@aeolus-fleet/gateway 0.37.1 → 0.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/prisma/changes.d.ts +8 -3
- package/dist/adapters/prisma/changes.js +18 -2
- package/dist/adapters/prisma/changes.js.map +1 -1
- package/dist/app.js +19 -11
- package/dist/app.js.map +1 -1
- package/dist/core/people/held-deliveries.d.ts +30 -0
- package/dist/core/people/held-deliveries.js +42 -0
- package/dist/core/people/held-deliveries.js.map +1 -0
- package/dist/core/people/opened-of.d.ts +2 -0
- package/dist/core/people/opened-of.js.map +1 -1
- package/dist/core/people/ports.d.ts +8 -0
- package/dist/core/people/read-basket.d.ts +2 -0
- package/dist/core/people/read-basket.js.map +1 -1
- package/dist/core/people/read-bridge-home.d.ts +2 -0
- package/dist/core/people/read-bridge-home.js.map +1 -1
- package/dist/core/people/read-inbox.d.ts +16 -8
- package/dist/core/people/read-inbox.js +21 -10
- package/dist/core/people/read-inbox.js.map +1 -1
- package/dist/core/people/send-stored-answers.d.ts +2 -0
- package/dist/core/people/send-stored-answers.js +1 -1
- package/dist/core/people/send-stored-answers.js.map +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +3 -3
- package/web/.next/diagnostics/route-bundle-stats.json +75 -75
- package/web/.next/fallback-build-manifest.json +3 -3
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/server/app/(bridge)/bridge/basket/page/server-reference-manifest.json +10 -10
- package/web/.next/server/app/(bridge)/bridge/basket/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/bridge/basket/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/bridge/done/page/server-reference-manifest.json +4 -4
- package/web/.next/server/app/(bridge)/bridge/done/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/bridge/done/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/bridge/fleet/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/(bridge)/bridge/fleet/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/bridge/fleet/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/bridge/page/server-reference-manifest.json +9 -9
- package/web/.next/server/app/(bridge)/bridge/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/bridge/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/bridge/settings/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/(bridge)/bridge/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/bridge/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page/server-reference-manifest.json +4 -4
- package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/bridge/settings/requests/[requestId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/bridge/settings/routing/page/server-reference-manifest.json +7 -7
- package/web/.next/server/app/(bridge)/bridge/settings/routing/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/bridge/settings/routing/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/bridge/stay-aware/page/server-reference-manifest.json +9 -9
- package/web/.next/server/app/(bridge)/bridge/stay-aware/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/bridge/stay-aware/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page/server-reference-manifest.json +16 -16
- package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/[name]/change/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/[name]/page/server-reference-manifest.json +10 -10
- package/web/.next/server/app/(bridge)/outside-parties/[name]/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/[name]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page/server-reference-manifest.json +16 -16
- package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/[name]/retire/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/add/page/server-reference-manifest.json +12 -12
- package/web/.next/server/app/(bridge)/outside-parties/add/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/add/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page/server-reference-manifest.json +4 -4
- package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/add-a2a-agent/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page/server-reference-manifest.json +4 -4
- package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/add-a2a-client/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/page/server-reference-manifest.json +4 -4
- package/web/.next/server/app/(bridge)/outside-parties/page.js.nft.json +1 -1
- package/web/.next/server/app/(bridge)/outside-parties/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/gateway-off/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/(console)/gateway-off/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/gateway-off/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/meetings/[meetingId]/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/(console)/meetings/[meetingId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/meetings/[meetingId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/parties/page/server-reference-manifest.json +9 -9
- package/web/.next/server/app/(console)/parties/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/parties/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/sign-in/failed/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/slack/disconnect/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/(console)/slack/disconnect/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/slack/disconnect/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/slack/expose/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/(console)/slack/expose/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/slack/expose/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/slack/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/(console)/slack/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/slack/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(console)/slack/remove/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/(console)/slack/remove/page.js.nft.json +1 -1
- package/web/.next/server/app/(console)/slack/remove/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +1 -1
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/failed/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/failed/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/failed/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/pick/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/pick/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/pick/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page.js.nft.json +1 -1
- package/web/.next/server/app/authorize/waiting/approval/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/ssr/01fr_app_(bridge)_bridge_settings_requests_[requestId]_page_actions_0o8g7_xshtmem.js +1 -1
- package/web/.next/server/chunks/ssr/01fr_app_(bridge)_bridge_settings_requests_[requestId]_page_actions_0o8g7_xshtmem.js.map +1 -1
- package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_settings_page_actions_0_te6h-2xxp7l.js +1 -1
- package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_settings_page_actions_0_te6h-2xxp7l.js.map +1 -1
- package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_stay-aware_page_actions_1u0xo0v3y9c34.js +1 -1
- package/web/.next/server/chunks/ssr/0b9d__next-internal_server_app_(bridge)_bridge_stay-aware_page_actions_1u0xo0v3y9c34.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_bridge_settings_routing_page_actions_06_j7s24dy5ee.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_bridge_settings_routing_page_actions_06_j7s24dy5ee.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_change_page_actions_1is-kjq5bubl4.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_change_page_actions_1is-kjq5bubl4.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_page_actions_1mctxtlzsa7xi.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_page_actions_1mctxtlzsa7xi.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_retire_page_actions_0xh6ok1un7s9k.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_[name]_retire_page_actions_0xh6ok1un7s9k.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add-a2a-agent_page_actions_1w1q5eavo_loo.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add-a2a-agent_page_actions_1w1q5eavo_loo.js.map +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add_page_actions_0urcbg_r0lo7j.js +1 -1
- package/web/.next/server/chunks/ssr/0vkm_server_app_(bridge)_outside-parties_add_page_actions_0urcbg_r0lo7j.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0ipo8r1s1ntds._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0ovcg5tg3nh49._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0ovcg5tg3nh49._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0ro-majrw7piv._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0ro-majrw7piv._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0xurmpdv5uqfl._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0zz6fx0keti4r._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0zz6fx0keti4r._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__19p4g16n2nh0b._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__19p4g16n2nh0b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1ncn4wx-1i09m._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1ncn4wx-1i09m._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_0d9el5z4r07h8._.js → _0-9rlwz3ujd0r._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_0nmqkf1y-qsc2._.js.map → _0-9rlwz3ujd0r._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js +1 -1
- package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0_nfv33ug5g31._.js +1 -1
- package/web/.next/server/chunks/ssr/_0_nfv33ug5g31._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js +1 -1
- package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js +1 -1
- package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js +1 -1
- package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_0nmqkf1y-qsc2._.js → _15yv_08kq3cgn._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_0d9el5z4r07h8._.js.map → _15yv_08kq3cgn._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_0msh_lv5ns4e9._.js → _1ag569itedbet._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_1a-gh-psko_2f._.js.map → _1ag569itedbet._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_1cs_0d0h7mhw0._.js +1 -1
- package/web/.next/server/chunks/ssr/_1cs_0d0h7mhw0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_1a-gh-psko_2f._.js → _1m4bmxzmjr-8s._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_0msh_lv5ns4e9._.js.map → _1m4bmxzmjr-8s._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js +1 -1
- package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js +1 -1
- package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1x3tv4gu7i2sy._.js +57 -0
- package/web/.next/server/chunks/ssr/_1x3tv4gu7i2sy._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_1zcbk6s3j_jfy._.js +57 -0
- package/web/.next/server/chunks/ssr/_1zcbk6s3j_jfy._.js.map +1 -0
- package/web/.next/server/chunks/ssr/web_0a9n7acgjrk5c._.js +1 -1
- package/web/.next/server/chunks/ssr/web_0a9n7acgjrk5c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_1vvrekkq5mirt._.js +1 -1
- package/web/.next/server/chunks/ssr/web_1vvrekkq5mirt._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_basket_page_actions_0g7q_rc5nma1e.js +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_basket_page_actions_0g7q_rc5nma1e.js.map +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_done_page_actions_0kjm34arntdzv.js +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_done_page_actions_0kjm34arntdzv.js.map +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_fleet_page_actions_19wmo6phgvqfk.js +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_fleet_page_actions_19wmo6phgvqfk.js.map +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_page_actions_1ok64rg3edm_u.js +1 -1
- package/web/.next/server/chunks/ssr/web__next-internal_server_app_(bridge)_bridge_page_actions_1ok64rg3edm_u.js.map +1 -1
- package/web/.next/server/chunks/ssr/{web_features_11rwm0rhf5957._.js → web_features_16z82ve7t15n5._.js} +2 -2
- package/web/.next/server/chunks/ssr/{web_features_11rwm0rhf5957._.js.map → web_features_16z82ve7t15n5._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{web_features_0cgvngtsgzu24._.js → web_features_1e7_lwq7351pm._.js} +2 -2
- package/web/.next/server/chunks/ssr/{web_features_0cgvngtsgzu24._.js.map → web_features_1e7_lwq7351pm._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{web_features_1r2u065j-hgrq._.js → web_features_1fzx-ctm4ru39._.js} +2 -2
- package/web/.next/server/chunks/ssr/{web_features_1r2u065j-hgrq._.js.map → web_features_1fzx-ctm4ru39._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{web_features_1loqabdanp8wi._.js → web_features_1wo7gr7bxvsi-._.js} +2 -2
- package/web/.next/server/chunks/ssr/{web_features_1loqabdanp8wi._.js.map → web_features_1wo7gr7bxvsi-._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{web_features_bridge_17dx2edv4zsex._.js → web_features_bridge_0qdb9pmm6338t._.js} +2 -2
- package/web/.next/server/chunks/ssr/{web_features_bridge_17dx2edv4zsex._.js.map → web_features_bridge_0qdb9pmm6338t._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/web_features_bridge_hooks_bridge-actions_ts_0h-_xm2rcb-ij._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_bridge_state_basket-panel_tsx_1qi_kzld0rfgs._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_bridge_state_basket-panel_tsx_1qi_kzld0rfgs._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_bridge_state_decision-panel_tsx_1mzsixgc8zuxc._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_bridge_state_decision-panel_tsx_1mzsixgc8zuxc._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_bridge_state_done-panel_tsx_1m844-qb1z9p_._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_bridge_state_done-panel_tsx_1m844-qb1z9p_._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-party_1-lre9nfakki7._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-party_1-lre9nfakki7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/web_features_outside-party_actions_ts_102ar5pdowf8s._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_parties_actions_ts_0r-tbfsig2ty-._.js +1 -1
- package/web/.next/server/chunks/ssr/web_features_slack_actions_ts_1l3yg9vl20_vu._.js +1 -1
- package/web/.next/server/middleware-build-manifest.js +3 -3
- package/web/.next/server/pages/500.html +1 -1
- package/web/.next/server/preview-props.json +3 -3
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +51 -51
- package/web/.next/static/chunks/{1az8wx3bt0tc-.js → 07km754q38z4c.js} +1 -1
- package/web/.next/static/chunks/{3c2whoiify4hd.js → 0ev65_p1z_ll0.js} +1 -1
- package/web/.next/static/chunks/17akrnci0j_nn.js +1 -0
- package/web/.next/static/chunks/{2ztqsnh1sq5f9.js → 1_f6w3i1t1svg.js} +1 -1
- package/web/.next/static/chunks/1e5_kej4hnnf_.js +1 -0
- package/web/.next/static/chunks/{3bvcgvk4m3hxh.js → 1edk_zyv9lbyy.js} +1 -1
- package/web/.next/static/chunks/{0klu03tcnjzsm.js → 1lq70vpqz6u1c.js} +1 -1
- package/web/.next/static/chunks/{1oipnf2j_m8oy.js → 1zqkns-nn-wz0.js} +4 -4
- package/web/.next/static/chunks/{3q_d1vlm22cy0.js → 2490rbe6dmnwe.js} +1 -1
- package/web/.next/static/chunks/{0jqdvhip5x6im.js → 27tnlhw9cxgul.js} +1 -1
- package/web/.next/static/chunks/{0d0fsf26a1ep_.js → 2_ayfyj3csc8m.js} +1 -1
- package/web/.next/static/chunks/2v-0k1odkn9cu.js +1 -0
- package/web/.next/static/chunks/{3po7blcdi5_y6.js → 2v4z6cjtqu95k.js} +1 -1
- package/web/.next/static/chunks/{12kwix3z2z-fs.js → 3ban8s8z3ah0y.js} +1 -1
- package/web/.next/static/chunks/{3nqasvqr8d81s.js → 3ik7w8wf5u23q.js} +1 -1
- package/web/.next/trace +1 -1
- package/web/.next/trace-build +1 -1
- package/web/.next/server/chunks/ssr/_1e720g1qty0xj._.js +0 -57
- package/web/.next/server/chunks/ssr/_1e720g1qty0xj._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_1xjxj1ur-j87t._.js +0 -57
- package/web/.next/server/chunks/ssr/_1xjxj1ur-j87t._.js.map +0 -1
- package/web/.next/static/chunks/04r-53h_fb5rq.js +0 -1
- package/web/.next/static/chunks/2fjzmc7-5sf_m.js +0 -1
- package/web/.next/static/chunks/38w8690okopia.js +0 -1
- /package/web/.next/static/{waEyx88w-M7TBm3nu35s- → yJHYTb3NO7GRc3o3RS0f0}/_buildManifest.js +0 -0
- /package/web/.next/static/{waEyx88w-M7TBm3nu35s- → yJHYTb3NO7GRc3o3RS0f0}/_clientMiddlewareManifest.js +0 -0
- /package/web/.next/static/{waEyx88w-M7TBm3nu35s- → yJHYTb3NO7GRc3o3RS0f0}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,28008,e=>{e.s(["H",0,"fleet","Q",0,{kind:"idle"}])},94984,e=>{var t=e.i(43476);e.s(["f",0,function({state:e,testId:n}){switch(e.kind){case"idle":return null;case"done":return(0,t.jsx)("p",{role:"status","data-testid":n,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e.message});case"refused":case"openNetwork":return(0,t.jsx)("p",{role:"alert","data-testid":n,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e.message})}}])},58107,e=>{var t=e.i(43476),n=e.i(74080),o=e.i(30402);e.s(["f",0,function({children:e,pending:r,kind:i="primary",testId:d}){let a=(0,n.useFormStatus)();return(0,t.jsx)("button",{type:"submit",className:o.x[i],disabled:a.pending,"aria-busy":a.pending,"data-testid":d,children:a.pending?r:e})}])},97e3,e=>{var t=e.i(43476);let n={waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",active:"border-tone-active-border bg-tone-active-bg text-tone-active-fg",ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg",ended:"border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg"},o={waiting:"text-tone-waiting-fg",active:"text-tone-active-fg",ok:"text-tone-ok-fg",attention:"rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-tone-attention-fg",ended:"text-tone-ended-fg"};e.s(["T",0,function({tone:e,label:r,look:i="pill",icon:d}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-caption ${"pill"===i?`rounded-full border px-2 ${n[e]}`:`h-5.5 px-0.5 font-medium ${o[e]}`}`,children:[d,r]})},"E",0,function({children:e,isMono:n=!1}){return(0,t.jsx)("span",{className:`inline-flex h-5.5 items-center rounded-sm border border-border px-1.5 text-caption font-medium ${n?"font-mono":""}`,children:e})}])},17018,e=>{var t=e.i(43476),n=e.i(85595),o=e.i(71645),r=e.i(28008),i=e.i(30402),d=e.i(94984),a=e.i(58107),s=e.i(95187);let l=(0,s.createServerReference)("
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,28008,e=>{e.s(["H",0,"fleet","Q",0,{kind:"idle"}])},94984,e=>{var t=e.i(43476);e.s(["f",0,function({state:e,testId:n}){switch(e.kind){case"idle":return null;case"done":return(0,t.jsx)("p",{role:"status","data-testid":n,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e.message});case"refused":case"openNetwork":return(0,t.jsx)("p",{role:"alert","data-testid":n,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e.message})}}])},58107,e=>{var t=e.i(43476),n=e.i(74080),o=e.i(30402);e.s(["f",0,function({children:e,pending:r,kind:i="primary",testId:d}){let a=(0,n.useFormStatus)();return(0,t.jsx)("button",{type:"submit",className:o.x[i],disabled:a.pending,"aria-busy":a.pending,"data-testid":d,children:a.pending?r:e})}])},97e3,e=>{var t=e.i(43476);let n={waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",active:"border-tone-active-border bg-tone-active-bg text-tone-active-fg",ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg",ended:"border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg"},o={waiting:"text-tone-waiting-fg",active:"text-tone-active-fg",ok:"text-tone-ok-fg",attention:"rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-tone-attention-fg",ended:"text-tone-ended-fg"};e.s(["T",0,function({tone:e,label:r,look:i="pill",icon:d}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-caption ${"pill"===i?`rounded-full border px-2 ${n[e]}`:`h-5.5 px-0.5 font-medium ${o[e]}`}`,children:[d,r]})},"E",0,function({children:e,isMono:n=!1}){return(0,t.jsx)("span",{className:`inline-flex h-5.5 items-center rounded-sm border border-border px-1.5 text-caption font-medium ${n?"font-mono":""}`,children:e})}])},17018,e=>{var t=e.i(43476),n=e.i(85595),o=e.i(71645),r=e.i(28008),i=e.i(30402),d=e.i(94984),a=e.i(58107),s=e.i(95187);let l=(0,s.createServerReference)("60ae449a18b0b6dee162a9e39ce03ccba4f6d50d9a",s.callServer,void 0,s.findSourceMapURL,"switchOutsideParties");var c=e.i(97e3);e.s(["SwitchCard",0,function({isOn:e,canSwitch:s,fleetId:u}){let[f,g]=(0,o.useActionState)(l,r.Q);return(0,t.jsxs)("section",{className:`${i.E} grid gap-1.5`,"data-testid":"outside-parties-switch",children:[(0,t.jsxs)("h2",{className:"flex items-center gap-2 font-semibold",children:["Outside parties are ",e?"on":"off"," ",e?(0,t.jsx)(c.T,{tone:"ok",label:"On",look:"flat",icon:(0,t.jsx)(n.f,{"aria-hidden":!0,className:"size-3.5"})}):(0,t.jsx)(c.T,{tone:"ended",label:"Off",look:"flat"})]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:e?"Approved outside MCP servers and clients reach the fleet, as its network rules allow.":"No outside MCP server or client reaches the fleet, and no request for one can be approved."}),"openNetwork"===f.kind?(0,t.jsxs)("form",{action:g,role:"alert",className:"grid gap-3 rounded-md border border-tone-attention-border bg-tone-attention-bg p-4 text-tone-attention-fg",children:[(0,t.jsx)("h3",{className:"font-semibold",children:"Open network"}),(0,t.jsx)("p",{children:f.message}),(0,t.jsx)("input",{type:"hidden",name:r.H,value:u}),(0,t.jsx)("input",{type:"hidden",name:"isOn",value:"true"}),(0,t.jsx)("input",{type:"hidden",name:"isOpenNetworkConfirmed",value:"true"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(a.f,{kind:"destructive",pending:"Turning on…",testId:"outside-parties-turn-on-anyway",children:"Turn on anyway"}),(0,t.jsx)("a",{className:i.x.secondary,href:"",children:"Keep off"})]})]}):s?(0,t.jsxs)("form",{action:g,children:[(0,t.jsx)("input",{type:"hidden",name:r.H,value:u}),(0,t.jsx)("input",{type:"hidden",name:"isOn",value:String(!e)}),(0,t.jsx)(a.f,{kind:e?"secondary":"primary",pending:e?"Turning off…":"Turning on…",testId:"outside-parties-turn",children:e?"Turn off":"Turn on"})]}):(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:["Turning them on or off needs ","fleet:network","."]}),"openNetwork"===f.kind?null:(0,t.jsx)(d.f,{state:f})]})}],17018)}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,37134,45017,47125,10030,e=>{var n=e.i(24189);e.s(["f",0,n],37134),e.s(["f",0,n],45017),e.s(["f",0,n],47125),e.s(["f",0,n],10030)},27921,e=>{var n=e.i(43476),t=e.i(71645),s=e.i(95187);let a=(0,s.createServerReference)("60b0d7b244056186717c74b1ae5d0d131820dc43f3",s.callServer,void 0,s.findSourceMapURL,"approveServer"),r=(0,s.createServerReference)("60b26b6f6b11e0f0a19478cb10891d159b3980fbf9",s.callServer,void 0,s.findSourceMapURL,"checkServer");var i=e.i(28008),d=e.i(88374),l=e.i(62052),o=e.i(30402),c=e.i(58107);let u=["Address","Check","Owner"],m=["Address","Owner","Sign in"];var x=e.i(94984);function p({refusal:e}){return void 0===e?null:(0,n.jsx)(x.f,{state:{kind:"refused",message:e}})}function h({names:e,at:t}){return(0,n.jsx)("ol",{className:"flex gap-4 text-meta",children:e.map((e,s)=>(0,n.jsxs)("li",{"aria-current":s===t?"step":void 0,className:s<=t?"font-semibold":"text-muted-foreground",children:[s+1," ",e]},e))})}function f({state:e,action:s,fleetId:a}){let[r,x]=(0,t.useState)((0,d.G)(e.fields.credentialKind??"")),g=r===d.m.kind;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h,{names:r===d.m.kind?m:u,at:0}),(0,n.jsxs)("form",{action:s,className:`${o.E} grid gap-3.5`,"data-testid":"add-server-address",children:[(0,n.jsx)("input",{type:"hidden",name:i.H,value:a}),(0,n.jsx)(p,{refusal:e.refusal}),(0,n.jsxs)("label",{className:o.z,children:[(0,n.jsx)("span",{children:"Streamable HTTP address"}),(0,n.jsx)("input",{className:o.w,type:"url",name:"url",defaultValue:e.fields.url??"",placeholder:"https://mcp.example.com/mcp",required:!0})]}),(0,n.jsx)(l.f,{legend:"The server's credential",fields:e.fields,noneHelp:"The gateway sends no credential: for a server reached only on a private network.",canEachPersonSignIn:!0,onKindChange:x}),(0,n.jsx)("div",{children:(0,n.jsx)(c.f,{pending:g?"Next…":"Checking the server…",testId:"add-server-check",children:g?"Next":"Check the server"})})]})]})}var g=e.i(65818),j=e.i(25621),b=e.i(97e3);function v({tool:e,control:t,testId:s}){let{name:a,description:r,isReadOnly:i,isNew:d=!1}=e,l=void 0===r?"":r.split("\n").map(e=>e.trim()).find(e=>""!==e)??"",o=void 0!==r&&r.trim()!==l;return(0,n.jsxs)("li",{className:"grid gap-1 border-b border-border py-2 last:border-b-0","data-testid":s,children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[t,(0,n.jsx)("span",{className:"font-mono",children:a}),i?(0,n.jsx)(b.E,{children:"reads only"}):null,d?(0,n.jsx)(b.T,{tone:"attention",label:"New"}):null]}),""===l?null:o?(0,n.jsxs)("details",{className:"text-muted-foreground",children:[(0,n.jsx)("summary",{className:"cursor-pointer",children:l}),(0,n.jsx)("p",{className:"mt-1 whitespace-pre-line",children:r})]}):(0,n.jsx)("p",{className:"text-muted-foreground",children:l})]})}function N({tools:e,canSwitch:s}){let[a,r]=(0,t.useState)(new Set),i=e.length-a.size;return(0,n.jsxs)("section",{className:"grid gap-2","data-testid":"add-server-tools",children:[(0,n.jsxs)("h2",{className:"flex flex-wrap justify-between gap-2 text-section font-semibold",children:[(0,n.jsxs)("span",{children:["The server answers: ",e.length," ",1===e.length?"tool":"tools"]}),s?(0,n.jsxs)("span",{role:"status",className:"font-normal text-muted-foreground","data-testid":"add-server-tools-on",children:[i," of ",e.length," on"]}):null]}),(0,n.jsx)("p",{className:"text-muted-foreground",children:s?"The fleet may call only the tools switched on. A tool the server adds later starts off.":"Switching tools needs gateway:approve: every tool starts on, and an approver switches them on its page."}),(0,n.jsx)("ul",{className:"grid",children:e.map(e=>{let t=!a.has(e.name);return(0,n.jsx)(v,{tool:e,testId:"add-server-tool",control:s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{type:"hidden",name:"toolShown",value:e.name}),t?(0,n.jsx)("input",{type:"hidden",name:"toolOn",value:e.name}):null,(0,n.jsx)(j.f,{isOn:t,label:e.name,onClick:()=>{var n;n=e.name,r(e=>{let t=new Set(e);return t.delete(n)||t.add(n),t})}})]}):null},e.name)})})]})}let w=["url","credentialKind","token","clientId","clientSecret","issuer","scope"];function y({state:e,refused:s,action:a,onBack:r,fleetId:d,canSwitchTools:l}){let x,f="refused"===s.kind&&s.requestId===e.requestId,j=f?s.fields:e.fields,b=j.url??"",[v,k]=(0,t.useState)(j.name??function(e){if(!URL.canParse(e))return"";let{hostname:n}=new URL(e);return/^\d+(\.\d+){3}$/.test(n)||n.startsWith("[")?"":(n.split(".").filter(e=>"mcp"!==e&&"www"!==e)[0]??"").toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"")}(b)),S=e.tools;return(0,n.jsxs)(n.Fragment,{children:[null===S?(0,n.jsx)(h,{names:m,at:1}):(0,n.jsx)(h,{names:u,at:2}),(0,n.jsxs)("form",{action:a,className:`${o.E} grid gap-3.5`,"data-testid":"add-server-owner",children:[null===S?null:(0,n.jsx)(N,{tools:S,canSwitch:l}),(0,n.jsx)("h2",{className:"text-section font-semibold",children:"Its owner"}),(0,n.jsx)(p,{refusal:f?s.message:void 0}),(0,n.jsx)("input",{type:"hidden",name:i.H,value:d}),(0,n.jsx)("input",{type:"hidden",name:"requestId",value:e.requestId}),w.map(e=>(0,n.jsx)("input",{type:"hidden",name:e,value:j[e]??""},e)),(0,n.jsx)("p",{className:"font-mono text-muted-foreground",children:b}),(0,n.jsxs)("label",{className:o.z,children:[(0,n.jsx)("span",{children:"Proxy ship's name"}),(0,n.jsx)("input",{className:o.w,type:"text",name:"name",value:v,onChange:e=>{k(e.target.value)},required:!0})]}),(0,n.jsx)(g.f,{choices:e.owners,current:e.owners.find(e=>e.shipId===j.ownerShipId)??null,help:"A person ship or argo. It answers for this server."}),(0,n.jsxs)("label",{className:o.z,children:[(0,n.jsx)("span",{children:"Calls at once"}),(0,n.jsx)("input",{className:o.w,type:"number",name:"concurrencyLimit",min:1,max:10,defaultValue:j.concurrencyLimit??"4"})]}),null===S?(0,n.jsx)("p",{className:"text-muted-foreground",children:"Its tools show once someone signs in."}):null,(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(c.f,{pending:null===S?"Checking the sign-in…":"Adding…",testId:"add-server-approve",children:""===(x=v.trim())?"Add as outside party":x.length>20?`Add ${x.slice(0,20)}…`:`Add ${x}`}),(0,n.jsx)("button",{type:"button",className:o.x.secondary,onClick:r,children:"Back to the address"})]})]})]})}var k=e.i(65894),S=e.i(31831),I=e.i(37018);function C({fleetId:e,name:s}){let[a,r]=(0,t.useActionState)(I.f,i.Q);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h,{names:m,at:2}),(0,n.jsxs)("form",{action:r,className:`${o.E} grid gap-3.5`,"data-testid":"add-server-sign-in",children:[(0,n.jsx)(x.f,{state:{kind:"done",message:`${s} is added.`}}),(0,n.jsx)(x.f,{state:a}),(0,n.jsx)("input",{type:"hidden",name:i.H,value:e}),(0,n.jsx)("input",{type:"hidden",name:"name",value:s}),(0,n.jsxs)("p",{children:["Sign in to ",s," for yourself. Its tools show after the first sign-in."]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsxs)(c.f,{pending:`Opening ${s}…`,testId:"add-server-sign-in-start",children:["Sign in to ",s]}),(0,n.jsx)("a",{href:(0,k.f)((0,S.N)(s),e),className:o.x.secondary,children:"Later"})]})]})]})}e.s(["AddServer",0,function({fleetId:e,canSwitchTools:s}){let[i,d]=(0,t.useActionState)(r,{step:"address",fields:{}}),[l,o]=(0,t.useActionState)(a,{kind:"idle"}),[c,u]=(0,t.useState)(void 0),m="owner"===i.step&&c!==i.requestId?i:void 0;return(0,n.jsxs)("div",{className:"grid max-w-160 gap-3",children:[(0,n.jsx)("h1",{className:"text-heading-touch font-semibold max-sm:sr-only",children:"Add MCP server"}),"added"===l.kind?(0,n.jsx)(C,{fleetId:e,name:l.name}):void 0===m?(0,n.jsx)(f,{state:i,action:d,fleetId:e}):(0,n.jsx)(y,{state:m,refused:l,action:o,onBack:()=>{u(m.requestId)},fleetId:e,canSwitchTools:s})]})}],27921)},55070,e=>{var n=e.i(43476);let t={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},s={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:a,variant:r="secondary",size:i="regular",children:d,className:l="",disabled:o,...c}){return(0,n.jsx)("button",{...c,disabled:!0===o||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${s[i]} ${t[r]} ${l}`,children:e?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),a]}):d})},"o",0,s])},28008,e=>{e.s(["H",0,"fleet","Q",0,{kind:"idle"}])},88374,e=>{let n=[{kind:"none",label:"No credential"},{kind:"bearer",label:"Bearer token"},{kind:"clientCredentials",label:"OAuth client credentials"}],t={kind:"personSignIn",label:"Each person signs in"},s=[...n,t];e.s(["a",0,s,"x",0,n,"m",0,t,"G",0,function(e){return s.find(({kind:n})=>n===e)?.kind??"bearer"},"C",0,function(e){return n.find(({kind:n})=>n===e)?.kind??"bearer"}])},62052,e=>{var n=e.i(43476),t=e.i(16327),s=e.i(71645),a=e.i(88374),r=e.i(30402);e.s(["f",0,function({legend:e,fields:i,noneHelp:d,canEachPersonSignIn:l=!1,onKindChange:o}){let c=l?a.G:a.C,[u,m]=(0,s.useState)(c(i.credentialKind??""));return(0,n.jsxs)("fieldset",{className:"grid gap-3",children:[(0,n.jsx)("legend",{className:"font-medium",children:e}),(0,n.jsxs)("span",{className:"relative",children:[(0,n.jsx)("select",{className:r.D,"aria-label":e,name:"credentialKind",value:u,onChange:e=>{let n=c(e.target.value);m(n),o?.(n)},children:(l?a.a:a.x).map(({kind:e,label:t})=>(0,n.jsx)("option",{value:e,children:t},e))}),(0,n.jsx)(t.f,{"aria-hidden":!0,className:"pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground"})]}),"clientCredentials"===u?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("label",{className:r.z,children:[(0,n.jsx)("span",{children:"Client id"}),(0,n.jsx)("input",{className:r.w,type:"text",name:"clientId",defaultValue:i.clientId??""})]}),(0,n.jsxs)("label",{className:r.z,children:[(0,n.jsx)("span",{children:"Client secret"}),(0,n.jsx)("input",{className:r.w,type:"password",name:"clientSecret"})]}),(0,n.jsxs)("label",{className:r.z,children:[(0,n.jsx)("span",{children:"Issuer"}),(0,n.jsx)("input",{className:r.w,type:"url",name:"issuer",defaultValue:i.issuer??""})]}),(0,n.jsxs)("label",{className:r.z,children:[(0,n.jsx)("span",{children:"Scope"}),(0,n.jsx)("input",{className:r.w,type:"text",name:"scope",defaultValue:i.scope??""})]})]}):"bearer"===u?(0,n.jsxs)("label",{className:r.z,children:[(0,n.jsx)("span",{children:"Bearer token"}),(0,n.jsx)("input",{className:r.w,type:"password",name:"token"})]}):u===a.m.kind?(0,n.jsx)("p",{className:"text-muted-foreground",children:"Each person signs in for themselves. A ship calls under its owner's sign-in."}):(0,n.jsx)("p",{className:"text-muted-foreground",children:d})]})}])},94984,e=>{var n=e.i(43476);e.s(["f",0,function({state:e,testId:t}){switch(e.kind){case"idle":return null;case"done":return(0,n.jsx)("p",{role:"status","data-testid":t,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e.message});case"refused":case"openNetwork":return(0,n.jsx)("p",{role:"alert","data-testid":t,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e.message})}}])},65818,e=>{var n=e.i(43476),t=e.i(30402);e.s(["f",0,function({choices:e,current:s,help:a,refusal:r}){let i=null===s||e.some(e=>e.shipId===s.shipId)?e:[s,...e];return(0,n.jsxs)("label",{className:t.z,children:[(0,n.jsx)("span",{children:"Owner"}),(0,n.jsxs)("select",{className:t.w,name:"ownerShipId",defaultValue:s?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===s?(0,n.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,i.map(e=>(0,n.jsx)("option",{value:e.shipId,children:e.name},e.shipId))]}),(0,n.jsx)("span",{className:"text-muted-foreground",children:r??a})]})}])},58107,e=>{var n=e.i(43476),t=e.i(74080),s=e.i(30402);e.s(["f",0,function({children:e,pending:a,kind:r="primary",testId:i}){let d=(0,t.useFormStatus)();return(0,n.jsx)("button",{type:"submit",className:s.x[r],disabled:d.pending,"aria-busy":d.pending,"data-testid":i,children:d.pending?a:e})}])},97e3,e=>{var n=e.i(43476);let t={waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",active:"border-tone-active-border bg-tone-active-bg text-tone-active-fg",ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg",ended:"border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg"},s={waiting:"text-tone-waiting-fg",active:"text-tone-active-fg",ok:"text-tone-ok-fg",attention:"rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-tone-attention-fg",ended:"text-tone-ended-fg"};e.s(["T",0,function({tone:e,label:a,look:r="pill",icon:i}){return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-caption ${"pill"===r?`rounded-full border px-2 ${t[e]}`:`h-5.5 px-0.5 font-medium ${s[e]}`}`,children:[i,a]})},"E",0,function({children:e,isMono:t=!1}){return(0,n.jsx)("span",{className:`inline-flex h-5.5 items-center rounded-sm border border-border px-1.5 text-caption font-medium ${t?"font-mono":""}`,children:e})}])}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,37134,45017,47125,10030,e=>{var n=e.i(24189);e.s(["f",0,n],37134),e.s(["f",0,n],45017),e.s(["f",0,n],47125),e.s(["f",0,n],10030)},27921,e=>{var n=e.i(43476),t=e.i(71645),s=e.i(95187);let a=(0,s.createServerReference)("60a8fc6fe1f386626108b583cc2337f8d3c56aa8f1",s.callServer,void 0,s.findSourceMapURL,"approveServer"),r=(0,s.createServerReference)("60bdcc095b1945bd5eb56aecfc8c268c586b98964f",s.callServer,void 0,s.findSourceMapURL,"checkServer");var i=e.i(28008),d=e.i(88374),l=e.i(62052),o=e.i(30402),c=e.i(58107);let u=["Address","Check","Owner"],m=["Address","Owner","Sign in"];var x=e.i(94984);function p({refusal:e}){return void 0===e?null:(0,n.jsx)(x.f,{state:{kind:"refused",message:e}})}function h({names:e,at:t}){return(0,n.jsx)("ol",{className:"flex gap-4 text-meta",children:e.map((e,s)=>(0,n.jsxs)("li",{"aria-current":s===t?"step":void 0,className:s<=t?"font-semibold":"text-muted-foreground",children:[s+1," ",e]},e))})}function f({state:e,action:s,fleetId:a}){let[r,x]=(0,t.useState)((0,d.G)(e.fields.credentialKind??"")),g=r===d.m.kind;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h,{names:r===d.m.kind?m:u,at:0}),(0,n.jsxs)("form",{action:s,className:`${o.E} grid gap-3.5`,"data-testid":"add-server-address",children:[(0,n.jsx)("input",{type:"hidden",name:i.H,value:a}),(0,n.jsx)(p,{refusal:e.refusal}),(0,n.jsxs)("label",{className:o.z,children:[(0,n.jsx)("span",{children:"Streamable HTTP address"}),(0,n.jsx)("input",{className:o.w,type:"url",name:"url",defaultValue:e.fields.url??"",placeholder:"https://mcp.example.com/mcp",required:!0})]}),(0,n.jsx)(l.f,{legend:"The server's credential",fields:e.fields,noneHelp:"The gateway sends no credential: for a server reached only on a private network.",canEachPersonSignIn:!0,onKindChange:x}),(0,n.jsx)("div",{children:(0,n.jsx)(c.f,{pending:g?"Next…":"Checking the server…",testId:"add-server-check",children:g?"Next":"Check the server"})})]})]})}var g=e.i(65818),j=e.i(25621),b=e.i(97e3);function v({tool:e,control:t,testId:s}){let{name:a,description:r,isReadOnly:i,isNew:d=!1}=e,l=void 0===r?"":r.split("\n").map(e=>e.trim()).find(e=>""!==e)??"",o=void 0!==r&&r.trim()!==l;return(0,n.jsxs)("li",{className:"grid gap-1 border-b border-border py-2 last:border-b-0","data-testid":s,children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[t,(0,n.jsx)("span",{className:"font-mono",children:a}),i?(0,n.jsx)(b.E,{children:"reads only"}):null,d?(0,n.jsx)(b.T,{tone:"attention",label:"New"}):null]}),""===l?null:o?(0,n.jsxs)("details",{className:"text-muted-foreground",children:[(0,n.jsx)("summary",{className:"cursor-pointer",children:l}),(0,n.jsx)("p",{className:"mt-1 whitespace-pre-line",children:r})]}):(0,n.jsx)("p",{className:"text-muted-foreground",children:l})]})}function N({tools:e,canSwitch:s}){let[a,r]=(0,t.useState)(new Set),i=e.length-a.size;return(0,n.jsxs)("section",{className:"grid gap-2","data-testid":"add-server-tools",children:[(0,n.jsxs)("h2",{className:"flex flex-wrap justify-between gap-2 text-section font-semibold",children:[(0,n.jsxs)("span",{children:["The server answers: ",e.length," ",1===e.length?"tool":"tools"]}),s?(0,n.jsxs)("span",{role:"status",className:"font-normal text-muted-foreground","data-testid":"add-server-tools-on",children:[i," of ",e.length," on"]}):null]}),(0,n.jsx)("p",{className:"text-muted-foreground",children:s?"The fleet may call only the tools switched on. A tool the server adds later starts off.":"Switching tools needs gateway:approve: every tool starts on, and an approver switches them on its page."}),(0,n.jsx)("ul",{className:"grid",children:e.map(e=>{let t=!a.has(e.name);return(0,n.jsx)(v,{tool:e,testId:"add-server-tool",control:s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{type:"hidden",name:"toolShown",value:e.name}),t?(0,n.jsx)("input",{type:"hidden",name:"toolOn",value:e.name}):null,(0,n.jsx)(j.f,{isOn:t,label:e.name,onClick:()=>{var n;n=e.name,r(e=>{let t=new Set(e);return t.delete(n)||t.add(n),t})}})]}):null},e.name)})})]})}let w=["url","credentialKind","token","clientId","clientSecret","issuer","scope"];function y({state:e,refused:s,action:a,onBack:r,fleetId:d,canSwitchTools:l}){let x,f="refused"===s.kind&&s.requestId===e.requestId,j=f?s.fields:e.fields,b=j.url??"",[v,k]=(0,t.useState)(j.name??function(e){if(!URL.canParse(e))return"";let{hostname:n}=new URL(e);return/^\d+(\.\d+){3}$/.test(n)||n.startsWith("[")?"":(n.split(".").filter(e=>"mcp"!==e&&"www"!==e)[0]??"").toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"")}(b)),S=e.tools;return(0,n.jsxs)(n.Fragment,{children:[null===S?(0,n.jsx)(h,{names:m,at:1}):(0,n.jsx)(h,{names:u,at:2}),(0,n.jsxs)("form",{action:a,className:`${o.E} grid gap-3.5`,"data-testid":"add-server-owner",children:[null===S?null:(0,n.jsx)(N,{tools:S,canSwitch:l}),(0,n.jsx)("h2",{className:"text-section font-semibold",children:"Its owner"}),(0,n.jsx)(p,{refusal:f?s.message:void 0}),(0,n.jsx)("input",{type:"hidden",name:i.H,value:d}),(0,n.jsx)("input",{type:"hidden",name:"requestId",value:e.requestId}),w.map(e=>(0,n.jsx)("input",{type:"hidden",name:e,value:j[e]??""},e)),(0,n.jsx)("p",{className:"font-mono text-muted-foreground",children:b}),(0,n.jsxs)("label",{className:o.z,children:[(0,n.jsx)("span",{children:"Proxy ship's name"}),(0,n.jsx)("input",{className:o.w,type:"text",name:"name",value:v,onChange:e=>{k(e.target.value)},required:!0})]}),(0,n.jsx)(g.f,{choices:e.owners,current:e.owners.find(e=>e.shipId===j.ownerShipId)??null,help:"A person ship or argo. It answers for this server."}),(0,n.jsxs)("label",{className:o.z,children:[(0,n.jsx)("span",{children:"Calls at once"}),(0,n.jsx)("input",{className:o.w,type:"number",name:"concurrencyLimit",min:1,max:10,defaultValue:j.concurrencyLimit??"4"})]}),null===S?(0,n.jsx)("p",{className:"text-muted-foreground",children:"Its tools show once someone signs in."}):null,(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(c.f,{pending:null===S?"Checking the sign-in…":"Adding…",testId:"add-server-approve",children:""===(x=v.trim())?"Add as outside party":x.length>20?`Add ${x.slice(0,20)}…`:`Add ${x}`}),(0,n.jsx)("button",{type:"button",className:o.x.secondary,onClick:r,children:"Back to the address"})]})]})]})}var k=e.i(65894),S=e.i(31831),I=e.i(76584);function C({fleetId:e,name:s}){let[a,r]=(0,t.useActionState)(I.f,i.Q);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h,{names:m,at:2}),(0,n.jsxs)("form",{action:r,className:`${o.E} grid gap-3.5`,"data-testid":"add-server-sign-in",children:[(0,n.jsx)(x.f,{state:{kind:"done",message:`${s} is added.`}}),(0,n.jsx)(x.f,{state:a}),(0,n.jsx)("input",{type:"hidden",name:i.H,value:e}),(0,n.jsx)("input",{type:"hidden",name:"name",value:s}),(0,n.jsxs)("p",{children:["Sign in to ",s," for yourself. Its tools show after the first sign-in."]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsxs)(c.f,{pending:`Opening ${s}…`,testId:"add-server-sign-in-start",children:["Sign in to ",s]}),(0,n.jsx)("a",{href:(0,k.f)((0,S.N)(s),e),className:o.x.secondary,children:"Later"})]})]})]})}e.s(["AddServer",0,function({fleetId:e,canSwitchTools:s}){let[i,d]=(0,t.useActionState)(r,{step:"address",fields:{}}),[l,o]=(0,t.useActionState)(a,{kind:"idle"}),[c,u]=(0,t.useState)(void 0),m="owner"===i.step&&c!==i.requestId?i:void 0;return(0,n.jsxs)("div",{className:"grid max-w-160 gap-3",children:[(0,n.jsx)("h1",{className:"text-heading-touch font-semibold max-sm:sr-only",children:"Add MCP server"}),"added"===l.kind?(0,n.jsx)(C,{fleetId:e,name:l.name}):void 0===m?(0,n.jsx)(f,{state:i,action:d,fleetId:e}):(0,n.jsx)(y,{state:m,refused:l,action:o,onBack:()=>{u(m.requestId)},fleetId:e,canSwitchTools:s})]})}],27921)},55070,e=>{var n=e.i(43476);let t={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},s={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:a,variant:r="secondary",size:i="regular",children:d,className:l="",disabled:o,...c}){return(0,n.jsx)("button",{...c,disabled:!0===o||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${s[i]} ${t[r]} ${l}`,children:e?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),a]}):d})},"o",0,s])},28008,e=>{e.s(["H",0,"fleet","Q",0,{kind:"idle"}])},88374,e=>{let n=[{kind:"none",label:"No credential"},{kind:"bearer",label:"Bearer token"},{kind:"clientCredentials",label:"OAuth client credentials"}],t={kind:"personSignIn",label:"Each person signs in"},s=[...n,t];e.s(["a",0,s,"x",0,n,"m",0,t,"G",0,function(e){return s.find(({kind:n})=>n===e)?.kind??"bearer"},"C",0,function(e){return n.find(({kind:n})=>n===e)?.kind??"bearer"}])},62052,e=>{var n=e.i(43476),t=e.i(16327),s=e.i(71645),a=e.i(88374),r=e.i(30402);e.s(["f",0,function({legend:e,fields:i,noneHelp:d,canEachPersonSignIn:l=!1,onKindChange:o}){let c=l?a.G:a.C,[u,m]=(0,s.useState)(c(i.credentialKind??""));return(0,n.jsxs)("fieldset",{className:"grid gap-3",children:[(0,n.jsx)("legend",{className:"font-medium",children:e}),(0,n.jsxs)("span",{className:"relative",children:[(0,n.jsx)("select",{className:r.D,"aria-label":e,name:"credentialKind",value:u,onChange:e=>{let n=c(e.target.value);m(n),o?.(n)},children:(l?a.a:a.x).map(({kind:e,label:t})=>(0,n.jsx)("option",{value:e,children:t},e))}),(0,n.jsx)(t.f,{"aria-hidden":!0,className:"pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground"})]}),"clientCredentials"===u?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("label",{className:r.z,children:[(0,n.jsx)("span",{children:"Client id"}),(0,n.jsx)("input",{className:r.w,type:"text",name:"clientId",defaultValue:i.clientId??""})]}),(0,n.jsxs)("label",{className:r.z,children:[(0,n.jsx)("span",{children:"Client secret"}),(0,n.jsx)("input",{className:r.w,type:"password",name:"clientSecret"})]}),(0,n.jsxs)("label",{className:r.z,children:[(0,n.jsx)("span",{children:"Issuer"}),(0,n.jsx)("input",{className:r.w,type:"url",name:"issuer",defaultValue:i.issuer??""})]}),(0,n.jsxs)("label",{className:r.z,children:[(0,n.jsx)("span",{children:"Scope"}),(0,n.jsx)("input",{className:r.w,type:"text",name:"scope",defaultValue:i.scope??""})]})]}):"bearer"===u?(0,n.jsxs)("label",{className:r.z,children:[(0,n.jsx)("span",{children:"Bearer token"}),(0,n.jsx)("input",{className:r.w,type:"password",name:"token"})]}):u===a.m.kind?(0,n.jsx)("p",{className:"text-muted-foreground",children:"Each person signs in for themselves. A ship calls under its owner's sign-in."}):(0,n.jsx)("p",{className:"text-muted-foreground",children:d})]})}])},94984,e=>{var n=e.i(43476);e.s(["f",0,function({state:e,testId:t}){switch(e.kind){case"idle":return null;case"done":return(0,n.jsx)("p",{role:"status","data-testid":t,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e.message});case"refused":case"openNetwork":return(0,n.jsx)("p",{role:"alert","data-testid":t,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e.message})}}])},65818,e=>{var n=e.i(43476),t=e.i(30402);e.s(["f",0,function({choices:e,current:s,help:a,refusal:r}){let i=null===s||e.some(e=>e.shipId===s.shipId)?e:[s,...e];return(0,n.jsxs)("label",{className:t.z,children:[(0,n.jsx)("span",{children:"Owner"}),(0,n.jsxs)("select",{className:t.w,name:"ownerShipId",defaultValue:s?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===s?(0,n.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,i.map(e=>(0,n.jsx)("option",{value:e.shipId,children:e.name},e.shipId))]}),(0,n.jsx)("span",{className:"text-muted-foreground",children:r??a})]})}])},58107,e=>{var n=e.i(43476),t=e.i(74080),s=e.i(30402);e.s(["f",0,function({children:e,pending:a,kind:r="primary",testId:i}){let d=(0,t.useFormStatus)();return(0,n.jsx)("button",{type:"submit",className:s.x[r],disabled:d.pending,"aria-busy":d.pending,"data-testid":i,children:d.pending?a:e})}])},97e3,e=>{var n=e.i(43476);let t={waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",active:"border-tone-active-border bg-tone-active-bg text-tone-active-fg",ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg",ended:"border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg"},s={waiting:"text-tone-waiting-fg",active:"text-tone-active-fg",ok:"text-tone-ok-fg",attention:"rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-tone-attention-fg",ended:"text-tone-ended-fg"};e.s(["T",0,function({tone:e,label:a,look:r="pill",icon:i}){return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-caption ${"pill"===r?`rounded-full border px-2 ${t[e]}`:`h-5.5 px-0.5 font-medium ${s[e]}`}`,children:[i,a]})},"E",0,function({children:e,isMono:t=!1}){return(0,n.jsx)("span",{className:`inline-flex h-5.5 items-center rounded-sm border border-border px-1.5 text-caption font-medium ${t?"font-mono":""}`,children:e})}])}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,21611,e=>{var s=e.i(43476),n=e.i(71645),a=e.i(65894),d=e.i(28008),i=e.i(30402),t=e.i(94984),r=e.i(65818),l=e.i(58107),o=e.i(31831),c=e.i(90526),u=e.i(95187);let m=(0,u.createServerReference)("
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,21611,e=>{var s=e.i(43476),n=e.i(71645),a=e.i(65894),d=e.i(28008),i=e.i(30402),t=e.i(94984),r=e.i(65818),l=e.i(58107),o=e.i(31831),c=e.i(90526),u=e.i(95187);let m=(0,u.createServerReference)("60d12d97585005a36f79e85f11e4f099d39a21ff02",u.callServer,void 0,u.findSourceMapURL,"addA2aClient"),p={kind:"idle"};function h({name:e,bearer:n,fleetId:d}){return(0,s.jsxs)("section",{className:`${i.r} grid gap-3`,"data-testid":"add-a2a-client-added",children:[(0,s.jsxs)("h2",{className:"text-section font-semibold",children:[e," is added"]}),(0,s.jsx)("p",{children:"Hand its client this bearer now. It is shown only once: the gateway keeps no copy it can show again."}),(0,s.jsx)("code",{className:"break-all rounded-md border border-border bg-background px-3 py-2 font-mono text-code","data-testid":"add-a2a-client-bearer",children:n}),(0,s.jsx)("p",{children:(0,s.jsx)("a",{href:(0,a.f)((0,o.N)(e),d),className:"text-primary hover:underline",children:"Its card addresses"})})]})}e.s(["A2aClientForm",0,function({fleetId:e,requestId:a,owners:o,scopes:u}){let[x,f]=(0,n.useActionState)(m,p);return"added"===x.kind?(0,s.jsx)(h,{name:x.name,bearer:x.bearer,fleetId:e}):(0,s.jsxs)("form",{action:f,className:`${i.r} grid max-w-160 gap-3`,"data-testid":"add-a2a-client-form",children:[(0,s.jsx)("input",{type:"hidden",name:d.H,value:e}),(0,s.jsx)("input",{type:"hidden",name:"requestId",value:a}),(0,s.jsx)("h1",{className:"text-heading-touch font-semibold max-sm:sr-only",children:"Add an A2A client"}),(0,s.jsxs)("label",{className:i.z,children:[(0,s.jsx)("span",{children:"Name, the proxy ship's"}),(0,s.jsx)("input",{className:i.w,name:"name",required:!0})]}),(0,s.jsx)(r.f,{choices:o.isOk?o.value:[],current:null,help:"A person ship or argo. It answers for this client.",refusal:o.isOk?void 0:o.refusal}),0===u.length?null:(0,s.jsxs)("fieldset",{className:"grid gap-2",children:[(0,s.jsx)("legend",{className:"font-medium",children:"Scopes, beside sending and receiving"}),u.map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",name:`${c.f}${e}`}),(0,s.jsx)("span",{className:"font-mono text-code",children:e})]},e))]}),(0,s.jsx)("div",{children:(0,s.jsx)(l.f,{pending:"Adding…",children:"Add"})}),(0,s.jsx)(t.f,{state:"refused"===x.kind?x:{kind:"idle"}})]})}],21611)},28008,e=>{e.s(["H",0,"fleet","Q",0,{kind:"idle"}])},94984,e=>{var s=e.i(43476);e.s(["f",0,function({state:e,testId:n}){switch(e.kind){case"idle":return null;case"done":return(0,s.jsx)("p",{role:"status","data-testid":n,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e.message});case"refused":case"openNetwork":return(0,s.jsx)("p",{role:"alert","data-testid":n,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e.message})}}])},65818,e=>{var s=e.i(43476),n=e.i(30402);e.s(["f",0,function({choices:e,current:a,help:d,refusal:i}){let t=null===a||e.some(e=>e.shipId===a.shipId)?e:[a,...e];return(0,s.jsxs)("label",{className:n.z,children:[(0,s.jsx)("span",{children:"Owner"}),(0,s.jsxs)("select",{className:n.w,name:"ownerShipId",defaultValue:a?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===a?(0,s.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,t.map(e=>(0,s.jsx)("option",{value:e.shipId,children:e.name},e.shipId))]}),(0,s.jsx)("span",{className:"text-muted-foreground",children:i??d})]})}])},58107,e=>{var s=e.i(43476),n=e.i(74080),a=e.i(30402);e.s(["f",0,function({children:e,pending:d,kind:i="primary",testId:t}){let r=(0,n.useFormStatus)();return(0,s.jsx)("button",{type:"submit",className:a.x[i],disabled:r.pending,"aria-busy":r.pending,"data-testid":t,children:r.pending?d:e})}])},90526,e=>{e.s(["f",0,"scope:"])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70812,71136,96315,28623,e=>{var t=e.i(56420);let i={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],70812);let a={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],71136);let r={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};r.node;let d=(0,t.f)(r);e.s(["f",0,d],96315);let o={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};o.node;let l=(0,t.f)(o);e.s(["f",0,l],28623)},51481,e=>{var t=e.i(75043);e.s(["f",()=>t.f])},59381,e=>{var t=e.i(56420);let i={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],59381)},55266,e=>{var t=e.i(95187);let i=(0,t.createServerReference)("600d7b220edec9ab18a80038d5b459fae730df7a95",t.callServer,void 0,t.findSourceMapURL,"removeFromBasket");e.s(["f",0,i])},31785,e=>{let t={decide:{name:"Decide",holds:"Questions from your ships",item:"question",items:"questions"},do:{name:"Do what only you can",holds:"Steps: sign in, create, approve",item:"step",items:"steps"},"stay-aware":{name:"Stay aware",holds:"Alerts and notices",item:"alert or notice",items:"alerts and notices"},"everything-else":{name:"Everything else",holds:"Replies and other messages",item:"message",items:"messages"}},i={slack:"Slack",chat:"A chat","web-push":"Web push",email:"Email"},n=["decide","do"],a="Bridge keeps every item.",s={label:"Not offered",isOk:!1},r={label:"Off",isOk:!1},d="Says only that something waits, with a link here.",o=`${d} Nothing is on until you turn it on.`,l="through the gateway. Lists what waits when you ask it.",c={slack:"Slack",chat:"a chat","web-push":"web push",email:"email"};e.s(["I",0,t,"k",0,i,"N",0,["slack","chat","web-push","email"],"g",0,function(e){return 0===e.length?{state:{label:"Not connected",isOk:!1},description:`claude.ai or another MCP client, ${l}`,action:"none"}:{state:{label:"Connected",isOk:!0},description:`${new Intl.ListFormat("en",{type:"conjunction"}).format(e)}, ${l}`,action:"none"}},"t",0,function({isOffered:e,isOnForAnyJob:t}){return e?t?{state:{label:"On",isOk:!0},description:d,action:"turnOff"}:{state:r,description:o,action:"turnOn"}:{state:s,description:"This gateway sends no email.",action:"none"}},"T",0,function(e,t){return e.jobs.filter(({job:e,places:i})=>i.email!==t&&(!t||n.includes(e))).map(({job:e})=>({job:e,place:"email",isOn:t}))},"r",0,function(e){let t=["Bridge",...e.map(e=>c[e])],i=t.at(-1),n=1===t.length?"Bridge":`${t.slice(0,-1).join(", ")} and ${String(i)}`;return`Shows in ${n}, as Where things show sets for Decide. One answer, wherever you give it.`},"H",0,function(e){if(null===e)return{state:{label:"Not connected",isOk:!1},description:"This fleet has no Slack workspace.",action:"none"};let{workspaceName:t,link:i}=e;return null===i?{state:{label:"Not linked",isOk:!1},description:`Link your Slack account in ${t} to see items there and answer them.`,action:"link"}:{state:{label:"Linked",isOk:!0},description:`As @${i.slackName} in ${t}. A button press or a thread reply there is yours.`,action:"unlink"}},"b",0,function(e){let{job:n,place:s,isOn:r,waiting:d,isChatOn:o}=e,{name:l,item:c,items:u}=t[n],m=`${i[s]} is ${r?"on":"off"} for ${l}`;return r?"chat"===s?{title:m,detail:`A chat lists every ${c} not done when you ask it.`}:{title:m,detail:`${i[s]} shows ${u} that arrive from now on.${void 0===d||0===d?"":` The ${String(d)} already waiting ${1===d?"stays":"stay"} ${o?"in Bridge and in a chat":"in Bridge"}.`}`}:{title:m,detail:"everything-else"===n&&"slack"===s?`Bots only: a bot ship's messages and replies to Slack still show there. ${a}`:a}},"B",0,function(e){if(!e.isOffered)return{state:s,description:"This gateway sends no web push.",action:"none"};if(!e.isTaken)return{state:r,description:"This browser takes no web push.",action:"none"};let t=e.browsers.find(({endpoint:t,isGone:i})=>t===e.ownEndpoint&&!i);return void 0===t?{state:r,description:o,action:"turnOn"}:{state:{label:"This browser",isOk:!0},description:`${t.browser}. ${d}`,action:"remove"}}])},94528,e=>{var t=e.i(43476),i=e.i(17904),n=e.i(29039);e.s(["FadedAsLastRead",0,function({children:e}){let a=(0,n.useLastReadAt)();return void 0===a?e:(0,t.jsxs)("div",{className:"grid gap-3",children:[(0,t.jsx)("div",{inert:!0,className:"opacity-60 [&_button:not([data-testid=bridge-item-title])]:hidden",children:e}),(0,t.jsx)("p",{className:"text-caption text-muted-foreground",children:`Shown as last read, at ${(0,i.C)(a)}.`})]})}])},85989,e=>{var t=e.i(43476),i=e.i(70812),n=e.i(47130),a=e.i(29247),s=e.i(12497),r=e.i(17904),d=e.i(55070),o=e.i(19015),l=e.i(82022);function c({href:e,isOutside:i,children:n,...a}){return(0,t.jsxs)("a",{...a,href:e,...i?{target:"_blank",rel:"noopener noreferrer"}:{},className:`inline-flex items-center rounded-md border border-border bg-card text-card-foreground hover:bg-accent ${d.o.row}`,children:[(0,t.jsx)(l.f,{"aria-hidden":"true",className:"size-3.5"}),n]})}var u=e.i(3523),m=e.i(29039);function p(e){let{stale:t,inBasket:i}=e;if(null===t&&null!==i)return null===i.option?"In the basket: the note alone":`In the basket: option ${String(i.option)}`;if(null===t)return"seen"===e.state?(0,s.M)(e.seenIn):void 0;let n=(0,a.f)(t,{from:e.from});return"withdrawn"===t.kind?`${n}: open it to clear it`:n}function h({item:e,opening:i}){let n=e.stale?.replacementId??null;return null===n?null:(0,t.jsx)(d.i,{"data-testid":"bridge-replacement",size:"row",isPending:i.openingId===n,pendingLabel:"Opening...",disabled:void 0!==i.openingId,onClick:()=>{i.open({deliveryId:n,job:e.job})},children:"do"===e.job?"Open the new step":"Open the new question"})}function g({item:e,opening:i}){return(0,t.jsx)(d.i,{"data-testid":"bridge-open",size:"row",isPending:i.openingId===e.deliveryId,pendingLabel:"Opening...",disabled:void 0!==i.openingId,onClick:()=>{i.open(e)},children:"Open"})}function f({item:e,opening:i}){let a=e.actInPlace;return a?.kind==="ownStep"?(0,t.jsx)(c,{"data-testid":"bridge-own-step",href:a.href,isOutside:!1,children:a.label}):(0,t.jsxs)(t.Fragment,{children:[a?.kind==="putPick"?(0,t.jsxs)(d.i,{"data-testid":"bridge-put-pick",variant:"primary",size:"row",isPending:i.puttingId===e.deliveryId,pendingLabel:"Putting...",disabled:void 0!==i.openingId||void 0!==i.puttingId,onClick:()=>{i.putPick(e,a.option)},children:[(0,t.jsx)(n.f,{"aria-hidden":"true",className:"size-3.5"}),"Put option ",a.option," in the basket"]}):null,a?.kind==="openLink"?(0,t.jsxs)(c,{"data-testid":"bridge-step-link",href:a.href,isOutside:!0,children:["Open ",a.host]}):null,(0,t.jsx)(h,{item:e,opening:i}),(0,t.jsx)(g,{item:e,opening:i})]})}function b(e,t){return void 0===t.openingId?()=>{t.open(e)}:void 0}function x({items:e,readAt:i,opening:n}){let a=void 0!==n.opened;return(0,t.jsx)("ul",{className:a?"border-t border-border":"overflow-hidden rounded-lg border border-border bg-card",children:e.map(e=>(0,t.jsx)(o.f,{item:e,now:i,isNew:"new"===e.state,isOpen:n.opened?.deliveryId===e.deliveryId,staleKind:e.stale?.kind,outcome:p(e),failure:n.failure?.deliveryId===e.deliveryId?n.failure.message:void 0,onOpen:b(e,n),actions:a?void 0:(0,t.jsx)(f,{item:e,opening:n})},e.deliveryId))})}function v({items:e,readAt:i,opening:n}){return(0,t.jsx)("ul",{className:void 0===n.opened?"overflow-hidden rounded-lg border border-border bg-card":"border-t border-border",children:e.map(e=>(0,t.jsx)(o.f,{item:e,now:i,isNew:"new"===e.state,isOpen:n.opened?.deliveryId===e.deliveryId,outcome:void 0,failure:n.failure?.deliveryId===e.deliveryId?n.failure.message:void 0,onOpen:b(e,n)},e.deliveryId))})}function y({home:e,readAt:i,opening:n,isStayAware:a}){let{waiting:s,stayAware:r}=e;return a?(0,t.jsxs)("section",{"aria-labelledby":"bridge-stay-aware-heading",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3 px-3 py-2.5",children:[(0,t.jsx)("h2",{id:"bridge-stay-aware-heading",className:"font-semibold",children:"Stay aware"}),(0,t.jsxs)("span",{className:"text-caption text-muted-foreground",children:[r.filter(({state:e})=>"new"===e).length," unseen"]})]}),(0,t.jsx)(v,{items:r,readAt:i,opening:n})]}):(0,t.jsxs)("section",{"aria-labelledby":"bridge-waiting-heading",children:[(0,t.jsxs)("h1",{id:"bridge-waiting-heading",className:"px-3 py-2.5 font-semibold",children:["Waiting on you ",(0,t.jsx)("span",{"data-testid":"bridge-count",className:"text-tone-waiting-fg",children:s.count})]}),(0,t.jsx)(x,{items:s.items,readAt:i,opening:n})]})}function w({home:e,now:n,opening:a,argo:s}){let{waiting:r,stayAware:d}=e,o=new Date(n);return void 0!==a.opened?(0,t.jsx)(y,{home:e,readAt:o,opening:a,isStayAware:"stay-aware"===a.opened.job}):(0,t.jsxs)("div",{className:"grid gap-8",children:[(0,t.jsx)("section",{className:"grid gap-3","aria-labelledby":"bridge-waiting-heading",children:0===r.items.length?(0,t.jsxs)("div",{"data-testid":"bridge-nothing-waits",className:"grid justify-items-center gap-1 rounded-lg border border-border bg-card p-6 text-center",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Nothing waits on you"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"Your ships have what they need from you. A question or a step shows here the moment one arrives."})]}):(0,t.jsx)(x,{items:r.items,readAt:o,opening:a})}),s,(0,t.jsxs)("section",{className:"grid gap-3","aria-labelledby":"bridge-stay-aware-heading",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsxs)("h2",{id:"bridge-stay-aware-heading",className:"inline-flex items-center gap-2 text-section font-semibold",children:[(0,t.jsx)(i.f,{"aria-hidden":"true",className:"size-4 shrink-0"}),"Stay aware"]}),(0,t.jsxs)("span",{className:"text-caption text-muted-foreground",children:[d.filter(({state:e})=>"new"===e).length," unseen, outside the count"]})]}),0===d.length?(0,t.jsx)("p",{"data-testid":"bridge-nothing-new",className:"rounded-md border border-border bg-card p-3 text-muted-foreground",children:"Nothing new. What you saw is in Done."}):(0,t.jsx)(v,{items:d,readAt:o,opening:a})]})]})}function j({items:e,lastReadAt:i}){let n=new Date(i);return(0,t.jsxs)("section",{className:"grid gap-3","aria-label":"Waiting on you, as last read",children:[0===e.length?null:(0,t.jsx)("ul",{inert:!0,className:"overflow-hidden rounded-lg border border-border bg-card opacity-60",children:e.map(e=>(0,t.jsx)(o.f,{item:e,now:n,isNew:"new"===e.state,isOpen:!1,staleKind:e.stale?.kind,outcome:p(e),failure:void 0,onOpen:void 0},e.deliveryId))}),(0,t.jsx)("p",{className:"text-caption text-muted-foreground",children:`Shown as last read, at ${(0,r.C)(i)}.`})]})}e.s(["HomePanel",0,function({fleetId:e,home:i,now:n,decidePlaces:a,argo:s}){let r=(0,m.useLastReadAt)();return void 0!==r?(0,t.jsx)(j,{items:i.waiting.items,lastReadAt:r}):(0,t.jsx)(u.f,{fleetId:e,decidePlaces:a,children:e=>(0,t.jsx)(w,{home:i,now:n,opening:e,argo:s})})},"StayAwareRows",0,v],85989)},3523,e=>{var t=e.i(43476),i=e.i(58487),n=e.i(5654),a=e.i(71645),s=e.i(73459),r=e.i(65894),d=e.i(67697),o=e.i(91710),l=e.i(11015),c=e.i(99522),u=e.i(75862),m=e.i(55266),p=e.i(57228),h=e.i(34244),g=e.i(43328),f=e.i(27538),b=e.i(77826),x=e.i(80734),v=e.i(60296),y=e.i(66734),w=e.i(47130);function j(){let{toasts:e}=n.f.useToastManager();return(0,t.jsx)(g.f.Portal,{children:(0,t.jsx)(f.f.Viewport,{className:"fixed bottom-4 left-4 z-50 hidden w-[min(24rem,calc(100vw-2rem))] gap-2 sm:grid",children:e.map(e=>(0,t.jsxs)(b.f.Root,{toast:e,"data-testid":"bridge-basket-toast",className:"flex items-start gap-3 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:[(0,t.jsx)(w.f,{"aria-hidden":!0,className:"mt-0.5 size-4 shrink-0"}),(0,t.jsxs)(x.f.Content,{className:"grid flex-1 gap-1",children:[(0,t.jsx)(v.f.Title,{className:"font-medium"}),(0,t.jsx)(y.f.Description,{className:"text-caption text-muted-foreground"})]})]},e.id))})})}var k=e.i(54235),N=e.i(62579),S=e.i(63132),I=e.i(75103),$=e.i(52021);function O({fleetId:e,decidePlaces:i,consoleUrl:g,children:f}){let b=n.f.useToastManager(),x=(0,I.P)(),[v,y]=(0,a.useState)(),[w,j]=(0,a.useState)(""),[A,R]=(0,a.useState)(),[z,P]=(0,a.useState)(),[L,M]=(0,a.useState)(),[T,B]=(0,a.useState)(),[D,C]=(0,a.useState)(),[U,q]=(0,a.useState)(),[,F]=(0,a.useTransition)(),[_,W]=(0,a.useState)(0);(0,$.R)(void 0===v?void 0:(0,h.u)(v.opened.job),()=>{y(void 0)});let H=t=>{R(t.deliveryId),B(void 0),q(void 0),F(async()=>{let i=await (0,l.f)(e,t.deliveryId);if(R(void 0),i.isOk){let e=t.inBasket??null;y({delivery:i.value,opened:{job:t.job,isAlert:t.isAlert??!1,wasNew:"seen"!==t.state},inBasket:e,finished:null}),j(e?.note??""),C(void 0)}else B({deliveryId:t.deliveryId,message:i.message})})},V=({control:e,action:t,onSettled:i})=>{M(e),C(void 0),F(async()=>{let e=await t();M(void 0),e.isOk?i(e.value):C(e.message)})},Y=e=>()=>{y(void 0),q(e)},E=void 0===v?void 0:{deliveryId:v.delivery.deliveryId,job:v.opened.job};return(0,t.jsx)(N.f,{list:(0,t.jsxs)("div",{className:"grid gap-4",children:[void 0===U?null:(0,t.jsx)(S.f,{message:U,isFailure:!1}),f({open:H,openingId:A,putPick:(t,i)=>{P(t.deliveryId),B(void 0),q(void 0),F(async()=>{let n=await (0,u.f)({fleet:e,deliveryId:t.deliveryId,option:i});P(void 0),n.isOk?(q(`Option ${String(i)} is in the basket, not sent: ${t.from} receives it when you send the basket.`),W(e=>e+1)):B({deliveryId:t.deliveryId,message:n.message})})},puttingId:z,failure:T,opened:E})]},_),item:void 0===v?void 0:(({delivery:n,inBasket:a,opened:l,finished:u})=>{let h=n.question?.id;return(0,t.jsx)(k.u,{delivery:n,opened:l,meetingHref:void 0===n.meetingId?void 0:(0,s.f)({fleetId:e,meetingId:n.meetingId}),consoleUrl:g,basketHref:(0,r.f)(p.H,e),inBasket:a,finished:u,places:i,note:w,working:L,failure:D,onNoteChange:j,onAnswer:t=>{V({control:void 0===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,d.f)({fleet:e,deliveryId:n.deliveryId,input:{questionId:n.question?.id,option:t,note:w}}),onSettled:Y(`Your answer went to ${n.from}.`)})},onPut:t=>{V({control:null===t?{kind:"note"}:{kind:"option",option:t},action:()=>(0,c.f)({fleet:e,deliveryId:n.deliveryId,option:t,optionLabel:n.question?.options.find(({key:e})=>e===t)?.label??null,note:w}),onSettled:e=>{var t;y({delivery:n,opened:l,finished:u,inBasket:e}),b.add({title:null===(t=e.option)?"Your note alone in the basket":`Option ${String(t)} in the basket`,description:"Not sent. Still waiting on you until you send it."})}})},onSend:t=>{V({control:{kind:"send"},action:()=>(0,d.f)({fleet:e,deliveryId:n.deliveryId,input:{questionId:h,option:t??void 0,note:w}}),onSettled:Y(`Your answer went to ${n.from}.`)})},onRemove:()=>{void 0!==h&&V({control:{kind:"remove"},action:()=>(0,m.f)(e,h),onSettled:Y(`Your answer to “${n.title}” is out of the basket; the question still waits on you.`)})},onDone:()=>{V({control:{kind:"done"},action:()=>(0,o.f)({fleet:e,deliveryId:n.deliveryId}),onSettled:Y(`Done with “${n.title}”.`)})},onFinishStep:t=>{V({control:{kind:t},action:()=>(0,o.f)({fleet:e,deliveryId:n.deliveryId,step:{outcome:t,note:w}}),onSettled:()=>{y({delivery:n,inBasket:a,opened:l,finished:{outcome:t,note:w.trim(),at:new Date().toISOString()}})}})},onOpen:e=>{H({deliveryId:e,job:l.job})},onSendMessage:void 0===n.alertShip||void 0===x?void 0:e=>{x({alertShip:e})},onBack:()=>{y(void 0)}},n.deliveryId)})(v)})}e.s(["f",0,function({fleetId:e,decidePlaces:n,consoleUrl:a,children:s}){return(0,t.jsxs)(i.f.Provider,{children:[(0,t.jsx)(O,{fleetId:e,decidePlaces:n,consoleUrl:a,children:s}),(0,t.jsx)(j,{})]})}],3523)},92587,e=>{var t=e.i(43476),i=e.i(35159),n=e.i(85989),a=e.i(3523);e.s(["StayAwarePanel",0,function({fleetId:e,consoleUrl:s,stayAware:r,now:d}){return(0,t.jsx)(a.f,{fleetId:e,consoleUrl:s,children:e=>(0,t.jsxs)("section",{className:"grid gap-3","aria-labelledby":"bridge-stay-aware-heading",children:[(0,t.jsxs)("div",{className:`flex items-baseline justify-between gap-3 max-sm:sr-only ${void 0===e.opened?"":"px-3 pt-2.5"}`,children:[(0,t.jsx)("h1",{id:"bridge-stay-aware-heading",className:void 0===e.opened?"text-heading font-semibold":"font-semibold",children:"Stay aware"}),(0,t.jsx)("span",{"data-testid":"bridge-stay-aware-count",className:"text-caption text-muted-foreground",children:(0,i.E)(r.filter(({state:e})=>"new"===e).length)})]}),(0,t.jsx)("p",{className:"text-caption text-muted-foreground sm:hidden",children:"Not in the count. Seeing one is all it asks."}),0===r.length?(0,t.jsx)("p",{"data-testid":"bridge-nothing-new",className:"rounded-md border border-border bg-card p-3 text-muted-foreground",children:"Nothing new. What you saw is in Done."}):(0,t.jsx)(n.StayAwareRows,{items:r,readAt:new Date(d),opening:e})]})})}])},55070,e=>{var t=e.i(43476);let i={primary:"bg-primary text-primary-foreground hover:bg-primary-hover",secondary:"border border-border bg-card text-card-foreground hover:bg-accent",ghost:"text-foreground hover:bg-accent"},n={regular:"h-9 gap-2 px-4",row:"h-9 gap-2 px-4 text-body sm:h-6 sm:gap-1.5 sm:px-2.5 sm:text-meta",small:"h-8 gap-2 px-3 text-meta",xs:"h-7 gap-1.5 px-2.5 text-caption font-medium"};e.s(["i",0,function({isPending:e,pendingLabel:a,variant:s="secondary",size:r="regular",children:d,className:o="",disabled:l,...c}){return(0,t.jsx)("button",{...c,disabled:!0===l||e,"aria-busy":e,className:`inline-flex items-center rounded-md disabled:cursor-not-allowed disabled:opacity-70 ${n[r]} ${i[s]} ${o}`,children:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}),a]}):d})},"o",0,n])},19015,e=>{var t=e.i(43476),i=e.i(70812),n=e.i(71136),a=e.i(96315),s=e.i(49287),r=e.i(28623),d=e.i(12497),o=e.i(91604),l=e.i(63132),c=e.i(779);let u={bridge:{icon:s.f,name:"Bridge"},slack:{icon:n.f,name:"Slack"},chat:{icon:r.f,name:"a chat"},"web-push":{icon:i.f,name:"web push"},email:{icon:a.f,name:"email"}};function m(){return(0,t.jsx)("span",{"aria-hidden":"true",className:"text-border",children:"·"})}function p({places:e}){var i;let n,a=["bridge",...e].map(e=>u[e]);return(0,t.jsx)("span",{role:"img","aria-label":`Shows in ${(n=(i=a.map(({name:e})=>e)).at(-1)??"",i.length<2?n:`${i.slice(0,-1).join(", ")} and ${n}`)}`,className:"inline-flex items-center gap-0.5",children:a.map(({icon:e,name:i})=>(0,t.jsx)(e,{"aria-hidden":"true",className:"size-3"},i))})}e.s(["f",0,function({item:e,now:i,isNew:n,isOpen:a=!1,staleKind:s,outcome:r,failure:u,onOpen:h,time:g,detail:f,actions:b}){var x;let v=e.isAlert??!1,y=(0,o.f)({job:e.job,isAlert:v}),w=y.icon,j="min-w-0 break-words text-left text-body-touch font-medium sm:truncate sm:text-body",k=void 0===s?e.title:(0,t.jsx)("s",{className:"decoration-muted-foreground",children:e.title});return(0,t.jsxs)("li",{"data-testid":"bridge-item","data-stale":void 0!==s,"aria-current":!!a||void 0,className:`grid min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto] items-start gap-x-2.5 gap-y-1.5 border-t border-border px-3 py-2.5 first:border-t-0 ${function({isOpen:e,isStale:t}){return e?"bg-highlight shadow-[inset_2px_0_0_var(--primary)]":t?"bg-muted":""}({isOpen:a,isStale:void 0!==s})}`,children:[(0,t.jsx)(w,{"aria-hidden":"true",className:`mt-0.5 size-4 ${y.tone}`}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-baseline sm:items-center",children:[n?(0,t.jsx)("span",{"aria-label":"New",className:"mr-1.5 size-[7px] shrink-0 -translate-y-px rounded-full bg-primary"}):null,void 0===h?(0,t.jsx)("span",{"data-testid":"bridge-item-title",className:j,children:k}):(0,t.jsx)("button",{type:"button","data-testid":"bridge-item-title",onClick:h,className:`${j} hover:underline`,children:k})]}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-caption text-muted-foreground",children:[(0,t.jsx)("span",{className:`font-medium ${y.tone}`,children:(0,d.z)({job:e.job,isAlert:v})}),(0,t.jsx)(m,{}),(0,t.jsx)("span",{children:e.from}),void 0===r?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{}),(0,t.jsxs)("span",{"data-testid":"bridge-outcome",className:"inline-flex items-center gap-1.5",children:[void 0===s?null:(0,t.jsx)(c.f,{kind:s}),r]})]}),void 0===e.places?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{}),(0,t.jsx)(p,{places:e.places})]})]})]}),(0,t.jsx)("time",{dateTime:g?.at??e.sentAt,title:(x=g?.at??e.sentAt,`${new Date(x).toISOString().slice(0,16).replace("T"," ")} UTC`),className:"whitespace-nowrap text-right text-caption text-muted-foreground",children:g?.said??(0,d.V)(e.sentAt,i)}),void 0===f?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2",children:f}),null==b?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2 flex flex-wrap items-center gap-1.5",children:b}),void 0===u?null:(0,t.jsx)("div",{className:"col-span-2 col-start-2",children:(0,t.jsx)(l.f,{message:u,isFailure:!0})})]})}])},63132,e=>{var t=e.i(43476);e.s(["f",0,function({message:e,isFailure:i}){return i?(0,t.jsx)("p",{role:"alert","data-testid":"bridge-failure",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e}):(0,t.jsx)("p",{role:"status","data-testid":"bridge-success",className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e})}])},73459,67697,91710,11015,99522,75862,e=>{e.s(["f",0,function(e){let t=new URLSearchParams({fleet:e.fleetId,...void 0===e.cursor?{}:{cursor:e.cursor}});return`/meetings/${encodeURIComponent(e.meetingId)}?${t.toString()}`}],73459);var t=e.i(95187);let i=(0,t.createServerReference)("409cd60338f4d2ebe089c816413026d35d3df175a5",t.callServer,void 0,t.findSourceMapURL,"answerDelivery");e.s(["f",0,i],67697);let n=(0,t.createServerReference)("408692edd7e68a3b2abfaf17b76ec93d0a21b9b8dd",t.callServer,void 0,t.findSourceMapURL,"doneDelivery");e.s(["f",0,n],91710);let a=(0,t.createServerReference)("6097df6443a06e5261e3227b1398330a1729afe230",t.callServer,void 0,t.findSourceMapURL,"openDelivery");e.s(["f",0,a],11015);let s=(0,t.createServerReference)("4014750f115befb3caee699cea842d94c42ccdf35a",t.callServer,void 0,t.findSourceMapURL,"putInBasket");e.s(["f",0,s],99522);let r=(0,t.createServerReference)("405ccc10e32995d237032f7358fbf9bc977ccbaa8d",t.callServer,void 0,t.findSourceMapURL,"putPickInBasket");e.s(["f",0,r],75862)}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25621,e=>{var t=e.i(43476);e.s(["f",0,function({isOn:e,label:n,isPending:s=!1,type:r="button",onClick:a,testId:l}){return(0,t.jsx)("button",{type:r,role:"switch","aria-checked":e,"aria-label":n,"aria-busy":s,disabled:s,onClick:a,"data-testid":l,className:`inline-flex h-5 w-9 shrink-0 items-center rounded-full border p-0.5 transition-colors disabled:opacity-60 ${e?"border-primary bg-primary":"border-input bg-muted"}`,children:(0,t.jsx)("span",{className:`size-3.5 rounded-full bg-background shadow-sm transition-transform ${e?"translate-x-4":"translate-x-0"} ${s?"animate-pulse":""}`})})}])},37018,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("60c6954ee32ef0da770b4a80d316382eb6c0a4c980",t.callServer,void 0,t.findSourceMapURL,"signInToParty");e.s(["f",0,n])},27055,19407,17779,35671,44047,90218,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("4055624bd11ca2ade15b378b28829dee0ac23423c1",t.callServer,void 0,t.findSourceMapURL,"setPartyScopes");function s(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e.at(-1)??""}`}function r(e){return`${String(e)} ${1===e?"tool":"tools"}`}function a(e,t){return null===t?e:`${e}; the fleet sees it at the proxy ship's next statement: ${t}`}e.s(["f",0,n],27055),e.s(["B",0,function({party:e,scopes:t}){return 0===t.length?`Every message to ${e} needs nothing beyond reaching it`:`Every message to ${e} needs ${s(t)}`},"G",0,function({party:e,scopes:t}){return 0===t.length?`Every tool of ${e} needs nothing beyond reaching it`:`Every tool of ${e} needs ${s(t)}`},"y",0,function({scopes:e,how:t,count:n}){return"remove"===t?`${s(e)} removed from ${r(n)}`:0===e.length?`${r(n)} need${1===n?"s":""} nothing of ${1===n?"its":"their"} own`:`${s(e)} set on ${r(n)}`},"I",0,a,"q",0,function(e){return e.map(({scopes:e,count:t})=>`${s(e)} set on ${r(t)}`).join("; ")},"g",0,function({count:e,isOn:t,statementRefusal:n}){return a(`${r(e)} switched ${t?"on":"off"}`,n)}],19407);var l=e.i(43476);e.s(["f",0,function({party:e=[],own:t,listed:n}){if(0===e.length&&0===t.length)return(0,l.jsx)("span",{className:"text-muted-foreground",children:"Nothing"});let s=(e,t)=>{let s=null!==n&&!n.has(e);return(0,l.jsxs)("span",{className:`inline-flex items-center rounded-md border px-2 font-mono text-caption ${s?"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg":t?"border-transparent bg-muted text-muted-foreground":"border-border"}`,"data-testid":t?"tools-table-party-scope":"tools-table-scope",title:s?"No longer defined in the fleet":t?"Every tool needs it":void 0,children:[e,s?(0,l.jsx)("span",{className:"ml-1 font-sans",children:"(no longer defined)"}):null]},`${t?"party":"own"}-${e}`)};return(0,l.jsxs)("span",{className:"flex flex-wrap gap-1",children:[e.map(e=>s(e,!0)),t.filter(t=>!e.includes(t)).map(e=>s(e,!1))]})}],17779);var i=e.i(24189),i=i,o=e.i(93976),d=e.i(37134),c=i,u=i,p=i,f=i,m=e.i(62050),h=e.i(45017),g=e.i(47125),x=e.i(10030),b=e.i(58998),v=e.i(94313),w=e.i(53535),y=i;let S=({scope:e,description:t})=>({value:e,label:e,description:t});e.s(["f",0,function({label:e,listed:t,picked:n,onPick:s,isDisabled:r=!1,testId:a}){let{contains:j}=i.useFilter(),N=[...t.map(S),...n.filter(e=>!t.some(t=>t.scope===e)).map(e=>({value:e,label:e,description:"No longer defined in the fleet"}))],R=N.filter(e=>n.includes(e.value));return(0,l.jsxs)(o.f.Root,{multiple:!0,items:N,value:R,disabled:r,isItemEqualToValue:(e,t)=>e.value===t.value,onValueChange:(e,t)=>{"escape-key"===t.reason?t.cancel():s(e.map(e=>e.value))},filter:(e,t)=>j(e.label,t)||j(e.description,t),children:[(0,l.jsxs)("div",{className:"grid gap-1","data-testid":a,children:[(0,l.jsx)(d.f.Label,{className:"font-medium",children:e}),(0,l.jsx)(c.InputGroup,{className:"flex min-h-9 flex-wrap items-center gap-1 rounded-md border border-input bg-background px-2 py-1",children:(0,l.jsxs)(u.Chips,{className:"contents",children:[R.map(e=>(0,l.jsxs)(p.Chip,{className:"inline-flex items-center gap-1 rounded-md border border-border bg-muted px-2 font-mono text-caption","aria-label":e.value,children:[e.value,(0,l.jsx)(f.ChipRemove,{className:"text-muted-foreground hover:text-foreground","aria-label":`Remove ${e.value}`,children:"×"})]},e.value)),(0,l.jsx)(m.f.Input,{placeholder:0===R.length?"Search the fleet's scopes":"",className:"h-7 min-w-32 flex-1 bg-transparent outline-none"})]})})]}),(0,l.jsx)(h.f.Portal,{children:(0,l.jsx)(g.f.Positioner,{sideOffset:4,className:"z-50",children:(0,l.jsxs)(x.f.Popup,{className:"max-h-72 w-(--anchor-width) overflow-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",children:[(0,l.jsx)(b.f.Empty,{className:"px-2 py-1 text-muted-foreground",children:"No scope listed matches."}),(0,l.jsx)(v.f.List,{children:e=>(0,l.jsxs)(w.f.Item,{value:e,className:"grid cursor-default grid-cols-[1rem_1fr] gap-x-2 rounded px-2 py-1 data-highlighted:bg-accent",children:[(0,l.jsx)(y.ItemIndicator,{className:"row-span-2",children:"✓"}),(0,l.jsx)("span",{className:"col-start-2 font-mono text-code",children:e.value}),(0,l.jsx)("span",{className:"col-start-2 text-caption text-muted-foreground",children:e.description})]},e.value)})]})})})]})}],35671);var j=e.i(26323),N=e.i(9977),R=e.i(41708),C=e.i(93480),k=e.i(9169),$=e.i(52744),P=e.i(30402),T=e.i(55070);e.s(["G",0,function({isOpen:e,onClose:t,title:n,description:s,children:r,appliesTo:a,action:i,isSaving:o,refusal:d,onReload:c,isReloading:u,testId:p}){return(0,l.jsx)(j.f.Root,{open:e,onOpenChange:e=>{e||o||t()},children:(0,l.jsxs)(N.f.Portal,{children:[(0,l.jsx)(R.f.Backdrop,{className:"fixed inset-0 z-40 bg-(--overlay)"}),(0,l.jsxs)(C.f.Popup,{className:"fixed top-1/2 left-1/2 z-50 grid max-h-[90vh] w-[min(36rem,calc(100vw-2rem))] -translate-1/2 gap-4 overflow-auto rounded-lg border border-border bg-popover p-6 text-popover-foreground shadow-lg","data-testid":p,children:[(0,l.jsxs)("div",{className:"grid gap-1",children:[(0,l.jsx)(k.f.Title,{className:"text-heading font-semibold",children:n}),(0,l.jsx)($.f.Description,{className:"text-muted-foreground",children:s})]}),(0,l.jsx)("fieldset",{disabled:o,className:"grid gap-4",children:r}),null===d?null:(0,l.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg","data-testid":"tools-table-dialog-refusal",children:[(0,l.jsx)("span",{children:d.message}),d.isConflict?(0,l.jsx)(T.i,{isPending:u,pendingLabel:"Reloading…",onClick:c,"data-testid":"tools-table-reload",children:"Reload"}):null]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,l.jsx)("span",{className:"text-muted-foreground","data-testid":"tools-table-applies-to",children:a}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",className:P.x.secondary,disabled:o,onClick:t,children:"Cancel"}),(0,l.jsx)(T.i,{variant:"primary",isPending:o,pendingLabel:i.pending,disabled:i.isDisabled||u,onClick:i.onPress,"data-testid":"tools-table-dialog-action",children:i.label})]})]})]})]})})},"V",0,function(e,t){return e?.isConflict===!0&&t>e.version?null:e}],44047);var O=e.i(5654),I=e.i(43328),M=e.i(27538),D=e.i(77826),A=e.i(80734),E=e.i(60296),F=e.i(88941);e.s(["f",0,function(){let{toasts:e}=O.f.useToastManager();return(0,l.jsx)(I.f.Portal,{children:(0,l.jsx)(M.f.Viewport,{className:"fixed right-4 bottom-4 z-50 grid w-[min(24rem,calc(100vw-2rem))] gap-2",children:e.map(e=>(0,l.jsx)(D.f.Root,{toast:e,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-4 py-3 text-tone-ok-fg shadow-md","data-testid":"tools-table-toast",children:(0,l.jsxs)(A.f.Content,{className:"flex items-start justify-between gap-3",children:[(0,l.jsx)(E.f.Title,{}),(0,l.jsx)(F.f.Close,{"aria-label":"Dismiss",children:"×"})]})},e.id))})})}],90218)},12589,e=>{var t=e.i(43476),n=e.i(58487),s=e.i(5654),r=e.i(18566),a=e.i(71645),l=e.i(27055),i=e.i(19407),o=e.i(17779),d=e.i(35671),c=e.i(44047),u=e.i(90218);function p({fleetId:e,party:n,version:u,scopes:f,listed:m,canChange:h}){let g=(0,r.useRouter)(),x=s.f.useToastManager(),[,b]=(0,a.useTransition)(),[v,w]=(0,a.useTransition)(),[y,S]=(0,a.useState)(!1),[j,N]=(0,a.useState)([]),[R,C]=(0,a.useState)(!1),[k,$]=(0,a.useState)(null),[P,T]=(0,a.useState)(null),[O,I]=(0,a.useState)(0),[M,D]=(0,a.useState)(null),A=M?.basis===f?M.scopes:f;return(0,t.jsxs)("div",{className:`flex flex-wrap items-center gap-2 rounded-md ${O>0?"animate-highlight":""}`,"data-testid":"agent-needs",children:[(0,t.jsx)(o.f,{own:A,listed:null===m?null:new Set(m.map(({scope:e})=>e))}),h&&null!==m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"text-primary hover:underline",onClick:()=>{N([...A]),$(null),S(!0)},"data-testid":"agent-needs-change",children:"Change…"}),(0,t.jsx)(c.G,{isOpen:y,onClose:()=>{S(!1)},title:"Every message needs",description:`The scopes a calling ship must hold to message ${n}.`,appliesTo:`Applies to every message to ${n}`,action:{label:"Save",pending:"Saving…",isDisabled:!1,onPress:()=>{C(!0),$(null);let t=Math.max(u,P??0);b(async()=>{let s=await (0,l.f)({fleetId:e,name:n,version:t,party:j,tools:[]});(C(!1),s.isOk)?(T(s.version),D({basis:f,scopes:j}),S(!1),I(e=>e+1),x.add({title:(0,i.I)((0,i.B)({party:n,scopes:j}),s.statementRefusal)}),g.refresh()):$({message:s.message,isConflict:s.isConflict,version:t})})}},isSaving:R,refusal:(0,c.V)(k,Math.max(u,P??0)),isReloading:v,onReload:()=>{w(()=>{g.refresh()})},testId:"agent-needs-dialog",children:(0,t.jsx)(d.f,{label:"Scopes",listed:m,picked:j,onPick:N,isDisabled:R,testId:"agent-needs-picker"})})]}):null]},O)}e.s(["AgentNeeds",0,function(e){return(0,t.jsxs)(n.f.Provider,{children:[(0,t.jsx)(p,{...e}),(0,t.jsx)(u.f,{})]})}])},54418,e=>{var t,n,s=e.i(43476),r=e.i(71645),a=e.i(8821),l=e.i(52245),i=e.i(79938);let o="--drawer-height",d="--drawer-swipe-movement-x",c="--drawer-swipe-movement-y",u="--drawer-snap-point-offset",p="--drawer-swipe-strength",f="--drawer-swipe-progress",m=r.forwardRef(function(e,t){let{render:n,className:s,style:r,forceRender:o=!1,...d}=e,c=(0,a.x)(),u=c.useState("open"),m=c.useState("nested"),h=c.useState("mounted"),g=c.useState("transitionStatus");return(0,l.a)("div",e,{state:{open:u,transitionStatus:g},ref:[c.context.backdropRef,t],stateAttributesMapping:i.M,props:[{role:"presentation",hidden:!h,style:{pointerEvents:u?void 0:"none",userSelect:"none",WebkitUserSelect:"none",[f]:"0",[p]:"1"}},d],enabled:o||!m})}),h=e.i(56736).f,g="data-drawer-content",x=r.forwardRef(function(e,t){let{render:n,className:s,style:r,...i}=e;return(0,a.x)(),(0,l.a)("div",e,{ref:t,props:[{[g]:""},i]})});var b=e.i(46376),v=e.i(67865),w=e.i(56789),y=e.i(61487),S=e.i(35890),j=e.i(64938),N=e.i(80829),R=e.i(6640);S.f.open,j.f.closed,N.f.startingStyle,R.f.endingStyle;let C="data-swipe-dismiss",k="data-swiping";var $=e.i(25834),P=e.i(37584),T=e.i(73327),O=e.i(33332);let I=r.createContext(void 0);function M(e){let t=r.useContext(I);if(!0!==e&&void 0===t)throw Error((0,O.f)(90));return t}var D=e.i(8868),A=e.i(24429);function E(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function F(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if("number"==typeof e)return Number.isFinite(e)?e<=1?(0,A.f)(e,0,1)*t:e:null;let s=e.trim();if(s.endsWith("px")){let e=Number.parseFloat(s);return Number.isFinite(e)?e:null}if(s.endsWith("rem")){let e=Number.parseFloat(s);return Number.isFinite(e)?e*n:null}return null}function U(e,t){let n=-1,s=1/0;for(let r=0;r<e.length;r+=1){let a=Math.abs(e[r]-t);a<s&&(s=a,n=r)}return n}function z(){let e=(0,a.x)(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:s,popupHeight:l}=M(),i=e.useState("viewportElement"),[o,d]=r.useState(0),[c,u]=r.useState(16),p=(0,v.f)(()=>{let e=(0,D.f)(i).documentElement;d(i?i.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&u(t)});(0,b.f)(()=>{if(p(),!i||"function"!=typeof ResizeObserver)return;let e=new ResizeObserver(p);return e.observe(i),()=>{e.disconnect()}},[p,i]);let f=r.useMemo(()=>{if(!t||0===t.length||o<=0||l<=0)return[];let e=Math.min(l,o),n=t.map(t=>{let n=F(t,o,c);if(null===n)return null;let s=(0,A.f)(n,0,e);return{value:t,height:s,offset:Math.max(0,l-s)}}).filter(e=>!!e);if(n.length<=1)return n;let s=[],r=[];for(let e=n.length-1;e>=0;e-=1){let t=n[e];r.some(e=>1>=Math.abs(e-t.height))||(r.push(t.height),s.push(t))}return s.reverse(),s},[l,c,t,o]),m=r.useMemo(()=>{if(null===n)return;let e=f.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(l,o),s=F(n,o,c);if(null===s)return;let r=(0,A.f)(s,0,t);return f[U(f.map(e=>e.height),r)]},[n,l,f,c,o]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:s,popupHeight:l,viewportHeight:o,resolvedSnapPoints:f,activeSnapPointOffset:m?.offset??null}}let H=r.createContext(null);var L=e.i(64111);let Y=!1,X={...i.M,expanded:e=>e?{"data-expanded":""}:null,nestedDrawerOpen:e=>e?{"data-nested-drawer-open":""}:null,nestedDrawerSwiping:e=>e?{"data-nested-drawer-swiping":""}:null,swipeDirection:e=>({"data-swipe-direction":e}),swiping:e=>e?{[k]:""}:null},V=r.forwardRef(function(e,t){let n,{render:i,className:m,style:h,finalFocus:g,initialFocus:x,...S}=e,j=(0,a.x)(),N=j.context.popupRef,{swipeDirection:R,frontmostHeight:C,hasNestedDrawer:k,nestedSwiping:O,nestedSwipeProgressStore:I,onPopupHeightChange:D,notifyParentFrontmostHeight:A,notifyParentHasNestedDrawer:F}=M(),U=j.useState("descriptionElementId"),V=j.useState("disablePointerDismissal"),G=j.useState("floatingRootContext"),W=j.useState("popupProps"),B=j.useState("modal"),K=j.useState("mounted"),q=j.useState("nested"),J=j.useState("nestedOpenDrawerCount"),Q=j.useState("transitionStatus"),Z=j.useState("open"),_=j.useState("openMethod"),ee=j.useState("titleElementId"),et=j.useState("role"),en=G.useState("floatingId"),es=S.id??en,er=r.useContext(H);(0,$.Z)();let{snapPoints:ea,activeSnapPoint:el,activeSnapPointOffset:ei}=z(),eo=J>0,ed=er?.swiping??!1,ec=er?.swipeStrength??null,[eu,ep]=r.useState(0),ef=r.useRef(0),em=(0,v.f)(()=>{let e=N.current;if(!e)return;let t=e.offsetHeight;if(!(ef.current>0)||!(C>ef.current)||!(t>ef.current)){if(ef.current>0&&k){let e=ef.current;ep(e),D(e);return}t!==ef.current&&(ef.current=t,ep(t),D(t))}});(0,b.f)(()=>{if(!K){ef.current=0,ep(0),D(0);return}let e=N.current;if(!e||(Y||("u">typeof CSS&&"registerProperty"in CSS&&([d,c,u].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),[{name:f,initialValue:"0"},{name:p,initialValue:"1"}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:"<number>",inherits:!1,initialValue:t})}catch{}})),Y=!0),em(),"function"!=typeof ResizeObserver))return;let t=new ResizeObserver(em);return t.observe(e),()=>{t.disconnect()}},[em,K,eo,D,N]),(0,b.f)(()=>{let e=()=>{let e=N.current;if(!e)return;let t=I.getSnapshot();t>0?e.style.setProperty(f,`${t}`):e.style.setProperty(f,"0")};e();let t=I.subscribe(e),n=N.current;return()=>{t(),n&&n.style.setProperty(f,"0")}},[I,N]),(0,b.f)(()=>{if(Z)return A?.(C),()=>{A?.(0)}},[C,Z,A]),(0,b.f)(()=>{if(F)return F(Z||"ending"===Q),()=>{F(!1)}},[F,Z,Q]),(0,P.f)({open:Z,ref:N,onComplete(){Z&&j.context.onOpenChangeComplete?.(!0)}});let eh=void 0===x?N:x,eg=j.useStateSetter("popupElement"),ex=!k&&"ending"!==Q;eu&&!ex&&(n=`${eu}px`);let eb=ea&&ea.length>0&&("down"===R||"up"===R),ev=null;eb&&null!==ei&&(ev="up"===R?-ei:ei);let ew=er?er.getDragStyles():w.w;if(eb&&"down"===R){let e=Number.parseFloat(String(ew[c]));ew=ed&&Number.isFinite(e)?{...ew,transform:void 0,[c]:`${E(ei??0,e)}px`}:{...ew,transform:void 0}}let ey=(0,l.a)("div",e,{state:{open:Z,nested:q,transitionStatus:Q,expanded:1===el,nestedDrawerOpen:eo,nestedDrawerSwiping:O,swipeDirection:R,swiping:ed},props:[W,{id:es,"aria-labelledby":ee,"aria-describedby":U,role:et,...L.X,hidden:!K,onKeyDown(e){T.f.has(e.key)&&e.stopPropagation()},style:{...ew,[f]:"0","--nested-drawers":J,[o]:n,[u]:"number"==typeof ev?`${ev}px`:"0px","--drawer-frontmost-height":C?`${C}px`:void 0,[p]:"number"==typeof ec&&Number.isFinite(ec)&&ec>0?`${ec}`:"1"}},S],ref:[t,N,eg],stateAttributesMapping:X});return(0,s.jsx)(y.f,{context:G,openInteractionType:_,disabled:!K,closeOnFocusOut:!V,initialFocus:eh,returnFocus:g,modal:!1!==B,restoreFocus:"popup",children:ey})}),G=e.i(64951).f;var W=e.i(74735),B=e.i(51437),K=e.i(33848),q=e.i(22162),J=e.i(75606),Q=e.i(80025),Z=e.i(16856),Z=Z,_=e.i(66250);let ee=r.createContext(void 0);function et(){return r.useContext(ee)}function en(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let s=Number.isFinite(n)?n:0;s!==e&&(e=s,t.forEach(e=>{e()}))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}}function es(){let e=et(),t=(0,a.x)(!1),n=e?.setDrawerOpen,s=e?.removeDrawer,l=t.useState("open"),i=t.useState("nestedOpenDialogCount"),o=t.useState("popupElement"),d=0===i;return(0,b.f)(()=>{if(s)return()=>{s(t)}},[s,t]),(0,b.f)(()=>{n?.(t,l)},[l,n,t]),r.useEffect(()=>{if(!l||!d||!q.f.os.android)return;let e=(0,K.f)(o).CloseWatcher;if(!e)return;let n=new e,s=(0,W.f)(n,"cancel",function(e){if(!t.select("open"))return;let n=(0,J.j)(Z.closeWatcher,e);e.cancelable||(n.cancel=w.x),t.setOpen(!1,n),n.isCanceled&&e.preventDefault()});return()=>{s(),n.destroy()}},[t,d,l,o]),null}let er=e.i(77173).f,ea=e.i(13488).f;var el=e.i(74080),ei=e.i(29315),eo=e.i(8445),ed=e.i(10199);let ec=r.forwardRef(function(e,t){let{render:n,className:s,style:r,children:i,...o}=e,d=(0,$.Z)(),c=(0,a.x)(),u=c.useState("open"),p=c.useState("nested"),f=c.useState("transitionStatus"),m=c.useState("nestedOpenDialogCount"),h=c.useState("mounted"),g=c.useStateSetter("viewportElement");return(0,l.a)("div",e,{enabled:d||h,state:{open:u,nested:p,transitionStatus:f,nestedDialogOpen:m>0},ref:[t,g],stateAttributesMapping:ed.f,props:[{role:"presentation",hidden:!h,style:{pointerEvents:u?void 0:"none"},children:i},o]})});S.f.open,j.f.closed,N.f.startingStyle,R.f.endingStyle;var eu=e.i(76782),ep=e.i(8760),ef=Z,em=e.i(84446),eh=e.i(24166),eg=e.i(96545),ex=e.i(38396),eb=e.i(2410);let ev=r.createContext(void 0),ew=`[${g}]`,ey={horizontal:`[${ex.a}="x"]`,vertical:`[${ex.a}="y"]`},eS=r.forwardRef(function(e,t){let{render:n,className:l,style:i,children:u,...p}=e,m=(0,a.x)(),h=m.context.popupRef,g=m.context.backdropRef,{swipeDirection:x,notifyParentSwipingChange:w,notifyParentSwipeProgressChange:y,frontmostHeight:S,snapToSequentialPoints:j,swipeAreaActiveRef:N}=M(),R=et(),{snapPoints:k,resolvedSnapPoints:$,activeSnapPoint:P,activeSnapPointOffset:T,setActiveSnapPoint:O,popupHeight:I}=z(),F=m.useState("open"),L=m.useState("mounted"),Y=m.useState("nested"),X=m.useState("nestedOpenDrawerCount"),V=m.useState("viewportElement"),G=m.useState("popupElement"),B=R?.visualStateStore,q=X>0,Q="left"===x||"right"===x?"horizontal":"vertical",Z="vertical"===Q,_=Z?"horizontal":"vertical",[ee,en]=r.useState(null),es=r.useRef(void 0),er=r.useRef(null),ea=(0,eo.z)(),ed=r.useRef(!1),eS=r.useRef(!1),eT=r.useRef(""),eO=r.useRef(!1),eI=r.useRef(!1),eM=r.useRef(null),eD=r.useContext(ev),eA=r.useMemo(()=>{if(!k||k.length<2||$.length<2||"down"!==x&&"up"!==x)return null;let e=$.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[$,k,x]),eE=r.useMemo(()=>eA&&null!==T?(0,A.f)((T-eA.minOffset)/eA.range,0,1):null,[T,eA]),eF=r.useMemo(()=>k&&k.length>0&&("down"===x||"up"===x)?"down"===x?["down","up"]:["up","down"]:[x],[k,x]),eU=(0,v.f)(e=>{h.current?.toggleAttribute(C,e),g.current?.toggleAttribute(C,e)}),ez=(0,v.f)(()=>{eU(!1),h.current?.removeAttribute(eh.f.endingStyle),en(null)}),eH=(0,v.f)(()=>{eS.current&&(eS.current=!1,w?.(!1))}),eL=(0,v.f)((e,t,n)=>{let s=F&&!Y&&t,r=s?e:0,a=F&&t?e:0;n&&y&&(y(a),a<=0&&eH()),B?.set({swipeProgress:r,frontmostHeight:r>0?S:0});let l=g.current;if(!l)return;let i=s&&r>0;l.style.setProperty(f,i?`${r}`:"0"),i&&S>0?l.style.setProperty(o,`${S}px`):l.style.removeProperty(o)}),eY=(0,ep.w)({enabled:L&&!q,directions:eF,elementRef:m.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:d,y:c},onSwipeStart(e){if("touches"in e||"touch"===e.pointerType)return;let t=h.current,n=(0,D.f)(t),s=n.getSelection?.();if(!s||s.isCollapsed)return;let r=(0,ei.m)(s.anchorNode)?s.anchorNode:s.anchorNode?.parentElement,a=(0,ei.m)(s.focusNode)?s.focusNode:s.focusNode?.parentElement;((0,em.I)(t,r)||(0,em.I)(t,a))&&s.removeAllRanges()},onSwipingChange(e){ed.current=e,ej(m.context.backdropRef.current,e),e||y||eH()},swipeThreshold:({element:e,direction:t})=>eR(e,t),canStart(e,t){let n=m.context.popupRef.current;if(!n)return!1;let s=t.nativeEvent,r="touches"in s||"touch"===s.pointerType,a=r?eM.current:null,l=n.ownerDocument,i=(0,eb.f)(n.getRootNode(),e.x,e.y);return!(!a?.startedInPopup&&!(0,em.I)(n,i)||r&&eC(l,n)||a?.hasCrossAxisGestureTarget&&!a.drawerAxisAttributed&&!0!==a.allowSwipe)},onProgress(e,t){let n=ed.current;n&&function(e){if(eS.current||!e)return;let t=e.direction??x;10>Math.abs((0,ep.R)(t,e.deltaX,e.deltaY))||(eS.current=!0,w?.(!0))}(t);let s=!!(k&&k.length>0);if(n&&"down"===x&&s&&t){let e=m.context.popupRef.current;e&&(e.style.removeProperty("transform"),e.style.setProperty(c,`${E(T??0,t.deltaY)}px`))}let r=e;if(eA&&I>0){let e=T??eA.minOffset;if(n&&t&&Number.isFinite(t.deltaY)){let n;n=(0,A.f)(e+t.deltaY,0,I),r=(0,A.f)((n-eA.minOffset)/eA.range,0,1)}else null!==eE&&(r=eE)}n||(y?.(0),eH()),eL(r,!0,n)},onRelease({event:e,deltaX:t,deltaY:n,direction:s,velocityX:r,velocityY:a,releaseVelocityX:l,releaseVelocityY:i}){let o=m.context.popupRef.current;if(!o)return void ez();function d(e){eH(),eU(!0),o.style.removeProperty("transition"),o.setAttribute(eh.f.endingStyle,""),el.flushSync(()=>{en(function(e,t,n,s,r,a,l,i){let o=eN(e,t);if(o<=0)return null;let d=Math.max(0,o-((("down"===t||"up"===t)&&k&&k.length>0?T??0:0)+(0,ep.R)(t,n,s)));if(d<=0)return null;let c=(0,ep.R)(t,l,i),u=Math.abs(c)>0?c:(0,ep.R)(t,r,a);if(u<=.2)return null;let p=(0,A.f)(u,.2,4);return .1+((0,A.f)(d/p,80,360)-80)/280*.9}(o,e,t,n,r,a,l,i))})}if(!k||0===k.length){if(!s)return void ez();let e=(0,ep.R)(s,t,n);if(e<=0)return ez(),!1;if((0,ep.R)(s,r,a)>=.5)return d(s),!0;let l=e>eR(o,s);return l?d(s):ez(),l}if("down"!==x&&"up"!==x)return void ez();if(!I)return ez(),!1;if(0===$.length)return void ez();let c="down"===x?n:-n,u=Math.sign(c),p="down"===x?i:-i,f="down"===x?a:-a,h=p;if(0!==u&&Math.abs(c)>=10){let e=Math.sign(h);0!==e&&e!==u&&(h=f)}let g=T??0,b=(0,A.f)(g+c,0,I),v=Math.abs(h)>=.5?300*(0,A.f)(h,-4,4):0,w=j?b:(0,A.f)(b+v,0,I),y=(0,J.j)(ef.swipe,e),S=()=>(eL(0,!0,!0),ez(),!1),N=e=>(O(e.value,y),S()),R=e=>s?(O(null,y),y.isCanceled)?S():(es.current=P,d(x),!0):N(e);if(j){let e=[...$].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=U(t,g),s=e[U(t,w)],r=Math.sign(h),a=w;if(0!==u&&0!==r&&r===u&&Math.abs(h)>=.5){let t=(0,A.f)(n+u,0,e.length-1);if(t!==n){let n=e[t];(u>0?w<n.offset:w>n.offset)&&(s=n,a=n.offset)}else if(u>0)return R(s)}return Math.abs(a-I)<Math.abs(a-s.offset)?R(s):N(s)}let C=$[U($.map(e=>e.offset),w)];return h>=.5&&c>0||Math.abs(w-I)<Math.abs(w-C.offset)?R(C):N(C)},onDismiss(e){B?.set({swipeProgress:0,frontmostHeight:0});let t=m.context.backdropRef.current;t&&(t.style.setProperty(f,"0"),t.style.removeProperty(o));let n=(0,J.j)(ef.swipe,e);if(m.setOpen(!1,n),n.isCanceled){let t=es.current;void 0!==t&&O(t,(0,J.j)(ef.swipe,e)),es.current=void 0,er.current?.(),ez();return}m.select("open")?ea.request(()=>{if(m.select("open")){let t=es.current;void 0!==t&&O(t,(0,J.j)(ef.swipe,e)),es.current=void 0,ez(),er.current?.()}else es.current=void 0}):(es.current=void 0,eU(!0))}}),eX=eY.getPointerProps(),eV=eY.getTouchProps(),{moveNative:eG,reset:eW}=eY;er.current=eW,r.useEffect(()=>{let e=V??G;if(!e||!F||!L)return;let t=(0,D.f)(e);return(0,W.f)(t,"touchmove",function(n){var s,r;if(eD?.onTouchMove(n),eI.current)return;let a=eM.current,l=n.touches[0];l&&a&&(!function(n,s,r){let a=Z?r.clientY-s.lastY:r.clientX-s.lastX;if(2===n.touches.length||eC(t,e)||q||function(e,t,n,s){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||!0===e.allowSwipe||!e.hasCrossAxisGestureTarget)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let r=s?n.clientY-e.startY:n.clientX-e.startX,a=s?n.clientX-e.startX:n.clientY-e.startY,l=Math.abs(r),i=Math.abs(a);return i>=6&&i>l+2?(e.preserveNativeCrossAxisScroll=!0,!0):!(l>=6)||(e.drawerAxisAttributed=!0,!1)}(s,n,r,Z))return;let l=s.scrollTarget;if(!l||l===t.documentElement||l===t.body){n.cancelable&&n.preventDefault(),n.stopPropagation(),eG(n,e);return}if(!(ek(l,Q).max>0)){n.cancelable&&n.preventDefault(),n.stopPropagation();return}if(0!==a){var i,o,d,c;let e=(i=l,o=Q,d=x,c=a,!!(eP(d,o)?c>0:c<0)&&e$(i,o,d));s.allowSwipe?n.cancelable&&n.preventDefault():n.cancelable&&e?(s.allowSwipe=!0,n.preventDefault()):s.allowSwipe=!1}!0===s.allowSwipe&&(n.stopPropagation(),eG(n,e))}(n,a,l),(s=a).lastX=(r=l).clientX,s.lastY=r.clientY)},{passive:!1,capture:!0})},[L,q,F,G,Z,Q,x,eG,V,eD]),(0,b.f)(()=>{eA&&!eY.swiping&&eL(!F||Y?0:eE??0,!0,!1)},[eL,S,Y,y,F,eE,eA,eY.swiping,m,B]),(0,b.f)(()=>{if(y)return F||y(0),()=>{y(0)}},[y,F]),(0,b.f)(()=>{F&&(N.current||eW(),ez())},[ez,F,eW,N]),(0,b.f)(()=>{let e=g.current;return()=>{B?.set({swipeProgress:0,frontmostHeight:0}),ej(e,!1);let t=g.current;t!==e&&ej(t,!1),eH()}},[g,eH,B]);let eB=r.useMemo(()=>({swiping:eY.swiping,getDragStyles:eY.getDragStyles,swipeStrength:ee??null,setSwipeDismissed:eU}),[eU,eY.getDragStyles,eY.swiping,ee]);function eK(e){eI.current=e,eM.current=null}function eq(){eK(!1),eT.current="",eO.current=!1}function eJ(e){return eT.current="","touch"!==e.pointerType}return(0,s.jsx)(ec,{ref:t,className:l,style:i,render:n,...(0,eu.w)(p,{onPointerDown(e){var t,n;if(eT.current=e.pointerType,eO.current="pen"===e.pointerType,!F||!L||q)return;let s=(0,eb.f)(e.currentTarget.getRootNode(),e.clientX,e.clientY);t=s,(0,em.h)(t,ex.u)||(n=s,(0,em.h)(n,ew))||"touch"!==e.pointerType&&eX.onPointerDown?.(e)},onPointerMove(e){"touch"!==e.pointerType&&eX.onPointerMove?.(e)},onPointerUp(e){eJ(e)&&eX.onPointerUp?.(e)},onPointerCancel(e){eJ(e)&&eX.onPointerCancel?.(e)},onTouchStart(e){var t,n,s;if("pen"===eT.current&&eO.current){eO.current=!1,eK(!1);return}if(!F||!L||q)return void eK(!1);let r=e.touches[0];if(!r)return;if(n=(t=e).nativeEvent,s=(0,K.f)(t.currentTarget),n.composedPath().some(e=>e instanceof s.HTMLInputElement&&"range"===e.type))return void eK(!1);let a=e.currentTarget,l=(0,eb.f)(a.getRootNode(),r.clientX,r.clientY),i=(0,em.Z)(e.nativeEvent),o=(0,ei.m)(i)?i:a;if(!(0,em.I)(a,o)||(eD?.onTouchStart(e),(0,em.h)(l,`${ex.u}:not(${ey[_]})`)))return void eK(!0);eI.current=!1;let d=(0,eg.U)(o,a,Q),c=null!=(0,eg.U)(o,a,_)||null!=(0,em.h)(l,ey[_]),u=null;d&&(u=!!e$(d,Q,x)&&null),eM.current={startX:r.clientX,startY:r.clientY,lastX:r.clientX,lastY:r.clientY,startedInPopup:(0,em.I)(h.current,l),scrollTarget:d,hasCrossAxisGestureTarget:c,allowSwipe:u,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},eV.onTouchStart?.(e)},onTouchEnd(e){eD?.onTouchEnd(e),eq(),eV.onTouchEnd?.(e)},onTouchCancel(e){eD?.onTouchCancel(),eq(),eV.onTouchCancel?.(e)},"data-nested-dialog-open":void 0}),children:(0,s.jsx)(H.Provider,{value:eB,children:u})})});function ej(e,t){e?.toggleAttribute(k,t)}function eN(e,t){return"left"===t||"right"===t?e.offsetWidth:e.offsetHeight}function eR(e,t){return Math.max(.5*eN(e,t),10)}function eC(e,t){let n,s,r=(0,em.T)(e);if(r&&(0,em.I)(t,r)&&("INPUT"===r.tagName||"TEXTAREA"===r.tagName)){let{selectionStart:e,selectionEnd:t}=r;if(null!=e&&null!=t&&e<t)return!0}let a=e.getSelection?.();return!!a&&!a.isCollapsed&&(n=(0,ei.m)(a.anchorNode)?a.anchorNode:a.anchorNode?.parentElement,s=(0,ei.m)(a.focusNode)?a.focusNode:a.focusNode?.parentElement,a.containsNode(t,!0)||(0,em.I)(t,n)||(0,em.I)(t,s))}function ek(e,t){if("vertical"===t){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function e$(e,t,n){let s=eP(n,t),{offset:r,max:a}=ek(e,t);return s?r<=0:r>=a}function eP(e,t){return"vertical"===t?"down"===e:"right"===e}e.s(["Backdrop",0,m,"Close",0,h,"Content",0,x,"Popup",0,V,"Portal",0,G,"Root",0,function(e){let{children:a,open:l,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:d,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:p,handle:f,triggerId:m,defaultTriggerId:h=null,swipeDirection:g="down",snapToSequentialPoints:x=!1,snapPoints:b,snapPoint:w,defaultSnapPoint:y,onSnapPointChange:S}=e,j=M(!0),N=j?.onNestedSwipeProgressChange,R=j?.onNestedFrontmostHeightChange,C=j?.onNestedSwipingChange,k=j?.onNestedDrawerPresenceChange,[$,P]=r.useState(0),[T,O]=r.useState(0),[D,A]=r.useState(!1),[E,F]=r.useState(!1),[U]=r.useState(en),z=void 0!==y?y:b?.[0]??null,H=void 0!==w,[L,Y]=(0,B.f)({controlled:w,default:z,name:"Drawer",state:"snapPoint"}),X=r.useRef(!1),V=r.useRef(!1),G=(0,v.f)((e,t)=>{let n=t??(0,J.j)(Q.f.none);S?.(e,n),n.isCanceled||Y(e)}),W=r.useMemo(()=>H||!b||0===b.length||null!==L&&b.some(e=>Object.is(e,L))?L:z,[L,H,z,b]),K=(0,v.f)(e=>{P(e),!X.current&&e>0&&O(e)}),q=(0,v.f)(e=>{if(e>0){X.current=!0,O(e);return}X.current=!1,$>0&&O($)}),Z=(0,v.f)(e=>{A(e)}),ee=(0,v.f)(e=>{U.set(e),N?.(e)}),et=(0,v.f)(e=>{F(e),C?.(e)}),er=(0,v.f)((e,t)=>{o?.(e,t),!t.isCanceled&&!e&&b&&b.length>0&&G(z,(0,J.j)(t.reason,t.event,t.trigger))}),ea=r.useMemo(()=>({swipeDirection:g,swipeAreaActiveRef:V,snapToSequentialPoints:x,snapPoints:b,activeSnapPoint:W,setActiveSnapPoint:G,frontmostHeight:T,popupHeight:$,hasNestedDrawer:D,nestedSwiping:E,nestedSwipeProgressStore:U,onNestedDrawerPresenceChange:Z,onPopupHeightChange:K,onNestedFrontmostHeightChange:q,onNestedSwipingChange:et,onNestedSwipeProgressChange:ee,notifyParentFrontmostHeight:R,notifyParentSwipingChange:C,notifyParentSwipeProgressChange:N,notifyParentHasNestedDrawer:k}),[W,T,D,E,U,k,N,C,R,Z,q,ee,et,K,$,G,b,x,V,g]),el="function"==typeof a?e=>(0,s.jsxs)(r.Fragment,{children:[t||(t=(0,s.jsx)(es,{})),a(e)]}):(0,s.jsxs)(r.Fragment,{children:[n||(n=(0,s.jsx)(es,{})),a]}),ei=(0,_.f)("drawer",{open:l,defaultOpen:i,onOpenChange:er,onOpenChangeComplete:d,disablePointerDismissal:c,modal:u,actionsRef:p,handle:f,triggerId:m,defaultTriggerId:h,children:el});return(0,s.jsx)(I.Provider,{value:ea,children:ei})},"Title",0,er,"Trigger",0,ea,"Viewport",0,eS],58954);var eT=e.i(58954),eT=eT,eO=eT,eI=eT,eM=eT,eD=eT,eA=eT,eE=eT,eF=eT,eU=eT,ez=e.i(58487),eH=e.i(5654),eL=e.i(18566),eY=e.i(30402),eX=e.i(25621),eV=e.i(55070),eG=e.i(97e3),eW=e.i(27055),eB=e.i(95187);let eK=(0,eB.createServerReference)("408b7585197882a44a3cc8c0b1c3280e3806171563",eB.callServer,void 0,eB.findSourceMapURL,"switchPartyTools"),eq=[{how:"add",label:"Add to each"},{how:"remove",label:"Remove from each"},{how:"replace",label:"Replace with these"}];var eJ=e.i(19407);let eQ=[{state:"all",label:"All"},{state:"on",label:"On"},{state:"off",label:"Off"},{state:"new",label:"New"},{state:"needsNothing",label:"Needs nothing"}];var eZ=e.i(17779),e_=e.i(35671),e0=e.i(44047),e1=e.i(90218);function e2(e){return e?.split("\n").find(e=>""!==e.trim())?.trim()??""}function e4({fleetId:e,party:t,tools:n,version:a,partyScopes:l,listed:i,canChange:o,serverRefusal:d}){var c;let u,p,f=(0,eL.useRouter)(),m=eH.f.useToastManager(),[,h]=(0,r.useTransition)(),[g,x]=(0,r.useTransition)(),[b,v]=(0,r.useState)(""),[w,y]=(0,r.useState)("all"),[S,j]=(0,r.useState)(new Set),[N,R]=(0,r.useState)(null),[C,k]=(0,r.useState)([]),[$,P]=(0,r.useState)("add"),[T,O]=(0,r.useState)({readOnly:[],other:[]}),[I,M]=(0,r.useState)(!1),[D,A]=(0,r.useState)(null),[E,F]=(0,r.useState)(null),[U,z]=(0,r.useState)(null),[H,L]=(0,r.useState)({names:new Set,round:0}),[Y,X]=(0,r.useState)(null),[V,G]=(0,r.useState)(!1),[W,B]=(0,r.useState)(null),K=W?.basis===n?W:null,q=null===K?n:n.map(e=>({...e,scopes:K.scopes.get(e.name)??e.scopes,isOn:null===e.isOn?null:K.switches.get(e.name)??e.isOn})),J=K?.party??l,Q=Math.max(a,Y??0),Z=null===i?null:new Set(i.map(({scope:e})=>e)),_=(u=(c={name:b,state:w,partyScopes:J}).name.trim().toLowerCase(),q.filter(e=>e.name.toLowerCase().includes(u)&&function(e,{state:t,partyScopes:n}){switch(t){case"all":return!0;case"on":return!0===e.isOn;case"off":return!1===e.isOn;case"new":return e.isNew;case"needsNothing":return 0===n.length&&0===e.scopes.length}}(e,c))),ee=q.filter(({name:e})=>S.has(e)),et=null===d,en=_.length>0&&_.every(({name:e})=>S.has(e)),es=function(e){let t={readOnly:[],other:[],withoutHints:[]};for(let n of e.filter(({scopes:e})=>0===e.length))!0===n.isDestructive||!1===n.isReadOnly?t.other.push(n.name):!0===n.isReadOnly?t.readOnly.push(n.name):t.withoutHints.push(n.name);return t}(q),er=[...(p=(e,t)=>0===t.length?[]:e.map(e=>({tool:e,scopes:[...t]})))(es.readOnly,T.readOnly),...p(es.other,T.other)],ea=({outcome:e,changed:t,message:s,change:r})=>{B({basis:n,party:r.party??K?.party??null,scopes:new Map([...K?.scopes??[],...(r.scopes??[]).map(({tool:e,scopes:t})=>[e,t])]),switches:new Map([...K?.switches??[],...r.switches??[]])}),null!==e.version&&X(e.version),L(e=>({names:new Set(t),round:e.round+1})),m.add({title:(0,eJ.I)(s,e.statementRefusal)}),f.refresh()},el=e=>{A(null),G(!1),k("party"===e?[...J]:[]),P("add"),O({readOnly:[],other:[]}),R(e)},ei=()=>{R(null),A(null)},eo=({change:n,changed:s,message:r})=>{M(!0),A(null),h(async()=>{let a=await (0,eW.f)({fleetId:e,name:t,version:Q,...n});(M(!1),a.isOk)?(R(null),j(new Set),ea({outcome:a,changed:s,message:r,change:{...void 0===n.party?{}:{party:n.party},scopes:n.tools}})):A({message:a.message,isConflict:a.isConflict,version:Q})})},ed=({names:n,isOn:s,working:r})=>{F(r),z(null),G(!1),h(async()=>{let r=await eK({fleetId:e,name:t,tools:[...n],isOn:s});if(F(null),!r.isOk)return void z(r.message);let[a]=n;ea({outcome:r,changed:n,change:{switches:new Map(n.map(e=>[e,s]))},message:1===n.length&&void 0!==a?function({tool:e,isOn:t,statementRefusal:n}){let s=`${e} is ${t?"on":"off"}`;return null!==n?`${s}; the fleet sees it at the proxy ship's next statement: ${n}`:t?`${s}: the fleet may call it.`:`${s}: the fleet sees it no more, and a call to it is refused.`}({tool:a,isOn:s,statementRefusal:null}):(0,eJ.g)({count:n.length,isOn:s,statementRefusal:null})})})},ec=()=>{x(()=>{f.refresh()})},eu=null!==E||I,ep=(0,s.jsxs)("div",{className:"grid gap-3 sm:flex sm:flex-wrap sm:items-center","data-testid":"tools-table-toolbar",children:[(0,s.jsxs)("label",{className:"grid gap-1 sm:w-56",children:[(0,s.jsx)("span",{className:"sr-only",children:"Filter by name"}),(0,s.jsx)("input",{className:eY.w,type:"search",placeholder:"Filter by name",value:b,onChange:e=>{v(e.target.value)},"data-testid":"tools-table-name-filter"})]}),(0,s.jsx)("div",{role:"group","aria-label":"Filter by state",className:"flex flex-wrap gap-1",children:eQ.map(({state:e,label:t})=>(0,s.jsx)("button",{type:"button","aria-pressed":w===e,onClick:()=>{y(e)},className:`h-8 rounded-md border px-3 ${w===e?"border-primary bg-primary text-primary-foreground":"border-border bg-card hover:bg-accent"}`,"data-testid":`tools-table-state-${e}`,children:t},e))}),o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:en,onChange:()=>{j(e=>{let t=new Set(e);for(let{name:e}of _)en?t.delete(e):t.add(e);return t})},disabled:0===_.length,"data-testid":"tools-table-select-shown"}),"Select all shown"]}),(0,s.jsxs)("span",{className:"text-muted-foreground","data-testid":"tools-table-selected",children:[S.size," selected"]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 sm:ml-auto",children:[(0,s.jsx)("button",{type:"button",className:eY.x.secondary,disabled:0===S.size||eu||null===i,onClick:()=>{el("scopes")},"data-testid":"tools-table-set-scopes",children:"Set scopes…"}),(0,s.jsx)(eV.i,{isPending:"on"===E,pendingLabel:"Switching on…",disabled:0===S.size||eu||!et,onClick:()=>{ed({names:[...S],isOn:!0,working:"on"})},"data-testid":"tools-table-switch-on",children:"Switch on"}),(0,s.jsx)(eV.i,{isPending:"off"===E,pendingLabel:"Switching off…",disabled:0===S.size||eu||!et,onClick:()=>{ed({names:[...S],isOn:!1,working:"off"})},"data-testid":"tools-table-switch-off",children:"Switch off"}),(0,s.jsx)("button",{type:"button",className:eY.x.secondary,disabled:eu||!et||null===i,onClick:()=>{el("suggest")},"data-testid":"tools-table-suggest",children:"Suggest from hints…"})]})]}):null]});return(0,s.jsxs)("div",{className:"grid gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"tools-table-party-needs",children:[(0,s.jsx)("span",{className:"font-medium",children:"Every tool needs"}),(0,s.jsx)(eZ.f,{party:J,own:[],listed:Z}),o?(0,s.jsx)("button",{type:"button",className:"text-primary hover:underline disabled:opacity-60",disabled:eu||null===i,onClick:()=>{el("party")},"data-testid":"tools-table-party-change",children:"Change…"}):null]}),null===d?null:(0,s.jsxs)("p",{role:"status",className:"rounded-md border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-tone-waiting-fg","data-testid":"tools-table-server-down",children:["The server did not answer, so this shows the scopes kept per tool name; they can still be changed. ",d]}),(0,s.jsx)("div",{className:"hidden sm:block",children:ep}),(0,s.jsx)("div",{className:"sm:hidden",children:(0,s.jsxs)(eT.Root,{open:V,onOpenChange:G,children:[(0,s.jsxs)(eO.Trigger,{className:eY.x.secondary,"data-testid":"tools-table-sheet-open",children:["Filters and actions",o?` (${String(S.size)} selected)`:""]}),(0,s.jsxs)(eI.Portal,{children:[(0,s.jsx)(eM.Backdrop,{className:"fixed inset-0 z-40 bg-(--overlay)"}),(0,s.jsx)(eD.Viewport,{className:"fixed inset-0 z-50 flex items-end",children:(0,s.jsx)(eA.Popup,{className:"w-full rounded-t-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:(0,s.jsxs)(eE.Content,{className:"grid gap-3",children:[(0,s.jsx)(eF.Title,{className:"text-heading font-semibold",children:"Filters and actions"}),ep,(0,s.jsx)(eU.Close,{className:eY.x.secondary,children:"Done"})]})})})]})]})}),null===U?null:(0,s.jsx)("p",{role:"alert",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg","data-testid":"tools-table-switch-refusal",children:U}),(0,s.jsxs)("table",{className:"w-full border-collapse max-sm:block","data-testid":"tools-table",children:[(0,s.jsx)("thead",{className:"max-sm:hidden",children:(0,s.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[o?(0,s.jsx)("th",{className:"w-8 py-2",children:(0,s.jsx)("span",{className:"sr-only",children:"Selected"})}):null,(0,s.jsx)("th",{className:"py-2 font-medium",children:"Tool"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"Hints"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"On"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"Needs"})]})}),(0,s.jsx)("tbody",{className:"max-sm:grid max-sm:gap-2",children:_.map(e=>{let t=H.names.has(e.name);return(0,s.jsxs)("tr",{className:`border-b border-border align-top last:border-b-0 max-sm:grid max-sm:grid-cols-[auto_1fr] max-sm:gap-x-2 max-sm:rounded-md max-sm:border max-sm:p-2 ${t?"animate-highlight":""}`,"data-testid":"tools-table-row","data-tool":e.name,children:[o?(0,s.jsx)("td",{className:"py-2 pr-2 max-sm:row-span-4",children:(0,s.jsx)("input",{type:"checkbox","aria-label":`Select ${e.name}`,checked:S.has(e.name),onChange:()=>{var t;t=e.name,j(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},"data-testid":"tools-table-select"})}):null,(0,s.jsxs)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:[(0,s.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-mono",children:e.name}),e.isNew?(0,s.jsx)(eG.T,{tone:"attention",label:"New"}):null]}),""===e2(e.description)?null:(0,s.jsx)("span",{className:"block text-muted-foreground",children:e2(e.description)})]}),(0,s.jsx)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:(0,s.jsxs)("span",{className:"flex flex-wrap gap-1",children:[!0===e.isReadOnly?(0,s.jsx)(eG.E,{children:"Read only"}):null,!0===e.isDestructive?(0,s.jsx)(eG.E,{children:"Destructive"}):null]})}),(0,s.jsx)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:null===e.isOn?(0,s.jsx)("span",{className:"text-muted-foreground",children:"Not known"}):o?(0,s.jsx)(eX.f,{isOn:e.isOn,label:e.name,isPending:E===e.name,onClick:()=>{ed({names:[e.name],isOn:!0!==e.isOn,working:e.name})},testId:"tools-table-switch"}):(0,s.jsx)(eG.E,{children:e.isOn?"On":"Off"})}),(0,s.jsx)("td",{className:"py-2 max-sm:col-start-2",children:(0,s.jsx)(eZ.f,{party:J,own:e.scopes,listed:Z})})]},t?`${e.name}-${String(H.round)}`:e.name)})})]}),0===_.length?(0,s.jsx)("p",{className:"text-muted-foreground","data-testid":"tools-table-empty",children:0===q.length?et?`${t} lists no tools.`:"No tool needs a scope of its own yet.":"No tool matches the filters."}):null,null===i?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e0.G,{isOpen:"scopes"===N,onClose:ei,title:"Set scopes",description:"The scopes a calling ship must hold for each selected tool, beside what every tool needs.",appliesTo:`Applies to ${String(ee.length)} ${1===ee.length?"tool":"tools"}`,action:{label:"Set scopes",pending:"Setting…",isDisabled:0===C.length&&"replace"!==$,onPress:()=>{var e;eo({change:{tools:(e={scopes:C,how:$},ee.map(({name:t,scopes:n})=>{switch(e.how){case"add":return{tool:t,scopes:[...new Set([...n,...e.scopes])]};case"remove":return{tool:t,scopes:n.filter(t=>!e.scopes.includes(t))};case"replace":return{tool:t,scopes:[...new Set(e.scopes)]}}}))},changed:ee.map(({name:e})=>e),message:(0,eJ.y)({scopes:C,how:$,count:ee.length})})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-scopes-dialog",children:[(0,s.jsx)(e_.f,{label:"Scopes",listed:i,picked:C,onPick:k,isDisabled:I,testId:"tools-table-scopes-picker"}),(0,s.jsxs)("fieldset",{className:"grid gap-1",children:[(0,s.jsx)("legend",{className:"font-medium",children:"On each selected tool"}),eq.map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"radio",name:"how",value:e.how,checked:$===e.how,onChange:()=>{P(e.how)},"data-testid":`tools-table-how-${e.how}`}),e.label]},e.how))]})]}),(0,s.jsx)(e0.G,{isOpen:"party"===N,onClose:ei,title:"Every tool needs",description:`The scopes a calling ship must hold for every tool of ${t}, beside each tool's own.`,appliesTo:`Applies to every tool of ${t}`,action:{label:"Save",pending:"Saving…",isDisabled:!1,onPress:()=>{eo({change:{party:C,tools:[]},changed:q.map(({name:e})=>e),message:(0,eJ.G)({party:t,scopes:C})})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-party-dialog",children:(0,s.jsx)(e_.f,{label:"Scopes",listed:i,picked:C,onPick:k,isDisabled:I,testId:"tools-table-party-picker"})}),(0,s.jsxs)(e0.G,{isOpen:"suggest"===N,onClose:ei,title:"Suggest from hints",description:"Scopes for each tool with no scope of its own, by what the server says of it. Hints are the server's claim: nothing applies until you confirm.",appliesTo:`Applies to ${String(er.length)} ${1===er.length?"tool":"tools"}`,action:{label:"Apply",pending:"Applying…",isDisabled:0===er.length,onPress:()=>{let e=[{scopes:T.readOnly,count:0===T.readOnly.length?0:es.readOnly.length},{scopes:T.other,count:0===T.other.length?0:es.other.length}].filter(({count:e})=>e>0);eo({change:{tools:er},changed:er.map(({tool:e})=>e),message:(0,eJ.q)(e)})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-suggest-dialog",children:[(0,s.jsx)(e_.f,{label:"Scopes for read-only tools",listed:i,picked:T.readOnly,onPick:e=>{O(t=>({...t,readOnly:e}))},isDisabled:I,testId:"tools-table-suggest-read-only"}),(0,s.jsx)(e_.f,{label:"Scopes for the other tools",listed:i,picked:T.other,onPick:e=>{O(t=>({...t,other:e}))},isDisabled:I,testId:"tools-table-suggest-other"}),(0,s.jsx)(e5,{title:"Read-only tools",names:es.readOnly,testId:"tools-table-suggest-read-only-tools"}),(0,s.jsx)(e5,{title:"Other tools",names:es.other,testId:"tools-table-suggest-other-tools"}),(0,s.jsx)(e5,{title:"Without hints, left as they are",names:es.withoutHints,testId:"tools-table-suggest-without-hints"})]})]})]})}function e5({title:e,names:t,testId:n}){return(0,s.jsxs)("details",{className:"rounded-md border border-border px-3 py-2","data-testid":n,children:[(0,s.jsxs)("summary",{className:"cursor-pointer",children:[e," (",t.length,")"]}),0===t.length?(0,s.jsx)("p",{className:"text-muted-foreground",children:"None"}):(0,s.jsx)("p",{className:"font-mono text-code break-words",children:t.join(", ")})]})}e.s(["ToolsTable",0,function(e){return(0,s.jsxs)(ez.f.Provider,{children:[(0,s.jsx)(e4,{...e}),(0,s.jsx)(e1.f,{})]})}],54418)},15327,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(28008),r=e.i(95187);let a=(0,r.createServerReference)("40a9ad5c4ced811b2e1b944591f45e2bdec3885949",r.callServer,void 0,r.findSourceMapURL,"readMoreSignIns"),l=(0,r.createServerReference)("4004ce1d46e14c5c2150455347d2c7a8d5d86a444d",r.callServer,void 0,r.findSourceMapURL,"removePersonSignIn");function i(e,t){let n=new Set(e.map(({personShipId:e})=>e));return[...e,...t.filter(({personShipId:e})=>!n.has(e))]}var o=e.i(30402),d=e.i(94984),c=e.i(97e3);let u=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],p=e=>String(e).padStart(2,"0"),f={signedIn:{tone:"ok",label:"Signed in"},lost:{tone:"attention",label:"Lost"}};function m(e){return e.personName??e.personShipId}function h({count:e}){return(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("h2",{className:"text-section font-semibold",children:"Everyone's sign-ins"}),null===e?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:e})]})}function g(){return(0,t.jsx)("thead",{className:"max-sm:hidden",children:(0,t.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Person"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Account"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"State"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Last used"}),(0,t.jsx)("th",{className:"h-10 px-2",children:(0,t.jsx)("span",{className:"sr-only",children:"Remove"})})]})})}function x({signIn:e,party:n,isRemoving:s,onConfirm:r,onKeep:a}){let l=m(e);return(0,t.jsxs)("div",{className:"grid gap-2 rounded-md bg-muted p-3","data-testid":"outside-party-sign-ins-confirm",children:[(0,t.jsxs)("p",{children:["Remove ",l,"'s sign-in? Their ships' calls to ",n," are refused until they sign in again."]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:o.x.destructive,disabled:s,"aria-busy":s,onClick:r,"data-testid":"outside-party-sign-ins-remove-confirmed",children:s?"Removing…":`Remove ${l}'s sign-in`}),(0,t.jsx)("button",{type:"button",className:o.x.secondary,onClick:a,children:"Keep"})]})]})}function b(e){let{party:n,now:s,rows:r,refusal:a,hasMore:l,isLoadingMore:i,confirming:b,removing:v,outcome:w}=e;return(0,t.jsxs)("section",{className:`${o.r} grid gap-3`,"data-testid":"outside-party-sign-ins",children:[(0,t.jsx)(h,{count:null===a?r.length:null}),(0,t.jsx)(d.f,{state:w}),null!==a?(0,t.jsx)(d.f,{state:{kind:"refused",message:a}}):0===r.length?(0,t.jsx)("p",{className:"text-muted-foreground",children:"Nobody has signed in yet."}):(0,t.jsxs)("table",{className:"w-full border-collapse max-sm:block",children:[(0,t.jsx)(g,{}),(0,t.jsx)("tbody",{className:"max-sm:grid",children:r.map(r=>{var a;let l,i,d=f[r.state],h=b===r.personShipId,g=null===r.lastUsedAt?"Not yet":(a=r.lastUsedAt,(i=new Date(s).getTime()-new Date(a).getTime())<6e4?"Just now":i<36e5?`${String(Math.floor(i/6e4))} min ago`:(l=new Date(a),`${String(l.getUTCDate())} ${u[l.getUTCMonth()]??""}, ${p(l.getUTCHours())}:${p(l.getUTCMinutes())}`));return[(0,t.jsxs)("tr",{className:`border-b border-border max-sm:grid max-sm:grid-cols-[1fr_auto] max-sm:gap-1 max-sm:py-3 ${h?"border-b-0":"last:border-b-0"}`,"data-testid":"outside-party-sign-ins-row",children:[(0,t.jsxs)("td",{className:"h-12 px-2 max-sm:col-start-1 max-sm:row-start-1 max-sm:h-auto max-sm:px-0 max-sm:font-medium",children:[m(r),r.isYours?(0,t.jsx)("span",{className:"font-normal text-muted-foreground",children:" (you)"}):null]}),(0,t.jsxs)("td",{className:"h-12 px-2 max-sm:col-span-2 max-sm:row-start-2 max-sm:h-auto max-sm:px-0 max-sm:text-muted-foreground",children:[function({outsideAccount:e}){return e.name??e.subject??(0,t.jsx)("span",{className:"text-muted-foreground",children:"Not known"})}(r),(0,t.jsxs)("span",{className:"sm:hidden",children:[" · last used ",null===r.lastUsedAt?"not yet":g]})]}),(0,t.jsx)("td",{className:"h-12 px-2 max-sm:col-start-2 max-sm:row-start-1 max-sm:h-auto max-sm:px-0",children:(0,t.jsx)(c.T,{tone:d.tone,label:d.label})}),(0,t.jsx)("td",{className:"h-12 px-2 text-muted-foreground max-sm:hidden",children:g}),(0,t.jsx)("td",{className:"h-12 px-2 text-right max-sm:col-span-2 max-sm:row-start-3 max-sm:h-auto max-sm:px-0 max-sm:text-left",children:(0,t.jsx)("button",{type:"button",className:`${o.x.secondary} ${h?"max-sm:hidden":""}`,onClick:()=>{e.onRemove(r.personShipId)},"data-testid":"outside-party-sign-ins-remove",children:"Remove"})})]},r.personShipId),h?(0,t.jsx)("tr",{className:"border-b border-border last:border-b-0 max-sm:block max-sm:pb-3",children:(0,t.jsx)("td",{colSpan:5,className:"pb-2 max-sm:block max-sm:pb-0",children:(0,t.jsx)(x,{signIn:r,party:n,isRemoving:v===r.personShipId,onConfirm:()=>{e.onConfirm(r)},onKeep:e.onKeep})})},`${r.personShipId}-confirm`):null]})})]}),null===a&&l?(0,t.jsx)("div",{children:(0,t.jsx)("button",{type:"button",className:o.x.secondary,disabled:i,"aria-busy":i,onClick:e.onMore,"data-testid":"outside-party-sign-ins-more",children:i?"Showing more…":"Show more"})}):null]})}e.s(["EveryonesSignInsCard",0,function({fleetId:e,party:r,now:o,first:d}){let[c,u]=(0,n.useState)([]),[p,f]=(0,n.useState)(d.next),[h,g]=(0,n.useState)(new Set),[x,v]=(0,n.useState)(null),[w,y]=(0,n.useState)(null),[S,j]=(0,n.useState)(s.Q),[N,R]=(0,n.useTransition)(),[,C]=(0,n.useTransition)(),k=i(d.grants,c).filter(({personShipId:e})=>!h.has(e));return(0,t.jsx)(b,{party:r,now:o,rows:k,refusal:null,hasMore:null!==p,isLoadingMore:N,confirming:x,removing:w,outcome:S,onRemove:e=>{v(e),j(s.Q)},onConfirm:t=>{y(t.personShipId),C(async()=>{let n=await l({fleetId:e,name:r,personShipId:t.personShipId});y(null),v(null),n.isOk?(g(e=>new Set([...e,t.personShipId])),j({kind:"done",message:function({person:e,party:t,isRevoked:n}){return n?`${e}'s sign-in is removed, and revoked at ${t}.`:`${e}'s sign-in is removed.`}({person:m(t),party:r,isRevoked:n.isRevoked})})):j({kind:"refused",message:n.message})})},onKeep:()=>{v(null)},onMore:()=>{let t=p??k.at(-1)?.personShipId;void 0!==t&&R(async()=>{let n=await a({fleetId:e,name:r,after:t});n.isOk?(u(e=>i(e,n.grants)),f(n.next)):j({kind:"refused",message:n.message})})}})}],15327)},52979,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(28008),r=e.i(94984),a=e.i(58107),l=e.i(95187);let i=(0,l.createServerReference)("60f6ca9b179e3a54d5ed0f11cdb52aaa1f537bc553",l.callServer,void 0,l.findSourceMapURL,"removeOwnSignIn");var o=e.i(37018);function d({fleetId:e,party:n}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"hidden",name:s.H,value:e}),(0,t.jsx)("input",{type:"hidden",name:"name",value:n})]})}e.s(["RemoveSignInForm",0,function({fleetId:e,party:l}){let[o,c]=(0,n.useActionState)(i,s.Q);return(0,t.jsxs)("form",{action:c,className:"grid gap-2",children:[(0,t.jsx)(r.f,{state:o}),(0,t.jsx)(d,{fleetId:e,party:l}),(0,t.jsx)("div",{children:(0,t.jsx)(a.f,{kind:"secondary",pending:"Removing…",testId:"outside-party-sign-in-remove",children:"Remove"})})]})},"SignInForm",0,function({fleetId:e,party:l,label:i,kind:c}){let[u,p]=(0,n.useActionState)(o.f,s.Q);return(0,t.jsxs)("form",{action:p,className:"grid gap-2",children:[(0,t.jsx)(r.f,{state:u}),(0,t.jsx)(d,{fleetId:e,party:l}),(0,t.jsx)("div",{children:(0,t.jsx)(a.f,{kind:c,pending:`Opening ${l}…`,testId:"outside-party-sign-in-start",children:i})})]})}],52979)},12137,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(74080),r=e.i(28008),a=e.i(25621),l=e.i(95187);let i=(0,l.createServerReference)("60fc44c5251aea4e8cf6a11329208266754ef56a78",l.callServer,void 0,l.findSourceMapURL,"markA2aAgent"),o={kind:"idle"};function d({isRepeatable:e}){let n=(0,s.useFormStatus)();return(0,t.jsx)(a.f,{type:"submit",isOn:e,label:"Repeatable",isPending:n.pending,testId:"outside-party-repeatable-switch"})}e.s(["RepeatableSwitch",0,function({fleetId:e,party:s,isRepeatable:a}){let[l,c]=(0,n.useActionState)(i,o),u="marked"===l.kind?l.isRepeatable:a;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("form",{action:c,className:"contents",children:[(0,t.jsx)("input",{type:"hidden",name:r.H,value:e}),(0,t.jsx)("input",{type:"hidden",name:"name",value:s}),(0,t.jsx)("input",{type:"hidden",name:"isRepeatable",value:String(!u)}),(0,t.jsx)(d,{isRepeatable:u})]}),"idle"===l.kind?null:(0,t.jsx)("span",{role:"refused"===l.kind?"alert":"status",className:`basis-full text-caption ${"refused"===l.kind?"text-tone-attention-fg":"text-tone-ok-fg"}`,"data-testid":"outside-party-repeatable-outcome",children:l.message})]})}],12137)}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25621,e=>{var t=e.i(43476);e.s(["f",0,function({isOn:e,label:n,isPending:s=!1,type:r="button",onClick:a,testId:l}){return(0,t.jsx)("button",{type:r,role:"switch","aria-checked":e,"aria-label":n,"aria-busy":s,disabled:s,onClick:a,"data-testid":l,className:`inline-flex h-5 w-9 shrink-0 items-center rounded-full border p-0.5 transition-colors disabled:opacity-60 ${e?"border-primary bg-primary":"border-input bg-muted"}`,children:(0,t.jsx)("span",{className:`size-3.5 rounded-full bg-background shadow-sm transition-transform ${e?"translate-x-4":"translate-x-0"} ${s?"animate-pulse":""}`})})}])},76584,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("60dfc77df91824127c01fb5c44efb2841ead72242f",t.callServer,void 0,t.findSourceMapURL,"signInToParty");e.s(["f",0,n])},99691,19407,17779,35671,44047,90218,e=>{var t=e.i(95187);let n=(0,t.createServerReference)("408e46bf6617cbbe648bcdb436ffd839c7f2bf376d",t.callServer,void 0,t.findSourceMapURL,"setPartyScopes");function s(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e.at(-1)??""}`}function r(e){return`${String(e)} ${1===e?"tool":"tools"}`}function a(e,t){return null===t?e:`${e}; the fleet sees it at the proxy ship's next statement: ${t}`}e.s(["f",0,n],99691),e.s(["B",0,function({party:e,scopes:t}){return 0===t.length?`Every message to ${e} needs nothing beyond reaching it`:`Every message to ${e} needs ${s(t)}`},"G",0,function({party:e,scopes:t}){return 0===t.length?`Every tool of ${e} needs nothing beyond reaching it`:`Every tool of ${e} needs ${s(t)}`},"y",0,function({scopes:e,how:t,count:n}){return"remove"===t?`${s(e)} removed from ${r(n)}`:0===e.length?`${r(n)} need${1===n?"s":""} nothing of ${1===n?"its":"their"} own`:`${s(e)} set on ${r(n)}`},"I",0,a,"q",0,function(e){return e.map(({scopes:e,count:t})=>`${s(e)} set on ${r(t)}`).join("; ")},"g",0,function({count:e,isOn:t,statementRefusal:n}){return a(`${r(e)} switched ${t?"on":"off"}`,n)}],19407);var l=e.i(43476);e.s(["f",0,function({party:e=[],own:t,listed:n}){if(0===e.length&&0===t.length)return(0,l.jsx)("span",{className:"text-muted-foreground",children:"Nothing"});let s=(e,t)=>{let s=null!==n&&!n.has(e);return(0,l.jsxs)("span",{className:`inline-flex items-center rounded-md border px-2 font-mono text-caption ${s?"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg":t?"border-transparent bg-muted text-muted-foreground":"border-border"}`,"data-testid":t?"tools-table-party-scope":"tools-table-scope",title:s?"No longer defined in the fleet":t?"Every tool needs it":void 0,children:[e,s?(0,l.jsx)("span",{className:"ml-1 font-sans",children:"(no longer defined)"}):null]},`${t?"party":"own"}-${e}`)};return(0,l.jsxs)("span",{className:"flex flex-wrap gap-1",children:[e.map(e=>s(e,!0)),t.filter(t=>!e.includes(t)).map(e=>s(e,!1))]})}],17779);var i=e.i(24189),i=i,o=e.i(93976),d=e.i(37134),c=i,u=i,p=i,f=i,m=e.i(62050),h=e.i(45017),g=e.i(47125),x=e.i(10030),b=e.i(58998),v=e.i(94313),w=e.i(53535),y=i;let S=({scope:e,description:t})=>({value:e,label:e,description:t});e.s(["f",0,function({label:e,listed:t,picked:n,onPick:s,isDisabled:r=!1,testId:a}){let{contains:j}=i.useFilter(),N=[...t.map(S),...n.filter(e=>!t.some(t=>t.scope===e)).map(e=>({value:e,label:e,description:"No longer defined in the fleet"}))],R=N.filter(e=>n.includes(e.value));return(0,l.jsxs)(o.f.Root,{multiple:!0,items:N,value:R,disabled:r,isItemEqualToValue:(e,t)=>e.value===t.value,onValueChange:(e,t)=>{"escape-key"===t.reason?t.cancel():s(e.map(e=>e.value))},filter:(e,t)=>j(e.label,t)||j(e.description,t),children:[(0,l.jsxs)("div",{className:"grid gap-1","data-testid":a,children:[(0,l.jsx)(d.f.Label,{className:"font-medium",children:e}),(0,l.jsx)(c.InputGroup,{className:"flex min-h-9 flex-wrap items-center gap-1 rounded-md border border-input bg-background px-2 py-1",children:(0,l.jsxs)(u.Chips,{className:"contents",children:[R.map(e=>(0,l.jsxs)(p.Chip,{className:"inline-flex items-center gap-1 rounded-md border border-border bg-muted px-2 font-mono text-caption","aria-label":e.value,children:[e.value,(0,l.jsx)(f.ChipRemove,{className:"text-muted-foreground hover:text-foreground","aria-label":`Remove ${e.value}`,children:"×"})]},e.value)),(0,l.jsx)(m.f.Input,{placeholder:0===R.length?"Search the fleet's scopes":"",className:"h-7 min-w-32 flex-1 bg-transparent outline-none"})]})})]}),(0,l.jsx)(h.f.Portal,{children:(0,l.jsx)(g.f.Positioner,{sideOffset:4,className:"z-50",children:(0,l.jsxs)(x.f.Popup,{className:"max-h-72 w-(--anchor-width) overflow-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",children:[(0,l.jsx)(b.f.Empty,{className:"px-2 py-1 text-muted-foreground",children:"No scope listed matches."}),(0,l.jsx)(v.f.List,{children:e=>(0,l.jsxs)(w.f.Item,{value:e,className:"grid cursor-default grid-cols-[1rem_1fr] gap-x-2 rounded px-2 py-1 data-highlighted:bg-accent",children:[(0,l.jsx)(y.ItemIndicator,{className:"row-span-2",children:"✓"}),(0,l.jsx)("span",{className:"col-start-2 font-mono text-code",children:e.value}),(0,l.jsx)("span",{className:"col-start-2 text-caption text-muted-foreground",children:e.description})]},e.value)})]})})})]})}],35671);var j=e.i(26323),N=e.i(9977),R=e.i(41708),C=e.i(93480),k=e.i(9169),$=e.i(52744),P=e.i(30402),T=e.i(55070);e.s(["G",0,function({isOpen:e,onClose:t,title:n,description:s,children:r,appliesTo:a,action:i,isSaving:o,refusal:d,onReload:c,isReloading:u,testId:p}){return(0,l.jsx)(j.f.Root,{open:e,onOpenChange:e=>{e||o||t()},children:(0,l.jsxs)(N.f.Portal,{children:[(0,l.jsx)(R.f.Backdrop,{className:"fixed inset-0 z-40 bg-(--overlay)"}),(0,l.jsxs)(C.f.Popup,{className:"fixed top-1/2 left-1/2 z-50 grid max-h-[90vh] w-[min(36rem,calc(100vw-2rem))] -translate-1/2 gap-4 overflow-auto rounded-lg border border-border bg-popover p-6 text-popover-foreground shadow-lg","data-testid":p,children:[(0,l.jsxs)("div",{className:"grid gap-1",children:[(0,l.jsx)(k.f.Title,{className:"text-heading font-semibold",children:n}),(0,l.jsx)($.f.Description,{className:"text-muted-foreground",children:s})]}),(0,l.jsx)("fieldset",{disabled:o,className:"grid gap-4",children:r}),null===d?null:(0,l.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg","data-testid":"tools-table-dialog-refusal",children:[(0,l.jsx)("span",{children:d.message}),d.isConflict?(0,l.jsx)(T.i,{isPending:u,pendingLabel:"Reloading…",onClick:c,"data-testid":"tools-table-reload",children:"Reload"}):null]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,l.jsx)("span",{className:"text-muted-foreground","data-testid":"tools-table-applies-to",children:a}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",className:P.x.secondary,disabled:o,onClick:t,children:"Cancel"}),(0,l.jsx)(T.i,{variant:"primary",isPending:o,pendingLabel:i.pending,disabled:i.isDisabled||u,onClick:i.onPress,"data-testid":"tools-table-dialog-action",children:i.label})]})]})]})]})})},"V",0,function(e,t){return e?.isConflict===!0&&t>e.version?null:e}],44047);var O=e.i(5654),I=e.i(43328),M=e.i(27538),D=e.i(77826),A=e.i(80734),E=e.i(60296),F=e.i(88941);e.s(["f",0,function(){let{toasts:e}=O.f.useToastManager();return(0,l.jsx)(I.f.Portal,{children:(0,l.jsx)(M.f.Viewport,{className:"fixed right-4 bottom-4 z-50 grid w-[min(24rem,calc(100vw-2rem))] gap-2",children:e.map(e=>(0,l.jsx)(D.f.Root,{toast:e,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-4 py-3 text-tone-ok-fg shadow-md","data-testid":"tools-table-toast",children:(0,l.jsxs)(A.f.Content,{className:"flex items-start justify-between gap-3",children:[(0,l.jsx)(E.f.Title,{}),(0,l.jsx)(F.f.Close,{"aria-label":"Dismiss",children:"×"})]})},e.id))})})}],90218)},12589,e=>{var t=e.i(43476),n=e.i(58487),s=e.i(5654),r=e.i(18566),a=e.i(71645),l=e.i(99691),i=e.i(19407),o=e.i(17779),d=e.i(35671),c=e.i(44047),u=e.i(90218);function p({fleetId:e,party:n,version:u,scopes:f,listed:m,canChange:h}){let g=(0,r.useRouter)(),x=s.f.useToastManager(),[,b]=(0,a.useTransition)(),[v,w]=(0,a.useTransition)(),[y,S]=(0,a.useState)(!1),[j,N]=(0,a.useState)([]),[R,C]=(0,a.useState)(!1),[k,$]=(0,a.useState)(null),[P,T]=(0,a.useState)(null),[O,I]=(0,a.useState)(0),[M,D]=(0,a.useState)(null),A=M?.basis===f?M.scopes:f;return(0,t.jsxs)("div",{className:`flex flex-wrap items-center gap-2 rounded-md ${O>0?"animate-highlight":""}`,"data-testid":"agent-needs",children:[(0,t.jsx)(o.f,{own:A,listed:null===m?null:new Set(m.map(({scope:e})=>e))}),h&&null!==m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"text-primary hover:underline",onClick:()=>{N([...A]),$(null),S(!0)},"data-testid":"agent-needs-change",children:"Change…"}),(0,t.jsx)(c.G,{isOpen:y,onClose:()=>{S(!1)},title:"Every message needs",description:`The scopes a calling ship must hold to message ${n}.`,appliesTo:`Applies to every message to ${n}`,action:{label:"Save",pending:"Saving…",isDisabled:!1,onPress:()=>{C(!0),$(null);let t=Math.max(u,P??0);b(async()=>{let s=await (0,l.f)({fleetId:e,name:n,version:t,party:j,tools:[]});(C(!1),s.isOk)?(T(s.version),D({basis:f,scopes:j}),S(!1),I(e=>e+1),x.add({title:(0,i.I)((0,i.B)({party:n,scopes:j}),s.statementRefusal)}),g.refresh()):$({message:s.message,isConflict:s.isConflict,version:t})})}},isSaving:R,refusal:(0,c.V)(k,Math.max(u,P??0)),isReloading:v,onReload:()=>{w(()=>{g.refresh()})},testId:"agent-needs-dialog",children:(0,t.jsx)(d.f,{label:"Scopes",listed:m,picked:j,onPick:N,isDisabled:R,testId:"agent-needs-picker"})})]}):null]},O)}e.s(["AgentNeeds",0,function(e){return(0,t.jsxs)(n.f.Provider,{children:[(0,t.jsx)(p,{...e}),(0,t.jsx)(u.f,{})]})}])},54418,e=>{var t,n,s=e.i(43476),r=e.i(71645),a=e.i(8821),l=e.i(52245),i=e.i(79938);let o="--drawer-height",d="--drawer-swipe-movement-x",c="--drawer-swipe-movement-y",u="--drawer-snap-point-offset",p="--drawer-swipe-strength",f="--drawer-swipe-progress",m=r.forwardRef(function(e,t){let{render:n,className:s,style:r,forceRender:o=!1,...d}=e,c=(0,a.x)(),u=c.useState("open"),m=c.useState("nested"),h=c.useState("mounted"),g=c.useState("transitionStatus");return(0,l.a)("div",e,{state:{open:u,transitionStatus:g},ref:[c.context.backdropRef,t],stateAttributesMapping:i.M,props:[{role:"presentation",hidden:!h,style:{pointerEvents:u?void 0:"none",userSelect:"none",WebkitUserSelect:"none",[f]:"0",[p]:"1"}},d],enabled:o||!m})}),h=e.i(56736).f,g="data-drawer-content",x=r.forwardRef(function(e,t){let{render:n,className:s,style:r,...i}=e;return(0,a.x)(),(0,l.a)("div",e,{ref:t,props:[{[g]:""},i]})});var b=e.i(46376),v=e.i(67865),w=e.i(56789),y=e.i(61487),S=e.i(35890),j=e.i(64938),N=e.i(80829),R=e.i(6640);S.f.open,j.f.closed,N.f.startingStyle,R.f.endingStyle;let C="data-swipe-dismiss",k="data-swiping";var $=e.i(25834),P=e.i(37584),T=e.i(73327),O=e.i(33332);let I=r.createContext(void 0);function M(e){let t=r.useContext(I);if(!0!==e&&void 0===t)throw Error((0,O.f)(90));return t}var D=e.i(8868),A=e.i(24429);function E(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function F(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if("number"==typeof e)return Number.isFinite(e)?e<=1?(0,A.f)(e,0,1)*t:e:null;let s=e.trim();if(s.endsWith("px")){let e=Number.parseFloat(s);return Number.isFinite(e)?e:null}if(s.endsWith("rem")){let e=Number.parseFloat(s);return Number.isFinite(e)?e*n:null}return null}function U(e,t){let n=-1,s=1/0;for(let r=0;r<e.length;r+=1){let a=Math.abs(e[r]-t);a<s&&(s=a,n=r)}return n}function z(){let e=(0,a.x)(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:s,popupHeight:l}=M(),i=e.useState("viewportElement"),[o,d]=r.useState(0),[c,u]=r.useState(16),p=(0,v.f)(()=>{let e=(0,D.f)(i).documentElement;d(i?i.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&u(t)});(0,b.f)(()=>{if(p(),!i||"function"!=typeof ResizeObserver)return;let e=new ResizeObserver(p);return e.observe(i),()=>{e.disconnect()}},[p,i]);let f=r.useMemo(()=>{if(!t||0===t.length||o<=0||l<=0)return[];let e=Math.min(l,o),n=t.map(t=>{let n=F(t,o,c);if(null===n)return null;let s=(0,A.f)(n,0,e);return{value:t,height:s,offset:Math.max(0,l-s)}}).filter(e=>!!e);if(n.length<=1)return n;let s=[],r=[];for(let e=n.length-1;e>=0;e-=1){let t=n[e];r.some(e=>1>=Math.abs(e-t.height))||(r.push(t.height),s.push(t))}return s.reverse(),s},[l,c,t,o]),m=r.useMemo(()=>{if(null===n)return;let e=f.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(l,o),s=F(n,o,c);if(null===s)return;let r=(0,A.f)(s,0,t);return f[U(f.map(e=>e.height),r)]},[n,l,f,c,o]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:s,popupHeight:l,viewportHeight:o,resolvedSnapPoints:f,activeSnapPointOffset:m?.offset??null}}let H=r.createContext(null);var L=e.i(64111);let Y=!1,X={...i.M,expanded:e=>e?{"data-expanded":""}:null,nestedDrawerOpen:e=>e?{"data-nested-drawer-open":""}:null,nestedDrawerSwiping:e=>e?{"data-nested-drawer-swiping":""}:null,swipeDirection:e=>({"data-swipe-direction":e}),swiping:e=>e?{[k]:""}:null},V=r.forwardRef(function(e,t){let n,{render:i,className:m,style:h,finalFocus:g,initialFocus:x,...S}=e,j=(0,a.x)(),N=j.context.popupRef,{swipeDirection:R,frontmostHeight:C,hasNestedDrawer:k,nestedSwiping:O,nestedSwipeProgressStore:I,onPopupHeightChange:D,notifyParentFrontmostHeight:A,notifyParentHasNestedDrawer:F}=M(),U=j.useState("descriptionElementId"),V=j.useState("disablePointerDismissal"),G=j.useState("floatingRootContext"),W=j.useState("popupProps"),B=j.useState("modal"),K=j.useState("mounted"),q=j.useState("nested"),J=j.useState("nestedOpenDrawerCount"),Q=j.useState("transitionStatus"),Z=j.useState("open"),_=j.useState("openMethod"),ee=j.useState("titleElementId"),et=j.useState("role"),en=G.useState("floatingId"),es=S.id??en,er=r.useContext(H);(0,$.Z)();let{snapPoints:ea,activeSnapPoint:el,activeSnapPointOffset:ei}=z(),eo=J>0,ed=er?.swiping??!1,ec=er?.swipeStrength??null,[eu,ep]=r.useState(0),ef=r.useRef(0),em=(0,v.f)(()=>{let e=N.current;if(!e)return;let t=e.offsetHeight;if(!(ef.current>0)||!(C>ef.current)||!(t>ef.current)){if(ef.current>0&&k){let e=ef.current;ep(e),D(e);return}t!==ef.current&&(ef.current=t,ep(t),D(t))}});(0,b.f)(()=>{if(!K){ef.current=0,ep(0),D(0);return}let e=N.current;if(!e||(Y||("u">typeof CSS&&"registerProperty"in CSS&&([d,c,u].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),[{name:f,initialValue:"0"},{name:p,initialValue:"1"}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:"<number>",inherits:!1,initialValue:t})}catch{}})),Y=!0),em(),"function"!=typeof ResizeObserver))return;let t=new ResizeObserver(em);return t.observe(e),()=>{t.disconnect()}},[em,K,eo,D,N]),(0,b.f)(()=>{let e=()=>{let e=N.current;if(!e)return;let t=I.getSnapshot();t>0?e.style.setProperty(f,`${t}`):e.style.setProperty(f,"0")};e();let t=I.subscribe(e),n=N.current;return()=>{t(),n&&n.style.setProperty(f,"0")}},[I,N]),(0,b.f)(()=>{if(Z)return A?.(C),()=>{A?.(0)}},[C,Z,A]),(0,b.f)(()=>{if(F)return F(Z||"ending"===Q),()=>{F(!1)}},[F,Z,Q]),(0,P.f)({open:Z,ref:N,onComplete(){Z&&j.context.onOpenChangeComplete?.(!0)}});let eh=void 0===x?N:x,eg=j.useStateSetter("popupElement"),ex=!k&&"ending"!==Q;eu&&!ex&&(n=`${eu}px`);let eb=ea&&ea.length>0&&("down"===R||"up"===R),ev=null;eb&&null!==ei&&(ev="up"===R?-ei:ei);let ew=er?er.getDragStyles():w.w;if(eb&&"down"===R){let e=Number.parseFloat(String(ew[c]));ew=ed&&Number.isFinite(e)?{...ew,transform:void 0,[c]:`${E(ei??0,e)}px`}:{...ew,transform:void 0}}let ey=(0,l.a)("div",e,{state:{open:Z,nested:q,transitionStatus:Q,expanded:1===el,nestedDrawerOpen:eo,nestedDrawerSwiping:O,swipeDirection:R,swiping:ed},props:[W,{id:es,"aria-labelledby":ee,"aria-describedby":U,role:et,...L.X,hidden:!K,onKeyDown(e){T.f.has(e.key)&&e.stopPropagation()},style:{...ew,[f]:"0","--nested-drawers":J,[o]:n,[u]:"number"==typeof ev?`${ev}px`:"0px","--drawer-frontmost-height":C?`${C}px`:void 0,[p]:"number"==typeof ec&&Number.isFinite(ec)&&ec>0?`${ec}`:"1"}},S],ref:[t,N,eg],stateAttributesMapping:X});return(0,s.jsx)(y.f,{context:G,openInteractionType:_,disabled:!K,closeOnFocusOut:!V,initialFocus:eh,returnFocus:g,modal:!1!==B,restoreFocus:"popup",children:ey})}),G=e.i(64951).f;var W=e.i(74735),B=e.i(51437),K=e.i(33848),q=e.i(22162),J=e.i(75606),Q=e.i(80025),Z=e.i(16856),Z=Z,_=e.i(66250);let ee=r.createContext(void 0);function et(){return r.useContext(ee)}function en(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let s=Number.isFinite(n)?n:0;s!==e&&(e=s,t.forEach(e=>{e()}))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}}function es(){let e=et(),t=(0,a.x)(!1),n=e?.setDrawerOpen,s=e?.removeDrawer,l=t.useState("open"),i=t.useState("nestedOpenDialogCount"),o=t.useState("popupElement"),d=0===i;return(0,b.f)(()=>{if(s)return()=>{s(t)}},[s,t]),(0,b.f)(()=>{n?.(t,l)},[l,n,t]),r.useEffect(()=>{if(!l||!d||!q.f.os.android)return;let e=(0,K.f)(o).CloseWatcher;if(!e)return;let n=new e,s=(0,W.f)(n,"cancel",function(e){if(!t.select("open"))return;let n=(0,J.j)(Z.closeWatcher,e);e.cancelable||(n.cancel=w.x),t.setOpen(!1,n),n.isCanceled&&e.preventDefault()});return()=>{s(),n.destroy()}},[t,d,l,o]),null}let er=e.i(77173).f,ea=e.i(13488).f;var el=e.i(74080),ei=e.i(29315),eo=e.i(8445),ed=e.i(10199);let ec=r.forwardRef(function(e,t){let{render:n,className:s,style:r,children:i,...o}=e,d=(0,$.Z)(),c=(0,a.x)(),u=c.useState("open"),p=c.useState("nested"),f=c.useState("transitionStatus"),m=c.useState("nestedOpenDialogCount"),h=c.useState("mounted"),g=c.useStateSetter("viewportElement");return(0,l.a)("div",e,{enabled:d||h,state:{open:u,nested:p,transitionStatus:f,nestedDialogOpen:m>0},ref:[t,g],stateAttributesMapping:ed.f,props:[{role:"presentation",hidden:!h,style:{pointerEvents:u?void 0:"none"},children:i},o]})});S.f.open,j.f.closed,N.f.startingStyle,R.f.endingStyle;var eu=e.i(76782),ep=e.i(8760),ef=Z,em=e.i(84446),eh=e.i(24166),eg=e.i(96545),ex=e.i(38396),eb=e.i(2410);let ev=r.createContext(void 0),ew=`[${g}]`,ey={horizontal:`[${ex.a}="x"]`,vertical:`[${ex.a}="y"]`},eS=r.forwardRef(function(e,t){let{render:n,className:l,style:i,children:u,...p}=e,m=(0,a.x)(),h=m.context.popupRef,g=m.context.backdropRef,{swipeDirection:x,notifyParentSwipingChange:w,notifyParentSwipeProgressChange:y,frontmostHeight:S,snapToSequentialPoints:j,swipeAreaActiveRef:N}=M(),R=et(),{snapPoints:k,resolvedSnapPoints:$,activeSnapPoint:P,activeSnapPointOffset:T,setActiveSnapPoint:O,popupHeight:I}=z(),F=m.useState("open"),L=m.useState("mounted"),Y=m.useState("nested"),X=m.useState("nestedOpenDrawerCount"),V=m.useState("viewportElement"),G=m.useState("popupElement"),B=R?.visualStateStore,q=X>0,Q="left"===x||"right"===x?"horizontal":"vertical",Z="vertical"===Q,_=Z?"horizontal":"vertical",[ee,en]=r.useState(null),es=r.useRef(void 0),er=r.useRef(null),ea=(0,eo.z)(),ed=r.useRef(!1),eS=r.useRef(!1),eT=r.useRef(""),eO=r.useRef(!1),eI=r.useRef(!1),eM=r.useRef(null),eD=r.useContext(ev),eA=r.useMemo(()=>{if(!k||k.length<2||$.length<2||"down"!==x&&"up"!==x)return null;let e=$.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[$,k,x]),eE=r.useMemo(()=>eA&&null!==T?(0,A.f)((T-eA.minOffset)/eA.range,0,1):null,[T,eA]),eF=r.useMemo(()=>k&&k.length>0&&("down"===x||"up"===x)?"down"===x?["down","up"]:["up","down"]:[x],[k,x]),eU=(0,v.f)(e=>{h.current?.toggleAttribute(C,e),g.current?.toggleAttribute(C,e)}),ez=(0,v.f)(()=>{eU(!1),h.current?.removeAttribute(eh.f.endingStyle),en(null)}),eH=(0,v.f)(()=>{eS.current&&(eS.current=!1,w?.(!1))}),eL=(0,v.f)((e,t,n)=>{let s=F&&!Y&&t,r=s?e:0,a=F&&t?e:0;n&&y&&(y(a),a<=0&&eH()),B?.set({swipeProgress:r,frontmostHeight:r>0?S:0});let l=g.current;if(!l)return;let i=s&&r>0;l.style.setProperty(f,i?`${r}`:"0"),i&&S>0?l.style.setProperty(o,`${S}px`):l.style.removeProperty(o)}),eY=(0,ep.w)({enabled:L&&!q,directions:eF,elementRef:m.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:d,y:c},onSwipeStart(e){if("touches"in e||"touch"===e.pointerType)return;let t=h.current,n=(0,D.f)(t),s=n.getSelection?.();if(!s||s.isCollapsed)return;let r=(0,ei.m)(s.anchorNode)?s.anchorNode:s.anchorNode?.parentElement,a=(0,ei.m)(s.focusNode)?s.focusNode:s.focusNode?.parentElement;((0,em.I)(t,r)||(0,em.I)(t,a))&&s.removeAllRanges()},onSwipingChange(e){ed.current=e,ej(m.context.backdropRef.current,e),e||y||eH()},swipeThreshold:({element:e,direction:t})=>eR(e,t),canStart(e,t){let n=m.context.popupRef.current;if(!n)return!1;let s=t.nativeEvent,r="touches"in s||"touch"===s.pointerType,a=r?eM.current:null,l=n.ownerDocument,i=(0,eb.f)(n.getRootNode(),e.x,e.y);return!(!a?.startedInPopup&&!(0,em.I)(n,i)||r&&eC(l,n)||a?.hasCrossAxisGestureTarget&&!a.drawerAxisAttributed&&!0!==a.allowSwipe)},onProgress(e,t){let n=ed.current;n&&function(e){if(eS.current||!e)return;let t=e.direction??x;10>Math.abs((0,ep.R)(t,e.deltaX,e.deltaY))||(eS.current=!0,w?.(!0))}(t);let s=!!(k&&k.length>0);if(n&&"down"===x&&s&&t){let e=m.context.popupRef.current;e&&(e.style.removeProperty("transform"),e.style.setProperty(c,`${E(T??0,t.deltaY)}px`))}let r=e;if(eA&&I>0){let e=T??eA.minOffset;if(n&&t&&Number.isFinite(t.deltaY)){let n;n=(0,A.f)(e+t.deltaY,0,I),r=(0,A.f)((n-eA.minOffset)/eA.range,0,1)}else null!==eE&&(r=eE)}n||(y?.(0),eH()),eL(r,!0,n)},onRelease({event:e,deltaX:t,deltaY:n,direction:s,velocityX:r,velocityY:a,releaseVelocityX:l,releaseVelocityY:i}){let o=m.context.popupRef.current;if(!o)return void ez();function d(e){eH(),eU(!0),o.style.removeProperty("transition"),o.setAttribute(eh.f.endingStyle,""),el.flushSync(()=>{en(function(e,t,n,s,r,a,l,i){let o=eN(e,t);if(o<=0)return null;let d=Math.max(0,o-((("down"===t||"up"===t)&&k&&k.length>0?T??0:0)+(0,ep.R)(t,n,s)));if(d<=0)return null;let c=(0,ep.R)(t,l,i),u=Math.abs(c)>0?c:(0,ep.R)(t,r,a);if(u<=.2)return null;let p=(0,A.f)(u,.2,4);return .1+((0,A.f)(d/p,80,360)-80)/280*.9}(o,e,t,n,r,a,l,i))})}if(!k||0===k.length){if(!s)return void ez();let e=(0,ep.R)(s,t,n);if(e<=0)return ez(),!1;if((0,ep.R)(s,r,a)>=.5)return d(s),!0;let l=e>eR(o,s);return l?d(s):ez(),l}if("down"!==x&&"up"!==x)return void ez();if(!I)return ez(),!1;if(0===$.length)return void ez();let c="down"===x?n:-n,u=Math.sign(c),p="down"===x?i:-i,f="down"===x?a:-a,h=p;if(0!==u&&Math.abs(c)>=10){let e=Math.sign(h);0!==e&&e!==u&&(h=f)}let g=T??0,b=(0,A.f)(g+c,0,I),v=Math.abs(h)>=.5?300*(0,A.f)(h,-4,4):0,w=j?b:(0,A.f)(b+v,0,I),y=(0,J.j)(ef.swipe,e),S=()=>(eL(0,!0,!0),ez(),!1),N=e=>(O(e.value,y),S()),R=e=>s?(O(null,y),y.isCanceled)?S():(es.current=P,d(x),!0):N(e);if(j){let e=[...$].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=U(t,g),s=e[U(t,w)],r=Math.sign(h),a=w;if(0!==u&&0!==r&&r===u&&Math.abs(h)>=.5){let t=(0,A.f)(n+u,0,e.length-1);if(t!==n){let n=e[t];(u>0?w<n.offset:w>n.offset)&&(s=n,a=n.offset)}else if(u>0)return R(s)}return Math.abs(a-I)<Math.abs(a-s.offset)?R(s):N(s)}let C=$[U($.map(e=>e.offset),w)];return h>=.5&&c>0||Math.abs(w-I)<Math.abs(w-C.offset)?R(C):N(C)},onDismiss(e){B?.set({swipeProgress:0,frontmostHeight:0});let t=m.context.backdropRef.current;t&&(t.style.setProperty(f,"0"),t.style.removeProperty(o));let n=(0,J.j)(ef.swipe,e);if(m.setOpen(!1,n),n.isCanceled){let t=es.current;void 0!==t&&O(t,(0,J.j)(ef.swipe,e)),es.current=void 0,er.current?.(),ez();return}m.select("open")?ea.request(()=>{if(m.select("open")){let t=es.current;void 0!==t&&O(t,(0,J.j)(ef.swipe,e)),es.current=void 0,ez(),er.current?.()}else es.current=void 0}):(es.current=void 0,eU(!0))}}),eX=eY.getPointerProps(),eV=eY.getTouchProps(),{moveNative:eG,reset:eW}=eY;er.current=eW,r.useEffect(()=>{let e=V??G;if(!e||!F||!L)return;let t=(0,D.f)(e);return(0,W.f)(t,"touchmove",function(n){var s,r;if(eD?.onTouchMove(n),eI.current)return;let a=eM.current,l=n.touches[0];l&&a&&(!function(n,s,r){let a=Z?r.clientY-s.lastY:r.clientX-s.lastX;if(2===n.touches.length||eC(t,e)||q||function(e,t,n,s){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||!0===e.allowSwipe||!e.hasCrossAxisGestureTarget)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let r=s?n.clientY-e.startY:n.clientX-e.startX,a=s?n.clientX-e.startX:n.clientY-e.startY,l=Math.abs(r),i=Math.abs(a);return i>=6&&i>l+2?(e.preserveNativeCrossAxisScroll=!0,!0):!(l>=6)||(e.drawerAxisAttributed=!0,!1)}(s,n,r,Z))return;let l=s.scrollTarget;if(!l||l===t.documentElement||l===t.body){n.cancelable&&n.preventDefault(),n.stopPropagation(),eG(n,e);return}if(!(ek(l,Q).max>0)){n.cancelable&&n.preventDefault(),n.stopPropagation();return}if(0!==a){var i,o,d,c;let e=(i=l,o=Q,d=x,c=a,!!(eP(d,o)?c>0:c<0)&&e$(i,o,d));s.allowSwipe?n.cancelable&&n.preventDefault():n.cancelable&&e?(s.allowSwipe=!0,n.preventDefault()):s.allowSwipe=!1}!0===s.allowSwipe&&(n.stopPropagation(),eG(n,e))}(n,a,l),(s=a).lastX=(r=l).clientX,s.lastY=r.clientY)},{passive:!1,capture:!0})},[L,q,F,G,Z,Q,x,eG,V,eD]),(0,b.f)(()=>{eA&&!eY.swiping&&eL(!F||Y?0:eE??0,!0,!1)},[eL,S,Y,y,F,eE,eA,eY.swiping,m,B]),(0,b.f)(()=>{if(y)return F||y(0),()=>{y(0)}},[y,F]),(0,b.f)(()=>{F&&(N.current||eW(),ez())},[ez,F,eW,N]),(0,b.f)(()=>{let e=g.current;return()=>{B?.set({swipeProgress:0,frontmostHeight:0}),ej(e,!1);let t=g.current;t!==e&&ej(t,!1),eH()}},[g,eH,B]);let eB=r.useMemo(()=>({swiping:eY.swiping,getDragStyles:eY.getDragStyles,swipeStrength:ee??null,setSwipeDismissed:eU}),[eU,eY.getDragStyles,eY.swiping,ee]);function eK(e){eI.current=e,eM.current=null}function eq(){eK(!1),eT.current="",eO.current=!1}function eJ(e){return eT.current="","touch"!==e.pointerType}return(0,s.jsx)(ec,{ref:t,className:l,style:i,render:n,...(0,eu.w)(p,{onPointerDown(e){var t,n;if(eT.current=e.pointerType,eO.current="pen"===e.pointerType,!F||!L||q)return;let s=(0,eb.f)(e.currentTarget.getRootNode(),e.clientX,e.clientY);t=s,(0,em.h)(t,ex.u)||(n=s,(0,em.h)(n,ew))||"touch"!==e.pointerType&&eX.onPointerDown?.(e)},onPointerMove(e){"touch"!==e.pointerType&&eX.onPointerMove?.(e)},onPointerUp(e){eJ(e)&&eX.onPointerUp?.(e)},onPointerCancel(e){eJ(e)&&eX.onPointerCancel?.(e)},onTouchStart(e){var t,n,s;if("pen"===eT.current&&eO.current){eO.current=!1,eK(!1);return}if(!F||!L||q)return void eK(!1);let r=e.touches[0];if(!r)return;if(n=(t=e).nativeEvent,s=(0,K.f)(t.currentTarget),n.composedPath().some(e=>e instanceof s.HTMLInputElement&&"range"===e.type))return void eK(!1);let a=e.currentTarget,l=(0,eb.f)(a.getRootNode(),r.clientX,r.clientY),i=(0,em.Z)(e.nativeEvent),o=(0,ei.m)(i)?i:a;if(!(0,em.I)(a,o)||(eD?.onTouchStart(e),(0,em.h)(l,`${ex.u}:not(${ey[_]})`)))return void eK(!0);eI.current=!1;let d=(0,eg.U)(o,a,Q),c=null!=(0,eg.U)(o,a,_)||null!=(0,em.h)(l,ey[_]),u=null;d&&(u=!!e$(d,Q,x)&&null),eM.current={startX:r.clientX,startY:r.clientY,lastX:r.clientX,lastY:r.clientY,startedInPopup:(0,em.I)(h.current,l),scrollTarget:d,hasCrossAxisGestureTarget:c,allowSwipe:u,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},eV.onTouchStart?.(e)},onTouchEnd(e){eD?.onTouchEnd(e),eq(),eV.onTouchEnd?.(e)},onTouchCancel(e){eD?.onTouchCancel(),eq(),eV.onTouchCancel?.(e)},"data-nested-dialog-open":void 0}),children:(0,s.jsx)(H.Provider,{value:eB,children:u})})});function ej(e,t){e?.toggleAttribute(k,t)}function eN(e,t){return"left"===t||"right"===t?e.offsetWidth:e.offsetHeight}function eR(e,t){return Math.max(.5*eN(e,t),10)}function eC(e,t){let n,s,r=(0,em.T)(e);if(r&&(0,em.I)(t,r)&&("INPUT"===r.tagName||"TEXTAREA"===r.tagName)){let{selectionStart:e,selectionEnd:t}=r;if(null!=e&&null!=t&&e<t)return!0}let a=e.getSelection?.();return!!a&&!a.isCollapsed&&(n=(0,ei.m)(a.anchorNode)?a.anchorNode:a.anchorNode?.parentElement,s=(0,ei.m)(a.focusNode)?a.focusNode:a.focusNode?.parentElement,a.containsNode(t,!0)||(0,em.I)(t,n)||(0,em.I)(t,s))}function ek(e,t){if("vertical"===t){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function e$(e,t,n){let s=eP(n,t),{offset:r,max:a}=ek(e,t);return s?r<=0:r>=a}function eP(e,t){return"vertical"===t?"down"===e:"right"===e}e.s(["Backdrop",0,m,"Close",0,h,"Content",0,x,"Popup",0,V,"Portal",0,G,"Root",0,function(e){let{children:a,open:l,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:d,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:p,handle:f,triggerId:m,defaultTriggerId:h=null,swipeDirection:g="down",snapToSequentialPoints:x=!1,snapPoints:b,snapPoint:w,defaultSnapPoint:y,onSnapPointChange:S}=e,j=M(!0),N=j?.onNestedSwipeProgressChange,R=j?.onNestedFrontmostHeightChange,C=j?.onNestedSwipingChange,k=j?.onNestedDrawerPresenceChange,[$,P]=r.useState(0),[T,O]=r.useState(0),[D,A]=r.useState(!1),[E,F]=r.useState(!1),[U]=r.useState(en),z=void 0!==y?y:b?.[0]??null,H=void 0!==w,[L,Y]=(0,B.f)({controlled:w,default:z,name:"Drawer",state:"snapPoint"}),X=r.useRef(!1),V=r.useRef(!1),G=(0,v.f)((e,t)=>{let n=t??(0,J.j)(Q.f.none);S?.(e,n),n.isCanceled||Y(e)}),W=r.useMemo(()=>H||!b||0===b.length||null!==L&&b.some(e=>Object.is(e,L))?L:z,[L,H,z,b]),K=(0,v.f)(e=>{P(e),!X.current&&e>0&&O(e)}),q=(0,v.f)(e=>{if(e>0){X.current=!0,O(e);return}X.current=!1,$>0&&O($)}),Z=(0,v.f)(e=>{A(e)}),ee=(0,v.f)(e=>{U.set(e),N?.(e)}),et=(0,v.f)(e=>{F(e),C?.(e)}),er=(0,v.f)((e,t)=>{o?.(e,t),!t.isCanceled&&!e&&b&&b.length>0&&G(z,(0,J.j)(t.reason,t.event,t.trigger))}),ea=r.useMemo(()=>({swipeDirection:g,swipeAreaActiveRef:V,snapToSequentialPoints:x,snapPoints:b,activeSnapPoint:W,setActiveSnapPoint:G,frontmostHeight:T,popupHeight:$,hasNestedDrawer:D,nestedSwiping:E,nestedSwipeProgressStore:U,onNestedDrawerPresenceChange:Z,onPopupHeightChange:K,onNestedFrontmostHeightChange:q,onNestedSwipingChange:et,onNestedSwipeProgressChange:ee,notifyParentFrontmostHeight:R,notifyParentSwipingChange:C,notifyParentSwipeProgressChange:N,notifyParentHasNestedDrawer:k}),[W,T,D,E,U,k,N,C,R,Z,q,ee,et,K,$,G,b,x,V,g]),el="function"==typeof a?e=>(0,s.jsxs)(r.Fragment,{children:[t||(t=(0,s.jsx)(es,{})),a(e)]}):(0,s.jsxs)(r.Fragment,{children:[n||(n=(0,s.jsx)(es,{})),a]}),ei=(0,_.f)("drawer",{open:l,defaultOpen:i,onOpenChange:er,onOpenChangeComplete:d,disablePointerDismissal:c,modal:u,actionsRef:p,handle:f,triggerId:m,defaultTriggerId:h,children:el});return(0,s.jsx)(I.Provider,{value:ea,children:ei})},"Title",0,er,"Trigger",0,ea,"Viewport",0,eS],58954);var eT=e.i(58954),eT=eT,eO=eT,eI=eT,eM=eT,eD=eT,eA=eT,eE=eT,eF=eT,eU=eT,ez=e.i(58487),eH=e.i(5654),eL=e.i(18566),eY=e.i(30402),eX=e.i(25621),eV=e.i(55070),eG=e.i(97e3),eW=e.i(99691),eB=e.i(95187);let eK=(0,eB.createServerReference)("40d13b79368f90a7fd44c08192397c549c663063a0",eB.callServer,void 0,eB.findSourceMapURL,"switchPartyTools"),eq=[{how:"add",label:"Add to each"},{how:"remove",label:"Remove from each"},{how:"replace",label:"Replace with these"}];var eJ=e.i(19407);let eQ=[{state:"all",label:"All"},{state:"on",label:"On"},{state:"off",label:"Off"},{state:"new",label:"New"},{state:"needsNothing",label:"Needs nothing"}];var eZ=e.i(17779),e_=e.i(35671),e0=e.i(44047),e1=e.i(90218);function e2(e){return e?.split("\n").find(e=>""!==e.trim())?.trim()??""}function e4({fleetId:e,party:t,tools:n,version:a,partyScopes:l,listed:i,canChange:o,serverRefusal:d}){var c;let u,p,f=(0,eL.useRouter)(),m=eH.f.useToastManager(),[,h]=(0,r.useTransition)(),[g,x]=(0,r.useTransition)(),[b,v]=(0,r.useState)(""),[w,y]=(0,r.useState)("all"),[S,j]=(0,r.useState)(new Set),[N,R]=(0,r.useState)(null),[C,k]=(0,r.useState)([]),[$,P]=(0,r.useState)("add"),[T,O]=(0,r.useState)({readOnly:[],other:[]}),[I,M]=(0,r.useState)(!1),[D,A]=(0,r.useState)(null),[E,F]=(0,r.useState)(null),[U,z]=(0,r.useState)(null),[H,L]=(0,r.useState)({names:new Set,round:0}),[Y,X]=(0,r.useState)(null),[V,G]=(0,r.useState)(!1),[W,B]=(0,r.useState)(null),K=W?.basis===n?W:null,q=null===K?n:n.map(e=>({...e,scopes:K.scopes.get(e.name)??e.scopes,isOn:null===e.isOn?null:K.switches.get(e.name)??e.isOn})),J=K?.party??l,Q=Math.max(a,Y??0),Z=null===i?null:new Set(i.map(({scope:e})=>e)),_=(u=(c={name:b,state:w,partyScopes:J}).name.trim().toLowerCase(),q.filter(e=>e.name.toLowerCase().includes(u)&&function(e,{state:t,partyScopes:n}){switch(t){case"all":return!0;case"on":return!0===e.isOn;case"off":return!1===e.isOn;case"new":return e.isNew;case"needsNothing":return 0===n.length&&0===e.scopes.length}}(e,c))),ee=q.filter(({name:e})=>S.has(e)),et=null===d,en=_.length>0&&_.every(({name:e})=>S.has(e)),es=function(e){let t={readOnly:[],other:[],withoutHints:[]};for(let n of e.filter(({scopes:e})=>0===e.length))!0===n.isDestructive||!1===n.isReadOnly?t.other.push(n.name):!0===n.isReadOnly?t.readOnly.push(n.name):t.withoutHints.push(n.name);return t}(q),er=[...(p=(e,t)=>0===t.length?[]:e.map(e=>({tool:e,scopes:[...t]})))(es.readOnly,T.readOnly),...p(es.other,T.other)],ea=({outcome:e,changed:t,message:s,change:r})=>{B({basis:n,party:r.party??K?.party??null,scopes:new Map([...K?.scopes??[],...(r.scopes??[]).map(({tool:e,scopes:t})=>[e,t])]),switches:new Map([...K?.switches??[],...r.switches??[]])}),null!==e.version&&X(e.version),L(e=>({names:new Set(t),round:e.round+1})),m.add({title:(0,eJ.I)(s,e.statementRefusal)}),f.refresh()},el=e=>{A(null),G(!1),k("party"===e?[...J]:[]),P("add"),O({readOnly:[],other:[]}),R(e)},ei=()=>{R(null),A(null)},eo=({change:n,changed:s,message:r})=>{M(!0),A(null),h(async()=>{let a=await (0,eW.f)({fleetId:e,name:t,version:Q,...n});(M(!1),a.isOk)?(R(null),j(new Set),ea({outcome:a,changed:s,message:r,change:{...void 0===n.party?{}:{party:n.party},scopes:n.tools}})):A({message:a.message,isConflict:a.isConflict,version:Q})})},ed=({names:n,isOn:s,working:r})=>{F(r),z(null),G(!1),h(async()=>{let r=await eK({fleetId:e,name:t,tools:[...n],isOn:s});if(F(null),!r.isOk)return void z(r.message);let[a]=n;ea({outcome:r,changed:n,change:{switches:new Map(n.map(e=>[e,s]))},message:1===n.length&&void 0!==a?function({tool:e,isOn:t,statementRefusal:n}){let s=`${e} is ${t?"on":"off"}`;return null!==n?`${s}; the fleet sees it at the proxy ship's next statement: ${n}`:t?`${s}: the fleet may call it.`:`${s}: the fleet sees it no more, and a call to it is refused.`}({tool:a,isOn:s,statementRefusal:null}):(0,eJ.g)({count:n.length,isOn:s,statementRefusal:null})})})},ec=()=>{x(()=>{f.refresh()})},eu=null!==E||I,ep=(0,s.jsxs)("div",{className:"grid gap-3 sm:flex sm:flex-wrap sm:items-center","data-testid":"tools-table-toolbar",children:[(0,s.jsxs)("label",{className:"grid gap-1 sm:w-56",children:[(0,s.jsx)("span",{className:"sr-only",children:"Filter by name"}),(0,s.jsx)("input",{className:eY.w,type:"search",placeholder:"Filter by name",value:b,onChange:e=>{v(e.target.value)},"data-testid":"tools-table-name-filter"})]}),(0,s.jsx)("div",{role:"group","aria-label":"Filter by state",className:"flex flex-wrap gap-1",children:eQ.map(({state:e,label:t})=>(0,s.jsx)("button",{type:"button","aria-pressed":w===e,onClick:()=>{y(e)},className:`h-8 rounded-md border px-3 ${w===e?"border-primary bg-primary text-primary-foreground":"border-border bg-card hover:bg-accent"}`,"data-testid":`tools-table-state-${e}`,children:t},e))}),o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:en,onChange:()=>{j(e=>{let t=new Set(e);for(let{name:e}of _)en?t.delete(e):t.add(e);return t})},disabled:0===_.length,"data-testid":"tools-table-select-shown"}),"Select all shown"]}),(0,s.jsxs)("span",{className:"text-muted-foreground","data-testid":"tools-table-selected",children:[S.size," selected"]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 sm:ml-auto",children:[(0,s.jsx)("button",{type:"button",className:eY.x.secondary,disabled:0===S.size||eu||null===i,onClick:()=>{el("scopes")},"data-testid":"tools-table-set-scopes",children:"Set scopes…"}),(0,s.jsx)(eV.i,{isPending:"on"===E,pendingLabel:"Switching on…",disabled:0===S.size||eu||!et,onClick:()=>{ed({names:[...S],isOn:!0,working:"on"})},"data-testid":"tools-table-switch-on",children:"Switch on"}),(0,s.jsx)(eV.i,{isPending:"off"===E,pendingLabel:"Switching off…",disabled:0===S.size||eu||!et,onClick:()=>{ed({names:[...S],isOn:!1,working:"off"})},"data-testid":"tools-table-switch-off",children:"Switch off"}),(0,s.jsx)("button",{type:"button",className:eY.x.secondary,disabled:eu||!et||null===i,onClick:()=>{el("suggest")},"data-testid":"tools-table-suggest",children:"Suggest from hints…"})]})]}):null]});return(0,s.jsxs)("div",{className:"grid gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"tools-table-party-needs",children:[(0,s.jsx)("span",{className:"font-medium",children:"Every tool needs"}),(0,s.jsx)(eZ.f,{party:J,own:[],listed:Z}),o?(0,s.jsx)("button",{type:"button",className:"text-primary hover:underline disabled:opacity-60",disabled:eu||null===i,onClick:()=>{el("party")},"data-testid":"tools-table-party-change",children:"Change…"}):null]}),null===d?null:(0,s.jsxs)("p",{role:"status",className:"rounded-md border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-tone-waiting-fg","data-testid":"tools-table-server-down",children:["The server did not answer, so this shows the scopes kept per tool name; they can still be changed. ",d]}),(0,s.jsx)("div",{className:"hidden sm:block",children:ep}),(0,s.jsx)("div",{className:"sm:hidden",children:(0,s.jsxs)(eT.Root,{open:V,onOpenChange:G,children:[(0,s.jsxs)(eO.Trigger,{className:eY.x.secondary,"data-testid":"tools-table-sheet-open",children:["Filters and actions",o?` (${String(S.size)} selected)`:""]}),(0,s.jsxs)(eI.Portal,{children:[(0,s.jsx)(eM.Backdrop,{className:"fixed inset-0 z-40 bg-(--overlay)"}),(0,s.jsx)(eD.Viewport,{className:"fixed inset-0 z-50 flex items-end",children:(0,s.jsx)(eA.Popup,{className:"w-full rounded-t-lg border border-border bg-popover p-4 text-popover-foreground shadow-lg",children:(0,s.jsxs)(eE.Content,{className:"grid gap-3",children:[(0,s.jsx)(eF.Title,{className:"text-heading font-semibold",children:"Filters and actions"}),ep,(0,s.jsx)(eU.Close,{className:eY.x.secondary,children:"Done"})]})})})]})]})}),null===U?null:(0,s.jsx)("p",{role:"alert",className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg","data-testid":"tools-table-switch-refusal",children:U}),(0,s.jsxs)("table",{className:"w-full border-collapse max-sm:block","data-testid":"tools-table",children:[(0,s.jsx)("thead",{className:"max-sm:hidden",children:(0,s.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[o?(0,s.jsx)("th",{className:"w-8 py-2",children:(0,s.jsx)("span",{className:"sr-only",children:"Selected"})}):null,(0,s.jsx)("th",{className:"py-2 font-medium",children:"Tool"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"Hints"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"On"}),(0,s.jsx)("th",{className:"py-2 font-medium",children:"Needs"})]})}),(0,s.jsx)("tbody",{className:"max-sm:grid max-sm:gap-2",children:_.map(e=>{let t=H.names.has(e.name);return(0,s.jsxs)("tr",{className:`border-b border-border align-top last:border-b-0 max-sm:grid max-sm:grid-cols-[auto_1fr] max-sm:gap-x-2 max-sm:rounded-md max-sm:border max-sm:p-2 ${t?"animate-highlight":""}`,"data-testid":"tools-table-row","data-tool":e.name,children:[o?(0,s.jsx)("td",{className:"py-2 pr-2 max-sm:row-span-4",children:(0,s.jsx)("input",{type:"checkbox","aria-label":`Select ${e.name}`,checked:S.has(e.name),onChange:()=>{var t;t=e.name,j(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},"data-testid":"tools-table-select"})}):null,(0,s.jsxs)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:[(0,s.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-mono",children:e.name}),e.isNew?(0,s.jsx)(eG.T,{tone:"attention",label:"New"}):null]}),""===e2(e.description)?null:(0,s.jsx)("span",{className:"block text-muted-foreground",children:e2(e.description)})]}),(0,s.jsx)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:(0,s.jsxs)("span",{className:"flex flex-wrap gap-1",children:[!0===e.isReadOnly?(0,s.jsx)(eG.E,{children:"Read only"}):null,!0===e.isDestructive?(0,s.jsx)(eG.E,{children:"Destructive"}):null]})}),(0,s.jsx)("td",{className:"py-2 pr-3 max-sm:col-start-2",children:null===e.isOn?(0,s.jsx)("span",{className:"text-muted-foreground",children:"Not known"}):o?(0,s.jsx)(eX.f,{isOn:e.isOn,label:e.name,isPending:E===e.name,onClick:()=>{ed({names:[e.name],isOn:!0!==e.isOn,working:e.name})},testId:"tools-table-switch"}):(0,s.jsx)(eG.E,{children:e.isOn?"On":"Off"})}),(0,s.jsx)("td",{className:"py-2 max-sm:col-start-2",children:(0,s.jsx)(eZ.f,{party:J,own:e.scopes,listed:Z})})]},t?`${e.name}-${String(H.round)}`:e.name)})})]}),0===_.length?(0,s.jsx)("p",{className:"text-muted-foreground","data-testid":"tools-table-empty",children:0===q.length?et?`${t} lists no tools.`:"No tool needs a scope of its own yet.":"No tool matches the filters."}):null,null===i?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e0.G,{isOpen:"scopes"===N,onClose:ei,title:"Set scopes",description:"The scopes a calling ship must hold for each selected tool, beside what every tool needs.",appliesTo:`Applies to ${String(ee.length)} ${1===ee.length?"tool":"tools"}`,action:{label:"Set scopes",pending:"Setting…",isDisabled:0===C.length&&"replace"!==$,onPress:()=>{var e;eo({change:{tools:(e={scopes:C,how:$},ee.map(({name:t,scopes:n})=>{switch(e.how){case"add":return{tool:t,scopes:[...new Set([...n,...e.scopes])]};case"remove":return{tool:t,scopes:n.filter(t=>!e.scopes.includes(t))};case"replace":return{tool:t,scopes:[...new Set(e.scopes)]}}}))},changed:ee.map(({name:e})=>e),message:(0,eJ.y)({scopes:C,how:$,count:ee.length})})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-scopes-dialog",children:[(0,s.jsx)(e_.f,{label:"Scopes",listed:i,picked:C,onPick:k,isDisabled:I,testId:"tools-table-scopes-picker"}),(0,s.jsxs)("fieldset",{className:"grid gap-1",children:[(0,s.jsx)("legend",{className:"font-medium",children:"On each selected tool"}),eq.map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"radio",name:"how",value:e.how,checked:$===e.how,onChange:()=>{P(e.how)},"data-testid":`tools-table-how-${e.how}`}),e.label]},e.how))]})]}),(0,s.jsx)(e0.G,{isOpen:"party"===N,onClose:ei,title:"Every tool needs",description:`The scopes a calling ship must hold for every tool of ${t}, beside each tool's own.`,appliesTo:`Applies to every tool of ${t}`,action:{label:"Save",pending:"Saving…",isDisabled:!1,onPress:()=>{eo({change:{party:C,tools:[]},changed:q.map(({name:e})=>e),message:(0,eJ.G)({party:t,scopes:C})})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-party-dialog",children:(0,s.jsx)(e_.f,{label:"Scopes",listed:i,picked:C,onPick:k,isDisabled:I,testId:"tools-table-party-picker"})}),(0,s.jsxs)(e0.G,{isOpen:"suggest"===N,onClose:ei,title:"Suggest from hints",description:"Scopes for each tool with no scope of its own, by what the server says of it. Hints are the server's claim: nothing applies until you confirm.",appliesTo:`Applies to ${String(er.length)} ${1===er.length?"tool":"tools"}`,action:{label:"Apply",pending:"Applying…",isDisabled:0===er.length,onPress:()=>{let e=[{scopes:T.readOnly,count:0===T.readOnly.length?0:es.readOnly.length},{scopes:T.other,count:0===T.other.length?0:es.other.length}].filter(({count:e})=>e>0);eo({change:{tools:er},changed:er.map(({tool:e})=>e),message:(0,eJ.q)(e)})}},isSaving:I,refusal:(0,e0.V)(D,Q),isReloading:g,onReload:ec,testId:"tools-table-suggest-dialog",children:[(0,s.jsx)(e_.f,{label:"Scopes for read-only tools",listed:i,picked:T.readOnly,onPick:e=>{O(t=>({...t,readOnly:e}))},isDisabled:I,testId:"tools-table-suggest-read-only"}),(0,s.jsx)(e_.f,{label:"Scopes for the other tools",listed:i,picked:T.other,onPick:e=>{O(t=>({...t,other:e}))},isDisabled:I,testId:"tools-table-suggest-other"}),(0,s.jsx)(e7,{title:"Read-only tools",names:es.readOnly,testId:"tools-table-suggest-read-only-tools"}),(0,s.jsx)(e7,{title:"Other tools",names:es.other,testId:"tools-table-suggest-other-tools"}),(0,s.jsx)(e7,{title:"Without hints, left as they are",names:es.withoutHints,testId:"tools-table-suggest-without-hints"})]})]})]})}function e7({title:e,names:t,testId:n}){return(0,s.jsxs)("details",{className:"rounded-md border border-border px-3 py-2","data-testid":n,children:[(0,s.jsxs)("summary",{className:"cursor-pointer",children:[e," (",t.length,")"]}),0===t.length?(0,s.jsx)("p",{className:"text-muted-foreground",children:"None"}):(0,s.jsx)("p",{className:"font-mono text-code break-words",children:t.join(", ")})]})}e.s(["ToolsTable",0,function(e){return(0,s.jsxs)(ez.f.Provider,{children:[(0,s.jsx)(e4,{...e}),(0,s.jsx)(e1.f,{})]})}],54418)},15327,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(28008),r=e.i(95187);let a=(0,r.createServerReference)("40e7a7e6912d4fe85e82238430f28daccc0ca68b01",r.callServer,void 0,r.findSourceMapURL,"readMoreSignIns"),l=(0,r.createServerReference)("40593685622e20a39118f2ae37576cd0e7ef70350d",r.callServer,void 0,r.findSourceMapURL,"removePersonSignIn");function i(e,t){let n=new Set(e.map(({personShipId:e})=>e));return[...e,...t.filter(({personShipId:e})=>!n.has(e))]}var o=e.i(30402),d=e.i(94984),c=e.i(97e3);let u=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],p=e=>String(e).padStart(2,"0"),f={signedIn:{tone:"ok",label:"Signed in"},lost:{tone:"attention",label:"Lost"}};function m(e){return e.personName??e.personShipId}function h({count:e}){return(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("h2",{className:"text-section font-semibold",children:"Everyone's sign-ins"}),null===e?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:e})]})}function g(){return(0,t.jsx)("thead",{className:"max-sm:hidden",children:(0,t.jsxs)("tr",{className:"border-b border-border text-left text-muted-foreground",children:[(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Person"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Account"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"State"}),(0,t.jsx)("th",{className:"h-10 px-2 font-medium",children:"Last used"}),(0,t.jsx)("th",{className:"h-10 px-2",children:(0,t.jsx)("span",{className:"sr-only",children:"Remove"})})]})})}function x({signIn:e,party:n,isRemoving:s,onConfirm:r,onKeep:a}){let l=m(e);return(0,t.jsxs)("div",{className:"grid gap-2 rounded-md bg-muted p-3","data-testid":"outside-party-sign-ins-confirm",children:[(0,t.jsxs)("p",{children:["Remove ",l,"'s sign-in? Their ships' calls to ",n," are refused until they sign in again."]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:o.x.destructive,disabled:s,"aria-busy":s,onClick:r,"data-testid":"outside-party-sign-ins-remove-confirmed",children:s?"Removing…":`Remove ${l}'s sign-in`}),(0,t.jsx)("button",{type:"button",className:o.x.secondary,onClick:a,children:"Keep"})]})]})}function b(e){let{party:n,now:s,rows:r,refusal:a,hasMore:l,isLoadingMore:i,confirming:b,removing:v,outcome:w}=e;return(0,t.jsxs)("section",{className:`${o.r} grid gap-3`,"data-testid":"outside-party-sign-ins",children:[(0,t.jsx)(h,{count:null===a?r.length:null}),(0,t.jsx)(d.f,{state:w}),null!==a?(0,t.jsx)(d.f,{state:{kind:"refused",message:a}}):0===r.length?(0,t.jsx)("p",{className:"text-muted-foreground",children:"Nobody has signed in yet."}):(0,t.jsxs)("table",{className:"w-full border-collapse max-sm:block",children:[(0,t.jsx)(g,{}),(0,t.jsx)("tbody",{className:"max-sm:grid",children:r.map(r=>{var a;let l,i,d=f[r.state],h=b===r.personShipId,g=null===r.lastUsedAt?"Not yet":(a=r.lastUsedAt,(i=new Date(s).getTime()-new Date(a).getTime())<6e4?"Just now":i<36e5?`${String(Math.floor(i/6e4))} min ago`:(l=new Date(a),`${String(l.getUTCDate())} ${u[l.getUTCMonth()]??""}, ${p(l.getUTCHours())}:${p(l.getUTCMinutes())}`));return[(0,t.jsxs)("tr",{className:`border-b border-border max-sm:grid max-sm:grid-cols-[1fr_auto] max-sm:gap-1 max-sm:py-3 ${h?"border-b-0":"last:border-b-0"}`,"data-testid":"outside-party-sign-ins-row",children:[(0,t.jsxs)("td",{className:"h-12 px-2 max-sm:col-start-1 max-sm:row-start-1 max-sm:h-auto max-sm:px-0 max-sm:font-medium",children:[m(r),r.isYours?(0,t.jsx)("span",{className:"font-normal text-muted-foreground",children:" (you)"}):null]}),(0,t.jsxs)("td",{className:"h-12 px-2 max-sm:col-span-2 max-sm:row-start-2 max-sm:h-auto max-sm:px-0 max-sm:text-muted-foreground",children:[function({outsideAccount:e}){return e.name??e.subject??(0,t.jsx)("span",{className:"text-muted-foreground",children:"Not known"})}(r),(0,t.jsxs)("span",{className:"sm:hidden",children:[" · last used ",null===r.lastUsedAt?"not yet":g]})]}),(0,t.jsx)("td",{className:"h-12 px-2 max-sm:col-start-2 max-sm:row-start-1 max-sm:h-auto max-sm:px-0",children:(0,t.jsx)(c.T,{tone:d.tone,label:d.label})}),(0,t.jsx)("td",{className:"h-12 px-2 text-muted-foreground max-sm:hidden",children:g}),(0,t.jsx)("td",{className:"h-12 px-2 text-right max-sm:col-span-2 max-sm:row-start-3 max-sm:h-auto max-sm:px-0 max-sm:text-left",children:(0,t.jsx)("button",{type:"button",className:`${o.x.secondary} ${h?"max-sm:hidden":""}`,onClick:()=>{e.onRemove(r.personShipId)},"data-testid":"outside-party-sign-ins-remove",children:"Remove"})})]},r.personShipId),h?(0,t.jsx)("tr",{className:"border-b border-border last:border-b-0 max-sm:block max-sm:pb-3",children:(0,t.jsx)("td",{colSpan:5,className:"pb-2 max-sm:block max-sm:pb-0",children:(0,t.jsx)(x,{signIn:r,party:n,isRemoving:v===r.personShipId,onConfirm:()=>{e.onConfirm(r)},onKeep:e.onKeep})})},`${r.personShipId}-confirm`):null]})})]}),null===a&&l?(0,t.jsx)("div",{children:(0,t.jsx)("button",{type:"button",className:o.x.secondary,disabled:i,"aria-busy":i,onClick:e.onMore,"data-testid":"outside-party-sign-ins-more",children:i?"Showing more…":"Show more"})}):null]})}e.s(["EveryonesSignInsCard",0,function({fleetId:e,party:r,now:o,first:d}){let[c,u]=(0,n.useState)([]),[p,f]=(0,n.useState)(d.next),[h,g]=(0,n.useState)(new Set),[x,v]=(0,n.useState)(null),[w,y]=(0,n.useState)(null),[S,j]=(0,n.useState)(s.Q),[N,R]=(0,n.useTransition)(),[,C]=(0,n.useTransition)(),k=i(d.grants,c).filter(({personShipId:e})=>!h.has(e));return(0,t.jsx)(b,{party:r,now:o,rows:k,refusal:null,hasMore:null!==p,isLoadingMore:N,confirming:x,removing:w,outcome:S,onRemove:e=>{v(e),j(s.Q)},onConfirm:t=>{y(t.personShipId),C(async()=>{let n=await l({fleetId:e,name:r,personShipId:t.personShipId});y(null),v(null),n.isOk?(g(e=>new Set([...e,t.personShipId])),j({kind:"done",message:function({person:e,party:t,isRevoked:n}){return n?`${e}'s sign-in is removed, and revoked at ${t}.`:`${e}'s sign-in is removed.`}({person:m(t),party:r,isRevoked:n.isRevoked})})):j({kind:"refused",message:n.message})})},onKeep:()=>{v(null)},onMore:()=>{let t=p??k.at(-1)?.personShipId;void 0!==t&&R(async()=>{let n=await a({fleetId:e,name:r,after:t});n.isOk?(u(e=>i(e,n.grants)),f(n.next)):j({kind:"refused",message:n.message})})}})}],15327)},52979,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(28008),r=e.i(94984),a=e.i(58107),l=e.i(95187);let i=(0,l.createServerReference)("6026bb159985f9d4881583a67cb2872dcaae3ff02a",l.callServer,void 0,l.findSourceMapURL,"removeOwnSignIn");var o=e.i(76584);function d({fleetId:e,party:n}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"hidden",name:s.H,value:e}),(0,t.jsx)("input",{type:"hidden",name:"name",value:n})]})}e.s(["RemoveSignInForm",0,function({fleetId:e,party:l}){let[o,c]=(0,n.useActionState)(i,s.Q);return(0,t.jsxs)("form",{action:c,className:"grid gap-2",children:[(0,t.jsx)(r.f,{state:o}),(0,t.jsx)(d,{fleetId:e,party:l}),(0,t.jsx)("div",{children:(0,t.jsx)(a.f,{kind:"secondary",pending:"Removing…",testId:"outside-party-sign-in-remove",children:"Remove"})})]})},"SignInForm",0,function({fleetId:e,party:l,label:i,kind:c}){let[u,p]=(0,n.useActionState)(o.f,s.Q);return(0,t.jsxs)("form",{action:p,className:"grid gap-2",children:[(0,t.jsx)(r.f,{state:u}),(0,t.jsx)(d,{fleetId:e,party:l}),(0,t.jsx)("div",{children:(0,t.jsx)(a.f,{kind:c,pending:`Opening ${l}…`,testId:"outside-party-sign-in-start",children:i})})]})}],52979)},12137,e=>{var t=e.i(43476),n=e.i(71645),s=e.i(74080),r=e.i(28008),a=e.i(25621),l=e.i(95187);let i=(0,l.createServerReference)("60ba7409746219e48a0ba8e750e4bf102f09a56269",l.callServer,void 0,l.findSourceMapURL,"markA2aAgent"),o={kind:"idle"};function d({isRepeatable:e}){let n=(0,s.useFormStatus)();return(0,t.jsx)(a.f,{type:"submit",isOn:e,label:"Repeatable",isPending:n.pending,testId:"outside-party-repeatable-switch"})}e.s(["RepeatableSwitch",0,function({fleetId:e,party:s,isRepeatable:a}){let[l,c]=(0,n.useActionState)(i,o),u="marked"===l.kind?l.isRepeatable:a;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("form",{action:c,className:"contents",children:[(0,t.jsx)("input",{type:"hidden",name:r.H,value:e}),(0,t.jsx)("input",{type:"hidden",name:"name",value:s}),(0,t.jsx)("input",{type:"hidden",name:"isRepeatable",value:String(!u)}),(0,t.jsx)(d,{isRepeatable:u})]}),"idle"===l.kind?null:(0,t.jsx)("span",{role:"refused"===l.kind?"alert":"status",className:`basis-full text-caption ${"refused"===l.kind?"text-tone-attention-fg":"text-tone-ok-fg"}`,"data-testid":"outside-party-repeatable-outcome",children:l.message})]})}],12137)}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87722,e=>{var s=e.i(43476),
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87722,e=>{var s=e.i(43476),a=e.i(71645),n=e.i(28008),t=e.i(62052),i=e.i(30402),l=e.i(94984),r=e.i(65818),d=e.i(58107),c=e.i(90526),o=e.i(95187);let u=(0,o.createServerReference)("60ca781a1c9f731db16ceadba0a0d7fb88c904344b",o.callServer,void 0,o.findSourceMapURL,"addA2aAgent"),m={kind:"idle"};e.s(["A2aAgentForm",0,function({fleetId:e,requestId:o,owners:p,scopes:h}){let[x,f]=(0,a.useActionState)(u,m),j="refused"===x.kind?x.fields:{};return(0,s.jsxs)("form",{action:f,className:`${i.r} grid max-w-160 gap-3`,"data-testid":"add-a2a-agent-form",children:[(0,s.jsx)("input",{type:"hidden",name:n.H,value:e}),(0,s.jsx)("input",{type:"hidden",name:"requestId",value:o}),(0,s.jsx)("h1",{className:"text-heading-touch font-semibold max-sm:sr-only",children:"Add an A2A agent"}),(0,s.jsx)(l.f,{state:"refused"===x.kind?x:{kind:"idle"}}),(0,s.jsxs)("label",{className:i.z,children:[(0,s.jsx)("span",{children:"Name, the proxy ship's"}),(0,s.jsx)("input",{className:i.w,name:"name",defaultValue:j.name??"",required:!0})]}),(0,s.jsxs)("label",{className:i.z,children:[(0,s.jsx)("span",{children:"Card address"}),(0,s.jsx)("input",{className:i.w,type:"url",name:"cardUrl",defaultValue:j.cardUrl??"",placeholder:"https://agent.example.com/.well-known/agent-card.json",required:!0}),(0,s.jsx)("span",{className:"text-caption text-muted-foreground",children:"The gateway reads the card first: an agent whose card it cannot state is not added."})]}),(0,s.jsx)(t.f,{legend:"The agent's credential",fields:j,noneHelp:"The gateway sends no credential: for an agent that asks for none."}),(0,s.jsxs)("label",{className:i.z,children:[(0,s.jsx)("span",{children:"Messages in flight at once"}),(0,s.jsx)("input",{className:i.w,type:"number",name:"concurrencyLimit",min:1,max:10,defaultValue:j.concurrencyLimit??"4"})]}),(0,s.jsx)(r.f,{choices:p.isOk?p.value:[],current:null,help:"A person ship or argo. It answers for this agent.",refusal:p.isOk?void 0:p.refusal}),0===h.length?null:(0,s.jsxs)("fieldset",{className:"grid gap-2",children:[(0,s.jsx)("legend",{className:"font-medium",children:"Scopes, beside sending and receiving"}),h.map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",name:`${c.f}${e}`,defaultChecked:void 0!==j[`${c.f}${e}`]}),(0,s.jsx)("span",{className:"font-mono text-code",children:e})]},e))]}),(0,s.jsx)("div",{children:(0,s.jsx)(d.f,{pending:"Reading the card…",children:"Add"})})]})}],87722)},28008,e=>{e.s(["H",0,"fleet","Q",0,{kind:"idle"}])},88374,e=>{let s=[{kind:"none",label:"No credential"},{kind:"bearer",label:"Bearer token"},{kind:"clientCredentials",label:"OAuth client credentials"}],a={kind:"personSignIn",label:"Each person signs in"},n=[...s,a];e.s(["a",0,n,"x",0,s,"m",0,a,"G",0,function(e){return n.find(({kind:s})=>s===e)?.kind??"bearer"},"C",0,function(e){return s.find(({kind:s})=>s===e)?.kind??"bearer"}])},62052,e=>{var s=e.i(43476),a=e.i(16327),n=e.i(71645),t=e.i(88374),i=e.i(30402);e.s(["f",0,function({legend:e,fields:l,noneHelp:r,canEachPersonSignIn:d=!1,onKindChange:c}){let o=d?t.G:t.C,[u,m]=(0,n.useState)(o(l.credentialKind??""));return(0,s.jsxs)("fieldset",{className:"grid gap-3",children:[(0,s.jsx)("legend",{className:"font-medium",children:e}),(0,s.jsxs)("span",{className:"relative",children:[(0,s.jsx)("select",{className:i.D,"aria-label":e,name:"credentialKind",value:u,onChange:e=>{let s=o(e.target.value);m(s),c?.(s)},children:(d?t.a:t.x).map(({kind:e,label:a})=>(0,s.jsx)("option",{value:e,children:a},e))}),(0,s.jsx)(a.f,{"aria-hidden":!0,className:"pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground"})]}),"clientCredentials"===u?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:i.z,children:[(0,s.jsx)("span",{children:"Client id"}),(0,s.jsx)("input",{className:i.w,type:"text",name:"clientId",defaultValue:l.clientId??""})]}),(0,s.jsxs)("label",{className:i.z,children:[(0,s.jsx)("span",{children:"Client secret"}),(0,s.jsx)("input",{className:i.w,type:"password",name:"clientSecret"})]}),(0,s.jsxs)("label",{className:i.z,children:[(0,s.jsx)("span",{children:"Issuer"}),(0,s.jsx)("input",{className:i.w,type:"url",name:"issuer",defaultValue:l.issuer??""})]}),(0,s.jsxs)("label",{className:i.z,children:[(0,s.jsx)("span",{children:"Scope"}),(0,s.jsx)("input",{className:i.w,type:"text",name:"scope",defaultValue:l.scope??""})]})]}):"bearer"===u?(0,s.jsxs)("label",{className:i.z,children:[(0,s.jsx)("span",{children:"Bearer token"}),(0,s.jsx)("input",{className:i.w,type:"password",name:"token"})]}):u===t.m.kind?(0,s.jsx)("p",{className:"text-muted-foreground",children:"Each person signs in for themselves. A ship calls under its owner's sign-in."}):(0,s.jsx)("p",{className:"text-muted-foreground",children:r})]})}])},94984,e=>{var s=e.i(43476);e.s(["f",0,function({state:e,testId:a}){switch(e.kind){case"idle":return null;case"done":return(0,s.jsx)("p",{role:"status","data-testid":a,className:"rounded-md border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-tone-ok-fg",children:e.message});case"refused":case"openNetwork":return(0,s.jsx)("p",{role:"alert","data-testid":a,className:"rounded-md border border-tone-attention-border bg-tone-attention-bg px-3 py-2 text-tone-attention-fg",children:e.message})}}])},65818,e=>{var s=e.i(43476),a=e.i(30402);e.s(["f",0,function({choices:e,current:n,help:t,refusal:i}){let l=null===n||e.some(e=>e.shipId===n.shipId)?e:[n,...e];return(0,s.jsxs)("label",{className:a.z,children:[(0,s.jsx)("span",{children:"Owner"}),(0,s.jsxs)("select",{className:a.w,name:"ownerShipId",defaultValue:n?.shipId??"",required:!0,"data-testid":"owner-field",children:[null===n?(0,s.jsx)("option",{value:"",disabled:!0,children:"Pick its owner"}):null,l.map(e=>(0,s.jsx)("option",{value:e.shipId,children:e.name},e.shipId))]}),(0,s.jsx)("span",{className:"text-muted-foreground",children:i??t})]})}])},58107,e=>{var s=e.i(43476),a=e.i(74080),n=e.i(30402);e.s(["f",0,function({children:e,pending:t,kind:i="primary",testId:l}){let r=(0,a.useFormStatus)();return(0,s.jsx)("button",{type:"submit",className:n.x[i],disabled:r.pending,"aria-busy":r.pending,"data-testid":l,children:r.pending?t:e})}])},90526,e=>{e.s(["f",0,"scope:"])}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[66595,e=>{var t=e.i(56420);let
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[66595,e=>{var t=e.i(56420);let a={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};a.node;let r=(0,t.f)(a);e.s(["f",0,r],66595)},95187,(e,t,a)=>{Object.defineProperty(a,"__esModule",{value:!0});var r={callServer:function(){return n.callServer},createServerReference:function(){return c.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var s in r)Object.defineProperty(a,s,{enumerable:!0,get:r[s]});let n=e.r(32120),i=e.r(92245),c=e.r(35326)},67914,e=>{var t=e.i(43476),a=e.i(71645),r=e.i(95187);let s=(0,r.createServerReference)("40d3155c2275216a9e48f8dfb030e0e9db8aa9ad40",r.callServer,void 0,r.findSourceMapURL,"setTheme"),n=["light","dark","system"];e.s(["f",0,function({email:e,accountUrl:r,theme:i,entries:c=[]}){let[l,d]=(0,a.useState)(i),[o,u]=(0,a.useState)(!1),m=(0,a.useRef)(null);return{account:{name:e,signedInAs:"account",accountUrl:r,theme:l,themes:n,hasTheme:!0,onThemeChange:e=>{let t;d(e),document.documentElement.dataset.theme=e,t="dark"===e||"system"===e&&window.matchMedia("(prefers-color-scheme: dark)").matches,document.documentElement.classList.toggle("dark",t),s(e)},shortcuts:[],helpUrl:"https://github.com/ThomasHendrickx/aeolus-fleet",onSignOut:()=>{u(!0),m.current?.requestSubmit()},isSigningOut:o,entries:c},signOutForm:(0,t.jsx)("form",{ref:m,method:"post",action:"/sign-in/end",hidden:!0})}}],67914)},84821,e=>{var t=e.i(43476),a=e.i(66595),r=e.i(68221),s=e.i(67393),n=e.i(55939),i=e.i(12911),c=e.i(11271);function l({switcher:e,account:d,onSearch:o,searchLabel:u="Search or jump to",children:m,actions:h,className:f}){return(0,t.jsxs)("header",{"data-slot":"app-header",className:(0,c.f)("sticky top-0 z-30 flex h-(--size-header) shrink-0 items-center justify-between gap-4 border-b border-border bg-background px-6",f),children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[void 0===e?(0,t.jsx)("span",{"data-testid":"app-switcher-loading","aria-hidden":!0,className:"h-4 w-36 shrink-0 animate-pulse rounded bg-muted motion-reduce:animate-none"}):(0,t.jsx)(r.AppSwitcher,{switcher:e,layout:"full",className:"shrink-0"}),m]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3",children:[h,o?(0,t.jsxs)(s.f,{size:"sm",icon:(0,t.jsx)(a.f,{"aria-hidden":!0}),"data-testid":"header-search",className:"w-60 justify-start font-normal text-muted-foreground max-lg:w-auto",onClick:o,children:[(0,t.jsx)("span",{className:"grow text-left max-lg:sr-only",children:u}),(0,t.jsx)(n.f,{children:"⌘K"})]}):null,(0,t.jsx)(i.AvatarMenu,{...d})]})]})}var d=e.i(18566),o=e.i(67914),u=e.i(65894);let m=[{key:"bridge",label:"Bridge",path:"/bridge"},{key:"outside-parties",label:"Outside parties",path:"/outside-parties"},{key:"parties",label:"Parties",path:"/parties"},{key:"slack",label:"Slack",path:"/slack"}];function h({fleetId:e}){let a=(0,d.usePathname)();return(0,t.jsx)("nav",{"aria-label":"Gateway",className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:m.map(({key:r,label:s,path:n})=>{let i=a===n||a.startsWith(`${n}/`);return(0,t.jsx)("a",{href:(0,u.f)(n,e),"data-testid":`frame-tab-${r}`,"aria-current":i?"page":void 0,className:`whitespace-nowrap rounded-md px-2 py-1 text-sm ${i?"bg-accent font-semibold":"text-muted-foreground hover:bg-accent"}`,children:s},r)})})}e.s(["GatewayHeader",0,function({switchers:e,email:a,accountUrl:s,theme:n}){let c=(0,d.useSearchParams)().get("fleet"),u=e.find(({fleet:e})=>e.id===c)??e[0],{account:m,signOutForm:f}=(0,o.f)({email:a,accountUrl:s,theme:n});return(0,t.jsxs)(t.Fragment,{children:[f,(0,t.jsx)(l,{switcher:u,account:m,className:"max-sm:hidden",children:void 0===u?null:(0,t.jsx)(h,{fleetId:u.fleet.id})}),(0,t.jsxs)("header",{className:"sticky top-0 z-30 flex h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-4 sm:hidden",children:[void 0===u?null:(0,t.jsx)(r.AppSwitcher,{switcher:u,layout:"compact",className:"min-w-0"}),void 0===u?null:(0,t.jsx)(h,{fleetId:u.fleet.id}),(0,t.jsx)("span",{className:"grow"}),(0,t.jsx)(i.AvatarMenuSheet,{...m})]})]})}],84821)},65894,e=>{e.s(["f",0,function(e,t){let[a="",r=""]=e.split("?"),s=new URLSearchParams(r);return s.set("fleet",t),`${a}?${s.toString()}`}])}],18566,(e,t,a)=>{t.exports=e.r(76562)}]);
|