thursday-agent 0.8.0 → 0.9.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/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- 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 +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/probe/route.js.nft.json +1 -1
- package/.next/server/app/api/reach/route.js +11 -11
- package/.next/server/app/api/reach/route.js.nft.json +1 -1
- package/.next/server/app/api/routine/route.js +6 -6
- package/.next/server/app/api/routine/route.js.nft.json +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 +11 -11
- package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js +6 -6
- 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 +3 -3
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__012s2o8._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__04r4h-2._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0nmhgeo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1fy2g82._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1nmflqk._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1v7-zke._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1wnzmx9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1xv-5cq._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
- package/.next/server/chunks/_05v8k21._.js +1 -1
- package/.next/server/chunks/_0awtznl._.js +4 -4
- package/.next/server/chunks/_0k6qjcf._.js +1 -1
- package/.next/server/chunks/_0na2fj1._.js +5 -5
- package/.next/server/chunks/_0x-ej3f._.js +21 -21
- package/.next/server/chunks/_1dc_d1q._.js +22 -20
- package/.next/server/chunks/_1jc5g4p._.js +2 -2
- package/.next/server/chunks/_1jn-aep._.js +50 -48
- package/.next/server/chunks/{_1u8ygbz._.js → _1m88lkh._.js} +7 -7
- package/.next/server/chunks/_1uuucy-._.js +4 -4
- package/.next/server/chunks/_1v9r2ke._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__1h4bnrf._.js → [root-of-the-server]__0oo-wlv._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__1kyi568._.js → [root-of-the-server]__0tvavy9._.js} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0tzekbl._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0zuns7e._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1se25x0._.js +1 -1
- package/.next/server/chunks/ssr/{_1i3ddn7._.js → _05pl_u8._.js} +1 -1
- package/.next/server/chunks/ssr/_070nv1_._.js +3 -0
- package/.next/server/chunks/ssr/_097-ljd._.js +1 -1
- package/.next/server/chunks/ssr/_0dshsh4._.js +3 -0
- package/.next/server/chunks/ssr/_0fqhhwi._.js +1 -1
- package/.next/server/chunks/ssr/{_0z8jpch._.js → _0ital-2._.js} +2 -2
- package/.next/server/chunks/ssr/{_19g570d._.js → _0kjj5ts._.js} +3 -3
- package/.next/server/chunks/ssr/{_1nod5hh._.js → _0l_mcfz._.js} +2 -2
- package/.next/server/chunks/ssr/_0ld9_qq._.js +1 -1
- package/.next/server/chunks/ssr/_0ltz2q5._.js +3 -0
- package/.next/server/chunks/ssr/_0scf7xy._.js +3 -0
- package/.next/server/chunks/ssr/_0u5xv6g._.js +3 -0
- package/.next/server/chunks/ssr/{_0ewory0._.js → _0urj3mc._.js} +2 -2
- package/.next/server/chunks/ssr/{_0pm-2p-._.js → _1-zyvdb._.js} +2 -2
- package/.next/server/chunks/ssr/{_1_rqu8x._.js → _12mijol._.js} +7 -7
- package/.next/server/chunks/ssr/_15zqt-t._.js +1 -1
- package/.next/server/chunks/ssr/_184327j._.js +1 -1
- package/.next/server/chunks/ssr/{_1y-ea28._.js → _1a-nuxx._.js} +2 -2
- package/.next/server/chunks/ssr/_1alxym6._.js +3 -0
- package/.next/server/chunks/ssr/{_0hzz82u._.js → _1d423aj._.js} +25 -23
- package/.next/server/chunks/ssr/{_1u1mxu9._.js → _1flbs77._.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/{_1oijqjw._.js → _1tmu8z-._.js} +2 -2
- package/.next/server/chunks/ssr/{_10y6r1n._.js → _1uy0xom._.js} +3 -3
- package/.next/server/chunks/ssr/_1x-kojb._.js +20 -0
- package/.next/server/chunks/ssr/_1xoch6f._.js +1 -1
- package/.next/server/chunks/ssr/_1z74dmq._.js +164 -0
- package/.next/server/chunks/ssr/features_bot_1nr94ks._.js +3 -0
- package/.next/server/chunks/ssr/features_bot_1s_-2vj._.js +1 -1
- 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/{node_modules_111sh9o._.js → node_modules_03d0rfz._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0lg75qx._.js → node_modules_04_sbbc._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_10gbm2y._.js → node_modules_05ybmta._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1v9tc1c._.js → node_modules_068ws5v._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1_8mv4v._.js → node_modules_06bb4q8._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_01f8_se._.js → node_modules_07rs_p2._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0ii1l89._.js → node_modules_0dzm4um._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_20xmwtu._.js → node_modules_0jljel9._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1ix-g49._.js → node_modules_0sgy-dc._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0woscox._.js → node_modules_0t_ez6-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_059vtf2._.js → node_modules_0th357h._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_06w645b._.js → node_modules_0ubdtk-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0b8df3s._.js → node_modules_0uyh_vb._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_07ih6wb._.js → node_modules_0wnlddw._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0gt-uw9._.js → node_modules_0x630an._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1x825hz._.js → node_modules_0yvz9e0._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0t-44lj._.js → node_modules_12et8d5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1m3gb16._.js → node_modules_13kwejm._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1p9rdsy._.js → node_modules_1af3w91._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0sz5yg1._.js → node_modules_1bucjlk._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1teyzfa._.js → node_modules_1lkix61._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1lsyy7k._.js → node_modules_1ogczzz._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1-7qawg._.js → node_modules_1s-gb-1._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0yv-re6._.js → node_modules_1uwg-gz._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_03ptrl9._.js → node_modules_1wbkzl9._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_00jv9_3._.js → node_modules_1z1lrbk._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@base-ui_react_0jne69c._.js → node_modules_@base-ui_react_0buz1-j._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_00q1oa3._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0r443fh._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1-2_5z7._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_10wnlbk._.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/06nt9tatr-dug.js +1 -0
- package/.next/static/chunks/0_awn8tucznxc.js +1 -0
- package/.next/static/chunks/{34s52v8f841zo.js → 0ge-hx0ed83a1.js} +1 -1
- package/.next/static/chunks/0pda_vf-abwvx.js +1 -0
- package/.next/static/chunks/{2u9yjkpkoij75.js → 0qmd8n52hp-6v.js} +1 -1
- package/.next/static/chunks/0rowp9rx3qbxu.js +18 -0
- package/.next/static/chunks/{1ocy4w0v20a3v.js → 13ixzheqw7o-w.js} +2 -2
- package/.next/static/chunks/1grkt5gr8pbg1.js +17 -0
- package/.next/static/chunks/{21gf2t_whhurc.js → 1yugpvvi8qrbu.js} +2 -2
- package/.next/static/chunks/{1e4yrzs5evq_r.js → 245hb85nsy6j4.js} +1 -1
- package/.next/static/chunks/27lkanxvtdn09.js +1 -0
- package/.next/static/chunks/{0oz7a68qanm99.js → 27tvv1i-smrck.js} +1 -1
- package/.next/static/chunks/{2zhfdbq50ee5i.js → 2c64drdevdla3.js} +1 -1
- package/.next/static/chunks/{0k5tkt_qi52kb.js → 2ndw4w4u2x51r.js} +1 -1
- package/.next/static/chunks/37j27b3e1gt7r.js +1 -0
- package/.next/static/chunks/{2om4lkg86feb4.js → 38301ji-85i30.js} +1 -1
- package/.next/static/chunks/{09c13vnqy7al3.js → 3bbzsitgiltnt.js} +2 -2
- package/.next/static/chunks/3fec-aeteddr-.js +1 -0
- package/.next/static/chunks/3go3hwp1z2_h2.css +1 -0
- package/.next/static/chunks/3h2bun3hcggg8.js +1 -0
- package/.next/static/chunks/{0g1p98s2pfx2w.js → 3h2e-xv1zxh_f.js} +2 -2
- package/.next/static/chunks/3j1y335o95mj7.js +1 -0
- package/.next/static/chunks/3obf9n3cxj99k.js +1 -0
- package/.next/static/chunks/{2upc9mkcc3nlq.js → 427qsc6kahxyo.js} +1 -1
- package/README.md +31 -14
- package/bin/port.mjs +11 -7
- package/bin/thursday.mjs +1 -1
- package/components/ui/radio-group.tsx +2 -2
- package/components/ui/shiny-text.tsx +3 -22
- package/docs/how-it-works.md +11 -3
- package/docs/images/first-run.png +0 -0
- package/docs/images/keeps-going.png +0 -0
- package/docs/images/two-minds.png +0 -0
- package/features/ai/components/model-browser.tsx +1 -1
- package/features/ai/components/model-picker.tsx +1 -1
- package/features/ai/guide.ts +9 -4
- package/features/ai/prompts/bot.prompt.ts +4 -1
- package/features/ai/tools/routine.tool.ts +28 -16
- package/features/bot/bot.runner.ts +3 -1
- package/features/bot/components/bot-mark.tsx +6 -1
- package/features/bot/components/bot-setting.tsx +2 -4
- package/features/bot/components/bot-tool.tsx +2 -0
- package/features/bot/components/room-list.tsx +12 -3
- package/features/bot/components/room-pill.tsx +26 -19
- package/features/config/components/config-setting.tsx +17 -5
- package/features/config/components/voice-key.tsx +38 -18
- package/features/connectors/mcp.const.ts +90 -59
- package/features/intro/components/intro.tsx +50 -27
- package/features/routine/components/routine-mark.tsx +4 -6
- package/features/routine/components/routine-setting.tsx +332 -143
- package/features/routine/routine.query.ts +24 -3
- package/features/routine/routine.schema.ts +55 -4
- package/features/settings/components/install-app.tsx +1 -4
- package/features/settings/components/setting-ui.tsx +1 -1
- package/features/skills/skills.discover.ts +2 -1
- package/features/skills/skills.query.ts +5 -1
- package/features/skills/skills.schema.ts +2 -0
- package/features/thursday/components/ascii-orb.tsx +39 -10
- package/features/thursday/components/connect-wave.tsx +284 -0
- package/features/thursday/components/side-captions.tsx +29 -17
- package/features/thursday/components/thursday-setting.tsx +2 -2
- package/features/thursday/components/thursday.tsx +130 -58
- package/features/thursday/components/voice-picker.tsx +1 -1
- package/features/thursday/components/write-line.tsx +2 -2
- package/features/thursday/open-work.ts +11 -3
- package/features/thursday/tool-line.ts +94 -12
- package/features/thursday/use-text-call.ts +3 -2
- package/features/thursday/use-thursday.ts +5 -2
- package/features/workspace/components/artifact-view.tsx +129 -7
- package/guide/bots.md +17 -5
- package/guide/calls.md +15 -7
- package/guide/setup.md +10 -2
- package/lib/desktop-notify.ts +3 -2
- package/package.json +1 -1
- package/scripts/bot-context.test.mts +1 -1
- package/skills/computer/SKILL.md +1 -0
- package/skills/interactive-page/SKILL.md +4 -0
- package/.next/server/chunks/[root-of-the-server]__0n-l_n_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0wvo2of._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1e6aut3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ziojdq._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1srp8l5._.js +0 -3
- package/.next/server/chunks/ssr/_0mes4s0._.js +0 -3
- package/.next/server/chunks/ssr/_0ya0cb0._.js +0 -3
- package/.next/server/chunks/ssr/_0yto5s7._.js +0 -20
- package/.next/server/chunks/ssr/_10dw2nv._.js +0 -3
- package/.next/server/chunks/ssr/_1p0gxeo._.js +0 -164
- package/.next/server/chunks/ssr/_1r41yvh._.js +0 -3
- package/.next/server/chunks/ssr/_1r79ksv._.js +0 -3
- package/.next/server/chunks/ssr/features_bot_1ogjt52._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_@base-ui_react_0b3d4m9._.js +0 -3
- package/.next/static/chunks/03omwz_vi2ndg.js +0 -1
- package/.next/static/chunks/0_1bqgd6wt_og.js +0 -1
- package/.next/static/chunks/0abgkzikaznxc.js +0 -1
- package/.next/static/chunks/0bddkpash59-o.js +0 -17
- package/.next/static/chunks/0c2-bzhy3a0ib.js +0 -1
- package/.next/static/chunks/0iilfb1ocevnx.js +0 -1
- package/.next/static/chunks/0imbhx-j830a_.css +0 -1
- package/.next/static/chunks/24h1y9dhy3m_2.js +0 -1
- package/.next/static/chunks/2be08eqxsfc1y.js +0 -1
- package/.next/static/chunks/2d3yhjtafgmtw.js +0 -1
- package/.next/static/chunks/2f_5saocsko_b.js +0 -1
- package/.next/static/chunks/2lwbr5vx0ixaj.js +0 -18
- package/.next/static/chunks/44kjmi5h_p8px.js +0 -1
- /package/.next/static/{UiOMPYpQ4fqGyu5PzS-7j → u8kJqShUAa49vY7BxAWsw}/_buildManifest.js +0 -0
- /package/.next/static/{UiOMPYpQ4fqGyu5PzS-7j → u8kJqShUAa49vY7BxAWsw}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{UiOMPYpQ4fqGyu5PzS-7j → u8kJqShUAa49vY7BxAWsw}/_ssgManifest.js +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,302707,e=>{"use strict";var t=e.i(843476),n=e.i(375775),r=e.i(689664),i=e.i(24071),s=e.i(867927),a=e.i(638292),o=e.i(456420);let l={name:"volume-2",size:24,node:[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]};l.node;let u=(0,o.default)(l),c={name:"volume-x",size:24,node:[["path",{d:"M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z",key:"1p7khw"}],["path",{d:"m16.5 14.5 5-5",key:"cul3yw"}],["path",{d:"m16.5 9.5 5 5",key:"1akey5"}]]};c.node;let d=(0,o.default)(c);var h=e.i(618566),p=e.i(271645),f=e.i(798120),m=e.i(167881),g=e.i(660302),x=e.i(319036),y=e.i(146538),v=e.i(265402),b=e.i(463625),_=e.i(635963),w=e.i(747985),k=e.i(805995),j=e.i(616816),T=e.i(19146),S=e.i(439100),N=e.i(992112),C=e.i(218080);let E={hello:"Hi, I'm Thursday. One thing first: this is a recording. You'll hear my real voice on our first call.",key:"My real voice comes from OpenAI, and it needs a key — think of it as a password. Paste one in, and I wake up. Don't have one yet? No problem, skip ahead. I'll ask again later.",awake:"There we go — I'm awake. That key is all a call needs. The rest is quick: your microphone, who does the work for you, and what they think with.",mic:"Now let me hear you. Your browser will ask before it turns the microphone on. Say yes, then say anything — and watch the line under me move. It's only on during a call, unless you ask for more.",heard:"I hear you — that line is your voice. If you'd rather wake me by saying my name instead of tapping, switch that on here and give it a try.",bots:"Big jobs go to my helper bots, so you and I can keep talking while they work. They work right here on your computer, with a browser and your files. Signing in and paying always stay with you.",models:"Every bot runs on an A.I. model that you pick. Start small: a small one is fast and cheap, and you can move any bot up later. Your OpenAI key already covers it. A GPT subscription, or a Vercel key, opens up a lot more.",call:"That's everything. Call me, tell me what to call you, and ask for one thing — anything you'd ask someone sitting next to you. From here on, it's my real voice. I'll show you the rest as we go.",asleep:"I still don't have a voice of my own, so no calls yet — but everything else works. Have a look around. When you have a key, tap me, and I'll take it from there."},M=Array(C.SPECTRUM_BANDS).fill(0),O="thursday.intro.muted";var A=e.i(745747),R=e.i(333495),L=e.i(435135),I=e.i(692888),P=e.i(762074),D=e.i(114923),z=e.i(234916),F=e.i(67045),B=e.i(895499),$=e.i(656572),q=e.i(609856),U=e.i(283653),H=e.i(647163);let K=["key","mic","bots","models","call"];function Y({children:e}){return(0,t.jsxs)("p",{className:"text-[17px] leading-[1.675] tracking-[0.3px]",children:[(0,t.jsx)("span",{className:"mr-4 inline-block size-2.5 rounded-full bg-foreground align-middle opacity-55"}),e]})}let V=({children:e})=>(0,t.jsx)("p",{className:"font-mono text-[11px] leading-relaxed text-pretty text-muted-foreground/70",children:e});function W({children:e,tail:n}){return(0,t.jsxs)("p",{className:"flex items-center gap-2.5 text-sm",children:[(0,t.jsx)("span",{className:"grid size-5 shrink-0 place-items-center rounded-full bg-primary text-primary-foreground",children:(0,t.jsx)(r.Check,{className:"size-3"})}),e,n&&(0,t.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground/70",children:n})]})}function G({keyed:e,onSaved:r}){return e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W,{children:"OpenAI key saved"}),(0,t.jsx)(V,{children:"Change it any time in Settings › API keys."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y,{children:"Paste your OpenAI API key"}),(0,t.jsx)(j.VoiceKeys,{dense:!0,autoFocus:!0,onSaved:r}),(0,t.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2.5 text-[13px] font-medium text-foreground no-underline",children:[(0,t.jsxs)("span",{className:"flex h-7.5 items-center gap-1.5 rounded-full bg-muted px-3.5 transition-colors hover:bg-accent",children:["Get a key",(0,t.jsx)(n.ArrowUpRight,{className:"size-3.5"})]}),(0,t.jsx)("span",{className:"truncate font-mono text-[11px] font-normal text-muted-foreground/70",children:"platform.openai.com/api-keys"})]}),(0,t.jsx)("ol",{className:"flex flex-col gap-1.75 text-[13px] text-muted-foreground",children:["Sign in, or make an account","Create new secret key, and copy it","Paste it here"].map((e,n)=>(0,t.jsxs)("li",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("span",{className:"grid size-4.5 shrink-0 place-items-center rounded font-mono text-[10px] text-foreground bg-secondary",children:n+1}),e]},e))}),(0,t.jsx)(V,{children:"OpenAI bills it by the minute of call, separately from ChatGPT."})]})}function X({mic:e}){let n=(0,F.useThursdayStore)(e=>e.wake),i=(0,F.useThursdayStore)(e=>e.patch),[s,o]=(0,p.useState)(!1),[l,u]=(0,p.useState)(null);return((0,$.useWakeWord)({enabled:e.on&&n.enabled&&!l,phrases:[n.phrase],onWake:()=>o(!0),onError:u}),e.on)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W,{children:"Microphone is on"}),(0,t.jsxs)("label",{className:"mt-1.5 flex cursor-pointer items-start gap-3",children:[(0,t.jsxs)("span",{className:"flex flex-1 flex-col gap-0.75",children:[(0,t.jsx)("span",{className:"text-sm",children:"Wake her by voice"}),(0,t.jsxs)(V,{children:["Say ",(0,t.jsxs)("span",{className:"text-foreground",children:['"',n.phrase,'"']})," and she picks up. The microphone stays open for as long as this tab is."]}),n.enabled&&!l&&(s?(0,t.jsxs)("span",{className:"mt-1.5 flex items-center gap-2 text-[13px]",children:[(0,t.jsx)("span",{className:"grid size-5 shrink-0 animate-in place-items-center rounded-full bg-foreground text-background duration-300 zoom-in-50",children:(0,t.jsx)(r.Check,{className:"size-3"})}),"Heard you. That is how you call her."]}):(0,t.jsxs)("span",{className:"mt-1.5 flex items-center gap-2 text-[13px]",children:[(0,t.jsx)(a.Mic,{className:"size-4 shrink-0 animate-pulse text-brand"}),(0,t.jsx)(g.ShinyText,{text:`Try it now: say "${n.phrase}"`,speed:2.2})]})),l&&(0,t.jsx)(V,{children:l})]}),(0,t.jsx)(x.Switch,{checked:n.enabled,onCheckedChange:e=>i({wake:{...n,enabled:e}})})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y,{children:"Turn on the microphone"}),(0,t.jsxs)(m.Button,{onClick:()=>void e.turnOn(),className:"h-11 self-start rounded-full px-5 pl-4 text-sm",children:[(0,t.jsx)(a.Mic,{className:""}),"Turn it on"]}),e.blocked?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-[13px] leading-normal text-amber-700 dark:text-amber-400",children:"This page is not allowed the microphone yet."}),(0,t.jsx)(V,{children:"The icon at the left of the address bar opens the site's settings: set Microphone to Allow and come back. Or just go on."})]}):(0,t.jsx)(V,{children:"Used on a call, and nowhere else unless you switch on waking her by voice."})]})}function J({picked:e,face:n,onToggle:r}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y,{children:"Pick who comes along"}),(0,t.jsx)("div",{className:"flex flex-col",children:b.BOT_SEEDS.map(i=>{let s=!!e[i.name];return(0,t.jsxs)("label",{className:"flex h-9.5 cursor-pointer items-center gap-2.75",children:[(0,t.jsx)(_.BotMark,{size:24,seed:i.name,...n(i),notify:!1,className:(0,H.cn)("shrink-0 transition-opacity",!s&&"opacity-40")}),(0,t.jsx)("span",{className:(0,H.cn)("w-17.5 shrink-0 text-[13.5px] font-medium",!s&&"text-muted-foreground"),children:i.name}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:i.hint}),(0,t.jsx)(x.Switch,{checked:s,onCheckedChange:()=>r(i.name)})]},i.name)})}),(0,t.jsx)(V,{children:"Three to start is plenty. The rest wait in Settings › Bots, and you can make your own."})]})}function Q(){let{data:e}=(0,U.useServerRoute)(f.queryKey.config),n=(0,v.parseTextModel)(e?.find(e=>e.key===N.DEFAULT_MODEL_KEY)?.value),[r,i]=(0,p.useState)(null),[s]=(0,q.useServerAction)(S.setConfigAction,{onOk:()=>(0,U.revalidate)(f.queryKey.config)}),[a]=(0,q.useServerAction)(T.removeConfigAction,{onOk:()=>(0,U.revalidate)(f.queryKey.config)});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y,{children:"Pick what they think with"}),(0,t.jsx)(k.AccountsSetup,{}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("span",{className:"shrink-0 text-[13px] text-muted-foreground",children:"Bots think with"}),(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(y.ModelPicker,{provider:r??n?.provider??null,model:r?"":n?.model??"",unset:"Automatic",onChange:e=>{if(!e.model.trim())return i(e.provider);i(null),s(N.DEFAULT_MODEL_KEY,`${e.provider}/${e.model.trim()}`)},onUnset:()=>{i(null),n&&a(N.DEFAULT_MODEL_KEY)}})})]})]})}function Z({mic:e,bots:n}){let i=["voice",e?"microphone":null,n>0?`${n} ${1===n?"bot":"bots"}`:null].filter(e=>null!==e);return(0,t.jsx)("span",{className:"flex items-center gap-2 text-xs",children:i.map((e,n)=>(0,t.jsxs)("span",{style:{animationDelay:`${300+260*n}ms`},className:"flex animate-in items-center gap-2 duration-300 fill-mode-backwards fade-in slide-in-from-bottom-1",children:[n>0&&(0,t.jsx)("span",{className:"text-muted-foreground/40",children:"·"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(r.Check,{className:"size-3.25"}),e]})]},e))})}let ee={threadId:"demo",label:"Osaka flights, October",bot:"Analyst",words:"Three fares from ₩296,000 out of Incheon. The Tuesday morning one is the pick: direct, and the cheapest by a little.",paths:[]};function et({stage:e,icons:n}){let r=b.BOT_SEEDS.filter(e=>e.recommended);return(0,t.jsxs)(t.Fragment,{children:["landed"===e&&(0,t.jsx)("div",{className:"pointer-events-none absolute bottom-5 left-5 w-90 text-left",children:(0,t.jsx)(B.FinishedCard,{row:ee,bot:{icon:n[b.BOT_SEEDS.findIndex(e=>e.name===ee.bot)]},onOpen:()=>{},onClose:()=>{}})}),(0,t.jsxs)("div",{className:"absolute right-5 bottom-5 flex h-10 items-center gap-2.5 rounded-full bg-background pr-3.5 pl-2.5 ring-1 ring-border",children:[(0,t.jsx)("span",{className:"flex",children:r.map((r,i)=>(0,t.jsx)(_.BotMark,{size:22,seed:r.name,...n[b.BOT_SEEDS.indexOf(r)],state:"working"===e&&"Analyst"===r.name?"thinking":"idle",notify:!1,className:(0,H.cn)("shrink-0",i>0&&"-ml-1.5")},r.name))}),(0,t.jsx)("span",{className:"w-40 truncate text-left text-[13px] text-muted-foreground",children:"working"===e?"Analyst · reading fares":"landed"===e?"Analyst finished":"Need a hand?"})]})]})}e.s(["Intro",0,function({ready:e,firstRun:n,forced:r,icons:a}){let o=n||r,l=(0,h.useRouter)(),c=(0,P.useThursdayFace)(),[f,g]=(0,p.useState)("hello"),[x,y]=(0,p.useState)(!1),[v,_]=(0,p.useState)(!1),[k,j]=(0,p.useState)(e),[T,S]=(0,p.useState)(null),[N,F]=(0,p.useState)(()=>Object.fromEntries(b.BOT_SEEDS.map(e=>[e.name,!0]))),B=function(e){let[t,n]=(0,p.useState)("off"),[r,i]=(0,p.useState)(!1),[s,a]=(0,p.useState)(""),o=(0,p.useRef)(null),l=(0,p.useRef)(null),u=(0,p.useCallback)(()=>{for(let e of l.current?.getTracks()??[])e.stop();l.current=null},[]);return(0,p.useEffect)(()=>{e||(u(),n(e=>"on"===e?"off":e))},[e,u]),(0,p.useEffect)(()=>u,[u]),{on:"on"===t,blocked:"blocked"===t,allowed:r,label:s,turnOn:(0,p.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});l.current=e,o.current??=(0,C.createAudioTap)(),o.current.open(),o.current.hear?.(e),a(e.getAudioTracks()[0]?.label??""),n("on"),i(!0)}catch{n("blocked")}},[]),spectrum:(0,p.useCallback)(()=>o.current?.readMic()??[],[])}}("mic"===f&&!x),$=function(e){let[t,n]=(0,p.useState)(0);(0,p.useEffect)(()=>{if(!e)return;let t=performance.now(),r=setInterval(()=>n((performance.now()-t)%16e3),120);return()=>clearInterval(r)},[e]);let r=(e,t,n)=>({id:e,role:t,text:n}),i=[];t>900&&i.push(r("ask","user","Find me flights to Osaka in October.")),t>4700&&i.push(r("onIt","assistant","On it. Analyst is looking. Keep talking, I will say when it is back.")),t>11500&&i.push(r("back","assistant","Analyst is back. From ₩296,000, out of Incheon. The page is on your screen."));let s=t>4700&&t<8300||t>11500&&t<14500;return{turns:i,status:s?"speaking":t>900&&t<4700?"listening":"idle",stage:t>9600?"landed":t>5400?"working":t>900?"asked":"rest",saying:s,voice:z.silentVoice}}("hello"===f&&o&&!x),q=o&&!x;(0,p.useEffect)(()=>(A.callSignal.hold(q),()=>A.callSignal.hold(!1)),[q]),(0,p.useEffect)(()=>{if(!x)return;let e=setTimeout(()=>_(!0),700);return()=>clearTimeout(e)},[x]);let U=K.indexOf(f),Y=(0,p.useMemo)(()=>{var e,t,n;let r,i;return e=f,t=k,n=B.on,r=(e,t)=>({id:e,role:"assistant",text:t}),i=[],"hello"===e||(i.push(r("key","I am Thursday. My voice comes from OpenAI, so the first thing I need is a key: paste one and I wake up. No key yet? Go on without it, and I will ask again when you call.")),t&&i.push(r("awake","There, I am awake, and that key is everything a call needs. From here on it is quick: your microphone, who works for you, and what they think with.")),"key"===e||(i.push(r("mic","Now let me hear you. Your browser asks before it opens the microphone: say yes, then say anything at all and watch the line under me move. It is only open on a call, unless you ask for more.")),n&&i.push(r("heard","I hear you: that line is your voice. If you would rather wake me by saying my name than by tapping me, switch it on here and try it once.")),"mic"===e||(i.push(r("bots","Long work goes to bots, so we can keep talking while they are at it. They work on this computer, with a shell, a browser and your files, and signing in or paying always stays with you.")),"bots"===e||(i.push(r("models","Bots think with a model you choose. Start small: a small model is quick and costs little, and any bot can move up later. An OpenAI key already covers it; a GPT subscription or one Vercel key opens far more.")),"models"===e||i.push(t?r("call","That is everything I need. Call me, tell me what to call you, and ask for one thing, anything you would ask a person at the next desk. I will show you the rest as we go."):r("asleep","I still have no voice of my own, so there is no call yet, but everything else works. Look around; tap me whenever you have a key and I will take it from there.")))))),i},[f,k,B.on]),V="hello"===f?$.turns:Y,W=(0,L.useTurnFocus)(V,!0),ee=function(e){let t=(0,p.useRef)(null),n=(0,p.useRef)(new Set),r=(0,p.useRef)([]),i=(0,p.useRef)(!1),[s,a]=(0,p.useState)(!1),[o,l]=(0,p.useState)(!1),u=(0,p.useRef)(!1);(0,p.useEffect)(()=>{try{let e="1"===window.localStorage.getItem(O);u.current=e,l(e)}catch{}},[]);let c=(0,p.useCallback)(()=>{r.current=[],t.current?.audio.pause()},[]),d=(0,p.useCallback)(()=>{let e=r.current.shift();if(!e||!t.current)return;let{audio:n,clip:i}=t.current;i.resume(),n.src=`/voices/intro/${e}-${function(e){let t=0x811c9dc5;for(let n of`marin|${e}`)t^=n.codePointAt(0)??0,t=Math.imul(t,0x1000193);return(t>>>0).toString(16).padStart(8,"0")}(E[e])}.ogg`,n.play().catch(()=>{})},[]),h=(0,p.useCallback)((...e)=>{let s=e.filter(e=>!n.current.has(e));if(!u.current&&s.length){if(!t.current){let e=new Audio,n=e=>()=>{i.current=e,a(e)};for(let t of(e.addEventListener("playing",n(!0)),["pause","ended","error"]))e.addEventListener(t,n(!1));e.addEventListener("ended",d),e.addEventListener("error",d),t.current={audio:e,clip:(0,C.createClipTap)(e)}}for(let e of s)n.current.add(e);r.current=s,d()}},[d]);(0,p.useEffect)(()=>{e&&t.current&&h(e)},[e,h]),(0,p.useEffect)(()=>()=>{t.current?.audio.pause(),t.current?.clip.close(),t.current=null},[]);let f=(0,p.useCallback)(()=>{let t=!u.current;u.current=t,l(t);try{window.localStorage.setItem(O,t?"1":"0")}catch{}if(t)return c();e&&(n.current.delete(e),h(e))},[c,e,h]);return{say:h,hush:c,speaking:s,muted:o,toggle:f,spectrum:(0,p.useCallback)(()=>t.current&&i.current?t.current.clip.read():M,[])}}(x?null:Y.at(-1)?.id??null);if(v||!o)return null;let en=e=>a[b.BOT_SEEDS.indexOf(e)],er=e=>{ee.hush(),y(!0),k&&(0,w.installSeedBots)(b.BOT_SEEDS.filter(e=>N[e.name]).map(e=>({name:e.name,icon:en(e)}))),e&&A.callSignal.place(),l.replace("/"),l.refresh()},ei="hello"===f?$.status:ee.speaking?"speaking":"mic"===f&&B.on?"listening":"idle",es="call"===f;return(0,t.jsxs)("div",{className:(0,H.cn)("fixed inset-0 z-40 bg-background transition-opacity duration-700",x&&"pointer-events-none opacity-0"),children:[(0,t.jsx)("button",{type:"button",onClick:ee.toggle,"aria-label":ee.muted?"Let her speak":"Mute her","aria-pressed":ee.muted,className:"absolute top-5 right-5 z-10 grid h-7.5 w-8 place-items-center rounded-[10px] text-muted-foreground ring-1 ring-border outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:ee.muted?(0,t.jsx)(d,{className:"size-[15px]"}):(0,t.jsx)(u,{className:"size-[15px]"})}),(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-5 pt-[7vh]",children:[(0,t.jsxs)("div",{className:"relative w-[min(28rem,72vw,52vh)]",children:[(0,t.jsx)("button",{type:"button",disabled:!es||!k,onClick:()=>er(!0),"aria-label":es&&k?"Call Thursday":void 0,className:(0,H.cn)("block w-full rounded-full outline-none transition-all duration-700 ease-out focus-visible:ring-3 focus-visible:ring-ring/50","hello"!==f&&!k&&"opacity-35"),children:(0,t.jsx)(R.Face,{look:c,status:ei,failed:!1,word:T,getSpectrum:"hello"===f?$.voice:ee.spectrum,className:"w-full"})}),(0,t.jsx)(L.SideCaptions,{turns:V,pinned:W.pinned,live:"hello"===f?$.saying:ee.speaking,onPick:W.pick}),"hello"!==f&&(0,t.jsxs)("div",{className:"absolute top-1/2 left-full ml-1.5 flex w-[min(22rem,26vw)] -translate-y-1/2 animate-in flex-col gap-4 text-left fade-in slide-in-from-bottom-1 duration-300",children:["key"===f&&(0,t.jsx)(G,{keyed:k,onSaved:()=>{j(!0),S((0,D.awake)())}}),"mic"===f&&(0,t.jsx)(X,{mic:B}),"bots"===f&&(0,t.jsx)(J,{picked:N,face:en,onToggle:e=>F(t=>({...t,[e]:!t[e]}))}),"models"===f&&(0,t.jsx)(Q,{})]},f)]}),(0,t.jsxs)("div",{className:"flex w-full max-w-3xl flex-col items-center gap-4 px-6 text-center",children:[(0,t.jsx)("div",{className:"flex h-14 items-center gap-2 text-[13px] text-muted-foreground",children:"hello"===f?(0,t.jsx)("p",{className:"max-w-130 text-[20px] leading-[1.5] text-balance text-foreground",children:"Just talk to her. She gets it done on this computer, and tells you when it is ready."}):"mic"===f&&B.on?(0,t.jsx)(I.Ear,{live:!0,getMicSpectrum:B.spectrum}):k?es?(0,t.jsx)(Z,{mic:B.allowed,bots:b.BOT_SEEDS.filter(e=>N[e.name]).length}):null:"Asleep"}),(0,t.jsxs)(m.Button,{variant:"brand",onClick:()=>{"hello"===f?(ee.say("hello",k?"awake":"key"),g("key")):es?er(k):g(K[U+1])},className:"h-12 px-7 pl-8 text-[15px]",children:["hello"===f?"Start":es?k?"Call her":"Look around":"Continue",(0,t.jsx)(s.ChevronRight,{})]}),(0,t.jsx)("p",{className:"h-4 font-mono text-[11px] text-muted-foreground/70",children:"hello"===f?"two minutes · every step can wait":"key"!==f||k?"mic"!==f||B.on?es&&k?"or tap her":"":"or allow it when the first call asks":"no key is fine — it can go in from the call screen"})]})]}),"hello"===f?(0,t.jsx)(et,{stage:$.stage,icons:a}):(0,t.jsxs)("div",{className:"absolute inset-x-0 bottom-6 grid grid-cols-[1fr_auto_1fr] items-center gap-4.5 font-mono text-[11px] text-muted-foreground/70 [@media(max-height:720px)]:bottom-3",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>g(U>0?K[U-1]:"hello"),className:"flex items-center gap-1 justify-self-end rounded-md outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)(i.ChevronLeft,{className:"size-3"}),"Back"]}),(0,t.jsxs)("span",{className:"flex items-center gap-4.5",children:[(0,t.jsx)("span",{className:"flex items-center gap-1.75",children:K.map((e,n)=>(0,t.jsx)("span",{className:(0,H.cn)("h-1.75 rounded-full transition-all duration-300",n===U?"w-5.5 bg-brand":"w-1.75",n<U&&"bg-foreground/40",n>U&&"bg-border")},e))}),(0,t.jsxs)("span",{children:[U+1," of ",K.length]})]}),es&&!k?(0,t.jsx)("span",{}):(0,t.jsx)("button",{type:"button",onClick:()=>er(!1),className:(0,H.cn)("justify-self-start rounded-md outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",es&&"text-muted-foreground"),children:es?"Look around first":"Skip all"})]})]})}],302707)},756958,e=>{"use strict";var t=e.i(271645),n=e.i(511769),r=e.i(798120),i=e.i(917162),s=e.i(283653),a=e.i(95187);let o=(0,a.createServerReference)("7fdc0f369433173f0c7c8c625683aa57e0508dcc63",a.callServer,void 0,a.findSourceMapURL,"allowReachAction"),l=(0,a.createServerReference)("7f1645b1dc1ef8c04f91344f690b8c9699f6d236ec",a.callServer,void 0,a.findSourceMapURL,"declineReachAction");var u=e.i(36174);e.s(["ReachAsk",0,function(){let{data:e}=(0,s.useServerRoute)(r.queryKey.reach);(0,n.useAppEvent)({reach:()=>void(0,s.revalidate)(r.queryKey.reach)});let a=(0,t.useRef)(null),c=e?.channels.find(e=>e.asking)??null,d=c?.asking??null,h=c?.name??null;return(0,t.useEffect)(()=>{if(!d||!h){a.current=null;return}let e=`${h}:${d.chat}`;a.current!==e&&(a.current=e,i.notify.confirm({title:`Let ${d.name} reach Thursday from a phone?`,description:`They wrote to your ${u.REACH_LABEL[h]} bot. Whoever you let in can talk to Thursday from there — and through her, start work on this computer. One person can be let in.`,okText:"Allow",cancelText:"Not them"}).then(e=>e?o(h,d.chat):l(h)))},[d,h]),null}],756958)},252284,e=>{"use strict";var t=e.i(843476),n=e.i(271645);e.s(["Boot",0,function(){let[e,r]=(0,n.useState)(!1);return((0,n.useEffect)(()=>r(!0),[]),e)?null:(0,t.jsx)("p",{"aria-hidden":!0,className:"pointer-events-none fixed inset-x-0 bottom-16 z-50 animate-stalled text-center text-[13px] text-muted-foreground opacity-0",children:"The page did not start. Reload it."})}])},692888,638292,747985,375775,234916,656572,745747,114923,895499,435135,e=>{"use strict";var t,n,r,i,s=e.i(843476),a=e.i(493801),o=e.i(716327),l=e.i(456420);let u={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};u.node;let c=(0,l.default)(u),d={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};d.node;let h=(0,l.default)(d),p={name:"mic",size:24,node:[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]};p.node;let f=(0,l.default)(p);e.s(["Mic",0,f],638292);let m={name:"mic-off",size:24,node:[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]]};m.node;let g=(0,l.default)(m),x={name:"phone-missed",size:24,node:[["path",{d:"m16 2 6 6",key:"1gw87d"}],["path",{d:"m22 2-6 6",key:"6f0sa0"}],["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]};x.node;let y=(0,l.default)(x),v={name:"settings-2",size:24,node:[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]};v.node;let b=(0,l.default)(v);var _=e.i(271645),w=e.i(798120),k=e.i(167881),j=e.i(225913),T=e.i(647163);let S=(0,j.cva)("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-1.5 [&>*]:relative [&>*]:focus-visible:z-10",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function N({className:e,orientation:t="horizontal",...n}){return(0,s.jsx)("div",{"data-slot":"button-group","data-orientation":t,role:"group",className:(0,T.cn)(S({orientation:t}),e),...n})}let C=new Intl.Segmenter(void 0,{granularity:"grapheme"});function E({text:e}){let t=(0,_.useMemo)(()=>Array.from(C.segment(e),e=>e.segment),[e]),n=(0,_.useRef)([]),r=0;for(;r<t.length&&t[r]===n.current[r];)r++;return(0,_.useEffect)(()=>{n.current=t},[t]),t.map((e,t)=>(0,s.jsx)(M,{wait:25*Math.max(0,t-r),children:e},`${e}${t}`))}function M({wait:e,children:t}){let[n]=(0,_.useState)(e);return(0,s.jsx)("span",{style:{animationDelay:`${n}ms`},className:"animate-letter motion-reduce:animate-none",children:t})}var O=e.i(660302),A=e.i(633669);function R(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var I,P,D,z,F,B,$,q,U,H,K,Y,V,W,G,X,J,Q,Z,ee,et,en,er,ei,es,ea,eo={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},el={duration:.5,overwrite:!1,delay:0},eu=2*Math.PI,ec=eu/4,ed=0,eh=Math.sqrt,ep=Math.cos,ef=Math.sin,em=function(e){return"string"==typeof e},eg=function(e){return"function"==typeof e},ex=function(e){return"number"==typeof e},ey=function(e){return void 0===e},ev=function(e){return"object"==typeof e},eb=function(e){return!1!==e},e_=function(){return"u">typeof window},ew=function(e){return eg(e)||em(e)},ek="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},ej=Array.isArray,eT=/random\([^)]+\)/g,eS=/,\s*/g,eN=/(?:-?\.?\d|\.)+/gi,eC=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,eE=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,eM=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,eO=/[+-]=-?[.\d]+/,eA=/[^,'"\[\]\s]+/gi,eR=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,eL={},eI={},eP=function(e){return(eI=tn(e,eL))&&n5},eD=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},ez=function(e,t){return!t&&console.warn(e)},eF=function(e,t){return e&&(eL[e]=t)&&eI&&(eI[e]=t)||eL},eB=function(){return 0},e$={suppressEvents:!0,isStart:!0,kill:!1},eq={suppressEvents:!0,kill:!1},eU={suppressEvents:!0},eH={},eK=[],eY={},eV={},eW={},eG=30,eX=[],eJ="",eQ=function(e){var t,n,r=e[0];if(ev(r)||eg(r)||(e=[e]),!(t=(r._gsap||{}).harness)){for(n=eX.length;n--&&!eX[n].targetTest(r););t=eX[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new nu(e[n],t)))||e.splice(n,1);return e},eZ=function(e){return e._gsap||eQ(tP(e))[0]._gsap},e0=function(e,t,n){return(n=e[t])&&eg(n)?e[t]():ey(n)&&e.getAttribute&&e.getAttribute(t)||n},e1=function(e,t){return(e=e.split(",")).forEach(t)||e},e2=function(e){return Math.round(1e5*e)/1e5||0},e5=function(e){return Math.round(1e7*e)/1e7||0},e3=function(e,t){var n=t.charAt(0),r=parseFloat(t.substr(2));return e=parseFloat(e),"+"===n?e+r:"-"===n?e-r:"*"===n?e*r:e/r},e4=function(e,t){for(var n=t.length,r=0;0>e.indexOf(t[r])&&++r<n;);return r<n},e6=function(){var e,t,n=eK.length,r=eK.slice(0);for(eY={},eK.length=0,e=0;e<n;e++)(t=r[e])&&t._lazy&&(t.render(t._lazy[0],t._lazy[1],!0)._lazy=0)},e7=function(e){return!!(e._initted||e._startAt||e.add)},e8=function(e,t,n,r){eK.length&&!J&&e6(),e.render(t,n,r||!!(J&&t<0&&e7(e))),eK.length&&!J&&e6()},e9=function(e){var t=parseFloat(e);return(t||0===t)&&(e+"").match(eA).length<2?t:em(e)?e.trim():e},te=function(e){return e},tt=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},tn=function(e,t){for(var n in t)e[n]=t[n];return e},tr=function e(t,n){for(var r in n)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&(t[r]=ev(n[r])?e(t[r]||(t[r]={}),n[r]):n[r]);return t},ti=function(e,t){var n,r={};for(n in e)n in t||(r[n]=e[n]);return r},ts=function(e){var t,n=e.parent||Z,r=e.keyframes?(t=ej(e.keyframes),function(e,n){for(var r in n)r in e||"duration"===r&&t||"ease"===r||(e[r]=n[r])}):tt;if(eb(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},ta=function(e,t){for(var n=e.length,r=n===t.length;r&&n--&&e[n]===t[n];);return n<0},to=function(e,t,n,r,i){void 0===n&&(n="_first"),void 0===r&&(r="_last");var s,a=e[r];if(i)for(s=t[i];a&&a[i]>s;)a=a._prev;return a?(t._next=a._next,a._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[r]=t,t._prev=a,t.parent=t._dp=e,t},tl=function(e,t,n,r){void 0===n&&(n="_first"),void 0===r&&(r="_last");var i=t._prev,s=t._next;i?i._next=s:e[n]===t&&(e[n]=s),s?s._prev=i:e[r]===t&&(e[r]=i),t._next=t._prev=t.parent=null},tu=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},tc=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},td=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},th=function(e,t,n,r){return e._startAt&&(J?e._startAt.revert(eq):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},tp=function(e){return e._repeat?tf(e._tTime,e=e.duration()+e._rDelay)*e:0},tf=function(e,t){var n=Math.floor(e=e5(e/t));return e&&n===e?n-1:n},tm=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},tg=function(e){return e._end=e5(e._start+(e._tDur/Math.abs(e._ts||e._rts||1e-8)||0))},tx=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=e5(n._time-(e._ts>0?t/e._ts:-(((e._dirty?e.totalDuration():e._tDur)-t)/e._ts))),tg(e),n._dirty||tc(n,e)),e},ty=function(e,t){var n;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(n=tm(e.rawTime(),t),(!t._dur||tA(0,t.totalDuration(),n)-t._tTime>1e-8)&&t.render(n,!0)),tc(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(n=e;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-1e-8}},tv=function(e,t,n,r){return t.parent&&tu(t),t._start=e5((ex(n)?n:n||e!==Z?tE(e,n,t):e._time)+t._delay),t._end=e5(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),to(e,t,"_first","_last",e._sort?"_start":0),tk(t)||(e._recent=t),r||ty(e,t),e._ts<0&&tx(e,e._tTime),e},tb=function(e,t){return(eL.ScrollTrigger||eD("scrollTrigger",t))&&eL.ScrollTrigger.create(t,e)},t_=function(e,t,n,r,i){return(nw(e,t,i),e._initted)?!n&&e._pt&&!J&&(e._dur&&!1!==e.vars.lazy||!e._dur&&e.vars.lazy)&&ei!==t4.frame?(eK.push(e),e._lazy=[i,r],1):void 0:1},tw=function e(t){var n=t.parent;return n&&n._ts&&n._initted&&!n._lock&&(0>n.rawTime()||e(n))},tk=function(e){var t=e.data;return"isFromStart"===t||"isStart"===t},tj=function(e,t,n,r){var i,s,a,o=e.ratio,l=t<0||!t&&(!e._start&&tw(e)&&!(!e._initted&&tk(e))||(e._ts<0||e._dp._ts<0)&&!tk(e))?0:1,u=e._rDelay,c=0;if(u&&e._repeat&&(s=tf(c=tA(0,e._tDur,t),u),e._yoyo&&1&s&&(l=1-l),s!==tf(e._tTime,u)&&(o=1-l,e.vars.repeatRefresh&&e._initted&&e.invalidate())),l!==o||J||r||1e-8===e._zTime||!t&&e._zTime){if(!e._initted&&t_(e,t,r,n,c))return;for(a=e._zTime,e._zTime=t||1e-8*!!n,n||(n=t&&!a),e.ratio=l,e._from&&(l=1-l),e._time=0,e._tTime=c,i=e._pt;i;)i.r(l,i.d),i=i._next;t<0&&th(e,t,n,!0),e._onUpdate&&!n&&tV(e,"onUpdate"),c&&e._repeat&&!n&&e.parent&&tV(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===l&&(l&&tu(e,1),n||J||(tV(e,l?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},tT=function(e,t,n){var r;if(n>t)for(r=e._first;r&&r._start<=n;){if("isPause"===r.data&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=n;){if("isPause"===r.data&&r._start<t)return r;r=r._prev}},tS=function(e,t,n,r){var i=e._repeat,s=e5(t)||0,a=e._tTime/e._tDur;return a&&!r&&(e._time*=s/e._dur),e._dur=s,e._tDur=i?i<0?1e10:e5(s*(i+1)+e._rDelay*i):s,a>0&&!r&&tx(e,e._tTime=e._tDur*a),e.parent&&tg(e),n||tc(e.parent,e),e},tN=function(e){return e instanceof nd?tc(e):tS(e,e._dur)},tC={_start:0,endTime:eB,totalDuration:eB},tE=function e(t,n,r){var i,s,a,o=t.labels,l=t._recent||tC,u=t.duration()>=1e8?l.endTime(!1):t._dur;return em(n)&&(isNaN(n)||n in o)?(s=n.charAt(0),a="%"===n.substr(-1),i=n.indexOf("="),"<"===s||">"===s)?(i>=0&&(n=n.replace(/=/,"")),("<"===s?l._start:l.endTime(l._repeat>=0))+(parseFloat(n.substr(1))||0)*(a?(i<0?l:r).totalDuration()/100:1)):i<0?(n in o||(o[n]=u),o[n]):(s=parseFloat(n.charAt(i-1)+n.substr(i+1)),a&&r&&(s=s/100*(ej(r)?r[0]:r).totalDuration()),i>1?e(t,n.substr(0,i-1),r)+s:u+s):null==n?u:+n},tM=function(e,t,n){var r,i,s=ex(t[1]),a=(s?2:1)+(e<2?0:1),o=t[a];if(s&&(o.duration=t[1]),o.parent=n,e){for(r=o,i=n;i&&!("immediateRender"in r);)r=i.vars.defaults||{},i=eb(i.vars.inherit)&&i.parent;o.immediateRender=eb(r.immediateRender),e<2?o.runBackwards=1:o.startAt=t[a-1]}return new nE(t[0],o,t[a+1])},tO=function(e,t){return e||0===e?t(e):t},tA=function(e,t,n){return n<e?e:n>t?t:n},tR=function(e,t){return em(e)&&(t=eR.exec(e))?t[1]:""},tL=[].slice,tI=function(e,t){return e&&ev(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&ev(e[0]))&&!e.nodeType&&e!==ee},tP=function(e,t,n){var r;return Q&&!t&&Q.selector?Q.selector(e):em(e)&&!n&&(et||!t6())?tL.call((t||en).querySelectorAll(e),0):ej(e)?(void 0===r&&(r=[]),e.forEach(function(e){var t;return em(e)&&!n||tI(e,1)?(t=r).push.apply(t,tP(e)):r.push(e)})||r):tI(e)?tL.call(e,0):e?[e]:[]},tD=function(e){return e=tP(e)[0]||ez("Invalid scope")||{},function(t){var n=e.current||e.nativeElement||e;return tP(t,n.querySelectorAll?n:n===e?ez("Invalid scope")||en.createElement("div"):e)}},tz=function(e){return e.sort(function(){return .5-Math.random()})},tF=function(e){if(eg(e))return e;var t=ev(e)?e:{each:e},n=ni(t.ease),r=t.from||0,i=parseFloat(t.base)||0,s={},a=r>0&&r<1,o=isNaN(r)||a,l=t.axis,u=r,c=r;return em(r)?u=c=({center:.5,edges:.5,end:1})[r]||0:!a&&o&&(u=r[0],c=r[1]),function(e,a,d){var h,p,f,m,g,x,y,v,b,_=(d||t).length,w=s[_];if(!w){if(!(b="auto"===t.grid?0:(t.grid||[1,1e8])[1])){for(y=-1e8;y<(y=d[b++].getBoundingClientRect().left)&&b<_;);b<_&&b--}for(w=s[_]=[],h=o?Math.min(b,_)*u-.5:r%b,p=1e8===b?0:o?_*c/b-.5:r/b|0,y=0,v=1e8,x=0;x<_;x++)f=x%b-h,m=p-(x/b|0),w[x]=g=l?Math.abs("y"===l?m:f):eh(f*f+m*m),g>y&&(y=g),g<v&&(v=g);"random"===r&&tz(w),w.max=y-v,w.min=v,w.v=_=(parseFloat(t.amount)||parseFloat(t.each)*(b>_?_-1:l?"y"===l?_/b:b:Math.max(b,_/b))||0)*("edges"===r?-1:1),w.b=_<0?i-_:i,w.u=tR(t.amount||t.each)||0,n=n&&_<0?nr(n):n}return _=(w[e]-w.min)/w.max||0,e5(w.b+(n?n(_):_)*w.v)+w.u}},tB=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(n){var r=e5(Math.round(parseFloat(n)/e)*e*t);return(r-r%1)/t+(ex(n)?0:tR(n))}},t$=function(e,t){var n,r,i=ej(e);return!i&&ev(e)&&(n=i=e.radius||1e8,e.values?(r=!ex((e=tP(e.values))[0]))&&(n*=n):e=tB(e.increment)),tO(t,i?eg(e)?function(t){return Math.abs((r=e(t))-t)<=n?r:t}:function(t){for(var i,s,a=parseFloat(r?t.x:t),o=parseFloat(r?t.y:0),l=1e8,u=0,c=e.length;c--;)(i=r?(i=e[c].x-a)*i+(s=e[c].y-o)*s:Math.abs(e[c]-a))<l&&(l=i,u=c);return u=!n||l<=n?e[u]:t,r||u===t||ex(t)?u:u+tR(t)}:tB(e))},tq=function(e,t,n,r){return tO(ej(e)?!t:!0===n?(n=0,!1):!r,function(){return ej(e)?e[~~(Math.random()*e.length)]:(r=(n=n||1e-5)<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((e-n/2+Math.random()*(t-e+.99*n))/n)*n*r)/r})},tU=function(e,t,n){return tO(n,function(n){return e[~~t(n)]})},tH=function(e){return e.replace(eT,function(e){var t=e.indexOf("[")+1,n=e.substring(t||7,t?e.indexOf("]"):e.length-1).split(eS);return tq(t?n:+n[0],t?0:+n[1],+n[2]||1e-5)})},tK=function(e,t,n,r,i){var s=t-e,a=r-n;return tO(i,function(t){return n+((t-e)/s*a||0)})},tY=function(e,t,n){var r,i,s,a=e.labels,o=1e8;for(r in a)(i=a[r]-t)<0==!!n&&i&&o>(i=Math.abs(i))&&(s=r,o=i);return s},tV=function(e,t,n){var r,i,s,a=e.vars,o=a[t],l=Q,u=e._ctx;if(o)return r=a[t+"Params"],i=a.callbackScope||e,n&&eK.length&&e6(),u&&(Q=u),s=r?o.apply(i,r):o.call(i),Q=l,s},tW=function(e){return tu(e),e.scrollTrigger&&e.scrollTrigger.kill(!!J),1>e.progress()&&tV(e,"onInterrupt"),e},tG=[],tX=function(e){if(e)if(e=!e.name&&e.default||e,e_()||e.headless){var t=e.name,n=eg(e),r=t&&!n&&e.init?function(){this._props=[]}:e,i={init:eB,render:nz,add:nv,kill:nB,modifier:nF,rawVars:0},s={targetTest:0,get:0,getSetter:nL,aliases:{},register:0};if(t6(),e!==r){if(eV[t])return;tt(r,tt(ti(e,i),s)),tn(r.prototype,tn(i,ti(e,s))),eV[r.prop=t]=r,e.targetTest&&(eX.push(r),eH[t]=1),t=("css"===t?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}eF(t,r),e.register&&e.register(n5,r,nU)}else tG.push(e)},tJ={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},tQ=function(e,t,n){return(6*(e+=e<0?1:e>1?-1:0)<1?t+(n-t)*e*6:e<.5?n:3*e<2?t+(n-t)*(2/3-e)*6:t)*255+.5|0},tZ=function(e,t,n){var r,i,s,a,o,l,u,c,d,h,p=e?ex(e)?[e>>16,e>>8&255,255&e]:0:tJ.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),tJ[e])p=tJ[e];else if("#"===e.charAt(0)){if(e.length<6&&(r=e.charAt(1),e="#"+r+r+(i=e.charAt(2))+i+(s=e.charAt(3))+s+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(p=parseInt(e.substr(1,6),16))>>16,p>>8&255,255&p,parseInt(e.substr(7),16)/255];p=[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e]}else if("hsl"===e.substr(0,3))if(p=h=e.match(eN),t){if(~e.indexOf("="))return p=e.match(eC),n&&p.length<4&&(p[3]=1),p}else a=p[0]%360/360,o=p[1]/100,i=(l=p[2]/100)<=.5?l*(o+1):l+o-l*o,r=2*l-i,p.length>3&&(p[3]*=1),p[0]=tQ(a+1/3,r,i),p[1]=tQ(a,r,i),p[2]=tQ(a-1/3,r,i);else p=e.match(eN)||tJ.transparent;p=p.map(Number)}return t&&!h&&(r=p[0]/255,l=((u=Math.max(r,i=p[1]/255,s=p[2]/255))+(c=Math.min(r,i,s)))/2,u===c?a=o=0:(d=u-c,o=l>.5?d/(2-u-c):d/(u+c),a=(u===r?(i-s)/d+6*(i<s):u===i?(s-r)/d+2:(r-i)/d+4)*60),p[0]=~~(a+.5),p[1]=~~(100*o+.5),p[2]=~~(100*l+.5)),n&&p.length<4&&(p[3]=1),p},t0=function(e){var t=[],n=[],r=-1;return e.split(t2).forEach(function(e){var i=e.match(eE)||[];t.push.apply(t,i),n.push(r+=i.length+1)}),t.c=n,t},t1=function(e,t,n){var r,i,s,a,o="",l=(e+o).match(t2),u=t?"hsla(":"rgba(",c=0;if(!l)return e;if(l=l.map(function(e){return(e=tZ(e,t,1))&&u+(t?e[0]+","+e[1]+"%,"+e[2]+"%,"+e[3]:e.join(","))+")"}),n&&(s=t0(e),(r=n.c).join(o)!==s.c.join(o)))for(a=(i=e.replace(t2,"1").split(eE)).length-1;c<a;c++)o+=i[c]+(~r.indexOf(c)?l.shift()||u+"0,0,0,0)":(s.length?s:l.length?l:n).shift());if(!i)for(a=(i=e.split(t2)).length-1;c<a;c++)o+=i[c]+l[c];return o+i[a]},t2=function(){var e,t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(e in tJ)t+="|"+e+"\\b";return RegExp(t+")","gi")}(),t5=/hsl[a]?\(/,t3=function(e){var t,n=e.join(" ");if(t2.lastIndex=0,t2.test(n))return t=t5.test(n),e[1]=t1(e[1],t),e[0]=t1(e[0],t,t0(e[1])),!0},t4=($=Date.now,q=500,U=33,K=H=$(),Y=1e3/240,V=1e3/240,W=[],G=function e(t){var n,r,i,s,a=$()-K,o=!0===t;if((a>q||a<0)&&(H+=a-U),K+=a,((n=(i=K-H)-V)>0||o)&&(s=++z.frame,F=i-1e3*z.time,z.time=i/=1e3,V+=n+(n>=Y?4:Y-n),r=1),o||(I=P(e)),r)for(B=0;B<W.length;B++)W[B](i,F,s,t)},z={time:0,frame:0,tick:function(){G(!0)},deltaRatio:function(e){return F/(1e3/(e||60))},wake:function(){er&&(!et&&e_()&&(en=(ee=et=window).document||{},eL.gsap=n5,(ee.gsapVersions||(ee.gsapVersions=[])).push(n5.version),eP(eI||ee.GreenSockGlobals||!ee.gsap&&ee||{}),tG.forEach(tX)),D="u">typeof requestAnimationFrame&&requestAnimationFrame,I&&z.sleep(),P=D||function(e){return setTimeout(e,V-1e3*z.time+1|0)},ea=1,G(2))},sleep:function(){(D?cancelAnimationFrame:clearTimeout)(I),ea=0,P=eB},lagSmoothing:function(e,t){U=Math.min(t||33,q=e||1/0)},fps:function(e){Y=1e3/(e||240),V=1e3*z.time+Y},add:function(e,t,n){var r=t?function(t,n,i,s){e(t,n,i,s),z.remove(r)}:e;return z.remove(e),W[n?"unshift":"push"](r),t6(),r},remove:function(e,t){~(t=W.indexOf(e))&&W.splice(t,1)&&B>=t&&B--},_listeners:W}),t6=function(){return!ea&&t4.wake()},t7={},t8=/^[\d.\-M][\d.\-,\s]/,t9=/["']/g,ne=function(e){for(var t,n,r,i={},s=e.substr(1,e.length-3).split(":"),a=s[0],o=1,l=s.length;o<l;o++)n=s[o],t=o!==l-1?n.lastIndexOf(","):n.length,r=n.substr(0,t),i[a]=isNaN(r)?r.replace(t9,"").trim():+r,a=n.substr(t+1).trim();return i},nt=function(e){var t=e.indexOf("(")+1,n=e.indexOf(")"),r=e.indexOf("(",t);return e.substring(t,~r&&r<n?e.indexOf(")",n+1):n)},nn=function(e){var t=(e+"").split("("),n=t7[t[0]];return n&&t.length>1&&n.config?n.config.apply(null,~e.indexOf("{")?[ne(t[1])]:nt(e).split(",").map(e9)):t7._CE&&t8.test(e)?t7._CE("",e):n},nr=function(e){return function(t){return 1-e(1-t)}},ni=function(e,t){return e&&(eg(e)?e:t7[e]||nn(e))||t},ns=function(e,t,n,r){void 0===n&&(n=function(e){return 1-t(1-e)}),void 0===r&&(r=function(e){return e<.5?t(2*e)/2:1-t((1-e)*2)/2});var i,s={easeIn:t,easeOut:n,easeInOut:r};return e1(e,function(e){for(var t in t7[e]=eL[e]=s,t7[i=e.toLowerCase()]=n,s)t7[i+("easeIn"===t?".in":"easeOut"===t?".out":".inOut")]=t7[e+"."+t]=s[t]}),s},na=function(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e((t-.5)*2)/2}},no=function e(t,n,r){var i=n>=1?n:1,s=(r||(t?.3:.45))/(n<1?n:1),a=s/eu*(Math.asin(1/i)||0),o=function(e){return 1===e?1:i*Math.pow(2,-10*e)*ef((e-a)*s)+1},l="out"===t?o:"in"===t?function(e){return 1-o(1-e)}:na(o);return s=eu/s,l.config=function(n,r){return e(t,n,r)},l},nl=function e(t,n){void 0===n&&(n=1.70158);var r=function(e){return e?--e*e*((n+1)*e+n)+1:0},i="out"===t?r:"in"===t?function(e){return 1-r(1-e)}:na(r);return i.config=function(n){return e(t,n)},i};e1("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var n=t<5?t+1:t;ns(e+",Power"+(n-1),t?function(e){return Math.pow(e,n)}:function(e){return e},function(e){return 1-Math.pow(1-e,n)},function(e){return e<.5?Math.pow(2*e,n)/2:1-Math.pow((1-e)*2,n)/2})}),t7.Linear.easeNone=t7.none=t7.Linear.easeIn,ns("Elastic",no("in"),no("out"),no()),np=2*(nh=1/2.75),nf=2.5*nh,ns("Bounce",function(e){return 1-nm(1-e)},nm=function(e){return e<nh?7.5625*e*e:e<np?7.5625*Math.pow(e-1.5/2.75,2)+.75:e<nf?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*Math.pow(e-2.625/2.75,2)+.984375}),ns("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)}),ns("Circ",function(e){return-(eh(1-e*e)-1)}),ns("Sine",function(e){return 1===e?1:-ep(e*ec)+1}),ns("Back",nl("in"),nl("out"),nl()),t7.SteppedEase=t7.steps=eL.SteppedEase={config:function(e,t){void 0===e&&(e=1);var n=1/e,r=e+ +!t,i=+!!t,s=.99999999;return function(e){return((r*tA(0,s,e)|0)+i)*n}}},el.ease=t7["quad.out"],e1("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return eJ+=e+","+e+"Params,"});var nu=function(e,t){this.id=ed++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:e0,this.set=t?t.getSetter:nL},nc=function(){function e(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,tS(this,+e.duration,1,1),this.data=e.data,Q&&(this._ctx=Q,Q.data.push(this)),ea||t4.wake()}var t=e.prototype;return t.delay=function(e){return e||0===e?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+e-this._delay),this._delay=e,this):this._delay},t.duration=function(e){return arguments.length?this.totalDuration(this._repeat>0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,tS(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(t6(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(tx(this,e),!n._dp||n.parent||ty(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:-((n.totalDuration()-n._tTime)/n._ts))&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&e<this._tDur||this._ts<0&&e>0||!this._tDur&&!e)&&tv(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&1e-8===Math.abs(this._zTime)||!this._initted&&this._dur&&e||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),e8(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+tp(this))%(this._dur+this._rDelay)||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(1&this.iteration())?1-e:e)+tp(this),t):this.duration()?Math.min(1,this._time/this._dur):+(this.rawTime()>0)},t.iteration=function(e,t){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*n,t):this._repeat?tf(this._tTime,n)+1:1},t.timeScale=function(e,t){if(!arguments.length)return -1e-8===this._rts?0:this._rts;if(this._rts===e)return this;var n=this.parent&&this._ts?tm(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||-1e-8===e?0:this._rts,this.totalTime(tA(-Math.abs(this._delay),this.totalDuration(),n),!1!==t),tg(this),td(this)},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(t6(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&1e-8!==Math.abs(this._zTime)&&(this._tTime-=1e-8)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=e5(e);var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&tv(t,this,this._start-this._delay),this}return this._start},t.endTime=function(e){return this._start+(eb(e)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&1>this.totalProgress())?this._tTime%(this._dur+this._rDelay):this._ts?tm(t.rawTime(e),this):this._tTime:this._tTime},t.revert=function(e){void 0===e&&(e=eU);var t=J;return J=e,e7(this)&&(this.timeline&&this.timeline.revert(e),this.totalTime(-.01,e.suppressEvents)),"nested"!==this.data&&!1!==e.kill&&this.kill(),J=t,this},t.globalTime=function(e){for(var t=this,n=arguments.length?e:t.rawTime();t;)n=t._start+n/(Math.abs(t._ts)||1),t=t._dp;return!this.parent&&this._sat?this._sat.globalTime(e):n},t.repeat=function(e){return arguments.length?(this._repeat=e===1/0?-2:e,tN(this)):-2===this._repeat?1/0:this._repeat},t.repeatDelay=function(e){if(arguments.length){var t=this._time;return this._rDelay=e,tN(this),t?this.time(t):this}return this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(tE(this,e),eb(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,eb(t)),this._dur||(this._zTime=-1e-8),this},t.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-1e-8:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},t.isActive=function(){var e,t=this.parent||this._dp,n=this._start;return!!(!t||this._ts&&this._initted&&t.isActive()&&(e=t.rawTime(!0))>=n&&e<this.endTime(!0)-1e-8)},t.eventCallback=function(e,t,n){var r=this.vars;return arguments.length>1?(t?(r[e]=t,n&&(r[e+"Params"]=n),"onUpdate"===e&&(this._onUpdate=t)):delete r[e],this):r[e]},t.then=function(e){var t=this,n=t._prom;return new Promise(function(r){var i=eg(e)?e:te,s=function(){var e=t.then;t.then=null,n&&n(),eg(i)&&(i=i(t))&&(i.then||i===t)&&(t.then=e),r(i),t.then=e};t._initted&&1===t.totalProgress()&&t._ts>=0||!t._tTime&&t._ts<0?s():t._prom=s})},t.kill=function(){tW(this)},e}();tt(nc.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var nd=function(e){function t(t,n){var r;return void 0===t&&(t={}),(r=e.call(this,t)||this).labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=eb(t.sortChildren),Z&&tv(t.parent||Z,R(r),n),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&tb(R(r),t.scrollTrigger),r}L(t,e);var n=t.prototype;return n.to=function(e,t,n){return tM(0,arguments,this),this},n.from=function(e,t,n){return tM(1,arguments,this),this},n.fromTo=function(e,t,n,r){return tM(2,arguments,this),this},n.set=function(e,t,n){return t.duration=0,t.parent=this,ts(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new nE(e,t,tE(this,n),1),this},n.call=function(e,t,n){return tv(this,nE.delayedCall(0,e,t),n)},n.staggerTo=function(e,t,n,r,i,s,a){return n.duration=t,n.stagger=n.stagger||r,n.onComplete=s,n.onCompleteParams=a,n.parent=this,new nE(e,n,tE(this,i)),this},n.staggerFrom=function(e,t,n,r,i,s,a){return n.runBackwards=1,ts(n).immediateRender=eb(n.immediateRender),this.staggerTo(e,t,n,r,i,s,a)},n.staggerFromTo=function(e,t,n,r,i,s,a,o){return r.startAt=n,ts(r).immediateRender=eb(r.immediateRender),this.staggerTo(e,t,r,i,s,a,o)},n.render=function(e,t,n){var r,i,s,a,o,l,u,c,d,h,p,f,m=this._time,g=this._dirty?this.totalDuration():this._tDur,x=this._dur,y=e<=0?0:e5(e),v=this._zTime<0!=e<0&&(this._initted||!x);if(this!==Z&&y>g&&e>=0&&(y=g),y!==this._tTime||n||v){if(m!==this._time&&x&&(y+=this._time-m,e+=this._time-m),r=y,d=this._start,l=!(c=this._ts),v&&(x||(m=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat){if(p=this._yoyo,o=x+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(100*o+e,t,n);if(r=e5(y%o),y===g?(a=this._repeat,r=x):((a=~~(h=e5(y/o)))&&a===h&&(r=x,a--),r>x&&(r=x)),h=tf(this._tTime,o),!m&&this._tTime&&h!==a&&this._tTime-h*o-this._dur<=0&&(h=a),p&&1&a&&(r=x-r,f=1),a!==h&&!this._lock){var b=p&&1&h,_=b===(p&&1&a);if(a<h&&(b=!b),m=b?0:y%x?x:y,this._lock=1,this.render(m||(f?0:e5(a*o)),t,!x)._lock=0,this._tTime=y,!t&&this.parent&&tV(this,"onRepeat"),this.vars.repeatRefresh&&!f&&(this.invalidate()._lock=1,h=a),m&&m!==this._time||!this._ts!==l||this.vars.onRepeat&&!this.parent&&!this._act||(x=this._dur,g=this._tDur,_&&(this._lock=2,m=b?x:-1e-4,this.render(m,!0),this.vars.repeatRefresh&&!f&&this.invalidate()),this._lock=0,!this._ts&&!l))return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(u=tT(this,e5(m),e5(r)))&&(y-=r-(r=u._start)),this._tTime=y,this._time=r,this._act=!!c,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=e,m=0),!m&&y&&x&&!t&&!h&&(tV(this,"onStart"),this._tTime!==y))return this;if(r>=m&&e>=0)for(i=this._first;i;){if(s=i._next,(i._act||r>=i._start)&&i._ts&&u!==i){if(i.parent!==this)return this.render(e,t,n);if(i.render(i._ts>0?(r-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(r-i._start)*i._ts,t,n),r!==this._time||!this._ts&&!l){u=0,s&&(y+=this._zTime=-1e-8);break}}i=s}else{i=this._last;for(var w=e<0?e:r;i;){if(s=i._prev,(i._act||w<=i._end)&&i._ts&&u!==i){if(i.parent!==this)return this.render(e,t,n);if(i.render(i._ts>0?(w-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(w-i._start)*i._ts,t,n||J&&e7(i)),r!==this._time||!this._ts&&!l){u=0,s&&(y+=this._zTime=w?-1e-8:1e-8);break}}i=s}}if(u&&!t&&(this.pause(),u.render(r>=m?0:-1e-8)._zTime=r>=m?1:-1,this._ts))return this._start=d,tg(this),this.render(e,t,n);this._onUpdate&&!t&&tV(this,"onUpdate",!0),(y===g&&this._tTime>=this.totalDuration()||!y&&m)&&(d===this._start||Math.abs(c)!==Math.abs(this._ts))&&!this._lock&&((e||!x)&&(y===g&&this._ts>0||!y&&this._ts<0)&&tu(this,1),t||e<0&&!m||!y&&!m&&g||(tV(this,y===g&&e>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(y<g&&this.timeScale()>0)&&this._prom()))}return this},n.add=function(e,t){var n=this;if(ex(t)||(t=tE(this,t,e)),!(e instanceof nc)){if(ej(e))return e.forEach(function(e){return n.add(e,t)}),this;if(em(e))return this.addLabel(e,t);if(!eg(e))return this;e=nE.delayedCall(0,e)}return this!==e?tv(this,e,t):this},n.getChildren=function(e,t,n,r){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===r&&(r=-1e8);for(var i=[],s=this._first;s;)s._start>=r&&(s instanceof nE?t&&i.push(s):(n&&i.push(s),e&&i.push.apply(i,s.getChildren(!0,t,n)))),s=s._next;return i},n.getById=function(e){for(var t=this.getChildren(1,1,1),n=t.length;n--;)if(t[n].vars.id===e)return t[n]},n.remove=function(e){return em(e)?this.removeLabel(e):eg(e)?this.killTweensOf(e):(e.parent===this&&tl(this,e),e===this._recent&&(this._recent=this._last),tc(this))},n.totalTime=function(t,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=e5(t4.time-(this._ts>0?t/this._ts:-((this.totalDuration()-t)/this._ts)))),e.prototype.totalTime.call(this,t,n),this._forcing=0,this):this._tTime},n.addLabel=function(e,t){return this.labels[e]=tE(this,t),this},n.removeLabel=function(e){return delete this.labels[e],this},n.addPause=function(e,t,n){var r=nE.delayedCall(0,t||eB,n);return r.data="isPause",this._hasPause=1,tv(this,r,tE(this,e))},n.removePause=function(e){var t=this._first;for(e=tE(this,e);t;)t._start===e&&"isPause"===t.data&&tu(t),t=t._next},n.killTweensOf=function(e,t,n){for(var r=this.getTweensOf(e,n),i=r.length;i--;)ng!==r[i]&&r[i].kill(e,t);return this},n.getTweensOf=function(e,t){for(var n,r=[],i=tP(e),s=this._first,a=ex(t);s;)s instanceof nE?e4(s._targets,i)&&(a?(!ng||s._initted&&s._ts)&&s.globalTime(0)<=t&&s.globalTime(s.totalDuration())>t:!t||s.isActive())&&r.push(s):(n=s.getTweensOf(i,t)).length&&r.push.apply(r,n),s=s._next;return r},n.tweenTo=function(e,t){t=t||{};var n,r=this,i=tE(r,e),s=t,a=s.startAt,o=s.onStart,l=s.onStartParams,u=s.immediateRender,c=nE.to(r,tt({ease:t.ease||"none",lazy:!1,immediateRender:!1,time:i,overwrite:"auto",duration:t.duration||Math.abs((i-(a&&"time"in a?a.time:r._time))/r.timeScale())||1e-8,onStart:function(){if(r.pause(),!n){var e=t.duration||Math.abs((i-(a&&"time"in a?a.time:r._time))/r.timeScale());c._dur!==e&&tS(c,e,0,1).render(c._time,!0,!0),n=1}o&&o.apply(c,l||[])}},t));return u?c.render(0):c},n.tweenFromTo=function(e,t,n){return this.tweenTo(t,tt({startAt:{time:tE(this,e)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(e){return void 0===e&&(e=this._time),tY(this,tE(this,e))},n.previousLabel=function(e){return void 0===e&&(e=this._time),tY(this,tE(this,e),1)},n.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+1e-8)},n.shiftChildren=function(e,t,n){void 0===n&&(n=0);var r,i=this._first,s=this.labels;for(e=e5(e);i;)i._start>=n&&(i._start+=e,i._end+=e),i=i._next;if(t)for(r in s)s[r]>=n&&(s[r]+=e);return tc(this)},n.invalidate=function(t){var n=this._first;for(this._lock=0;n;)n.invalidate(t),n=n._next;return e.prototype.invalidate.call(this,t)},n.clear=function(e){void 0===e&&(e=!0);for(var t,n=this._first;n;)t=n._next,this.remove(n),n=t;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),tc(this)},n.totalDuration=function(e){var t,n,r,i=0,s=this._last,a=1e8;if(arguments.length)return this.timeScale((this._repeat<0?this.duration():this.totalDuration())/(this.reversed()?-e:e));if(this._dirty){for(r=this.parent;s;)t=s._prev,s._dirty&&s.totalDuration(),(n=s._start)>a&&this._sort&&s._ts&&!this._lock?(this._lock=1,tv(this,s,n-s._delay,1)._lock=0):a=n,n<0&&s._ts&&(i-=n,(!r&&!this._dp||r&&r.smoothChildTiming)&&(this._start+=e5(n/this._ts),this._time-=n,this._tTime-=n),this.shiftChildren(-n,!1,-Infinity),a=0),s._end>i&&s._ts&&(i=s._end),s=t;tS(this,this===Z&&this._time>i?this._time:i,1,1),this._dirty=0}return this._tDur},t.updateRoot=function(e){if(Z._ts&&(e8(Z,tm(e,Z)),ei=t4.frame),t4.frame>=eG){eG+=eo.autoSleep||120;var t=Z._first;if((!t||!t._ts)&&eo.autoSleep&&t4._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||t4.sleep()}}},t}(nc);tt(nd.prototype,{_lock:0,_hasPause:0,_forcing:0});var nh,np,nf,nm,ng,nx,ny=function(e,t,n,r,i,s,a){var o,l,u,c,d,h,p,f,m=new nU(this._pt,e,t,0,1,nD,null,i),g=0,x=0;for(m.b=n,m.e=r,n+="",r+="",(p=~r.indexOf("random("))&&(r=tH(r)),s&&(s(f=[n,r],e,t),n=f[0],r=f[1]),l=n.match(eM)||[];o=eM.exec(r);)c=o[0],d=r.substring(g,o.index),u?u=(u+1)%5:"rgba("===d.substr(-5)&&(u=1),c!==l[x++]&&(h=parseFloat(l[x-1])||0,m._pt={_next:m._pt,p:d||1===x?d:",",s:h,c:"="===c.charAt(1)?e3(h,c)-h:parseFloat(c)-h,m:u&&u<4?Math.round:0},g=eM.lastIndex);return m.c=g<r.length?r.substring(g,r.length):"",m.fp=a,(eO.test(r)||p)&&(m.e=0),this._pt=m,m},nv=function(e,t,n,r,i,s,a,o,l,u){eg(r)&&(r=r(i||0,e,s));var c,d=e[t],h="get"!==n?n:eg(d)?l?e[t.indexOf("set")||!eg(e["get"+t.substr(3)])?t:"get"+t.substr(3)](l):e[t]():d,p=eg(d)?l?nA:nO:nM;if(em(r)&&(~r.indexOf("random(")&&(r=tH(r)),"="===r.charAt(1)&&((c=e3(h,r)+(tR(h)||0))||0===c)&&(r=c)),!u||h!==r||nx)return isNaN(h*r)||""===r?(d||t in e||eD(t,r),ny.call(this,e,t,h,r,p,o||eo.stringFilter,l)):(c=new nU(this._pt,e,t,+h||0,r-(h||0),"boolean"==typeof d?nP:nI,0,p),l&&(c.fp=l),a&&c.modifier(a,this,e),this._pt=c)},nb=function(e,t,n,r,i){if(eg(e)&&(e=nS(e,i,t,n,r)),!ev(e)||e.style&&e.nodeType||ej(e)||ek(e))return em(e)?nS(e,i,t,n,r):e;var s,a={};for(s in e)a[s]=nS(e[s],i,t,n,r);return a},n_=function(e,t,n,r,i,s){var a,o,l,u;if(eV[e]&&!1!==(a=new eV[e]).init(i,a.rawVars?t[e]:nb(t[e],r,i,s,n),n,r,s)&&(n._pt=o=new nU(n._pt,i,e,0,1,a.render,a,0,a.priority),n!==es))for(l=n._ptLookup[n._targets.indexOf(i)],u=a._props.length;u--;)l[a._props[u]]=o;return a},nw=function e(t,n,r){var i,s,a,o,l,u,c,d,h,p,f,m,g,x=t.vars,y=x.ease,v=x.startAt,b=x.immediateRender,_=x.lazy,w=x.onUpdate,k=x.runBackwards,j=x.yoyoEase,T=x.keyframes,S=x.autoRevert,N=t._dur,C=t._startAt,E=t._targets,M=t.parent,O=M&&"nested"===M.data?M.vars.targets:E,A="auto"===t._overwrite&&!X,R=t.timeline,L=x.easeReverse||j;if(!R||T&&y||(y="none"),t._ease=ni(y,el.ease),t._rEase=L&&(ni(L)||t._ease),t._from=!R&&!!x.runBackwards,t._from&&(t.ratio=1),!R||T&&!x.stagger){if(m=(d=E[0]?eZ(E[0]).harness:0)&&x[d.prop],i=ti(x,eH),C&&(C._zTime<0&&C.progress(1),n<0&&k&&b&&!S?C.render(-1,!0):C.revert(k&&N?eq:e$),C._lazy=0),v){if(tu(t._startAt=nE.set(E,tt({data:"isStart",overwrite:!1,parent:M,immediateRender:!0,lazy:!C&&eb(_),startAt:null,delay:0,onUpdate:w&&function(){return tV(t,"onUpdate")},stagger:0},v))),t._startAt._dp=0,t._startAt._sat=t,n<0&&(J||!b&&!S)&&t._startAt.revert(eq),b&&N&&n<=0&&r<=0){n&&(t._zTime=n);return}}else if(k&&N&&!C)if(n&&(b=!1),a=tt({overwrite:!1,data:"isFromStart",lazy:b&&!C&&eb(_),immediateRender:b,stagger:0,parent:M},i),m&&(a[d.prop]=m),tu(t._startAt=nE.set(E,a)),t._startAt._dp=0,t._startAt._sat=t,n<0&&(J?t._startAt.revert(eq):t._startAt.render(-1,!0)),t._zTime=n,b){if(!n)return}else e(t._startAt,1e-8,1e-8);for(t._pt=t._ptCache=0,_=N&&eb(_)||_&&!N,s=0;s<E.length;s++){if(c=(l=E[s])._gsap||eQ(E)[s]._gsap,t._ptLookup[s]=p={},eY[c.id]&&eK.length&&e6(),f=O===E?s:O.indexOf(l),d&&!1!==(h=new d).init(l,m||i,t,f,O)&&(t._pt=o=new nU(t._pt,l,h.name,0,1,h.render,h,0,h.priority),h._props.forEach(function(e){p[e]=o}),h.priority&&(u=1)),!d||m)for(a in i)eV[a]&&(h=n_(a,i,t,f,l,O))?h.priority&&(u=1):p[a]=o=nv.call(t,l,a,"get",i[a],f,O,0,x.stringFilter);t._op&&t._op[s]&&t.kill(l,t._op[s]),A&&t._pt&&(ng=t,Z.killTweensOf(l,p,t.globalTime(n)),g=!t.parent,ng=0),t._pt&&_&&(eY[c.id]=1)}u&&nq(t),t._onInit&&t._onInit(t)}t._onUpdate=w,t._initted=(!t._op||t._pt)&&!g,T&&n<=0&&R.render(1e8,!0,!0)},nk=function(e,t,n,r,i,s,a,o){var l,u,c,d,h=(e._pt&&e._ptCache||(e._ptCache={}))[t];if(!h)for(h=e._ptCache[t]=[],c=e._ptLookup,d=e._targets.length;d--;){if((l=c[d][t])&&l.d&&l.d._pt)for(l=l.d._pt;l&&l.p!==t&&l.fp!==t;)l=l._next;if(!l)return nx=1,e.vars[t]="+=0",nw(e,a),nx=0,o?ez(t+" not eligible for reset. Try splitting into individual properties"):1;h.push(l)}for(d=h.length;d--;)(l=(u=h[d])._pt||u).s=(r||0===r)&&!i?r:l.s+(r||0)+s*l.c,l.c=n-l.s,u.e&&(u.e=e2(n)+tR(u.e)),u.b&&(u.b=l.s+tR(u.b))},nj=function(e,t){var n,r,i,s,a=e[0]?eZ(e[0]).harness:0,o=a&&a.aliases;if(!o)return t;for(r in n=tn({},t),o)if(r in n)for(i=(s=o[r].split(",")).length;i--;)n[s[i]]=n[r];return n},nT=function(e,t,n,r){var i,s,a=t.ease||r||"power1.inOut";if(ej(t))s=n[e]||(n[e]=[]),t.forEach(function(e,n){return s.push({t:n/(t.length-1)*100,v:e,e:a})});else for(i in t)s=n[i]||(n[i]=[]),"ease"===i||s.push({t:parseFloat(e),v:t[i],e:a})},nS=function(e,t,n,r,i){return eg(e)?e.call(t,n,r,i):em(e)&&~e.indexOf("random(")?tH(e):e},nN=eJ+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",nC={};e1(nN+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return nC[e]=1});var nE=function(e){function t(t,n,r,i){"number"==typeof n&&(r.duration=n,n=r,r=null);var s,a,o,l,u,c,d,h,p=e.call(this,i?n:ts(n))||this,f=p.vars,m=f.duration,g=f.delay,x=f.immediateRender,y=f.stagger,v=f.overwrite,b=f.keyframes,_=f.defaults,w=f.scrollTrigger,k=n.parent||Z,j=(ej(t)||ek(t)?ex(t[0]):"length"in n)?[t]:tP(t);if(p._targets=j.length?eQ(j):ez("GSAP target "+t+" not found. https://gsap.com",!eo.nullTargetWarn)||[],p._ptLookup=[],p._overwrite=v,b||y||ew(m)||ew(g)){var T=(n=p.vars).easeReverse||n.yoyoEase;if((s=p.timeline=new nd({data:"nested",defaults:_||{},targets:k&&"nested"===k.data?k.vars.targets:j})).kill(),s.parent=s._dp=R(p),s._start=0,y||ew(m)||ew(g)){if(l=j.length,d=y&&tF(y),ev(y))for(u in y)~nN.indexOf(u)&&(h||(h={}),h[u]=y[u]);for(a=0;a<l;a++)(o=ti(n,nC)).stagger=0,T&&(o.easeReverse=T),h&&tn(o,h),c=j[a],o.duration=+nS(m,R(p),a,c,j),o.delay=(+nS(g,R(p),a,c,j)||0)-p._delay,!y&&1===l&&o.delay&&(p._delay=g=o.delay,p._start+=g,o.delay=0),s.to(c,o,d?d(a,c,j):0),s._ease=t7.none;s.duration()?m=g=0:p.timeline=0}else if(b){ts(tt(s.vars.defaults,{ease:"none"})),s._ease=ni(b.ease||n.ease||"none");var S,N,C,E=0;if(ej(b))b.forEach(function(e){return s.to(j,e,">")}),s.duration();else{for(u in o={},b)"ease"===u||"easeEach"===u||nT(u,b[u],o,b.easeEach);for(u in o)for(S=o[u].sort(function(e,t){return e.t-t.t}),E=0,a=0;a<S.length;a++)(C={ease:(N=S[a]).e,duration:(N.t-(a?S[a-1].t:0))/100*m})[u]=N.v,s.to(j,C,E),E+=C.duration;s.duration()<m&&s.to({},{duration:m-s.duration()})}}m||p.duration(m=s.duration())}else p.timeline=0;return!0!==v||X||(ng=R(p),Z.killTweensOf(j),ng=0),tv(k,R(p),r),n.reversed&&p.reverse(),n.paused&&p.paused(!0),(x||!m&&!b&&p._start===e5(k._time)&&eb(x)&&function e(t){return!t||t._ts&&e(t.parent)}(R(p))&&"nested"!==k.data)&&(p._tTime=-1e-8,p.render(Math.max(0,-g)||0)),w&&tb(R(p),w),p}L(t,e);var n=t.prototype;return n.render=function(e,t,n){var r,i,s,a,o,l,u,c,d=this._time,h=this._tDur,p=this._dur,f=e<0,m=e>h-1e-8&&!f?h:e<1e-8?0:e;if(p){if(m!==this._tTime||!e||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(r=m,c=this.timeline,this._repeat){if(a=p+this._rDelay,this._repeat<-1&&f)return this.totalTime(100*a+e,t,n);if(r=e5(m%a),m===h?(s=this._repeat,r=p):(s=~~(o=e5(m/a)))&&s===o?(r=p,s--):r>p&&(r=p),(l=this._yoyo&&1&s)&&(r=p-r),o=tf(this._tTime,a),r===d&&!n&&this._initted&&s===o)return this._tTime=m,this;s!==o&&this.vars.repeatRefresh&&!l&&!this._lock&&r!==a&&this._initted&&(this._lock=n=1,this.render(e5(a*s),!0).invalidate()._lock=0)}if(!this._initted){if(t_(this,f?e:r,n,t,m))return this._tTime=0,this;if(d!==this._time&&!(n&&this.vars.repeatRefresh&&s!==o))return this;if(p!==this._dur)return this.render(e,t,n)}if(this._rEase){var g=r<d;if(g!==this._inv){var x=g?d:p-d;this._inv=g,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=d,this._invRecip=x?(g?-1:1)/x:0,this._invScale=g?-this.ratio:1-this.ratio,this._invEase=g?this._rEase:this._ease}this.ratio=u=this._invRatio+this._invScale*this._invEase((r-this._invTime)*this._invRecip)}else this.ratio=u=this._ease(r/p);if(this._from&&(this.ratio=u=1-u),this._tTime=m,this._time=r,!this._act&&this._ts&&(this._act=1,this._lazy=0),!d&&m&&!t&&!o&&(tV(this,"onStart"),this._tTime!==m))return this;for(i=this._pt;i;)i.r(u,i.d),i=i._next;c&&c.render(e<0?e:c._dur*c._ease(r/this._dur),t,n)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(f&&th(this,e,t,n),tV(this,"onUpdate")),this._repeat&&s!==o&&this.vars.onRepeat&&!t&&this.parent&&tV(this,"onRepeat"),(m===this._tDur||!m)&&this._tTime===m&&(f&&!this._onUpdate&&th(this,e,!0,!0),(e||!p)&&(m===this._tDur&&this._ts>0||!m&&this._ts<0)&&tu(this,1),!t&&!(f&&!d)&&(m||d||l)&&(tV(this,m===h?"onComplete":"onReverseComplete",!0),this._prom&&!(m<h&&this.timeScale()>0)&&this._prom()))}}else tj(this,e,t,n);return this},n.targets=function(){return this._targets},n.invalidate=function(t){return t&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),e.prototype.invalidate.call(this,t)},n.resetTo=function(e,t,n,r,i){ea||t4.wake(),this._ts||this.play();var s=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return(this._initted||nw(this,s),nk(this,e,t,n,r,this._ease(s/this._dur),s,i))?this.resetTo(e,t,n,r,1):(tx(this,0),this.parent||to(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(e,t){if(void 0===t&&(t="all"),!e&&(!t||"all"===t))return this._lazy=this._pt=0,this.parent?tW(this):this.scrollTrigger&&this.scrollTrigger.kill(!!J),this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(e,t,ng&&!0!==ng.vars.overwrite)._first||tW(this),this.parent&&n!==this.timeline.totalDuration()&&tS(this,this._dur*this.timeline._tDur/n,0,1),this}var r,i,s,a,o,l,u,c=this._targets,d=e?tP(e):c,h=this._ptLookup,p=this._pt;if((!t||"all"===t)&&ta(c,d))return"all"===t&&(this._pt=0),tW(this);for(r=this._op=this._op||[],"all"!==t&&(em(t)&&(o={},e1(t,function(e){return o[e]=1}),t=o),t=nj(c,t)),u=c.length;u--;)if(~d.indexOf(c[u]))for(o in i=h[u],"all"===t?(r[u]=t,a=i,s={}):(s=r[u]=r[u]||{},a=t),a)(l=i&&i[o])&&("kill"in l.d&&!0!==l.d.kill(o)||tl(this,l,"_pt"),delete i[o]),"all"!==s&&(s[o]=1);return this._initted&&!this._pt&&p&&tW(this),this},t.to=function(e,n){return new t(e,n,arguments[2])},t.from=function(e,t){return tM(1,arguments)},t.delayedCall=function(e,n,r,i){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:n,onReverseComplete:n,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},t.fromTo=function(e,t,n){return tM(2,arguments)},t.set=function(e,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(e,n)},t.killTweensOf=function(e,t,n){return Z.killTweensOf(e,t,n)},t}(nc);tt(nE.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),e1("staggerTo,staggerFrom,staggerFromTo",function(e){nE[e]=function(){var t=new nd,n=tL.call(arguments,0);return n.splice("staggerFromTo"===e?5:4,0,0),t[e].apply(t,n)}});var nM=function(e,t,n){return e[t]=n},nO=function(e,t,n){return e[t](n)},nA=function(e,t,n,r){return e[t](r.fp,n)},nR=function(e,t,n){return e.setAttribute(t,n)},nL=function(e,t){return eg(e[t])?nO:ey(e[t])&&e.setAttribute?nR:nM},nI=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},nP=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},nD=function(e,t){var n=t._pt,r="";if(!e&&t.b)r=t.b;else if(1===e&&t.e)r=t.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*e):Math.round((n.s+n.c*e)*1e4)/1e4)+r,n=n._next;r+=t.c}t.set(t.t,t.p,r,t)},nz=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},nF=function(e,t,n,r){for(var i,s=this._pt;s;)i=s._next,s.p===r&&s.modifier(e,t,n),s=i},nB=function(e){for(var t,n,r=this._pt;r;)n=r._next,(r.p!==e||r.op)&&r.op!==e?r.dep||(t=1):tl(this,r,"_pt"),r=n;return!t},n$=function(e,t,n,r){r.mSet(e,t,r.m.call(r.tween,n,r.mt),r)},nq=function(e){for(var t,n,r,i,s=e._pt;s;){for(t=s._next,n=r;n&&n.pr>s.pr;)n=n._next;(s._prev=n?n._prev:i)?s._prev._next=s:r=s,(s._next=n)?n._prev=s:i=s,s=t}e._pt=r},nU=function(){function e(e,t,n,r,i,s,a,o,l){this.t=t,this.s=r,this.c=i,this.p=n,this.r=s||nI,this.d=a||this,this.set=o||nM,this.pr=l||0,this._next=e,e&&(e._prev=this)}return e.prototype.modifier=function(e,t,n){this.mSet=this.mSet||this.set,this.set=n$,this.m=e,this.mt=n,this.tween=t},e}();e1(eJ+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(e){return eH[e]=1}),eL.TweenMax=eL.TweenLite=nE,eL.TimelineLite=eL.TimelineMax=nd,Z=new nd({sortChildren:!1,defaults:el,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),eo.stringFilter=t3;var nH=[],nK={},nY=[],nV=0,nW=0,nG=function(e){return(nK[e]||nY).map(function(e){return e()})},nX=function(){var e=Date.now(),t=[];e-nV>2&&(nG("matchMediaInit"),nH.forEach(function(e){var n,r,i,s,a=e.queries,o=e.conditions;for(r in a)(n=ee.matchMedia(a[r]).matches)&&(i=1),n!==o[r]&&(o[r]=n,s=1);s&&(e.revert(),i&&t.push(e))}),nG("matchMediaRevert"),t.forEach(function(e){return e.onMatch(e,function(t){return e.add(null,t)})}),nV=e,nG("matchMedia"))},nJ=function(){function e(e,t){this.selector=t&&tD(t),this.data=[],this._r=[],this.isReverted=!1,this.id=nW++,e&&this.add(e)}var t=e.prototype;return t.add=function(e,t,n){eg(e)&&(n=t,t=e,e=eg);var r=this,i=function(){var e,i=Q,s=r.selector;return i&&i!==r&&i.data.push(r),n&&(r.selector=tD(n)),Q=r,e=t.apply(r,arguments),eg(e)&&r._r.push(e),Q=i,r.selector=s,r.isReverted=!1,e};return r.last=i,e===eg?i(r,function(e){return r.add(null,e)}):e?r[e]=i:i},t.ignore=function(e){var t=Q;Q=null,e(this),Q=t},t.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof e?t.push.apply(t,n.getTweens()):n instanceof nE&&!(n.parent&&"nested"===n.parent.data)&&t.push(n)}),t},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(e,t){var n=this;if(e){for(var r,i=n.getTweens(),s=n.data.length;s--;)"isFlip"===(r=n.data[s]).data&&(r.revert(),r.getChildren(!0,!0,!1).forEach(function(e){return i.splice(i.indexOf(e),1)}));for(i.map(function(e){return{g:e._dur||e._delay||e._sat&&!e._sat.vars.immediateRender?e.globalTime(0):-1/0,t:e}}).sort(function(e,t){return t.g-e.g||-1/0}).forEach(function(t){return t.t.revert(e)}),s=n.data.length;s--;)(r=n.data[s])instanceof nd?"nested"!==r.data&&(r.scrollTrigger&&r.scrollTrigger.revert(),r.kill()):r instanceof nE||!r.revert||r.revert(e);n._r.forEach(function(t){return t(e,n)}),n.isReverted=!0}else this.data.forEach(function(e){return e.kill&&e.kill()});if(this.clear(),t)for(var a=nH.length;a--;)nH[a].id===this.id&&nH.splice(a,1)},t.revert=function(e){this.kill(e||{})},e}(),nQ=function(){function e(e){this.contexts=[],this.scope=e,Q&&Q.data.push(this)}var t=e.prototype;return t.add=function(e,t,n){ev(e)||(e={matches:e});var r,i,s,a=new nJ(0,n||this.scope),o=a.conditions={};for(i in Q&&!a.selector&&(a.selector=Q.selector),this.contexts.push(a),t=a.add("onMatch",t),a.queries=e,e)"all"===i?s=1:(r=ee.matchMedia(e[i]))&&(0>nH.indexOf(a)&&nH.push(a),(o[i]=r.matches)&&(s=1),r.addListener?r.addListener(nX):r.addEventListener("change",nX));return s&&t(a,function(e){return a.add(null,e)}),this},t.revert=function(e){this.kill(e||{})},t.kill=function(e){this.contexts.forEach(function(t){return t.kill(e,!0)})},e}(),nZ={registerPlugin:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach(function(e){return tX(e)})},timeline:function(e){return new nd(e)},getTweensOf:function(e,t){return Z.getTweensOf(e,t)},getProperty:function(e,t,n,r){em(e)&&(e=tP(e)[0]);var i=eZ(e||{}).get,s=n?te:e9;return"native"===n&&(n=""),e?t?s((eV[t]&&eV[t].get||i)(e,t,n,r)):function(t,n,r){return s((eV[t]&&eV[t].get||i)(e,t,n,r))}:e},quickSetter:function(e,t,n){if((e=tP(e)).length>1){var r=e.map(function(e){return n5.quickSetter(e,t,n)}),i=r.length;return function(e){for(var t=i;t--;)r[t](e)}}e=e[0]||{};var s=eV[t],a=eZ(e),o=a.harness&&(a.harness.aliases||{})[t]||t,l=s?function(t){var r=new s;es._pt=0,r.init(e,n?t+n:t,es,0,[e]),r.render(1,r),es._pt&&nz(1,es)}:a.set(e,o);return s?l:function(t){return l(e,o,n?t+n:t,a,1)}},quickTo:function(e,t,n){var r,i=n5.to(e,tt(((r={})[t]="+=0.1",r.paused=!0,r.stagger=0,r),n||{})),s=function(e,n,r){return i.resetTo(t,e,n,r)};return s.tween=i,s},isTweening:function(e){return Z.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=ni(e.ease,el.ease)),tr(el,e||{})},config:function(e){return tr(eo,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,r=e.plugins,i=e.defaults,s=e.extendTimeline;(r||"").split(",").forEach(function(e){return e&&!eV[e]&&!eL[e]&&ez(t+" effect requires "+e+" plugin.")}),eW[t]=function(e,t,r){return n(tP(e),tt(t||{},i),r)},s&&(nd.prototype[t]=function(e,n,r){return this.add(eW[t](e,ev(n)?n:(r=n)&&{},this),r)})},registerEase:function(e,t){t7[e]=ni(t)},parseEase:function(e,t){return arguments.length?ni(e,t):t7},getById:function(e){return Z.getById(e)},exportRoot:function(e,t){void 0===e&&(e={});var n,r,i=new nd(e);for(i.smoothChildTiming=eb(e.smoothChildTiming),Z.remove(i),i._dp=0,i._time=i._tTime=Z._time,n=Z._first;n;)r=n._next,(t||!(!n._dur&&n instanceof nE&&n.vars.onComplete===n._targets[0]))&&tv(i,n,n._start-n._delay),n=r;return tv(Z,i,0),i},context:function(e,t){return e?new nJ(e,t):Q},matchMedia:function(e){return new nQ(e)},matchMediaRefresh:function(){return nH.forEach(function(e){var t,n,r=e.conditions;for(n in r)r[n]&&(r[n]=!1,t=1);t&&e.revert()})||nX()},addEventListener:function(e,t){var n=nK[e]||(nK[e]=[]);~n.indexOf(t)||n.push(t)},removeEventListener:function(e,t){var n=nK[e],r=n&&n.indexOf(t);r>=0&&n.splice(r,1)},utils:{wrap:function e(t,n,r){var i=n-t;return ej(t)?tU(t,e(0,t.length),n):tO(r,function(e){return(i+(e-t)%i)%i+t})},wrapYoyo:function e(t,n,r){var i=n-t,s=2*i;return ej(t)?tU(t,e(0,t.length-1),n):tO(r,function(e){return e=(s+(e-t)%s)%s||0,t+(e>i?s-e:e)})},distribute:tF,random:tq,snap:t$,normalize:function(e,t,n){return tK(e,t,0,1,n)},getUnit:tR,clamp:function(e,t,n){return tO(n,function(n){return tA(e,t,n)})},splitColor:tZ,toArray:tP,selector:tD,mapRange:tK,pipe:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduce(function(e,t){return t(e)},e)}},unitize:function(e,t){return function(n){return e(parseFloat(n))+(t||tR(n))}},interpolate:function e(t,n,r,i){var s=isNaN(t+n)?0:function(e){return(1-e)*t+e*n};if(!s){var a,o,l,u,c,d=em(t),h={};if(!0===r&&(i=1)&&(r=null),d)t={p:t},n={p:n};else if(ej(t)&&!ej(n)){for(l=[],c=(u=t.length)-2,o=1;o<u;o++)l.push(e(t[o-1],t[o]));u--,s=function(e){var t=Math.min(c,~~(e*=u));return l[t](e-t)},r=n}else i||(t=tn(ej(t)?[]:{},t));if(!l){for(a in n)nv.call(h,t,a,"get",n[a]);s=function(e){return nz(e,h)||(d?t.p:t)}}}return tO(r,s)},shuffle:tz},install:eP,effects:eW,ticker:t4,updateRoot:nd.updateRoot,plugins:eV,globalTimeline:Z,core:{PropTween:nU,globals:eF,Tween:nE,Timeline:nd,Animation:nc,getCache:eZ,_removeLinkedListItem:tl,reverting:function(){return J},context:function(e){return e&&Q&&(Q.data.push(e),e._ctx=Q),Q},suppressOverwrites:function(e){return X=e}}};e1("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return nZ[e]=nE[e]}),t4.add(nd.updateRoot),es=nZ.to({},{duration:0});var n0=function(e,t){for(var n=e._pt;n&&n.p!==t&&n.op!==t&&n.fp!==t;)n=n._next;return n},n1=function(e,t){var n,r,i,s=e._targets;for(n in t)for(r=s.length;r--;)(i=e._ptLookup[r][n])&&(i=i.d)&&(i._pt&&(i=n0(i,n)),i&&i.modifier&&i.modifier(t[n],e,s[r],n))},n2=function(e,t){return{name:e,headless:1,rawVars:1,init:function(e,n,r){r._onInit=function(e){var r,i;if(em(n)&&(r={},e1(n,function(e){return r[e]=1}),n=r),t){for(i in r={},n)r[i]=t(n[i]);n=r}n1(e,n)}}}},n5=nZ.registerPlugin({name:"attr",init:function(e,t,n,r,i){var s,a,o;for(s in this.tween=n,t)o=e.getAttribute(s)||"",(a=this.add(e,"setAttribute",(o||0)+"",t[s],r,i,0,0,s)).op=s,a.b=o,this._props.push(s)},render:function(e,t){for(var n=t._pt;n;)J?n.set(n.t,n.p,n.b,n):n.r(e,n.d),n=n._next}},{name:"endArray",headless:1,init:function(e,t){for(var n=t.length;n--;)this.add(e,n,e[n]||0,t[n],0,0,0,0,0,1)}},n2("roundProps",tB),n2("modifiers"),n2("snap",t$))||nZ;nE.version=nd.version=n5.version="3.15.0",er=1,e_()&&t6(),t7.Power0,t7.Power1,t7.Power2,t7.Power3,t7.Power4,t7.Linear,t7.Quad,t7.Cubic,t7.Quart,t7.Quint,t7.Strong,t7.Elastic,t7.Back,t7.SteppedEase,t7.Bounce,t7.Sine,t7.Expo,t7.Circ;var n3,n4,n6,n7,n8,n9,re,rt={},rn=180/Math.PI,rr=Math.PI/180,ri=Math.atan2,rs=/([A-Z])/g,ra=/(left|right|width|margin|padding|x)/i,ro=/[\s,\(]\S/,rl={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},ru=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},rc=function(e,t){return t.set(t.t,t.p,1===e?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},rd=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},rh=function(e,t){return t.set(t.t,t.p,1===e?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},rp=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},rf=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},rm=function(e,t){return t.set(t.t,t.p,1!==e?t.b:t.e,t)},rg=function(e,t,n){return e.style[t]=n},rx=function(e,t,n){return e.style.setProperty(t,n)},ry=function(e,t,n){return e._gsap[t]=n},rv=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},rb=function(e,t,n,r,i){var s=e._gsap;s.scaleX=s.scaleY=n,s.renderTransform(i,s)},r_=function(e,t,n,r,i){var s=e._gsap;s[t]=n,s.renderTransform(i,s)},rw="transform",rk=rw+"Origin",rj=function e(t,n){var r=this,i=this.target,s=i.style,a=i._gsap;if(t in rt&&s){if(this.tfm=this.tfm||{},"transform"===t)return rl.transform.split(",").forEach(function(t){return e.call(r,t,n)});if(~(t=rl[t]||t).indexOf(",")?t.split(",").forEach(function(e){return r.tfm[e]=rq(i,e)}):this.tfm[t]=a.x?a[t]:rq(i,t),t===rk&&(this.tfm.zOrigin=a.zOrigin),this.props.indexOf(rw)>=0)return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(rk,n,"")),t=rw}(s||n)&&this.props.push(t,n,s[t])},rT=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},rS=function(){var e,t,n=this.props,r=this.target,i=r.style,s=r._gsap;for(e=0;e<n.length;e+=3)n[e+1]?2===n[e+1]?r[n[e]](n[e+2]):r[n[e]]=n[e+2]:n[e+2]?i[n[e]]=n[e+2]:i.removeProperty("--"===n[e].substr(0,2)?n[e]:n[e].replace(rs,"-$1").toLowerCase());if(this.tfm){for(t in this.tfm)s[t]=this.tfm[t];s.svg&&(s.renderTransform(),r.setAttribute("data-svg-origin",this.svgo||"")),(e=n9())&&e.isStart||i[rw]||(rT(i),s.zOrigin&&i[rk]&&(i[rk]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},rN=function(e,t){var n={target:e,props:[],revert:rS,save:rj};return e._gsap||n5.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(e){return n.save(e)}),n},rC=function(e,t){var n=n3.createElementNS?n3.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):n3.createElement(e);return n&&n.style?n:n3.createElement(e)},rE=function e(t,n,r){var i=getComputedStyle(t);return i[n]||i.getPropertyValue(n.replace(rs,"-$1").toLowerCase())||i.getPropertyValue(n)||!r&&e(t,rO(n)||n,1)||""},rM="O,Moz,ms,Ms,Webkit".split(","),rO=function(e,t,n){var r=(t||n7).style,i=5;if(e in r&&!n)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);i--&&!(rM[i]+e in r););return i<0?null:(3===i?"ms":i>=0?rM[i]:"")+e},rA=function(){"u">typeof window&&window.document&&(n4=(n3=window.document).documentElement,n7=rC("div")||{style:{}},rC("div"),rk=(rw=rO(rw))+"Origin",n7.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",re=!!rO("perspective"),n9=n5.core.reverting,n6=1)},rR=function(e){var t,n=e.ownerSVGElement,r=rC("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=e.cloneNode(!0);i.style.display="block",r.appendChild(i),n4.appendChild(r);try{t=i.getBBox()}catch(e){}return r.removeChild(i),n4.removeChild(r),t},rL=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},rI=function(e){var t,n;try{t=e.getBBox()}catch(r){t=rR(e),n=1}return t&&(t.width||t.height)||n||(t=rR(e)),!t||t.width||t.x||t.y?t:{x:+rL(e,["x","cx","x1"])||0,y:+rL(e,["y","cy","y1"])||0,width:0,height:0}},rP=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&rI(e))},rD=function(e,t){if(t){var n,r=e.style;t in rt&&t!==rk&&(t=rw),r.removeProperty?(("ms"===(n=t.substr(0,2))||"webkit"===t.substr(0,6))&&(t="-"+t),r.removeProperty("--"===n?t:t.replace(rs,"-$1").toLowerCase())):r.removeAttribute(t)}},rz=function(e,t,n,r,i,s){var a=new nU(e._pt,t,n,0,1,s?rm:rf);return e._pt=a,a.b=r,a.e=i,e._props.push(n),a},rF={deg:1,rad:1,turn:1},rB={grid:1,flex:1},r$=function e(t,n,r,i){var s,a,o,l,u=parseFloat(r)||0,c=(r+"").trim().substr((u+"").length)||"px",d=n7.style,h=ra.test(n),p="svg"===t.tagName.toLowerCase(),f=(p?"client":"offset")+(h?"Width":"Height"),m="px"===i,g="%"===i;if(i===c||!u||rF[i]||rF[c])return u;if("px"===c||m||(u=e(t,n,r,"px")),l=t.getCTM&&rP(t),(g||"%"===c)&&(rt[n]||~n.indexOf("adius")))return s=l?t.getBBox()[h?"width":"height"]:t[f],e2(g?u/s*100:u/100*s);if(d[h?"width":"height"]=100+(m?c:i),a="rem"!==i&&~n.indexOf("adius")||"em"===i&&t.appendChild&&!p?t:t.parentNode,l&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==n3&&a.appendChild||(a=n3.body),(o=a._gsap)&&g&&o.width&&h&&o.time===t4.time&&!o.uncache)return e2(u/o.width*100);if(g&&("height"===n||"width"===n)){var x=t.style[n];t.style[n]=100+i,s=t[f],x?t.style[n]=x:rD(t,n)}else(g||"%"===c)&&!rB[rE(a,"display")]&&(d.position=rE(t,"position")),a===t&&(d.position="static"),a.appendChild(n7),s=n7[f],a.removeChild(n7),d.position="absolute";return h&&g&&((o=eZ(a)).time=t4.time,o.width=a[f]),e2(m?s*u/100:s&&u?100/s*u:0)},rq=function(e,t,n,r){var i;return n6||rA(),t in rl&&"transform"!==t&&~(t=rl[t]).indexOf(",")&&(t=t.split(",")[0]),rt[t]&&"transform"!==t?(i=r0(e,r),i="transformOrigin"!==t?i[t]:i.svg?i.origin:r1(rE(e,rk))+" "+i.zOrigin+"px"):(!(i=e.style[t])||"auto"===i||r||~(i+"").indexOf("calc("))&&(i=rV[t]&&rV[t](e,t,n)||rE(e,t)||e0(e,t)||+("opacity"===t)),n&&!~(i+"").trim().indexOf(" ")?r$(e,t,i,n)+n:i},rU=function(e,t,n,r){if(!n||"none"===n){var i=rO(t,e,1),s=i&&rE(e,i,1);s&&s!==n?(t=i,n=s):"borderColor"===t&&(n=rE(e,"borderTopColor"))}var a,o,l,u,c,d,h,p,f,m,g,x=new nU(this._pt,e.style,t,0,1,nD),y=0,v=0;if(x.b=n,x.e=r,n+="","var(--"===(r+="").substring(0,6)&&(r=rE(e,r.substring(4,r.indexOf(")")))),"auto"===r&&(d=e.style[t],e.style[t]=r,r=rE(e,t)||r,d?e.style[t]=d:rD(e,t)),t3(a=[n,r]),n=a[0],r=a[1],l=n.match(eE)||[],(r.match(eE)||[]).length){for(;o=eE.exec(r);)h=o[0],f=r.substring(y,o.index),c?c=(c+1)%5:("rgba("===f.substr(-5)||"hsla("===f.substr(-5))&&(c=1),h!==(d=l[v++]||"")&&(u=parseFloat(d)||0,g=d.substr((u+"").length),"="===h.charAt(1)&&(h=e3(u,h)+g),p=parseFloat(h),m=h.substr((p+"").length),y=eE.lastIndex-m.length,m||(m=m||eo.units[t]||g,y===r.length&&(r+=m,x.e+=m)),g!==m&&(u=r$(e,t,d,m)||0),x._pt={_next:x._pt,p:f||1===v?f:",",s:u,c:p-u,m:c&&c<4||"zIndex"===t?Math.round:0});x.c=y<r.length?r.substring(y,r.length):""}else x.r="display"===t&&"none"===r?rm:rf;return eO.test(r)&&(x.e=0),this._pt=x,x},rH={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},rK=function(e){var t=e.split(" "),n=t[0],r=t[1]||"50%";return("top"===n||"bottom"===n||"left"===r||"right"===r)&&(e=n,n=r,r=e),t[0]=rH[n]||n,t[1]=rH[r]||r,t.join(" ")},rY=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var n,r,i,s=t.t,a=s.style,o=t.u,l=s._gsap;if("all"===o||!0===o)a.cssText="",r=1;else for(i=(o=o.split(",")).length;--i>-1;)rt[n=o[i]]&&(r=1,n="transformOrigin"===n?rk:rw),rD(s,n);r&&(rD(s,rw),l&&(l.svg&&s.removeAttribute("transform"),a.scale=a.rotate=a.translate="none",r0(s,1),l.uncache=1,rT(a)))}},rV={clearProps:function(e,t,n,r,i){if("isFromStart"!==i.data){var s=e._pt=new nU(e._pt,t,n,0,0,rY);return s.u=r,s.pr=-10,s.tween=i,e._props.push(n),1}}},rW=[1,0,0,1,0,0],rG={},rX=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},rJ=function(e){var t=rE(e,rw);return rX(t)?rW:t.substr(7).match(eC).map(e2)},rQ=function(e,t){var n,r,i,s,a=e._gsap||eZ(e),o=e.style,l=rJ(e);return a.svg&&e.getAttribute("transform")?"1,0,0,1,0,0"===(l=[(i=e.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?rW:l:(l!==rW||e.offsetParent||e===n4||a.svg||(i=o.display,o.display="block",(n=e.parentNode)&&(e.offsetParent||e.getBoundingClientRect().width)||(s=1,r=e.nextElementSibling,n4.appendChild(e)),l=rJ(e),i?o.display=i:rD(e,"display"),s&&(r?n.insertBefore(e,r):n?n.appendChild(e):n4.removeChild(e))),t&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},rZ=function(e,t,n,r,i,s){var a,o,l,u,c=e._gsap,d=i||rQ(e,!0),h=c.xOrigin||0,p=c.yOrigin||0,f=c.xOffset||0,m=c.yOffset||0,g=d[0],x=d[1],y=d[2],v=d[3],b=d[4],_=d[5],w=t.split(" "),k=parseFloat(w[0])||0,j=parseFloat(w[1])||0;n?d!==rW&&(o=g*v-x*y)&&(l=v/o*k+-y/o*j+(y*_-v*b)/o,u=-x/o*k+g/o*j-(g*_-x*b)/o,k=l,j=u):(k=(a=rI(e)).x+(~w[0].indexOf("%")?k/100*a.width:k),j=a.y+(~(w[1]||w[0]).indexOf("%")?j/100*a.height:j)),r||!1!==r&&c.smooth?(c.xOffset=f+((b=k-h)*g+(_=j-p)*y)-b,c.yOffset=m+(b*x+_*v)-_):c.xOffset=c.yOffset=0,c.xOrigin=k,c.yOrigin=j,c.smooth=!!r,c.origin=t,c.originIsAbsolute=!!n,e.style[rk]="0px 0px",s&&(rz(s,c,"xOrigin",h,k),rz(s,c,"yOrigin",p,j),rz(s,c,"xOffset",f,c.xOffset),rz(s,c,"yOffset",m,c.yOffset)),e.setAttribute("data-svg-origin",k+" "+j)},r0=function(e,t){var n=e._gsap||new nu(e);if("x"in n&&!t&&!n.uncache)return n;var r,i,s,a,o,l,u,c,d,h,p,f,m,g,x,y,v,b,_,w,k,j,T,S,N,C,E,M,O,A,R,L,I=e.style,P=n.scaleX<0,D=getComputedStyle(e),z=rE(e,rk)||"0";return r=i=s=l=u=c=d=h=p=0,a=o=1,n.svg=!!(e.getCTM&&rP(e)),D.translate&&(("none"!==D.translate||"none"!==D.scale||"none"!==D.rotate)&&(I[rw]=("none"!==D.translate?"translate3d("+(D.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==D.rotate?"rotate("+D.rotate+") ":"")+("none"!==D.scale?"scale("+D.scale.split(" ").join(",")+") ":"")+("none"!==D[rw]?D[rw]:"")),I.scale=I.rotate=I.translate="none"),g=rQ(e,n.svg),n.svg&&(n.uncache?(N=e.getBBox(),z=n.xOrigin-N.x+"px "+(n.yOrigin-N.y)+"px",S=""):S=!t&&e.getAttribute("data-svg-origin"),rZ(e,S||z,!!S||n.originIsAbsolute,!1!==n.smooth,g)),f=n.xOrigin||0,m=n.yOrigin||0,g!==rW&&(b=g[0],_=g[1],w=g[2],k=g[3],r=j=g[4],i=T=g[5],6===g.length?(a=Math.sqrt(b*b+_*_),o=Math.sqrt(k*k+w*w),l=b||_?ri(_,b)*rn:0,(d=w||k?ri(w,k)*rn+l:0)&&(o*=Math.abs(Math.cos(d*rr))),n.svg&&(r-=f-(f*b+m*w),i-=m-(f*_+m*k))):(L=g[6],A=g[7],E=g[8],M=g[9],O=g[10],R=g[11],r=g[12],i=g[13],s=g[14],u=(x=ri(L,O))*rn,x&&(S=j*(y=Math.cos(-x))+E*(v=Math.sin(-x)),N=T*y+M*v,C=L*y+O*v,E=-(j*v)+E*y,M=-(T*v)+M*y,O=-(L*v)+O*y,R=-(A*v)+R*y,j=S,T=N,L=C),c=(x=ri(-w,O))*rn,x&&(S=b*(y=Math.cos(-x))-E*(v=Math.sin(-x)),N=_*y-M*v,C=w*y-O*v,R=k*v+R*y,b=S,_=N,w=C),l=(x=ri(_,b))*rn,x&&(S=b*(y=Math.cos(x))+_*(v=Math.sin(x)),N=j*y+T*v,_=_*y-b*v,T=T*y-j*v,b=S,j=N),u&&Math.abs(u)+Math.abs(l)>359.9&&(u=l=0,c=180-c),a=e2(Math.sqrt(b*b+_*_+w*w)),o=e2(Math.sqrt(T*T+L*L)),d=Math.abs(x=ri(j,T))>2e-4?x*rn:0,p=R?1/(R<0?-R:R):0),n.svg&&(S=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!rX(rE(e,rw)),S&&e.setAttribute("transform",S))),Math.abs(d)>90&&270>Math.abs(d)&&(P?(a*=-1,d+=l<=0?180:-180,l+=l<=0?180:-180):(o*=-1,d+=d<=0?180:-180)),t=t||n.uncache,n.x=r-((n.xPercent=r&&(!t&&n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-r)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+"px",n.y=i-((n.yPercent=i&&(!t&&n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-i)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+"px",n.z=s+"px",n.scaleX=e2(a),n.scaleY=e2(o),n.rotation=e2(l)+"deg",n.rotationX=e2(u)+"deg",n.rotationY=e2(c)+"deg",n.skewX=d+"deg",n.skewY=h+"deg",n.transformPerspective=p+"px",(n.zOrigin=parseFloat(z.split(" ")[2])||!t&&n.zOrigin||0)&&(I[rk]=r1(z)),n.xOffset=n.yOffset=0,n.force3D=eo.force3D,n.renderTransform=n.svg?r6:re?r4:r5,n.uncache=0,n},r1=function(e){return(e=e.split(" "))[0]+" "+e[1]},r2=function(e,t,n){var r=tR(t);return e2(parseFloat(t)+parseFloat(r$(e,"x",n+"px",r)))+r},r5=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,r4(e,t)},r3="0deg",r4=function(e,t){var n=t||this,r=n.xPercent,i=n.yPercent,s=n.x,a=n.y,o=n.z,l=n.rotation,u=n.rotationY,c=n.rotationX,d=n.skewX,h=n.skewY,p=n.scaleX,f=n.scaleY,m=n.transformPerspective,g=n.force3D,x=n.target,y=n.zOrigin,v="",b="auto"===g&&e&&1!==e||!0===g;if(y&&(c!==r3||u!==r3)){var _,w=parseFloat(u)*rr,k=Math.sin(w),j=Math.cos(w);s=r2(x,s,-(k*(_=Math.cos(w=parseFloat(c)*rr))*y)),a=r2(x,a,-(-Math.sin(w)*y)),o=r2(x,o,-(j*_*y)+y)}"0px"!==m&&(v+="perspective("+m+") "),(r||i)&&(v+="translate("+r+"%, "+i+"%) "),(b||"0px"!==s||"0px"!==a||"0px"!==o)&&(v+="0px"!==o||b?"translate3d("+s+", "+a+", "+o+") ":"translate("+s+", "+a+") "),l!==r3&&(v+="rotate("+l+") "),u!==r3&&(v+="rotateY("+u+") "),c!==r3&&(v+="rotateX("+c+") "),(d!==r3||h!==r3)&&(v+="skew("+d+", "+h+") "),(1!==p||1!==f)&&(v+="scale("+p+", "+f+") "),x.style[rw]=v||"translate(0, 0)"},r6=function(e,t){var n,r,i,s,a,o=t||this,l=o.xPercent,u=o.yPercent,c=o.x,d=o.y,h=o.rotation,p=o.skewX,f=o.skewY,m=o.scaleX,g=o.scaleY,x=o.target,y=o.xOrigin,v=o.yOrigin,b=o.xOffset,_=o.yOffset,w=o.forceCSS,k=parseFloat(c),j=parseFloat(d);h=parseFloat(h),p=parseFloat(p),(f=parseFloat(f))&&(p+=f=parseFloat(f),h+=f),h||p?(h*=rr,p*=rr,n=Math.cos(h)*m,r=Math.sin(h)*m,i=-(Math.sin(h-p)*g),s=Math.cos(h-p)*g,p&&(f*=rr,i*=a=Math.sqrt(1+(a=Math.tan(p-f))*a),s*=a,f&&(n*=a=Math.sqrt(1+(a=Math.tan(f))*a),r*=a)),n=e2(n),r=e2(r),i=e2(i),s=e2(s)):(n=m,s=g,r=i=0),(k&&!~(c+"").indexOf("px")||j&&!~(d+"").indexOf("px"))&&(k=r$(x,"x",c,"px"),j=r$(x,"y",d,"px")),(y||v||b||_)&&(k=e2(k+y-(y*n+v*i)+b),j=e2(j+v-(y*r+v*s)+_)),(l||u)&&(k=e2(k+l/100*(a=x.getBBox()).width),j=e2(j+u/100*a.height)),a="matrix("+n+","+r+","+i+","+s+","+k+","+j+")",x.setAttribute("transform",a),w&&(x.style[rw]=a)},r7=function(e,t,n,r,i){var s,a,o=em(i),l=parseFloat(i)*(o&&~i.indexOf("rad")?rn:1)-r,u=r+l+"deg";return o&&("short"===(s=i.split("_")[1])&&(l%=360)!=l%180&&(l+=l<0?360:-360),"cw"===s&&l<0?l=(l+36e9)%360-360*~~(l/360):"ccw"===s&&l>0&&(l=(l-36e9)%360-360*~~(l/360))),e._pt=a=new nU(e._pt,t,n,r,l,rc),a.e=u,a.u="deg",e._props.push(n),a},r8=function(e,t){for(var n in t)e[n]=t[n];return e},r9=function(e,t,n){var r,i,s,a,o,l,u,c=r8({},n._gsap),d=n.style;for(i in c.svg?(s=n.getAttribute("transform"),n.setAttribute("transform",""),d[rw]=t,r=r0(n,1),rD(n,rw),n.setAttribute("transform",s)):(s=getComputedStyle(n)[rw],d[rw]=t,r=r0(n,1),d[rw]=s),rt)(s=c[i])!==(a=r[i])&&0>"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)&&(o=tR(s)!==(u=tR(a))?r$(n,i,s,u):parseFloat(s),l=parseFloat(a),e._pt=new nU(e._pt,r,i,o,l-o,ru),e._pt.u=u||0,e._props.push(i));r8(r,c)};e1("padding,margin,Width,Radius",function(e,t){var n="Right",r="Bottom",i="Left",s=(t<3?["Top",n,r,i]:["Top"+i,"Top"+n,r+n,r+i]).map(function(n){return t<2?e+n:"border"+n+e});rV[t>1?"border"+e:e]=function(e,t,n,r,i){var a,o;if(arguments.length<4)return 5===(o=(a=s.map(function(t){return rq(e,t,n)})).join(" ")).split(a[0]).length?a[0]:o;a=(r+"").split(" "),o={},s.forEach(function(e,t){return o[e]=a[t]=a[t]||a[(t-1)/2|0]}),e.init(t,o,i)}});var ie={name:"css",register:rA,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,r,i){var s,a,o,l,u,c,d,h,p,f,m,g,x,y,v,b,_,w=this._props,k=e.style,j=n.vars.startAt;for(d in n6||rA(),this.styles=this.styles||rN(e),b=this.styles.props,this.tween=n,t)if("autoRound"!==d&&(a=t[d],!(eV[d]&&n_(d,t,n,r,e,i)))){if(u=typeof a,c=rV[d],"function"===u&&(u=typeof(a=a.call(n,r,e,i))),"string"===u&&~a.indexOf("random(")&&(a=tH(a)),c)c(this,e,d,a,n)&&(v=1);else if("--"===d.substr(0,2))s=(getComputedStyle(e).getPropertyValue(d)+"").trim(),a+="",t2.lastIndex=0,!t2.test(s)&&(h=tR(s),(p=tR(a))?h!==p&&(s=r$(e,d,s,p)+p):h&&(a+=h)),this.add(k,"setProperty",s,a,r,i,0,0,d),w.push(d),b.push(d,0,k[d]);else if("undefined"!==u){if(j&&d in j?(em(s="function"==typeof j[d]?j[d].call(n,r,e,i):j[d])&&~s.indexOf("random(")&&(s=tH(s)),tR(s+"")||"auto"===s||(s+=eo.units[d]||tR(rq(e,d))||""),"="===(s+"").charAt(1)&&(s=rq(e,d))):s=rq(e,d),l=parseFloat(s),(f="string"===u&&"="===a.charAt(1)&&a.substr(0,2))&&(a=a.substr(2)),o=parseFloat(a),d in rl&&("autoAlpha"===d&&(1===l&&"hidden"===rq(e,"visibility")&&o&&(l=0),b.push("visibility",0,k.visibility),rz(this,k,"visibility",l?"inherit":"hidden",o?"inherit":"hidden",!o)),"scale"!==d&&"transform"!==d&&~(d=rl[d]).indexOf(",")&&(d=d.split(",")[0])),m=d in rt){if(this.styles.save(d),_=a,"string"===u&&"var(--"===a.substring(0,6)){if("calc("===(a=rE(e,a.substring(4,a.indexOf(")")))).substring(0,5)){var T=e.style.perspective;e.style.perspective=a,a=rE(e,"perspective"),T?e.style.perspective=T:rD(e,"perspective")}o=parseFloat(a)}if(g||((x=e._gsap).renderTransform&&!t.parseTransform||r0(e,t.parseTransform),y=!1!==t.smoothOrigin&&x.smooth,(g=this._pt=new nU(this._pt,k,rw,0,1,x.renderTransform,x,0,-1)).dep=1),"scale"===d)this._pt=new nU(this._pt,x,"scaleY",x.scaleY,(f?e3(x.scaleY,f+o):o)-x.scaleY||0,ru),this._pt.u=0,w.push("scaleY",d),d+="X";else if("transformOrigin"===d){b.push(rk,0,k[rk]),a=rK(a),x.svg?rZ(e,a,0,y,0,this):((p=parseFloat(a.split(" ")[2])||0)!==x.zOrigin&&rz(this,x,"zOrigin",x.zOrigin,p),rz(this,k,d,r1(s),r1(a)));continue}else if("svgOrigin"===d){rZ(e,a,1,y,0,this);continue}else if(d in rG){r7(this,x,d,l,f?e3(l,f+a):a);continue}else if("smoothOrigin"===d){rz(this,x,"smooth",x.smooth,a);continue}else if("force3D"===d){x[d]=a;continue}else if("transform"===d){r9(this,a,e);continue}}else d in k||(d=rO(d)||d);if(m||(o||0===o)&&(l||0===l)&&!ro.test(a)&&d in k)h=(s+"").substr((l+"").length),o||(o=0),p=tR(a)||(d in eo.units?eo.units[d]:h),h!==p&&(l=r$(e,d,s,p)),this._pt=new nU(this._pt,m?x:k,d,l,(f?e3(l,f+o):o)-l,!m&&("px"===p||"zIndex"===d)&&!1!==t.autoRound?rp:ru),this._pt.u=p||0,m&&_!==a?(this._pt.b=s,this._pt.e=_,this._pt.r=rh):h!==p&&"%"!==p&&(this._pt.b=s,this._pt.r=rd);else if(d in k)rU.call(this,e,d,s,f?f+a:a);else if(d in e)this.add(e,d,s||e[d],f?f+a:a,r,i);else if("parseTransform"!==d){eD(d,a);continue}m||(d in k?b.push(d,0,k[d]):"function"==typeof e[d]?b.push(d,2,e[d]()):b.push(d,1,s||e[d])),w.push(d)}}v&&nq(this)},render:function(e,t){if(t.tween._time||!n9())for(var n=t._pt;n;)n.r(e,n.d),n=n._next;else t.styles.revert()},get:rq,aliases:rl,getSetter:function(e,t,n){var r=rl[t];return r&&0>r.indexOf(",")&&(t=r),t in rt&&t!==rk&&(e._gsap.x||rq(e,"x"))?n&&n8===n?"scale"===t?rv:ry:(n8=n||{},"scale"===t?rb:r_):e.style&&!ey(e.style[t])?rg:~t.indexOf("-")?rx:nL(e,t)},core:{_removeProperty:rD,_getMatrix:rQ}};n5.utils.checkPrefix=rO,n5.core.getStyleSaver=rN,n=e1("x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+(t="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(e){rt[e]=1}),e1(t,function(e){eo.units[e]="deg",rG[e]=1}),rl[n[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+t,e1("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(e){var t=e.split(":");rl[t[1]]=n[t[0]]}),e1("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){eo.units[e]="px"}),n5.registerPlugin(ie);var it=n5.registerPlugin(ie)||n5;it.core.Tween;let ir=({text:e,as:t="div",typingSpeed:n=50,initialDelay:r=0,pauseDuration:i=2e3,deletingSpeed:a=30,loop:o=!0,className:l="",showCursor:u=!0,hideCursorWhileTyping:c=!1,cursorCharacter:d="|",cursorClassName:h="",cursorBlinkDuration:p=.5,textColors:f=[],variableSpeed:m,onSentenceComplete:g,startOnVisible:x=!1,reverseMode:y=!1,...v})=>{let[b,w]=(0,_.useState)(""),[k,j]=(0,_.useState)(0),[T,S]=(0,_.useState)(!1),[N,C]=(0,_.useState)(0),[E,M]=(0,_.useState)(!x),O=(0,_.useRef)(null),A=(0,_.useRef)(null),R=(0,_.useMemo)(()=>Array.isArray(e)?e:[e],[e]),L=(0,_.useCallback)(()=>{if(!m)return n;let{min:e,max:t}=m;return Math.random()*(t-e)+e},[m,n]);(0,_.useEffect)(()=>{if(!x||!A.current)return;let e=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&M(!0)})},{threshold:.1});return e.observe(A.current),()=>e.disconnect()},[x]),(0,_.useEffect)(()=>{u&&O.current&&(it.set(O.current,{opacity:1}),it.to(O.current,{opacity:0,duration:p,repeat:-1,yoyo:!0,ease:"power2.inOut"}))},[u,p]),(0,_.useEffect)(()=>{let e;if(!E)return;let t=R[N],s=y?t.split("").reverse().join(""):t,l=()=>{if(T)if(""===b){if(S(!1),N===R.length-1&&!o)return;g&&g(R[N],N),C(e=>(e+1)%R.length),j(0),e=setTimeout(()=>{},i)}else e=setTimeout(()=>{w(e=>e.slice(0,-1))},a);else if(k<s.length)e=setTimeout(()=>{w(e=>e+s[k]),j(e=>e+1)},m?L():n);else if(R.length>=1){if(!o&&N===R.length-1)return;e=setTimeout(()=>{S(!0)},i)}};return 0!==k||T||""!==b?l():e=setTimeout(l,r),()=>clearTimeout(e)},[k,b,T,n,a,i,R,N,o,r,E,y,m,g]);let I=c&&(k<R[N].length||T);return(0,_.createElement)(t,{ref:A,className:`inline-block whitespace-pre-wrap tracking-tight ${l}`,...v},(0,s.jsx)("span",{className:"inline",style:{color:(0===f.length?"inherit":f[N%f.length])||"inherit"},children:b}),u&&(0,s.jsx)("span",{ref:O,className:`ml-1 inline-block opacity-100 ${I?"hidden":""} ${h}`,children:d}))};e.s([],951047),e.i(951047);var ii=e.i(247167),is=e.i(896499),ia=e.i(956789),io=e.i(146376),il=e.i(733332);let iu=_.createContext(void 0);function ic(e){let t=_.useContext(iu);if(void 0===t&&!e)throw Error((0,il.default)(72));return t}var id=e.i(574735),ih=e.i(667865),ip=e.i(229315),im=e.i(584446),ig=e.i(157940);function ix(e){return null!=e&&null!=e.clientX}var iy=e.i(17989),iv=e.i(675606),ib=e.i(264111),i_=e.i(176782),iw=e.i(301252),ik=e.i(56434),ij=e.i(18478),iT=e.i(116786),iS=e.i(990627);let iN={...iT.popupStoreSelectors,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class iC extends iw.ReactStore{constructor(e,t,n){const r=new iS.PopupTriggerMap;super(iE(e,r,t,n),iM(r),iN)}setOpen=(e,t)=>{(0,ib.applyPopupOpenChange)(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,(0,iv.createChangeEventDetails)(ik.REASONS.triggerPress,e))}}function iE(e,t,n,r=!1){return{...(0,iT.createInitialPopupStoreState)(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function iM(e){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}let iO=(0,is.fastComponent)(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a="none",actionsRef:o,onOpenChange:l,onOpenChangeComplete:u,handle:c,triggerId:d,defaultTriggerId:h=null,children:p}=e,f=(0,ib.usePopupRootStore)((e,t)=>new iC({open:n,openProp:r,activeTriggerId:h,triggerIdProp:d},e,t));f.useControlledProp("openProp",r),f.useControlledProp("triggerIdProp",d),f.useContextCallback("onOpenChange",l),f.useContextCallback("onOpenChangeComplete",u);let m=f.useState("open"),g=!t&&m,x=f.useState("activeTriggerId"),y=f.useState("mounted"),v=f.useState("payload");f.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),(0,ib.useImplicitActiveTrigger)(f,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:w}=(0,ib.useOpenStateTransitions)(g,f),k=f.useState("isInstantPhase"),j=f.useState("instantType"),T=f.useState("lastOpenChangeReason"),S=_.useRef(null);(0,io.useIsoLayoutEffect)(()=>{m&&t&&f.setOpen(!1,(0,iv.createChangeEventDetails)(ik.REASONS.disabled))},[m,t,f]),(0,io.useIsoLayoutEffect)(()=>{"ending"===w&&T===ik.REASONS.none||"ending"!==w&&k?("delay"!==j&&(S.current=j),f.set("instantType","delay")):null!==S.current&&(f.set("instantType",S.current),S.current=null)},[w,k,T,j,f]),(0,io.useIsoLayoutEffect)(()=>{g&&null==x&&f.set("payload",void 0)},[f,x,g]),_.useImperativeHandle(o,()=>({unmount:b,close:()=>f.setOpen(!1,(0,iv.createChangeEventDetails)(ik.REASONS.imperativeAction))}),[b,f]);let N=g||y||!t&&"none"!==a;return(0,s.jsxs)(iu.Provider,{value:f,children:[c&&(0,s.jsx)(ib.PopupHandleAttachment,{handle:c,store:f}),N&&(0,s.jsx)(iA,{store:f,disabled:t,trackCursorAxis:a}),"function"==typeof p?p({payload:v}):p]})});function iA({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState("floatingRootContext"),i=(0,iy.useDismiss)(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=function(e,t={}){let{enabled:n=!0,axis:r="both"}=t,i="rootStore"in e?e.rootStore:e,s=i.useState("open"),a=i.useState("floatingElement"),o=i.useState("domReferenceElement"),l=i.context.dataRef,u=_.useRef(!1),c=_.useRef(null),[d,h]=_.useState(),[p,f]=_.useState([]),m=(0,ih.useStableCallback)(e=>{i.set("positionReference",e)}),g=(0,ih.useStableCallback)((e,t,n)=>{if(!u.current&&(!l.current.openEvent||ix(l.current.openEvent))){var s,a;let u,c,h;i.set("positionReference",(s=n??o,a={x:e,y:t,axis:r,dataRef:l,pointerType:d},u=null,c=null,h=!1,{contextElement:s||void 0,getBoundingClientRect(){let e=s?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},t="x"===a.axis||"both"===a.axis,n="y"===a.axis||"both"===a.axis,r=["mouseenter","mousemove"].includes(a.dataRef.current.openEvent?.type||"")&&"touch"!==a.pointerType,i=e.width,o=e.height,l=e.x,d=e.y;return null==u&&a.x&&t&&(u=e.x-a.x),null==c&&a.y&&n&&(c=e.y-a.y),l-=u||0,d-=c||0,i=0,o=0,!h||r?(i="y"===a.axis?e.width:0,o="x"===a.axis?e.height:0,l=t&&null!=a.x?a.x:l,d=n&&null!=a.y?a.y:d):h&&!r&&(o="x"===a.axis?e.height:o,i="y"===a.axis?e.width:i),h=!0,{width:i,height:o,x:l,y:d,top:d,right:l+i,bottom:d+o,left:l}}}))}}),x=(0,ih.useStableCallback)(e=>{s?c.current||(g(e.clientX,e.clientY,e.currentTarget),f([])):g(e.clientX,e.clientY,e.currentTarget)}),y=(0,ig.isMouseLikePointerType)(d)?a:s;_.useEffect(()=>{if(!n)return void m(o);if(!y)return;function e(){c.current?.(),c.current=null}let t=(0,ip.getWindow)(a);return!l.current.openEvent||ix(l.current.openEvent)?c.current=(0,id.addEventListener)(t,"mousemove",function(t){let n=(0,im.getTarget)(t);(0,im.contains)(a,n)?e():g(t.clientX,t.clientY)}):m(o),e},[y,n,a,l,o,i,g,m,p]),_.useEffect(()=>()=>{i.set("positionReference",null)},[i]),_.useEffect(()=>{n&&!a&&(u.current=!1)},[n,a]),_.useEffect(()=>{!n&&s&&(u.current=!0)},[n,s]);let v=_.useMemo(()=>{function e(e){h(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:x,onMouseEnter:x}},[x]);return _.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}(r,{enabled:!t&&"none"!==n,axis:"none"===n?void 0:n}),a=_.useMemo(()=>(0,i_.mergeProps)(s.reference,i.reference),[s.reference,i.reference]);return(0,ib.usePopupInteractionProps)(e,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:i.floating??ia.EMPTY_OBJECT}),null}var iR=e.i(439957),iL=e.i(446265),iI=e.i(879938),iP=e.i(552245),iD=e.i(459636),iz=e.i(788015);let iF=_.createContext(void 0);var iB=e.i(650316),i$=e.i(944681);let iq=_.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new iR.Timeout,currentIdRef:{current:null},currentContextRef:{current:null}});function iU(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=_.useRef(n),a=_.useRef(n),o=_.useRef(null),l=_.useRef(null),u=(0,iR.useTimeout)();return(0,io.useIsoLayoutEffect)(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:(0,i$.getDelay)(i.current,"open"),close:(0,i$.getDelay)(n,"close")}},[n,o,i,a]),(0,s.jsx)(iq.Provider,{value:_.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:l,timeout:u}),[r,u]),children:t})}var iH=e.i(413082),iK=e.i(872135),iY=e.i(673752),iV=e.i(322846);let iW="data-base-ui-tooltip-trigger";function iG(e){if("composedPath"in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if((0,ip.isElement)(n))return n}}let t=e.target;return(0,ip.isElement)(t)?t:null}let iX=(0,is.fastComponentRef)(function(e,t){let{render:n,className:r,style:i,handle:s,payload:a,disabled:o,delay:l,closeOnClick:u=!0,closeDelay:c,id:d,...h}=e,p=ic(!0),f=(0,iD.usePopupHandleStore)(s)??p;if(!f)throw Error((0,il.default)(82));let m=(0,iz.useBaseUiId)(d),g=f.useState("isTriggerActive",m),x=f.useState("isOpenedByTrigger",m),y=f.useState("floatingRootContext"),v=_.useRef(null),b=c??0,{registerTrigger:w,isMountedByThisTrigger:k}=(0,ib.useTriggerDataForwarding)(m,v,f,{payload:a,closeOnClick:u,closeDelay:b}),j=_.useContext(iF),{activeIdRef:T,delayRef:S,isInstantPhase:N,hasProvider:C}=function(e,t={open:!1}){let{open:n}=t,r="rootStore"in e?e.rootStore:e,i=r.useState("floatingId"),{currentIdRef:s,delayRef:a,timeoutMs:o,initialDelayRef:l,currentContextRef:u,hasProvider:c,timeout:d}=_.useContext(iq),[h,p]=_.useState(!1),f=_.useRef(n);return(0,io.useIsoLayoutEffect)(()=>{f.current=n},[n]),(0,io.useIsoLayoutEffect)(()=>{function e(){u.current?.setIsInstantPhase(!1),s.current=null,u.current=null,a.current=l.current,d.clear()}if(s.current&&!n&&s.current===i){if(p(!1),o)return d.start(o,()=>{r.select("open")||s.current&&s.current!==i||e()}),()=>{(f.current||s.current!==i)&&d.clear()};e()}},[n,i,s,a,o,l,u,d,r]),(0,io.useIsoLayoutEffect)(()=>{if(!n)return;let e=u.current,t=s.current;d.clear(),u.current={onOpenChange:r.setOpen,setIsInstantPhase:p},s.current=i,a.current={open:0,close:(0,i$.getDelay)(l.current,"close")},null!==t&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,(0,iv.createChangeEventDetails)(ik.REASONS.none))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,s,a,l,u,d]),(0,io.useIsoLayoutEffect)(()=>()=>{s.current===i&&(u.current=null,f.current)&&(s.current=null,a.current=l.current,d.clear())},[u,s,a,i,l,d]),_.useMemo(()=>({activeIdRef:s,hasProvider:c,delayRef:a,isInstantPhase:h}),[s,c,a,h])}(y,{open:x}),E=(0,iY.useHoverInteractionSharedState)(y);f.useSyncedValue("isInstantPhase",N);let M=f.useState("disabled"),O=o??M,A=(0,iL.useValueAsRef)(O),R=f.useState("trackCursorAxis"),L=f.useState("disableHoverablePopup"),I=_.useRef(!1),P=(0,iR.useTimeout)(),D=_.useRef(void 0);function z(){return C&&null!=T.current?0:l??j??600}function F(e){let t=v.current;if(!t||!e)return!1;let n=function(e){let t=e;for(;t;){let e=t.closest(`[${iW}]`);if(e)return e;let n=t.getRootNode();t="host"in n&&(0,ip.isElement)(n.host)?n.host:null}return null}(e);return null!==n&&n!==t&&(0,im.contains)(t,n)}let B=(0,iK.useHoverReferenceInteraction)(y,{enabled:!O,mouseOnly:!0,move:!1,handleClose:L||"both"===R?null:(0,iB.safePolygon)(),restMs:z,delay:()=>null==c&&C?{close:(0,i$.getDelay)(S.current,"close")}:{close:b},triggerElementRef:v,isActiveTrigger:g,isClosing:()=>"ending"===f.select("transitionStatus"),shouldOpen:()=>!I.current}),$=(0,iH.useFocus)(y,{enabled:!O}).reference,q=f.useState("triggerProps",k),U=k||"none"!==R;return(0,iP.useRenderElement)("button",e,{state:{open:x},ref:[t,w,v],props:[B,$,U?q:void 0,{onMouseOver(e){(e=>{let t,n=I.current,r=iG(e),i=(I.current=t=F(r),t&&(E.openChangeTimeout.clear(),E.restTimeout.clear(),E.restTimeoutPending=!1,P.clear()),t),s=v.current,a=s&&r&&(0,im.contains)(s,r);if(i&&f.select("open")&&f.select("lastOpenChangeReason")===ik.REASONS.triggerHover)return f.setOpen(!1,(0,iv.createChangeEventDetails)(ik.REASONS.triggerHover,e));if(n&&!i&&a&&!A.current&&!f.select("open")&&s&&(0,ig.isMouseLikePointerType)(D.current)){let t=()=>{I.current||A.current||f.select("open")||f.setOpen(!0,(0,iv.createChangeEventDetails)(ik.REASONS.triggerHover,e,s))},n=z();0===n?(P.clear(),t()):P.start(n,t)}})(e.nativeEvent)},onFocus(e){F(iG(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,P.clear(),D.current=void 0},onPointerEnter(e){D.current=e.pointerType},onPointerDown(e){D.current=e.pointerType,f.set("closeOnClick",u),u&&!f.select("open")&&f.cancelPendingOpen(e.nativeEvent)},onClick(e){u&&!f.select("open")&&f.cancelPendingOpen(e.nativeEvent)},id:m,[iV.triggerDisabled]:O?"":void 0,[iW]:O?void 0:""},h],stateAttributesMapping:iI.triggerOpenStateMapping})}),iJ=_.createContext(void 0);var iQ=e.i(378680);let iZ=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return ic().useState("mounted")||n?(0,s.jsx)(iJ.Provider,{value:n,children:(0,s.jsx)(iQ.FloatingPortalLite,{ref:t,...r})}):null}),i0=_.createContext(void 0);function i1(){let e=_.useContext(i0);if(void 0===e)throw Error((0,il.default)(71));return e}var i2=e.i(923706),i5=e.i(638396),i3=e.i(789579);let i4=_.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a="absolute",side:o="top",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:h=5,arrowPadding:p=5,sticky:f=!1,disableAnchorTracking:m=!1,collisionAvoidance:g=i5.POPUP_COLLISION_AVOIDANCE,style:x,...y}=e,v=ic(),b=function(){let e=_.useContext(iJ);if(void 0===e)throw Error((0,il.default)(70));return e}(),w=v.useState("open"),k=v.useState("mounted"),j=v.useState("trackCursorAxis"),T=v.useState("disableHoverablePopup"),S=v.useState("floatingRootContext"),N=v.useState("instantType"),C=v.useState("transitionStatus"),E=v.useState("adaptiveOrigin"),M=(0,i2.useAnchorPositioning)({anchor:i,positionMethod:a,floatingRootContext:S,mounted:k,side:o,sideOffset:u,align:l,alignOffset:c,collisionBoundary:d,collisionPadding:h,sticky:f,arrowPadding:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:g,adaptiveOrigin:E}),O=_.useMemo(()=>({open:w,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:"none"!==j?"tracking-cursor":N}),[w,M.side,M.align,M.anchorHidden,j,N]),A=(0,i3.usePositioner)(e,O,{styles:M.positionerStyles,transitionStatus:C,props:y,refs:[t,v.useStateSetter("positionerElement")],hidden:!k,inert:!w||"both"===j||T});return(0,s.jsx)(i0.Provider,{value:M,children:A})});var i6=e.i(137584),i7=e.i(253984),i8=e.i(431157);let i9=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...s}=e,a=ic(),{side:o,align:l}=i1(),u=a.useState("open"),c=a.useState("instantType"),d=a.useState("transitionStatus"),h=a.useState("popupProps"),p=a.useState("floatingRootContext"),f=a.useState("disabled"),m=a.useState("closeDelay");(0,i6.useOpenChangeComplete)({open:u,ref:a.context.popupRef,onComplete(){u&&a.context.onOpenChangeComplete?.(!0)}}),(0,i8.useHoverFloatingInteraction)(p,{enabled:!f,closeDelay:m});let g=a.useStateSetter("popupElement");return(0,iP.useRenderElement)("div",e,{state:{open:u,side:o,align:l,instant:c,transitionStatus:d},ref:[t,a.context.popupRef,g],props:[ib.FOCUSABLE_POPUP_PROPS,h,(0,i7.getDisabledMountTransitionStyles)(d),s],stateAttributesMapping:iI.popupTransitionStateMapping})}),se=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...s}=e,a=ic(),{arrowRef:o,side:l,align:u,arrowUncentered:c,arrowStyles:d}=i1(),h=a.useState("open"),p=a.useState("instantType");return(0,iP.useRenderElement)("div",e,{state:{open:h,side:l,align:u,uncentered:c,instant:p},ref:[t,o],props:[{style:d,"aria-hidden":!0},s],stateAttributesMapping:iI.popupStateMapping})});var st=e.i(818390);let sn=_.forwardRef(function(e,t){let{render:n,className:r,style:i,children:s,...a}=e,o=ic(),l=i1(),u=o.useState("instantType"),{children:c,state:d}=(0,st.usePopupViewport)({store:o,side:l.side,children:s}),h={activationDirection:d.activationDirection,transitioning:d.transitioning,instant:u};return(0,iP.useRenderElement)("div",e,{state:h,ref:t,props:[a,{children:c}],stateAttributesMapping:st.popupViewportStateMapping})});var sr=e.i(564170);class si extends sr.BasePopupHandle{constructor(){super(function(){let e=new iS.PopupTriggerMap;return Object.assign(new ij.NullStore(Object.freeze(iE(void 0,e)),Object.freeze(iM(e)),iN),{setOpen:ia.NOOP,cancelPendingOpen:ia.NOOP})}(),"Tooltip")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}e.s(["Arrow",0,se,"Handle",0,si,"Popup",0,i9,"Portal",0,iZ,"Positioner",0,i4,"Provider",0,function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=_.useMemo(()=>({open:t,close:n}),[t,n]);return(0,s.jsx)(iF.Provider,{value:t,children:(0,s.jsx)(iU,{delay:i,timeoutMs:r,children:e.children})})},"Root",0,iO,"Trigger",0,iX,"Viewport",0,sn,"createHandle",0,function(){return new si}],599643);var ss=e.i(599643),ss=ss;function sa({delay:e=0,...t}){return(0,s.jsx)(ss.Provider,{"data-slot":"tooltip-provider",delay:e,...t})}function so({...e}){return(0,s.jsx)(ss.Root,{"data-slot":"tooltip",...e})}function sl({...e}){return(0,s.jsx)(ss.Trigger,{"data-slot":"tooltip-trigger",...e})}function su({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:i=0,children:a,...o}){return(0,s.jsx)(ss.Portal,{children:(0,s.jsx)(ss.Positioner,{align:r,alignOffset:i,side:t,sideOffset:n,className:"isolate z-50",children:(0,s.jsxs)(ss.Popup,{"data-slot":"tooltip-content",className:(0,T.cn)("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o,children:[a,(0,s.jsx)(ss.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}var sc=e.i(41533),sd=e.i(149666),sh=e.i(265402),sp=e.i(451888),sf=e.i(635963),sm=e.i(511769),sg=e.i(399512),sx=e.i(245629);let sy=e=>(e,t)=>{};var sv=e.i(661504),sb=e.i(283653),s_=e.i(978411),sw=e.i(351866),sk=e.i(401851),sj=e.i(677241),sT=e.i(24708),sS=e.i(845110),sN=e.i(980797),sC=e.i(383482),sE=e.i(24071),sM=e.i(931619),sO=e.i(632781),sA=e.i(671428),sR=e.i(127341),sL=e.i(835878),sI=e.i(431594);let sP=sp.needsThreadReply,sD=e=>"done"===e.status&&!e.seen;function sz({tab:e,current:t,onTab:n,onClose:r}){return(0,s.jsxs)("div",{className:"flex items-center gap-2 pt-3 pr-3.5 pb-1.5 pl-2.5",children:[(0,s.jsx)(sR.Tabs,{value:e,onValueChange:e=>n(e),className:"gap-0",children:(0,s.jsxs)(sR.TabsList,{className:"gap-1 rounded-none bg-transparent p-0 group-data-horizontal/tabs:h-auto",children:[(0,s.jsxs)(sR.TabsTrigger,{value:"now",className:sw.TAB,children:["Now",t>0&&(0,s.jsx)("span",{className:"font-mono text-[10px] font-normal text-muted-foreground tabular-nums",children:t})]}),(0,s.jsx)(sR.TabsTrigger,{value:"history",className:sw.TAB,children:"History"})]})}),(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsx)(sw.FoldButton,{onClick:r})]})}function sF({bots:e}){return(0,s.jsx)("p",{className:"px-6 pt-4 pb-5 text-center text-[12px] text-muted-foreground",children:e?.length?"Nothing handed over yet — ask for something that takes a while.":`Thursday hands work to ${sp.DEFAULT_BOT.name} until you make bots of your own in Settings › Bots.`})}function sB(){return(0,s.jsx)("p",{className:"px-6 pt-4 pb-5 text-center text-[12px] text-muted-foreground",children:"Nothing running or waiting."})}function s$({pages:e,threads:t,scroll:n,onPick:r}){let i=(0,_.useCallback)(e=>{e&&(e.scrollTop=n.current)},[n]),a=[];for(let e of t){let t=function(e){let t=(0,sx.toDate)(e);return(0,sN.isToday)(t)?"today":(0,sC.isYesterday)(t)?"yesterday":(0,sk.format)(t,function(e,t){let[n,r]=(0,sS.normalizeDates)(void 0,e,t);return n.getFullYear()===r.getFullYear()}((0,sj.constructFrom)(t,t),(0,sT.constructNow)(t))?"MMM d":"MMM d, yyyy").toLowerCase()}(e.updatedAt),n=a.at(-1);n?.day===t?n.rows.push(e):a.push({day:t,rows:[e]})}return(0,s.jsx)("div",{ref:i,onScroll:e=>{n.current=e.currentTarget.scrollTop},className:"flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pt-1 pb-2 scrollbar-none",children:e.error?(0,s.jsx)("p",{className:"px-2.5 py-3 text-[12px] text-destructive",children:e.error.message}):e.isLoading?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"flex h-6 items-center px-2.5 pt-1",children:(0,s.jsx)(sA.Skeleton,{className:"h-2.5 w-16"})}),(0,s.jsx)(sU,{})]}):(0,s.jsxs)(s.Fragment,{children:[a.map((e,t)=>(0,s.jsxs)(_.Fragment,{children:[(0,s.jsxs)("p",{className:(0,T.cn)("px-2.5 pb-1 font-mono text-[10px] text-muted-foreground",0===t?"pt-1":"pt-3"),children:[e.day," · ",e.rows.length]}),e.rows.map(e=>(0,s.jsx)(sY,{thread:e,onPick:()=>r(e.id)},e.id))]},e.day)),e.hasMore?(0,s.jsx)("div",{ref:e.sentinelRef,children:(0,s.jsx)(sU,{})}):0===a.length&&(0,s.jsx)("p",{className:"px-6 pt-3 pb-4 text-center text-[12px] text-muted-foreground",children:"Nothing has ended yet."})]})})}function sq({onBack:e,onClose:t}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,s.jsx)("button",{type:"button",onClick:e,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,s.jsx)(sE.ChevronLeft,{className:"size-4"})}),(0,s.jsx)(sA.Skeleton,{className:"size-5.5 shrink-0 rounded-md"}),(0,s.jsx)("span",{className:"flex min-w-0 flex-1",children:(0,s.jsx)(sA.Skeleton,{className:"h-3.5 w-2/5"})}),(0,s.jsx)(sw.FoldButton,{onClick:t})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-4",children:[(0,s.jsx)(sA.Skeleton,{className:"h-3 w-4/5"}),(0,s.jsx)(sA.Skeleton,{className:"h-3 w-3/5"}),(0,s.jsx)(sA.Skeleton,{className:"h-3 w-2/3"})]})]})}function sU(){return(0,s.jsxs)("div",{className:"flex items-center gap-2.5 px-2 py-1.5",children:[(0,s.jsx)(sA.Skeleton,{className:"size-8 shrink-0 rounded-[10px]"}),(0,s.jsxs)("span",{className:"flex h-9 min-w-0 flex-1 flex-col justify-center gap-1.5",children:[(0,s.jsx)(sA.Skeleton,{className:"h-3.5 w-2/5"}),(0,s.jsx)(sA.Skeleton,{className:"h-2.5 w-3/5"})]})]})}let sH=[{id:"you",label:"needs you",holds:sP},{id:"unread",label:"new results",holds:sD},{id:"working",label:"working",holds:e=>"working"===e.status},{id:"done",label:"done",holds:()=>!0}];function sK({threads:e,onPick:t}){let n=new Map;for(let t of e){let e=sH.find(e=>e.holds(t))??sH[sH.length-1],r=n.get(e.id);r?r.push(t):n.set(e.id,[t])}return(0,s.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pt-1 pb-1 scrollbar-none",children:sH.map((e,r)=>{let i=n.get(e.id)??[];return i.length?(0,s.jsxs)(_.Fragment,{children:[(0,s.jsxs)("p",{className:(0,T.cn)("px-2.5 pb-1 font-mono text-[10px] text-muted-foreground",0===r?"pt-1":"pt-3"),children:[e.label," · ",i.length]}),i.map(e=>(0,s.jsx)(sY,{thread:e,onPick:()=>t(e.id)},e.id))]},e.id):null})})}function sY({thread:e,onPick:t}){let n=sP(e),r=e.lines.at(-1),i=(0,_.useMemo)(()=>(function(e){let t=e.room.questions[0];if(t)return{text:(0,T.plainText)(t.text),tone:"text-foreground"};if("waiting"===e.status&&e.ask)return{text:(0,sp.isAppStop)(e.ask)?(0,T.plainText)(e.outcome??e.ask.question):e.ask.question,tone:T.WAITING_INK};let n=e.seen;if("cancelled"===e.status)return{text:"Stopped",tone:"text-muted-foreground"};if("done"===e.status)return{text:(0,T.plainText)(e.outcome??"Done"),tone:n?"text-muted-foreground":"text-foreground"};let r=(0,s_.lastSaid)(e);return r?{text:"tool"===r.kind&&r.tool?r.tool.note??`${r.tool.name} \xb7 ${r.tool.input}`:r.text,tone:"text-muted-foreground"}:{text:`${e.bot.name} is taking it on…`,tone:"text-muted-foreground italic"}})(e),[e.status,e.outcome,e.seen,e.ask,e.room.questions,r?.id]),[a,o]=(0,sg.useAnswerThread)(),[l,u]=(0,_.useState)(null),c="waiting"===e.status&&(0,sp.isAppStop)(e.ask)?e.ask?.options??[]:[];return(0,s.jsxs)("div",{className:"rounded-xl transition-colors hover:bg-muted/60",children:[(0,s.jsxs)("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2.5 rounded-xl px-2 py-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,s.jsx)("span",{className:"relative flex size-8 shrink-0 items-center justify-center overflow-visible",title:e.bot.name,children:(0,s.jsx)(sf.BotMark,{size:32,seed:e.bot.name,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,paint:e.bot.icon?.paint,state:"working"===e.status?"thinking":"idle",notify:n,crossed:"cancelled"===e.status})}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(n||sD(e))&&(0,s.jsx)("span",{className:"block text-[10px] font-medium text-foreground",children:e.room.questions.length?`${1===e.room.questions.length?"Question":`${e.room.questions.length} questions`} \xb7 ${[...new Set(e.room.questions.map(e=>e.bot))].join(", ")}`:"waiting"===e.status?(0,sp.isAppStop)(e.ask)?"Paused":"Question":"New result"}),(0,s.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:(0,T.cn)("min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]",n?"text-foreground":"text-foreground/80"),children:e.label}),e.routineId&&(0,s.jsx)("span",{title:"Started by a routine",className:"shrink-0",children:(0,s.jsx)(sI.RoutineMark,{className:"size-3 text-muted-foreground/80"})}),(0,s.jsx)(sL.BotRoster,{bots:(0,s_.rosterOf)(e)}),(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsx)("span",{className:"shrink-0 font-mono text-[11px] leading-4 text-muted-foreground/70 tabular-nums",children:(0,sx.shortAgo)(e.updatedAt)})]}),(0,s.jsxs)("span",{className:"mt-px flex h-4 items-center gap-1.5",children:["working"===e.status&&(0,s.jsx)(sO.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/70"}),"working"!==e.status||n?(0,s.jsx)("span",{className:(0,T.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",i.tone),children:i.text}):(0,s.jsx)(O.ShinyText,{text:i.text,speed:2.2,className:(0,T.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",i.tone.includes("italic")&&"italic")})]})]})]}),c.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-0.5 pr-2 pb-2 pl-12.5",children:c.map(t=>(0,s.jsxs)(k.Button,{size:"sm",variant:"outline",loading:l===t,disabled:o,onClick:async()=>{u(t),await a(e,t),u(null)},className:"h-7 gap-1.5 rounded-full border-border bg-background px-3 text-[12px]",children:[t===sp.THREAD_CONTINUE&&(0,s.jsx)(sM.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),t]},t))})]})}var sV=e.i(689664);let sW={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};sW.node;let sG=(0,l.default)(sW);var sX=e.i(51481),sJ=e.i(77071),sQ=e.i(825398),sZ=e.i(263676),s0=e.i(256604),s1=e.i(864723);let s2={done:sV.Check,cancelled:sZ.X,question:sX.CircleQuestionMark,stopped:sG,resumed:sQ.RotateCw},s5={question:T.WAITING_INK,stopped:T.WAITING_INK},s3=e=>{let t=(0,T.plainText)(e).replace(/\s+/g," ").trim();return t.length>28?`${t.slice(0,27)}…`:t};function s4({crew:e,more:t,bubble:n,rows:r,count:i,busy:a,pending:o,unread:l,onPick:u,onOpen:c}){let d=(0,s_.useWriteLineUp)(),h=r.length>0&&!d;return(0,s.jsxs)("div",{className:(0,T.cn)("pointer-events-auto w-fit max-w-full bg-background/78 ring-1 ring-border/50 backdrop-blur-md transition-shadow duration-300",h?"w-132 rounded-3xl shadow-lg shadow-black/8":"rounded-full shadow-sm shadow-black/3"),children:[(0,s.jsx)("div",{className:(0,T.cn)("grid overflow-hidden transition-[grid-template-rows] duration-300 ease-out",h?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:(0,s.jsxs)("div",{className:"min-h-0 overflow-hidden",inert:!h,children:[(0,s.jsx)("p",{className:"flex items-center gap-2 px-3 py-2 font-mono text-[10px] tracking-wide text-muted-foreground",children:(0,s.jsx)("span",{className:"flex-1",children:[o>0?`${o} ${1===o?"needs":"need"} a reply`:"",l>0?`${l} new ${1===l?"result":"results"}`:""].filter(Boolean).join(" · ")})}),(0,s.jsx)("div",{className:"max-h-[45vh] overflow-y-auto px-1.5 pb-2",children:r.map(e=>(0,s.jsx)(sY,{thread:e,onPick:()=>u(e.id)},e.id))}),(0,s.jsx)("span",{className:"block h-1.5"})]})}),(0,s.jsx)(s6,{crew:e,more:t,bubble:h?null:n,label:i?`Threads (${i})`:"Bots",onClick:c,side:(0,s.jsx)(s7,{busy:a,pending:o,grown:h,folded:d?l:0}),onWrite:s_.writeLine.open})]})}function s6({crew:e,more:t,bubble:n,side:r,label:i,onClick:a,onWrite:o}){return(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2 py-1.5 pr-3 pl-1.5",children:[(0,s.jsx)("button",{type:"button",onClick:o,"aria-label":"Write to a bot",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,s.jsx)(sJ.Plus,{className:"size-3.5"})}),(0,s.jsxs)("button",{type:"button",onClick:a,"aria-label":i,className:"flex min-w-0 flex-1 items-center gap-2 rounded-full text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,s.jsx)(s9,{crew:e,more:t,bubble:n}),r]})]})}function s7(e){let t=function({busy:e,pending:t,grown:n,folded:r=0}){return t>0?{text:1===t?"waiting on you":`${t} waiting on you`,shine:!0}:e>0?{text:"working",shine:!0,spin:!0}:r>0?{text:1===r?"1 new result":`${r} new results`,shine:!1}:n?null:{text:"Need a hand?",shine:!1}}(e);return t?(0,s.jsxs)("span",{className:"ml-auto flex h-7 shrink-0 items-center gap-1.5",children:[t.shine?(0,s.jsx)(O.ShinyText,{text:t.text,speed:2.6,className:"block truncate text-[14px] leading-5 tracking-[-0.15px]"}):(0,s.jsx)("span",{className:"block animate-in truncate text-[14px] leading-5 tracking-[-0.15px] text-muted-foreground fade-in duration-300",children:t.text},t.text),t.spin&&(0,s.jsx)(sO.Loader2,{className:"size-4 shrink-0 animate-spin text-muted-foreground/70"})]}):null}let s8=["alto","brio","cinder","delta"].map((e,t)=>({name:e,icon:{color:s1.MARK_PALETTE[Math.floor(t*s1.MARK_PALETTE.length/4)],shape:s1.MARK_SHAPES[t%s1.MARK_SHAPES.length]},awake:!1,waiting:!1,word:null,standIn:!0}));function s9({crew:e,more:t,bubble:n}){return(0,s.jsxs)("span",{className:"flex min-w-0 shrink items-center",children:[e.map((t,r)=>(0,s.jsxs)(_.Fragment,{children:[(0,s.jsxs)("span",{className:(0,T.cn)("relative shrink-0 transition-[margin] duration-500 ease-out",r>0&&!e[r-1].word&&"-ml-2",t.standIn&&"opacity-35"),style:{zIndex:e.length-r},children:[(0,s.jsx)("span",{className:(0,T.cn)("flex transition-transform duration-500 ease-out",t.awake&&"-translate-y-0.5 scale-110"),children:(0,s.jsx)(ae,{face:t})}),n?.at===t.name&&(0,s.jsx)(at,{handoff:n})]}),t.word&&(0,s.jsx)("span",{className:"mx-2.5 min-w-0 shrink truncate",children:(0,s.jsx)(O.ShinyText,{text:t.word,speed:2.6,className:"truncate text-[13px] leading-5 tracking-[-0.1px]"})})]},t.name)),t>0&&(0,s.jsxs)("span",{className:(0,T.cn)("grid size-7 shrink-0 place-items-center rounded-[9px] bg-muted font-mono text-[10px] text-muted-foreground ring-1 ring-border/50",!e.at(-1)?.word&&"-ml-2"),title:`${t} more`,children:["+",t]})]})}function ae({face:e}){return(0,s.jsx)(sf.BotMark,{size:28,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:e.waiting})}function at({handoff:e}){return(0,s.jsxs)("span",{className:"pointer-events-none absolute bottom-[calc(100%+10px)] left-1/2 flex w-max -translate-x-1/2 animate-in flex-col items-center fade-in zoom-in-95 duration-200",children:[(0,s.jsx)("span",{className:"flex rounded-full bg-background py-2 pr-3.5 pl-2.5 shadow-lg shadow-black/10 ring-1 ring-border",children:(0,s.jsx)(ar,{handoff:e})}),(0,s.jsx)("span",{className:"-mt-px size-0 border-x-[6px] border-t-[7px] border-x-transparent border-t-border"}),(0,s.jsx)("span",{className:"-mt-[7.5px] size-0 border-x-[6px] border-t-[7px] border-x-transparent border-t-background"})]})}function an({handoff:e}){return(0,s.jsx)("span",{className:"ml-auto flex h-7 min-w-0 shrink animate-in items-center pl-4 fade-in duration-200",children:(0,s.jsx)(ar,{handoff:e})})}function ar({handoff:e}){let t=e.sign?s2[e.sign]:null,n=e.sign?s5[e.sign]:void 0;return(0,s.jsxs)("span",{className:(0,T.cn)("flex min-w-0 items-center gap-2 text-[13px] leading-[18px] tracking-[-0.1px] whitespace-nowrap",n),children:[(0,s.jsx)(ai,{from:e.from,to:e.to}),t&&(0,s.jsx)(t,{className:(0,T.cn)("size-3.5 shrink-0",!n&&"text-muted-foreground/70")}),e.shine?(0,s.jsx)(O.ShinyText,{text:e.text,speed:2.2,className:"min-w-0 truncate"}):(0,s.jsx)("span",{className:"min-w-0 truncate",children:e.text})]})}function ai({from:e,to:t}){let n=[e,...t];return(0,s.jsx)("span",{className:"flex shrink-0 items-center",children:n.map((e,t)=>(0,s.jsx)("span",{className:(0,T.cn)("relative flex",t>0&&"-ml-1.25"),style:{zIndex:n.length-t},children:(0,s.jsx)(as,{bot:e})},e.name))})}function as({bot:e}){return e.name===sw.THURSDAY.name?(0,s.jsx)(s0.ThursdayMark,{size:18,className:"shrink-0"}):(0,s.jsx)(sf.BotMark,{size:18,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}let aa=(0,_.memo)(function(){let e=(0,s_.useBotThreads)(),t=(0,s_.useRingingThreads)(),{data:n}=(0,sb.useServerRoute)(w.queryKey.bot),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(null),l=r&&null!==a;(0,_.useEffect)(()=>(s_.roomOpen.set(l),()=>s_.roomOpen.set(!1)),[l]);let[u,c]=(0,_.useState)({}),[d,h]=(0,_.useState)("now"),p=(0,_.useRef)(0),f=[...e].reverse(),m=0,g=f.filter(e=>"cancelled"!==e.status&&("done"!==e.status||(m+=1)<=sc.INBOX_FINISHED||!e.seen)),x=r&&"history"===d,y=(0,sv.useServerPages)({key:(e,t)=>{if(!x)return null;if(0===e)return w.queryKey.threadHistory(null);let n=t?.at(-1);return n?w.queryKey.threadHistory((0,sx.toDate)(n.updatedAt).toISOString()):null},size:sc.PAGE_SIZE}),{refresh:v}=y,b=(0,_.useRef)(!1);b.current=y.items.length>0,(0,_.useEffect)(()=>{x&&b.current&&v()},[x,v]);let k=(0,_.useMemo)(()=>y.items.filter(e=>"done"===e.status||"cancelled"===e.status).map(e=>(0,s_.threadFromRow)(e,n)),[y.items,n]),j=a?f.find(e=>e.id===a)??k.find(e=>e.id===a)??null:null,{data:T,isLoading:S}=(0,sb.useServerRoute)(a&&!j?w.queryKey.thread(a):null),N=(0,_.useMemo)(()=>T&&T.id===a?(0,s_.threadFromRow)(T,n):null,[T,a,n]),C=j??N,[E,M]=function(){let[e,t]=(0,_.useState)(null),n=(0,_.useRef)(null);return(0,_.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),[e,(0,_.useCallback)(e=>{t(e),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t(null)},3400)},[])]}(),O=(0,_.useMemo)(()=>E??function(e,t){for(let n of e){if("working"!==n.status)continue;let e=n.room.deliveries.find(e=>!e.delivered);if(e)return{at:e.bot,from:t(e.bot),to:[],text:"Step-in · waits for its next step",shine:!0}}return null}(e,e=>({name:e,icon:n?.find(t=>t.name===e)?.icon??null})),[E,e,n]),{crew:A,more:R}=(0,_.useMemo)(()=>(function(e,t){let n=new Map;for(let e of(0,s_.latestPerBot)(t)){let{thread:t,bot:r,line:i}=e;if("waiting"===t.status&&t.bot.name===r.name){n.set(r.name,{waiting:!0,word:null});continue}!("working"!==t.status||n.get(r.name)?.waiting)&&n.set(r.name,{waiting:!1,word:i?.kind==="tool"||i?.kind==="say"?s3((0,sw.stepOf)(i)):null})}let r=new Map;for(let t of e??[])r.set(t.name,{name:t.name,icon:t.icon,awake:n.has(t.name),waiting:n.get(t.name)?.waiting??!1,word:n.get(t.name)?.word??null});for(let[e,t]of n)r.has(e)||r.set(e,{name:e,icon:null,awake:!0,waiting:t.waiting,word:t.word});let i=[...r.values()];if(!i.length)return{crew:s8.slice(0,3),more:0};for(let e of s8){if(i.length>=3)break;r.has(e.name)||i.push(e)}let s=e=>e.waiting?0:e.awake?1:e.standIn?3:2,a=i.map((e,t)=>({face:e,at:t})).sort((e,t)=>s(e.face)-s(t.face)||e.at-t.at).map(e=>e.face);return{crew:a.slice(0,10),more:Math.max(0,a.length-10)}})(n,e),[n,e]),L=(0,_.useRef)(null),I=(0,_.useRef)(new Map),P=(0,_.useRef)(new Set);(0,_.useEffect)(()=>{if(!s_.botThreads.primed())return;let t=L.current;L.current=new Map(e.map(e=>[e.id,e.status]));let n=I.current;I.current=function(e){let t=new Map;for(let n of e)for(let e of n.room.participants)t.set(`${n.id}
|
|
2
|
-
${e.bot}`,e.state);return t}(e);let r=P.current;if(P.current=new Set(e.flatMap(e=>e.lines.map(e=>e.id))),!t)return;let i=null;for(let s of e)for(let e of function(e,t,n,r,i){let s=[],a=e.lines.filter(e=>!n.has(e.id)),o=e.bot,l=new Map;for(let e of a)"user"===e.kind?s.push(e.steppedIn?{rank:1,at:e.bot.name,from:e.bot,to:[],text:"Step-in · read"}:{rank:1,at:e.bot.name,from:sw.THURSDAY,to:[e.bot],text:s3(e.text)}):"stop"===e.kind?s.push({rank:3,at:e.bot.name,from:e.bot,to:[],sign:"stopped",text:(0,sw.leadOf)(e.text)}):"ask"===e.kind&&e.to?.name===sw.THURSDAY.name?s.push(e.question?{rank:4,at:e.bot.name,from:e.bot,to:[],sign:"question",text:`asks you \xb7 ${s3(e.text)}`}:{rank:2,at:e.bot.name,from:e.bot,to:[sw.THURSDAY],text:s3(e.text)}):"ask"===e.kind&&e.to&&l.set(e.bot.name,[...l.get(e.bot.name)??[],e]);for(let[e,t]of l){let n=new Map;for(let e of t)e.to&&n.set(e.to.name,e.to);s.push({rank:2,at:e,from:t[0].bot,to:[...n.values()],text:1===t.length?s3(t[0].text):`sent ${t.length} parts out`})}for(let t of(0,s_.rosterOf)(e)){let n=`${e.id}
|
|
3
|
-
${t.name}`;t.name===o.name||"running"!==r.get(n)||"done"!==i.get(n)||a.some(e=>e.bot.name===t.name&&("ask"===e.kind||"say"===e.kind))||s.push({rank:1,at:t.name,from:t,to:[],sign:"done",text:"finished its part"})}if(!t)return"working"===e.status&&s.push({rank:1,at:o.name,from:sw.THURSDAY,to:[o],text:`took on “${s3(e.label)}”`}),s;if(t===e.status)return s;let u=s3(e.label);return"cancelled"===e.status?s.push({rank:3,at:o.name,from:o,to:[],sign:"cancelled",text:`stopped \xb7 ${u}`}):"done"===e.status?s.push({rank:3,at:o.name,from:o,to:[],sign:"done",text:`done \xb7 ${u}`}):"working"===e.status?a.some(e=>"user"===e.kind)||s.push({rank:1,at:o.name,from:o,to:[],sign:"resumed",text:"picked it back up"}):(0,sp.isAppStop)(e.ask)&&!s.some(e=>"question"===e.sign||"stopped"===e.sign)&&s.push({rank:3,at:o.name,from:o,to:[],sign:"stopped",text:"paused"}),s}(s,t.get(s.id),r,n,I.current))(!i||e.rank>=i.rank)&&(i=e);i&&M(i)},[e,M]),(0,s_.useSeenOnDetail)(r?C:null);let D=r?C?.id??null:null;(0,_.useEffect)(()=>{sy("room")("open",{thread:D})},[D]),(0,sm.useAppEvent)({showThread:e=>{o(e.threadId),i(!0)}}),(0,_.useEffect)(()=>s_.roomOpens.subscribe(e=>{o(e),i(!0)}),[]);let z=e.filter(e=>"working"===e.status).length,F=f.filter(sP).length,B=f.filter(sD),$=(0,_.useMemo)(()=>A.map(e=>({...e,word:null})),[A]),q=()=>{i(!1),o(null),h("now"),p.current=0};return(0,s.jsx)("div",{className:"pointer-events-none absolute right-5 bottom-5 z-10 flex w-[min(80vw,calc(100vw-2.5rem))] flex-col items-end gap-2",children:r?(0,s.jsx)("div",{"data-room":!0,className:"pointer-events-auto flex max-h-[calc(100dvh-5.5rem)] w-160 max-w-full animate-in flex-col overflow-hidden rounded-3xl bg-background/75 shadow-2xl shadow-black/6 ring-1 ring-border/50 backdrop-blur-xl fade-in slide-in-from-bottom-1 duration-200",children:!C&&a&&S?(0,s.jsx)(sq,{onBack:()=>o(null),onClose:q}):C?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(sw.ThreadHeader,{thread:C,onBack:()=>o(null),onClose:q}),(0,s.jsx)(sw.Conversation,{thread:C,tab:u[C.id]??null,onTab:e=>c(t=>({...t,[C.id]:e})),className:"min-h-0 flex-1"}),(0,s.jsx)(sg.ThreadReply,{thread:{id:C.id,label:C.label,bot:C.bot.name,ask:C.ask,room:C.room},status:"working"===C.status?"running":C.status,faces:(0,s_.rosterOf)(C),to:u[C.id]??C.bot.name,className:"mx-3 mb-2 shrink-0"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(sz,{tab:d,current:g.length,onTab:h,onClose:q}),"history"===d?(0,s.jsx)(s$,{pages:y,threads:k,scroll:p,onPick:o}):g.length?(0,s.jsx)(sK,{threads:g,onPick:o}):f.length?(0,s.jsx)(sB,{}):(0,s.jsx)(sF,{bots:n}),(0,s.jsx)(s6,{crew:$,more:R,bubble:null,label:"Fold the room away",onClick:q,onWrite:s_.writeLine.open,side:O?(0,s.jsx)(an,{handoff:O}):(0,s.jsx)(s7,{busy:z,pending:F,grown:!0})})]})}):(0,s.jsx)(s4,{crew:A,more:R,bubble:O,rows:f.filter(e=>!t.includes(e.id)&&(sP(e)||sD(e))),count:e.length,busy:z,pending:F,unread:B.length,onPick:e=>{o(e),i(!0)},onOpen:()=>i(!0)})})});var ao=e.i(222055),al=e.i(6799),au=e.i(393080),ac=e.i(721806),ad=e.i(463625);function ah(e){let t=e??ad.BOT_SEEDS.filter(e=>e.recommended).map(e=>({name:e.name}));t.length&&(0,ac.createSeedBotsAction)(t).then(au.unwrapResult).then(()=>(0,sb.revalidate)(w.queryKey.bot)).catch(e=>al.toast.add({type:"warning",title:"Could not set up the bots",description:(0,T.errorToString)(e)}))}e.s(["installSeedBots",0,ah],747985);var ap=e.i(616816),af=e.i(992112);let am={name:"app-window-mac",size:24,node:[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M14 8h.01",key:"1primd"}]]};am.node;let ag=(0,l.default)(am),ax={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};ax.node;let ay=(0,l.default)(ax);e.s(["ArrowUpRight",0,ay],375775);let av="thursday.install-asked",ab=null,a_=new Set,aw=()=>{for(let e of a_)e()};function ak(){return(0,_.useSyncExternalStore)(e=>(a_.add(e),()=>a_.delete(e)),()=>ab,()=>null)}async function aj(){let e=ab;e&&(ab=null,aw(),await e.prompt(),await e.userChoice.catch(()=>void 0))}function aT({hidden:e}){let t=null!==ak(),[n,r]=(0,_.useState)(!0);if((0,_.useEffect)(()=>{try{r(null!==window.localStorage.getItem(av))}catch{}},[]),!t||n||e)return null;let i=()=>{r(!0);try{window.localStorage.setItem(av,"1")}catch{}};return(0,s.jsxs)("div",{className:"flex w-76 animate-in items-start gap-3 rounded-2xl bg-background p-3.5 shadow-[0_22px_44px_-20px_rgb(0_0_0/0.22)] ring-1 ring-border duration-300 fade-in slide-in-from-top-1",children:[(0,s.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted",children:(0,s.jsx)(ag,{className:"size-4"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-2.5",children:[(0,s.jsxs)("p",{className:"text-[13px] leading-snug",children:[(0,s.jsx)("span",{className:"block font-medium",children:"Keep her in her own window"}),(0,s.jsx)("span",{className:"block text-muted-foreground",children:"Install Thursday as an app, with its own icon. A closed tab no longer takes her calls with it."})]}),(0,s.jsxs)("div",{className:"flex gap-1.5",children:[(0,s.jsx)(k.Button,{size:"sm",className:"rounded-full px-3.5",onClick:()=>{i(),aj()},children:"Install"}),(0,s.jsx)(k.Button,{size:"sm",variant:"ghost",className:"rounded-full px-3 text-muted-foreground",onClick:i,children:"Not now"})]})]})]})}function aS(){return null===ak()?null:(0,s.jsxs)("button",{type:"button",onClick:()=>void aj(),className:"group/install flex w-full items-start gap-2.5 rounded-xl px-3 py-2.5 text-left outline-none transition-colors hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,s.jsx)("span",{className:"mt-0.5 grid size-7 shrink-0 place-items-center rounded-lg bg-background ring-1 ring-border",children:(0,s.jsx)(ag,{className:"size-3.5"})}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1 text-sm font-medium",children:["Install app",(0,s.jsx)(ay,{className:"size-3.5 text-muted-foreground transition-transform group-hover/install:translate-x-px group-hover/install:-translate-y-px"})]}),(0,s.jsx)("span",{className:"block text-xs leading-snug text-muted-foreground",children:"Its own window, apart from your tabs"})]})]})}window.addEventListener("beforeinstallprompt",e=>{e.preventDefault(),ab=e,aw()}),window.addEventListener("appinstalled",()=>{ab=null,aw()});let aN={name:"aperture",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m14.31 8 5.74 9.94",key:"1y6ab4"}],["path",{d:"M9.69 8h11.48",key:"1wxppr"}],["path",{d:"m7.38 12 5.74-9.94",key:"1grp0k"}],["path",{d:"M9.69 16 3.95 6.06",key:"libnyf"}],["path",{d:"M14.31 16H2.83",key:"x5fava"}],["path",{d:"m16.62 12-5.74 9.94",key:"1vwawt"}]]};aN.node;let aC=(0,l.default)(aN);var aE=e.i(758925),aM=e.i(218964),aO=e.i(97923);let aA={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};aA.node;let aR=(0,l.default)(aA),aL={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};aL.node;let aI=(0,l.default)(aL);var aP=e.i(986206);let aD={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};aD.node;let az=(0,l.default)(aD);var aF=e.i(770703),aB=e.i(630374),a$=e.i(421429),aq=e.i(895836);function aU(){let{data:e}=(0,sb.useServerRoute)(w.queryKey.bot);return e&&0===e.length?"amber":null}function aH(){let{data:e}=(0,sb.useServerRoute)(w.queryKey.threads);return{owed:(e??[]).filter(e=>(0,sp.needsThreadReply)(e)||"done"===e.status&&!e.seen).length}}function aK(){let{data:e,isLoading:t}=(0,sb.useServerRoute)(w.queryKey.config);if(t)return null;let n=t=>(0,af.isConfigSet)(e,t);return af.CONFIG_GROUPS.some(e=>"keys"===e.section&&!(0,af.groupSatisfied)(e,n))?"amber":null}let aY=af.CONFIG_GROUPS.filter(e=>"models"===e.section).flatMap(e=>e.entries.filter(e=>e.kind).map(e=>e.key));function aV(){let{data:e,isLoading:t}=(0,sb.useServerRoute)(w.queryKey.config);return t||!e?null:aY.every(t=>!(0,af.isConfigSet)(e,t))?"amber":null}function aW(){let{data:e}=(0,sb.useServerRoute)(w.queryKey.mcp);return e?.some(e=>e.lastError)?"red":null}var aG=e.i(991322),aX=e.i(852116),aJ=e.i(589128);let aQ=e.i(569644).FolderOpen;var aZ=e.i(922521),a0=e.i(734080),a1=e.i(989409),a2=aq;let a5=(e,t=a2.SettingSkeleton)=>(0,aF.default)(e,{loading:()=>(0,s.jsx)(t,{})}),a3=a5(()=>e.A(48663).then(e=>({default:e.MemorySetting}))),a4=a5(()=>e.A(959484).then(e=>({default:e.BotSetting})),a2.SettingPanesSkeleton),a6=a5(()=>e.A(954404).then(e=>({default:e.ThreadSetting}))),a7=a5(()=>e.A(483782).then(e=>({default:e.RoutineSetting}))),a8=a5(()=>e.A(711454).then(e=>({default:e.ModelsSetting}))),a9=a5(()=>e.A(711454).then(e=>({default:e.KeysSetting}))),oe=a5(()=>e.A(711454).then(e=>({default:e.PhoneSetting}))),ot=a5(()=>e.A(17613).then(e=>({default:e.ThursdaySetting}))),on=a5(()=>e.A(706108).then(e=>({default:e.ArtifactSetting})),a2.SettingPanesSkeleton),or=a5(()=>e.A(194379).then(e=>({default:e.WorkspaceSetting})),a2.SettingPanesSkeleton),oi=a5(()=>e.A(832663).then(e=>({default:e.SkillsSetting}))),os=a5(()=>e.A(959108).then(e=>({default:e.McpSetting}))),oa=a5(()=>e.A(663973).then(e=>({default:e.SignInsSetting})));function oo({tabs:e}){let[t,n]=(0,_.useState)(0),r=e[t].Component;return(0,s.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,s.jsx)("div",{className:"shrink-0 px-8 pt-5",children:(0,s.jsx)(a2.SettingColumn,{children:(0,s.jsx)(a$.Segmented,{"aria-label":"Screens of this section",options:e.map((e,t)=>({value:String(t),label:e.label})),value:String(t),onChange:e=>n(Number(e))})})}),(0,s.jsx)("div",{className:"min-h-0 flex-1",children:(0,s.jsx)(r,{})})]})}let ol=[{label:"Finished",Component:on},{label:"All files",Component:or}],ou=["call","work","app"],oc=[{id:"thursday",label:"Thursday",group:"call",hint:"Her face, models, and how a call starts",icon:s0.ThursdayMark,Component:ot},{id:"memory",label:"Memory",group:"call",hint:"What the agent knows",icon:aX.MemoryMark,Component:a3},{id:"bot",label:"Bots",group:"work",hint:"Workers the agent delegates to",icon:sf.BotsMark,Component:a4,Badge:function(){return aU()?(0,s.jsx)(aq.NavBadge,{tone:"amber"}):null}},{id:"threads",label:"Threads",group:"work",hint:"Work the bots were handed",icon:aM.ListChecks,Component:a6,Badge:function(){return(0,s.jsx)(aq.NavBadge,{tone:"amber",count:aH().owed})}},{id:"routines",label:"Routines",group:"work",hint:"Work that starts by itself, on a schedule",icon:sI.RoutineMark,Component:a7},{id:"files",label:"Files",group:"work",hint:"What the bots finished, and everything else they wrote",icon:aQ,Component:()=>(0,s.jsx)(oo,{tabs:ol})},{id:"skills",label:"Skills",group:"work",hint:"Instructions the bots load on demand",icon:aJ.SkillsMark,Component:oi},{id:"mcp",label:"Connectors",group:"work",hint:"Tools from MCP servers",icon:aG.McpMark,Component:os,Badge:function(){return aW()?(0,s.jsx)(aq.NavBadge,{tone:"red"}):null}},{id:"signins",label:"Sign-ins",group:"work",hint:"The sites you signed in to, and the bots that may use each",icon:aO.LogIn,Component:oa},{id:"models",label:"Models",group:"app",hint:"What bots think with, and what they draw, film and speak with",icon:aC,Component:a8},{id:"keys",label:"API keys",group:"app",hint:"The accounts the app runs on",icon:aE.KeyRound,Component:a9,Badge:function(){let e=aK(),t=aV();return e||t?(0,s.jsx)(aq.NavBadge,{tone:"amber"}):null}},{id:"phone",label:"Phone",group:"app",hint:"Write to Thursday from a chat app",icon:aP.Smartphone,Component:oe}],od={system:{label:"System",icon:aR},light:{label:"Light",icon:az},dark:{label:"Dark",icon:aI}};function oh(){let e=(0,aZ.useTheme)();return(0,s.jsx)(a$.Segmented,{"aria-label":"Theme",className:"w-full gap-0.5 *:flex-1 *:py-1.5",options:a0.THEMES.map(e=>{let{label:t,icon:n}=od[e];return{value:e,title:t,label:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n,{className:"size-3.5"}),(0,s.jsx)("span",{className:"sr-only",children:t})]})}}),value:e,onChange:aZ.setTheme})}function op({children:e}){let t=(0,a1.useSettingsStore)(e=>e.open),n=(0,a1.useSettingsStore)(e=>e.section),r=(0,a1.useSettingsStore)(e=>e.show),i=(0,a1.useSettingsStore)(e=>e.hide),a=(0,a1.useSettingsStore)(e=>e.pick),o=(0,_.useRef)(null),l=oc.find(e=>e.id===n)??oc[0];return(0,_.useEffect)(()=>{if(!t)return;let e=e=>{if(!e.metaKey&&!e.ctrlKey)return;if("k"===e.key){let t=o.current?.querySelector("[data-setting-filter]");if(!t)return;e.preventDefault(),t.focus(),t.select();return}let t=Number(e.key);Number.isInteger(t)&&t>=1&&t<=oc.length&&(e.preventDefault(),a(oc[t-1].id))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,a]),(0,s.jsxs)(aB.Dialog,{open:t,onOpenChange:e=>e?r():i(),children:[e&&(0,s.jsx)(aB.DialogTrigger,{render:e}),(0,s.jsxs)(aB.DialogContent,{className:"block h-[min(52rem,calc(100vh-3rem))] overflow-hidden p-0 sm:max-w-[min(80rem,calc(100vw-3rem))]",children:[(0,s.jsx)(aB.DialogTitle,{className:"sr-only",children:"Settings"}),(0,s.jsxs)("div",{className:"flex h-full min-h-0",children:[(0,s.jsxs)("nav",{"aria-label":"Settings sections",onKeyDown:e=>{let t,r="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0;if(!r)return;e.preventDefault();let i=(t=(oc.findIndex(e=>e.id===n)+r+oc.length)%oc.length,oc[t].id);a(i),e.currentTarget.querySelector(`[data-section="${i}"]`)?.focus()},className:"flex w-52 shrink-0 flex-col gap-0.5 border-r border-border/60 bg-muted/30 p-3",children:[ou.map(e=>(0,s.jsxs)(_.Fragment,{children:[(0,s.jsx)("span",{className:"px-3 pt-3 pb-1 font-mono text-[10px] text-muted-foreground/60",children:e}),oc.filter(t=>t.group===e).map(e=>(0,s.jsxs)(k.Button,{"data-section":e.id,onClick:()=>a(e.id),variant:e.id===n?"secondary":"ghost",className:(0,T.cn)("justify-start",e.id===n?"text-foreground bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]":"text-muted-foreground"),children:[(0,s.jsx)(e.icon,{className:(0,T.cn)("mr-1")}),(0,s.jsx)("span",{className:"truncate text-sm",children:e.label}),e.Badge&&(0,s.jsx)("span",{className:"ml-auto flex items-center",children:(0,s.jsx)(e.Badge,{})})]},e.id))]},e)),(0,s.jsxs)("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[(0,s.jsx)(aS,{}),(0,s.jsx)("div",{className:"px-1",children:(0,s.jsx)(oh,{})})]})]}),(0,s.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[(0,s.jsx)("div",{className:"shrink-0 px-8 pt-10",children:(0,s.jsxs)(a2.SettingColumn,{className:"animate-in space-y-0.5 fade-in slide-in-from-bottom-1 duration-300",children:[(0,s.jsx)("p",{className:"truncate text-2xl font-semibold",children:l.label}),(0,s.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:l.hint})]},l.id)}),(0,s.jsx)("div",{ref:o,className:"min-h-0 min-w-0 flex-1",children:(0,s.jsx)(l.Component,{})})]})]})]})]})}function of(e){return e.includes("red")?"red":e.includes("amber")?"amber":null}function om(){let e=aU(),t=aH().owed>0?"amber":null;return{bot:e,threads:t,mcp:aW(),models:of([aK(),aV()])}}var og=e.i(762074);function ox(){let e=performance.now()/1e3;return Array.from({length:8},(t,n)=>.18+.16*Math.sin(e*(5+.9*n)+1.7*n)**2)}e.s(["silentVoice",0,ox],234916);var oy=e.i(671228),ov=e.i(67045),ob=e.i(670097),o_=e.i(640262),ow=e.i(213377),ok=e.i(95187);let oj=(0,ok.createServerReference)("7fa0dd7045a8b45c7045e5f8237e003914126fb396",ok.callServer,void 0,ok.findSourceMapURL,"acceptThreadRelaysAction");var oT=e.i(609856);let oS=new Set,oN={question:0,stopped:1,done:2,progress:3};function oC(e){let t=e.trim();if(t.length<=sc.CALL_RELAY.chars)return t;let n=t.slice(0,sc.CALL_RELAY.chars),r=Math.max(n.lastIndexOf("\n\n"),n.lastIndexOf(". "),n.lastIndexOf(".\n"),n.lastIndexOf("。")),i=(r>sc.CALL_RELAY.chars/3?n.slice(0,r+1):n).trim();return`${i}
|
|
4
|
-
[The message goes on; the rest is in its thread on screen.]`}function oE(e){let t=[];for(let n of e){let{relays:e,questions:r}=n.room,i=(0,sx.toDate)(n.updatedAt).getTime(),s=(e,t)=>`[${e} → Thursday, thread "${n.label}" (${n.id}), ${t}.]`,a=(e,t)=>({kind:"relay",name:n.label,line:t,done:!0,bot:e});for(let n of r){let r=n.options?.length?` Options: ${n.options.join(" / ")}.`:"";t.push({rank:oN.question,key:`question:${n.id}`,kind:"question",line:`${s(n.bot,"question")}
|
|
5
|
-
${oC(n.text)}${r}`,relayIds:e.filter(e=>e.messageId===n.id).map(e=>e.id),show:a(n.bot,`${n.bot}: question`)})}let o=e.filter(e=>!r.some(t=>t.id===e.messageId)),l="done"===n.status,u="waiting"===n.status&&(0,sp.isAppStop)(n.ask)&&!n.ask?.auto;if(l||u){if(n.seen)continue;let e=u?"stopped":"done",r="stopped"===e?`It stopped before finishing. Where it got to: ${oC(n.ask?.question??n.outcome??"")}`:`Done. Its answer: ${oC(n.outcome??"")}`;t.push({rank:oN[e],key:`${e}:${n.id}@${i}`,kind:"ending",line:`${s(n.bot,e)}
|
|
6
|
-
${r}`,relayIds:o.map(e=>e.id),show:a(n.bot,"stopped"===e?`${n.bot} stopped`:`Answer from ${n.bot}`)});continue}for(let e of o)t.push({rank:oN.progress,key:`progress:${e.id}`,kind:"progress",line:`${s(e.bot,e.kind)}
|
|
7
|
-
${oC(e.text)}`,relayIds:[e.id],show:a(e.bot,`${e.bot}: ${e.kind}`)})}return t.sort((e,t)=>e.rank-t.rank)}let oM=(0,ok.createServerReference)("7f2a5dcd6aeb34c34c150e5054a0fc8ac6c4d56e77",ok.callServer,void 0,ok.findSourceMapURL,"endCallAction"),oO=(0,ok.createServerReference)("7f4c4e69d103c06312b82dbb684f4d77ac276932f9",ok.callServer,void 0,ok.findSourceMapURL,"openTextCallAction");var oA=e.i(561540);let oR={relay:!0},oL=new o_.DefaultChatTransport({api:w.queryKey.textCall}),oI=()=>ov.useThursdayStore.getState().textModel;async function oP(e,t,n,r){try{let i=await fetch(w.queryKey.toolCall,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolCallId:t.id,callId:e,webSearch:n,name:t.name,input:t.arguments?JSON.parse(t.arguments):{}}),signal:r}),{output:s}=(0,au.unwrapResult)(await i.json());return"string"==typeof s?s:JSON.stringify(s??null)}catch(e){return`Error: ${(0,T.errorToString)(e)}`}}var oD=e.i(319841);let oz={"not-allowed":"The microphone is not allowed","service-not-allowed":"The microphone is not allowed","audio-capture":"There is no microphone","language-not-supported":"This browser cannot listen in that language"},oF=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,"").split(/\s+/).filter(Boolean),oB=(e,t,n)=>Math.abs(e.length-t.length)<=n&&function(e,t){let n=Array.from({length:e.length+1},(e,t)=>t),r=Array(e.length+1).fill(0);for(let i=1;i<=t.length;i++){r[0]=i;for(let s=1;s<=e.length;s++){let a=n[s-1]+ +(t[i-1]!==e[s-1]);r[s]=Math.min(a,n[s]+1,r[s-1]+1)}[n,r]=[r,n]}return n[e.length]}(e,t)<=n;function o$({enabled:e,onWake:t,phrases:n,lang:r="en-US",tolerance:i=.34,onError:s}){let a=(0,_.useRef)({onWake:t,onError:s,phrases:n,tolerance:i});a.current={onWake:t,onError:s,phrases:n,tolerance:i},(0,_.useEffect)(()=>{if(!e)return;let t=window,n=t.SpeechRecognition??t.webkitSpeechRecognition;if(!n)return void a.current.onError?.("This browser cannot listen for a wake word");let i=new n,s=!0,o=!0,l=null,u=300;i.lang=r,i.continuous=!0,i.interimResults=!0,i.maxAlternatives=3;let c=()=>{if(s){o=!0;try{i.start()}catch{}}};return i.onresult=({resultIndex:e,results:t})=>{if(!s||!o)return;u=300;let{phrases:n,tolerance:r,onWake:l}=a.current,c=n.map(oF).filter(e=>e.length);for(let n=e;n<t.length;n++){let e=t[n];for(let t=0;t<e.length;t++){let n=e[t].transcript,s=oF(n);if(c.some(e=>(function(e,t,n){for(let r=0;r<e.length;r++)if(function e(t,n,r,i,s){if(i===r.length)return!0;if(n>=t.length)return!1;let a=r[i],o=Math.max(1,Math.round(a.length*s));return!!(oB(t[n],a,o)&&e(t,n+1,r,i+1,s))||n+1<t.length&&oB(t[n]+t[n+1],a,o)&&e(t,n+2,r,i+1,s)}(e,r,t,0,n))return!0;return!1})(s,e,r))){o=!1,i.abort(),l(n.trim());return}}}},i.onerror=({error:e})=>{let t=oz[e];t?(s=!1,a.current.onError?.(t)):"network"===e&&(u=Math.min(2*u,1e4))},i.onend=()=>{s&&(l=setTimeout(c,u))},c(),()=>{s=!1,l&&clearTimeout(l),i.onresult=null,i.onerror=null,i.onend=null,i.abort()}},[e,r])}e.s(["useWakeWord",0,o$],656572);let oq={silent:{level:-1},fatal:{level:0},error:{level:0},warn:{level:1},log:{level:2},info:{level:3},success:{level:3},fail:{level:3},ready:{level:3},start:{level:3},box:{level:3},debug:{level:4},trace:{level:5},verbose:{level:1/0}};function oU(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e))}let oH=!1,oK=[];class oY{options;_lastLog;_mockFn;constructor(e={}){const t=e.types||oq;for(const n in this.options=((...e)=>e.reduce((e,t)=>(function e(t,n,r=".",i){if(!oU(n))return e(t,{},r,i);let s=Object.assign({},n);for(let n in t){if("__proto__"===n||"constructor"===n)continue;let a=t[n];null!=a&&(i&&i(s,n,a,r)||(Array.isArray(a)&&Array.isArray(s[n])?s[n]=[...a,...s[n]]:oU(a)&&oU(s[n])?s[n]=e(a,s[n],(r?`${r}.`:"")+n.toString(),i):s[n]=a))}return s})(e,t,"",void 0),{}))({...e,defaults:{...e.defaults},level:oV(e.level,t),reporters:[...e.reporters||[]]},{types:oq,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}}),t){const e={type:n,...this.options.defaults,...t[n]};this[n]=this._wrapLogFn(e),this[n].raw=this._wrapLogFn(e,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=oV(e,this.options.types,this.options.level)}prompt(e,t){if(!this.options.prompt)throw Error("prompt is not supported!");return this.options.prompt(e,t)}create(e){let t=new oY({...this.options,...e});return this._mockFn&&t.mockTypes(this._mockFn),t}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){let t=this.options.reporters.indexOf(e);if(-1!==t)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(let e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,t){e&&(e.__write||(e.__write=e.write),e.write=e=>{this[t].raw(String(e).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){oH=!0}resumeLogs(){for(let e of(oH=!1,oK.splice(0)))e[0]._logFn(e[1],e[2])}mockTypes(e){let t=e||this.options.mockFn;if(this._mockFn=t,"function"==typeof t)for(let e in this.options.types)this[e]=t(e,this.options.types[e])||this[e],this[e].raw=this[e]}_wrapLogFn(e,t){return(...n)=>oH?void oK.push([this,e,n,t]):this._logFn(e,n,t)}_logFn(e,t,n){var r,i;if((e.level||0)>this.level)return!1;let s={date:new Date,args:[],...e,level:oV(e.level,this.options.types)};n||1!==t.length||+(i=r=t[0],"[object Object]"!==Object.prototype.toString.call(i)||!r.message&&!r.args||!!r.stack)?s.args=[...t]:Object.assign(s,t[0]),s.message&&(s.args.unshift(s.message),delete s.message),s.additional&&(Array.isArray(s.additional)||(s.additional=s.additional.split("\n")),s.args.push("\n"+s.additional.join("\n")),delete s.additional),s.type="string"==typeof s.type?s.type.toLowerCase():"log",s.tag="string"==typeof s.tag?s.tag:"";let a=(e=!1)=>{let t=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&t>0){let e=[...this._lastLog.object.args];t>1&&e.push(`(repeated ${t} times)`),this._log({...this._lastLog.object,args:e}),this._lastLog.count=1}e&&(this._lastLog.object=s,this._log(s))};clearTimeout(this._lastLog.timeout);let o=this._lastLog.time&&s.date?s.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=s.date,o<this.options.throttle)try{let e=JSON.stringify([s.type,s.tag,s.args]),t=this._lastLog.serialized===e;if(this._lastLog.serialized=e,t&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(a,this.options.throttle);return}}catch{}a(!0)}_log(e){for(let t of this.options.reporters)t.log(e,{options:this.options})}}function oV(e,t={},n=3){return void 0===e?n:"number"==typeof e?e:t[e]&&void 0!==t[e].level?t[e].level:n}oY.prototype.add=oY.prototype.addReporter,oY.prototype.remove=oY.prototype.removeReporter,oY.prototype.clear=oY.prototype.removeReporter,oY.prototype.withScope=oY.prototype.withTag,oY.prototype.mock=oY.prototype.mockTypes,oY.prototype.pause=oY.prototype.pauseLogs,oY.prototype.resume=oY.prototype.resumeLogs;class oW{options;defaultColor;levelColorMap;typeColorMap;constructor(e){this.options={...e},this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}_getLogFn(e){return e<1?console.__error||console.error:1===e?console.__warn||console.warn:console.__log||console.log}log(e){let t=this._getLogFn(e.level),n="log"===e.type?"":e.type,r=e.tag||"",i=this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor,s=`
|
|
8
|
-
background: ${i};
|
|
9
|
-
border-radius: 0.5em;
|
|
10
|
-
color: white;
|
|
11
|
-
font-weight: bold;
|
|
12
|
-
padding: 2px 0.5em;
|
|
13
|
-
`,a=`%c${[r,n].filter(Boolean).join(":")}`;"string"==typeof e.args[0]?t(`${a}%c ${e.args[0]}`,s,"",...e.args.slice(1)):t(a,s,...e.args)}}function oG(e={}){return function(e={}){return new oY(e)}({reporters:e.reporters||[new oW({})],prompt:(e,t={})=>"confirm"===t.type?Promise.resolve(confirm(e)):Promise.resolve(prompt(e)),...e})}oG();var oX=e.i(379227);let{env:oJ={},argv:oQ=[],platform:oZ=""}=void 0===ii.default?{}:ii.default,o0="NO_COLOR"in oJ||oQ.includes("--no-color"),o1="FORCE_COLOR"in oJ||oQ.includes("--color"),o2="dumb"===oJ.TERM,o5=oX&&oX.isatty&&oX.isatty(1)&&oJ.TERM&&!o2,o3="CI"in oJ&&("GITHUB_ACTIONS"in oJ||"GITLAB_CI"in oJ||"CIRCLECI"in oJ),o4=!o0&&(o1||"win32"===oZ&&!o2||o5||o3);function o6(e,t,n){return function(e,t,n=e,r=e.length+1){return i=>{var s;return i||""!==i&&void 0!==i?(s=(""+i).indexOf(t,r),s<0?e+i+t:e+function e(t,n,r,i,s=n.slice(0,Math.max(0,t))+i,a=n.slice(Math.max(0,t+r.length)),o=a.indexOf(r)){return s+(o<0?a:e(o,a,r,i))}(s,i,t,n)+t):""}}(`\x1b[${e}m`,`\x1b[${t}m`,n)}let o7={reset:o6(0,0),bold:o6(1,22,"\x1b[22m\x1b[1m"),dim:o6(2,22,"\x1b[22m\x1b[2m"),italic:o6(3,23),underline:o6(4,24),inverse:o6(7,27),hidden:o6(8,28),strikethrough:o6(9,29),black:o6(30,39),red:o6(31,39),green:o6(32,39),yellow:o6(33,39),blue:o6(34,39),magenta:o6(35,39),cyan:o6(36,39),white:o6(37,39),gray:o6(90,39),bgBlack:o6(40,49),bgRed:o6(41,49),bgGreen:o6(42,49),bgYellow:o6(43,49),bgBlue:o6(44,49),bgMagenta:o6(45,49),bgCyan:o6(46,49),bgWhite:o6(47,49),blackBright:o6(90,39),redBright:o6(91,39),greenBright:o6(92,39),yellowBright:o6(93,39),blueBright:o6(94,39),magentaBright:o6(95,39),cyanBright:o6(96,39),whiteBright:o6(97,39),bgBlackBright:o6(100,49),bgRedBright:o6(101,49),bgGreenBright:o6(102,49),bgYellowBright:o6(103,49),bgBlueBright:o6(104,49),bgMagentaBright:o6(105,49),bgCyanBright:o6(106,49),bgWhiteBright:o6(107,49)},o8=function(e=o4){return e?o7:Object.fromEntries(Object.keys(o7).map(e=>[e,String]))}();[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");let o9=oG({level:sc.IS_DEV?4:3}),le=(r=sc.APP_NAME,o9.withDefaults({message:(i=`${r}: `,(function(e,t="reset"){return o8[e]||o8[t]})("blackBright")(i))}));var lt=e.i(413168);let ln={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},lr=sy("live"),li=new TextEncoder;async function ls(e){let t=la(e);try{return await t.connect(),t}catch(e){throw await t.close(),e}}let la=({initialize:e,audio:t,on:n})=>{let r,i,s,a,o,l,u,c,d=!1,h=!1,p=!1,f=0,m=0,g="",x=[],y=new Set,v=new Set,b=new Set,_=new Map,w=!1,k=new Map,j=new Map,S=[],N=null,C=-1/0,E=()=>{for(let e of(clearTimeout(u),u=void 0,y))n.turn({...e.turn,fragments:[...e.fragments],done:!0});y.clear()},M=()=>{if(!p){for(let e of(p=!0,clearTimeout(o),clearTimeout(c),clearInterval(l),E(),N=null,S.splice(0)))e.settle(!1);z.close(),s?.()}},O=e=>{i?.(Error(e)),M(),d&&!h?n.failed(e):h&&n.warn(e)},A=-1/0,R=()=>{if(p||h)return;let e=performance.now(),r=t.levels?.();r&&r.output>.01&&(C=e);let i={speaking:e-C<300,working:[..._.values()].some(e=>!e.terminal)||j.size>0||e-A<5e3,tools:[...j.values()]},s=JSON.stringify(i);(s!==g||i.speaking||i.working)&&(g=s,n.activity(i))},L=()=>{if(!d||p||h||N||!S.length)return;let[e]=S;N=crypto.randomUUID(),lr("out",{type:`session.${e.kind}.append`,client:N,head:e.chunks[0].slice(0,80),chunksLeft:e.chunks.length}),z.send({type:`session.${e.kind}.append`,event_id:N,delegation_id:null,content:e.chunks[0]}),c=setTimeout(()=>{n.warn("Live did not acknowledge the conversation update; delivery is unknown."),I(!1)},sc.LIVE_CALL.appendMs)},I=e=>{clearTimeout(c),N=null;let[t]=S;t&&(e&&t.chunks.shift(),e&&t.chunks.length||(S.shift(),t.settle(e)),L())},P=(e,t)=>{if(!e.delta||void 0===e.start_ms||void 0===e.end_ms)return;let r=e.start_ms,i=e.end_ms,s=x.findLast(e=>e.turn.role===t&&r>=e.turn.seq-sc.LIVE_CALL.transcriptGapMs&&r<=e.end+sc.LIVE_CALL.transcriptGapMs&&("user"===t||!x.some(t=>"user"===t.turn.role&&t.turn.seq>e.turn.seq&&t.turn.seq<r)));s||(s={turn:{id:`live-${m++}`,role:t,text:"",seq:r,done:!1},end:i,fragments:[]},x.push(s)),s.fragments.push({start:r,end:i,text:e.delta}),s.fragments.sort((e,t)=>e.start-t.start),s.end=Math.max(s.end,i),s.turn.text=s.fragments.map(e=>e.text).join(""),n.turn({...s.turn,done:!1}),y.add(s),u??=setTimeout(E,sc.LIVE_CALL.transcriptSaveMs)},D=async e=>{e.terminal&&!e.continued&&e.calls.size&&(e.continued=!0,await Promise.all(e.calls.values()),lr("out",{type:"response.create",closing:h,closed:p}),h||p||(A=performance.now(),z.send({type:"response.create",event_id:crypto.randomUUID()})),R())},z=function({negotiate:e,audio:t,on:n}){let r,i,s=null,a=null,o=null,l=!1,u=!1,c=!1,d=e=>{for(let t of e?.getTracks()??[])t.stop()};return{async connect(){let h=new RTCPeerConnection;s=h;let p=h.createDataChannel("oai-events");a=p;let f=new Promise((e,t)=>{r=t;let i=e=>{l||c||(c=!0,u?n.dropped(e):t(Error(e)))};p.onopen=()=>{u=!0,e()},p.onclose=()=>i("The connection to OpenAI Live closed."),p.onerror=()=>i("The connection to OpenAI Live dropped."),h.onconnectionstatechange=()=>{["failed","closed"].includes(h.connectionState)&&i("Could not reach OpenAI Live.")}});f.catch(()=>{}),p.onmessage=({data:e})=>{let t;if(!l&&"string"==typeof e){try{t=JSON.parse(e)}catch{n.dropped("OpenAI Live sent an unreadable event.");return}n.event(t)}},h.ontrack=e=>{if(l)return;let n=e.streams[0]??new MediaStream([e.track]);t.element.srcObject=n,t.listen(n)};let m=await navigator.mediaDevices.getUserMedia({audio:ln});if(l)throw d(m),Error("The call closed before connecting.");for(let e of(o=m,t.hear?.(m),m.getAudioTracks()))h.addTrack(e,m);await h.setLocalDescription(await h.createOffer()),"complete"!==h.iceGatheringState&&await new Promise((e,t)=>{let n=n=>{clearTimeout(s),h.removeEventListener("icegatheringstatechange",r),i=void 0,n?t(n):e()},r=()=>{"complete"===h.iceGatheringState&&n()},s=setTimeout(()=>n(Error("ICE gathering timed out.")),1e4);i=()=>n(Error("The call closed before connecting.")),h.addEventListener("icegatheringstatechange",r),r()});let g=h.localDescription?.sdp;if(!g||l)throw Error("No live SDP offer is available.");let x=await e(g);if(l)throw Error("The call closed before connecting.");await h.setRemoteDescription({type:"answer",sdp:x}),await f},send(e){l||a?.readyState!=="open"||a.send(JSON.stringify(e))},close:()=>{l||(l=!0,r?.(Error("The call closed before connecting.")),i?.(),d(o),o=null,a?.close(),s?.close(),t.element.srcObject=null)}}}({audio:t,negotiate:async t=>{let n=await e(t);if(!n)throw Error("OpenAI Live returned no SDP answer.");return n},on:{event:e=>{if(!p){if(e.event_id){if(v.has(e.event_id))return;v.add(e.event_id)}switch(f=Math.max(f,e.offset_ms??0,e.end_ms??0),!e.type.endsWith(".delta")&&!e.event?.type.endsWith(".delta")&&lr("in",{type:e.type,nested:e.event?.type,response:e.event?.response?.id??e.event?.response_id,status:e.event?.response?.status,item:e.event?.item&&{type:e.event.item.type,name:e.event.item.name,call:e.event.item.call_id,status:e.event.item.status},delegation:e.delegation_id,client:e.client_event_id,error:e.error?.message??e.event?.response?.error?.message,ms:e.offset_ms??e.start_ms}),e.type){case"session.started":d=!0,r?.(),L();break;case"session.closed":n.finalized?.({reason:e.reason??"closed",seconds:e.usage?.seconds??null}),le.info("Live session closed",{reason:e.reason,seconds:e.usage?.seconds}),i?.(Error("OpenAI Live closed before startup completed.")),M(),h||n.failed(`The Live call ended (${e.reason??"closed"}).`);break;case"session.input_transcript.delta":P(e,"user");break;case"session.output_transcript.delta":P(e,"assistant");break;case"session.instructions.appended":case"session.commentary.appended":case"session.thinking.appended":N&&e.client_event_id===N&&I(!0);break;case"error":{let t=e.error?.message??"OpenAI Live reported an error.";if(!d){O(t);break}n.warn(t),N&&e.error?.client_event_id===N&&I(!1);break}case"response.event":{let t=e.event;if(!t||h)break;"response.created"===t.type&&(A=-1/0),"response.created"===t.type&&t.response&&e.delegation_id&&k.set(e.delegation_id,t.response.id);let r=t.response?.id??t.response_id??(e.delegation_id?k.get(e.delegation_id):void 0);if(!r)break;let i=_.get(r);if(i||(i={calls:new Map,terminal:!1,continued:!1},_.set(r,i)),"response.reasoning_summary_text.done"===t.type&&n.reasoning?.({id:`${t.item_id}:${t.summary_index??0}`,text:t.text??"",seq:f}),("response.output_item.added"===t.type||"response.output_item.done"===t.type)&&t.item?.type===lt.LIVE_HOSTED_TOOLS.webSearch.item){let e=t.item,i="response.output_item.done"===t.type;i&&le.debug("Live web search",e),n.search?.({id:e.id,responseId:r,query:(e.action?.query??e.action?.queries?.join(" · "))?.trim()||null,sources:[...new Set((e.action?.sources??[]).flatMap(e=>e.url?[e.url]:[]))].map(e=>({url:e})),done:i,seq:f})}if("response.output_item.done"===t.type&&t.item?.type==="message"){let e=function(e){let t=new Map;for(let n of e??[])for(let e of n.annotations??[])"url_citation"===e.type&&e.url&&!t.has(e.url)&&t.set(e.url,{url:e.url,...e.title?{title:e.title}:{}});return[...t.values()]}(t.item.content);e.length&&n.cited?.(r,e)}if("response.output_item.done"===t.type&&t.item?.type==="function_call"){let e=t.item;if(b.has(e.call_id))break;if(b.add(e.call_id),"incomplete"===e.status){i.terminal=!0,le.warn("Live backend call cut off; not run",{responseId:r,name:e.name,arguments:e.arguments.slice(0,200)}),i.calls.size&&!w?(w=!0,D(i)):i.continued=!0;break}n.turn({id:e.id,role:"tool",tool:e.name,text:e.arguments,seq:f,done:!0}),E(),j.set(e.call_id,e.name);let s=Promise.resolve().then(()=>n.runTool({id:e.call_id,name:e.name,arguments:e.arguments,item:e.id})).catch(e=>`Error: ${(0,T.errorToString)(e)}`).then(t=>{j.delete(e.call_id),lr("out",{type:"function_call_output",name:e.name,call:e.call_id,size:t.length}),p||h||z.send({type:"response.item.create",event_id:crypto.randomUUID(),item:{type:"function_call_output",call_id:e.call_id,output:t}}),R()});i.calls.set(e.call_id,s),D(i)}["response.completed","response.failed","response.incomplete","response.cancelled"].includes(t.type)&&(i.terminal=!0,"response.completed"===t.type?(w=!1,le.debug("Live backend usage",{responseId:r,usage:t.response?.usage}),D(i)):"response.incomplete"===t.type&&i.calls.size&&!w?(w=!0,le.warn("Live backend response incomplete; continuing once",{responseId:r}),D(i)):(w=!1,i.continued=!0,n.warn(t.response?.error?.message??`The Live backend ${t.type.slice(9)}.`)))}}R()}},dropped:O}});return{async connect(){t.element.muted=!1;let e=new Promise((e,t)=>{r=e,i=t});e.catch(()=>{});let n=setTimeout(()=>O("OpenAI Live did not start in time."),sc.LIVE_CALL.startupMs);try{if(await Promise.all([z.connect(),e]),p)throw Error("The Live call closed during startup.");l=setInterval(R,100)}catch(e){throw M(),e}finally{clearTimeout(n),i=void 0}},close:()=>a||(p?Promise.resolve():(h=!0,E(),d)?(a=new Promise(e=>{s=e}),o=setTimeout(()=>{n.warn("Live disconnected without confirming final session usage."),M()},sc.LIVE_CALL.closeMs),t.element.muted=!0,lr("out",{type:"session.close"}),z.send({type:"session.close",event_id:crypto.randomUUID()}),a):(M(),Promise.resolve())),append(e,t){let n=function(e){let t=[],n="",r=0,i=e=>{let i=li.encode(e).length;if(r+i>480&&n&&(t.push(n),n="",r=0),i<=480){n+=e,r+=i;return}for(let i of e){let e=li.encode(i).length;r+e>480&&(t.push(n),n="",r=0),n+=i,r+=e}};for(let t of e.split(/(?<=\s)/))i(t);return n&&t.push(n),t}(t);return p||h||!n.length?Promise.resolve(!1):new Promise(t=>{S.push({kind:e,chunks:n,settle:t}),L()})},nudge(){let e=[..._.values()].some(e=>!e.terminal)||j.size>0||performance.now()-A<5e3;return!p&&!h&&!e&&(lr("out",{type:"response.create",nudge:!0}),A=performance.now(),z.send({type:"response.create",event_id:crypto.randomUUID()}),R(),!0)}}};var lo=e.i(218080),ll=e.i(567334);let lu=!1,lc=new Set,ld=new Set,lh={hold(e){if(e!==lu)for(let t of(lu=e,lc))t()},place(){for(let e of ld)e()},onPlace:e=>(ld.add(e),()=>{ld.delete(e)})};function lp(){return(0,_.useSyncExternalStore)(e=>(lc.add(e),()=>lc.delete(e)),()=>lu,()=>!1)}e.s(["callSignal",0,lh,"useCallHeld",0,lp],745747);let lf=[[22,["HELLO","HI","HEY"]],[17,["EVENING","HELLO","HI"]],[11,["HELLO","HI","HEY"]],[5,["MORNING","HELLO","HI"]],[0,["HELLO","HI","HEY"]]],lm=e=>e[Math.floor(Math.random()*e.length)],lg=(e,t)=>({text:e,at:Date.now(),hold:t});function lx(e=new Date){let t=e.getHours();return lg(lm(lf.find(([e])=>t>=e)?.[1]??["HI"]),1.6)}function ly(e=new Date){let t=e.getHours();return lg(t>=22||t<5?lm(["NIGHT","BYE"]):"BYE",1.2)}let lv=()=>lg("OK",1);e.s(["awake",0,()=>lg("HI",1.6),"finished",0,lv,"goodbye",0,ly,"greeting",0,lx],114923);let lb=(0,ok.createServerReference)("7fc6d79ad92635df62fcf3e92693d56a835ddc2877",ok.callServer,void 0,ok.findSourceMapURL,"openCallAction"),l_=(0,ok.createServerReference)("7fb2da80d9b55bccbc9630568ebabb82848332375b",ok.callServer,void 0,ok.findSourceMapURL,"saveThoughtAction"),lw=(0,ok.createServerReference)("7f2b91c3d2cefdd46343de0ee5224be3a883591137",ok.callServer,void 0,ok.findSourceMapURL,"saveTurnsAction"),lk=[620,775],lj=Array(lo.SPECTRUM_BANDS).fill(0),lT=!1;function lS(e){let t=e.replace(/\[[^\]]*\]?|\]/g,"").trim();return/[\p{L}\p{N}]/u.test(t)?t:""}function lN(e,t,n="This call is not being saved"){e.failures>=3||t().then(e=>(0,au.unwrapResult)(e)).catch(t=>{e.failures+=1,3===e.failures&&al.toast.add({type:"warning",title:n,description:(0,T.errorToString)(t)})})}var lC=e.i(116228),lE=e.i(807038),lM=e.i(83928),lO=e.i(616172),lA=e.i(621285);function lR(){return(0,s.jsx)(lA.FileViewer,{children:(0,s.jsx)(lL,{})})}function lL(){let[e,t]=(0,_.useState)([]),{data:n}=(0,sb.useServerRoute)(w.queryKey.bot),r=(0,s_.useBotThreads)(),i=(0,lA.useOpenFile)();(0,sm.useAppEvent)({showFile:e=>i(e.paths[0],e.paths.filter(e=>"image"===(0,lO.viewKindOf)(e))),finished:e=>t(t=>[{threadId:e.threadId,label:e.label,bot:e.bot,words:e.words,paths:e.paths},...t.filter(t=>t.threadId!==e.threadId)].slice(0,sc.FINISHED_NOTICE.rows))});let a=e=>t(t=>t.filter(t=>t.threadId!==e)),o=(0,_.useRef)(new Set);return((0,_.useEffect)(()=>{let n=[];for(let t of e){let e=r.find(e=>e.id===t.threadId);e&&(e.seen?o.current.delete(t.threadId)&&n.push(t.threadId):o.current.add(t.threadId))}n.length&&t(e=>e.filter(e=>!n.includes(e.threadId)))},[e,r]),e.length)?(0,s.jsxs)("div",{className:"absolute bottom-3 left-3 z-10 flex max-h-[calc(100%-1.5rem)] w-82 max-w-[calc(100vw-1.5rem)] flex-col-reverse gap-2 overflow-y-auto p-2 scrollbar-none",children:[e.map(e=>(0,s.jsx)(lI,{row:e,bot:n?.find(t=>t.name===e.bot),onOpen:t=>{if(t){var n;i(t,e.paths.filter(e=>"image"===(0,lO.viewKindOf)(e))),a(n=e.threadId),(0,lC.markSeenAction)([n]).then(au.unwrapResult).then(()=>(0,sb.revalidate)(w.queryKey.threads)).catch(e=>al.toast.add({type:"error",title:"Could not mark the thread as read",description:(0,T.errorToString)(e)}))}else s_.roomOpens.open(e.threadId),a(e.threadId)},onClose:()=>a(e.threadId)},e.threadId)),e.length>1&&(0,s.jsxs)("p",{className:"flex shrink-0 items-center px-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex-1",children:[e.length," new"]}),(0,s.jsx)("button",{type:"button",onClick:()=>t([]),className:"rounded-md px-1 font-sans text-[11px] outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:"Clear all"})]})]}):null}function lI({row:e,bot:t,onOpen:n,onClose:r}){let i=e.paths.length-4;return(0,s.jsxs)("div",{className:"flex shrink-0 animate-in gap-2.5 rounded-[20px] bg-background py-2.5 pr-2 pl-2.5 shadow-black/10 shadow-lg ring-1 ring-border fade-in slide-in-from-bottom-2 duration-300",children:[(0,s.jsx)(sf.BotMark,{size:32,seed:e.bot,color:t?.icon?.color,shape:t?.icon?.shape,outline:t?.icon?.outline,paint:t?.icon?.paint,notify:!1,className:"shrink-0"}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(0,s.jsxs)("div",{className:"flex items-start gap-1",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>n(e.paths[0]??null),className:"flex min-w-0 flex-1 flex-col gap-1.5 rounded-lg text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,s.jsxs)("span",{className:"flex min-h-8 flex-col justify-center",children:[(0,s.jsx)("span",{className:"truncate font-medium text-[14px] leading-5 tracking-[-0.15px]",children:e.label}),(0,s.jsx)("span",{className:"truncate font-mono text-[10px] leading-[13px] text-muted-foreground",children:e.bot})]}),e.words&&(0,s.jsx)("span",{className:"line-clamp-2 break-keep text-[12.5px] leading-normal text-muted-foreground",children:(0,lE.shortenPaths)(e.words)})]}),(0,s.jsx)(k.Button,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss",onClick:r,className:"shrink-0 text-muted-foreground",children:(0,s.jsx)(sZ.X,{})})]}),e.paths.length>0&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5 pt-0.5",children:[e.paths.slice(0,4).map(e=>(0,s.jsx)("button",{type:"button",title:e.split("/").pop(),onClick:()=>n(e),className:"rounded-[10px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,s.jsx)(lM.FileThumb,{path:e,glyph:"size-4",className:"h-15 w-12 rounded-[10px] ring-1 ring-border"})},e)),i>0&&(0,s.jsxs)("span",{className:"px-1 font-mono text-[11px] text-muted-foreground",children:["+",i]})]})]})]})}e.s(["ArtifactView",0,lR,"FinishedCard",0,lI],895499);var lP=e.i(333495);function lD(e){let t=[];for(let n of e){let e=t.at(-1);e?.role===n.role?e.text=`${e.text} ${n.text}`:t.push({...n})}return t}let lz={assistant:null,user:null};function lF(e,t){let[n,r]=(0,_.useState)(lz);return(0,_.useEffect)(()=>{t||r(lz)},[t]),(0,_.useEffect)(()=>{if(!t)return;let e=e=>{"ArrowDown"!==e.key||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(0,oD.capturesKeys)(e.target)||e.target?.closest?.('[role="dialog"]')||(e.preventDefault(),r(lz))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]),{pinned:n,pick:(0,_.useCallback)((t,n)=>{let i=e.filter(e=>e.role===t).length-1;r(e=>({...e,[t]:n>=i?null:n}))},[e]),back:null!==n.assistant||null!==n.user}}function lB({turns:e,pinned:t,live:n,onPick:r,under:i=null,ahead:a=!1}){let o=e.at(-1);return(0,s.jsx)(s.Fragment,{children:["assistant","user"].map(l=>(0,s.jsx)(l$,{role:l,turns:e.filter(e=>e.role===l),pinned:t[l],saying:n?o?.id:void 0,onPick:e=>r(l,e),under:"assistant"===l?i:null,ahead:"assistant"===l&&a},l))})}function l$({role:e,turns:t,pinned:n,saying:r,onPick:i,under:a,ahead:o}){let l="user"===e,[u,c]=(0,_.useState)({}),d=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>d.current?.disconnect(),[]);let h=(0,_.useCallback)(e=>{if(e)return d.current??=new ResizeObserver(e=>c(t=>{let n=t;for(let r of e){let e=r.target,i=e.dataset.turn;i&&t[i]!==e.offsetHeight&&(n===t&&(n={...t}),n[i]=e.offsetHeight)}return n})),d.current.observe(e),()=>d.current?.unobserve(e)},[]);if(!t.length&&!a)return null;let p=t.length-1,f=null===n&&(o||!t.length)?t.length:Math.min(n??p,p),m=e=>1150/(1150+700*Math.abs(e-f)),g=e=>e===f?1:.78,x=e=>(u[t[e].id]??28.475)*m(e)*g(e),y=Array(t.length+1).fill(0);y[f]=-28.475/2;for(let e=f-1;e>=0;e--)y[e]=y[e+1]-49-x(e);for(let e=f+1;e<t.length;e++)y[e]=y[e-1]+x(e-1)+49;let v=f===t.length?y[f]:f===p?y[f]+(u[t[f].id]??28.475)+8:null;return(0,s.jsxs)("div",{className:(0,T.cn)("pointer-events-none absolute h-0 w-[min(21.25rem,24vw)]",l?"left-full ml-1.5 [perspective-origin:0_0]":"right-full mr-1.5 [perspective-origin:100%_0]"),style:{top:"calc(50% + -40px)",perspective:1150},children:[t.map((e,n)=>{let a=Math.abs(n-f),o=n<f?f-n<=2:n-f<=2,u=n===f,c=o?u?1:.56*.6**(a-1):0,d=o&&!u,p=14*a*(l?-1:1)/m(n),x=y[n]/m(n);return(0,s.jsx)("div",{ref:h,"data-turn":e.id,"aria-hidden":!o,onClick:d?()=>i(n):void 0,style:{transform:`translate(${p.toFixed(1)}px, ${x.toFixed(1)}px) translateZ(${-700*a}px) scale(${g(n)})`,"--ink":c,"--lift":Math.max(c,.9)},className:(0,T.cn)("group/turn absolute top-0 w-max max-w-full text-[17px] leading-[1.675] tracking-[0.3px] text-foreground transition-transform duration-[520ms] ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none",l?"left-0 origin-top-left":"right-0 origin-top-right",!o&&"invisible",d&&"pointer-events-auto cursor-pointer",u&&"pointer-events-auto"),children:(0,s.jsxs)("p",{className:(0,T.cn)("break-keep text-pretty opacity-(--ink) transition-opacity duration-[520ms] motion-reduce:transition-none",!u&&"line-clamp-4",d&&"group-hover/turn:opacity-(--lift)"),children:[u&&(0,s.jsx)("span",{className:(0,T.cn)("mr-4 inline-block size-2.5 rounded-full align-middle",e.id===r?"animate-pulse motion-reduce:animate-none":"opacity-55",l?"bg-foreground":"bg-brand")}),n===t.length-1?(0,s.jsx)(E,{text:e.text}):e.text]})},e.id)}),a&&(0,s.jsx)("div",{"aria-hidden":null===v,style:{transform:`translateY(${(v??0).toFixed(1)}px)`},className:(0,T.cn)("absolute top-0 flex w-full transition-transform duration-[520ms] ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none",l?"left-0 justify-start":"right-0 justify-end",null===v&&"invisible"),children:a})]})}e.s(["SideCaptions",0,lB,"turnsOf",0,lD,"useTurnFocus",0,lF],435135);let lq=["▁▄▇▄","▂▆▆▂","▄▇▄▁","▆▆▂▂","▇▄▁▄","▆▂▂▆","▄▁▄▇","▂▂▆▆"];function lU({live:e,ringing:t}){let{owed:n}=aH(),r=of(Object.values(om()).map(e=>e??null));return(0,_.useEffect)(()=>{let r=t?`${sc.APP_NAME} is calling`:sc.APP_NAME,i=n>0?`(${n}) ${r}`:r;if(!e){document.title=i;return}let s=0;document.title=`${i} ${lq[s]}`;let a=setInterval(()=>{s=(s+1)%lq.length,document.title=`${i} ${lq[s]}`},100);return()=>clearInterval(a)},[e,n,t]),(0,_.useEffect)(()=>{let e=document.head.querySelector("link[data-tab-icon]");e||((e=document.createElement("link")).rel="icon",e.type="image/svg+xml",e.setAttribute("sizes","any"),e.dataset.tabIcon="",document.head.append(e)),e.href=`data:image/svg+xml,${encodeURIComponent(function(e){let{head:t,eyes:n}=(0,sf.markAtRest)(s0.THURSDAY_SEED),r=e?`<circle cx="200" cy="200" r="${66}"/>`:"",i=e?`<circle class="${e}" cx="200" cy="200" r="46"/>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="-6 -6 252 252"><style>.ink{fill:#0a0a0a}.amber{fill:#e17100}.red{fill:#e7000b}@media (prefers-color-scheme:dark){.ink{fill:#fafafa}.amber{fill:#ffb900}.red{fill:#ff6467}}</style><mask id="m" maskUnits="userSpaceOnUse"><path d="${t}" fill="#fff"/><path d="${n[0]}"/><path d="${n[1]}"/>${r}</mask><path class="ink" d="${t}" mask="url(#m)"/>${i}</svg>`}(r))}`},[r]),null}let lH={name:"arrow-down-to-line",size:24,node:[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]};lH.node;let lK=(0,l.default)(lH);var lY=e.i(96892),lV=e.i(64801),lW=e.i(59377),lG=e.i(184762),lX=e.i(146538);let lJ=(0,ok.createServerReference)("7f7ad6d5298124c5a742f3261c2cab7cf966ae3854",ok.callServer,void 0,ok.findSourceMapURL,"startThreadAction");var lQ=e.i(553429),lZ=e.i(709190);let l0={name:lQ.ROOM_THURSDAY,description:"A call in writing — she answers here"},l1="thursday.write.to",l2=e=>/^@(\S*)$/.exec(e.split(/\s/,1)[0]);function l5({written:e,onCall:t=!1}){let{data:n}=(0,sb.useServerRoute)(w.queryKey.bot),r=(0,_.useMemo)(()=>[...e?[l0]:[],...n?.length?n.filter(e=>!e.disabled).map(({name:e,icon:t,description:n})=>({name:e,icon:t,description:n})):[sp.DEFAULT_BOT]],[n,e]),[i,a]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),[c,d]=(0,_.useState)(!1),[h,p]=(0,_.useState)(null),[f,m]=(0,_.useState)(""),g=(0,_.useRef)(t);g.current=t;let x=(0,lZ.useGivenFiles)({onKept:e=>{if(g.current)return s_.screenActs.announce({kind:"gave",paths:e}),"she knows it is here"}}),y=(0,_.useRef)(null),v=(0,_.useRef)(null),b=(0,s_.useRoomOpen)();(0,_.useEffect)(()=>{try{p(window.localStorage.getItem(l1))}catch{}},[]);let j=!!e?.on,[S,N]=(0,_.useState)(null);(0,_.useEffect)(()=>{j||N(null)},[j]);let C=j?r.find(e=>e.name===S)??l0:r.find(e=>e.name===h)??r[0],E=C===l0,M=lp(),O=(0,_.useCallback)(()=>{M||(a(!0),requestAnimationFrame(()=>y.current?.focus()))},[M]),{take:A}=x,R=(0,_.useCallback)(e=>{O(),A(e)},[A,O]);(0,_.useEffect)(()=>s_.writeLine.subscribe(O),[O]),(0,_.useEffect)(()=>{let e=e=>{"/"!==e.key||e.metaKey||e.ctrlKey||e.altKey||e.defaultPrevented||(0,oD.capturesKeys)(e.target)||e.target?.closest?.('[role="dialog"]')||(e.preventDefault(),O())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[O]),(0,_.useEffect)(()=>{if(M)return;let e=e=>!!e.dataTransfer?.types.includes("Files"),t=t=>{e(t)&&(t.preventDefault(),d(!0))},n=e=>{null===e.relatedTarget&&d(!1)},r=t=>{if(!e(t))return;t.preventDefault(),d(!1);let n=[...t.dataTransfer?.files??[]];lZ.roomDrop.offer(t.target,n)||R(n)};return window.addEventListener("dragover",t),window.addEventListener("dragleave",n),window.addEventListener("drop",r),()=>{window.removeEventListener("dragover",t),window.removeEventListener("dragleave",n),window.removeEventListener("drop",r)}},[R,M]);let[L,I]=(0,oT.useServerAction)(lJ,{onOk:({id:e})=>{(0,sb.revalidate)(w.queryKey.threads),m(""),x.clear(),a(!1),N(null),s_.roomOpens.open(e)}}),P=e=>{if(u(!1),m(e=>l2(e)?e.replace(/^@\S*\s?/,""):e),y.current?.focus(),j)return N(e.name===l0.name?null:e.name);p(e.name);try{window.localStorage.setItem(l1,e.name)}catch{}},D=l2(f),z=D?r.filter(e=>e.name.toLowerCase().startsWith(D[1].toLowerCase())):r,[F,B]=(0,_.useState)(!1),$=I||F||!!(E&&e?.busy),q=!!f.trim()&&!D&&!x.arriving&&!$&&!(E&&!e?.runsOn),U=()=>{if(!q)return;let t=x.withPaths(f);E?e&&(B(!0),e.say(t).then(()=>{m(""),x.clear()}).catch(()=>{}).finally(()=>B(!1))):L(C.name,t)},H=()=>{if(j&&!E)return N(null);j&&e?.end(),a(!1)},K=(0,_.useRef)(H);K.current=H;let Y=i||c||j;(0,_.useEffect)(()=>{if(!Y)return;let e=e=>{"Escape"!==e.key||e.defaultPrevented||e.target?.closest?.('[role="dialog"]')||(e.preventDefault(),K.current())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Y]);let V=I||F;return((0,_.useEffect)(()=>{Y&&!V&&y.current?.focus()},[Y,V]),(0,_.useEffect)(()=>(s_.writeLine.shown(Y),()=>s_.writeLine.shown(!1)),[Y]),Y)?(0,s.jsxs)(s.Fragment,{children:[c&&(0,s.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-0 z-20 bg-background/60",children:(0,s.jsx)("div",{className:"absolute inset-3 rounded-3xl border-[1.5px] border-dashed border-brand/55"})}),(0,s.jsx)("div",{className:(0,T.cn)("pointer-events-none fixed inset-x-0 bottom-7 z-30 flex justify-center px-5 transition-[padding] duration-500 ease-out max-[1180px]:bottom-18",b&&"min-[1180px]:pr-[41.25rem]"),children:(0,s.jsxs)("div",{className:"pointer-events-auto flex w-160 max-w-full animate-in flex-col gap-2 fade-in slide-in-from-bottom-2 duration-200",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-[26px] bg-background p-2 shadow-[0_22px_44px_-20px_rgb(0_0_0/0.22)] ring-1 ring-border",children:[(x.files.length>0||c)&&(0,s.jsx)(lZ.GivenFiles,{files:x.files,onRemove:x.remove,className:"px-0.5 pt-0.5",children:c&&(0,s.jsxs)("span",{className:"flex h-13 items-center gap-2 rounded-[14px] border-[1.5px] border-dashed border-brand px-4 text-[13px] text-brand",children:[(0,s.jsx)(lK,{className:"size-4"}),"Let go — it waits here"]})}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),U()},className:"flex items-end gap-2",children:[(0,s.jsxs)(lW.Popover,{open:l||!!D,onOpenChange:u,children:[(0,s.jsxs)(lW.PopoverTrigger,{render:(0,s.jsx)("button",{type:"button","aria-label":`To ${C.name}. Choose someone else`,className:"flex h-9 shrink-0 items-center gap-1.5 rounded-full bg-muted pr-2.5 pl-1.5 text-[13px] font-medium outline-none transition-colors hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50"}),children:[(0,s.jsx)(l6,{bot:C,size:22}),C.name,(0,s.jsx)(o.ChevronDown,{className:"size-3 text-muted-foreground"})]}),(0,s.jsxs)(lW.PopoverContent,{side:"top",align:"start",sideOffset:14,initialFocus:!D&&void 0,className:"w-90 gap-0 rounded-[18px] p-1.5",children:[(0,s.jsx)("p",{className:"px-2.5 pt-1.5 pb-1 font-mono text-[10px] text-muted-foreground",children:"to"}),z.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>P(e),className:(0,T.cn)("flex h-11.5 w-full items-center gap-2.5 rounded-xl px-2.5 text-left outline-none hover:bg-muted focus-visible:bg-muted",e.name===C.name&&!D&&"bg-muted"),children:[(0,s.jsx)(l6,{bot:e,size:24}),(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,s.jsx)("span",{className:"text-[13.5px] leading-4.5 font-medium",children:e.name}),(0,s.jsx)("span",{className:"truncate text-xs leading-4 text-muted-foreground",children:e.description})]})]},e.name)),0===z.length&&(0,s.jsx)("p",{className:"px-2.5 py-2 text-[13px] text-muted-foreground",children:"Nobody by that name."})]})]}),(0,s.jsx)(lG.Textarea,{ref:y,value:f,rows:1,disabled:I||F,onChange:e=>m(e.target.value),onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),R(t))},onKeyDown:e=>{if("Escape"===e.key)return e.preventDefault(),H();if("Enter"===e.key&&!e.shiftKey&&!e.nativeEvent.isComposing&&229!==e.keyCode){if(e.preventDefault(),D){z[0]&&P(z[0]);return}U()}},placeholder:x.files.length?"Say what to do with them":j&&E?"Write back":E?"Write to her instead of calling":`Say the whole job — ${C.name} cannot hear the call`,"aria-label":`Message for ${C.name}`,className:"max-h-36 min-h-9 flex-1 resize-none border-0 bg-transparent px-0 py-1.5 text-[15px] leading-6 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,s.jsx)("input",{ref:v,type:"file",multiple:!0,hidden:!0,onChange:e=>{R([...e.target.files??[]]),e.target.value=""}}),(0,s.jsx)("button",{type:"button","aria-label":"Add files",onClick:()=>v.current?.click(),className:"grid size-9 shrink-0 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,s.jsx)(lV.Paperclip,{className:"size-4"})}),(0,s.jsx)("button",{type:"submit","aria-label":"Send",disabled:!q,className:(0,T.cn)("grid size-9 shrink-0 place-items-center rounded-full outline-none transition-colors focus-visible:ring-3 focus-visible:ring-brand/30",q?"bg-brand text-brand-foreground hover:bg-brand/85":"bg-muted text-muted-foreground/40"),children:$?(0,s.jsx)("span",{className:"size-3.5 animate-spin rounded-full border-2 border-current/30 border-t-current"}):(0,s.jsx)(lY.ArrowUp,{className:"size-4"})})]})]}),E&&e?.error&&(0,s.jsx)("p",{className:"px-4 text-center text-xs leading-5 text-destructive",children:e.error}),E&&e?.error&&e.fallback&&(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsxs)(k.Button,{type:"button",size:"sm",variant:"brand",disabled:e.busy,onClick:()=>{ov.useThursdayStore.getState().patch({textModel:e.fallback}),e.again()},children:[(0,s.jsx)(sQ.RotateCw,{}),"Send it again on your OpenAI key"]})}),(0,s.jsxs)("p",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1 font-mono text-[10.5px] text-muted-foreground/70",children:[E?(0,s.jsx)(l3,{runsOn:e?.runsOn??null}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l7,{children:"Enter"})," send",(0,s.jsx)(l4,{}),(0,s.jsx)(l7,{children:"@"})," pick a bot"]}),(0,s.jsx)(l4,{}),(0,s.jsx)(l7,{children:"Esc"})," ",j?E?"to end":"back to her":"close"]})]})})]}):null}function l3({runsOn:e}){let t=sh.TEXT_MODEL_PROVIDERS.chatgpt.label,n=(0,s.jsx)(lX.ModelPicker,{compact:!0,provider:e?.provider??null,model:e?.model??"",unset:"pick a model",onChange:e=>ov.useThursdayStore.getState().patch({textModel:e})});return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"text"}),(0,s.jsx)(l4,{}),(0,s.jsx)("span",{children:"runs on"}),n]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{children:["Writing to her needs a ",t,", an OpenAI key, or"]}),n,(0,s.jsx)(l4,{}),(0,s.jsx)("button",{type:"button",onClick:()=>(0,a1.openSettings)("keys"),className:"rounded-sm text-foreground/80 underline underline-offset-3 outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:"API keys"})]})}let l4=()=>(0,s.jsx)("span",{className:"text-muted-foreground/40",children:"·"});function l6({bot:e,size:t}){return e===l0?(0,s.jsx)(s0.ThursdayMark,{size:t,className:"shrink-0"}):(0,s.jsx)(sf.BotMark,{size:t,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}function l7({children:e}){return(0,s.jsx)("kbd",{className:"rounded-md border border-border bg-background px-1.5 py-0.5 font-mono text-[10px] text-foreground/80 shadow-[0_1px_0_var(--border)]",children:e})}function l8({status:e,failed:t=!1,messages:n,tool:r,thinkingSince:i=null,thinkingTitle:a=null,ended:o=null,faceWord:l=null,onTap:u,ringing:c=null,onDecline:d,wakePhrase:h=null,hotkeyLabel:p=null,idleLeft:f=null,since:m=null,getSpectrum:g,getMicSpectrum:x,captionView:y="sides",face:v=oy.FACE_DEFAULT,callable:b=!0,written:w=null}){let[k,j]=(0,_.useState)(!1),S=!b&&"idle"===e,N="connecting"===e||"ending"===e,C=!!w?.on,E="idle"!==e&&!N&&!C,M=n.findLast(e=>"assistant"===e.role)?.text??"",O="sides"===y&&"idle"!==e,A=(0,_.useMemo)(()=>lD(n),[n]),R=lF(A,O),L=A.at(-1)?.role,I=function(e,t){let[n,r]=(0,_.useState)(e),i=(0,_.useRef)(e?[e]:[]),s=(0,_.useRef)(Date.now()),a=(0,_.useRef)(!1),o=(0,_.useRef)(null),l=(0,_.useCallback)(()=>{o.current&&clearTimeout(o.current),o.current=null,(i.current.length>1||a.current)&&i.current.length&&(o.current=setTimeout(()=>{i.current.shift(),s.current=Date.now(),r(i.current[0]??null),l()},Math.max(0,s.current+sc.CALL_LINE.dwellMs-Date.now())))},[]);return(0,_.useEffect)(()=>{if(!e){a.current=!0,i.current.length<=1&&(i.current=[],r(null)),l();return}a.current=!1;let t=i.current.findIndex(t=>t.id===e.id);t>=0?(i.current[t]=e,0===t&&r(e)):(i.current=[...i.current.map((e,t)=>0===t?e:{...e,done:!0}),e],1===i.current.length&&(s.current=Date.now(),r(e))),l()},[e,l]),(0,_.useEffect)(()=>{if(!t)return;let e=i.current.at(-1);i.current=e&&!a.current?[e]:[],s.current=Date.now(),r(i.current[0]??null),l()},[t,l]),(0,_.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]),n}(r,"speaking"===e),P=function(e,t){let n=null!==e||t,[r,i]=(0,_.useState)([]),[s,a]=(0,_.useState)(n);return(0,_.useEffect)(()=>{i(t=>{let n=t.some(e=>!e.done)?t.map(e=>e.done?e:{...e,done:!0}):t;if(!e)return n;let r=t.findIndex(t=>uh(t)===uh(e));return r>=0?t.map((t,n)=>n===r?e:t):[...n,e].slice(-4)})},[e]),(0,_.useEffect)(()=>{if(n)return void a(!0);let e=setTimeout(()=>{a(!1),i([])},300);return()=>clearTimeout(e)},[n]),{lines:r,on:n,held:s}}(I,null!==i),[D,z]=(0,_.useState)(!1);(0,_.useEffect)(()=>{"user"!==L?z(!1):P.on&&z(!0)},[L,P.on]);let F="assistant"===L&&"speaking"===e||"user"===L&&"listening"===e,B=null!==c&&null===c.missedAt,$=function(e){let[t,n]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(!e)return void n(null);let t=()=>n({...uf,at:Date.now()});t();let r=setInterval(t,2600);return()=>clearInterval(r)},[e]),t}(B);return(0,s.jsxs)("div",{className:"relative flex h-full flex-col",children:[(0,s.jsxs)("div",{className:"absolute top-5 right-5 z-10 flex flex-col items-end gap-3",children:[(0,s.jsx)(ut,{}),(0,s.jsx)(aT,{hidden:"idle"!==e||null!==c||C})]}),(0,s.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-5 pt-[7vh]",children:[(0,s.jsxs)("div",{className:"relative w-[min(28rem,72vw,52vh)]",children:[(0,s.jsx)("button",{type:"button",disabled:N,onClick:S?()=>j(!0):C&&!b?void 0:u,"aria-label":S?"Add a speech key":E?"End the call":B?"Answer Thursday":"Call Thursday",className:(0,T.cn)("block w-full rounded-full outline-none transition-all duration-700 ease-out focus-visible:ring-3 focus-visible:ring-ring/50 enabled:active:scale-[0.99] disabled:opacity-70",S&&"opacity-35"),children:(0,s.jsx)("span",{className:"block",children:(0,s.jsx)(lP.Face,{look:v,status:e,failed:t,word:$??l,getSpectrum:g,className:"w-full"})})}),O&&(0,s.jsx)(lB,{turns:A,pinned:R.pinned,live:F,onPick:R.pick,under:P.held?(0,s.jsx)(up,{lines:P.lines,shown:P.on,thinkingSince:i,thinkingTitle:a}):null,ahead:D&&P.held})]}),(0,s.jsxs)("div",{className:"relative flex w-full max-w-3xl flex-col items-center gap-2 px-6 text-center",children:[c&&(0,s.jsx)(ug,{ringing:c,onAnswer:u,onDecline:()=>d?.()}),(0,s.jsxs)("div",{className:(0,T.cn)("contents",c&&"*:invisible"),children:[(0,s.jsx)(uc,{tool:O?null:I,thinkingSince:O?null:i,thinkingTitle:a,listening:"listening"===e&&null===i&&!C,getMicSpectrum:x}),(0,s.jsx)(un,{text:O||"idle"===e?"":M,fadeIn:!0,className:"w-full max-w-160 text-center text-base"}),(0,s.jsx)("div",{className:(0,T.cn)("flex flex-col items-center","idle"===e&&"order-first"),children:S?(0,s.jsx)(u_,{open:k,onOpen:()=>j(!0),onClose:()=>j(!1)}):C?(0,s.jsx)("span",{className:"h-6"}):(0,s.jsx)(ub,{status:e,idleLeft:f,since:m,ended:o,behind:O&&R.back,wakePhrase:h,hotkeyLabel:p})})]})]})]}),(0,s.jsx)(lR,{}),(0,s.jsx)(aa,{}),(0,s.jsx)(l5,{written:w,onCall:E})]})}let l9=["thursday","memory","bot"];function ue({alert:e}){return e?(0,s.jsx)("span",{"aria-hidden":!0,className:(0,T.cn)("absolute top-0.5 right-0.5 size-1.5 rounded-full ring-2 ring-background","red"===e?"bg-destructive":"bg-amber-600 dark:bg-amber-400")}):null}function ut(){let e=om(),t=of(oc.filter(e=>!l9.includes(e.id)).map(t=>e[t.id]??null));return(0,s.jsxs)(sa,{children:[(0,s.jsxs)(N,{className:"bg-background/75 backdrop-blur-md",children:[(0,s.jsx)(N,{children:l9.map(t=>{let n=oc.find(e=>e.id===t);return n?(0,s.jsxs)(so,{children:[(0,s.jsxs)(sl,{render:(0,s.jsx)(k.Button,{size:"icon",variant:"outline","aria-label":n.label,onClick:()=>(0,a1.openSettings)(t)}),children:[(0,s.jsx)(n.icon,{className:"text-muted-foreground"}),(0,s.jsx)(ue,{alert:e[t]??null})]}),(0,s.jsx)(su,{side:"bottom",children:n.label})]},t):null})}),(0,s.jsx)(N,{children:(0,s.jsxs)(k.Button,{variant:"outline",onClick:()=>(0,a1.openSettings)(),className:"gap-1.5 px-2.5 text-[12.5px] font-normal",children:[(0,s.jsx)(b,{className:"text-muted-foreground"}),"Settings",(0,s.jsx)(ue,{alert:t})]})})]}),(0,s.jsx)(op,{})]})}function un({text:e,lines:t=3,fadeIn:n=!1,className:r}){let i=(0,_.useRef)(null),[a,l]=(0,_.useState)(t),[u,d]=(0,_.useState)(0);(0,_.useEffect)(()=>d(0),[e]),(0,_.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);t&&l(Math.max(1,Math.round(e.scrollHeight/t)))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]);let h=Math.ceil(Math.max(0,a-t)/t),p=Math.max(0,a-t-Math.min(u,h)*t),f=`calc(${t} * 1.625em)`,m=(0,s.jsx)("p",{ref:i,style:{lineHeight:1.625,transform:`translateY(-${1.625*p}em)`},className:"break-keep transition-transform duration-200",children:n?(0,s.jsx)(E,{text:e}):e});return(0,s.jsxs)("div",{className:"relative flex w-full justify-center",children:[(0,s.jsx)("div",{style:{height:f},onClick:h>0?()=>d(e=>e>=h?0:e+1):void 0,className:(0,T.cn)("overflow-hidden",h>0&&"cursor-pointer",r),children:m}),h>0&&(0,s.jsxs)("div",{className:"absolute top-1/2 right-0 flex -translate-y-1/2 flex-col items-center gap-0.5",children:[(0,s.jsx)(ur,{look:c,label:"Earlier lines",shown:u<h,onPick:()=>d(e=>Math.min(h,e+1))}),(0,s.jsx)(ur,{look:o.ChevronDown,label:"Later lines",shown:u>0,onPick:()=>d(e=>Math.max(0,e-1))})]})]})}function ur({look:e,label:t,shown:n,onPick:r}){return(0,s.jsx)("button",{type:"button","aria-label":t,"aria-hidden":!n,tabIndex:n?void 0:-1,onClick:e=>{e.stopPropagation(),r()},className:(0,T.cn)("grid size-7 place-items-center rounded-full text-muted-foreground/60 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",!n&&"invisible"),children:(0,s.jsx)(e,{className:"size-3.5"})})}let ui=[{id:"a",from:0,to:1,gain:.8},{id:"b",from:1,to:3,gain:1},{id:"c",from:3,to:5,gain:1.15},{id:"d",from:5,to:6,gain:1.35},{id:"e",from:6,to:8,gain:1.55}];function us({live:e,getMicSpectrum:t}){let n=(0,_.useRef)({}),r=(0,_.useRef)(ui.map(()=>0));return(0,_.useEffect)(()=>{if(!e||!t)return;let i=requestAnimationFrame(function e(){let s=t();ui.forEach((e,t)=>{let i=0;for(let t=e.from;t<e.to;t++)i=Math.max(i,s[t]??0);let a=Math.min(1,(i*e.gain)**.8),o=r.current[t],l=o+(a-o)*(a>o?.6:.16);r.current[t]=l;let u=n.current[e.id];u&&(u.style.height=`${2+12*l}px`)}),i=requestAnimationFrame(e)});return()=>cancelAnimationFrame(i)},[e,t]),(0,s.jsx)("span",{"aria-hidden":!0,className:"flex h-3.5 w-[18px] shrink-0 items-center gap-0.5",children:ui.map(e=>(0,s.jsx)("span",{ref:t=>{n.current[e.id]=t},style:{height:2},className:"w-0.5 rounded-full bg-muted-foreground/70"},e.id))})}function ua({live:e,getMicSpectrum:t}){return(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-[13px] leading-5 text-muted-foreground",children:[(0,s.jsx)(us,{live:e,getMicSpectrum:t}),"Listening"]})}function uo({tool:e}){let t="relay"===e.kind?h:(0,ao.toolIcon)(e.name),n=e.line??e.name,r=e.line?"min-w-0 truncate text-[13px] leading-5 break-keep":"min-w-0 truncate font-mono text-xs leading-5",i=(0,sb.useServerRoute)(w.queryKey.bot).data,a=e.bot?i?.find(t=>t.name===e.bot)??null:null;return(0,s.jsxs)("span",{className:"flex max-w-full items-center gap-1.5",children:[(0,s.jsxs)("span",{className:"relative grid size-[18px] shrink-0 place-items-center",children:[(0,s.jsx)(ul,{tool:e,bot:a,icon:t}),!e.done&&(0,s.jsx)("span",{className:"absolute inset-0 grid animate-ink place-items-center",children:(0,s.jsx)(ul,{tool:e,bot:a,icon:t,running:!0})})]}),e.done&&e.sources?.length?(0,s.jsx)(A.SourceChips,{sources:e.sources,limit:2,className:"flex-nowrap"}):e.done?(0,s.jsx)("span",{className:(0,T.cn)(r,"text-muted-foreground"),children:n}):(0,s.jsx)(O.ShinyText,{text:n,motion:"pulse",className:r})]})}function ul({tool:e,bot:t,icon:n,running:r}){return e.bot?(0,s.jsx)("span",{className:(0,T.cn)("flex",!r&&!e.done&&"opacity-40"),children:(0,s.jsx)(sf.BotMark,{size:16,seed:e.bot,color:t?.icon?.color,shape:t?.icon?.shape,outline:t?.icon?.outline,paint:t?.icon?.paint,notify:!1})}):(0,s.jsx)(n,{className:(0,T.cn)("size-3.5",r?"text-foreground":"text-muted-foreground",!r&&!e.done&&"opacity-40")})}function uu(e,t){let[n,r]=(0,_.useState)(null!==e),[i,s]=(0,_.useState)(t);return(0,_.useEffect)(()=>{null!==e&&(r(!0),s(t))},[e,t]),{thought:n,title:i}}function uc({tool:e,thinkingSince:t,thinkingTitle:n,listening:r,getMicSpectrum:i}){let[a,o]=(0,_.useState)(e);(0,_.useEffect)(()=>{e&&o(e)},[e]);let{thought:l,title:u}=uu(t,n),c=r&&!e;return(0,s.jsxs)("div",{className:"grid h-7 max-w-full items-center justify-items-center",children:[a&&(0,s.jsx)(uy,{at:"col-start-1 row-start-1 max-w-full",shown:null!==e,children:(0,s.jsx)(uo,{tool:a})}),l&&(0,s.jsx)(uy,{at:"col-start-1 row-start-1",shown:null!==t&&!e,children:(0,s.jsx)(uw,{title:u})}),(0,s.jsx)(uy,{at:"col-start-1 row-start-1",shown:c,children:(0,s.jsx)(ua,{live:c,getMicSpectrum:i})})]})}let ud=[1,.7,.45],uh=e=>e.id??`${e.kind??"tool"}:${e.name}`;function up({lines:e,shown:t,thinkingSince:n,thinkingTitle:r}){let{thought:i,title:a}=uu(n,r),o=Math.max(0,e.length-3),l=e.length-o,u=e.at(-1);return(0,s.jsxs)("div",{"aria-hidden":!t,className:(0,T.cn)("pointer-events-auto relative w-[min(100%,16.5rem)] transition-opacity duration-300 ease-out",!t&&"pointer-events-none opacity-0"),style:{height:(l+1)*26},children:[e.map((t,n)=>{let r=n-o;return(0,s.jsx)("div",{style:{transform:`translateY(${26*r}px)`,opacity:r<0?0:ud[e.length-1-n],height:26},className:"absolute inset-x-0 top-0 flex items-center transition-[transform,opacity] duration-300 ease-out motion-reduce:transition-none",children:(0,s.jsx)("div",{className:"flex min-w-0 animate-in duration-300 fade-in slide-in-from-bottom-1 motion-reduce:animate-none",children:(0,s.jsx)(uo,{tool:t})})},uh(t))}),i&&(0,s.jsx)("div",{style:{transform:`translateY(${26*l}px)`,height:26},className:"absolute inset-x-0 top-0 flex items-center transition-transform duration-300 ease-out motion-reduce:transition-none",children:(0,s.jsx)(uy,{at:(0,T.cn)("min-w-0",l>0&&"pl-6"),shown:null!==n&&(!u||u.done),children:(0,s.jsx)(uw,{title:a})})})]})}let uf={text:"CALL",hold:1.5},um="rounded-md border border-border bg-background px-1.5 py-0.5 font-mono text-[10px] text-foreground/80 shadow-[0_1px_0_var(--border)]";function ug({ringing:e,onAnswer:t,onDecline:n}){let r=(0,sb.useServerRoute)(w.queryKey.bot).data,i=(e,t)=>{let n=r?.find(t=>t.name===e.bot)?.icon;return(0,s.jsx)(sf.BotMark,{size:t,seed:e.bot,color:n?.color,shape:n?.shape,outline:n?.outline,paint:n?.paint,notify:!1,className:"shrink-0"})},{first:o,others:l,missedAt:u}=e;if(null!==u){let e=[o,...l];return(0,s.jsxs)("div",{className:"absolute inset-x-0 -top-20 z-10 flex animate-in flex-col items-center px-6 fade-in duration-300",children:[(0,s.jsxs)("div",{className:"flex w-full max-w-140 flex-col text-left",children:[(0,s.jsxs)("p",{className:"mb-1.5 flex items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,s.jsx)(y,{className:"size-3"}),(0,s.jsxs)("span",{children:["Missed ·"," ",(0,a.formatDistanceToNowStrict)(u,{addSuffix:!0})]}),(0,s.jsxs)("button",{type:"button",onClick:n,className:"ml-auto flex items-center gap-1.5 rounded-md outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,s.jsx)("kbd",{className:um,children:"Esc"}),"clear"]})]}),e.slice(0,3).map(e=>(0,s.jsxs)("div",{className:"flex h-8.5 items-center gap-2.5",children:[i(e,20),(0,s.jsx)("span",{className:"w-32 shrink-0 truncate text-[13.5px]",children:e.label}),(0,s.jsx)("span",{className:"w-14 shrink-0 font-mono text-[10.5px] text-muted-foreground",children:ux[e.kind]}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] text-muted-foreground",children:(0,T.plainText)(e.text)})]},e.id)),e.length>3&&(0,s.jsxs)("p",{className:"mt-1 font-mono text-[10.5px] text-muted-foreground/70",children:["+",e.length-3," more in the room"]})]}),(0,s.jsx)(k.Button,{variant:"brand",onClick:t,className:"mt-5 h-12 px-8 text-[15px]",children:"Call back"})]})}return(0,s.jsxs)("div",{className:"absolute inset-x-0 -top-20 z-10 flex animate-in flex-col items-center gap-3 px-6 fade-in duration-300",children:[(0,s.jsxs)("span",{className:"flex max-w-full items-center gap-2 text-sm",children:[i(o,18),(0,s.jsx)("span",{children:o.bot}),(0,s.jsx)("span",{className:"text-muted-foreground/40",children:"·"}),(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:o.label})]}),(0,s.jsx)("p",{className:"line-clamp-3 max-w-150 text-base/relaxed text-pretty break-keep [@media(min-height:860px)]:line-clamp-5",children:(0,T.plainText)(o.text)}),o.options.length>0&&(0,s.jsx)("span",{className:"flex max-w-full flex-wrap justify-center gap-1.5",children:o.options.map(e=>(0,s.jsx)("span",{className:"flex h-7 max-w-60 items-center truncate rounded-full px-3 text-[12.5px] text-muted-foreground ring-1 ring-border",children:e},e))}),(0,s.jsx)(k.Button,{variant:"brand",onClick:t,className:"mt-3 h-12 px-8 text-[15px]",children:"Answer"}),l.length>0&&(0,s.jsxs)("span",{className:"flex max-w-full flex-wrap items-center justify-center gap-x-4.5 gap-y-1 text-[13px] text-muted-foreground",children:[l.slice(0,2).map(e=>(0,s.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[i(e,16),(0,s.jsx)("span",{className:"max-w-44 truncate text-foreground",children:e.label}),ux[e.kind]]},e.id)),l.length>2&&(0,s.jsxs)("span",{children:["+",l.length-2]})]}),(0,s.jsxs)("button",{type:"button",onClick:n,className:"mt-1 flex items-center gap-2 rounded-md font-mono text-[11px] text-muted-foreground/70 outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,s.jsx)("kbd",{className:um,children:"Esc"}),"not now"]})]})}let ux={question:"asks",done:"finished",stopped:"stopped"};function uy({at:e,shown:t,children:n}){return(0,s.jsx)("span",{"aria-hidden":!t,className:(0,T.cn)("flex transition-opacity duration-300 ease-out",e,t?"opacity-100":"pointer-events-none opacity-0"),children:n})}let uv={quiet:`${sc.CALL_IDLE.hangUpMs/1e3}s of quiet`,hungUp:"Thursday hung up",closed:"Live closed the call",dropped:"the connection dropped"};function ub({status:e,idleLeft:t,since:n,ended:r,behind:i,wakePhrase:a,hotkeyLabel:o}){let l,u,c="connecting"===e||"ending"===e,d="idle"!==e&&!c;return c?(u=e,l=(0,s.jsx)(O.ShinyText,{text:"connecting"===e?"Connecting…":"Ending…",motion:"pulse",className:"text-muted-foreground/70"})):d&&null!==t?(u="quiet",l=`Quiet — ending in ${t}s. Say anything to stay.`):d?(u=i?"behind":"live",l=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"Tap Thursday to end"}),(0,s.jsx)("span",{className:"text-muted-foreground/40",children:"·"}),i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("kbd",{className:"rounded-md border border-border bg-background px-1.5 py-0.5 font-mono text-[10px] text-foreground/80 shadow-[0_1px_0_var(--border)]",children:"↓"}),(0,s.jsx)("span",{children:"back to now"})]}):(0,s.jsx)(uk,{since:n})]})):r?(u=`ended:${r}`,l=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{children:["Ended — ",uv[r]]}),(0,s.jsx)("span",{className:"text-muted-foreground/40",children:"·"}),(0,s.jsx)("span",{children:"Tap to call again"})]})):a?(u=`wake:${a}`,l=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"Tap Thursday, or say"}),(0,s.jsxs)("span",{className:"flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-foreground/80",children:[(0,s.jsx)(f,{className:"size-3"}),a]})]})):o?(u=`key:${o}`,l=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"Tap Thursday, or press"}),(0,s.jsx)("kbd",{className:"rounded-md border border-border bg-background px-1.5 py-0.5 font-mono text-[10px] text-foreground/80 shadow-[0_1px_0_var(--border)]",children:o})]})):(u="tap",l=(0,s.jsx)(ir,{as:"span",text:"Tap Thursday to talk",loop:!1,typingSpeed:95,initialDelay:400,cursorCharacter:"▌",cursorClassName:"ml-0.5 text-muted-foreground/50",className:"tracking-normal"})),(0,s.jsx)("span",{className:"flex h-6 animate-in items-center gap-1.5 font-mono text-[11px] text-muted-foreground/70 fade-in duration-700",children:l},u)}function u_({open:e,onOpen:t,onClose:n}){return e?(0,s.jsx)("div",{className:"w-[min(26rem,84vw)] animate-in rounded-2xl bg-background/80 p-3 ring-1 ring-border/60 backdrop-blur-md fade-in duration-300",children:(0,s.jsx)(ap.VoiceKeys,{dense:!0,autoFocus:!0,onCancel:n,onSaved:()=>ah()})}):(0,s.jsxs)("span",{className:"flex animate-in items-center gap-2 rounded-full bg-muted/60 py-1 pr-1 pl-1.5 ring-1 ring-border/60 fade-in duration-500",children:[(0,s.jsxs)("span",{className:"relative flex size-6 shrink-0 items-center justify-center",children:[(0,s.jsx)(sf.BotMark,{size:24,seed:sp.DEFAULT_BOT.name,color:sp.DEFAULT_BOT.icon?.color,shape:sp.DEFAULT_BOT.icon?.shape,outline:sp.DEFAULT_BOT.icon?.outline,notify:!1}),(0,s.jsx)(g,{className:"absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full bg-muted text-muted-foreground"})]}),(0,s.jsx)("span",{className:"text-[13px] text-muted-foreground break-keep",children:"Calls need one speech key. Everything else here already works."}),(0,s.jsx)(k.Button,{size:"sm",onClick:t,className:"h-7 rounded-full px-3.5",children:"Add key"})]})}function uw({title:e}){var t;let n=e?`Thinking about ${t=e,/^\p{Lu}\p{Lu}/u.test(t)?t:t.charAt(0).toLowerCase()+t.slice(1)}`:"Thinking…";return(0,s.jsx)("span",{className:"flex max-w-full items-center text-[13px] leading-5",children:(0,s.jsx)(O.ShinyText,{text:n,className:"min-w-0 animate-in truncate fade-in duration-300"},n)})}function uk({since:e}){let[t,n]=(0,_.useState)(()=>Date.now());if((0,_.useEffect)(()=>{if(null===e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),null===e)return null;let r=Math.max(0,Math.floor((t-e)/1e3)),i=String(Math.floor(r/60)).padStart(2,"0"),a=String(r%60).padStart(2,"0");return(0,s.jsxs)("span",{className:"tabular-nums",children:[i,":",a]})}e.s(["Ear",0,ua,"Thursday",0,function({ready:e}){let t=function(){let[e,t]=(0,_.useState)(null),n=(0,_.useRef)(e);n.current=e;let[r]=(0,oT.useServerAction)(oO),{messages:i,sendMessage:s,regenerate:a,setMessages:o,status:l,stop:u,error:c,clearError:d}=(0,ob.useChat)({transport:oL}),h="submitted"===l||"streaming"===l,p=(0,_.useCallback)(()=>{let e=n.current;e&&(n.current=null,t(null),u(),o([]),d(),oM(e.callId).then(au.unwrapResult).finally(()=>(0,sb.revalidate)(w.queryKey.callHistory(null))))},[u,o,d]),f=(0,_.useRef)(p);f.current=p,(0,_.useEffect)(()=>()=>f.current(),[]);let m=(0,_.useCallback)(async e=>{let i=(0,ov.thursdaySettings)(),a=n.current;a||(n.current=a={...await r(i,oI()),at:Date.now()},t(a)),d(),s({text:e},{body:{callId:a.callId,settings:i,standing:a.standing,runsOn:oI()}})},[r,s,d]),g=(0,_.useCallback)(()=>{let e=n.current;e&&(d(),a({body:{callId:e.callId,settings:(0,ov.thursdaySettings)(),standing:e.standing,runsOn:oI()}}))},[a,d]),{data:x}=(0,sb.useServerRoute)(w.queryKey.threads),y=(0,_.useRef)(x);y.current=x;let v=(0,_.useRef)(Date.now()),b=(0,_.useRef)(null),[k,j]=(0,_.useState)(null),S=(0,_.useRef)(h);S.current=h,(0,_.useEffect)(()=>{v.current=Date.now();let e=b.current;if(h){e&&(e.began=!0);return}if(e&&!e.began)return;if(b.current=null,e&&c)for(let t of e.keys)oS.delete(t);if(e?.rows.length&&!c&&oj(e.rows).then(au.unwrapResult).catch(()=>{}),!k)return;let t=setTimeout(()=>j(null),2500);return()=>clearTimeout(t)},[h,c,k]);let N=null!==e;(0,_.useEffect)(()=>{if(!N)return;let e=setInterval(()=>{let e=n.current;if(!e||S.current||b.current||!y.current||Date.now()-v.current<sc.CALL_RELAY.quietMs)return;let t=oE(y.current).filter(e=>!oS.has(e.key)),r=t[0];if(!r)return;let i=t.filter(e=>e.kind===r.kind).slice(0,sc.CALL_RELAY.perTurn);for(let e of i)oS.add(e.key);b.current={keys:i.map(e=>e.key),rows:i.flatMap(e=>e.relayIds),began:!1},j((i.at(-1)??r).show),v.current=Date.now(),d();let a=i.map(e=>e.line);s({text:1===a.length?a[0]:`[${a.length} updates.]
|
|
14
|
-
|
|
15
|
-
${a.join("\n\n")}`,metadata:oR},{body:{callId:e.callId,settings:(0,ov.thursdaySettings)(),standing:e.standing,runsOn:oI()}})},1e3);return()=>clearInterval(e)},[N,s,d]);let C=i.at(-1)?.role==="assistant"?i.at(-1):null,E=C?.parts??[],M=E.at(-1),O=(0,_.useMemo)(()=>i.flatMap(e=>{if("system"===e.role||e.metadata?.relay===!0)return[];let t=e.parts.flatMap(e=>"text"===e.type?e.text:[]).join("\n\n").trim(),n="assistant"===e.role?(0,T.plainText)(t):t;return n?[{id:e.id,role:e.role,text:n}]:[]}),[i]),A=[...E].reverse().find(o_.isToolUIPart),R=(0,_.useMemo)(()=>{if(!A)return null;let e=(0,o_.getToolName)(A),t=A.output?.action?.query,n=JSON.stringify({..."string"==typeof t?{query:t}:{},...A.input??{}}),r="output-available"===A.state||"output-error"===A.state,i=r&&e===ow.TOOL_NAMES.web_search?(0,oA.searchSourcesOf)(JSON.stringify(A.output??null)):[];return M?.type!=="text"||i.length?{id:A.toolCallId,name:e,line:(0,oA.toolLine)(e,n),bot:(0,oA.toolBot)(e,n),done:r,...i.length?{sources:i}:{}}:null},[A,M?.type]),[L,I]=(0,_.useState)(null),P=R?.done&&!R.sources?R.id:null;(0,_.useEffect)(()=>{if(!P)return;let e=setTimeout(()=>I(P),2500);return()=>clearTimeout(e)},[P]);let D=R&&R.id!==L?R:k,z=!!h&&M?.type!=="text"&&(!R||!!R.done),[F,B]=(0,_.useState)(null);(0,_.useEffect)(()=>{B(z?Date.now():null)},[z]);let $=[...E].reverse().find(e=>"reasoning"===e.type),q=z&&$?.type==="reasoning"&&/^\s*\*\*(.+?)\*\*/.exec($.text)?.[1]?.trim()||null,U=e?h?M?.type==="text"?"speaking":R&&!R.done&&R.name===ow.TOOL_NAMES.thread_start?"delegating":"working":"listening":"idle";return{on:null!==e,busy:h,status:U,messages:O,tool:D,thinkingSince:F,thinkingTitle:q,since:e?.at??null,error:c?c.message:null,say:m,again:g,end:p}}(),{status:n,failed:r,messages:i,tool:a,thinkingSince:o,thinkingTitle:l,ended:u,faceWord:c,idleLeft:d,since:h,call:p,ringing:f,decline:m,getSpectrum:g,getMicSpectrum:x,wakePhrase:y,hotkey:v}=function(e=!1){let t,n,r=(0,_.useRef)(null),i=(0,_.useRef)(null),s=(0,_.useRef)(null),[a,o]=(0,_.useState)("idle"),[l,u]=(0,_.useState)(!1),c=(0,_.useRef)(null),d=(0,_.useCallback)(e=>{c.current&&clearTimeout(c.current),c.current=e?setTimeout(()=>u(!1),6e3):null,u(e)},[]),[h,p]=(0,_.useState)([]),[f,m]=(0,_.useState)(null),[g,x]=(0,_.useState)(null),[y,v]=(0,_.useState)(null),[b,k]=(0,_.useState)(null),[j,S]=(0,_.useState)(null),[N,C]=(0,_.useState)(null),[E,M]=(0,_.useState)(null);(0,_.useEffect)(()=>M(lx()),[]);let O=(0,_.useRef)(null),A=(0,_.useRef)(null),R=(0,_.useRef)({on:!1,spoke:!1,giveUp:null}),L=(0,_.useRef)(null),I=(0,_.useRef)(0),P=(0,_.useRef)(null),D=(0,_.useRef)(!1),z=(0,_.useRef)(null),F=(0,_.useRef)(null),B=(0,_.useRef)(oS),$=(0,_.useRef)(new Set),q=(0,_.useRef)([]),U=(0,_.useRef)([]),H=(0,_.useRef)(null),K=(0,_.useRef)(0),Y=(0,_.useRef)(null),V=(0,_.useRef)(0),W=(0,_.useRef)(!1),G=(0,_.useRef)(!1),X=(0,_.useRef)(void 0),J=(0,_.useRef)(null),Q=J.current??=(t=[],n=null,{send(e){n?n(e):t.push(e)},open(e){n=e;let r=t;for(let n of(t=[],r))e(n)},close(){n=null},clear(){let e=t;return t=[],e}}),Z=(0,_.useRef)(!1),ee=(0,_.useRef)(!1),et=(0,_.useRef)(!1),en=(0,_.useRef)(0),er=(0,_.useCallback)(e=>{P.current&&clearTimeout(P.current),D.current=!1,m({id:e.id,name:e.name,line:(0,oA.toolLine)(e.name,e.arguments),bot:(0,oA.toolBot)(e.name,e.arguments),done:!1})},[]),ei=(0,_.useRef)(sy("page")).current,es=(0,_.useCallback)(e=>{P.current&&clearTimeout(P.current),D.current=!0,m({...e,done:!1})},[]),ea=(0,_.useCallback)(e=>{m(t=>t?.id===e?{...t,done:!0}:t),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>m(e=>e?.done?null:e),2500)},[]),eo=(0,_.useCallback)(()=>{if(R.current.giveUp&&clearTimeout(R.current.giveUp),ei("read.done",{spoke:R.current.spoke,keys:q.current}),R.current.spoke){for(let e of q.current)$.current.delete(e);let e=U.current;e.length&&oj(e).then(au.unwrapResult).catch(e=>al.toast.add({type:"error",title:"Could not record relay delivery",description:(0,T.errorToString)(e)}))}U.current=[],q.current=[],R.current={on:!1,spoke:!1,giveUp:null},D.current&&(D.current=!1,m(e=>e?.kind==="relay"?{...e,done:!0}:e),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>m(e=>e?.kind==="relay"?null:e),5e3))},[]),el=(0,_.useCallback)(()=>{R.current.giveUp&&clearTimeout(R.current.giveUp),R.current={on:!0,spoke:!1,giveUp:setTimeout(eo,sc.CALL_RELAY.readMs)}},[eo]),eu=(0,_.useCallback)(e=>{O.current=e,S(e),C(null)},[]),ec=(0,_.useCallback)((e,t)=>{let n=()=>{A.current&&clearTimeout(A.current),A.current=null};if(t){n(),null!==O.current&&eu(null);return}if(e){n(),null===O.current&&eu(Date.now());return}null===O.current||A.current||(A.current=setTimeout(()=>{A.current=null,eu(null)},6e3))},[eu]),ed=(0,_.useCallback)(()=>{let e=r.current,t=X.current;if(!e||!t||R.current.on||G.current||null!==O.current||Y.current)return;let n=W.current;if(W.current=!1,!n&&Date.now()-V.current<sc.CALL_RELAY.quietMs)return;let i=oE(t).filter(e=>!B.current.has(e.key)),s=i[0];if(!s)return;let a=i.filter(e=>e.kind===s.kind).slice(0,sc.CALL_RELAY.perTurn),o=a.map(e=>e.line);for(let e of a)B.current.add(e.key),$.current.add(e.key);s.key.startsWith("done:")&&M(lv()),ei("relay.out",{kind:s.kind,keys:a.map(e=>e.key),waiting:i.length-a.length,quietMs:Date.now()-V.current,rung:n}),el(),q.current=a.map(e=>e.key),U.current=a.flatMap(e=>e.relayIds),es((a.at(-1)??s).show),e.append("commentary",1===o.length?o.join(""):`[${o.length} updates.]
|
|
16
|
-
|
|
17
|
-
${o.join("\n\n")}`).then(e=>{ei("relay.acked",{delivered:e}),e||(U.current=[],eo())})},[el,eo,es]),eh=(0,_.useRef)(a);(0,_.useEffect)(()=>{eh.current=a},[a]);let ep=(0,_.useRef)("listening"),ef=(0,_.useRef)(null),em=(0,_.useCallback)(()=>{ef.current&&clearTimeout(ef.current),ef.current=null},[]),eg=(0,_.useCallback)(e=>{eh.current=e,o(e)},[]),ex=(0,_.useCallback)(e=>{ep.current=e;let t=eh.current;if("speaking"===e){em(),eg(e);return}let n="working"===e||"delegating"===e;if(n&&("working"===t||"delegating"===t)){em(),eg(e);return}n||"listening"!==t?ef.current||(ef.current=setTimeout(()=>{ef.current=null,eg(ep.current)},n?800:600)):em()},[em,eg]),ey="idle"!==a&&"connecting"!==a&&"ending"!==a,{data:ev}=(0,sb.useServerRoute)(w.queryKey.threads,{refreshInterval:3e4});(0,sm.useAppEvent)({hello:()=>{(0,sb.revalidateAll)()},threads:()=>void(0,sb.revalidate)(w.queryKey.threads),routines:()=>void(0,sb.revalidate)(w.queryKey.routines),memory:()=>void(0,sb.revalidate)(w.queryKey.memory),mcp:()=>{(0,sb.revalidate)(w.queryKey.mcp),(0,sb.revalidate)(w.queryKey.mcpTools)},config:()=>{(0,sb.revalidate)(w.queryKey.config),(0,sb.revalidate)(w.queryKey.llmModel)}});let{data:eb}=(0,sb.useServerRoute)(w.queryKey.bot);(0,_.useEffect)(()=>{ev&&s_.botThreads.sync(ev,eb)},[ev,eb]),(0,_.useEffect)(()=>{X.current=ev},[ev]);let e_=function({threads:e,resting:t,writing:n}){let r=(0,_.useRef)(sy("page")).current,i=(0,_.useRef)(Date.now()),[s,a]=(0,_.useState)([]),[o,l]=(0,_.useState)(null),u=s.length>0,c=(0,ov.useThursdayStore)(e=>e.callBack);(0,_.useEffect)(()=>{if(!e)return;let s=new Set(e.filter(e=>{let t,n;return t=e,"off"!==(n=c)&&!t.seen&&!t.ask?.auto&&(t.room.questions.length>0||"any"===n&&"running"!==t.status)}).map(e=>e.id));if(a(e=>e.every(e=>s.has(e))?e:e.filter(e=>s.has(e))),!t||n)return;let o=i.current,u=e.filter(e=>s.has(e.id)&&(0,sx.toDate)(e.updatedAt).getTime()>o);u.length&&(r("ring",{threads:u.map(e=>e.id)}),i.current=Date.now(),l(null),a(e=>[...e,...u.map(e=>e.id).filter(t=>!e.includes(t))]))},[e,c,t,n,r]),(0,_.useEffect)(()=>{n?(a([]),l(null)):i.current=Date.now()},[n]);let d=(0,_.useCallback)(()=>{r("ring.declined"),a([]),l(null)},[]);(0,_.useEffect)(()=>{if(!u)return;let e=null===o?setTimeout(()=>l(Date.now()),sc.CALL_BACK.ringMs):null,t=e=>{"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),d())};return window.addEventListener("keydown",t),()=>{e&&clearTimeout(e),window.removeEventListener("keydown",t)}},[u,o,d]),(0,_.useEffect)(()=>{let e,t,n,r;if(!u||null!==o)return;let i=(e=null,t=null,n=(e,t)=>{let n=e.createGain();for(let r of(n.gain.setValueAtTime(0,t),n.gain.linearRampToValueAtTime(.05,t+.03),n.gain.setValueAtTime(.05,t+.34-.08),n.gain.linearRampToValueAtTime(0,t+.34),n.connect(e.destination),lk)){let i=e.createOscillator();i.type="sine",i.frequency.value=r,i.connect(n),i.start(t),i.stop(t+.34)}},r=()=>{if(!e||"running"!==e.state)return;let t=e.currentTime+.02;n(e,t),n(e,t+.34+.16)},{start(){!t&&"u">typeof AudioContext&&((e??=new AudioContext).resume().then(r).catch(()=>{}),t=setInterval(r,2600))},stop(){t&&clearInterval(t),t=null,e?.close().catch(()=>{}),e=null}});return i.start(),()=>i.stop()},[u,o]);let h=(0,_.useMemo)(()=>{let[t,...n]=s.flatMap(t=>{let n=e?.find(e=>e.id===t);if(!n)return[];let r=n.room.questions[0];return[{id:n.id,bot:r?.bot??n.bot,kind:r?"question":"done"===n.status?"done":"stopped",label:n.label,text:r?.text??n.outcome??n.ask?.question??n.label,options:r?.options??[]}]});return t?{first:t,others:n,missedAt:o}:null},[s,e,o]);return(0,_.useEffect)(()=>{s_.ringingThreads.set(s)},[s]),{ringing:h,isRinging:u,ringingFor:s,answered:(0,_.useCallback)(()=>{a([]),l(null)},[]),settle:(0,_.useCallback)(()=>{i.current=Date.now()},[]),decline:d}}({threads:ev,resting:"idle"===a,writing:e}),{answered:ew,settle:ek}=e_;(0,_.useEffect)(()=>s_.screenActs.subscribe(e=>{Z.current&&Q.send("answered"===e.kind?`The user sent a message on screen to ${e.recipient??"the coordinator"} in thread "${e.label}" (${e.id})${e.replyTo?`, replying to ${e.replyTo}`:""}: ${e.answer}. It has reached that participant.`:"stopped"===e.kind?`The user stopped thread "${e.label}" on screen. It is no longer running.`:`The user put ${1===e.paths.length?"a file":`${e.paths.length} files`} down on screen, kept on this computer at ${e.paths.join(", ")}.`)}),[Q]);let ej=(0,_.useCallback)(async(e=null)=>{if(et.current)return;et.current=!0,ei("hangup",{why:e,call:F.current,unvoiced:[...$.current],reading:R.current.on}),Y.current&&clearInterval(Y.current),Y.current=null,en.current+=1;let t=r.current,n=F.current;for(let e of(r.current=null,F.current=null,Z.current=!1,ee.current=!1,W.current=!1,$.current))B.current.delete(e);$.current.clear(),Q.close(),Q.clear(),z.current?.abort(),z.current=null,eo(),P.current&&clearTimeout(P.current),em(),ek(),v(null),x(null),o(t?"ending":"idle"),t&&M(ly()),p([]),m(null),eu(null),A.current&&clearTimeout(A.current),A.current=null,D.current=!1,await t?.close();let i=L.current;L.current=null,et.current=!1,o("idle"),t&&k(e),n&&oM(n,i),t&&s.current&&(s.current.currentTime=0,s.current.play().catch(()=>{}))},[Q,em,eo,eu]);(0,_.useEffect)(()=>()=>{en.current+=1,r.current?.close(),r.current=null;let e=F.current;F.current=null,Z.current=!1,ee.current=!1,e&&oM(e),z.current?.abort(),z.current=null,P.current&&clearTimeout(P.current),ef.current&&clearTimeout(ef.current),R.current.giveUp&&clearTimeout(R.current.giveUp),A.current&&clearTimeout(A.current),c.current&&clearTimeout(c.current),Y.current&&clearInterval(Y.current)},[]);let eT=(0,_.useCallback)(()=>{if(Y.current)return;let e=Date.now();ei("end_call",{sinceVoiceMs:e-K.current}),Y.current=setInterval(()=>{let t=Date.now();((K.current>e-sc.CALL_END.unsaidMs?t-Math.max(K.current,e)>=sc.CALL_END.quietMs:t-e>=sc.CALL_END.unsaidMs)||t-e>=sc.CALL_END.maxMs)&&ej("hungUp")},100)},[ej]);(0,_.useEffect)(()=>{if(!ey)return;I.current=Date.now();let e=setInterval(()=>{if(!r.current)return;let e=sc.CALL_IDLE.hangUpMs-(Date.now()-I.current);v(e<=sc.CALL_IDLE.warnMs?Math.max(0,Math.ceil(e/1e3)):null),e<=0&&ej("quiet")},1e3);return()=>clearInterval(e)},[ey,ej]),(0,_.useEffect)(()=>{if(!ey)return;let e=setInterval(ed,1e3);return()=>clearInterval(e)},[ey,ed]);let eS=(0,_.useCallback)(async()=>{let e=e_.isRinging;if(ei("call",{calledBack:e,ringingFor:e_.ringingFor}),ee.current||et.current)return;if(Z.current||"idle"!==a)return ej();ew(),o("connecting"),k(null),d(!1),ee.current=!0,Z.current=!0,L.current=null,Q.clear(),en.current+=1;let t=en.current,n=()=>Z.current&&en.current===t;try{i.current??=(0,lo.createAudioTap)(),function(e){if("suspended"!==e.state||lT)return;lT=!0;let t=()=>{lT=!1,window.removeEventListener("pointerdown",t),window.removeEventListener("keydown",t),e.resume().catch(()=>{})};window.addEventListener("pointerdown",t),window.addEventListener("keydown",t),al.toast.add({type:"warning",title:"Tap anywhere to hear her",description:"This call opened on its own, so the browser is holding the audio."})}(i.current.open().context);let t=new Audio("/sounds/start_voice.ogg");s.current??=new Audio("/sounds/end_voice.ogg");let a=(0,ov.thursdaySettings)(),o=new AbortController;z.current=o;let l={failures:0},u={failures:0},c={callId:"",last:null,opening:null,standing:null},h=new Map,f=new Map,g=null,y=e=>{let t={query:e.query,sources:e.sources};return lN(l,()=>lw(c.callId,[{id:e.row,role:"tool",tool:ow.TOOL_NAMES.web_search,text:JSON.stringify(t),seq:Math.max(0,Math.round(e.seq)),fragments:null}])),!!e.sources.length&&g===e.id&&(P.current&&clearTimeout(P.current),m(n=>n&&n.id!==e.id?n:{id:e.id,name:ow.TOOL_NAMES.web_search,line:(0,oA.toolLine)(ow.TOOL_NAMES.web_search,JSON.stringify(t)),done:!0,bot:null,sources:e.sources}),!0)},v=await ls({initialize:async t=>{let r=(0,au.unwrapResult)(await lb(a,t,e));if(!n())throw oM(r.callId),Error("The call closed during startup.");return F.current=r.callId,c.callId=r.callId,c.last=r.last,c.opening=r.opening,c.standing=r.standing,r.sdp},audio:i.current,on:{runTool:async e=>{if(e.name===ow.TOOL_NAMES.end_call)return eT(),"Ending the call.";if(e.name===ow.TOOL_NAMES.emote){let{word:t,reply:n}=function(e){let t="";try{let n=JSON.parse(e);n&&"object"==typeof n&&"text"in n&&(t=String(n.text??"").trim())}catch{t=""}let n=Array.from(t).length;if(!n)return{word:null,reply:"Nothing was shown: text is empty."};if(n>ll.FACE_WORD_MAX)return{word:null,reply:`Too long: ${n} characters, ${ll.FACE_WORD_MAX} at most. Nothing was shown.`};let r=(0,ll.undrawable)(t);return r?{word:null,reply:`Cannot draw "${r}"; use only the characters \`text\` lists. Nothing was shown.`}:{word:t.toUpperCase(),reply:"Shown."}}(e.arguments);return t&&M({text:t,at:Date.now()}),n}let t=Date.now();ei("tool.run",{name:e.name,id:e.id}),er(e);let n=e.name===ow.TOOL_NAMES.web_search;n&&(g=e.id);let r=!1;try{let t=await oP(c.callId,e,a.webSearch,o.signal);return n&&(r=y({id:e.id,row:e.item??e.id,query:(0,oA.searchQueryOf)(e.arguments),sources:(0,oA.searchSourcesOf)(t),seq:0})),t}finally{ei("tool.done",{id:e.id,ms:Date.now()-t}),r||ea(e.id)}},search:e=>{if(!e.done){g=e.id,er({id:e.id,name:ow.TOOL_NAMES.web_search,arguments:JSON.stringify({query:e.query})});return}let t={id:e.id,row:e.id,query:e.query,sources:e.sources,seq:e.seq};f.set(e.responseId,t),y(t)||ea(t.id)},cited:(e,t)=>{let n=f.get(e);if(!n)return;let r=new Set(n.sources.map(e=>e.url));n.sources=[...n.sources.map(e=>t.find(t=>t.url===e.url)??e),...t.filter(e=>!r.has(e.url))],y(n)},reasoning:e=>{let t=/^\s*\*\*(.+?)\*\*/.exec(e.text)?.[1]?.trim();t&&C(t),lN(u,()=>l_(c.callId,{...e,seq:Math.max(0,Math.round(e.seq))}),"The backend's thinking is not being saved")},turn:e=>{let t="tool"===e.role?"":lS(e.text),n=!!t&&t!==lS(h.get(e.id)?.text??"");if(n&&(V.current=Date.now()),n&&"user"===e.role&&(I.current=Date.now(),g)){let e=g;g=null,m(t=>t?.id===e?null:t)}if("tool"!==e.role&&F.current===c.callId&&(h.set(e.id,{seq:e.seq,id:e.id,role:e.role,text:e.text}),p([...h.values()].sort((e,t)=>e.seq-t.seq).slice(-24))),sc.CALL_NUDGE.on&&e.done&&"user"===e.role&&t){H.current&&clearTimeout(H.current);let e=I.current;H.current=setTimeout(()=>{H.current=null,I.current===e&&null===O.current&&ei("nudge",{sent:r.current?.nudge()??!1})},sc.CALL_NUDGE.waitMs)}e.done&&lN(l,()=>lw(c.callId,[{id:e.id,role:e.role,tool:e.tool,text:e.text,seq:Math.max(0,Math.round(e.seq)),fragments:e.fragments??null}]))},activity:e=>{var t;ex((t=e).speaking?"speaking":t.working||t.tools.length?t.tools.includes(ow.TOOL_NAMES.thread_start)?"delegating":"working":"listening");let n=e.working||e.tools.length>0;G.current=n,ec(n,e.speaking),e.speaking&&(K.current=Date.now()),(e.speaking&&!R.current.on||e.working||e.tools.length)&&(I.current=Date.now()),R.current.on&&(e.speaking?R.current.spoke=!0:R.current.spoke&&eo())},finalized:e=>{L.current=e},warn:e=>al.toast.add({type:"warning",title:"Call warning",description:e}),failed:e=>{al.toast.add({type:"error",title:"Call failed",description:e}),d(!0),ej(L.current?"closed":"dropped")}}});if(!n())return void await v.close();r.current=v,ee.current=!1,W.current=e,Q.open(e=>void v.append("thinking",e)),V.current=Date.now(),c.last&&v.append("thinking",c.last),c.opening&&(el(),v.append("instructions",c.opening).then(e=>{e||eo()})),c.standing&&v.append("thinking",c.standing),eg("listening"),x(Date.now()),t.play().catch(()=>{})}catch(e){if(n()&&(al.toast.add({type:"error",title:"Could not start the call",description:(0,T.errorToString)(e)}),d(!0)),en.current!==t)return;F.current&&oM(F.current),F.current=null,ee.current=!1,Z.current=!1,z.current=null,Q.clear(),o("idle")}},[a,ej,er,ea,ex,eg,Q,el,eo,ec,d,eT,e_.isRinging,e_.ringingFor,ew]);(0,_.useEffect)(()=>{if(!b)return;let e=setTimeout(()=>k(null),sc.CALL_ENDED_MS);return()=>clearTimeout(e)},[b]);let eN=(0,_.useCallback)(()=>i.current?.read()??lj,[]),eC=(0,_.useCallback)(()=>i.current?.readMic()??lj,[]),eE=(0,ov.useThursdayStore)(e=>e.wake),[eM,eO]=(0,_.useState)(!1),eA=lp();(0,_.useEffect)(()=>lh.onPlace(()=>void eS()),[eS]),o$({enabled:"idle"===a&&eE.enabled&&!eM&&!eA,phrases:[eE.phrase],onWake:()=>void eS(),onError:e=>{eO(!0),al.toast.add({type:"error",title:"Wake word off",description:e})}});let eR=(0,ov.useThursdayStore)(e=>e.hotkey),eL="connecting"===a||"ending"===a;return(0,oD.useHotkey)({enabled:eR.enabled&&!eL&&!eA,combo:eR.enabled&&(0,oD.isCombo)(eR.combo)?eR.combo:null,onPress:()=>void eS()}),{status:a,failed:l,messages:h,tool:f,ended:b,thinkingSince:j,thinkingTitle:N,faceWord:E,idleLeft:y,since:g,call:eS,ringing:e_.ringing,decline:e_.decline,getSpectrum:eN,getMicSpectrum:eC,wakePhrase:eE.enabled&&!eM?eE.phrase:null,hotkey:eR.enabled&&(0,oD.isCombo)(eR.combo)?eR.combo:null}}(t.on),b=(0,oD.useHotkeyLabel)(v),k=(0,og.useThursdayFace)(),j=(0,ov.useThursdayStore)(e=>e.captionView),{data:S}=(0,sb.useServerRoute)(w.queryKey.config),N=S?(0,af.isConfigSet)(S,sd.LIVE_PROVIDER.apiKeyName):e,C="idle"!==n,E=t.end;(0,_.useEffect)(()=>{C&&t.on&&E()},[C,t.on,E]);let M=t.on&&!C,O=(0,ov.useThursdayStore)(e=>e.textModel),A=(0,ov.useThursdayStore)(e=>e.backendModel),R=(0,_.useMemo)(()=>{let e=e=>(0,af.isConfigSet)(S,e),n=(0,oy.textCallRunsOn)(e),r=O&&e(sh.TEXT_MODEL_PROVIDERS[O.provider].apiKeyName)?O:n?{provider:n,model:A}:null;return{on:M,busy:t.busy,error:t.error,say:t.say,again:t.again,end:t.end,runsOn:r,fallback:r?.provider!=="openai"&&e(sh.TEXT_MODEL_PROVIDERS.openai.apiKeyName)?{provider:"openai",model:A}:null}},[M,t.busy,t.error,t.say,t.again,t.end,S,O,A]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lU,{live:"idle"!==n,ringing:null!==f}),(0,s.jsx)(l8,{status:M?t.status:n,failed:M?null!==t.error:r,messages:M?t.messages:i,tool:M?t.tool:a,thinkingSince:M?t.thinkingSince:o,thinkingTitle:M?t.thinkingTitle:l,ended:u,faceWord:c,onTap:p,ringing:N?f:null,onDecline:m,wakePhrase:y,hotkeyLabel:b,idleLeft:d,since:h,getSpectrum:M?ox:g,getMicSpectrum:x,face:k,captionView:j,callable:N,written:C?null:R})]})}],692888)},379227,(e,t,n)=>{var r;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/next/dist/compiled/tty-browserify/"),(r={}).isatty=function(){return!1},r.ReadStream=function(){throw Error("tty.ReadStream is not implemented")},r.WriteStream=function(){throw Error("tty.WriteStream is not implemented")},t.exports=r},90317,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={bindSnapshot:function(){return u},createAsyncLocalStorage:function(){return l},createSnapshot:function(){return c}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let s=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class a{disable(){throw s}getStore(){}run(){throw s}exit(){throw s}enterWith(){throw s}static bind(e){return e}}let o="u">typeof globalThis&&globalThis.AsyncLocalStorage;function l(){return o?new o:new a}function u(e){return o?o.bind(e):a.bind(e)}function c(){return o?o.snapshot():function(e,...t){return e(...t)}}},242344,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,e.r(90317).createAsyncLocalStorage)()},563599,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=e.r(242344)},309885,(e,t,n)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"encodeURIPath",{enumerable:!0,get:function(){return r}})},667585,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BailoutToCSR",{enumerable:!0,get:function(){return i}});let r=e.r(132061);function i({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new r.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},652157,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PreloadChunks",{enumerable:!0,get:function(){return l}});let r=e.r(843476),i=e.r(174080),s=e.r(563599),a=e.r(309885),o=e.r(543369);function l({moduleIds:e}){if("u">typeof window)return null;let t=s.workAsyncStorage.getStore();if(void 0===t)return null;let n=[];if(t.reactLoadableManifest&&e){let r=t.reactLoadableManifest;for(let t of e){if(!r[t])continue;let e=r[t].files;n.push(...e)}}if(0===n.length)return null;let u=(0,o.getAssetTokenQuery)();return(0,r.jsx)(r.Fragment,{children:n.map(e=>{let n=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${u}`;return e.endsWith(".css")?(0,r.jsx)("link",{precedence:"dynamic",href:n,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,i.preload)(n,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},869093,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return u}});let r=e.r(843476),i=e.r(271645),s=e.r(667585),a=e.r(652157);function o(e){return{default:e&&"default"in e?e.default:e}}let l={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},u=function(e){let t={...l,...e},n=(0,i.lazy)(()=>t.loader().then(o)),u=t.loading;function c(e){let o=u?(0,r.jsx)(u,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,c=l?i.Suspense:i.Fragment,d=t.ssr?(0,r.jsxs)(r.Fragment,{children:["u"<typeof window?(0,r.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(c,{...l?{fallback:o}:{},children:d})}return c.displayName="LoadableComponent",c}},770703,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return i}});let r=e.r(555682)._(e.r(869093));function i(e,t){let n={};"function"==typeof e&&(n.loader=e);let i={...n,...t};return(0,r.default)({...i,modules:i.loadableGenerated?.modules})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},618566,(e,t,n)=>{t.exports=e.r(976562)}]);
|