thursday-agent 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +0 -1
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +0 -6
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/keep-working/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/events/route.js.nft.json +1 -1
- package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
- package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/reach/route.js +13 -13
- package/.next/server/app/api/reach/route.js.nft.json +1 -1
- package/.next/server/app/api/routine/route.js.nft.json +1 -1
- package/.next/server/app/api/signins/route.js +1 -1
- package/.next/server/app/api/signins/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js +14 -15
- package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/route.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
- package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/.next/server/app/page/server-reference-manifest.json +56 -56
- package/.next/server/app/page.js +4 -4
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +0 -1
- package/.next/server/chunks/[root-of-the-server]__014ydvq._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0209ah4._.js +7 -5
- package/.next/server/chunks/[root-of-the-server]__04r4h-2._.js +4 -2
- package/.next/server/chunks/[root-of-the-server]__0542v_d._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0gewdg9._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1-swlkw._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__12iddfq._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ai5lme._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__1cjxw0-._.js +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1fy2g82._.js → [root-of-the-server]__1k3j52n._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1kyjt5m._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
- package/.next/server/chunks/_05v8k21._.js +3 -1
- package/.next/server/chunks/_0awtznl._.js +1 -1
- package/.next/server/chunks/_0na2fj1._.js +1 -1
- package/.next/server/chunks/_0x-ej3f._.js +17 -17
- package/.next/server/chunks/_12-amdu._.js +2 -2
- package/.next/server/chunks/_15740dw._.js +60 -0
- package/.next/server/chunks/_1dc_d1q._.js +3 -3
- package/.next/server/chunks/_1i350l5._.js +3 -1
- package/.next/server/chunks/_1jc5g4p._.js +2 -2
- package/.next/server/chunks/_1jn-aep._.js +4 -4
- package/.next/server/chunks/_1m88lkh._.js +11 -11
- package/.next/server/chunks/_1ogqovh._.js +4 -4
- package/.next/server/chunks/_1uuucy-._.js +1 -1
- package/.next/server/chunks/_1zxp-p6._.js +1 -1
- package/.next/server/chunks/features_0rfvely._.js +5 -3
- package/.next/server/chunks/ssr/{[root-of-the-server]__1se25x0._.js → [root-of-the-server]__0hpp3nw._.js} +29 -13
- package/.next/server/chunks/ssr/[root-of-the-server]__0m7u9j-._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0tzekbl._.js +24 -60
- package/.next/server/chunks/ssr/[root-of-the-server]__1cz2rz5._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__0tvavy9._.js → [root-of-the-server]__1iwyp1e._.js} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1w9hqq8._.js +1 -1
- package/.next/server/chunks/ssr/_097-ljd._.js +1 -1
- package/.next/server/chunks/ssr/{_1tmu8z-._.js → _0btzccu._.js} +2 -2
- package/.next/server/chunks/ssr/_0fqhhwi._.js +1 -1
- package/.next/server/chunks/ssr/_0hjzb5o._.js +3 -0
- package/.next/server/chunks/ssr/_0ld9_qq._.js +1 -1
- package/.next/server/chunks/ssr/{_0urj3mc._.js → _0ouzu9f._.js} +2 -2
- package/.next/server/chunks/ssr/{_1-zyvdb._.js → _0u7ko71._.js} +2 -2
- package/.next/server/chunks/ssr/{_0ltz2q5._.js → _0wd_o8-._.js} +2 -2
- package/.next/server/chunks/ssr/_0ya0cb0._.js +3 -0
- package/.next/server/chunks/ssr/_10yyqtk._.js +67 -0
- package/.next/server/chunks/ssr/{_1uy0xom._.js → _12eyown._.js} +3 -3
- package/.next/server/chunks/ssr/_12mijol._.js +11 -11
- package/.next/server/chunks/ssr/_132qkfz._.js +1 -1
- package/.next/server/chunks/ssr/_184327j._.js +1 -1
- package/.next/server/chunks/ssr/{_1z74dmq._.js → _19ps4p3._.js} +7 -7
- package/.next/server/chunks/ssr/{_1flbs77._.js → _1bhy4yg._.js} +2 -2
- package/.next/server/chunks/ssr/_1d423aj._.js +7 -5
- package/.next/server/chunks/ssr/{_1a-nuxx._.js → _1kd843u._.js} +2 -2
- package/.next/server/chunks/ssr/{_0ital-2._.js → _1kq2ye_._.js} +2 -2
- package/.next/server/chunks/ssr/_1mqn9mc._.js +1 -1
- package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
- package/.next/server/chunks/ssr/_1p8xorg._.js +3 -0
- package/.next/server/chunks/ssr/{_1x-kojb._.js → _1q683w8._.js} +3 -3
- package/.next/server/chunks/ssr/_1tawxu2._.js +3 -0
- package/.next/server/chunks/ssr/{_0scf7xy._.js → _1w2oba6._.js} +2 -2
- package/.next/server/chunks/ssr/_1xoch6f._.js +1 -1
- package/.next/server/chunks/ssr/{_0kjj5ts._.js → _1ybo1hd._.js} +3 -3
- package/.next/server/chunks/ssr/features_bot_0s11m4r._.js +3 -0
- package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
- package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
- package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
- package/.next/server/chunks/ssr/features_workspace_00jz2hu._.js +1 -1
- package/.next/server/chunks/ssr/{node_modules_1af3w91._.js → node_modules_00pocul._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0th357h._.js → node_modules_02zt4az._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0jljel9._.js → node_modules_05ojmcl._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0wnlddw._.js → node_modules_06i6bli._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_06bb4q8._.js → node_modules_09dj429._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_068ws5v._.js → node_modules_0auzgvx._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1ogczzz._.js → node_modules_0evjwh1._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_13kwejm._.js → node_modules_0gmdur8._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1s-gb-1._.js → node_modules_0j3te-1._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1bucjlk._.js → node_modules_0rbaymq._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1wbkzl9._.js → node_modules_0tf8_1e._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_12et8d5._.js → node_modules_0yqy-0b._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1lkix61._.js → node_modules_1-53ebx._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_03d0rfz._.js → node_modules_1-y9aho._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0x630an._.js → node_modules_11bltzp._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0uyh_vb._.js → node_modules_18jn2qo._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0dzm4um._.js → node_modules_1_te3bu._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_07rs_p2._.js → node_modules_1c0pg3k._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0sgy-dc._.js → node_modules_1en2jx5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0ubdtk-._.js → node_modules_1p-c8cr._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1z1lrbk._.js → node_modules_1qe-oxg._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_04_sbbc._.js → node_modules_1rjt833._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0yvz9e0._.js → node_modules_1tzw5sn._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1uwg-gz._.js → node_modules_1x6uwvn._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0t_ez6-._.js → node_modules_1zqddke._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_05ybmta._.js → node_modules_211zgim._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0r443fh._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0y51bqj._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_10wnlbk._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1sc114e._.js} +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +57 -57
- package/.next/static/chunks/{13ixzheqw7o-w.js → 03-724sj0nk_z.js} +2 -2
- package/.next/static/chunks/03bhu4mk8en2q.js +1 -0
- package/.next/static/chunks/{3h2e-xv1zxh_f.js → 04imzjhvzw65d.js} +2 -2
- package/.next/static/chunks/{27tvv1i-smrck.js → 0gljzv9fz1g7d.js} +1 -1
- package/.next/static/chunks/{37j27b3e1gt7r.js → 0h0lythv1ql93.js} +1 -1
- package/.next/static/chunks/{2o4dndk0d68do.js → 0hzbj7f48cmx0.js} +1 -1
- package/.next/static/chunks/0lwunwbl7u7pt.js +1 -0
- package/.next/static/chunks/{0u9ae9k_2g7k3.js → 0r6nwxg4dv83t.js} +1 -1
- package/.next/static/chunks/0rn9nbg6aif9f.js +17 -0
- package/.next/static/chunks/{3bbzsitgiltnt.js → 0x_w4shtvrrfg.js} +1 -1
- package/.next/static/chunks/{2sdwbfs1x5skp.js → 0ympuji_ufypd.js} +1 -1
- package/.next/static/chunks/{3t9huugh-5_ps.js → 0zmrz4zfzm4dt.js} +1 -1
- package/.next/static/chunks/{0qmd8n52hp-6v.js → 11tlxkr7a_rpc.js} +1 -1
- package/.next/static/chunks/{2c64drdevdla3.js → 12scesro428m7.js} +2 -2
- package/.next/static/chunks/16s2fx3890_jd.js +65 -0
- package/.next/static/chunks/{0oyz95sujd2c7.js → 1qzfgplyo18tc.js} +1 -1
- package/.next/static/chunks/{04e-e--5lk26x.js → 1r4zajz14jp9-.js} +1 -1
- package/.next/static/chunks/1s6m4cmbn7htf.js +1 -0
- package/.next/static/chunks/1wl9t1-3i-q8p.css +1 -0
- package/.next/static/chunks/2-asot3p1j3yg.js +1 -0
- package/.next/static/chunks/{0u3ktztrzu1fa.js → 2-jn4xscbm-i2.js} +1 -1
- package/.next/static/chunks/22h9gvclqtx_2.js +1 -0
- package/.next/static/chunks/{337g9g_ux2gj-.js → 26-eblxwnykck.js} +1 -1
- package/.next/static/chunks/{43q9cgbuw8krx.js → 2kzwhbuobpkw3.js} +2 -2
- package/.next/static/chunks/2m6jd3586ijb-.js +1 -0
- package/.next/static/chunks/{0_awn8tucznxc.js → 304q9p54tcgm1.js} +1 -1
- package/.next/static/chunks/{1u5i-jti87jbo.js → 35wdx3wt7cg4a.js} +1 -1
- package/.next/static/chunks/37unh9460im7v.js +18 -0
- package/.next/static/chunks/{01xjer0i_e5z5.js → 39gj5vxz1zpm_.js} +1 -1
- package/.next/static/chunks/{427qsc6kahxyo.js → 39vrqy1r_00jc.js} +1 -1
- package/.next/static/chunks/{245hb85nsy6j4.js → 3dipmu0mptqum.js} +1 -1
- package/.next/static/chunks/3gki-squw28yu.js +1 -0
- package/.next/static/chunks/{3obf9n3cxj99k.js → 3jvldk2wvwbge.js} +1 -1
- package/.next/static/chunks/{38301ji-85i30.js → 3nnzdl_te20hv.js} +1 -1
- package/.next/static/chunks/{2m267diam_vib.js → 3tz4dr0_8pq1-.js} +1 -1
- package/.next/static/chunks/{2gocl3dq0_h1s.js → 3x6pggb-2kyrk.js} +1 -1
- package/.next/static/chunks/{025bmrgeukcb2.js → 4440mws9jz3mt.js} +1 -1
- package/README.md +4 -0
- package/app/api/thursday/tool-call/route.ts +1 -15
- package/components/ui/radio-group.tsx +2 -2
- package/docs/images/demo-still.jpg +0 -0
- package/docs/live-calls.md +19 -11
- package/features/ai/prompts/live.prompt.ts +51 -26
- package/features/ai/prompts/prompt-helper.ts +1 -9
- package/features/ai/prompts/thursday.prompt.ts +8 -2
- package/features/bot/bot.run.ts +9 -3
- package/features/bot/bot.seed.ts +35 -91
- package/features/bot/components/bot-room.tsx +0 -6
- package/features/bot/components/bot-setting.tsx +4 -4
- package/features/bot/components/room-pill.tsx +4 -2
- package/features/bot/seed-bots.ts +2 -2
- package/features/intro/components/intro.tsx +2 -3
- package/features/reach/reach.ts +2 -2
- package/features/routine/components/routine-setting.tsx +1 -1
- package/features/signins/signins.query.ts +66 -1
- package/features/thursday/components/side-captions.tsx +31 -8
- package/features/thursday/components/thursday-setting.tsx +5 -5
- package/features/thursday/components/thursday.tsx +97 -39
- package/features/thursday/components/write-line.tsx +28 -17
- package/features/thursday/thursday.action.ts +4 -20
- package/features/thursday/thursday.schema.ts +0 -9
- package/features/thursday/thursday.store.ts +11 -15
- package/features/thursday/thursday.text.ts +10 -8
- package/features/thursday/tool-line.ts +17 -6
- package/features/thursday/use-call-ring.ts +1 -5
- package/features/thursday/use-text-call.ts +37 -21
- package/features/thursday/use-thursday.ts +14 -44
- package/features/workspace/workspace.ts +4 -2
- package/guide/bots.md +13 -3
- package/guide/calls.md +7 -5
- package/knip.json +1 -0
- package/lib/live/live.session.ts +0 -39
- package/package.json +1 -1
- package/scripts/live-session.test.mts +19 -26
- package/seed-skills/analyst/README.md +18 -0
- package/seed-skills/analyst/data-report/SKILL.md +60 -0
- package/seed-skills/analyst/data-report/references/brief.md +31 -0
- package/seed-skills/analyst/data-report/references/company.md +41 -0
- package/seed-skills/analyst/data-report/references/comparison.md +42 -0
- package/seed-skills/analyst/data-report/references/decision.md +28 -0
- package/seed-skills/analyst/data-report/references/market-size.md +49 -0
- package/seed-skills/analyst/data-report/references/price-check.md +33 -0
- package/seed-skills/analyst/data-report/references/sources.md +51 -0
- package/seed-skills/analyst/data-report/references/trend.md +39 -0
- package/seed-skills/analyst/data-report/scripts/fetch.mjs +521 -0
- package/seed-skills/insta/instagram/SKILL.md +36 -0
- package/seed-skills/insta/instagram/references/dm.md +49 -0
- package/seed-skills/insta/instagram/references/post.md +74 -0
- package/seed-skills/insta/instagram/scripts/compose.mjs +333 -0
- package/seed-skills/insta/instagram/scripts/inbox.mjs +163 -0
- package/seed-skills/insta/instagram/scripts/lib.mjs +33 -0
- package/seed-skills/insta/instagram/scripts/media.mjs +104 -0
- package/seed-skills/insta/instagram/scripts/profile.mjs +143 -0
- package/seed-skills/insta/instagram/scripts/read.mjs +244 -0
- package/seed-skills/insta/instagram/scripts/search.mjs +137 -0
- package/seed-skills/insta/instagram/scripts/selectors.mjs +56 -0
- package/seed-skills/insta/instagram/scripts/sheet.mjs +43 -0
- package/seed-skills/insta/instagram/templates/carousel.html +62 -0
- package/seed-skills/marketer/README.md +6 -4
- package/seed-skills/marketer/copywriting/SKILL.md +1 -1
- package/seed-skills/marketer/emails/SKILL.md +1 -1
- package/seed-skills/marketer/launch/SKILL.md +1 -1
- package/seed-skills/marketer/product-marketing/SKILL.md +5 -5
- package/seed-skills/marketer/seo-audit/SKILL.md +1 -1
- package/seed-skills/marketer/social/SKILL.md +1 -1
- package/seed-skills/tutor/picture-book/SKILL.md +16 -0
- package/seed-skills/tutor/picture-book/book/book.css +181 -0
- package/seed-skills/tutor/picture-book/book/book.html +33 -0
- package/seed-skills/tutor/picture-book/book/book.js +60 -0
- package/seed-skills/tutor/picture-book/references/picture-book.md +104 -0
- package/seed-skills/tutor/picture-book/scripts/book-video.mjs +177 -0
- package/seed-skills/tutor/picture-book/scripts/book.mjs +98 -0
- package/skills/browser/SKILL.md +13 -4
- package/skills/browser/references/scripts.md +55 -0
- package/skills/browser/scripts/image-size.mjs +30 -0
- package/skills/browser/scripts/render.mjs +126 -0
- package/skills/browser/scripts/session.mjs +105 -0
- package/skills/browser/scripts/sheet.mjs +97 -0
- package/skills/browser/scripts/webimage.mjs +105 -0
- package/skills/interactive-page/SKILL.md +4 -3
- package/skills/interactive-page/scripts/chart.mjs +679 -0
- package/skills/interactive-page/scripts/page.mjs +1 -0
- package/.next/server/app/api/probe/route/app-paths-manifest.json +0 -3
- package/.next/server/app/api/probe/route/build-manifest.json +0 -12
- package/.next/server/app/api/probe/route/server-reference-manifest.json +0 -4
- package/.next/server/app/api/probe/route.js +0 -10
- package/.next/server/app/api/probe/route.js.map +0 -5
- package/.next/server/app/api/probe/route.js.nft.json +0 -1
- package/.next/server/app/api/probe/route_client-reference-manifest.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__012s2o8._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0z0hc1f._.js +0 -4
- package/.next/server/chunks/[root-of-the-server]__1v7-zke._.js +0 -5
- package/.next/server/chunks/_0whlpyi._.js +0 -4
- package/.next/server/chunks/_next-internal_server_app_api_probe_route_actions_0cqd30j.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0oo-wlv._.js +0 -103
- package/.next/server/chunks/ssr/[root-of-the-server]__0zuns7e._.js +0 -3
- package/.next/server/chunks/ssr/_070nv1_._.js +0 -3
- package/.next/server/chunks/ssr/_0dshsh4._.js +0 -3
- package/.next/server/chunks/ssr/_0l_mcfz._.js +0 -3
- package/.next/server/chunks/ssr/_0u5xv6g._.js +0 -3
- package/.next/server/chunks/ssr/_157yfrk._.js +0 -3
- package/.next/server/chunks/ssr/features_bot_1nr94ks._.js +0 -3
- package/.next/static/chunks/06nt9tatr-dug.js +0 -1
- package/.next/static/chunks/0ge-hx0ed83a1.js +0 -1
- package/.next/static/chunks/0pda_vf-abwvx.js +0 -1
- package/.next/static/chunks/0rowp9rx3qbxu.js +0 -18
- package/.next/static/chunks/1grkt5gr8pbg1.js +0 -17
- package/.next/static/chunks/1yugpvvi8qrbu.js +0 -101
- package/.next/static/chunks/27lkanxvtdn09.js +0 -1
- package/.next/static/chunks/3fec-aeteddr-.js +0 -1
- package/.next/static/chunks/3go3hwp1z2_h2.css +0 -1
- package/.next/static/chunks/3h2bun3hcggg8.js +0 -1
- package/.next/static/chunks/3j1y335o95mj7.js +0 -1
- package/lib/probe.server.ts +0 -17
- package/lib/probe.ts +0 -55
- /package/.next/static/{u8kJqShUAa49vY7BxAWsw → En1vUPazxcYjPjnnahcN5}/_buildManifest.js +0 -0
- /package/.next/static/{u8kJqShUAa49vY7BxAWsw → En1vUPazxcYjPjnnahcN5}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{u8kJqShUAa49vY7BxAWsw → En1vUPazxcYjPjnnahcN5}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,463415,547242,978411,e=>{"use strict";var t=e.i(843476);e.i(261027);var n=e.i(382370),o=e.i(389554),r=e.i(685996),i=e.i(371714),a=e.i(181194),s=e.i(801545),u=e.i(91384),l=e.i(858307),d=e.i(764270),c=e.i(219712),p=e.i(82264),f=e.i(862050),g=e.i(282593),m=e.i(105953),v=e.i(63947),b=e.i(277450),h=e.i(733332),S=e.i(271645),R=e.i(439957),x=e.i(108868),y=e.i(896499),E=e.i(667865),M=e.i(146376),I=e.i(956789),C=e.i(650316),k=e.i(385689),O=e.i(46420),T=e.i(413082),w=e.i(872135),P=e.i(379248),A=e.i(584446),N=e.i(978921),D=e.i(879938),L=e.i(552245),F=e.i(540886),B=e.i(264042),j=e.i(348990),H=e.i(838452),U=e.i(229315),_=e.i(459636),G=e.i(264111),K=e.i(346570),Y=e.i(788015),V=e.i(56434),z=e.i(507447),W=e.i(638396),J=e.i(152535),$=e.i(176782);let q=(0,y.fastComponentRef)(function(e,n){let o,{render:r,className:i,style:a,disabled:s=!1,nativeButton:u=!0,id:l,openOnHover:d,delay:c=100,closeDelay:p=0,handle:f,payload:g,...m}=e,v=(0,N.useMenuRootContext)(!0),b=(0,_.usePopupHandleStore)(f)??v?.store;if(!b)throw Error((0,h.default)(85));let y=(0,Y.useBaseUiId)(l),q=b.useState("isTriggerActive",y),X=b.useState("floatingRootContext"),Q=b.useState("isOpenedByTrigger",y),Z=b.useState("triggerPopupId",y),ee=S.useRef(null),et=(o=(0,z.useMenubarContext)(!0),S.useMemo(()=>o?{type:"menubar",context:o}:{type:void 0},[o])),en=(0,H.useCompositeRootContext)(!0),eo=(0,O.useFloatingTree)(),er=S.useMemo(()=>eo??new P.FloatingTreeStore,[eo]),ei=(0,O.useFloatingNodeId)(er),ea=(0,O.useFloatingParentNodeId)(),{registerTrigger:es,isMountedByThisTrigger:eu}=(0,G.useTriggerDataForwarding)(y,ee,b,{payload:g,closeDelay:p,parent:et,floatingTreeRoot:er,floatingNodeId:ei,floatingParentNodeId:ea,keyboardEventRelay:en?.relayKeyboardEvent}),el="menubar"===et.type,ed=b.useState("disabled"),ec=s||ed||el&&et.context.disabled,{getButtonProps:ep,buttonRef:ef}=(0,F.useButton)({disabled:ec,native:u});S.useEffect(()=>{Q||void 0!==et.type||(b.context.allowMouseUpTriggerRef.current=!1)},[b,Q,et.type]);let eg=S.useRef(null),em=(0,R.useTimeout)(),ev=(0,E.useStableCallback)(e=>{if(!eg.current)return;em.clear(),b.context.allowMouseUpTriggerRef.current=!1;let t=e.target;(0,A.contains)(eg.current,t)||(0,A.contains)(b.select("positionerElement"),t)||t===eg.current||null!=t&&function e(t){return(0,U.isHTMLElement)(t)&&t.hasAttribute("data-rootownerid")?t.getAttribute("data-rootownerid"):(0,U.isLastTraversableNode)(t)?void 0:e((0,U.getParentNode)(t))}(t)===b.select("rootId")||(0,B.isMouseWithinBounds)(e,eg.current)||er.events.emit("close",{domEvent:e,reason:V.REASONS.cancelOpen})});S.useEffect(()=>{Q&&b.select("lastOpenChangeReason")===V.REASONS.triggerHover&&(0,x.ownerDocument)(eg.current).addEventListener("mouseup",ev,{once:!0})},[Q,ev,b]);let eb=el&&et.context.hasSubmenuOpen,eh=d??eb,eS=(0,w.useHoverReferenceInteraction)(X,{enabled:eh&&!ec&&(!el||eb&&!eu),handleClose:(0,C.safePolygon)({blockPointerEvents:!el}),mouseOnly:!0,move:!1,restMs:void 0===et.type?c:void 0,delay:{close:p},triggerElementRef:ee,externalTree:er,isActiveTrigger:q,isClosing:()=>"ending"===b.select("transitionStatus")}),eR=function(e,t){let n=(0,R.useTimeout)(),[o,r]=S.useState(!1);return(0,M.useIsoLayoutEffect)(()=>{e&&t===V.REASONS.triggerHover?(r(!0),n.start(W.PATIENT_CLICK_THRESHOLD,()=>{r(!1)})):e||(n.clear(),r(!1))},[e,t,n]),o}(Q,b.select("lastOpenChangeReason")),ex=(0,k.useClick)(X,{enabled:!ec,event:Q&&el?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:void 0===et.type&&eR}),ey=(0,T.useFocus)(X,{enabled:!ec&&eb}),eE=function(e){let{enabled:t=!0,mouseDownAction:n,open:o}=e,r=S.useRef(!1);return S.useMemo(()=>t?{onMouseDown:e=>{("open"===n&&!o||"close"===n&&o)&&(r.current=!0,(0,x.ownerDocument)(e.currentTarget).addEventListener("click",()=>{r.current=!1},{once:!0}))},onClick:e=>{r.current&&(r.current=!1,e.preventBaseUIHandler())}}:I.EMPTY_OBJECT,[t,n,o])}({open:Q,enabled:el,mouseDownAction:"open"}),eM=S.useMemo(()=>(0,$.mergeProps)(ey.reference,ex.reference),[ey.reference,ex.reference]),eI=b.useState("triggerProps",eu),{preFocusGuardRef:eC,handlePreFocusGuardFocus:ek,handleFocusTargetFocus:eO}=(0,K.useTriggerFocusGuards)(b,ee),eT={disabled:ec,open:Q},ew=[eg,n,ef,es,ee],eP=[eM,eS??I.EMPTY_OBJECT,eI,{"aria-haspopup":"menu","aria-controls":Z,id:y,onMouseDown:e=>{b.select("open")||(em.start(200,()=>{b.context.allowMouseUpTriggerRef.current=!0}),(0,x.ownerDocument)(e.currentTarget).addEventListener("mouseup",ev,{once:!0}))}},el?{role:"menuitem"}:{},eE,m,ep],eA=(0,L.useRenderElement)("button",e,{enabled:!el,stateAttributesMapping:D.pressableTriggerOpenStateMapping,state:eT,ref:ew,props:eP});return el?(0,t.jsx)(j.CompositeItem,{tag:"button",render:r,className:i,style:a,state:eT,refs:ew,props:eP,stateAttributesMapping:D.pressableTriggerOpenStateMapping}):Q?(0,t.jsxs)(S.Fragment,{children:[(0,t.jsx)(J.FocusGuard,{ref:eC,onFocus:ek},`${y}-pre-focus-guard`),(0,t.jsx)(S.Fragment,{children:eA},y),(0,t.jsx)(J.FocusGuard,{ref:b.context.triggerFocusTargetRef,onFocus:eO},`${y}-post-focus-guard`)]}):(0,t.jsx)(S.Fragment,{children:eA},y)});var X=e.i(803414),Q=e.i(818390);let Z=S.forwardRef(function(e,t){let{render:n,className:o,style:r,children:i,...a}=e,{store:s}=(0,N.useMenuRootContext)(),{side:u}=(0,X.useMenuPositionerContext)(),l=s.useState("instantType"),{children:d,state:c}=(0,Q.usePopupViewport)({store:s,side:u,children:i}),p={activationDirection:c.activationDirection,transitioning:c.transitioning,instant:l};return(0,L.useRenderElement)("div",e,{state:p,ref:t,props:[a,{children:d}],stateAttributesMapping:Q.popupViewportStateMapping})});var ee=e.i(652225),et=e.i(328744),en=e.i(673553),eo=e.i(866506),er=e.i(874671);let ei={"aria-expanded":void 0},ea=S.forwardRef(function(e,t){let{render:n,className:o,style:r,label:i,id:a,nativeButton:s=!1,openOnHover:u=!0,delay:l=100,closeDelay:d=0,disabled:c=!1,...p}=e,f=(0,er.useMenuSubmenuRootContext)();if(!f?.parentMenu)throw Error((0,h.default)(37));let g=(0,en.useCompositeListItem)({guess:!0,label:i}),m=(0,X.useMenuPositionerContext)(),{store:v}=(0,N.useMenuRootContext)(),b=(0,Y.useBaseUiId)(a),R=v.useState("open"),x=v.useState("floatingRootContext"),y=v.useState("floatingTreeRoot"),O=v.useState("triggerPopupId",b),T=(0,G.useTriggerRegistration)(b,v),P=(0,E.useStableCallback)(e=>{T(e),null!==e&&v.select("open")&&null==v.select("activeTriggerId")&&v.update({activeTriggerId:b??null,activeTriggerElement:e,closeDelay:d})}),A=S.useRef(null),F=S.useCallback(e=>{A.current=e,v.set("activeTriggerElement",e)},[v]);(0,M.useIsoLayoutEffect)(()=>(P(A.current),()=>P(null)),[P,b,v]),v.useSyncedValue("closeDelay",d);let B=f.parentMenu,j=v.useState("disabled"),H=B.useState("disabled"),U=c||j||H,_=B.useState("itemProps"),K=B.useState("isActive",g.index),z=S.useMemo(()=>({type:"submenu-trigger",setActive(){B.select("highlightItemOnHover")&&B.set("activeIndex",g.index)}}),[B,g.index]),{getItemProps:W,itemRef:J}=(0,eo.useMenuItem)({closeOnClick:!1,disabled:U,highlighted:K,id:b,store:v,typingRef:B.context.typingRef,nativeButton:s,itemMetadata:z,nodeId:m?.context.nodeId}),$=v.useState("hoverEnabled"),q=(0,w.useHoverReferenceInteraction)(x,{enabled:$&&u&&!U,handleClose:(0,C.safePolygon)({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:d},shouldOpen:l>0?()=>B.select("allowMouseEnter"):void 0,triggerElementRef:A,externalTree:y,isClosing:()=>"ending"===v.select("transitionStatus"),guardStaleOpen:!0}),Q=(0,k.useClick)(x,{enabled:!U,event:"mousedown",toggle:!u,ignoreMouse:u,stickIfOpen:!1}).reference??I.EMPTY_OBJECT,Z=v.useState("triggerProps",!0);delete Z.id;let ee=v.useState("openMethod"),ea=v.useState("lastOpenChangeReason")===V.REASONS.listNavigation||"keyboard"===ee,es=R&&ea&&et.platform.screenReader.voiceOver;return(0,L.useRenderElement)("div",e,{state:{disabled:U,highlighted:K,open:R},stateAttributesMapping:D.triggerOpenStateMapping,props:[Q,q,Z,_,es?ei:void 0,{"aria-controls":O,tabIndex:R||K?0:-1,onBlur(){K&&B.set("activeIndex",null)}},p,W],ref:[t,g.ref,J,P,F]})});var es=e.i(536481),eu=e.i(564170);class el extends eu.BasePopupHandle{constructor(){super((0,es.createNullMenuStore)(),"Menu")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}e.s(["Arrow",()=>n.MenuArrow,"Backdrop",()=>o.MenuBackdrop,"CheckboxItem",()=>r.MenuCheckboxItem,"CheckboxItemIndicator",()=>i.MenuCheckboxItemIndicator,"Group",()=>a.MenuGroup,"GroupLabel",()=>s.MenuGroupLabel,"Handle",0,el,"Item",()=>u.MenuItem,"LinkItem",()=>l.MenuLinkItem,"Popup",()=>d.MenuPopup,"Portal",()=>c.MenuPortal,"Positioner",()=>p.MenuPositioner,"RadioGroup",()=>f.MenuRadioGroup,"RadioItem",()=>g.MenuRadioItem,"RadioItemIndicator",()=>m.MenuRadioItemIndicator,"Root",()=>v.MenuRoot,"Separator",()=>ee.Separator,"SubmenuRoot",()=>b.MenuSubmenuRoot,"SubmenuTrigger",0,ea,"Trigger",0,q,"Viewport",0,Z,"createHandle",0,function(){return new el}],160948);var ed=e.i(160948),ed=ed;e.i(593698),e.i(986253);var ec=e.i(647163);e.s(["DropdownMenu",0,function({...e}){return(0,t.jsx)(ed.Root,{"data-slot":"dropdown-menu",...e})},"DropdownMenuContent",0,function({align:e="start",alignOffset:n=0,side:o="bottom",sideOffset:r=4,className:i,...a}){return(0,t.jsx)(ed.Portal,{children:(0,t.jsx)(ed.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:n,side:o,sideOffset:r,children:(0,t.jsx)(ed.Popup,{"data-slot":"dropdown-menu-content",className:(0,ec.cn)("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",i),...a})})})},"DropdownMenuGroup",0,function({...e}){return(0,t.jsx)(ed.Group,{"data-slot":"dropdown-menu-group",...e})},"DropdownMenuItem",0,function({className:e,inset:n,variant:o="default",...r}){return(0,t.jsx)(ed.Item,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":o,className:(0,ec.cn)("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})},"DropdownMenuTrigger",0,function({...e}){return(0,t.jsx)(ed.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}],463415);var ep=e.i(798120),ef=e.i(6799),eg=e.i(95187);let em=(0,eg.createServerReference)("7f969d744615558389e49a38b007fca870d7856f39",eg.callServer,void 0,eg.findSourceMapURL,"markSeenAction");e.s(["markSeenAction",0,em],547242);var ev=e.i(245629),eb=e.i(393080),eh=e.i(283653),eS=e.i(553429);let eR=[],ex=!1,ey=new Set;function eE(e,t){let n=e=>({name:e,icon:t?.find(t=>t.name===e)?.icon??null}),o=n(e.bot),r=[],i=new Map,a=new Map,s=new Map;for(let t of e.lines){let e=t.bot?n(t.bot):o,u=t.to?n(t.to):t.parent?a.get(t.parent)??null:null;switch(t.kind){case"user":r.push({id:t.id,bot:t.to?n(t.to):o,to:t.to?n(t.to):null,text:t.text,kind:"user"});break;case"text":r.push({id:t.id,bot:e,to:u,text:t.text,kind:"say"});break;case"note":r.push({id:t.id,bot:e,to:u,text:t.text,kind:"note"});break;case"stop":r.push({id:t.id,bot:e,to:u,text:t.text,kind:"stop",at:t.at});break;case"tool":i.set(t.callId,r.length),r.push({id:t.id,bot:e,to:u,text:t.note??t.input,kind:"tool",at:t.at,tool:{name:t.name,input:t.input,note:t.note,path:t.path,callId:t.callId}});break;case"tool-result":{let e=i.get(t.callId)??s.get(t.callId),n=void 0===e?void 0:r[e];n?.tool&&void 0!==e?r[e]={...n,tool:{...n.tool,results:t.results,more:t.more}}:n?.kind==="ask"&&void 0!==e&&(r[e]={id:n.id,bot:n.bot,to:null,text:n.text,kind:"tool",tool:{name:t.name,input:n.text,callId:t.callId,results:t.results,more:t.more}});break}case"ask":{s.set(t.callId,r.length);let o=n(t.to);a.set(t.callId,e),r.push({id:t.id,bot:e,to:o,text:t.text,kind:"ask",question:t.question})}}}if(r.forEach((e,t)=>{if("user"!==e.kind)return;let n=r.slice(0,t).findLast(t=>"user"!==t.kind&&t.bot.name===e.bot.name);n?.kind==="tool"&&(r[t]={...e,steppedIn:!0})}),"done"===e.status){let t=r.at(-1);t&&"say"===t.kind&&t.text===e.outcome&&(r[r.length-1]={...t,kind:"result"})}return{id:e.id,room:e.room,request:e.request,label:e.label,bot:o,lines:r,status:"running"===e.status?"working":e.status,outcome:e.outcome,ask:e.ask,seen:e.seen,routineId:e.routineId,tokens:e.tokens,contextTokens:e.contextTokens,contextBudget:e.contextBudget,updatedAt:e.updatedAt}}let eM=new Map,eI=new Map,eC=[],ek=new Set,eO=[],eT=!1,ew=new Set,eP=new Set,eA=!1,eN=new Set,eD=new Set,eL=new Set,eF=[],eB=e=>e.id.slice(0,e.id.lastIndexOf("-")),ej=e=>"user"===e.kind?{name:eS.ROOM_THURSDAY}:e.bot,eH=e=>"user"===e.kind?e.bot:e.to,eU=(e,t)=>({kind:"entry",speaker:e.bot,entry:{kind:"work",key:`${e.lines[0].id}-work`,lines:e.lines,open:t}});e.s(["botThreads",0,{sync(e,t){for(let n of(ex=!0,eR=[...e].reverse().map(e=>eE(e,t)),ey))n()},primed:()=>ex},"heardBy",0,eH,"lastSaid",0,function(e){for(let t=e.lines.length-1;t>=0;t--){let n=e.lines[t];if("user"!==n.kind&&"note"!==n.kind&&"stop"!==n.kind)return n}return null},"latestPerBot",0,function(e){let t=new Map;for(let n of e)for(let e of(t.has(n.bot.name)||t.set(n.bot.name,{bot:n.bot,thread:n,line:null}),n.lines))"user"!==e.kind&&"note"!==e.kind&&"stop"!==e.kind&&t.set(e.bot.name,{bot:e.bot,thread:n,line:e});return[...t.values()]},"ringingThreads",0,{set(e){if(!(e.length===eC.length&&e.every((e,t)=>eC[t]===e)))for(let t of(eC=e,ek))t()}},"roomOpen",0,{set(e){if(e!==eT)for(let t of(eT=e,ew))t()}},"roomOpens",0,{open(e){for(let t of eD)t(e)},subscribe:e=>(eD.add(e),()=>{eD.delete(e)})},"rosterOf",0,function(e){let t=[e.bot];for(let n of e.lines)for(let e of[n.bot,n.to])e&&e.name!==eS.ROOM_THURSDAY&&!t.some(t=>t.name===e.name)&&t.push(e);return t},"screenActs",0,{announce(e){for(let t of eL)t(e)},subscribe:e=>(eL.add(e),()=>{eL.delete(e)})},"threadDrafts",0,{recipient:e=>eI.get(e),select:(e,t)=>{eI.set(e,t)},get:(e,t,n)=>eM.get(e)?.get(JSON.stringify([t,n??null]))??"",set(e,t,n,o){let r=eM.get(e)??new Map,i=JSON.stringify([t,o??null]);n?r.set(i,n):r.delete(i),r.size?eM.set(e,r):eM.delete(e)}},"threadFromRow",0,eE,"threadItems",0,function(e,t,n=[]){let o,r=(o=new Set(e.lines.filter(e=>"tool"===e.kind||"ask"===e.kind).map(eB)),e=>"user"===e.kind||"ask"===e.kind||"result"===e.kind||"say"===e.kind&&!o.has(eB(e))),i=t===e.bot.name?e.lines:e.lines.filter(e=>ej(e).name===t||r(e)&&eH(e)?.name===t),a=new Set([e.bot.name,eS.ROOM_THURSDAY]),s=new Map;for(let t of e.lines){let e=eH(t);e&&!a.has(e.name)&&(a.add(e.name),s.set(t.id,{from:ej(t),to:e})),a.add(t.bot.name)}let u=[],l=new Map,d=e=>{let t=e?l.get(e.name):void 0;t&&(l.delete(t.bot.name),u.push(eU(t,!1)))};for(let e of i){if(!r(e)){let t=l.get(e.bot.name)??{bot:e.bot,lines:[],at:0};t.lines.push(e),t.at=u.length,l.set(e.bot.name,t);continue}let t=ej(e);d(eH(e));let n=s.get(e.id);n&&u.push({kind:"invite",key:`${e.id}-joins`,...n}),d(t),u.push({kind:"entry",speaker:t,entry:{kind:"message",key:e.id,line:e}})}for(let e of[...l.values()].sort((e,t)=>e.at-t.at).reverse())u.splice(e.at,0,eU(e,!0));for(let e of n)l.has(e.name)||u.push({kind:"entry",speaker:e,entry:{kind:"work",key:`${e.name}-now`,lines:[],open:!0}});let c=[];for(let e of u){let t=c.at(-1);"invite"===e.kind?c.push(e):t?.kind==="turn"&&t.speaker.name===e.speaker.name?t.entries.push(e.entry):c.push({kind:"turn",key:e.entry.key,speaker:e.speaker,entries:[e.entry]})}return c},"useBotThreads",0,function(){return(0,S.useSyncExternalStore)(e=>(ey.add(e),()=>ey.delete(e)),()=>eR,()=>eF)},"useRingingThreads",0,function(){return(0,S.useSyncExternalStore)(e=>(ek.add(e),()=>ek.delete(e)),()=>eC,()=>eO)},"useRoomOpen",0,function(){return(0,S.useSyncExternalStore)(e=>(ew.add(e),()=>ew.delete(e)),()=>eT,()=>!1)},"useSeenOnDetail",0,function(e){let t=(0,S.useRef)(new Set),n=e?.id??null,o=e?`${e.id}@${(0,ev.toDate)(e.updatedAt).getTime()}`:null,r=!!e&&"done"===e.status&&!e.seen;(0,S.useEffect)(()=>{!n||!o||!r||t.current.has(o)||(t.current.add(o),em([n]).then(eb.unwrapResult).then(()=>(0,eh.revalidate)(ep.queryKey.threads)).catch(e=>{t.current.delete(o),ef.toast.add({type:"error",title:"Could not mark the thread as read",description:(0,ec.errorToString)(e)})}))},[n,o,r])},"useWriteLineUp",0,function(){return(0,S.useSyncExternalStore)(e=>(eN.add(e),()=>eN.delete(e)),()=>eA,()=>!1)},"writeLine",0,{open(){for(let e of eP)e()},subscribe:e=>(eP.add(e),()=>{eP.delete(e)}),shown(e){if(e!==eA)for(let t of(eA=e,eN))t()}}],978411)},413082,e=>{"use strict";var t=e.i(271645),n=e.i(574735),o=e.i(328744),r=e.i(365420),i=e.i(108868),a=e.i(439957),s=e.i(229315),u=e.i(451321),l=e.i(584446),d=e.i(596296),c=e.i(675606),p=e.i(56434);let f=o.platform.os.mac&&o.platform.engine.webkit;e.s(["useFocus",0,function(e,o={}){let{enabled:g=!0,delay:m}=o,v="rootStore"in e?e.rootStore:e,{events:b,dataRef:h}=v.context,S=t.useRef(!1),R=t.useRef(null),x=t.useRef(!0),y=(0,a.useTimeout)();t.useEffect(()=>{let e=v.select("domReferenceElement");if(!g)return;let t=(0,s.getWindow)(e);return(0,r.mergeCleanups)((0,n.addEventListener)(t,"blur",function(){let e=v.select("domReferenceElement");!v.select("open")&&(0,s.isHTMLElement)(e)&&e===(0,l.activeElement)((0,i.ownerDocument)(e))&&(S.current=!0,R.current=e)}),f&&(0,n.addEventListener)(t,"keydown",function(){x.current=!0},!0),f&&(0,n.addEventListener)(t,"pointerdown",function(){x.current=!1},!0))},[v,g]),t.useEffect(()=>{if(g)return b.on("openchange",e),()=>{b.off("openchange",e)};function e(e){if(e.reason===p.REASONS.triggerPress||e.reason===p.REASONS.escapeKey){let e=v.select("domReferenceElement");(0,s.isElement)(e)&&(R.current=e,S.current=!0)}}},[b,g,v]);let E=t.useMemo(()=>{function e(){S.current=!1,R.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(S.current){if(R.current===n)return;e()}let o=(0,l.getTarget)(t.nativeEvent);if((0,s.isElement)(o)){if(f&&!t.relatedTarget){if(!x.current&&!(0,d.isTypeableElement)(o))return}else if(!(0,d.matchesFocusVisible)(o))return}let r=(0,d.isTargetInsideEnabledTrigger)(t.relatedTarget,v.context.triggerElements),{nativeEvent:i,currentTarget:a}=t,u="function"==typeof m?m():m;v.select("open")&&r||0===u||void 0===u?v.setOpen(!0,(0,c.createChangeEventDetails)(p.REASONS.triggerFocus,i,a)):y.start(u,()=>{S.current||v.setOpen(!0,(0,c.createChangeEventDetails)(p.REASONS.triggerFocus,i,a))})},onBlur(t){e();let n=t.relatedTarget,o=t.nativeEvent,r=(0,s.isElement)(n)&&n.hasAttribute((0,u.createAttribute)("focus-guard"))&&"outside"===n.getAttribute("data-type");y.start(0,()=>{let e=v.select("domReferenceElement"),t=(0,l.activeElement)((0,i.ownerDocument)(e));if(!n&&t===e||(0,l.contains)(h.current.floatingContext?.refs.floating.current,t)||(0,l.contains)(e,t)||r)return;let a=n??t;(0,d.isTargetInsideEnabledTrigger)(a,v.context.triggerElements)||v.setOpen(!1,(0,c.createChangeEventDetails)(p.REASONS.triggerFocus,o))})}}},[h,m,v,y]);return t.useMemo(()=>g?{reference:E,trigger:E}:{},[g,E])}])},261027,803414,978921,382370,389554,866506,685996,371714,181194,801545,91384,858307,764270,219712,82264,862050,282593,105953,507447,536481,874671,63947,277450,e=>{"use strict";e.s([],261027);var t=e.i(271645),n=e.i(733332);let o=t.createContext(void 0);function r(e){let r=t.useContext(o);if(void 0===r&&!e)throw Error((0,n.default)(33));return r}e.s(["MenuPositionerContext",0,o,"useMenuPositionerContext",0,r],803414);let i=t.createContext(void 0);function a(e){let o=t.useContext(i);if(void 0===o&&!e)throw Error((0,n.default)(36));return o}e.s(["MenuRootContext",0,i,"useMenuRootContext",0,a],978921);var s=e.i(552245),u=e.i(879938);let l=t.forwardRef(function(e,t){let{render:n,className:o,style:i,...l}=e,{store:d}=a(),{arrowRef:c,side:p,align:f,arrowUncentered:g,arrowStyles:m}=r(),v=d.useState("open");return(0,s.useRenderElement)("div",e,{ref:[c,t],stateAttributesMapping:u.popupStateMapping,state:{open:v,side:p,align:f,uncentered:g},props:{style:m,"aria-hidden":!0,...l}})});e.s(["MenuArrow",0,l],382370);let d=t.createContext(void 0);function c(e=!0){let o=t.useContext(d);if(void 0===o&&!e)throw Error((0,n.default)(25));return o}var p=e.i(56434);let f=t.forwardRef(function(e,t){let{render:n,className:o,style:r,...i}=e,{store:l}=a(),d=l.useState("open"),f=l.useState("mounted"),g=l.useState("transitionStatus"),m=l.useState("lastOpenChangeReason"),v=c();return(0,s.useRenderElement)("div",e,{ref:v?.backdropRef?[t,v.backdropRef]:t,state:{open:d,transitionStatus:g},stateAttributesMapping:u.popupTransitionStateMapping,props:[{role:"presentation",hidden:!f,style:{pointerEvents:m===p.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},i]})});e.s(["MenuBackdrop",0,f],389554);var g=e.i(951437),m=e.i(956789);let v=t.createContext(void 0);var b=e.i(828918),h=e.i(540886),S=e.i(176782),R=e.i(328744),x=e.i(64350);function y(e){let{closeOnClick:n,highlighted:o,id:r,nodeId:i,store:a,typingRef:s,itemRef:u,itemMetadata:l}=e,{events:d}=a.useState("floatingTreeRoot"),f=a.useState("open"),g=c(!0),m=void 0!==g;return t.useMemo(()=>({id:r,role:"menuitem",tabIndex:f&&o?0:-1,onKeyDown(e){" "===e.key&&s?.current&&e.preventDefault()},onMouseMove(e){i&&d.emit("itemhover",{nodeId:i,target:e.currentTarget})},onClick(e){n&&d.emit("close",{domEvent:e,reason:p.REASONS.itemPress})},onMouseUp(e){if(g){let t=g.initialCursorPointRef.current;if(g.initialCursorPointRef.current=null,m&&t&&1>=Math.abs(e.clientX-t.x)&&1>=Math.abs(e.clientY-t.y)||m&&!R.platform.os.mac&&2===e.button)return}u.current&&a.context.allowMouseUpTriggerRef.current&&(!m||2===e.button)&&"regular-item"===l.type&&(0,x.dispatchClickWithModifiers)(u.current,e,{detail:1})}}),[n,o,r,d,i,f,a,s,u,g,m,l])}let E={type:"regular-item"};function M(e){let{closeOnClick:n,disabled:o,highlighted:r,id:i,store:a,typingRef:s=a.context.typingRef,nativeButton:u,itemMetadata:l,nodeId:d}=e,c=t.useRef(null),{getButtonProps:p,buttonRef:f}=(0,h.useButton)({disabled:o,focusableWhenDisabled:!0,native:u,composite:!0}),g=y({closeOnClick:n,highlighted:r,id:i,nodeId:d,store:a,typingRef:s,itemRef:c,itemMetadata:l}),m=t.useCallback(e=>(0,S.mergeProps)(g,{onMouseEnter(){"submenu-trigger"===l.type&&l.setActive()}},e,p),[g,p,l]),v=(0,b.useMergedRefs)(c,f);return t.useMemo(()=>({getItemProps:m,itemRef:v}),[m,v])}e.s(["REGULAR_ITEM",0,E,"useMenuItem",0,M],866506);var I=e.i(673553),C=e.i(788015);let k={checked:e=>e?{"data-checked":""}:{"data-unchecked":""},...e.i(474354).transitionStatusMapping};var O=e.i(675606),T=e.i(843476);let w=t.forwardRef(function(e,n){let{render:o,className:i,id:u,label:l,nativeButton:d=!1,disabled:c=!1,closeOnClick:f=!1,checked:b,defaultChecked:h,onCheckedChange:S,style:R,...x}=e,y=(0,I.useCompositeListItem)({guess:!0,label:l}),w=r(!0),P=(0,C.useBaseUiId)(u),{store:A}=a(),N=A.useState("disabled"),D=c||N,L=A.useState("isActive",y.index),F=A.useState("itemProps"),[B,j]=(0,g.useControlled)({controlled:b,default:h??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:H,itemRef:U}=M({closeOnClick:f,disabled:D,highlighted:L,id:P,store:A,nativeButton:d,nodeId:w?.context.nodeId,itemMetadata:E}),_=t.useMemo(()=>({disabled:D,highlighted:L,checked:B}),[D,L,B]),G=(0,s.useRenderElement)("div",e,{state:_,stateAttributesMapping:k,props:[F,{role:"menuitemcheckbox","aria-checked":B,onClick:function(e){let t=(0,O.createChangeEventDetails)(p.REASONS.itemPress,e.nativeEvent,void 0,{preventUnmountOnClose:m.NOOP});S?.(!B,t),t.isCanceled||j(e=>!e)}},x,H],ref:[U,n,y.ref]});return(0,T.jsx)(v.Provider,{value:_,children:G})});e.s(["MenuCheckboxItem",0,w],685996);var P=e.i(223910),A=e.i(137584);let N=t.forwardRef(function(e,o){let{render:r,className:i,style:a,keepMounted:u=!1,...l}=e,d=function(){let e=t.useContext(v);if(void 0===e)throw Error((0,n.default)(30));return e}(),c=t.useRef(null),{transitionStatus:p,mounted:f,setMounted:g}=(0,P.useTransitionStatus)(d.checked);(0,A.useOpenChangeComplete)({batch:!0,enabled:!d.checked,open:d.checked,ref:c,onComplete(){d.checked||g(!1)}});let m={checked:d.checked,disabled:d.disabled,highlighted:d.highlighted,transitionStatus:p};return(0,s.useRenderElement)("span",e,{state:m,ref:[o,c],stateAttributesMapping:k,props:{"aria-hidden":!0,...l},enabled:u||f})});e.s(["MenuCheckboxItemIndicator",0,N],371714);let D=t.createContext(void 0),L=t.forwardRef(function(e,n){let{render:o,className:r,style:i,...a}=e,[u,l]=t.useState(void 0),d=(0,s.useRenderElement)("div",e,{ref:n,props:{role:"group","aria-labelledby":u,...a}});return(0,T.jsx)(D.Provider,{value:l,children:d})});e.s(["MenuGroup",0,L],181194);var F=e.i(146376);let B=t.forwardRef(function(e,o){let{render:r,className:i,style:a,id:u,...l}=e,d=(0,C.useBaseUiId)(u),c=function(){let e=t.useContext(D);if(void 0===e)throw Error((0,n.default)(31));return e}();return(0,F.useIsoLayoutEffect)(()=>(c(d),()=>{c(e=>e===d?void 0:e)}),[c,d]),(0,s.useRenderElement)("div",e,{ref:o,props:{id:d,"aria-hidden":!0,...l}})});e.s(["MenuGroupLabel",0,B],801545);let j=t.forwardRef(function(e,t){let{render:n,className:o,id:i,label:u,nativeButton:l=!1,disabled:d=!1,closeOnClick:c=!0,style:p,...f}=e,g=(0,I.useCompositeListItem)({guess:!0,label:u}),m=r(!0),v=(0,C.useBaseUiId)(i),{store:b}=a(),h=b.useState("disabled"),S=d||h,R=b.useState("isActive",g.index),x=b.useState("itemProps"),{getItemProps:y,itemRef:k}=M({closeOnClick:c,disabled:S,highlighted:R,id:v,store:b,nativeButton:l,nodeId:m?.context.nodeId,itemMetadata:E});return(0,s.useRenderElement)("div",e,{state:{disabled:S,highlighted:R},props:[x,f,y],ref:[k,t,g.ref]})});e.s(["MenuItem",0,j],91384);let H=t.forwardRef(function(e,n){let{render:o,className:i,id:u,label:l,closeOnClick:d=!1,style:c,...p}=e,f=t.useRef(null),g=(0,I.useCompositeListItem)({guess:!0,label:l}),m=r(!0),v=m?.context.nodeId,b=(0,C.useBaseUiId)(u),{store:R}=a(),x=R.useState("isActive",g.index),M=R.useState("itemProps"),k=R.context.typingRef,{getButtonProps:O,buttonRef:T}=(0,h.useButton)({native:!1,composite:!0}),w=y({closeOnClick:d,highlighted:x,id:b,nodeId:v,store:R,typingRef:k,itemRef:f,itemMetadata:E});return(0,s.useRenderElement)("a",e,{state:{highlighted:x},props:[M,p,function(e){return(0,S.mergeProps)(w,e,O)}],ref:[f,T,n,g.ref]})});e.s(["MenuLinkItem",0,H],858307);var U=e.i(61487),_=e.i(431157),G=e.i(96533),K=e.i(673327),Y=e.i(253984);let V=t.forwardRef(function(e,n){let{render:o,className:i,style:l,finalFocus:d,...c}=e,{store:f}=a(),{side:g,align:m}=r(),v=null!=(0,G.useToolbarRootContext)(!0),b=f.useState("open"),h=f.useState("transitionStatus"),S=f.useState("popupProps"),R=f.useState("mounted"),x=f.useState("instantType"),y=f.useState("activeTriggerElement"),E=f.useState("parent"),M=f.useState("lastOpenChangeReason"),I=f.useState("rootId"),C=f.useState("floatingRootContext"),k=f.useState("floatingTreeRoot"),w=f.useState("closeDelay"),P=f.useState("hoverEnabled"),N=f.useState("disabled"),D=f.useState("openMethod"),L="context-menu"===E.type;(0,A.useOpenChangeComplete)({open:b,ref:f.context.popupRef,onComplete(){b&&f.context.onOpenChangeComplete?.(!0)}}),t.useEffect(()=>{function e(e){f.setOpen(!1,(0,O.createChangeEventDetails)(e.reason,e.domEvent))}return k.events.on("close",e),()=>{k.events.off("close",e)}},[k.events,f]),(0,_.useHoverFloatingInteraction)(C,{enabled:P&&!N&&!L&&"menubar"!==E.type,closeDelay:w});let F=f.useStateSetter("popupElement"),B={transitionStatus:h,side:g,align:m,open:b,nested:"menu"===E.type,instant:x},j=(0,s.useRenderElement)("div",e,{state:B,ref:[n,f.context.popupRef,F],stateAttributesMapping:u.popupTransitionStateMapping,props:[S,{onKeyDown(e){v&&K.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()}},(0,Y.getDisabledMountTransitionStyles)(h),c,{"data-rootownerid":I}]}),H=void 0===E.type||L;return(y||"menubar"===E.type&&M!==p.REASONS.outsidePress)&&(H=!0),(0,T.jsx)(U.FloatingFocusManager,{context:C,openInteractionType:D,modal:L,disabled:!R,returnFocus:void 0===d?H:d,initialFocus:"menu"!==E.type,restoreFocus:!0,externalTree:"menubar"!==E.type?k:void 0,previousFocusableElement:y,nextFocusableElement:void 0===E.type?f.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:void 0===E.type?f.context.beforeContentFocusGuardRef:void 0,children:j})});e.s(["MenuPopup",0,V],764270);var z=e.i(726674);let W=t.createContext(void 0),J=t.forwardRef(function(e,t){let{keepMounted:n=!1,...o}=e,{store:r,parent:i}=a();if(!(r.useState("mounted")||n))return null;let s="menu"===i.type||"menubar"===i.type?"group":void 0;return(0,T.jsx)(W.Provider,{value:n,children:(0,T.jsx)(z.FloatingPortal,{ref:t,...o,portalOwnerRole:s})})});e.s(["MenuPortal",0,J],219712);var $=e.i(144394),q=e.i(439957),X=e.i(46420),Q=e.i(923706),Z=e.i(53687),ee=e.i(426),et=e.i(638396),en=e.i(222640),eo=e.i(789579),er=e.i(33383);let ei=t.forwardRef(function(e,r){let{anchor:i,positionMethod:s="absolute",className:u,render:l,side:d,align:f,sideOffset:g=0,alignOffset:m=0,collisionBoundary:v="clipping-ancestors",collisionPadding:b=5,arrowPadding:h=5,sticky:S=!1,disableAnchorTracking:R=!1,collisionAvoidance:x=et.DROPDOWN_COLLISION_AVOIDANCE,style:y,...E}=e,{store:M}=a(),I=function(){let e=t.useContext(W);if(void 0===e)throw Error((0,n.default)(32));return e}(),C=c(!0),k=M.useState("parent"),w=M.useState("floatingRootContext"),P=M.useState("floatingTreeRoot"),A=M.useState("mounted"),N=M.useState("open"),D=M.useState("modal"),L=M.useState("openMethod"),B=M.useState("activeTriggerElement"),j=M.useState("transitionStatus"),H=M.useState("positionerElement"),U=M.useState("instantType"),_=M.useState("adaptiveOrigin"),G=M.useState("lastOpenChangeReason"),K=M.useState("floatingNodeId"),Y=M.useState("floatingParentNodeId"),V=w.useState("domReferenceElement"),z=t.useRef(null),J=(0,en.useAnimationsFinished)(H),ei=i,ea=g,es=m,eu=f,el=x;"context-menu"===k.type&&(ei=i??k.context?.anchor,eu=eu??"start",d||"center"===eu||(es=e.alignOffset??2,ea=e.sideOffset??-5));let ed=d,ec=eu;"menu"===k.type?(ed=ed??"inline-end",ec=ec??"start",el=e.collisionAvoidance??et.POPUP_COLLISION_AVOIDANCE):"menubar"===k.type&&(ed=ed??("vertical"===k.context.orientation?"inline-end":"bottom"),ec=ec??"start");let ep="context-menu"===k.type,ef=(0,Q.useAnchorPositioning)({anchor:ei,floatingRootContext:w,positionMethod:C?"fixed":s,mounted:A,side:ed,sideOffset:ea,align:ec,alignOffset:es,arrowPadding:ep?0:h,collisionBoundary:v,collisionPadding:b,sticky:S,nodeId:K,keepMounted:I,disableAnchorTracking:R,collisionAvoidance:el,shift:ep?{crossAxis:!("side"in el&&"flip"===el.side),rootBoundary:"layoutViewport"}:void 0,externalTree:P,adaptiveOrigin:_});t.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===K&&M.set("hoverEnabled",!1),e.nodeId!==K&&e.parentNodeId===M.select("floatingParentNodeId")&&M.setOpen(!1,(0,O.createChangeEventDetails)(p.REASONS.siblingOpen)))}return P.events.on("menuopenchange",e),()=>{P.events.off("menuopenchange",e)}},[M,P.events,K]),t.useEffect(()=>{if(null!=M.select("floatingParentNodeId"))return P.events.on("menuopenchange",e),()=>{P.events.off("menuopenchange",e)};function e(e){if(e.open||e.nodeId!==M.select("floatingParentNodeId"))return;let t=e.reason??p.REASONS.siblingOpen;M.setOpen(!1,(0,O.createChangeEventDetails)(t))}},[P.events,M]);let eg=(0,q.useTimeout)();t.useEffect(()=>{N||eg.clear()},[N,eg]),t.useEffect(()=>{function e(e){if(N&&e.nodeId===M.select("floatingParentNodeId"))if(e.target&&B&&B!==e.target){let e=M.select("closeDelay");e>0?eg.isStarted()||eg.start(e,()=>{M.setOpen(!1,(0,O.createChangeEventDetails)(p.REASONS.siblingOpen))}):M.setOpen(!1,(0,O.createChangeEventDetails)(p.REASONS.siblingOpen))}else eg.clear()}return P.events.on("itemhover",e),()=>{P.events.off("itemhover",e)}},[P.events,N,B,M,eg]),t.useEffect(()=>{let e={open:N,nodeId:K,parentNodeId:Y,reason:M.select("lastOpenChangeReason")};P.events.emit("menuopenchange",e)},[P.events,N,M,K,Y]),(0,F.useIsoLayoutEffect)(()=>{let e=z.current;if(V&&(z.current=V),e&&V&&V!==e){M.set("instantType",void 0);let e=new AbortController;return J(()=>{M.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[V,J,M]);let em={open:N,side:ef.side,align:ef.align,anchorHidden:ef.anchorHidden,nested:"menu"===k.type,instant:U},ev="menubar"===k.type&&k.context.modal,eb=D&&G!==p.REASONS.triggerHover;(0,er.useAnchoredPopupScrollLock)(N&&(ev||eb),"touch"===L,H,B);let eh=(0,eo.usePositioner)(e,em,{styles:ef.positionerStyles,transitionStatus:j,props:E,refs:[r,M.useStateSetter("positionerElement")],hidden:!A,inert:!N}),eS=A&&"menu"!==k.type&&("menubar"!==k.type&&D&&G!==p.REASONS.triggerHover||"menubar"===k.type&&k.context.modal),eR=null;return"menubar"===k.type?eR=k.context.contentElement:void 0===k.type&&(eR=B),(0,T.jsxs)(o.Provider,{value:ef,children:[eS&&(0,T.jsx)(ee.InternalBackdrop,{ref:"context-menu"===k.type||"nested-context-menu"===k.type?k.context.internalBackdropRef:null,inert:(0,$.inertValue)(!N),cutout:eR}),(0,T.jsx)(X.FloatingNode,{id:K,children:(0,T.jsx)(Z.CompositeList,{elementsRef:M.context.itemDomElements,labelsRef:M.context.itemLabels,children:eh})})]})});e.s(["MenuPositioner",0,ei],82264);var ea=e.i(667865);let es=t.createContext(void 0),eu=t.memo(t.forwardRef(function(e,n){let{render:o,className:r,value:i,defaultValue:a,onValueChange:u,disabled:l=!1,style:d,"aria-labelledby":c,...p}=e,[f,m]=t.useState(void 0),[v,b]=(0,g.useControlled)({controlled:i,default:a,name:"MenuRadioGroup"}),h=(0,ea.useStableCallback)((e,t)=>{u?.(e,t),t.isCanceled||b(e)}),S=(0,s.useRenderElement)("div",e,{state:{disabled:l},ref:n,props:{role:"group","aria-labelledby":c??f,"aria-disabled":l||void 0,...p}}),R=t.useMemo(()=>({value:v,setValue:h,disabled:l}),[v,h,l]);return(0,T.jsx)(D.Provider,{value:m,children:(0,T.jsx)(es.Provider,{value:R,children:S})})}));e.s(["MenuRadioGroup",0,eu],862050);let el=t.createContext(void 0),ed=t.forwardRef(function(e,o){let{render:i,className:u,id:l,label:d,nativeButton:c=!1,disabled:f=!1,closeOnClick:g=!1,value:v,style:b,...h}=e,S=(0,I.useCompositeListItem)({guess:!0,label:d}),R=r(!0),x=(0,C.useBaseUiId)(l),{store:y}=a(),w=y.useState("isActive",S.index),P=y.useState("itemProps"),{value:A,setValue:N,disabled:D}=function(){let e=t.useContext(es);if(void 0===e)throw Error((0,n.default)(34));return e}(),L=y.useState("disabled"),F=f||D||L,B=A===v,{getItemProps:j,itemRef:H}=M({closeOnClick:g,disabled:F,highlighted:w,id:x,store:y,nativeButton:c,nodeId:R?.context.nodeId,itemMetadata:E}),U=t.useMemo(()=>({disabled:F,highlighted:w,checked:B}),[F,w,B]),_=(0,s.useRenderElement)("div",e,{state:U,stateAttributesMapping:k,props:[P,{role:"menuitemradio","aria-checked":B,onClick:function(e){N(v,(0,O.createChangeEventDetails)(p.REASONS.itemPress,e.nativeEvent,void 0,{preventUnmountOnClose:m.NOOP}))}},h,j],ref:[H,o,S.ref]});return(0,T.jsx)(el.Provider,{value:U,children:_})});e.s(["MenuRadioItem",0,ed],282593);let ec=t.forwardRef(function(e,o){let{render:r,className:i,style:a,keepMounted:u=!1,...l}=e,d=function(){let e=t.useContext(el);if(void 0===e)throw Error((0,n.default)(35));return e}(),c=t.useRef(null),{transitionStatus:p,mounted:f,setMounted:g}=(0,P.useTransitionStatus)(d.checked);(0,A.useOpenChangeComplete)({batch:!0,enabled:!d.checked,open:d.checked,ref:c,onComplete(){d.checked||g(!1)}});let m={checked:d.checked,disabled:d.disabled,highlighted:d.highlighted,transitionStatus:p};return(0,s.useRenderElement)("span",e,{state:m,stateAttributesMapping:k,ref:[o,c],props:{"aria-hidden":!0,...l},enabled:u||f})});e.s(["MenuRadioItemIndicator",0,ec],105953);var ep=e.i(883977),ef=e.i(388940),eg=e.i(896499),em=e.i(17989),ev=e.i(260891),eb=e.i(736760),eh=e.i(350527);let eS=t.createContext(null);function eR(e){let o=t.useContext(eS);if(null===o&&!e)throw Error((0,n.default)(5));return o}e.s(["useMenubarContext",0,eR],507447);var ex=e.i(872855),ey=e.i(32199),eE=e.i(301252),eM=e.i(379248),eI=e.i(18478),eC=e.i(116786),ek=e.i(990627);let eO={...eC.popupStoreSelectors,disabled:e=>"menubar"===e.parent.type&&e.parent.context.disabled||e.disabled,modal:e=>(void 0===e.parent.type||"context-menu"===e.parent.type)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>"menu"===e.parent.type?e.parent.store.select("rootId"):void 0!==e.parent.type?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>"menu"===e.parent.type?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>e.keyboardEventRelay?e.keyboardEventRelay:"menu"===e.parent.type?e.parent.store.select("keyboardEventRelay"):void 0};class eT extends eE.ReactStore{constructor(e,t,n=!1){const o=new ek.PopupTriggerMap;super(eP(o,t,n,e),ew(o),eO),this.unsubscribeParentListener=this.observe("parent",e=>{if(this.unsubscribeParentListener?.(),"menu"===e.type){let t=e.store.select("rootId"),n=e.store.select("floatingTreeRoot"),o=e.store.select("keyboardEventRelay");this.unsubscribeParentListener=e.store.subscribe(()=>{let r=e.store.select("rootId"),i=e.store.select("floatingTreeRoot"),a=e.store.select("keyboardEventRelay");(t!==r||n!==i||o!==a)&&(t=r,n=i,o=a,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}void 0!==e.type&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}unsubscribeParentListener=null}function ew(e){return{positionerRef:t.createRef(),popupRef:t.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:t.createRef(),beforeContentFocusGuardRef:t.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function eP(e,t,n=!1,o){return{...(0,eC.createInitialPopupStoreState)(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new eM.FloatingTreeStore,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:m.EMPTY_OBJECT,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...o}}e.s(["MenuStore",0,eT,"createNullMenuStore",0,function(){let e=new ek.PopupTriggerMap;return Object.assign(new eI.NullStore(Object.freeze(eP(e)),Object.freeze(ew(e)),eO),{setOpen:m.NOOP})}],536481);var eA=e.i(264111);let eN=t.createContext(void 0);function eD(){return t.useContext(eN)}e.s(["MenuSubmenuRootContext",0,eN,"useMenuSubmenuRootContext",0,eD],874671);let eL=(0,eg.fastComponent)(function(e){var n,o,r;let s,{children:u,open:l,onOpenChange:d,onOpenChangeComplete:f,defaultOpen:g=!1,disabled:v=!1,modal:b,loopFocus:h=!0,orientation:R="vertical",actionsRef:x,closeParentOnEsc:y=!1,handle:E,triggerId:M,defaultTriggerId:I=null,highlightItemOnHover:C=!0}=e,k=c(!0),w=a(!0),P=eR(!0),A=eD(),N=t.useMemo(()=>A&&w?{type:"menu",store:w.store}:P?{type:"menubar",context:P}:k&&!w?{type:"context-menu",context:k}:{type:void 0},[k,w,P,A]),D=(0,ep.useId)(),L=(0,ep.useId)(),B=(0,X.useFloatingParentNodeId)(),j="menu"===N.type?N.store:void 0,H=(l??g)&&j?.state.transitionStatus==="starting",U=(0,ef.useRefWithInit)(()=>H?j?.state.instantType:void 0).current,_=(n={open:g,openProp:l,activeTriggerId:I,triggerIdProp:M,parent:N,disabled:v,highlightItemOnHover:C,modal:void 0===N.type?b:void 0,rootId:D,instantType:U},o=L,r=null!=B,(0,ef.useRefWithInit)(()=>new eT(n,o,r)).current);_.useControlledProp("openProp",l),_.useControlledProp("triggerIdProp",M),_.useContextCallback("onOpenChangeComplete",f);let G=_.useState("floatingTreeRoot"),K=(0,X.useFloatingNodeId)(G),Y=_.useState("open"),V=_.useState("activeTriggerElement"),z=_.useState("positionerElement"),W=_.useState("hoverEnabled"),J=_.useState("disabled"),$=_.useState("lastOpenChangeReason"),Q=_.useState("parent"),Z=_.useState("activeIndex"),ee=_.useState("payload"),eo=_.useState("floatingParentNodeId"),er=t.useRef(null),ei=t.useRef("context-menu"!==Q.type),es=(0,q.useTimeout)(),eu=t.useRef(!0),el=(0,q.useTimeout)(),ed=null!=eo,{openMethod:ec,triggerProps:eg}=(0,ey.useOpenInteractionType)(Y);_.useSyncedValues({disabled:v,highlightItemOnHover:C,modal:void 0===Q.type?b:void 0,openMethod:ec,rootId:D}),(0,eA.useImplicitActiveTrigger)(_);let{forceUnmount:eS,transitionStatus:eE}=(0,eA.useOpenStateTransitions)(Y,_,()=>{_.set("allowMouseEnter",!1)},H),eM=(0,en.useAnimationsFinished)(_.context.popupRef);t.useEffect(()=>{if(void 0===U)return;let e=()=>{_.state.instantType===U&&_.set("instantType",void 0)};if(!Y)return void e();if(void 0!==eE)return;if(null==_.context.popupRef.current)return void e();let t=new AbortController;return eM(e,t.signal),()=>{t.abort()}},[U,Y,eE,eM,_]),(0,F.useIsoLayoutEffect)(()=>{k&&!w?_.update({parent:{type:"context-menu",context:k},floatingNodeId:K,floatingParentNodeId:B}):w&&_.update({floatingNodeId:K,floatingParentNodeId:B})},[k,w,K,B,_]),t.useEffect(()=>{if(Y||(er.current=null),"context-menu"===Q.type){if(!Y){es.clear(),ei.current=!1;return}es.start(500,()=>{ei.current=!0})}},[es,Y,Q.type]),(0,F.useIsoLayoutEffect)(()=>{Y||W||_.set("hoverEnabled",!0)},[Y,W,_]);let eI=(0,ea.useStableCallback)((e,t)=>{let n=t.reason;if(!e&&!_.select("open")||Y===e&&t.trigger===V&&$===n)return;let o=(0,eA.attachPreventUnmountOnClose)(t);if(e||null!=t.trigger||(t.trigger=V??void 0),d?.(e,t),t.isCanceled)return;_.state.floatingRootContext.dispatchOpenChange(e,t);let r=t.event;if(!1===e&&r?.type==="click"&&"touch"===r.pointerType&&!eu.current)return;e&&n===p.REASONS.triggerFocus?(eu.current=!1,el.start(300,()=>{eu.current=!0})):(eu.current=!0,el.clear());let i=(n===p.REASONS.triggerPress||n===p.REASONS.itemPress)&&0===r.detail,a=!e&&(n===p.REASONS.escapeKey||null==n);er.current=t.event;let s=(0,eA.createPopupOpenState)(_.state,e,t.trigger,o());s.openChangeReason=n,"menubar"===Q.type&&(n===p.REASONS.triggerFocus||n===p.REASONS.focusOut||n===p.REASONS.triggerHover||n===p.REASONS.listNavigation||n===p.REASONS.siblingOpen)?s.instantType="group":i||a?s.instantType=i?"click":"dismiss":s.instantType=void 0,_.update(s)}),eC=(0,eh.useSyncedFloatingRootContext)({popupStore:_,floatingRootContext:_.state.floatingRootContext,floatingId:L,nested:null!=B,onOpenChange:eI}),ek=eC.context.events;(0,F.useIsoLayoutEffect)(()=>{let e=({open:e,eventDetails:t})=>eI(e,t);return ek.on("setOpen",e),()=>{ek?.off("setOpen",e)}},[ek,eI]);let eO=t.useCallback(()=>{_.setOpen(!1,(0,O.createChangeEventDetails)(p.REASONS.imperativeAction))},[_]);t.useImperativeHandle(x,()=>({unmount:eS,close:eO}),[eS,eO]),"context-menu"===Q.type&&(s=Q.context),t.useImperativeHandle(s?.positionerRef,()=>z,[z]),t.useImperativeHandle(s?.actionsRef,()=>({setOpen:eI}),[eI]);let ew=(0,em.useDismiss)(eC,{enabled:!J,bubbles:{escapeKey:y&&"menu"===Q.type},outsidePress:()=>"context-menu"!==Q.type||er.current?.type==="contextmenu"||ei.current,externalTree:ed?G:void 0}),eP=(0,ex.useDirection)(),eN=t.useCallback(e=>{_.select("activeIndex")!==e&&_.set("activeIndex",e)},[_]),eL=(0,ev.useListNavigation)(eC,{enabled:!J,listRef:_.context.itemDomElements,activeIndex:Z,nested:void 0!==Q.type,loopFocus:h,orientation:R,parentOrientation:"menubar"===Q.type?Q.context.orientation:void 0,rtl:"rtl"===eP,disabledIndices:m.EMPTY_ARRAY,onNavigate:eN,openOnArrowKeyDown:"context-menu"!==Q.type,externalTree:ed?G:void 0,focusItemOnHover:C}),eF=t.useCallback(e=>{_.context.typingRef.current=e},[_]),eB=(0,eb.useTypeahead)(eC,{enabled:!J,listRef:_.context.itemLabels,elementsRef:_.context.itemDomElements,activeIndex:Z,resetMs:et.TYPEAHEAD_RESET_MS,onMatch:e=>{Y&&e!==Z&&_.set("activeIndex",e)},onTyping:eF}),ej=t.useMemo(()=>{let e=(0,S.mergeProps)(eB.reference,eL.reference,ew.reference,{onMouseMove(){_.set("allowMouseEnter",!0)}},eg);return e["aria-haspopup"]="menu",e["aria-expanded"]=Y,e},[_,eB.reference,eL.reference,ew.reference,eg,Y]),eH=t.useMemo(()=>{let e=(0,S.mergeProps)(eL.trigger,ew.trigger,eg);return e["aria-haspopup"]="menu",e["aria-expanded"]=!1,e},[eL.trigger,ew.trigger,eg]);(0,ef.useRefWithInit)(()=>(_.update({inactiveTriggerProps:eH}),null));let eU=t.useMemo(()=>(0,S.mergeProps)(eA.FOCUSABLE_POPUP_PROPS,{id:L,role:"menu","aria-orientation":"horizontal"===R?"horizontal":void 0,"aria-labelledby":V?.id,onMouseMove(){_.set("allowMouseEnter",!0),"menu"===Q.type&&_.set("hoverEnabled",!1)},onClick(){_.select("hoverEnabled")&&_.set("hoverEnabled",!1)},onKeyDown(e){let t=_.select("keyboardEventRelay");t&&!e.isPropagationStopped()&&t(e)}},eB.floating,eL.floating,ew.floating),[V,L,R,Q.type,_,eB.floating,eL.floating,ew.floating]),e_=eL.item??m.EMPTY_OBJECT;(0,eA.usePopupInteractionProps)(_,{floatingRootContext:eC,activeTriggerProps:ej,inactiveTriggerProps:eH,popupProps:eU,itemProps:e_});let eG=t.useMemo(()=>({store:_,parent:N}),[_,N]),eK=(0,T.jsxs)(i.Provider,{value:eG,children:[E&&(0,T.jsx)(eA.PopupHandleAttachment,{handle:E,store:_}),"function"==typeof u?u({payload:ee}):u]});return void 0===Q.type||"context-menu"===Q.type?(0,T.jsx)(X.FloatingTree,{externalTree:G,children:eK}):eK});e.s(["MenuRoot",0,eL],63947),e.s(["MenuSubmenuRoot",0,function(e){let n=a().store,o=t.useMemo(()=>({parentMenu:n}),[n]);return(0,T.jsx)(eN.Provider,{value:o,children:(0,T.jsx)(eL,{...e})})}],277450)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,463415,770625,978411,e=>{"use strict";var t=e.i(843476);e.i(261027);var n=e.i(382370),o=e.i(389554),r=e.i(685996),i=e.i(371714),a=e.i(181194),s=e.i(801545),u=e.i(91384),l=e.i(858307),d=e.i(764270),c=e.i(219712),p=e.i(82264),f=e.i(862050),g=e.i(282593),m=e.i(105953),v=e.i(63947),b=e.i(277450),h=e.i(733332),S=e.i(271645),R=e.i(439957),x=e.i(108868),y=e.i(896499),E=e.i(667865),M=e.i(146376),I=e.i(956789),C=e.i(650316),k=e.i(385689),O=e.i(46420),T=e.i(413082),w=e.i(872135),P=e.i(379248),A=e.i(584446),N=e.i(978921),D=e.i(879938),L=e.i(552245),F=e.i(540886),B=e.i(264042),j=e.i(348990),H=e.i(838452),U=e.i(229315),_=e.i(459636),G=e.i(264111),K=e.i(346570),Y=e.i(788015),V=e.i(56434),z=e.i(507447),W=e.i(638396),J=e.i(152535),$=e.i(176782);let q=(0,y.fastComponentRef)(function(e,n){let o,{render:r,className:i,style:a,disabled:s=!1,nativeButton:u=!0,id:l,openOnHover:d,delay:c=100,closeDelay:p=0,handle:f,payload:g,...m}=e,v=(0,N.useMenuRootContext)(!0),b=(0,_.usePopupHandleStore)(f)??v?.store;if(!b)throw Error((0,h.default)(85));let y=(0,Y.useBaseUiId)(l),q=b.useState("isTriggerActive",y),X=b.useState("floatingRootContext"),Q=b.useState("isOpenedByTrigger",y),Z=b.useState("triggerPopupId",y),ee=S.useRef(null),et=(o=(0,z.useMenubarContext)(!0),S.useMemo(()=>o?{type:"menubar",context:o}:{type:void 0},[o])),en=(0,H.useCompositeRootContext)(!0),eo=(0,O.useFloatingTree)(),er=S.useMemo(()=>eo??new P.FloatingTreeStore,[eo]),ei=(0,O.useFloatingNodeId)(er),ea=(0,O.useFloatingParentNodeId)(),{registerTrigger:es,isMountedByThisTrigger:eu}=(0,G.useTriggerDataForwarding)(y,ee,b,{payload:g,closeDelay:p,parent:et,floatingTreeRoot:er,floatingNodeId:ei,floatingParentNodeId:ea,keyboardEventRelay:en?.relayKeyboardEvent}),el="menubar"===et.type,ed=b.useState("disabled"),ec=s||ed||el&&et.context.disabled,{getButtonProps:ep,buttonRef:ef}=(0,F.useButton)({disabled:ec,native:u});S.useEffect(()=>{Q||void 0!==et.type||(b.context.allowMouseUpTriggerRef.current=!1)},[b,Q,et.type]);let eg=S.useRef(null),em=(0,R.useTimeout)(),ev=(0,E.useStableCallback)(e=>{if(!eg.current)return;em.clear(),b.context.allowMouseUpTriggerRef.current=!1;let t=e.target;(0,A.contains)(eg.current,t)||(0,A.contains)(b.select("positionerElement"),t)||t===eg.current||null!=t&&function e(t){return(0,U.isHTMLElement)(t)&&t.hasAttribute("data-rootownerid")?t.getAttribute("data-rootownerid"):(0,U.isLastTraversableNode)(t)?void 0:e((0,U.getParentNode)(t))}(t)===b.select("rootId")||(0,B.isMouseWithinBounds)(e,eg.current)||er.events.emit("close",{domEvent:e,reason:V.REASONS.cancelOpen})});S.useEffect(()=>{Q&&b.select("lastOpenChangeReason")===V.REASONS.triggerHover&&(0,x.ownerDocument)(eg.current).addEventListener("mouseup",ev,{once:!0})},[Q,ev,b]);let eb=el&&et.context.hasSubmenuOpen,eh=d??eb,eS=(0,w.useHoverReferenceInteraction)(X,{enabled:eh&&!ec&&(!el||eb&&!eu),handleClose:(0,C.safePolygon)({blockPointerEvents:!el}),mouseOnly:!0,move:!1,restMs:void 0===et.type?c:void 0,delay:{close:p},triggerElementRef:ee,externalTree:er,isActiveTrigger:q,isClosing:()=>"ending"===b.select("transitionStatus")}),eR=function(e,t){let n=(0,R.useTimeout)(),[o,r]=S.useState(!1);return(0,M.useIsoLayoutEffect)(()=>{e&&t===V.REASONS.triggerHover?(r(!0),n.start(W.PATIENT_CLICK_THRESHOLD,()=>{r(!1)})):e||(n.clear(),r(!1))},[e,t,n]),o}(Q,b.select("lastOpenChangeReason")),ex=(0,k.useClick)(X,{enabled:!ec,event:Q&&el?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:void 0===et.type&&eR}),ey=(0,T.useFocus)(X,{enabled:!ec&&eb}),eE=function(e){let{enabled:t=!0,mouseDownAction:n,open:o}=e,r=S.useRef(!1);return S.useMemo(()=>t?{onMouseDown:e=>{("open"===n&&!o||"close"===n&&o)&&(r.current=!0,(0,x.ownerDocument)(e.currentTarget).addEventListener("click",()=>{r.current=!1},{once:!0}))},onClick:e=>{r.current&&(r.current=!1,e.preventBaseUIHandler())}}:I.EMPTY_OBJECT,[t,n,o])}({open:Q,enabled:el,mouseDownAction:"open"}),eM=S.useMemo(()=>(0,$.mergeProps)(ey.reference,ex.reference),[ey.reference,ex.reference]),eI=b.useState("triggerProps",eu),{preFocusGuardRef:eC,handlePreFocusGuardFocus:ek,handleFocusTargetFocus:eO}=(0,K.useTriggerFocusGuards)(b,ee),eT={disabled:ec,open:Q},ew=[eg,n,ef,es,ee],eP=[eM,eS??I.EMPTY_OBJECT,eI,{"aria-haspopup":"menu","aria-controls":Z,id:y,onMouseDown:e=>{b.select("open")||(em.start(200,()=>{b.context.allowMouseUpTriggerRef.current=!0}),(0,x.ownerDocument)(e.currentTarget).addEventListener("mouseup",ev,{once:!0}))}},el?{role:"menuitem"}:{},eE,m,ep],eA=(0,L.useRenderElement)("button",e,{enabled:!el,stateAttributesMapping:D.pressableTriggerOpenStateMapping,state:eT,ref:ew,props:eP});return el?(0,t.jsx)(j.CompositeItem,{tag:"button",render:r,className:i,style:a,state:eT,refs:ew,props:eP,stateAttributesMapping:D.pressableTriggerOpenStateMapping}):Q?(0,t.jsxs)(S.Fragment,{children:[(0,t.jsx)(J.FocusGuard,{ref:eC,onFocus:ek},`${y}-pre-focus-guard`),(0,t.jsx)(S.Fragment,{children:eA},y),(0,t.jsx)(J.FocusGuard,{ref:b.context.triggerFocusTargetRef,onFocus:eO},`${y}-post-focus-guard`)]}):(0,t.jsx)(S.Fragment,{children:eA},y)});var X=e.i(803414),Q=e.i(818390);let Z=S.forwardRef(function(e,t){let{render:n,className:o,style:r,children:i,...a}=e,{store:s}=(0,N.useMenuRootContext)(),{side:u}=(0,X.useMenuPositionerContext)(),l=s.useState("instantType"),{children:d,state:c}=(0,Q.usePopupViewport)({store:s,side:u,children:i}),p={activationDirection:c.activationDirection,transitioning:c.transitioning,instant:l};return(0,L.useRenderElement)("div",e,{state:p,ref:t,props:[a,{children:d}],stateAttributesMapping:Q.popupViewportStateMapping})});var ee=e.i(652225),et=e.i(328744),en=e.i(673553),eo=e.i(866506),er=e.i(874671);let ei={"aria-expanded":void 0},ea=S.forwardRef(function(e,t){let{render:n,className:o,style:r,label:i,id:a,nativeButton:s=!1,openOnHover:u=!0,delay:l=100,closeDelay:d=0,disabled:c=!1,...p}=e,f=(0,er.useMenuSubmenuRootContext)();if(!f?.parentMenu)throw Error((0,h.default)(37));let g=(0,en.useCompositeListItem)({guess:!0,label:i}),m=(0,X.useMenuPositionerContext)(),{store:v}=(0,N.useMenuRootContext)(),b=(0,Y.useBaseUiId)(a),R=v.useState("open"),x=v.useState("floatingRootContext"),y=v.useState("floatingTreeRoot"),O=v.useState("triggerPopupId",b),T=(0,G.useTriggerRegistration)(b,v),P=(0,E.useStableCallback)(e=>{T(e),null!==e&&v.select("open")&&null==v.select("activeTriggerId")&&v.update({activeTriggerId:b??null,activeTriggerElement:e,closeDelay:d})}),A=S.useRef(null),F=S.useCallback(e=>{A.current=e,v.set("activeTriggerElement",e)},[v]);(0,M.useIsoLayoutEffect)(()=>(P(A.current),()=>P(null)),[P,b,v]),v.useSyncedValue("closeDelay",d);let B=f.parentMenu,j=v.useState("disabled"),H=B.useState("disabled"),U=c||j||H,_=B.useState("itemProps"),K=B.useState("isActive",g.index),z=S.useMemo(()=>({type:"submenu-trigger",setActive(){B.select("highlightItemOnHover")&&B.set("activeIndex",g.index)}}),[B,g.index]),{getItemProps:W,itemRef:J}=(0,eo.useMenuItem)({closeOnClick:!1,disabled:U,highlighted:K,id:b,store:v,typingRef:B.context.typingRef,nativeButton:s,itemMetadata:z,nodeId:m?.context.nodeId}),$=v.useState("hoverEnabled"),q=(0,w.useHoverReferenceInteraction)(x,{enabled:$&&u&&!U,handleClose:(0,C.safePolygon)({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:d},shouldOpen:l>0?()=>B.select("allowMouseEnter"):void 0,triggerElementRef:A,externalTree:y,isClosing:()=>"ending"===v.select("transitionStatus"),guardStaleOpen:!0}),Q=(0,k.useClick)(x,{enabled:!U,event:"mousedown",toggle:!u,ignoreMouse:u,stickIfOpen:!1}).reference??I.EMPTY_OBJECT,Z=v.useState("triggerProps",!0);delete Z.id;let ee=v.useState("openMethod"),ea=v.useState("lastOpenChangeReason")===V.REASONS.listNavigation||"keyboard"===ee,es=R&&ea&&et.platform.screenReader.voiceOver;return(0,L.useRenderElement)("div",e,{state:{disabled:U,highlighted:K,open:R},stateAttributesMapping:D.triggerOpenStateMapping,props:[Q,q,Z,_,es?ei:void 0,{"aria-controls":O,tabIndex:R||K?0:-1,onBlur(){K&&B.set("activeIndex",null)}},p,W],ref:[t,g.ref,J,P,F]})});var es=e.i(536481),eu=e.i(564170);class el extends eu.BasePopupHandle{constructor(){super((0,es.createNullMenuStore)(),"Menu")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}e.s(["Arrow",()=>n.MenuArrow,"Backdrop",()=>o.MenuBackdrop,"CheckboxItem",()=>r.MenuCheckboxItem,"CheckboxItemIndicator",()=>i.MenuCheckboxItemIndicator,"Group",()=>a.MenuGroup,"GroupLabel",()=>s.MenuGroupLabel,"Handle",0,el,"Item",()=>u.MenuItem,"LinkItem",()=>l.MenuLinkItem,"Popup",()=>d.MenuPopup,"Portal",()=>c.MenuPortal,"Positioner",()=>p.MenuPositioner,"RadioGroup",()=>f.MenuRadioGroup,"RadioItem",()=>g.MenuRadioItem,"RadioItemIndicator",()=>m.MenuRadioItemIndicator,"Root",()=>v.MenuRoot,"Separator",()=>ee.Separator,"SubmenuRoot",()=>b.MenuSubmenuRoot,"SubmenuTrigger",0,ea,"Trigger",0,q,"Viewport",0,Z,"createHandle",0,function(){return new el}],160948);var ed=e.i(160948),ed=ed;e.i(593698),e.i(986253);var ec=e.i(647163);e.s(["DropdownMenu",0,function({...e}){return(0,t.jsx)(ed.Root,{"data-slot":"dropdown-menu",...e})},"DropdownMenuContent",0,function({align:e="start",alignOffset:n=0,side:o="bottom",sideOffset:r=4,className:i,...a}){return(0,t.jsx)(ed.Portal,{children:(0,t.jsx)(ed.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:n,side:o,sideOffset:r,children:(0,t.jsx)(ed.Popup,{"data-slot":"dropdown-menu-content",className:(0,ec.cn)("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",i),...a})})})},"DropdownMenuGroup",0,function({...e}){return(0,t.jsx)(ed.Group,{"data-slot":"dropdown-menu-group",...e})},"DropdownMenuItem",0,function({className:e,inset:n,variant:o="default",...r}){return(0,t.jsx)(ed.Item,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":o,className:(0,ec.cn)("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})},"DropdownMenuTrigger",0,function({...e}){return(0,t.jsx)(ed.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}],463415);var ep=e.i(798120),ef=e.i(6799),eg=e.i(95187);let em=(0,eg.createServerReference)("7f2872df8bda8a147ab741a01f541e9fe16fb60125",eg.callServer,void 0,eg.findSourceMapURL,"markSeenAction");e.s(["markSeenAction",0,em],770625);var ev=e.i(245629),eb=e.i(393080),eh=e.i(283653),eS=e.i(553429);let eR=[],ex=!1,ey=new Set;function eE(e,t){let n=e=>({name:e,icon:t?.find(t=>t.name===e)?.icon??null}),o=n(e.bot),r=[],i=new Map,a=new Map,s=new Map;for(let t of e.lines){let e=t.bot?n(t.bot):o,u=t.to?n(t.to):t.parent?a.get(t.parent)??null:null;switch(t.kind){case"user":r.push({id:t.id,bot:t.to?n(t.to):o,to:t.to?n(t.to):null,text:t.text,kind:"user"});break;case"text":r.push({id:t.id,bot:e,to:u,text:t.text,kind:"say"});break;case"note":r.push({id:t.id,bot:e,to:u,text:t.text,kind:"note"});break;case"stop":r.push({id:t.id,bot:e,to:u,text:t.text,kind:"stop",at:t.at});break;case"tool":i.set(t.callId,r.length),r.push({id:t.id,bot:e,to:u,text:t.note??t.input,kind:"tool",at:t.at,tool:{name:t.name,input:t.input,note:t.note,path:t.path,callId:t.callId}});break;case"tool-result":{let e=i.get(t.callId)??s.get(t.callId),n=void 0===e?void 0:r[e];n?.tool&&void 0!==e?r[e]={...n,tool:{...n.tool,results:t.results,more:t.more}}:n?.kind==="ask"&&void 0!==e&&(r[e]={id:n.id,bot:n.bot,to:null,text:n.text,kind:"tool",tool:{name:t.name,input:n.text,callId:t.callId,results:t.results,more:t.more}});break}case"ask":{s.set(t.callId,r.length);let o=n(t.to);a.set(t.callId,e),r.push({id:t.id,bot:e,to:o,text:t.text,kind:"ask",question:t.question})}}}if(r.forEach((e,t)=>{if("user"!==e.kind)return;let n=r.slice(0,t).findLast(t=>"user"!==t.kind&&t.bot.name===e.bot.name);n?.kind==="tool"&&(r[t]={...e,steppedIn:!0})}),"done"===e.status){let t=r.at(-1);t&&"say"===t.kind&&t.text===e.outcome&&(r[r.length-1]={...t,kind:"result"})}return{id:e.id,room:e.room,request:e.request,label:e.label,bot:o,lines:r,status:"running"===e.status?"working":e.status,outcome:e.outcome,ask:e.ask,seen:e.seen,routineId:e.routineId,tokens:e.tokens,contextTokens:e.contextTokens,contextBudget:e.contextBudget,updatedAt:e.updatedAt}}let eM=new Map,eI=new Map,eC=[],ek=new Set,eO=[],eT=!1,ew=new Set,eP=new Set,eA=!1,eN=new Set,eD=new Set,eL=new Set,eF=[],eB=e=>e.id.slice(0,e.id.lastIndexOf("-")),ej=e=>"user"===e.kind?{name:eS.ROOM_THURSDAY}:e.bot,eH=e=>"user"===e.kind?e.bot:e.to,eU=(e,t)=>({kind:"entry",speaker:e.bot,entry:{kind:"work",key:`${e.lines[0].id}-work`,lines:e.lines,open:t}});e.s(["botThreads",0,{sync(e,t){for(let n of(ex=!0,eR=[...e].reverse().map(e=>eE(e,t)),ey))n()},primed:()=>ex},"heardBy",0,eH,"lastSaid",0,function(e){for(let t=e.lines.length-1;t>=0;t--){let n=e.lines[t];if("user"!==n.kind&&"note"!==n.kind&&"stop"!==n.kind)return n}return null},"latestPerBot",0,function(e){let t=new Map;for(let n of e)for(let e of(t.has(n.bot.name)||t.set(n.bot.name,{bot:n.bot,thread:n,line:null}),n.lines))"user"!==e.kind&&"note"!==e.kind&&"stop"!==e.kind&&t.set(e.bot.name,{bot:e.bot,thread:n,line:e});return[...t.values()]},"ringingThreads",0,{set(e){if(!(e.length===eC.length&&e.every((e,t)=>eC[t]===e)))for(let t of(eC=e,ek))t()}},"roomOpen",0,{set(e){if(e!==eT)for(let t of(eT=e,ew))t()}},"roomOpens",0,{open(e){for(let t of eD)t(e)},subscribe:e=>(eD.add(e),()=>{eD.delete(e)})},"rosterOf",0,function(e){let t=[e.bot];for(let n of e.lines)for(let e of[n.bot,n.to])e&&e.name!==eS.ROOM_THURSDAY&&!t.some(t=>t.name===e.name)&&t.push(e);return t},"screenActs",0,{announce(e){for(let t of eL)t(e)},subscribe:e=>(eL.add(e),()=>{eL.delete(e)})},"threadDrafts",0,{recipient:e=>eI.get(e),select:(e,t)=>{eI.set(e,t)},get:(e,t,n)=>eM.get(e)?.get(JSON.stringify([t,n??null]))??"",set(e,t,n,o){let r=eM.get(e)??new Map,i=JSON.stringify([t,o??null]);n?r.set(i,n):r.delete(i),r.size?eM.set(e,r):eM.delete(e)}},"threadFromRow",0,eE,"threadItems",0,function(e,t,n=[]){let o,r=(o=new Set(e.lines.filter(e=>"tool"===e.kind||"ask"===e.kind).map(eB)),e=>"user"===e.kind||"ask"===e.kind||"result"===e.kind||"say"===e.kind&&!o.has(eB(e))),i=t===e.bot.name?e.lines:e.lines.filter(e=>ej(e).name===t||r(e)&&eH(e)?.name===t),a=new Set([e.bot.name,eS.ROOM_THURSDAY]),s=new Map;for(let t of e.lines){let e=eH(t);e&&!a.has(e.name)&&(a.add(e.name),s.set(t.id,{from:ej(t),to:e})),a.add(t.bot.name)}let u=[],l=new Map,d=e=>{let t=e?l.get(e.name):void 0;t&&(l.delete(t.bot.name),u.push(eU(t,!1)))};for(let e of i){if(!r(e)){let t=l.get(e.bot.name)??{bot:e.bot,lines:[],at:0};t.lines.push(e),t.at=u.length,l.set(e.bot.name,t);continue}let t=ej(e);d(eH(e));let n=s.get(e.id);n&&u.push({kind:"invite",key:`${e.id}-joins`,...n}),d(t),u.push({kind:"entry",speaker:t,entry:{kind:"message",key:e.id,line:e}})}for(let e of[...l.values()].sort((e,t)=>e.at-t.at).reverse())u.splice(e.at,0,eU(e,!0));for(let e of n)l.has(e.name)||u.push({kind:"entry",speaker:e,entry:{kind:"work",key:`${e.name}-now`,lines:[],open:!0}});let c=[];for(let e of u){let t=c.at(-1);"invite"===e.kind?c.push(e):t?.kind==="turn"&&t.speaker.name===e.speaker.name?t.entries.push(e.entry):c.push({kind:"turn",key:e.entry.key,speaker:e.speaker,entries:[e.entry]})}return c},"useBotThreads",0,function(){return(0,S.useSyncExternalStore)(e=>(ey.add(e),()=>ey.delete(e)),()=>eR,()=>eF)},"useRingingThreads",0,function(){return(0,S.useSyncExternalStore)(e=>(ek.add(e),()=>ek.delete(e)),()=>eC,()=>eO)},"useRoomOpen",0,function(){return(0,S.useSyncExternalStore)(e=>(ew.add(e),()=>ew.delete(e)),()=>eT,()=>!1)},"useSeenOnDetail",0,function(e){let t=(0,S.useRef)(new Set),n=e?.id??null,o=e?`${e.id}@${(0,ev.toDate)(e.updatedAt).getTime()}`:null,r=!!e&&"done"===e.status&&!e.seen;(0,S.useEffect)(()=>{!n||!o||!r||t.current.has(o)||(t.current.add(o),em([n]).then(eb.unwrapResult).then(()=>(0,eh.revalidate)(ep.queryKey.threads)).catch(e=>{t.current.delete(o),ef.toast.add({type:"error",title:"Could not mark the thread as read",description:(0,ec.errorToString)(e)})}))},[n,o,r])},"useWriteLineUp",0,function(){return(0,S.useSyncExternalStore)(e=>(eN.add(e),()=>eN.delete(e)),()=>eA,()=>!1)},"writeLine",0,{open(){for(let e of eP)e()},subscribe:e=>(eP.add(e),()=>{eP.delete(e)}),shown(e){if(e!==eA)for(let t of(eA=e,eN))t()}}],978411)},413082,e=>{"use strict";var t=e.i(271645),n=e.i(574735),o=e.i(328744),r=e.i(365420),i=e.i(108868),a=e.i(439957),s=e.i(229315),u=e.i(451321),l=e.i(584446),d=e.i(596296),c=e.i(675606),p=e.i(56434);let f=o.platform.os.mac&&o.platform.engine.webkit;e.s(["useFocus",0,function(e,o={}){let{enabled:g=!0,delay:m}=o,v="rootStore"in e?e.rootStore:e,{events:b,dataRef:h}=v.context,S=t.useRef(!1),R=t.useRef(null),x=t.useRef(!0),y=(0,a.useTimeout)();t.useEffect(()=>{let e=v.select("domReferenceElement");if(!g)return;let t=(0,s.getWindow)(e);return(0,r.mergeCleanups)((0,n.addEventListener)(t,"blur",function(){let e=v.select("domReferenceElement");!v.select("open")&&(0,s.isHTMLElement)(e)&&e===(0,l.activeElement)((0,i.ownerDocument)(e))&&(S.current=!0,R.current=e)}),f&&(0,n.addEventListener)(t,"keydown",function(){x.current=!0},!0),f&&(0,n.addEventListener)(t,"pointerdown",function(){x.current=!1},!0))},[v,g]),t.useEffect(()=>{if(g)return b.on("openchange",e),()=>{b.off("openchange",e)};function e(e){if(e.reason===p.REASONS.triggerPress||e.reason===p.REASONS.escapeKey){let e=v.select("domReferenceElement");(0,s.isElement)(e)&&(R.current=e,S.current=!0)}}},[b,g,v]);let E=t.useMemo(()=>{function e(){S.current=!1,R.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(S.current){if(R.current===n)return;e()}let o=(0,l.getTarget)(t.nativeEvent);if((0,s.isElement)(o)){if(f&&!t.relatedTarget){if(!x.current&&!(0,d.isTypeableElement)(o))return}else if(!(0,d.matchesFocusVisible)(o))return}let r=(0,d.isTargetInsideEnabledTrigger)(t.relatedTarget,v.context.triggerElements),{nativeEvent:i,currentTarget:a}=t,u="function"==typeof m?m():m;v.select("open")&&r||0===u||void 0===u?v.setOpen(!0,(0,c.createChangeEventDetails)(p.REASONS.triggerFocus,i,a)):y.start(u,()=>{S.current||v.setOpen(!0,(0,c.createChangeEventDetails)(p.REASONS.triggerFocus,i,a))})},onBlur(t){e();let n=t.relatedTarget,o=t.nativeEvent,r=(0,s.isElement)(n)&&n.hasAttribute((0,u.createAttribute)("focus-guard"))&&"outside"===n.getAttribute("data-type");y.start(0,()=>{let e=v.select("domReferenceElement"),t=(0,l.activeElement)((0,i.ownerDocument)(e));if(!n&&t===e||(0,l.contains)(h.current.floatingContext?.refs.floating.current,t)||(0,l.contains)(e,t)||r)return;let a=n??t;(0,d.isTargetInsideEnabledTrigger)(a,v.context.triggerElements)||v.setOpen(!1,(0,c.createChangeEventDetails)(p.REASONS.triggerFocus,o))})}}},[h,m,v,y]);return t.useMemo(()=>g?{reference:E,trigger:E}:{},[g,E])}])},261027,803414,978921,382370,389554,866506,685996,371714,181194,801545,91384,858307,764270,219712,82264,862050,282593,105953,507447,536481,874671,63947,277450,e=>{"use strict";e.s([],261027);var t=e.i(271645),n=e.i(733332);let o=t.createContext(void 0);function r(e){let r=t.useContext(o);if(void 0===r&&!e)throw Error((0,n.default)(33));return r}e.s(["MenuPositionerContext",0,o,"useMenuPositionerContext",0,r],803414);let i=t.createContext(void 0);function a(e){let o=t.useContext(i);if(void 0===o&&!e)throw Error((0,n.default)(36));return o}e.s(["MenuRootContext",0,i,"useMenuRootContext",0,a],978921);var s=e.i(552245),u=e.i(879938);let l=t.forwardRef(function(e,t){let{render:n,className:o,style:i,...l}=e,{store:d}=a(),{arrowRef:c,side:p,align:f,arrowUncentered:g,arrowStyles:m}=r(),v=d.useState("open");return(0,s.useRenderElement)("div",e,{ref:[c,t],stateAttributesMapping:u.popupStateMapping,state:{open:v,side:p,align:f,uncentered:g},props:{style:m,"aria-hidden":!0,...l}})});e.s(["MenuArrow",0,l],382370);let d=t.createContext(void 0);function c(e=!0){let o=t.useContext(d);if(void 0===o&&!e)throw Error((0,n.default)(25));return o}var p=e.i(56434);let f=t.forwardRef(function(e,t){let{render:n,className:o,style:r,...i}=e,{store:l}=a(),d=l.useState("open"),f=l.useState("mounted"),g=l.useState("transitionStatus"),m=l.useState("lastOpenChangeReason"),v=c();return(0,s.useRenderElement)("div",e,{ref:v?.backdropRef?[t,v.backdropRef]:t,state:{open:d,transitionStatus:g},stateAttributesMapping:u.popupTransitionStateMapping,props:[{role:"presentation",hidden:!f,style:{pointerEvents:m===p.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},i]})});e.s(["MenuBackdrop",0,f],389554);var g=e.i(951437),m=e.i(956789);let v=t.createContext(void 0);var b=e.i(828918),h=e.i(540886),S=e.i(176782),R=e.i(328744),x=e.i(64350);function y(e){let{closeOnClick:n,highlighted:o,id:r,nodeId:i,store:a,typingRef:s,itemRef:u,itemMetadata:l}=e,{events:d}=a.useState("floatingTreeRoot"),f=a.useState("open"),g=c(!0),m=void 0!==g;return t.useMemo(()=>({id:r,role:"menuitem",tabIndex:f&&o?0:-1,onKeyDown(e){" "===e.key&&s?.current&&e.preventDefault()},onMouseMove(e){i&&d.emit("itemhover",{nodeId:i,target:e.currentTarget})},onClick(e){n&&d.emit("close",{domEvent:e,reason:p.REASONS.itemPress})},onMouseUp(e){if(g){let t=g.initialCursorPointRef.current;if(g.initialCursorPointRef.current=null,m&&t&&1>=Math.abs(e.clientX-t.x)&&1>=Math.abs(e.clientY-t.y)||m&&!R.platform.os.mac&&2===e.button)return}u.current&&a.context.allowMouseUpTriggerRef.current&&(!m||2===e.button)&&"regular-item"===l.type&&(0,x.dispatchClickWithModifiers)(u.current,e,{detail:1})}}),[n,o,r,d,i,f,a,s,u,g,m,l])}let E={type:"regular-item"};function M(e){let{closeOnClick:n,disabled:o,highlighted:r,id:i,store:a,typingRef:s=a.context.typingRef,nativeButton:u,itemMetadata:l,nodeId:d}=e,c=t.useRef(null),{getButtonProps:p,buttonRef:f}=(0,h.useButton)({disabled:o,focusableWhenDisabled:!0,native:u,composite:!0}),g=y({closeOnClick:n,highlighted:r,id:i,nodeId:d,store:a,typingRef:s,itemRef:c,itemMetadata:l}),m=t.useCallback(e=>(0,S.mergeProps)(g,{onMouseEnter(){"submenu-trigger"===l.type&&l.setActive()}},e,p),[g,p,l]),v=(0,b.useMergedRefs)(c,f);return t.useMemo(()=>({getItemProps:m,itemRef:v}),[m,v])}e.s(["REGULAR_ITEM",0,E,"useMenuItem",0,M],866506);var I=e.i(673553),C=e.i(788015);let k={checked:e=>e?{"data-checked":""}:{"data-unchecked":""},...e.i(474354).transitionStatusMapping};var O=e.i(675606),T=e.i(843476);let w=t.forwardRef(function(e,n){let{render:o,className:i,id:u,label:l,nativeButton:d=!1,disabled:c=!1,closeOnClick:f=!1,checked:b,defaultChecked:h,onCheckedChange:S,style:R,...x}=e,y=(0,I.useCompositeListItem)({guess:!0,label:l}),w=r(!0),P=(0,C.useBaseUiId)(u),{store:A}=a(),N=A.useState("disabled"),D=c||N,L=A.useState("isActive",y.index),F=A.useState("itemProps"),[B,j]=(0,g.useControlled)({controlled:b,default:h??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:H,itemRef:U}=M({closeOnClick:f,disabled:D,highlighted:L,id:P,store:A,nativeButton:d,nodeId:w?.context.nodeId,itemMetadata:E}),_=t.useMemo(()=>({disabled:D,highlighted:L,checked:B}),[D,L,B]),G=(0,s.useRenderElement)("div",e,{state:_,stateAttributesMapping:k,props:[F,{role:"menuitemcheckbox","aria-checked":B,onClick:function(e){let t=(0,O.createChangeEventDetails)(p.REASONS.itemPress,e.nativeEvent,void 0,{preventUnmountOnClose:m.NOOP});S?.(!B,t),t.isCanceled||j(e=>!e)}},x,H],ref:[U,n,y.ref]});return(0,T.jsx)(v.Provider,{value:_,children:G})});e.s(["MenuCheckboxItem",0,w],685996);var P=e.i(223910),A=e.i(137584);let N=t.forwardRef(function(e,o){let{render:r,className:i,style:a,keepMounted:u=!1,...l}=e,d=function(){let e=t.useContext(v);if(void 0===e)throw Error((0,n.default)(30));return e}(),c=t.useRef(null),{transitionStatus:p,mounted:f,setMounted:g}=(0,P.useTransitionStatus)(d.checked);(0,A.useOpenChangeComplete)({batch:!0,enabled:!d.checked,open:d.checked,ref:c,onComplete(){d.checked||g(!1)}});let m={checked:d.checked,disabled:d.disabled,highlighted:d.highlighted,transitionStatus:p};return(0,s.useRenderElement)("span",e,{state:m,ref:[o,c],stateAttributesMapping:k,props:{"aria-hidden":!0,...l},enabled:u||f})});e.s(["MenuCheckboxItemIndicator",0,N],371714);let D=t.createContext(void 0),L=t.forwardRef(function(e,n){let{render:o,className:r,style:i,...a}=e,[u,l]=t.useState(void 0),d=(0,s.useRenderElement)("div",e,{ref:n,props:{role:"group","aria-labelledby":u,...a}});return(0,T.jsx)(D.Provider,{value:l,children:d})});e.s(["MenuGroup",0,L],181194);var F=e.i(146376);let B=t.forwardRef(function(e,o){let{render:r,className:i,style:a,id:u,...l}=e,d=(0,C.useBaseUiId)(u),c=function(){let e=t.useContext(D);if(void 0===e)throw Error((0,n.default)(31));return e}();return(0,F.useIsoLayoutEffect)(()=>(c(d),()=>{c(e=>e===d?void 0:e)}),[c,d]),(0,s.useRenderElement)("div",e,{ref:o,props:{id:d,"aria-hidden":!0,...l}})});e.s(["MenuGroupLabel",0,B],801545);let j=t.forwardRef(function(e,t){let{render:n,className:o,id:i,label:u,nativeButton:l=!1,disabled:d=!1,closeOnClick:c=!0,style:p,...f}=e,g=(0,I.useCompositeListItem)({guess:!0,label:u}),m=r(!0),v=(0,C.useBaseUiId)(i),{store:b}=a(),h=b.useState("disabled"),S=d||h,R=b.useState("isActive",g.index),x=b.useState("itemProps"),{getItemProps:y,itemRef:k}=M({closeOnClick:c,disabled:S,highlighted:R,id:v,store:b,nativeButton:l,nodeId:m?.context.nodeId,itemMetadata:E});return(0,s.useRenderElement)("div",e,{state:{disabled:S,highlighted:R},props:[x,f,y],ref:[k,t,g.ref]})});e.s(["MenuItem",0,j],91384);let H=t.forwardRef(function(e,n){let{render:o,className:i,id:u,label:l,closeOnClick:d=!1,style:c,...p}=e,f=t.useRef(null),g=(0,I.useCompositeListItem)({guess:!0,label:l}),m=r(!0),v=m?.context.nodeId,b=(0,C.useBaseUiId)(u),{store:R}=a(),x=R.useState("isActive",g.index),M=R.useState("itemProps"),k=R.context.typingRef,{getButtonProps:O,buttonRef:T}=(0,h.useButton)({native:!1,composite:!0}),w=y({closeOnClick:d,highlighted:x,id:b,nodeId:v,store:R,typingRef:k,itemRef:f,itemMetadata:E});return(0,s.useRenderElement)("a",e,{state:{highlighted:x},props:[M,p,function(e){return(0,S.mergeProps)(w,e,O)}],ref:[f,T,n,g.ref]})});e.s(["MenuLinkItem",0,H],858307);var U=e.i(61487),_=e.i(431157),G=e.i(96533),K=e.i(673327),Y=e.i(253984);let V=t.forwardRef(function(e,n){let{render:o,className:i,style:l,finalFocus:d,...c}=e,{store:f}=a(),{side:g,align:m}=r(),v=null!=(0,G.useToolbarRootContext)(!0),b=f.useState("open"),h=f.useState("transitionStatus"),S=f.useState("popupProps"),R=f.useState("mounted"),x=f.useState("instantType"),y=f.useState("activeTriggerElement"),E=f.useState("parent"),M=f.useState("lastOpenChangeReason"),I=f.useState("rootId"),C=f.useState("floatingRootContext"),k=f.useState("floatingTreeRoot"),w=f.useState("closeDelay"),P=f.useState("hoverEnabled"),N=f.useState("disabled"),D=f.useState("openMethod"),L="context-menu"===E.type;(0,A.useOpenChangeComplete)({open:b,ref:f.context.popupRef,onComplete(){b&&f.context.onOpenChangeComplete?.(!0)}}),t.useEffect(()=>{function e(e){f.setOpen(!1,(0,O.createChangeEventDetails)(e.reason,e.domEvent))}return k.events.on("close",e),()=>{k.events.off("close",e)}},[k.events,f]),(0,_.useHoverFloatingInteraction)(C,{enabled:P&&!N&&!L&&"menubar"!==E.type,closeDelay:w});let F=f.useStateSetter("popupElement"),B={transitionStatus:h,side:g,align:m,open:b,nested:"menu"===E.type,instant:x},j=(0,s.useRenderElement)("div",e,{state:B,ref:[n,f.context.popupRef,F],stateAttributesMapping:u.popupTransitionStateMapping,props:[S,{onKeyDown(e){v&&K.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()}},(0,Y.getDisabledMountTransitionStyles)(h),c,{"data-rootownerid":I}]}),H=void 0===E.type||L;return(y||"menubar"===E.type&&M!==p.REASONS.outsidePress)&&(H=!0),(0,T.jsx)(U.FloatingFocusManager,{context:C,openInteractionType:D,modal:L,disabled:!R,returnFocus:void 0===d?H:d,initialFocus:"menu"!==E.type,restoreFocus:!0,externalTree:"menubar"!==E.type?k:void 0,previousFocusableElement:y,nextFocusableElement:void 0===E.type?f.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:void 0===E.type?f.context.beforeContentFocusGuardRef:void 0,children:j})});e.s(["MenuPopup",0,V],764270);var z=e.i(726674);let W=t.createContext(void 0),J=t.forwardRef(function(e,t){let{keepMounted:n=!1,...o}=e,{store:r,parent:i}=a();if(!(r.useState("mounted")||n))return null;let s="menu"===i.type||"menubar"===i.type?"group":void 0;return(0,T.jsx)(W.Provider,{value:n,children:(0,T.jsx)(z.FloatingPortal,{ref:t,...o,portalOwnerRole:s})})});e.s(["MenuPortal",0,J],219712);var $=e.i(144394),q=e.i(439957),X=e.i(46420),Q=e.i(923706),Z=e.i(53687),ee=e.i(426),et=e.i(638396),en=e.i(222640),eo=e.i(789579),er=e.i(33383);let ei=t.forwardRef(function(e,r){let{anchor:i,positionMethod:s="absolute",className:u,render:l,side:d,align:f,sideOffset:g=0,alignOffset:m=0,collisionBoundary:v="clipping-ancestors",collisionPadding:b=5,arrowPadding:h=5,sticky:S=!1,disableAnchorTracking:R=!1,collisionAvoidance:x=et.DROPDOWN_COLLISION_AVOIDANCE,style:y,...E}=e,{store:M}=a(),I=function(){let e=t.useContext(W);if(void 0===e)throw Error((0,n.default)(32));return e}(),C=c(!0),k=M.useState("parent"),w=M.useState("floatingRootContext"),P=M.useState("floatingTreeRoot"),A=M.useState("mounted"),N=M.useState("open"),D=M.useState("modal"),L=M.useState("openMethod"),B=M.useState("activeTriggerElement"),j=M.useState("transitionStatus"),H=M.useState("positionerElement"),U=M.useState("instantType"),_=M.useState("adaptiveOrigin"),G=M.useState("lastOpenChangeReason"),K=M.useState("floatingNodeId"),Y=M.useState("floatingParentNodeId"),V=w.useState("domReferenceElement"),z=t.useRef(null),J=(0,en.useAnimationsFinished)(H),ei=i,ea=g,es=m,eu=f,el=x;"context-menu"===k.type&&(ei=i??k.context?.anchor,eu=eu??"start",d||"center"===eu||(es=e.alignOffset??2,ea=e.sideOffset??-5));let ed=d,ec=eu;"menu"===k.type?(ed=ed??"inline-end",ec=ec??"start",el=e.collisionAvoidance??et.POPUP_COLLISION_AVOIDANCE):"menubar"===k.type&&(ed=ed??("vertical"===k.context.orientation?"inline-end":"bottom"),ec=ec??"start");let ep="context-menu"===k.type,ef=(0,Q.useAnchorPositioning)({anchor:ei,floatingRootContext:w,positionMethod:C?"fixed":s,mounted:A,side:ed,sideOffset:ea,align:ec,alignOffset:es,arrowPadding:ep?0:h,collisionBoundary:v,collisionPadding:b,sticky:S,nodeId:K,keepMounted:I,disableAnchorTracking:R,collisionAvoidance:el,shift:ep?{crossAxis:!("side"in el&&"flip"===el.side),rootBoundary:"layoutViewport"}:void 0,externalTree:P,adaptiveOrigin:_});t.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===K&&M.set("hoverEnabled",!1),e.nodeId!==K&&e.parentNodeId===M.select("floatingParentNodeId")&&M.setOpen(!1,(0,O.createChangeEventDetails)(p.REASONS.siblingOpen)))}return P.events.on("menuopenchange",e),()=>{P.events.off("menuopenchange",e)}},[M,P.events,K]),t.useEffect(()=>{if(null!=M.select("floatingParentNodeId"))return P.events.on("menuopenchange",e),()=>{P.events.off("menuopenchange",e)};function e(e){if(e.open||e.nodeId!==M.select("floatingParentNodeId"))return;let t=e.reason??p.REASONS.siblingOpen;M.setOpen(!1,(0,O.createChangeEventDetails)(t))}},[P.events,M]);let eg=(0,q.useTimeout)();t.useEffect(()=>{N||eg.clear()},[N,eg]),t.useEffect(()=>{function e(e){if(N&&e.nodeId===M.select("floatingParentNodeId"))if(e.target&&B&&B!==e.target){let e=M.select("closeDelay");e>0?eg.isStarted()||eg.start(e,()=>{M.setOpen(!1,(0,O.createChangeEventDetails)(p.REASONS.siblingOpen))}):M.setOpen(!1,(0,O.createChangeEventDetails)(p.REASONS.siblingOpen))}else eg.clear()}return P.events.on("itemhover",e),()=>{P.events.off("itemhover",e)}},[P.events,N,B,M,eg]),t.useEffect(()=>{let e={open:N,nodeId:K,parentNodeId:Y,reason:M.select("lastOpenChangeReason")};P.events.emit("menuopenchange",e)},[P.events,N,M,K,Y]),(0,F.useIsoLayoutEffect)(()=>{let e=z.current;if(V&&(z.current=V),e&&V&&V!==e){M.set("instantType",void 0);let e=new AbortController;return J(()=>{M.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[V,J,M]);let em={open:N,side:ef.side,align:ef.align,anchorHidden:ef.anchorHidden,nested:"menu"===k.type,instant:U},ev="menubar"===k.type&&k.context.modal,eb=D&&G!==p.REASONS.triggerHover;(0,er.useAnchoredPopupScrollLock)(N&&(ev||eb),"touch"===L,H,B);let eh=(0,eo.usePositioner)(e,em,{styles:ef.positionerStyles,transitionStatus:j,props:E,refs:[r,M.useStateSetter("positionerElement")],hidden:!A,inert:!N}),eS=A&&"menu"!==k.type&&("menubar"!==k.type&&D&&G!==p.REASONS.triggerHover||"menubar"===k.type&&k.context.modal),eR=null;return"menubar"===k.type?eR=k.context.contentElement:void 0===k.type&&(eR=B),(0,T.jsxs)(o.Provider,{value:ef,children:[eS&&(0,T.jsx)(ee.InternalBackdrop,{ref:"context-menu"===k.type||"nested-context-menu"===k.type?k.context.internalBackdropRef:null,inert:(0,$.inertValue)(!N),cutout:eR}),(0,T.jsx)(X.FloatingNode,{id:K,children:(0,T.jsx)(Z.CompositeList,{elementsRef:M.context.itemDomElements,labelsRef:M.context.itemLabels,children:eh})})]})});e.s(["MenuPositioner",0,ei],82264);var ea=e.i(667865);let es=t.createContext(void 0),eu=t.memo(t.forwardRef(function(e,n){let{render:o,className:r,value:i,defaultValue:a,onValueChange:u,disabled:l=!1,style:d,"aria-labelledby":c,...p}=e,[f,m]=t.useState(void 0),[v,b]=(0,g.useControlled)({controlled:i,default:a,name:"MenuRadioGroup"}),h=(0,ea.useStableCallback)((e,t)=>{u?.(e,t),t.isCanceled||b(e)}),S=(0,s.useRenderElement)("div",e,{state:{disabled:l},ref:n,props:{role:"group","aria-labelledby":c??f,"aria-disabled":l||void 0,...p}}),R=t.useMemo(()=>({value:v,setValue:h,disabled:l}),[v,h,l]);return(0,T.jsx)(D.Provider,{value:m,children:(0,T.jsx)(es.Provider,{value:R,children:S})})}));e.s(["MenuRadioGroup",0,eu],862050);let el=t.createContext(void 0),ed=t.forwardRef(function(e,o){let{render:i,className:u,id:l,label:d,nativeButton:c=!1,disabled:f=!1,closeOnClick:g=!1,value:v,style:b,...h}=e,S=(0,I.useCompositeListItem)({guess:!0,label:d}),R=r(!0),x=(0,C.useBaseUiId)(l),{store:y}=a(),w=y.useState("isActive",S.index),P=y.useState("itemProps"),{value:A,setValue:N,disabled:D}=function(){let e=t.useContext(es);if(void 0===e)throw Error((0,n.default)(34));return e}(),L=y.useState("disabled"),F=f||D||L,B=A===v,{getItemProps:j,itemRef:H}=M({closeOnClick:g,disabled:F,highlighted:w,id:x,store:y,nativeButton:c,nodeId:R?.context.nodeId,itemMetadata:E}),U=t.useMemo(()=>({disabled:F,highlighted:w,checked:B}),[F,w,B]),_=(0,s.useRenderElement)("div",e,{state:U,stateAttributesMapping:k,props:[P,{role:"menuitemradio","aria-checked":B,onClick:function(e){N(v,(0,O.createChangeEventDetails)(p.REASONS.itemPress,e.nativeEvent,void 0,{preventUnmountOnClose:m.NOOP}))}},h,j],ref:[H,o,S.ref]});return(0,T.jsx)(el.Provider,{value:U,children:_})});e.s(["MenuRadioItem",0,ed],282593);let ec=t.forwardRef(function(e,o){let{render:r,className:i,style:a,keepMounted:u=!1,...l}=e,d=function(){let e=t.useContext(el);if(void 0===e)throw Error((0,n.default)(35));return e}(),c=t.useRef(null),{transitionStatus:p,mounted:f,setMounted:g}=(0,P.useTransitionStatus)(d.checked);(0,A.useOpenChangeComplete)({batch:!0,enabled:!d.checked,open:d.checked,ref:c,onComplete(){d.checked||g(!1)}});let m={checked:d.checked,disabled:d.disabled,highlighted:d.highlighted,transitionStatus:p};return(0,s.useRenderElement)("span",e,{state:m,stateAttributesMapping:k,ref:[o,c],props:{"aria-hidden":!0,...l},enabled:u||f})});e.s(["MenuRadioItemIndicator",0,ec],105953);var ep=e.i(883977),ef=e.i(388940),eg=e.i(896499),em=e.i(17989),ev=e.i(260891),eb=e.i(736760),eh=e.i(350527);let eS=t.createContext(null);function eR(e){let o=t.useContext(eS);if(null===o&&!e)throw Error((0,n.default)(5));return o}e.s(["useMenubarContext",0,eR],507447);var ex=e.i(872855),ey=e.i(32199),eE=e.i(301252),eM=e.i(379248),eI=e.i(18478),eC=e.i(116786),ek=e.i(990627);let eO={...eC.popupStoreSelectors,disabled:e=>"menubar"===e.parent.type&&e.parent.context.disabled||e.disabled,modal:e=>(void 0===e.parent.type||"context-menu"===e.parent.type)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>"menu"===e.parent.type?e.parent.store.select("rootId"):void 0!==e.parent.type?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>"menu"===e.parent.type?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>e.keyboardEventRelay?e.keyboardEventRelay:"menu"===e.parent.type?e.parent.store.select("keyboardEventRelay"):void 0};class eT extends eE.ReactStore{constructor(e,t,n=!1){const o=new ek.PopupTriggerMap;super(eP(o,t,n,e),ew(o),eO),this.unsubscribeParentListener=this.observe("parent",e=>{if(this.unsubscribeParentListener?.(),"menu"===e.type){let t=e.store.select("rootId"),n=e.store.select("floatingTreeRoot"),o=e.store.select("keyboardEventRelay");this.unsubscribeParentListener=e.store.subscribe(()=>{let r=e.store.select("rootId"),i=e.store.select("floatingTreeRoot"),a=e.store.select("keyboardEventRelay");(t!==r||n!==i||o!==a)&&(t=r,n=i,o=a,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}void 0!==e.type&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}unsubscribeParentListener=null}function ew(e){return{positionerRef:t.createRef(),popupRef:t.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:t.createRef(),beforeContentFocusGuardRef:t.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function eP(e,t,n=!1,o){return{...(0,eC.createInitialPopupStoreState)(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new eM.FloatingTreeStore,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:m.EMPTY_OBJECT,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...o}}e.s(["MenuStore",0,eT,"createNullMenuStore",0,function(){let e=new ek.PopupTriggerMap;return Object.assign(new eI.NullStore(Object.freeze(eP(e)),Object.freeze(ew(e)),eO),{setOpen:m.NOOP})}],536481);var eA=e.i(264111);let eN=t.createContext(void 0);function eD(){return t.useContext(eN)}e.s(["MenuSubmenuRootContext",0,eN,"useMenuSubmenuRootContext",0,eD],874671);let eL=(0,eg.fastComponent)(function(e){var n,o,r;let s,{children:u,open:l,onOpenChange:d,onOpenChangeComplete:f,defaultOpen:g=!1,disabled:v=!1,modal:b,loopFocus:h=!0,orientation:R="vertical",actionsRef:x,closeParentOnEsc:y=!1,handle:E,triggerId:M,defaultTriggerId:I=null,highlightItemOnHover:C=!0}=e,k=c(!0),w=a(!0),P=eR(!0),A=eD(),N=t.useMemo(()=>A&&w?{type:"menu",store:w.store}:P?{type:"menubar",context:P}:k&&!w?{type:"context-menu",context:k}:{type:void 0},[k,w,P,A]),D=(0,ep.useId)(),L=(0,ep.useId)(),B=(0,X.useFloatingParentNodeId)(),j="menu"===N.type?N.store:void 0,H=(l??g)&&j?.state.transitionStatus==="starting",U=(0,ef.useRefWithInit)(()=>H?j?.state.instantType:void 0).current,_=(n={open:g,openProp:l,activeTriggerId:I,triggerIdProp:M,parent:N,disabled:v,highlightItemOnHover:C,modal:void 0===N.type?b:void 0,rootId:D,instantType:U},o=L,r=null!=B,(0,ef.useRefWithInit)(()=>new eT(n,o,r)).current);_.useControlledProp("openProp",l),_.useControlledProp("triggerIdProp",M),_.useContextCallback("onOpenChangeComplete",f);let G=_.useState("floatingTreeRoot"),K=(0,X.useFloatingNodeId)(G),Y=_.useState("open"),V=_.useState("activeTriggerElement"),z=_.useState("positionerElement"),W=_.useState("hoverEnabled"),J=_.useState("disabled"),$=_.useState("lastOpenChangeReason"),Q=_.useState("parent"),Z=_.useState("activeIndex"),ee=_.useState("payload"),eo=_.useState("floatingParentNodeId"),er=t.useRef(null),ei=t.useRef("context-menu"!==Q.type),es=(0,q.useTimeout)(),eu=t.useRef(!0),el=(0,q.useTimeout)(),ed=null!=eo,{openMethod:ec,triggerProps:eg}=(0,ey.useOpenInteractionType)(Y);_.useSyncedValues({disabled:v,highlightItemOnHover:C,modal:void 0===Q.type?b:void 0,openMethod:ec,rootId:D}),(0,eA.useImplicitActiveTrigger)(_);let{forceUnmount:eS,transitionStatus:eE}=(0,eA.useOpenStateTransitions)(Y,_,()=>{_.set("allowMouseEnter",!1)},H),eM=(0,en.useAnimationsFinished)(_.context.popupRef);t.useEffect(()=>{if(void 0===U)return;let e=()=>{_.state.instantType===U&&_.set("instantType",void 0)};if(!Y)return void e();if(void 0!==eE)return;if(null==_.context.popupRef.current)return void e();let t=new AbortController;return eM(e,t.signal),()=>{t.abort()}},[U,Y,eE,eM,_]),(0,F.useIsoLayoutEffect)(()=>{k&&!w?_.update({parent:{type:"context-menu",context:k},floatingNodeId:K,floatingParentNodeId:B}):w&&_.update({floatingNodeId:K,floatingParentNodeId:B})},[k,w,K,B,_]),t.useEffect(()=>{if(Y||(er.current=null),"context-menu"===Q.type){if(!Y){es.clear(),ei.current=!1;return}es.start(500,()=>{ei.current=!0})}},[es,Y,Q.type]),(0,F.useIsoLayoutEffect)(()=>{Y||W||_.set("hoverEnabled",!0)},[Y,W,_]);let eI=(0,ea.useStableCallback)((e,t)=>{let n=t.reason;if(!e&&!_.select("open")||Y===e&&t.trigger===V&&$===n)return;let o=(0,eA.attachPreventUnmountOnClose)(t);if(e||null!=t.trigger||(t.trigger=V??void 0),d?.(e,t),t.isCanceled)return;_.state.floatingRootContext.dispatchOpenChange(e,t);let r=t.event;if(!1===e&&r?.type==="click"&&"touch"===r.pointerType&&!eu.current)return;e&&n===p.REASONS.triggerFocus?(eu.current=!1,el.start(300,()=>{eu.current=!0})):(eu.current=!0,el.clear());let i=(n===p.REASONS.triggerPress||n===p.REASONS.itemPress)&&0===r.detail,a=!e&&(n===p.REASONS.escapeKey||null==n);er.current=t.event;let s=(0,eA.createPopupOpenState)(_.state,e,t.trigger,o());s.openChangeReason=n,"menubar"===Q.type&&(n===p.REASONS.triggerFocus||n===p.REASONS.focusOut||n===p.REASONS.triggerHover||n===p.REASONS.listNavigation||n===p.REASONS.siblingOpen)?s.instantType="group":i||a?s.instantType=i?"click":"dismiss":s.instantType=void 0,_.update(s)}),eC=(0,eh.useSyncedFloatingRootContext)({popupStore:_,floatingRootContext:_.state.floatingRootContext,floatingId:L,nested:null!=B,onOpenChange:eI}),ek=eC.context.events;(0,F.useIsoLayoutEffect)(()=>{let e=({open:e,eventDetails:t})=>eI(e,t);return ek.on("setOpen",e),()=>{ek?.off("setOpen",e)}},[ek,eI]);let eO=t.useCallback(()=>{_.setOpen(!1,(0,O.createChangeEventDetails)(p.REASONS.imperativeAction))},[_]);t.useImperativeHandle(x,()=>({unmount:eS,close:eO}),[eS,eO]),"context-menu"===Q.type&&(s=Q.context),t.useImperativeHandle(s?.positionerRef,()=>z,[z]),t.useImperativeHandle(s?.actionsRef,()=>({setOpen:eI}),[eI]);let ew=(0,em.useDismiss)(eC,{enabled:!J,bubbles:{escapeKey:y&&"menu"===Q.type},outsidePress:()=>"context-menu"!==Q.type||er.current?.type==="contextmenu"||ei.current,externalTree:ed?G:void 0}),eP=(0,ex.useDirection)(),eN=t.useCallback(e=>{_.select("activeIndex")!==e&&_.set("activeIndex",e)},[_]),eL=(0,ev.useListNavigation)(eC,{enabled:!J,listRef:_.context.itemDomElements,activeIndex:Z,nested:void 0!==Q.type,loopFocus:h,orientation:R,parentOrientation:"menubar"===Q.type?Q.context.orientation:void 0,rtl:"rtl"===eP,disabledIndices:m.EMPTY_ARRAY,onNavigate:eN,openOnArrowKeyDown:"context-menu"!==Q.type,externalTree:ed?G:void 0,focusItemOnHover:C}),eF=t.useCallback(e=>{_.context.typingRef.current=e},[_]),eB=(0,eb.useTypeahead)(eC,{enabled:!J,listRef:_.context.itemLabels,elementsRef:_.context.itemDomElements,activeIndex:Z,resetMs:et.TYPEAHEAD_RESET_MS,onMatch:e=>{Y&&e!==Z&&_.set("activeIndex",e)},onTyping:eF}),ej=t.useMemo(()=>{let e=(0,S.mergeProps)(eB.reference,eL.reference,ew.reference,{onMouseMove(){_.set("allowMouseEnter",!0)}},eg);return e["aria-haspopup"]="menu",e["aria-expanded"]=Y,e},[_,eB.reference,eL.reference,ew.reference,eg,Y]),eH=t.useMemo(()=>{let e=(0,S.mergeProps)(eL.trigger,ew.trigger,eg);return e["aria-haspopup"]="menu",e["aria-expanded"]=!1,e},[eL.trigger,ew.trigger,eg]);(0,ef.useRefWithInit)(()=>(_.update({inactiveTriggerProps:eH}),null));let eU=t.useMemo(()=>(0,S.mergeProps)(eA.FOCUSABLE_POPUP_PROPS,{id:L,role:"menu","aria-orientation":"horizontal"===R?"horizontal":void 0,"aria-labelledby":V?.id,onMouseMove(){_.set("allowMouseEnter",!0),"menu"===Q.type&&_.set("hoverEnabled",!1)},onClick(){_.select("hoverEnabled")&&_.set("hoverEnabled",!1)},onKeyDown(e){let t=_.select("keyboardEventRelay");t&&!e.isPropagationStopped()&&t(e)}},eB.floating,eL.floating,ew.floating),[V,L,R,Q.type,_,eB.floating,eL.floating,ew.floating]),e_=eL.item??m.EMPTY_OBJECT;(0,eA.usePopupInteractionProps)(_,{floatingRootContext:eC,activeTriggerProps:ej,inactiveTriggerProps:eH,popupProps:eU,itemProps:e_});let eG=t.useMemo(()=>({store:_,parent:N}),[_,N]),eK=(0,T.jsxs)(i.Provider,{value:eG,children:[E&&(0,T.jsx)(eA.PopupHandleAttachment,{handle:E,store:_}),"function"==typeof u?u({payload:ee}):u]});return void 0===Q.type||"context-menu"===Q.type?(0,T.jsx)(X.FloatingTree,{externalTree:G,children:eK}):eK});e.s(["MenuRoot",0,eL],63947),e.s(["MenuSubmenuRoot",0,function(e){let n=a().store,o=t.useMemo(()=>({parentMenu:n}),[n]);return(0,T.jsx)(eN.Provider,{value:o,children:(0,T.jsx)(eL,{...e})})}],277450)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,658679,t=>{"use strict";var e=t.i(419524),a=class{constructor(t){this.init=t,this.records=this.init()}static{(0,e.__name)(this,"ImperativeState")}reset(){this.records=this.init()}};t.s(["ImperativeState",0,a])},58137,t=>{"use strict";var e=t.i(60231),a=t.i(419524),r=t.i(
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,658679,t=>{"use strict";var e=t.i(419524),a=class{constructor(t){this.init=t,this.records=this.init()}static{(0,e.__name)(this,"ImperativeState")}reset(){this.records=this.init()}};t.s(["ImperativeState",0,a])},58137,t=>{"use strict";var e=t.i(60231),a=t.i(419524),r=t.i(779879);t.i(947716);var s=t.i(723685),i=(0,a.__name)((t,e)=>{let a=t.append("rect");if(a.attr("x",e.x),a.attr("y",e.y),a.attr("fill",e.fill),a.attr("stroke",e.stroke),a.attr("width",e.width),a.attr("height",e.height),e.name&&a.attr("name",e.name),e.rx&&a.attr("rx",e.rx),e.ry&&a.attr("ry",e.ry),void 0!==e.attrs)for(let t in e.attrs)a.attr(t,e.attrs[t]);return e.class&&a.attr("class",e.class),a},"drawRect"),l=(0,a.__name)((t,e)=>{i(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"}).lower()},"drawBackgroundRect"),n=(0,a.__name)((t,a)=>{let r=a.text.replace(e.lineBreakRegex," "),s=t.append("text");s.attr("x",a.x),s.attr("y",a.y),s.attr("class","legend"),s.style("text-anchor",a.anchor),a.class&&s.attr("class",a.class);let i=s.append("tspan");return i.attr("x",a.x+2*a.textMargin),i.text(r),s},"drawText"),d=(0,a.__name)((t,e,a,s)=>{let i=t.append("image");i.attr("x",e),i.attr("y",a);let l=(0,r.sanitizeUrl)(s);i.attr("xlink:href",l)},"drawImage"),o=(0,a.__name)((t,e,a,s)=>{let i=t.append("use");i.attr("x",e),i.attr("y",a);let l=(0,r.sanitizeUrl)(s);i.attr("xlink:href",`#${l}`)},"drawEmbeddedImage"),c=(0,a.__name)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),x=(0,a.__name)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),p=(0,a.__name)(()=>{let t=(0,s.select)(".mermaidTooltip");return t.empty()&&(t=(0,s.select)("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip");t.s(["createTooltip",0,p,"drawBackgroundRect",0,l,"drawEmbeddedImage",0,o,"drawImage",0,d,"drawRect",0,i,"drawText",0,n,"getNoteRect",0,c,"getTextObj",0,x])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,107941,e=>{"use strict";var t=e.i(843476),n=e.i(24071),i=e.i(867927),s=e.i(482022),r=e.i(829600),a=e.i(456420);let o={name:"file-code-corner",size:24,node:[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],aliases:["file-code-2"]};o.node;let l=(0,a.default)(o);var d=e.i(905015),c=e.i(226091),u=e.i(726067),x=e.i(569644),m=e.i(815170),f=e.i(51921);let h={name:"sheet",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]};h.node;let p=(0,a.default)(h);var g=e.i(759659);let v={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};v.node;let y=(0,a.default)(v);var k=e.i(271645),j=e.i(798120),b=e.i(167881),w=e.i(917162),N=e.i(41533),S=e.i(895836),F=e.i(621285),A=e.i(317567),C=e.i(95187);let R=(0,C.createServerReference)("7f621cca3daf8c0930d78dcfd588de1da610762acd",C.callServer,void 0,C.findSourceMapURL,"emptyScratchAction");var z=e.i(428817),$=e.i(245629),E=e.i(609856),M=e.i(283653),O=e.i(647163);let P={markdown:c.FileText,csv:p,json:d.FileJson,text:c.FileText,frame:l,image:m.Image,audio:f.Music,video:y,none:r.File};function W({label:e,rows:n,children:i}){return 0===n.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"px-3 pt-3 pb-1 font-mono text-[10px] text-muted-foreground/60",children:e}),i]})}function B({entry:e,active:n,onPick:s}){let r="dir"===e.kind?u.Folder:P[e.view];return(0,t.jsxs)("button",{type:"button",onClick:s,title:"file"===e.kind?`${e.name} \xb7 ${(0,$.shortAgo)(e.at)}`:e.name,className:(0,O.cn)("mx-2 flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",n?"bg-secondary font-medium text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[(0,t.jsx)(r,{className:"size-3.5 shrink-0 opacity-70"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.name}),"file"===e.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/75",children:(0,O.formatBytes)(e.bytes)}),(0,t.jsx)("span",{className:"w-3.5 shrink-0"})]}):(0,t.jsx)(i.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]})}function K({empty:e,onReveal:n}){return(0,t.jsxs)("div",{className:"space-y-4 p-8",children:[e?(0,t.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:["Nothing here yet. What a bot writes during a call lands in"," ",(0,t.jsx)("span",{className:"font-mono text-[13px] text-foreground",children:"artifacts/"})," ","— a page, a table, a picture — and shows up here to open."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Pick a file on the left."}),(0,t.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:"Only what the app can open is listed — a page, a table, a picture, a note. Installed packages and tool leftovers are left out, and no folder is measured, so a folder opens as fast as it lists. Reveal folder for everything else."})]}),(0,t.jsxs)(b.Button,{variant:"outline",onClick:n,children:[(0,t.jsx)(x.FolderOpen,{}),"Reveal folder"]})]})}function L({file:e,onGone:n}){let i=e.path,[r]=(0,E.useServerAction)(z.openFileAction),[a,o]=(0,E.useServerAction)(A.deleteWorkspaceFileAction,{okMessage:"File deleted",onOk:()=>{(0,M.revalidate)(j.queryKey.workspace),n()}}),l=async()=>{await w.notify.confirm({title:`Delete ${i.split("/").pop()}?`,description:"It is deleted from disk for good.",okText:"Delete",destructive:!0})&&a(i)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-b border-border/60 px-6 py-2",children:[(0,t.jsx)(T,{path:i}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:[(0,O.formatBytes)(e.bytes)," · ",(0,$.shortAgo)(e.at)]}),(0,t.jsx)("a",{href:j.queryKey.fileView(i),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(s.ExternalLink,{className:"size-4"})}),(0,t.jsx)(b.Button,{size:"icon-sm",variant:"ghost","aria-label":"Reveal in the file manager",className:"text-muted-foreground",onClick:()=>r(i),children:(0,t.jsx)(x.FolderOpen,{})}),(0,t.jsx)(b.Button,{size:"icon-sm",variant:"ghost","aria-label":"Delete",loading:o,className:"text-muted-foreground",onClick:l,children:(0,t.jsx)(g.Trash2,{})})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:(0,t.jsx)(F.FilePreview,{path:i,bytes:e.bytes})})]})}function T({path:e}){let n=["workspace",...e.split("/").filter(Boolean)];return(0,t.jsx)("span",{className:"flex min-w-0 flex-1 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:n.map((e,s)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[s>0&&(0,t.jsx)(i.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,t.jsx)("span",{className:(0,O.cn)("truncate",s===n.length-1&&"text-foreground"),children:e})]},`${s}-${e}`))})}e.s(["WorkspaceSetting",0,function(){let[e,i]=(0,k.useState)(""),[s,r]=(0,k.useState)(N.WORKSPACE_VIEW.rows),[a,o]=(0,k.useState)(null),[l,d]=(0,k.useState)(""),{data:c,isLoading:u,error:m}=(0,M.useServerRoute)(j.queryKey.workspaceFolder(e,s),{keepPreviousData:!0}),f=e=>{i(e),r(N.WORKSPACE_VIEW.rows)},[h,p]=(0,E.useServerAction)(R,{okMessage:"Scratch emptied",onOk:()=>(0,M.revalidate)(j.queryKey.workspace)}),[g]=(0,E.useServerAction)(z.openFileAction),v=async()=>{await w.notify.confirm({title:"Empty scratch?",description:"Everything under scratch/ is deleted for good. artifacts/ and projects/ are untouched.",okText:"Empty",destructive:!0})&&h()};if(u)return(0,t.jsx)(S.SettingPanesSkeleton,{});if(m)return(0,t.jsx)(S.SettingError,{message:m.message});let y=c?.entries??[],F=c?.total??0,A=l.trim().toLowerCase(),C=A?y.filter(e=>e.name.toLowerCase().includes(A)):y,$=C.filter(e=>"dir"===e.kind),O=C.filter(e=>"file"===e.kind),P=y.find(e=>"file"===e.kind&&e.path===a?.path)??a;return(0,t.jsx)(S.SettingPanes,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.SettingRailNote,{children:(0,t.jsxs)("span",{className:"font-mono",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:`.ai-workspace${e?`/${e}`:""}`}),` \xb7 ${function(e,t){let n=e.filter(e=>"dir"===e.kind).length,i=e.length-n,s=[n&&`${n} ${1===n?"folder":"folders"}`,i&&`${i} ${1===i?"file":"files"}`].filter(Boolean);if(!s.length)return"empty";let r=s.join(" · ");return t>e.length?`${r} of ${t.toLocaleString("en")}`:r}(y,F)}`]})}),(0,t.jsxs)(b.Button,{variant:"outline",size:"sm",onClick:()=>g(e||"."),children:[(0,t.jsx)(x.FolderOpen,{}),"Reveal folder"]}),(0,t.jsx)(b.Button,{variant:"outline",size:"sm",loading:p,onClick:v,className:"text-destructive hover:text-destructive",children:"Empty scratch"})]}),left:(0,t.jsxs)("div",{className:"flex flex-col py-2",children:[(0,t.jsx)(S.SettingFilter,{value:l,onChange:d,placeholder:"Filter this folder",className:"mx-2 mb-1.5 w-auto"}),e&&(0,t.jsxs)("button",{type:"button",onClick:()=>f(e.split("/").slice(0,-1).join("/")),className:"mx-2 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(n.ChevronLeft,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.split("/").slice(0,-1).pop()??"workspace"})]}),0===C.length?(0,t.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground/60",children:A?"Nothing matches":"Empty folder"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W,{label:"folders",rows:$,children:$.map(e=>(0,t.jsx)(B,{entry:e,onPick:()=>f(e.path)},e.path))}),(0,t.jsx)(W,{label:"files",rows:O,children:O.map(e=>(0,t.jsx)(B,{entry:e,active:e.path===a?.path,onPick:()=>"file"===e.kind&&o(e)},e.path))})]}),F>y.length&&(0,t.jsx)("button",{type:"button",onClick:()=>r(s+N.WORKSPACE_VIEW.rows),className:"mx-2 mt-2 rounded-md px-2 py-1.5 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:`Show ${Math.min(N.WORKSPACE_VIEW.rows,F-y.length)} more of ${F.toLocaleString("en")}`})]}),right:P?.kind==="file"?(0,t.jsx)(L,{file:P,onGone:()=>o(null)},P.path):(0,t.jsx)(K,{empty:!e&&0===y.length,onReveal:()=>g(".")})})}],107941)},317567,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f018e766e37c74d20596a96676bff15026135e01b",t.callServer,void 0,t.findSourceMapURL,"deleteWorkspaceFileAction");e.s(["deleteWorkspaceFileAction",0,n])},726067,e=>{"use strict";var t=e.i(456420);let n={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};n.node;let i=(0,t.default)(n);e.s(["Folder",0,i],726067)},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let i=(0,t.default)(n);e.s(["Trash2",0,i],759659)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58137,t=>{"use strict";var e=t.i(60231),a=t.i(419524),i=t.i(139941);t.i(947716);var n=t.i(723685),r=(0,a.__name)((t,e)=>{let a=t.append("rect");if(a.attr("x",e.x),a.attr("y",e.y),a.attr("fill",e.fill),a.attr("stroke",e.stroke),a.attr("width",e.width),a.attr("height",e.height),e.name&&a.attr("name",e.name),e.rx&&a.attr("rx",e.rx),e.ry&&a.attr("ry",e.ry),void 0!==e.attrs)for(let t in e.attrs)a.attr(t,e.attrs[t]);return e.class&&a.attr("class",e.class),a},"drawRect"),d=(0,a.__name)((t,e)=>{r(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"}).lower()},"drawBackgroundRect"),g=(0,a.__name)((t,a)=>{let i=a.text.replace(e.lineBreakRegex," "),n=t.append("text");n.attr("x",a.x),n.attr("y",a.y),n.attr("class","legend"),n.style("text-anchor",a.anchor),a.class&&n.attr("class",a.class);let r=n.append("tspan");return r.attr("x",a.x+2*a.textMargin),r.text(i),n},"drawText"),o=(0,a.__name)((t,e,a,n)=>{let r=t.append("image");r.attr("x",e),r.attr("y",a);let d=(0,i.sanitizeUrl)(n);r.attr("xlink:href",d)},"drawImage"),s=(0,a.__name)((t,e,a,n)=>{let r=t.append("use");r.attr("x",e),r.attr("y",a);let d=(0,i.sanitizeUrl)(n);r.attr("xlink:href",`#${d}`)},"drawEmbeddedImage"),l=(0,a.__name)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=(0,a.__name)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),h=(0,a.__name)(()=>{let t=(0,n.select)(".mermaidTooltip");return t.empty()&&(t=(0,n.select)("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip");t.s(["createTooltip",0,h,"drawBackgroundRect",0,d,"drawEmbeddedImage",0,s,"drawImage",0,o,"drawRect",0,r,"drawText",0,g,"getNoteRect",0,l,"getTextObj",0,p])},117204,t=>{"use strict";var e=t.i(60231),a=t.i(508324),i=t.i(419524),n=(0,i.__name)((t,i,n,g)=>{t.attr("class",n);let{width:o,height:s,x:l,y:p}=r(t,i);(0,e.configureSvgSize)(t,s,o,g);let h=d(l,p,o,s,i);t.attr("viewBox",h),a.log.debug(`viewBox configured: ${h} with padding: ${i}`)},"setupViewPortForSVG"),r=(0,i.__name)((t,e)=>{let a=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:a.width+2*e,height:a.height+2*e,x:a.x,y:a.y}},"calculateDimensionsWithPadding"),d=(0,i.__name)((t,e,a,i,n)=>`${t-n} ${e-n} ${a} ${i}`,"createViewBox");t.s(["setupViewPortForSVG",0,n])},248585,t=>{"use strict";var e=t.i(419524);t.i(947716);var a=t.i(723685),i=(0,e.__name)((t,e)=>{let i;return"sandbox"===e&&(i=(0,a.select)("#i"+t)),("sandbox"===e?(0,a.select)(i.nodes()[0].contentDocument.body):(0,a.select)("body")).select(`[id="${t}"]`)},"getDiagramElement");t.s(["getDiagramElement",0,i])},757018,t=>{"use strict";var e,a=t.i(904873);t.i(248585),t.i(117204),t.i(121292),t.i(58137),t.i(369110),t.i(382793),t.i(502056),t.i(217248),t.i(224797),t.i(836333),t.i(29836);var i=t.i(447804),n=t.i(60231),r=t.i(508324),d=t.i(419524);t.i(947716);var g=t.i(723685);t.i(461696);var o=t.i(915888);t.i(566661);var s=t.i(704642),l=t.i(785833),p=t.i(600104),h=(0,d.__name)(t=>t.append("circle").attr("class","start-state").attr("r",(0,n.getConfig2)().state.sizeUnit).attr("cx",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit).attr("cy",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit),"drawStartState"),f=(0,d.__name)(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",(0,n.getConfig2)().state.textHeight).attr("class","divider").attr("x2",2*(0,n.getConfig2)().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),c=(0,d.__name)((t,e)=>{let a=t.append("text").attr("x",2*(0,n.getConfig2)().state.padding).attr("y",(0,n.getConfig2)().state.textHeight+2*(0,n.getConfig2)().state.padding).attr("font-size",(0,n.getConfig2)().state.fontSize).attr("class","state-title").text(e.id),i=a.node().getBBox();return t.insert("rect",":first-child").attr("x",(0,n.getConfig2)().state.padding).attr("y",(0,n.getConfig2)().state.padding).attr("width",i.width+2*(0,n.getConfig2)().state.padding).attr("height",i.height+2*(0,n.getConfig2)().state.padding).attr("rx",(0,n.getConfig2)().state.radius),a},"drawSimpleState"),x=(0,d.__name)((t,e)=>{let a=(0,d.__name)(function(t,e,a){let i=t.append("tspan").attr("x",2*(0,n.getConfig2)().state.padding).text(e);a||i.attr("dy",(0,n.getConfig2)().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*(0,n.getConfig2)().state.padding).attr("y",(0,n.getConfig2)().state.textHeight+1.3*(0,n.getConfig2)().state.padding).attr("font-size",(0,n.getConfig2)().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),r=i.height,g=t.append("text").attr("x",(0,n.getConfig2)().state.padding).attr("y",r+.4*(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.dividerMargin+(0,n.getConfig2)().state.textHeight).attr("class","state-description"),o=!0,s=!0;e.descriptions.forEach(function(t){o||(a(g,t,s),s=!1),o=!1});let l=t.append("line").attr("x1",(0,n.getConfig2)().state.padding).attr("y1",(0,n.getConfig2)().state.padding+r+(0,n.getConfig2)().state.dividerMargin/2).attr("y2",(0,n.getConfig2)().state.padding+r+(0,n.getConfig2)().state.dividerMargin/2).attr("class","descr-divider"),p=g.node().getBBox(),h=Math.max(p.width,i.width);return l.attr("x2",h+3*(0,n.getConfig2)().state.padding),t.insert("rect",":first-child").attr("x",(0,n.getConfig2)().state.padding).attr("y",(0,n.getConfig2)().state.padding).attr("width",h+2*(0,n.getConfig2)().state.padding).attr("height",p.height+r+2*(0,n.getConfig2)().state.padding).attr("rx",(0,n.getConfig2)().state.radius),t},"drawDescrState"),u=(0,d.__name)((t,e,a)=>{let i,r=(0,n.getConfig2)().state.padding,d=2*(0,n.getConfig2)().state.padding,g=t.node().getBBox(),o=g.width,s=g.x,l=t.append("text").attr("x",0).attr("y",(0,n.getConfig2)().state.titleShift).attr("font-size",(0,n.getConfig2)().state.fontSize).attr("class","state-title").text(e.id),p=l.node().getBBox().width+d,h=Math.max(p,o);h===o&&(h+=d);let f=t.node().getBBox();e.doc,i=s-r,p>o&&(i=(o-h)/2+r),Math.abs(s-f.x)<r&&p>o&&(i=s-(p-o)/2);let c=1-(0,n.getConfig2)().state.textHeight;return t.insert("rect",":first-child").attr("x",i).attr("y",c).attr("class",a?"alt-composit":"composit").attr("width",h).attr("height",f.height+(0,n.getConfig2)().state.textHeight+(0,n.getConfig2)().state.titleShift+1).attr("rx","0"),l.attr("x",i+r),p<=o&&l.attr("x",s+(h-d)/2-p/2+r),t.insert("rect",":first-child").attr("x",i).attr("y",(0,n.getConfig2)().state.titleShift-(0,n.getConfig2)().state.textHeight-(0,n.getConfig2)().state.padding).attr("width",h).attr("height",3*(0,n.getConfig2)().state.textHeight).attr("rx",(0,n.getConfig2)().state.radius),t.insert("rect",":first-child").attr("x",i).attr("y",(0,n.getConfig2)().state.titleShift-(0,n.getConfig2)().state.textHeight-(0,n.getConfig2)().state.padding).attr("width",h).attr("height",f.height+3+2*(0,n.getConfig2)().state.textHeight).attr("rx",(0,n.getConfig2)().state.radius),t},"addTitleAndBox"),y=(0,d.__name)(t=>(t.append("circle").attr("class","end-state-outer").attr("r",(0,n.getConfig2)().state.sizeUnit+(0,n.getConfig2)().state.miniPadding).attr("cx",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit+(0,n.getConfig2)().state.miniPadding).attr("cy",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit+(0,n.getConfig2)().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",(0,n.getConfig2)().state.sizeUnit).attr("cx",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit+2).attr("cy",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit+2)),"drawEndState"),m=(0,d.__name)((t,e)=>{let a=(0,n.getConfig2)().state.forkWidth,i=(0,n.getConfig2)().state.forkHeight;if(e.parentId){let t=a;a=i,i=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",a).attr("height",i).attr("x",(0,n.getConfig2)().state.padding).attr("y",(0,n.getConfig2)().state.padding)},"drawForkJoinState"),C=(0,d.__name)((t,e,a,i)=>{let r=0,d=i.append("text");d.style("text-anchor","start"),d.attr("class","noteText");let g=t.replace(/\r\n/g,"<br/>"),o=(g=g.replace(/\n/g,"<br/>")).split(n.common_default.lineBreakRegex),s=1.25*(0,n.getConfig2)().state.noteMargin;for(let t of o){let i=t.trim();if(i.length>0){let t=d.append("tspan");t.text(i),0===s&&(s+=t.node().getBBox().height),r+=s,t.attr("x",e+(0,n.getConfig2)().state.noteMargin),t.attr("y",a+r+1.25*(0,n.getConfig2)().state.noteMargin)}}return{textWidth:d.node().getBBox().width,textHeight:r}},"_drawLongText"),w=(0,d.__name)((t,e)=>{e.attr("class","state-note");let a=e.append("rect").attr("x",0).attr("y",(0,n.getConfig2)().state.padding),{textWidth:i,textHeight:r}=C(t,0,0,e.append("g"));return a.attr("height",r+2*(0,n.getConfig2)().state.noteMargin),a.attr("width",i+2*(0,n.getConfig2)().state.noteMargin),a},"drawNote"),_=(0,d.__name)(function(t,e){let a=e.id,i={id:a,label:e.id,width:0,height:0},r=t.append("g").attr("id",a).attr("class","stateGroup");"start"===e.type&&h(r),"end"===e.type&&y(r),("fork"===e.type||"join"===e.type)&&m(r,e),"note"===e.type&&w(e.note.text,r),"divider"===e.type&&f(r),"default"===e.type&&0===e.descriptions.length&&c(r,e),"default"===e.type&&e.descriptions.length>0&&x(r,e);let d=r.node().getBBox();return i.width=d.width+2*(0,n.getConfig2)().state.padding,i.height=d.height+2*(0,n.getConfig2)().state.padding,i},"drawState"),b=0,B=(0,d.__name)(function(t,e,g){let o=(0,d.__name)(function(t){switch(t){case a.StateDB.relationType.AGGREGATION:return"aggregation";case a.StateDB.relationType.EXTENSION:return"extension";case a.StateDB.relationType.COMPOSITION:return"composition";case a.StateDB.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(t=>!Number.isNaN(t.y));let s=e.points,h=(0,l.line)().x(function(t){return t.x}).y(function(t){return t.y}).curve(p.curveBasis),f=t.append("path").attr("d",h(s)).attr("id","edge"+b).attr("class","transition"),c="";if((0,n.getConfig2)().state.arrowMarkerAbsolute&&(c=(0,n.getUrl)(!0)),f.attr("marker-end","url("+c+"#"+o(a.StateDB.relationType.DEPENDENCY)+"End)"),void 0!==g.title){let a=t.append("g").attr("class","stateLabel"),{x:d,y:o}=i.utils_default.calcLabelPosition(e.points),s=n.common_default.getRows(g.title),l=0,p=[],h=0,f=0;for(let t=0;t<=s.length;t++){let e=a.append("text").attr("text-anchor","middle").text(s[t]).attr("x",d).attr("y",o+l),i=e.node().getBBox();h=Math.max(h,i.width),f=Math.min(f,i.x),r.log.info(i.x,d,o+l),0===l&&(l=e.node().getBBox().height,r.log.info("Title height",l,o)),p.push(e)}let c=l*s.length;if(s.length>1){let t=(s.length-1)*l*.5;p.forEach((e,a)=>e.attr("y",o+a*l-t)),c=l*s.length}let x=a.node().getBBox();a.insert("rect",":first-child").attr("class","box").attr("x",d-h/2-(0,n.getConfig2)().state.padding/2).attr("y",o-c/2-(0,n.getConfig2)().state.padding/2-3.5).attr("width",h+(0,n.getConfig2)().state.padding).attr("height",c+(0,n.getConfig2)().state.padding),r.log.info(x)}b++},"drawEdge"),S={},k=(0,d.__name)(function(){},"setConf"),v=(0,d.__name)(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),E=(0,d.__name)(function(t,a,i,d){let o;e=(0,n.getConfig2)().state;let s=(0,n.getConfig2)().securityLevel;"sandbox"===s&&(o=(0,g.select)("#i"+a));let l="sandbox"===s?(0,g.select)(o.nodes()[0].contentDocument.body):(0,g.select)("body"),p="sandbox"===s?o.nodes()[0].contentDocument:document;r.log.debug("Rendering diagram "+t);let h=l.select(`[id='${a}']`);v(h),T(d.db.getRootDoc(),h.append("g").attr("id",a+"-root"),void 0,!1,l,p,d);let f=e.padding,c=h.node().getBBox(),x=c.width+2*f,u=c.height+2*f;(0,n.configureSvgSize)(h,u,1.75*x,e.useMaxWidth),h.attr("viewBox",`${c.x-e.padding} ${c.y-e.padding} `+x+" "+u)},"draw"),N=(0,d.__name)(t=>t?t.length*e.fontSizeFactor:1,"getLabelWidth"),T=(0,d.__name)((t,a,i,d,g,l,p)=>{let h,f=new s.Graph({compound:!0,multigraph:!0}),c=!0;for(h=0;h<t.length;h++)if("relation"===t[h].stmt){c=!1;break}i?f.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:c?1:e.edgeLengthFactor,nodeSep:c?1:50,isMultiGraph:!0}):f.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:c?1:e.edgeLengthFactor,nodeSep:c?1:50,ranker:"tight-tree",isMultiGraph:!0}),f.setDefaultEdgeLabel(function(){return{}});let x=p.db.getStates(),y=p.db.getRelations();for(let t of Object.keys(x)){let n,r=x[t];if(i&&(r.parentId=i),r.doc){let t=a.append("g").attr("id",r.id).attr("class","stateGroup");n=T(r.doc,t,r.id,!d,g,l,p);{let a=(t=u(t,r,d)).node().getBBox();n.width=a.width,n.height=a.height+e.padding/2,S[r.id]={y:e.compositTitleSize}}}else n=_(a,r,f);if(r.note){let t=_(a,{descriptions:[],id:r.id+"-note",note:r.note,type:"note"},f);"left of"===r.note.position?(f.setNode(n.id+"-note",t),f.setNode(n.id,n)):(f.setNode(n.id,n),f.setNode(n.id+"-note",t)),f.setParent(n.id,n.id+"-group"),f.setParent(n.id+"-note",n.id+"-group")}else f.setNode(n.id,n)}r.log.debug("Count=",f.nodeCount(),f);let m=0;y.forEach(function(t){m++,r.log.debug("Setting edge",t),f.setEdge(t.id1,t.id2,{relation:t,width:N(t.title),height:e.labelHeight*n.common_default.getRows(t.title).length,labelpos:"c"},"id"+m)}),(0,o.layout)(f),r.log.debug("Graph after layout",f.nodes());let C=a.node();f.nodes().forEach(function(t){void 0!==t&&void 0!==f.node(t)?(r.log.warn("Node "+t+": "+JSON.stringify(f.node(t))),g.select("#"+C.id+" #"+t).attr("transform","translate("+(f.node(t).x-f.node(t).width/2)+","+(f.node(t).y+(S[t]?S[t].y:0)-f.node(t).height/2)+" )"),g.select("#"+C.id+" #"+t).attr("data-x-shift",f.node(t).x-f.node(t).width/2),l.querySelectorAll("#"+C.id+" #"+t+" .divider").forEach(t=>{let e=t.parentElement,a=0,i=0;e&&(e.parentElement&&(a=e.parentElement.getBBox().width),Number.isNaN(i=parseInt(e.getAttribute("data-x-shift"),10))&&(i=0)),t.setAttribute("x1",0-i+8),t.setAttribute("x2",a-i-8)})):r.log.debug("No Node "+t+": "+JSON.stringify(f.node(t)))});let w=C.getBBox();f.edges().forEach(function(t){void 0!==t&&void 0!==f.edge(t)&&(r.log.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(f.edge(t))),B(a,f.edge(t),f.edge(t).relation))});let b={id:i||"root",label:i||"root",width:0,height:0};return b.width=(w=C.getBBox()).width+2*e.padding,b.height=w.height+2*e.padding,r.log.debug("Doc rendered",b,f),b},"renderDoc"),D={parser:a.stateDiagram_default,get db(){return new a.StateDB(1)},renderer:{setConf:k,draw:E},styles:a.styles_default,init:(0,d.__name)(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};t.s(["diagram",0,D])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58137,t=>{"use strict";var e=t.i(60231),a=t.i(419524),i=t.i(779879);t.i(947716);var n=t.i(723685),r=(0,a.__name)((t,e)=>{let a=t.append("rect");if(a.attr("x",e.x),a.attr("y",e.y),a.attr("fill",e.fill),a.attr("stroke",e.stroke),a.attr("width",e.width),a.attr("height",e.height),e.name&&a.attr("name",e.name),e.rx&&a.attr("rx",e.rx),e.ry&&a.attr("ry",e.ry),void 0!==e.attrs)for(let t in e.attrs)a.attr(t,e.attrs[t]);return e.class&&a.attr("class",e.class),a},"drawRect"),d=(0,a.__name)((t,e)=>{r(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"}).lower()},"drawBackgroundRect"),g=(0,a.__name)((t,a)=>{let i=a.text.replace(e.lineBreakRegex," "),n=t.append("text");n.attr("x",a.x),n.attr("y",a.y),n.attr("class","legend"),n.style("text-anchor",a.anchor),a.class&&n.attr("class",a.class);let r=n.append("tspan");return r.attr("x",a.x+2*a.textMargin),r.text(i),n},"drawText"),o=(0,a.__name)((t,e,a,n)=>{let r=t.append("image");r.attr("x",e),r.attr("y",a);let d=(0,i.sanitizeUrl)(n);r.attr("xlink:href",d)},"drawImage"),s=(0,a.__name)((t,e,a,n)=>{let r=t.append("use");r.attr("x",e),r.attr("y",a);let d=(0,i.sanitizeUrl)(n);r.attr("xlink:href",`#${d}`)},"drawEmbeddedImage"),l=(0,a.__name)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=(0,a.__name)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),h=(0,a.__name)(()=>{let t=(0,n.select)(".mermaidTooltip");return t.empty()&&(t=(0,n.select)("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip");t.s(["createTooltip",0,h,"drawBackgroundRect",0,d,"drawEmbeddedImage",0,s,"drawImage",0,o,"drawRect",0,r,"drawText",0,g,"getNoteRect",0,l,"getTextObj",0,p])},117204,t=>{"use strict";var e=t.i(60231),a=t.i(508324),i=t.i(419524),n=(0,i.__name)((t,i,n,g)=>{t.attr("class",n);let{width:o,height:s,x:l,y:p}=r(t,i);(0,e.configureSvgSize)(t,s,o,g);let h=d(l,p,o,s,i);t.attr("viewBox",h),a.log.debug(`viewBox configured: ${h} with padding: ${i}`)},"setupViewPortForSVG"),r=(0,i.__name)((t,e)=>{let a=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:a.width+2*e,height:a.height+2*e,x:a.x,y:a.y}},"calculateDimensionsWithPadding"),d=(0,i.__name)((t,e,a,i,n)=>`${t-n} ${e-n} ${a} ${i}`,"createViewBox");t.s(["setupViewPortForSVG",0,n])},248585,t=>{"use strict";var e=t.i(419524);t.i(947716);var a=t.i(723685),i=(0,e.__name)((t,e)=>{let i;return"sandbox"===e&&(i=(0,a.select)("#i"+t)),("sandbox"===e?(0,a.select)(i.nodes()[0].contentDocument.body):(0,a.select)("body")).select(`[id="${t}"]`)},"getDiagramElement");t.s(["getDiagramElement",0,i])},757018,t=>{"use strict";var e,a=t.i(904873);t.i(248585),t.i(117204),t.i(121292),t.i(58137),t.i(369110),t.i(382793),t.i(502056),t.i(217248),t.i(224797),t.i(836333),t.i(29836);var i=t.i(447804),n=t.i(60231),r=t.i(508324),d=t.i(419524);t.i(947716);var g=t.i(723685);t.i(461696);var o=t.i(915888);t.i(566661);var s=t.i(704642),l=t.i(785833),p=t.i(600104),h=(0,d.__name)(t=>t.append("circle").attr("class","start-state").attr("r",(0,n.getConfig2)().state.sizeUnit).attr("cx",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit).attr("cy",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit),"drawStartState"),f=(0,d.__name)(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",(0,n.getConfig2)().state.textHeight).attr("class","divider").attr("x2",2*(0,n.getConfig2)().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),c=(0,d.__name)((t,e)=>{let a=t.append("text").attr("x",2*(0,n.getConfig2)().state.padding).attr("y",(0,n.getConfig2)().state.textHeight+2*(0,n.getConfig2)().state.padding).attr("font-size",(0,n.getConfig2)().state.fontSize).attr("class","state-title").text(e.id),i=a.node().getBBox();return t.insert("rect",":first-child").attr("x",(0,n.getConfig2)().state.padding).attr("y",(0,n.getConfig2)().state.padding).attr("width",i.width+2*(0,n.getConfig2)().state.padding).attr("height",i.height+2*(0,n.getConfig2)().state.padding).attr("rx",(0,n.getConfig2)().state.radius),a},"drawSimpleState"),x=(0,d.__name)((t,e)=>{let a=(0,d.__name)(function(t,e,a){let i=t.append("tspan").attr("x",2*(0,n.getConfig2)().state.padding).text(e);a||i.attr("dy",(0,n.getConfig2)().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*(0,n.getConfig2)().state.padding).attr("y",(0,n.getConfig2)().state.textHeight+1.3*(0,n.getConfig2)().state.padding).attr("font-size",(0,n.getConfig2)().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),r=i.height,g=t.append("text").attr("x",(0,n.getConfig2)().state.padding).attr("y",r+.4*(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.dividerMargin+(0,n.getConfig2)().state.textHeight).attr("class","state-description"),o=!0,s=!0;e.descriptions.forEach(function(t){o||(a(g,t,s),s=!1),o=!1});let l=t.append("line").attr("x1",(0,n.getConfig2)().state.padding).attr("y1",(0,n.getConfig2)().state.padding+r+(0,n.getConfig2)().state.dividerMargin/2).attr("y2",(0,n.getConfig2)().state.padding+r+(0,n.getConfig2)().state.dividerMargin/2).attr("class","descr-divider"),p=g.node().getBBox(),h=Math.max(p.width,i.width);return l.attr("x2",h+3*(0,n.getConfig2)().state.padding),t.insert("rect",":first-child").attr("x",(0,n.getConfig2)().state.padding).attr("y",(0,n.getConfig2)().state.padding).attr("width",h+2*(0,n.getConfig2)().state.padding).attr("height",p.height+r+2*(0,n.getConfig2)().state.padding).attr("rx",(0,n.getConfig2)().state.radius),t},"drawDescrState"),u=(0,d.__name)((t,e,a)=>{let i,r=(0,n.getConfig2)().state.padding,d=2*(0,n.getConfig2)().state.padding,g=t.node().getBBox(),o=g.width,s=g.x,l=t.append("text").attr("x",0).attr("y",(0,n.getConfig2)().state.titleShift).attr("font-size",(0,n.getConfig2)().state.fontSize).attr("class","state-title").text(e.id),p=l.node().getBBox().width+d,h=Math.max(p,o);h===o&&(h+=d);let f=t.node().getBBox();e.doc,i=s-r,p>o&&(i=(o-h)/2+r),Math.abs(s-f.x)<r&&p>o&&(i=s-(p-o)/2);let c=1-(0,n.getConfig2)().state.textHeight;return t.insert("rect",":first-child").attr("x",i).attr("y",c).attr("class",a?"alt-composit":"composit").attr("width",h).attr("height",f.height+(0,n.getConfig2)().state.textHeight+(0,n.getConfig2)().state.titleShift+1).attr("rx","0"),l.attr("x",i+r),p<=o&&l.attr("x",s+(h-d)/2-p/2+r),t.insert("rect",":first-child").attr("x",i).attr("y",(0,n.getConfig2)().state.titleShift-(0,n.getConfig2)().state.textHeight-(0,n.getConfig2)().state.padding).attr("width",h).attr("height",3*(0,n.getConfig2)().state.textHeight).attr("rx",(0,n.getConfig2)().state.radius),t.insert("rect",":first-child").attr("x",i).attr("y",(0,n.getConfig2)().state.titleShift-(0,n.getConfig2)().state.textHeight-(0,n.getConfig2)().state.padding).attr("width",h).attr("height",f.height+3+2*(0,n.getConfig2)().state.textHeight).attr("rx",(0,n.getConfig2)().state.radius),t},"addTitleAndBox"),y=(0,d.__name)(t=>(t.append("circle").attr("class","end-state-outer").attr("r",(0,n.getConfig2)().state.sizeUnit+(0,n.getConfig2)().state.miniPadding).attr("cx",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit+(0,n.getConfig2)().state.miniPadding).attr("cy",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit+(0,n.getConfig2)().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",(0,n.getConfig2)().state.sizeUnit).attr("cx",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit+2).attr("cy",(0,n.getConfig2)().state.padding+(0,n.getConfig2)().state.sizeUnit+2)),"drawEndState"),m=(0,d.__name)((t,e)=>{let a=(0,n.getConfig2)().state.forkWidth,i=(0,n.getConfig2)().state.forkHeight;if(e.parentId){let t=a;a=i,i=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",a).attr("height",i).attr("x",(0,n.getConfig2)().state.padding).attr("y",(0,n.getConfig2)().state.padding)},"drawForkJoinState"),C=(0,d.__name)((t,e,a,i)=>{let r=0,d=i.append("text");d.style("text-anchor","start"),d.attr("class","noteText");let g=t.replace(/\r\n/g,"<br/>"),o=(g=g.replace(/\n/g,"<br/>")).split(n.common_default.lineBreakRegex),s=1.25*(0,n.getConfig2)().state.noteMargin;for(let t of o){let i=t.trim();if(i.length>0){let t=d.append("tspan");t.text(i),0===s&&(s+=t.node().getBBox().height),r+=s,t.attr("x",e+(0,n.getConfig2)().state.noteMargin),t.attr("y",a+r+1.25*(0,n.getConfig2)().state.noteMargin)}}return{textWidth:d.node().getBBox().width,textHeight:r}},"_drawLongText"),w=(0,d.__name)((t,e)=>{e.attr("class","state-note");let a=e.append("rect").attr("x",0).attr("y",(0,n.getConfig2)().state.padding),{textWidth:i,textHeight:r}=C(t,0,0,e.append("g"));return a.attr("height",r+2*(0,n.getConfig2)().state.noteMargin),a.attr("width",i+2*(0,n.getConfig2)().state.noteMargin),a},"drawNote"),_=(0,d.__name)(function(t,e){let a=e.id,i={id:a,label:e.id,width:0,height:0},r=t.append("g").attr("id",a).attr("class","stateGroup");"start"===e.type&&h(r),"end"===e.type&&y(r),("fork"===e.type||"join"===e.type)&&m(r,e),"note"===e.type&&w(e.note.text,r),"divider"===e.type&&f(r),"default"===e.type&&0===e.descriptions.length&&c(r,e),"default"===e.type&&e.descriptions.length>0&&x(r,e);let d=r.node().getBBox();return i.width=d.width+2*(0,n.getConfig2)().state.padding,i.height=d.height+2*(0,n.getConfig2)().state.padding,i},"drawState"),b=0,B=(0,d.__name)(function(t,e,g){let o=(0,d.__name)(function(t){switch(t){case a.StateDB.relationType.AGGREGATION:return"aggregation";case a.StateDB.relationType.EXTENSION:return"extension";case a.StateDB.relationType.COMPOSITION:return"composition";case a.StateDB.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(t=>!Number.isNaN(t.y));let s=e.points,h=(0,l.line)().x(function(t){return t.x}).y(function(t){return t.y}).curve(p.curveBasis),f=t.append("path").attr("d",h(s)).attr("id","edge"+b).attr("class","transition"),c="";if((0,n.getConfig2)().state.arrowMarkerAbsolute&&(c=(0,n.getUrl)(!0)),f.attr("marker-end","url("+c+"#"+o(a.StateDB.relationType.DEPENDENCY)+"End)"),void 0!==g.title){let a=t.append("g").attr("class","stateLabel"),{x:d,y:o}=i.utils_default.calcLabelPosition(e.points),s=n.common_default.getRows(g.title),l=0,p=[],h=0,f=0;for(let t=0;t<=s.length;t++){let e=a.append("text").attr("text-anchor","middle").text(s[t]).attr("x",d).attr("y",o+l),i=e.node().getBBox();h=Math.max(h,i.width),f=Math.min(f,i.x),r.log.info(i.x,d,o+l),0===l&&(l=e.node().getBBox().height,r.log.info("Title height",l,o)),p.push(e)}let c=l*s.length;if(s.length>1){let t=(s.length-1)*l*.5;p.forEach((e,a)=>e.attr("y",o+a*l-t)),c=l*s.length}let x=a.node().getBBox();a.insert("rect",":first-child").attr("class","box").attr("x",d-h/2-(0,n.getConfig2)().state.padding/2).attr("y",o-c/2-(0,n.getConfig2)().state.padding/2-3.5).attr("width",h+(0,n.getConfig2)().state.padding).attr("height",c+(0,n.getConfig2)().state.padding),r.log.info(x)}b++},"drawEdge"),S={},k=(0,d.__name)(function(){},"setConf"),v=(0,d.__name)(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),E=(0,d.__name)(function(t,a,i,d){let o;e=(0,n.getConfig2)().state;let s=(0,n.getConfig2)().securityLevel;"sandbox"===s&&(o=(0,g.select)("#i"+a));let l="sandbox"===s?(0,g.select)(o.nodes()[0].contentDocument.body):(0,g.select)("body"),p="sandbox"===s?o.nodes()[0].contentDocument:document;r.log.debug("Rendering diagram "+t);let h=l.select(`[id='${a}']`);v(h),T(d.db.getRootDoc(),h.append("g").attr("id",a+"-root"),void 0,!1,l,p,d);let f=e.padding,c=h.node().getBBox(),x=c.width+2*f,u=c.height+2*f;(0,n.configureSvgSize)(h,u,1.75*x,e.useMaxWidth),h.attr("viewBox",`${c.x-e.padding} ${c.y-e.padding} `+x+" "+u)},"draw"),N=(0,d.__name)(t=>t?t.length*e.fontSizeFactor:1,"getLabelWidth"),T=(0,d.__name)((t,a,i,d,g,l,p)=>{let h,f=new s.Graph({compound:!0,multigraph:!0}),c=!0;for(h=0;h<t.length;h++)if("relation"===t[h].stmt){c=!1;break}i?f.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:c?1:e.edgeLengthFactor,nodeSep:c?1:50,isMultiGraph:!0}):f.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:c?1:e.edgeLengthFactor,nodeSep:c?1:50,ranker:"tight-tree",isMultiGraph:!0}),f.setDefaultEdgeLabel(function(){return{}});let x=p.db.getStates(),y=p.db.getRelations();for(let t of Object.keys(x)){let n,r=x[t];if(i&&(r.parentId=i),r.doc){let t=a.append("g").attr("id",r.id).attr("class","stateGroup");n=T(r.doc,t,r.id,!d,g,l,p);{let a=(t=u(t,r,d)).node().getBBox();n.width=a.width,n.height=a.height+e.padding/2,S[r.id]={y:e.compositTitleSize}}}else n=_(a,r,f);if(r.note){let t=_(a,{descriptions:[],id:r.id+"-note",note:r.note,type:"note"},f);"left of"===r.note.position?(f.setNode(n.id+"-note",t),f.setNode(n.id,n)):(f.setNode(n.id,n),f.setNode(n.id+"-note",t)),f.setParent(n.id,n.id+"-group"),f.setParent(n.id+"-note",n.id+"-group")}else f.setNode(n.id,n)}r.log.debug("Count=",f.nodeCount(),f);let m=0;y.forEach(function(t){m++,r.log.debug("Setting edge",t),f.setEdge(t.id1,t.id2,{relation:t,width:N(t.title),height:e.labelHeight*n.common_default.getRows(t.title).length,labelpos:"c"},"id"+m)}),(0,o.layout)(f),r.log.debug("Graph after layout",f.nodes());let C=a.node();f.nodes().forEach(function(t){void 0!==t&&void 0!==f.node(t)?(r.log.warn("Node "+t+": "+JSON.stringify(f.node(t))),g.select("#"+C.id+" #"+t).attr("transform","translate("+(f.node(t).x-f.node(t).width/2)+","+(f.node(t).y+(S[t]?S[t].y:0)-f.node(t).height/2)+" )"),g.select("#"+C.id+" #"+t).attr("data-x-shift",f.node(t).x-f.node(t).width/2),l.querySelectorAll("#"+C.id+" #"+t+" .divider").forEach(t=>{let e=t.parentElement,a=0,i=0;e&&(e.parentElement&&(a=e.parentElement.getBBox().width),Number.isNaN(i=parseInt(e.getAttribute("data-x-shift"),10))&&(i=0)),t.setAttribute("x1",0-i+8),t.setAttribute("x2",a-i-8)})):r.log.debug("No Node "+t+": "+JSON.stringify(f.node(t)))});let w=C.getBBox();f.edges().forEach(function(t){void 0!==t&&void 0!==f.edge(t)&&(r.log.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(f.edge(t))),B(a,f.edge(t),f.edge(t).relation))});let b={id:i||"root",label:i||"root",width:0,height:0};return b.width=(w=C.getBBox()).width+2*e.padding,b.height=w.height+2*e.padding,r.log.debug("Doc rendered",b,f),b},"renderDoc"),D={parser:a.stateDiagram_default,get db(){return new a.StateDB(1)},renderer:{setConf:k,draw:E},styles:a.styles_default,init:(0,d.__name)(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};t.s(["diagram",0,D])}]);
|