thursday-agent 0.17.2 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +4 -2
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +28 -12
- 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 +12 -12
- package/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +11 -11
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/artifact/route.js +7 -7
- package/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/files/route.js +4 -4
- package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/route.js +4 -4
- package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/route.js +4 -4
- package/.next/server/app/api/bot/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/[id]/route.js +1 -1
- package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/file/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/bot/thread/file/route.js +29 -0
- package/.next/server/app/api/bot/thread/file/route.js.nft.json +1 -0
- package/.next/server/app/api/bot/thread/file/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/bot/thread/route.js +1 -1
- package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
- package/.next/server/app/api/config/route.js +1 -1
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/events/route.js +2 -2
- 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 +4 -4
- package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/automatic/route.js +3 -3
- package/.next/server/app/api/llm-model/automatic/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/catalog/[provider]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/llm-model/catalog/{route.js → [provider]/route.js} +8 -8
- package/.next/server/app/api/llm-model/catalog/[provider]/route.js.nft.json +1 -0
- package/.next/server/app/api/llm-model/catalog/[provider]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/llm-model/credits/[provider]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/llm-model/credits/[provider]/route/build-manifest.json +12 -0
- package/.next/server/app/api/llm-model/credits/[provider]/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/llm-model/credits/{route.js → [provider]/route.js} +8 -8
- package/.next/server/app/api/llm-model/credits/[provider]/route.js.map +5 -0
- package/.next/server/app/api/llm-model/credits/[provider]/route.js.nft.json +1 -0
- package/.next/server/app/api/llm-model/credits/[provider]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/llm-model/route.js +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 +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 +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 +2 -2
- package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route.js +1 -1
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/tools/route.js +1 -1
- package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/edit/route.js +12 -12
- package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/route.js +1 -1
- package/.next/server/app/api/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/reach/route.js +17 -17
- 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/running/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/running/route/build-manifest.json +12 -0
- package/.next/server/app/api/running/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/running/route.js +10 -0
- package/.next/server/app/api/running/route.js.map +5 -0
- package/.next/server/app/api/running/route.js.nft.json +1 -0
- package/.next/server/app/api/running/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/signins/route.js +4 -4
- package/.next/server/app/api/signins/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/[source]/[name]/route.js +7 -7
- package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route.js +6 -6
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/end/route.js +1 -1
- package/.next/server/app/api/thursday/call/end/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/route.js +1 -1
- package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/settings/route.js +1 -1
- package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/text/route.js +12 -12
- package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js +13 -13
- package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/files/route.js +7 -7
- package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/route.js +6 -6
- package/.next/server/app/api/workspace/route.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +94 -6
- package/.next/server/app/artifact/[...path]/page.js +9 -5
- 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 +161 -128
- package/.next/server/app/page.js +10 -9
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +4 -2
- package/.next/server/chunks/[root-of-the-server]__00qyw01._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__02ra64t._.js +5 -0
- package/.next/server/chunks/{[root-of-the-server]__05dp5tr._.js → [root-of-the-server]__06ky9of._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0b565-x._.js +7 -0
- package/.next/server/chunks/[root-of-the-server]__0bmtib_._.js +7 -0
- package/.next/server/chunks/[root-of-the-server]__0bqveex._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0brmiv2._.js +7 -0
- package/.next/server/chunks/[root-of-the-server]__0eivkvk._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0f7m79q._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0g38-aj._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0gvdr2h._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__0h656y-._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0hm3tiq._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0hzdqnv._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0kzmxpg._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0mgyt8p._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0o5s5-o._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__0p80i1n._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0qdoc_9._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__0qzho69._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0sm5xvm._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0v_kuor._.js +5 -0
- package/.next/server/chunks/{[root-of-the-server]__061o2_x._.js → [root-of-the-server]__0ypkfbu._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1-18_pz._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__13hng6h._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__01k3vi3._.js → [root-of-the-server]__14iga7p._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__16gn7zn._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__18e65_-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__1_cgawk._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1ceammd._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ckt1yj._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1cu5f3z._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1dth047._.js +5 -0
- package/.next/server/chunks/{[root-of-the-server]__1k2qs1m._.js → [root-of-the-server]__1fc6v12._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1hviq62._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__1ksm9m-._.js +12 -0
- package/.next/server/chunks/[root-of-the-server]__1m1q6u5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1m_dmf6._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1mys2c3._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1p0njle._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1p47fbb._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__1pugoq0._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0ts7ai0._.js → [root-of-the-server]__1trns9g._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1zn039k._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__20w_g71._.js +3 -0
- package/.next/server/chunks/_01c32w9._.js +1 -1
- package/.next/server/chunks/_02bov6_._.js +1 -1
- package/.next/server/chunks/_06hnfi8._.js +2 -2
- package/.next/server/chunks/_06u9yo-._.js +1 -1
- package/.next/server/chunks/_08354bn._.js +12 -11
- package/.next/server/chunks/_08_-9ay._.js +7 -0
- package/.next/server/chunks/_08s4vft._.js +1 -1
- package/.next/server/chunks/_0bgjf07._.js +5 -0
- package/.next/server/chunks/_0c49lmw._.js +1 -1
- package/.next/server/chunks/_0fb6dvr._.js +1 -1
- package/.next/server/chunks/_0hgvg55._.js +1 -1
- package/.next/server/chunks/_0iw19ig._.js +1 -1
- package/.next/server/chunks/_0poi1t2._.js +1 -1
- package/.next/server/chunks/_0s8ao8z._.js +1 -1
- package/.next/server/chunks/_0t_7gji._.js +1 -1
- package/.next/server/chunks/_0ucx1jv._.js +1 -1
- package/.next/server/chunks/_0uzj57i._.js +1 -1
- package/.next/server/chunks/_0wyh244._.js +112 -0
- package/.next/server/chunks/_1-sk_q4._.js +1 -1
- package/.next/server/chunks/_108gsm8._.js +2 -2
- package/.next/server/chunks/_136j09a._.js +5 -5
- package/.next/server/chunks/_15negpy._.js +2 -2
- package/.next/server/chunks/_1d7og_q._.js +1 -1
- package/.next/server/chunks/_1dxq827._.js +2 -2
- package/.next/server/chunks/_1e54wxa._.js +1 -1
- package/.next/server/chunks/_1frcwj1._.js +1 -1
- package/.next/server/chunks/_1gn2r2q._.js +8 -6
- package/.next/server/chunks/_1gxankq._.js +2 -2
- package/.next/server/chunks/_1i3uucm._.js +1 -1
- package/.next/server/chunks/_1jvy78-._.js +5 -0
- package/.next/server/chunks/_1lg0lsu._.js +53 -0
- package/.next/server/chunks/_1njolhx._.js +294 -0
- package/.next/server/chunks/_1q6e56i._.js +8 -6
- package/.next/server/chunks/_1qgix-j._.js +1 -1
- package/.next/server/chunks/_1wtb-77._.js +294 -0
- package/.next/server/chunks/_1wwl_7o._.js +1 -1
- package/.next/server/chunks/_1y8w80a._.js +5 -5
- package/.next/server/chunks/_1yx285_._.js +3 -0
- package/.next/server/chunks/_20qn224._.js +3 -0
- package/.next/server/chunks/_211dn2c._.js +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_bot_thread_file_route_actions_0q3be0o.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_llm-model_catalog_[provider]_route_actions_1i0449q.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_llm-model_credits_[provider]_route_actions_0iui9hz.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_running_route_actions_0o1g-aw.js +3 -0
- package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
- package/.next/server/chunks/features_bot_08z387_._.js +3 -3
- package/.next/server/chunks/features_bot_0zy_q8y._.js +7 -7
- package/.next/server/chunks/features_bot_1dfrdsb._.js +7 -7
- package/.next/server/chunks/features_workspace_workspace_ts_13h82gv._.js +3 -3
- package/.next/server/chunks/features_workspace_workspace_ts_1iyjroj._.js +3 -3
- package/.next/server/chunks/{node_modules_1rosz79._.js → node_modules_035o7ku._.js} +1 -1
- package/.next/server/chunks/{node_modules_1er1u8w._.js → node_modules_0tn5t13._.js} +1 -1
- package/.next/server/chunks/{node_modules_103lpef._.js → node_modules_12oq3hr._.js} +1 -1
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0g87zst._.js → node_modules_consola_dist_chunks_prompt_mjs_0yd5xa0._.js} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__04upd5v._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0p0mv2u._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0sk5enu._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0xyaud4._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1-gi9sm._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__16nn3pe._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1867koj._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1c8-7cw._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__1d7usu0._.js → [root-of-the-server]__1qn0axo._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__1tb5vve._.js +47 -0
- package/.next/server/chunks/ssr/_02cm0fr._.js +5 -0
- package/.next/server/chunks/ssr/{features_bot_1knyan7._.js → _07nmtxo._.js} +2 -2
- package/.next/server/chunks/ssr/_088vzgn._.js +1 -1
- package/.next/server/chunks/ssr/{_1dfv66y._.js → _0bg1u1j._.js} +2 -2
- package/.next/server/chunks/ssr/_0cv9tmv._.js +1 -1
- package/.next/server/chunks/ssr/{_10-_awu._.js → _0f9hx5p._.js} +2 -2
- package/.next/server/chunks/ssr/_0g9ula_._.js +3 -0
- package/.next/server/chunks/ssr/{_1aqjk-1._.js → _0irozu9._.js} +2 -2
- package/.next/server/chunks/ssr/{_123y-ah._.js → _0is8m6y._.js} +2 -2
- package/.next/server/chunks/ssr/_0iwsdp7._.js +3 -0
- package/.next/server/chunks/ssr/_0l7rjg5._.js +1 -1
- package/.next/server/chunks/ssr/{lib_logger_ts_0-olsze._.js → _0mfgsk-._.js} +4 -2
- package/.next/server/chunks/ssr/{_0fo4552._.js → _0nk80t6._.js} +53 -13
- package/.next/server/chunks/ssr/_0p6w0ef._.js +3 -0
- package/.next/server/chunks/ssr/_0pbav_w._.js +3 -0
- package/.next/server/chunks/ssr/{_0vo_oym._.js → _0q-mdwv._.js} +8 -8
- package/.next/server/chunks/ssr/_0s5_ahb._.js +3 -0
- package/.next/server/chunks/ssr/{_0e2fnvg._.js → _0t5f2c3._.js} +2 -2
- package/.next/server/chunks/ssr/_0v9r8g2._.js +1 -1
- package/.next/server/chunks/ssr/_0x8ophf._.js +1 -1
- package/.next/server/chunks/ssr/_0x9f717._.js +60 -0
- package/.next/server/chunks/ssr/_107vtdk._.js +162 -0
- package/.next/server/chunks/ssr/{_17a4qyk._.js → _12lql1x._.js} +3 -3
- package/.next/server/chunks/ssr/{_163dr78._.js → _165wnr4._.js} +2 -2
- package/.next/server/chunks/ssr/_16_7zeo._.js +3 -0
- package/.next/server/chunks/ssr/_17komoi._.js +3 -0
- package/.next/server/chunks/ssr/_190hjys._.js +3 -0
- package/.next/server/chunks/ssr/_1bfrntd._.js +6 -0
- package/.next/server/chunks/ssr/{_01al00i._.js → _1booff4._.js} +2 -2
- package/.next/server/chunks/ssr/{_0xfafez._.js → _1ew1j7l._.js} +2 -2
- package/.next/server/chunks/ssr/_1i2swyr._.js +3 -0
- package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
- package/.next/server/chunks/ssr/_1qsa25k._.js +3 -0
- package/.next/server/chunks/ssr/_1soynbw._.js +6 -0
- package/.next/server/chunks/ssr/_1vc2xmu._.js +3 -0
- package/.next/server/chunks/ssr/{_14oirtb._.js → _1wq90j8._.js} +2 -2
- package/.next/server/chunks/ssr/_1xwtbdz._.js +3 -0
- package/.next/server/chunks/ssr/_1zrhkf0._.js +310 -0
- package/.next/server/chunks/ssr/_21awrs2._.js +5 -0
- package/.next/server/chunks/ssr/features_0796o8r._.js +1 -1
- package/.next/server/chunks/ssr/features_bot_0tb4ui-._.js +2 -2
- package/.next/server/chunks/ssr/features_bot_1c56lew._.js +37 -0
- package/.next/server/chunks/ssr/features_bot_1fn_grf._.js +3 -0
- package/.next/server/chunks/ssr/{features_config_09n-q9q._.js → features_config_05zi68v._.js} +3 -3
- package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
- package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
- package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
- package/.next/server/chunks/ssr/features_workspace_workspace_ts_1wc7_u_._.js +4 -4
- package/.next/server/chunks/ssr/{node_modules_1k5i-_9._.js → node_modules_0-sux1a._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0msrhxf._.js → node_modules_01oezhb._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1gq3ght._.js → node_modules_04m6ebg._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0nmkv-v._.js → node_modules_067jfov._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0gd9hbz._.js → node_modules_06ugby3._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0d6j33x._.js → node_modules_07p51j3._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_10_fv2a._.js → node_modules_0995xyq._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1lmyts8._.js → node_modules_0_uecwx._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_04x5wyv._.js → node_modules_0dsyc90._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0__0tvm._.js → node_modules_0hli6s2._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0k8-y89._.js → node_modules_0m-bde_._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1p_6sq7._.js → node_modules_0oqfdbr._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_0qd7p5f._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_13g-d25._.js → node_modules_0tgy5s5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1_8-jcj._.js → node_modules_1-kjmls._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0m73b88._.js → node_modules_1-l3ka5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_113l3e5._.js → node_modules_1-w3ayh._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0q-klni._.js → node_modules_133exgm._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1xb-ndg._.js → node_modules_17xc5_k._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_021lid9._.js → node_modules_1_i_w30._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1ri_eip._.js → node_modules_1a2cjfk._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_13bqv6i._.js → node_modules_1k752fe._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1qstb1x._.js → node_modules_1lie7z8._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_096up6a._.js → node_modules_1mv70-y._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_156kv_t._.js → node_modules_1r611t2._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_1vfd8dz._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_0cjnmzp._.js → node_modules_1yaowd7._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0nw5jz7._.js → node_modules_20a1wpo._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0amkw0b._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1r8pxbe._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0zq3l45._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1siiu4h._.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 +205 -132
- package/.next/static/chunks/{0obogzscwwekj.js → 088d3w5qxu19g.js} +2 -2
- package/.next/static/chunks/0_s4z70lx1tgs.js +1 -0
- package/.next/static/chunks/0bxekp4hnuk1g.js +1 -0
- package/.next/static/chunks/{1cglo3a2mbeou.js → 0fw4u_s974j24.js} +1 -1
- package/.next/static/chunks/0hy2x7qhk8wgx.css +1 -0
- package/.next/static/chunks/{2zbl41hed17g3.js → 0n_eshmn_7wfn.js} +2 -2
- package/.next/static/chunks/0q9b2n6l4flqb.js +1 -0
- package/.next/static/chunks/0ulcp_u_y1u0b.js +15 -0
- package/.next/static/chunks/0vj93zo0yvix9.js +35 -0
- package/.next/static/chunks/{166smhw8v-s3j.js → 10f98bh4hdmhe.js} +1 -1
- package/.next/static/chunks/1b8bce_z_act0.js +1 -0
- package/.next/static/chunks/1c32d2azsjaj_.js +1 -0
- package/.next/static/chunks/{1xv4g10m-cl1s.js → 1fs829mz69pxz.js} +1 -1
- package/.next/static/chunks/1lwlh4mo_vv8d.js +1 -0
- package/.next/static/chunks/{0p2f6uv4xytfm.js → 1po8fkg40peu-.js} +1 -1
- package/.next/static/chunks/{0uxq_vs6uxi-b.js → 1rg6b9l5fm1hj.js} +1 -1
- package/.next/static/chunks/{3b96xy59nl_gd.js → 26g3iwfuad-7p.js} +1 -1
- package/.next/static/chunks/2bjnmtke_q43c.js +1 -0
- package/.next/static/chunks/2c86k0o-1p9_w.js +1 -0
- package/.next/static/chunks/2gf4t0d76bvyv.js +1 -0
- package/.next/static/chunks/2rj3q_ahctv19.js +1 -0
- package/.next/static/chunks/{2lhc74urf3acr.js → 2x6-fpctvucte.js} +1 -1
- package/.next/static/chunks/2yicf7bky866n.js +3 -0
- package/.next/static/chunks/337g9g_ux2gj-.js +1 -0
- package/.next/static/chunks/350ws7svim7ij.js +58 -0
- package/.next/static/chunks/{0o7o0eb7ihxi6.js → 396enq-m0sss5.js} +1 -1
- package/.next/static/chunks/3e1w_nwfb39j-.js +1 -0
- package/.next/static/chunks/3v3ooretb54ag.js +1 -0
- package/.next/static/chunks/40re_3ukjulg9.js +1 -0
- package/.next/static/chunks/{3gsxnqqqphh-1.js → 44bcbnmup71so.js} +1 -1
- package/.next/static/chunks/{2qgkbdshzpq1c.js → 458dtbsemx996.js} +1 -1
- package/README.md +5 -5
- package/bin/background.mjs +995 -0
- package/bin/lock.mjs +121 -5
- package/bin/thursday.mjs +126 -30
- package/bin/tools.mjs +72 -1
- package/database/migrations/20260926021847_thread_cache_tokens/migration.sql +2 -0
- package/database/migrations/20260926021847_thread_cache_tokens/snapshot.json +1949 -0
- package/guide/bots.md +173 -317
- package/guide/calls.md +106 -146
- package/guide/index.md +2 -2
- package/guide/memory.md +14 -18
- package/guide/phone.md +86 -133
- package/guide/setup.md +141 -172
- package/guide/trouble.md +42 -65
- package/package.json +1 -1
- package/seed-skills/concierge/travel/references/itinerary.md +1 -1
- package/seed-skills/concierge/travel/scripts/itinerary.mjs +8 -3
- package/skills/artifact/references/book.md +3 -3
- package/skills/artifact/runtime/shell/shell.js +32 -3
- package/.next/server/app/api/llm-model/catalog/route/app-paths-manifest.json +0 -3
- package/.next/server/app/api/llm-model/catalog/route.js.nft.json +0 -1
- package/.next/server/app/api/llm-model/catalog/route_client-reference-manifest.js +0 -3
- package/.next/server/app/api/llm-model/credits/route/app-paths-manifest.json +0 -3
- package/.next/server/app/api/llm-model/credits/route.js.nft.json +0 -1
- package/.next/server/app/api/llm-model/credits/route_client-reference-manifest.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__01ypm_z._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__021dkui._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__03xamry._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__09gdscj._.js +0 -7
- package/.next/server/chunks/[root-of-the-server]__0ljizgj._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__0nmust6._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__0svzjwa._.js +0 -7
- package/.next/server/chunks/[root-of-the-server]__1-rmal0._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__10xnb7e._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1_h4hf9._.js +0 -7
- package/.next/server/chunks/[root-of-the-server]__1c2kwku._.js +0 -12
- package/.next/server/chunks/[root-of-the-server]__1t02-1p._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1t0jj1j._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__1v7x5ym._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1vlxv19._.js +0 -5
- package/.next/server/chunks/_07nxi75._.js +0 -254
- package/.next/server/chunks/_08btiir._.js +0 -7
- package/.next/server/chunks/_0j0-gq6._.js +0 -5
- package/.next/server/chunks/_0p6v1fr._.js +0 -5
- package/.next/server/chunks/_0srlnvd._.js +0 -16
- package/.next/server/chunks/_0xygcxs._.js +0 -254
- package/.next/server/chunks/_1ic3bew._.js +0 -5
- package/.next/server/chunks/_next-internal_server_app_api_llm-model_catalog_route_actions_1eu2y41.js +0 -3
- package/.next/server/chunks/_next-internal_server_app_api_llm-model_credits_route_actions_0v424pb.js +0 -3
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_04oxl25._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0-af_o7._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__09f39cp._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__0ouu4qp._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0q9g9ea._.js +0 -5
- package/.next/server/chunks/ssr/[root-of-the-server]__17h1ggo._.js +0 -46
- package/.next/server/chunks/ssr/[root-of-the-server]__1jyeu61._.js +0 -5
- package/.next/server/chunks/ssr/_0afrpci._.js +0 -3
- package/.next/server/chunks/ssr/_0bgse1c._.js +0 -162
- package/.next/server/chunks/ssr/_0jstvlg._.js +0 -39
- package/.next/server/chunks/ssr/_0qsmpcu._.js +0 -3
- package/.next/server/chunks/ssr/_0z38nha._.js +0 -3
- package/.next/server/chunks/ssr/_1-41lck._.js +0 -3
- package/.next/server/chunks/ssr/_10_ph1t._.js +0 -3
- package/.next/server/chunks/ssr/_116lfdc._.js +0 -3
- package/.next/server/chunks/ssr/_14dfh7a._.js +0 -4
- package/.next/server/chunks/ssr/_17qtuv7._.js +0 -3
- package/.next/server/chunks/ssr/_19jez1a._.js +0 -3
- package/.next/server/chunks/ssr/_1_5xof_._.js +0 -3
- package/.next/server/chunks/ssr/_1alxym6._.js +0 -3
- package/.next/server/chunks/ssr/_1ou5sj0._.js +0 -3
- package/.next/server/chunks/ssr/_1tmw842._.js +0 -5
- package/.next/server/chunks/ssr/_1uij_rj._.js +0 -3
- package/.next/server/chunks/ssr/_1w9w1ok._.js +0 -3
- package/.next/server/chunks/ssr/_20gq_24._.js +0 -3
- package/.next/server/chunks/ssr/features_bot_0ouemw8._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_@base-ui_react_1j9i1ho._.js +0 -3
- package/.next/static/chunks/01l7kw74vfp32.js +0 -1
- package/.next/static/chunks/0a5_-jqhaktjj.js +0 -1
- package/.next/static/chunks/0npvak0wpgagb.js +0 -1
- package/.next/static/chunks/19l81deo_pyoc.js +0 -1
- package/.next/static/chunks/1bnhw-5fj7aiz.js +0 -1
- package/.next/static/chunks/1in6nxpu33iab.js +0 -1
- package/.next/static/chunks/1u7kg91f9qy3g.js +0 -1
- package/.next/static/chunks/2ajs12-fcdwzm.js +0 -1
- package/.next/static/chunks/2i7qtmxc1kuqg.js +0 -1
- package/.next/static/chunks/2kz1f6r59nky0.js +0 -3
- package/.next/static/chunks/31kn4_h2rvf6k.css +0 -1
- package/.next/static/chunks/35jj-5u4te56r.js +0 -1
- package/.next/static/chunks/37ixzapa06xlo.js +0 -1
- package/.next/static/chunks/3jtcieuk1l6tw.js +0 -1
- package/.next/static/chunks/3k1d8y03t5nax.js +0 -58
- package/.next/static/chunks/3sla-dm1puqd1.js +0 -35
- package/.next/static/chunks/3t2c76awm9k_p.js +0 -1
- package/.next/static/chunks/3vrmcm31ih7gb.js +0 -1
- package/.next/static/chunks/3yiqr95d7ybeq.js +0 -15
- package/bin/autostart.mjs +0 -162
- /package/.next/server/app/api/{llm-model/catalog → bot/thread/file}/route/build-manifest.json +0 -0
- /package/.next/server/app/api/{llm-model/catalog → bot/thread/file}/route/server-reference-manifest.json +0 -0
- /package/.next/server/app/api/{llm-model/catalog → bot/thread/file}/route.js.map +0 -0
- /package/.next/server/app/api/llm-model/{credits → catalog/[provider]}/route/build-manifest.json +0 -0
- /package/.next/server/app/api/llm-model/{credits → catalog/[provider]}/route/server-reference-manifest.json +0 -0
- /package/.next/server/app/api/llm-model/{credits → catalog/[provider]}/route.js.map +0 -0
- /package/.next/static/{8I2hKtciyA9LXvd8txuOz → YhaRHJqObuAcXZe5VLFs0}/_buildManifest.js +0 -0
- /package/.next/static/{8I2hKtciyA9LXvd8txuOz → YhaRHJqObuAcXZe5VLFs0}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{8I2hKtciyA9LXvd8txuOz → YhaRHJqObuAcXZe5VLFs0}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,805995,
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,805995,294970,e=>{"use strict";var t,n=e.i(843476),s=e.i(493801),r=e.i(375775),i=e.i(422411),o=e.i(525335),a=e.i(689664),l=e.i(867927),d=e.i(456420);let c={name:"clapperboard",size:24,node:[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]]};c.node;let u=(0,d.default)(c);var h=e.i(560972),h=h,f=e.i(815170),m=e.i(758925),g=e.i(566595),x=e.i(466787),p=e.i(271645),y=e.i(798120),k=e.i(167881),v=e.i(23750),j=e.i(917162),b=e.i(59377),w=e.i(818125),N=e.i(671428),A=e.i(41533),S=e.i(412294),C=e.i(458898),M=e.i(146538),z=e.i(968978),E=e.i(265402),R=e.i(635963),I=e.i(95187);let F=(0,I.createServerReference)("7fc5ad2ca5f880c272d3b36234f095644501ad4300",I.callServer,void 0,I.findSourceMapURL,"removeConfigAction");e.s(["removeConfigAction",0,F],294970);var P=e.i(432653),T=e.i(992112),K=e.i(508734),_=e.i(482022),$=((t=$||{})[t.Border=-1]="Border",t[t.Data=0]="Data",t[t.Function=1]="Function",t[t.Position=2]="Position",t[t.Timing=3]="Timing",t[t.Alignment=4]="Alignment",t);let B=[1,0],O=[2,3],L=[3,2],q={L:[0,1],M:B,Q:O,H:L},D=/^\d*$/,H=/^[A-Z0-9 $%*+./:-]*$/,U="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",G=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Y=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class W{constructor(e,t,n,s){if(this.version=e,this.ecc=t,e<1||e>40)throw RangeError("Version value out of range");if(s<-1||s>7)throw RangeError("Mask value out of range");this.size=4*e+17;const r=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(r.slice()),this.types.push(r.map(()=>0));this.drawFunctionPatterns();const i=this.addEccAndInterleave(n);if(this.drawCodewords(i),-1===s){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(s=t,e=n),this.applyMask(t)}}this.mask=s,this.applyMask(s),this.drawFormatBits(s)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,$.Timing),this.setFunctionModule(e,6,e%2==0,$.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let s=0;s<t;s++)(0!==n||0!==s)&&(0!==n||s!==t-1)&&(n!==t-1||0!==s)&&this.drawAlignmentPattern(e[n],e[s]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let s=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,Q(s,e));this.setFunctionModule(8,7,Q(s,6)),this.setFunctionModule(8,8,Q(s,7)),this.setFunctionModule(7,8,Q(s,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,Q(s,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,Q(s,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,Q(s,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=Q(t,e),s=this.size-11+e%3,r=Math.floor(e/3);this.setFunctionModule(s,r,n),this.setFunctionModule(r,s,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let s=-4;s<=4;s++){let r=Math.max(Math.abs(s),Math.abs(n)),i=e+s,o=t+n;i>=0&&i<this.size&&o>=0&&o<this.size&&this.setFunctionModule(i,o,2!==r&&4!==r,$.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let s=-2;s<=2;s++)this.setFunctionModule(e+s,t+n,1!==Math.max(Math.abs(s),Math.abs(n)),$.Alignment)}setFunctionModule(e,t,n,s=$.Function){this.modules[t][e]=n,this.types[t][e]=s}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==er(t,n))throw RangeError("Invalid argument");let s=Y[n[0]][t],r=G[n[0]][t],i=Math.floor(es(t)/8),o=s-i%s,a=Math.floor(i/s),l=[],d=function(e){if(e<1||e>255)throw RangeError("Degree out of range");let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let s=0;s<e;s++){for(let e=0;e<t.length;e++)t[e]=ei(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=ei(n,2)}return t}(r);for(let t=0,n=0;t<s;t++){let s=e.slice(n,n+a-r+(t<o?0:1));n+=s.length;let i=function(e,t){let n=t.map(e=>0);for(let s of e){let e=s^n.shift();n.push(0),t.forEach((t,s)=>n[s]^=ei(t,e))}return n}(s,d);t<o&&s.push(0),l.push(s.concat(i))}let c=[];for(let e=0;e<l[0].length;e++)l.forEach((t,n)=>{(e!==a-r||n>=o)&&c.push(t[e])});return c}drawCodewords(e){if(e.length!==Math.floor(es(this.version)/8))throw RangeError("Invalid argument");let t=0;for(let n=this.size-1;n>=1;n-=2){6===n&&(n=5);for(let s=0;s<this.size;s++)for(let r=0;r<2;r++){let i=n-r,o=(n+1&2)==0?this.size-1-s:s;!this.types[o][i]&&t<8*e.length&&(this.modules[o][i]=Q(e[t>>>3],7-(7&t)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let s;switch(e){case 0:s=(n+t)%2==0;break;case 1:s=t%2==0;break;case 2:s=n%3==0;break;case 3:s=(n+t)%3==0;break;case 4:s=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:s=n*t%2+n*t%3==0;break;case 6:s=(n*t%2+n*t%3)%2==0;break;case 7:s=((n+t)%2+n*t%3)%2==0;break;default:throw Error("Unreachable")}!this.types[t][n]&&s&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,s=0,r=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[t][i]===n?5==++s?e+=3:s>5&&e++:(this.finderPenaltyAddHistory(s,r),n||(e+=40*this.finderPenaltyCountPatterns(r)),n=this.modules[t][i],s=1);e+=40*this.finderPenaltyTerminateAndCount(n,s,r)}for(let t=0;t<this.size;t++){let n=!1,s=0,r=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[i][t]===n?5==++s?e+=3:s>5&&e++:(this.finderPenaltyAddHistory(s,r),n||(e+=40*this.finderPenaltyCountPatterns(r)),n=this.modules[i][t],s=1);e+=40*this.finderPenaltyTerminateAndCount(n,s,r)}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let s=this.modules[t][n];s===this.modules[t][n+1]&&s===this.modules[t+1][n]&&s===this.modules[t+1][n+1]&&(e+=3)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size;return e+(Math.ceil(Math.abs(20*t-10*n)/n)-1)*10}getAlignmentPatternPositions(){if(1===this.version)return[];{let e=Math.floor(this.version/7)+2,t=32===this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),n=[6];for(let s=this.size-7;n.length<e;s-=t)n.splice(1,0,s);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===3*t&&e[4]===t&&e[5]===t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0===t[0]&&(e+=this.size),t.pop(),t.unshift(e)}}function V(e,t,n){if(t<0||t>31||e>>>t!=0)throw RangeError("Value out of range");for(let s=t-1;s>=0;s--)n.push(e>>>s&1)}function Q(e,t){return(e>>>t&1)!=0}class X{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError("Invalid argument");this.bitData=n.slice()}getData(){return this.bitData.slice()}}let Z=[1,10,12,14],J=[2,9,11,13],ee=[4,8,16,16];function et(e,t){return e[Math.floor((t+7)/17)+1]}function en(e){let t=[];for(let n of e)V(n,8,t);return new X(ee,e.length,t)}function es(e){if(e<1||e>40)throw RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function er(e,t){return Math.floor(es(e)/8)-G[t[0]][e]*Y[t[0]][e]}function ei(e,t){if(e>>>8!=0||t>>>8!=0)throw RangeError("Byte out of range");let n=0;for(let s=7;s>=0;s--)n=n<<1^(n>>>7)*285^(t>>>s&1)*e;return n}var eo=e.i(511769),ea=e.i(660302),el=e.i(895836),ed=e.i(609856),ec=e.i(283653),eu=e.i(647163);let eh=(0,I.createServerReference)("7f1de1f12ee8e3b472973865a1b455fbca4fbe4919",I.callServer,void 0,I.findSourceMapURL,"forgetReachAction");var ef=e.i(36174);let em={telegram:"telegram.org",discord:"discord.com",slack:"slack.com"},eg=`display_information:
|
|
2
2
|
name: Thursday
|
|
3
3
|
features:
|
|
4
4
|
app_home:
|
|
@@ -15,4 +15,4 @@ settings:
|
|
|
15
15
|
interactivity:
|
|
16
16
|
is_enabled: true
|
|
17
17
|
socket_mode_enabled: true
|
|
18
|
-
`,ex=({children:e})=>(0,n.jsx)("span",{className:"font-medium text-foreground",children:e}),ep={telegram:[{body:(0,n.jsxs)(n.Fragment,{children:["In Telegram, write to ",(0,n.jsx)(ex,{children:"@BotFather"}),", send ",(0,n.jsx)(ex,{children:"/newbot"})," and pick a name. It answers with a ",(0,n.jsx)(ex,{children:"token"}),"."]}),slot:{open:"https://t.me/BotFather",label:"Open @BotFather"}},{body:(0,n.jsx)(n.Fragment,{children:"Paste the token here."}),slot:{key:ef.TELEGRAM_TOKEN_KEY,looks:"123456789:AAE…"}},{body:(0,n.jsx)(n.Fragment,{children:"From your phone, write anything to your bot."}),slot:{says:"Point your phone's camera at it to open the chat."}},{body:(0,n.jsxs)(n.Fragment,{children:["A question with a code appears on this computer. Press ",(0,n.jsx)(ex,{children:"Allow"})," if your phone shows the same code."]})}],discord:[{body:(0,n.jsxs)(n.Fragment,{children:["At ",(0,n.jsx)(ex,{children:"discord.com/developers"}),", make a ",(0,n.jsx)(ex,{children:"New Application"}),". So nobody else can add it to a server, set ",(0,n.jsx)(ex,{children:"Install Link"})," to"," ",(0,n.jsx)(ex,{children:"None"})," on its ",(0,n.jsx)(ex,{children:"Installation"})," page and turn off"," ",(0,n.jsx)(ex,{children:"Public Bot"})," on its ",(0,n.jsx)(ex,{children:"Bot"})," page. There, press"," ",(0,n.jsx)(ex,{children:"Reset Token"})," and copy it."]}),slot:{open:"https://discord.com/developers/applications",label:"Open discord.com/developers"}},{body:(0,n.jsx)(n.Fragment,{children:"Paste the token here."}),slot:{key:ef.DISCORD_TOKEN_KEY,looks:"MTE…"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Add the bot to a server of your own"})," — Discord only delivers a message to a bot you share a server with. A private server made for this is fine."]}),slot:{says:"Point your phone's camera at it, or open it here. It asks which server, and adds the bot with no permissions in it.",does:"Add the bot to a server"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Send the bot a direct message"}),", not in the server: on a phone, tap the bot in the server's member list, then ",(0,n.jsx)(ex,{children:"Message"}),". A question with a code appears here: press ",(0,n.jsx)(ex,{children:"Allow"})," if your phone shows the same code."]})}],slack:[{body:(0,n.jsxs)(n.Fragment,{children:["At ",(0,n.jsx)(({href:e,children:t})=>(0,n.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"font-medium text-foreground underline underline-offset-4 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:t}),{href:"https://api.slack.com/apps",children:"api.slack.com/apps"}),","," ",(0,n.jsx)(ex,{children:"Create New App › From a manifest"}),", and paste the manifest."]}),slot:{manifest:!0}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Basic Information › App-Level Tokens"}),": generate one with"," ",(0,n.jsx)(ex,{children:"connections:write"}),". It starts with xapp-."]}),slot:{key:ef.SLACK_APP_TOKEN_KEY,looks:"xapp-…"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Install App"})," to your workspace. The Bot User OAuth Token starts with xoxb-."]}),slot:{key:ef.SLACK_BOT_TOKEN_KEY,looks:"xoxb-…"}},{body:(0,n.jsxs)(n.Fragment,{children:["In Slack, open the app under ",(0,n.jsx)(ex,{children:"Apps"})," and write in its"," ",(0,n.jsx)(ex,{children:"Messages"})," tab. A question with a code appears here: press"," ",(0,n.jsx)(ex,{children:"Allow"})," if Slack shows the same code."]})}]};function ey(){let e=(0,ec.useServerRoute)(y.queryKey.config),t=(0,ec.useServerRoute)(y.queryKey.reach);(0,eo.useAppEvent)({reach:()=>void(0,ec.revalidate)(y.queryKey.reach)});let s=t=>(0,T.isConfigSet)(e.data,t),r=e=>t.data?.channels.find(t=>t.name===e)??null,i=e=>!!r(e)?.allowed,o=ef.REACH_CHANNELS.find(e=>r(e)?.refused),a=ef.REACH_CHANNELS.find(e=>ef.REACH_KEYS[e].every(s)&&!i(e)),l=!ef.REACH_CHANNELS.some(i),[d,c]=(0,p.useState)(o??a??(l?ef.REACH_CHANNELS[0]:null));return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(el.SettingItems,{children:ef.REACH_CHANNELS.map(e=>(0,n.jsx)(ek,{name:e,status:r(e),tokensIn:ef.REACH_KEYS[e].filter(s).length,isSet:s,open:d===e,onOpen:()=>c(d===e?null:e)},e))}),(0,n.jsx)(el.SettingNote,{children:"Only the one person you allow can write, and only direct messages are read. Work started here runs whether or not a tab is open, while Thursday is running on this computer."})]})}function ek({name:e,status:t,tokensIn:s,isSet:r,open:i,onOpen:o}){var a;let d,c,u,h,f=ep[e],g=t?.refused??null,x=(a={connected:!!t?.bot,allowed:!!t?.allowed,refused:g},d=f.map(e=>e.slot&&"key"in e.slot?e.slot.key:null),c=e=>!r(e)||e===a.refused,u=d.findIndex(e=>e&&c(e)),h=d.reduce((e,t,n)=>t?n:e,-1),f.map((e,t)=>{let n=d[t];return n?c(n)?t===u?"now":"later":"done":u>=0?t<u?a.refused?"done":"flat":"later":a.allowed||t<h?"done":a.connected?"now":"flat"})),p=!!t?.bot&&!t?.allowed&&!g;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{type:"button",onClick:o,"aria-expanded":i,className:"flex w-full items-center gap-3 px-4 py-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsx)(w.SiteIcon,{host:em[e],className:"size-4 rounded-[4px]",fallback:(0,n.jsx)(m.KeyRound,{className:"size-4 text-muted-foreground"})}),(0,n.jsx)("span",{className:"text-sm font-medium",children:ef.REACH_LABEL[e]}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:(0,n.jsx)(ev,{status:t,tokensIn:s,tokens:ef.REACH_KEYS[e].length})}),(0,n.jsx)(l.ChevronRight,{className:(0,eu.cn)("size-4 shrink-0 text-muted-foreground transition-transform",i&&"rotate-90")})]}),i&&(0,n.jsxs)("div",{className:"px-4 pt-1 pb-4",children:[(0,n.jsx)("ol",{className:"space-y-3",children:f.map((e,s)=>(0,n.jsx)(ej,{n:s+1,step:e,state:x[s],set:!!e.slot&&"key"in e.slot&&r(e.slot.key),refused:e.slot&&"key"in e.slot&&e.slot.key===g?t?.problem??"":null,link:t?.link??null,waiting:p&&s===f.length-1},s))}),t?.allowed&&(0,n.jsx)(ez,{name:e,who:t.allowed.name,stopped:!!g})]})]})}function ev({status:e,tokensIn:t,tokens:s}){let r="text-xs";return t<s?(0,n.jsx)("span",{className:(0,eu.cn)(r,"text-muted-foreground"),children:t?`${t} of ${s} tokens in`:"Not set"}):e?.refused?(0,n.jsxs)("span",{className:(0,eu.cn)(r,"text-destructive"),children:["Stopped — ",ef.REACH_LABEL[e.name]," turned the token away"]}):e?.problem?(0,n.jsx)(ea.ShinyText,{text:`${e.bot?"Reconnecting":"Connecting"}… ${e.problem}`,className:(0,eu.cn)(r,"align-middle")}):e?.allowed?(0,n.jsxs)("span",{className:(0,eu.cn)(r,"text-muted-foreground"),children:["Listening as ",e.bot,". ",e.allowed.name," is let in."]}):e?.bot?(0,n.jsx)(ea.ShinyText,{text:`Listening as ${e.bot} — waiting for your first message`,tone:"waiting",className:(0,eu.cn)(r,"align-middle")}):(0,n.jsx)(ea.ShinyText,{text:"Connecting…",className:(0,eu.cn)(r,"align-middle")})}function ej({n:e,step:t,state:s,set:r,refused:i,link:o,waiting:a}){return(0,n.jsxs)("li",{className:"flex gap-3 text-[13px] leading-relaxed",children:[(0,n.jsx)(eb,{n:e,state:s}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2.5",children:[(0,n.jsx)("p",{className:(0,eu.cn)("done"===s||"later"===s?"text-muted-foreground/60 **:text-inherit":"text-muted-foreground"),children:t.body}),(0,n.jsx)(ew,{slot:t.slot,state:s,set:r,refused:i,link:o,waiting:a})]})]})}function eb({n:e,state:t}){return"done"===t?(0,n.jsx)("span",{className:"mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-foreground text-background",children:(0,n.jsx)(a.Check,{className:"size-3"})}):(0,n.jsx)("span",{className:(0,eu.cn)("mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-background font-mono text-[10.5px] ring-1","now"===t?(0,eu.cn)(eu.WAITING_INK,"ring-waiting/40"):"text-muted-foreground ring-border/60","later"===t&&"opacity-60"),children:e})}function ew({slot:e,state:t,set:s,refused:r,link:i,waiting:o}){let a=o&&(0,n.jsx)(ea.ShinyText,{text:"Waiting for your first message…",tone:"waiting"});return"later"===t?null:e&&"key"in e?(0,n.jsx)(eC,{configKey:e.key,looks:e.looks,set:s,refused:r}):"done"===t?e&&"says"in e&&i?(0,n.jsx)(eS,{href:i,children:e.does??eA(i)}):null:e?"open"in e?(0,n.jsx)(eS,{href:e.open,children:e.label}):"manifest"in e?(0,n.jsx)(eM,{}):i?(0,n.jsxs)("div",{className:"space-y-2.5",children:[(0,n.jsx)(eN,{link:i,says:e.says,does:e.does}),a]}):a||null:a||null}function eN({link:e,says:t,does:s}){let{size:r,data:i}=function(e){let{ecc:t="L",boostEcc:n=!1,minVersion:s=1,maxVersion:r=40,maskPattern:i=-1,border:o=1}={},a="string"==typeof e?function(e){var t,n;if(""===e)return[];if(t=e,D.test(t))return[function(e){var t;if(t=e,!D.test(t))throw RangeError("String contains non-numeric characters");let n=[];for(let t=0;t<e.length;){let s=Math.min(e.length-t,3);V(Number.parseInt(e.substring(t,t+s),10),3*s+1,n),t+=s}return new X(Z,e.length,n)}(e)];return(n=e,H.test(n))?[function(e){var t;let n;if(t=e,!H.test(t))throw RangeError("String contains unencodable characters in alphanumeric mode");let s=[];for(n=0;n+2<=e.length;n+=2){let t=45*U.indexOf(e.charAt(n));V(t+=U.indexOf(e.charAt(n+1)),11,s)}return n<e.length&&V(U.indexOf(e.charAt(n)),6,s),new X(J,e.length,s)}(e)]:[en(function(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!==e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2);return t}(e))]}(e):Array.isArray(e)?[en(e)]:void 0;if(!a)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=function(e,t,n=1,s=40,r=-1,i=!0){let o,a;if(!(1<=n&&n<=s&&s<=40)||r<-1||r>7)throw RangeError("Invalid value");for(o=n;;o++){let n=8*er(o,t),r=function(e,t){let n=0;for(let s of e){let e=et(s.mode,t);if(s.numChars>=1<<e)return 1/0;n+=4+e+s.bitData.length}return n}(e,o);if(r<=n){a=r;break}if(o>=s)throw RangeError("Data too long")}for(let e of[B,O,L])i&&a<=8*er(o,e)&&(t=e);let l=[];for(let t of e)for(let e of(V(t.mode[0],4,l),V(t.numChars,et(t.mode,o),l),t.getData()))l.push(e);let d=8*er(o,t);V(0,Math.min(4,d-l.length),l),V(0,(8-l.length%8)%8,l);for(let e=236;l.length<d;e^=253)V(e,8,l);let c=Array.from({length:Math.ceil(l.length/8)},()=>0);return l.forEach((e,t)=>c[t>>>3]|=e<<7-(7&t)),new W(o,t,c,r)}(a,q[t],s,r,i,n);return function(e,t=1){if(!t)return e;let{size:n}=e,s=n+2*t;e.size=s,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:s},e=>!1)),e.data.push(Array.from({length:s},e=>!1));let r=$.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(r),e.push(r)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:s},e=>r)),e.types.push(Array.from({length:s},e=>r));return e}({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},o)}(e),o=eA(e);return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,n.jsx)("div",{className:"rounded-lg bg-white p-2.5",children:(0,n.jsx)("svg",{viewBox:`0 0 ${r} ${r}`,className:"block size-31 text-black",role:"img","aria-label":`A picture of ${o} for a phone camera`,children:i.flatMap((e,t)=>e.map((e,s)=>e?(0,n.jsx)("rect",{x:s,y:t,width:1,height:1,fill:"currentColor"},`${s}-${t}`):null))})}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-muted-foreground",children:t}),(0,n.jsx)(eS,{href:e,children:s??o})]})]})}let eA=e=>e.replace(/^https:\/\//,"");function eS({href:e,children:t}){return(0,n.jsxs)("a",{href:e,target:"_blank",rel:"noreferrer",className:(0,eu.cn)((0,k.buttonVariants)({variant:"outline",size:"sm"})),children:[(0,n.jsx)(_.ExternalLink,{}),t]})}function eC({configKey:e,looks:t,set:s,refused:r}){let[i,o]=(0,p.useState)(""),[a,l]=(0,p.useState)(!1),d=()=>{o(""),l(!1),(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.reach)},[c,u]=(0,ed.useServerAction)(P.setConfigAction,{onOk:d}),[h,f]=(0,ed.useServerAction)(F,{onOk:d}),m=async()=>{await j.notify.confirm({title:"Remove this token?",description:"That service stops, and whoever is let in is let go.",okText:"Remove",destructive:!0})&&h(e)};return s&&!a&&null===r?(0,n.jsx)(k.Button,{size:"xs",variant:"ghost",onClick:()=>l(!0),className:"-ml-2 text-muted-foreground",children:"Change the token"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("form",{className:"flex flex-wrap items-center gap-2",onSubmit:t=>{t.preventDefault(),c(e,i)},children:[(0,n.jsx)(v.Input,{value:i,onChange:e=>o(e.target.value),placeholder:t,"aria-label":"Token",type:"password",autoComplete:"off",spellCheck:!1,className:"w-72 font-mono"}),(0,n.jsx)(k.Button,{type:"submit",size:"sm",loading:u,disabled:i.trim().length<A.KEY_MIN,children:s?"Replace":"Save"}),s&&(0,n.jsxs)(n.Fragment,{children:[null===r&&(0,n.jsx)(k.Button,{size:"sm",variant:"ghost",onClick:()=>l(!1),children:"Cancel"}),(0,n.jsx)(k.Button,{size:"sm",variant:"ghost",loading:f,onClick:()=>void m(),className:"ml-auto text-destructive hover:text-destructive",children:"Remove"})]})]}),r&&(0,n.jsx)("p",{className:"max-w-xl text-destructive",children:r})]})}function eM(){let[e,t]=(0,p.useState)(!1);return(0,n.jsxs)(k.Button,{size:"sm",variant:"outline",onClick:()=>void navigator.clipboard.writeText(eg).then(()=>{t(!0),setTimeout(()=>t(!1),2e3)}),children:[e?(0,n.jsx)(a.Check,{}):(0,n.jsx)(K.Copy,{}),e?"Copied":"Copy the manifest"]})}function ez({name:e,who:t,stopped:s}){let[r,i]=(0,ed.useServerAction)(eh,{onOk:()=>(0,ec.revalidate)(y.queryKey.reach)});return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-3 pl-8 text-[13px] text-muted-foreground",children:[(0,n.jsx)("span",{children:s?`${t} is let in.`:`${t} can write from a phone.`}),(0,n.jsx)(k.Button,{size:"sm",variant:"outline",loading:i,onClick:async()=>{await j.notify.confirm({title:`Let ${t} go?`,description:"Nobody can write to Thursday through this service until someone is let in again.",okText:"Let them go",destructive:!0})&&r(e)},children:"Let them go"})]})}let eE={[T.EXA_API_KEY]:g.Search},eR={image:f.Image,video:u,speech:i.AudioLines,transcription:o.Captions},eI={keys:["voice","easy","text","search"],models:["bots","studio"]};function eF({screen:e}){let{data:t,isLoading:s,error:r}=(0,ec.useServerRoute)(y.queryKey.config);if(s)return(0,n.jsx)(el.SettingSkeleton,{rows:4});if(r)return(0,n.jsx)(el.SettingError,{message:r.message});let i=e=>(0,T.isConfigSet)(t,e),o=e=>t?.find(t=>t.key===e)?.value,a=eI[e].flatMap(e=>T.CONFIG_GROUPS.find(t=>t.id===e)??[]),l=a.filter(e=>"keys"===e.section).flatMap(e=>e.entries);return(0,n.jsx)(el.SettingScreen,{footer:(0,n.jsx)(el.SettingRailNote,{children:"models"===e?"Her own voice and backend models are in Thursday. A bot can pick its own on its page.":`${l.filter(e=>i(e.key)).length} of ${l.length} set${a.some(e=>!(0,T.groupSatisfied)(e,i))?" · a call needs one voice key":" · your keys stay on this machine"}`}),children:a.map(e=>(0,n.jsx)(el.SettingGroup,{label:e.title,hint:e.hint,right:(0,n.jsx)(eT,{group:e,isSet:i}),children:"easy"===e.id?(0,n.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.entries.map(e=>(0,n.jsx)(eK,{card:!0,entry:e,set:i(e.key),needed:!1},e.key))}):"text"===e.id?(0,n.jsx)("div",{className:"flex flex-wrap gap-x-1.5 gap-y-3.5",children:e.entries.map(e=>(0,n.jsx)(eP,{entry:e,set:i(e.key)},e.key))}):(0,n.jsx)(el.SettingItems,{children:e.entries.map(t=>t.effortOf?null:t.choices?(0,n.jsx)(eU,{entry:t,choices:t.choices,value:o(t.key),effort:eG(e,t.key),effortValue:o(T.DEFAULT_EFFORT_KEY)},t.key):(0,n.jsx)(eK,{entry:t,set:i(t.key),needed:!(0,T.groupSatisfied)(e,i)},t.key))})},e.id))})}function eP({entry:e,set:t}){return(0,n.jsxs)("button",{type:"button",onClick:()=>eW(e,t),"aria-label":`${e.label}: ${t?"set":"not set"}`,className:"group flex w-17 flex-col items-center gap-1.5 rounded-xl py-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsxs)("span",{className:"relative grid size-10.5 place-items-center rounded-[13px] bg-muted/60 transition-colors group-hover:bg-muted",children:[(0,n.jsx)(eH,{entry:e}),t&&(0,n.jsx)("span",{className:"absolute -top-1 -right-1 grid size-4 place-items-center rounded-full bg-primary text-primary-foreground ring-2 ring-background",children:(0,n.jsx)(a.Check,{className:"size-2.5"})})]}),(0,n.jsx)("span",{className:(0,eu.cn)("max-w-full truncate text-[11px]",t?"text-foreground":"text-muted-foreground"),children:e.label})]})}function eT({group:e,isSet:t}){return"none"===e.require?null:(0,T.groupSatisfied)(e,t)?(0,n.jsxs)("span",{className:"flex items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,n.jsx)(a.Check,{className:"size-3"}),"ready"]}):(0,n.jsxs)("span",{className:(0,eu.cn)("flex items-center gap-1 font-mono text-[11px]",eu.WAITING_INK),children:[(0,n.jsx)(x.TriangleAlert,{className:"size-3"}),e.note??"Required"]})}function eK({entry:e,set:t,needed:s,card:r=!1,narrow:i=!1}){let o=eB(e,t),d=eL(e,t),c=eO(e,t),u=d.data?eq(d.data):e$(t,s,o.data,e.signIn),h=o.isLoading||d.isLoading,f=(0,n.jsxs)("span",{className:(0,eu.cn)("flex shrink-0 items-center gap-1.5 font-mono text-xs",u.ink),children:[u.warn?(0,n.jsx)(x.TriangleAlert,{className:"size-3"}):t&&(0,n.jsx)(a.Check,{className:"size-3"}),u.text]});return(0,n.jsxs)("button",{type:"button",onClick:()=>{var s;return e.signIn?(s=e,j.notify.component({className:"sm:max-w-md",renderer:({close:e})=>(0,n.jsx)(eY,{entry:s,onDone:e})})):eW(e,t)},className:(0,eu.cn)("group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",r&&"rounded-xl border border-border/60"),children:[(0,n.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,n.jsx)(eH,{entry:e})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,n.jsxs)("span",{className:"flex items-center gap-2 truncate text-sm font-medium",children:[e.label,e.recommended&&(0,n.jsx)("span",{className:"rounded-full px-1.5 font-mono text-[9.5px] leading-4 font-normal text-muted-foreground ring-1 ring-border ring-inset",children:"recommended"})]}),i?h?(0,n.jsx)(N.Skeleton,{className:"h-3 w-20"}):f:(0,n.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:e.signIn?t?eD(d.data,c):"sign in with your account":e.key})]}),i?null:h?(0,n.jsx)(N.Skeleton,{className:"h-3 w-20 shrink-0"}):f,(0,n.jsx)(l.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}let e_=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function e$(e,t,n,s){return e?n?"refused"in n?{text:"Key refused",ink:"text-destructive",warn:!0}:{text:`${e_.format(n.balance)} left`,ink:n.low?eu.WAITING_INK:"text-muted-foreground",warn:n.low}:{text:s?"Signed in":"Set",ink:"text-muted-foreground",warn:!1}:t?{text:"Needed",ink:eu.WAITING_INK,warn:!0}:{text:s?"Signed out":"Not set",ink:"text-muted-foreground/60",warn:!1}}function eB(e,t){return(0,ec.useServerRoute)(t&&"vercel-ai-gateway"===e.provider?y.queryKey.gatewayCredits:null)}function eO(e,t){let{data:n}=(0,ec.useServerRoute)(t&&e.signIn?y.queryKey.llmModel:null);return n?.find(t=>t.id===e.provider)?.plan??null}function eL(e,t){return(0,ec.useServerRoute)(t&&e.signIn?y.queryKey.subscriptionUsage:null)}function eq(e){return"refused"in e?{text:"Sign-in refused",ink:"text-destructive",warn:!0}:{text:e.spent?"Limit reached":`${e.usedPercent}% used`,ink:e.high?eu.WAITING_INK:"text-muted-foreground",warn:e.high}}function eD(e,t){let n=!e||"refused"in e?null:e,r=`${n?.plan??t??"unknown"} plan`;return n?.resetsAt?`${r} \xb7 resets in ${(0,s.formatDistanceToNowStrict)(new Date(n.resetsAt))}`:r}function eH({entry:e}){if(e.provider)return(0,n.jsx)(z.ProviderIcon,{provider:e.provider,className:"size-4"});let t=eE[e.key]??m.KeyRound,s=(0,n.jsx)(t,{className:"size-4 text-muted-foreground"});return e.site?(0,n.jsx)(w.SiteIcon,{host:e.site,className:"size-4 rounded-[4px]",fallback:s}):s}function eU({entry:e,choices:t,value:s,effort:r,effortValue:i}){let o=e.text?(0,E.parseTextModel)(s):(0,E.parseMediaModel)(s),{data:a}=(0,ec.useServerRoute)(e.text&&!s&&y.queryKey.automaticModel),l=e.kind?eR[e.kind]:R.BotsMark,[d]=(0,ed.useServerAction)(P.setConfigAction,{onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.automaticModel)}}),[c]=(0,ed.useServerAction)(F,{onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.automaticModel)}});return(0,n.jsxs)("div",{className:"flex w-full items-start gap-3 p-4",children:[(0,n.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,n.jsx)(l,{className:"size-4 text-muted-foreground"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 pt-1.5",children:[(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),!s&&(0,n.jsx)("span",{className:(0,eu.cn)("shrink-0 rounded-[5px] border border-border/60 px-1 font-mono text-[10px]",e.kind?eu.WAITING_INK:"text-muted-foreground"),children:e.kind?"off":"auto"})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)("div",{className:"min-w-0",children:(0,n.jsx)(M.ModelPicker,{kind:e.kind,provider:o?.provider??null,model:o?.model??"",unset:e.kind?"Not offered to bots until you pick one":function(e,t){if(!e)return"Automatic";if(!e.ref)return e.problem;let{provider:n,model:s}=e.ref,r=t.find(e=>e.value===`${n}/${s}`);return`Automatic \xb7 ${r?.label??s}`}(a,t),onChange:t=>d(e.key,`${t.provider}/${t.model.trim()}`),onUnset:s?()=>{c(e.key),r&&i&&c(r.key)}:void 0})}),r&&o&&(0,n.jsxs)("div",{className:"flex items-start gap-3 pt-0.5",children:[(0,n.jsx)("span",{className:"w-12 shrink-0 pt-1.5 font-mono text-[11px] text-muted-foreground",children:"effort"}),(0,n.jsx)(C.EffortSwitch,{provider:o.provider,model:o.model,value:E.effortSchema.safeParse(i).data??null,onChange:e=>e?d(r.key,e):c(r.key)})]})]})]})]})}let eG=(e,t)=>e.entries.find(e=>e.effortOf===t);function eY({entry:e,onDone:t}){let{data:s}=(0,ec.useServerRoute)(y.queryKey.config),r=(0,T.isConfigSet)(s,e.key),i=eO(e,r),o=eL(e,r),a=o.data?eq(o.data):null,[l,d]=(0,ed.useServerAction)(F,{okMessage:`Signed out of ${e.label}`,onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.llmModel),t()}});return(0,n.jsx)(el.SettingDialogContent,{title:e.label,description:r?(0,n.jsxs)(n.Fragment,{children:["Signed in ·"," ",(0,n.jsx)("span",{className:"font-mono",children:eD(o.data,i)}),a&&(0,n.jsxs)(n.Fragment,{children:[" · ",(0,n.jsx)("span",{className:(0,eu.cn)("font-mono",a.ink),children:a.text})]})]}):"Sign in with your ChatGPT account instead of a key",footer:(0,n.jsxs)(n.Fragment,{children:[r&&(0,n.jsx)(k.Button,{variant:"ghost",loading:d,onClick:async()=>{await j.notify.confirm({title:`Sign out of ${e.label}?`,description:"Nothing runs on your plan until you sign in again.",okText:"Sign out",destructive:!0})&&l(e.key)},children:"Sign out"}),(0,n.jsx)(k.Button,{variant:"ghost",onClick:t,children:r?"Close":"Cancel"}),!r&&(0,n.jsx)(S.ChatGptSignIn,{})]}),children:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(el.SettingNote,{children:r?"Bots on this subscription spend your plan's usage, not a key. When it runs out, the job stops and says when it resets.":"The sign-in opens in its own window. Approve it there, and this turns to signed in by itself."}),o.data&&"refused"in o.data&&(0,n.jsx)(el.SettingNote,{className:"wrap-break-word text-destructive",children:o.data.refused})]})})}function eW(e,t){return j.notify.component({className:"sm:max-w-md",renderer:({close:s})=>(0,n.jsx)(eV,{entry:e,set:t,onDone:s})})}function eV({entry:e,set:t,onDone:s}){let[i,o]=(0,p.useState)(""),{data:a}=eB(e,t),l=a?e$(t,!1,a):null,d=()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.llmModel)},[c,u]=(0,ed.useServerAction)(P.setConfigAction,{okMessage:`${e.label} key saved`,onOk:()=>{d(),s()}}),[h,f]=(0,ed.useServerAction)(F,{okMessage:`${e.label} key removed`,onOk:()=>{d(),s()}}),m=async()=>{await j.notify.confirm({title:`Remove the ${e.label} key?`,description:"It is deleted from this computer, and nothing runs on it until a key is pasted again.",okText:"Remove",destructive:!0})&&h(e.key)};return(0,n.jsx)(el.SettingDialogContent,{title:e.label,description:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"font-mono",children:e.key}),e.hint&&(0,n.jsxs)(n.Fragment,{children:[" · ",e.hint]}),l&&(0,n.jsxs)(n.Fragment,{children:[" · ",(0,n.jsx)("span",{className:(0,eu.cn)("font-mono",l.ink),children:l.text})]})]}),footer:(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(k.Button,{variant:"ghost",loading:f,onClick:()=>void m(),className:"mr-auto text-destructive hover:text-destructive",children:"Remove"}),(0,n.jsx)(k.Button,{variant:"ghost",onClick:s,children:"Cancel"}),(0,n.jsx)(k.Button,{loading:u,disabled:i.trim().length<A.KEY_MIN,onClick:()=>c(e.key,i),children:t?"Replace":"Save"})]}),children:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(v.Input,{value:i,onChange:e=>o(e.target.value),onKeyDown:t=>{"Enter"===t.key&&i.trim().length>=A.KEY_MIN&&c(e.key,i)},placeholder:t?"New value — replaces the current key":e.keyLooks??"Paste the key",spellCheck:!1,type:"password",autoFocus:!0}),!t&&e.keysAt&&(0,n.jsxs)("a",{href:e.keysAt,target:"_blank",rel:"noreferrer",className:"flex w-fit items-center gap-1 px-0.5 text-[13px] text-foreground underline underline-offset-3 hover:text-foreground/80",children:["Get a key at ",new URL(e.keysAt).host,(0,n.jsx)(r.ArrowUpRight,{className:"size-3.5"})]}),a&&"refused"in a&&(0,n.jsx)(el.SettingNote,{className:"wrap-break-word text-destructive",children:a.refused})]})})}e.s(["AccountsSetup",0,function({withoutVoice:e=!1}){let{data:t}=(0,ec.useServerRoute)(y.queryKey.config),s=e=>(0,T.isConfigSet)(t,e),r=e=>T.CONFIG_GROUPS.find(t=>t.id===e)?.entries??[],[i,o]=(0,p.useState)(!1),a=r("voice"),l=[...a,...r("text")],d=l.filter((t,n)=>(n<4||s(t.key))&&!(e&&a.includes(t))),c=l.filter(t=>!d.includes(t)&&!(e&&a.includes(t)));return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsx)("div",{className:"flex flex-col gap-2",children:r("easy").map(e=>(0,n.jsx)(eK,{card:!0,narrow:!0,entry:e,set:s(e.key),needed:!1},e.key))}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-y-2.5",children:[d.map(e=>(0,n.jsx)(eP,{entry:e,set:s(e.key)},e.key)),c.length>0&&(0,n.jsxs)(b.Popover,{open:i,onOpenChange:o,children:[(0,n.jsxs)(b.PopoverTrigger,{"aria-label":`${c.length} more providers`,className:"group flex w-17 flex-col items-center gap-1.5 rounded-xl py-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsx)("span",{className:"grid size-10.5 place-items-center rounded-[13px] bg-muted/60 text-muted-foreground transition-colors group-hover:bg-muted",children:(0,n.jsx)(h.default,{className:"size-4"})}),(0,n.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"More"})]}),(0,n.jsx)(b.PopoverContent,{align:"end",className:"w-78 flex-row flex-wrap gap-0 gap-y-2.5 rounded-2xl p-2.5",onClick:()=>o(!1),children:c.map(e=>(0,n.jsx)(eP,{entry:e,set:s(e.key)},e.key))})]})]}),r("search").map(e=>(0,n.jsx)(eK,{card:!0,narrow:!0,entry:e,set:s(e.key),needed:!1},e.key))]})},"KeysSetting",0,()=>(0,n.jsx)(eF,{screen:"keys"}),"ModelsSetting",0,()=>(0,n.jsx)(eF,{screen:"models"}),"PhoneSetting",0,()=>(0,n.jsx)(el.SettingScreen,{footer:(0,n.jsx)(el.SettingRailNote,{children:"Nothing on this computer is opened to the internet: the app asks the chat service what was written."}),children:(0,n.jsx)(ey,{})})],805995)}]);
|
|
18
|
+
`,ex=({children:e})=>(0,n.jsx)("span",{className:"font-medium text-foreground",children:e}),ep={telegram:[{body:(0,n.jsxs)(n.Fragment,{children:["In Telegram, write to ",(0,n.jsx)(ex,{children:"@BotFather"}),", send ",(0,n.jsx)(ex,{children:"/newbot"})," and pick a name. It answers with a ",(0,n.jsx)(ex,{children:"token"}),"."]}),slot:{open:"https://t.me/BotFather",label:"Open @BotFather"}},{body:(0,n.jsx)(n.Fragment,{children:"Paste the token here."}),slot:{key:ef.TELEGRAM_TOKEN_KEY,looks:"123456789:AAE…"}},{body:(0,n.jsx)(n.Fragment,{children:"From your phone, write anything to your bot."}),slot:{says:"Point your phone's camera at it to open the chat."}},{body:(0,n.jsxs)(n.Fragment,{children:["A question with a code appears on this computer. Press ",(0,n.jsx)(ex,{children:"Allow"})," if your phone shows the same code."]})}],discord:[{body:(0,n.jsxs)(n.Fragment,{children:["At ",(0,n.jsx)(ex,{children:"discord.com/developers"}),", make a ",(0,n.jsx)(ex,{children:"New Application"}),". So nobody else can add it to a server, set ",(0,n.jsx)(ex,{children:"Install Link"})," to"," ",(0,n.jsx)(ex,{children:"None"})," on its ",(0,n.jsx)(ex,{children:"Installation"})," page and turn off"," ",(0,n.jsx)(ex,{children:"Public Bot"})," on its ",(0,n.jsx)(ex,{children:"Bot"})," page. There, press"," ",(0,n.jsx)(ex,{children:"Reset Token"})," and copy it."]}),slot:{open:"https://discord.com/developers/applications",label:"Open discord.com/developers"}},{body:(0,n.jsx)(n.Fragment,{children:"Paste the token here."}),slot:{key:ef.DISCORD_TOKEN_KEY,looks:"MTE…"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Add the bot to a server of your own"})," — Discord only delivers a message to a bot you share a server with. A private server made for this is fine."]}),slot:{says:"Point your phone's camera at it, or open it here. It asks which server, and adds the bot with no permissions in it.",does:"Add the bot to a server"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Send the bot a direct message"}),", not in the server: on a phone, tap the bot in the server's member list, then ",(0,n.jsx)(ex,{children:"Message"}),". A question with a code appears here: press ",(0,n.jsx)(ex,{children:"Allow"})," if your phone shows the same code."]})}],slack:[{body:(0,n.jsxs)(n.Fragment,{children:["At ",(0,n.jsx)(({href:e,children:t})=>(0,n.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"font-medium text-foreground underline underline-offset-4 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:t}),{href:"https://api.slack.com/apps",children:"api.slack.com/apps"}),","," ",(0,n.jsx)(ex,{children:"Create New App › From a manifest"}),", and paste the manifest."]}),slot:{manifest:!0}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Basic Information › App-Level Tokens"}),": generate one with"," ",(0,n.jsx)(ex,{children:"connections:write"}),". It starts with xapp-."]}),slot:{key:ef.SLACK_APP_TOKEN_KEY,looks:"xapp-…"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Install App"})," to your workspace. The Bot User OAuth Token starts with xoxb-."]}),slot:{key:ef.SLACK_BOT_TOKEN_KEY,looks:"xoxb-…"}},{body:(0,n.jsxs)(n.Fragment,{children:["In Slack, open the app under ",(0,n.jsx)(ex,{children:"Apps"})," and write in its"," ",(0,n.jsx)(ex,{children:"Messages"})," tab. A question with a code appears here: press"," ",(0,n.jsx)(ex,{children:"Allow"})," if Slack shows the same code."]})}]};function ey(){let e=(0,ec.useServerRoute)(y.queryKey.config),t=(0,ec.useServerRoute)(y.queryKey.reach);(0,eo.useAppEvent)({reach:()=>void(0,ec.revalidate)(y.queryKey.reach)});let s=t=>(0,T.isConfigSet)(e.data,t),r=e=>t.data?.channels.find(t=>t.name===e)??null,i=e=>!!r(e)?.allowed,o=ef.REACH_CHANNELS.find(e=>r(e)?.refused),a=ef.REACH_CHANNELS.find(e=>ef.REACH_KEYS[e].every(s)&&!i(e)),l=!ef.REACH_CHANNELS.some(i),[d,c]=(0,p.useState)(o??a??(l?ef.REACH_CHANNELS[0]:null));return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(el.SettingItems,{children:ef.REACH_CHANNELS.map(e=>(0,n.jsx)(ek,{name:e,status:r(e),tokensIn:ef.REACH_KEYS[e].filter(s).length,isSet:s,open:d===e,onOpen:()=>c(d===e?null:e)},e))}),(0,n.jsx)(el.SettingNote,{children:"Only the one person you allow can write, and only direct messages are read. Work started here runs whether or not a tab is open, while Thursday is running on this computer."})]})}function ek({name:e,status:t,tokensIn:s,isSet:r,open:i,onOpen:o}){var a;let d,c,u,h,f=ep[e],g=t?.refused??null,x=(a={connected:!!t?.bot,allowed:!!t?.allowed,refused:g},d=f.map(e=>e.slot&&"key"in e.slot?e.slot.key:null),c=e=>!r(e)||e===a.refused,u=d.findIndex(e=>e&&c(e)),h=d.reduce((e,t,n)=>t?n:e,-1),f.map((e,t)=>{let n=d[t];return n?c(n)?t===u?"now":"later":"done":u>=0?t<u?a.refused?"done":"flat":"later":a.allowed||t<h?"done":a.connected?"now":"flat"})),p=!!t?.bot&&!t?.allowed&&!g;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{type:"button",onClick:o,"aria-expanded":i,className:"flex w-full items-center gap-3 px-4 py-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsx)(w.SiteIcon,{host:em[e],className:"size-4 rounded-[4px]",fallback:(0,n.jsx)(m.KeyRound,{className:"size-4 text-muted-foreground"})}),(0,n.jsx)("span",{className:"text-sm font-medium",children:ef.REACH_LABEL[e]}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:(0,n.jsx)(ev,{status:t,tokensIn:s,tokens:ef.REACH_KEYS[e].length})}),(0,n.jsx)(l.ChevronRight,{className:(0,eu.cn)("size-4 shrink-0 text-muted-foreground transition-transform",i&&"rotate-90")})]}),i&&(0,n.jsxs)("div",{className:"px-4 pt-1 pb-4",children:[(0,n.jsx)("ol",{className:"space-y-3",children:f.map((e,s)=>(0,n.jsx)(ej,{n:s+1,step:e,state:x[s],set:!!e.slot&&"key"in e.slot&&r(e.slot.key),refused:e.slot&&"key"in e.slot&&e.slot.key===g?t?.problem??"":null,link:t?.link??null,waiting:p&&s===f.length-1},s))}),t?.allowed&&(0,n.jsx)(ez,{name:e,who:t.allowed.name,stopped:!!g})]})]})}function ev({status:e,tokensIn:t,tokens:s}){let r="text-xs";return t<s?(0,n.jsx)("span",{className:(0,eu.cn)(r,"text-muted-foreground"),children:t?`${t} of ${s} tokens in`:"Not set"}):e?.refused?(0,n.jsxs)("span",{className:(0,eu.cn)(r,"text-destructive"),children:["Stopped — ",ef.REACH_LABEL[e.name]," turned the token away"]}):e?.problem?(0,n.jsx)(ea.ShinyText,{text:`${e.bot?"Reconnecting":"Connecting"}… ${e.problem}`,className:(0,eu.cn)(r,"align-middle")}):e?.allowed?(0,n.jsxs)("span",{className:(0,eu.cn)(r,"text-muted-foreground"),children:["Listening as ",e.bot,". ",e.allowed.name," is let in."]}):e?.bot?(0,n.jsx)(ea.ShinyText,{text:`Listening as ${e.bot} — waiting for your first message`,tone:"waiting",className:(0,eu.cn)(r,"align-middle")}):(0,n.jsx)(ea.ShinyText,{text:"Connecting…",className:(0,eu.cn)(r,"align-middle")})}function ej({n:e,step:t,state:s,set:r,refused:i,link:o,waiting:a}){return(0,n.jsxs)("li",{className:"flex gap-3 text-[13px] leading-relaxed",children:[(0,n.jsx)(eb,{n:e,state:s}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2.5",children:[(0,n.jsx)("p",{className:(0,eu.cn)("done"===s||"later"===s?"text-muted-foreground/60 **:text-inherit":"text-muted-foreground"),children:t.body}),(0,n.jsx)(ew,{slot:t.slot,state:s,set:r,refused:i,link:o,waiting:a})]})]})}function eb({n:e,state:t}){return"done"===t?(0,n.jsx)("span",{className:"mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-foreground text-background",children:(0,n.jsx)(a.Check,{className:"size-3"})}):(0,n.jsx)("span",{className:(0,eu.cn)("mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-background font-mono text-[10.5px] ring-1","now"===t?(0,eu.cn)(eu.WAITING_INK,"ring-waiting/40"):"text-muted-foreground ring-border/60","later"===t&&"opacity-60"),children:e})}function ew({slot:e,state:t,set:s,refused:r,link:i,waiting:o}){let a=o&&(0,n.jsx)(ea.ShinyText,{text:"Waiting for your first message…",tone:"waiting"});return"later"===t?null:e&&"key"in e?(0,n.jsx)(eC,{configKey:e.key,looks:e.looks,set:s,refused:r}):"done"===t?e&&"says"in e&&i?(0,n.jsx)(eS,{href:i,children:e.does??eA(i)}):null:e?"open"in e?(0,n.jsx)(eS,{href:e.open,children:e.label}):"manifest"in e?(0,n.jsx)(eM,{}):i?(0,n.jsxs)("div",{className:"space-y-2.5",children:[(0,n.jsx)(eN,{link:i,says:e.says,does:e.does}),a]}):a||null:a||null}function eN({link:e,says:t,does:s}){let{size:r,data:i}=function(e){let{ecc:t="L",boostEcc:n=!1,minVersion:s=1,maxVersion:r=40,maskPattern:i=-1,border:o=1}={},a="string"==typeof e?function(e){var t,n;if(""===e)return[];if(t=e,D.test(t))return[function(e){var t;if(t=e,!D.test(t))throw RangeError("String contains non-numeric characters");let n=[];for(let t=0;t<e.length;){let s=Math.min(e.length-t,3);V(Number.parseInt(e.substring(t,t+s),10),3*s+1,n),t+=s}return new X(Z,e.length,n)}(e)];return(n=e,H.test(n))?[function(e){var t;let n;if(t=e,!H.test(t))throw RangeError("String contains unencodable characters in alphanumeric mode");let s=[];for(n=0;n+2<=e.length;n+=2){let t=45*U.indexOf(e.charAt(n));V(t+=U.indexOf(e.charAt(n+1)),11,s)}return n<e.length&&V(U.indexOf(e.charAt(n)),6,s),new X(J,e.length,s)}(e)]:[en(function(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!==e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2);return t}(e))]}(e):Array.isArray(e)?[en(e)]:void 0;if(!a)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=function(e,t,n=1,s=40,r=-1,i=!0){let o,a;if(!(1<=n&&n<=s&&s<=40)||r<-1||r>7)throw RangeError("Invalid value");for(o=n;;o++){let n=8*er(o,t),r=function(e,t){let n=0;for(let s of e){let e=et(s.mode,t);if(s.numChars>=1<<e)return 1/0;n+=4+e+s.bitData.length}return n}(e,o);if(r<=n){a=r;break}if(o>=s)throw RangeError("Data too long")}for(let e of[B,O,L])i&&a<=8*er(o,e)&&(t=e);let l=[];for(let t of e)for(let e of(V(t.mode[0],4,l),V(t.numChars,et(t.mode,o),l),t.getData()))l.push(e);let d=8*er(o,t);V(0,Math.min(4,d-l.length),l),V(0,(8-l.length%8)%8,l);for(let e=236;l.length<d;e^=253)V(e,8,l);let c=Array.from({length:Math.ceil(l.length/8)},()=>0);return l.forEach((e,t)=>c[t>>>3]|=e<<7-(7&t)),new W(o,t,c,r)}(a,q[t],s,r,i,n);return function(e,t=1){if(!t)return e;let{size:n}=e,s=n+2*t;e.size=s,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:s},e=>!1)),e.data.push(Array.from({length:s},e=>!1));let r=$.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(r),e.push(r)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:s},e=>r)),e.types.push(Array.from({length:s},e=>r));return e}({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},o)}(e),o=eA(e);return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,n.jsx)("div",{className:"rounded-lg bg-white p-2.5",children:(0,n.jsx)("svg",{viewBox:`0 0 ${r} ${r}`,className:"block size-31 text-black",role:"img","aria-label":`A picture of ${o} for a phone camera`,children:i.flatMap((e,t)=>e.map((e,s)=>e?(0,n.jsx)("rect",{x:s,y:t,width:1,height:1,fill:"currentColor"},`${s}-${t}`):null))})}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-muted-foreground",children:t}),(0,n.jsx)(eS,{href:e,children:s??o})]})]})}let eA=e=>e.replace(/^https:\/\//,"");function eS({href:e,children:t}){return(0,n.jsxs)("a",{href:e,target:"_blank",rel:"noreferrer",className:(0,eu.cn)((0,k.buttonVariants)({variant:"outline",size:"sm"})),children:[(0,n.jsx)(_.ExternalLink,{}),t]})}function eC({configKey:e,looks:t,set:s,refused:r}){let[i,o]=(0,p.useState)(""),[a,l]=(0,p.useState)(!1),d=()=>{o(""),l(!1),(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.reach)},[c,u]=(0,ed.useServerAction)(P.setConfigAction,{onOk:d}),[h,f]=(0,ed.useServerAction)(F,{onOk:d}),m=async()=>{await j.notify.confirm({title:"Remove this token?",description:"That service stops, and whoever is let in is let go.",okText:"Remove",destructive:!0})&&h(e)};return s&&!a&&null===r?(0,n.jsx)(k.Button,{size:"xs",variant:"ghost",onClick:()=>l(!0),className:"-ml-2 text-muted-foreground",children:"Change the token"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("form",{className:"flex flex-wrap items-center gap-2",onSubmit:t=>{t.preventDefault(),c(e,i)},children:[(0,n.jsx)(v.Input,{value:i,onChange:e=>o(e.target.value),placeholder:t,"aria-label":"Token",type:"password",autoComplete:"off",spellCheck:!1,className:"w-72 font-mono"}),(0,n.jsx)(k.Button,{type:"submit",size:"sm",loading:u,disabled:i.trim().length<A.KEY_MIN,children:s?"Replace":"Save"}),s&&(0,n.jsxs)(n.Fragment,{children:[null===r&&(0,n.jsx)(k.Button,{size:"sm",variant:"ghost",onClick:()=>l(!1),children:"Cancel"}),(0,n.jsx)(k.Button,{size:"sm",variant:"ghost",loading:f,onClick:()=>void m(),className:"ml-auto text-destructive hover:text-destructive",children:"Remove"})]})]}),r&&(0,n.jsx)("p",{className:"max-w-xl text-destructive",children:r})]})}function eM(){let[e,t]=(0,p.useState)(!1);return(0,n.jsxs)(k.Button,{size:"sm",variant:"outline",onClick:()=>void navigator.clipboard.writeText(eg).then(()=>{t(!0),setTimeout(()=>t(!1),2e3)}),children:[e?(0,n.jsx)(a.Check,{}):(0,n.jsx)(K.Copy,{}),e?"Copied":"Copy the manifest"]})}function ez({name:e,who:t,stopped:s}){let[r,i]=(0,ed.useServerAction)(eh,{onOk:()=>(0,ec.revalidate)(y.queryKey.reach)});return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-3 pl-8 text-[13px] text-muted-foreground",children:[(0,n.jsx)("span",{children:s?`${t} is let in.`:`${t} can write from a phone.`}),(0,n.jsx)(k.Button,{size:"sm",variant:"outline",loading:i,onClick:async()=>{await j.notify.confirm({title:`Let ${t} go?`,description:"Nobody can write to Thursday through this service until someone is let in again.",okText:"Let them go",destructive:!0})&&r(e)},children:"Let them go"})]})}let eE={[T.EXA_API_KEY]:g.Search},eR={image:f.Image,video:u,speech:i.AudioLines,transcription:o.Captions},eI={keys:["voice","easy","text","search"],models:["bots","studio"]};function eF({screen:e}){let{data:t,isLoading:s,error:r}=(0,ec.useServerRoute)(y.queryKey.config);if(s)return(0,n.jsx)(el.SettingSkeleton,{rows:4});if(r)return(0,n.jsx)(el.SettingError,{message:r.message});let i=e=>(0,T.isConfigSet)(t,e),o=e=>t?.find(t=>t.key===e)?.value,a=eI[e].flatMap(e=>T.CONFIG_GROUPS.find(t=>t.id===e)??[]),l=a.filter(e=>"keys"===e.section).flatMap(e=>e.entries);return(0,n.jsx)(el.SettingScreen,{footer:(0,n.jsx)(el.SettingRailNote,{children:"models"===e?"Her own voice and backend models are in Thursday. A bot can pick its own on its page.":`${l.filter(e=>i(e.key)).length} of ${l.length} set${a.some(e=>!(0,T.groupSatisfied)(e,i))?" · a call needs one voice key":" · your keys stay on this machine"}`}),children:a.map(e=>(0,n.jsx)(el.SettingGroup,{label:e.title,hint:e.hint,right:(0,n.jsx)(eT,{group:e,isSet:i}),children:"easy"===e.id?(0,n.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.entries.map(e=>(0,n.jsx)(eK,{card:!0,entry:e,set:i(e.key),needed:!1},e.key))}):"text"===e.id?(0,n.jsx)("div",{className:"flex flex-wrap gap-x-1.5 gap-y-3.5",children:e.entries.map(e=>(0,n.jsx)(eP,{entry:e,set:i(e.key)},e.key))}):(0,n.jsx)(el.SettingItems,{children:e.entries.map(t=>t.effortOf?null:t.choices?(0,n.jsx)(eU,{entry:t,choices:t.choices,value:o(t.key),effort:eG(e,t.key),effortValue:o(T.DEFAULT_EFFORT_KEY)},t.key):(0,n.jsx)(eK,{entry:t,set:i(t.key),needed:!(0,T.groupSatisfied)(e,i)},t.key))})},e.id))})}function eP({entry:e,set:t}){return(0,n.jsxs)("button",{type:"button",onClick:()=>eW(e,t),"aria-label":`${e.label}: ${t?"set":"not set"}`,className:"group flex w-17 flex-col items-center gap-1.5 rounded-xl py-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsxs)("span",{className:"relative grid size-10.5 place-items-center rounded-[13px] bg-muted/60 transition-colors group-hover:bg-muted",children:[(0,n.jsx)(eH,{entry:e}),t&&(0,n.jsx)("span",{className:"absolute -top-1 -right-1 grid size-4 place-items-center rounded-full bg-primary text-primary-foreground ring-2 ring-background",children:(0,n.jsx)(a.Check,{className:"size-2.5"})})]}),(0,n.jsx)("span",{className:(0,eu.cn)("max-w-full truncate text-[11px]",t?"text-foreground":"text-muted-foreground"),children:e.label})]})}function eT({group:e,isSet:t}){return"none"===e.require?null:(0,T.groupSatisfied)(e,t)?(0,n.jsxs)("span",{className:"flex items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,n.jsx)(a.Check,{className:"size-3"}),"ready"]}):(0,n.jsxs)("span",{className:(0,eu.cn)("flex items-center gap-1 font-mono text-[11px]",eu.WAITING_INK),children:[(0,n.jsx)(x.TriangleAlert,{className:"size-3"}),e.note??"Required"]})}function eK({entry:e,set:t,needed:s,card:r=!1,narrow:i=!1}){let o=eB(e,t),d=eL(e,t),c=eO(e,t),u=d.data?eq(d.data):e$(t,s,o.data,e.signIn),h=o.isLoading||d.isLoading,f=(0,n.jsxs)("span",{className:(0,eu.cn)("flex shrink-0 items-center gap-1.5 font-mono text-xs",u.ink),children:[u.warn?(0,n.jsx)(x.TriangleAlert,{className:"size-3"}):t&&(0,n.jsx)(a.Check,{className:"size-3"}),u.text]});return(0,n.jsxs)("button",{type:"button",onClick:()=>{var s;return e.signIn?(s=e,j.notify.component({className:"sm:max-w-md",renderer:({close:e})=>(0,n.jsx)(eY,{entry:s,onDone:e})})):eW(e,t)},className:(0,eu.cn)("group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",r&&"rounded-xl border border-border/60"),children:[(0,n.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,n.jsx)(eH,{entry:e})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,n.jsxs)("span",{className:"flex items-center gap-2 truncate text-sm font-medium",children:[e.label,e.recommended&&(0,n.jsx)("span",{className:"rounded-full px-1.5 font-mono text-[9.5px] leading-4 font-normal text-muted-foreground ring-1 ring-border ring-inset",children:"recommended"})]}),i?h?(0,n.jsx)(N.Skeleton,{className:"h-3 w-20"}):f:(0,n.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:e.signIn?t?eD(d.data,c):"sign in with your account":e.key})]}),i?null:h?(0,n.jsx)(N.Skeleton,{className:"h-3 w-20 shrink-0"}):f,(0,n.jsx)(l.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}let e_=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function e$(e,t,n,s){return e?n?"refused"in n?{text:"Key refused",ink:"text-destructive",warn:!0}:{text:`${e_.format(n.balance)} left`,ink:n.low?eu.WAITING_INK:"text-muted-foreground",warn:n.low}:{text:s?"Signed in":"Set",ink:"text-muted-foreground",warn:!1}:t?{text:"Needed",ink:eu.WAITING_INK,warn:!0}:{text:s?"Signed out":"Not set",ink:"text-muted-foreground/60",warn:!1}}function eB(e,t){return(0,ec.useServerRoute)(t&&(0,E.isCatalogProvider)(e.provider)?y.queryKey.keyCredits(e.provider):null)}function eO(e,t){let{data:n}=(0,ec.useServerRoute)(t&&e.signIn?y.queryKey.llmModel:null);return n?.find(t=>t.id===e.provider)?.plan??null}function eL(e,t){return(0,ec.useServerRoute)(t&&e.signIn?y.queryKey.subscriptionUsage:null)}function eq(e){return"refused"in e?{text:"Sign-in refused",ink:"text-destructive",warn:!0}:{text:e.spent?"Limit reached":`${e.usedPercent}% used`,ink:e.high?eu.WAITING_INK:"text-muted-foreground",warn:e.high}}function eD(e,t){let n=!e||"refused"in e?null:e,r=`${n?.plan??t??"unknown"} plan`;return n?.resetsAt?`${r} \xb7 resets in ${(0,s.formatDistanceToNowStrict)(new Date(n.resetsAt))}`:r}function eH({entry:e}){if(e.provider)return(0,n.jsx)(z.ProviderIcon,{provider:e.provider,className:"size-4"});let t=eE[e.key]??m.KeyRound,s=(0,n.jsx)(t,{className:"size-4 text-muted-foreground"});return e.site?(0,n.jsx)(w.SiteIcon,{host:e.site,className:"size-4 rounded-[4px]",fallback:s}):s}function eU({entry:e,choices:t,value:s,effort:r,effortValue:i}){let o=e.text?(0,E.parseTextModel)(s):(0,E.parseMediaModel)(s),{data:a}=(0,ec.useServerRoute)(e.text&&!s&&y.queryKey.automaticModel),l=e.kind?eR[e.kind]:R.BotsMark,[d]=(0,ed.useServerAction)(P.setConfigAction,{onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.automaticModel)}}),[c]=(0,ed.useServerAction)(F,{onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.automaticModel)}});return(0,n.jsxs)("div",{className:"flex w-full items-start gap-3 p-4",children:[(0,n.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,n.jsx)(l,{className:"size-4 text-muted-foreground"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 pt-1.5",children:[(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),!s&&(0,n.jsx)("span",{className:(0,eu.cn)("shrink-0 rounded-[5px] border border-border/60 px-1 font-mono text-[10px]",e.kind?eu.WAITING_INK:"text-muted-foreground"),children:e.kind?"off":"auto"})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)("div",{className:"min-w-0",children:(0,n.jsx)(M.ModelPicker,{kind:e.kind,provider:o?.provider??null,model:o?.model??"",unset:e.kind?"Not offered to bots until you pick one":function(e,t){if(!e)return"Automatic";if(!e.ref)return e.problem;let{provider:n,model:s}=e.ref,r=t.find(e=>e.value===`${n}/${s}`);return`Automatic \xb7 ${r?.label??s}`}(a,t),onChange:t=>d(e.key,`${t.provider}/${t.model.trim()}`),onUnset:s?()=>{c(e.key),r&&i&&c(r.key)}:void 0})}),r&&o&&(0,n.jsxs)("div",{className:"flex items-start gap-3 pt-0.5",children:[(0,n.jsx)("span",{className:"w-12 shrink-0 pt-1.5 font-mono text-[11px] text-muted-foreground",children:"effort"}),(0,n.jsx)(C.EffortSwitch,{provider:o.provider,model:o.model,value:E.effortSchema.safeParse(i).data??null,onChange:e=>e?d(r.key,e):c(r.key)})]})]})]})]})}let eG=(e,t)=>e.entries.find(e=>e.effortOf===t);function eY({entry:e,onDone:t}){let{data:s}=(0,ec.useServerRoute)(y.queryKey.config),r=(0,T.isConfigSet)(s,e.key),i=eO(e,r),o=eL(e,r),a=o.data?eq(o.data):null,[l,d]=(0,ed.useServerAction)(F,{okMessage:`Signed out of ${e.label}`,onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.llmModel),t()}});return(0,n.jsx)(el.SettingDialogContent,{title:e.label,description:r?(0,n.jsxs)(n.Fragment,{children:["Signed in ·"," ",(0,n.jsx)("span",{className:"font-mono",children:eD(o.data,i)}),a&&(0,n.jsxs)(n.Fragment,{children:[" · ",(0,n.jsx)("span",{className:(0,eu.cn)("font-mono",a.ink),children:a.text})]})]}):"Sign in with your ChatGPT account instead of a key",footer:(0,n.jsxs)(n.Fragment,{children:[r&&(0,n.jsx)(k.Button,{variant:"ghost",loading:d,onClick:async()=>{await j.notify.confirm({title:`Sign out of ${e.label}?`,description:"Nothing runs on your plan until you sign in again.",okText:"Sign out",destructive:!0})&&l(e.key)},children:"Sign out"}),(0,n.jsx)(k.Button,{variant:"ghost",onClick:t,children:r?"Close":"Cancel"}),!r&&(0,n.jsx)(S.ChatGptSignIn,{})]}),children:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(el.SettingNote,{children:r?"Bots on this subscription spend your plan's usage, not a key. When it runs out, the job stops and says when it resets.":"The sign-in opens in its own window. Approve it there, and this turns to signed in by itself."}),o.data&&"refused"in o.data&&(0,n.jsx)(el.SettingNote,{className:"wrap-break-word text-destructive",children:o.data.refused})]})})}function eW(e,t){return j.notify.component({className:"sm:max-w-md",renderer:({close:s})=>(0,n.jsx)(eV,{entry:e,set:t,onDone:s})})}function eV({entry:e,set:t,onDone:s}){let[i,o]=(0,p.useState)(""),{data:a}=eB(e,t),l=a?e$(t,!1,a):null,d=()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.llmModel)},[c,u]=(0,ed.useServerAction)(P.setConfigAction,{okMessage:`${e.label} key saved`,onOk:()=>{d(),s()}}),[h,f]=(0,ed.useServerAction)(F,{okMessage:`${e.label} key removed`,onOk:()=>{d(),s()}}),m=async()=>{await j.notify.confirm({title:`Remove the ${e.label} key?`,description:"It is deleted from this computer, and nothing runs on it until a key is pasted again.",okText:"Remove",destructive:!0})&&h(e.key)};return(0,n.jsx)(el.SettingDialogContent,{title:e.label,description:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"font-mono",children:e.key}),e.hint&&(0,n.jsxs)(n.Fragment,{children:[" · ",e.hint]}),l&&(0,n.jsxs)(n.Fragment,{children:[" · ",(0,n.jsx)("span",{className:(0,eu.cn)("font-mono",l.ink),children:l.text})]})]}),footer:(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(k.Button,{variant:"ghost",loading:f,onClick:()=>void m(),className:"mr-auto text-destructive hover:text-destructive",children:"Remove"}),(0,n.jsx)(k.Button,{variant:"ghost",onClick:s,children:"Cancel"}),(0,n.jsx)(k.Button,{loading:u,disabled:i.trim().length<A.KEY_MIN,onClick:()=>c(e.key,i),children:t?"Replace":"Save"})]}),children:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(v.Input,{value:i,onChange:e=>o(e.target.value),onKeyDown:t=>{"Enter"===t.key&&i.trim().length>=A.KEY_MIN&&c(e.key,i)},placeholder:t?"New value — replaces the current key":e.keyLooks??"Paste the key",spellCheck:!1,type:"password",autoFocus:!0}),!t&&e.keysAt&&(0,n.jsxs)("a",{href:e.keysAt,target:"_blank",rel:"noreferrer",className:"flex w-fit items-center gap-1 px-0.5 text-[13px] text-foreground underline underline-offset-3 hover:text-foreground/80",children:["Get a key at ",new URL(e.keysAt).host,(0,n.jsx)(r.ArrowUpRight,{className:"size-3.5"})]}),a&&"refused"in a&&(0,n.jsx)(el.SettingNote,{className:"wrap-break-word text-destructive",children:a.refused})]})})}e.s(["AccountsSetup",0,function({withoutVoice:e=!1}){let{data:t}=(0,ec.useServerRoute)(y.queryKey.config),s=e=>(0,T.isConfigSet)(t,e),r=e=>T.CONFIG_GROUPS.find(t=>t.id===e)?.entries??[],[i,o]=(0,p.useState)(!1),a=r("voice"),l=[...a,...r("text")],d=l.filter((t,n)=>(n<4||s(t.key))&&!(e&&a.includes(t))),c=l.filter(t=>!d.includes(t)&&!(e&&a.includes(t)));return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsx)("div",{className:"flex flex-col gap-2",children:r("easy").map(e=>(0,n.jsx)(eK,{card:!0,narrow:!0,entry:e,set:s(e.key),needed:!1},e.key))}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-y-2.5",children:[d.map(e=>(0,n.jsx)(eP,{entry:e,set:s(e.key)},e.key)),c.length>0&&(0,n.jsxs)(b.Popover,{open:i,onOpenChange:o,children:[(0,n.jsxs)(b.PopoverTrigger,{"aria-label":`${c.length} more providers`,className:"group flex w-17 flex-col items-center gap-1.5 rounded-xl py-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsx)("span",{className:"grid size-10.5 place-items-center rounded-[13px] bg-muted/60 text-muted-foreground transition-colors group-hover:bg-muted",children:(0,n.jsx)(h.default,{className:"size-4"})}),(0,n.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"More"})]}),(0,n.jsx)(b.PopoverContent,{align:"end",className:"w-78 flex-row flex-wrap gap-0 gap-y-2.5 rounded-2xl p-2.5",onClick:()=>o(!1),children:c.map(e=>(0,n.jsx)(eP,{entry:e,set:s(e.key)},e.key))})]})]}),r("search").map(e=>(0,n.jsx)(eK,{card:!0,narrow:!0,entry:e,set:s(e.key),needed:!1},e.key))]})},"KeysSetting",0,()=>(0,n.jsx)(eF,{screen:"keys"}),"ModelsSetting",0,()=>(0,n.jsx)(eF,{screen:"models"}),"PhoneSetting",0,()=>(0,n.jsx)(el.SettingScreen,{footer:(0,n.jsx)(el.SettingRailNote,{children:"Nothing on this computer is opened to the internet: the app asks the chat service what was written."}),children:(0,n.jsx)(ey,{})})],805995)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,917162,23750,e=>{"use strict";var t=e.i(843476),i=e.i(271645),n=e.i(88014),r=e.i(167881),l=e.i(630374);e.i(166432);var a=e.i(932013),s=e.i(45574),o=e.i(535718),u=e.i(910148),d=e.i(951437),c=e.i(146376),f=e.i(108868),m=e.i(667865),v=e.i(439957),x=e.i(469690),h=e.i(381104),g=e.i(884708),b=e.i(247778),p=e.i(538489),C=e.i(875812),j=e.i(552245),y=e.i(606039),N=e.i(675606),R=e.i(56434),S=e.i(584446);let w=i.forwardRef(function(e,t){let{render:n,className:r,id:l,name:a,value:s,disabled:o=!1,onValueChange:u,defaultValue:w,autoFocus:E=!1,style:D,...I}=e,{state:T,name:k,disabled:F,setTouched:O,setDirty:L,validityData:M,setFocused:P,setFilled:A,validationMode:V,validation:B}=(0,x.useFieldRootContext)(),{clearErrors:_,elementRef:U,submitCountRef:K}=(0,g.useFormContext)(),z=F||o,W=k??a,Y={...T,disabled:z},{labelId:H}=(0,b.useLabelableContext)(),J=(0,p.useLabelableId)({id:l}),[q]=(0,d.useControlled)({controlled:s,default:w,name:"FieldControl",state:"value"}),G=void 0!==s,X=G?q:void 0,$=null==X?void 0:String(X),Q=(0,m.useStableCallback)(()=>B.inputRef.current?.value);(0,h.useRegisterFieldControl)(B.inputRef,J,$,Q,!z,a),(0,c.useIsoLayoutEffect)(()=>{let e=$??B.inputRef.current?.value;void 0!==e&&A(""!==e)},[$,B.inputRef,A]),(0,y.useValueChanged)($,()=>{void 0!==$&&(_(W),L($!==(M.initialValue??"")),B.change($))});let Z=i.useRef(null),ee=(0,v.useTimeout)();return(0,c.useIsoLayoutEffect)(()=>{E&&Z.current===(0,S.activeElement)((0,f.ownerDocument)(Z.current))&&P(!0)},[E,P]),(0,j.useRenderElement)("input",e,{ref:[t,Z],state:Y,props:[{id:J,disabled:z,name:W,ref:B.inputRef,"aria-labelledby":H,autoFocus:E,...G?{value:X}:{defaultValue:w},onChange(e){let t=e.currentTarget.value,i=(0,N.createChangeEventDetails)(R.REASONS.none,e.nativeEvent);u?.(t,i),!G&&(L(t!==(M.initialValue??"")),A(""!==t),e.nativeEvent.defaultPrevented||i.isCanceled||(_(W),B.change(t)))},onFocus(){P(!0)},onBlur(e){if(O(!0),P(!1),"onBlur"===V){let t=e.currentTarget.value;B.commit(t),G&&queueMicrotask(()=>{let e=B.inputRef.current?.value;void 0!==e&&e!==t&&e!==(M.initialValue??"")&&B.commit(e)})}},onKeyDown(e){if("INPUT"===e.currentTarget.tagName&&"Enter"===e.key){O(!0);let t=e.currentTarget.value,i=e.currentTarget.form;if(i&&i===U.current&&!e.defaultPrevented){let t=e.currentTarget,i=K.current;ee.start(0,()=>{K.current===i&&B.commit(t.value)})}else B.commit(t)}}},I,e=>B.getValidationProps(z,e)],stateAttributesMapping:C.fieldValidityMapping})});var E=e.i(568815),D=e.i(223910),I=e.i(157153),T=e.i(666493);let k=i.forwardRef(function(e,n){let{render:r,className:l,style:a,disabled:s=!1,...o}=e,{state:u,disabled:d}=(0,x.useFieldRootContext)(!1),c=d||s,f={...u,disabled:c},m=i.useMemo(()=>({disabled:c}),[c]),v=(0,j.useRenderElement)("div",e,{ref:n,state:f,props:o,stateAttributesMapping:C.fieldValidityMapping});return(0,t.jsx)(T.LabelableProvider,{children:(0,t.jsx)(I.FieldItemContext.Provider,{value:m,children:v})})});e.s(["Control",0,w,"Description",()=>u.FieldDescription,"Error",()=>o.FieldError,"Item",0,k,"Label",()=>s.FieldLabel,"Root",()=>a.FieldRoot,"Validity",0,function(e){let{children:n}=e,{validityData:r,invalid:l}=(0,x.useFieldRootContext)(!1),a=i.useMemo(()=>(0,E.getCombinedFieldValidityData)(r,l),[r,l]),s=!1===a.state.valid,{transitionStatus:o}=(0,D.useTransitionStatus)(s),u=i.useMemo(()=>({...a,validity:a.state,transitionStatus:o}),[a,o]);return(0,t.jsx)(i.Fragment,{children:n(u)})}],305359);var F=e.i(305359),F=F;let O=i.forwardRef(function(e,i){return(0,t.jsx)(F.Control,{ref:i,...e})});var L=e.i(647163);let M="h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";function P({className:e,type:i,...n}){return(0,t.jsx)(O,{type:i,"data-slot":"input",className:(0,L.cn)(M,e),...n})}e.s(["Input",0,P,"inputClassName",0,M],23750);var A=e.i(184762);let V=()=>{let e=document.createElement("div");e.id=crypto.randomUUID(),document.body.appendChild(e);let t=(0,n.createRoot)(e);return{render:e=>t.render(e),unmount:()=>{t.unmount(),e.remove()}}},B={component:({renderer:e,className:i})=>new Promise(n=>{let r=V(),a=null,s=()=>{r.unmount(),n()},o=async()=>{(!a?.()||await B.discard())&&s()};r.render((0,t.jsx)(l.Dialog,{open:!0,onOpenChange:o,children:(0,t.jsx)(l.DialogContent,{className:(0,L.cn)("px-0",i),children:e({close:s,guard:e=>{a=e}})})}))}),discard:()=>B.confirm({title:"Discard your changes?",description:"What you wrote here is not saved.",okText:"Discard",destructive:!0}),alert:e=>new Promise(i=>{let n=V(),a=()=>{n.unmount(),i()};n.render((0,t.jsx)(l.Dialog,{open:!0,onOpenChange:a,children:(0,t.jsxs)(l.DialogContent,{showCloseButton:!1,children:[(0,t.jsxs)(l.DialogHeader,{children:[(0,t.jsx)(l.DialogTitle,{children:e.title}),(0,t.jsx)(l.DialogDescription,{children:e.description})]}),(0,t.jsx)(l.DialogFooter,{children:(0,t.jsx)(r.Button,{variant:"ghost",onClick:a,autoFocus:!0,children:e.okText||"OK"})})]})}))}),confirm:e=>new Promise(i=>{if(e.signal?.aborted)return void i(!1);let n=V(),a=!1,s=()=>{a||(a=!0,e.signal?.removeEventListener("abort",d),n.unmount())},o=()=>{i(!0),s()},u=()=>{i(!1),s()},d=()=>queueMicrotask(u);e.signal?.addEventListener("abort",d,{once:!0});let c=!!(e.destructive||e.cautious);n.render((0,t.jsx)(function(){return(0,t.jsx)(l.Dialog,{open:!0,onOpenChange:u,children:(0,t.jsxs)(l.DialogContent,{showCloseButton:!1,children:[(0,t.jsxs)(l.DialogHeader,{children:[(0,t.jsx)(l.DialogTitle,{children:e.title}),(0,t.jsx)(l.DialogDescription,{children:e.description})]}),e.body,(0,t.jsxs)(l.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"ghost",onClick:u,autoFocus:c,children:e.cancelText||"Never mind"}),(0,t.jsx)(r.Button,{variant:e.destructive?"destructive":"secondary",onClick:o,autoFocus:!c,children:e.okText||"OK"})]})]})})},{}))}),prompt:e=>new Promise(n=>{let a=V(),s=(e="")=>{a.unmount(),n(e)};a.render((0,t.jsx)(()=>{let[n,a]=(0,i.useState)(""),o=e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),s(n))};return(0,t.jsx)(l.Dialog,{open:!0,onOpenChange:()=>s(),children:(0,t.jsxs)(l.DialogContent,{showCloseButton:!1,children:[(0,t.jsxs)(l.DialogHeader,{children:[(0,t.jsx)(l.DialogTitle,{children:e.title}),(0,t.jsx)(l.DialogDescription,{children:e.description}),e.multiline?(0,t.jsx)(A.Textarea,{className:"resize-none max-h-[200px]",placeholder:e.placeholder,autoFocus:!0,value:n,maxLength:e.maxLength,onKeyDown:o,onChange:e=>a(e.target.value)}):(0,t.jsx)(P,{placeholder:e.placeholder,autoFocus:!0,value:n,maxLength:e.maxLength,onChange:e=>a(e.target.value),onKeyDown:o})]}),(0,t.jsxs)(l.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"ghost",onClick:()=>s(),children:e.cancelText||"Cancel"}),(0,t.jsx)(r.Button,{disabled:!n.trim(),variant:"secondary",onClick:()=>s(n),children:e.okText||"OK"})]})]})})},{}))})};e.s(["notify",0,B],917162)},895836,e=>{"use strict";var t=e.i(843476),i=e.i(77071),n=e.i(566595),r=e.i(271645),l=e.i(630374),a=e.i(23750),s=e.i(671428),o=e.i(647163);let u="px-8 pt-8 pb-6";function d({className:e,children:i}){return(0,t.jsx)("div",{className:(0,o.cn)("mx-auto w-full max-w-[55rem]",e),children:i})}function c({left:e,right:i,footer:n}){return(0,t.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,t.jsxs)("div",{className:"mt-8 flex min-h-0 flex-1 border-t border-border/60",children:[(0,t.jsx)("div",{className:"flex w-64 shrink-0 flex-col overflow-y-auto border-r border-border/60 bg-muted/20",children:e}),(0,t.jsx)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:i})]}),n&&(0,t.jsx)(m,{children:n})]})}let f=["w-28","w-36","w-24","w-32","w-20"];function m({children:e}){return(0,t.jsx)("div",{className:"shrink-0 border-t border-border/60 px-8",children:(0,t.jsx)(d,{className:"flex h-14 items-center gap-3 text-xs text-muted-foreground",children:e})})}function v({label:e,hint:i,filter:n,right:r}){return(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[e&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:e}),i&&(0,t.jsx)("span",{className:"truncate font-mono text-xs text-muted-foreground/60",children:i}),n,r&&(0,t.jsx)("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:r})]})}function x({className:e,children:i}){return(0,t.jsx)("p",{className:(0,o.cn)("px-1 font-mono text-[11px] text-muted-foreground",e),children:i})}function h({label:e,onClick:n}){return(0,t.jsxs)("button",{type:"button",onClick:n,className:"text-muted-foreground hover:text-foreground flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-lg",children:(0,t.jsx)(i.Plus,{className:"size-4"})}),(0,t.jsx)("span",{className:"text-sm",children:e})]})}e.s(["NavBadge",0,function({tone:e,count:i}){return 0===i?null:void 0===i?(0,t.jsx)("span",{className:(0,o.cn)("size-1.5 shrink-0 rounded-full","red"===e?"bg-destructive":"bg-waiting")}):(0,t.jsx)("span",{className:(0,o.cn)("shrink-0 font-mono text-[11px]","red"===e?"text-destructive":o.WAITING_INK),children:i})},"PICKED_ROW",0,"bg-brand/8 text-foreground dark:bg-brand/14","SettingColumn",0,d,"SettingDialogContent",0,function({title:e,description:i,children:n,footer:r}){return(0,t.jsxs)("div",{className:"flex min-w-0 max-h-[75vh] flex-col gap-6 p-1",children:[(0,t.jsx)("div",{className:"flex shrink-0 items-start justify-between gap-3",children:(0,t.jsxs)("div",{className:"min-w-0 space-y-1 px-6",children:[(0,t.jsx)(l.DialogTitle,{render:(0,t.jsx)("p",{}),className:"truncate text-xl font-semibold",children:e}),i&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:i})]})}),(0,t.jsx)("div",{className:"min-h-0 min-w-0 flex-1 scroll-py-3 overflow-y-auto",children:(0,t.jsx)("div",{className:"space-y-4 p-1 px-6",children:n})}),r&&(0,t.jsx)("div",{className:"flex shrink-0 justify-end gap-2 px-6",children:r})]})},"SettingError",0,function({message:e}){return(0,t.jsx)("div",{className:u,children:(0,t.jsx)(d,{children:(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:e})})})},"SettingFilter",0,function({value:e,onChange:i,placeholder:r,className:l}){return(0,t.jsxs)("div",{className:(0,o.cn)("relative w-72 max-w-full",l),children:[(0,t.jsx)(n.Search,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(a.Input,{"data-setting-filter":"","aria-label":r,placeholder:r,value:e,onChange:e=>i(e.target.value),className:"h-8 pl-8"})]})},"SettingGroup",0,function({label:e,hint:i,filter:n,right:r,note:l,children:a}){return(0,t.jsxs)("section",{children:[(e||i||n||r)&&(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsx)(v,{label:e,hint:i,filter:n,right:r})}),a,l&&(0,t.jsx)(x,{className:"mt-2",children:l})]})},"SettingItems",0,function({addRow:e,children:i}){return(0,t.jsxs)("div",{className:"divide-y divide-border/60 rounded-xl border border-border/60",children:[e&&(0,t.jsx)(h,{label:e.label,onClick:e.onClick}),i]})},"SettingMore",0,function({hasMore:e,loading:i,sentinelRef:n,ghost:l,count:a=2,className:s}){return e?(0,t.jsx)("div",{ref:n,"aria-busy":i,"aria-label":"Loading more",className:s,children:Array.from({length:a},(e,i)=>(0,t.jsx)(r.Fragment,{children:l},`ghost-${i}`))}):null},"SettingNote",0,x,"SettingPanes",0,c,"SettingPanesSkeleton",0,function({rows:e=7}){return(0,t.jsx)(c,{footer:(0,t.jsx)(s.Skeleton,{className:"h-3 w-64 max-w-full"}),left:(0,t.jsx)("div",{className:"flex flex-col py-2",children:Array.from({length:e},(e,i)=>(0,t.jsx)("div",{className:"mx-2 flex items-center px-2 py-2",children:(0,t.jsx)(s.Skeleton,{className:(0,o.cn)("h-3",f[i%f.length])})},i))}),right:(0,t.jsx)("div",{className:"flex h-11 shrink-0 items-center border-b border-border/60 px-6",children:(0,t.jsx)(s.Skeleton,{className:"h-3 w-40"})})})},"SettingRailNote",0,function({children:e}){return(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e})},"SettingScreen",0,function({footer:e,children:i}){return(0,t.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,t.jsxs)("div",{className:"relative min-h-0 flex-1",children:[(0,t.jsx)("div",{className:"h-full w-full scroll-py-6 overflow-y-auto",children:(0,t.jsx)("div",{className:u,children:(0,t.jsx)(d,{children:(0,t.jsx)("div",{className:(0,o.cn)("-m-1 p-1","space-y-8"),children:i})})})}),(0,t.jsx)("div",{className:"pointer-events-none absolute top-0 left-0 h-6 w-full bg-linear-to-b from-background to-transparent dark:hidden"})]}),e&&(0,t.jsx)(m,{children:e})]})},"SettingSkeleton",0,function({rows:e=3}){return(0,t.jsx)("div",{className:u,children:(0,t.jsx)(d,{className:"space-y-3",children:Array.from({length:e},(e,i)=>(0,t.jsx)(s.Skeleton,{className:"h-16 w-full rounded-xl"},i))})})},"SettingToolbar",0,function({children:e,count:i}){return(0,t.jsx)(v,{filter:e,right:i})}])},166432,e=>{"use strict";e.s([])},932013,666493,568815,155627,157153,45574,535718,910148,e=>{"use strict";var t=e.i(271645),i=e.i(146376),n=e.i(667865),r=e.i(469690),l=e.i(875812),a=e.i(387068),s=e.i(884708),o=e.i(388940),u=e.i(788015),d=e.i(247778),c=e.i(843476);let f=function(e){let i=(0,u.useBaseUiId)(),[r,l]=t.useState(i),[a,s]=t.useState(),[f,m]=t.useState([]),v=void 0===r?i:r,x=(0,o.useRefWithInit)(()=>new Map),{messageIds:h}=(0,d.useLabelableContext)(),g=(0,n.useStableCallback)((e,t)=>{let i=x.current;void 0===t?i.delete(e):i.set(e,t),l(e=>{let t;if(0===i.size)return e;for(let n of i.values()){if(n===e)return e;void 0===t&&(t=n)}return t})}),b=(0,n.useStableCallback)(()=>{0===x.current.size&&l(i)}),p=t.useCallback(e=>{let t=e["aria-describedby"]?e["aria-describedby"].split(" "):[];return t.push(...h,...f),{...e,"aria-describedby":Array.from(new Set(t)).join(" ")||void 0}},[h,f]),C=t.useMemo(()=>({controlId:v,registerControlId:g,resetControlId:b,labelId:a,setLabelId:s,messageIds:f,setMessageIds:m,getDescriptionProps:p}),[v,g,b,a,s,f,m,p]);return(0,c.jsx)(d.LabelableContext.Provider,{value:C,children:e.children})};e.s(["LabelableProvider",0,f],666493);var m=e.i(552245),v=e.i(956789),x=e.i(439957),h=e.i(176782);function g(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}e.s(["getCombinedFieldValidityData",0,g],568815);let b=Object.keys(l.DEFAULT_VALIDITY_STATE);function p(e,t){return!e.matches(":disabled")&&(!t||e.form===t||null===e.form&&!e.hasAttribute("form"))}function C(e,t){let i=null;for(let n of e.keys())if(p(n,t)){if(!n.validity.valid)return n;i??=n}return i}function j(e){return{...l.DEFAULT_VALIDITY_STATE,valid:!e,customError:e}}function y(e){return e&&e.validationMessage?[e.validationMessage]:[]}function N(e){let{elementRef:i,formRef:r}=(0,s.useFormContext)(),{setValidityData:l,validate:a,validityData:u,validationDebounceTime:c,invalid:f,markedDirtyRef:m,state:p,shouldValidateOnChange:N,validationMode:R,registeredFieldIdRef:S}=e,{controlId:w,getDescriptionProps:E}=(0,d.useLabelableContext)(),D=(0,x.useTimeout)(),I=t.useRef(null),T=(0,o.useRefWithInit)(()=>new Map).current,k=t.useRef(0),F=t.useRef(null),O=t.useCallback((e,t)=>(T.set(e,t),()=>{T.delete(e)}),[T]),L=(0,n.useStableCallback)(()=>{let e=C(T,i.current);return e&&T.get(e)?.controlRef.current||null}),M=(0,n.useStableCallback)(async(e,t=!1)=>{k.current+=1;let n=k.current;function s(){let e=F.current;F.current=null,e&&(!e[0].willValidate||e[0].validationMessage===e[1])&&e[0].setCustomValidity(e[2])}function o(t,i,n){let a,s=(a=!1===t.valid?i:[],{value:e,state:t,error:a[0]??"",errors:a,initialValue:u.initialValue});!function(e,t=f){let i=S.current??w;if(null==i)return;let n=r.current.fields.get(i);if(!n)return;let l=g(e,t);r.current.fields.set(i,{...n,validityData:l})}(s,n),l(s)}function d(){return T.size>0?C(T,i.current):I.current}let c=d();function v(){return c=d(),c?.willValidate?function(e){let t=b.reduce((t,i)=>(t[i]=e.validity[i],t),{}),i=!1;for(let e of b)if("valid"!==e){if("valueMissing"===e&&t[e])i=!0;else if(t[e])return t}return i&&!m.current&&(t.valid=!0,t.valueMissing=!1),t}(c):j(!1)}if(t){if(!1!==p.valid||!c)return;if(!c.validity.valueMissing){s();let e=d(),t=e?.validity.customError?y(e):[];o(j(t.length>0),t,!1);return}for(let e of b)if("valid"!==e&&"valueMissing"!==e&&"customError"!==e&&c.validity[e])return}D.clear(),s();let x=v(),h=y(c),E=N();if(0===h.length||E){let t,i=a(e,Array.from(r.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));if("object"==typeof i&&null!==i&&"then"in i){if(!1===x.valid?o(x,h):"onSubmit"!==R&&u.state.customError||(x.valid=null,o(x,h)),t=await i,n!==k.current)return;x=v()}else t=i;if((h=t?[].concat(t).filter(Boolean):[]).length>0){var O,L;let e,t;x.valid=!1,x.customError=!0,c?.willValidate&&(O=c,L=h.join("\n"),e=O.validity.customError?O.validationMessage:"",t=L.replace(/\r\n?/g,"\n"),O.setCustomValidity(t),F.current=[O,t,e])}else h=y(c)}o(x,h)}),P=(0,n.useStableCallback)((e,t=!1)=>{if(D.clear(),k.current+=1,t)return;let i=N();i&&""!==e&&c?D.start(c,()=>{M(e)}):M(e,!i)}),A=t.useCallback((e,t={})=>(0,h.mergeProps)(E(t),!1!==p.valid||p.disabled||e?v.EMPTY_OBJECT:{"aria-invalid":!0}),[E,p.disabled,p.valid]);return t.useMemo(()=>({getValidationProps:A,inputRef:I,registeredInputs:T,registerInput:O,getInputControl:L,commit:M,change:P}),[A,T,O,L,M,P])}e.s(["isEligibleInput",0,p,"useFieldValidation",0,N],155627);let R=t.forwardRef(function(e,o){let{errors:u,validationMode:d,submitCountRef:f}=(0,s.useFormContext)(),{render:v,className:x,validate:h,validationDebounceTime:b=0,validationMode:p=d,name:C,disabled:j=!1,invalid:y,dirty:R,touched:S,actionsRef:w,style:E,...D}=e,I=(0,a.useFieldsetRootContext)(!0)?.disabled,T=(0,n.useStableCallback)(h||(()=>null)),k=I||j,[F,O]=t.useState(!1),[L,M]=t.useState(!1),[P,A]=t.useState(!1),[V,B]=t.useState(!1),_=R??L,U=S??F,K=t.useRef(_),z=t.useRef(void 0),[W,Y]=t.useState(),H=C??W;(0,i.useIsoLayoutEffect)(()=>{void 0!==R&&(K.current=R)},[R]);let J=(0,n.useStableCallback)(e=>{void 0===R&&(e&&(K.current=!0),M(e))}),q=(0,n.useStableCallback)(e=>{void 0===S&&O(e)}),G=(0,n.useStableCallback)(()=>"onChange"===p||"onSubmit"===p&&f.current>0),X=H&&Object.hasOwn(u,H)?u[H]:null,$=!!(Array.isArray(X)?X.length:X),Q=!0===y||$,[Z,ee]=t.useState({state:l.DEFAULT_VALIDITY_STATE,error:"",errors:[],value:null,initialValue:null}),et=!Q&&(k?null:Z.state.valid),ei=t.useMemo(()=>({disabled:k,touched:U,dirty:_,valid:et,filled:P,focused:V}),[k,U,_,et,P,V]),en=N({setValidityData:ee,validate:T,validityData:Z,validationDebounceTime:b,invalid:Q,markedDirtyRef:K,state:ei,shouldValidateOnChange:G,validationMode:p,registeredFieldIdRef:z}),[er,el]=function(e){let{change:r,commit:l,invalid:a,markedDirtyRef:o,name:u,setRegisteredFieldName:d,registeredFieldIdRef:c,setValidityData:f,validityData:m}=e,{formRef:v}=(0,s.useFormContext)(),x=t.useRef(null),h=t.useRef(null),b=t.useRef(!1),p=(0,n.useStableCallback)(()=>{let e=h.current;if(e)return e.getValue?e.getValue():e.value});function C(e){return void 0===e.value?p():e.value}let j=(0,n.useStableCallback)(()=>{let e=h.current;(o.current=!0,e)?l(C(e)):l(m.value)});function y(e=h.current?.id){e&&v.current.fields.delete(e)}(0,i.useIsoLayoutEffect)(()=>{let e=h.current;e&&e.id&&(d(u?void 0:e.name),v.current.fields.set(e.id,{getValue:p,name:u??e.name,controlRef:e.controlRef,validityData:g(m,a),validate:j}))},[v,p,a,u,d,j,m]),(0,i.useIsoLayoutEffect)(()=>{let e=v.current.fields;return()=>{let t=h.current?.id;t&&e.delete(t)}},[v]);let N=(0,n.useStableCallback)((e,t)=>{let i;if(!t){x.current===e&&(x.current=null,r(void 0,!0),y(),h.current=null,d(void 0),c.current=void 0);return}let n=h.current?.id,l=x.current;l&&l!==e&&r(void 0,!0),x.current=e,h.current=t,u||d(t.name),c.current=t.id,n&&n!==t.id&&y(n),function(e){if(b.current)return;b.current=!0;let t=C(e);f(e=>e.initialValue===t?e:{...e,initialValue:t})}(t),(i=h.current)&&i.id&&v.current.fields.set(i.id,{getValue:p,name:u??i.name,controlRef:i.controlRef,validityData:g(m,a),validate:j})});return[j,N]}({change:en.change,commit:en.commit,invalid:Q,markedDirtyRef:K,name:C,setRegisteredFieldName:Y,registeredFieldIdRef:z,setValidityData:ee,validityData:Z});t.useImperativeHandle(w,()=>({validate:er}),[er]);let ea=t.useMemo(()=>({invalid:Q,name:H,validityData:Z,setValidityData:ee,disabled:k,setTouched:q,setDirty:J,setFilled:A,setFocused:B,validationMode:p,shouldValidateOnChange:G,state:ei,registerFieldControl:el,validation:en}),[Q,H,Z,k,q,J,A,B,p,G,ei,el,en]),es=(0,m.useRenderElement)("div",e,{ref:o,state:ei,props:D,stateAttributesMapping:l.fieldValidityMapping});return(0,c.jsx)(r.FieldRootContext.Provider,{value:ea,children:es})}),S=t.forwardRef(function(e,t){return(0,c.jsx)(f,{children:(0,c.jsx)(R,{...e,ref:t})})});e.s(["FieldRoot",0,S],932013);var w=e.i(229315),E=e.i(108868),D=e.i(584446);let I=t.createContext({disabled:!1});function T(){return t.useContext(I)}e.s(["FieldItemContext",0,I,"useFieldItemContext",0,T],157153);let k=t.forwardRef(function(e,a){let{render:s,className:o,style:c,id:f,nativeLabel:v=!0,...x}=e,h=(0,r.useFieldRootContext)(!1),g=T(),{labelId:b}=(0,d.useLabelableContext)(),p={...h.state,disabled:h.disabled||g.disabled},C=t.useRef(null),j=function(e={}){let t,{id:r,fallbackControlId:l,native:a=!1,setLabelId:s,focusControl:o}=e,{controlId:c,setLabelId:f}=(0,d.useLabelableContext)(),m=(0,n.useStableCallback)(e=>{f(e),s?.(e)}),v=(t=(0,u.useBaseUiId)(r),(0,i.useIsoLayoutEffect)(()=>(m(t),()=>{m(e=>e===t?void 0:e)}),[t,m]),t),x=c??l;function h(e){let t=(0,D.getTarget)(e.nativeEvent);t?.closest("button,input,select,textarea")||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),a||function(e){if(o)return o(e,x);if(!x)return;let t=(0,E.ownerDocument)(e.currentTarget).getElementById(x);(0,w.isHTMLElement)(t)&&t.focus({focusVisible:!0})}(e))}return a?{id:v,htmlFor:x,onMouseDown:h}:{id:v,onClick:h,onPointerDown(e){e.preventDefault()}}}({id:b??f,native:v});return(0,m.useRenderElement)("label",e,{ref:[a,C],state:p,props:[j,x],stateAttributesMapping:l.fieldValidityMapping})});e.s(["FieldLabel",0,k],45574);var F=e.i(137584),O=e.i(474354),L=e.i(223910);let M={...l.fieldValidityMapping,...O.transitionStatusMapping},P=t.forwardRef(function(e,n){let{render:l,id:a,className:o,match:f,style:v,...x}=e,h=(0,u.useBaseUiId)(a),{validityData:g,state:b,name:p}=(0,r.useFieldRootContext)(!1),{setMessageIds:C}=(0,d.useLabelableContext)(),{errors:j}=(0,s.useFormContext)(),y=p&&Object.hasOwn(j,p)?j[p]:null,N=!!(Array.isArray(y)?y.length:y),R="string"==typeof f,S=!1;S=!0===f||!b.disabled&&(R?!!g.state[f]:N||!1===g.state.valid);let{mounted:w,transitionStatus:E,setMounted:D}=(0,L.useTransitionStatus)(S);(0,i.useIsoLayoutEffect)(()=>{if(S&&h)return C(e=>e.concat(h)),()=>{C(e=>e.filter(e=>e!==h))}},[S,h,C]);let I=t.useRef(null),[T,k]=t.useState(null),[O,P]=t.useState(null),A=g.error;!R&&N?A=y:g.errors.length>1&&(A=g.errors);let V=A;Array.isArray(A)&&(V=A.length>1?(0,c.jsx)("ul",{children:A.map(e=>(0,c.jsx)("li",{children:e},e))}):A[0]);let B=Array.isArray(A)?JSON.stringify(A):A;S&&B!==O&&(P(B),k(V)),(0,F.useOpenChangeComplete)({open:S,ref:I,onComplete(){S||D(!1)}});let _={...b,transitionStatus:E},U=(0,m.useRenderElement)("div",e,{ref:[n,I],state:_,props:[{id:h,children:S?V:T},x],stateAttributesMapping:M,enabled:w});return w?U:null});e.s(["FieldError",0,P],535718);let A=t.forwardRef(function(e,t){let{render:n,id:a,className:s,style:o,...c}=e,f=(0,u.useBaseUiId)(a),v=(0,r.useFieldRootContext)(!1),x=T(),{setMessageIds:h}=(0,d.useLabelableContext)(),g={...v.state,disabled:v.disabled||x.disabled};return(0,i.useIsoLayoutEffect)(()=>{if(f)return h(e=>e.concat(f)),()=>{h(e=>e.filter(e=>e!==f))}},[f,h]),(0,m.useRenderElement)("p",e,{ref:t,state:g,props:[{id:f},c],stateAttributesMapping:l.fieldValidityMapping})});e.s(["FieldDescription",0,A],910148)},387068,e=>{"use strict";e.i(247167);var t=e.i(733332),i=e.i(271645);let n=i.createContext(void 0);e.s(["useFieldsetRootContext",0,function(e=!1){let r=i.useContext(n);if(!r&&!e)throw Error((0,t.default)(86));return r}])},381104,e=>{"use strict";var t=e.i(146376),i=e.i(388940),n=e.i(469690);e.s(["useRegisterFieldControl",0,function(e,r,l,a,s=!0,o){let{registerFieldControl:u}=(0,n.useFieldRootContext)(),d=(0,i.useRefWithInit)(()=>Symbol());(0,t.useIsoLayoutEffect)(()=>{let t=d.current;s?u(t,{controlRef:e,getValue:a,id:r,name:o,value:l}):u(t,void 0)},[e,s,a,r,o,u,d,l]),(0,t.useIsoLayoutEffect)(()=>{let e=d.current;return()=>{u(e,void 0)}},[u,d])}])},469690,875812,e=>{"use strict";var t=e.i(733332),i=e.i(271645),n=e.i(956789);let r={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},l={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},a={disabled:!1,...l};e.s(["DEFAULT_FIELD_ROOT_STATE",0,a,"DEFAULT_FIELD_STATE_ATTRIBUTES",0,l,"DEFAULT_VALIDITY_STATE",0,r,"fieldValidityMapping",0,{valid:e=>null===e?null:e?{"data-valid":""}:{"data-invalid":""}}],875812);let s={invalid:void 0,name:void 0,validityData:{state:r,errors:[],error:"",value:"",initialValue:null},setValidityData:n.NOOP,disabled:void 0,setTouched:n.NOOP,setDirty:n.NOOP,setFilled:n.NOOP,setFocused:n.NOOP,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:a,registerFieldControl:n.NOOP,validation:{getValidationProps:(e,t=n.EMPTY_OBJECT)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:n.NOOP,getInputControl:()=>null,commit:async()=>{},change:n.NOOP}},o=i.createContext(s);e.s(["DEFAULT_FIELD_ROOT_CONTEXT",0,s,"FieldRootContext",0,o,"useFieldRootContext",0,function(e=!0){let r=i.useContext(o);if(r.setValidityData===n.NOOP&&!e)throw Error((0,t.default)(28));return r}],469690)},884708,247778,e=>{"use strict";var t=e.i(271645),i=e.i(956789);let n=t.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:i.NOOP,validationMode:"onSubmit",submitCountRef:{current:0}});e.s(["useFormContext",0,function(){return t.useContext(n)}],884708);let r=t.createContext({controlId:void 0,registerControlId:i.NOOP,resetControlId:i.NOOP,labelId:void 0,setLabelId:i.NOOP,messageIds:[],setMessageIds:i.NOOP,getDescriptionProps:e=>e});e.s(["LabelableContext",0,r,"useLabelableContext",0,function(){return t.useContext(r)}],247778)},538489,e=>{"use strict";var t=e.i(271645),i=e.i(146376),n=e.i(667865),r=e.i(388940),l=e.i(956789),a=e.i(788015),s=e.i(247778);e.s(["useLabelableId",0,function(e={}){let{id:o,enabled:u=!0}=e,{controlId:d,registerControlId:c,resetControlId:f}=(0,s.useLabelableContext)(),m=(0,a.useBaseUiId)(),v=(0,r.useRefWithInit)(()=>Symbol()),x=t.useRef(!1),h=t.useRef(!1),g=(0,n.useStableCallback)(()=>{x.current&&c!==l.NOOP&&(x.current=!1,c(v.current,void 0))});return(0,i.useIsoLayoutEffect)(()=>{let e;if(!u||c===l.NOOP)return void g();if(void 0!==o)h.current=!0,e=o;else{if(!h.current)return void f();e=m}void 0===e?g():(x.current=!0,c(v.current,e))},[o,u,c,f,m,v,g]),(0,i.useIsoLayoutEffect)(()=>g,[g]),(u?d:void 0)??o??m}])},77071,e=>{"use strict";var t=e.i(456420);let i={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};i.node;let n=(0,t.default)(i);e.s(["Plus",0,n],77071)},566595,630299,e=>{"use strict";var t=e.i(456420);let i={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};i.node;let n=(0,t.default)(i);e.s(["default",0,n],630299),e.s(["Search",0,n],566595)}]);
|