agim-cli 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/cli-ui/i18n.d.ts +2 -2
- package/dist/cli-ui/i18n.js +4 -4
- package/dist/cli-ui/i18n.js.map +1 -1
- package/dist/cli-ui/setup-llm.js +1 -1
- package/dist/cli-ui/setup-llm.js.map +1 -1
- package/dist/cli-ui/tui/app.d.ts +4 -1
- package/dist/cli-ui/tui/app.d.ts.map +1 -1
- package/dist/cli-ui/tui/app.js +229 -6
- package/dist/cli-ui/tui/app.js.map +1 -1
- package/dist/cli-ui/tui/approval-bridge.d.ts +61 -0
- package/dist/cli-ui/tui/approval-bridge.d.ts.map +1 -0
- package/dist/cli-ui/tui/approval-bridge.js +274 -0
- package/dist/cli-ui/tui/approval-bridge.js.map +1 -0
- package/dist/cli-ui/tui/index.d.ts.map +1 -1
- package/dist/cli-ui/tui/index.js +31 -0
- package/dist/cli-ui/tui/index.js.map +1 -1
- package/dist/core/agent-cwd.js +1 -1
- package/dist/core/ask-user-rpc.d.ts +36 -14
- package/dist/core/ask-user-rpc.d.ts.map +1 -1
- package/dist/core/ask-user-rpc.js +309 -34
- package/dist/core/ask-user-rpc.js.map +1 -1
- package/dist/core/commands/builtin.d.ts.map +1 -1
- package/dist/core/commands/builtin.js +15 -6
- package/dist/core/commands/builtin.js.map +1 -1
- package/dist/core/llm/imhub-dispatcher.d.ts.map +1 -1
- package/dist/core/llm/imhub-dispatcher.js +6 -1
- package/dist/core/llm/imhub-dispatcher.js.map +1 -1
- package/dist/core/onboarding.js +2 -2
- package/dist/core/onboarding.js.map +1 -1
- package/dist/core/router.d.ts.map +1 -1
- package/dist/core/router.js +12 -9
- package/dist/core/router.js.map +1 -1
- package/dist/core/types.d.ts +6 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/plugins/agents/claude-code/mcp-approval-server.d.ts +4 -0
- package/dist/plugins/agents/claude-code/mcp-approval-server.d.ts.map +1 -1
- package/dist/plugins/agents/claude-code/mcp-approval-server.js +11 -6
- package/dist/plugins/agents/claude-code/mcp-approval-server.js.map +1 -1
- package/dist/plugins/agents/native/index.js +8 -8
- package/dist/plugins/agents/native/index.js.map +1 -1
- package/dist/plugins/agents/pi-native/factory.d.ts.map +1 -1
- package/dist/plugins/agents/pi-native/factory.js +4 -3
- package/dist/plugins/agents/pi-native/factory.js.map +1 -1
- package/dist/web/llm-api.js +7 -4
- package/dist/web/llm-api.js.map +1 -1
- package/dist/web/public/assets/{a2a-Dtc6AKjx.js → a2a-Y30Sn8pc.js} +2 -2
- package/dist/web/public/assets/{a2a-Dtc6AKjx.js.map → a2a-Y30Sn8pc.js.map} +1 -1
- package/dist/web/public/assets/{activity-CWFI_ke7.js → activity--oN7qxFJ.js} +2 -2
- package/dist/web/public/assets/{activity-CWFI_ke7.js.map → activity--oN7qxFJ.js.map} +1 -1
- package/dist/web/public/assets/{admins-CeQorJdU.js → admins-DONiT3ld.js} +2 -2
- package/dist/web/public/assets/{admins-CeQorJdU.js.map → admins-DONiT3ld.js.map} +1 -1
- package/dist/web/public/assets/agents-DRbQOH0K.js +7 -0
- package/dist/web/public/assets/agents-DRbQOH0K.js.map +1 -0
- package/dist/web/public/assets/{approvals-BEPKSyrL.js → approvals-C5jd7Wf9.js} +2 -2
- package/dist/web/public/assets/{approvals-BEPKSyrL.js.map → approvals-C5jd7Wf9.js.map} +1 -1
- package/dist/web/public/assets/{arrow-down-CzWGZc48.js → arrow-down-x-Lq92tn.js} +2 -2
- package/dist/web/public/assets/{arrow-down-CzWGZc48.js.map → arrow-down-x-Lq92tn.js.map} +1 -1
- package/dist/web/public/assets/{arrow-up-CXy94NPi.js → arrow-up-Cc28qbjN.js} +2 -2
- package/dist/web/public/assets/{arrow-up-CXy94NPi.js.map → arrow-up-Cc28qbjN.js.map} +1 -1
- package/dist/web/public/assets/{asks-BszsbhPn.js → asks-CeVcu8SD.js} +2 -2
- package/dist/web/public/assets/{asks-BszsbhPn.js.map → asks-CeVcu8SD.js.map} +1 -1
- package/dist/web/public/assets/{audit-ACrwMizd.js → audit-Dc9_FDkW.js} +2 -2
- package/dist/web/public/assets/{audit-ACrwMizd.js.map → audit-Dc9_FDkW.js.map} +1 -1
- package/dist/web/public/assets/{bell-BLwNOhXO.js → bell-CxPf_Xzs.js} +2 -2
- package/dist/web/public/assets/{bell-BLwNOhXO.js.map → bell-CxPf_Xzs.js.map} +1 -1
- package/dist/web/public/assets/{bgjobs-Cwp0PmTF.js → bgjobs-CYjmAJgs.js} +2 -2
- package/dist/web/public/assets/{bgjobs-Cwp0PmTF.js.map → bgjobs-CYjmAJgs.js.map} +1 -1
- package/dist/web/public/assets/{brain-5AJBYzXX.js → brain-DjCfwBAT.js} +2 -2
- package/dist/web/public/assets/{brain-5AJBYzXX.js.map → brain-DjCfwBAT.js.map} +1 -1
- package/dist/web/public/assets/{briefcase-BTDurkZz.js → briefcase-Br1bd_VG.js} +2 -2
- package/dist/web/public/assets/{briefcase-BTDurkZz.js.map → briefcase-Br1bd_VG.js.map} +1 -1
- package/dist/web/public/assets/chat-uqxuXn2X.js +17 -0
- package/dist/web/public/assets/chat-uqxuXn2X.js.map +1 -0
- package/dist/web/public/assets/{chevron-left-CnLOhWHE.js → chevron-left-CN-4SIfi.js} +2 -2
- package/dist/web/public/assets/{chevron-left-CnLOhWHE.js.map → chevron-left-CN-4SIfi.js.map} +1 -1
- package/dist/web/public/assets/{chevron-right-CpWYrqTa.js → chevron-right-BhSTLH2K.js} +2 -2
- package/dist/web/public/assets/{chevron-right-CpWYrqTa.js.map → chevron-right-BhSTLH2K.js.map} +1 -1
- package/dist/web/public/assets/{circle-check-DhcTh_uP.js → circle-check-B4UdHmdJ.js} +2 -2
- package/dist/web/public/assets/{circle-check-DhcTh_uP.js.map → circle-check-B4UdHmdJ.js.map} +1 -1
- package/dist/web/public/assets/{circle-check-big-CcknUEHz.js → circle-check-big-CvXnDqiF.js} +2 -2
- package/dist/web/public/assets/{circle-check-big-CcknUEHz.js.map → circle-check-big-CvXnDqiF.js.map} +1 -1
- package/dist/web/public/assets/{circle-x-QODE2UcL.js → circle-x-B8y8mLHr.js} +2 -2
- package/dist/web/public/assets/{circle-x-QODE2UcL.js.map → circle-x-B8y8mLHr.js.map} +1 -1
- package/dist/web/public/assets/{clock-BPBx4QWT.js → clock-CK2KO_Rc.js} +2 -2
- package/dist/web/public/assets/{clock-BPBx4QWT.js.map → clock-CK2KO_Rc.js.map} +1 -1
- package/dist/web/public/assets/{confirm-dialog-HsyBgWxC.js → confirm-dialog-GZyIzSwj.js} +2 -2
- package/dist/web/public/assets/{confirm-dialog-HsyBgWxC.js.map → confirm-dialog-GZyIzSwj.js.map} +1 -1
- package/dist/web/public/assets/{copy-VJNELMp7.js → copy-CDCgL5Yq.js} +2 -2
- package/dist/web/public/assets/{copy-VJNELMp7.js.map → copy-CDCgL5Yq.js.map} +1 -1
- package/dist/web/public/assets/{data-table-C0yaCeSS.js → data-table-1cGunUIX.js} +2 -2
- package/dist/web/public/assets/{data-table-C0yaCeSS.js.map → data-table-1cGunUIX.js.map} +1 -1
- package/dist/web/public/assets/{download-EUh-RXv5.js → download-CuLP0G-q.js} +2 -2
- package/dist/web/public/assets/{download-EUh-RXv5.js.map → download-CuLP0G-q.js.map} +1 -1
- package/dist/web/public/assets/{email-YUzrp4Tf.js → email-Q-SY9qC9.js} +2 -2
- package/dist/web/public/assets/{email-YUzrp4Tf.js.map → email-Q-SY9qC9.js.map} +1 -1
- package/dist/web/public/assets/{empty-state-DoiBKL4l.js → empty-state-BRsb30K6.js} +2 -2
- package/dist/web/public/assets/{empty-state-DoiBKL4l.js.map → empty-state-BRsb30K6.js.map} +1 -1
- package/dist/web/public/assets/{external-link-Bf2430Ji.js → external-link-D-E90Kfw.js} +2 -2
- package/dist/web/public/assets/{external-link-Bf2430Ji.js.map → external-link-D-E90Kfw.js.map} +1 -1
- package/dist/web/public/assets/{eye-vE4k-Us-.js → eye-DSu_4mW2.js} +2 -2
- package/dist/web/public/assets/{eye-vE4k-Us-.js.map → eye-DSu_4mW2.js.map} +1 -1
- package/dist/web/public/assets/{facts-BPVTGzM4.js → facts-pmGTfGmv.js} +2 -2
- package/dist/web/public/assets/{facts-BPVTGzM4.js.map → facts-pmGTfGmv.js.map} +1 -1
- package/dist/web/public/assets/goals-DpRm9-av.js +17 -0
- package/dist/web/public/assets/goals-DpRm9-av.js.map +1 -0
- package/dist/web/public/assets/{health-CSMAArAj.js → health-mqoH7KDV.js} +2 -2
- package/dist/web/public/assets/{health-CSMAArAj.js.map → health-mqoH7KDV.js.map} +1 -1
- package/dist/web/public/assets/{heart-pulse-8RDC8GWv.js → heart-pulse-CrCHhXtC.js} +2 -2
- package/dist/web/public/assets/{heart-pulse-8RDC8GWv.js.map → heart-pulse-CrCHhXtC.js.map} +1 -1
- package/dist/web/public/assets/{heartbeat-BzHZy7Mx.js → heartbeat-EGjLHWU0.js} +2 -2
- package/dist/web/public/assets/{heartbeat-BzHZy7Mx.js.map → heartbeat-EGjLHWU0.js.map} +1 -1
- package/dist/web/public/assets/hot-B9x1_5yx.js +12 -0
- package/dist/web/public/assets/hot-B9x1_5yx.js.map +1 -0
- package/dist/web/public/assets/index-BIBWEKxu.js +204 -0
- package/dist/web/public/assets/index-BIBWEKxu.js.map +1 -0
- package/dist/web/public/assets/{injection-a2kkgRbT.js → injection-CDx5n-mk.js} +2 -2
- package/dist/web/public/assets/{injection-a2kkgRbT.js.map → injection-CDx5n-mk.js.map} +1 -1
- package/dist/web/public/assets/{installed-XQQEPKh8.js → installed-DV7X4wfv.js} +5 -5
- package/dist/web/public/assets/{installed-XQQEPKh8.js.map → installed-DV7X4wfv.js.map} +1 -1
- package/dist/web/public/assets/{jobs-Cby1Eq4o.js → jobs-zAigElCl.js} +2 -2
- package/dist/web/public/assets/{jobs-Cby1Eq4o.js.map → jobs-zAigElCl.js.map} +1 -1
- package/dist/web/public/assets/{layout-BdtJtlu5.js → layout-7wcifbsm.js} +2 -2
- package/dist/web/public/assets/{layout-BdtJtlu5.js.map → layout-7wcifbsm.js.map} +1 -1
- package/dist/web/public/assets/{layout-BRnEPnky.js → layout-B0RjH6M2.js} +2 -2
- package/dist/web/public/assets/{layout-BRnEPnky.js.map → layout-B0RjH6M2.js.map} +1 -1
- package/dist/web/public/assets/{layout-Gh29ouFO.js → layout-C6q-GbBZ.js} +2 -2
- package/dist/web/public/assets/{layout-Gh29ouFO.js.map → layout-C6q-GbBZ.js.map} +1 -1
- package/dist/web/public/assets/layout-CzjqlPxW.js +2 -0
- package/dist/web/public/assets/layout-CzjqlPxW.js.map +1 -0
- package/dist/web/public/assets/{layout-CbqldDRj.js → layout-DOSpVfND.js} +2 -2
- package/dist/web/public/assets/{layout-CbqldDRj.js.map → layout-DOSpVfND.js.map} +1 -1
- package/dist/web/public/assets/llm-DwZX5fwY.js +27 -0
- package/dist/web/public/assets/llm-DwZX5fwY.js.map +1 -0
- package/dist/web/public/assets/{loader-circle-DO3Ni2RJ.js → loader-circle-BQkLEJZw.js} +2 -2
- package/dist/web/public/assets/{loader-circle-DO3Ni2RJ.js.map → loader-circle-BQkLEJZw.js.map} +1 -1
- package/dist/web/public/assets/{map-pin-BsL35E1s.js → map-pin-B-IMY07m.js} +2 -2
- package/dist/web/public/assets/{map-pin-BsL35E1s.js.map → map-pin-B-IMY07m.js.map} +1 -1
- package/dist/web/public/assets/{mcp-CWMdxcBf.js → mcp-K0P3-b6q.js} +2 -2
- package/dist/web/public/assets/{mcp-CWMdxcBf.js.map → mcp-K0P3-b6q.js.map} +1 -1
- package/dist/web/public/assets/{memos-BYQa4d2t.js → memos-DcpDEVN8.js} +2 -2
- package/dist/web/public/assets/{memos-BYQa4d2t.js.map → memos-DcpDEVN8.js.map} +1 -1
- package/dist/web/public/assets/{messengers-CebazAJ1.js → messengers-DmrNvPMS.js} +2 -2
- package/dist/web/public/assets/{messengers-CebazAJ1.js.map → messengers-DmrNvPMS.js.map} +1 -1
- package/dist/web/public/assets/{mobile-CMJRNHs2.js → mobile-a-oUiAoR.js} +2 -2
- package/dist/web/public/assets/{mobile-CMJRNHs2.js.map → mobile-a-oUiAoR.js.map} +1 -1
- package/dist/web/public/assets/{network-pNcx_slv.js → network-Bbh3j5ew.js} +2 -2
- package/dist/web/public/assets/{network-pNcx_slv.js.map → network-Bbh3j5ew.js.map} +1 -1
- package/dist/web/public/assets/{outbox-87hzZQLn.js → outbox-BP_hfANb.js} +2 -2
- package/dist/web/public/assets/{outbox-87hzZQLn.js.map → outbox-BP_hfANb.js.map} +1 -1
- package/dist/web/public/assets/{pagination-C4edFAqf.js → pagination-CPLj3V0r.js} +2 -2
- package/dist/web/public/assets/{pagination-C4edFAqf.js.map → pagination-CPLj3V0r.js.map} +1 -1
- package/dist/web/public/assets/{persona-BcOT3Wms.js → persona-CT38dLd4.js} +2 -2
- package/dist/web/public/assets/{persona-BcOT3Wms.js.map → persona-CT38dLd4.js.map} +1 -1
- package/dist/web/public/assets/plans-Msw85XkI.js +12 -0
- package/dist/web/public/assets/plans-Msw85XkI.js.map +1 -0
- package/dist/web/public/assets/{play-Bzdymasn.js → play-tH2nb1Kt.js} +2 -2
- package/dist/web/public/assets/{play-Bzdymasn.js.map → play-tH2nb1Kt.js.map} +1 -1
- package/dist/web/public/assets/{plus-BxjzY9Wh.js → plus-6MNGQidu.js} +2 -2
- package/dist/web/public/assets/{plus-BxjzY9Wh.js.map → plus-6MNGQidu.js.map} +1 -1
- package/dist/web/public/assets/{policy-Be-tMZZc.js → policy-BJ7zORVG.js} +2 -2
- package/dist/web/public/assets/{policy-Be-tMZZc.js.map → policy-BJ7zORVG.js.map} +1 -1
- package/dist/web/public/assets/{qr-code-D1V5cA_X.js → qr-code-DfsxFxoa.js} +2 -2
- package/dist/web/public/assets/{qr-code-D1V5cA_X.js.map → qr-code-DfsxFxoa.js.map} +1 -1
- package/dist/web/public/assets/{refresh-ccw-BhPAzZAa.js → refresh-ccw-CFPE6zD1.js} +2 -2
- package/dist/web/public/assets/{refresh-ccw-BhPAzZAa.js.map → refresh-ccw-CFPE6zD1.js.map} +1 -1
- package/dist/web/public/assets/{reminders-DEWtrlH_.js → reminders-CAUNAuDy.js} +2 -2
- package/dist/web/public/assets/{reminders-DEWtrlH_.js.map → reminders-CAUNAuDy.js.map} +1 -1
- package/dist/web/public/assets/{save-Cye8Vlu5.js → save-CNUmUMEf.js} +2 -2
- package/dist/web/public/assets/{save-Cye8Vlu5.js.map → save-CNUmUMEf.js.map} +1 -1
- package/dist/web/public/assets/{schedules-CuqRy3t8.js → schedules-C25NyoGh.js} +2 -2
- package/dist/web/public/assets/{schedules-CuqRy3t8.js.map → schedules-C25NyoGh.js.map} +1 -1
- package/dist/web/public/assets/{search-Dot_W5Eu.js → search-CaRTqZw1.js} +2 -2
- package/dist/web/public/assets/{search-Dot_W5Eu.js.map → search-CaRTqZw1.js.map} +1 -1
- package/dist/web/public/assets/{search-BQqVArrW.js → search-D9TZs0bG.js} +2 -2
- package/dist/web/public/assets/{search-BQqVArrW.js.map → search-D9TZs0bG.js.map} +1 -1
- package/dist/web/public/assets/{security-BB-YnetQ.js → security-BMGGzEwr.js} +2 -2
- package/dist/web/public/assets/{security-BB-YnetQ.js.map → security-BMGGzEwr.js.map} +1 -1
- package/dist/web/public/assets/{service-DgkqlAtM.js → service-BQBoddcT.js} +2 -2
- package/dist/web/public/assets/{service-DgkqlAtM.js.map → service-BQBoddcT.js.map} +1 -1
- package/dist/web/public/assets/{shield-alert-CBOmgn9W.js → shield-alert-eOBoc2yc.js} +2 -2
- package/dist/web/public/assets/{shield-alert-CBOmgn9W.js.map → shield-alert-eOBoc2yc.js.map} +1 -1
- package/dist/web/public/assets/{status-badge-9sMFH4uP.js → status-badge-CF1Cya26.js} +2 -2
- package/dist/web/public/assets/{status-badge-9sMFH4uP.js.map → status-badge-CF1Cya26.js.map} +1 -1
- package/dist/web/public/assets/{subtasks-BrqdQxw_.js → subtasks-CEPB2TSV.js} +2 -2
- package/dist/web/public/assets/{subtasks-BrqdQxw_.js.map → subtasks-CEPB2TSV.js.map} +1 -1
- package/dist/web/public/assets/{table-CSHCu7pz.js → table-Dww-k14l.js} +2 -2
- package/dist/web/public/assets/{table-CSHCu7pz.js.map → table-Dww-k14l.js.map} +1 -1
- package/dist/web/public/assets/{topn-DZWbwDge.js → topn-DwgKlIxc.js} +2 -2
- package/dist/web/public/assets/{topn-DZWbwDge.js.map → topn-DwgKlIxc.js.map} +1 -1
- package/dist/web/public/assets/{trash-2-Cco09tAA.js → trash-2-BF98SY8M.js} +2 -2
- package/dist/web/public/assets/{trash-2-Cco09tAA.js.map → trash-2-BF98SY8M.js.map} +1 -1
- package/dist/web/public/assets/{use-agim-skills-CJOJKeOZ.js → use-agim-skills-kDpiSMBP.js} +2 -2
- package/dist/web/public/assets/{use-agim-skills-CJOJKeOZ.js.map → use-agim-skills-kDpiSMBP.js.map} +1 -1
- package/dist/web/public/assets/{use-background-tasks-D77bcfrq.js → use-background-tasks-B1Pxq3JU.js} +2 -2
- package/dist/web/public/assets/{use-background-tasks-D77bcfrq.js.map → use-background-tasks-B1Pxq3JU.js.map} +1 -1
- package/dist/web/public/assets/{use-memory-CX4B1SYC.js → use-memory-w-EY79Zm.js} +2 -2
- package/dist/web/public/assets/{use-memory-CX4B1SYC.js.map → use-memory-w-EY79Zm.js.map} +1 -1
- package/dist/web/public/assets/{use-observability-rcc7fRmj.js → use-observability-Cd2dUHb7.js} +2 -2
- package/dist/web/public/assets/{use-observability-rcc7fRmj.js.map → use-observability-Cd2dUHb7.js.map} +1 -1
- package/dist/web/public/assets/{use-settings-DQnJkPXp.js → use-settings-DG1rm9KU.js} +2 -2
- package/dist/web/public/assets/{use-settings-DQnJkPXp.js.map → use-settings-DG1rm9KU.js.map} +1 -1
- package/dist/web/public/assets/{use-workspace-J5eeVxw9.js → use-workspace-DvW_xOmj.js} +2 -2
- package/dist/web/public/assets/{use-workspace-J5eeVxw9.js.map → use-workspace-DvW_xOmj.js.map} +1 -1
- package/dist/web/public/assets/{vector-xRphJ8hW.js → vector-CDJ4p6UI.js} +2 -2
- package/dist/web/public/assets/{vector-xRphJ8hW.js.map → vector-CDJ4p6UI.js.map} +1 -1
- package/dist/web/public/assets/{viewer-Bq7l2kE8.js → viewer-Bje5-HtQ.js} +2 -2
- package/dist/web/public/assets/{viewer-Bq7l2kE8.js.map → viewer-Bje5-HtQ.js.map} +1 -1
- package/dist/web/public/assets/workspace-B7QYGLix.js +17 -0
- package/dist/web/public/assets/workspace-B7QYGLix.js.map +1 -0
- package/dist/web/public/assets/{workspaces-D0pYJfxI.js → workspaces-BlodF0DP.js} +2 -2
- package/dist/web/public/assets/{workspaces-D0pYJfxI.js.map → workspaces-BlodF0DP.js.map} +1 -1
- package/dist/web/public/index.html +2 -2
- package/dist/web/server.js +2 -2
- package/dist/web/server.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/public/assets/agents-DnJruPrS.js +0 -7
- package/dist/web/public/assets/agents-DnJruPrS.js.map +0 -1
- package/dist/web/public/assets/chat-D7jjr-Rn.js +0 -17
- package/dist/web/public/assets/chat-D7jjr-Rn.js.map +0 -1
- package/dist/web/public/assets/goals-HsKzf-PG.js +0 -17
- package/dist/web/public/assets/goals-HsKzf-PG.js.map +0 -1
- package/dist/web/public/assets/hot-DkFvD3H4.js +0 -12
- package/dist/web/public/assets/hot-DkFvD3H4.js.map +0 -1
- package/dist/web/public/assets/index-D7BuMEIr.js +0 -204
- package/dist/web/public/assets/index-D7BuMEIr.js.map +0 -1
- package/dist/web/public/assets/layout-0rDvqHCV.js +0 -2
- package/dist/web/public/assets/layout-0rDvqHCV.js.map +0 -1
- package/dist/web/public/assets/llm-COWnMdB9.js +0 -7
- package/dist/web/public/assets/llm-COWnMdB9.js.map +0 -1
- package/dist/web/public/assets/native-agent-MGgMeTHN.js +0 -22
- package/dist/web/public/assets/native-agent-MGgMeTHN.js.map +0 -1
- package/dist/web/public/assets/plans-Ddz5qwqp.js +0 -12
- package/dist/web/public/assets/plans-Ddz5qwqp.js.map +0 -1
- package/dist/web/public/assets/workspace-BqMuxPFF.js +0 -17
- package/dist/web/public/assets/workspace-BqMuxPFF.js.map +0 -1
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/layout-BRnEPnky.js","assets/react-DlP5eolq.js","assets/jobs-Cby1Eq4o.js","assets/data-table-C0yaCeSS.js","assets/table-CSHCu7pz.js","assets/empty-state-DoiBKL4l.js","assets/arrow-up-CXy94NPi.js","assets/arrow-down-CzWGZc48.js","assets/status-badge-9sMFH4uP.js","assets/pagination-C4edFAqf.js","assets/chevron-left-CnLOhWHE.js","assets/chevron-right-CpWYrqTa.js","assets/confirm-dialog-HsyBgWxC.js","assets/use-event-stream-I1lMFEfh.js","assets/loader-circle-DO3Ni2RJ.js","assets/refresh-ccw-BhPAzZAa.js","assets/circle-x-QODE2UcL.js","assets/briefcase-BTDurkZz.js","assets/subtasks-BrqdQxw_.js","assets/bgjobs-Cwp0PmTF.js","assets/schedules-CuqRy3t8.js","assets/outbox-87hzZQLn.js","assets/a2a-Dtc6AKjx.js","assets/heartbeat-BzHZy7Mx.js","assets/use-background-tasks-D77bcfrq.js","assets/heart-pulse-8RDC8GWv.js","assets/play-Bzdymasn.js","assets/goals-HsKzf-PG.js","assets/circle-check-DhcTh_uP.js","assets/asks-BszsbhPn.js","assets/plans-Ddz5qwqp.js","assets/clock-BPBx4QWT.js","assets/approvals-BEPKSyrL.js","assets/reminders-DEWtrlH_.js","assets/bell-BLwNOhXO.js","assets/memos-BYQa4d2t.js","assets/trash-2-Cco09tAA.js","assets/search-BQqVArrW.js","assets/map-pin-BsL35E1s.js","assets/layout-Gh29ouFO.js","assets/use-memory-CX4B1SYC.js","assets/facts-BPVTGzM4.js","assets/brain-5AJBYzXX.js","assets/persona-BcOT3Wms.js","assets/circle-check-big-CcknUEHz.js","assets/vector-xRphJ8hW.js","assets/use-settings-DQnJkPXp.js","assets/save-Cye8Vlu5.js","assets/eye-vE4k-Us-.js","assets/download-EUh-RXv5.js","assets/workspace-BqMuxPFF.js","assets/use-workspace-J5eeVxw9.js","assets/layout-BdtJtlu5.js","assets/health-CSMAArAj.js","assets/use-observability-rcc7fRmj.js","assets/activity-CWFI_ke7.js","assets/topn-DZWbwDge.js","assets/audit-ACrwMizd.js","assets/layout-0rDvqHCV.js","assets/messengers-CebazAJ1.js","assets/qr-code-D1V5cA_X.js","assets/email-YUzrp4Tf.js","assets/viewer-Bq7l2kE8.js","assets/external-link-Bf2430Ji.js","assets/agents-DnJruPrS.js","assets/network-pNcx_slv.js","assets/plus-BxjzY9Wh.js","assets/policy-Be-tMZZc.js","assets/security-BB-YnetQ.js","assets/shield-alert-CBOmgn9W.js","assets/service-DgkqlAtM.js","assets/admins-CeQorJdU.js","assets/workspaces-D0pYJfxI.js","assets/llm-COWnMdB9.js","assets/mcp-CWMdxcBf.js","assets/native-agent-MGgMeTHN.js","assets/search-Dot_W5Eu.js","assets/mobile-CMJRNHs2.js","assets/copy-VJNELMp7.js","assets/layout-CbqldDRj.js","assets/installed-XQQEPKh8.js","assets/use-agim-skills-CJOJKeOZ.js","assets/hot-DkFvD3H4.js","assets/injection-a2kkgRbT.js","assets/chat-D7jjr-Rn.js","assets/browser-ponyfill-DBWdeCTC.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as g,a as Pr,R as wo,b as mm,c as W,v as gm,d as Qi,g as md}from"./react-DlP5eolq.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var gd={exports:{}},ko={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.min.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var ym=g,vm=Symbol.for("react.element"),bm=Symbol.for("react.fragment"),xm=Object.prototype.hasOwnProperty,wm=ym.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,km={key:!0,ref:!0,__self:!0,__source:!0};function yd(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)xm.call(t,r)&&!km.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:vm,type:e,key:o,ref:a,props:i,_owner:wm.current}}ko.Fragment=bm;ko.jsx=yd;ko.jsxs=yd;gd.exports=ko;var y=gd.exports,Ra={},Rl=Pr;Ra.createRoot=Rl.createRoot,Ra.hydrateRoot=Rl.hydrateRoot;const Sm="modulepreload",Cm=function(e){return"/"+e},Tl={},fe=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),s=a?.nonce||a?.getAttribute("nonce");i=Promise.allSettled(n.map(l=>{if(l=Cm(l),l in Tl)return;Tl[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":Sm,c||(d.as="script"),d.crossOrigin="",d.href=l,s&&d.setAttribute("nonce",s),document.head.appendChild(d),c)return new Promise((h,f)=>{d.addEventListener("load",h),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return i.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};/**
|
|
11
|
-
* @remix-run/router v1.23.3
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Remix Software Inc.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
17
|
-
*
|
|
18
|
-
* @license MIT
|
|
19
|
-
*/function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},He.apply(null,arguments)}var Qe;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qe||(Qe={}));const Pl="popstate";function Em(e){e===void 0&&(e={});function t(r,i){let{pathname:o,search:a,hash:s}=r.location;return oi("",{pathname:o,search:a,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Gn(i)}return Rm(t,n,null,e)}function xe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Am(){return Math.random().toString(36).substr(2,8)}function Il(e,t){return{usr:e.state,key:e.key,idx:t}}function oi(e,t,n,r){return n===void 0&&(n=null),He({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?En(t):t,{state:n,key:t&&t.key||r||Am()})}function Gn(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function En(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Rm(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=Qe.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(He({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){s=Qe.Pop;let v=u(),b=v==null?null:v-c;c=v,l&&l({action:s,location:p.location,delta:b})}function h(v,b){s=Qe.Push;let x=oi(p.location,v,b);c=u()+1;let w=Il(x,c),A=p.createHref(x);try{a.pushState(w,"",A)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(A)}o&&l&&l({action:s,location:p.location,delta:1})}function f(v,b){s=Qe.Replace;let x=oi(p.location,v,b);c=u();let w=Il(x,c),A=p.createHref(x);a.replaceState(w,"",A),o&&l&&l({action:s,location:p.location,delta:0})}function m(v){let b=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof v=="string"?v:Gn(v);return x=x.replace(/ $/,"%20"),xe(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let p={get action(){return s},get location(){return e(i,a)},listen(v){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Pl,d),l=v,()=>{i.removeEventListener(Pl,d),l=null}},createHref(v){return t(i,v)},createURL:m,encodeLocation(v){let b=m(v);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:f,go(v){return a.go(v)}};return p}var _e;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(_e||(_e={}));const Tm=new Set(["lazy","caseSensitive","path","id","index","children"]);function Pm(e){return e.index===!0}function Yi(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let a=[...n,String(o)],s=typeof i.id=="string"?i.id:a.join("-");if(xe(i.index!==!0||!i.children,"Cannot specify children on an index route"),xe(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Pm(i)){let l=He({},i,t(i),{id:s});return r[s]=l,l}else{let l=He({},i,t(i),{id:s,children:void 0});return r[s]=l,i.children&&(l.children=Yi(i.children,t,a,r)),l}})}function Un(e,t,n){return n===void 0&&(n="/"),zi(e,t,n,!1)}function zi(e,t,n,r){let i=typeof t=="string"?En(t):t,o=on(i.pathname||"/",n);if(o==null)return null;let a=vd(e);Lm(a);let s=null,l=zm(o);for(let c=0;s==null&&c<a.length;++c)s=Hm(a[c],l,r);return s}function Im(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function vd(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(o,a,s)=>{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(xe(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=rn([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(xe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),vd(o.children,t,u,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:Fm(c,o.index),routesMeta:u})};return e.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let l of bd(o.path))i(o,a,l)}),t}function bd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=bd(r.join("/")),s=[];return s.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function Lm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Um(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Om=/^:[\w-]+$/,Nm=3,_m=2,Dm=1,Mm=10,jm=-2,Ll=e=>e==="*";function Fm(e,t){let n=e.split("/"),r=n.length;return n.some(Ll)&&(r+=jm),t&&(r+=_m),n.filter(i=>!Ll(i)).reduce((i,o)=>i+(Om.test(o)?Nm:o===""?Dm:Mm),r)}function Um(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Hm(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",a=[];for(let s=0;s<r.length;++s){let l=r[s],c=s===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=Xi({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),h=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Xi({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:rn([o,d.pathname]),pathnameBase:Wm(rn([o,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(o=rn([o,d.pathnameBase]))}return a}function Xi(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Bm(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((c,u,d)=>{let{paramName:h,isOptional:f}=u;if(h==="*"){let p=s[d]||"";a=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}const m=s[d];return f&&!m?c[h]=void 0:c[h]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:e}}function Bm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),qn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function zm(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return qn(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function on(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const $m=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vm=e=>$m.test(e);function Km(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?En(e):e,o;if(n)if(Vm(n))o=n;else{if(n.includes("//")){let a=n;n=vs(n),qn(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?o=Ol(n.substring(1),"/"):o=Ol(n,t)}else o=t;return{pathname:o,search:qm(r),hash:Gm(i)}}function Ol(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Xo(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function xd(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function So(e,t){let n=xd(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Co(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=En(e):(i=He({},e),xe(!i.pathname||!i.pathname.includes("?"),Xo("?","pathname","search",i)),xe(!i.pathname||!i.pathname.includes("#"),Xo("#","pathname","hash",i)),xe(!i.search||!i.search.includes("#"),Xo("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}s=d>=0?t[d]:"/"}let l=Km(i,s),c=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const vs=e=>e.replace(/\/\/+/g,"/"),rn=e=>vs(e.join("/")),Wm=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qm=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Gm=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Ji{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ai(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const wd=["post","put","patch","delete"],Qm=new Set(wd),Ym=["get",...wd],Xm=new Set(Ym),Jm=new Set([301,302,303,307,308]),Zm=new Set([307,308]),Jo={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},eg={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$r={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},bs=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tg=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),kd="remix-router-transitions";function ng(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;xe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let T=e.detectErrorBoundary;i=I=>({hasErrorBoundary:T(I)})}else i=tg;let o={},a=Yi(e.routes,i,void 0,o),s,l=e.basename||"/",c=e.dataStrategy||ag,u=e.patchRoutesOnNavigation,d=He({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,f=new Set,m=null,p=null,v=null,b=e.hydrationData!=null,x=Un(a,e.history.location,l),w=!1,A=null;if(x==null&&!u){let T=gt(404,{pathname:e.history.location.pathname}),{matches:I,route:O}=$l(a);x=I,A={[O.id]:T}}x&&!e.hydrationData&&Ne(x,a,e.history.location.pathname).active&&(x=null);let P;if(x)if(x.some(T=>T.route.lazy))P=!1;else if(!x.some(T=>T.route.loader))P=!0;else if(d.v7_partialHydration){let T=e.hydrationData?e.hydrationData.loaderData:null,I=e.hydrationData?e.hydrationData.errors:null;if(I){let O=x.findIndex(j=>I[j.route.id]!==void 0);P=x.slice(0,O+1).every(j=>!Pa(j.route,T,I))}else P=x.every(O=>!Pa(O.route,T,I))}else P=e.hydrationData!=null;else if(P=!1,x=[],d.v7_partialHydration){let T=Ne(null,a,e.history.location.pathname);T.active&&T.matches&&(w=!0,x=T.matches)}let E,k={historyAction:e.history.action,location:e.history.location,matches:x,initialized:P,navigation:Jo,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||A,fetchers:new Map,blockers:new Map},N=Qe.Pop,M=!1,R,_=!1,L=new Map,z=null,U=!1,$=!1,Q=[],Y=new Set,V=new Map,F=0,S=-1,ie=new Map,Z=new Set,C=new Map,ae=new Map,me=new Set,ve=new Map,q=new Map,he;function Pe(){if(h=e.history.listen(T=>{let{action:I,location:O,delta:j}=T;if(he){he(),he=void 0;return}qn(q.size===0||j!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let G=Fr({currentLocation:k.location,nextLocation:O,historyAction:I});if(G&&j!=null){let re=new Promise(le=>{he=le});e.history.go(j*-1),_n(G,{state:"blocked",location:O,proceed(){_n(G,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),re.then(()=>e.history.go(j))},reset(){let le=new Map(k.blockers);le.set(G,$r),pe({blockers:le})}});return}return tt(I,O)}),n){xg(t,L);let T=()=>wg(t,L);t.addEventListener("pagehide",T),z=()=>t.removeEventListener("pagehide",T)}return k.initialized||tt(Qe.Pop,k.location,{initialHydration:!0}),E}function be(){h&&h(),z&&z(),f.clear(),R&&R.abort(),k.fetchers.forEach((T,I)=>Ze(I)),k.blockers.forEach((T,I)=>pt(I))}function ke(T){return f.add(T),()=>f.delete(T)}function pe(T,I){I===void 0&&(I={}),k=He({},k,T);let O=[],j=[];d.v7_fetcherPersist&&k.fetchers.forEach((G,re)=>{G.state==="idle"&&(me.has(re)?j.push(re):O.push(re))}),me.forEach(G=>{!k.fetchers.has(G)&&!V.has(G)&&j.push(G)}),[...f].forEach(G=>G(k,{deletedFetchers:j,viewTransitionOpts:I.viewTransitionOpts,flushSync:I.flushSync===!0})),d.v7_fetcherPersist?(O.forEach(G=>k.fetchers.delete(G)),j.forEach(G=>Ze(G))):j.forEach(G=>me.delete(G))}function We(T,I,O){var j,G;let{flushSync:re}=O===void 0?{}:O,le=k.actionData!=null&&k.navigation.formMethod!=null&&Nt(k.navigation.formMethod)&&k.navigation.state==="loading"&&((j=T.state)==null?void 0:j._isRedirect)!==!0,J;I.actionData?Object.keys(I.actionData).length>0?J=I.actionData:J=null:le?J=k.actionData:J=null;let ee=I.loaderData?Bl(k.loaderData,I.loaderData,I.matches||[],I.errors):k.loaderData,X=k.blockers;X.size>0&&(X=new Map(X),X.forEach((Ee,nt)=>X.set(nt,$r)));let te=M===!0||k.navigation.formMethod!=null&&Nt(k.navigation.formMethod)&&((G=T.state)==null?void 0:G._isRedirect)!==!0;s&&(a=s,s=void 0),U||N===Qe.Pop||(N===Qe.Push?e.history.push(T,T.state):N===Qe.Replace&&e.history.replace(T,T.state));let ge;if(N===Qe.Pop){let Ee=L.get(k.location.pathname);Ee&&Ee.has(T.pathname)?ge={currentLocation:k.location,nextLocation:T}:L.has(T.pathname)&&(ge={currentLocation:T,nextLocation:k.location})}else if(_){let Ee=L.get(k.location.pathname);Ee?Ee.add(T.pathname):(Ee=new Set([T.pathname]),L.set(k.location.pathname,Ee)),ge={currentLocation:k.location,nextLocation:T}}pe(He({},I,{actionData:J,loaderData:ee,historyAction:N,location:T,initialized:!0,navigation:Jo,revalidation:"idle",restoreScrollPosition:Ie(T,I.matches||k.matches),preventScrollReset:te,blockers:X}),{viewTransitionOpts:ge,flushSync:re===!0}),N=Qe.Pop,M=!1,_=!1,U=!1,$=!1,Q=[]}async function Ye(T,I){if(typeof T=="number"){e.history.go(T);return}let O=Ta(k.location,k.matches,l,d.v7_prependBasename,T,d.v7_relativeSplatPath,I?.fromRouteId,I?.relative),{path:j,submission:G,error:re}=Nl(d.v7_normalizeFormMethod,!1,O,I),le=k.location,J=oi(k.location,j,I&&I.state);J=He({},J,e.history.encodeLocation(J));let ee=I&&I.replace!=null?I.replace:void 0,X=Qe.Push;ee===!0?X=Qe.Replace:ee===!1||G!=null&&Nt(G.formMethod)&&G.formAction===k.location.pathname+k.location.search&&(X=Qe.Replace);let te=I&&"preventScrollReset"in I?I.preventScrollReset===!0:void 0,ge=(I&&I.flushSync)===!0,Ee=Fr({currentLocation:le,nextLocation:J,historyAction:X});if(Ee){_n(Ee,{state:"blocked",location:J,proceed(){_n(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),Ye(T,I)},reset(){let nt=new Map(k.blockers);nt.set(Ee,$r),pe({blockers:nt})}});return}return await tt(X,J,{submission:G,pendingError:re,preventScrollReset:te,replace:I&&I.replace,enableViewTransition:I&&I.viewTransition,flushSync:ge})}function Ft(){if(B(),pe({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){tt(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}tt(N||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:_===!0})}}async function tt(T,I,O){R&&R.abort(),R=null,N=T,U=(O&&O.startUninterruptedRevalidation)===!0,ce(k.location,k.matches),M=(O&&O.preventScrollReset)===!0,_=(O&&O.enableViewTransition)===!0;let j=s||a,G=O&&O.overrideNavigation,re=O!=null&&O.initialHydration&&k.matches&&k.matches.length>0&&!w?k.matches:Un(j,I,l),le=(O&&O.flushSync)===!0;if(re&&k.initialized&&!$&&fg(k.location,I)&&!(O&&O.submission&&Nt(O.submission.formMethod))){We(I,{matches:re},{flushSync:le});return}let J=Ne(re,j,I.pathname);if(J.active&&J.matches&&(re=J.matches),!re){let{error:Fe,notFoundMatches:Le,route:Ve}=Ur(I.pathname);We(I,{matches:Le,loaderData:{},errors:{[Ve.id]:Fe}},{flushSync:le});return}R=new AbortController;let ee=sr(e.history,I,R.signal,O&&O.submission),X;if(O&&O.pendingError)X=[Hn(re).route.id,{type:_e.error,error:O.pendingError}];else if(O&&O.submission&&Nt(O.submission.formMethod)){let Fe=await Ut(ee,I,O.submission,re,J.active,{replace:O.replace,flushSync:le});if(Fe.shortCircuited)return;if(Fe.pendingActionResult){let[Le,Ve]=Fe.pendingActionResult;if(wt(Ve)&&ai(Ve.error)&&Ve.error.status===404){R=null,We(I,{matches:Fe.matches,loaderData:{},errors:{[Le]:Ve.error}});return}}re=Fe.matches||re,X=Fe.pendingActionResult,G=Zo(I,O.submission),le=!1,J.active=!1,ee=sr(e.history,ee.url,ee.signal)}let{shortCircuited:te,matches:ge,loaderData:Ee,errors:nt}=await Ln(ee,I,re,J.active,G,O&&O.submission,O&&O.fetcherSubmission,O&&O.replace,O&&O.initialHydration===!0,le,X);te||(R=null,We(I,He({matches:ge||re},zl(X),{loaderData:Ee,errors:nt})))}async function Ut(T,I,O,j,G,re){re===void 0&&(re={}),B();let le=vg(I,O);if(pe({navigation:le},{flushSync:re.flushSync===!0}),G){let X=await it(j,I.pathname,T.signal);if(X.type==="aborted")return{shortCircuited:!0};if(X.type==="error"){let te=Hn(X.partialMatches).route.id;return{matches:X.partialMatches,pendingActionResult:[te,{type:_e.error,error:X.error}]}}else if(X.matches)j=X.matches;else{let{notFoundMatches:te,error:ge,route:Ee}=Ur(I.pathname);return{matches:te,pendingActionResult:[Ee.id,{type:_e.error,error:ge}]}}}let J,ee=Zr(j,I);if(!ee.route.action&&!ee.route.lazy)J={type:_e.error,error:gt(405,{method:T.method,pathname:I.pathname,routeId:ee.route.id})};else if(J=(await Zt("action",k,T,[ee],j,null))[ee.route.id],T.signal.aborted)return{shortCircuited:!0};if($n(J)){let X;return re&&re.replace!=null?X=re.replace:X=Fl(J.response.headers.get("Location"),new URL(T.url),l,e.history)===k.location.pathname+k.location.search,await Pt(T,J,!0,{submission:O,replace:X}),{shortCircuited:!0}}if(bn(J))throw gt(400,{type:"defer-action"});if(wt(J)){let X=Hn(j,ee.route.id);return(re&&re.replace)!==!0&&(N=Qe.Push),{matches:j,pendingActionResult:[X.route.id,J]}}return{matches:j,pendingActionResult:[ee.route.id,J]}}async function Ln(T,I,O,j,G,re,le,J,ee,X,te){let ge=G||Zo(I,re),Ee=re||le||Kl(ge),nt=!U&&(!d.v7_partialHydration||!ee);if(j){if(nt){let Ke=On(te);pe(He({navigation:ge},Ke!==void 0?{actionData:Ke}:{}),{flushSync:X})}let Te=await it(O,I.pathname,T.signal);if(Te.type==="aborted")return{shortCircuited:!0};if(Te.type==="error"){let Ke=Hn(Te.partialMatches).route.id;return{matches:Te.partialMatches,loaderData:{},errors:{[Ke]:Te.error}}}else if(Te.matches)O=Te.matches;else{let{error:Ke,notFoundMatches:or,route:zr}=Ur(I.pathname);return{matches:or,loaderData:{},errors:{[zr.id]:Ke}}}}let Fe=s||a,[Le,Ve]=Dl(e.history,k,O,Ee,I,d.v7_partialHydration&&ee===!0,d.v7_skipActionErrorRevalidation,$,Q,Y,me,C,Z,Fe,l,te);if(Dn(Te=>!(O&&O.some(Ke=>Ke.route.id===Te))||Le&&Le.some(Ke=>Ke.route.id===Te)),S=++F,Le.length===0&&Ve.length===0){let Te=It();return We(I,He({matches:O,loaderData:{},errors:te&&wt(te[1])?{[te[0]]:te[1].error}:null},zl(te),Te?{fetchers:new Map(k.fetchers)}:{}),{flushSync:X}),{shortCircuited:!0}}if(nt){let Te={};if(!j){Te.navigation=ge;let Ke=On(te);Ke!==void 0&&(Te.actionData=Ke)}Ve.length>0&&(Te.fetchers=Nn(Ve)),pe(Te,{flushSync:X})}Ve.forEach(Te=>{$e(Te.key),Te.controller&&V.set(Te.key,Te.controller)});let ir=()=>Ve.forEach(Te=>$e(Te.key));R&&R.signal.addEventListener("abort",ir);let{loaderResults:Hr,fetcherResults:en}=await D(k,O,Le,Ve,T);if(T.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",ir),Ve.forEach(Te=>V.delete(Te.key));let $t=Ei(Hr);if($t)return await Pt(T,$t.result,!0,{replace:J}),{shortCircuited:!0};if($t=Ei(en),$t)return Z.add($t.key),await Pt(T,$t.result,!0,{replace:J}),{shortCircuited:!0};let{loaderData:Yo,errors:Br}=Hl(k,O,Hr,te,Ve,en,ve);ve.forEach((Te,Ke)=>{Te.subscribe(or=>{(or||Te.done)&&ve.delete(Ke)})}),d.v7_partialHydration&&ee&&k.errors&&(Br=He({},k.errors,Br));let Mn=It(),Si=Be(S),Ci=Mn||Si||Ve.length>0;return He({matches:O,loaderData:Yo,errors:Br},Ci?{fetchers:new Map(k.fetchers)}:{})}function On(T){if(T&&!wt(T[1]))return{[T[0]]:T[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function Nn(T){return T.forEach(I=>{let O=k.fetchers.get(I.key),j=Vr(void 0,O?O.data:void 0);k.fetchers.set(I.key,j)}),new Map(k.fetchers)}function Jt(T,I,O,j){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");$e(T);let G=(j&&j.flushSync)===!0,re=s||a,le=Ta(k.location,k.matches,l,d.v7_prependBasename,O,d.v7_relativeSplatPath,I,j?.relative),J=Un(re,le,l),ee=Ne(J,re,le);if(ee.active&&ee.matches&&(J=ee.matches),!J){se(T,I,gt(404,{pathname:le}),{flushSync:G});return}let{path:X,submission:te,error:ge}=Nl(d.v7_normalizeFormMethod,!0,le,j);if(ge){se(T,I,ge,{flushSync:G});return}let Ee=Zr(J,X),nt=(j&&j.preventScrollReset)===!0;if(te&&Nt(te.formMethod)){rr(T,I,X,Ee,J,ee.active,G,nt,te);return}C.set(T,{routeId:I,path:X}),Tt(T,I,X,Ee,J,ee.active,G,nt,te)}async function rr(T,I,O,j,G,re,le,J,ee){B(),C.delete(T);function X(qe){if(!qe.route.action&&!qe.route.lazy){let ar=gt(405,{method:ee.formMethod,pathname:O,routeId:I});return se(T,I,ar,{flushSync:le}),!0}return!1}if(!re&&X(j))return;let te=k.fetchers.get(T);ne(T,bg(ee,te),{flushSync:le});let ge=new AbortController,Ee=sr(e.history,O,ge.signal,ee);if(re){let qe=await it(G,new URL(Ee.url).pathname,Ee.signal,T);if(qe.type==="aborted")return;if(qe.type==="error"){se(T,I,qe.error,{flushSync:le});return}else if(qe.matches){if(G=qe.matches,j=Zr(G,O),X(j))return}else{se(T,I,gt(404,{pathname:O}),{flushSync:le});return}}V.set(T,ge);let nt=F,Le=(await Zt("action",k,Ee,[j],G,T))[j.route.id];if(Ee.signal.aborted){V.get(T)===ge&&V.delete(T);return}if(d.v7_fetcherPersist&&me.has(T)){if($n(Le)||wt(Le)){ne(T,gn(void 0));return}}else{if($n(Le))if(V.delete(T),S>nt){ne(T,gn(void 0));return}else return Z.add(T),ne(T,Vr(ee)),Pt(Ee,Le,!1,{fetcherSubmission:ee,preventScrollReset:J});if(wt(Le)){se(T,I,Le.error);return}}if(bn(Le))throw gt(400,{type:"defer-action"});let Ve=k.navigation.location||k.location,ir=sr(e.history,Ve,ge.signal),Hr=s||a,en=k.navigation.state!=="idle"?Un(Hr,k.navigation.location,l):k.matches;xe(en,"Didn't find any matches after fetcher action");let $t=++F;ie.set(T,$t);let Yo=Vr(ee,Le.data);k.fetchers.set(T,Yo);let[Br,Mn]=Dl(e.history,k,en,ee,Ve,!1,d.v7_skipActionErrorRevalidation,$,Q,Y,me,C,Z,Hr,l,[j.route.id,Le]);Mn.filter(qe=>qe.key!==T).forEach(qe=>{let ar=qe.key,Al=k.fetchers.get(ar),pm=Vr(void 0,Al?Al.data:void 0);k.fetchers.set(ar,pm),$e(ar),qe.controller&&V.set(ar,qe.controller)}),pe({fetchers:new Map(k.fetchers)});let Si=()=>Mn.forEach(qe=>$e(qe.key));ge.signal.addEventListener("abort",Si);let{loaderResults:Ci,fetcherResults:Te}=await D(k,en,Br,Mn,ir);if(ge.signal.aborted)return;ge.signal.removeEventListener("abort",Si),ie.delete(T),V.delete(T),Mn.forEach(qe=>V.delete(qe.key));let Ke=Ei(Ci);if(Ke)return Pt(ir,Ke.result,!1,{preventScrollReset:J});if(Ke=Ei(Te),Ke)return Z.add(Ke.key),Pt(ir,Ke.result,!1,{preventScrollReset:J});let{loaderData:or,errors:zr}=Hl(k,en,Ci,void 0,Mn,Te,ve);if(k.fetchers.has(T)){let qe=gn(Le.data);k.fetchers.set(T,qe)}Be($t),k.navigation.state==="loading"&&$t>S?(xe(N,"Expected pending action"),R&&R.abort(),We(k.navigation.location,{matches:en,loaderData:or,errors:zr,fetchers:new Map(k.fetchers)})):(pe({errors:zr,loaderData:Bl(k.loaderData,or,en,zr),fetchers:new Map(k.fetchers)}),$=!1)}async function Tt(T,I,O,j,G,re,le,J,ee){let X=k.fetchers.get(T);ne(T,Vr(ee,X?X.data:void 0),{flushSync:le});let te=new AbortController,ge=sr(e.history,O,te.signal);if(re){let Le=await it(G,new URL(ge.url).pathname,ge.signal,T);if(Le.type==="aborted")return;if(Le.type==="error"){se(T,I,Le.error,{flushSync:le});return}else if(Le.matches)G=Le.matches,j=Zr(G,O);else{se(T,I,gt(404,{pathname:O}),{flushSync:le});return}}V.set(T,te);let Ee=F,Fe=(await Zt("loader",k,ge,[j],G,T))[j.route.id];if(bn(Fe)&&(Fe=await xs(Fe,ge.signal,!0)||Fe),V.get(T)===te&&V.delete(T),!ge.signal.aborted){if(me.has(T)){ne(T,gn(void 0));return}if($n(Fe))if(S>Ee){ne(T,gn(void 0));return}else{Z.add(T),await Pt(ge,Fe,!1,{preventScrollReset:J});return}if(wt(Fe)){se(T,I,Fe.error);return}xe(!bn(Fe),"Unhandled fetcher deferred data"),ne(T,gn(Fe.data))}}async function Pt(T,I,O,j){let{submission:G,fetcherSubmission:re,preventScrollReset:le,replace:J}=j===void 0?{}:j;I.response.headers.has("X-Remix-Revalidate")&&($=!0);let ee=I.response.headers.get("Location");xe(ee,"Expected a Location header on the redirect Response"),ee=Fl(ee,new URL(T.url),l,e.history);let X=oi(k.location,ee,{_isRedirect:!0});if(n){let Le=!1;if(I.response.headers.has("X-Remix-Reload-Document"))Le=!0;else if(bs.test(ee)){const Ve=e.history.createURL(ee);Le=Ve.origin!==t.location.origin||on(Ve.pathname,l)==null}if(Le){J?t.location.replace(ee):t.location.assign(ee);return}}R=null;let te=J===!0||I.response.headers.has("X-Remix-Replace")?Qe.Replace:Qe.Push,{formMethod:ge,formAction:Ee,formEncType:nt}=k.navigation;!G&&!re&&ge&&Ee&&nt&&(G=Kl(k.navigation));let Fe=G||re;if(Zm.has(I.response.status)&&Fe&&Nt(Fe.formMethod))await tt(te,X,{submission:He({},Fe,{formAction:ee}),preventScrollReset:le||M,enableViewTransition:O?_:void 0});else{let Le=Zo(X,G);await tt(te,X,{overrideNavigation:Le,fetcherSubmission:re,preventScrollReset:le||M,enableViewTransition:O?_:void 0})}}async function Zt(T,I,O,j,G,re){let le,J={};try{le=await sg(c,T,I,O,j,G,re,o,i)}catch(ee){return j.forEach(X=>{J[X.route.id]={type:_e.error,error:ee}}),J}for(let[ee,X]of Object.entries(le))if(hg(X)){let te=X.result;J[ee]={type:_e.redirect,response:ug(te,O,ee,G,l,d.v7_relativeSplatPath)}}else J[ee]=await cg(X);return J}async function D(T,I,O,j,G){let re=T.matches,le=Zt("loader",T,G,O,I,null),J=Promise.all(j.map(async te=>{if(te.matches&&te.match&&te.controller){let Ee=(await Zt("loader",T,sr(e.history,te.path,te.controller.signal),[te.match],te.matches,te.key))[te.match.route.id];return{[te.key]:Ee}}else return Promise.resolve({[te.key]:{type:_e.error,error:gt(404,{pathname:te.path})}})})),ee=await le,X=(await J).reduce((te,ge)=>Object.assign(te,ge),{});return await Promise.all([gg(I,ee,G.signal,re,T.loaderData),yg(I,X,j)]),{loaderResults:ee,fetcherResults:X}}function B(){$=!0,Q.push(...Dn()),C.forEach((T,I)=>{V.has(I)&&Y.add(I),$e(I)})}function ne(T,I,O){O===void 0&&(O={}),k.fetchers.set(T,I),pe({fetchers:new Map(k.fetchers)},{flushSync:(O&&O.flushSync)===!0})}function se(T,I,O,j){j===void 0&&(j={});let G=Hn(k.matches,I);Ze(T),pe({errors:{[G.route.id]:O},fetchers:new Map(k.fetchers)},{flushSync:(j&&j.flushSync)===!0})}function Ce(T){return ae.set(T,(ae.get(T)||0)+1),me.has(T)&&me.delete(T),k.fetchers.get(T)||eg}function Ze(T){let I=k.fetchers.get(T);V.has(T)&&!(I&&I.state==="loading"&&ie.has(T))&&$e(T),C.delete(T),ie.delete(T),Z.delete(T),d.v7_fetcherPersist&&me.delete(T),Y.delete(T),k.fetchers.delete(T)}function At(T){let I=(ae.get(T)||0)-1;I<=0?(ae.delete(T),me.add(T),d.v7_fetcherPersist||Ze(T)):ae.set(T,I),pe({fetchers:new Map(k.fetchers)})}function $e(T){let I=V.get(T);I&&(I.abort(),V.delete(T))}function ct(T){for(let I of T){let O=Ce(I),j=gn(O.data);k.fetchers.set(I,j)}}function It(){let T=[],I=!1;for(let O of Z){let j=k.fetchers.get(O);xe(j,"Expected fetcher: "+O),j.state==="loading"&&(Z.delete(O),T.push(O),I=!0)}return ct(T),I}function Be(T){let I=[];for(let[O,j]of ie)if(j<T){let G=k.fetchers.get(O);xe(G,"Expected fetcher: "+O),G.state==="loading"&&($e(O),ie.delete(O),I.push(O))}return ct(I),I.length>0}function Ht(T,I){let O=k.blockers.get(T)||$r;return q.get(T)!==I&&q.set(T,I),O}function pt(T){k.blockers.delete(T),q.delete(T)}function _n(T,I){let O=k.blockers.get(T)||$r;xe(O.state==="unblocked"&&I.state==="blocked"||O.state==="blocked"&&I.state==="blocked"||O.state==="blocked"&&I.state==="proceeding"||O.state==="blocked"&&I.state==="unblocked"||O.state==="proceeding"&&I.state==="unblocked","Invalid blocker state transition: "+O.state+" -> "+I.state);let j=new Map(k.blockers);j.set(T,I),pe({blockers:j})}function Fr(T){let{currentLocation:I,nextLocation:O,historyAction:j}=T;if(q.size===0)return;q.size>1&&qn(!1,"A router only supports one blocker at a time");let G=Array.from(q.entries()),[re,le]=G[G.length-1],J=k.blockers.get(re);if(!(J&&J.state==="proceeding")&&le({currentLocation:I,nextLocation:O,historyAction:j}))return re}function Ur(T){let I=gt(404,{pathname:T}),O=s||a,{matches:j,route:G}=$l(O);return Dn(),{notFoundMatches:j,route:G,error:I}}function Dn(T){let I=[];return ve.forEach((O,j)=>{(!T||T(j))&&(O.cancel(),I.push(j),ve.delete(j))}),I}function Bt(T,I,O){if(m=T,v=I,p=O||null,!b&&k.navigation===Jo){b=!0;let j=Ie(k.location,k.matches);j!=null&&pe({restoreScrollPosition:j})}return()=>{m=null,v=null,p=null}}function ki(T,I){return p&&p(T,I.map(j=>Im(j,k.loaderData)))||T.key}function ce(T,I){if(m&&v){let O=ki(T,I);m[O]=v()}}function Ie(T,I){if(m){let O=ki(T,I),j=m[O];if(typeof j=="number")return j}return null}function Ne(T,I,O){if(u)if(T){if(Object.keys(T[0].params).length>0)return{active:!0,matches:zi(I,O,l,!0)}}else return{active:!0,matches:zi(I,O,l,!0)||[]};return{active:!1,matches:null}}async function it(T,I,O,j){if(!u)return{type:"success",matches:T};let G=T;for(;;){let re=s==null,le=s||a,J=o;try{await u({signal:O,path:I,matches:G,fetcherKey:j,patch:(te,ge)=>{O.aborted||jl(te,ge,le,J,i)}})}catch(te){return{type:"error",error:te,partialMatches:G}}finally{re&&!O.aborted&&(a=[...a])}if(O.aborted)return{type:"aborted"};let ee=Un(le,I,l);if(ee)return{type:"success",matches:ee};let X=zi(le,I,l,!0);if(!X||G.length===X.length&&G.every((te,ge)=>te.route.id===X[ge].route.id))return{type:"success",matches:null};G=X}}function bt(T){o={},s=Yi(T,i,void 0,o)}function zt(T,I){let O=s==null;jl(T,I,s||a,o,i),O&&(a=[...a],pe({}))}return E={get basename(){return l},get future(){return d},get state(){return k},get routes(){return a},get window(){return t},initialize:Pe,subscribe:ke,enableScrollRestoration:Bt,navigate:Ye,fetch:Jt,revalidate:Ft,createHref:T=>e.history.createHref(T),encodeLocation:T=>e.history.encodeLocation(T),getFetcher:Ce,deleteFetcher:At,dispose:be,getBlocker:Ht,deleteBlocker:pt,patchRoutes:zt,_internalFetchControllers:V,_internalActiveDeferreds:ve,_internalSetRoutes:bt},E}function rg(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ta(e,t,n,r,i,o,a,s){let l,c;if(a){l=[];for(let d of t)if(l.push(d),d.route.id===a){c=d;break}}else l=t,c=t[t.length-1];let u=Co(i||".",So(l,o),on(e.pathname,n)||e.pathname,s==="path");if(i==null&&(u.search=e.search,u.hash=e.hash),(i==null||i===""||i===".")&&c){let d=ws(u.search);if(c.route.index&&!d)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let h=new URLSearchParams(u.search),f=h.getAll("index");h.delete("index"),f.filter(p=>p).forEach(p=>h.append("index",p));let m=h.toString();u.search=m?"?"+m:""}}return r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:rn([n,u.pathname])),Gn(u)}function Nl(e,t,n,r){if(!r||!rg(r))return{path:n};if(r.formMethod&&!mg(r.formMethod))return{path:n,error:gt(405,{method:r.formMethod})};let i=()=>({path:n,error:gt(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),s=Ed(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Nt(a))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((f,m)=>{let[p,v]=m;return""+f+p+"="+v+`
|
|
20
|
-
`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Nt(a))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}xe(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=Ia(r.formData),c=r.formData;else if(r.body instanceof FormData)l=Ia(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=Ul(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=Ul(l)}catch{return i()}let u={formMethod:a,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(Nt(u.formMethod))return{path:n,submission:u};let d=En(n);return t&&d.search&&ws(d.search)&&l.append("index",""),d.search="?"+l,{path:Gn(d),submission:u}}function _l(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Dl(e,t,n,r,i,o,a,s,l,c,u,d,h,f,m,p){let v=p?wt(p[1])?p[1].error:p[1].data:void 0,b=e.createURL(t.location),x=e.createURL(i),w=n;o&&t.errors?w=_l(n,Object.keys(t.errors)[0],!0):p&&wt(p[1])&&(w=_l(n,p[0]));let A=p?p[1].statusCode:void 0,P=a&&A&&A>=400,E=w.filter((N,M)=>{let{route:R}=N;if(R.lazy)return!0;if(R.loader==null)return!1;if(o)return Pa(R,t.loaderData,t.errors);if(ig(t.loaderData,t.matches[M],N)||l.some(z=>z===N.route.id))return!0;let _=t.matches[M],L=N;return Ml(N,He({currentUrl:b,currentParams:_.params,nextUrl:x,nextParams:L.params},r,{actionResult:v,actionStatus:A,defaultShouldRevalidate:P?!1:s||b.pathname+b.search===x.pathname+x.search||b.search!==x.search||Sd(_,L)}))}),k=[];return d.forEach((N,M)=>{if(o||!n.some(U=>U.route.id===N.routeId)||u.has(M))return;let R=Un(f,N.path,m);if(!R){k.push({key:M,routeId:N.routeId,path:N.path,matches:null,match:null,controller:null});return}let _=t.fetchers.get(M),L=Zr(R,N.path),z=!1;h.has(M)?z=!1:c.has(M)?(c.delete(M),z=!0):_&&_.state!=="idle"&&_.data===void 0?z=s:z=Ml(L,He({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:v,actionStatus:A,defaultShouldRevalidate:P?!1:s})),z&&k.push({key:M,routeId:N.routeId,path:N.path,matches:R,match:L,controller:new AbortController})}),[E,k]}function Pa(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function ig(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Sd(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ml(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function jl(e,t,n,r,i){var o;let a;if(e){let c=r[e];xe(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),a=c.children}else a=n;let s=t.filter(c=>!a.some(u=>Cd(c,u))),l=Yi(s,i,[e||"_","patch",String(((o=a)==null?void 0:o.length)||"0")],r);a.push(...l)}function Cd(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(o=>Cd(n,o))}):!1}async function og(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];xe(i,"No route found in manifest");let o={};for(let a in r){let l=i[a]!==void 0&&a!=="hasErrorBoundary";qn(!l,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!Tm.has(a)&&(o[a]=r[a])}Object.assign(i,o),Object.assign(i,He({},t(i),{lazy:void 0}))}async function ag(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,o,a)=>Object.assign(i,{[n[a].route.id]:o}),{})}async function sg(e,t,n,r,i,o,a,s,l,c){let u=o.map(f=>f.route.lazy?og(f.route,l,s):void 0),d=o.map((f,m)=>{let p=u[m],v=i.some(x=>x.route.id===f.route.id);return He({},f,{shouldLoad:v,resolve:async x=>(x&&r.method==="GET"&&(f.route.lazy||f.route.loader)&&(v=!0),v?lg(t,r,f,p,x,c):Promise.resolve({type:_e.data,result:void 0}))})}),h=await e({matches:d,request:r,params:o[0].params,fetcherKey:a,context:c});try{await Promise.all(u)}catch{}return h}async function lg(e,t,n,r,i,o){let a,s,l=c=>{let u,d=new Promise((m,p)=>u=p);s=()=>u(),t.signal.addEventListener("abort",s);let h=m=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:o},...m!==void 0?[m]:[]),f=(async()=>{try{return{type:"data",result:await(i?i(p=>h(p)):h())}}catch(m){return{type:"error",result:m}}})();return Promise.race([f,d])};try{let c=n.route[e];if(r)if(c){let u,[d]=await Promise.all([l(c).catch(h=>{u=h}),r]);if(u!==void 0)throw u;a=d}else if(await r,c=n.route[e],c)a=await l(c);else if(e==="action"){let u=new URL(t.url),d=u.pathname+u.search;throw gt(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:_e.data,result:void 0};else if(c)a=await l(c);else{let u=new URL(t.url),d=u.pathname+u.search;throw gt(404,{pathname:d})}xe(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:_e.error,result:c}}finally{s&&t.signal.removeEventListener("abort",s)}return a}async function cg(e){let{result:t,type:n}=e;if(Ad(t)){let d;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?d=null:d=await t.json():d=await t.text()}catch(h){return{type:_e.error,error:h}}return n===_e.error?{type:_e.error,error:new Ji(t.status,t.statusText,d),statusCode:t.status,headers:t.headers}:{type:_e.data,data:d,statusCode:t.status,headers:t.headers}}if(n===_e.error){if(Vl(t)){var r,i;if(t.data instanceof Error){var o,a;return{type:_e.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:_e.error,error:new Ji(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:ai(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:_e.error,error:t,statusCode:ai(t)?t.status:void 0}}if(pg(t)){var s,l;return{type:_e.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(Vl(t)){var c,u;return{type:_e.data,data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:_e.data,data:t}}function ug(e,t,n,r,i,o){let a=e.headers.get("Location");if(xe(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!bs.test(a)){let s=r.slice(0,r.findIndex(l=>l.route.id===n)+1);a=Ta(new URL(t.url),s,i,!0,a,o),e.headers.set("Location",a)}return e}function Fl(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(bs.test(e)){let o=e,a=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(i.includes(a.protocol))throw new Error("Invalid redirect location");let s=on(a.pathname,n)!=null;if(a.origin===t.origin&&s)return vs(a.pathname)+a.search+a.hash}try{let o=r.createURL(e);if(i.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function sr(e,t,n,r){let i=e.createURL(Ed(t)).toString(),o={signal:n};if(r&&Nt(r.formMethod)){let{formMethod:a,formEncType:s}=r;o.method=a.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(r.json)):s==="text/plain"?o.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?o.body=Ia(r.formData):o.body=r.formData}return new Request(i,o)}function Ia(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Ul(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function dg(e,t,n,r,i){let o={},a=null,s,l=!1,c={},u=n&&wt(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let h=d.route.id,f=t[h];if(xe(!$n(f),"Cannot handle redirect results in processLoaderData"),wt(f)){let m=f.error;u!==void 0&&(m=u,u=void 0),a=a||{};{let p=Hn(e,h);a[p.route.id]==null&&(a[p.route.id]=m)}o[h]=void 0,l||(l=!0,s=ai(f.error)?f.error.status:500),f.headers&&(c[h]=f.headers)}else bn(f)?(r.set(h,f.deferredData),o[h]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers)):(o[h]=f.data,f.statusCode&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers))}),u!==void 0&&n&&(a={[n[0]]:u},o[n[0]]=void 0),{loaderData:o,errors:a,statusCode:s||200,loaderHeaders:c}}function Hl(e,t,n,r,i,o,a){let{loaderData:s,errors:l}=dg(t,n,r,a);return i.forEach(c=>{let{key:u,match:d,controller:h}=c,f=o[u];if(xe(f,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(wt(f)){let m=Hn(e.matches,d?.route.id);l&&l[m.route.id]||(l=He({},l,{[m.route.id]:f.error})),e.fetchers.delete(u)}else if($n(f))xe(!1,"Unhandled fetcher revalidation redirect");else if(bn(f))xe(!1,"Unhandled fetcher deferred data");else{let m=gn(f.data);e.fetchers.set(u,m)}}),{loaderData:s,errors:l}}function Bl(e,t,n,r){let i=He({},t);for(let o of n){let a=o.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&o.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function zl(e){return e?wt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Hn(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function $l(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function gt(e,t){let{pathname:n,routeId:r,method:i,type:o,message:a}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new Ji(e||500,s,new Error(l),!0)}function Ei(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if($n(i))return{key:r,result:i}}}function Ed(e){let t=typeof e=="string"?En(e):e;return Gn(He({},t,{hash:""}))}function fg(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function hg(e){return Ad(e.result)&&Jm.has(e.result.status)}function bn(e){return e.type===_e.deferred}function wt(e){return e.type===_e.error}function $n(e){return(e&&e.type)===_e.redirect}function Vl(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function pg(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Ad(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function mg(e){return Xm.has(e.toLowerCase())}function Nt(e){return Qm.has(e.toLowerCase())}async function gg(e,t,n,r,i){let o=Object.entries(t);for(let a=0;a<o.length;a++){let[s,l]=o[a],c=e.find(h=>h?.route.id===s);if(!c)continue;let u=r.find(h=>h.route.id===c.route.id),d=u!=null&&!Sd(u,c)&&(i&&i[c.route.id])!==void 0;bn(l)&&d&&await xs(l,n,!1).then(h=>{h&&(t[s]=h)})}}async function yg(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:o,controller:a}=n[r],s=t[i];e.find(c=>c?.route.id===o)&&bn(s)&&(xe(a,"Expected an AbortController for revalidating fetcher deferred result"),await xs(s,a.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function xs(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:_e.data,data:e.deferredData.unwrappedData}}catch(i){return{type:_e.error,error:i}}return{type:_e.data,data:e.deferredData.data}}}function ws(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Zr(e,t){let n=typeof t=="string"?En(t).search:t.search;if(e[e.length-1].route.index&&ws(n||""))return e[e.length-1];let r=xd(e);return r[r.length-1]}function Kl(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function Zo(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function vg(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Vr(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function bg(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function gn(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function xg(e,t){try{let n=e.sessionStorage.getItem(kd);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function wg(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(kd,JSON.stringify(n))}catch(r){qn(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
21
|
-
* React Router v6.30.4
|
|
22
|
-
*
|
|
23
|
-
* Copyright (c) Remix Software Inc.
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the MIT license found in the
|
|
26
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
27
|
-
*
|
|
28
|
-
* @license MIT
|
|
29
|
-
*/function Zi(){return Zi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zi.apply(null,arguments)}const gi=g.createContext(null),ks=g.createContext(null),ln=g.createContext(null),Ss=g.createContext(null),cn=g.createContext({outlet:null,matches:[],isDataRoute:!1}),Rd=g.createContext(null);function kg(e,t){let{relative:n}=t===void 0?{}:t;Ir()||xe(!1);let{basename:r,navigator:i}=g.useContext(ln),{hash:o,pathname:a,search:s}=Ao(e,{relative:n}),l=a;return r!=="/"&&(l=a==="/"?r:rn([r,a])),i.createHref({pathname:l,search:s,hash:o})}function Ir(){return g.useContext(Ss)!=null}function un(){return Ir()||xe(!1),g.useContext(Ss).location}function Td(e){g.useContext(ln).static||g.useLayoutEffect(e)}function Eo(){let{isDataRoute:e}=g.useContext(cn);return e?Mg():Sg()}function Sg(){Ir()||xe(!1);let e=g.useContext(gi),{basename:t,future:n,navigator:r}=g.useContext(ln),{matches:i}=g.useContext(cn),{pathname:o}=un(),a=JSON.stringify(So(i,n.v7_relativeSplatPath)),s=g.useRef(!1);return Td(()=>{s.current=!0}),g.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=Co(c,JSON.parse(a),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:rn([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,a,o,e])}const Cg=g.createContext(null);function Eg(e){let t=g.useContext(cn).outlet;return t&&g.createElement(Cg.Provider,{value:e},t)}function Ao(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(ln),{matches:i}=g.useContext(cn),{pathname:o}=un(),a=JSON.stringify(So(i,r.v7_relativeSplatPath));return g.useMemo(()=>Co(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function Ag(e,t,n,r){Ir()||xe(!1);let{navigator:i}=g.useContext(ln),{matches:o}=g.useContext(cn),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=un(),u;u=c;let d=u.pathname||"/",h=d;if(l!=="/"){let p=l.replace(/^\//,"").split("/");h="/"+d.replace(/^\//,"").split("/").slice(p.length).join("/")}let f=Un(e,{pathname:h});return Lg(f&&f.map(p=>Object.assign({},p,{params:Object.assign({},s,p.params),pathname:rn([l,i.encodeLocation?i.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?l:rn([l,i.encodeLocation?i.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),o,n,r)}function Rg(){let e=Dg(),t=ai(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,null)}const Tg=g.createElement(Rg,null);class Pg extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(cn.Provider,{value:this.props.routeContext},g.createElement(Rd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ig(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(gi);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(cn.Provider,{value:t},r)}function Lg(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=a.findIndex(d=>d.route.id&&s?.[d.route.id]!==void 0);u>=0||xe(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<a.length;u++){let d=a[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:h,errors:f}=n,m=d.route.loader&&h[d.route.id]===void 0&&(!f||f[d.route.id]===void 0);if(d.route.lazy||m){l=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,h)=>{let f,m=!1,p=null,v=null;n&&(f=s&&d.route.id?s[d.route.id]:void 0,p=d.route.errorElement||Tg,l&&(c<0&&h===0?(jg("route-fallback"),m=!0,v=null):c===h&&(m=!0,v=d.route.hydrateFallbackElement||null)));let b=t.concat(a.slice(0,h+1)),x=()=>{let w;return f?w=p:m?w=v:d.route.Component?w=g.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,g.createElement(Ig,{match:d,routeContext:{outlet:u,matches:b,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?g.createElement(Pg,{location:n.location,revalidation:n.revalidation,component:p,error:f,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var Pd=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Pd||{}),Id=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Id||{});function Og(e){let t=g.useContext(gi);return t||xe(!1),t}function Ng(e){let t=g.useContext(ks);return t||xe(!1),t}function _g(e){let t=g.useContext(cn);return t||xe(!1),t}function Ld(e){let t=_g(),n=t.matches[t.matches.length-1];return n.route.id||xe(!1),n.route.id}function Dg(){var e;let t=g.useContext(Rd),n=Ng(),r=Ld();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Mg(){let{router:e}=Og(Pd.UseNavigateStable),t=Ld(Id.UseNavigateStable),n=g.useRef(!1);return Td(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Zi({fromRouteId:t},o)))},[e,t])}const Wl={};function jg(e,t,n){Wl[e]||(Wl[e]=!0)}function Fg(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function Vt(e){let{to:t,replace:n,state:r,relative:i}=e;Ir()||xe(!1);let{future:o,static:a}=g.useContext(ln),{matches:s}=g.useContext(cn),{pathname:l}=un(),c=Eo(),u=Co(t,So(s,o.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(u);return g.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:i}),[c,d,i,n,r]),null}function CD(e){return Eg(e.context)}function Ug(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Qe.Pop,navigator:o,static:a=!1,future:s}=e;Ir()&&xe(!1);let l=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:l,navigator:o,static:a,future:Zi({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=En(r));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:m="default"}=r,p=g.useMemo(()=>{let v=on(u,l);return v==null?null:{location:{pathname:v,search:d,hash:h,state:f,key:m},navigationType:i}},[l,u,d,h,f,m,i]);return p==null?null:g.createElement(ln.Provider,{value:c},g.createElement(Ss.Provider,{children:n,value:p}))}new Promise(()=>{});function Hg(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:g.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:g.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
30
|
-
* React Router DOM v6.30.4
|
|
31
|
-
*
|
|
32
|
-
* Copyright (c) Remix Software Inc.
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the MIT license found in the
|
|
35
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
36
|
-
*
|
|
37
|
-
* @license MIT
|
|
38
|
-
*/function kr(){return kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kr.apply(null,arguments)}function Od(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Bg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zg(e,t){return e.button===0&&(!t||t==="_self")&&!Bg(e)}function La(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function $g(e,t){let n=La(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const Vg=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Kg=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Wg="6";try{window.__reactRouterVersion=Wg}catch{}function qg(e,t){return ng({basename:void 0,future:kr({},void 0,{v7_prependBasename:!0}),history:Em({window:void 0}),hydrationData:Gg(),routes:e,mapRouteProperties:Hg,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function Gg(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=kr({},t,{errors:Qg(t.errors)})),t}function Qg(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Ji(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let a=new o(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}const Nd=g.createContext({isTransitioning:!1}),Yg=g.createContext(new Map),Xg="startTransition",ql=wo[Xg],Jg="flushSync",Gl=mm[Jg];function Zg(e){ql?ql(e):e()}function Kr(e){Gl?Gl(e):e()}class ey{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function ty(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=g.useState(n.state),[a,s]=g.useState(),[l,c]=g.useState({isTransitioning:!1}),[u,d]=g.useState(),[h,f]=g.useState(),[m,p]=g.useState(),v=g.useRef(new Map),{v7_startTransition:b}=r||{},x=g.useCallback(N=>{b?Zg(N):N()},[b]),w=g.useCallback((N,M)=>{let{deletedFetchers:R,flushSync:_,viewTransitionOpts:L}=M;N.fetchers.forEach((U,$)=>{U.data!==void 0&&v.current.set($,U.data)}),R.forEach(U=>v.current.delete(U));let z=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||z){_?Kr(()=>o(N)):x(()=>o(N));return}if(_){Kr(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let U=n.window.document.startViewTransition(()=>{Kr(()=>o(N))});U.finished.finally(()=>{Kr(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})})}),Kr(()=>f(U));return}h?(u&&u.resolve(),h.skipTransition(),p({state:N,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(s(N),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,h,u,v,x]);g.useLayoutEffect(()=>n.subscribe(w),[n,w]),g.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new ey)},[l]),g.useEffect(()=>{if(u&&a&&n.window){let N=a,M=u.promise,R=n.window.document.startViewTransition(async()=>{x(()=>o(N)),await M});R.finished.finally(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})}),f(R)}},[x,a,u,n.window]),g.useEffect(()=>{u&&a&&i.location.key===a.location.key&&u.resolve()},[u,h,i.location,a]),g.useEffect(()=>{!l.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),p(void 0))},[l.isTransitioning,m]),g.useEffect(()=>{},[]);let A=g.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:N=>n.navigate(N),push:(N,M,R)=>n.navigate(N,{state:M,preventScrollReset:R?.preventScrollReset}),replace:(N,M,R)=>n.navigate(N,{replace:!0,state:M,preventScrollReset:R?.preventScrollReset})}),[n]),P=n.basename||"/",E=g.useMemo(()=>({router:n,navigator:A,static:!1,basename:P}),[n,A,P]),k=g.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return g.useEffect(()=>Fg(r,n.future),[r,n.future]),g.createElement(g.Fragment,null,g.createElement(gi.Provider,{value:E},g.createElement(ks.Provider,{value:i},g.createElement(Yg.Provider,{value:v.current},g.createElement(Nd.Provider,{value:l},g.createElement(Ug,{basename:P,location:i.location,navigationType:i.historyAction,navigator:A,future:k},i.initialized||n.future.v7_partialHydration?g.createElement(ny,{routes:n.routes,future:n.future,state:i}):t))))),null)}const ny=g.memo(ry);function ry(e){let{routes:t,future:n,state:r}=e;return Ag(t,void 0,r,n)}const iy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",oy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cs=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:a,state:s,target:l,to:c,preventScrollReset:u,viewTransition:d}=t,h=Od(t,Vg),{basename:f}=g.useContext(ln),m,p=!1;if(typeof c=="string"&&oy.test(c)&&(m=c,iy))try{let w=new URL(window.location.href),A=c.startsWith("//")?new URL(w.protocol+c):new URL(c),P=on(A.pathname,f);A.origin===w.origin&&P!=null?c=P+A.search+A.hash:p=!0}catch{}let v=kg(c,{relative:i}),b=sy(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:i,viewTransition:d});function x(w){r&&r(w),w.defaultPrevented||b(w)}return g.createElement("a",kr({},h,{href:m||v,onClick:p||o?r:x,ref:n,target:l}))}),Ql=g.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:a=!1,style:s,to:l,viewTransition:c,children:u}=t,d=Od(t,Kg),h=Ao(l,{relative:d.relative}),f=un(),m=g.useContext(ks),{navigator:p,basename:v}=g.useContext(ln),b=m!=null&&cy(h)&&c===!0,x=p.encodeLocation?p.encodeLocation(h).pathname:h.pathname,w=f.pathname,A=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(w=w.toLowerCase(),A=A?A.toLowerCase():null,x=x.toLowerCase()),A&&v&&(A=on(A,v)||A);const P=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let E=w===x||!a&&w.startsWith(x)&&w.charAt(P)==="/",k=A!=null&&(A===x||!a&&A.startsWith(x)&&A.charAt(x.length)==="/"),N={isActive:E,isPending:k,isTransitioning:b},M=E?r:void 0,R;typeof o=="function"?R=o(N):R=[o,E?"active":null,k?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let _=typeof s=="function"?s(N):s;return g.createElement(Cs,kr({},d,{"aria-current":M,className:R,ref:n,style:_,to:l,viewTransition:c}),typeof u=="function"?u(N):u)});var Oa;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Oa||(Oa={}));var Yl;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Yl||(Yl={}));function ay(e){let t=g.useContext(gi);return t||xe(!1),t}function sy(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a,viewTransition:s}=t===void 0?{}:t,l=Eo(),c=un(),u=Ao(e,{relative:a});return g.useCallback(d=>{if(zg(d,n)){d.preventDefault();let h=r!==void 0?r:Gn(c)===Gn(u);l(e,{replace:h,state:i,preventScrollReset:o,relative:a,viewTransition:s})}},[c,l,u,r,i,n,e,o,a,s])}function ly(e){let t=g.useRef(La(e)),n=g.useRef(!1),r=un(),i=g.useMemo(()=>$g(r.search,n.current?null:t.current),[r.search]),o=Eo(),a=g.useCallback((s,l)=>{const c=La(typeof s=="function"?s(i):s);n.current=!0,o("?"+c,l)},[o,i]);return[i,a]}function cy(e,t){t===void 0&&(t={});let n=g.useContext(Nd);n==null&&xe(!1);let{basename:r}=ay(Oa.useViewTransitionState),i=Ao(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=on(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=on(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xi(i.pathname,a)!=null||Xi(i.pathname,o)!=null}const Xl=e=>{let t;const n=new Set,r=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(f=>f(t,h))}},i=()=>t,s={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,i,s);return s},uy=e=>e?Xl(e):Xl,dy=e=>e;function fy(e,t=dy){const n=W.useSyncExternalStore(e.subscribe,W.useCallback(()=>t(e.getState()),[e,t]),W.useCallback(()=>t(e.getInitialState()),[e,t]));return W.useDebugValue(n),n}const Jl=e=>{const t=uy(e),n=r=>fy(t,r);return Object.assign(n,t),n},_d=e=>e?Jl(e):Jl,eo="agim_token";function hy(){try{return localStorage.getItem(eo)}catch{return null}}function Zl(e){try{e?localStorage.setItem(eo,e):localStorage.removeItem(eo)}catch{}}const ec=hy(),Es=_d(e=>({token:ec,signedIn:!!ec,setToken:t=>{Zl(t),e({token:t,signedIn:!!t})},clear:()=>{Zl(null),e({token:null,signedIn:!1})}}));function py(){function e(t){if(t.key!==eo)return;const n=t.newValue;Es.setState({token:n,signedIn:!!n})}return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}function Dd({children:e}){const t=Es(r=>r.signedIn),n=un();if(!t){const r=encodeURIComponent(n.pathname+n.search);return y.jsx(Vt,{to:`/login?next=${r}`,replace:!0})}return y.jsx(y.Fragment,{children:e})}const my=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);Kn(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},tc={},Na=(e,t,n,r)=>{Kn(n)&&tc[n]||(Kn(n)&&(tc[n]=new Date),my(e,t,n,r))},Md=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},_a=(e,t,n)=>{e.loadNamespaces(t,Md(e,n))},nc=(e,t,n,r)=>{if(Kn(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return _a(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,Md(e,r))},gy=(e,t,n={})=>!t.languages||!t.languages.length?(Na(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Kn=e=>typeof e=="string",yy=e=>typeof e=="object"&&e!==null,vy=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,by={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},xy=e=>by[e],wy=e=>e.replace(vy,xy);let Da={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:wy};const ky=(e={})=>{Da={...Da,...e}},Sy=()=>Da;let jd;const Cy=e=>{jd=e},Ey=()=>jd,Ay={type:"3rdParty",init(e){ky(e.options.react),Cy(e)}},Ry=g.createContext();class Ty{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Py=(e,t)=>{const n=g.useRef();return g.useEffect(()=>{n.current=e},[e,t]),n.current},Fd=(e,t,n,r)=>e.getFixedT(t,n,r),Iy=(e,t,n,r)=>g.useCallback(Fd(e,t,n,r),[e,t,n,r]),st=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=g.useContext(Ry)||{},o=n||r||Ey();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Ty),!o){Na(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const A=(E,k)=>Kn(k)?k:yy(k)&&Kn(k.defaultValue)?k.defaultValue:Array.isArray(E)?E[E.length-1]:E,P=[A,{},!1];return P.t=A,P.i18n={},P.ready=!1,P}o.options.react?.wait&&Na(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Sy(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let c=e||i||o.options?.defaultNS;c=Kn(c)?[c]:c||["translation"],o.reportNamespaces.addUsedNamespaces?.(c);const u=(o.isInitialized||o.initializedStoreOnce)&&c.every(A=>gy(A,o,a)),d=Iy(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),h=()=>d,f=()=>Fd(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),[m,p]=g.useState(h);let v=c.join();t.lng&&(v=`${t.lng}${v}`);const b=Py(v),x=g.useRef(!0);g.useEffect(()=>{const{bindI18n:A,bindI18nStore:P}=a;x.current=!0,!u&&!s&&(t.lng?nc(o,t.lng,c,()=>{x.current&&p(f)}):_a(o,c,()=>{x.current&&p(f)})),u&&b&&b!==v&&x.current&&p(f);const E=()=>{x.current&&p(f)};return A&&o?.on(A,E),P&&o?.store.on(P,E),()=>{x.current=!1,o&&A&&A?.split(" ").forEach(k=>o.off(k,E)),P&&o&&P.split(" ").forEach(k=>o.store.off(k,E))}},[o,v]),g.useEffect(()=>{x.current&&u&&p(h)},[o,l,u]);const w=[m,o,u];if(w.t=m,w.i18n=o,w.ready=u,u||!u&&!s)return w;throw new Promise(A=>{t.lng?nc(o,t.lng,c,()=>A()):_a(o,c,()=>A())})};/**
|
|
39
|
-
* @license lucide-react v0.469.0 - ISC
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the ISC license.
|
|
42
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/const Ly=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ud=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
44
|
-
* @license lucide-react v0.469.0 - ISC
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the ISC license.
|
|
47
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var Oy={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"};/**
|
|
49
|
-
* @license lucide-react v0.469.0 - ISC
|
|
50
|
-
*
|
|
51
|
-
* This source code is licensed under the ISC license.
|
|
52
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
-
*/const Ny=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>g.createElement("svg",{ref:l,...Oy,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ud("lucide",i),...s},[...a.map(([c,u])=>g.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
|
|
54
|
-
* @license lucide-react v0.469.0 - ISC
|
|
55
|
-
*
|
|
56
|
-
* This source code is licensed under the ISC license.
|
|
57
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/const ht=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement(Ny,{ref:o,iconNode:t,className:Ud(`lucide-${Ly(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
|
59
|
-
* @license lucide-react v0.469.0 - ISC
|
|
60
|
-
*
|
|
61
|
-
* This source code is licensed under the ISC license.
|
|
62
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
-
*/const _y=ht("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
64
|
-
* @license lucide-react v0.469.0 - ISC
|
|
65
|
-
*
|
|
66
|
-
* This source code is licensed under the ISC license.
|
|
67
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
-
*/const Hd=ht("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
69
|
-
* @license lucide-react v0.469.0 - ISC
|
|
70
|
-
*
|
|
71
|
-
* This source code is licensed under the ISC license.
|
|
72
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
-
*/const Dy=ht("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
74
|
-
* @license lucide-react v0.469.0 - ISC
|
|
75
|
-
*
|
|
76
|
-
* This source code is licensed under the ISC license.
|
|
77
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/const My=ht("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"}]]);/**
|
|
79
|
-
* @license lucide-react v0.469.0 - ISC
|
|
80
|
-
*
|
|
81
|
-
* This source code is licensed under the ISC license.
|
|
82
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/const jy=ht("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/**
|
|
84
|
-
* @license lucide-react v0.469.0 - ISC
|
|
85
|
-
*
|
|
86
|
-
* This source code is licensed under the ISC license.
|
|
87
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/const Fy=ht("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
|
|
89
|
-
* @license lucide-react v0.469.0 - ISC
|
|
90
|
-
*
|
|
91
|
-
* This source code is licensed under the ISC license.
|
|
92
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/const Uy=ht("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
|
|
94
|
-
* @license lucide-react v0.469.0 - ISC
|
|
95
|
-
*
|
|
96
|
-
* This source code is licensed under the ISC license.
|
|
97
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/const Hy=ht("MessageSquarePlus",[["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"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
|
|
99
|
-
* @license lucide-react v0.469.0 - ISC
|
|
100
|
-
*
|
|
101
|
-
* This source code is licensed under the ISC license.
|
|
102
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/const By=ht("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
104
|
-
* @license lucide-react v0.469.0 - ISC
|
|
105
|
-
*
|
|
106
|
-
* This source code is licensed under the ISC license.
|
|
107
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/const zy=ht("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
109
|
-
* @license lucide-react v0.469.0 - ISC
|
|
110
|
-
*
|
|
111
|
-
* This source code is licensed under the ISC license.
|
|
112
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
-
*/const $y=ht("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
114
|
-
* @license lucide-react v0.469.0 - ISC
|
|
115
|
-
*
|
|
116
|
-
* This source code is licensed under the ISC license.
|
|
117
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/const Vy=ht("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"}]]);/**
|
|
119
|
-
* @license lucide-react v0.469.0 - ISC
|
|
120
|
-
*
|
|
121
|
-
* This source code is licensed under the ISC license.
|
|
122
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
-
*/const Ky=ht("SunMedium",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]]);/**
|
|
124
|
-
* @license lucide-react v0.469.0 - ISC
|
|
125
|
-
*
|
|
126
|
-
* This source code is licensed under the ISC license.
|
|
127
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
-
*/const Wy=ht("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"}]]);/**
|
|
129
|
-
* @license lucide-react v0.469.0 - ISC
|
|
130
|
-
*
|
|
131
|
-
* This source code is licensed under the ISC license.
|
|
132
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/const qy=ht("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function rc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=rc(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():rc(e[i],null)}}}}function ze(...e){return g.useCallback(Gy(...e),e)}function Sr(e){const t=g.forwardRef((n,r)=>{let{children:i,...o}=n,a=null,s=!1;const l=[];ic(i)&&typeof Ai=="function"&&(i=Ai(i._payload)),g.Children.forEach(i,h=>{if(ev(h)){s=!0;const f=h;let m="child"in f.props?f.props.child:f.props.children;ic(m)&&typeof Ai=="function"&&(m=Ai(m._payload)),a=Xy(f,m),l.push(a?.props?.children)}else l.push(h)}),a?a=g.cloneElement(a,void 0,l):!s&&g.Children.count(i)===1&&g.isValidElement(i)&&(a=i);const c=a?Zy(a):void 0,u=ze(r,c);if(!a){if(i||i===0)throw new Error(s?iv(e):rv(e));return i}const d=Jy(o,a.props??{});return a.type!==g.Fragment&&(d.ref=r?u:c),g.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}var Qy=Sr("Slot"),Bd=Symbol.for("radix.slottable");function Yy(e){const t=n=>"child"in n?n.children(n.child):n.children;return t.displayName=`${e}.Slottable`,t.__radixId=Bd,t}var Xy=(e,t)=>{if("child"in e.props){const n=e.props.child;return g.isValidElement(n)?g.cloneElement(n,void 0,e.props.children(n.props.children)):null}return g.isValidElement(t)?t:null};function Jy(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Zy(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ev(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bd}var tv=Symbol.for("react.lazy");function ic(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tv&&"_payload"in e&&nv(e._payload)}function nv(e){return typeof e=="object"&&e!==null&&"then"in e}var rv=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,iv=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Ai=wo[" use ".trim().toString()];function zd(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=zd(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $d(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=zd(e))&&(r&&(r+=" "),r+=t);return r}const oc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ac=$d,As=(e,t)=>n=>{var r;if(t?.variants==null)return ac(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(c=>{const u=n?.[c],d=o?.[c];if(u===null)return null;const h=oc(u)||oc(d);return i[c][h]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...f}=u;return Object.entries(f).every(m=>{let[p,v]=m;return Array.isArray(v)?v.includes({...o,...s}[p]):{...o,...s}[p]===v})?[...c,d,h]:c},[]);return ac(e,a,l,n?.class,n?.className)},Rs="-",ov=e=>{const t=sv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(Rs);return s[0]===""&&s.length!==1&&s.shift(),Vd(s,t)||av(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},Vd=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Vd(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Rs);return t.validators.find(({validator:a})=>a(o))?.classGroupId},sc=/^\[(.+)\]$/,av=e=>{if(sc.test(e)){const t=sc.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},sv=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return cv(Object.entries(e.classGroups),n).forEach(([o,a])=>{Ma(a,r,o,t)}),r},Ma=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:lc(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(lv(i)){Ma(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{Ma(a,lc(t,o),n,r)})})},lc=(e,t)=>{let n=e;return t.split(Rs).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},lv=e=>e.isThemeGetter,cv=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e,uv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},Kd="!",dv=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=s=>{const l=[];let c=0,u=0,d;for(let v=0;v<s.length;v++){let b=s[v];if(c===0){if(b===i&&(r||s.slice(v,v+o)===t)){l.push(s.slice(u,v)),u=v+o;continue}if(b==="/"){d=v;continue}}b==="["?c++:b==="]"&&c--}const h=l.length===0?s:s.substring(u),f=h.startsWith(Kd),m=f?h.substring(1):h,p=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}};return n?s=>n({className:s,parseClassName:a}):a},fv=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},hv=e=>({cache:uv(e.cacheSize),parseClassName:dv(e),...ov(e)}),pv=/\s+/,mv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(pv);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=n(c);let m=!!f,p=r(m?h.substring(0,f):h);if(!p){if(!m){s=c+(s.length>0?" "+s:s);continue}if(p=r(h),!p){s=c+(s.length>0?" "+s:s);continue}m=!1}const v=fv(u).join(":"),b=d?v+Kd:v,x=b+p;if(o.includes(x))continue;o.push(x);const w=i(p,m);for(let A=0;A<w.length;++A){const P=w[A];o.push(b+P)}s=c+(s.length>0?" "+s:s)}return s};function gv(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Wd(t))&&(r&&(r+=" "),r+=n);return r}const Wd=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Wd(e[r]))&&(n&&(n+=" "),n+=t);return n};function yv(e,...t){let n,r,i,o=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=hv(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=mv(l,n);return i(l,u),u}return function(){return o(gv.apply(null,arguments))}}const Ue=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},qd=/^\[(?:([a-z-]+):)?(.+)\]$/i,vv=/^\d+\/\d+$/,bv=new Set(["px","full","screen"]),xv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,kv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Sv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Cv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tn=e=>vr(e)||bv.has(e)||vv.test(e),hn=e=>Lr(e,"length",Ov),vr=e=>!!e&&!Number.isNaN(Number(e)),ea=e=>Lr(e,"number",vr),Wr=e=>!!e&&Number.isInteger(Number(e)),Ev=e=>e.endsWith("%")&&vr(e.slice(0,-1)),ye=e=>qd.test(e),pn=e=>xv.test(e),Av=new Set(["length","size","percentage"]),Rv=e=>Lr(e,Av,Gd),Tv=e=>Lr(e,"position",Gd),Pv=new Set(["image","url"]),Iv=e=>Lr(e,Pv,_v),Lv=e=>Lr(e,"",Nv),qr=()=>!0,Lr=(e,t,n)=>{const r=qd.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ov=e=>wv.test(e)&&!kv.test(e),Gd=()=>!1,Nv=e=>Sv.test(e),_v=e=>Cv.test(e),Dv=()=>{const e=Ue("colors"),t=Ue("spacing"),n=Ue("blur"),r=Ue("brightness"),i=Ue("borderColor"),o=Ue("borderRadius"),a=Ue("borderSpacing"),s=Ue("borderWidth"),l=Ue("contrast"),c=Ue("grayscale"),u=Ue("hueRotate"),d=Ue("invert"),h=Ue("gap"),f=Ue("gradientColorStops"),m=Ue("gradientColorStopPositions"),p=Ue("inset"),v=Ue("margin"),b=Ue("opacity"),x=Ue("padding"),w=Ue("saturate"),A=Ue("scale"),P=Ue("sepia"),E=Ue("skew"),k=Ue("space"),N=Ue("translate"),M=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",ye,t],L=()=>[ye,t],z=()=>["",tn,hn],U=()=>["auto",vr,ye],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",ye],S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ie=()=>[vr,ye];return{cacheSize:500,separator:":",theme:{colors:[qr],spacing:[tn,hn],blur:["none","",pn,ye],brightness:ie(),borderColor:[e],borderRadius:["none","","full",pn,ye],borderSpacing:L(),borderWidth:z(),contrast:ie(),grayscale:F(),hueRotate:ie(),invert:F(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[Ev,hn],inset:_(),margin:_(),opacity:ie(),padding:L(),saturate:ie(),scale:ie(),sepia:F(),skew:ie(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",ye]}],container:["container"],columns:[{columns:[pn]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),ye]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Wr,ye]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ye]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Wr,ye]}],"grid-cols":[{"grid-cols":[qr]}],"col-start-end":[{col:["auto",{span:["full",Wr,ye]},ye]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[qr]}],"row-start-end":[{row:["auto",{span:[Wr,ye]},ye]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ye]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ye,t]}],"min-w":[{"min-w":[ye,t,"min","max","fit"]}],"max-w":[{"max-w":[ye,t,"none","full","min","max","fit","prose",{screen:[pn]},pn]}],h:[{h:[ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",pn,hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ea]}],"font-family":[{font:[qr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ye]}],"line-clamp":[{"line-clamp":["none",vr,ea]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",tn,ye]}],"list-image":[{"list-image":["none",ye]}],"list-style-type":[{list:["none","disc","decimal",ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",tn,hn]}],"underline-offset":[{"underline-offset":["auto",tn,ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),Tv]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Rv]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Iv]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...Q(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:Q()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Q()]}],"outline-offset":[{"outline-offset":[tn,ye]}],"outline-w":[{outline:[tn,hn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[tn,hn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",pn,Lv]}],"shadow-color":[{shadow:[qr]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",pn,ye]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ye]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",ye]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[Wr,ye]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[tn,hn,ea]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Mv=yv(Dv);function we(...e){return Mv($d(e))}const jv=As(["inline-flex items-center justify-center gap-2","whitespace-nowrap rounded-md text-sm font-medium","transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg","disabled:pointer-events-none disabled:opacity-55","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"].join(" "),{variants:{variant:{default:"bg-accent text-accent-fg hover:bg-accent-hover",secondary:"bg-surface-2 text-text hover:bg-surface-hover border border-border",outline:"bg-surface text-text border border-border hover:bg-surface-hover hover:border-border-strong",ghost:"bg-transparent text-text-dim hover:bg-surface-hover hover:text-text",destructive:"bg-surface text-danger border border-danger hover:bg-danger hover:text-white",link:"bg-transparent text-accent underline-offset-4 hover:underline px-0 h-auto"},size:{default:"h-8 px-3 py-1 text-sm",sm:"h-7 px-2.5 py-1 text-xs",lg:"h-9 px-5",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),at=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const a=r?Qy:"button";return y.jsx(a,{className:we(jv({variant:t,size:n,className:e})),ref:o,...i})});at.displayName="Button";class Fv extends g.Component{state={error:null,info:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.setState({info:n})}handleReset=()=>{this.setState({error:null,info:null})};render(){return this.state.error?y.jsx(Uv,{error:this.state.error,info:this.state.info,onReset:this.handleReset}):this.props.children}}function Uv({error:e,info:t,onReset:n}){const{t:r}=st("common"),i=typeof import.meta<"u"&&!1;return y.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8",children:y.jsxs("div",{className:"flex flex-col items-center gap-4 text-center max-w-xl",children:[y.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-danger-bg text-danger",children:y.jsx(Wy,{className:"h-6 w-6"})}),y.jsx("h1",{className:"text-xl font-semibold",children:r("errorBoundary.title",{defaultValue:"Something went wrong."})}),y.jsx("p",{className:"text-sm text-text-dim",children:r("errorBoundary.description",{defaultValue:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it."})}),y.jsxs("pre",{className:"w-full max-w-lg overflow-auto rounded-md bg-surface-2 px-3 py-2 text-left text-xs leading-5 text-text-dim",children:[e.name,": ",e.message]}),i&&t?.componentStack&&y.jsxs("details",{className:"w-full max-w-lg text-left text-xs",children:[y.jsx("summary",{className:"cursor-pointer text-text-dim",children:"component stack (dev)"}),y.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-surface-2 px-3 py-2 text-text-muted",children:t.componentStack})]}),y.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:[y.jsxs(at,{type:"button",variant:"default",onClick:()=>{n(),typeof window<"u"&&window.location.reload()},children:[y.jsx(zy,{className:"h-4 w-4"}),r("errorBoundary.reload",{defaultValue:"Reload"})]}),y.jsx(at,{type:"button",variant:"secondary",asChild:!0,children:y.jsxs(Cs,{to:"/",onClick:n,children:[y.jsx(Fy,{className:"h-4 w-4"}),r("errorBoundary.home",{defaultValue:"Home"})]})})]})]})})}var Or=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Hv=class extends Or{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Ts=new Hv,Bv={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zv=class{#e=Bv;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Vn=new zv;function $v(e){setTimeout(e,0)}var Vv=typeof window>"u"||"Deno"in globalThis;function ut(){}function Kv(e,t){return typeof e=="function"?e(t):e}function ja(e){return typeof e=="number"&&e>=0&&e!==1/0}function Qd(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xn(e,t){return typeof e=="function"?e(t):e}function kt(e,t){return typeof e=="function"?e(t):e}function cc(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==Ps(a,t.options))return!1}else if(!si(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function uc(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Qn(t.options.mutationKey)!==Qn(o))return!1}else if(!si(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ps(e,t){return(t?.queryKeyHashFn||Qn)(e)}function Qn(e){return JSON.stringify(e,(t,n)=>Fa(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function si(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>si(e[n],t[n])):!1}var Wv=Object.prototype.hasOwnProperty;function Yd(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=dc(e)&&dc(t);if(!r&&!(Fa(e)&&Fa(t)))return t;const o=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),s=a.length,l=r?new Array(s):{};let c=0;for(let u=0;u<s;u++){const d=r?u:a[u],h=e[d],f=t[d];if(h===f){l[d]=h,(r?u<o:Wv.call(e,d))&&c++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){l[d]=f;continue}const m=Yd(h,f,n+1);l[d]=m,m===h&&c++}return o===s&&c===o?e:l}function to(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function dc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fa(e){if(!fc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!fc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function fc(e){return Object.prototype.toString.call(e)==="[object Object]"}function qv(e){return new Promise(t=>{Vn.setTimeout(t,e)})}function Ua(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Yd(e,t):t}function Gv(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Qv(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Is=Symbol();function Xd(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Is?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ls(e,t){return typeof e=="function"?e(...t):!!e}function Yv(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var li=(()=>{let e=()=>Vv;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ha(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var Xv=$v;function Jv(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=Xv;const o=s=>{t?e.push(s):i(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Je=Jv(),Zv=class extends Or{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},no=new Zv;function eb(e){return Math.min(1e3*2**e,3e4)}function Jd(e){return(e??"online")==="online"?no.isOnline():!0}var Ba=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Zd(e){let t=!1,n=0,r;const i=Ha(),o=()=>i.status!=="pending",a=p=>{if(!o()){const v=new Ba(p);h(v),e.onCancel?.(v)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>Ts.isFocused()&&(e.networkMode==="always"||no.isOnline())&&e.canRun(),u=()=>Jd(e.networkMode)&&e.canRun(),d=p=>{o()||(r?.(),i.resolve(p))},h=p=>{o()||(r?.(),i.reject(p))},f=()=>new Promise(p=>{r=v=>{(o()||c())&&p(v)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),m=()=>{if(o())return;let p;const v=n===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(b){p=Promise.reject(b)}Promise.resolve(p).then(d).catch(b=>{if(o())return;const x=e.retry??(li.isServer()?0:3),w=e.retryDelay??eb,A=typeof w=="function"?w(n,b):w,P=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!P){h(b);return}n++,e.onFail?.(n,b),qv(A).then(()=>c()?void 0:f()).then(()=>{t?h(b):m()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?m():f().then(m),i)}}var ef=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ja(this.gcTime)&&(this.#e=Vn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(li.isServer()?1/0:5*60*1e3))}clearGcTimeout(){this.#e!==void 0&&(Vn.clearTimeout(this.#e),this.#e=void 0)}};function tb(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=m=>{Yv(m,()=>t.signal,()=>u=!0)},h=Xd(t.options,t.fetchOptions),f=async(m,p,v)=>{if(u)return Promise.reject(t.signal.reason);if(p==null&&m.pages.length)return Promise.resolve(m);const x=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:p,direction:v?"backward":"forward",meta:t.options.meta};return d(E),E})(),w=await h(x),{maxPages:A}=t.options,P=v?Qv:Gv;return{pages:P(m.pages,w,A),pageParams:P(m.pageParams,p,A)}};if(i&&o.length){const m=i==="backward",p=m?nb:hc,v={pages:o,pageParams:a},b=p(r,v);s=await f(v,b,m)}else{const m=e??o.length;do{const p=l===0?a[0]??r.initialPageParam:hc(r,s);if(l>0&&p==null)break;s=await f(s,p),l++}while(l<m)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function hc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function nb(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var rb=class extends ef{#e;#t;#n;#r;#o;#i;#s;#a;constructor(e){super(),this.#a=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#r=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=mc(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=mc(this.options);t.data!==void 0&&(this.setState(pc(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=Ua(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(ut).catch(ut):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>kt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Is||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>xn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Qd(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#a||this.#u()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const l=Xd(this.options,t),u=(()=>{const d={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#a=!1,this.options.persister?this.options.persister(l,u,this):l(u)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:i};return r(l),l})();(this.#e==="infinite"?tb(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:"fetch",meta:a.fetchOptions?.meta}),this.#i=Zd({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof Ba&&l.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#l({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const l=await this.#i.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof Ba){if(l.silent)return this.#i.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#l({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...tf(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...pc(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Je.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function tf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Jd(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function pc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function mc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ib=class extends Or{constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.#s=Ha(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#o;#i;#s;#a;#u;#l;#p;#d;#f;#c;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),gc(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return za(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return za(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#k(),this.#t.setOptions(this.options),t._defaulted&&!to(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&yc(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||kt(this.options.enabled,this.#t)!==kt(t.enabled,this.#t)||xn(this.options.staleTime,this.#t)!==xn(t.staleTime,this.#t))&&this.#g();const i=this.#y();r&&(this.#t!==n||kt(this.options.enabled,this.#t)!==kt(t.enabled,this.#t)||i!==this.#c)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ab(this,n)&&(this.#r=n,this.#i=this.options,this.#o=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#k();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ut)),t}#g(){this.#x();const e=xn(this.options.staleTime,this.#t);if(li.isServer()||this.#r.isStale||!ja(e))return;const n=Qd(this.#r.dataUpdatedAt,e)+1;this.#d=Vn.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#c=e,!(li.isServer()||kt(this.options.enabled,this.#t)===!1||!ja(this.#c)||this.#c===0)&&(this.#f=Vn.setInterval(()=>{(this.options.refetchIntervalInBackground||Ts.isFocused())&&this.#h()},this.#c))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#d!==void 0&&(Vn.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#f!==void 0&&(Vn.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#r,o=this.#o,a=this.#i,l=e!==n?e.state:this.#n,{state:c}=e;let u={...c},d=!1,h;if(t._optimisticResults){const N=this.hasListeners(),M=!N&&gc(e,t),R=N&&yc(e,n,t,r);(M||R)&&(u={...u,...tf(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:f,errorUpdatedAt:m,status:p}=u;h=u.data;let v=!1;if(t.placeholderData!==void 0&&h===void 0&&p==="pending"){let N;i?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(N=i.data,v=!0):N=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,N!==void 0&&(p="success",h=Ua(i?.data,N,t),d=!0)}if(t.select&&h!==void 0&&!v)if(i&&h===o?.data&&t.select===this.#u)h=this.#l;else try{this.#u=t.select,h=t.select(h),h=Ua(i?.data,h,t),this.#l=h,this.#a=null}catch(N){this.#a=N}this.#a&&(f=this.#a,h=this.#l,m=Date.now(),p="error");const b=u.fetchStatus==="fetching",x=p==="pending",w=p==="error",A=x&&b,P=h!==void 0,k={status:p,fetchStatus:u.fetchStatus,isPending:x,isSuccess:p==="success",isError:w,isInitialLoading:A,isLoading:A,data:h,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:m,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:w&&!P,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&P,isStale:Os(e,t),refetch:this.refetch,promise:this.#s,isEnabled:kt(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const N=k.data!==void 0,M=k.status==="error"&&!N,R=z=>{M?z.reject(k.error):N&&z.resolve(k.data)},_=()=>{const z=this.#s=k.promise=Ha();R(z)},L=this.#s;switch(L.status){case"pending":e.queryHash===n.queryHash&&R(L);break;case"fulfilled":(M||k.data!==L.value)&&_();break;case"rejected":(!M||k.error!==L.reason)&&_();break}}return k}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#i=this.options,this.#o.data!==void 0&&(this.#p=this.#t),to(t,e))return;this.#r=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#m.size)return!0;const o=new Set(i??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#r).some(a=>{const s=a;return this.#r[s]!==e[s]&&o.has(s)})};this.#S({listeners:n()})}#k(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){Je.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function ob(e,t){return kt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&kt(t.retryOnMount,e)===!1)}function gc(e,t){return ob(e,t)||e.state.data!==void 0&&za(e,t,t.refetchOnMount)}function za(e,t,n){if(kt(t.enabled,e)!==!1&&xn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Os(e,t)}return!1}function yc(e,t,n,r){return(e!==t||kt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Os(e,n)}function Os(e,t){return kt(t.enabled,e)!==!1&&e.isStaleByTime(xn(t.staleTime,e))}function ab(e,t){return!to(e.getCurrentResult(),t)}var sb=class extends ef{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||nf(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#o({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Zd({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#o({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#r.canStart();try{if(r)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#o({type:"pending",context:a,variables:e,isPaused:i})}const o=await this.#r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#o({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#o({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Je.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function nf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var lb=class extends Or{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new sb({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Ri(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ri(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ri(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Ri(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Je.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>uc(t,n))}findAll(e={}){return this.getAll().filter(t=>uc(e,t))}notify(e){Je.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Je.batch(()=>Promise.all(e.map(t=>t.continue().catch(ut))))}};function Ri(e){return e.options.scope?.id}var cb=class extends Or{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),to(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Qn(n.mutationKey)!==Qn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#o(){const t=this.#n?.state??nf();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){Je.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(t.data,null,n,r,i)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(void 0,t.error,n,r,i)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},ub=class extends Or{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Ps(r,t);let o=this.get(i);return o||(o=new rb({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Je.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>cc(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>cc(e,n)):t}notify(e){Je.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Je.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Je.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},db=class{#e;#t;#n;#r;#o;#i;#s;#a;constructor(e={}){this.#e=e.queryCache||new ub,this.#t=e.mutationCache||new lb,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#s=Ts.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=no.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#s?.(),this.#s=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(xn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=Kv(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Je.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Je.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Je.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Je.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(ut).catch(ut)}invalidateQueries(e,t={}){return Je.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Je.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(ut)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(ut)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(xn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ut).catch(ut)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ut).catch(ut)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return no.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Qn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{si(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(Qn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{si(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ps(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Is&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},rf=g.createContext(void 0),An=e=>{const t=g.useContext(rf);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},fb=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(rf.Provider,{value:e,children:t})),of=g.createContext(!1),hb=()=>g.useContext(of);of.Provider;function pb(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var mb=g.createContext(pb()),gb=()=>g.useContext(mb),yb=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Ls(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},vb=e=>{g.useEffect(()=>{e.clearReset()},[e])},bb=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Ls(n,[e.error,r])),xb=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},wb=(e,t)=>e.isLoading&&e.isFetching&&!t,kb=(e,t)=>e?.suspense&&t.isPending,vc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Sb(e,t,n){const r=hb(),i=gb(),o=An(),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const s=o.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,xb(a),yb(a,i,s),vb(i);const c=!o.getQueryCache().get(a.queryHash),[u]=g.useState(()=>new t(o,a)),d=u.getOptimisticResult(a),h=!r&&l;if(g.useSyncExternalStore(g.useCallback(f=>{const m=h?u.subscribe(Je.batchCalls(f)):ut;return u.updateResult(),m},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),g.useEffect(()=>{u.setOptions(a)},[a,u]),kb(a,d))throw vc(a,u,i);if(bb({result:d,errorResetBoundary:i,throwOnError:a.throwOnError,query:s,suspense:a.suspense}))throw d.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,d),a.experimental_prefetchInRender&&!li.isServer()&&wb(d,r)&&(c?vc(a,u,i):s?.promise)?.catch(ut).finally(()=>{u.updateResult()}),a.notifyOnChangeProps?d:u.trackResult(d)}function af(e,t){return Sb(e,ib)}function Rn(e,t){const n=An(),[r]=g.useState(()=>new cb(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const i=g.useSyncExternalStore(g.useCallback(a=>r.subscribe(Je.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=g.useCallback((a,s)=>{r.mutate(a,s).catch(ut)},[r]);if(i.error&&Ls(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var Cb=e=>{switch(e){case"success":return Rb;case"info":return Pb;case"warning":return Tb;case"error":return Ib;default:return null}},Eb=Array(12).fill(0),Ab=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},Eb.map((n,r)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Rb=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Tb=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Pb=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Ib=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Lb=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ob=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},$a=1,Nb=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:$a++,o=this.toasts.find(s=>s.id===i),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...e,id:i,title:n}),{...s,...e,id:i,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,a=r.then(async l=>{if(o=["resolve",l],W.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(Db(l)&&!l.ok){i=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:u})}else if(t.success!==void 0){i=!1;let c=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],t.error!==void 0){i=!1;let c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),s=()=>new Promise((l,c)=>a.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||$a++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},yt=new Nb,_b=(e,t)=>{let n=t?.id||$a++;return yt.addToast({title:e,...t,id:n}),n},Db=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Mb=_b,jb=()=>yt.toasts,Fb=()=>yt.getActiveToasts(),Xe=Object.assign(Mb,{success:yt.success,info:yt.info,warning:yt.warning,error:yt.error,custom:yt.custom,message:yt.message,promise:yt.promise,dismiss:yt.dismiss,loading:yt.loading},{getHistory:jb,getToasts:Fb});function Ub(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Ub(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
134
|
-
`);function Ti(e){return e.label!==void 0}var Hb=3,Bb="32px",zb="16px",bc=4e3,$b=356,Vb=14,Kb=20,Wb=200;function Lt(...e){return e.filter(Boolean).join(" ")}function qb(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Gb=e=>{var t,n,r,i,o,a,s,l,c,u,d;let{invert:h,toast:f,unstyled:m,interacting:p,setHeights:v,visibleToasts:b,heights:x,index:w,toasts:A,expanded:P,removeToast:E,defaultRichColors:k,closeButton:N,style:M,cancelButtonStyle:R,actionButtonStyle:_,className:L="",descriptionClassName:z="",duration:U,position:$,gap:Q,loadingIcon:Y,expandByDefault:V,classNames:F,icons:S,closeButtonAriaLabel:ie="Close toast",pauseWhenPageIsHidden:Z}=e,[C,ae]=W.useState(null),[me,ve]=W.useState(null),[q,he]=W.useState(!1),[Pe,be]=W.useState(!1),[ke,pe]=W.useState(!1),[We,Ye]=W.useState(!1),[Ft,tt]=W.useState(!1),[Ut,Ln]=W.useState(0),[On,Nn]=W.useState(0),Jt=W.useRef(f.duration||U||bc),rr=W.useRef(null),Tt=W.useRef(null),Pt=w===0,Zt=w+1<=b,D=f.type,B=f.dismissible!==!1,ne=f.className||"",se=f.descriptionClassName||"",Ce=W.useMemo(()=>x.findIndex(ce=>ce.toastId===f.id)||0,[x,f.id]),Ze=W.useMemo(()=>{var ce;return(ce=f.closeButton)!=null?ce:N},[f.closeButton,N]),At=W.useMemo(()=>f.duration||U||bc,[f.duration,U]),$e=W.useRef(0),ct=W.useRef(0),It=W.useRef(0),Be=W.useRef(null),[Ht,pt]=$.split("-"),_n=W.useMemo(()=>x.reduce((ce,Ie,Ne)=>Ne>=Ce?ce:ce+Ie.height,0),[x,Ce]),Fr=Ob(),Ur=f.invert||h,Dn=D==="loading";ct.current=W.useMemo(()=>Ce*Q+_n,[Ce,_n]),W.useEffect(()=>{Jt.current=At},[At]),W.useEffect(()=>{he(!0)},[]),W.useEffect(()=>{let ce=Tt.current;if(ce){let Ie=ce.getBoundingClientRect().height;return Nn(Ie),v(Ne=>[{toastId:f.id,height:Ie,position:f.position},...Ne]),()=>v(Ne=>Ne.filter(it=>it.toastId!==f.id))}},[v,f.id]),W.useLayoutEffect(()=>{if(!q)return;let ce=Tt.current,Ie=ce.style.height;ce.style.height="auto";let Ne=ce.getBoundingClientRect().height;ce.style.height=Ie,Nn(Ne),v(it=>it.find(bt=>bt.toastId===f.id)?it.map(bt=>bt.toastId===f.id?{...bt,height:Ne}:bt):[{toastId:f.id,height:Ne,position:f.position},...it])},[q,f.title,f.description,v,f.id]);let Bt=W.useCallback(()=>{be(!0),Ln(ct.current),v(ce=>ce.filter(Ie=>Ie.toastId!==f.id)),setTimeout(()=>{E(f)},Wb)},[f,E,v,ct]);W.useEffect(()=>{if(f.promise&&D==="loading"||f.duration===1/0||f.type==="loading")return;let ce;return P||p||Z&&Fr?(()=>{if(It.current<$e.current){let Ie=new Date().getTime()-$e.current;Jt.current=Jt.current-Ie}It.current=new Date().getTime()})():Jt.current!==1/0&&($e.current=new Date().getTime(),ce=setTimeout(()=>{var Ie;(Ie=f.onAutoClose)==null||Ie.call(f,f),Bt()},Jt.current)),()=>clearTimeout(ce)},[P,p,f,D,Z,Fr,Bt]),W.useEffect(()=>{f.delete&&Bt()},[Bt,f.delete]);function ki(){var ce,Ie,Ne;return S!=null&&S.loading?W.createElement("div",{className:Lt(F?.loader,(ce=f?.classNames)==null?void 0:ce.loader,"sonner-loader"),"data-visible":D==="loading"},S.loading):Y?W.createElement("div",{className:Lt(F?.loader,(Ie=f?.classNames)==null?void 0:Ie.loader,"sonner-loader"),"data-visible":D==="loading"},Y):W.createElement(Ab,{className:Lt(F?.loader,(Ne=f?.classNames)==null?void 0:Ne.loader),visible:D==="loading"})}return W.createElement("li",{tabIndex:0,ref:Tt,className:Lt(L,ne,F?.toast,(t=f?.classNames)==null?void 0:t.toast,F?.default,F?.[D],(n=f?.classNames)==null?void 0:n[D]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:k,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":q,"data-promise":!!f.promise,"data-swiped":Ft,"data-removed":Pe,"data-visible":Zt,"data-y-position":Ht,"data-x-position":pt,"data-index":w,"data-front":Pt,"data-swiping":ke,"data-dismissible":B,"data-type":D,"data-invert":Ur,"data-swipe-out":We,"data-swipe-direction":me,"data-expanded":!!(P||V&&q),style:{"--index":w,"--toasts-before":w,"--z-index":A.length-w,"--offset":`${Pe?Ut:ct.current}px`,"--initial-height":V?"auto":`${On}px`,...M,...f.style},onDragEnd:()=>{pe(!1),ae(null),Be.current=null},onPointerDown:ce=>{Dn||!B||(rr.current=new Date,Ln(ct.current),ce.target.setPointerCapture(ce.pointerId),ce.target.tagName!=="BUTTON"&&(pe(!0),Be.current={x:ce.clientX,y:ce.clientY}))},onPointerUp:()=>{var ce,Ie,Ne,it;if(We||!B)return;Be.current=null;let bt=Number(((ce=Tt.current)==null?void 0:ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),zt=Number(((Ie=Tt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),T=new Date().getTime()-((Ne=rr.current)==null?void 0:Ne.getTime()),I=C==="x"?bt:zt,O=Math.abs(I)/T;if(Math.abs(I)>=Kb||O>.11){Ln(ct.current),(it=f.onDismiss)==null||it.call(f,f),ve(C==="x"?bt>0?"right":"left":zt>0?"down":"up"),Bt(),Ye(!0),tt(!1);return}pe(!1),ae(null)},onPointerMove:ce=>{var Ie,Ne,it,bt;if(!Be.current||!B||((Ie=window.getSelection())==null?void 0:Ie.toString().length)>0)return;let zt=ce.clientY-Be.current.y,T=ce.clientX-Be.current.x,I=(Ne=e.swipeDirections)!=null?Ne:qb($);!C&&(Math.abs(T)>1||Math.abs(zt)>1)&&ae(Math.abs(T)>Math.abs(zt)?"x":"y");let O={x:0,y:0};C==="y"?(I.includes("top")||I.includes("bottom"))&&(I.includes("top")&&zt<0||I.includes("bottom")&&zt>0)&&(O.y=zt):C==="x"&&(I.includes("left")||I.includes("right"))&&(I.includes("left")&&T<0||I.includes("right")&&T>0)&&(O.x=T),(Math.abs(O.x)>0||Math.abs(O.y)>0)&&tt(!0),(it=Tt.current)==null||it.style.setProperty("--swipe-amount-x",`${O.x}px`),(bt=Tt.current)==null||bt.style.setProperty("--swipe-amount-y",`${O.y}px`)}},Ze&&!f.jsx?W.createElement("button",{"aria-label":ie,"data-disabled":Dn,"data-close-button":!0,onClick:Dn||!B?()=>{}:()=>{var ce;Bt(),(ce=f.onDismiss)==null||ce.call(f,f)},className:Lt(F?.closeButton,(i=f?.classNames)==null?void 0:i.closeButton)},(o=S?.close)!=null?o:Lb):null,f.jsx||g.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:W.createElement(W.Fragment,null,D||f.icon||f.promise?W.createElement("div",{"data-icon":"",className:Lt(F?.icon,(a=f?.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||ki():null,f.type!=="loading"?f.icon||S?.[D]||Cb(D):null):null,W.createElement("div",{"data-content":"",className:Lt(F?.content,(s=f?.classNames)==null?void 0:s.content)},W.createElement("div",{"data-title":"",className:Lt(F?.title,(l=f?.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?W.createElement("div",{"data-description":"",className:Lt(z,se,F?.description,(c=f?.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),g.isValidElement(f.cancel)?f.cancel:f.cancel&&Ti(f.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||R,onClick:ce=>{var Ie,Ne;Ti(f.cancel)&&B&&((Ne=(Ie=f.cancel).onClick)==null||Ne.call(Ie,ce),Bt())},className:Lt(F?.cancelButton,(u=f?.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,g.isValidElement(f.action)?f.action:f.action&&Ti(f.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||_,onClick:ce=>{var Ie,Ne;Ti(f.action)&&((Ne=(Ie=f.action).onClick)==null||Ne.call(Ie,ce),!ce.defaultPrevented&&Bt())},className:Lt(F?.actionButton,(d=f?.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function xc(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Qb(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,a=o?"--mobile-offset":"--offset",s=o?zb:Bb;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}var Yb=g.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:h,style:f,visibleToasts:m=Hb,toastOptions:p,dir:v=xc(),gap:b=Vb,loadingIcon:x,icons:w,containerAriaLabel:A="Notifications",pauseWhenPageIsHidden:P}=e,[E,k]=W.useState([]),N=W.useMemo(()=>Array.from(new Set([r].concat(E.filter(Z=>Z.position).map(Z=>Z.position)))),[E,r]),[M,R]=W.useState([]),[_,L]=W.useState(!1),[z,U]=W.useState(!1),[$,Q]=W.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=W.useRef(null),V=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=W.useRef(null),S=W.useRef(!1),ie=W.useCallback(Z=>{k(C=>{var ae;return(ae=C.find(me=>me.id===Z.id))!=null&&ae.delete||yt.dismiss(Z.id),C.filter(({id:me})=>me!==Z.id)})},[]);return W.useEffect(()=>yt.subscribe(Z=>{if(Z.dismiss){k(C=>C.map(ae=>ae.id===Z.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{gm.flushSync(()=>{k(C=>{let ae=C.findIndex(me=>me.id===Z.id);return ae!==-1?[...C.slice(0,ae),{...C[ae],...Z},...C.slice(ae+1)]:[Z,...C]})})})}),[]),W.useEffect(()=>{if(u!=="system"){Q(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Q("dark"):Q("light")),typeof window>"u")return;let Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:C})=>{Q(C?"dark":"light")})}catch{Z.addListener(({matches:ae})=>{try{Q(ae?"dark":"light")}catch(me){console.error(me)}})}},[u]),W.useEffect(()=>{E.length<=1&&L(!1)},[E]),W.useEffect(()=>{let Z=C=>{var ae,me;i.every(ve=>C[ve]||C.code===ve)&&(L(!0),(ae=Y.current)==null||ae.focus()),C.code==="Escape"&&(document.activeElement===Y.current||(me=Y.current)!=null&&me.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[i]),W.useEffect(()=>{if(Y.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,S.current=!1)}},[Y.current]),W.createElement("section",{ref:t,"aria-label":`${A} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((Z,C)=>{var ae;let[me,ve]=Z.split("-");return E.length?W.createElement("ol",{key:Z,dir:v==="auto"?xc():v,tabIndex:-1,ref:Y,className:s,"data-sonner-toaster":!0,"data-theme":$,"data-y-position":me,"data-lifted":_&&E.length>1&&!o,"data-x-position":ve,style:{"--front-toast-height":`${((ae=M[0])==null?void 0:ae.height)||0}px`,"--width":`${$b}px`,"--gap":`${b}px`,...f,...Qb(l,c)},onBlur:q=>{S.current&&!q.currentTarget.contains(q.relatedTarget)&&(S.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||S.current||(S.current=!0,F.current=q.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{z||L(!1)},onDragEnd:()=>L(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},E.filter(q=>!q.position&&C===0||q.position===Z).map((q,he)=>{var Pe,be;return W.createElement(Gb,{key:q.id,icons:w,index:he,toast:q,defaultRichColors:d,duration:(Pe=p?.duration)!=null?Pe:h,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:n,visibleToasts:m,closeButton:(be=p?.closeButton)!=null?be:a,interacting:z,position:Z,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:ie,toasts:E.filter(ke=>ke.position==q.position),heights:M.filter(ke=>ke.position==q.position),setHeights:R,expandByDefault:o,gap:b,loadingIcon:x,expanded:_,pauseWhenPageIsHidden:P,swipeDirections:e.swipeDirections})})):null}))});const sf="agim_token";function Xb(e){if(!e)return"";const t=[];for(const[n,r]of Object.entries(e))if(!(r==null||r==="")){if(typeof r=="boolean"){t.push(`${encodeURIComponent(n)}=${r?"1":"0"}`);continue}t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`)}return t.length?`?${t.join("&")}`:""}function Jb(){try{return localStorage.getItem(sf)}catch{return null}}async function Gr(e,t,n={}){const r=t+Xb(n.query),i={...n.headers??{}},o=Jb();o&&!i.Authorization&&(i.Authorization=`Bearer ${o}`);let a;n.body!==void 0&&n.body!==null&&(n.body instanceof FormData||typeof n.body=="string"?a=n.body:(i["Content-Type"]=i["Content-Type"]??"application/json",a=JSON.stringify(n.body)));let s;try{s=await fetch(r,{method:e,headers:i,body:a,credentials:"same-origin",signal:n.signal})}catch(u){const d=u instanceof Error?u.message:String(u);throw new Va({code:"NETWORK",message:d,status:0})}if(s.status===204)return;const c=(s.headers.get("content-type")||"").includes("application/json");if(!s.ok){let u=`HTTP_${s.status}`,d=s.statusText,h=!1;if(c)try{const f=await s.json();f.error&&(d=f.error),f.code&&(u=f.code,h=!0)}catch{}if(h||(s.status===401&&(u="AUTH_INVALID"),s.status===403&&(u="FORBIDDEN"),s.status===404&&(u="NOT_FOUND"),s.status===413&&(u="PAYLOAD_TOO_LARGE")),s.status===401&&!t.startsWith("/api/auth/")){try{localStorage.removeItem(sf)}catch{}const f=encodeURIComponent(location.pathname+location.search);location.pathname.startsWith("/login")||(location.href=`/login?next=${f}`)}throw new Va({code:u,message:d,status:s.status})}return c?await s.json():await s.text()}class Va extends Error{code;status;constructor(t){super(t.message),this.name="ApiClientError",this.code=t.code,this.status=t.status}}const K={get:(e,t)=>Gr("GET",e,t),post:(e,t)=>Gr("POST",e,t),put:(e,t)=>Gr("PUT",e,t),patch:(e,t)=>Gr("PATCH",e,t),delete:(e,t)=>Gr("DELETE",e,t)},Zb={getA2ARecent:e=>K.get("/api/a2a/recent",{query:e}),getA2AStats:()=>K.get("/api/a2a/stats"),removeAdminAllowlist:e=>K.delete("/api/admin-allowlist",{body:e}),listAdminAllowlist:()=>K.get("/api/admin-allowlist"),addAdminAllowlist:e=>K.post("/api/admin-allowlist",{body:e}),getAgentHealth:e=>K.get("/api/agent-health",e),discoverAcpAgents:e=>K.post("/api/agents/acp/discover",{body:e}),testAcpAgent:e=>K.post("/api/agents/acp/test",{body:e}),testEmail:()=>K.post("/api/messengers/email/test"),getSearchProviders:()=>K.get("/api/search/providers"),testSearchProvider:e=>K.post("/api/search/test",{body:e}),generateMobileQR:e=>K.post("/api/mobile/qr",{body:e??{}}),getAgentsStatus:()=>K.get("/api/agents/status"),listApprovals:()=>K.get("/api/approvals"),resolveApproval:(e,t)=>K.post(`/api/approvals/${encodeURIComponent(e)}/resolve`,{body:t}),getAudit:e=>K.get("/api/audit",{query:e}),login:e=>K.post("/api/auth/login",{body:e}),logout:e=>K.post("/api/auth/logout",e),listBgJobs:e=>K.get("/api/bgjobs",{query:e}),getConfig:()=>K.get("/api/config"),updateConfig:e=>K.put("/api/config",{body:e}),listWorkspacesFull:()=>K.get("/api/workspaces",{query:{full:!0}}),upsertWorkspace:e=>K.post("/api/workspaces",{body:e}),startWechatQr:()=>K.post("/api/messengers/wechat/qr-start"),getWechatQrStatus:e=>K.get("/api/messengers/wechat/qr-status",{query:e}),getEnv:e=>K.get("/api/env",{query:e}),updateEnv:e=>K.put("/api/env",{body:e}),getHealth:e=>K.get("/api/health",e),getHealthSummary:e=>K.get("/api/health/summary",{query:e}),getHealthTopN:e=>K.get("/api/health/topn",{query:e}),invoke:e=>K.post("/api/invoke",e),listJobs:e=>K.get("/api/jobs",{query:e}),createJob:e=>K.post("/api/jobs",{body:e}),batchCancelJobs:e=>K.post("/api/jobs/batch-cancel",{body:e}),batchRunJobs:e=>K.post("/api/jobs/batch-run",{body:e}),submitLoc:e=>K.post("/api/loc",e),getLocInfo:e=>K.get("/api/loc/info",e),consolidateMemory:()=>K.post("/api/memory/consolidate"),getMemoryConsolidateStatus:()=>K.get("/api/memory/consolidate/status"),exportMemory:e=>K.get("/api/memory/export",e),deleteMemoryFacts:(e,t)=>K.delete("/api/memory/facts",{query:e,body:t}),deleteMemoryFactById:(e,t)=>K.delete(`/api/memory/facts/${e}`,{query:t}),listMemoryFacts:e=>K.get("/api/memory/facts",{query:e}),deleteMemoryPersona:e=>K.delete("/api/memory/persona",{query:e}),getMemoryPersona:e=>K.get("/api/memory/persona",{query:e}),updateMemoryPersona:(e,t)=>K.put("/api/memory/persona",{query:e,body:t}),listMemoryUsers:()=>K.get("/api/memory/users"),backfillMemoryVector:(e,t)=>K.post("/api/memory/vector/backfill",{query:e,body:t}),clearMemoryVector:e=>K.post("/api/memory/vector/clear",{query:e}),downloadMemoryVector:()=>K.post("/api/memory/vector/download"),getMemoryVectorStatus:e=>K.get("/api/memory/vector/status",{query:e}),testMemoryVector:()=>K.post("/api/memory/vector/test"),listMemos:e=>K.get("/api/memos",{query:e}),deleteMemo:e=>K.delete(`/api/memos/${e}`),getMetrics:e=>K.get("/api/metrics",e),notify:e=>K.post("/api/notify",e),listOutbox:e=>K.get("/api/outbox",{query:e}),getOutboxStats:()=>K.get("/api/outbox/stats"),retryOutbox:e=>K.post(`/api/outbox/${e}/retry`),listReminders:e=>K.get("/api/reminders",{query:e}),cancelReminder:e=>K.post(`/api/reminders/${e}/cancel`),snoozeReminder:(e,t)=>K.post(`/api/reminders/${e}/snooze`,{body:t}),listSchedules:e=>K.get("/api/schedules",{query:e}),restartService:()=>K.post("/api/service/restart"),startService:()=>K.post("/api/service/start"),getServiceStatus:()=>K.get("/api/service/status"),stopService:()=>K.post("/api/service/stop"),listSkills:()=>K.get("/api/skills"),getSkillDetail:e=>K.get(`/api/skills/${encodeURIComponent(e)}`),getSkillsRemoteHot:()=>K.get("/api/skills/remote/hot"),listSubtasks:e=>K.get("/api/subtasks",{query:e}),listViewerPastes:e=>K.get("/api/viewer",e),getViewerTunnel:()=>K.get("/api/viewer/tunnel"),getWorkspaceFiles:e=>K.get("/api/workspace-files",{query:e}),writeWorkspaceFile:(e,t)=>K.put("/api/workspace-files",{query:e,body:t})};function ex(e,t){if(e instanceof Va){const n=t("errors:UNKNOWN",{code:e.code,detail:e.message,defaultValue:e.message}),r=t(`errors:${e.code}`,{defaultValue:n,detail:e.message});return{code:e.code,message:r}}return e instanceof Error?{code:"UNKNOWN",message:t("errors:UNKNOWN",{code:e.name,defaultValue:e.message})}:{code:"UNKNOWN",message:t("errors:UNKNOWN",{code:"UNKNOWN",defaultValue:String(e)})}}const lf=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:we("rounded-lg border border-border bg-surface text-text shadow-sm",e),...t}));lf.displayName="Card";const cf=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:we("flex flex-col space-y-1 p-3 sm:p-4",e),...t}));cf.displayName="CardHeader";const uf=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:we("text-md font-semibold leading-tight",e),...t}));uf.displayName="CardTitle";const df=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:we("text-sm text-text-dim",e),...t}));df.displayName="CardDescription";const ff=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:we("p-3 pt-0 sm:p-4 sm:pt-0",e),...t}));ff.displayName="CardContent";const hf=g.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:we("flex items-center p-5 pt-0 sm:p-6 sm:pt-0 gap-2",e),...t}));hf.displayName="CardFooter";const gr=g.forwardRef(({className:e,type:t,...n},r)=>y.jsx("input",{type:t,className:we("flex h-8 w-full rounded-md border border-border bg-surface","px-3 py-1 text-sm shadow-sm","file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-text-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55",e),ref:r,...n}));gr.displayName="Input";var tx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],De=tx.reduce((e,t)=>{const n=Sr(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function nx(e,t){e&&Pr.flushSync(()=>e.dispatchEvent(t))}var rx="Label",pf=g.forwardRef((e,t)=>y.jsx(De.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));pf.displayName=rx;var mf=pf;const ix=As("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Bn=g.forwardRef(({className:e,...t},n)=>y.jsx(mf,{ref:n,className:we(ix(),e),...t}));Bn.displayName=mf.displayName;function ox(e){if(!e)return"/";try{const t=decodeURIComponent(e);if(t.startsWith("/")&&!t.startsWith("//"))return t}catch{}return"/"}function ax(){const{t:e}=st(),t=Eo(),[n]=ly(),r=Es(c=>c.setToken),[i,o]=g.useState(""),a=ox(n.get("next")),s=Rn({mutationFn:c=>Zb.login({token:c}),onSuccess:()=>{r(i.trim()),Xe.success(e("states.saved")),t(a,{replace:!0})},onError:c=>{const{message:u}=ex(c,e);Xe.error(u)}});function l(c){c.preventDefault();const u=i.trim();u&&s.mutate(u)}return y.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8 pt-safe",children:y.jsxs(lf,{className:"w-full max-w-md",children:[y.jsxs(cf,{children:[y.jsxs(uf,{className:"text-xl",children:[y.jsx("span",{className:"mr-2",children:"🤖"}),e("appName")]}),y.jsx(df,{children:e("login.intro",{defaultValue:"Paste your access token from `agim token bootstrap` (first boot) or `agim token create`."})})]}),y.jsx(ff,{children:y.jsxs("form",{onSubmit:l,className:"flex flex-col gap-4",children:[y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(Bn,{htmlFor:"token",children:e("login.tokenLabel",{defaultValue:"Access token"})}),y.jsx(gr,{id:"token",type:"password",value:i,onChange:c=>o(c.target.value),placeholder:"agim_••••••••",autoComplete:"off",autoFocus:!0,required:!0})]}),y.jsx(at,{type:"submit",size:"lg",disabled:s.isPending||i.trim().length===0,children:s.isPending?e("states.loading"):e("login.submit",{defaultValue:"Sign in"})})]})}),y.jsx(hf,{className:"block text-xs text-text-muted",children:e("login.hint",{defaultValue:"Loopback (127.0.0.1) requests bypass this check; you only see this page when accessing agim from another host or with IMHUB_TRUST_LOOPBACK=off."})})]})})}const wc=[1e3,2e3,5e3,1e4,3e4];function sx(e){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${e}`}let Qr=null;function lx(){if(Qr)return Qr;let e=null,t="connecting",n=0,r=null,i=!1;const o=new Set;function a(v){t=v;for(const b of o)b.type==="status"&&b.fn(v)}function s(v){for(const b of o)b.type==="message"&&b.fn(v)}function l(){r!=null&&(clearTimeout(r),r=null)}function c(){if(i)return;l();const v=wc[Math.min(n,wc.length-1)]??3e4;n+=1,r=setTimeout(()=>u(),v)}function u(){l(),a("connecting");try{e=new WebSocket(sx("/ws"))}catch(v){a("error"),console.warn("[ws] construct failed",v),c();return}e.addEventListener("open",()=>{n=0,a("open")}),e.addEventListener("message",v=>{let b;try{b=JSON.parse(v.data)}catch{console.warn("[ws] bad json",v.data?.slice?.(0,200));return}s(b)}),e.addEventListener("close",()=>{a("closed"),i||c()}),e.addEventListener("error",()=>{a("error")})}function d(v){if(!e||e.readyState!==WebSocket.OPEN)return!1;try{return e.send(JSON.stringify(v)),!0}catch{return!1}}function h(v){return o.add(v),v.type==="status"&&v.fn(t),()=>{o.delete(v)}}function f(){i=!0,l();try{e?.close()}catch{}e=null,Qr=null}function m(){document.visibilityState==="visible"&&(!e||e.readyState===WebSocket.CLOSED)&&(n=0,u())}function p(){n=0,(!e||e.readyState!==WebSocket.OPEN)&&u()}return document.addEventListener("visibilitychange",m),window.addEventListener("online",p),u(),Qr={send:d,subscribe:h,status:()=>t,close:()=>{document.removeEventListener("visibilitychange",m),window.removeEventListener("online",p),f()}},Qr}const cx=1200,ux={messages:[],pendingApprovals:[],runActivities:[],activeRunId:null,agents:[],agent:"",status:"connecting",currentReplyId:null,error:null},dx=24;function fx(e,t){switch(t.kind){case"WS_STATUS":return{...e,status:t.status};case"INIT":return{...e,agents:t.agents,agent:e.agent||t.defaultAgent};case"HISTORY":return{...e,messages:t.messages,agent:t.agent};case"AGENTS":return{...e,agents:t.agents};case"AGENT_SWITCHED":return{...e,agent:t.agent};case"SEND_USER":return{...e,messages:[...e.messages,t.message,t.placeholder],currentReplyId:t.placeholder.id,error:null};case"CHUNK":{const n=e.messages.findIndex(o=>o.id===t.replyId);if(n<0)return e;const r=[...e.messages],i=r[n];return i&&(r[n]={...i,content:i.content+t.text}),{...e,messages:r}}case"DONE":{const n=e.messages.findIndex(o=>o.id===t.replyId);if(n<0)return{...e,currentReplyId:null};const r=[...e.messages],i=r[n];return i&&(r[n]={...i,content:t.finalText||i.content}),{...e,messages:r,currentReplyId:null}}case"ERROR":return{...e,error:t.message,currentReplyId:null};case"APPROVAL_CARD":return e.pendingApprovals.some(n=>n.messageId===t.messageId)?e:{...e,pendingApprovals:[...e.pendingApprovals,{messageId:t.messageId,prompt:t.prompt}]};case"APPROVAL_TEXT":return e;case"APPROVAL_EDIT":{const n=e.pendingApprovals.findIndex(o=>o.messageId===t.messageId);if(n<0)return e;const r=[...e.pendingApprovals],i=r[n];return i&&(r[n]={...i,outcome:t.outcome,resolvedAt:Date.now()}),{...e,pendingApprovals:r}}case"APPROVAL_DISMISS":return{...e,pendingApprovals:e.pendingApprovals.filter(n=>n.messageId!==t.messageId)};case"RUN_START":{const n=[{runId:t.runId,agent:t.agent,startedAt:t.startedAt,status:"running"},...e.runActivities.filter(r=>r.runId!==t.runId)];return{...e,runActivities:n.slice(0,dx),activeRunId:t.runId}}case"RUN_USAGE":{const n=e.runActivities.findIndex(o=>o.runId===t.runId);if(n<0)return e;const r=[...e.runActivities],i=r[n];return i&&(r[n]={...i,durationMs:t.durationMs,outputChars:t.outputChars}),{...e,runActivities:r}}case"RUN_FINISH":{const n=e.runActivities.findIndex(o=>o.runId===t.runId);if(n<0)return{...e,activeRunId:e.activeRunId===t.runId?null:e.activeRunId};const r=[...e.runActivities],i=r[n];return i&&(r[n]={...i,status:t.status,finishedAt:t.finishedAt,durationMs:t.durationMs,error:t.error}),{...e,runActivities:r,activeRunId:e.activeRunId===t.runId?null:e.activeRunId}}case"RESET_CONVERSATION":return{...e,messages:[],pendingApprovals:[],runActivities:[],activeRunId:null,currentReplyId:null,error:null};case"CLEAR_ERROR":return{...e,error:null}}}function hx(e){switch(e.decision){case"allowed":Xe.success("已批准");return;case"allowed-pinned":Xe.success("已批准 · 后续同类自动放行");return;case"denied":Xe.error("已拒绝");return;case"denied-revoked":Xe.error("已拒绝 · 撤销自动放行规则");return;case"expired":Xe.warning("已过期");return}}let kc=0;function Sc(e){return kc+=1,`${e}-${Date.now()}-${kc}`}function px(){const[e,t]=g.useReducer(fx,ux),n=g.useRef(lx()),r=g.useRef(new Map),i=g.useRef(!1),o=g.useRef(null);g.useEffect(()=>{o.current=e.currentReplyId},[e.currentReplyId]),g.useEffect(()=>{const f=n.current,m=f.subscribe({type:"status",fn:A=>t({kind:"WS_STATUS",status:A})}),p=f.subscribe({type:"message",fn:A=>a(A)});function v(){try{const P=localStorage.getItem("agim-web-thread-id");if(P&&/^web-[A-Za-z0-9_-]{4,64}$/.test(P))return P}catch{}const A=`web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;try{localStorage.setItem("agim-web-thread-id",A)}catch{}return A}const b=v();function x(){f.send({type:"get-history",threadId:b}),f.send({type:"get-agents"})}let w=()=>{};return f.status()==="open"?x():w=f.subscribe({type:"status",fn:A=>{A==="open"&&(x(),w())}}),()=>{m(),p(),w()}},[]);function a(f){switch(f.type){case"init":t({kind:"INIT",agents:f.agents,defaultAgent:f.defaultAgent});return;case"history":t({kind:"HISTORY",agent:f.agent,messages:f.messages.map((m,p)=>({id:`hist-${p}`,role:m.role,content:m.content,agent:m.agent,timestamp:m.timestamp?Date.parse(m.timestamp):Date.now()-p*1e3}))});return;case"agents":t({kind:"AGENTS",agents:f.agents});return;case"agent-switched":t({kind:"AGENT_SWITCHED",agent:f.agent});return;case"run-start":t({kind:"RUN_START",runId:f.runId,agent:f.agent,startedAt:Number.isFinite(Date.parse(f.startedAt))?Date.parse(f.startedAt):Date.now()});return;case"usage":t({kind:"RUN_USAGE",runId:f.runId,durationMs:f.durationMs,outputChars:f.outputChars});return;case"run-finish":t({kind:"RUN_FINISH",runId:f.runId,status:f.status,finishedAt:Number.isFinite(Date.parse(f.finishedAt))?Date.parse(f.finishedAt):Date.now(),durationMs:f.durationMs,error:f.error});return;case"chunk":s(f.text);return;case"done":l(),t({kind:"DONE",replyId:o.current??"",finalText:f.text});return;case"error":l(),t({kind:"ERROR",message:f.message});return;case"approval-card":t({kind:"APPROVAL_CARD",messageId:f.messageId,prompt:f.prompt});return;case"approval-card-edit":t({kind:"APPROVAL_EDIT",messageId:f.messageId,outcome:f.outcome}),hx(f.outcome),window.setTimeout(()=>{t({kind:"APPROVAL_DISMISS",messageId:f.messageId})},cx);return;case"approval-text":Xe.info(f.text);return;case"metrics":return;default:return}}function s(f){const m=o.current;if(!m)return;const p=r.current.get(m)??"";r.current.set(m,p+f),!i.current&&(i.current=!0,requestAnimationFrame(()=>{i.current=!1,l()}))}function l(){for(const[f,m]of r.current.entries())m&&t({kind:"CHUNK",replyId:f,text:m});r.current.clear()}function c(f){const m=f.trim();if(!m)return;const p=n.current,v=Sc("u"),b=Sc("a");t({kind:"SEND_USER",message:{id:v,role:"user",content:m,timestamp:Date.now()},placeholder:{id:b,role:"assistant",content:"",agent:e.agent,timestamp:Date.now()}}),p.send({type:"message",text:m,agent:e.agent})||t({kind:"ERROR",message:"Not connected. Reconnecting…"})}function u(f){n.current.send({type:"switch-agent",agent:f})}function d(f,m,p){const v=n.current.send({type:"approval-action",data:`apv:${m}:${p}`,messageId:f});return v||t({kind:"ERROR",message:"Not connected. Reconnecting — try clicking again in a moment."}),v}function h(){t({kind:"RESET_CONVERSATION"}),n.current.send({type:"new-conversation"})}return{state:e,send:c,switchAgent:u,approvalClick:d,newConversation:h,clearError:()=>t({kind:"CLEAR_ERROR"})}}const mx=As(["inline-flex items-center gap-1","rounded-full border px-2 py-0.5","text-xs font-semibold uppercase tracking-wide leading-5","transition-colors"].join(" "),{variants:{variant:{default:"bg-surface-2 text-text-dim border-transparent",secondary:"bg-surface-2 text-text border-border",outline:"bg-transparent text-text-dim border-border",success:"bg-success-bg text-success border-transparent",warning:"bg-warning-bg text-warning border-transparent",danger:"bg-danger-bg text-danger border-transparent",info:"bg-info-bg text-info border-transparent",accent:"bg-accent-bg text-accent border-transparent"}},defaultVariants:{variant:"default"}});function dt({className:e,variant:t,...n}){return y.jsx("span",{className:we(mx({variant:t}),e),...n})}function gx(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const yx=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vx=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bx={};function Cc(e,t){return(bx.jsx?vx:yx).test(e)}const xx=/[ \t\n\f\r]/g;function wx(e){return typeof e=="object"?e.type==="text"?Ec(e.value):!1:Ec(e)}function Ec(e){return e.replace(xx,"")===""}class yi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yi.prototype.normal={};yi.prototype.property={};yi.prototype.space=void 0;function gf(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new yi(n,r,t)}function Ka(e){return e.toLowerCase()}class vt{constructor(t,n){this.attribute=n,this.property=t}}vt.prototype.attribute="";vt.prototype.booleanish=!1;vt.prototype.boolean=!1;vt.prototype.commaOrSpaceSeparated=!1;vt.prototype.commaSeparated=!1;vt.prototype.defined=!1;vt.prototype.mustUseProperty=!1;vt.prototype.number=!1;vt.prototype.overloadedBoolean=!1;vt.prototype.property="";vt.prototype.spaceSeparated=!1;vt.prototype.space=void 0;let kx=0;const ue=tr(),Ge=tr(),Wa=tr(),H=tr(),Me=tr(),Wn=tr(),xt=tr();function tr(){return 2**++kx}const qa=Object.freeze(Object.defineProperty({__proto__:null,boolean:ue,booleanish:Ge,commaOrSpaceSeparated:xt,commaSeparated:Wn,number:H,overloadedBoolean:Wa,spaceSeparated:Me},Symbol.toStringTag,{value:"Module"})),ta=Object.keys(qa);class Ns extends vt{constructor(t,n,r,i){let o=-1;if(super(t,n),Ac(this,"space",i),typeof r=="number")for(;++o<ta.length;){const a=ta[o];Ac(this,ta[o],(r&qa[a])===qa[a])}}}Ns.prototype.defined=!0;function Ac(e,t,n){n&&(e[t]=n)}function Nr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Ns(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Ka(r)]=r,n[Ka(o.attribute)]=r}return new yi(t,n,e.space)}const yf=Nr({properties:{ariaActiveDescendant:null,ariaAtomic:Ge,ariaAutoComplete:null,ariaBusy:Ge,ariaChecked:Ge,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:Me,ariaCurrent:null,ariaDescribedBy:Me,ariaDetails:null,ariaDisabled:Ge,ariaDropEffect:Me,ariaErrorMessage:null,ariaExpanded:Ge,ariaFlowTo:Me,ariaGrabbed:Ge,ariaHasPopup:null,ariaHidden:Ge,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Me,ariaLevel:H,ariaLive:null,ariaModal:Ge,ariaMultiLine:Ge,ariaMultiSelectable:Ge,ariaOrientation:null,ariaOwns:Me,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:Ge,ariaReadOnly:Ge,ariaRelevant:null,ariaRequired:Ge,ariaRoleDescription:Me,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:Ge,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function vf(e,t){return t in e?e[t]:t}function bf(e,t){return vf(e,t.toLowerCase())}const Sx=Nr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wn,acceptCharset:Me,accessKey:Me,action:null,allow:null,allowFullScreen:ue,allowPaymentRequest:ue,allowUserMedia:ue,alpha:ue,alt:null,as:null,async:ue,autoCapitalize:null,autoComplete:Me,autoFocus:ue,autoPlay:ue,blocking:Me,capture:null,charSet:null,checked:ue,cite:null,className:Me,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:Ge,controls:ue,controlsList:Me,coords:H|Wn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ue,defer:ue,dir:null,dirName:null,disabled:ue,download:Wa,draggable:Ge,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ue,formTarget:null,headers:Me,height:H,hidden:Wa,high:H,href:null,hrefLang:null,htmlFor:Me,httpEquiv:Me,id:null,imageSizes:null,imageSrcSet:null,inert:ue,inputMode:null,integrity:null,is:null,isMap:ue,itemId:null,itemProp:Me,itemRef:Me,itemScope:ue,itemType:Me,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ue,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:ue,muted:ue,name:null,nonce:null,noModule:ue,noValidate:ue,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ue,optimum:H,pattern:null,ping:Me,placeholder:null,playsInline:ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ue,referrerPolicy:null,rel:Me,required:ue,reversed:ue,rows:H,rowSpan:H,sandbox:Me,scope:null,scoped:ue,seamless:ue,selected:ue,shadowRootClonable:ue,shadowRootCustomElementRegistry:ue,shadowRootDelegatesFocus:ue,shadowRootMode:null,shadowRootSerializable:ue,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:Ge,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:ue,useMap:null,value:Ge,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Me,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ue,declare:ue,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:ue,noHref:ue,noShade:ue,noWrap:ue,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:Ge,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ue,disablePictureInPicture:ue,disableRemotePlayback:ue,exportParts:Wn,part:Me,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:bf}),Cx=Nr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:xt,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:Me,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Wn,g2:Wn,glyphName:Wn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:xt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Me,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xt,rev:xt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xt,requiredFeatures:xt,requiredFonts:xt,requiredFormats:xt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:xt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xt,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vf}),xf=Nr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),wf=Nr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:bf}),kf=Nr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ex={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Ax=/[A-Z]/g,Rc=/-[a-z]/g,Rx=/^data[-\w.:]+$/i;function Tx(e,t){const n=Ka(t);let r=t,i=vt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Rx.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Rc,Ix);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Rc.test(o)){let a=o.replace(Ax,Px);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Ns}return new i(r,t)}function Px(e){return"-"+e.toLowerCase()}function Ix(e){return e.charAt(1).toUpperCase()}const Lx=gf([yf,Sx,xf,wf,kf],"html"),_s=gf([yf,Cx,xf,wf,kf],"svg");function Ox(e){return e.join(" ").trim()}var Ds={},Tc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Nx=/\n/g,_x=/^\s*/,Dx=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Mx=/^:\s*/,jx=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Fx=/^[;\s]*/,Ux=/^\s+|\s+$/g,Hx=`
|
|
135
|
-
`,Pc="/",Ic="*",zn="",Bx="comment",zx="declaration";function $x(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var p=m.match(Nx);p&&(n+=p.length);var v=m.lastIndexOf(Hx);r=~v?m.length-v:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new a(m),c(),p}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var v=p[0];return i(v),e=e.slice(v.length),p}}function c(){l(_x)}function u(m){var p;for(m=m||[];p=d();)p!==!1&&m.push(p);return m}function d(){var m=o();if(!(Pc!=e.charAt(0)||Ic!=e.charAt(1))){for(var p=2;zn!=e.charAt(p)&&(Ic!=e.charAt(p)||Pc!=e.charAt(p+1));)++p;if(p+=2,zn===e.charAt(p-1))return s("End of comment missing");var v=e.slice(2,p-2);return r+=2,i(v),e=e.slice(p),r+=2,m({type:Bx,comment:v})}}function h(){var m=o(),p=l(Dx);if(p){if(d(),!l(Mx))return s("property missing ':'");var v=l(jx),b=m({type:zx,property:Lc(p[0].replace(Tc,zn)),value:v?Lc(v[0].replace(Tc,zn)):zn});return l(Fx),b}}function f(){var m=[];u(m);for(var p;p=h();)p!==!1&&(m.push(p),u(m));return m}return c(),f()}function Lc(e){return e?e.replace(Ux,zn):zn}var Vx=$x,Kx=Qi&&Qi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.default=qx;const Wx=Kx(Vx);function qx(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Wx.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:a,value:s}=o;i?t(a,s,o):s&&(n=n||{},n[a]=s)}),n}var Ro={};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.camelCase=void 0;var Gx=/^--[a-zA-Z0-9_-]+$/,Qx=/-([a-z])/g,Yx=/^[^-]+$/,Xx=/^-(webkit|moz|ms|o|khtml)-/,Jx=/^-(ms)-/,Zx=function(e){return!e||Yx.test(e)||Gx.test(e)},ew=function(e,t){return t.toUpperCase()},Oc=function(e,t){return"".concat(t,"-")},tw=function(e,t){return t===void 0&&(t={}),Zx(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Jx,Oc):e=e.replace(Xx,Oc),e.replace(Qx,ew))};Ro.camelCase=tw;var nw=Qi&&Qi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},rw=nw(Ds),iw=Ro;function Ga(e,t){var n={};return!e||typeof e!="string"||(0,rw.default)(e,function(r,i){r&&i&&(n[(0,iw.camelCase)(r,t)]=i)}),n}Ga.default=Ga;var ow=Ga;const aw=md(ow),Sf=Cf("end"),Ms=Cf("start");function Cf(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function sw(e){const t=Ms(e),n=Sf(e);if(t&&n)return{start:t,end:n}}function ti(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Nc(e.position):"start"in e||"end"in e?Nc(e):"line"in e||"column"in e?Qa(e):""}function Qa(e){return _c(e&&e.line)+":"+_c(e&&e.column)}function Nc(e){return Qa(e&&e.start)+"-"+Qa(e&&e.end)}function _c(e){return e&&typeof e=="number"?e:1}class lt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=ti(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}lt.prototype.file="";lt.prototype.name="";lt.prototype.reason="";lt.prototype.message="";lt.prototype.stack="";lt.prototype.column=void 0;lt.prototype.line=void 0;lt.prototype.ancestors=void 0;lt.prototype.cause=void 0;lt.prototype.fatal=void 0;lt.prototype.place=void 0;lt.prototype.ruleId=void 0;lt.prototype.source=void 0;const js={}.hasOwnProperty,lw=new Map,cw=/[A-Z]/g,uw=new Set(["table","tbody","thead","tfoot","tr"]),dw=new Set(["td","th"]),Ef="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function fw(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=xw(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");r=bw(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,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"?_s:Lx,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Af(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Af(e,t,n){if(t.type==="element")return hw(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return pw(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return gw(e,t,n);if(t.type==="mdxjsEsm")return mw(e,t);if(t.type==="root")return yw(e,t,n);if(t.type==="text")return vw(e,t)}function hw(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=_s,e.schema=i),e.ancestors.push(t);const o=Tf(e,t.tagName,!1),a=ww(e,t);let s=Us(e,t);return uw.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!wx(l):!0})),Rf(e,a,o,t),Fs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function pw(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ci(e,t.position)}function mw(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ci(e,t.position)}function gw(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=_s,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Tf(e,t.name,!0),a=kw(e,t),s=Us(e,t);return Rf(e,a,o,t),Fs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function yw(e,t,n){const r={};return Fs(r,Us(e,t)),e.create(t,e.Fragment,r,n)}function vw(e,t){return t.value}function Rf(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Fs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function bw(e,t,n){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?n:t;return s?c(o,a,s):c(o,a)}}function xw(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=Ms(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function ww(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&js.call(t.properties,i)){const o=Sw(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&dw.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function kw(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else ci(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else ci(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Us(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:lw;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const s=Af(e,o,a);s!==void 0&&n.push(s)}return n}function Sw(e,t,n){const r=Tx(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?gx(n):Ox(n)),r.property==="style"){let i=typeof n=="object"?n:Cw(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Ew(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Ex[r.property]||r.property:r.attribute,n]}}function Cw(e,t){try{return aw(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new lt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Ef+"#cannot-parse-style-attribute",i}}function Tf(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=Cc(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=Cc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return js.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ci(e)}function ci(e,t){const n=new lt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Ef+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ew(e){const t={};let n;for(n in e)js.call(e,n)&&(t[Aw(n)]=e[n]);return t}function Aw(e){let t=e.replace(cw,Rw);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Rw(e){return"-"+e.toLowerCase()}const na={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Tw={};function Hs(e,t){const n=Tw,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Pf(e,r,i)}function Pf(e,t,n){if(Pw(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Dc(e.children,t,n)}return Array.isArray(e)?Dc(e,t,n):""}function Dc(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Pf(e[i],t,n);return r.join("")}function Pw(e){return!!(e&&typeof e=="object")}const Mc=document.createElement("i");function Bs(e){const t="&"+e+";";Mc.innerHTML=t;const n=Mc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ct(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function Rt(e,t){return e.length>0?(Ct(e,e.length,0,t),e):t}const jc={}.hasOwnProperty;function If(e){const t={};let n=-1;for(;++n<e.length;)Iw(t,e[n]);return t}function Iw(e,t){let n;for(n in t){const i=(jc.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){jc.call(i,a)||(i[a]=[]);const s=o[a];Lw(i[a],Array.isArray(s)?s:s?[s]:[])}}}function Lw(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ct(e,0,0,r)}function Lf(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&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 _t(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ft=Tn(/[A-Za-z]/),ot=Tn(/[\dA-Za-z]/),Ow=Tn(/[#-'*+\--9=?A-Z^-~]/);function ro(e){return e!==null&&(e<32||e===127)}const Ya=Tn(/\d/),Nw=Tn(/[\dA-Fa-f]/),_w=Tn(/[!-/:-@[-`{-~]/);function oe(e){return e!==null&&e<-2}function je(e){return e!==null&&(e<0||e===32)}function Se(e){return e===-2||e===-1||e===32}const To=Tn(/\p{P}|\p{S}/u),Yn=Tn(/\s/);function Tn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function _r(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&ot(e.charCodeAt(n+1))&&ot(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Re(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return Se(l)?(e.enter(n),s(l)):t(l)}function s(l){return Se(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const Dw={tokenize:Mw};function Mw(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Re(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return oe(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const jw={tokenize:Fw},Fc={tokenize:Uw};function Fw(e){const t=this,n=[];let r=0,i,o,a;return s;function s(w){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const A=t.events.length;let P=A,E;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){E=t.events[P][1].end;break}b(r);let k=A;for(;k<t.events.length;)t.events[k][1].end={...E},k++;return Ct(t.events,P+1,0,t.events.slice(A)),t.events.length=k,c(w)}return s(w)}function c(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Fc,u,d)(w)}function u(w){return i&&x(),b(r),h(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(Fc,f,m)(w)}function f(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&x(),b(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){v(e.exit("chunkFlow"),!0),b(0),e.consume(w);return}return oe(w)?(e.consume(w),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),p)}function v(w,A){const P=t.sliceStream(w);if(A&&P.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(P),t.parser.lazy[w.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<a&&(!i.events[E][1].end||i.events[E][1].end.offset>a))return;const k=t.events.length;let N=k,M,R;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(M){R=t.events[N][1].end;break}M=!0}for(b(r),E=k;E<t.events.length;)t.events[E][1].end={...R},E++;Ct(t.events,N+1,0,t.events.slice(k)),t.events.length=E}}function b(w){let A=n.length;for(;A-- >w;){const P=n[A];t.containerState=P[1],P[0].exit.call(t,e)}n.length=w}function x(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Uw(e,t,n){return Re(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cr(e){if(e===null||je(e)||Yn(e))return 1;if(To(e))return 2}function Po(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Xa={name:"attention",resolveAll:Hw,tokenize:Bw};function Hw(e,t){let n=-1,r,i,o,a,s,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};Uc(d,-l),Uc(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Rt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Rt(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=Rt(c,Po(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Rt(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Rt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Ct(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Bw(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Cr(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const c=e.exit("attentionSequence"),u=Cr(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!h)),c._close=!!(o===42?h:h&&(u||!d)),t(l)}}function Uc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const zw={name:"autolink",tokenize:$w};function $w(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return ft(f)?(e.consume(f),a):f===64?n(f):c(f)}function a(f){return f===43||f===45||f===46||ot(f)?(r=1,s(f)):c(f)}function s(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||ot(f))&&r++<32?(e.consume(f),s):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||ro(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):Ow(f)?(e.consume(f),c):n(f)}function u(f){return ot(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||ot(f))&&r++<63){const m=f===45?h:d;return e.consume(f),m}return n(f)}}const vi={partial:!0,tokenize:Vw};function Vw(e,t,n){return r;function r(o){return Se(o)?Re(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||oe(o)?t(o):n(o)}}const Of={continuation:{tokenize:Ww},exit:qw,name:"blockQuote",tokenize:Kw};function Kw(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Se(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Ww(e,t,n){const r=this;return i;function i(a){return Se(a)?Re(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(Of,t,n)(a)}}function qw(e){e.exit("blockQuote")}const Nf={name:"characterEscape",tokenize:Gw};function Gw(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return _w(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const _f={name:"characterReference",tokenize:Qw};function Qw(e,t,n){const r=this;let i=0,o,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=ot,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Nw,u):(e.enter("characterReferenceValue"),o=7,a=Ya,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return a===ot&&!Bs(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<o?(e.consume(d),u):n(d)}}const Hc={partial:!0,tokenize:Xw},Bc={concrete:!0,name:"codeFenced",tokenize:Yw};function Yw(e,t,n){const r=this,i={partial:!0,tokenize:P};let o=0,a=0,s;return l;function l(E){return c(E)}function c(E){const k=r.events[r.events.length-1];return o=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,s=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(E)}function u(E){return E===s?(a++,e.consume(E),u):a<3?n(E):(e.exit("codeFencedFenceSequence"),Se(E)?Re(e,d,"whitespace")(E):d(E))}function d(E){return E===null||oe(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Hc,p,A)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||oe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(E)):Se(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Re(e,f,"whitespace")(E)):E===96&&E===s?n(E):(e.consume(E),h)}function f(E){return E===null||oe(E)?d(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||oe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(E)):E===96&&E===s?n(E):(e.consume(E),m)}function p(E){return e.attempt(i,A,v)(E)}function v(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),b}function b(E){return o>0&&Se(E)?Re(e,x,"linePrefix",o+1)(E):x(E)}function x(E){return E===null||oe(E)?e.check(Hc,p,A)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||oe(E)?(e.exit("codeFlowValue"),x(E)):(e.consume(E),w)}function A(E){return e.exit("codeFenced"),t(E)}function P(E,k,N){let M=0;return R;function R($){return E.enter("lineEnding"),E.consume($),E.exit("lineEnding"),_}function _($){return E.enter("codeFencedFence"),Se($)?Re(E,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):L($)}function L($){return $===s?(E.enter("codeFencedFenceSequence"),z($)):N($)}function z($){return $===s?(M++,E.consume($),z):M>=a?(E.exit("codeFencedFenceSequence"),Se($)?Re(E,U,"whitespace")($):U($)):N($)}function U($){return $===null||oe($)?(E.exit("codeFencedFence"),k($)):N($)}}}function Xw(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const ra={name:"codeIndented",tokenize:Zw},Jw={partial:!0,tokenize:ek};function Zw(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Re(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):oe(c)?e.attempt(Jw,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||oe(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function ek(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Re(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):oe(a)?i(a):n(a)}}const tk={name:"codeText",previous:rk,resolve:nk,tokenize:ik};function nk(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function rk(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ik(e,t,n){let r=0,i,o;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||oe(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class ok{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=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 t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Yr(this.left,r),o.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),Yr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Yr(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<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Yr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Yr(this.left,n.reverse())}}}function Yr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Df(e){const t={};let n=-1,r,i,o,a,s,l,c;const u=new ok(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ak(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=u.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Ct(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function ak(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,h=-1,f=n,m=0,p=0;const v=[p];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<s.length;)s[h][0]==="exit"&&s[h-1][0]==="enter"&&s[h][1].type===s[h-1][1].type&&s[h][1].start.line!==s[h][1].end.line&&(p=h+1,v.push(p),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):v.pop(),h=v.length;h--;){const b=s.slice(v[h],v[h+1]),x=o.pop();l.push([x,x+b.length-1]),e.splice(x,2,b)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const sk={resolve:ck,tokenize:uk},lk={partial:!0,tokenize:dk};function ck(e){return Df(e),e}function uk(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):oe(s)?e.check(lk,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function dk(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Re(e,o,"linePrefix")}function o(a){if(a===null||oe(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Mf(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(b){return b===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(b),e.exit(o),h):b===null||b===32||b===41||ro(b)?n(b):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(b))}function h(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===62?(e.exit("chunkString"),e.exit(s),h(b)):b===null||b===60||oe(b)?n(b):(e.consume(b),b===92?m:f)}function m(b){return b===60||b===62||b===92?(e.consume(b),f):f(b)}function p(b){return!u&&(b===null||b===41||je(b))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(b)):u<c&&b===40?(e.consume(b),u++,p):b===41?(e.consume(b),u--,p):b===null||b===32||b===40||ro(b)?n(b):(e.consume(b),b===92?v:p)}function v(b){return b===40||b===41||b===92?(e.consume(b),p):p(b)}}function jf(e,t,n,r,i,o){const a=this;let s=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),u}function u(f){return s>999||f===null||f===91||f===93&&!l||f===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):oe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||oe(f)||s++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!Se(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),s++,d):d(f)}}function Ff(e,t,n,r,i,o){let a;return s;function s(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===a?(e.exit(o),l(a)):h===null?n(h):oe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Re(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===a||h===null||oe(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===a||h===92?(e.consume(h),u):u(h)}}function ni(e,t){let n;return r;function r(i){return oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Se(i)?Re(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const fk={name:"definition",tokenize:pk},hk={partial:!0,tokenize:mk};function pk(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),a(f)}function a(f){return jf.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function s(f){return i=_t(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return je(f)?ni(e,c)(f):c(f)}function c(f){return Mf(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(hk,d,d)(f)}function d(f){return Se(f)?Re(e,h,"whitespace")(f):h(f)}function h(f){return f===null||oe(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function mk(e,t,n){return r;function r(s){return je(s)?ni(e,i)(s):n(s)}function i(s){return Ff(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Se(s)?Re(e,a,"whitespace")(s):a(s)}function a(s){return s===null||oe(s)?t(s):n(s)}}const gk={name:"hardBreakEscape",tokenize:yk};function yk(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return oe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const vk={name:"headingAtx",resolve:bk,tokenize:xk};function bk(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ct(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function xk(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||je(u)?(e.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||oe(u)?(e.exit("atxHeading"),t(u)):Se(u)?Re(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||je(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const wk=["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"],zc=["pre","script","style","textarea"],kk={concrete:!0,name:"htmlFlow",resolveTo:Ek,tokenize:Ak},Sk={partial:!0,tokenize:Tk},Ck={partial:!0,tokenize:Rk};function Ek(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 Ak(e,t,n){const r=this;let i,o,a,s,l;return c;function c(C){return u(C)}function u(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),d}function d(C){return C===33?(e.consume(C),h):C===47?(e.consume(C),o=!0,p):C===63?(e.consume(C),i=3,r.interrupt?t:S):ft(C)?(e.consume(C),a=String.fromCharCode(C),v):n(C)}function h(C){return C===45?(e.consume(C),i=2,f):C===91?(e.consume(C),i=5,s=0,m):ft(C)?(e.consume(C),i=4,r.interrupt?t:S):n(C)}function f(C){return C===45?(e.consume(C),r.interrupt?t:S):n(C)}function m(C){const ae="CDATA[";return C===ae.charCodeAt(s++)?(e.consume(C),s===ae.length?r.interrupt?t:L:m):n(C)}function p(C){return ft(C)?(e.consume(C),a=String.fromCharCode(C),v):n(C)}function v(C){if(C===null||C===47||C===62||je(C)){const ae=C===47,me=a.toLowerCase();return!ae&&!o&&zc.includes(me)?(i=1,r.interrupt?t(C):L(C)):wk.includes(a.toLowerCase())?(i=6,ae?(e.consume(C),b):r.interrupt?t(C):L(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?x(C):w(C))}return C===45||ot(C)?(e.consume(C),a+=String.fromCharCode(C),v):n(C)}function b(C){return C===62?(e.consume(C),r.interrupt?t:L):n(C)}function x(C){return Se(C)?(e.consume(C),x):R(C)}function w(C){return C===47?(e.consume(C),R):C===58||C===95||ft(C)?(e.consume(C),A):Se(C)?(e.consume(C),w):R(C)}function A(C){return C===45||C===46||C===58||C===95||ot(C)?(e.consume(C),A):P(C)}function P(C){return C===61?(e.consume(C),E):Se(C)?(e.consume(C),P):w(C)}function E(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),l=C,k):Se(C)?(e.consume(C),E):N(C)}function k(C){return C===l?(e.consume(C),l=null,M):C===null||oe(C)?n(C):(e.consume(C),k)}function N(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||je(C)?P(C):(e.consume(C),N)}function M(C){return C===47||C===62||Se(C)?w(C):n(C)}function R(C){return C===62?(e.consume(C),_):n(C)}function _(C){return C===null||oe(C)?L(C):Se(C)?(e.consume(C),_):n(C)}function L(C){return C===45&&i===2?(e.consume(C),Q):C===60&&i===1?(e.consume(C),Y):C===62&&i===4?(e.consume(C),ie):C===63&&i===3?(e.consume(C),S):C===93&&i===5?(e.consume(C),F):oe(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Sk,Z,z)(C)):C===null||oe(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),L)}function z(C){return e.check(Ck,U,Z)(C)}function U(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),$}function $(C){return C===null||oe(C)?z(C):(e.enter("htmlFlowData"),L(C))}function Q(C){return C===45?(e.consume(C),S):L(C)}function Y(C){return C===47?(e.consume(C),a="",V):L(C)}function V(C){if(C===62){const ae=a.toLowerCase();return zc.includes(ae)?(e.consume(C),ie):L(C)}return ft(C)&&a.length<8?(e.consume(C),a+=String.fromCharCode(C),V):L(C)}function F(C){return C===93?(e.consume(C),S):L(C)}function S(C){return C===62?(e.consume(C),ie):C===45&&i===2?(e.consume(C),S):L(C)}function ie(C){return C===null||oe(C)?(e.exit("htmlFlowData"),Z(C)):(e.consume(C),ie)}function Z(C){return e.exit("htmlFlow"),t(C)}}function Rk(e,t,n){const r=this;return i;function i(a){return oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Tk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(vi,t,n)}}const Pk={name:"htmlText",tokenize:Ik};function Ik(e,t,n){const r=this;let i,o,a;return s;function s(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),l}function l(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),P):S===63?(e.consume(S),w):ft(S)?(e.consume(S),N):n(S)}function c(S){return S===45?(e.consume(S),u):S===91?(e.consume(S),o=0,m):ft(S)?(e.consume(S),x):n(S)}function u(S){return S===45?(e.consume(S),f):n(S)}function d(S){return S===null?n(S):S===45?(e.consume(S),h):oe(S)?(a=d,Y(S)):(e.consume(S),d)}function h(S){return S===45?(e.consume(S),f):d(S)}function f(S){return S===62?Q(S):S===45?h(S):d(S)}function m(S){const ie="CDATA[";return S===ie.charCodeAt(o++)?(e.consume(S),o===ie.length?p:m):n(S)}function p(S){return S===null?n(S):S===93?(e.consume(S),v):oe(S)?(a=p,Y(S)):(e.consume(S),p)}function v(S){return S===93?(e.consume(S),b):p(S)}function b(S){return S===62?Q(S):S===93?(e.consume(S),b):p(S)}function x(S){return S===null||S===62?Q(S):oe(S)?(a=x,Y(S)):(e.consume(S),x)}function w(S){return S===null?n(S):S===63?(e.consume(S),A):oe(S)?(a=w,Y(S)):(e.consume(S),w)}function A(S){return S===62?Q(S):w(S)}function P(S){return ft(S)?(e.consume(S),E):n(S)}function E(S){return S===45||ot(S)?(e.consume(S),E):k(S)}function k(S){return oe(S)?(a=k,Y(S)):Se(S)?(e.consume(S),k):Q(S)}function N(S){return S===45||ot(S)?(e.consume(S),N):S===47||S===62||je(S)?M(S):n(S)}function M(S){return S===47?(e.consume(S),Q):S===58||S===95||ft(S)?(e.consume(S),R):oe(S)?(a=M,Y(S)):Se(S)?(e.consume(S),M):Q(S)}function R(S){return S===45||S===46||S===58||S===95||ot(S)?(e.consume(S),R):_(S)}function _(S){return S===61?(e.consume(S),L):oe(S)?(a=_,Y(S)):Se(S)?(e.consume(S),_):M(S)}function L(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,z):oe(S)?(a=L,Y(S)):Se(S)?(e.consume(S),L):(e.consume(S),U)}function z(S){return S===i?(e.consume(S),i=void 0,$):S===null?n(S):oe(S)?(a=z,Y(S)):(e.consume(S),z)}function U(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||je(S)?M(S):(e.consume(S),U)}function $(S){return S===47||S===62||je(S)?M(S):n(S)}function Q(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function Y(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),V}function V(S){return Se(S)?Re(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):F(S)}function F(S){return e.enter("htmlTextData"),a(S)}}const zs={name:"labelEnd",resolveAll:_k,resolveTo:Dk,tokenize:Mk},Lk={tokenize:jk},Ok={tokenize:Fk},Nk={tokenize:Uk};function _k(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ct(e,0,e.length,n),e}function Dk(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=Rt(s,e.slice(o+1,o+r+3)),s=Rt(s,[["enter",u,t]]),s=Rt(s,Po(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=Rt(s,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),s=Rt(s,e.slice(a+1)),s=Rt(s,[["exit",l,t]]),Ct(e,o,e.length,s),e}function Mk(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(h){return o?o._inactive?d(h):(a=r.parser.defined.includes(_t(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Lk,u,a?u:d)(h):h===91?e.attempt(Ok,u,a?c:d)(h):a?u(h):d(h)}function c(h){return e.attempt(Nk,u,d)(h)}function u(h){return t(h)}function d(h){return o._balanced=!0,n(h)}}function jk(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return je(d)?ni(e,o)(d):o(d)}function o(d){return d===41?u(d):Mf(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return je(d)?ni(e,l)(d):u(d)}function s(d){return n(d)}function l(d){return d===34||d===39||d===40?Ff(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return je(d)?ni(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function Fk(e,t,n){const r=this;return i;function i(s){return jf.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(_t(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function Uk(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Hk={name:"labelStartImage",resolveAll:zs.resolveAll,tokenize:Bk};function Bk(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const zk={name:"labelStartLink",resolveAll:zs.resolveAll,tokenize:$k};function $k(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ia={name:"lineEnding",tokenize:Vk};function Vk(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Re(e,t,"linePrefix")}}const $i={name:"thematicBreak",tokenize:Kk};function Kk(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||oe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Se(c)?Re(e,s,"whitespace")(c):s(c))}}const mt={continuation:{tokenize:Qk},exit:Xk,name:"list",tokenize:Gk},Wk={partial:!0,tokenize:Jk},qk={partial:!0,tokenize:Yk};function Gk(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Ya(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check($i,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return Ya(f)&&++a<10?(e.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(vi,r.interrupt?n:u,e.attempt(Wk,h,d))}function u(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return Se(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Qk(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(vi,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Re(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Se(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(qk,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Re(e,e.attempt(mt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Yk(e,t,n){const r=this;return Re(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function Xk(e){e.exit(this.containerState.type)}function Jk(e,t,n){const r=this;return Re(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Se(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const $c={name:"setextUnderline",resolveTo:Zk,tokenize:eS};function Zk(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function eS(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Se(c)?Re(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||oe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const tS={tokenize:nS};function nS(e){const t=this,n=e.attempt(vi,r,e.attempt(this.parser.constructs.flowInitial,i,Re(e,e.attempt(this.parser.constructs.flow,i,e.attempt(sk,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const rS={resolveAll:Hf()},iS=Uf("string"),oS=Uf("text");function Uf(e){return{resolveAll:Hf(e==="text"?aS:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(u){return c(u)?o(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Hf(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function aS(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const sS={42:mt,43:mt,45:mt,48:mt,49:mt,50:mt,51:mt,52:mt,53:mt,54:mt,55:mt,56:mt,57:mt,62:Of},lS={91:fk},cS={[-2]:ra,[-1]:ra,32:ra},uS={35:vk,42:$i,45:[$c,$i],60:kk,61:$c,95:$i,96:Bc,126:Bc},dS={38:_f,92:Nf},fS={[-5]:ia,[-4]:ia,[-3]:ia,33:Hk,38:_f,42:Xa,60:[zw,Pk],91:zk,92:[gk,Nf],93:zs,95:Xa,96:tk},hS={null:[Xa,rS]},pS={null:[42,95]},mS={null:[]},gS=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:pS,contentInitial:lS,disable:mS,document:sS,flow:uS,flowInitial:cS,insideSpan:hS,string:dS,text:fS},Symbol.toStringTag,{value:"Module"}));function yS(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[];const l={attempt:k(P),check:k(E),consume:x,enter:w,exit:A,interrupt:k(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(_){return a=Rt(a,_),v(),a[a.length-1]!==null?[]:(N(t,0),c.events=Po(o,c.events,c),c.events)}function h(_,L){return bS(f(_),L)}function f(_){return vS(a,_)}function m(){const{_bufferIndex:_,_index:L,line:z,column:U,offset:$}=r;return{_bufferIndex:_,_index:L,line:z,column:U,offset:$}}function p(_){i[_.line]=_.column,R()}function v(){let _;for(;r._index<a.length;){const L=a[r._index];if(typeof L=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<L.length;)b(L.charCodeAt(r._bufferIndex));else b(L)}}function b(_){u=u(_)}function x(_){oe(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,R()):_!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=_}function w(_,L){const z=L||{};return z.type=_,z.start=m(),c.events.push(["enter",z,c]),s.push(z),z}function A(_){const L=s.pop();return L.end=m(),c.events.push(["exit",L,c]),L}function P(_,L){N(_,L.from)}function E(_,L){L.restore()}function k(_,L){return z;function z(U,$,Q){let Y,V,F,S;return Array.isArray(U)?Z(U):"tokenize"in U?Z([U]):ie(U);function ie(ve){return q;function q(he){const Pe=he!==null&&ve[he],be=he!==null&&ve.null,ke=[...Array.isArray(Pe)?Pe:Pe?[Pe]:[],...Array.isArray(be)?be:be?[be]:[]];return Z(ke)(he)}}function Z(ve){return Y=ve,V=0,ve.length===0?Q:C(ve[V])}function C(ve){return q;function q(he){return S=M(),F=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?me():ve.tokenize.call(L?Object.assign(Object.create(c),L):c,l,ae,me)(he)}}function ae(ve){return _(F,S),$}function me(ve){return S.restore(),++V<Y.length?C(Y[V]):Q}}}function N(_,L){_.resolveAll&&!o.includes(_)&&o.push(_),_.resolve&&Ct(c.events,L,c.events.length-L,_.resolve(c.events.slice(L),c)),_.resolveTo&&(c.events=_.resolveTo(c.events,c))}function M(){const _=m(),L=c.previous,z=c.currentConstruct,U=c.events.length,$=Array.from(s);return{from:U,restore:Q};function Q(){r=_,c.previous=L,c.currentConstruct=z,c.events.length=U,s=$,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function vS(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function bS(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
|
|
136
|
-
`;break}case-3:{a=`\r
|
|
137
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function xS(e){const r={constructs:If([gS,...(e||{}).extensions||[]]),content:i(Dw),defined:[],document:i(jw),flow:i(tS),lazy:{},string:i(iS),text:i(oS)};return r;function i(o){return a;function a(s){return yS(r,o,s)}}}function wS(e){for(;!Df(e););return e}const Vc=/[\0\t\n\r]/g;function kS(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let c,u,d,h,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(Vc.lastIndex=d,c=Vc.exec(o),h=c&&c.index!==void 0?c.index:o.length,f=o.charCodeAt(h),!c){t=o.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(o.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const SS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function CS(e){return e.replace(SS,ES)}function ES(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Lf(n.slice(o?2:1),o?16:10)}return Bs(n)||e}const Bf={}.hasOwnProperty;function AS(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),RS(n)(wS(xS(n).document().write(kS()(e,t,!0))))}function RS(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(On),autolinkProtocol:M,autolinkEmail:M,atxHeading:o(Ft),blockQuote:o(be),characterEscape:M,characterReference:M,codeFenced:o(ke),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(ke,a),codeText:o(pe,a),codeTextData:M,data:M,codeFlowValue:M,definition:o(We),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Ye),hardBreakEscape:o(tt),hardBreakTrailing:o(tt),htmlFlow:o(Ut,a),htmlFlowData:M,htmlText:o(Ut,a),htmlTextData:M,image:o(Ln),label:a,link:o(On),listItem:o(Jt),listItemValue:h,listOrdered:o(Nn,d),listUnordered:o(Nn),paragraph:o(rr),reference:C,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Ft),strong:o(Tt),thematicBreak:o(Zt)},exit:{atxHeading:l(),atxHeadingSequence:P,autolink:l(),autolinkEmail:Pe,autolinkProtocol:he,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ve,characterReference:q,codeFenced:l(v),codeFencedFence:p,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:l(b),codeText:l($),codeTextData:R,data:R,definition:l(),definitionDestinationString:A,definitionLabelString:x,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(z),htmlFlowData:R,htmlText:l(U),htmlTextData:R,image:l(Y),label:F,labelText:V,lineEnding:_,link:l(Q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ae,resourceDestinationString:S,resourceTitleString:ie,resource:Z,setextHeading:l(N),setextHeadingLineSequence:k,setextHeadingText:E,strong:l(),thematicBreak:l()}};zf(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(D){let B={type:"root",children:[]};const ne={stack:[B],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},se=[];let Ce=-1;for(;++Ce<D.length;)if(D[Ce][1].type==="listOrdered"||D[Ce][1].type==="listUnordered")if(D[Ce][0]==="enter")se.push(Ce);else{const Ze=se.pop();Ce=i(D,Ze,Ce)}for(Ce=-1;++Ce<D.length;){const Ze=t[D[Ce][0]];Bf.call(Ze,D[Ce][1].type)&&Ze[D[Ce][1].type].call(Object.assign({sliceSerialize:D[Ce][2].sliceSerialize},ne),D[Ce][1])}if(ne.tokenStack.length>0){const Ze=ne.tokenStack[ne.tokenStack.length-1];(Ze[1]||Kc).call(ne,void 0,Ze[0])}for(B.position={start:mn(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:mn(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce<t.transforms.length;)B=t.transforms[Ce](B)||B;return B}function i(D,B,ne){let se=B-1,Ce=-1,Ze=!1,At,$e,ct,It;for(;++se<=ne;){const Be=D[se];switch(Be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Be[0]==="enter"?Ce++:Ce--,It=void 0;break}case"lineEndingBlank":{Be[0]==="enter"&&(At&&!It&&!Ce&&!ct&&(ct=se),It=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:It=void 0}if(!Ce&&Be[0]==="enter"&&Be[1].type==="listItemPrefix"||Ce===-1&&Be[0]==="exit"&&(Be[1].type==="listUnordered"||Be[1].type==="listOrdered")){if(At){let Ht=se;for($e=void 0;Ht--;){const pt=D[Ht];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;$e&&(D[$e][1].type="lineEndingBlank",Ze=!0),pt[1].type="lineEnding",$e=Ht}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarker"||pt[1].type==="listItemIndent"))break}ct&&(!$e||ct<$e)&&(At._spread=!0),At.end=Object.assign({},$e?D[$e][1].start:Be[1].end),D.splice($e||se,0,["exit",At,Be[2]]),se++,ne++}if(Be[1].type==="listItemPrefix"){const Ht={type:"listItem",_spread:!1,start:Object.assign({},Be[1].start),end:void 0};At=Ht,D.splice(se,0,["enter",Ht,Be[2]]),se++,ne++,ct=void 0,It=!0}}}return D[B][1]._spread=Ze,ne}function o(D,B){return ne;function ne(se){s.call(this,D(se),se),B&&B.call(this,se)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(D,B,ne){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([B,ne||void 0]),D.position={start:mn(B.start),end:void 0}}function l(D){return B;function B(ne){D&&D.call(this,ne),c.call(this,ne)}}function c(D,B){const ne=this.stack.pop(),se=this.tokenStack.pop();if(se)se[0].type!==D.type&&(B?B.call(this,D,se[0]):(se[1]||Kc).call(this,D,se[0]));else throw new Error("Cannot close `"+D.type+"` ("+ti({start:D.start,end:D.end})+"): it’s not open");ne.position.end=mn(D.end)}function u(){return Hs(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(D){if(this.data.expectingFirstListItemValue){const B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function f(){const D=this.resume(),B=this.stack[this.stack.length-1];B.lang=D}function m(){const D=this.resume(),B=this.stack[this.stack.length-1];B.meta=D}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const D=this.resume(),B=this.stack[this.stack.length-1];B.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const D=this.resume(),B=this.stack[this.stack.length-1];B.value=D.replace(/(\r?\n|\r)$/g,"")}function x(D){const B=this.resume(),ne=this.stack[this.stack.length-1];ne.label=B,ne.identifier=_t(this.sliceSerialize(D)).toLowerCase()}function w(){const D=this.resume(),B=this.stack[this.stack.length-1];B.title=D}function A(){const D=this.resume(),B=this.stack[this.stack.length-1];B.url=D}function P(D){const B=this.stack[this.stack.length-1];if(!B.depth){const ne=this.sliceSerialize(D).length;B.depth=ne}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function k(D){const B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function M(D){const ne=this.stack[this.stack.length-1].children;let se=ne[ne.length-1];(!se||se.type!=="text")&&(se=Pt(),se.position={start:mn(D.start),end:void 0},ne.push(se)),this.stack.push(se)}function R(D){const B=this.stack.pop();B.value+=this.sliceSerialize(D),B.position.end=mn(D.end)}function _(D){const B=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ne=B.children[B.children.length-1];ne.position.end=mn(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(B.type)&&(M.call(this,D),R.call(this,D))}function L(){this.data.atHardBreak=!0}function z(){const D=this.resume(),B=this.stack[this.stack.length-1];B.value=D}function U(){const D=this.resume(),B=this.stack[this.stack.length-1];B.value=D}function $(){const D=this.resume(),B=this.stack[this.stack.length-1];B.value=D}function Q(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=B,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function Y(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=B,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(D){const B=this.sliceSerialize(D),ne=this.stack[this.stack.length-2];ne.label=CS(B),ne.identifier=_t(B).toLowerCase()}function F(){const D=this.stack[this.stack.length-1],B=this.resume(),ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,ne.type==="link"){const se=D.children;ne.children=se}else ne.alt=B}function S(){const D=this.resume(),B=this.stack[this.stack.length-1];B.url=D}function ie(){const D=this.resume(),B=this.stack[this.stack.length-1];B.title=D}function Z(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function ae(D){const B=this.resume(),ne=this.stack[this.stack.length-1];ne.label=B,ne.identifier=_t(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function me(D){this.data.characterReferenceType=D.type}function ve(D){const B=this.sliceSerialize(D),ne=this.data.characterReferenceType;let se;ne?(se=Lf(B,ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):se=Bs(B);const Ce=this.stack[this.stack.length-1];Ce.value+=se}function q(D){const B=this.stack.pop();B.position.end=mn(D.end)}function he(D){R.call(this,D);const B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(D)}function Pe(D){R.call(this,D);const B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(D)}function be(){return{type:"blockquote",children:[]}}function ke(){return{type:"code",lang:null,meta:null,value:""}}function pe(){return{type:"inlineCode",value:""}}function We(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ye(){return{type:"emphasis",children:[]}}function Ft(){return{type:"heading",depth:0,children:[]}}function tt(){return{type:"break"}}function Ut(){return{type:"html",value:""}}function Ln(){return{type:"image",title:null,url:"",alt:null}}function On(){return{type:"link",title:null,url:"",children:[]}}function Nn(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function Jt(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function rr(){return{type:"paragraph",children:[]}}function Tt(){return{type:"strong",children:[]}}function Pt(){return{type:"text",value:""}}function Zt(){return{type:"thematicBreak"}}}function mn(e){return{line:e.line,column:e.column,offset:e.offset}}function zf(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?zf(e,r):TS(e,r)}}function TS(e,t){let n;for(n in t)if(Bf.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Kc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ti({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ti({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ti({start:t.start,end:t.end})+") is still open")}function PS(e){const t=this;t.parser=n;function n(r){return AS(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function IS(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function LS(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
138
|
-
`}]}function OS(e,t){const n=t.value?t.value+`
|
|
139
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function NS(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _S(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DS(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=_r(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function MS(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 jS(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $f(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function FS(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $f(e,t);const i={src:_r(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function US(e,t){const n={src:_r(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 r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function HS(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function BS(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return $f(e,t);const i={href:_r(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function zS(e,t){const n={href:_r(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function $S(e,t,n){const r=e.all(t),i=n?VS(n):Vf(t),o={},a=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const u=r[s];(i||s!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
|
|
140
|
-
`}),u.type==="element"&&u.tagName==="p"&&!i?a.push(...u.children):a.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
|
|
141
|
-
`});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)}function VS(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Vf(n[r])}return t}function Vf(e){const t=e.spread;return t??e.children.length>1}function KS(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function WS(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qS(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function GS(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function QS(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Ms(t.children[1]),l=Sf(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function YS(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const d=t.children[l],h={},f=a?a[l]:void 0;f&&(h.align=f);let m={type:"element",tagName:o,properties:h,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function XS(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Wc=9,qc=32;function JS(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Gc(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Gc(t.slice(i),i>0,!1)),o.join("")}function Gc(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Wc||o===qc;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Wc||o===qc;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ZS(e,t){const n={type:"text",value:JS(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function e0(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const t0={blockquote:IS,break:LS,code:OS,delete:NS,emphasis:_S,footnoteReference:DS,heading:MS,html:jS,imageReference:FS,image:US,inlineCode:HS,linkReference:BS,link:zS,listItem:$S,list:KS,paragraph:WS,root:qS,strong:GS,table:QS,tableCell:XS,tableRow:YS,text:ZS,thematicBreak:e0,toml:Pi,yaml:Pi,definition:Pi,footnoteDefinition:Pi};function Pi(){}const Kf=-1,Io=0,ri=1,io=2,$s=3,Vs=4,Ks=5,Ws=6,Wf=7,qf=8,n0=typeof self=="object"?self:globalThis,Qc=(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 n0[e](t)},r0=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case Io:case Kf:return n(a,i);case ri:{const s=n([],i);for(const l of a)s.push(r(l));return s}case io:{const s=n({},i);for(const[l,c]of a)s[r(l)]=r(c);return s}case $s:return n(new Date(a),i);case Vs:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case Ks:{const s=n(new Map,i);for(const[l,c]of a)s.set(r(l),r(c));return s}case Ws:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case Wf:{const{name:s,message:l}=a;return n(Qc(s,l),i)}case qf:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(Qc(o,a),i)};return r},Yc=e=>r0(new Map,e)(0),lr="",{toString:i0}={},{keys:o0}=Object,Xr=e=>{const t=typeof e;if(t!=="object"||!e)return[Io,t];const n=i0.call(e).slice(8,-1);switch(n){case"Array":return[ri,lr];case"Object":return[io,lr];case"Date":return[$s,lr];case"RegExp":return[Vs,lr];case"Map":return[Ks,lr];case"Set":return[Ws,lr];case"DataView":return[ri,n]}return n.includes("Array")?[ri,n]:n.includes("Error")?[Wf,n]:[io,n]},Ii=([e,t])=>e===Io&&(t==="function"||t==="symbol"),a0=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=Xr(a);switch(s){case Io:{let u=a;switch(l){case"bigint":s=qf,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([Kf],a)}return i([s,u],a)}case ri:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const u=[],d=i([s,u],a);for(const h of a)u.push(o(h));return d}case io:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const u=[],d=i([s,u],a);for(const h of o0(a))(e||!Ii(Xr(a[h])))&&u.push([o(h),o(a[h])]);return d}case $s:return i([s,a.toISOString()],a);case Vs:{const{source:u,flags:d}=a;return i([s,{source:u,flags:d}],a)}case Ks:{const u=[],d=i([s,u],a);for(const[h,f]of a)(e||!(Ii(Xr(h))||Ii(Xr(f))))&&u.push([o(h),o(f)]);return d}case Ws:{const u=[],d=i([s,u],a);for(const h of a)(e||!Ii(Xr(h)))&&u.push(o(h));return d}}const{message:c}=a;return i([s,{name:l,message:c}],a)};return o},Xc=(e,{json:t,lossy:n}={})=>{const r=[];return a0(!(t||n),!!t,new Map,r)(e),r},oo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Yc(Xc(e,t)):structuredClone(e):(e,t)=>Yc(Xc(e,t));function s0(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 l0(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function c0(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||s0,r=e.options.footnoteBackLabel||l0,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=_r(d.toLowerCase());let f=0;const m=[],p=e.footnoteCounts.get(d);for(;p!==void 0&&++f<=p;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,f);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else u.push(...m);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,b),s.push(b)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...oo(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
142
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
|
|
143
|
-
`}]}}const Lo=function(e){if(e==null)return h0;if(typeof e=="function")return Oo(e);if(typeof e=="object")return Array.isArray(e)?u0(e):d0(e);if(typeof e=="string")return f0(e);throw new Error("Expected function, string, or object as test")};function u0(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Lo(e[n]);return Oo(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function d0(e){const t=e;return Oo(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function f0(e){return Oo(t);function t(n){return n&&n.type===e}}function Oo(e){return t;function t(n,r,i){return!!(p0(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function h0(){return!0}function p0(e){return e!==null&&typeof e=="object"&&"type"in e}const Gf=[],m0=!0,Ja=!1,g0="skip";function Qf(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Lo(i),a=r?-1:1;s(e,void 0,[])();function s(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=Gf,m,p,v;if((!t||o(l,c,u[u.length-1]||void 0))&&(f=y0(n(l,u)),f[0]===Ja))return f;if("children"in l&&l.children){const b=l;if(b.children&&f[0]!==g0)for(p=(r?b.children.length:-1)+a,v=u.concat(b);p>-1&&p<b.children.length;){const x=b.children[p];if(m=s(x,p,v)(),m[0]===Ja)return m;p=typeof m[1]=="number"?m[1]:p+a}}return f}}}function y0(e){return Array.isArray(e)?e:typeof e=="number"?[m0,e]:e==null?Gf:[e]}function qs(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),Qf(e,o,s,i);function s(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return a(l,d,u)}}const Za={}.hasOwnProperty,v0={};function b0(e,t){const n=t||v0,r=new Map,i=new Map,o=new Map,a={...t0,...n.handlers},s={all:c,applyData:w0,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:x0,wrap:S0};return qs(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),s;function l(u,d){const h=u.type,f=s.handlers[h];if(Za.call(s.handlers,h)&&f)return f(s,u,d);if(s.options.passThrough&&s.options.passThrough.includes(h)){if("children"in u){const{children:p,...v}=u,b=oo(v);return b.children=s.all(u),b}return oo(u)}return(s.options.unknownHandler||k0)(s,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const m=s.one(h[f],u);if(m){if(f&&h[f-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Jc(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=Jc(p.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function x0(e,t){e.position&&(t.position=sw(e))}function w0(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,oo(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function k0(e,t){const n=t.data||{},r="value"in t&&!(Za.call(n,"hProperties")||Za.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function S0(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
144
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
145
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
146
|
-
`}),n}function Jc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Zc(e,t){const n=b0(e,t),r=n.one(e,void 0),i=c0(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
147
|
-
`},i),o}function C0(e,t){return e&&"run"in e?async function(n,r){const i=Zc(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Zc(n,{file:r,...e||t})}}function eu(e){if(e)throw e}var Vi=Object.prototype.hasOwnProperty,Yf=Object.prototype.toString,tu=Object.defineProperty,nu=Object.getOwnPropertyDescriptor,ru=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Yf.call(t)==="[object Array]"},iu=function(t){if(!t||Yf.call(t)!=="[object Object]")return!1;var n=Vi.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Vi.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Vi.call(t,i)},ou=function(t,n){tu&&n.name==="__proto__"?tu(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},au=function(t,n){if(n==="__proto__")if(Vi.call(t,n)){if(nu)return nu(t,n).value}else return;return t[n]},E0=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=au(s,n),i=au(t,n),s!==i&&(u&&i&&(iu(i)||(o=ru(i)))?(o?(o=!1,a=r&&ru(r)?r:[]):a=r&&iu(r)?r:{},ou(s,{name:n,newValue:e(u,a,i)})):typeof i<"u"&&ou(s,{name:n,newValue:i}));return s};const oa=md(E0);function es(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function A0(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...c){const u=e[++o];let d=-1;if(l){a(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?R0(u,s)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function R0(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(c){const u=c;if(s&&n)throw u;return i(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const Kt={basename:T0,dirname:P0,extname:I0,join:L0,sep:"/"};function T0(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bi(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function P0(e){if(bi(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function I0(e){bi(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function L0(...e){let t=-1,n;for(;++t<e.length;)bi(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":O0(n)}function O0(e){bi(e);const t=e.codePointAt(0)===47;let n=N0(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function N0(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function bi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _0={cwd:D0};function D0(){return"/"}function ts(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function M0(e){if(typeof e=="string")e=new URL(e);else if(!ts(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 j0(e)}function j0(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const aa=["history","path","basename","stem","extname","dirname"];class Xf{constructor(t){let n;t?ts(t)?n={path:t}:typeof t=="string"||F0(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":_0.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<aa.length;){const o=aa[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)aa.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Kt.basename(this.path):void 0}set basename(t){la(t,"basename"),sa(t,"basename"),this.path=Kt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Kt.dirname(this.path):void 0}set dirname(t){su(this.basename,"dirname"),this.path=Kt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Kt.extname(this.path):void 0}set extname(t){if(sa(t,"extname"),su(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Kt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ts(t)&&(t=M0(t)),la(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Kt.basename(this.path,this.extname):void 0}set stem(t){la(t,"stem"),sa(t,"stem"),this.path=Kt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new lt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function sa(e,t){if(e&&e.includes(Kt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Kt.sep+"`")}function la(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function su(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function F0(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const U0=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},H0={}.hasOwnProperty;class Gs extends U0{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=A0()}copy(){const t=new Gs;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(oa(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(da("data",this.frozen),this.namespace[t]=n,this):H0.call(this.namespace,t)&&this.namespace[t]||void 0:t?(da("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Li(t),r=this.parser||this.Parser;return ca("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ca("process",this.parser||this.Parser),ua("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=Li(t),l=r.parse(s);r.run(l,s,function(u,d,h){if(u||!d||!h)return c(u);const f=d,m=r.stringify(f,h);$0(m)?h.value=m:h.result=m,c(u,h)});function c(u,d){u||!d?a(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),ca("processSync",this.parser||this.Parser),ua("processSync",this.compiler||this.Compiler),this.process(t,i),cu("processSync","process",n),r;function i(o,a){n=!0,eu(o),r=a}}run(t,n,r){lu(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const l=Li(n);i.run(t,l,c);function c(u,d,h){const f=d||t;u?s(u):a?a(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),cu("runSync","run",r),i;function o(a,s){eu(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=Li(n),i=this.compiler||this.Compiler;return ua("stringify",i),lu(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(da("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(i.settings=oa(!0,i.settings,c.settings))}function s(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...m]=u;const p=r[h][1];es(p)&&es(f)&&(f=oa(!0,p,f)),r[h]=[c,f,...m]}}}}const B0=new Gs().freeze();function ca(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ua(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function da(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 lu(e){if(!es(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function cu(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Li(e){return z0(e)?e:new Xf(e)}function z0(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $0(e){return typeof e=="string"||V0(e)}function V0(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const K0="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",uu=[],du={allowDangerousHtml:!0},W0=/^(https?|ircs?|mailto|xmpp)$/i,q0=[{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:"className",id:"remove-classname"},{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 G0(e){const t=Q0(e),n=Y0(e);return X0(t.runSync(t.parse(n),n),e)}function Q0(e){const t=e.rehypePlugins||uu,n=e.remarkPlugins||uu,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...du}:du;return B0().use(PS).use(n).use(C0,r).use(t)}function Y0(e){const t=e.children||"",n=new Xf;return typeof t=="string"&&(n.value=t),n}function X0(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||J0;for(const u of q0)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+K0+u.id,void 0);return qs(e,c),fw(e,{Fragment:y.Fragment,components:i,ignoreInvalidStyle:!0,jsx:y.jsx,jsxs:y.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return a?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let f;for(f in na)if(Object.hasOwn(na,f)&&Object.hasOwn(u.properties,f)){const m=u.properties[f],p=na[f];(p===null||p.includes(u.tagName))&&(u.properties[f]=l(String(m||""),f,u))}}if(u.type==="element"){let f=n?!n.includes(u.tagName):o?o.includes(u.tagName):!1;if(!f&&r&&typeof d=="number"&&(f=!r(u,d,h)),f&&h&&typeof d=="number")return s&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function J0(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||W0.test(e.slice(0,t))?e:""}function fu(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Z0(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function eC(e,t,n){const i=Lo((n||{}).ignore||[]),o=tC(t);let a=-1;for(;++a<o.length;)Qf(e,"text",s);function s(c,u){let d=-1,h;for(;++d<u.length;){const f=u[d],m=h?h.children:void 0;if(i(f,m?m.indexOf(f):void 0,h))return;h=f}if(h)return l(c,u)}function l(c,u){const d=u[u.length-1],h=o[a][0],f=o[a][1];let m=0;const v=d.children.indexOf(c);let b=!1,x=[];h.lastIndex=0;let w=h.exec(c.value);for(;w;){const A=w.index,P={index:w.index,input:w.input,stack:[...u,c]};let E=f(...w,P);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?h.lastIndex=A+1:(m!==A&&x.push({type:"text",value:c.value.slice(m,A)}),Array.isArray(E)?x.push(...E):E&&x.push(E),m=A+w[0].length,b=!0),!h.global)break;w=h.exec(c.value)}return b?(m<c.value.length&&x.push({type:"text",value:c.value.slice(m)}),d.children.splice(v,1,...x)):x=[c],v+x.length}}function tC(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([nC(i[0]),rC(i[1])])}return t}function nC(e){return typeof e=="string"?new RegExp(Z0(e),"g"):e}function rC(e){return typeof e=="function"?e:function(){return e}}const fa="phrasing",ha=["autolink","link","image","label"];function iC(){return{transforms:[dC],enter:{literalAutolink:aC,literalAutolinkEmail:pa,literalAutolinkHttp:pa,literalAutolinkWww:pa},exit:{literalAutolink:uC,literalAutolinkEmail:cC,literalAutolinkHttp:sC,literalAutolinkWww:lC}}}function oC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fa,notInConstruct:ha},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fa,notInConstruct:ha},{character:":",before:"[ps]",after:"\\/",inConstruct:fa,notInConstruct:ha}]}}function aC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pa(e){this.config.enter.autolinkProtocol.call(this,e)}function sC(e){this.config.exit.autolinkProtocol.call(this,e)}function lC(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function cC(e){this.config.exit.autolinkEmail.call(this,e)}function uC(e){this.exit(e)}function dC(e){eC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fC],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,hC]],{ignore:["link","linkReference"]})}function fC(e,t,n,r,i){let o="";if(!Jf(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!pC(n)))return!1;const a=mC(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function hC(e,t,n,r){return!Jf(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function pC(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function mC(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=fu(e,"(");let o=fu(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Jf(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Yn(n)||To(n))&&(!t||n!==47)}Zf.peek=CC;function gC(){this.buffer()}function yC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function vC(){this.buffer()}function bC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function xC(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_t(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wC(e){this.exit(e)}function kC(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_t(this.sliceSerialize(e)).toLowerCase(),n.label=t}function SC(e){this.exit(e)}function CC(){return"["}function Zf(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function EC(){return{enter:{gfmFootnoteCallString:gC,gfmFootnoteCall:yC,gfmFootnoteDefinitionLabelString:vC,gfmFootnoteDefinition:bC},exit:{gfmFootnoteCallString:xC,gfmFootnoteCall:wC,gfmFootnoteDefinitionLabelString:kC,gfmFootnoteDefinition:SC}}}function AC(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Zf},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const c=o.enter("footnoteDefinition"),u=o.enter("label");return l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"})),u(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
|
|
148
|
-
`:" ")+o.indentLines(o.containerFlow(r,s.current()),t?eh:RC))),c(),l}}function RC(e,t,n){return t===0?e:eh(e,t,n)}function eh(e,t,n){return(n?"":" ")+e}const TC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];th.peek=NC;function PC(){return{canContainEols:["delete"],enter:{strikethrough:LC},exit:{strikethrough:OC}}}function IC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:TC}],handlers:{delete:th}}}function LC(e){this.enter({type:"delete",children:[]},e)}function OC(e){this.exit(e)}function th(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function NC(){return"~"}function _C(e){return e.length}function DC(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||_C,o=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const p=[],v=[];let b=-1;for(e[u].length>c&&(c=e[u].length);++b<e[u].length;){const x=MC(e[u][b]);if(n.alignDelimiters!==!1){const w=i(x);v[b]=w,(l[b]===void 0||w>l[b])&&(l[b]=w)}p.push(x)}a[u]=p,s[u]=v}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=hu(r[d]);else{const p=hu(r);for(;++d<c;)o[d]=p}d=-1;const h=[],f=[];for(;++d<c;){const p=o[d];let v="",b="";p===99?(v=":",b=":"):p===108?v=":":p===114&&(b=":");let x=n.alignDelimiters===!1?1:Math.max(1,l[d]-v.length-b.length);const w=v+"-".repeat(x)+b;n.alignDelimiters!==!1&&(x=v.length+x+b.length,x>l[d]&&(l[d]=x),f[d]=x),h[d]=w}a.splice(1,0,h),s.splice(1,0,f),u=-1;const m=[];for(;++u<a.length;){const p=a[u],v=s[u];d=-1;const b=[];for(;++d<c;){const x=p[d]||"";let w="",A="";if(n.alignDelimiters!==!1){const P=l[d]-(v[d]||0),E=o[d];E===114?w=" ".repeat(P):E===99?P%2?(w=" ".repeat(P/2+.5),A=" ".repeat(P/2-.5)):(w=" ".repeat(P/2),A=w):A=" ".repeat(P)}n.delimiterStart!==!1&&!d&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&b.push(" "),n.alignDelimiters!==!1&&b.push(w),b.push(x),n.alignDelimiters!==!1&&b.push(A),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&b.push("|")}m.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
|
|
149
|
-
`)}function MC(e){return e==null?"":String(e)}function hu(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function jC(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),FC);return i(),a}function FC(e,t,n){return">"+(n?"":" ")+e}function UC(e,t){return pu(e,t.inConstruct,!0)&&!pu(e,t.notInConstruct,!1)}function pu(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function mu(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
150
|
-
`&&UC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
151
|
-
`}function HC(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function BC(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 zC(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 $C(e,t,n,r){const i=zC(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(BC(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(o,VC);return d(),h}const s=n.createTracker(r),l=i.repeat(Math.max(HC(o,i)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const d=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
152
|
-
`,encode:["`"],...s.current()})),d()}return u+=s.move(`
|
|
153
|
-
`),o&&(u+=s.move(o+`
|
|
154
|
-
`)),u+=s.move(l),c(),u}function VC(e,t,n){return(n?"":" ")+e}function Qs(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 KC(e,t,n,r){const i=Qs(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
155
|
-
`,...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),a(),c}function WC(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 ui(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ao(e,t,n){const r=Cr(e),i=Cr(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}nh.peek=qC;function nh(e,t,n,r){const i=WC(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=ao(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=ui(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=ao(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+ui(d));const f=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function qC(e,t,n){return n.options.emphasis||"*"}function GC(e,t){let n=!1;return qs(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ja}),!!((!e.depth||e.depth<3)&&Hs(e)&&(t.options.setext||n))}function QC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(GC(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
|
|
156
|
-
`,after:`
|
|
157
|
-
`});return d(),u(),h+`
|
|
158
|
-
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
159
|
-
`))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
160
|
-
`,...o.current()});return/^[\t ]/.test(c)&&(c=ui(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c}rh.peek=YC;function rh(e){return e.value||""}function YC(){return"<"}ih.peek=XC;function ih(e,t,n,r){const i=Qs(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),a(),c}function XC(){return"!"}oh.peek=JC;function oh(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),i==="full"||!c||c!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function JC(){return"!"}ah.peek=ZC;function ah(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],s=n.compilePattern(a);let l;if(a.atBreak)for(;l=s.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function ZC(){return"`"}function sh(e,t){const n=Hs(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}lh.peek=eE;function lh(e,t,n,r){const i=Qs(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(sh(e,n)){const u=n.stack;n.stack=[],s=n.enter("autolink");let d=a.move("<");return d+=a.move(n.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),s(),n.stack=u,d}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function eE(e,t,n){return sh(e,n)?"<":"["}ch.peek=tE;function ch(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),i==="full"||!c||c!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function tE(){return"["}function Ys(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 nE(e){const t=Ys(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 rE(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 uh(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 iE(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?rE(n):Ys(n);const s=e.ordered?a==="."?")":".":nE(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&u&&(!u.children||!u.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&&(l=!0),uh(n)===a&&u){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),c}function oE(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function aE(e,t,n,r){const i=oE(n);let o=n.bulletCurrent||Ys(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),u);return l(),c;function u(d,h,f){return h?(f?"":" ".repeat(a))+d:(f?o:o+" ".repeat(a-o.length))+d}}function sE(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const lE=Lo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function cE(e,t,n,r){return(e.children.some(function(a){return lE(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function uE(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}dh.peek=dE;function dh(e,t,n,r){const i=uE(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=ao(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=ui(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=ao(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+ui(d));const f=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function dE(e,t,n){return n.options.strong||"*"}function fE(e,t,n,r){return n.safe(e.value,r)}function hE(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 pE(e,t,n){const r=(uh(n)+(n.options.ruleSpaces?" ":"")).repeat(hE(n));return n.options.ruleSpaces?r.slice(0,-1):r}const fh={blockquote:jC,break:mu,code:$C,definition:KC,emphasis:nh,hardBreak:mu,heading:QC,html:rh,image:ih,imageReference:oh,inlineCode:ah,link:lh,linkReference:ch,list:iE,listItem:aE,paragraph:sE,root:cE,strong:dh,text:fE,thematicBreak:pE};function mE(){return{enter:{table:gE,tableData:gu,tableHeader:gu,tableRow:vE},exit:{codeText:bE,table:yE,tableData:ma,tableHeader:ma,tableRow:ma}}}function gE(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 yE(e){this.exit(e),this.data.inTable=void 0}function vE(e){this.enter({type:"tableRow",children:[]},e)}function ma(e){this.exit(e)}function gu(e){this.enter({type:"tableCell",children:[]},e)}function bE(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,xE));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function xE(e,t){return t==="|"?t:e}function wE(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
161
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:s}};function a(f,m,p,v){return c(u(f,p,v),f.align)}function s(f,m,p,v){const b=d(f,p,v),x=c([b]);return x.slice(0,x.indexOf(`
|
|
162
|
-
`))}function l(f,m,p,v){const b=p.enter("tableCell"),x=p.enter("phrasing"),w=p.containerPhrasing(f,{...v,before:o,after:o});return x(),b(),w}function c(f,m){return DC(f,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function u(f,m,p){const v=f.children;let b=-1;const x=[],w=m.enter("table");for(;++b<v.length;)x[b]=d(v[b],m,p);return w(),x}function d(f,m,p){const v=f.children;let b=-1;const x=[],w=m.enter("tableRow");for(;++b<v.length;)x[b]=l(v[b],f,m,p);return w(),x}function h(f,m,p){let v=fh.inlineCode(f,m,p);return p.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function kE(){return{exit:{taskListCheckValueChecked:yu,taskListCheckValueUnchecked:yu,paragraph:CE}}}function SE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:EE}}}function yu(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function CE(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function EE(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=fh.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+a}}function AE(){return[iC(),EC(),PC(),mE(),kE()]}function RE(e){return{extensions:[oC(),AC(e),IC(),wE(e),SE()]}}const TE={tokenize:_E,partial:!0},hh={tokenize:DE,partial:!0},ph={tokenize:ME,partial:!0},mh={tokenize:jE,partial:!0},PE={tokenize:FE,partial:!0},gh={name:"wwwAutolink",tokenize:OE,previous:vh},yh={name:"protocolAutolink",tokenize:NE,previous:bh},dn={name:"emailAutolink",tokenize:LE,previous:xh},Yt={};function IE(){return{text:Yt}}let jn=48;for(;jn<123;)Yt[jn]=dn,jn++,jn===58?jn=65:jn===91&&(jn=97);Yt[43]=dn;Yt[45]=dn;Yt[46]=dn;Yt[95]=dn;Yt[72]=[dn,yh];Yt[104]=[dn,yh];Yt[87]=[dn,gh];Yt[119]=[dn,gh];function LE(e,t,n){const r=this;let i,o;return a;function a(d){return!ns(d)||!xh.call(r,r.previous)||Xs(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return ns(d)?(e.consume(d),s):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(PE,u,c)(d):d===45||d===95||ot(d)?(o=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return o&&i&&ft(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function OE(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!vh.call(r,r.previous)||Xs(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(TE,e.attempt(hh,e.attempt(ph,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function NE(e,t,n){const r=this;let i="",o=!1;return a;function a(d){return(d===72||d===104)&&bh.call(r,r.previous)&&!Xs(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),s):n(d)}function s(d){if(ft(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),s;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),o?c:(o=!0,l)):n(d)}function c(d){return d===null||ro(d)||je(d)||Yn(d)||To(d)?n(d):e.attempt(hh,e.attempt(ph,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function _E(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function DE(e,t,n){let r,i,o;return a;function a(c){return c===46||c===95?e.check(mh,l,s)(c):c===null||je(c)||Yn(c)||c!==45&&To(c)?l(c):(o=!0,e.consume(c),a)}function s(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function l(c){return i||r||!o?n(c):t(c)}}function ME(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(mh,t,o)(a):a===null||je(a)||Yn(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function jE(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||je(s)||Yn(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||je(s)||Yn(s)?t(s):r(s)}function o(s){return ft(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):ft(s)?(e.consume(s),a):n(s)}}function FE(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return ot(o)?n(o):t(o)}}function vh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||je(e)}function bh(e){return!ft(e)}function xh(e){return!(e===47||ns(e))}function ns(e){return e===43||e===45||e===46||e===95||ot(e)}function Xs(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const UE={tokenize:qE,partial:!0};function HE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:VE,continuation:{tokenize:KE},exit:WE}},text:{91:{name:"gfmFootnoteCall",tokenize:$E},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:BE,resolveTo:zE}}}}function BE(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const c=_t(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function zE(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 r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function $E(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(o>999||d===93&&!a||d===null||d===91||je(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(_t(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return je(d)||(a=!0),o++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),o++,c):c(d)}}function VE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(m)}function u(m){if(a>999||m===93&&!s||m===null||m===91||je(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=_t(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return je(m)||(s=!0),a++,e.consume(m),m===92?d:u}function d(m){return m===91||m===92||m===93?(e.consume(m),a++,u):u(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),Re(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function KE(e,t,n){return e.check(vi,t,e.attempt(UE,t,n))}function WE(e){e.exit("gfmFootnoteDefinition")}function qE(e,t,n){const r=this;return Re(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function GE(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",u,s],["enter",a[c][1],s],["exit",a[c][1],s],["enter",d,s]],f=s.parser.constructs.insideSpan.null;f&&Ct(h,h.length,0,Po(f,a.slice(c+1,l),s)),Ct(h,h.length,0,[["exit",d,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",u,s]]),Ct(a,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function o(a,s,l){const c=this.previous,u=this.events;let d=0;return h;function h(m){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const p=Cr(c);if(m===126)return d>1?l(m):(a.consume(m),d++,f);if(d<2&&!n)return l(m);const v=a.exit("strikethroughSequenceTemporary"),b=Cr(m);return v._open=!b||b===2&&!!p,v._close=!p||p===2&&!!b,s(m)}}}class QE{constructor(){this.map=[]}add(t,n,r){YE(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function YE(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function XE(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function JE(){return{flow:{null:{name:"table",tokenize:ZE,resolveAll:e1}}}}function ZE(e,t,n){const r=this;let i=0,o=0,a;return s;function s(R){let _=r.events.length-1;for(;_>-1;){const U=r.events[_][1].type;if(U==="lineEnding"||U==="linePrefix")_--;else break}const L=_>-1?r.events[_][1].type:null,z=L==="tableHead"||L==="tableRow"?E:l;return z===E&&r.parser.lazy[r.now().line]?n(R):z(R)}function l(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(a=!0,o+=1),u(R)}function u(R){return R===null?n(R):oe(R)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),f):n(R):Se(R)?Re(e,u,"whitespace")(R):(o+=1,a&&(a=!1,i+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),a=!0,u):(e.enter("data"),d(R)))}function d(R){return R===null||R===124||je(R)?(e.exit("data"),u(R)):(e.consume(R),R===92?h:d)}function h(R){return R===92||R===124?(e.consume(R),d):d(R)}function f(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),a=!1,Se(R)?Re(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):m(R))}function m(R){return R===45||R===58?v(R):R===124?(a=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),p):P(R)}function p(R){return Se(R)?Re(e,v,"whitespace")(R):v(R)}function v(R){return R===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),b):R===45?(o+=1,b(R)):R===null||oe(R)?A(R):P(R)}function b(R){return R===45?(e.enter("tableDelimiterFiller"),x(R)):P(R)}function x(R){return R===45?(e.consume(R),x):R===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(R))}function w(R){return Se(R)?Re(e,A,"whitespace")(R):A(R)}function A(R){return R===124?m(R):R===null||oe(R)?!a||i!==o?P(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):P(R)}function P(R){return n(R)}function E(R){return e.enter("tableRow"),k(R)}function k(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),k):R===null||oe(R)?(e.exit("tableRow"),t(R)):Se(R)?Re(e,k,"whitespace")(R):(e.enter("data"),N(R))}function N(R){return R===null||R===124||je(R)?(e.exit("data"),k(R)):(e.consume(R),R===92?M:N)}function M(R){return R===92||R===124?(e.consume(R),N):N(R)}}function e1(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,c,u,d;const h=new QE;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(vu(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])),i=m.type==="tableDelimiterRow"?2:u?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],d=Oi(h,t,o,i,void 0,d),o=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],d=Oi(h,t,o,i,void 0,d)),o=a,a=[o[1],n,0,0])):m.type==="tableHead"?(s=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(a[0]=a[1],d=Oi(h,t,o,i,n,d)):a[1]!==0&&(d=Oi(h,t,a,i,n,d)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&vu(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=XE(t.events,n))}return e}function Oi(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},mr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=mr(t.events,n[1]);if(o={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=mr(t.events,n[2]),u=mr(t.events,n[3]),d={type:s,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},mr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function vu(e,t,n,r,i){const o=[],a=mr(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function mr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const t1={name:"tasklistCheck",tokenize:r1};function n1(){return{text:{91:t1}}}function r1(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return je(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return oe(l)?t(l):Se(l)?e.check({tokenize:i1},t,n)(l):n(l)}}function i1(e,t,n){return Re(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function o1(e){return If([IE(),HE(),GE(e),JE(),n1()])}const a1={};function s1(e){const t=this,n=e||a1,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(o1(n)),o.push(AE()),a.push(RE(n))}const l1={h1:({children:e,...t})=>y.jsx("h2",{className:"mt-2 mb-1 text-base font-semibold",...t,children:e}),h2:({children:e,...t})=>y.jsx("h3",{className:"mt-2 mb-1 text-sm font-semibold",...t,children:e}),h3:({children:e,...t})=>y.jsx("h4",{className:"mt-1.5 mb-1 text-sm font-semibold",...t,children:e}),h4:({children:e,...t})=>y.jsx("h5",{className:"mt-1.5 mb-1 text-xs font-semibold uppercase tracking-wide text-text-muted",...t,children:e}),h5:({children:e,...t})=>y.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-semibold text-text-muted",...t,children:e}),h6:({children:e,...t})=>y.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-medium text-text-muted",...t,children:e}),p:({children:e,...t})=>y.jsx("p",{className:"my-1 leading-relaxed",...t,children:e}),strong:({children:e,...t})=>y.jsx("strong",{className:"font-semibold text-text",...t,children:e}),em:({children:e,...t})=>y.jsx("em",{className:"italic",...t,children:e}),a:({children:e,...t})=>y.jsx("a",{className:"text-accent underline decoration-accent/40 underline-offset-2 hover:decoration-accent",target:"_blank",rel:"noreferrer",...t,children:e}),ul:({children:e,...t})=>y.jsx("ul",{className:"my-1 ml-5 list-disc space-y-0.5",...t,children:e}),ol:({children:e,...t})=>y.jsx("ol",{className:"my-1 ml-5 list-decimal space-y-0.5",...t,children:e}),li:({children:e,...t})=>y.jsx("li",{className:"leading-relaxed",...t,children:e}),blockquote:({children:e,...t})=>y.jsx("blockquote",{className:"my-2 border-l-2 border-border pl-3 text-text-dim",...t,children:e}),code:({inline:e,className:t,children:n,...r})=>e?y.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.85em]",...r,children:n}):y.jsx("code",{className:we("font-mono text-xs",t),...r,children:n}),pre:({children:e,...t})=>y.jsx("pre",{className:"my-2 overflow-x-auto rounded bg-surface-2 p-2 text-xs leading-relaxed",...t,children:e}),table:({children:e,...t})=>y.jsx("div",{className:"my-2 overflow-x-auto",children:y.jsx("table",{className:"w-full border-collapse text-xs",...t,children:e})}),thead:({children:e,...t})=>y.jsx("thead",{className:"border-b border-border bg-surface-2/50",...t,children:e}),tbody:({children:e,...t})=>y.jsx("tbody",{...t,children:e}),tr:({children:e,...t})=>y.jsx("tr",{className:"border-b border-border/40 last:border-b-0",...t,children:e}),th:({children:e,...t})=>y.jsx("th",{className:"px-2 py-1 text-left font-semibold",...t,children:e}),td:({children:e,...t})=>y.jsx("td",{className:"px-2 py-1 align-top",...t,children:e}),hr:e=>y.jsx("hr",{className:"my-2 border-border",...e})};function c1({content:e,className:t}){return y.jsx("div",{className:we("text-sm leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",t),children:y.jsx(G0,{remarkPlugins:[s1],components:l1,children:e})})}function u1({msg:e,onApprove:t}){if(e.approval)return y.jsx(f1,{approval:e.approval,onApprove:t});const n=e.role==="user",r=!n&&!!e.content;return y.jsx("div",{className:we("flex",n?"justify-end":"justify-start"),children:y.jsxs("div",{className:we("max-w-[85%] sm:max-w-[75%] rounded-lg px-3 py-2 shadow-sm",n?"bg-accent text-accent-fg":"bg-surface text-text border border-border"),children:[!n&&(e.agent||r)&&y.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[y.jsx("span",{className:"text-xs font-medium text-text-muted",children:e.agent??""}),r&&y.jsx(d1,{text:e.content})]}),!n&&e.content?y.jsx(c1,{content:e.content,className:"break-words"}):y.jsx("div",{className:"whitespace-pre-wrap break-words text-sm leading-relaxed",children:e.content||e.role==="assistant"&&y.jsx("span",{className:"inline-block animate-pulse text-text-dim",children:"…"})})]})})}function d1({text:e}){const{t}=st(),[n,r]=g.useState(!1);async function i(){try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)}catch{Xe.error(t("chat.copyFailed",{defaultValue:"复制失败"}))}}return y.jsx("button",{type:"button",onClick:i,title:t("chat.copyMarkdown",{defaultValue:"复制 Markdown"}),className:"shrink-0 rounded px-1.5 py-0.5 text-[11px] text-text-dim transition hover:bg-surface-2 hover:text-text",children:n?t("chat.copied",{defaultValue:"✓ 已复制"}):t("chat.copy",{defaultValue:"复制"})})}function f1({approval:e,onApprove:t}){const{t:n}=st(),{messageId:r,prompt:i,text:o,outcome:a}=e,s=i?.mode==="auto-allow",[l,c]=g.useState(null);g.useEffect(()=>{a&&c(null)},[a]);function u(d){if(l||!i||!t)return;c(d),t(r,i.reqId,d)===!1&&c(null)}return y.jsxs("div",{className:we("mx-auto w-full max-w-2xl rounded-lg border p-4",s?"border-warning/60 bg-warning-bg":"border-warning bg-warning-bg",a&&"opacity-90"),children:[y.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[y.jsx(dt,{variant:"warning",children:n("chat.approvalTitle",{defaultValue:"🔐 Tool approval"})}),s&&!a&&y.jsx(dt,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})})]}),s&&!a&&i&&y.jsx(h1,{graceSeconds:i.graceSeconds??0}),i?y.jsxs("div",{className:"mt-1 flex flex-col gap-2 text-sm",children:[y.jsx(bu,{label:n("chat.approvalToolLabel",{defaultValue:"Tool"}),children:y.jsx("code",{className:"rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})}),y.jsx(bu,{label:n("chat.approvalInputLabel",{defaultValue:"Input"}),children:y.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded bg-surface-2 p-2 font-mono text-xs leading-relaxed text-text",children:i.inputJson})})]}):o?y.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm text-text",children:o}):null,a?y.jsx(p1,{outcome:a}):i?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[!s&&y.jsxs(y.Fragment,{children:[y.jsx(at,{size:"sm",disabled:l!==null,onClick:()=>u("y"),children:n("chat.approvalAllow",{defaultValue:"Allow"})}),y.jsx(at,{size:"sm",variant:"secondary",disabled:l!==null,onClick:()=>u("a"),title:n("chat.approvalAutoTip",{defaultValue:"Allow and auto-allow similar calls for the rest of the session"}),children:n("chat.approvalAuto",{defaultValue:"Auto for similar"})})]}),y.jsx(at,{size:"sm",variant:"destructive",disabled:l!==null,onClick:()=>u("n"),children:n("chat.approvalDeny",{defaultValue:"Deny"})})]}),l!==null&&y.jsx("p",{className:"mt-2 text-xs text-text-dim",children:n("chat.approvalSubmitting",{defaultValue:"已发送,等待结果…"})})]}):null]})}function bu({label:e,children:t}){return y.jsxs("div",{className:"flex flex-col gap-0.5",children:[y.jsx("span",{className:"text-xs font-medium text-text-muted",children:e}),t]})}function h1({graceSeconds:e}){const{t}=st(),[n,r]=g.useState(Math.max(0,e));return g.useEffect(()=>{if(e<=0)return;r(e);const i=setInterval(()=>{r(o=>o>0?o-1:0)},1e3);return()=>clearInterval(i)},[e]),e<=0?null:y.jsx("p",{className:"mb-2 text-xs text-warning",children:n>0?t("chat.approvalAutoIn",{count:n,defaultValue:"Auto-allowing in {{count}}s — Deny to stop."}):t("chat.approvalAutoResolving",{defaultValue:"Auto-allowing now…"})})}function p1({outcome:e}){const{t}=st(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return y.jsx("div",{className:"mt-3",children:y.jsxs(dt,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]})});case"allowed-pinned":return y.jsx("div",{className:"mt-3",children:y.jsxs(dt,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]})});case"denied":return y.jsx("div",{className:"mt-3",children:y.jsxs(dt,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]})});case"denied-revoked":return y.jsx("div",{className:"mt-3",children:y.jsxs(dt,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]})});case"expired":return y.jsx("div",{className:"mt-3",children:y.jsxs(dt,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})})}}function m1({approvals:e,onApprove:t}){return e.length===0?null:y.jsx("div",{className:"border-t border-warning/40 bg-warning-bg/40",children:y.jsx("div",{className:"mx-auto max-h-60 w-full max-w-3xl overflow-y-auto px-3 py-2 sm:px-4",children:y.jsx("div",{className:"flex flex-col gap-2",children:e.map(n=>y.jsx(g1,{entry:n,onApprove:t},n.messageId))})})})}function g1({entry:e,onApprove:t}){const{t:n}=st(),{messageId:r,prompt:i,outcome:o}=e,a=i.mode==="auto-allow",[s,l]=g.useState(null);g.useEffect(()=>{o&&l(null)},[o]);function c(u){if(s||!t)return;l(u),t(r,i.reqId,u)===!1&&l(null)}return y.jsxs("div",{className:we("rounded-lg border bg-surface p-3 shadow-sm transition-opacity",o?"border-success/60 opacity-80":"border-warning"),children:[y.jsxs("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[y.jsxs(dt,{variant:"warning",className:"gap-1",children:[y.jsx(Vy,{className:"h-3 w-3"}),n("chat.approvalTitle",{defaultValue:"工具授权"})]}),a&&!o&&y.jsx(dt,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})}),a&&!o&&i.graceSeconds!=null&&y.jsx(y1,{graceSeconds:i.graceSeconds}),y.jsx("code",{className:"ml-auto rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})]}),y.jsx("pre",{className:"mb-2 max-h-32 overflow-auto rounded bg-surface-2 p-2 font-mono text-xs leading-relaxed text-text",children:i.inputJson}),o?y.jsx(v1,{outcome:o}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex flex-wrap gap-2",children:[!a&&y.jsxs(y.Fragment,{children:[y.jsx(at,{size:"sm",disabled:s!==null,onClick:()=>c("y"),children:n("chat.approvalAllow",{defaultValue:"批准"})}),y.jsx(at,{size:"sm",variant:"secondary",disabled:s!==null,onClick:()=>c("a"),title:n("chat.approvalAutoTip",{defaultValue:"Allow and auto-allow similar calls for the rest of the session"}),children:n("chat.approvalAuto",{defaultValue:"本类自动放行"})})]}),y.jsx(at,{size:"sm",variant:"destructive",disabled:s!==null,onClick:()=>c("n"),children:n("chat.approvalDeny",{defaultValue:"拒绝"})})]}),s!==null&&y.jsx("p",{className:"mt-1.5 text-xs text-text-dim",children:n("chat.approvalSubmitting",{defaultValue:"已发送,等待结果…"})})]})]})}function y1({graceSeconds:e}){const{t}=st(),[n,r]=g.useState(Math.max(0,e));return g.useEffect(()=>{if(e<=0)return;r(e);const i=setInterval(()=>{r(o=>o>0?o-1:0)},1e3);return()=>clearInterval(i)},[e]),e<=0?null:y.jsx("span",{className:"text-xs text-warning",children:n>0?t("chat.approvalAutoIn",{count:n,defaultValue:"Auto-allowing in {{count}}s — Deny to stop."}):t("chat.approvalAutoResolving",{defaultValue:"Auto-allowing now…"})})}function v1({outcome:e}){const{t}=st(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return y.jsxs(dt,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]});case"allowed-pinned":return y.jsxs(dt,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]});case"denied":return y.jsxs(dt,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]});case"denied-revoked":return y.jsxs(dt,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]});case"expired":return y.jsxs(dt,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})}}function xu(e,[t,n]){return Math.min(n,Math.max(t,e))}function Oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function xi(e,t=[]){let n=[];function r(o,a){const s=g.createContext(a);s.displayName=o+"Context";const l=n.length;n=[...n,a];const c=d=>{const{scope:h,children:f,...m}=d,p=h?.[e]?.[l]||s,v=g.useMemo(()=>m,Object.values(m));return y.jsx(p.Provider,{value:v,children:f})};c.displayName=o+"Provider";function u(d,h){const f=h?.[e]?.[l]||s,m=g.useContext(f);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(a=>g.createContext(a));return function(s){const l=s?.[e]||o;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,b1(i,...t)]}function b1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...s,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function x1(e){const t=e+"CollectionProvider",[n,r]=xi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:v,children:b}=p,x=g.useRef(null),w=g.useRef(new Map).current;return y.jsx(i,{scope:v,itemMap:w,collectionRef:x,children:b})};a.displayName=t;const s=e+"CollectionSlot",l=Sr(s),c=g.forwardRef((p,v)=>{const{scope:b,children:x}=p,w=o(s,b),A=ze(v,w.collectionRef);return y.jsx(l,{ref:A,children:x})});c.displayName=s;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=Sr(u),f=g.forwardRef((p,v)=>{const{scope:b,children:x,...w}=p,A=g.useRef(null),P=ze(v,A),E=o(u,b);return g.useEffect(()=>(E.itemMap.set(A,{ref:A,...w}),()=>void E.itemMap.delete(A))),y.jsx(h,{[d]:"",ref:P,children:x})});f.displayName=u;function m(p){const v=o(e+"CollectionConsumer",p);return g.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((E,k)=>w.indexOf(E.ref.current)-w.indexOf(k.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:c,ItemSlot:f},m,r]}var w1=g.createContext(void 0);function k1(e){const t=g.useContext(w1);return e||t||"ltr"}function Xn(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>t.current?.(...n),[])}function S1(e,t=globalThis?.document){const n=Xn(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var C1="DismissableLayer",rs="dismissableLayer.update",E1="dismissableLayer.pointerDownOutside",A1="dismissableLayer.focusOutside",wu,Js=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),No=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,u=g.useContext(Js),[d,h]=g.useState(null),f=d?.ownerDocument??globalThis?.document,[,m]=g.useState({}),p=ze(t,M=>h(M)),v=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(b),w=d?v.indexOf(d):-1,A=u.layersWithOutsidePointerEventsDisabled.size>0,P=w>=x,E=g.useRef(!1),k=I1(M=>{const R=M.target;if(!(R instanceof Node))return;const _=[...u.branches].some(L=>L.contains(R));!P||_||(o?.(M),s?.(M),M.defaultPrevented||l?.())},{ownerDocument:f,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:u.dismissableSurfaces}),N=L1(M=>{if(r&&E.current)return;const R=M.target;[...u.branches].some(L=>L.contains(R))||(a?.(M),s?.(M),M.defaultPrevented||l?.())},f);return S1(M=>{w===u.layers.size-1&&(i?.(M),!M.defaultPrevented&&l&&(M.preventDefault(),l()))},f),g.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(wu=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ku(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=wu))}},[d,f,n,u]),g.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ku())},[d,u]),g.useEffect(()=>{const M=()=>m({});return document.addEventListener(rs,M),()=>document.removeEventListener(rs,M)},[]),y.jsx(De.div,{...c,ref:p,style:{pointerEvents:A?P?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,k.onPointerDownCapture)})});No.displayName=C1;var R1="DismissableLayerBranch",T1=g.forwardRef((e,t)=>{const n=g.useContext(Js),r=g.useRef(null),i=ze(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),y.jsx(De.div,{...e,ref:i})});T1.displayName=R1;function P1(){const e=g.useContext(Js),[t,n]=g.useState(null);return g.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function I1(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o}=t,a=Xn(e),s=g.useRef(!1),l=g.useRef(!1),c=g.useRef(new Map),u=g.useRef(()=>{});return g.useEffect(()=>{function d(){l.current=!1,i.current=!1,c.current.clear()}function h(){return Array.from(c.current.values()).some(Boolean)}function f(x){if(!l.current)return;const w=x.target;w instanceof Node&&[...o].some(P=>P.contains(w))||c.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{l.current&&u.current()},0)}function m(x){l.current&&c.current.set(x.type,!1)}const p=x=>{if(x.target&&!s.current){let w=function(){n.removeEventListener("click",u.current);const P=h();d(),P||wh(E1,a,A,{discrete:!0})};const A={originalEvent:x};l.current=!0,i.current=r&&x.button===0,c.current.clear(),!r||x.button!==0?w():(n.removeEventListener("click",u.current),u.current=w,n.addEventListener("click",u.current,{once:!0}))}else n.removeEventListener("click",u.current),d();s.current=!1},v=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of v)n.addEventListener(x,f,!0),n.addEventListener(x,m);const b=window.setTimeout(()=>{n.addEventListener("pointerdown",p)},0);return()=>{window.clearTimeout(b),n.removeEventListener("pointerdown",p),n.removeEventListener("click",u.current);for(const x of v)n.removeEventListener(x,f,!0),n.removeEventListener(x,m)}},[n,a,r,i,o]),{onPointerDownCapture:()=>s.current=!0}}function L1(e,t=globalThis?.document){const n=Xn(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&wh(A1,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ku(){const e=new CustomEvent(rs);document.dispatchEvent(e)}function wh(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?nx(i,o):i.dispatchEvent(o)}var Ni=0,cr=null;function kh(){g.useEffect(()=>{cr||(cr={start:Su(),end:Su()});const{start:e,end:t}=cr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Ni++,()=>{Ni===1&&(cr?.start.remove(),cr?.end.remove(),cr=null),Ni=Math.max(0,Ni-1)}},[])}function Su(){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}var ga="focusScope.autoFocusOnMount",ya="focusScope.autoFocusOnUnmount",Cu={bubbles:!1,cancelable:!0},O1="FocusScope",Zs=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=g.useState(null),c=Xn(i),u=Xn(o),d=g.useRef(null),h=ze(t,p=>l(p)),f=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let p=function(w){if(f.paused||!s)return;const A=w.target;s.contains(A)?d.current=A:yn(d.current,{select:!0})},v=function(w){if(f.paused||!s)return;const A=w.relatedTarget;A!==null&&(s.contains(A)||yn(d.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const P of w)P.removedNodes.length>0&&yn(s)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const x=new MutationObserver(b);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),x.disconnect()}}},[r,s,f.paused]),g.useEffect(()=>{if(s){Au.add(f);const p=document.activeElement;if(!s.contains(p)){const b=new CustomEvent(ga,Cu);s.addEventListener(ga,c),s.dispatchEvent(b),b.defaultPrevented||(N1(F1(Sh(s)),{select:!0}),document.activeElement===p&&yn(s))}return()=>{s.removeEventListener(ga,c),setTimeout(()=>{const b=new CustomEvent(ya,Cu);s.addEventListener(ya,u),s.dispatchEvent(b),b.defaultPrevented||yn(p??document.body,{select:!0}),s.removeEventListener(ya,u),Au.remove(f)},0)}}},[s,c,u,f]);const m=g.useCallback(p=>{if(!n&&!r||f.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,b=document.activeElement;if(v&&b){const x=p.currentTarget,[w,A]=_1(x);w&&A?!p.shiftKey&&b===A?(p.preventDefault(),n&&yn(w,{select:!0})):p.shiftKey&&b===w&&(p.preventDefault(),n&&yn(A,{select:!0})):b===x&&p.preventDefault()}},[n,r,f.paused]);return y.jsx(De.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})});Zs.displayName=O1;function N1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yn(r,{select:t}),document.activeElement!==n)return}function _1(e){const t=Sh(e),n=Eu(t,e),r=Eu(t.reverse(),e);return[n,r]}function Sh(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Eu(e,t){for(const n of e)if(!D1(n,{upTo:t}))return n}function D1(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}function M1(e){return e instanceof HTMLInputElement&&"select"in e}function yn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&M1(e)&&t&&e.select()}}var Au=j1();function j1(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Ru(e,t),e.unshift(t)},remove(t){e=Ru(e,t),e[0]?.resume()}}}function Ru(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function F1(e){return e.filter(t=>t.tagName!=="A")}var rt=globalThis?.document?g.useLayoutEffect:()=>{},U1=wo[" useId ".trim().toString()]||(()=>{}),H1=0;function br(e){const[t,n]=g.useState(U1());return rt(()=>{n(r=>r??String(H1++))},[e]),t?`radix-${t}`:""}const B1=["top","right","bottom","left"],wn=Math.min,St=Math.max,so=Math.round,_i=Math.floor,Qt=e=>({x:e,y:e}),z1={left:"right",right:"left",bottom:"top",top:"bottom"};function is(e,t,n){return St(e,wn(t,n))}function an(e,t){return typeof e=="function"?e(t):e}function sn(e){return e.split("-")[0]}function Dr(e){return e.split("-")[1]}function el(e){return e==="x"?"y":"x"}function tl(e){return e==="y"?"height":"width"}function qt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function nl(e){return el(qt(e))}function $1(e,t,n){n===void 0&&(n=!1);const r=Dr(e),i=nl(e),o=tl(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=lo(a)),[a,lo(a)]}function V1(e){const t=lo(e);return[os(e),t,os(t)]}function os(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Tu=["left","right"],Pu=["right","left"],K1=["top","bottom"],W1=["bottom","top"];function q1(e,t,n){switch(e){case"top":case"bottom":return n?t?Pu:Tu:t?Tu:Pu;case"left":case"right":return t?K1:W1;default:return[]}}function G1(e,t,n,r){const i=Dr(e);let o=q1(sn(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(os)))),o}function lo(e){const t=sn(e);return z1[t]+e.slice(t.length)}function Q1(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ch(e){return typeof e!="number"?Q1(e):{top:e,right:e,bottom:e,left:e}}function co(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Iu(e,t,n){let{reference:r,floating:i}=e;const o=qt(t),a=nl(t),s=tl(a),l=sn(t),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Dr(t)){case"start":f[a]-=h*(n&&c?-1:1);break;case"end":f[a]+=h*(n&&c?-1:1);break}return f}async function Y1(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=an(t,e),m=Ch(f),v=s[h?d==="floating"?"reference":"floating":d],b=co(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),A=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},P=co(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:l}):x);return{top:(b.top-P.top+m.top)/A.y,bottom:(P.bottom-b.bottom+m.bottom)/A.y,left:(b.left-P.left+m.left)/A.x,right:(P.right-b.right+m.right)/A.x}}const X1=50,J1=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:Y1},l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Iu(c,r,l),h=r,f=0;const m={};for(let p=0;p<o.length;p++){const v=o[p];if(!v)continue;const{name:b,fn:x}=v,{x:w,y:A,data:P,reset:E}=await x({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,d=A??d,m[b]={...m[b],...P},E&&f<X1&&(f++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:u,y:d}=Iu(c,h,l)),p=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:m}},Z1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=an(e,t)||{};if(c==null)return{};const d=Ch(u),h={x:n,y:r},f=nl(i),m=tl(f),p=await a.getDimensions(c),v=f==="y",b=v?"top":"left",x=v?"bottom":"right",w=v?"clientHeight":"clientWidth",A=o.reference[m]+o.reference[f]-h[f]-o.floating[m],P=h[f]-o.reference[f],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let k=E?E[w]:0;(!k||!await(a.isElement==null?void 0:a.isElement(E)))&&(k=s.floating[w]||o.floating[m]);const N=A/2-P/2,M=k/2-p[m]/2-1,R=wn(d[b],M),_=wn(d[x],M),L=R,z=k-p[m]-_,U=k/2-p[m]/2+N,$=is(L,U,z),Q=!l.arrow&&Dr(i)!=null&&U!==$&&o.reference[m]/2-(U<L?R:_)-p[m]/2<0,Y=Q?U<L?U-L:U-z:0;return{[f]:h[f]+Y,data:{[f]:$,centerOffset:U-$-Y,...Q&&{alignmentOffset:Y}},reset:Q}}}),eA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...v}=an(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=sn(i),x=qt(s),w=sn(s)===s,A=await(l.isRTL==null?void 0:l.isRTL(c.floating)),P=h||(w||!p?[lo(s)]:V1(s)),E=m!=="none";!h&&E&&P.push(...G1(s,p,m,A));const k=[s,...P],N=await l.detectOverflow(t,v),M=[];let R=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&M.push(N[b]),d){const U=$1(i,a,A);M.push(N[U[0]],N[U[1]])}if(R=[...R,{placement:i,overflows:M}],!M.every(U=>U<=0)){var _,L;const U=(((_=o.flip)==null?void 0:_.index)||0)+1,$=k[U];if($&&(!(d==="alignment"?x!==qt($):!1)||R.every(V=>qt(V.placement)===x?V.overflows[0]>0:!0)))return{data:{index:U,overflows:R},reset:{placement:$}};let Q=(L=R.filter(Y=>Y.overflows[0]<=0).sort((Y,V)=>Y.overflows[1]-V.overflows[1])[0])==null?void 0:L.placement;if(!Q)switch(f){case"bestFit":{var z;const Y=(z=R.filter(V=>{if(E){const F=qt(V.placement);return F===x||F==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(F=>F>0).reduce((F,S)=>F+S,0)]).sort((V,F)=>V[1]-F[1])[0])==null?void 0:z[0];Y&&(Q=Y);break}case"initialPlacement":Q=s;break}if(i!==Q)return{reset:{placement:Q}}}return{}}}};function Lu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ou(e){return B1.some(t=>e[t]>=0)}const tA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=an(e,t);switch(i){case"referenceHidden":{const a=await r.detectOverflow(t,{...o,elementContext:"reference"}),s=Lu(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ou(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...o,altBoundary:!0}),s=Lu(a,n.floating);return{data:{escapedOffsets:s,escaped:Ou(s)}}}default:return{}}}}},Eh=new Set(["left","top"]);async function nA(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=sn(n),s=Dr(n),l=qt(n)==="y",c=Eh.has(a)?-1:1,u=o&&l?-1:1,d=an(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(f=s==="end"?m*-1:m),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const rA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await nA(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},iA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...c}=an(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),h=qt(sn(i)),f=el(h);let m=u[f],p=u[h];if(a){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=m+d[b],A=m-d[x];m=is(w,m,A)}if(s){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=p+d[b],A=p-d[x];p=is(w,p,A)}const v=l.fn({...t,[f]:m,[h]:p});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:a,[h]:s}}}}}},oA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=an(e,t),u={x:n,y:r},d=qt(i),h=el(d);let f=u[h],m=u[d];const p=an(s,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=h==="y"?"height":"width",A=o.reference[h]-o.floating[w]+v.mainAxis,P=o.reference[h]+o.reference[w]-v.mainAxis;f<A?f=A:f>P&&(f=P)}if(c){var b,x;const w=h==="y"?"width":"height",A=Eh.has(sn(i)),P=o.reference[d]-o.floating[w]+(A&&((b=a.offset)==null?void 0:b[d])||0)+(A?0:v.crossAxis),E=o.reference[d]+o.reference[w]+(A?0:((x=a.offset)==null?void 0:x[d])||0)-(A?v.crossAxis:0);m<P?m=P:m>E&&(m=E)}return{[h]:f,[d]:m}}}},aA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...c}=an(e,t),u=await a.detectOverflow(t,c),d=sn(i),h=Dr(i),f=qt(i)==="y",{width:m,height:p}=o.floating;let v,b;d==="top"||d==="bottom"?(v=d,b=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,v=h==="end"?"top":"bottom");const x=p-u.top-u.bottom,w=m-u.left-u.right,A=wn(p-u[v],x),P=wn(m-u[b],w),E=!t.middlewareData.shift;let k=A,N=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=x),E&&!h){const R=St(u.left,0),_=St(u.right,0),L=St(u.top,0),z=St(u.bottom,0);f?N=m-2*(R!==0||_!==0?R+_:St(u.left,u.right)):k=p-2*(L!==0||z!==0?L+z:St(u.top,u.bottom))}await l({...t,availableWidth:N,availableHeight:k});const M=await a.getDimensions(s.floating);return m!==M.width||p!==M.height?{reset:{rects:!0}}:{}}}};function _o(){return typeof window<"u"}function Mr(e){return Ah(e)?(e.nodeName||"").toLowerCase():"#document"}function Et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xt(e){var t;return(t=(Ah(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ah(e){return _o()?e instanceof Node||e instanceof Et(e).Node:!1}function Dt(e){return _o()?e instanceof Element||e instanceof Et(e).Element:!1}function fn(e){return _o()?e instanceof HTMLElement||e instanceof Et(e).HTMLElement:!1}function Nu(e){return!_o()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Et(e).ShadowRoot}function wi(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Mt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function sA(e){return/^(table|td|th)$/.test(Mr(e))}function Do(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const lA=/transform|translate|scale|rotate|perspective|filter/,cA=/paint|layout|strict|content/,Fn=e=>!!e&&e!=="none";let va;function rl(e){const t=Dt(e)?Mt(e):e;return Fn(t.transform)||Fn(t.translate)||Fn(t.scale)||Fn(t.rotate)||Fn(t.perspective)||!il()&&(Fn(t.backdropFilter)||Fn(t.filter))||lA.test(t.willChange||"")||cA.test(t.contain||"")}function uA(e){let t=kn(e);for(;fn(t)&&!Er(t);){if(rl(t))return t;if(Do(t))return null;t=kn(t)}return null}function il(){return va==null&&(va=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),va}function Er(e){return/^(html|body|#document)$/.test(Mr(e))}function Mt(e){return Et(e).getComputedStyle(e)}function Mo(e){return Dt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kn(e){if(Mr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Nu(e)&&e.host||Xt(e);return Nu(t)?t.host:t}function Rh(e){const t=kn(e);return Er(t)?e.ownerDocument?e.ownerDocument.body:e.body:fn(t)&&wi(t)?t:Rh(t)}function di(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Rh(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Et(i);if(o){const s=as(a);return t.concat(a,a.visualViewport||[],wi(i)?i:[],s&&n?di(s):[])}else return t.concat(i,di(i,[],n))}function as(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Th(e){const t=Mt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=fn(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=so(n)!==o||so(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function ol(e){return Dt(e)?e:e.contextElement}function xr(e){const t=ol(e);if(!fn(t))return Qt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Th(t);let a=(o?so(n.width):n.width)/r,s=(o?so(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const dA=Qt(0);function Ph(e){const t=Et(e);return!il()||!t.visualViewport?dA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Et(e)?!1:t}function Jn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=ol(e);let a=Qt(1);t&&(r?Dt(r)&&(a=xr(r)):a=xr(e));const s=fA(o,n,r)?Ph(o):Qt(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const h=Et(o),f=r&&Dt(r)?Et(r):r;let m=h,p=as(m);for(;p&&r&&f!==m;){const v=xr(p),b=p.getBoundingClientRect(),x=Mt(p),w=b.left+(p.clientLeft+parseFloat(x.paddingLeft))*v.x,A=b.top+(p.clientTop+parseFloat(x.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=w,c+=A,m=Et(p),p=as(m)}}return co({width:u,height:d,x:l,y:c})}function jo(e,t){const n=Mo(e).scrollLeft;return t?t.left+n:Jn(Xt(e)).left+n}function Ih(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-jo(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function hA(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=Xt(r),s=t?Do(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Qt(1);const u=Qt(0),d=fn(r);if((d||!d&&!o)&&((Mr(r)!=="body"||wi(a))&&(l=Mo(r)),d)){const f=Jn(r);c=xr(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const h=a&&!d&&!o?Ih(a,l):Qt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function pA(e){return Array.from(e.getClientRects())}function mA(e){const t=Xt(e),n=Mo(e),r=e.ownerDocument.body,i=St(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=St(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+jo(e);const s=-n.scrollTop;return Mt(r).direction==="rtl"&&(a+=St(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const _u=25;function gA(e,t){const n=Et(e),r=Xt(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=il();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=jo(r);if(c<=0){const u=r.ownerDocument,d=u.body,h=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-f);m<=_u&&(o-=m)}else c<=_u&&(o+=c);return{width:o,height:a,x:s,y:l}}function yA(e,t){const n=Jn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=fn(e)?xr(e):Qt(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function Du(e,t,n){let r;if(t==="viewport")r=gA(e,n);else if(t==="document")r=mA(Xt(e));else if(Dt(t))r=yA(t,n);else{const i=Ph(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return co(r)}function Lh(e,t){const n=kn(e);return n===t||!Dt(n)||Er(n)?!1:Mt(n).position==="fixed"||Lh(n,t)}function vA(e,t){const n=t.get(e);if(n)return n;let r=di(e,[],!1).filter(s=>Dt(s)&&Mr(s)!=="body"),i=null;const o=Mt(e).position==="fixed";let a=o?kn(e):e;for(;Dt(a)&&!Er(a);){const s=Mt(a),l=rl(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||wi(a)&&!l&&Lh(e,a))?r=r.filter(u=>u!==a):i=s,a=kn(a)}return t.set(e,r),r}function bA(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Do(t)?[]:vA(t,this._c):[].concat(n),r],s=Du(t,a[0],i);let l=s.top,c=s.right,u=s.bottom,d=s.left;for(let h=1;h<a.length;h++){const f=Du(t,a[h],i);l=St(f.top,l),c=wn(f.right,c),u=wn(f.bottom,u),d=St(f.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function xA(e){const{width:t,height:n}=Th(e);return{width:t,height:n}}function wA(e,t,n){const r=fn(t),i=Xt(t),o=n==="fixed",a=Jn(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Qt(0);function c(){l.x=jo(i)}if(r||!r&&!o)if((Mr(t)!=="body"||wi(i))&&(s=Mo(t)),r){const f=Jn(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?Ih(i,s):Qt(0),d=a.left+s.scrollLeft-l.x-u.x,h=a.top+s.scrollTop-l.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function ba(e){return Mt(e).position==="static"}function Mu(e,t){if(!fn(e)||Mt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Xt(e)===n&&(n=n.ownerDocument.body),n}function Oh(e,t){const n=Et(e);if(Do(e))return n;if(!fn(e)){let i=kn(e);for(;i&&!Er(i);){if(Dt(i)&&!ba(i))return i;i=kn(i)}return n}let r=Mu(e,t);for(;r&&sA(r)&&ba(r);)r=Mu(r,t);return r&&Er(r)&&ba(r)&&!rl(r)?n:r||uA(e)||n}const kA=async function(e){const t=this.getOffsetParent||Oh,n=this.getDimensions,r=await n(e.floating);return{reference:wA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function SA(e){return Mt(e).direction==="rtl"}const CA={convertOffsetParentRelativeRectToViewportRelativeRect:hA,getDocumentElement:Xt,getClippingRect:bA,getOffsetParent:Oh,getElementRects:kA,getClientRects:pA,getDimensions:xA,getScale:xr,isElement:Dt,isRTL:SA};function Nh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function EA(e,t){let n=null,r;const i=Xt(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=c;if(s||t(),!h||!f)return;const m=_i(d),p=_i(i.clientWidth-(u+h)),v=_i(i.clientHeight-(d+f)),b=_i(u),w={rootMargin:-m+"px "+-p+"px "+-v+"px "+-b+"px",threshold:St(0,wn(1,l))||1};let A=!0;function P(E){const k=E[0].intersectionRatio;if(k!==l){if(!A)return a();k?a(!1,k):r=setTimeout(()=>{a(!1,1e-7)},1e3)}k===1&&!Nh(c,e.getBoundingClientRect())&&a(),A=!1}try{n=new IntersectionObserver(P,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,w)}n.observe(e)}return a(!0),o}function AA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=ol(e),u=i||o?[...c?di(c):[],...t?di(t):[]]:[];u.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const d=c&&s?EA(c,n):null;let h=-1,f=null;a&&(f=new ResizeObserver(b=>{let[x]=b;x&&x.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),c&&!l&&f.observe(c),t&&f.observe(t));let m,p=l?Jn(e):null;l&&v();function v(){const b=Jn(e);p&&!Nh(p,b)&&n(),p=b,m=requestAnimationFrame(v)}return n(),()=>{var b;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d?.(),(b=f)==null||b.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const RA=rA,TA=iA,PA=eA,IA=aA,LA=tA,ju=Z1,OA=oA,NA=(e,t,n)=>{const r=new Map,i={platform:CA,...n},o={...i.platform,_c:r};return J1(e,t,{...i,platform:o})};var _A=typeof document<"u",DA=function(){},Ki=_A?g.useLayoutEffect:DA;function uo(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,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!uo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!uo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function _h(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fu(e,t){const n=_h(e);return Math.round(t*n)/n}function xa(e){const t=g.useRef(e);return Ki(()=>{t.current=e}),t}function MA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=g.useState(r);uo(h,r)||f(r);const[m,p]=g.useState(null),[v,b]=g.useState(null),x=g.useCallback(V=>{V!==E.current&&(E.current=V,p(V))},[]),w=g.useCallback(V=>{V!==k.current&&(k.current=V,b(V))},[]),A=o||m,P=a||v,E=g.useRef(null),k=g.useRef(null),N=g.useRef(u),M=l!=null,R=xa(l),_=xa(i),L=xa(c),z=g.useCallback(()=>{if(!E.current||!k.current)return;const V={placement:t,strategy:n,middleware:h};_.current&&(V.platform=_.current),NA(E.current,k.current,V).then(F=>{const S={...F,isPositioned:L.current!==!1};U.current&&!uo(N.current,S)&&(N.current=S,Pr.flushSync(()=>{d(S)}))})},[h,t,n,_,L]);Ki(()=>{c===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[c]);const U=g.useRef(!1);Ki(()=>(U.current=!0,()=>{U.current=!1}),[]),Ki(()=>{if(A&&(E.current=A),P&&(k.current=P),A&&P){if(R.current)return R.current(A,P,z);z()}},[A,P,z,R,M]);const $=g.useMemo(()=>({reference:E,floating:k,setReference:x,setFloating:w}),[x,w]),Q=g.useMemo(()=>({reference:A,floating:P}),[A,P]),Y=g.useMemo(()=>{const V={position:n,left:0,top:0};if(!Q.floating)return V;const F=Fu(Q.floating,u.x),S=Fu(Q.floating,u.y);return s?{...V,transform:"translate("+F+"px, "+S+"px)",..._h(Q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:S}},[n,s,Q.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:z,refs:$,elements:Q,floatingStyles:Y}),[u,z,$,Q,Y])}const jA=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ju({element:r.current,padding:i}).fn(n):{}:r?ju({element:r,padding:i}).fn(n):{}}}},FA=(e,t)=>{const n=RA(e);return{name:n.name,fn:n.fn,options:[e,t]}},UA=(e,t)=>{const n=TA(e);return{name:n.name,fn:n.fn,options:[e,t]}},HA=(e,t)=>({fn:OA(e).fn,options:[e,t]}),BA=(e,t)=>{const n=PA(e);return{name:n.name,fn:n.fn,options:[e,t]}},zA=(e,t)=>{const n=IA(e);return{name:n.name,fn:n.fn,options:[e,t]}},$A=(e,t)=>{const n=LA(e);return{name:n.name,fn:n.fn,options:[e,t]}},VA=(e,t)=>{const n=jA(e);return{name:n.name,fn:n.fn,options:[e,t]}};var KA="Arrow",Dh=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return y.jsx(De.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dh.displayName=KA;var WA=Dh;function qA(e){const[t,n]=g.useState(void 0);return rt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var al="Popper",[Mh,Fo]=xi(al),[GA,jh]=Mh(al),Fh=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null),[o,a]=g.useState(void 0);return y.jsx(GA,{scope:t,anchor:r,onAnchorChange:i,placementState:o,setPlacementState:a,children:n})};Fh.displayName=al;var Uh="PopperAnchor",Hh=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=jh(Uh,n),a=g.useRef(null),s=o.onAnchorChange,l=g.useCallback(m=>{a.current=m,m&&s(m)},[s]),c=ze(t,l),u=g.useRef(null);g.useEffect(()=>{if(!r)return;const m=u.current;u.current=r.current,m!==u.current&&s(u.current)});const d=o.placementState&&ll(o.placementState),h=d?.[0],f=d?.[1];return r?null:y.jsx(De.div,{"data-radix-popper-side":h,"data-radix-popper-align":f,...i,ref:c})});Hh.displayName=Uh;var sl="PopperContent",[QA,YA]=Mh(sl),Bh=g.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:m,...p}=e,v=jh(sl,n),[b,x]=g.useState(null),w=ze(t,he=>x(he)),[A,P]=g.useState(null),E=qA(A),k=E?.width??0,N=E?.height??0,M=r+(o!=="center"?"-"+o:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},_=Array.isArray(c)?c:[c],L=_.length>0,z={padding:R,boundary:_.filter(JA),altBoundary:L},{refs:U,floatingStyles:$,placement:Q,isPositioned:Y,middlewareData:V}=MA({strategy:"fixed",placement:M,whileElementsMounted:(...he)=>AA(...he,{animationFrame:f==="always"}),elements:{reference:v.anchor},middleware:[FA({mainAxis:i+N,alignmentAxis:a}),l&&UA({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?HA():void 0,...z}),l&&BA({...z}),zA({...z,apply:({elements:he,rects:Pe,availableWidth:be,availableHeight:ke})=>{const{width:pe,height:We}=Pe.reference,Ye=he.floating.style;Ye.setProperty("--radix-popper-available-width",`${be}px`),Ye.setProperty("--radix-popper-available-height",`${ke}px`),Ye.setProperty("--radix-popper-anchor-width",`${pe}px`),Ye.setProperty("--radix-popper-anchor-height",`${We}px`)}}),A&&VA({element:A,padding:s}),ZA({arrowWidth:k,arrowHeight:N}),h&&$A({strategy:"referenceHidden",...z,boundary:L?z.boundary:void 0})]}),F=v.setPlacementState;rt(()=>(F(Q),()=>{F(void 0)}),[Q,F]);const[S,ie]=ll(Q),Z=Xn(m);rt(()=>{Y&&Z?.()},[Y,Z]);const C=V.arrow?.x,ae=V.arrow?.y,me=V.arrow?.centerOffset!==0,[ve,q]=g.useState();return rt(()=>{b&&q(window.getComputedStyle(b).zIndex)},[b]),y.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:Y?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:y.jsx(QA,{scope:n,placedSide:S,placedAlign:ie,onArrowChange:P,arrowX:C,arrowY:ae,shouldHideArrow:me,children:y.jsx(De.div,{"data-side":S,"data-align":ie,...p,ref:w,style:{...p.style,animation:Y?void 0:"none"}})})})});Bh.displayName=sl;var zh="PopperArrow",XA={top:"bottom",right:"left",bottom:"top",left:"right"},$h=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=YA(zh,r),a=XA[o.placedSide];return y.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:y.jsx(WA,{...i,ref:n,style:{...i.style,display:"block"}})})});$h.displayName=zh;function JA(e){return e!==null}var ZA=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,u]=ll(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(i.arrow?.x??0)+s/2,f=(i.arrow?.y??0)+l/2;let m="",p="";return c==="bottom"?(m=a?d:`${h}px`,p=`${-l}px`):c==="top"?(m=a?d:`${h}px`,p=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,p=a?d:`${f}px`):c==="left"&&(m=`${r.floating.width+l}px`,p=a?d:`${f}px`),{data:{x:m,y:p}}}});function ll(e){const[t,n="center"]=e.split("-");return[t,n]}var eR=Fh,Vh=Hh,Kh=Bh,Wh=$h,tR="Portal",cl=g.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=g.useState(!1);rt(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?Pr.createPortal(y.jsx(De.div,{...r,ref:t}),a):null});cl.displayName=tR;function nR(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var jr=e=>{const{present:t,children:n}=e,r=rR(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=iR(r.ref,oR(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};jr.displayName="Presence";function rR(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),a=e?"mounted":"unmounted",[s,l]=nR(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=Di(r.current);o.current=s==="mounted"?c:"none"},[s]),rt(()=>{const c=r.current,u=i.current;if(u!==e){const h=o.current,f=Di(c);e?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),rt(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const p=Di(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&p&&(l("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=f=>{f.target===t&&(o.current=Di(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Uu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function iR(...e){const t=g.useRef(e);return t.current=e,g.useCallback(n=>{const r=t.current;let i=!1;const o=r.map(a=>{const s=Uu(a,n);return!i&&typeof s=="function"&&(i=!0),s});if(i)return()=>{for(let a=0;a<o.length;a++){const s=o[a];typeof s=="function"?s():Uu(r[a],null)}}},[])}function Di(e){return e?.animationName||"none"}function oR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aR=wo[" useInsertionEffect ".trim().toString()]||rt;function ss({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=sR({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const c=g.useCallback(u=>{if(s){const d=lR(u)?u(e):u;d!==e&&a.current?.(d)}else o(u)},[s,e,o,a]);return[l,c]}function sR({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return aR(()=>{o.current=t},[t]),g.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function lR(e){return typeof e=="function"}function cR(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var qh=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"}),uR="VisuallyHidden",Gh=g.forwardRef((e,t)=>y.jsx(De.span,{...e,ref:t,style:{...qh,...e.style}}));Gh.displayName=uR;var dR=Gh,fR=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ur=new WeakMap,Mi=new WeakMap,ji={},wa=0,Qh=function(e){return e&&(e.host||Qh(e.parentNode))},hR=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Qh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},pR=function(e,t,n,r){var i=hR(t,Array.isArray(e)?e:[e]);ji[n]||(ji[n]=new WeakMap);var o=ji[n],a=[],s=new Set,l=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(s.has(h))u(h);else try{var f=h.getAttribute(r),m=f!==null&&f!=="false",p=(ur.get(h)||0)+1,v=(o.get(h)||0)+1;ur.set(h,p),o.set(h,v),a.push(h),p===1&&m&&Mi.set(h,!0),v===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return u(t),s.clear(),wa++,function(){a.forEach(function(d){var h=ur.get(d)-1,f=o.get(d)-1;ur.set(d,h),o.set(d,f),h||(Mi.has(d)||d.removeAttribute(r),Mi.delete(d)),f||d.removeAttribute(n)}),wa--,wa||(ur=new WeakMap,ur=new WeakMap,Mi=new WeakMap,ji={})}},Yh=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=fR(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),pR(r,i,n,"aria-hidden")):function(){return null}},Wt=function(){return Wt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Wt.apply(this,arguments)};function Xh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function mR(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Wi="right-scroll-bar-position",qi="width-before-scroll-bar",gR="with-scroll-bars-hidden",yR="--removed-body-scroll-bar-size";function ka(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function vR(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var bR=typeof window<"u"?g.useLayoutEffect:g.useEffect,Hu=new WeakMap;function xR(e,t){var n=vR(null,function(r){return e.forEach(function(i){return ka(i,r)})});return bR(function(){var r=Hu.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||ka(s,null)}),o.forEach(function(s){i.has(s)||ka(s,a)})}Hu.set(n,e)},[e]),n}function wR(e){return e}function kR(e,t){t===void 0&&(t=wR);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var u=a;a=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),n}}}};return i}function SR(e){e===void 0&&(e={});var t=kR(null);return t.options=Wt({async:!0,ssr:!1},e),t}var Jh=function(e){var t=e.sideCar,n=Xh(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,Wt({},n))};Jh.isSideCarExport=!0;function CR(e,t){return e.useMedium(t),Jh}var Zh=SR(),Sa=function(){},Uo=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:Sa,onWheelCapture:Sa,onTouchMoveCapture:Sa}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,p=e.inert,v=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,w=e.gapMode,A=Xh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=h,E=xR([n,t]),k=Wt(Wt({},A),i);return g.createElement(g.Fragment,null,u&&g.createElement(P,{sideCar:Zh,removeScrollBar:c,shards:d,noRelative:f,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!v,lockRef:n,gapMode:w}),a?g.cloneElement(g.Children.only(s),Wt(Wt({},k),{ref:E})):g.createElement(x,Wt({},k,{className:l,ref:E}),s))});Uo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Uo.classNames={fullWidth:qi,zeroRight:Wi};var ER=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ER();return t&&e.setAttribute("nonce",t),e}function RR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function TR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var PR=function(){var e=0,t=null;return{add:function(n){e==0&&(t=AR())&&(RR(t,n),TR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},IR=function(){var e=PR();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ep=function(){var e=IR(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},LR={left:0,top:0,right:0,gap:0},Ca=function(e){return parseInt(e||"",10)||0},OR=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Ca(n),Ca(r),Ca(i)]},NR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return LR;var t=OR(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},_R=ep(),wr="data-scroll-locked",DR=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
163
|
-
.`.concat(gR,` {
|
|
164
|
-
overflow: hidden `).concat(r,`;
|
|
165
|
-
padding-right: `).concat(s,"px ").concat(r,`;
|
|
166
|
-
}
|
|
167
|
-
body[`).concat(wr,`] {
|
|
168
|
-
overflow: hidden `).concat(r,`;
|
|
169
|
-
overscroll-behavior: contain;
|
|
170
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
171
|
-
padding-left: `.concat(i,`px;
|
|
172
|
-
padding-top: `).concat(o,`px;
|
|
173
|
-
padding-right: `).concat(a,`px;
|
|
174
|
-
margin-left:0;
|
|
175
|
-
margin-top:0;
|
|
176
|
-
margin-right: `).concat(s,"px ").concat(r,`;
|
|
177
|
-
`),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.`).concat(Wi,` {
|
|
181
|
-
right: `).concat(s,"px ").concat(r,`;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.`).concat(qi,` {
|
|
185
|
-
margin-right: `).concat(s,"px ").concat(r,`;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.`).concat(Wi," .").concat(Wi,` {
|
|
189
|
-
right: 0 `).concat(r,`;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.`).concat(qi," .").concat(qi,` {
|
|
193
|
-
margin-right: 0 `).concat(r,`;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
body[`).concat(wr,`] {
|
|
197
|
-
`).concat(yR,": ").concat(s,`px;
|
|
198
|
-
}
|
|
199
|
-
`)},Bu=function(){var e=parseInt(document.body.getAttribute(wr)||"0",10);return isFinite(e)?e:0},MR=function(){g.useEffect(function(){return document.body.setAttribute(wr,(Bu()+1).toString()),function(){var e=Bu()-1;e<=0?document.body.removeAttribute(wr):document.body.setAttribute(wr,e.toString())}},[])},jR=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;MR();var o=g.useMemo(function(){return NR(i)},[i]);return g.createElement(_R,{styles:DR(o,!t,i,n?"":"!important")})},ls=!1;if(typeof window<"u")try{var Fi=Object.defineProperty({},"passive",{get:function(){return ls=!0,!0}});window.addEventListener("test",Fi,Fi),window.removeEventListener("test",Fi,Fi)}catch{ls=!1}var dr=ls?{passive:!1}:!1,FR=function(e){return e.tagName==="TEXTAREA"},tp=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!FR(e)&&n[t]==="visible")},UR=function(e){return tp(e,"overflowY")},HR=function(e){return tp(e,"overflowX")},zu=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=np(e,r);if(i){var o=rp(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},BR=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},zR=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},np=function(e,t){return e==="v"?UR(t):HR(t)},rp=function(e,t){return e==="v"?BR(t):zR(t)},$R=function(e,t){return e==="h"&&t==="rtl"?-1:1},VR=function(e,t,n,r,i){var o=$R(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,h=0;do{if(!s)break;var f=rp(e,s),m=f[0],p=f[1],v=f[2],b=p-v-o*m;(m||b)&&np(e,s)&&(d+=b,h+=m);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&Math.abs(d)<1||!u&&Math.abs(h)<1)&&(c=!0),c},Ui=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$u=function(e){return[e.deltaX,e.deltaY]},Vu=function(e){return e&&"current"in e?e.current:e},KR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},WR=function(e){return`
|
|
200
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
201
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
202
|
-
`)},qR=0,fr=[];function GR(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(qR++)[0],o=g.useState(ep)[0],a=g.useRef(e);g.useEffect(function(){a.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=mR([e.lockRef.current],(e.shards||[]).map(Vu),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var b=Ui(p),x=n.current,w="deltaX"in p?p.deltaX:x[0]-b[0],A="deltaY"in p?p.deltaY:x[1]-b[1],P,E=p.target,k=Math.abs(w)>Math.abs(A)?"h":"v";if("touches"in p&&k==="h"&&E.type==="range")return!1;var N=window.getSelection(),M=N&&N.anchorNode,R=M?M===E||M.contains(E):!1;if(R)return!1;var _=zu(k,E);if(!_)return!0;if(_?P=k:(P=k==="v"?"h":"v",_=zu(k,E)),!_)return!1;if(!r.current&&"changedTouches"in p&&(w||A)&&(r.current=P),!P)return!0;var L=r.current||P;return VR(L,v,p,L==="h"?w:A)},[]),l=g.useCallback(function(p){var v=p;if(!(!fr.length||fr[fr.length-1]!==o)){var b="deltaY"in v?$u(v):Ui(v),x=t.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&KR(P.delta,b)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var w=(a.current.shards||[]).map(Vu).filter(Boolean).filter(function(P){return P.contains(v.target)}),A=w.length>0?s(v,w[0]):!a.current.noIsolation;A&&v.cancelable&&v.preventDefault()}}},[]),c=g.useCallback(function(p,v,b,x){var w={name:p,delta:v,target:b,should:x,shadowParent:QR(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(A){return A!==w})},1)},[]),u=g.useCallback(function(p){n.current=Ui(p),r.current=void 0},[]),d=g.useCallback(function(p){c(p.type,$u(p),p.target,s(p,e.lockRef.current))},[]),h=g.useCallback(function(p){c(p.type,Ui(p),p.target,s(p,e.lockRef.current))},[]);g.useEffect(function(){return fr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,dr),document.addEventListener("touchmove",l,dr),document.addEventListener("touchstart",u,dr),function(){fr=fr.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,dr),document.removeEventListener("touchmove",l,dr),document.removeEventListener("touchstart",u,dr)}},[]);var f=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(o,{styles:WR(i)}):null,f?g.createElement(jR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function QR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const YR=CR(Zh,GR);var ul=g.forwardRef(function(e,t){return g.createElement(Uo,Wt({},e,{ref:t,sideCar:YR}))});ul.classNames=Uo.classNames;var XR=[" ","Enter","ArrowUp","ArrowDown"],JR=[" ","Enter"],Zn="Select",[Ho,Bo,ZR]=x1(Zn),[nr]=xi(Zn,[ZR,Fo]),zo=Fo(),[eT,Pn]=nr(Zn),[tT,nT]=nr(Zn),rT="SelectProvider";function ip(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:h,required:f,form:m,internal_do_not_use_render:p}=e,v=zo(t),[b,x]=g.useState(null),[w,A]=g.useState(null),[P,E]=g.useState(!1),k=k1(c),[N,M]=ss({prop:r,defaultProp:i??!1,onChange:o,caller:Zn}),[R,_]=ss({prop:a,defaultProp:s,onChange:l,caller:Zn}),L=g.useRef(null),z=b?!!m||!!b.closest("form"):!0,[U,$]=g.useState(new Set),Q=br(),Y=Array.from(U).map(ie=>ie.props.value).join(";"),V=g.useCallback(ie=>{$(Z=>new Set(Z).add(ie))},[]),F=g.useCallback(ie=>{$(Z=>{const C=new Set(Z);return C.delete(ie),C})},[]),S={required:f,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:A,valueNodeHasChildren:P,onValueNodeHasChildrenChange:E,contentId:Q,value:R,onValueChange:_,open:N,onOpenChange:M,dir:k,triggerPointerDownPosRef:L,disabled:h,name:u,autoComplete:d,form:m,nativeOptions:U,nativeSelectKey:Y,isFormControl:z};return y.jsx(eR,{...v,children:y.jsx(eT,{scope:t,...S,children:y.jsx(Ho.Provider,{scope:t,children:y.jsx(tT,{scope:t,onNativeOptionAdd:V,onNativeOptionRemove:F,children:vT(p)?p(S):n})})})})}ip.displayName=rT;var op=e=>{const{__scopeSelect:t,children:n,...r}=e;return y.jsx(ip,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:i})=>y.jsxs(y.Fragment,{children:[n,i?y.jsx(Ap,{__scopeSelect:t}):null]})})};op.displayName=Zn;var ap="SelectTrigger",dl=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=zo(n),a=Pn(ap,n),s=a.disabled||r,l=ze(t,a.onTriggerChange),c=Bo(n),u=g.useRef("touch"),[d,h,f]=Rp(p=>{const v=c().filter(w=>!w.disabled),b=v.find(w=>w.value===a.value),x=Tp(v,p,b);x!==void 0&&a.onValueChange(x.value)}),m=p=>{s||(a.onOpenChange(!0),f()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return y.jsx(Vh,{asChild:!0,...o,children:y.jsx(De.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":$o(a.value)?"":void 0,...i,ref:l,onClick:Oe(i.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&m(p)}),onPointerDown:Oe(i.onPointerDown,p=>{u.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(m(p),p.preventDefault())}),onKeyDown:Oe(i.onKeyDown,p=>{const v=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(v&&p.key===" ")&&XR.includes(p.key)&&(m(),p.preventDefault())})})})});dl.displayName=ap;var sp="SelectValue",lp=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,l=Pn(sp,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=ze(t,l.onValueNodeChange);rt(()=>{c(u)},[c,u]);const h=$o(l.value);return y.jsx(De.span,{...s,asChild:h?!1:s.asChild,ref:d,style:{pointerEvents:"none"},children:y.jsx(g.Fragment,{children:h?a:o},h?"placeholder":"value")})});lp.displayName=sp;var iT="SelectIcon",cp=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return y.jsx(De.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});cp.displayName=iT;var up="SelectPortal",[oT,aT]=nr(up,{forceMount:void 0}),dp=e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return y.jsx(oT,{scope:e.__scopeSelect,forceMount:n,children:y.jsx(cl,{asChild:!0,...r})})};dp.displayName=up;var Sn="SelectContent",fl=g.forwardRef((e,t)=>{const n=aT(Sn,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,o=Pn(Sn,e.__scopeSelect),[a,s]=g.useState();return rt(()=>{s(new DocumentFragment)},[]),y.jsx(jr,{present:r||o.open,children:({present:l})=>l?y.jsx(pp,{...i,ref:t}):y.jsx(fp,{...i,fragment:a})})});fl.displayName=Sn;var fp=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,fragment:i}=e;return i?Pr.createPortal(y.jsx(hp,{scope:n,children:y.jsx(Ho.Slot,{scope:n,children:y.jsx("div",{ref:t,children:r})})}),i):null});fp.displayName="SelectContentFragment";var Ot=10,[hp,In]=nr(Sn),sT="SelectContentImpl",lT=Sr("SelectContent.RemoveScroll"),pp=g.forwardRef((e,t)=>{const{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:v,...b}=e,x=Pn(Sn,n),[w,A]=g.useState(null),[P,E]=g.useState(null),k=ze(t,q=>A(q)),[N,M]=g.useState(null),[R,_]=g.useState(null),L=Bo(n),[z,U]=g.useState(!1),$=g.useRef(!1);g.useEffect(()=>{if(w)return Yh(w)},[w]),kh();const Q=g.useCallback(q=>{const[he,...Pe]=L().map(pe=>pe.ref.current),[be]=Pe.slice(-1),ke=document.activeElement;for(const pe of q)if(pe===ke||(pe?.scrollIntoView({block:"nearest"}),pe===he&&P&&(P.scrollTop=0),pe===be&&P&&(P.scrollTop=P.scrollHeight),pe?.focus(),document.activeElement!==ke))return},[L,P]),Y=g.useCallback(()=>Q([N,w]),[Q,N,w]);g.useEffect(()=>{z&&Y()},[z,Y]);const{onOpenChange:V,triggerPointerDownPosRef:F}=x;g.useEffect(()=>{if(w){let q={x:0,y:0};const he=be=>{q={x:Math.abs(Math.round(be.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(be.pageY)-(F.current?.y??0))}},Pe=be=>{q.x<=10&&q.y<=10?be.preventDefault():be.composedPath().includes(w)||V(!1),document.removeEventListener("pointermove",he),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",Pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",Pe,{capture:!0})}}},[w,V,F]),g.useEffect(()=>{const q=()=>V(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[V]);const[S,ie]=Rp(q=>{const he=L().filter(ke=>!ke.disabled),Pe=he.find(ke=>ke.ref.current===document.activeElement),be=Tp(he,q,Pe);be&&setTimeout(()=>be.ref.current?.focus())}),Z=g.useCallback((q,he,Pe)=>{const be=!$.current&&!Pe;(x.value!==void 0&&x.value===he||be)&&(M(q),be&&($.current=!0))},[x.value]),C=g.useCallback(()=>w?.focus(),[w]),ae=g.useCallback((q,he,Pe)=>{const be=!$.current&&!Pe;(x.value!==void 0&&x.value===he||be)&&_(q)},[x.value]),me=r==="popper"?cs:mp,ve=me===cs?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:v}:{};return y.jsx(hp,{scope:n,content:w,viewport:P,onViewportChange:E,itemRefCallback:Z,selectedItem:N,onItemLeave:C,itemTextRefCallback:ae,focusSelectedItem:Y,selectedItemText:R,position:r,isPositioned:z,searchRef:S,children:y.jsx(ul,{as:lT,allowPinchZoom:!0,children:y.jsx(Zs,{asChild:!0,trapped:x.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Oe(i,q=>{x.trigger?.focus({preventScroll:!0}),q.preventDefault()}),children:y.jsx(No,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:y.jsx(me,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:q=>q.preventDefault(),...b,...ve,onPlaced:()=>U(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Oe(b.onKeyDown,q=>{const he=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!he&&q.key.length===1&&ie(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let be=L().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);if(["ArrowUp","End"].includes(q.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const ke=q.target,pe=be.indexOf(ke);be=be.slice(pe+1)}setTimeout(()=>Q(be)),q.preventDefault()}})})})})})})});pp.displayName=sT;var cT="SelectItemAlignedPosition",mp=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Pn(Sn,n),a=In(Sn,n),[s,l]=g.useState(null),[c,u]=g.useState(null),d=ze(t,k=>u(k)),h=Bo(n),f=g.useRef(!1),m=g.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=a,w=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&p&&v&&b){const k=o.trigger.getBoundingClientRect(),N=c.getBoundingClientRect(),M=o.valueNode.getBoundingClientRect(),R=b.getBoundingClientRect();if(o.dir!=="rtl"){const ke=R.left-N.left,pe=M.left-ke,We=k.left-pe,Ye=k.width+We,Ft=Math.max(Ye,N.width),tt=window.innerWidth-Ot,Ut=xu(pe,[Ot,Math.max(Ot,tt-Ft)]);s.style.minWidth=Ye+"px",s.style.left=Ut+"px"}else{const ke=N.right-R.right,pe=window.innerWidth-M.right-ke,We=window.innerWidth-k.right-pe,Ye=k.width+We,Ft=Math.max(Ye,N.width),tt=window.innerWidth-Ot,Ut=xu(pe,[Ot,Math.max(Ot,tt-Ft)]);s.style.minWidth=Ye+"px",s.style.right=Ut+"px"}const _=h(),L=window.innerHeight-Ot*2,z=p.scrollHeight,U=window.getComputedStyle(c),$=parseInt(U.borderTopWidth,10),Q=parseInt(U.paddingTop,10),Y=parseInt(U.borderBottomWidth,10),V=parseInt(U.paddingBottom,10),F=$+Q+z+V+Y,S=Math.min(v.offsetHeight*5,F),ie=window.getComputedStyle(p),Z=parseInt(ie.paddingTop,10),C=parseInt(ie.paddingBottom,10),ae=k.top+k.height/2-Ot,me=L-ae,ve=v.offsetHeight/2,q=v.offsetTop+ve,he=$+Q+q,Pe=F-he;if(he<=ae){const ke=_.length>0&&v===_[_.length-1].ref.current;s.style.bottom="0px";const pe=c.clientHeight-p.offsetTop-p.offsetHeight,We=Math.max(me,ve+(ke?C:0)+pe+Y),Ye=he+We;s.style.height=Ye+"px"}else{const ke=_.length>0&&v===_[0].ref.current;s.style.top="0px";const We=Math.max(ae,$+p.offsetTop+(ke?Z:0)+ve)+Pe;s.style.height=We+"px",p.scrollTop=he-ae+p.offsetTop}s.style.margin=`${Ot}px 0`,s.style.minHeight=S+"px",s.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,s,c,p,v,b,o.dir,r]);rt(()=>w(),[w]);const[A,P]=g.useState();rt(()=>{c&&P(window.getComputedStyle(c).zIndex)},[c]);const E=g.useCallback(k=>{k&&m.current===!0&&(w(),x?.(),m.current=!1)},[w,x]);return y.jsx(dT,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:f,onScrollButtonChange:E,children:y.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:y.jsx(De.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});mp.displayName=cT;var uT="SelectPopperPosition",cs=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ot,...o}=e,a=zo(n);return y.jsx(Kh,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.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)"}})});cs.displayName=uT;var[dT,hl]=nr(Sn,{}),us="SelectViewport",gp=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=In(us,n),a=hl(us,n),s=ze(t,o.onViewportChange),l=g.useRef(0);return y.jsxs(y.Fragment,{children:[y.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:r}),y.jsx(Ho.Slot,{scope:n,children:y.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Oe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=a;if(h?.current&&d){const f=Math.abs(l.current-u.scrollTop);if(f>0){const m=window.innerHeight-Ot*2,p=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),b=Math.max(p,v);if(b<m){const x=b+f,w=Math.min(m,x),A=x-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=A>0?A:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});gp.displayName=us;var yp="SelectGroup",[fT,hT]=nr(yp),pT=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=br();return y.jsx(fT,{scope:n,id:i,children:y.jsx(De.div,{role:"group","aria-labelledby":i,...r,ref:t})})});pT.displayName=yp;var vp="SelectLabel",pl=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=hT(vp,n);return y.jsx(De.div,{id:i.id,...r,ref:t})});pl.displayName=vp;var fo="SelectItem",[mT,bp]=nr(fo),ml=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=Pn(fo,n),l=In(fo,n),c=s.value===r,[u,d]=g.useState(o??""),[h,f]=g.useState(!1),m=ze(t,x=>l.itemRefCallback?.(x,r,i)),p=br(),v=g.useRef("touch"),b=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return y.jsx(mT,{scope:n,value:r,disabled:i,textId:p,isSelected:c,onItemTextChange:g.useCallback(x=>{d(w=>w||(x?.textContent??"").trim())},[]),children:y.jsx(Ho.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:y.jsx(De.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:m,onFocus:Oe(a.onFocus,()=>f(!0)),onBlur:Oe(a.onBlur,()=>f(!1)),onClick:Oe(a.onClick,()=>{v.current!=="mouse"&&b()}),onPointerUp:Oe(a.onPointerUp,()=>{v.current==="mouse"&&b()}),onPointerDown:Oe(a.onPointerDown,x=>{v.current=x.pointerType}),onPointerMove:Oe(a.onPointerMove,x=>{v.current=x.pointerType,i?l.onItemLeave?.():v.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:Oe(a.onKeyDown,x=>{l.searchRef?.current!==""&&x.key===" "||(JR.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});ml.displayName=fo;var ei="SelectItemText",xp=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Pn(ei,n),s=In(ei,n),l=bp(ei,n),c=nT(ei,n),[u,d]=g.useState(null),h=ze(t,b=>d(b),l.onItemTextChange,b=>s.itemTextRefCallback?.(b,l.value,l.disabled)),f=u?.textContent,m=g.useMemo(()=>y.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=c;return rt(()=>(p(m),()=>v(m)),[p,v,m]),y.jsxs(y.Fragment,{children:[y.jsx(De.span,{id:l.textId,...o,ref:h}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!$o(a.value)?Pr.createPortal(o.children,a.valueNode):null]})});xp.displayName=ei;var wp="SelectItemIndicator",kp=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return bp(wp,n).isSelected?y.jsx(De.span,{"aria-hidden":!0,...r,ref:t}):null});kp.displayName=wp;var ds="SelectScrollUpButton",gl=g.forwardRef((e,t)=>{const n=In(ds,e.__scopeSelect),r=hl(ds,e.__scopeSelect),[i,o]=g.useState(!1),a=ze(t,r.onScrollButtonChange);return rt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?y.jsx(Sp,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});gl.displayName=ds;var fs="SelectScrollDownButton",yl=g.forwardRef((e,t)=>{const n=In(fs,e.__scopeSelect),r=hl(fs,e.__scopeSelect),[i,o]=g.useState(!1),a=ze(t,r.onScrollButtonChange);return rt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;o(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?y.jsx(Sp,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});yl.displayName=fs;var Sp=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=In("SelectScrollButton",n),a=g.useRef(null),s=Bo(n),l=g.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),rt(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),y.jsx(De.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{l()})})}),gT="SelectSeparator",vl=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return y.jsx(De.div,{"aria-hidden":!0,...r,ref:t})});vl.displayName=gT;var Cp="SelectArrow",yT=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=zo(n);return In(Cp,n).position==="popper"?y.jsx(Wh,{...i,...r,ref:t}):null});yT.displayName=Cp;var Ep="SelectBubbleInput",Ap=g.forwardRef(({__scopeSelect:e,...t},n)=>{const r=Pn(Ep,e),{value:i,onValueChange:o,required:a,disabled:s,name:l,autoComplete:c,form:u}=r,{nativeOptions:d,nativeSelectKey:h}=r,f=g.useRef(null),m=ze(n,f),p=i??"",v=cR(p),b=Array.from(d).some(x=>(x.props.value??"")==="");return g.useEffect(()=>{const x=f.current;if(!x)return;const w=window.HTMLSelectElement.prototype,P=Object.getOwnPropertyDescriptor(w,"value").set;if(v!==p&&P){const E=new Event("change",{bubbles:!0});P.call(x,p),x.dispatchEvent(E)}},[v,p]),y.jsxs(De.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:l,autoComplete:c,disabled:s,form:u,onChange:x=>o(x.target.value),...t,style:{...qh,...t.style},ref:m,defaultValue:p,children:[$o(i)&&!b?y.jsx("option",{value:""}):null,Array.from(d)]},h)});Ap.displayName=Ep;function vT(e){return typeof e=="function"}function $o(e){return e===""||e===void 0}function Rp(e){const t=Xn(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(a=>{const s=n.current+a;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Tp(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=bT(e,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function bT(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const ho=op,po=lp,fi=g.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(dl,{ref:r,className:we("flex h-8 w-full items-center justify-between gap-2","rounded-md border border-border bg-surface px-3 py-1 text-sm","placeholder:text-text-muted","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55","[&>span]:line-clamp-1",e),...n,children:[t,y.jsx(cp,{asChild:!0,children:y.jsx(Hd,{className:"h-4 w-4 opacity-60"})})]}));fi.displayName=dl.displayName;const Pp=g.forwardRef(({className:e,...t},n)=>y.jsx(gl,{ref:n,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(Dy,{className:"h-4 w-4"})}));Pp.displayName=gl.displayName;const Ip=g.forwardRef(({className:e,...t},n)=>y.jsx(yl,{ref:n,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(Hd,{className:"h-4 w-4"})}));Ip.displayName=yl.displayName;const hi=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>y.jsx(dp,{children:y.jsxs(fl,{ref:i,position:n,className:we("relative z-50 max-h-96 min-w-[8rem] overflow-hidden","rounded-md border border-border bg-surface text-text shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",n==="popper"&&["data-[side=bottom]:translate-y-1","data-[side=top]:-translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1"],e),...r,children:[y.jsx(Pp,{}),y.jsx(gp,{className:we("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),y.jsx(Ip,{})]})}));hi.displayName=fl.displayName;const xT=g.forwardRef(({className:e,...t},n)=>y.jsx(pl,{ref:n,className:we("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted",e),...t}));xT.displayName=pl.displayName;const vn=g.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(ml,{ref:r,className:we("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-surface-hover focus:text-text","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(kp,{children:y.jsx(_y,{className:"h-4 w-4"})})}),y.jsx(xp,{children:t})]}));vn.displayName=ml.displayName;const wT=g.forwardRef(({className:e,...t},n)=>y.jsx(vl,{ref:n,className:we("-mx-1 my-1 h-px bg-border",e),...t}));wT.displayName=vl.displayName;function kT({agents:e,value:t,onChange:n}){const{t:r}=st();function i(o){if(!o||o===t)return;window.confirm(r("chat.switchAgentConfirm",{agent:o,defaultValue:`切换为「${o}」的对话框?`}))&&n(o)}return y.jsxs(ho,{value:t||void 0,onValueChange:i,children:[y.jsx(fi,{className:"h-7 w-28 sm:w-36 text-xs",children:y.jsx(po,{placeholder:e[0]??"—"})}),y.jsx(hi,{children:e.map(o=>y.jsx(vn,{value:o,children:o},o))})]})}function ST(e){const t=String(e||"");if(!t)return!1;const n=t.toLowerCase();return n.includes("native")?n.includes("not configured")||n.includes("not available")||n.includes("no llm backend")||n.includes("llmroles.native-chat")||t.includes("/settings/llm")||t.includes("未配置")||t.includes("大模型"):!1}const Vo={all:["llm"],list:["llm","list"]};function CT(){return af({queryKey:Vo.list,queryFn:()=>K.get("/api/llm")})}function ET(){const e=An();return Rn({mutationFn:t=>K.post("/api/llm/backends",{body:t}),onSuccess:()=>e.invalidateQueries({queryKey:Vo.all})})}function AD(){const e=An();return Rn({mutationFn:t=>K.delete(`/api/llm/backends/${encodeURIComponent(t)}`),onSuccess:()=>e.invalidateQueries({queryKey:Vo.all})})}function RD(){const e=An();return Rn({mutationFn:t=>K.put("/api/llm/roles",{body:t}),onSuccess:()=>e.invalidateQueries({queryKey:Vo.all})})}function TD(){return Rn({mutationFn:e=>K.post(`/api/llm/backends/${encodeURIComponent(e)}/ping`)})}const Ko={all:["mcp"],list:["mcp","list"]};function PD(){return af({queryKey:Ko.list,queryFn:()=>K.get("/api/mcp")})}function ID(){const e=An();return Rn({mutationFn:t=>K.post("/api/mcp/servers",{body:t}),onSuccess:()=>e.invalidateQueries({queryKey:Ko.all})})}function LD(){const e=An();return Rn({mutationFn:t=>K.delete(`/api/mcp/servers/${encodeURIComponent(t)}`),onSuccess:()=>e.invalidateQueries({queryKey:Ko.all})})}function OD(){const e=An();return Rn({mutationFn:t=>K.post(`/api/mcp/servers/${encodeURIComponent(t)}/health`),onSuccess:()=>e.invalidateQueries({queryKey:Ko.all})})}var Wo="Dialog",[Lp]=xi(Wo),[AT,jt]=Lp(Wo),Op=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=g.useRef(null),l=g.useRef(null),[c,u]=ss({prop:r,defaultProp:i??!1,onChange:o,caller:Wo});return y.jsx(AT,{scope:t,triggerRef:s,contentRef:l,contentId:br(),titleId:br(),descriptionId:br(),open:c,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};Op.displayName=Wo;var Np="DialogTrigger",RT=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jt(Np,n),o=ze(t,i.triggerRef);return y.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Cl(i.open),...r,ref:o,onClick:Oe(e.onClick,i.onOpenToggle)})});RT.displayName=Np;var bl="DialogPortal",[TT,_p]=Lp(bl,{forceMount:void 0}),Dp=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=jt(bl,t);return y.jsx(TT,{scope:t,forceMount:n,children:g.Children.map(r,a=>y.jsx(jr,{present:n||o.open,children:y.jsx(cl,{asChild:!0,container:i,children:a})}))})};Dp.displayName=bl;var mo="DialogOverlay",xl=g.forwardRef((e,t)=>{const n=_p(mo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=jt(mo,e.__scopeDialog);return o.modal?y.jsx(jr,{present:r||o.open,children:y.jsx(IT,{...i,ref:t})}):null});xl.displayName=mo;var PT=Sr("DialogOverlay.RemoveScroll"),IT=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jt(mo,n),o=P1(),a=ze(t,o);return y.jsx(ul,{as:PT,allowPinchZoom:!0,shards:[i.contentRef],children:y.jsx(De.div,{"data-state":Cl(i.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})}),Ar="DialogContent",wl=g.forwardRef((e,t)=>{const n=_p(Ar,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=jt(Ar,e.__scopeDialog);return y.jsx(jr,{present:r||o.open,children:o.modal?y.jsx(LT,{...i,ref:t}):y.jsx(OT,{...i,ref:t})})});wl.displayName=Ar;var LT=g.forwardRef((e,t)=>{const n=jt(Ar,e.__scopeDialog),r=g.useRef(null),i=ze(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return Yh(o)},[]),y.jsx(Mp,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Oe(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Oe(e.onFocusOutside,o=>o.preventDefault())})}),OT=g.forwardRef((e,t)=>{const n=jt(Ar,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return y.jsx(Mp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Mp=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=jt(Ar,n);return kh(),y.jsx(y.Fragment,{children:y.jsx(Zs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:y.jsx(No,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Cl(s.open),...a,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),jp="DialogTitle",kl=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jt(jp,n);return y.jsx(De.h2,{id:i.titleId,...r,ref:t})});kl.displayName=jp;var Fp="DialogDescription",Sl=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jt(Fp,n);return y.jsx(De.p,{id:i.descriptionId,...r,ref:t})});Sl.displayName=Fp;var Up="DialogClose",Hp=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jt(Up,n);return y.jsx(De.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>i.onOpenChange(!1))})});Hp.displayName=Up;function Cl(e){return e?"open":"closed"}const NT=Op,_T=Dp,Bp=g.forwardRef(({className:e,...t},n)=>y.jsx(xl,{ref:n,className:we("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Bp.displayName=xl.displayName;const zp=g.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(_T,{children:[y.jsx(Bp,{}),y.jsxs(wl,{ref:r,className:we("fixed left-[50%] top-[50%] z-50 grid w-full max-w-[calc(100vw-2rem)] sm:max-w-lg","translate-x-[-50%] translate-y-[-50%] gap-4","border border-border bg-surface p-4 shadow-lg","rounded-lg","max-h-[85dvh] overflow-y-auto pb-[calc(env(safe-area-inset-bottom)+1.5rem)]","duration-200","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",e),...n,children:[t,y.jsx(Hp,{className:we("absolute right-4 top-4 rounded-md p-1","text-text-dim hover:bg-surface-hover hover:text-text","focus:outline-none focus:ring-2 focus:ring-accent","tap-target","disabled:pointer-events-none"),"aria-label":"Close",children:y.jsx(qy,{className:"h-4 w-4"})})]})]}));zp.displayName=wl.displayName;const $p=({className:e,...t})=>y.jsx("div",{className:we("flex flex-col gap-1.5 text-left",e),...t});$p.displayName="DialogHeader";const Vp=({className:e,...t})=>y.jsx("div",{className:we("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t});Vp.displayName="DialogFooter";const Kp=g.forwardRef(({className:e,...t},n)=>y.jsx(kl,{ref:n,className:we("text-lg font-semibold leading-snug",e),...t}));Kp.displayName=kl.displayName;const Wp=g.forwardRef(({className:e,...t},n)=>y.jsx(Sl,{ref:n,className:we("text-sm text-text-dim",e),...t}));Wp.displayName=Sl.displayName;const Gi=[{key:"deepseek",provider:"openai-compat",baseUrl:"https://api.deepseek.com/v1",model:"deepseek-chat",baseName:"deepseek-native"},{key:"moonshot",provider:"openai-compat",baseUrl:"https://api.moonshot.cn/v1",model:"moonshot-v1-8k",baseName:"moonshot-native"},{key:"zhipu",provider:"openai-compat",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-4-air",baseName:"zhipu-native"},{key:"openai",provider:"openai-compat",baseUrl:"https://api.openai.com/v1",model:"gpt-4o-mini",baseName:"openai-native"},{key:"anthropic",provider:"anthropic",baseUrl:"https://api.anthropic.com",model:"claude-3-5-sonnet-20241022",baseName:"anthropic-native"},{key:"custom",provider:"openai-compat",baseUrl:"",model:"",baseName:"native-backend"}],Ku=Gi[0];function Wu(e,t){const n=new Set(t.map(r=>r.toLowerCase()));if(!n.has(e.toLowerCase()))return e;for(let r=2;r<200;r+=1){const i=`${e}-${r}`;if(!n.has(i.toLowerCase()))return i}return`${e}-${Date.now()}`}function DT({open:e,reason:t,onOpenChange:n,onConfigured:r}){const{t:i}=st(["common","settings"]),o=ET(),a=CT(),[s,l]=g.useState("deepseek"),c=g.useMemo(()=>Gi.find(P=>P.key===s)??Ku,[s]),u=g.useMemo(()=>(a.data?.backends??[]).map(P=>P.name),[a.data]),[d,h]=g.useState(()=>Wu("deepseek-native",[])),[f,m]=g.useState(c.baseUrl),[p,v]=g.useState(c.model),[b,x]=g.useState("");function w(P){const E=Gi.find(k=>k.key===P)??Ku;l(P),m(E.baseUrl),v(E.model),h(Wu(E.baseName,u))}async function A(P){if(P.preventDefault(),!d.trim()){Xe.error(i("llm.nameRequired",{ns:"settings"}));return}if(!f.trim()){Xe.error(i("llm.baseUrlRequired",{ns:"settings"}));return}if(!/^https?:\/\//i.test(f.trim())){Xe.error(i("llm.baseUrlRequired",{ns:"settings"}));return}if(!p.trim()){Xe.error(i("llm.modelRequired",{ns:"settings"}));return}if(!b.trim()){Xe.error(i("chat.nativeSetupApiKeyRequired",{defaultValue:"请填写 API Key"}));return}try{await o.mutateAsync({name:d.trim(),provider:c.provider,baseUrl:f.trim(),model:p.trim(),apiKey:b.trim()}),Xe.success(i("chat.nativeSetupSaved",{defaultValue:"LLM 配置已保存,正在重试切换 native…"})),x(""),n(!1),r?.()}catch(E){Xe.error(E?.message??String(E))}}return y.jsx(NT,{open:e,onOpenChange:n,children:y.jsxs(zp,{className:"sm:max-w-2xl",children:[y.jsxs($p,{children:[y.jsx(Kp,{children:i("chat.nativeSetupDialogTitle",{defaultValue:"配置 Native Agent 所需 LLM"})}),y.jsx(Wp,{children:i("chat.nativeSetupDialogDesc",{defaultValue:"只要配置一个可用的 LLM backend(含 API Key),native 就可以使用。Role Bindings 属于可选高级配置。"})})]}),y.jsxs("form",{className:"space-y-4",onSubmit:P=>void A(P),children:[t&&y.jsxs("div",{className:"rounded-md border border-warning/50 bg-warning-bg/40 p-3 text-xs text-warning",children:[y.jsx("div",{className:"mb-1 font-medium",children:i("chat.nativeSetupDialogReason",{defaultValue:"最近一次错误信息"})}),y.jsx("div",{className:"break-words",children:t})]}),y.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[y.jsxs("div",{children:[y.jsx(Bn,{className:"text-xs font-medium",children:i("llm.preset",{ns:"settings"})}),y.jsxs(ho,{value:s,onValueChange:P=>w(P),children:[y.jsx(fi,{children:y.jsx(po,{})}),y.jsx(hi,{children:Gi.map(P=>y.jsx(vn,{value:P.key,children:i(`llm.presets.${P.key}`,{ns:"settings"})},P.key))})]})]}),y.jsxs("div",{children:[y.jsx(Bn,{className:"text-xs font-medium",children:i("llm.name",{ns:"settings"})}),y.jsx(gr,{value:d,onChange:P=>h(P.target.value),placeholder:i("llm.namePlaceholder",{ns:"settings"}),className:"font-mono text-xs"})]}),y.jsxs("div",{className:"sm:col-span-2",children:[y.jsx(Bn,{className:"text-xs font-medium",children:i("llm.baseUrl",{ns:"settings"})}),y.jsx(gr,{value:f,onChange:P=>m(P.target.value),placeholder:i("llm.baseUrlPlaceholder",{ns:"settings"}),className:"font-mono text-xs"})]}),y.jsxs("div",{children:[y.jsx(Bn,{className:"text-xs font-medium",children:i("llm.model",{ns:"settings"})}),y.jsx(gr,{value:p,onChange:P=>v(P.target.value),placeholder:i("llm.modelPlaceholder",{ns:"settings"}),className:"font-mono text-xs"})]}),y.jsxs("div",{children:[y.jsx(Bn,{className:"text-xs font-medium",children:i("llm.apiKeyOptional",{ns:"settings"})}),y.jsx(gr,{type:"password",value:b,onChange:P=>x(P.target.value),placeholder:i("llm.apiKeyPlaceholder",{ns:"settings"}),className:"font-mono text-xs",autoComplete:"off"})]})]}),y.jsx("p",{className:"text-xs text-text-dim",children:i("chat.nativeSetupDialogRoleOptional",{defaultValue:"Role Bindings 是可选增强项,不配置也不会阻塞 native。"})}),y.jsxs(Vp,{children:[y.jsx(at,{type:"button",variant:"ghost",onClick:()=>window.location.assign("/settings/llm"),children:i("chat.nativeSetupDialogAdvanced",{defaultValue:"打开完整 LLM 设置页"})}),y.jsx(at,{type:"button",variant:"outline",onClick:()=>n(!1),children:i("chat.nativeSetupDialogCancel",{defaultValue:"稍后再配"})}),y.jsx(at,{type:"submit",disabled:o.isPending,children:i("chat.nativeSetupDialogSave",{defaultValue:"保存并启用 native"})})]})]})]})})}const hs="agim-theme",qp="im-hub-lang";function MT(){try{const e=localStorage.getItem(hs);if(e==="light"||e==="dark")return e}catch{}return"system"}function jT(){try{const t=localStorage.getItem(qp);if(t==="en"||t==="zh")return t}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function qu(e){try{e==="system"?localStorage.removeItem(hs):localStorage.setItem(hs,e)}catch{}}function FT(e){try{localStorage.setItem(qp,e)}catch{}}const yr=_d((e,t)=>({theme:MT(),lang:jT(),setTheme:n=>{qu(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=n==="system"?"light":n==="light"?"dark":"system";qu(r),e({theme:r})},setLang:n=>{FT(n),e({lang:n})}}));function Gu(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}function UT(){const e=yr(t=>t.theme);g.useEffect(()=>{if(Gu(e),e!=="system")return;const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>Gu(e);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e])}function HT(){const{t:e}=st(),t=yr(o=>o.theme),n=yr(o=>o.lang),r=yr(o=>o.setTheme),i=yr(o=>o.setLang);return y.jsxs(y.Fragment,{children:[y.jsxs(ho,{value:n,onValueChange:o=>i(o),children:[y.jsx(fi,{className:"h-7 w-16 sm:w-20 text-xs","aria-label":e("lang.label"),children:y.jsx(po,{})}),y.jsxs(hi,{children:[y.jsx(vn,{value:"en",children:e("lang.en")}),y.jsx(vn,{value:"zh",children:e("lang.zh")})]})]}),y.jsxs(ho,{value:t,onValueChange:o=>r(o),children:[y.jsx(fi,{className:"h-7 w-16 text-xs sm:w-28","aria-label":e("theme.label"),children:y.jsx(po,{})}),y.jsxs(hi,{children:[y.jsx(vn,{value:"system",children:y.jsxs("span",{className:"inline-flex items-center gap-2",children:[y.jsx(Uy,{className:"h-4 w-4"})," ",e("theme.system")]})}),y.jsx(vn,{value:"light",children:y.jsxs("span",{className:"inline-flex items-center gap-2",children:[y.jsx(Ky,{className:"h-4 w-4"})," ",e("theme.light")]})}),y.jsx(vn,{value:"dark",children:y.jsxs("span",{className:"inline-flex items-center gap-2",children:[y.jsx(By,{className:"h-4 w-4"})," ",e("theme.dark")]})})]})]})]})}function BT(e){const[t,n]=g.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return g.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),i=o=>n(o.matches);return n(r.matches),r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e]),t}function zT(){return BT("(min-width: 640px)")}const $T=[{to:"/",i18nKey:"nav.chat",mounted:!0},{to:"/tasks",i18nKey:"nav.tasks",mounted:!0},{to:"/approvals",i18nKey:"nav.approvals",mounted:!0},{to:"/reminders",i18nKey:"nav.reminders",mounted:!0},{to:"/memos",i18nKey:"nav.memos",mounted:!0},{to:"/memory",i18nKey:"nav.memory",mounted:!0},{to:"/workspace",i18nKey:"nav.workspace",mounted:!0},{to:"/observability",i18nKey:"nav.observability",mounted:!0},{to:"/settings",i18nKey:"nav.settings",mounted:!0}];function Gp({children:e}){const{t}=st(),n=zT(),r=y.jsx("nav",{className:we("flex flex-1 min-w-0 items-center gap-1","overflow-x-auto scrollbar-thin","[&::-webkit-scrollbar]:h-1 [&::-webkit-scrollbar-thumb]:bg-border"),"aria-label":t("appName"),children:$T.filter(i=>i.mounted).map(i=>y.jsx(Ql,{to:i.to,end:i.to==="/",className:({isActive:o})=>we("shrink-0 rounded-md px-2.5 py-1.5 text-sm no-underline","transition-colors tap-target",o?"bg-accent-bg text-accent font-medium":"text-text-dim hover:bg-surface-hover hover:text-text"),children:t(i.i18nKey)},i.to))});return y.jsxs("header",{className:we("sticky top-0 z-20","flex flex-col sm:flex-row sm:items-center sm:gap-3","border-b border-border bg-surface","pt-safe","shadow-sm"),children:[y.jsxs("div",{className:we("flex items-center gap-2 sm:gap-3","overflow-x-hidden","px-3 sm:px-4 py-2 sm:py-2","sm:flex-1 sm:min-w-0"),children:[y.jsxs(Ql,{to:"/",className:"flex shrink-0 items-center gap-1 text-md font-semibold no-underline",end:!0,children:[y.jsx("span",{"aria-hidden":"true",children:"🤖"}),y.jsx("span",{className:"hidden sm:inline",children:t("appName")})]}),n&&y.jsx("div",{className:"flex flex-1 min-w-0",children:r}),e&&y.jsx("div",{className:"flex items-center gap-2",children:e}),y.jsx("div",{className:"flex shrink-0 items-center gap-2",children:y.jsx(HT,{})})]}),!n&&y.jsx("div",{className:"border-t border-border px-3 py-1",children:r})]})}const VT={open:"bg-success",connecting:"bg-warning animate-pulse",closed:"bg-text-muted",error:"bg-danger"};function KT(){const{t:e}=st(),{state:t,send:n,switchAgent:r,approvalClick:i,newConversation:o,clearError:a}=px(),[s,l]=g.useState(""),[c,u]=g.useState(!1),[d,h]=g.useState(""),f=g.useRef(null),m=g.useRef(null);g.useEffect(()=>{if(!f.current)return;const b=f.current;!(b.scrollHeight-b.scrollTop-b.clientHeight<200)&&t.currentReplyId==null||requestAnimationFrame(()=>{b.scrollTop=b.scrollHeight})},[t.messages,t.currentReplyId]),g.useEffect(()=>{t.error&&(ST(t.error)?(h(t.error),u(!0)):Xe.error(t.error),a())},[t.error,a]);function p(b){b?.preventDefault();const x=s.trim();if(x){if(t.status!=="open"){Xe.error(e("chat.notConnected",{defaultValue:"Not connected. Reconnecting…"}));return}n(x),l(""),requestAnimationFrame(()=>m.current?.focus())}}function v(b){b.nativeEvent.isComposing||b.keyCode===229||b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),p())}return y.jsxs("div",{className:"flex h-dvh flex-col bg-bg",children:[y.jsxs(Gp,{children:[y.jsx("span",{className:we("inline-block h-2 w-2 rounded-full",VT[t.status]),title:t.status}),y.jsx("span",{className:"hidden text-xs text-text-dim sm:inline",children:t.status}),y.jsxs(at,{variant:"ghost",size:"sm",onClick:()=>{o(),Xe.success(e("chat.newConvToast",{defaultValue:"Started a new conversation"})),requestAnimationFrame(()=>m.current?.focus())},disabled:t.status!=="open",title:e("chat.newConvHint",{defaultValue:"Clear messages and start a fresh session"}),"aria-label":e("chat.newConv",{defaultValue:"New conversation"}),children:[y.jsx(Hy,{className:"h-4 w-4"}),y.jsx("span",{className:"hidden text-xs sm:inline",children:e("chat.newConv",{defaultValue:"New"})})]}),y.jsx(kT,{agents:t.agents,value:t.agent,onChange:r})]}),y.jsx(DT,{open:c,reason:d,onOpenChange:u,onConfigured:()=>r("native")}),y.jsx("div",{ref:f,className:"flex-1 overflow-y-auto",children:y.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col gap-2 px-3 py-3 sm:px-4",children:[t.messages.length===0&&t.status==="open"&&y.jsxs("div",{className:"flex flex-col items-center gap-2 py-16 text-center",children:[y.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-2xl",children:"💬"}),y.jsx("h2",{className:"text-base font-semibold",children:e("chat.welcomeTitle",{defaultValue:"Start a conversation"})}),y.jsx("p",{className:"max-w-md text-sm text-text-dim",children:e("chat.welcomeBody",{defaultValue:"Type a message to ask the active agent. Use the agent dropdown to switch."})})]}),t.messages.length===0&&t.status!=="open"&&y.jsxs("div",{className:"grid place-items-center py-16 text-center",children:[y.jsx(My,{className:"h-10 w-10 text-text-muted"}),y.jsx("p",{className:"mt-3 text-sm text-text-dim",children:t.status==="connecting"?e("chat.connecting",{defaultValue:"Connecting to agim…"}):e("chat.disconnected",{defaultValue:"Disconnected. Reconnecting automatically; you can keep typing."})})]}),t.messages.filter(b=>!b.approval).map(b=>y.jsx(u1,{msg:b,onApprove:(x,w,A)=>i(x,w,A)},b.id))]})}),y.jsx(m1,{approvals:t.pendingApprovals,onApprove:(b,x,w)=>i(b,x,w)}),y.jsxs("form",{onSubmit:p,className:"sticky bottom-0 border-t border-border bg-surface px-4 py-2 pb-safe sm:px-6",children:[y.jsxs("div",{className:"mx-auto flex max-w-3xl items-end gap-2",children:[y.jsx("textarea",{ref:m,value:s,onChange:b=>l(b.target.value),onKeyDown:v,placeholder:e("chat.inputPlaceholder",{defaultValue:"Message… (Enter sends, Shift+Enter newlines)"}),rows:1,className:we("flex-1 resize-none rounded-md border border-border bg-bg","px-3 py-1.5 text-sm leading-5","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","max-h-32 min-h-8")}),y.jsx(at,{type:"submit",disabled:!s.trim()||t.status!=="open","aria-label":e("chat.send",{defaultValue:"Send"}),className:"h-8 w-8 p-0",children:y.jsx($y,{className:"h-4 w-4"})})]}),t.currentReplyId&&y.jsx("div",{className:"mx-auto mt-2 flex max-w-3xl items-center gap-2",children:y.jsx(dt,{variant:"info",children:e("chat.streaming",{defaultValue:"… streaming"})})})]})]})}function WT(){const{t:e}=st(),t=un();return y.jsxs("div",{className:"flex min-h-dvh flex-col bg-bg",children:[y.jsx(Gp,{}),y.jsx("main",{className:"grid flex-1 place-items-center px-4 py-8 pb-safe",children:y.jsxs("div",{className:"flex max-w-md flex-col items-center gap-3 text-center",children:[y.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-text-dim",children:y.jsx(jy,{className:"h-6 w-6"})}),y.jsx("div",{className:"text-6xl font-bold tracking-tight text-text-muted",children:"404"}),y.jsx("h1",{className:"text-xl font-semibold",children:e("notFound.title",{defaultValue:"Nothing here."})}),y.jsx("p",{className:"text-sm text-text-dim",children:e("notFound.description",{defaultValue:"The page you're looking for doesn't exist."})}),y.jsx("code",{className:"rounded bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.pathname}),y.jsx(at,{asChild:!0,className:"mt-2",children:y.jsx(Cs,{to:"/",children:e("actions.back")})})]})})]})}function nn(e){return async()=>{const n=(await e()).default;return{element:y.jsx(Dd,{children:y.jsx(n,{})})}}}function Ae(e){return async()=>{const n=(await e()).default;return{element:y.jsx(n,{})}}}const qT=qg([{path:"/login",element:y.jsx(ax,{})},{path:"/",element:y.jsx(Dd,{children:y.jsx(KT,{})})},{path:"/tasks",lazy:nn(()=>fe(()=>import("./layout-BRnEPnky.js"),__vite__mapDeps([0,1]))),children:[{index:!0,element:y.jsx(Vt,{to:"jobs",replace:!0})},{path:"jobs",lazy:Ae(()=>fe(()=>import("./jobs-Cby1Eq4o.js"),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])))},{path:"subtasks",lazy:Ae(()=>fe(()=>import("./subtasks-BrqdQxw_.js"),__vite__mapDeps([18,1,3,4,5,6,7,8,13,14,15])))},{path:"bgjobs",lazy:Ae(()=>fe(()=>import("./bgjobs-Cwp0PmTF.js"),__vite__mapDeps([19,1,3,4,5,6,7,8,14,15])))},{path:"schedules",lazy:Ae(()=>fe(()=>import("./schedules-CuqRy3t8.js"),__vite__mapDeps([20,1,3,4,5,6,7,14,15])))},{path:"outbox",lazy:Ae(()=>fe(()=>import("./outbox-87hzZQLn.js"),__vite__mapDeps([21,1,3,4,5,6,7,8,12,14,15])))},{path:"a2a",lazy:Ae(()=>fe(()=>import("./a2a-Dtc6AKjx.js"),__vite__mapDeps([22,1,3,4,5,6,7,8,13,14,15])))},{path:"heartbeat",lazy:Ae(()=>fe(()=>import("./heartbeat-BzHZy7Mx.js"),__vite__mapDeps([23,1,4,24,25,14,15,26])))},{path:"goals",lazy:Ae(()=>fe(()=>import("./goals-HsKzf-PG.js"),__vite__mapDeps([27,1,4,24,14,15,28,16])))},{path:"asks",lazy:Ae(()=>fe(()=>import("./asks-BszsbhPn.js"),__vite__mapDeps([29,4,1,24,14,15,16])))},{path:"plans",lazy:Ae(()=>fe(()=>import("./plans-Ddz5qwqp.js"),__vite__mapDeps([30,1,4,24,14,15,11,31,16,28])))}]},{path:"/approvals",lazy:nn(()=>fe(()=>import("./approvals-BEPKSyrL.js"),__vite__mapDeps([32,1,5,13,14,15])))},{path:"/reminders",lazy:nn(()=>fe(()=>import("./reminders-DEWtrlH_.js"),__vite__mapDeps([33,1,3,4,5,6,7,8,12,31,14,15,34])))},{path:"/memos",lazy:nn(()=>fe(()=>import("./memos-BYQa4d2t.js"),__vite__mapDeps([35,1,3,4,5,6,7,12,11,36,15,37,38])))},{path:"/memory",lazy:nn(()=>fe(()=>import("./layout-Gh29ouFO.js"),__vite__mapDeps([39,40,1]))),children:[{index:!0,element:y.jsx(Vt,{to:"facts",replace:!0})},{path:"facts",lazy:Ae(()=>fe(()=>import("./facts-BPVTGzM4.js"),__vite__mapDeps([41,1,3,4,5,6,7,9,10,11,12,40,36,42,14,15,37])))},{path:"persona",lazy:Ae(()=>fe(()=>import("./persona-BcOT3Wms.js"),__vite__mapDeps([43,1,5,12,40,42,14,15,26,44,16,36])))},{path:"vector",lazy:Ae(()=>fe(()=>import("./vector-xRphJ8hW.js"),__vite__mapDeps([45,1,46,40,14,47,48,12,5,16,15,26,49,36,44])))},{path:"skills",element:y.jsx(Vt,{to:"/settings/agim-skills/installed",replace:!0})}]},{path:"/skills",children:[{index:!0,element:y.jsx(Vt,{to:"/settings/agim-skills/installed",replace:!0})},{path:"installed",element:y.jsx(Vt,{to:"/settings/agim-skills/installed",replace:!0})},{path:"hot",element:y.jsx(Vt,{to:"/settings/agim-skills/hot",replace:!0})}]},{path:"/workspace",lazy:nn(()=>fe(()=>import("./workspace-BqMuxPFF.js"),__vite__mapDeps([50,1,5,51,14,15])))},{path:"/observability",lazy:nn(()=>fe(()=>import("./layout-BdtJtlu5.js"),__vite__mapDeps([52,1]))),children:[{index:!0,element:y.jsx(Vt,{to:"health",replace:!0})},{path:"health",lazy:Ae(()=>fe(()=>import("./health-CSMAArAj.js"),__vite__mapDeps([53,1,5,4,54,14,15,55])))},{path:"topn",lazy:Ae(()=>fe(()=>import("./topn-DZWbwDge.js"),__vite__mapDeps([56,5,4,1,54,14,15])))},{path:"audit",lazy:Ae(()=>fe(()=>import("./audit-ACrwMizd.js"),__vite__mapDeps([57,1,3,4,5,6,7,54,14,15,55])))}]},{path:"/settings",lazy:nn(()=>fe(()=>import("./layout-0rDvqHCV.js"),__vite__mapDeps([58,1]))),children:[{index:!0,element:y.jsx(Vt,{to:"messengers",replace:!0})},{path:"messengers",lazy:Ae(()=>fe(()=>import("./messengers-CebazAJ1.js"),__vite__mapDeps([59,1,46,14,15,47,60])))},{path:"email",lazy:Ae(()=>fe(()=>import("./email-YUzrp4Tf.js"),__vite__mapDeps([61,1,46,14,16,28,15,48,47])))},{path:"viewer",lazy:Ae(()=>fe(()=>import("./viewer-Bq7l2kE8.js"),__vite__mapDeps([62,1,46,48,14,15,28,63,47,38])))},{path:"agents",lazy:Ae(()=>fe(()=>import("./agents-DnJruPrS.js"),__vite__mapDeps([64,1,5,51,46,14,15,47,65,37,66,36])))},{path:"policy",lazy:Ae(()=>fe(()=>import("./policy-Be-tMZZc.js"),__vite__mapDeps([67,46,14,15,1])))},{path:"security",lazy:Ae(()=>fe(()=>import("./security-BB-YnetQ.js"),__vite__mapDeps([68,1,46,14,15,69,28])))},{path:"service",lazy:Ae(()=>fe(()=>import("./service-DgkqlAtM.js"),__vite__mapDeps([70,1,12,46,14,15,26,65,47])))},{path:"admins",lazy:Ae(()=>fe(()=>import("./admins-CeQorJdU.js"),__vite__mapDeps([71,1,12,5,4,46,14,15,36])))},{path:"workspaces",lazy:Ae(()=>fe(()=>import("./workspaces-D0pYJfxI.js"),__vite__mapDeps([72,1,5,4,46,14,15,17,47])))},{path:"llm",lazy:Ae(()=>fe(()=>import("./llm-COWnMdB9.js"),__vite__mapDeps([73,1,4,14,15,36,66])))},{path:"mcp",lazy:Ae(()=>fe(()=>import("./mcp-CWMdxcBf.js"),__vite__mapDeps([74,1,4,14,15,55,36,66])))},{path:"native-agent",lazy:Ae(()=>fe(()=>import("./native-agent-MGgMeTHN.js"),__vite__mapDeps([75,1,46,14,15,47,65,69,34,25])))},{path:"search",lazy:Ae(()=>fe(()=>import("./search-Dot_W5Eu.js"),__vite__mapDeps([76,1,46,14,15,47,6,7,28,16])))},{path:"mobile",lazy:Ae(()=>fe(()=>import("./mobile-CMJRNHs2.js"),__vite__mapDeps([77,1,14,15,60,48,78,69])))},{path:"agim-skills",lazy:Ae(()=>fe(()=>import("./layout-CbqldDRj.js"),__vite__mapDeps([79,1]))),children:[{index:!0,element:y.jsx(Vt,{to:"installed",replace:!0})},{path:"installed",lazy:Ae(()=>fe(()=>import("./installed-XQQEPKh8.js"),__vite__mapDeps([80,1,81,14,15,37,11,36,47])))},{path:"hot",lazy:Ae(()=>fe(()=>import("./hot-DkFvD3H4.js"),__vite__mapDeps([82,1,5,63,14,15,37,49,78])))},{path:"injection",lazy:Ae(()=>fe(()=>import("./injection-a2kkgRbT.js"),__vite__mapDeps([83,1,81,14,15,78,47,36])))}]}]},{path:"/m/chat",lazy:nn(()=>fe(()=>import("./chat-D7jjr-Rn.js"),__vite__mapDeps([84,1,10,7,14,55])))},{path:"*",element:y.jsx(WT,{})}]);function GT(){return y.jsx(Fv,{children:y.jsx(ty,{router:qT})})}const QT=new db({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1,retryDelay:e=>Math.min(1e3*2**e,8e3),refetchOnWindowFocus:!1,refetchOnReconnect:!0},mutations:{retry:0}}}),de=e=>typeof e=="string",Jr=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},Qu=e=>e==null?"":""+e,YT=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},XT=/###/g,Yu=e=>e&&e.indexOf("###")>-1?e.replace(XT,"."):e,Xu=e=>!e||de(e),ii=(e,t,n)=>{const r=de(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(Xu(e))return{};const o=Yu(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return Xu(e)?{}:{obj:e,k:Yu(r[i])}},Ju=(e,t,n)=>{const{obj:r,k:i}=ii(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=ii(e,a,Object);for(;s.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=ii(e,a,Object),s?.obj&&typeof s.obj[`${s.k}.${o}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},JT=(e,t,n,r)=>{const{obj:i,k:o}=ii(e,t,Object);i[o]=i[o]||[],i[o].push(n)},go=(e,t)=>{const{obj:n,k:r}=ii(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ZT=(e,t,n)=>{const r=go(e,n);return r!==void 0?r:go(t,n)},Qp=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?de(e[r])||e[r]instanceof String||de(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Qp(e[r],t[r],n):e[r]=t[r]);return e},hr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var eP={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const tP=e=>de(e)?e.replace(/[&<>"'\/]/g,t=>eP[t]):e;class nP{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 r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const rP=[" ",",","?","!",";"],iP=new nP(20),oP=(e,t,n)=>{t=t||"",n=n||"";const r=rP.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=iP.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},ps=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let a,s="";for(let l=o;l<r.length;++l)if(l!==o&&(s+=n),s+=r[l],a=i[s],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;o+=l-o+1;break}i=a}return i},yo=e=>e?.replace("_","-"),aP={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class vo{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||aP,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(de(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new vo(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new vo(this.logger,t)}}var Gt=new vo;class qo{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(a=>{let[s,l]=a;for(let c=0;c<l;c++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[s,l]=a;for(let c=0;c<l;c++)s.apply(s,[t,...r])})}}class Zu extends qo{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,n],r&&(Array.isArray(r)?s.push(...r):de(r)&&o?s.push(...r.split(o)):s.push(r)));const l=go(this.data,s);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),l||!a||!de(r)?l:ps(this.data?.[t]?.[n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),Ju(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(de(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=go(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Qp(l,r,o):l={...l,...r},Ju(this.data,s,l),a.silent||this.emit("added",t,n,r)}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(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var Yp={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,i)??t}),t}};const ed={},td=e=>!de(e)&&typeof e!="boolean"&&typeof e!="number";class bo extends qo{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),YT(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Gt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!oP(t,r,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:de(o)?[o]:o};const c=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(i)}return{key:t,namespaces:de(o)?[o]:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],n),l=s[s.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode"){if(u){const _=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${_}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${_}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a}const d=this.resolve(t,n);let h=d?.res;const f=d?.usedKey||a,m=d?.exactUsedKey||a,p=["[object Number]","[object Function]","[object RegExp]"],v=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=n.count!==void 0&&!de(n.count),w=bo.hasDefaultValue(n),A=x?this.pluralResolver.getSuffix(c,n.count,n):"",P=n.ordinal&&x?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",E=x&&!n.ordinal&&n.count===0,k=E&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${A}`]||n[`defaultValue${P}`]||n.defaultValue;let N=h;b&&!h&&w&&(N=k);const M=td(N),R=Object.prototype.toString.apply(N);if(b&&N&&M&&p.indexOf(R)<0&&!(de(v)&&Array.isArray(N))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,N,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(d.res=_,d.usedParams=this.getUsedParamsDetails(n),d):_}if(o){const _=Array.isArray(N),L=_?[]:{},z=_?m:f;for(const U in N)if(Object.prototype.hasOwnProperty.call(N,U)){const $=`${z}${o}${U}`;w&&!h?L[U]=this.translate($,{...n,defaultValue:td(k)?k[U]:void 0,joinArrays:!1,ns:s}):L[U]=this.translate($,{...n,joinArrays:!1,ns:s}),L[U]===$&&(L[U]=N[U])}h=L}}else if(b&&de(v)&&Array.isArray(h))h=h.join(v),h&&(h=this.extendTranslation(h,t,n,r));else{let _=!1,L=!1;!this.isValidLookup(h)&&w&&(_=!0,h=k),this.isValidLookup(h)||(L=!0,h=a);const U=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:h,$=w&&k!==h&&this.options.updateMissing;if(L||_||$){if(this.logger.log($?"updateKey":"missingKey",c,l,a,$?k:h),o){const F=this.resolve(a,{...n,keySeparator:!1});F&&F.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 Q=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let F=0;F<Y.length;F++)Q.push(Y[F]);else this.options.saveMissingTo==="all"?Q=this.languageUtils.toResolveHierarchy(n.lng||this.language):Q.push(n.lng||this.language);const V=(F,S,ie)=>{const Z=w&&ie!==h?ie:U;this.options.missingKeyHandler?this.options.missingKeyHandler(F,l,S,Z,$,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,l,S,Z,$,n),this.emit("missingKey",F,l,S,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?Q.forEach(F=>{const S=this.pluralResolver.getSuffixes(F,n);E&&n[`defaultValue${this.options.pluralSeparator}zero`]&&S.indexOf(`${this.options.pluralSeparator}zero`)<0&&S.push(`${this.options.pluralSeparator}zero`),S.forEach(ie=>{V([F],a+ie,n[`defaultValue${ie}`]||k)})}):V(Q,a,k))}h=this.extendTranslation(h,t,n,d,r),L&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${l}:${a}`),(L||_)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,_?h:void 0))}return i?(d.res=h,d.usedParams=this.getUsedParamsDetails(n),d):h}extendTranslation(t,n,r,i,o){var a=this;if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=de(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const h=t.match(this.interpolator.nestingRegexp);u=h&&h.length}let d=r.replace&&!de(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language||i.usedLng,r),c){const h=t.match(this.interpolator.nestingRegexp),f=h&&h.length;u<f&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var h=arguments.length,f=new Array(h),m=0;m<h;m++)f[m]=arguments[m];return o?.[0]===f[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${n[0]}`),null):a.translate(...f,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=de(s)?[s]:s;return t!=null&&l?.length&&r.applyPostProcessor!==!1&&(t=Yp.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,a,s;return de(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;i=u;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const h=n.count!==void 0&&!de(n.count),f=h&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(de(n.context)||typeof n.context=="number")&&n.context!=="",p=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(v=>{this.isValidLookup(r)||(s=v,!ed[`${p[0]}-${v}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(ed[`${p[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${p.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!!!")),p.forEach(b=>{if(this.isValidLookup(r))return;a=b;const x=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(x,u,b,v,n);else{let A;h&&(A=this.pluralResolver.getSuffix(b,n.count,n));const P=`${this.options.pluralSeparator}zero`,E=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(x.push(u+A),n.ordinal&&A.indexOf(E)===0&&x.push(u+A.replace(E,this.options.pluralSeparator)),f&&x.push(u+P)),m){const k=`${u}${this.options.contextSeparator}${n.context}`;x.push(k),h&&(x.push(k+A),n.ordinal&&A.indexOf(E)===0&&x.push(k+A.replace(E,this.options.pluralSeparator)),f&&x.push(k+P))}}let w;for(;w=x.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(b,v,w,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!de(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class nd{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Gt.create("languageUtils")}getScriptPartFromCode(t){if(t=yo(t),!t||t.indexOf("-")<0)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=yo(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(de(t)&&t.indexOf("-")>-1){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.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),de(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return de(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):de(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const rd={zero:0,one:1,two:2,few:3,many:4,other:5},id={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class sP{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Gt.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=yo(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),id;if(!t.match(/-|_/))return id;const l=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(l,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>rd[i]-rd[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const od=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=ZT(e,t,n);return!o&&i&&de(n)&&(o=ps(e,n,r),o===void 0&&(o=ps(t,n,r))),o},Ea=e=>e.replace(/\$/g,"$$$$");class lP{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Gt.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:a,suffix:s,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:h,nestingPrefixEscaped:f,nestingSuffix:m,nestingSuffixEscaped:p,nestingOptionsSeparator:v,maxReplaces:b,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:tP,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?hr(o):a||"{{",this.suffix=s?hr(s):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=h?hr(h):f||hr("$t("),this.nestingSuffix=m?hr(m):p||hr(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=b||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"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,r,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=f=>{if(f.indexOf(this.formatSeparator)<0){const b=od(n,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...i,...n,interpolationkey:f}):b}const m=f.split(this.formatSeparator),p=m.shift().trim(),v=m.join(this.formatSeparator).trim();return this.format(od(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure),v,r,{...i,...n,interpolationkey:p})};this.resetRegExp();const u=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>Ea(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?Ea(this.escape(f)):Ea(f)}].forEach(f=>{for(s=0;o=f.regex.exec(t);){const m=o[1].trim();if(a=c(m),a===void 0)if(typeof u=="function"){const v=u(t,o,i);a=de(v)?v:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(d){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),a="";else!de(a)&&!this.useRawValueToEscape&&(a=Qu(a));const p=f.safeValue(a);if(t=t.replace(o[0],p),d?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=o[0].length):f.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;const s=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const d=l.split(new RegExp(`${u}[ ]*{`));let h=`{${d[1]}`;l=d[0],h=this.interpolate(h,a);const f=h.match(/'/g),m=h.match(/"/g);((f?.length??0)%2===0&&!m||m.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),c&&(a={...c,...a})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,p),`${l}${u}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&!de(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const u=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=u.shift(),l=u,c=!0}if(o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&!de(o))return o;de(o)||(o=Qu(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),c&&(o=l.reduce((u,d)=>this.format(u,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const cP=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[s,...l]=a.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=s.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:t,formatOptions:n}},pr=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e(yo(r),i),t[a]=s),s(n)}};class uP{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Gt.create("formatter"),this.options=t,this.formats={number:pr((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:pr((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:pr((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:pr((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:pr((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=pr(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(s=>s.indexOf(")")>-1)){const s=o.findIndex(l=>l.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,s)].join(this.formatSeparator)}return o.reduce((s,l)=>{const{formatName:c,formatOptions:u}=cP(l);if(this.formats[c]){let d=s;try{const h=i?.formatParams?.[i.interpolationkey]||{},f=h.locale||h.lng||i.locale||i.lng||r;d=this.formats[c](s,f,{...u,...i,...h})}catch(h){this.logger.warn(h)}return d}else this.logger.warn(`there was no format function for ${c}`);return s},t)}}const dP=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class fP extends qo{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Gt.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=[],this.backend?.init?.(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},l={};return t.forEach(c=>{let u=!0;n.forEach(d=>{const h=`${c}|${d}`;!r.reload&&this.store.hasResourceBundle(c,d)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,u=!1,a[h]===void 0&&(a[h]=!0),o[h]===void 0&&(o[h]=!0),l[d]===void 0&&(l[d]=!0)))}),u||(s[c]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const s={};this.queue.forEach(l=>{JT(l.loaded,[o],a),dP(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const u=l.loaded[c];u.length&&u.forEach(d=>{s[c][d]===void 0&&(s[c][d]=!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(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&u&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>s(null,u)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();de(t)&&(t=this.languageUtils.toResolveHierarchy(t)),de(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" 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(!(r==null||r==="")){if(this.backend?.create){const l={...a,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(t,n,r,i,l):u=c(t,n,r,i),u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}else c(t,n,r,i,s,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const ad=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",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]),de(e[1])&&(t.defaultValue=e[1]),de(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),sd=e=>(de(e.ns)&&(e.ns=[e.ns]),de(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),de(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Hi=()=>{},hP=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class pi extends qo{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=sd(t),this.services={},this.logger=Gt,this.modules={external:[]},hP(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(de(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=ad();this.options={...i,...this.options,...sd(n)},this.options.interpolation={...i.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Gt.init(o(this.modules.logger),this.options):Gt.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=uP;const d=new nd(this.options);this.store=new Zu(this.options.resources,this.options);const h=this.services;h.logger=Gt,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new sP(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(h.formatter=o(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new lP(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new fP(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),v=1;v<m;v++)p[v-1]=arguments[v];t.emit(f,...p)}),this.modules.languageDetector&&(h.languageDetector=o(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=o(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new bo(this.services,this.options),this.translator.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),v=1;v<m;v++)p[v-1]=arguments[v];t.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Hi),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]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const l=Jr(),c=()=>{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),l.resolve(h),r(d,h)};if(this.languages&&!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){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hi;const i=de(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(c=>{c!=="cimode"&&o.indexOf(c)<0&&o.push(c)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const i=Jr();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Hi),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}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"&&Yp.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"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=Jr();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,c)=>{c?(o(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=de(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,u=>{a(u,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,n,r){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),d=2;d<c;d++)u[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([a,s].concat(u))}else l={...s};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||o.keyPrefix);const h=i.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(a)?f=a.map(m=>`${l.keyPrefix}${h}${m}`):f=l.keyPrefix?`${l.keyPrefix}${h}${a}`:a,i.t(f,l)};return de(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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 r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=Jr();return this.options.ns?(de(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Jr();de(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";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"],r=this.services?.languageUtils||new nd(ad());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new pi(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hi;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new pi(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const s=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},Object.keys(l[c]).reduce((u,d)=>(u[d]={...l[c][d]},u),{})),{});o.store=new Zu(s,i),o.services.resourceStore=o.store}return o.translator=new bo(o.services,i),o.translator.on("*",function(s){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];o.emit(s,...c)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const et=pi.createInstance();et.createInstance=pi.createInstance;et.createInstance;et.dir;et.init;et.loadResources;et.reloadResources;et.use;et.changeLanguage;et.getFixedT;et.t;et.exists;et.setDefaultNamespace;et.hasLoadedNamespace;et.loadNamespaces;et.loadLanguages;function pP(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=mP(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
203
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function mP(e,t){if(e){if(typeof e=="string")return ld(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ld(e,t):void 0}}function ld(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ms(e){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ms(e)}var Xp=["__proto__","constructor","prototype"];function Jp(e){return!(typeof e!="string"||e.length===0||e.length>128||Xp.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function Zp(e){return!(!Jp(e)||e.indexOf("/")>-1)}function gP(e){return Jp(e)}var yP={lng:Zp,ns:gP};function Bi(e){return typeof e!="string"?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function vP(e){if(typeof e!="string"||e.length===0)return e;try{var t=new URL(e);return t.username||t.password?(t.username="",t.password="",t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function em(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":ms(XMLHttpRequest))==="object"}function bP(e){return!!e&&typeof e.then=="function"}function xP(e){return bP(e)?e:Promise.resolve(e)}var wP=/\{\{(.+?)\}\}/g;function cd(e,t){var n=!1,r=e.replace(wP,function(i,o){var a=o.trim();if(Xp.indexOf(a)>-1)return i;var s=t[a];if(s==null)return i;var l=yP[a]||Zp,c=String(s).split("+"),u=pP(c),d;try{for(u.s();!(d=u.n()).done;){var h=d.value;if(!l(h))return n=!0,i}}catch(f){u.e(f)}finally{u.f()}return c.join("+")});return n?null:r}function ud(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ud(Object(n),!0).forEach(function(r){kP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ud(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kP(e,t,n){return(t=SP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SP(e){var t=CP(e,"string");return er(t)=="symbol"?t:t+""}function CP(e,t){if(er(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(er(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function er(e){"@babel/helpers - typeof";return er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},er(e)}var Cn=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?Cn=global.fetch:typeof window<"u"&&window.fetch&&(Cn=window.fetch);var mi;em()&&(typeof global<"u"&&global.XMLHttpRequest?mi=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(mi=window.XMLHttpRequest));var xo;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?xo=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(xo=window.ActiveXObject));typeof Cn!="function"&&(Cn=void 0);if(!Cn&&!mi&&!xo)try{fe(()=>import("./browser-ponyfill-DBWdeCTC.js").then(e=>e.b),__vite__mapDeps([85,1])).then(function(e){Cn=e.default}).catch(function(){})}catch{}var tm=["__proto__","constructor","prototype"],gs=function(t,n){if(n&&er(n)==="object"){for(var r="",i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];tm.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},fd=function(t,n,r,i){var o=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(c){r(null,{status:l.status,data:c})}).catch(r)};if(i){var a=i(t,n);if(a instanceof Promise){a.then(o).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(o).catch(r):Cn(t,n).then(o).catch(r)},EP=function(t,n,r,i){t.queryStringParams&&(n=gs(n,t.queryStringParams));var o=dd({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=dd({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},t._omitFetchOptions?{}:a),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{fd(n,s,i,l)}catch(c){if(!a||Object.keys(a).length===0||!c.message||c.message.indexOf("not implemented")<0)return i(c);try{Object.keys(a).forEach(function(u){delete s[u]}),fd(n,s,i,l),t._omitFetchOptions=!0}catch(u){i(u)}}},AP=function(t,n,r,i){r&&er(r)==="object"&&(r=gs("",r).slice(1)),t.queryStringParams&&(n=gs(n,t.queryStringParams));try{var o=mi?new mi:new xo("MSXML2.XMLHTTP.3.0");o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s=0,l=Object.keys(a);s<l.length;s++){var c=l[s];tm.indexOf(c)>-1||o.setRequestHeader(c,a[c])}o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(u){console&&console.log(u)}},RP=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Cn&&n.indexOf("file:")!==0)return EP(t,n,r,i);if(em()||typeof ActiveXObject=="function")return AP(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function Rr(e){"@babel/helpers - typeof";return Rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(e)}function hd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Aa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hd(Object(n),!0).forEach(function(r){nm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hd(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rm(r.key),r)}}function IP(e,t,n){return t&&PP(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function nm(e,t,n){return(t=rm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rm(e){var t=LP(e,"string");return Rr(t)=="symbol"?t:t+""}function LP(e,t){if(Rr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var OP=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return nm({},r,i||"")},parseLoadPayload:function(n,r){},request:RP,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},im=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};TP(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return IP(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=Aa(Aa(Aa({},OP()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);Rr(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=xP(l),l.then(function(c){if(!c)return a(null,{});var u=cd(c,{lng:n.join("+"),ns:i.join("+")});if(u==null){var d=n.map(Bi).join(", "),h=i.map(Bi).join(", ");return a(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+d+"] namespaces=["+h+"]"),!1)}s.loadUrl(u,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this,s=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,c=this.options.parseLoadPayload(s,l),u=Bi(vP(n));this.options.request(this.options,n,c,function(d,h){if(h&&(h.status>=500&&h.status<600||!h.status))return r("failed loading "+u+"; status code: "+h.status,!0);if(h&&h.status>=400&&h.status<500)return r("failed loading "+u+"; status code: "+h.status,!1);if(!h&&d&&d.message){var f=d.message.toLowerCase(),m=["failed","fetch","network","load"].find(function(b){return f.indexOf(b)>-1});if(m)return r("failed loading "+u+": "+Bi(d.message),!0)}if(d)return r(d,!1);var p,v;try{typeof h.data=="string"?p=a.options.parse(h.data,i,o):p=h.data}catch{v="failed parsing "+u+" to json"}if(v)return r(v,!1);r(null,p)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),c=0,u=[],d=[];n.forEach(function(h){var f=s.options.addPath;typeof s.options.addPath=="function"&&(f=s.options.addPath(h,r));var m=cd(f,{lng:h,ns:r});if(m==null){c+=1,a&&c===n.length&&a(u,d);return}s.options.request(s.options,m,l,function(p,v){c+=1,u.push(p),d.push(v),c===n.length&&typeof a=="function"&&a(u,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],c=function(d){var h=o.toResolveHierarchy(d);h.forEach(function(f){l.indexOf(f)<0&&l.push(f)})};c(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(d){i.read(u,d,"read",null,null,function(h,f){h&&a.warn("loading namespace ".concat(d," for language ").concat(u," failed"),h),!h&&f&&a.log("loaded namespace ".concat(d," for language ").concat(u),f),i.loaded("".concat(u,"|").concat(d),h,f)})})})}}}])}();im.type="backend";const NP="Agim",_P={refresh:"Refresh",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",submit:"Submit",close:"Close",back:"Back",next:"Next",previous:"Previous",create:"Create",search:"Search",retry:"Retry",confirm:"Confirm"},DP={loading:"Loading…",empty:"No data",saving:"Saving…",saved:"Saved",error:"Something went wrong"},MP={label:"Theme",system:"System",light:"Light",dark:"Dark",cycleHint:"Click to cycle theme"},jP={label:"Language",en:"English",zh:"中文"},FP={chat:"Chat",tasks:"Tasks",approvals:"Approvals",reminders:"Reminders",memos:"Memos",memory:"Memory",skills:"Skills",workspace:"Workspace",observability:"Observability",settings:"Settings"},UP={deleteTitle:"Delete this item?",deleteDescription:"This cannot be undone.",destructiveAction:"Delete"},HP={label:"Pagination",perPage:"Per page",firstPage:"First page",lastPage:"Last page",pageOfTotal:"Page {{page}} of {{totalPages}}",range:"{{from}}–{{to}} of {{total}}"},BP={selectAll:"Select all rows",selectRow:"Select row"},zP={intro:"Paste your access token from `agim token bootstrap` (first boot) or `agim token create`.",tokenLabel:"Access token",submit:"Sign in",hint:"Loopback (127.0.0.1) requests bypass this page; you only land here from another host or with IMHUB_TRUST_LOOPBACK=off."},$P={placeholder:"Signed in. The chat surface ships in PR-6; this route is intentionally blank for now.",healthCheck:"Backend reachable"},VP={title:"Nothing here.",description:"The page you're looking for doesn't exist."},KP={title:"Something went wrong.",description:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it.",reload:"Reload",home:"Home"},WP={mobileTitle:"agim chat",menu:"Menu",back:"Back",logout:"Log out",agent:"Agent",scrollDown:"Scroll to bottom",send:"Send",streaming:"… streaming",running:"Running",notConnected:"Not connected. Reconnecting…",connecting:"Connecting to agim…",disconnected:"Disconnected. Reconnecting automatically; you can keep typing.",welcomeTitle:"Start a conversation",welcomeBody:"Type a message to ask the active agent. Use the agent dropdown to switch.",welcomeBodyMobile:"Type a message below. Switch agent or start over from the menu.",inputPlaceholder:"Message… (Enter sends, Shift+Enter newlines)",inputPlaceholderMobile:"Message…",mobileHint:"Enter creates new lines, tap Send to submit.",activity:"Activity",activityTitle:"Run activity",activityEmpty:"No recent runs yet.",llmSettings:"LLM settings",nativeSetupRequired:"Native agent is not configured. Open /settings/llm to add a usable LLM API backend (role bindings are optional).",nativeSetupAction:"Configure now",nativeSetupDialogTitle:"Configure LLM for Native agent",nativeSetupDialogDesc:"Native works as soon as one backend with a valid API key is configured. Role Bindings are optional advanced wiring.",nativeSetupDialogReason:"Most recent error",nativeSetupDialogRoleOptional:"Role Bindings are optional and do not block native usage.",nativeSetupDialogSave:"Save and enable native",nativeSetupDialogCancel:"Later",nativeSetupDialogAdvanced:"Open full LLM settings",nativeSetupApiKeyRequired:"API key is required",nativeSetupSaved:"LLM backend saved. Retrying native switch…",pendingApprovals:"Pending approvals",quickPrompt:{plan:"Draft a plan first",risks:"List risks and rollback steps",summary:"Write an executive summary"},newConv:"New",newConvHint:"Clear messages and start a fresh session",newConvToast:"Started a new conversation",approvalTitle:"🔐 Tool approval",approvalAutoBadge:"auto-allow",approvalAutoIn:"Auto-allowing in {{count}}s — Deny to stop.",approvalAutoResolving:"Auto-allowing now…",approvalToolLabel:"Tool",approvalInputLabel:"Input",approvalAllow:"Allow",approvalAuto:"Auto for similar",approvalAutoTip:"Allow and auto-allow similar calls for the rest of the session",approvalDeny:"Deny",outcome:{allowed:"✅ Allowed",allowedPinned:"✅ Allowed + auto-allow further",denied:"❌ Denied",deniedRevoked:"❌ Denied (auto-allow revoked)",expired:"⏱ Timed out"}},qP={appName:NP,actions:_P,states:DP,theme:MP,lang:jP,nav:FP,confirm:UP,pagination:HP,table:BP,login:zP,home:$P,notFound:VP,errorBoundary:KP,chat:WP},GP="Agim",QP={refresh:"刷新",save:"保存",cancel:"取消",delete:"删除",edit:"编辑",submit:"提交",close:"关闭",back:"返回",next:"下一页",previous:"上一页",create:"新建",search:"搜索",retry:"重试",confirm:"确定"},YP={loading:"加载中…",empty:"暂无数据",saving:"保存中…",saved:"已保存",error:"出错了"},XP={label:"主题",system:"跟随系统",light:"浅色",dark:"深色",cycleHint:"点击切换主题"},JP={label:"语言",en:"English",zh:"中文"},ZP={chat:"对话",tasks:"任务",approvals:"审批",reminders:"提醒",memos:"备忘",memory:"记忆",skills:"技能",workspace:"工作区",observability:"观测",settings:"设置"},eI={deleteTitle:"确认删除?",deleteDescription:"操作不可撤销。",destructiveAction:"删除"},tI={label:"分页",perPage:"每页",firstPage:"首页",lastPage:"末页",pageOfTotal:"第 {{page}} / {{totalPages}} 页",range:"{{from}}–{{to}} / 共 {{total}}"},nI={selectAll:"全选",selectRow:"选中此行"},rI={intro:"粘贴访问令牌:首次部署可运行 `agim token bootstrap`,后续可用 `agim token create` 生成。",tokenLabel:"访问令牌",submit:"登录",hint:"loopback(127.0.0.1)的请求会跳过此页;只有跨机访问或设置了 IMHUB_TRUST_LOOPBACK=off 时才会看到此页。"},iI={placeholder:"已登录。聊天界面将在 PR-6 落地;当前页暂为占位。",healthCheck:"后端可达"},oI={title:"什么也没找到。",description:"你要找的页面不存在。"},aI={title:"出错了。",description:"页面渲染过程中遇到了未预期的错误。可以尝试刷新或返回主页;若问题反复出现,请复制下方错误信息反馈。",reload:"刷新",home:"返回主页"},sI={mobileTitle:"agim 对话",menu:"菜单",back:"返回",logout:"退出登录",agent:"Agent",scrollDown:"回到底部",send:"发送",streaming:"… 接收中",running:"处理中",notConnected:"未连接,正在重连…",connecting:"正在连接 agim…",disconnected:"已断开,自动重连中;可以继续输入。",welcomeTitle:"开始对话",welcomeBody:"输入消息向当前 Agent 提问。点上方下拉可切换 Agent。",welcomeBodyMobile:"在下方输入消息,或从菜单切换 Agent、开启新对话。",inputPlaceholder:"输入消息……(Enter 发送,Shift+Enter 换行)",inputPlaceholderMobile:"输入消息…",mobileHint:"Enter 换行,点击发送提交。",activity:"运行动态",activityTitle:"运行动态",activityEmpty:"暂无运行记录。",llmSettings:"LLM 配置",nativeSetupRequired:"Native agent 未配置。请先在 /settings/llm 配置一个可用模型 API(角色绑定可选)。",nativeSetupAction:"去配置",nativeSetupDialogTitle:"配置 Native Agent 所需 LLM",nativeSetupDialogDesc:"只要配置一个可用的 LLM backend(含 API Key),native 就可以使用。Role Bindings 属于可选高级配置。",nativeSetupDialogReason:"最近一次错误信息",nativeSetupDialogRoleOptional:"Role Bindings 是可选增强项,不配置也不会阻塞 native。",nativeSetupDialogSave:"保存并启用 native",nativeSetupDialogCancel:"稍后再配",nativeSetupDialogAdvanced:"打开完整 LLM 设置页",nativeSetupApiKeyRequired:"请填写 API Key",nativeSetupSaved:"LLM 配置已保存,正在重试切换 native…",pendingApprovals:"待审批数",quickPrompt:{plan:"先帮我拆解这个任务",risks:"列出风险与回滚方案",summary:"给我一版汇报摘要"},newConv:"新对话",newConvHint:"清空消息并开启新会话",newConvToast:"已开启新对话",approvalTitle:"🔐 工具授权",approvalAutoBadge:"自动放行",approvalAutoIn:"{{count}} 秒后自动放行 — 点「拒绝」可中止。",approvalAutoResolving:"正在自动放行…",approvalToolLabel:"工具",approvalInputLabel:"输入",approvalAllow:"批准",approvalAuto:"本类自动放行",approvalAutoTip:"批准并对本会话内同类调用自动放行",approvalDeny:"拒绝",outcome:{allowed:"✅ 已批准",allowedPinned:"✅ 已批准 · 后续同类自动放行",denied:"❌ 已拒绝",deniedRevoked:"❌ 已拒绝(撤销自动放行)",expired:"⏱ 已超时"}},lI={appName:GP,actions:QP,states:YP,theme:XP,lang:JP,nav:ZP,confirm:eI,pagination:tI,table:nI,login:rI,home:iI,notFound:oI,errorBoundary:aI,chat:sI},cI="Couldn't reach the server. Check your connection and retry.",uI="Your session expired. Please sign in again.",dI="Sign-in required.",fI="Auth token missing from request.",hI="Auth subsystem isn't ready yet. Retry in a moment.",pI="You don't have permission to do that.",mI="The requested resource wasn't found.",gI="That request is too big — try splitting it.",yI="The server rejected the request: {{detail}}",vI="Request body wasn't valid JSON.",bI="Configuration didn't validate. Check the form fields.",xI="Couldn't save configuration: {{detail}}",wI="Send an `updates` object to change env values.",kI="None of the keys you sent are editable.",SI="SMTP isn't configured. Save host / user / password first.",CI="SMTP verify failed: {{detail}}",EI="Provide a baseUrl to discover ACP agents.",AI="Provide an `endpoint` to test the agent.",RI="ACP discovery failed: {{detail}}",TI="ACP agent test failed: {{detail}}",PI="A user_key (platform:userId) is required.",II="Something went wrong (code {{code}}).",LI="Bad request.",OI="Sign-in required.",NI="Forbidden.",_I="Not found.",DI="Conflict — refresh and try again.",MI="Request too large.",jI="Server error.",FI="Gateway error.",UI="Service unavailable.",HI="Gateway timeout.",BI={NETWORK:cI,AUTH_INVALID:uI,AUTH_REQUIRED:dI,AUTH_TOKEN_REQUIRED:fI,AUTH_NOT_READY:hI,FORBIDDEN:pI,NOT_FOUND:mI,PAYLOAD_TOO_LARGE:gI,VALIDATION:yI,INVALID_JSON_BODY:vI,CONFIG_INVALID:bI,CONFIG_SAVE_FAILED:xI,ENV_UPDATES_REQUIRED:wI,ENV_NO_EDITABLE_KEYS:kI,EMAIL_NOT_CONFIGURED:SI,EMAIL_VERIFY_FAILED:CI,ACP_BASEURL_REQUIRED:EI,ACP_ENDPOINT_REQUIRED:AI,ACP_DISCOVER_FAILED:RI,ACP_TEST_FAILED:TI,MEMORY_USER_KEY_REQUIRED:PI,UNKNOWN:II,HTTP_400:LI,HTTP_401:OI,HTTP_403:NI,HTTP_404:_I,HTTP_409:DI,HTTP_413:MI,HTTP_500:jI,HTTP_502:FI,HTTP_503:UI,HTTP_504:HI},zI="无法访问服务器,请检查网络后重试。",$I="登录状态已过期,请重新登录。",VI="请先登录。",KI="请求缺少 auth token。",WI="鉴权子系统尚未就绪,请稍后重试。",qI="没有执行该操作的权限。",GI="请求的资源不存在。",QI="请求体过大,请拆分后重试。",YI="服务端拒绝了请求:{{detail}}",XI="请求体不是合法的 JSON。",JI="配置校验失败,请检查表单字段。",ZI="保存配置失败:{{detail}}",eL="请在请求体中提供 `updates` 对象以修改 env。",tL="请求里的 key 均不可编辑。",nL="SMTP 未配置,请先保存 host / user / password。",rL="SMTP 连接测试失败:{{detail}}",iL="需要 baseUrl 才能发现 ACP Agent。",oL="需要 `endpoint` 才能测试该 Agent。",aL="ACP 发现失败:{{detail}}",sL="ACP Agent 测试失败:{{detail}}",lL="需要 user_key(形如 `platform:userId`)。",cL="出错了 (code {{code}})。",uL="请求格式不正确。",dL="请先登录。",fL="没有权限。",hL="未找到。",pL="状态冲突,请刷新后重试。",mL="请求体过大。",gL="服务端出错。",yL="网关错误。",vL="服务暂不可用。",bL="网关超时。",xL={NETWORK:zI,AUTH_INVALID:$I,AUTH_REQUIRED:VI,AUTH_TOKEN_REQUIRED:KI,AUTH_NOT_READY:WI,FORBIDDEN:qI,NOT_FOUND:GI,PAYLOAD_TOO_LARGE:QI,VALIDATION:YI,INVALID_JSON_BODY:XI,CONFIG_INVALID:JI,CONFIG_SAVE_FAILED:ZI,ENV_UPDATES_REQUIRED:eL,ENV_NO_EDITABLE_KEYS:tL,EMAIL_NOT_CONFIGURED:nL,EMAIL_VERIFY_FAILED:rL,ACP_BASEURL_REQUIRED:iL,ACP_ENDPOINT_REQUIRED:oL,ACP_DISCOVER_FAILED:aL,ACP_TEST_FAILED:sL,MEMORY_USER_KEY_REQUIRED:lL,UNKNOWN:cL,HTTP_400:uL,HTTP_401:dL,HTTP_403:fL,HTTP_404:hL,HTTP_409:pL,HTTP_413:mL,HTTP_500:gL,HTTP_502:yL,HTTP_503:vL,HTTP_504:bL},wL="Tasks",kL={jobs:"Jobs",subtasks:"Subtasks",bgjobs:"Background",schedules:"Schedules",outbox:"Outbox",a2a:"Agent ↔ Agent",heartbeat:"Heartbeat",goals:"Goals",asks:"Ask User",plans:"Plans"},SL={title:"Jobs",subtitle:"Long-running agent invocations and their results.",empty:{title:"No jobs yet",description:"Jobs are created when an agent runs in async mode — via `agim --invoke` or an inline /run command from chat."},filter:{status:"Status",statusAny:"Any status",agent:"Agent",agentAny:"Any agent",kind:"Kind",kindAny:"Any kind"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",createdAt:"Created",duration:"Duration",cost:"Cost"},status:{pending:"Pending",running:"Running",completed:"Completed",delivered:"Delivered",failed:"Failed",cancelled:"Cancelled",interrupted:"Interrupted",replaced:"Replaced",abandoned:"Abandoned"},kind:{job:"Job",inline:"Inline"},stats:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed"},batch:{selected:"{{count}} selected",cancel:"Cancel selected",rerun:"Re-run selected",confirmCancel:"Cancel {{count}} job(s)?",confirmCancelDesc:"Running jobs will be sent a stop signal. Already-completed jobs are unaffected.",confirmRerun:"Re-run {{count}} job(s)?",confirmRerunDesc:"New jobs will be created from the original prompts."},live:{connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"}},CL={title:"Subtasks",subtitle:"Per-conversation child tasks spawned by the parent agent.",empty:{title:"No subtasks yet",description:"Subtasks appear when an agent dispatches work to another agent inside a chat thread."},filter:{agent:"Parent agent",agentAny:"Any agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",parent:"Parent",platform:"Platform",createdAt:"Created"},status:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"}},EL={title:"Background jobs",subtitle:"Long-running scripts the agent wrappers (Claude Code / opencode / codex) launched via bgjob.",empty:{title:"No background jobs",description:"Background jobs show up here once an agent has used its bgjob wrapper. Roots come from ~/.claude/bgjobs/, ~/.config/opencode/bgjobs/, ~/.codex/bgjobs/ (override via IMHUB_BGJOB_ROOTS)."},filter:{root:"Root",rootAny:"All roots"},col:{name:"Name",status:"Status",root:"Root",pid:"PID",startedAt:"Started",endedAt:"Ended",exit:"Exit"},exitOk:"ok",stillRunning:"—"},AL={title:"Schedules",subtitle:"Cron-style triggers that re-invoke an agent with a fixed prompt.",empty:{title:"No schedules configured",description:"Create a schedule from the agent's chat via `/cron set` or by running `agim cron create` in the CLI."},filter:{agent:"Agent",agentAny:"Any agent"},col:{id:"ID",name:"Name",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"Enabled",nextRun:"Next run",lastRun:"Last run"},enabled:"On",disabled:"Off"},RL={title:"Outbox",subtitle:"Pending IM-platform deliveries. The crash-safe queue retries on transient failures and parks unrecoverable ones in `giving_up`.",empty:{title:"Outbox is empty",description:"Messages move through the queue and are deleted on successful delivery. A non-empty outbox here means the queue is actively flushing or a delivery is stuck."},filter:{status:"Status",statusAny:"Any status",thread:"Thread key"},stats:{pending:"Pending",giving_up:"Giving up",delivered:"Delivered (lifetime)",lastDelivered:"Last delivery"},col:{id:"ID",status:"Status",platform:"Platform",preview:"Preview",thread:"Thread",kind:"Kind",attempts:"Attempts",createdAt:"Created",lastError:"Last error",jobId:"Job"},status:{pending:"Pending",delivered:"Delivered",giving_up:"Giving up"},action:{retry:"Retry",confirmRetry:"Re-queue this delivery?",confirmRetryDesc:"The row's status flips back to pending and the sender will attempt delivery again on the next tick."}},TL={title:"Agent ↔ Agent",subtitle:"Recent inline jobs spawned with a parent (one agent invoking another).",empty:{title:"No agent-to-agent calls yet",description:"Inline a2a calls appear here once an agent uses the `agim --invoke` tool with a parent context."},stats:{total:"Total",recent24h:"Last 24h",maxDepth:"Max depth"},col:{id:"ID",agent:"Agent",parent:"Parent",depth:"Depth",status:"Status",prompt:"Prompt",createdAt:"Created"}},PL={title:"Heartbeat bindings",subtitle:"Cross-thread view of every /heartbeat bind. Enable/disable a binding from here; create new ones from inside the IM thread itself (/heartbeat bind <body>).",refresh:"Refresh",empty:"No heartbeat bindings yet. Run /heartbeat bind <body> in any IM thread to create one.",col:{thread:"Thread",owner:"Owner",interval:"Interval",lastTick:"Last tick",enabled:"Enabled",body:"Body"},never:"never",pause:"Pause",enable:"Enable",show:"Show",hide:"Hide",enabledToast:"enabled binding",disabledToast:"disabled binding",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",intervalMin:"{{count}}m"},IL={title:"Active goals",subtitle:"Cross-thread view of every active /goal. Lifecycle controls (pause / complete / cancel) operate without the IM thread; creating a new goal still requires the thread context — /goal set <title>.",refresh:"Refresh",empty:"No active goals. Create one inside any IM thread with /goal set <title>.",col:{id:"#",thread:"Thread",title:"Title",progress:"Progress",updated:"Updated",actions:"Actions"},showBody:"Show body",hideBody:"Hide body",pause:"Pause",complete:"Complete",cancel:"Cancel",body:"Body",recentProgress:"Recent progress (latest {{count}})",created:"created {{at}}",closed:"closed {{at}}",statusUpdated:"Goal {{status}}"},LL={title:"Pending ask_user",subtitle:"Live list of every mcp__imhub__ask_user waiting on a reply. Cancelling here gives the agent the same response shape as a natural timeout (ok: false, reason: 'cancelled').",refresh:"Refresh",empty:"No pending asks. Auto-refreshes every 5s.",col:{reqId:"Req ID",thread:"Thread",question:"Question",choices:"Choices",age:"Age",actions:""},cancel:"Cancel",cancelConfirm:"Cancel pending ask {{id}}…?",cancelledToast:"Cancelled",justNow:"just now",seconds:"{{count}}s",minutes:"{{count}}m",hours:"{{count}}h"},OL={pageTitle:wL,subnav:kL,jobs:SL,subtasks:CL,bgjobs:EL,schedules:AL,outbox:RL,a2a:TL,heartbeat:PL,goals:IL,asks:LL},NL="任务",_L={jobs:"作业",subtasks:"子任务",bgjobs:"后台脚本",schedules:"定时任务",outbox:"投递队列",a2a:"Agent 互调",heartbeat:"心跳",goals:"目标",asks:"待回答",plans:"Plan 审计"},DL={title:"作业",subtitle:"Agent 的长任务调用与结果。",empty:{title:"暂无作业",description:"通过 `agim --invoke` 或聊天里的 /run 命令异步启动 Agent 时会自动生成作业记录。"},filter:{status:"状态",statusAny:"全部状态",agent:"Agent",agentAny:"全部 Agent",kind:"类型",kindAny:"全部类型"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"状态",createdAt:"创建时间",duration:"耗时",cost:"成本"},status:{pending:"等待中",running:"运行中",completed:"已完成",delivered:"已送达",failed:"失败",cancelled:"已取消",interrupted:"已中断",replaced:"已替换",abandoned:"已放弃"},kind:{job:"作业",inline:"即时"},stats:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败"},batch:{selected:"已选 {{count}} 项",cancel:"取消所选",rerun:"重跑所选",confirmCancel:"确认取消 {{count}} 个作业?",confirmCancelDesc:"运行中的作业会收到停止信号。已完成的作业不受影响。",confirmRerun:"确认重跑 {{count}} 个作业?",confirmRerunDesc:"将根据原 Prompt 重新创建作业。"},live:{connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"}},ML={title:"子任务",subtitle:"由父 Agent 在对话内派发出的子任务列表。",empty:{title:"暂无子任务",description:"当 Agent 在聊天线程内向其他 Agent 委派工作时,子任务会出现在这里。"},filter:{agent:"父 Agent",agentAny:"全部 Agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"状态",parent:"父级",platform:"平台",createdAt:"创建时间"},status:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败",cancelled:"已取消"}},jL={title:"后台脚本",subtitle:"Agent 封装(Claude Code / opencode / codex)通过 bgjob 启动的长任务进程。",empty:{title:"暂无后台脚本",description:"当 Agent 使用其 bgjob 封装时,记录会在这里出现。Root 路径默认取 ~/.claude/bgjobs/、~/.config/opencode/bgjobs/、~/.codex/bgjobs/(可通过 IMHUB_BGJOB_ROOTS 覆盖)。"},filter:{root:"Root",rootAny:"全部 Root"},col:{name:"名称",status:"状态",root:"Root",pid:"PID",startedAt:"开始时间",endedAt:"结束时间",exit:"退出码"},exitOk:"ok",stillRunning:"—"},FL={title:"定时任务",subtitle:"Cron 触发的 Agent 调用 — 按固定 Prompt 重新执行。",empty:{title:"暂无定时任务",description:"可在聊天中通过 `/cron set` 或 CLI `agim cron create` 创建定时任务。"},filter:{agent:"Agent",agentAny:"全部 Agent"},col:{id:"ID",name:"名称",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"启用",nextRun:"下次运行",lastRun:"上次运行"},enabled:"开",disabled:"关"},UL={title:"投递队列",subtitle:"面向 IM 平台的待投递消息队列。瞬态失败会自动重试;不可恢复的会停在 giving_up。",empty:{title:"投递队列为空",description:"消息成功投递后会被删除。如果这里非空,说明队列正在刷出消息,或某条消息卡住了。"},filter:{status:"状态",statusAny:"全部状态",thread:"Thread 标识"},stats:{pending:"待发送",giving_up:"放弃中",delivered:"已投递(累计)",lastDelivered:"最近投递"},col:{id:"ID",status:"状态",platform:"平台",preview:"内容",thread:"Thread",kind:"类型",attempts:"尝试次数",createdAt:"创建时间",lastError:"最后错误",jobId:"Job"},status:{pending:"待发送",delivered:"已投递",giving_up:"放弃中"},action:{retry:"重试",confirmRetry:"重新入队这条投递?",confirmRetryDesc:"状态会切回 pending,发送器会在下一轮 tick 再次尝试投递。"}},HL={title:"Agent 互调",subtitle:"带父级 ID 的最近 inline 作业(一个 Agent 调用另一个 Agent 的记录)。",empty:{title:"暂无 Agent 互调记录",description:"当某 Agent 使用 `agim --invoke` 工具并带上父级上下文时,这里会出现 inline a2a 调用记录。"},stats:{total:"累计",recent24h:"近 24 小时",maxDepth:"最大深度"},col:{id:"ID",agent:"Agent",parent:"父级",depth:"深度",status:"状态",prompt:"Prompt",createdAt:"创建时间"}},BL={title:"心跳绑定",subtitle:"跨线程查看所有 /heartbeat bind。可在此启用/停用绑定;新建绑定需在 IM 线程内执行 /heartbeat bind <body>。",refresh:"刷新",empty:"尚无心跳绑定。在任意 IM 线程执行 /heartbeat bind <body> 即可创建。",col:{thread:"线程",owner:"所有者",interval:"间隔",lastTick:"上次 tick",enabled:"启用",body:"正文"},never:"从未",pause:"暂停",enable:"启用",show:"展开",hide:"收起",enabledToast:"已启用绑定",disabledToast:"已停用绑定",justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前",intervalMin:"{{count}} 分钟"},zL={title:"活跃目标",subtitle:"跨线程查看所有活跃 /goal。生命周期操作(暂停/完成/取消)无需 IM 线程;新建目标仍需在线程内执行 /goal set <title>。",refresh:"刷新",empty:"暂无活跃目标。在任意 IM 线程执行 /goal set <title> 创建。",col:{id:"#",thread:"线程",title:"标题",progress:"进度",updated:"更新",actions:"操作"},showBody:"展开正文",hideBody:"收起正文",pause:"暂停",complete:"完成",cancel:"取消",body:"正文",recentProgress:"最近进度(最新 {{count}} 条)",created:"创建于 {{at}}",closed:"关闭于 {{at}}",statusUpdated:"目标已{{status}}"},$L={title:"待回答 ask_user",subtitle:"所有等待回复的 mcp__imhub__ask_user 实时列表。在此取消与超时相同(ok: false, reason: 'cancelled')。",refresh:"刷新",empty:"暂无待回答。每 5 秒自动刷新。",col:{reqId:"请求 ID",thread:"线程",question:"问题",choices:"选项数",age:"等待时长",actions:""},cancel:"取消",cancelConfirm:"取消待回答 {{id}}…?",cancelledToast:"已取消",justNow:"刚刚",seconds:"{{count}} 秒",minutes:"{{count}} 分",hours:"{{count}} 小时"},VL={pageTitle:NL,subnav:_L,jobs:DL,subtasks:ML,bgjobs:jL,schedules:FL,outbox:UL,a2a:HL,heartbeat:BL,goals:zL,asks:$L},KL="Approvals",WL="Pending tool invocations the agent is asking permission for.",qL={connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"},GL={pending:"Pending",totalAllowed:"Total allowed",totalDenied:"Total denied",totalTimedOut:"Timed out",totalReadonly:"Read-only auto-allowed"},QL={title:"No approvals waiting",description:"The queue is empty. Tool requests show up here when an agent calls a tool that's not on its allow-list yet."},YL="Thread",XL="auto-allow",JL="Backend auto-allowed this read-only tool; the card is shown for visibility only.",ZL="Allow",eO="Deny",tO={allowedShort:"Allowed",deniedShort:"Denied"},nO={pageTitle:KL,subtitle:WL,live:qL,stats:GL,empty:QL,threadLabel:YL,autoAllowedTag:XL,autoAllowedTitle:JL,allow:ZL,deny:eO,toast:tO},rO="审批",iO="Agent 等待批准的工具调用。",oO={connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"},aO={pending:"待审批",totalAllowed:"累计放行",totalDenied:"累计拒绝",totalTimedOut:"超时",totalReadonly:"只读自动放行"},sO={title:"暂无待审批请求",description:"队列为空。当 Agent 调用尚未加入白名单的工具时,请求会在这里出现。"},lO="Thread",cO="自动放行",uO="后端已对该只读工具自动放行;此处仅供可见性展示。",dO="放行",fO="拒绝",hO={allowedShort:"已放行",deniedShort:"已拒绝"},pO={pageTitle:rO,subtitle:iO,live:oO,stats:aO,empty:sO,threadLabel:lO,autoAllowedTag:cO,autoAllowedTitle:uO,allow:dO,deny:fO,toast:hO},mO="Reminders",gO="Queued reminders waiting to fire. Cancel or snooze pending ones; fired and cancelled rows are kept for audit.",yO={status:"Status",statusAny:"Any status"},vO={pending:"Pending",firing:"Firing",fired:"Fired",cancelled:"Cancelled",failed:"Failed"},bO={slash:"/remind",mcp:"MCP",api:"API"},xO={literal:"Literal",llm:"LLM"},wO={title:"Nothing scheduled",description:"Reminders show up here once an agent (via /remind, MCP, or API) queues one. Filter by status to see fired or cancelled ones."},kO={id:"ID",fireAt:"Fires",text:"Text",status:"Status",platform:"Platform",thread:"Thread",source:"Source",recurrence:"Recurrence",createdAt:"Created"},SO={cancel:"Cancel",snooze:"Snooze",confirmCancel:"Cancel this reminder?",confirmCancelDesc:"The reminder is removed from the queue. Recurring reminders won't fire again unless re-created."},CO={title:"Snooze reminder",description:"How long should it be pushed back?",preset5m:"5 minutes",preset30m:"30 minutes",preset1h:"1 hour",preset1d:"1 day",submit:"Snooze",toastOk:"Snoozed for {{duration}}"},EO={cancelled:"Reminder cancelled"},AO={pageTitle:mO,subtitle:gO,filter:yO,status:vO,source:bO,promptMode:xO,empty:wO,col:kO,action:SO,snooze:CO,toast:EO},RO="提醒",TO="排队待触发的提醒。可对 pending 的提醒做取消 / 延后;已触发与已取消的记录保留以备审计。",PO={status:"状态",statusAny:"全部状态"},IO={pending:"等待中",firing:"触发中",fired:"已触发",cancelled:"已取消",failed:"失败"},LO={slash:"/remind",mcp:"MCP",api:"API"},OO={literal:"原文",llm:"LLM"},NO={title:"暂无提醒",description:"当 Agent 通过 /remind、MCP 或 API 创建提醒时,记录会出现在这里。可切换状态查看已触发或已取消的记录。"},_O={id:"ID",fireAt:"触发时间",text:"内容",status:"状态",platform:"平台",thread:"Thread",source:"来源",recurrence:"周期",createdAt:"创建时间"},DO={cancel:"取消",snooze:"延后",confirmCancel:"确认取消这条提醒?",confirmCancelDesc:"该提醒会被移出队列。周期提醒在未重新创建前不会再触发。"},MO={title:"延后提醒",description:"延后多久?",preset5m:"5 分钟",preset30m:"30 分钟",preset1h:"1 小时",preset1d:"1 天",submit:"确认延后",toastOk:"已延后 {{duration}}"},jO={cancelled:"已取消"},FO={pageTitle:RO,subtitle:TO,filter:PO,status:IO,source:LO,promptMode:OO,empty:NO,col:_O,action:DO,snooze:MO,toast:jO},UO="Memos",HO="Long-term notes the operator captured for the agent — searchable by content, person, or location.",BO={placeholder:"Search memos…",who:"Who",what:"What",hasLocation:"Has location",includeExpired:"Include expired"},zO={title:"No memos match",description:"Memos are created from chat via `/memo` or auto-extracted by the memory subsystem. Try clearing filters or widening the search."},$O={id:"ID",what:"What",who:"Who",when:"When",where:"Where",platform:"Platform",createdAt:"Created",expiresAt:"Expires"},VO={delete:"Delete",confirmDelete:"Delete this memo?",confirmDeleteDesc:"This cannot be undone. The memory subsystem still has any embeddings derived from this memo until a backfill prune lands."},KO={label:"Open map",baidu:"Baidu Maps",apple:"Apple Maps",google:"Google Maps",osm:"OpenStreetMap"},WO={deleted:"Memo deleted"},qO={pageTitle:UO,subtitle:HO,search:BO,empty:zO,col:$O,action:VO,openMap:KO,toast:WO},GO="备忘",QO="操作员为 Agent 记下的长期备忘 — 可按内容、人物、地点检索。",YO={placeholder:"搜索备忘…",who:"谁",what:"做什么",hasLocation:"含位置",includeExpired:"包含过期"},XO={title:"未匹配到备忘",description:"备忘通过聊天中的 `/memo` 命令或记忆子系统自动抽取生成。可清空筛选或放宽搜索条件再试。"},JO={id:"ID",what:"事项",who:"对象",when:"时间",where:"地点",platform:"平台",createdAt:"创建时间",expiresAt:"过期时间"},ZO={delete:"删除",confirmDelete:"确认删除此备忘?",confirmDeleteDesc:"操作不可撤销。记忆子系统中由此备忘衍生的 embedding 在下一次 backfill 清理前仍会保留。"},eN={label:"在地图中打开",baidu:"百度地图",apple:"Apple 地图",google:"Google 地图",osm:"OpenStreetMap"},tN={deleted:"已删除"},nN={pageTitle:GO,subtitle:QO,search:YO,empty:XO,col:JO,action:ZO,openMap:eN,toast:tN},rN="Memory",iN="Per-user facts the agent has accumulated. Long-term memory that survives session resets.",oN={label:"User",placeholder:"Pick a user",factsLabel:"{{count}} facts",personaTag:"persona"},aN={title:"Pick a user to view their memory",description:"Memory is partitioned per user_key (platform:userId). The dropdown above lists every user whose memory has any rows in the bank."},sN={facts:"Facts",persona:"Persona",vector:"Vector",skills:"Skills"},lN={title:"Facts",empty:{title:"No facts yet",description:"Facts accumulate as the agent extracts them from chat history during memory consolidation. Triggering `/memory consolidate` from chat (or the Persona tab's button when it lands) seeds this list."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},category:{fact:"Fact",preference:"Preference",goal:"Goal",history:"History",profile:"Profile"},col:{id:"ID",what:"What",category:"Category",confidence:"Confidence",source:"Source",createdAt:"Created"},batch:{selected:"{{count}} selected",deleteSelected:"Delete selected",confirmDelete:"Delete {{count}} fact(s)?",confirmDeleteDesc:"This removes the rows from the bank. The vector index keeps any embedding derived from these rows until the next backfill prune."},action:{delete:"Delete",confirmDelete:"Delete this fact?",confirmDeleteDesc:"This row is removed permanently. The vector index retains its embedding until the next backfill prune."},toast:{deletedOne:"Fact deleted",deletedMany:"Deleted {{count}} facts"}},cN={title:"Persona",subtitle:"Long-form summary of who this user is, refined by periodic consolidation of their facts.",empty:{title:"No persona yet",description:"Personas are written by the consolidation pass — run it from the button below once enough facts have accumulated."},updated:"Updated {{at}}",editorLabel:"Persona summary",save:"Save",saved:"Saved",delete:"Delete persona",confirmDelete:"Delete this persona?",confirmDeleteDesc:"The persona summary is removed from the bank. Facts the persona was derived from stay in place; the next consolidate pass will rewrite a fresh one.",consolidate:{trigger:"Run consolidation",triggering:"Starting…",running:"Consolidation running…",doneOk:"Consolidation complete",doneFailed:"Consolidation failed",lastRun:"Last run {{at}}",result:"Processed {{users}} user(s), {{updated}} persona(s) updated"}},uN={title:"Vector backend",subtitle:"Embeddings power hybrid recall on memory facts. The active backend, model, and per-user coverage live here.",config:{title:"Backend configuration",hint:"Backend selection + OpenAI / local-model parameters live in env. Edit `~/.agim/env` on the host (or set systemd `Environment=`); the `IMHUB_MEMORY_VECTOR_*` keys are listed below.",editLink:"env file"},form:{title:"Backend configuration",hint:"Pick a backend, fill in the parameters, then save & test. Changes hit the env file and reload in-process; a restart re-reads them.",dirty:"Unsaved changes",discard:"Discard",saveAndTest:"Save & test",savedToast:"Saved — running test…",nothingChanged:"Nothing to save",backend:"Backend",backendHelp:"off = vector recall disabled; local = on-device BGE; openai = OpenAI-compatible remote endpoint",backendOff:"Off",backendLocal:"Local (BGE)",backendOpenai:"OpenAI-compatible",localModel:"Local model",localModelHelp:"Xenova model id, defaults to Xenova/bge-base-zh-v1.5. First-time use needs a manual download.",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI-compatible endpoint root, e.g. https://api.openai.com/v1 or your self-hosted gateway.",openaiModel:"Model",openaiModelHelp:"Embedding model id, defaults to text-embedding-3-small. Match your provider's docs for other endpoints.",openaiApiKey:"API key",apiKeyKeepHint:"Leave blank to keep the existing key (placeholder shows the masked value); typing replaces it.",apiKeyNewHint:"Paste your OpenAI-compatible API key (only the server sees the raw value after save).",toggleApiKey:"Show / hide API key",batchSize:"Batch size",batchSizeHelp:"Max texts per embed call, 1–1024 (default 32).",hybridWeight:"Hybrid weight",hybridWeightHelp:"Vector branch weight when fusing with FTS5 recall, 0–1 (default 0.5).",errors:{baseUrlRequired:"Base URL is required",baseUrlInvalid:"Base URL is not a valid URL",openaiModelRequired:"Embedding model id is required",apiKeyRequired:"API key is required for the OpenAI backend on first setup",localModelRequired:"Local model id is required",batchSizeRange:"Batch size must be between 1 and 1024",hybridWeightRange:"Hybrid weight must be between 0 and 1"}},backendLabel:"Backend",modelLabel:"Model",dimsLabel:"Dimensions",readyTrue:"Ready",readyFalse:"Not ready",downloadedTrue:"Files on disk",lastError:"Last error",coverage:{title:"Coverage",total:"Facts",withEmbedding:"Embedded",withDifferentModel:"Mismatched model",scope_user:"for {{userKey}}",scope_global:"across every user"},actions:{title:"Maintenance",test:"Test",testOk:"Backend test OK",testFail:"Backend test failed: {{detail}}",download:"Download model",downloadStarted:"Download started",downloadAlreadyReady:"Model is already ready",backfill:"Backfill embeddings",backfillStarted:"Backfill started",backfillNotReady:"Backend not ready — run download first",clear:"Clear embeddings",clearStarted:"Cleared {{count}} embedding(s)",confirmClear:"Clear all embeddings?",confirmClearDesc:"Drops the embedding column for {{scope}}. Facts themselves stay; you'll need to backfill again before vector recall works."},jobs:{title:"Recent jobs",empty:"No recent jobs",phase:{running:"Running",done:"Done",failed:"Failed"}}},dN={title:"Skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills installed",description:"Drop a SKILL.md (with `name` and `description` frontmatter) under one of the configured roots and refresh."},filter:{search:"Search",category:"Category",categoryAny:"All categories"},sources:{title:"Source directories",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Available to"}},fN={pageTitle:rN,subtitle:iN,userPicker:oN,noUserSelected:aN,tabs:sN,facts:lN,persona:cN,vector:uN,skills:dN},hN="记忆",pN="Agent 为每个用户积累的事实库。跨会话保留的长期记忆。",mN={label:"用户",placeholder:"选择一个用户",factsLabel:"{{count}} 条事实",personaTag:"persona"},gN={title:"选择一个用户查看其记忆",description:"记忆按 user_key(platform:userId)分隔。上方下拉列出每位在库中有任何记忆数据的用户。"},yN={facts:"事实",persona:"Persona",vector:"向量",skills:"技能"},vN={title:"事实",empty:{title:"暂无事实",description:"Agent 在记忆整理过程中会从聊天历史中抽取事实。可在聊天里运行 `/memory consolidate` 或后续 Persona 子页内的按钮触发整理。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},category:{fact:"事实",preference:"偏好",goal:"目标",history:"历史",profile:"档案"},col:{id:"ID",what:"内容",category:"类别",confidence:"置信度",source:"来源",createdAt:"创建时间"},batch:{selected:"已选 {{count}} 项",deleteSelected:"删除所选",confirmDelete:"确认删除 {{count}} 条事实?",confirmDeleteDesc:"记忆库中的这些行将被删除。向量索引中相应的 embedding 在下一次 backfill 清理前仍会保留。"},action:{delete:"删除",confirmDelete:"确认删除此事实?",confirmDeleteDesc:"该行被永久删除。向量索引会在下一次 backfill 清理前保留对应 embedding。"},toast:{deletedOne:"已删除",deletedMany:"已删除 {{count}} 条"}},bN={title:"Persona",subtitle:"该用户的长篇画像,由记忆整理任务从事实库中提炼。",empty:{title:"暂无 Persona",description:"Persona 由整理任务生成。当事实积累到一定量后,点击下方按钮运行整理。"},updated:"更新于 {{at}}",editorLabel:"Persona 内容",save:"保存",saved:"已保存",delete:"删除 Persona",confirmDelete:"确认删除此 Persona?",confirmDeleteDesc:"Persona 概要会从库中删除。生成它的事实仍保留,下一次整理会重新生成。",consolidate:{trigger:"运行整理",triggering:"启动中…",running:"整理进行中…",doneOk:"整理完成",doneFailed:"整理失败",lastRun:"上次运行:{{at}}",result:"处理 {{users}} 位用户,更新 {{updated}} 条 Persona"}},xN={title:"向量后端",subtitle:"Embedding 驱动事实库的混合检索。当前后端、模型与每位用户的覆盖情况都在这里。",config:{title:"后端配置",hint:"后端选择与 OpenAI / 本地模型的参数都通过环境变量配置。请在宿主机直接编辑 `~/.agim/env`(或 systemd unit 的 `Environment=`),下方列出的 `IMHUB_MEMORY_VECTOR_*` 系列 key 即对应字段。",editLink:"env file"},form:{title:"后端配置",hint:"选好后端、填好参数 → 保存并测试。配置只对本进程生效,重启服务后从 env 文件重新加载。",dirty:"有未保存的改动",discard:"放弃改动",saveAndTest:"保存并测试",savedToast:"已保存,正在测试…",nothingChanged:"没有需要保存的改动",backend:"后端",backendHelp:"off = 关闭向量召回;local = 本地 BGE 模型;openai = 调远程 OpenAI 协议端点",backendOff:"关闭",backendLocal:"本地(BGE)",backendOpenai:"OpenAI 协议远程",localModel:"本地模型",localModelHelp:"Xenova 仓库的 model id,默认 Xenova/bge-base-zh-v1.5;首次使用需手动触发下载。",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI 兼容端点根路径,例如 https://api.openai.com/v1 或自部署网关。",openaiModel:"模型",openaiModelHelp:"Embedding 模型 id,默认 text-embedding-3-small;用其他兼容端点请按其文档填写。",openaiApiKey:"API Key",apiKeyKeepHint:"留空 = 保留当前 key(占位显示为脱敏值);填了就会覆盖。",apiKeyNewHint:"粘贴你的 OpenAI 兼容 API Key(保存后只在服务端可见)。",toggleApiKey:"显示 / 隐藏 API Key",batchSize:"批大小",batchSizeHelp:"单次嵌入的最大文本数,1–1024,默认 32。",hybridWeight:"混合权重",hybridWeightHelp:"FTS5 与向量召回融合时向量分支的权重,0–1,默认 0.5。",errors:{baseUrlRequired:"Base URL 不能为空",baseUrlInvalid:"Base URL 不是合法 URL",openaiModelRequired:"Embedding 模型 id 不能为空",apiKeyRequired:"首次使用 OpenAI 后端需要填 API Key",localModelRequired:"本地模型 id 不能为空",batchSizeRange:"批大小需在 1–1024 之间",hybridWeightRange:"混合权重需在 0–1 之间"}},backendLabel:"后端",modelLabel:"模型",dimsLabel:"维度",readyTrue:"就绪",readyFalse:"未就绪",downloadedTrue:"已下载",lastError:"最近错误",coverage:{title:"覆盖率",total:"事实总数",withEmbedding:"已嵌入",withDifferentModel:"模型不匹配",scope_user:"(针对 {{userKey}})",scope_global:"(全部用户)"},actions:{title:"维护",test:"测试",testOk:"后端测试通过",testFail:"后端测试失败:{{detail}}",download:"下载模型",downloadStarted:"下载已开始",downloadAlreadyReady:"模型已就绪",backfill:"回填 embedding",backfillStarted:"回填已开始",backfillNotReady:"后端未就绪 — 请先下载",clear:"清空 embedding",clearStarted:"已清空 {{count}} 条",confirmClear:"确认清空全部 embedding?",confirmClearDesc:"会丢弃 {{scope}} 的 embedding 列。事实本身保留;下次回填前向量检索不可用。"},jobs:{title:"近期任务",empty:"暂无任务",phase:{running:"运行中",done:"完成",failed:"失败"}}},wN={title:"技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},kN={pageTitle:hN,subtitle:pN,userPicker:mN,noUserSelected:gN,tabs:yN,facts:vN,persona:bN,vector:xN,skills:wN},SN="Skills",CN={installed:"Installed",hot:"Hot on skillhub.cn"},EN={title:"Installed skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills",description:"Drop a SKILL.md with `name` + `description` frontmatter under a configured root and refresh."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},sources:{title:"Sources",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Picked up by"}},AN={title:"Hot on skillhub.cn",subtitle:"Live top entries from skillhub.cn (cached 5 min on the server). Click a row for the install commands. agim never auto-runs installs — you copy the command and paste into shell or IM.",openHub:"Open skillhub.cn",loading:"Loading…",empty:"No data",cached:"cache hit",stale:"upstream unreachable — serving stale",updatedAt:"updated {{at}}",col:{slug:"slug",name:"Name / description",stars:"stars",installs:"installs"},detail:{version:"Version",category:"Category",stars:"Stars",installs:"Installs",downloads:"Downloads",howInstall:"How to install (pick one; agim never auto-runs)",copy:"Copy",copied:"Copied",label:{cliInstall:"On host (recommended)",cliSearch:"Dry-run first",imAsk:"Ask an IM agent"},hint:"The two CLI commands need skillhub CLI installed on the host first. See docs/skills.md or skillhub.cn."}},RN={pageTitle:SN,subnav:CN,installed:EN,hot:AN},TN="技能",PN={installed:"已安装",hot:"skillhub.cn 热门"},IN={title:"已安装的技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},LN={title:"skillhub.cn 热门",subtitle:"实时拉取 skillhub.cn 热门下载(服务端 5 分钟缓存)。点击任意条目查看安装命令。agim 不会自动跑安装——命令复制后由你贴去 shell 或 IM 触发。",openHub:"前往 skillhub.cn",loading:"正在加载…",empty:"暂无数据",cached:"缓存命中",stale:"上游不可达,使用旧数据",updatedAt:"更新于 {{at}}",col:{slug:"slug",name:"名称 / 描述",stars:"stars",installs:"installs"},detail:{version:"版本",category:"类别",stars:"stars",installs:"installs",downloads:"downloads",howInstall:"安装方式(任选一个;agim 不会自动跑)",copy:"复制",copied:"已复制",label:{cliInstall:"Host 上跑(推荐)",cliSearch:"先查再装",imAsk:"在 IM 里让 agent 装"},hint:"前两条要先在 host 上安装 skillhub CLI。详见 docs/skills.md 或 skillhub.cn。"}},ON={pageTitle:TN,subnav:PN,installed:IN,hot:LN},NN="Workspace",_N="Read and edit files in the per-agent working directories (`AGENT_CWD`).",DN={label:"Agent",placeholder:"Pick an agent",online:"online",offline:"offline"},MN={title:"Pick an agent to browse its workspace",description:"Each registered agent runs from its own CWD. The picker lists every agent the registry knows about; the green dot next to a name means it reports available."},jN={title:"Files",loading:"Loading…",empty:"(empty directory)",up:"Up",rootLabel:"(workspace root)",binary:"binary",symlinkEscape:"symlink → outside workspace, hidden",broken:"unreadable"},FN={noFile:"Select a file from the tree to view or edit it.",binary:"This file looks binary (base64-encoded) — editing not supported.",truncated:"File is over 1 MiB; only the first 1 MiB is shown. Saving from here would replace the whole file with the truncated content — close without saving.",save:"Save",saving:"Saving…",savedMeta:"Saved · {{size}} bytes · {{at}}",dirtyHint:"Unsaved changes",loadFailed:"Failed to load file"},UN={saved:"Saved {{path}}"},HN={pageTitle:NN,subtitle:_N,agentPicker:DN,noAgent:MN,tree:jN,editor:FN,toast:UN},BN="工作区",zN="在每个 Agent 的工作目录(`AGENT_CWD`)下浏览与编辑文件。",$N={label:"Agent",placeholder:"选择一个 Agent",online:"在线",offline:"离线"},VN={title:"选择一个 Agent 来浏览其工作区",description:"每个已注册的 Agent 都有自己的 CWD。下拉列出注册表中所有已知的 Agent;名字旁的绿点表示该 Agent 当前可用。"},KN={title:"文件",loading:"加载中…",empty:"(目录为空)",up:"返回上级",rootLabel:"(工作区根目录)",binary:"二进制",symlinkEscape:"符号链接指向工作区外,已隐藏",broken:"不可读"},WN={noFile:"从左侧选择一个文件查看或编辑。",binary:"该文件是二进制(base64 编码)— 不支持编辑。",truncated:"文件超过 1 MiB;仅显示前 1 MiB。直接保存会用截断内容覆盖整个文件 — 请关闭而不要保存。",save:"保存",saving:"保存中…",savedMeta:"已保存 · {{size}} 字节 · {{at}}",dirtyHint:"有未保存的修改",loadFailed:"加载文件失败"},qN={saved:"已保存 {{path}}"},GN={pageTitle:BN,subtitle:zN,agentPicker:$N,noAgent:VN,tree:KN,editor:WN,toast:qN},QN="Observability",YN="Operational health: invocation totals, top-N leaderboards, and the audit timeline.",XN={health:"Health",topn:"Top-N",audit:"Audit"},JN={label:"Window",days_one:"{{count}} day",days_other:"{{count}} days"},ZN={title:"Health",totals:"Totals",byDay:"By day",kpi:{calls:"Calls",cost:"Cost",errors:"Errors",errorRate:"Error rate",avgLatencyMs:"Avg latency",p95LatencyMs:"P95 latency"},byDayCol:{date:"Date",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data in this window",description:"No invocations recorded in the selected time window. Widen the window or wait for an agent call to fire."}},e_={title:"Top-N",filter:{dim:"Group by",metric:"Rank by"},dim:{user:"User",agent:"Agent",platform:"Platform",intent:"Intent"},metric:{cost:"Cost",calls:"Calls",errors:"Errors",avg_latency:"Avg latency"},col:{rank:"#",key:"Key",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data",description:"No invocations matched the filters."}},t_={title:"Audit",stats:{total:"Total",totalCost:"Total cost"},filter:{agent:"Agent",platform:"Platform",user:"User",intent:"Intent"},col:{ts:"Time",trace:"Trace",agent:"Agent",platform:"Platform",user:"User",intent:"Intent",duration:"Duration",cost:"Cost",outcome:"Outcome"},outcome:{ok:"ok",fail:"fail"},empty:{title:"No invocations",description:"Audit rows appear here when an agent is invoked. Adjust filters or widen the window."}},n_={pageTitle:QN,subtitle:YN,tabs:XN,window:JN,health:ZN,topn:e_,audit:t_},r_="观测",i_="运行健康:调用总量、Top-N 排行与审计时间线。",o_={health:"健康",topn:"Top-N",audit:"审计"},a_={label:"时间窗口",days_one:"{{count}} 天",days_other:"{{count}} 天"},s_={title:"健康",totals:"总览",byDay:"每日明细",kpi:{calls:"调用",cost:"成本",errors:"错误",errorRate:"错误率",avgLatencyMs:"平均延迟",p95LatencyMs:"P95 延迟"},byDayCol:{date:"日期",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"时间窗口内无数据",description:"所选时间范围内没有任何调用记录。可以放宽时间窗口或等待 Agent 被调用。"}},l_={title:"Top-N",filter:{dim:"分组维度",metric:"排序依据"},dim:{user:"用户",agent:"Agent",platform:"平台",intent:"意图"},metric:{cost:"成本",calls:"调用",errors:"错误",avg_latency:"平均延迟"},col:{rank:"#",key:"Key",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"暂无数据",description:"当前筛选下没有调用记录。"}},c_={title:"审计",stats:{total:"累计",totalCost:"累计成本"},filter:{agent:"Agent",platform:"平台",user:"用户",intent:"意图"},col:{ts:"时间",trace:"Trace",agent:"Agent",platform:"平台",user:"用户",intent:"意图",duration:"耗时",cost:"成本",outcome:"结果"},outcome:{ok:"成功",fail:"失败"},empty:{title:"暂无调用",description:"当 Agent 被调用时,审计记录会出现在这里。可调整筛选或放宽时间窗口。"}},u_={pageTitle:r_,subtitle:i_,tabs:o_,window:a_,health:s_,topn:l_,audit:c_},d_="Settings",f_="Operational configuration: environment variables and service lifecycle.",h_={messengers:"Messengers",email:"Email (SMTP)",viewer:"Viewer & Maps",agents:"Agents",llm:"LLM Backends",mcp:"MCP Servers",nativeAgent:"Native Agent",search:"Web search",mobile:"Mobile",agimSkills:"agim Skills",policy:"Policy",security:"Security",workspaces:"Workspaces",admins:"Admins",env:"Env Vars",service:"Service"},p_={title:"Agents",subtitle:"Built-in agent adapters. Enable the ones whose CLI is installed on this host; pick which one handles unrouted messages by default. `native` is an in-process agent and needs no install.",installHint:"Not installed. `npm install -g {{pkg}}` on the host.",nativeInstallHint:"No LLM backend configured. Set one (OpenAI / DeepSeek / Anthropic / …) on the Settings → Native Agent tab and you're done.",inProcessBadge:"built-in",inProcessHint:"in-process — runs inside agim, no external CLI to install",aliasesLabel:"Aliases",online:"online",offline:"offline",defaultAgent:"Default agent",defaultAgentHint:"Used when the intent classifier has no preference (new web threads, etc.). Only enabled + online agents appear here.",noEligible:"No eligible default",saveBtn:"Save",saving:"Saving…",dirtyHint:"Unsaved changes",discard:"Discard",toast:{saved:"Saved"},acp:{title:"Remote agents (ACP)",subtitle:"Agents reachable over HTTP via the Agent Communication Protocol. Each entry persists in config and registers on the next service restart.",discoverBtn:"Discover",runDiscover:"Probe",baseUrl:"Discovery URL",baseUrlHint:"Probes `<base>/.well-known/acp` and adds the entries it lists. Skips names already present.",addTitle:"Add agent",name:"Name",nameHint:"Stable identifier; letters, digits, `._-`.",aliases:"Aliases",aliasesHint:"Comma-separated; routed via `/alias` in chat.",endpoint:"Endpoint",endpointHint:"Base URL of the agent's ACP root (no trailing `/`).",authType:"Auth",auth:{none:"None",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"Paste token",testBtn:"Test",addBtn:"Add",removeBtn:"Remove",on:"on",off:"off",dupName:"An agent with this name already exists.",empty:{title:"No remote agents",description:"Add an ACP endpoint below or use Discover for a `.well-known/acp` directory."},toast:{staged:"Staged. Save to persist.",testOk:"Reached `{{name}}`",testMasked:"Save first — token is masked, can't test in place.",discoverEmpty:"Nothing new to add.",discoverAdded_one:"Added {{count}} agent.",discoverAdded_other:"Added {{count}} agents."}}},m_={title:"Policy & toggles",subtitle:"Frequently-flipped switches that operate on env values under the hood. Each toggle persists immediately; the change applies on the next service restart unless the relevant module supports hot-reload (most do).",savingToast:"Saved",safety:{title:"Skip permissions (DANGEROUS)",description:"When ON, the Claude Code adapter passes `--dangerously-skip-permissions` to the wrapped CLI, bypassing every tool-use confirmation. Recommended OFF for production. Only enable for trusted, isolated workspaces.",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"production deployments should keep this OFF"},approval:{title:"Approval timeout default",description:'What the approval bus does when a pending tool-use request expires with no human reply. `Deny` is the safe default and keeps write-side calls (Bash / Edit / Write) gated; `Allow` is "user away" mode and lets the agent keep moving.',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"Deny on timeout",valAllow:"Allow on timeout"},memory:{title:"Long-term memory",description:"Master switch for the per-user memory subsystem (facts + persona + vector retrieval). Disabling stops new fact extraction and persona consolidation; the existing bank stays on disk.",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"Long-message viewer",description:"When ON, IM replies that exceed the viewer threshold are uploaded to the local paste store and the IM message becomes a short URL the user can click. Without it, long replies get truncated by the messenger.",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A notify mode",description:"How verbose the bus is when one agent calls another. `essential` (default) sends only headline events; `verbose` includes every transition; `off` silences cross-agent notifications entirely.",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"Essential",valVerbose:"Verbose",valOff:"Off"}},g_={title:"Messengers",subtitle:"Per-IM-platform connection settings. Toggle a platform on, fill in its credentials, and Save. The next service restart picks up the new config.",saveAll:"Save all",saving:"Saving…",savedToast:"Configuration saved",discardAll:"Discard changes",dirtyHint:"Unsaved changes",platform:{wechat:"WeChat",telegram:"Telegram",feishu:"Feishu (Lark)",dingtalk:"DingTalk",discord:"Discord"},hint:{wechat:"iLink-based QR login. Click Scan, scan the QR with your phone WeChat, confirm — the bot logs in as that account.",telegram:"Bot API token from @BotFather; channel id is optional and only used when targeting a specific chat.",feishu:"App credentials from the Lark developer console. App must have the messaging scopes.",dingtalk:"Stream API client credentials from the DingTalk developer console.",discord:"Bot token from the Discord developer portal. The bot must be invited to the target channel."},enabled:"Enabled",disabled:"Disabled",scanQr:"Scan QR",fields:{botToken:"Bot token",appId:"App ID",appSecret:"App secret",clientId:"Client ID",clientSecret:"Client secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"DM policy",groupPolicy:"Group policy",allowFrom:"DM allowFrom (staffIds, comma-separated)",groupAllowFrom:"Group allowFrom (staffIds, comma-separated)",ackReaction:"Ack-reaction",policy:{open:"open — anyone may talk",pairing:"pairing — first DMer pinned",allowlist:"allowlist — only listed IDs",disabled:"disabled — bot ignores groups"},ack:{off:"off — no ack glyph",emoji:"emoji ⏳→✅",kaomoji:"kaomoji (text-face)"},accountsTitle:"Extra accounts",accountDisabled:"disabled",accountsHint:"Each entry starts its own DWClient with isolated dmPolicy / allowFrom / ack-reaction. Restart agim after Save for new accounts to take effect.",accountsEmpty:"No extra accounts yet. Click ‘+ add account’ to wire another DingTalk bot.",addAccount:"Add account",accountName:"Display name (optional)",accountRenameCollision:'An account with id "{{id}}" already exists; pick another id.'},qr:{title:"Scan WeChat QR",description:"Open WeChat on your phone, scan this code, then confirm the login prompt inside WeChat.",starting:"Starting QR session…",loadFailed:"Failed to start QR session",expired:"QR code expired — close and start a new one.",cancelled:"Cancelled.",confirmed:"Login confirmed — wechat-ilink will start on the next service restart."}},y_={title:"Email (SMTP)",subtitle:"Outbound mail delivery for `/remind email me@x.com …`. Credentials persist to `~/.agim/.env`. Leave blank to disable.",cardTitle:"SMTP credentials",statusOn:"configured",statusOff:"disabled",host:"Host",hostHint:"Mail server hostname (e.g. `smtp.gmail.com`).",port:"Port",portHint:"Usually 465 (SSL) or 587 (STARTTLS).",user:"Username",userHint:"Login email; often the sender address too.",pass:"Password / app token",passHint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",from:"From",fromHint:"Sender header. Defaults to the username when blank.",secure:"TLS mode",secureHint:"`auto` follows the port; force SSL or STARTTLS if your provider requires it.",secureAuto:"auto (port-based)",secureTrue:"true (SSL, port 465)",secureFalse:"false (STARTTLS, port 587)",reveal:"Reveal",hide:"Hide",testBtn:"Test connection",testNeedsConfigured:"Save host / user / password first.",disableBtn:"Disable SMTP",saveBtn:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"SMTP saved",disabled:"SMTP disabled",noChanges:"Nothing to save"}},v_={title:"Viewer & Maps",subtitle:"Public-facing surfaces: the long-message Viewer (turns >threshold replies into a `/v/<id>` short link) and Baidu Maps AK (drives `/memo` address geocoding).",reveal:"Reveal",hide:"Hide",save:"Save",saving:"Saving…",discard:"Discard",dirtyHint:"Unsaved changes",toast:{saved:"Viewer settings saved"},viewer:{title:"Viewer (long-message links)",subtitle:"Replies longer than the chars / lines threshold are uploaded to the local paste store and the IM message becomes a short `/v/<id>` link.",on:"enabled",off:"disabled",enableLabel:"Enable the long-message Viewer",publicUrl:"Public base URL",publicUrlHint:"What the operator's reverse proxy / tunnel exposes. Used to build `/v/<id>` links.",tunnelMode:"Tunnel mode",tunnelOff:"off (use Public base URL)",tunnelQuick:"quick (cloudflared)",tunnelHint:"`quick` launches a Cloudflare quick tunnel and uses its URL when the operator hasn't fronted agim themselves.",remotePasteUrl:"Remote paste URL",remotePasteUrlHint:"POST markdown here to get a public URL back; overrides Public base URL + tunnel. Leave empty to use the community default https://viewer.iclaw.host/paste.",remotePasteToken:"Remote paste bearer token",remotePasteTokenHint:"Optional bearer token sent to the remote paste server. Required only if your paste server protects POSTs.",noDefaultRemote:"Disable community default",noDefaultRemoteLabel:"Don't fall back to viewer.iclaw.host when nothing else is configured",noDefaultRemoteHint:"v1.2.43+: when no mode is configured, agim defaults to remote mode against viewer.iclaw.host. Check this to disable that fallback (markdown stays inline if no other mode is set).",tunnelStatus:"Tunnel status",refreshTunnel:"Refresh",tunnelRunning:"Running",yes:"yes",no:"no",tunnelUrl:"Live URL",effectiveUrl:"Effective URL",binary:"cloudflared binary",binaryMissing:"not found in PATH — install from cloudflare/cloudflared releases",lastError:"Last error",tunnelLoading:"Loading tunnel status…",thresholds:"Thresholds",chars:"Max chars",charsHint:"Replies above this length route through Viewer.",lines:"Max lines",linesHint:"Same routing decision, on line count.",codeLines:"Max code lines",codeLinesHint:"Lower threshold for replies inside code fences.",maxPastes:"Paste store cap",maxPastesHint:"Older pastes are evicted FIFO once the count exceeds this."},baidu:{title:"Baidu Maps AK",subtitle:"Enables `/memo` address-to-coords lookup. Without it, /memo still works via raw coords or browser GPS share. Free AK: lbsyun.baidu.com → Console → Application → Server-side API.",configured:"configured",empty:"not set",placeholder:"32-char AK starting with a non-digit",hint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",suspicious:"AK length is {{length}} — usually a Baidu AK is 32 characters. Double-check?",clear:"Clear AK",toast:{saved:"Baidu Maps AK saved",cleared:"Baidu Maps AK cleared"}}},b_={title:"Workspaces",subtitle:"Multi-tenant workspace registry. Each workspace has its own agent whitelist, rate-limit, and (optionally) member list. The `default` workspace catches every unrouted user.",empty:{title:"Only the default workspace",description:"Add a workspace below to partition a team / project / customer. Each one gets its own agent whitelist + rate-limit."},col:{id:"ID",name:"Name",agents:"Agents",members:"Members",rateLimit:"Rate limit"},rateLimitFormat:"{{rate}} per {{intervalSec}}s, burst {{burst}}",membersOpen:"open (any user)",membersCount_one:"{{count}} member",membersCount_other:"{{count}} members",edit:"Edit",form:{title:"Add or edit a workspace",subtitleEdit:"Editing existing workspace — change id to clone, keep to upsert.",id:"ID",idHint:"Stable identifier; [a-zA-Z0-9_-]+; the special name `default` is reserved.",name:"Display name",agents:"Agent whitelist",agentsHint:"Comma-separated; empty = allow every registered agent.",members:"Member user IDs",membersHint:"Comma-separated `platform:userId`; empty = open workspace.",rateLimit:"Rate limit (optional)",rate:"Calls",intervalSec:"Per (seconds)",burst:"Burst",submit:"Save workspace",reset:"Clear form"},toast:{saved:"Workspace saved"}},x_={title:"Service",subtitle:"Inspect the running agim process + start, stop, or restart it.",modeLabel:"Mode",pidLabel:"PID",uptimeLabel:"Uptime",webLabel:"Web",bootPhaseLabel:"Boot phase",mode:{systemd:"systemd",background:"background",foreground:"foreground",none:"not running"},actions:{start:"Start",stop:"Stop",restart:"Restart",confirmStop:"Stop the agim service?",confirmStopDesc:"The web console, the messenger adapters, and any in-flight job will all stop. You'll need to start the service again before you can use it.",confirmRestart:"Restart the agim service?",confirmRestartDesc:"The process stops and re-starts. In-flight jobs are cancelled; outbox + queued reminders survive the bounce. The web console will be unreachable for ~5-30 seconds."},toast:{started:"Service started",stopped:"Service stopped",restarted:"Service restarted"},ports:{title:"Ports",subtitle:"Which ports agim binds when started. Leave blank to use the default. Changes apply on the next service restart (use the Restart button below after saving).",webPort:"Web port",webPortHint:"HTTP server for the chat UI + REST API. Default: {{default}}.",acpPort:"ACP port",acpPortHint:"Agent Communication Protocol server (remote agent surface). Default: {{default}}.",invalidPort:"Must be a number between 1 and 65535.",restartRequired:"Restart required",save:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"Ports saved — restart agim to bind the new ports"}}},w_={title:"Security",subtitle:"Tool sandbox, SSRF block, sender allowlist, runtime audit. Changes persist to the env file immediately. Most native tools read process.env per call (hot-reload); exec sandbox + sender allowlist need a service restart to apply.",diagnostics:{title:"Runtime diagnostics",runningAsRoot:"Running as root",runningAsRootHelp:"Tool calls run with root privileges. Recommend creating a dedicated user + setting User= in the systemd unit.",envFilePerms:"Env file permissions",envFilePermsLax:"Too permissive (group/world readable)",envFilePermsOk:"0600 (owner-only)",bwrapAvailable:"bubblewrap installed",bwrapMissing:"Not installed (apt install bubblewrap)",senderAllowlist:"Sender allowlist",senderAllowlistOff:"Not configured (open access)",senderAllowlistOn:"Configured",adminAllowlist:"Admin allowlist",adminAllowlistOff:"Not configured (populated after first /setup)",adminAllowlistOn:"Configured"},sender:{title:"Sender allowlist (who can talk to the bot)",description:"Comma-separated platform:userId pairs, e.g. telegram:8754479311,wechat-ilink:wxid_abc. Set to * to mark 'everyone explicitly allowed'. Empty = open access (preserves backward compatibility; startup logs OPEN_IM_ACCESS).",envKey:"IMHUB_ALLOWED_USERS",placeholder:"platform:userId,platform:userId"},exec:{title:"Native exec tool",description:"Sandbox + timeout controls for native_exec. Each invocation also goes through an IM approval card (unless previously auto-allowed by fingerprint).",sandbox:"Sandbox backend",sandboxNone:"None (plain spawn)",sandboxBwrap:"bubblewrap (Linux only)",sandboxBwrapMissing:"bubblewrap not installed",sandboxNet:"Sandbox network",sandboxNetOn:"Allowed (default)",sandboxNetOff:"Blocked (--unshare-net)",timeoutMs:"Command timeout (ms, default 60000)",maxOutput:"Per-stream output cap (bytes, default 32768)"},web:{title:"Native web tools",description:"SSRF defense and timeouts. CIDR whitelist lets you allow Tailscale / 100.64.0.0/10 / VPN ranges back in.",allowPrivate:"Allow all private ranges (not recommended)",allowPrivateHelp:"= 1 disables all private-IP checks. Only for trusted internal deployments.",ssrfWhitelist:"SSRF CIDR whitelist",ssrfWhitelistPlaceholder:"100.64.0.0/10,10.20.0.0/16",timeoutMs:"fetch / search timeout (ms, default 30000)"},fs:{title:"Native filesystem tools",description:"fs tools default to the native agent's per-thread workspace subtree.",restrict:"Restrict to workspace",restrictOn:"ON (recommended)",restrictOff:"OFF (allow any path; sensitive-paths denylist still applies)",timeoutMs:"fs tool timeout (ms, default 60000)"},delegation:{title:"Native call_agent cap",description:"Max mcp__imhub__call_agent invocations per turn. Prevents native from spinning on infinite delegations. 0 = unlimited.",envKey:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN",valueLabel:"default 2"},platformBlacklist:{title:"IM platform blacklist",description:"Comma-separated platform ids. Listed platforms are hidden from the CLI wizard, from this admin page, and registry.registerMessenger refuses to register them at boot — even if their credentials still live in the env file the adapter won't come up. Default empty (no blocks). Common ids: wechat-ilink / telegram / feishu / dingtalk / discord / email.",envKey:"IMHUB_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"Currently in force"},diagnosticsPlatformBlacklist:"Platform blacklist",savingToast:"Saved.",resetTitle:"Reset to default"},k_={title:"IM admin registry",subtitle:"Web admin tokens decide who can run IM admin-tier commands. Candidate IM users are auto-discovered after they send any message to agim.",configured:"Allowlist configured",notConfigured:"No IM admin configured yet.",empty:"No admins added yet.",col:{platform:"Platform",userId:"User ID"},known:{title:"Discovered IM users",hint:"Users appear here automatically after they talk to agim. Grant admin directly from this list.",count:"Discovered users: {{count}}",empty:"No discovered IM users yet.",emptyHint:"Ask the user to send one message to agim first.",col:{lastSeen:"Last seen"},promote:"Grant admin",alreadyAdmin:"Already admin"},remove:{label:"Remove",confirmTitle:"Remove this admin?",confirmDescription:"They lose access to all admin-tier commands. Re-add to restore."},toast:{added:"Admin added",removed:"Admin removed"}},S_={title:"Native LLM Backends",subtitle:"These backends power the in-process native agent and internal introspection callers (memo extraction, intent classification, notification evaluator, heartbeat). Backend metadata lives in ~/.agim/config.json; API keys live in ~/.agim/llm-secrets.json (0600) or the AGIM_LLM_SECRET_<NAME> env var.",refresh:"Refresh",backendsTitle:"Backends ({{count}})",backendsEmpty:"No LLM backends configured yet. Add one below.",rolesTitle:"Role Bindings (optional, advanced)",rolesOptionalHint:"Native no longer depends on role bindings. It auto-falls back to any usable backend.",addTitle:"Add Backend",col:{name:"Name",provider:"Provider",model:"Model",baseUrl:"Base URL",apiKey:"API Key",actions:"Actions"},secretMissing:"missing",ping:"Ping",remove:"Remove",pinging:"pinging…",setKeyFirst:"set API key first",pingHint:"send a tiny chat probe",removeConfirm:'Remove backend "{{name}}"? Role bindings + API key will be cleared.',removedToast:"Removed (also cleared {{count}} role binding(s)).",roleUpdated:"Updated role {{role}}",unset:"(unset)",unbound:"(unbound)",roleHint:{cheap:"Internal introspection: memo extraction, intent classification, fallback chain stage 1.",evaluator:"Notification evaluator + router-compare judge LLM.","native-chat":"Default for /na loop; if unbound, native auto-falls back to any usable backend."},preset:"Provider preset",name:"Name",namePlaceholder:"e.g. deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"Model",modelPlaceholder:"model-id",apiKeyOptional:"API Key (optional)",apiKeyPlaceholder:"sk-...",addBackend:"Add Backend",invalidPreset:"invalid preset",nameRequired:"name required",baseUrlRequired:"baseUrl required",modelRequired:"model required",addedWithKey:'Added "{{name}}" with API key',addedNoKey:'Added "{{name}}" (set key separately)',presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"Zhipu GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"Custom"}},C_={title:"External MCP Servers",subtitle:"Tools advertised by these servers are exposed to the in-process native agent (via mcp_<server>_<tool> naming). CLI agents have their own MCP configs and ignore this list. Header values may contain bearer tokens — admin-only.",refresh:"Refresh",serversTitle:"Servers ({{count}})",serversEmpty:"No MCP servers configured. Add one below — common picks: filesystem, github, postgres.",totalTools:"total tools: {{count}}",addTitle:"Add Server",col:{name:"Name",transport:"Transport",target:"Target",runtime:"Runtime",actions:"Actions"},transportStdio:"stdio",transportSse:"SSE",transportHttp:"http",runtimeUnknown:"unknown",runtimeConnected:"connected · {{count}} tools",runtimeConnectedOne:"connected · {{count}} tool",runtimeDisconnected:"disconnected",health:"Health",remove:"Remove",probing:"probing…",removeConfirm:'Remove MCP server "{{name}}"?',removedToast:'Removed "{{name}}"',nameRequired:"name required",commandRequired:"command required for stdio transport",urlRequired:"url required for http/sse transport",headersInvalid:"headers must be valid JSON",addedToast:'Added "{{name}}"',nameLabel:"Name",namePlaceholder:"e.g. filesystem",transportLabel:"Transport",transportStdioOption:"stdio (subprocess)",transportHttpOption:"http / SSE",commandLabel:"Command",commandPlaceholder:"e.g. npx",argsLabel:"Args (space-separated)",urlLabel:"URL",urlPlaceholder:"https://example.com/mcp",headersLabel:"Headers (JSON, optional)",headersPlaceholder:'{"Authorization":"Bearer …"}',addServer:"Add Server"},E_={title:"Native Agent · Evaluator · Heartbeat",subtitle:"Behavior knobs for the in-process native agent and the two LLM-driven gates (notification evaluator, heartbeat). LLM backend + role wiring lives on /settings/llm; this page covers what the agent + gates actually do at runtime.",llmLink:"/settings/llm",refresh:"Refresh",unsaved:"unsaved changes",discard:"Discard",save:"Save",savedToast:"Saved.",agentCard:"Native Agent (in-process)",evaluatorCard:"Notification Evaluator",heartbeatCard:"Heartbeat Scheduler",on:"on",off:"off",roleOverride:"Role override",roleHint:"Native prefers this role first; when no role resolves, it auto-falls back to any usable backend. Role bindings are optional.",approvalMode:"Approval mode",approvalHint:"How tool calls from the native loop are gated.",modeReadOnly:"read-only (safe default; built-ins only)",modeAllowList:"allow-list (only autoAllow entries)",modeAllowAll:"allow-all (every tool, no gate)",modeDenyAll:"deny-all (no tools)",autoAllow:"Auto-allow tool prefixes",autoAllowHint:"Comma-separated. Tool names starting with any entry bypass the gate (e.g. native_,mcp_filesystem_).",denyList:"Deny-list tool prefixes",denyListHint:"Comma-separated. Always rejected regardless of mode (e.g. mcp_shell_).",evalDesc:"LLM gate that filters routine / empty agent-initiated push messages. Uses the evaluator role. Fail-open: LLM error or missing backend → message is delivered.",enableGate:"Enable gate",filterViaLlm:"Filter via LLM",evalSources:"Sources to gate",evalSourcesHint:"Comma-separated subset of: push, notify, reminder, heartbeat. Empty = default push,heartbeat.",hbDesc:"Periodic proactive wake-up loop. With this off, /heartbeat bind still works (saves the binding) but no scans run. Three-phase tick: DECIDE → EXECUTE → EVALUATE.",enableScheduler:"Enable scheduler",startScanLoop:"Start scan loop",tickInterval:"Tick interval (ms)",tickHint:"How often the scan loop checks due bindings. Default 60000.",defaultInterval:"Default binding interval (min)",defaultIntervalHint:"Minutes between ticks when a binding didn't specify one. Default 15.",runtimeCard:"Runtime caps (v1.2.126)",runtimeDesc:"Hard caps for native-agent tool calls + retries. All keys hot-reload; no restart needed. Leave blank to use defaults.",toolResultCap:"Max tool-result chars",toolResultCapHint:"IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS. Truncates + appends a note. Default 64000.",toolTimeoutMs:"Per-tool timeout (ms)",toolTimeoutHint:"IMHUB_NATIVE_TOOL_TIMEOUT_MS. Default 60000 (60 s).",blankRetryMax:"Blank-response retries",blankRetryHint:"IMHUB_NATIVE_BLANK_RETRY_MAX. Times to retry when the model returns empty text. Default 1.",lengthRecoveryMax:"Length-truncation continues",lengthRecoveryHint:"IMHUB_NATIVE_LENGTH_RECOVERY_MAX. Times to auto-continue on finishReason=length. Default 1.",a2aCard:"A2A sub-agent spawn (v1.2.127)",a2aDesc:"When the model calls `mcp__imhub__call_agent`, depth + timeout caps apply, and native→native fast-paths in-process. All hot-reload.",a2aMaxDepth:"Max recursion depth",a2aMaxDepthHint:"IMHUB_A2A_MAX_DEPTH. Hard cap on nested call_agent chains. Default 1.",a2aTimeoutMs:"Default timeout (ms)",a2aTimeoutMsHint:"IMHUB_A2A_TIMEOUT_DEFAULT_MS. Default 1800000 (30 min).",callAgentInProcess:"Native→native in-process",callAgentInProcessHint:"IMHUB_NATIVE_CALL_AGENT_IN_PROCESS. Off falls back to the CLI subprocess. Default on.",callAgentMaxPerTurn:"Calls per turn cap",callAgentMaxPerTurnHint:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN. 0 = unlimited. Default 2.",criticCard:"Early stop + critic (v1.2.127)",criticDesc:"Semantic stuck-loop kills 3-strike same-intent across tools. Critic is an opt-in goal-divergence detector.",semanticStuckLoop:"Semantic stuck-loop",semanticStuckLoopHint:"IMHUB_NATIVE_SEMANTIC_STUCK_LOOP. Default on; off disables the v1.2.122 cross-tool dedup.",criticEnabled:"Goal critic",criticEnabledHint:"IMHUB_NATIVE_CRITIC. Off by default; on enables off-track early-stop reviews.",criticRole:"Critic LLM role",criticRoleHint:"IMHUB_NATIVE_CRITIC_ROLE. Optional override (else uses main backend).",planModeDefault:"PlanMode default state",planModeDefaultHint:"IMHUB_NATIVE_PLAN_MODE. Default off; `/plan on` toggles per-thread regardless.",planIntentAuto:"Plan-intent auto-enter (v1.2.135)",planIntentAutoHint:"IMHUB_PLAN_INTENT_AUTO. When on, a prompt containing 先想想 / plan only / don't act yet temporarily enables plan mode for THAT turn only. Never auto-exits — user must /plan off or model must call native_exit_plan_mode.",planIntentPhrases:"Plan-intent phrase list (optional override)",planIntentPhrasesHint:"IMHUB_PLAN_INTENT_PHRASES. Comma-separated. Empty = use built-in CN/EN defaults. Matching is case-insensitive substring.",compactCard:"Auto-compact (v1.2.127)",compactDesc:"Head + summary + tail (OpenHands Condenser). Triggers when total chars > threshold; KEEP_FIRST preserves original goal.",compactTriggerChars:"Trigger chars",compactTriggerCharsHint:"IMHUB_NATIVE_COMPACT_TRIGGER_CHARS. Set 0 to disable. Default 60000.",compactKeepTurns:"Keep last N pairs",compactKeepTurnsHint:"IMHUB_NATIVE_COMPACT_KEEP_TURNS. Tail size in user/assistant turns. Default 6.",compactKeepFirst:"Keep first N user msgs",compactKeepFirstHint:"IMHUB_NATIVE_COMPACT_KEEP_FIRST. Head preserves original user goal(s). Default 1.",compactSummaryChars:"Summary char cap",compactSummaryCharsHint:"IMHUB_NATIVE_COMPACT_SUMMARY_CHARS. Cap on the LLM-generated summary. Default 1500.",streamCard:"Streaming + iteration (v1.2.127)",streamDesc:"Streaming preserves partial text on IM's 30-min hard timeout. Max-iter is the worst-case tool-call ceiling.",streamPartial:"Stream partial",streamPartialHint:"IMHUB_NATIVE_STREAM_PARTIAL. Default on; off uses legacy non-stream path.",maxIter:"Max iterations",maxIterHint:"IMHUB_NATIVE_AGENT_MAX_ITER. Clamped to [1,100]. Default 50 (v1.2.136; bumped from 20)."},A_={title:"Web search providers",subtitle:"Backend chain for the native_web_search tool. Falls through to the next provider on error. Clear a key to remove it; type to overwrite. All changes hot-reload.",refresh:"Refresh",save:"Save",discard:"Discard",unsaved:"Unsaved changes",savedToast:"Saved. Next search will use the new chain.",chainLabel:"Active chain:",chainEmpty:"no providers available",chainHint:"Resolved from IMHUB_WEB_SEARCH_PROVIDERS; only entries whose available() is true appear.",configured:"configured",missingKey:"missing key",noKey:"no key needed",moveUp:"Move up",moveDown:"Move down",testBtn:"Test",clearKey:"Clear",placeholderConfigured:"Saved (hidden) — leave blank to keep",placeholderEnter:"Enter new key",keyHint:"On Save, value is written to ~/.agim/env under {{envKey}}.",testOk:"{{provider}} ✓ {{hits}} hits / {{ms}} ms",testFail:"{{provider}} ✗ {{error}}"},R_={title:"Mobile sign-in QR",subtitle:"Generate a single QR code an operator can scan with a phone to open /m/chat. The scanned URL carries a fresh role=user token; on first scan the phone gets an auth cookie and lands inside the mobile chat.",generateCard:"Generate QR",generateDesc:"Each click mints a NEW token (the previous QR keeps working until you revoke it). Operators with phones already signed in are not affected.",hostLabel:"Override host (optional)",hostPlaceholder:"leave blank to auto-detect",hostHint:"By default the URL uses the same hostname:port this admin tab opened on. Override if your phone reaches agim via a different domain (e.g. cloudflared tunnel).",generate:"Generate QR",regenerate:"Regenerate",generating:"Generating…",generatedToast:"QR generated. Scan within sight of the screen.",scanCard:"Scan from your phone",scanDesc:"Open the phone camera, point it at the QR. The phone will sign in once and stay signed in until the token is revoked.",tokenLabel:"Label",urlLabel:"Embedded URL",urlHint:"Anyone with this URL can sign in as the user role. Keep it private; treat it like a password.",tokenIdLabel:"Token id",tokenIdHint:"Use this to find the token in the security page when you want to revoke it.",warningTitle:"Treat the QR like a password.",warningBody:"Scanned tokens persist until revoked. If a phone is lost, revoke the matching mobile-via-qr-* token in Security.",revokeLink:"Manage / revoke tokens →",copied:"URL copied",copyFailed:"Copy failed; long-press the URL field instead.",showUrl:"Show URL",hideUrl:"Hide URL",copyUrl:"Copy URL",qrAlt:"QR code for mobile chat sign-in"},T_={title:"System Prompt Skill Injection",subtitle:"Tune the tier-1 skill block injected into every system prompt. When the override file is non-empty, it REPLACES the auto-generated block (the routing header and always-on skill bodies are preserved).",autoLabel:"Auto-generated (read-only preview)",overrideLabel:"Operator override (saved on Save)",overridePlaceholder:"Leave empty to use auto. Common pattern: copy auto above, prune families you don't need, or prepend routing hints at the top.",overrideActive:"Override active",overrideInactive:"Auto-generated",largeWarn:"Large block — watch your token budget",copyToOverride:"Copy to override",save:"Save",clear:"Clear override",savedToast:"Saved. Next turn picks it up.",clearedToast:"Override cleared. Back to auto.",refreshedToast:"Auto preview refreshed.",rebuild:"Rebuild auto block",rebuildTooltip:"Rescan all SKILL.md on disk and regenerate the auto-generated block above (override below is unaffected).",rebuiltToast:"Rescanned and rebuilt the auto-generated block. Picks up next turn.",overLimitToast:"Body is {{len}} chars, over the {{max}} limit",confirmClear:"Delete the override file and revert to auto-generated?",hint:"No restart needed; the next system-prompt build reads the latest content."},P_={title:"agim Skills",tab:{installed:"Installed",hot:"skillhub Hot",injection:"Prompt Injection"},group:{framework:"Framework (agim-*)",builtin:"Agim builtin (non-ECC)",workspace:"Workspace (operator-installed)",eccPicks:"ECC recommended picks",eccRemainder:"ECC remainder"},searchPlaceholder:"Filter skills by name or description...",searchEmpty:"No matching skills.",reload:"Reload from disk",subtitle:"SKILL.md files loaded by src/core/skills/loader.ts. Tier-1 summary (name + description) is auto-injected into every agent system prompt; full body is read on-demand via mcp__imhub__read_skill. Workspace skills shadow bundled builtin skills by name.",reloadedToast:"Reloaded — {{count}} skill(s) on disk",selectHint:"Select a skill on the left, or click New to create one.",emptyList:"No skills loaded. Click New to create one (lands at ~/.agim/skills/<name>/SKILL.md).",unavailable:"unavailable",alwaysOn:"always-on",sourceWs:"ws",sourceBuiltin:"builtin",notFound:"Not found.",sourceWorkspace:"workspace",sourceBuiltinReadonly:"builtin (read-only via UI)",builtinShadowHint:"Builtin shown for reference. Save creates a workspace shadow that overrides it.",delete:"Delete",save:"Save",saveShadow:"Save (create workspace shadow)",savedToast:'Saved "{{name}}"',deleteConfirm:'Delete workspace skill "{{name}}"? The builtin (if any) will become visible again.',deletedToast:'Deleted "{{name}}"',new:"New",newTitle:"New skill",newName:"Skill name",newNamePlaceholder:"my-skill",newCreate:"Create",createdToast:'Created "{{name}}"',nameRequired:"name required",pathLabel:"Workspace path:",binsLabel:"Required bins:",envLabel:"Required env:",none:"none"},I_={pageTitle:d_,subtitle:f_,tabs:h_,agents:p_,policy:m_,messengers:g_,email:y_,viewerSettings:v_,workspaces:b_,service:x_,security:w_,admins:k_,llm:S_,mcp:C_,nativeAgent:E_,search:A_,mobile:R_,skillInjection:T_,agimSkills:P_},L_="设置",O_="运维配置:环境变量与服务生命周期。",N_={messengers:"IM 平台",email:"邮件 (SMTP)",viewer:"Viewer & 地图",agents:"Agent",llm:"LLM 后端",mcp:"MCP 服务器",nativeAgent:"Native Agent",search:"Web 搜索",mobile:"手机端",agimSkills:"agim Skills",policy:"策略",security:"安全",workspaces:"工作区",admins:"管理员",env:"环境变量",service:"服务"},__={title:"Agent",subtitle:"内置 Agent 适配器。启用宿主机已安装 CLI 的;并选择一个作为默认 Agent(用于路由无法判定的消息)。`native` 是内置 in-process 智能体,无需安装。",installHint:"未安装。在宿主机执行 `npm install -g {{pkg}}`。",nativeInstallHint:"未配置 LLM 后端。前往 设置 → Native Agent 选项卡,配置 OpenAI / DeepSeek / Anthropic 等任一即可使用。",inProcessBadge:"内置",inProcessHint:"in-process — 跑在 agim 进程内,无需安装外部 CLI",aliasesLabel:"别名",online:"在线",offline:"未就绪",defaultAgent:"默认 Agent",defaultAgentHint:"意图分类无判定时使用(新建 web 线程等)。下拉只列出已启用且在线的 Agent。",noEligible:"无可选默认",saveBtn:"保存",saving:"保存中…",dirtyHint:"有未保存改动",discard:"放弃改动",toast:{saved:"已保存"},acp:{title:"远程 Agent (ACP)",subtitle:"通过 Agent Communication Protocol 接入的 HTTP Agent。每个条目持久化到 config,下次服务重启时注册。",discoverBtn:"批量发现",runDiscover:"探测",baseUrl:"发现地址",baseUrlHint:"探测 `<base>/.well-known/acp` 并追加返回的 Agent;同名条目自动跳过。",addTitle:"新增 Agent",name:"名称",nameHint:"稳定标识;只允许 字母 数字 `._-`。",aliases:"别名",aliasesHint:"逗号分隔;在 IM 内通过 `/alias` 路由。",endpoint:"Endpoint",endpointHint:"Agent 的 ACP 根路径(不带尾部 `/`)。",authType:"鉴权",auth:{none:"无",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"粘贴 token",testBtn:"测试",addBtn:"新增",removeBtn:"移除",on:"已启用",off:"已停用",dupName:"已存在同名 Agent。",empty:{title:"暂无远程 Agent",description:"下方填写 ACP endpoint 新增,或使用「批量发现」自动从 `.well-known/acp` 导入。"},toast:{staged:"已暂存,点击「保存」生效。",testOk:"已联通 `{{name}}`",testMasked:"Token 是掩码态,请先保存后再测试。",discoverEmpty:"没有可新增的 Agent。",discoverAdded_one:"已新增 {{count}} 个 Agent。",discoverAdded_other:"已新增 {{count}} 个 Agent。"}}},D_={title:"策略与开关",subtitle:"高频切换的开关,底层操作的是 env 值。每个开关变更后立即持久化;多数模块支持热加载,少数需要等下次服务重启。",savingToast:"已保存",safety:{title:"跳过权限确认(危险)",description:"打开后,Claude Code 适配器会向 CLI 传递 `--dangerously-skip-permissions`,跳过所有工具调用确认。生产环境强烈建议保持关闭;仅在隔离的可信工作区内启用。",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"生产部署建议保持关闭"},approval:{title:"审批超时默认行为",description:'当 pending 的工具调用无人响应而超时时审批 bus 的行为。`拒绝` 是安全默认值,会让 Bash / Edit / Write 等写入调用保持阻断;`放行` 是"用户离开"模式,让 Agent 继续运行。',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"超时拒绝",valAllow:"超时放行"},memory:{title:"长期记忆",description:"每用户记忆子系统(事实 + persona + 向量检索)的总开关。关闭后停止抽取新事实和 persona 整理;已有数据保留在磁盘。",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"长消息查看器",description:"打开后,超过阈值的 IM 回复会被上传到本地 paste 存储,IM 消息变成一个可点击的短链。关闭则消息会被 IM 平台截断。",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A 通知模式",description:"Agent 间互相调用时 bus 的提示详细程度。`essential`(默认)仅发关键事件;`verbose` 包含每次状态切换;`off` 完全静默跨 Agent 通知。",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"关键事件",valVerbose:"详细",valOff:"关闭"}},M_={title:"IM 平台",subtitle:"各 IM 平台的连接配置。打开开关、填写凭据、保存;下次服务重启即生效。",saveAll:"全部保存",saving:"保存中…",savedToast:"配置已保存",discardAll:"放弃改动",dirtyHint:"有未保存的改动",platform:{wechat:"微信",telegram:"Telegram",feishu:"飞书",dingtalk:"钉钉",discord:"Discord"},hint:{wechat:'基于 iLink 的扫码登录。点击 "扫码登录",用手机微信扫码并在弹窗中确认;机器人以该微信账号登录。',telegram:"@BotFather 申请的 Bot Token;Channel ID 可选,仅用于定向到特定群组。",feishu:"飞书开放平台的应用凭据。应用需开启消息权限。",dingtalk:"钉钉开发者后台的 Stream API 客户端凭据。",discord:"Discord 开发者门户的 Bot Token。需将机器人邀请到目标频道。"},enabled:"已启用",disabled:"未启用",scanQr:"扫码登录",fields:{botToken:"Bot Token",appId:"App ID",appSecret:"App Secret",clientId:"Client ID",clientSecret:"Client Secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"私聊访问策略",groupPolicy:"群聊访问策略",allowFrom:"私聊白名单(staffId,英文逗号分隔)",groupAllowFrom:"群聊白名单(staffId,英文逗号分隔)",ackReaction:"ack 反馈方式",policy:{open:"open — 任何人都能对话",pairing:"pairing — 第一个私聊的人锁定为唯一对端",allowlist:"allowlist — 只允许名单中的 ID",disabled:"disabled — 机器人完全忽略群聊"},ack:{off:"off — 不发标记",emoji:"emoji ⏳→✅",kaomoji:"kaomoji(纯文本颜文字)"},accountsTitle:"多账号 / 多机器人",accountDisabled:"已禁用",accountsHint:"每个 entry 启动独立的 DWClient,dmPolicy / allowFrom / ack-reaction 全部隔离。保存后请重启 agim 让新账号生效。",accountsEmpty:"还没有额外账号。点「+ 添加账号」接入另一个钉钉机器人。",addAccount:"添加账号",accountName:"显示名(可选)",accountRenameCollision:'已存在 id 为 "{{id}}" 的账号;请换一个 id。'},qr:{title:"扫码登录微信",description:"打开手机微信扫一扫这个二维码,然后在微信内确认登录。",starting:"正在启动 QR 会话…",loadFailed:"QR 启动失败",expired:"二维码已过期 — 关闭并重新发起。",cancelled:"已取消。",confirmed:"登录成功 — wechat-ilink 将在下次服务重启后启用。"}},j_={title:"邮件 (SMTP)",subtitle:"用于 `/remind email me@x.com …` 的对外邮件投递。凭据保存在 `~/.agim/.env`,留空即停用。",cardTitle:"SMTP 凭据",statusOn:"已配置",statusOff:"未配置",host:"Host",hostHint:"邮件服务器域名(如 `smtp.gmail.com`)。",port:"Port",portHint:"通常 465 (SSL) 或 587 (STARTTLS)。",user:"用户名",userHint:"登录邮箱;通常也是发件人地址。",pass:"密码 / 应用 Token",passHint:"保存到 `~/.agim/.env`(chmod 600)。默认遮罩,按「显示」可查看。",from:"发件人",fromHint:"发件 header;为空则使用用户名。",secure:"TLS 模式",secureHint:"`auto` 按端口判定;如运营商要求可强制 SSL 或 STARTTLS。",secureAuto:"auto(按端口)",secureTrue:"true(SSL,对应 465)",secureFalse:"false(STARTTLS,对应 587)",reveal:"显示",hide:"隐藏",testBtn:"测试连接",testNeedsConfigured:"请先保存 host / user / password。",disableBtn:"停用 SMTP",saveBtn:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"SMTP 已保存",disabled:"SMTP 已停用",noChanges:"无可保存的改动"}},F_={title:"Viewer & 地图",subtitle:"公开访问的两个外设:长消息 Viewer(超过阈值的回复转成 `/v/<id>` 短链)+ Baidu Maps AK(驱动 `/memo` 地址解析)。",reveal:"显示",hide:"隐藏",save:"保存",saving:"保存中…",discard:"放弃改动",dirtyHint:"有未保存改动",toast:{saved:"Viewer 设置已保存"},viewer:{title:"Viewer(长消息短链)",subtitle:"超过字符 / 行数阈值的回复会被上传到本地 paste 存储,IM 消息变成一条 `/v/<id>` 短链。",on:"已启用",off:"未启用",enableLabel:"启用长消息 Viewer",publicUrl:"公开基础 URL",publicUrlHint:"反代 / 隧道暴露给外网的地址。用于拼接 `/v/<id>` 短链。",remotePasteUrl:"远端 paste URL",remotePasteUrlHint:"POST markdown 到这个地址换公网链接;优先级高于 Public base URL 和 quick 隧道。留空使用社区默认 https://viewer.iclaw.host/paste。",remotePasteToken:"远端 paste Bearer Token",remotePasteTokenHint:"可选;只在你的 paste 服务要求鉴权时需要填。",noDefaultRemote:"禁用社区默认",noDefaultRemoteLabel:"未配置任何模式时不回退到 viewer.iclaw.host",noDefaultRemoteHint:"v1.2.43+:未配置任何模式时,agim 默认走 remote 模式上传到 viewer.iclaw.host。勾选此项可关闭该回退(这时长内容会直接 inline)。",tunnelMode:"隧道模式",tunnelOff:"关闭(使用上方公开 URL)",tunnelQuick:"quick(cloudflared 临时隧道)",tunnelHint:"`quick` 会本地拉起 Cloudflare quick tunnel;当运营商自己没有反代 agim 时启用。",tunnelStatus:"隧道状态",refreshTunnel:"刷新",tunnelRunning:"运行中",yes:"是",no:"否",tunnelUrl:"实时 URL",effectiveUrl:"生效 URL",binary:"cloudflared 二进制",binaryMissing:"PATH 中未找到 — 请从 cloudflare/cloudflared releases 安装",lastError:"最近一次错误",tunnelLoading:"正在加载隧道状态…",thresholds:"路由阈值",chars:"字符上限",charsHint:"回复超过此长度走 Viewer。",lines:"行数上限",linesHint:"相同的路由判定,按行数。",codeLines:"代码行数上限",codeLinesHint:"代码块内回复的更低阈值。",maxPastes:"Paste 存储上限",maxPastesHint:"超过此数量后按 FIFO 淘汰旧 paste。"},baidu:{title:"Baidu Maps AK",subtitle:"启用 `/memo` 的地址→坐标解析。不配置 AK,/memo 仍可通过裸坐标或浏览器 GPS 分享工作。免费 AK:lbsyun.baidu.com → 控制台 → 应用管理 → 创建应用 → 服务端 API。",configured:"已配置",empty:"未配置",placeholder:"32 位 AK,首字符非数字",hint:"保存到 `~/.agim/.env`(chmod 600),默认遮罩,按「显示」可查看。",suspicious:"AK 长度为 {{length}},通常 Baidu AK 是 32 位 — 请核对。",clear:"清除 AK",toast:{saved:"Baidu Maps AK 已保存",cleared:"Baidu Maps AK 已清除"}}},U_={title:"工作区",subtitle:"多租户工作区注册表。每个工作区有独立的 Agent 白名单、限流配置以及(可选的)成员名单。`default` 工作区承接所有未匹配的用户。",empty:{title:"只有默认工作区",description:"在下方添加工作区,可按团队 / 项目 / 客户分隔。每个工作区有独立的 Agent 白名单与限流。"},col:{id:"ID",name:"名称",agents:"Agent 白名单",members:"成员",rateLimit:"限流"},rateLimitFormat:"{{rate}} / {{intervalSec}}s,突发 {{burst}}",membersOpen:"开放(任何用户)",membersCount_one:"{{count}} 位成员",membersCount_other:"{{count}} 位成员",edit:"编辑",form:{title:"新增或编辑工作区",subtitleEdit:"编辑已有工作区 — 改 ID 可克隆,保持原 ID 即 upsert。",id:"ID",idHint:"稳定标识符;只允许 [a-zA-Z0-9_-]+;`default` 为保留名。",name:"显示名",agents:"Agent 白名单",agentsHint:"逗号分隔;为空 = 允许所有已注册 Agent。",members:"成员用户 ID",membersHint:"逗号分隔,形如 `platform:userId`;为空 = 开放工作区。",rateLimit:"限流(可选)",rate:"调用数",intervalSec:"周期(秒)",burst:"突发上限",submit:"保存工作区",reset:"清空表单"},toast:{saved:"工作区已保存"}},H_={title:"服务",subtitle:"查看运行中的 agim 进程,并启动 / 停止 / 重启它。",modeLabel:"运行模式",pidLabel:"PID",uptimeLabel:"运行时长",webLabel:"Web 端口",bootPhaseLabel:"启动阶段",mode:{systemd:"systemd",background:"后台",foreground:"前台",none:"未运行"},actions:{start:"启动",stop:"停止",restart:"重启",confirmStop:"停止 agim 服务?",confirmStopDesc:"Web 控制台、消息适配器、所有正在进行的作业都会停止。需要重新启动后才能继续使用。",confirmRestart:"重启 agim 服务?",confirmRestartDesc:"进程会先停止再启动。进行中的作业会被取消;投递队列与已排队的提醒会保留。重启期间 Web 控制台不可达,通常 5-30 秒。"},toast:{started:"服务已启动",stopped:"服务已停止",restarted:"服务已重启"},ports:{title:"端口",subtitle:"agim 启动时监听的端口。留空使用默认值;改动需下次服务重启生效(保存后点下方「重启」按钮)。",webPort:"Web 端口",webPortHint:"聊天 UI + REST API 的 HTTP 服务端口。默认 {{default}}。",acpPort:"ACP 端口",acpPortHint:"Agent Communication Protocol 服务端口(远程 Agent 接入面)。默认 {{default}}。",invalidPort:"需为 1-65535 之间的数字。",restartRequired:"需重启生效",save:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"端口已保存 — 重启 agim 以绑定新端口"}}},B_={title:"安全",subtitle:"工具沙盒、SSRF 拦截、发送方门禁、运行时审计。改动立即写入 env 文件;多数 native 工具读 process.env,下次工具调用即生效;exec 沙盒和发送方门禁需要「重启服务」生效。",diagnostics:{title:"运行时诊断",runningAsRoot:"以 root 运行",runningAsRootHelp:"tool 调用会拿到 root 权限。建议在 systemd unit 设 User=agim 后重启。",envFilePerms:"env 文件权限",envFilePermsLax:"过宽(group/world 可读)",envFilePermsOk:"0600(仅 owner 可读写)",bwrapAvailable:"bubblewrap 已装",bwrapMissing:"未装(apt install bubblewrap)",senderAllowlist:"发送方门禁",senderAllowlistOff:"未配置(开放访问)",senderAllowlistOn:"已配置",adminAllowlist:"管理员清单",adminAllowlistOff:"未配置(首次 setup 后填充)",adminAllowlistOn:"已配置"},sender:{title:"发送方门禁 (谁能跟 bot 说话)",description:"允许列表,逗号分隔 platform:userId 对,例如 telegram:8754479311,wechat-ilink:wxid_abc。设为 * 显式表示「所有人都允许」。空值 = 开放访问(保持向后兼容;启动日志 OPEN_IM_ACCESS)。",envKey:"IMHUB_ALLOWED_USERS",placeholder:"platform:userId,platform:userId"},exec:{title:"Native exec 工具",description:"对 native_exec 的沙盒与超时控制。每次 exec 调用还会经 IM 审批卡(除非已 autoallow 同 fingerprint)。",sandbox:"沙盒后端",sandboxNone:"无(直接 spawn)",sandboxBwrap:"bubblewrap(Linux only)",sandboxBwrapMissing:"bubblewrap 未装",sandboxNet:"沙盒内网络",sandboxNetOn:"允许(默认)",sandboxNetOff:"禁用(--unshare-net)",timeoutMs:"命令超时(毫秒,默认 60000)",maxOutput:"单流输出上限(字节,默认 32768)"},web:{title:"Native web 工具",description:"SSRF 防护与超时。CIDR 白名单可放行 Tailscale/100.64.0.0/10 这类私网。",allowPrivate:"允许所有私网(不推荐)",allowPrivateHelp:"= 1 时跳过所有私网检查。仅用于受信任的内网部署。",ssrfWhitelist:"SSRF CIDR 白名单",ssrfWhitelistPlaceholder:"100.64.0.0/10,10.20.0.0/16",timeoutMs:"fetch / search 超时(毫秒,默认 30000)"},fs:{title:"Native filesystem 工具",description:"fs 工具默认限制在 native 当前线程的 workspace 子树内。",restrict:"限制到 workspace",restrictOn:"ON(推荐)",restrictOff:"OFF(允许任意路径;sensitive-paths 黑名单仍生效)",timeoutMs:"fs 工具超时(毫秒,默认 60000)"},delegation:{title:"Native call_agent 上限",description:"一次对话内 mcp__imhub__call_agent 允许的最多次数。防止 native 死循环委托给 CLI agent。0 = 无限。",envKey:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN",valueLabel:"默认 2"},platformBlacklist:{title:"IM 平台黑名单",description:"逗号分隔的 IM 平台 id,列入后:CLI 向导不显示、web 后台不出现、注册时被直接拒绝。即使凭证仍在 env 文件里,进程也不会拉起这个适配器。默认空(不拦截)。常见 id:wechat-ilink / telegram / feishu / dingtalk / discord / email。",envKey:"IMHUB_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"当前生效"},diagnosticsPlatformBlacklist:"IM 平台黑名单",savingToast:"已保存。",resetTitle:"清空 (使用默认值)"},z_={title:"IM 管理员名单",subtitle:"Web 管理员 token 是唯一授权源。IM 候选用户会在与 agim 对话后自动出现在这里,可直接授予管理员。",configured:"名单已配置",notConfigured:"尚未配置任何 IM 管理员。",empty:"暂无管理员。",col:{platform:"平台",userId:"用户 ID"},known:{title:"已感知 IM 用户",hint:"用户给 agim 发过消息后会自动出现在此列表,可直接设为管理员。",count:"已感知用户:{{count}}",empty:"暂无已感知 IM 用户。",emptyHint:"请先让该用户给 agim 发送一条消息。",col:{lastSeen:"最近出现时间"},promote:"设为管理员",alreadyAdmin:"已是管理员"},remove:{label:"移除",confirmTitle:"确认移除该管理员?",confirmDescription:"该用户将失去所有管理员命令访问权限。可再次添加恢复。"},toast:{added:"已添加",removed:"已移除"}},$_={title:"Native LLM 后端",subtitle:"这些后端为进程内 native agent 及内部 introspection 调用方(记忆提取、意图分类、通知评估器、心跳)提供能力。后端元数据保存在 ~/.agim/config.json;API Key 保存在 ~/.agim/llm-secrets.json(0600)或 AGIM_LLM_SECRET_<NAME> 环境变量。",refresh:"刷新",backendsTitle:"后端 ({{count}})",backendsEmpty:"尚未配置 LLM 后端。请在下方添加。",rolesTitle:"角色绑定(可选,高级)",rolesOptionalHint:"不配置角色绑定也不会阻塞 native 使用;系统会自动回退到可用 backend。",addTitle:"添加后端",col:{name:"名称",provider:"提供商",model:"模型",baseUrl:"Base URL",apiKey:"API Key",actions:"操作"},secretMissing:"缺失",ping:"探测",remove:"删除",pinging:"探测中…",setKeyFirst:"请先设置 API Key",pingHint:"发送一次小型 chat 探测",removeConfirm:'删除后端 "{{name}}"?角色绑定与 API Key 将被清除。',removedToast:"已删除(同时清除 {{count}} 个角色绑定)。",roleUpdated:"已更新角色 {{role}}",unset:"(未设置)",unbound:"(未绑定)",roleHint:{cheap:"内部 introspection:记忆提取、意图分类、回退链第一阶段。",evaluator:"通知评估器 + router-compare 裁判 LLM。","native-chat":"/na agent 循环默认角色;不绑定时会自动回退到任意可用 backend。"},preset:"提供商预设",name:"名称",namePlaceholder:"如 deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"模型",modelPlaceholder:"model-id",apiKeyOptional:"API Key(可选)",apiKeyPlaceholder:"sk-...",addBackend:"添加后端",invalidPreset:"无效预设",nameRequired:"名称必填",baseUrlRequired:"baseUrl 必填",modelRequired:"model 必填",addedWithKey:'已添加 "{{name}}"(含 API Key)',addedNoKey:'已添加 "{{name}}"(请单独设置 Key)',presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"智谱 GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"自定义"}},V_={title:"外部 MCP 服务器",subtitle:"这些服务器提供的工具会暴露给进程内 native agent(命名规则 mcp_<server>_<tool>)。CLI agent 使用各自的 MCP 配置,不会读取此列表。Header 可能包含 Bearer Token — 仅管理员可见。",refresh:"刷新",serversTitle:"服务器 ({{count}})",serversEmpty:"尚未配置 MCP 服务器。请在下方添加 — 常见选择:filesystem、github、postgres。",totalTools:"工具总数:{{count}}",addTitle:"添加服务器",col:{name:"名称",transport:"传输",target:"目标",runtime:"运行时",actions:"操作"},transportStdio:"stdio",transportSse:"SSE",transportHttp:"http",runtimeUnknown:"未知",runtimeConnected:"已连接 · {{count}} 个工具",runtimeConnectedOne:"已连接 · {{count}} 个工具",runtimeDisconnected:"未连接",health:"健康检查",remove:"删除",probing:"探测中…",removeConfirm:'删除 MCP 服务器 "{{name}}"?',removedToast:'已删除 "{{name}}"',nameRequired:"名称必填",commandRequired:"stdio 传输需要 command",urlRequired:"http/sse 传输需要 url",headersInvalid:"headers 必须是合法 JSON",addedToast:'已添加 "{{name}}"',nameLabel:"名称",namePlaceholder:"如 filesystem",transportLabel:"传输",transportStdioOption:"stdio(子进程)",transportHttpOption:"http / SSE",commandLabel:"命令",commandPlaceholder:"如 npx",argsLabel:"参数(空格分隔)",urlLabel:"URL",urlPlaceholder:"https://example.com/mcp",headersLabel:"Headers(JSON,可选)",headersPlaceholder:'{"Authorization":"Bearer …"}',addServer:"添加服务器"},K_={title:"Native Agent · 评估器 · 心跳",subtitle:"进程内 native agent 及两个 LLM 驱动门控(通知评估器、心跳)的运行时行为。LLM 后端与角色绑定在 /settings/llm;本页配置 agent 与门控的实际行为。",llmLink:"/settings/llm",refresh:"刷新",unsaved:"有未保存改动",discard:"放弃",save:"保存",savedToast:"已保存。",agentCard:"Native Agent(进程内)",evaluatorCard:"通知评估器",heartbeatCard:"心跳调度器",on:"开",off:"关",roleOverride:"角色覆盖",roleHint:"native 循环优先解析此角色;若未命中,会自动回退到任意可用 backend。角色绑定为可选增强项。",approvalMode:"审批模式",approvalHint:"native 循环中工具调用的门控方式。",modeReadOnly:"read-only(安全默认;仅内置工具)",modeAllowList:"allow-list(仅 autoAllow 条目)",modeAllowAll:"allow-all(所有工具,无门控)",modeDenyAll:"deny-all(禁止工具)",autoAllow:"自动允许工具前缀",autoAllowHint:"逗号分隔。名称以任一前缀开头的工具绕过门控(如 native_,mcp_filesystem_)。",denyList:"拒绝列表工具前缀",denyListHint:"逗号分隔。无论模式如何始终拒绝(如 mcp_shell_)。",evalDesc:"过滤例行/空的 agent 主动推送消息的 LLM 门控。使用 evaluator 角色。失败开放:LLM 错误或缺少后端 → 仍投递消息。",enableGate:"启用门控",filterViaLlm:"通过 LLM 过滤",evalSources:"门控来源",evalSourcesHint:"逗号分隔子集:push, notify, reminder, heartbeat。留空 = 默认 push,heartbeat。",hbDesc:"周期性主动唤醒循环。关闭后 /heartbeat bind 仍可保存绑定,但不执行扫描。三阶段 tick:DECIDE → EXECUTE → EVALUATE。",enableScheduler:"启用调度器",startScanLoop:"启动扫描循环",tickInterval:"Tick 间隔(毫秒)",tickHint:"扫描循环检查到期绑定的频率。默认 60000。",defaultInterval:"默认绑定间隔(分钟)",defaultIntervalHint:"绑定未指定时的 tick 间隔。默认 15。",runtimeCard:"运行参数(v1.2.126)",runtimeDesc:"Native agent 工具调用与重试的硬上限。所有键热生效,无需重启服务。留空使用默认值。",toolResultCap:"单次工具返回最大字符",toolResultCapHint:"IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS。超出截断+附说明。默认 64000。",toolTimeoutMs:"单次工具超时(毫秒)",toolTimeoutHint:"IMHUB_NATIVE_TOOL_TIMEOUT_MS。默认 60000(60 秒)。",blankRetryMax:"空响应重试上限",blankRetryHint:"IMHUB_NATIVE_BLANK_RETRY_MAX。模型连续返回空文本时的重试次数。默认 1。",lengthRecoveryMax:"长度截断续写上限",lengthRecoveryHint:"IMHUB_NATIVE_LENGTH_RECOVERY_MAX。finishReason=length 时自动续写次数。默认 1。",a2aCard:"A2A 子 Agent 派生(v1.2.127)",a2aDesc:"模型调用 `mcp__imhub__call_agent` 时的深度 / 超时 / 同进程 / 单轮上限。native→native 默认走同进程快路径。所有键热生效。",a2aMaxDepth:"递归深度上限",a2aMaxDepthHint:"IMHUB_A2A_MAX_DEPTH。call_agent 嵌套调用最大层数。默认 1。",a2aTimeoutMs:"默认超时(毫秒)",a2aTimeoutMsHint:"IMHUB_A2A_TIMEOUT_DEFAULT_MS。默认 1800000(30 分钟)。",callAgentInProcess:"native→native 同进程",callAgentInProcessHint:"IMHUB_NATIVE_CALL_AGENT_IN_PROCESS。关闭则回退到子进程 CLI。默认开。",callAgentMaxPerTurn:"单轮调用上限",callAgentMaxPerTurnHint:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN。0 = 不限。默认 2。",criticCard:"早停 + 复盘(v1.2.127)",criticDesc:"语义死循环检测识别「3 次同意图但工具不同」的情形并早停。Critic 是可选的目标偏离检测器。",semanticStuckLoop:"语义死循环检测",semanticStuckLoopHint:"IMHUB_NATIVE_SEMANTIC_STUCK_LOOP。默认开;关闭即关掉 v1.2.122 的跨工具去重。",criticEnabled:"Goal Critic 复盘",criticEnabledHint:"IMHUB_NATIVE_CRITIC。默认关;开启后启用目标偏离早停。",criticRole:"Critic LLM role",criticRoleHint:"IMHUB_NATIVE_CRITIC_ROLE。可选 override(留空走主后端)。",planModeDefault:"PlanMode 默认状态",planModeDefaultHint:"IMHUB_NATIVE_PLAN_MODE。默认关;`/plan on` 在单线程内可独立切换不受此影响。",planIntentAuto:"Plan 意图自动入场(v1.2.135)",planIntentAutoHint:"IMHUB_PLAN_INTENT_AUTO。开启后,含「先想想 / plan only / 不要直接做」等关键词的 prompt 会临时进入 plan 模式,仅本轮生效;从不自动退出——必须 /plan off 或模型调 native_exit_plan_mode。",planIntentPhrases:"意图关键词列表(可选覆盖)",planIntentPhrasesHint:"IMHUB_PLAN_INTENT_PHRASES。逗号分隔。留空则用内置中英文默认列表。匹配方式:大小写不敏感的子串。",compactCard:"Auto-compact 自动摘要(v1.2.127)",compactDesc:"Head + summary + tail(OpenHands Condenser)。总字符数超过阈值时触发;KEEP_FIRST 保留原始 user goal。",compactTriggerChars:"触发字符数",compactTriggerCharsHint:"IMHUB_NATIVE_COMPACT_TRIGGER_CHARS。设为 0 禁用。默认 60000。",compactKeepTurns:"保留最后 N 对",compactKeepTurnsHint:"IMHUB_NATIVE_COMPACT_KEEP_TURNS。tail 保留的 user/assistant 对数。默认 6。",compactKeepFirst:"保留前 N 条 user 消息",compactKeepFirstHint:"IMHUB_NATIVE_COMPACT_KEEP_FIRST。head 保留原始 user 目标。默认 1。",compactSummaryChars:"摘要字符上限",compactSummaryCharsHint:"IMHUB_NATIVE_COMPACT_SUMMARY_CHARS。LLM 生成摘要的字符上限。默认 1500。",streamCard:"流式 + 迭代(v1.2.127)",streamDesc:"流式回传可在 IM 30 分钟硬超时时保留部分文本。max-iter 是工具循环的最坏上限。",streamPartial:"流式增量回写",streamPartialHint:"IMHUB_NATIVE_STREAM_PARTIAL。默认开;关闭走旧的非流式路径。",maxIter:"迭代上限",maxIterHint:"IMHUB_NATIVE_AGENT_MAX_ITER。范围 [1,100]。默认 50(v1.2.136 起,原为 20)。"},W_={title:"Web 搜索 Provider",subtitle:"native_web_search 工具的后端链路。失败时按顺序回退到下一家。键留空 = 删除该值;填则覆盖。所有修改热生效。",refresh:"刷新",save:"保存",discard:"放弃",unsaved:"有未保存改动",savedToast:"已保存。下一次搜索即生效。",chainLabel:"当前生效链路:",chainEmpty:"无可用 provider",chainHint:"由 IMHUB_WEB_SEARCH_PROVIDERS 决定;只列出已启用且 available() 为真的项。",configured:"已配置",missingKey:"缺 API key",noKey:"无需 key",moveUp:"上移",moveDown:"下移",testBtn:"测试",clearKey:"清空",placeholderConfigured:"已保存(隐藏) — 不输入则保留",placeholderEnter:"输入新 key",keyHint:"提交后将以密文写入 ~/.agim/env 的 {{envKey}} 键。",testOk:"{{provider}} ✓ {{hits}} 条结果 / {{ms}} ms",testFail:"{{provider}} ✗ {{error}}"},q_={title:"手机端登录二维码",subtitle:"生成一张二维码,让操作员用手机扫码即可打开 /m/chat。链接里带一次性 role=user token,首次扫码后手机会拿到 cookie 并跳转到手机版聊天界面。",generateCard:"生成二维码",generateDesc:"每次点击会新建 token(旧二维码在被吊销前仍然可用)。已登录的手机不受影响。",hostLabel:"覆盖访问域名(可选)",hostPlaceholder:"留空自动识别",hostHint:"默认沿用当前 admin 页面的域名/端口。如果手机走的是另一个域名(例如 cloudflared 隧道),请在此覆盖。",generate:"生成二维码",regenerate:"重新生成",generating:"生成中…",generatedToast:"二维码已生成,请在屏幕前扫码。",scanCard:"用手机扫码",scanDesc:"打开手机相机对准二维码,首次扫码即完成登录,token 未被吊销前保持登录态。",tokenLabel:"标签",urlLabel:"内嵌 URL",urlHint:"持有此 URL 的人可以以 user 身份登录。请妥善保管,与密码同等敏感。",tokenIdLabel:"Token ID",tokenIdHint:"需要吊销时,在「安全」页按此 ID 定位 token。",warningTitle:"请像对待密码一样保护此二维码。",warningBody:"扫码 token 在被吊销前长期有效。手机丢失时,请到「安全」页吊销 mobile-via-qr-* 标签下的 token。",revokeLink:"管理 / 吊销 token →",copied:"URL 已复制",copyFailed:"复制失败,请长按 URL 字段选中。",showUrl:"显示 URL",hideUrl:"隐藏 URL",copyUrl:"复制 URL",qrAlt:"手机端聊天登录二维码"},G_={title:"系统提示 Skill 注入",subtitle:"调整每轮注入到系统提示的 tier-1 skill 块。覆盖文件存在且非空时,会替换自动生成的内容(路由头与 always-on skill 正文保留)。",autoLabel:"自动生成(只读预览)",overrideLabel:"运营者覆盖(保存后生效)",overridePlaceholder:"留空表示使用自动生成。常见做法:从上方复制后删掉不需要的族,或在头部加几行路由提示。",overrideActive:"覆盖生效中",overrideInactive:"使用自动生成",largeWarn:"占用偏大,注意 token 预算",copyToOverride:"复制到下方编辑",save:"保存",clear:"清除覆盖",savedToast:"已保存。下一轮对话生效。",clearedToast:"已清除覆盖。回到自动生成。",refreshedToast:"已刷新自动生成预览。",rebuild:"重建默认注入词",rebuildTooltip:"重新扫描磁盘的所有 SKILL.md,按规则重新生成上方自动注入词(不影响下方覆盖)。",rebuiltToast:"已重新扫描磁盘并按规则生成自动注入词。下次对话生效。",overLimitToast:"内容 {{len}} 字符,超过上限 {{max}}",confirmClear:"清除覆盖文件,回到自动生成?",hint:"保存后无需重启;下一轮系统提示构建会读取最新内容。"},Q_={title:"agim Skills",tab:{installed:"已安装",hot:"skillhub 热门",injection:"系统提示注入"},group:{framework:"Framework(agim-*)",builtin:"Agim 内置(非 ECC)",workspace:"Workspace(运营者亲装业务)",eccPicks:"ECC 推荐池",eccRemainder:"ECC 余下"},searchPlaceholder:"搜索 skill 名称或描述…",searchEmpty:"没有匹配的 skill。",reload:"从磁盘重新加载",subtitle:"由 src/core/skills/loader.ts 加载的 SKILL.md 文件。Tier-1 摘要(name + description)自动注入每个 agent 系统提示;完整正文通过 mcp__imhub__read_skill 按需读取。工作区 skill 按名称覆盖内置 skill。",reloadedToast:"已重新加载 — 磁盘上 {{count}} 个 skill",selectHint:"在左侧选择一个 skill,或点击「新建」创建。",emptyList:"尚未加载 skill。点击「新建」创建(保存到 ~/.agim/skills/<name>/SKILL.md)。",unavailable:"不可用",alwaysOn:"常驻",sourceWs:"ws",sourceBuiltin:"builtin",notFound:"未找到。",sourceWorkspace:"workspace",sourceBuiltinReadonly:"builtin(UI 只读)",builtinShadowHint:"内置 skill 仅供参考。保存将创建工作区 shadow 覆盖它。",delete:"删除",save:"保存",saveShadow:"保存(创建工作区 shadow)",savedToast:'已保存 "{{name}}"',deleteConfirm:'删除工作区 skill "{{name}}"?如有内置版本将重新可见。',deletedToast:'已删除 "{{name}}"',new:"新建",newTitle:"新建 skill",newName:"Skill 名称",newNamePlaceholder:"my-skill",newCreate:"创建",createdToast:'已创建 "{{name}}"',nameRequired:"名称必填",pathLabel:"工作区路径:",binsLabel:"依赖二进制:",envLabel:"依赖环境变量:",none:"无"},Y_={pageTitle:L_,subtitle:O_,tabs:N_,agents:__,policy:D_,messengers:M_,email:j_,viewerSettings:F_,workspaces:U_,service:H_,security:B_,admins:z_,llm:$_,mcp:V_,nativeAgent:K_,search:W_,mobile:q_,skillInjection:G_,agimSkills:Q_};et.use(im).use(Ay).init({resources:{en:{common:qP,errors:BI,tasks:OL,approvals:nO,reminders:AO,memos:qO,memory:fN,skills:RN,workspace:HN,observability:n_,settings:I_},zh:{common:lI,errors:xL,tasks:VL,approvals:pO,reminders:FO,memos:nN,memory:kN,skills:ON,workspace:GN,observability:u_,settings:Y_}},lng:X_(),fallbackLng:"en",supportedLngs:["en","zh"],ns:["common","errors","tasks","approvals","reminders","memos","memory","skills","workspace","observability","settings"],defaultNS:"common",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:[],caches:[]}});function X_(){try{const e=localStorage.getItem("im-hub-lang");if(e==="en"||e==="zh")return e}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function J_(e){et.language!==e&&et.changeLanguage(e)}var[Go]=xi("Tooltip",[Fo]),El=Fo(),om="TooltipProvider",Z_=700,pd="tooltip.open",[eD,am]=Go(om),sm=e=>{const{__scopeTooltip:t,delayDuration:n=Z_,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=g.useRef(!0),s=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),y.jsx(eD,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(l.current),a.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:g.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:o})};sm.displayName=om;var lm="Tooltip",[ND,Qo]=Go(lm),ys="TooltipTrigger",tD=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Qo(ys,n),o=am(ys,n),a=El(n),s=g.useRef(null),l=ze(t,s,i.onTriggerChange),c=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),y.jsx(Vh,{asChild:!0,...a,children:y.jsx(De.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Oe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Oe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Oe(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Oe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Oe(e.onBlur,i.onClose),onClick:Oe(e.onClick,i.onClose)})})});tD.displayName=ys;var nD="TooltipPortal",[_D,rD]=Go(nD,{forceMount:void 0}),Tr="TooltipContent",cm=g.forwardRef((e,t)=>{const n=rD(Tr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Qo(Tr,e.__scopeTooltip);return y.jsx(jr,{present:r||a.open,children:a.disableHoverableContent?y.jsx(um,{side:i,...o,ref:t}):y.jsx(iD,{side:i,...o,ref:t})})}),iD=g.forwardRef((e,t)=>{const n=Qo(Tr,e.__scopeTooltip),r=am(Tr,e.__scopeTooltip),i=g.useRef(null),o=ze(t,i),[a,s]=g.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,h=g.useCallback(()=>{s(null),d(!1)},[d]),f=g.useCallback((m,p)=>{const v=m.currentTarget,b={x:m.clientX,y:m.clientY},x=cD(b,v.getBoundingClientRect()),w=uD(b,x),A=dD(p.getBoundingClientRect()),P=hD([...w,...A]);s(P),d(!0)},[d]);return g.useEffect(()=>()=>h(),[h]),g.useEffect(()=>{if(l&&u){const m=v=>f(v,u),p=v=>f(v,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",p)}}},[l,u,f,h]),g.useEffect(()=>{if(a){const m=p=>{const v=p.target,b={x:p.clientX,y:p.clientY},x=l?.contains(v)||u?.contains(v),w=!fD(b,a);x?h():w&&(h(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,a,c,h]),y.jsx(um,{...e,ref:o})}),[oD,aD]=Go(lm,{isInside:!1}),sD=Yy("TooltipContent"),um=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=Qo(Tr,n),c=El(n),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(pd,u),()=>document.removeEventListener(pd,u)),[u]),g.useEffect(()=>{if(l.trigger){const d=h=>{h.target instanceof Node&&h.target.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),y.jsx(No,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:y.jsxs(Kh,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.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:[y.jsx(sD,{children:r}),y.jsx(oD,{scope:n,isInside:!0,children:y.jsx(dR,{id:l.contentId,role:"tooltip",children:i||r})})]})})});cm.displayName=Tr;var dm="TooltipArrow",lD=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=El(n);return aD(dm,n).isInside?null:y.jsx(Wh,{...i,...r,ref:t})});lD.displayName=dm;function cD(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function uD(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function dD(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function fD(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o],l=t[a],c=s.x,u=s.y,d=l.x,h=l.y;u>r!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=!i)}return i}function hD(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),pD(t)}function pD(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}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)}var mD=sm,fm=cm;const gD=mD,yD=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>y.jsx(fm,{ref:r,sideOffset:t,className:we("z-50 overflow-hidden rounded-md","bg-text text-bg px-2 py-1 text-xs font-medium shadow-md","data-[state=delayed-open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=delayed-open]:zoom-in-95",e),...n}));yD.displayName=fm.displayName;function vD(e){return y.jsx(Yb,{position:"top-center",richColors:!0,closeButton:!0,toastOptions:{classNames:{toast:"border border-border bg-surface text-text shadow-md",title:"font-medium",description:"text-text-dim text-sm",actionButton:"bg-accent text-accent-fg rounded-md",cancelButton:"bg-surface-2 text-text rounded-md",error:"bg-danger-bg text-danger border-danger",success:"bg-success-bg text-success border-success",warning:"bg-warning-bg text-warning border-warning",info:"bg-info-bg text-info border-info"}},...e})}function bD({children:e}){const t=yr(r=>r.lang),{i18n:n}=st();return g.useEffect(()=>{n.language!==t&&J_(t)},[t,n]),y.jsx(y.Fragment,{children:e})}function xD({children:e}){return UT(),y.jsx(y.Fragment,{children:e})}function wD({children:e}){return g.useEffect(()=>py(),[]),y.jsx(y.Fragment,{children:e})}function kD({children:e}){return y.jsx(fb,{client:QT,children:y.jsx(bD,{children:y.jsx(xD,{children:y.jsx(wD,{children:y.jsxs(gD,{children:[e,y.jsx(vD,{})]})})})})})}const hm=document.getElementById("root");if(!hm)throw new Error("agim: #root not found in index.html");Ra.createRoot(hm).render(y.jsx(W.StrictMode,{children:y.jsx(kD,{children:y.jsx(GT,{})})}));export{ul as $,x1 as A,at as B,Hd as C,NT as D,br as E,Oe as F,ze as G,k1 as H,gr as I,ss as J,Xn as K,Bn as L,eR as M,Ql as N,CD as O,De as P,Vh as Q,zy as R,ho as S,Gp as T,Fo as U,jr as V,cl as W,qy as X,Yh as Y,nx as Z,kh as _,An as a,Zs as a0,No as a1,Kh as a2,Sr as a3,Wh as a4,Gy as a5,Va as a6,Dy as a7,$y as a8,CT as a9,AD as aa,TD as ab,RD as ac,ET as ad,PD as ae,LD as af,OD as ag,ID as ah,px as ai,ST as aj,DT as ak,u1 as al,m1 as am,kT as an,af as b,we as c,Zb as d,Rn as e,ly as f,fi as g,po as h,hi as i,y as j,vn as k,dt as l,Xe as m,ex as n,ht as o,K as p,Wy as q,_y as r,Vy as s,zp as t,st as u,$p as v,Kp as w,Wp as x,Vp as y,xi as z};
|
|
204
|
-
//# sourceMappingURL=index-D7BuMEIr.js.map
|