@alook/app 0.0.110 → 0.0.112
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/bundled/email-worker/index.js +52 -19
- package/bundled/web/.open-next/.build/durable-objects/queue.js +5 -5
- package/bundled/web/.open-next/assets/BUILD_ID +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/05k5yq2079y4m.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{0y4~yxd1iyiue.js → 06_jx3ncn42qx.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{032abedppun95.js → 07n8~bkabw8tk.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{09_5h3duged1-.js → 0c5ce61j3ps45.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{13g3lr47fmukl.js → 0feon~hbkd1t8.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0l7699a2nu_ob.css +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0sb6j-6nlwzlz.js +3 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0s~-o9703a6o~.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{0~tcqxgka2xol.js → 0tw05tsn2c~1m.js} +15 -15
- package/bundled/web/.open-next/assets/_next/static/chunks/0wnbo93.rhzuf.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/0xvr_746pz3cv.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{0fkuoe3g9qc_4.js → 0yv.twub1_eip.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/13ogh4gvbsvjk.js +62 -0
- package/bundled/web/.open-next/cache/{KbaMV38oRSu84qh40vSuT → vfJXZuQqqk5c1B-ikIMmb}/_global-error.cache +1 -1
- package/bundled/web/.open-next/cache/{KbaMV38oRSu84qh40vSuT → vfJXZuQqqk5c1B-ikIMmb}/_not-found.cache +1 -1
- package/bundled/web/.open-next/cache/{KbaMV38oRSu84qh40vSuT → vfJXZuQqqk5c1B-ikIMmb}/device.cache +1 -1
- package/bundled/web/.open-next/cache/{KbaMV38oRSu84qh40vSuT → vfJXZuQqqk5c1B-ikIMmb}/privacy.cache +1 -1
- package/bundled/web/.open-next/cache/{KbaMV38oRSu84qh40vSuT → vfJXZuQqqk5c1B-ikIMmb}/sitemap.xml.cache +1 -1
- package/bundled/web/.open-next/cloudflare/cache-assets-manifest.sql +1 -1
- package/bundled/web/.open-next/cloudflare/init.js +1 -1
- package/bundled/web/.open-next/dynamodb-provider/dynamodb-cache.json +1 -1
- package/bundled/web/.open-next/middleware/handler.mjs +11 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/prerender-manifest.json +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/invite/[token]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/studio/new/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/activity/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/[convId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/email/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/files/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/meetings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/new/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/calendar/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/flags/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/help/email-setup/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/home/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/issues/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/runtimes/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/settings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/[traceId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/unread/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/workspaces/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(auth)/sign-in/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agent-links/[id]/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agent-links/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/access/[userId]/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/access/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/active-tasks/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/activity/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/chat-init/route.js +9 -8
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/conversation/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/conversations/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/email-accounts/[accountId]/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/email-accounts/[accountId]/sync/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/email-accounts/[accountId]/test/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/email-accounts/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/meetings/[meetingId]/approve/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/meetings/[meetingId]/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/meetings/[meetingId]/stop/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/meetings/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/pin/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/skills/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/whitelist/[whitelistId]/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/whitelist/route.js +9 -8
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/[id]/workspace/browse/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/active-task-counts/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/active-tasks/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/pins/reorder/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/pins/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/recruit/route.js +9 -9
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/route.js +8 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/agents/sidebar/reorder/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/artifacts/[id]/content/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/artifacts/[id]/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/artifacts/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/artifacts/upload/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/auth/[...all]/route.js +6 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/calendar/[id]/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/calendar/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/channels/[id]/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/channels/reorder/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/channels/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/cli/latest-version/route.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/config/min-version/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/config/model-options/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/[id]/active-task/route.js +8 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/[id]/buffered-messages/[messageId]/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/[id]/buffered-messages/route.js +9 -8
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/[id]/init/route.js +9 -8
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/[id]/messages/route.js +7 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/[id]/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/check-fresh/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/conversations/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/deregister/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/heartbeat/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/register/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/skills/sync/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/sweep/route.js +8 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/complete/route.js +10 -9
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/fail/route.js +10 -9
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/messages/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/progress/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/start/route.js +10 -9
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/status/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/[taskId]/supersede/route.js +10 -9
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/tasks/poll/route.js +9 -8
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/daemon/workspace/report/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/[id]/attachment/[index]/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/[id]/body/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/[id]/raw/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/[id]/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/[id]/thread/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/notify/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/send/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/email/upload/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/flags/[messageId]/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/flags/count/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/flags/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/inbox/count/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/inbox/read/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/inbox/read-all/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/inbox/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/invite/[token]/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/issues/[id]/comments/route.js +9 -8
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/issues/[id]/route.js +9 -8
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/issues/route.js +8 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/machine-tokens/[id]/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/machine-tokens/activate/route.js +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/machine-tokens/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/me/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/meeting/callback/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/members/me/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/runtimes/[runtimeId]/rescan/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/runtimes/[runtimeId]/update/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/runtimes/machine/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/runtimes/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/studios/check-handles/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/studios/check-name/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/studios/route.js +10 -9
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/tasks/[id]/messages/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/tasks/[id]/retry/route.js +8 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/tasks/[id]/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/traces/[traceId]/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/traces/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/workspaces/[id]/invites/[inviteId]/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/workspaces/[id]/invites/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/workspaces/[id]/members/[memberId]/route.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/workspaces/[id]/members/route.js +7 -7
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/workspaces/[id]/overview/route.js +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/workspaces/[id]/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/workspaces/route.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/ws/token/route.js +6 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/device/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/onboard.md/route.js +2 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/[id]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0-tysll._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0-w8cvr._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0.-ex.r._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__00kdrdq._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__00t-lv7._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__01pm5bg._.js +101 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__03xk-80._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__04-aiih._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__04ibu3u._.js +19 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__05cpvpx._.js +8 -8
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__05y4ji4._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__061r~5n._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__063bu6a._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__06kj~8s._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__088o0os._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__096a7~5._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0_52q3p._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0_a1bfb._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0a3~vl5._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0ae.~ic._.js +19 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0auk5r9._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0bj0jcs._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0bzc7r~._.js +81 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0c3-~q~._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0d0_qit._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0eafbpy._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0ee3fyc._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0ejdw~f._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0eusp4j._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0f6g-yw._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0fg5lyo._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0fveomh._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0g0wi2~._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0hcjev6._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0hd86qt._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0i0ukpl._.js +101 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0intft0._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0j5fdu2._.js +101 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0l5zxrt._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0n42~r6._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0o7orcx._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0oj5al3._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0oj8ury._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0phdbto._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0qhsr9q._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0qrw9-l._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0rg~ky_._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0rkhrs3._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0sc6-vs._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0sf_9ve._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0tciisw._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0tgz16m._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0u0~aqt._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0uqtpq.._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0x.v~yr._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0xp0-1_._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0xtab4g._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0y4l-ox._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0yd9_c4._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0zhaznf._.js +19 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0zv9j_e._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0~a64yc._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0~otgta._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__10x0i39._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__116npth._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__11cl4~p._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{[root-of-the-server]__07_2txj._.js → [root-of-the-server]__11ury1h._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__122~iy7._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__12ju08.._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__13mvgdw._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[turbopack]_runtime.js +113 -109
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_00_9pus._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_02.f31i._.js +5 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_025fm6r._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_02~mjb4._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_03ju0js._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_07hpwgw._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_08y2ta9._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_09ivzvb._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0_jw-5d._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0_kfe3c._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0ahwrti._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0b4pq8.._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0d6rwbr._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0fhlxv6._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0h-fa04._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0il0z_b._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0es3xrw._.js → _0jj44iu._.js} +3 -19
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0l1rr.g._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0d5xg0u._.js → _0m4uqwa._.js} +3 -19
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/{_0r~swxs._.js → _0mibx4k._.js} +3 -19
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0ozui8c._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0p_10om._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0r04wj_._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0r0h9so._.js +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0r4pg7i._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0ri6_n4._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0zk1_mu._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_102qunz._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_12i.jt7._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_13lep.0._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/src_web_src_lib_services_0yvxfxt._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0_vmy~.._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0a.f58h._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0i8fzgr._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0tv~geg._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[turbopack]_runtime.js +113 -109
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0lb.qjt._.js → _0.wd8xr._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_07m_9fn._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0_.06ux._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0xhqu2a._.js → _0a0h6kk._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0gbiien._.js +65 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0goqyet._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0h.i9j.._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0mo4bbn._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0p44d2o._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0r_ppn9._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0ryz7_7._.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0sby7nn._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0plb9rd._.js → _0t50c_j._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0v378m.._.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_12~4zih._.js → _0y7yqet._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0zgwjzh._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_10lo-_p._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0zbzypo._.js → _11jpe7z._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_0~23g-y._.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_agents_[id]_email_page_tsx_09mq1-g._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_agents_[id]_layout_tsx_0juu2um._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_00xgo_-._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_0nj0euq._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_issues_issue-sheet_tsx_02fma1.._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-build-manifest.js +3 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-manifest.json +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.json +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs +188 -281
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +1182 -1049
- package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +3 -3
- package/bundled/ws-do/index.js +21 -6
- package/dist/cli/index.js +460 -309
- package/dist/cli/meeting-runner.js +1 -2
- package/dist/cli/session-runner.js +365 -308
- package/dist/index.js +9 -1
- package/package.json +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/08_pxrd46meym.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/08p2ekglkxw~q.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0aj8yzj6vrad4.css +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0c4uhxm3-drto.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0caq6r63e_.cz.js +0 -3
- package/bundled/web/.open-next/assets/_next/static/chunks/11.l90o9r_vdp.js +0 -62
- package/bundled/web/.open-next/assets/_next/static/chunks/15gzq7biqnfyu.js +0 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0-857yf._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0-f7f94._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0-x_e2-._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0-y0x05._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0.i~n9k._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__00-t~84._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__01m8-42._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__027birg._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__027mioa._.js +0 -85
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__04d5vn8._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__04ga0fm._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__04lf9dm._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__05.i~p4._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__05j4uuj._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__06-~y~n._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__06h.0.p._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__06jx2r6._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__07kynzq._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__09c2eii._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__09p6viv._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0afyujp._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0ai~o9t._.js +0 -85
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0blgkro._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0bm22_4._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0e50pyj._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0f1ifkk._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0foyyii._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0g2f8es._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0hfok0d._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0i2~~cu._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0ibt4_b._.js +0 -85
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0ii4sxa._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0l2s5a9._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0ltc6gj._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0mcp7fl._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0oui7hy._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0ov0u8s._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0p25hr6._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0pafdaa._.js +0 -71
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0pld4w5._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0q.1vjc._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0q7ub2s._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0q_9ucm._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0rum9mg._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0s0x1gw._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0sef7j.._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0te6cra._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0tgnaho._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0twttjc._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0u_.xg8._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0v6cx19._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0vry3o4._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0w1jro_._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0w8pipz._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0w~qukv._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0y7iq_6._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0yslih5._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0z1srcf._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0zp3bvl._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0~6oegu._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__0~qx7w~._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__10ygwwj._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__11~a0kb._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__1254c58._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__13bx1-9._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__13cfxr-._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__13l5e82._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0.gkbx8._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_00-p7_0._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0047hu1._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_03.wj5m._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_03gwxos._.js +0 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_03pj4c4._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0403fh~._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0aa_-d.._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0aomz8a._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0aqlpnt._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0b6v~wp._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0fjzb27._.js +0 -115
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0huk3rm._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0i~wxfn._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0nyvdk.._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0ow_nxn._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0w5uflk._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0wbaduy._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0xed-yu._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0xfnkkm._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0yzq1gx._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_11zk~pq._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_12-_-5g._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/src_0wkbw.-._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0.zvpt1._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__00ir-1l._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0z8-n4g._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0.bg4hm._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_06glull._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0ac_em-._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0hjt5jw._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0llmkdo._.js +0 -65
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_124ub0f._.js +0 -3
- /package/bundled/web/.open-next/assets/_next/static/{KbaMV38oRSu84qh40vSuT → vfJXZuQqqk5c1B-ikIMmb}/_buildManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{KbaMV38oRSu84qh40vSuT → vfJXZuQqqk5c1B-ikIMmb}/_clientMiddlewareManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{KbaMV38oRSu84qh40vSuT → vfJXZuQqqk5c1B-ikIMmb}/_ssgManifest.js +0 -0
- /package/bundled/web/.open-next/cache/{KbaMV38oRSu84qh40vSuT → vfJXZuQqqk5c1B-ikIMmb}/robots.txt.cache +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[221781,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(207058),e=a.i(506180),f=a.i(752792),g=a.i(588339),h=a.i(732254),i=a.i(22902),j=a.i(623789),k=a.i(892236),l=a.i(807820),m=a.i(108275),n=a.i(632465),o=a.i(8607),p=o.Extension.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:a=>{let b=a.style.textAlign;return this.options.alignments.includes(b)?b:this.options.defaultAlignment},renderHTML:a=>a.textAlign?{style:`text-align: ${a.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:a=>({commands:b})=>!!this.options.alignments.includes(a)&&this.options.types.map(c=>b.updateAttributes(c,{textAlign:a})).some(a=>a),unsetTextAlign:()=>({commands:a})=>this.options.types.map(b=>a.resetAttributes(b,"textAlign")).some(a=>a),toggleTextAlign:a=>({editor:b,commands:c})=>!!this.options.alignments.includes(a)&&(b.isActive({textAlign:a})?c.unsetTextAlign():c.setTextAlign(a))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),q=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,r=o.Node.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:a}){return["img",(0,o.mergeAttributes)(this.options.HTMLAttributes,a)]},parseMarkdown:(a,b)=>b.createNode("image",{src:a.href,title:a.title,alt:a.text}),renderMarkdown:a=>{var b,c,d,e,f,g;let h=null!=(c=null==(b=a.attrs)?void 0:b.src)?c:"",i=null!=(e=null==(d=a.attrs)?void 0:d.alt)?e:"",j=null!=(g=null==(f=a.attrs)?void 0:f.title)?g:"";return j?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"u"<typeof document)return null;let{directions:a,minWidth:b,minHeight:c,alwaysPreserveAspectRatio:d}=this.options.resize;return({node:e,getPos:f,HTMLAttributes:g,editor:h})=>{let i=document.createElement("img");Object.entries(g).forEach(([a,b])=>{if(null!=b)switch(a){case"width":case"height":break;default:i.setAttribute(a,b)}}),i.src=g.src;let j=new o.ResizableNodeView({element:i,editor:h,node:e,getPos:f,onResize:(a,b)=>{i.style.width=`${a}px`,i.style.height=`${b}px`},onCommit:(a,b)=>{let c=f();void 0!==c&&this.editor.chain().setNodeSelection(c).updateAttributes(this.name,{width:a,height:b}).run()},onUpdate:(a,b,c)=>a.type===e.type,options:{directions:a,min:{width:b,height:c},preserveAspectRatio:!0===d}}),k=j.dom;return k.style.visibility="hidden",k.style.pointerEvents="none",i.onload=()=>{k.style.visibility="",k.style.pointerEvents=""},j}},addCommands(){return{setImage:a=>({commands:b})=>b.insertContent({type:this.name,attrs:a})}},addInputRules(){return[(0,o.nodeInputRule)({find:q,type:this.type,getAttributes:a=>{let[,,b,c,d]=a;return{src:c,alt:b,title:d}}})]}}),s=a.i(75118),t=a.i(525132),u=a.i(432340),v=a.i(334235),w=a.i(647651);let x=(0,w.default)("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]),y=(0,w.default)("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]),z=(0,w.default)("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]),A=(0,w.default)("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]),B=(0,w.default)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),C=(0,w.default)("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]),D=(0,w.default)("text-align-start",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]]),E=(0,w.default)("text-align-center",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]]),F=(0,w.default)("text-align-end",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]]),G=(0,w.default)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),H=(0,w.default)("unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]),I=(0,w.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),J=(0,w.default)("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]),K=(0,w.default)("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);var L=a.i(457655),L=L;function M({active:a,disabled:c,onAction:d,title:e,children:f}){return(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",disabled:c,onMouseDown:a=>a.preventDefault(),onClick:d,className:(0,s.cn)("text-muted-foreground/70",a&&"bg-accent text-foreground")}),children:f}),(0,b.jsx)(t.TooltipContent,{children:e})]})}function N(){return(0,b.jsx)("div",{className:"w-px h-4 bg-border/60 mx-0.5 shrink-0"})}function O({editor:a}){let[,d]=(0,c.useReducer)(a=>a+1,0),[e,f]=(0,c.useState)(!1),[g,i]=(0,c.useState)("link"),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(!1),r=(0,c.useRef)(null),w=(0,c.useRef)(!1);if((0,c.useEffect)(()=>{if(!a)return;let b=()=>d();return a.on("transaction",b),()=>{a.off("transaction",b)}},[a]),(0,c.useEffect)(()=>{e&&setTimeout(()=>r.current?.focus(),0)},[e]),!a)return null;let P="size-3.5",Q=()=>{let b=j.trim();if(b){try{new URL(b)}catch{m("Please enter a valid URL");return}if(m(""),"link"===g)if(p){let c=n.trim()||b;a.chain().focus().insertContent({type:"text",text:c,marks:[{type:"link",attrs:{href:b}}]}).run()}else a.chain().focus().extendMarkRange("link").setLink({href:b}).run();else a.chain().focus().setImage({src:b}).run();f(!1)}};return(0,b.jsxs)("div",{className:"flex items-center gap-0.5 px-3 py-1 overflow-x-auto",children:[(0,b.jsx)(M,{title:"Bold",active:a.isActive("bold"),onAction:()=>a.chain().focus().toggleBold().run(),children:(0,b.jsx)(x,{className:P})}),(0,b.jsx)(M,{title:"Italic",active:a.isActive("italic"),onAction:()=>a.chain().focus().toggleItalic().run(),children:(0,b.jsx)(y,{className:P})}),(0,b.jsx)(M,{title:"Underline",active:a.isActive("underline"),onAction:()=>a.chain().focus().toggleUnderline().run(),children:(0,b.jsx)(z,{className:P})}),(0,b.jsx)(M,{title:"Strikethrough",active:a.isActive("strike"),onAction:()=>a.chain().focus().toggleStrike().run(),children:(0,b.jsx)(A,{className:P})}),(0,b.jsx)(N,{}),(0,b.jsx)(M,{title:"Heading 1",active:a.isActive("heading",{level:1}),onAction:()=>a.chain().focus().toggleHeading({level:1}).run(),children:(0,b.jsx)(J,{className:P})}),(0,b.jsx)(M,{title:"Heading 2",active:a.isActive("heading",{level:2}),onAction:()=>a.chain().focus().toggleHeading({level:2}).run(),children:(0,b.jsx)(K,{className:P})}),(0,b.jsx)(N,{}),(0,b.jsx)(M,{title:"Bullet List",active:a.isActive("bulletList"),onAction:()=>a.chain().focus().toggleBulletList().run(),children:(0,b.jsx)(B,{className:P})}),(0,b.jsx)(M,{title:"Ordered List",active:a.isActive("orderedList"),onAction:()=>a.chain().focus().toggleOrderedList().run(),children:(0,b.jsx)(C,{className:P})}),(0,b.jsx)(N,{}),(0,b.jsx)(M,{title:"Align Left",active:a.isActive({textAlign:"left"}),onAction:()=>a.chain().focus().setTextAlign("left").run(),children:(0,b.jsx)(D,{className:P})}),(0,b.jsx)(M,{title:"Align Center",active:a.isActive({textAlign:"center"}),onAction:()=>a.chain().focus().setTextAlign("center").run(),children:(0,b.jsx)(E,{className:P})}),(0,b.jsx)(M,{title:"Align Right",active:a.isActive({textAlign:"right"}),onAction:()=>a.chain().focus().setTextAlign("right").run(),children:(0,b.jsx)(F,{className:P})}),(0,b.jsx)(N,{}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onMouseDown:b=>{b.preventDefault(),w.current=a.isActive("link")},onClick:()=>{w.current?a.chain().focus().unsetLink().run():(i("link"),k(""),m(""),o(""),q(a.state.selection.empty),f(!0))},className:(0,s.cn)("text-muted-foreground/70",a.isActive("link")&&"bg-accent text-foreground")}),children:a.isActive("link")?(0,b.jsx)(H,{className:P}):(0,b.jsx)(G,{className:P})}),(0,b.jsx)(t.TooltipContent,{children:a.isActive("link")?"Remove Link":"Insert Link"})]}),(0,b.jsx)(M,{title:"Insert Image",onAction:()=>{i("image"),k(""),m(""),f(!0)},children:(0,b.jsx)(I,{className:P})}),(0,b.jsx)(N,{}),(0,b.jsx)(M,{title:"Horizontal Rule",onAction:()=>a.chain().focus().setHorizontalRule().run(),children:(0,b.jsx)(L.default,{className:P})}),(0,b.jsx)(u.Dialog,{open:e,onOpenChange:f,children:(0,b.jsxs)(u.DialogContent,{children:[(0,b.jsx)(u.DialogHeader,{children:(0,b.jsx)(u.DialogTitle,{children:"link"===g?"Insert Link":"Insert Image"})}),"link"===g&&p&&(0,b.jsx)(v.Input,{ref:r,value:n,onChange:a=>o(a.target.value),onKeyDown:a=>{"Enter"===a.key&&Q()},placeholder:"Display text"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(v.Input,{ref:"image"!==g&&p?void 0:r,value:j,onChange:a=>{k(a.target.value),m("")},onKeyDown:a=>{"Enter"===a.key&&Q()},placeholder:"link"===g?"https://example.com":"https://example.com/image.png",type:"url","aria-invalid":!!l}),l&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:l})]}),(0,b.jsx)(u.DialogFooter,{children:(0,b.jsx)(h.Button,{onClick:Q,disabled:!j.trim(),children:"Insert"})})]})})]})}var P=a.i(921584),Q=a.i(17239),R=a.i(518828),S=a.i(16831),T=a.i(546257),U=a.i(390759);function V({fromAddress:d,onSend:e,onDiscard:f,initialTo:g="",initialSubject:i="",initialBody:o="",initialAttachments:q=[],inReplyTo:s,references:u}){let[w,x]=(0,c.useState)(g),[y,z]=(0,c.useState)(i),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(q),[E,F]=(0,c.useState)(!1),G=(0,c.useRef)(null),H=(0,j.useEditor)({immediatelyRender:!1,content:o||void 0,extensions:[k.default.configure({link:!1,underline:!1}),l.default.configure({placeholder:"Write your email..."}),m.default,n.default.configure({autolink:!0,openOnClick:!1,linkOnPaste:!0}),p.configure({types:["heading","paragraph"]}),r.configure({inline:!0,allowBase64:!0})],editorProps:{attributes:{class:"text-sm max-w-none focus:outline-none min-h-50 px-4 py-3"}}}),I=async()=>{if(w.trim()&&y.trim()&&H){B(!0);try{let a=H.getHTML();await e(w.trim(),y.trim(),a,C,s||u?{inReplyTo:s,references:u}:void 0)&&(x(""),z(""),D([]),H.commands.clearContent())}finally{B(!1)}}},J=async b=>{let c=b.target.files;if(c&&0!==c.length){F(!0);try{let{uploadEmailAttachment:b}=await a.A(81396);for(let a of Array.from(c)){if(a.size>0xa00000){P.toast.error(`${a.name} exceeds 10 MB limit`);continue}let c=new URLSearchParams(window.location.search).get("workspace_id")??"",d=await b(a,c);D(a=>[...a,d])}}catch{P.toast.error("Failed to upload attachment")}finally{F(!1),G.current&&(G.current.value="")}}};return(0,b.jsxs)("div",{className:"flex flex-col h-full w-full min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border/40 px-4 py-2",children:[(0,b.jsx)("h3",{className:"text-sm font-heading font-medium tracking-tight",children:"New Email"}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(h.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-7 px-2",onClick:f,disabled:A,children:[(0,b.jsx)(R.X,{className:"size-3 mr-1"}),"Discard"]}),(0,b.jsxs)(h.Button,{size:"sm",className:"text-xs h-7 px-3",onClick:I,disabled:A||!w.trim()||!y.trim(),children:[A?(0,b.jsx)(S.Loader2,{className:"size-3 mr-1 animate-spin"}):(0,b.jsx)(Q.Send,{className:"size-3 mr-1"}),"Send"]})]})]}),(0,b.jsxs)("div",{className:"border-b border-border/30 px-4 py-2.5 space-y-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"From"}),(0,b.jsx)("span",{className:"text-muted-foreground truncate min-w-0",children:d})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"To"}),(0,b.jsx)("div",{className:"flex-1 min-w-0 -ml-1.5 rounded-md bg-muted/40",children:(0,b.jsx)(v.Input,{type:"email",value:w,onChange:a=>x(a.target.value),placeholder:"recipient@example.com",className:"h-7 text-sm border-0 bg-transparent px-1.5 shadow-none focus-visible:ring-0 placeholder:text-muted-foreground/50",disabled:A})})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"Subject"}),(0,b.jsx)("div",{className:"flex-1 min-w-0 -ml-1.5 rounded-md bg-muted/40",children:(0,b.jsx)(v.Input,{value:y,onChange:a=>z(a.target.value),placeholder:"Email subject",className:"h-7 text-sm border-0 bg-transparent px-1.5 shadow-none focus-visible:ring-0 placeholder:text-muted-foreground/50",disabled:A})})]})]}),(0,b.jsxs)("div",{className:"flex items-center border-b border-border/30",children:[(0,b.jsx)(O,{editor:H}),(0,b.jsxs)("div",{className:"flex items-center gap-1 px-2 border-l border-border/30",children:[(0,b.jsx)("input",{ref:G,type:"file",multiple:!0,className:"hidden",onChange:J}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",disabled:E,onMouseDown:a=>a.preventDefault(),onClick:()=>G.current?.click(),className:"text-muted-foreground/70"}),children:E?(0,b.jsx)(S.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(T.Paperclip,{className:"size-3.5"})}),(0,b.jsx)(t.TooltipContent,{children:"Attach file"})]})]})]}),C.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5 px-4 py-2 border-b border-border/30",children:C.map(a=>{var c;return(0,b.jsxs)("div",{className:"flex items-center gap-1.5 rounded-md bg-muted px-2 py-1 text-xs",children:[(0,b.jsx)(U.File,{className:"size-3 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"truncate max-w-37.5",children:a.filename}),(0,b.jsx)("span",{className:"text-muted-foreground shrink-0",children:(c=a.size)<1024?`${c} B`:c<1048576?`${(c/1024).toFixed(1)} KB`:`${(c/1048576).toFixed(1)} MB`}),(0,b.jsx)("button",{type:"button",onClick:()=>{var b;return b=a.key,void D(a=>a.filter(a=>a.key!==b))},className:"text-muted-foreground hover:text-foreground ml-0.5 cursor-pointer",children:(0,b.jsx)(R.X,{className:"size-3"})})]},a.key)})}),(0,b.jsx)("div",{className:"flex-1 overflow-y-auto thin-scrollbar",children:(0,b.jsx)(j.EditorContent,{editor:H})})]})}var W=a.i(25668),X=a.i(321932),Y=a.i(606896),Z=a.i(109578),$=a.i(552012),_=a.i(415584);let aa=(0,w.default)("forward",[["path",{d:"m15 17 5-5-5-5",key:"nf172w"}],["path",{d:"M4 18v-2a4 4 0 0 1 4-4h12",key:"jmiej9"}]]),ab=(0,w.default)("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);var ac=a.i(584126),ad=a.i(549931);let ae=(0,w.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);var af=a.i(28429),ag=a.i(586220),ah=a.i(559745),ai=a.i(135510);function aj(a){let b=new Date(a),c=Math.floor((new Date().getTime()-b.getTime())/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d}h ago`;let e=Math.floor(d/24);return e<7?`${e}d ago`:b.toLocaleDateString(void 0,{month:"short",day:"numeric"})}a.s(["default",0,function(){let a=(0,d.useParams)().id,{workspaceId:j}=(0,e.useWorkspace)(),{agents:k,subscribeWs:l}=(0,f.useAgentContext)(),m=k.find(b=>b.id===a),n=(0,ag.useIsMobile)(),[o,p]=(0,c.useState)("inbox"),[q,r]=(0,c.useState)([]),u=(0,c.useMemo)(()=>q.filter(a=>"unread"===a.status).length,[q]),[v,w]=(0,c.useState)(!0),[x,y]=(0,c.useState)(null),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(!1),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)({}),[H,I]=(0,c.useState)([]),[J,K]=(0,c.useState)(null),[L,M]=(0,c.useState)({}),[N,O]=(0,c.useState)(!1),[R,ak]=(0,c.useState)(null),[al,am]=(0,c.useState)(!1),[an,ao]=(0,c.useState)([]),[ap,aq]=(0,c.useState)(!1),ar=(0,c.useCallback)(a=>{p(a),r([]),y(null),A(null),E(!1)},[]),as=m?.email_handle?`${m.email_handle}@alook.ai`:"",at=[...as?[{type:"alook",address:as}]:[],...an.map(a=>({type:"custom",address:a.email_address,accountId:a.id}))],[au,av]=(0,c.useState)(0),aw=at[au]??at[0]??null,ax=aw?.address??"",ay=aw?.type==="custom"?aw.accountId:void 0,az=q.find(a=>a.id===x)??null,aA=(0,c.useCallback)(async(b,c)=>{w(!0);try{let d=await (0,g.listEmails)(a,j,b,c);r(d)}catch{P.toast.error("Failed to load emails")}finally{w(!1)}},[a,j]);(0,c.useEffect)(()=>{(0,g.listEmailAccounts)(a,j).then(ao).catch(()=>{})},[a,j]),(0,c.useEffect)(()=>{aA(o,ax)},[o,ax,aA]),(0,c.useEffect)(()=>l(b=>{("email.received"===b.type&&b.agentId===a||"email.sent"===b.type&&b.agentId===a)&&aA(o,ax)}),[l,a,o,ax,aA]);let aB=async a=>{E(!1),y(a),A(null),C(!0),I([]),K(null),M({});try{let[b,c]=await Promise.all([(0,g.getEmailBody)(a,j),(0,g.getEmailThread)(a,j).catch(()=>[])]);A(b),I(c);let d=q.find(b=>b.id===a);d&&"unread"===d.status&&(0,g.updateEmailStatus)(a,j,"read").then(()=>{r(b=>b.map(b=>b.id===a?{...b,status:"read"}:b))}).catch(()=>{r(b=>b.map(b=>b.id===a?{...b,status:"unread"}:b))})}catch{A({content:"(body not available)",isHtml:!1})}finally{C(!1)}},aC=async a=>{if(J===a)return void K(null);if(K(a),!L[a])try{let b=await (0,g.getEmailBody)(a,j);M(c=>({...c,[a]:b}))}catch{M(b=>({...b,[a]:{content:"(body not available)",isHtml:!1}}))}},aD=async()=>{if(R){am(!0);try{await (0,g.deleteEmail)(R,j),r(a=>a.filter(a=>a.id!==R)),x===R&&(y(null),A(null)),P.toast.success("Email deleted")}catch{P.toast.error("Failed to delete email")}finally{am(!1),O(!1),ak(null)}}},aE=async(b,c,d,e,f)=>{try{return await (0,g.sendEmail)(a,b,c,d,j,e.length>0?e:void 0,f,ay),P.toast.success("Email sent"),E(!1),ar("sent"),!0}catch{return P.toast.error("Failed to send email"),!1}},aF=a=>`<br/><br/><div style="border-left: 2px solid #ccc; padding-left: 12px; margin-left: 0; color: #666;"><p><strong>From:</strong> ${a.from_email}<br/><strong>To:</strong> ${a.to_email}<br/><strong>Date:</strong> ${new Date(a.created_at).toLocaleString()}<br/><strong>Subject:</strong> ${a.subject}</p>`+(a.html_body?a.html_body:z?.isHtml?z.content:`<pre>${z?.content??""}</pre>`)+"</div>",aG=a=>({inReplyTo:a.message_id||void 0,references:[a.references,a.message_id].filter(Boolean).join(" ").trim()||void 0}),[aH,aI]=(0,c.useState)(!1),aJ=async()=>{if(ax)try{await navigator.clipboard.writeText(ax),aI(!0),setTimeout(()=>aI(!1),1500)}catch{P.toast.error("Failed to copy")}},aK=(0,b.jsxs)("div",{className:"flex h-full flex-col",children:[at.length>0?(0,b.jsx)("div",{className:"px-3 pt-3 pb-1 relative",children:1===at.length?(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:aJ,className:"group flex items-center gap-1.5 text-left cursor-pointer w-full"}),children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:ax}),aH?(0,b.jsx)(ad.Check,{className:"size-2.5 text-green-500 shrink-0"}):(0,b.jsx)(ac.Copy,{className:"size-2.5 text-muted-foreground/0 group-hover:text-muted-foreground/60 shrink-0 transition-colors"})]}),(0,b.jsx)(t.TooltipContent,{children:"Click to copy"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1 w-full",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>aq(!ap),className:"flex items-center gap-1 text-left cursor-pointer min-w-0 flex-1",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:ax}),(0,b.jsx)(af.ChevronDown,{className:"size-2.5 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:aJ,className:"shrink-0 p-0.5"}),children:aH?(0,b.jsx)(ad.Check,{className:"size-2.5 text-green-500"}):(0,b.jsx)(ac.Copy,{className:"size-2.5 text-muted-foreground/40 hover:text-muted-foreground/80 transition-colors"})}),(0,b.jsx)(t.TooltipContent,{children:"Copy address"})]})]}),ap&&(0,b.jsx)("div",{className:"absolute left-2 right-2 top-full mt-0.5 z-10 rounded-lg border border-border bg-popover shadow-md py-1",children:at.map((a,c)=>(0,b.jsxs)("button",{type:"button",onClick:()=>{av(c),aq(!1)},className:(0,s.cn)("flex items-center gap-2 w-full px-2.5 py-1.5 text-left text-xs transition-colors",c===au?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),children:[(0,b.jsx)(Y.Mail,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:a.address}),"custom"===a.type&&(0,b.jsx)("span",{className:"text-[9px] text-muted-foreground/60 shrink-0",children:"IMAP"})]},a.address))})]})}):(0,b.jsx)("div",{className:"px-3 pt-3 pb-1",children:(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:"No email configured"})}),(0,b.jsx)("div",{className:"p-2",children:(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(h.Button,{size:"sm",className:"w-full justify-start text-xs h-8 gap-1.5",onClick:()=>{G({}),E(!0),y(null)},disabled:0===at.length}),children:[(0,b.jsx)($.Plus,{className:"size-3.5"}),"New Email"]}),(0,b.jsx)(t.TooltipContent,{children:0===at.length?"Configure an email in agent settings to send emails":"Compose new email"})]})}),(0,b.jsxs)("nav",{className:"flex flex-col gap-0.5 px-2",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>ar("inbox"),className:(0,s.cn)("flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer","inbox"===o?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[(0,b.jsx)(Z.Inbox,{className:"size-4 shrink-0"}),"Inbox","inbox"===o&&u>0&&(0,b.jsx)("span",{className:"ml-auto text-xs bg-blue-500 text-white rounded-full px-1.5 py-0.5 leading-none min-w-5 text-center",children:u})]}),(0,b.jsxs)("button",{type:"button",onClick:()=>ar("sent"),className:(0,s.cn)("flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer","sent"===o?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[(0,b.jsx)(Q.Send,{className:"size-4 shrink-0"}),"Sent"]}),(0,b.jsxs)("button",{type:"button",onClick:()=>ar("untrust"),className:(0,s.cn)("flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer","untrust"===o?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[(0,b.jsx)(ae,{className:"size-4 shrink-0"}),"Untrust"]})]})]}),aL=(0,b.jsx)("div",{className:(0,s.cn)("h-full thin-scrollbar",q.length>0&&!v?"overflow-y-auto":"overflow-hidden"),children:v?(0,b.jsx)(b.Fragment,{children:Array.from({length:3}).map((a,c)=>(0,b.jsxs)("div",{className:"px-4 py-3 border-b border-border/30",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[(0,b.jsx)(W.Skeleton,{className:"h-3.5 w-32"}),(0,b.jsx)(W.Skeleton,{className:"h-2.5 w-10"})]}),(0,b.jsx)(W.Skeleton,{className:"h-3.5 w-48 mb-1.5"}),(0,b.jsx)(W.Skeleton,{className:"h-4 w-16 rounded-full"})]},c))}):0===q.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center h-full animate-[fade-up_400ms_ease-out_both]",children:[(0,b.jsx)(Y.Mail,{className:"size-8 text-muted-foreground mb-3"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"inbox"===o?"No emails from trusted senders":"sent"===o?"No emails sent yet":"No untrusted emails"})]}):q.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>aB(a.id),className:(0,s.cn)("w-full text-left px-4 py-3 border-b border-border/30 transition-colors duration-150 cursor-pointer",x===a.id?"bg-accent/60":"hover:bg-accent/30"),children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-0.5",children:[(0,b.jsx)("p",{className:(0,s.cn)("text-sm truncate","unread"===a.status?"font-semibold":"font-medium text-muted-foreground"),children:"sent"===o?a.to_email:a.from_email}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:["sent"!==o&&(0,b.jsx)("span",{className:(0,s.cn)("text-[10px] rounded-full px-1.5 py-0.5 leading-none font-medium","unread"===a.status?"bg-blue-500/15 text-blue-600 dark:text-blue-400":"bg-muted text-muted-foreground"),children:"unread"===a.status?"unread":"read"}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:aj(a.created_at)})]})]}),(0,b.jsx)("p",{className:(0,s.cn)("text-[13px] truncate","unread"===a.status?"text-foreground":"text-muted-foreground"),children:a.subject||"(no subject)"})]},a.id))}),aM=(0,b.jsx)("div",{className:"h-full overflow-auto flex flex-col min-w-0 thin-scrollbar",children:D?(0,b.jsx)(V,{fromAddress:ax,onSend:aE,onDiscard:()=>{E(!1),G({})},initialTo:F.to,initialSubject:F.subject,initialBody:F.body,initialAttachments:F.attachments,inReplyTo:F.inReplyTo,references:F.references},JSON.stringify(F)):az?(0,b.jsxs)("div",{className:"flex flex-col h-full md:min-w-100 max-w-3xl mx-auto w-full",children:[(0,b.jsxs)("div",{className:"flex items-center gap-0.5 border-b border-border/40 px-4 py-1.5",children:["sent"!==o&&(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground/60 hover:text-foreground",onClick:()=>{let a;return a=az.subject.startsWith("Re:")?az.subject:`Re: ${az.subject}`,void(y(null),G({to:az.from_email,subject:a,body:aF(az),...aG(az)}),E(!0))}}),children:(0,b.jsx)(ab,{className:"size-3.5"})}),(0,b.jsx)(t.TooltipContent,{children:"Reply"})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground/60 hover:text-foreground",onClick:()=>{let a;return a=az.subject.startsWith("Fwd:")?az.subject:`Fwd: ${az.subject}`,void(y(null),G({subject:a,body:aF(az),attachments:az.attachments??[],...aG(az)}),E(!0))}}),children:(0,b.jsx)(aa,{className:"size-3.5"})}),(0,b.jsx)(t.TooltipContent,{children:"Forward"})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground/60 hover:text-destructive",onClick:()=>{ak(az.id),O(!0)}}),children:(0,b.jsx)(_.Trash2,{className:"size-3.5"})}),(0,b.jsx)(t.TooltipContent,{children:"Delete"})]})]}),H.length>0&&(0,b.jsx)("div",{className:"border-b border-border/30",children:H.map(a=>(0,b.jsxs)("div",{className:"border-b border-border/20 last:border-b-0",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>aC(a.id),className:"w-full flex items-center gap-2 px-5 py-2.5 text-left hover:bg-accent/30 transition-colors cursor-pointer",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:J===a.id?"▾":"▸"}),(0,b.jsx)("span",{className:"text-sm font-medium truncate flex-1",children:a.from_email}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:aj(a.created_at)})]}),J===a.id&&(0,b.jsxs)("div",{className:"px-5 pb-3",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground mb-2",children:a.subject}),L[a.id]?L[a.id].isHtml?(0,b.jsx)(ai.EmailBodyFrame,{html:L[a.id].content,className:"max-w-full text-sm"}):(0,b.jsx)("div",{className:"text-sm whitespace-pre-wrap leading-[1.65] text-foreground",children:L[a.id].content}):(0,b.jsx)(S.Loader2,{className:"size-3 animate-spin text-muted-foreground"})]})]},a.id))}),(0,b.jsxs)("div",{className:"p-5",children:[(0,b.jsx)("h2",{className:"text-lg font-heading font-semibold tracking-tight mb-1",children:az.subject||"(no subject)"}),(0,b.jsxs)("div",{className:"text-sm space-y-1 mb-5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"From"}),(0,b.jsx)("span",{children:az.from_email})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"To"}),(0,b.jsx)("span",{children:az.to_email})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"sent"===o?"Sent":"Received"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:new Date(az.created_at).toLocaleString()})]})]}),B?(0,b.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,b.jsx)(S.Loader2,{className:"size-4 animate-spin text-muted-foreground"})}):az.html_body?(0,b.jsx)(ai.EmailBodyFrame,{html:az.html_body,className:"max-w-full"}):z?.isHtml?(0,b.jsx)(ai.EmailBodyFrame,{html:z.content,className:"max-w-full"}):(0,b.jsx)("div",{className:"text-sm whitespace-pre-wrap leading-[1.65] text-foreground",children:z?.content}),az.attachments&&az.attachments.length>0&&(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 mb-2 text-xs text-muted-foreground",children:[(0,b.jsx)(T.Paperclip,{className:"size-3"}),az.attachments.length," attachment",az.attachments.length>1?"s":""]}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:az.attachments.map((a,c)=>(0,b.jsxs)("a",{href:`/api/email/${az.id}/attachment/${c}?workspace_id=${j}`,target:"_blank",rel:"noopener noreferrer",download:a.filename,className:"flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/50 px-2.5 py-1.5 text-xs hover:bg-muted transition-colors cursor-pointer",children:[(0,b.jsx)(U.File,{className:"size-3 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"truncate max-w-45",children:a.filename}),(0,b.jsx)("span",{className:"text-muted-foreground shrink-0",children:a.size<1024?`${a.size} B`:a.size<1048576?`${(a.size/1024).toFixed(1)} KB`:`${(a.size/1048576).toFixed(1)} MB`})]},a.key))})]})]})]}):(0,b.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Select an email to view"})}),aN=D?(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/50 px-3 py-2",children:[(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{E(!1),G({})},children:(0,b.jsx)(X.ArrowLeft,{className:"size-4"})}),(0,b.jsx)("span",{className:"text-sm font-medium",children:"New Email"})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:aM})]}):x&&az?(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/50 px-3 py-2",children:[(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{y(null),A(null)},children:(0,b.jsx)(X.ArrowLeft,{className:"size-4"})}),(0,b.jsx)("span",{className:"text-sm font-medium truncate",children:az.subject||"(no subject)"})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:aM})]}):(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[at.length>1&&(0,b.jsxs)("div",{className:"relative px-3 pt-2 pb-1 border-b border-border/30",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>aq(!ap),className:"flex items-center gap-1 text-left cursor-pointer min-w-0 flex-1",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:ax}),(0,b.jsx)(af.ChevronDown,{className:"size-2.5 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:aJ,className:"shrink-0 p-0.5"}),children:aH?(0,b.jsx)(ad.Check,{className:"size-2.5 text-green-500"}):(0,b.jsx)(ac.Copy,{className:"size-2.5 text-muted-foreground/40 hover:text-muted-foreground/80 transition-colors"})}),(0,b.jsx)(t.TooltipContent,{children:"Copy address"})]})]}),ap&&(0,b.jsx)("div",{className:"absolute left-2 right-2 top-full mt-0.5 z-10 rounded-lg border border-border bg-popover shadow-md py-1",children:at.map((a,c)=>(0,b.jsxs)("button",{type:"button",onClick:()=>{av(c),aq(!1)},className:(0,s.cn)("flex items-center gap-2 w-full px-2.5 py-1.5 text-left text-xs transition-colors",c===au?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),children:[(0,b.jsx)(Y.Mail,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:a.address}),"custom"===a.type&&(0,b.jsx)("span",{className:"text-[9px] text-muted-foreground/60 shrink-0",children:"IMAP"})]},a.address))})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 border-b border-border/50 px-3 py-2",children:[(0,b.jsx)("div",{className:"flex items-center gap-0.5 flex-1 min-w-0",children:[{id:"inbox",label:"Inbox"},{id:"sent",label:"Sent"},{id:"untrust",label:"Untrust"}].map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>ar(a.id),className:(0,s.cn)("px-2.5 py-1 rounded-md text-xs font-medium transition-colors",o===a.id?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:[a.label,"inbox"===a.id&&"inbox"===o&&u>0&&(0,b.jsx)("span",{className:"ml-0.5 text-[10px] bg-blue-500 text-white rounded-full px-1 leading-none min-w-4 text-center",children:u})]},a.id))}),(0,b.jsx)(h.Button,{size:"icon-sm",variant:"ghost",onClick:()=>{G({}),E(!0),y(null)},disabled:0===at.length,children:(0,b.jsx)($.Plus,{className:"size-4"})})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:aL})]});return(0,b.jsxs)(b.Fragment,{children:[n?aN:(0,b.jsxs)(ah.ResizablePanelGroup,{orientation:"horizontal",children:[(0,b.jsx)(ah.ResizablePanel,{defaultSize:"15%",minSize:"10%",maxSize:"20%",children:aK}),(0,b.jsx)(ah.ResizableHandle,{withHandle:!0}),(0,b.jsx)(ah.ResizablePanel,{defaultSize:"30%",minSize:"15%",maxSize:"40%",children:aL}),(0,b.jsx)(ah.ResizableHandle,{withHandle:!0}),(0,b.jsx)(ah.ResizablePanel,{defaultSize:"55%",minSize:"25%",children:aM})]}),(0,b.jsx)(i.ConfirmDialog,{open:N,onOpenChange:O,title:"Delete email",description:"This will permanently delete this email.",loading:al,onConfirm:aD})]})}],221781)}];
|
|
1
|
+
module.exports=[221781,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(207058),e=a.i(506180),f=a.i(752792),g=a.i(588339);a.i(974936);var h=a.i(911509),i=a.i(732254),j=a.i(22902),k=a.i(623789),l=a.i(892236),m=a.i(807820),n=a.i(108275),o=a.i(632465),p=a.i(8607),q=p.Extension.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:a=>{let b=a.style.textAlign;return this.options.alignments.includes(b)?b:this.options.defaultAlignment},renderHTML:a=>a.textAlign?{style:`text-align: ${a.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:a=>({commands:b})=>!!this.options.alignments.includes(a)&&this.options.types.map(c=>b.updateAttributes(c,{textAlign:a})).some(a=>a),unsetTextAlign:()=>({commands:a})=>this.options.types.map(b=>a.resetAttributes(b,"textAlign")).some(a=>a),toggleTextAlign:a=>({editor:b,commands:c})=>!!this.options.alignments.includes(a)&&(b.isActive({textAlign:a})?c.unsetTextAlign():c.setTextAlign(a))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),r=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,s=p.Node.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:a}){return["img",(0,p.mergeAttributes)(this.options.HTMLAttributes,a)]},parseMarkdown:(a,b)=>b.createNode("image",{src:a.href,title:a.title,alt:a.text}),renderMarkdown:a=>{var b,c,d,e,f,g;let h=null!=(c=null==(b=a.attrs)?void 0:b.src)?c:"",i=null!=(e=null==(d=a.attrs)?void 0:d.alt)?e:"",j=null!=(g=null==(f=a.attrs)?void 0:f.title)?g:"";return j?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"u"<typeof document)return null;let{directions:a,minWidth:b,minHeight:c,alwaysPreserveAspectRatio:d}=this.options.resize;return({node:e,getPos:f,HTMLAttributes:g,editor:h})=>{let i=document.createElement("img");Object.entries(g).forEach(([a,b])=>{if(null!=b)switch(a){case"width":case"height":break;default:i.setAttribute(a,b)}}),i.src=g.src;let j=new p.ResizableNodeView({element:i,editor:h,node:e,getPos:f,onResize:(a,b)=>{i.style.width=`${a}px`,i.style.height=`${b}px`},onCommit:(a,b)=>{let c=f();void 0!==c&&this.editor.chain().setNodeSelection(c).updateAttributes(this.name,{width:a,height:b}).run()},onUpdate:(a,b,c)=>a.type===e.type,options:{directions:a,min:{width:b,height:c},preserveAspectRatio:!0===d}}),k=j.dom;return k.style.visibility="hidden",k.style.pointerEvents="none",i.onload=()=>{k.style.visibility="",k.style.pointerEvents=""},j}},addCommands(){return{setImage:a=>({commands:b})=>b.insertContent({type:this.name,attrs:a})}},addInputRules(){return[(0,p.nodeInputRule)({find:r,type:this.type,getAttributes:a=>{let[,,b,c,d]=a;return{src:c,alt:b,title:d}}})]}}),t=a.i(75118),u=a.i(525132),v=a.i(432340),w=a.i(334235),x=a.i(647651);let y=(0,x.default)("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]),z=(0,x.default)("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]),A=(0,x.default)("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]),B=(0,x.default)("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]),C=(0,x.default)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),D=(0,x.default)("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]),E=(0,x.default)("text-align-start",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]]),F=(0,x.default)("text-align-center",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]]),G=(0,x.default)("text-align-end",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]]),H=(0,x.default)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),I=(0,x.default)("unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]),J=(0,x.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),K=(0,x.default)("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]),L=(0,x.default)("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);var M=a.i(457655),M=M;function N({active:a,disabled:c,onAction:d,title:e,children:f}){return(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)(i.Button,{variant:"ghost",size:"icon-sm",disabled:c,onMouseDown:a=>a.preventDefault(),onClick:d,className:(0,t.cn)("text-muted-foreground/70",a&&"bg-accent text-foreground")}),children:f}),(0,b.jsx)(u.TooltipContent,{children:e})]})}function O(){return(0,b.jsx)("div",{className:"w-px h-4 bg-border/60 mx-0.5 shrink-0"})}function P({editor:a}){let[,d]=(0,c.useReducer)(a=>a+1,0),[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)("link"),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(!1),r=(0,c.useRef)(null),s=(0,c.useRef)(!1);if((0,c.useEffect)(()=>{if(!a)return;let b=()=>d();return a.on("transaction",b),()=>{a.off("transaction",b)}},[a]),(0,c.useEffect)(()=>{e&&setTimeout(()=>r.current?.focus(),0)},[e]),!a)return null;let x="size-3.5",Q=()=>{let b=j.trim();if(b){try{new URL(b)}catch{m("Please enter a valid URL");return}if(m(""),"link"===g)if(p){let c=n.trim()||b;a.chain().focus().insertContent({type:"text",text:c,marks:[{type:"link",attrs:{href:b}}]}).run()}else a.chain().focus().extendMarkRange("link").setLink({href:b}).run();else a.chain().focus().setImage({src:b}).run();f(!1)}};return(0,b.jsxs)("div",{className:"flex items-center gap-0.5 px-3 py-1 overflow-x-auto",children:[(0,b.jsx)(N,{title:"Bold",active:a.isActive("bold"),onAction:()=>a.chain().focus().toggleBold().run(),children:(0,b.jsx)(y,{className:x})}),(0,b.jsx)(N,{title:"Italic",active:a.isActive("italic"),onAction:()=>a.chain().focus().toggleItalic().run(),children:(0,b.jsx)(z,{className:x})}),(0,b.jsx)(N,{title:"Underline",active:a.isActive("underline"),onAction:()=>a.chain().focus().toggleUnderline().run(),children:(0,b.jsx)(A,{className:x})}),(0,b.jsx)(N,{title:"Strikethrough",active:a.isActive("strike"),onAction:()=>a.chain().focus().toggleStrike().run(),children:(0,b.jsx)(B,{className:x})}),(0,b.jsx)(O,{}),(0,b.jsx)(N,{title:"Heading 1",active:a.isActive("heading",{level:1}),onAction:()=>a.chain().focus().toggleHeading({level:1}).run(),children:(0,b.jsx)(K,{className:x})}),(0,b.jsx)(N,{title:"Heading 2",active:a.isActive("heading",{level:2}),onAction:()=>a.chain().focus().toggleHeading({level:2}).run(),children:(0,b.jsx)(L,{className:x})}),(0,b.jsx)(O,{}),(0,b.jsx)(N,{title:"Bullet List",active:a.isActive("bulletList"),onAction:()=>a.chain().focus().toggleBulletList().run(),children:(0,b.jsx)(C,{className:x})}),(0,b.jsx)(N,{title:"Ordered List",active:a.isActive("orderedList"),onAction:()=>a.chain().focus().toggleOrderedList().run(),children:(0,b.jsx)(D,{className:x})}),(0,b.jsx)(O,{}),(0,b.jsx)(N,{title:"Align Left",active:a.isActive({textAlign:"left"}),onAction:()=>a.chain().focus().setTextAlign("left").run(),children:(0,b.jsx)(E,{className:x})}),(0,b.jsx)(N,{title:"Align Center",active:a.isActive({textAlign:"center"}),onAction:()=>a.chain().focus().setTextAlign("center").run(),children:(0,b.jsx)(F,{className:x})}),(0,b.jsx)(N,{title:"Align Right",active:a.isActive({textAlign:"right"}),onAction:()=>a.chain().focus().setTextAlign("right").run(),children:(0,b.jsx)(G,{className:x})}),(0,b.jsx)(O,{}),(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onMouseDown:b=>{b.preventDefault(),s.current=a.isActive("link")},onClick:()=>{s.current?a.chain().focus().unsetLink().run():(h("link"),k(""),m(""),o(""),q(a.state.selection.empty),f(!0))},className:(0,t.cn)("text-muted-foreground/70",a.isActive("link")&&"bg-accent text-foreground")}),children:a.isActive("link")?(0,b.jsx)(I,{className:x}):(0,b.jsx)(H,{className:x})}),(0,b.jsx)(u.TooltipContent,{children:a.isActive("link")?"Remove Link":"Insert Link"})]}),(0,b.jsx)(N,{title:"Insert Image",onAction:()=>{h("image"),k(""),m(""),f(!0)},children:(0,b.jsx)(J,{className:x})}),(0,b.jsx)(O,{}),(0,b.jsx)(N,{title:"Horizontal Rule",onAction:()=>a.chain().focus().setHorizontalRule().run(),children:(0,b.jsx)(M.default,{className:x})}),(0,b.jsx)(v.Dialog,{open:e,onOpenChange:f,children:(0,b.jsxs)(v.DialogContent,{children:[(0,b.jsx)(v.DialogHeader,{children:(0,b.jsx)(v.DialogTitle,{children:"link"===g?"Insert Link":"Insert Image"})}),"link"===g&&p&&(0,b.jsx)(w.Input,{ref:r,value:n,onChange:a=>o(a.target.value),onKeyDown:a=>{"Enter"===a.key&&Q()},placeholder:"Display text"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(w.Input,{ref:"image"!==g&&p?void 0:r,value:j,onChange:a=>{k(a.target.value),m("")},onKeyDown:a=>{"Enter"===a.key&&Q()},placeholder:"link"===g?"https://example.com":"https://example.com/image.png",type:"url","aria-invalid":!!l}),l&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:l})]}),(0,b.jsx)(v.DialogFooter,{children:(0,b.jsx)(i.Button,{onClick:Q,disabled:!j.trim(),children:"Insert"})})]})})]})}var Q=a.i(921584),R=a.i(17239),S=a.i(518828),T=a.i(16831),U=a.i(546257),V=a.i(390759);function W({fromAddress:d,onSend:e,onDiscard:f,initialTo:g="",initialSubject:h="",initialBody:j="",initialAttachments:p=[],inReplyTo:r,references:t}){let[v,x]=(0,c.useState)(g),[y,z]=(0,c.useState)(h),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(p),[E,F]=(0,c.useState)(!1),G=(0,c.useRef)(null),H=(0,k.useEditor)({immediatelyRender:!1,content:j||void 0,extensions:[l.default.configure({link:!1,underline:!1}),m.default.configure({placeholder:"Write your email..."}),n.default,o.default.configure({autolink:!0,openOnClick:!1,linkOnPaste:!0}),q.configure({types:["heading","paragraph"]}),s.configure({inline:!0,allowBase64:!0})],editorProps:{attributes:{class:"text-sm max-w-none focus:outline-none min-h-50 px-4 py-3"}}}),I=async()=>{if(v.trim()&&y.trim()&&H){B(!0);try{let a=H.getHTML();await e(v.trim(),y.trim(),a,C,r||t?{inReplyTo:r,references:t}:void 0)&&(x(""),z(""),D([]),H.commands.clearContent())}finally{B(!1)}}},J=async b=>{let c=b.target.files;if(c&&0!==c.length){F(!0);try{let{uploadEmailAttachment:b}=await a.A(81396);for(let a of Array.from(c)){if(a.size>0xa00000){Q.toast.error(`${a.name} exceeds 10 MB limit`);continue}let c=new URLSearchParams(window.location.search).get("workspace_id")??"",d=await b(a,c);D(a=>[...a,d])}}catch{Q.toast.error("Failed to upload attachment")}finally{F(!1),G.current&&(G.current.value="")}}};return(0,b.jsxs)("div",{className:"flex flex-col h-full w-full min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border/40 px-4 py-2",children:[(0,b.jsx)("h3",{className:"text-sm font-heading font-medium tracking-tight",children:"New Email"}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-7 px-2",onClick:f,disabled:A,children:[(0,b.jsx)(S.X,{className:"size-3 mr-1"}),"Discard"]}),(0,b.jsxs)(i.Button,{size:"sm",className:"text-xs h-7 px-3",onClick:I,disabled:A||!v.trim()||!y.trim(),children:[A?(0,b.jsx)(T.Loader2,{className:"size-3 mr-1 animate-spin"}):(0,b.jsx)(R.Send,{className:"size-3 mr-1"}),"Send"]})]})]}),(0,b.jsxs)("div",{className:"border-b border-border/30 px-4 py-2.5 space-y-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"From"}),(0,b.jsx)("span",{className:"text-muted-foreground truncate min-w-0",children:d})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"To"}),(0,b.jsx)("div",{className:"flex-1 min-w-0 -ml-1.5 rounded-md bg-muted/40",children:(0,b.jsx)(w.Input,{type:"email",value:v,onChange:a=>x(a.target.value),placeholder:"recipient@example.com",className:"h-7 text-sm border-0 bg-transparent px-1.5 shadow-none focus-visible:ring-0 placeholder:text-muted-foreground/50",disabled:A})})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"Subject"}),(0,b.jsx)("div",{className:"flex-1 min-w-0 -ml-1.5 rounded-md bg-muted/40",children:(0,b.jsx)(w.Input,{value:y,onChange:a=>z(a.target.value),placeholder:"Email subject",className:"h-7 text-sm border-0 bg-transparent px-1.5 shadow-none focus-visible:ring-0 placeholder:text-muted-foreground/50",disabled:A})})]})]}),(0,b.jsxs)("div",{className:"flex items-center border-b border-border/30",children:[(0,b.jsx)(P,{editor:H}),(0,b.jsxs)("div",{className:"flex items-center gap-1 px-2 border-l border-border/30",children:[(0,b.jsx)("input",{ref:G,type:"file",multiple:!0,className:"hidden",onChange:J}),(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)(i.Button,{variant:"ghost",size:"icon-sm",disabled:E,onMouseDown:a=>a.preventDefault(),onClick:()=>G.current?.click(),className:"text-muted-foreground/70"}),children:E?(0,b.jsx)(T.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(U.Paperclip,{className:"size-3.5"})}),(0,b.jsx)(u.TooltipContent,{children:"Attach file"})]})]})]}),C.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5 px-4 py-2 border-b border-border/30",children:C.map(a=>{var c;return(0,b.jsxs)("div",{className:"flex items-center gap-1.5 rounded-md bg-muted px-2 py-1 text-xs",children:[(0,b.jsx)(V.File,{className:"size-3 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"truncate max-w-37.5",children:a.filename}),(0,b.jsx)("span",{className:"text-muted-foreground shrink-0",children:(c=a.size)<1024?`${c} B`:c<1048576?`${(c/1024).toFixed(1)} KB`:`${(c/1048576).toFixed(1)} MB`}),(0,b.jsx)("button",{type:"button",onClick:()=>{var b;return b=a.key,void D(a=>a.filter(a=>a.key!==b))},className:"text-muted-foreground hover:text-foreground ml-0.5 cursor-pointer",children:(0,b.jsx)(S.X,{className:"size-3"})})]},a.key)})}),(0,b.jsx)("div",{className:"flex-1 overflow-y-auto thin-scrollbar",children:(0,b.jsx)(k.EditorContent,{editor:H})})]})}var X=a.i(25668),Y=a.i(321932),Z=a.i(606896),$=a.i(109578),_=a.i(552012),aa=a.i(415584);let ab=(0,x.default)("forward",[["path",{d:"m15 17 5-5-5-5",key:"nf172w"}],["path",{d:"M4 18v-2a4 4 0 0 1 4-4h12",key:"jmiej9"}]]),ac=(0,x.default)("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);var ad=a.i(584126),ae=a.i(549931);let af=(0,x.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);var ag=a.i(28429),ah=a.i(586220),ai=a.i(559745),aj=a.i(135510);function ak(a){let b=new Date(a),c=Math.floor((new Date().getTime()-b.getTime())/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d}h ago`;let e=Math.floor(d/24);return e<7?`${e}d ago`:b.toLocaleDateString(void 0,{month:"short",day:"numeric"})}a.s(["default",0,function(){let a=(0,d.useParams)().id,{workspaceId:k}=(0,e.useWorkspace)(),{agents:l,subscribeWs:m}=(0,f.useAgentContext)(),n=l.find(b=>b.id===a),o=(0,ah.useIsMobile)(),[p,q]=(0,c.useState)("inbox"),[r,s]=(0,c.useState)([]),v=(0,c.useMemo)(()=>r.filter(a=>"unread"===a.status).length,[r]),[w,x]=(0,c.useState)(!0),[y,z]=(0,c.useState)(null),[A,B]=(0,c.useState)(null),[C,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)({}),[I,J]=(0,c.useState)([]),[K,L]=(0,c.useState)(null),[M,N]=(0,c.useState)({}),[O,P]=(0,c.useState)(!1),[S,al]=(0,c.useState)(null),[am,an]=(0,c.useState)(!1),[ao,ap]=(0,c.useState)([]),[aq,ar]=(0,c.useState)(!1),as=(0,c.useCallback)(a=>{q(a),s([]),z(null),B(null),F(!1)},[]),at=n?.email_handle?(0,h.toAlookAddress)(n.email_handle):"",au=[...at?[{type:"alook",address:at}]:[],...ao.map(a=>({type:"custom",address:a.email_address,accountId:a.id}))],[av,aw]=(0,c.useState)(0),ax=au[av]??au[0]??null,ay=ax?.address??"",az=ax?.type==="custom"?ax.accountId:void 0,aA=r.find(a=>a.id===y)??null,aB=(0,c.useCallback)(async(b,c)=>{x(!0);try{let d=await (0,g.listEmails)(a,k,b,c);s(d)}catch{Q.toast.error("Failed to load emails")}finally{x(!1)}},[a,k]);(0,c.useEffect)(()=>{(0,g.listEmailAccounts)(a,k).then(ap).catch(()=>{})},[a,k]),(0,c.useEffect)(()=>{aB(p,ay)},[p,ay,aB]),(0,c.useEffect)(()=>m(b=>{("email.received"===b.type&&b.agentId===a||"email.sent"===b.type&&b.agentId===a)&&aB(p,ay)}),[m,a,p,ay,aB]);let aC=async a=>{F(!1),z(a),B(null),D(!0),J([]),L(null),N({});try{let[b,c]=await Promise.all([(0,g.getEmailBody)(a,k),(0,g.getEmailThread)(a,k).catch(()=>[])]);B(b),J(c);let d=r.find(b=>b.id===a);d&&"unread"===d.status&&(0,g.updateEmailStatus)(a,k,"read").then(()=>{s(b=>b.map(b=>b.id===a?{...b,status:"read"}:b))}).catch(()=>{s(b=>b.map(b=>b.id===a?{...b,status:"unread"}:b))})}catch{B({content:"(body not available)",isHtml:!1})}finally{D(!1)}},aD=async a=>{if(K===a)return void L(null);if(L(a),!M[a])try{let b=await (0,g.getEmailBody)(a,k);N(c=>({...c,[a]:b}))}catch{N(b=>({...b,[a]:{content:"(body not available)",isHtml:!1}}))}},aE=async()=>{if(S){an(!0);try{await (0,g.deleteEmail)(S,k),s(a=>a.filter(a=>a.id!==S)),y===S&&(z(null),B(null)),Q.toast.success("Email deleted")}catch{Q.toast.error("Failed to delete email")}finally{an(!1),P(!1),al(null)}}},aF=async(b,c,d,e,f)=>{try{return await (0,g.sendEmail)(a,b,c,d,k,e.length>0?e:void 0,f,az),Q.toast.success("Email sent"),F(!1),as("sent"),!0}catch{return Q.toast.error("Failed to send email"),!1}},aG=a=>`<br/><br/><div style="border-left: 2px solid #ccc; padding-left: 12px; margin-left: 0; color: #666;"><p><strong>From:</strong> ${a.from_email}<br/><strong>To:</strong> ${a.to_email}<br/><strong>Date:</strong> ${new Date(a.created_at).toLocaleString()}<br/><strong>Subject:</strong> ${a.subject}</p>`+(a.html_body?a.html_body:A?.isHtml?A.content:`<pre>${A?.content??""}</pre>`)+"</div>",aH=a=>({inReplyTo:a.message_id||void 0,references:[a.references,a.message_id].filter(Boolean).join(" ").trim()||void 0}),[aI,aJ]=(0,c.useState)(!1),aK=async()=>{if(ay)try{await navigator.clipboard.writeText(ay),aJ(!0),setTimeout(()=>aJ(!1),1500)}catch{Q.toast.error("Failed to copy")}},aL=(0,b.jsxs)("div",{className:"flex h-full flex-col",children:[au.length>0?(0,b.jsx)("div",{className:"px-3 pt-3 pb-1 relative",children:1===au.length?(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsxs)(u.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:aK,className:"group flex items-center gap-1.5 text-left cursor-pointer w-full"}),children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:ay}),aI?(0,b.jsx)(ae.Check,{className:"size-2.5 text-green-500 shrink-0"}):(0,b.jsx)(ad.Copy,{className:"size-2.5 text-muted-foreground/0 group-hover:text-muted-foreground/60 shrink-0 transition-colors"})]}),(0,b.jsx)(u.TooltipContent,{children:"Click to copy"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-1 w-full",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>ar(!aq),className:"flex items-center gap-1 text-left cursor-pointer min-w-0 flex-1",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:ay}),(0,b.jsx)(ag.ChevronDown,{className:"size-2.5 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:aK,className:"shrink-0 p-0.5"}),children:aI?(0,b.jsx)(ae.Check,{className:"size-2.5 text-green-500"}):(0,b.jsx)(ad.Copy,{className:"size-2.5 text-muted-foreground/40 hover:text-muted-foreground/80 transition-colors"})}),(0,b.jsx)(u.TooltipContent,{children:"Copy address"})]})]}),aq&&(0,b.jsx)("div",{className:"absolute left-2 right-2 top-full mt-0.5 z-10 rounded-lg border border-border bg-popover shadow-md py-1",children:au.map((a,c)=>(0,b.jsxs)("button",{type:"button",onClick:()=>{aw(c),ar(!1)},className:(0,t.cn)("flex items-center gap-2 w-full px-2.5 py-1.5 text-left text-xs transition-colors",c===av?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),children:[(0,b.jsx)(Z.Mail,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:a.address}),"custom"===a.type&&(0,b.jsx)("span",{className:"text-[9px] text-muted-foreground/60 shrink-0",children:"IMAP"})]},a.address))})]})}):(0,b.jsx)("div",{className:"px-3 pt-3 pb-1",children:(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:"No email configured"})}),(0,b.jsx)("div",{className:"p-2",children:(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsxs)(u.TooltipTrigger,{render:(0,b.jsx)(i.Button,{size:"sm",className:"w-full justify-start text-xs h-8 gap-1.5",onClick:()=>{H({}),F(!0),z(null)},disabled:0===au.length}),children:[(0,b.jsx)(_.Plus,{className:"size-3.5"}),"New Email"]}),(0,b.jsx)(u.TooltipContent,{children:0===au.length?"Configure an email in agent settings to send emails":"Compose new email"})]})}),(0,b.jsxs)("nav",{className:"flex flex-col gap-0.5 px-2",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>as("inbox"),className:(0,t.cn)("flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer","inbox"===p?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[(0,b.jsx)($.Inbox,{className:"size-4 shrink-0"}),"Inbox","inbox"===p&&v>0&&(0,b.jsx)("span",{className:"ml-auto text-xs bg-blue-500 text-white rounded-full px-1.5 py-0.5 leading-none min-w-5 text-center",children:v})]}),(0,b.jsxs)("button",{type:"button",onClick:()=>as("sent"),className:(0,t.cn)("flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer","sent"===p?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[(0,b.jsx)(R.Send,{className:"size-4 shrink-0"}),"Sent"]}),(0,b.jsxs)("button",{type:"button",onClick:()=>as("untrust"),className:(0,t.cn)("flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm transition-colors cursor-pointer","untrust"===p?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[(0,b.jsx)(af,{className:"size-4 shrink-0"}),"Untrust"]})]})]}),aM=(0,b.jsx)("div",{className:(0,t.cn)("h-full thin-scrollbar",r.length>0&&!w?"overflow-y-auto":"overflow-hidden"),children:w?(0,b.jsx)(b.Fragment,{children:Array.from({length:3}).map((a,c)=>(0,b.jsxs)("div",{className:"px-4 py-3 border-b border-border/30",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[(0,b.jsx)(X.Skeleton,{className:"h-3.5 w-32"}),(0,b.jsx)(X.Skeleton,{className:"h-2.5 w-10"})]}),(0,b.jsx)(X.Skeleton,{className:"h-3.5 w-48 mb-1.5"}),(0,b.jsx)(X.Skeleton,{className:"h-4 w-16 rounded-full"})]},c))}):0===r.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center h-full animate-[fade-up_400ms_ease-out_both]",children:[(0,b.jsx)(Z.Mail,{className:"size-8 text-muted-foreground mb-3"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"inbox"===p?"No emails from trusted senders":"sent"===p?"No emails sent yet":"No untrusted emails"})]}):r.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>aC(a.id),className:(0,t.cn)("w-full text-left px-4 py-3 border-b border-border/30 transition-colors duration-150 cursor-pointer",y===a.id?"bg-accent/60":"hover:bg-accent/30"),children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-0.5",children:[(0,b.jsx)("p",{className:(0,t.cn)("text-sm truncate","unread"===a.status?"font-semibold":"font-medium text-muted-foreground"),children:"sent"===p?a.to_email:a.from_email}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:["sent"!==p&&(0,b.jsx)("span",{className:(0,t.cn)("text-[10px] rounded-full px-1.5 py-0.5 leading-none font-medium","unread"===a.status?"bg-blue-500/15 text-blue-600 dark:text-blue-400":"bg-muted text-muted-foreground"),children:"unread"===a.status?"unread":"read"}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:ak(a.created_at)})]})]}),(0,b.jsx)("p",{className:(0,t.cn)("text-[13px] truncate","unread"===a.status?"text-foreground":"text-muted-foreground"),children:a.subject||"(no subject)"})]},a.id))}),aN=(0,b.jsx)("div",{className:"h-full overflow-auto flex flex-col min-w-0 thin-scrollbar",children:E?(0,b.jsx)(W,{fromAddress:ay,onSend:aF,onDiscard:()=>{F(!1),H({})},initialTo:G.to,initialSubject:G.subject,initialBody:G.body,initialAttachments:G.attachments,inReplyTo:G.inReplyTo,references:G.references},JSON.stringify(G)):aA?(0,b.jsxs)("div",{className:"flex flex-col h-full md:min-w-100 max-w-3xl mx-auto w-full",children:[(0,b.jsxs)("div",{className:"flex items-center gap-0.5 border-b border-border/40 px-4 py-1.5",children:["sent"!==p&&(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)(i.Button,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground/60 hover:text-foreground",onClick:()=>{let a;return a=aA.subject.startsWith("Re:")?aA.subject:`Re: ${aA.subject}`,void(z(null),H({to:aA.from_email,subject:a,body:aG(aA),...aH(aA)}),F(!0))}}),children:(0,b.jsx)(ac,{className:"size-3.5"})}),(0,b.jsx)(u.TooltipContent,{children:"Reply"})]}),(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)(i.Button,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground/60 hover:text-foreground",onClick:()=>{let a;return a=aA.subject.startsWith("Fwd:")?aA.subject:`Fwd: ${aA.subject}`,void(z(null),H({subject:a,body:aG(aA),attachments:aA.attachments??[],...aH(aA)}),F(!0))}}),children:(0,b.jsx)(ab,{className:"size-3.5"})}),(0,b.jsx)(u.TooltipContent,{children:"Forward"})]}),(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)(i.Button,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground/60 hover:text-destructive",onClick:()=>{al(aA.id),P(!0)}}),children:(0,b.jsx)(aa.Trash2,{className:"size-3.5"})}),(0,b.jsx)(u.TooltipContent,{children:"Delete"})]})]}),I.length>0&&(0,b.jsx)("div",{className:"border-b border-border/30",children:I.map(a=>(0,b.jsxs)("div",{className:"border-b border-border/20 last:border-b-0",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>aD(a.id),className:"w-full flex items-center gap-2 px-5 py-2.5 text-left hover:bg-accent/30 transition-colors cursor-pointer",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:K===a.id?"▾":"▸"}),(0,b.jsx)("span",{className:"text-sm font-medium truncate flex-1",children:a.from_email}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:ak(a.created_at)})]}),K===a.id&&(0,b.jsxs)("div",{className:"px-5 pb-3",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground mb-2",children:a.subject}),M[a.id]?M[a.id].isHtml?(0,b.jsx)(aj.EmailBodyFrame,{html:M[a.id].content,className:"max-w-full text-sm"}):(0,b.jsx)("div",{className:"text-sm whitespace-pre-wrap leading-[1.65] text-foreground",children:M[a.id].content}):(0,b.jsx)(T.Loader2,{className:"size-3 animate-spin text-muted-foreground"})]})]},a.id))}),(0,b.jsxs)("div",{className:"p-5",children:[(0,b.jsx)("h2",{className:"text-lg font-heading font-semibold tracking-tight mb-1",children:aA.subject||"(no subject)"}),(0,b.jsxs)("div",{className:"text-sm space-y-1 mb-5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"From"}),(0,b.jsx)("span",{children:aA.from_email})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"To"}),(0,b.jsx)("span",{children:aA.to_email})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0",children:"sent"===p?"Sent":"Received"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:new Date(aA.created_at).toLocaleString()})]})]}),C?(0,b.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,b.jsx)(T.Loader2,{className:"size-4 animate-spin text-muted-foreground"})}):aA.html_body?(0,b.jsx)(aj.EmailBodyFrame,{html:aA.html_body,className:"max-w-full"}):A?.isHtml?(0,b.jsx)(aj.EmailBodyFrame,{html:A.content,className:"max-w-full"}):(0,b.jsx)("div",{className:"text-sm whitespace-pre-wrap leading-[1.65] text-foreground",children:A?.content}),aA.attachments&&aA.attachments.length>0&&(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 mb-2 text-xs text-muted-foreground",children:[(0,b.jsx)(U.Paperclip,{className:"size-3"}),aA.attachments.length," attachment",aA.attachments.length>1?"s":""]}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:aA.attachments.map((a,c)=>(0,b.jsxs)("a",{href:`/api/email/${aA.id}/attachment/${c}?workspace_id=${k}`,target:"_blank",rel:"noopener noreferrer",download:a.filename,className:"flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/50 px-2.5 py-1.5 text-xs hover:bg-muted transition-colors cursor-pointer",children:[(0,b.jsx)(V.File,{className:"size-3 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"truncate max-w-45",children:a.filename}),(0,b.jsx)("span",{className:"text-muted-foreground shrink-0",children:a.size<1024?`${a.size} B`:a.size<1048576?`${(a.size/1024).toFixed(1)} KB`:`${(a.size/1048576).toFixed(1)} MB`})]},a.key))})]})]})]}):(0,b.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Select an email to view"})}),aO=E?(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/50 px-3 py-2",children:[(0,b.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{F(!1),H({})},children:(0,b.jsx)(Y.ArrowLeft,{className:"size-4"})}),(0,b.jsx)("span",{className:"text-sm font-medium",children:"New Email"})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:aN})]}):y&&aA?(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/50 px-3 py-2",children:[(0,b.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{z(null),B(null)},children:(0,b.jsx)(Y.ArrowLeft,{className:"size-4"})}),(0,b.jsx)("span",{className:"text-sm font-medium truncate",children:aA.subject||"(no subject)"})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:aN})]}):(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[au.length>1&&(0,b.jsxs)("div",{className:"relative px-3 pt-2 pb-1 border-b border-border/30",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>ar(!aq),className:"flex items-center gap-1 text-left cursor-pointer min-w-0 flex-1",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:ay}),(0,b.jsx)(ag.ChevronDown,{className:"size-2.5 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:aK,className:"shrink-0 p-0.5"}),children:aI?(0,b.jsx)(ae.Check,{className:"size-2.5 text-green-500"}):(0,b.jsx)(ad.Copy,{className:"size-2.5 text-muted-foreground/40 hover:text-muted-foreground/80 transition-colors"})}),(0,b.jsx)(u.TooltipContent,{children:"Copy address"})]})]}),aq&&(0,b.jsx)("div",{className:"absolute left-2 right-2 top-full mt-0.5 z-10 rounded-lg border border-border bg-popover shadow-md py-1",children:au.map((a,c)=>(0,b.jsxs)("button",{type:"button",onClick:()=>{aw(c),ar(!1)},className:(0,t.cn)("flex items-center gap-2 w-full px-2.5 py-1.5 text-left text-xs transition-colors",c===av?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),children:[(0,b.jsx)(Z.Mail,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:a.address}),"custom"===a.type&&(0,b.jsx)("span",{className:"text-[9px] text-muted-foreground/60 shrink-0",children:"IMAP"})]},a.address))})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 border-b border-border/50 px-3 py-2",children:[(0,b.jsx)("div",{className:"flex items-center gap-0.5 flex-1 min-w-0",children:[{id:"inbox",label:"Inbox"},{id:"sent",label:"Sent"},{id:"untrust",label:"Untrust"}].map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>as(a.id),className:(0,t.cn)("px-2.5 py-1 rounded-md text-xs font-medium transition-colors",p===a.id?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:[a.label,"inbox"===a.id&&"inbox"===p&&v>0&&(0,b.jsx)("span",{className:"ml-0.5 text-[10px] bg-blue-500 text-white rounded-full px-1 leading-none min-w-4 text-center",children:v})]},a.id))}),(0,b.jsx)(i.Button,{size:"icon-sm",variant:"ghost",onClick:()=>{H({}),F(!0),z(null)},disabled:0===au.length,children:(0,b.jsx)(_.Plus,{className:"size-4"})})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:aM})]});return(0,b.jsxs)(b.Fragment,{children:[o?aO:(0,b.jsxs)(ai.ResizablePanelGroup,{orientation:"horizontal",children:[(0,b.jsx)(ai.ResizablePanel,{defaultSize:"15%",minSize:"10%",maxSize:"20%",children:aL}),(0,b.jsx)(ai.ResizableHandle,{withHandle:!0}),(0,b.jsx)(ai.ResizablePanel,{defaultSize:"30%",minSize:"15%",maxSize:"40%",children:aM}),(0,b.jsx)(ai.ResizableHandle,{withHandle:!0}),(0,b.jsx)(ai.ResizablePanel,{defaultSize:"55%",minSize:"25%",children:aN})]}),(0,b.jsx)(j.ConfirmDialog,{open:O,onOpenChange:P,title:"Delete email",description:"This will permanently delete this email.",loading:am,onConfirm:aE})]})}],221781)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_web_src_app_%28app%29_w_%5Bslug%5D_agents_%5Bid%5D_email_page_tsx_09mq1-g._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[812187,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(207058),e=a.i(26822),f=a.i(752792),g=a.i(506180),h=a.i(732254),i=a.i(22902),j=a.i(654461),k=a.i(75118);let l=(0,a.i(647651).default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var m=a.i(137993),n=a.i(334235),o=a.i(76592),p=a.i(889624),q=a.i(984078),r=a.i(588339),s=a.i(921584),t=a.i(224226);a.i(735132);var u=a.i(628508),v=a.i(325848);function w({ratio:a,size:c=16,stroke:d=1.5}){let e=(c-d)/2,f=2*Math.PI*e,g=(a<=0?0:a>=1?1:Math.log1p(99*a)/Math.log(100))*f;return(0,b.jsxs)("svg",{width:c,height:c,className:"shrink-0 -rotate-90","aria-hidden":!0,children:[(0,b.jsx)("circle",{cx:c/2,cy:c/2,r:e,fill:"none",stroke:"currentColor",strokeWidth:d,className:"text-border"}),(0,b.jsx)("circle",{cx:c/2,cy:c/2,r:e,fill:"none",stroke:"currentColor",strokeWidth:d,strokeDasharray:`${g} ${f-g}`,strokeLinecap:"round",className:(0,k.cn)("transition-all duration-300",a>.9?"text-destructive/70":a>.7?"text-yellow-500/50":"text-muted-foreground/30")})]})}function x({model:a,setModel:c,runtimeId:d,setRuntimeId:e,runtimes:f,providerModels:g}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(o.Label,{className:"text-xs text-muted-foreground",children:"Runtime"}),(0,b.jsx)(q.RuntimeSelect,{value:d,onValueChange:a=>{let b=f.find(a=>a.id===d)?.provider,g=f.find(b=>b.id===a)?.provider;e(a),b&&b!==g&&c("")},runtimes:f})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(o.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsx)(n.Input,{value:a,onChange:a=>c(a.target.value),placeholder:"Default (runtime model)",list:"agent-model-options-edit"}),g.length>0&&(0,b.jsx)("datalist",{id:"agent-model-options-edit",children:g.map(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"Optional. Leave blank to use the runtime's default model."})]})]})}function y({agent:a,runtimes:d,modelOptions:e,onSave:f,onCancel:i,saving:n}){let{workspaceId:o}=(0,g.useWorkspace)(),[q,z]=(0,c.useState)("general"),[A,B]=(0,c.useState)(a.name??""),[C,D]=(0,c.useState)(a.description??""),[E,F]=(0,c.useState)(a.runtime_id??""),[G,H]=(0,c.useState)(()=>(0,v.parseAvatarUrl)(a.avatar_url)??v.DEFAULT_CONFIG),[I,J]=(0,c.useState)(()=>{let b=a.runtime_config;return"string"==typeof b?.model?b.model:""}),[K,L]=(0,c.useState)(a.instructions??""),[M,N]=(0,c.useState)(a.instructions??""),O=(0,c.useRef)(K);(0,c.useEffect)(()=>{O.current=K},[K]);let P=(0,c.useRef)(M);(0,c.useEffect)(()=>{P.current=M},[M]);let Q=(0,c.useRef)(null),R=(0,c.useRef)(!1),S=(0,c.useRef)(()=>{}),T=(0,c.useCallback)(async()=>{if(R.current)return;let b=O.current;if(b!==P.current){R.current=!0;try{await (0,r.updateAgent)(a.id,{instructions:b},o),N(b)}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to save instructions")}finally{R.current=!1,O.current!==P.current&&S.current()}}},[a.id,o]),U=(0,c.useCallback)(()=>{Q.current&&clearTimeout(Q.current),Q.current=setTimeout(T,500)},[T]);(0,c.useEffect)(()=>{S.current=U},[U]);let V=(0,c.useCallback)(a=>{L(a),U()},[U]);(0,c.useEffect)(()=>{let b=()=>{if(Q.current&&clearTimeout(Q.current),O.current!==P.current){let b=new URLSearchParams({workspace_id:o});fetch(`/api/agents/${a.id}?${b}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({instructions:O.current}),keepalive:!0})}};return window.addEventListener("beforeunload",b),()=>window.removeEventListener("beforeunload",b)},[a.id,o]),(0,c.useEffect)(()=>()=>{if(Q.current&&clearTimeout(Q.current),O.current!==P.current){let b=new URLSearchParams({workspace_id:o});fetch(`/api/agents/${a.id}?${b}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({instructions:O.current}),keepalive:!0})}},[a.id,o]);let W=d.find(a=>a.id===E),X=W&&e?e[W.provider]??[]:[],Y=async a=>{a.preventDefault(),await f({name:A,description:C,runtime_id:E,runtime_config:I?{model:I}:{},avatar_url:(0,v.serializeAvatarConfig)(G)})},Z=[{id:"general",label:"General"},{id:"instruction",label:"Instruction"},{id:"runtime",label:"Runtime"},{id:"email",label:"Email"},{id:"permission",label:"Permission"}],$="general"===q||"runtime"===q||"email"===q,_=K.length/5e4;return(0,b.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,b.jsx)("nav",{className:"w-48 shrink-0 border-r border-border/50 py-3 px-2 hidden md:block",children:Z.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>z(a.id),className:(0,k.cn)("w-full rounded-md px-2.5 py-1.5 text-left text-sm transition-colors",q===a.id?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:a.label},a.id))}),(0,b.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,b.jsx)("div",{className:"px-4 pt-2 md:hidden",children:(0,b.jsx)(j.Tabs,{className:"items-center",value:q,onValueChange:a=>z(a),children:(0,b.jsx)(j.TabsList,{className:"h-auto gap-1",children:Z.map(a=>(0,b.jsx)(j.TabsTrigger,{value:a.id,children:a.label},a.id))})})}),"instruction"===q?(0,b.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,b.jsx)("div",{className:"flex-1 px-6 pt-4 pb-4 overflow-y-auto",children:(0,b.jsx)(p.MarkdownEditor,{value:K,onChange:V,placeholder:"Write instructions for this agent...",minHeight:"calc(100vh - 240px)",contentType:"markdown",variant:"seamless"})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 px-6 py-3 border-t border-border/50",children:[(0,b.jsx)(w,{ratio:_}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Agent-specific instruction. Your global instruction is prepended automatically."})]})]}):(0,b.jsx)("div",{className:"flex-1 overflow-y-auto thin-scrollbar px-5 py-6",children:$?(0,b.jsxs)("form",{onSubmit:Y,className:"mx-auto max-w-md space-y-4",children:["general"===q&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(u.AvatarPickerDialog,{config:G,onChange:H}),(0,b.jsx)(t.GeneralFields,{name:A,setName:B,description:C,setDescription:D,model:I,setModel:J,runtimeId:E,setRuntimeId:F,runtimes:[],providerModels:[]})]}),"runtime"===q&&(0,b.jsx)(x,{model:I,setModel:J,runtimeId:E,setRuntimeId:F,runtimes:d,providerModels:X}),"email"===q&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"rounded-lg border border-border/50 bg-muted/30 px-4 py-3",children:[(0,b.jsxs)("div",{className:"mb-2.5 flex items-center gap-1.5",children:[(0,b.jsx)(l,{className:"size-3 text-muted-foreground/60"}),(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground/60",children:"Set at creation"})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:"Email"}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a.email_handle?`${a.email_handle}@alook.ai`:"Not configured"})]})]}),(0,b.jsx)(m.CustomEmailForm,{agentId:a.id,workspaceId:a.workspace_id}),a.email_handle&&(0,b.jsx)("div",{className:"border-t border-border/50 pt-4 mt-4",children:(0,b.jsx)(t.AllowedSendersTab,{agentId:a.id})})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,b.jsx)(h.Button,{type:"button",variant:"ghost",size:"sm",onClick:i,children:"Cancel"}),(0,b.jsx)(h.Button,{type:"submit",size:"sm",disabled:n||!A,children:n?"Saving...":"Save"})]})]}):(0,b.jsx)(t.AgentAccessTab,{agentId:a.id,ownerId:a.owner_id})})]})]})}var z=a.i(953528),A=a.i(25668),B=a.i(191525),C=a.i(426619),D=a.i(858767),E=a.i(304377),F=a.i(606896),G=a.i(113010),H=a.i(945081),I=a.i(372443),J=a.i(415584),K=a.i(110025),L=a.i(518828),M=a.i(867561),N=a.i(525132);a.s(["default",0,function({children:a}){let j=(0,d.useParams)(),k=(0,d.useRouter)(),l=(0,d.usePathname)(),{slug:m}=(0,g.useWorkspace)(),n=(0,d.useSearchParams)(),o=j.id,p=!!n.get("conv"),q=l.includes("/activity")||p?"activity":l.includes("/meetings")?"meetings":l.includes("/email")?"email":l.includes("/files")?"files":"chat",{agents:s,runtimes:t,handleDeleteAgent:u,handleUpdateAgent:v}=(0,f.useAgentContext)(),w=s.find(a=>a.id===o),x=w?t.find(a=>a.id===w.runtime_id):null,O=x?.status==="online",{activeTaskCounts:P}=(0,f.useAgentContext)(),Q=P[o]??0,[R,S]=(0,c.useState)(!1),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)(!1),[Z,$]=(0,c.useState)({});return(0,c.useEffect)(()=>{(0,r.fetchModelOptions)().then($).catch(()=>{})},[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border/50 px-4 md:px-5 py-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[w?(0,b.jsx)(B.AgentStatusBadge,{isOnline:O,taskCount:Q,agentId:o}):(0,b.jsx)(A.Skeleton,{className:"size-2 rounded-full shrink-0"}),w?(0,b.jsxs)(N.Tooltip,{children:[(0,b.jsx)(N.TooltipTrigger,{render:(0,b.jsx)(e.default,{href:`/w/${m}/agents/${o}`,onClick:()=>S(!1),className:"text-sm font-medium truncate hover:text-foreground/80 transition-colors"}),children:w.name}),(0,b.jsx)(N.TooltipContent,{children:w.description||"No description"})]}):(0,b.jsx)(A.Skeleton,{className:"h-3.5 w-24"}),(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",R?"Settings":({email:"Email",meetings:"Meetings",activity:"Activity",files:"Files"})[q]??"Chat"]})]}),w?(0,b.jsx)("div",{className:"flex items-center gap-0.5 shrink-0",children:R?(0,b.jsxs)(h.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-7 gap-1 px-2",onClick:()=>S(!1),children:[(0,b.jsx)(L.X,{className:"size-3"}),"Cancel"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"hidden sm:flex items-center gap-0.5",children:[(0,b.jsxs)(e.default,{href:`/w/${m}/agents/${o}`,className:`group inline-flex items-center rounded-lg text-xs h-7 px-2 transition-all ${"chat"===q?"text-foreground bg-muted":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[(0,b.jsx)(G.MessageSquare,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:`overflow-hidden transition-all duration-500 ease-out ${"chat"===q?"max-w-16 opacity-100 ml-1":"max-w-0 opacity-0 group-hover:max-w-16 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300"}`,children:"Chat"})]}),(0,b.jsxs)(e.default,{href:`/w/${m}/agents/${o}/email`,className:`group inline-flex items-center rounded-lg text-xs h-7 px-2 transition-all ${"email"===q?"text-foreground bg-muted":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[(0,b.jsx)(F.Mail,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:`overflow-hidden transition-all duration-500 ease-out ${"email"===q?"max-w-16 opacity-100 ml-1":"max-w-0 opacity-0 group-hover:max-w-16 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300"}`,children:"Email"})]}),(0,b.jsxs)(e.default,{href:`/w/${m}/agents/${o}/meetings`,className:`group inline-flex items-center rounded-lg text-xs h-7 px-2 transition-all ${"meetings"===q?"text-foreground bg-muted":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[(0,b.jsx)(K.Video,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:`overflow-hidden transition-all duration-500 ease-out ${"meetings"===q?"max-w-20 opacity-100 ml-1":"max-w-0 opacity-0 group-hover:max-w-20 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300"}`,children:"Meetings"})]}),(0,b.jsxs)(e.default,{href:`/w/${m}/agents/${o}/activity`,className:`group inline-flex items-center rounded-lg text-xs h-7 px-2 transition-all ${"activity"===q?"text-foreground bg-muted":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[(0,b.jsx)(E.History,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:`overflow-hidden transition-all duration-500 ease-out ${"activity"===q?"max-w-16 opacity-100 ml-1":"max-w-0 opacity-0 group-hover:max-w-16 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300"}`,children:"Activity"})]}),(0,b.jsxs)(e.default,{href:`/w/${m}/agents/${o}/files`,className:`group inline-flex items-center rounded-lg text-xs h-7 px-2 transition-all ${"files"===q?"text-foreground bg-muted":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[(0,b.jsx)(C.FolderOpen,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:`overflow-hidden transition-all duration-500 ease-out ${"files"===q?"max-w-16 opacity-100 ml-1":"max-w-0 opacity-0 group-hover:max-w-16 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300"}`,children:"Files"})]}),(0,b.jsxs)(e.default,{href:`/w/${m}/threads?agentId=${o}`,className:"group inline-flex items-center rounded-lg text-xs text-muted-foreground h-7 px-2 hover:bg-muted hover:text-foreground transition-all",children:[(0,b.jsx)(D.GitBranch,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:"max-w-0 opacity-0 group-hover:max-w-20 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300 overflow-hidden transition-all duration-500 ease-out",children:"Threads"})]}),(0,b.jsx)("div",{className:"w-px h-4 bg-border mx-1"}),(0,b.jsxs)("button",{className:"group inline-flex items-center rounded-lg text-xs text-muted-foreground h-7 px-2 hover:bg-muted hover:text-foreground transition-all",onClick:()=>S(!0),children:[(0,b.jsx)(I.Pencil,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:"max-w-0 opacity-0 group-hover:max-w-12 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300 overflow-hidden transition-all duration-500 ease-out",children:"Edit"})]}),(0,b.jsxs)("button",{className:"group inline-flex items-center rounded-lg text-xs text-muted-foreground h-7 px-2 hover:bg-muted hover:text-destructive transition-all",onClick:()=>W(!0),children:[(0,b.jsx)(J.Trash2,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:"max-w-0 opacity-0 group-hover:max-w-16 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300 overflow-hidden transition-all duration-500 ease-out",children:"Remove"})]})]}),(0,b.jsx)("div",{className:"sm:hidden",children:(0,b.jsxs)(M.DropdownMenu,{children:[(0,b.jsx)(M.DropdownMenuTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground"}),children:(0,b.jsx)(H.MoreHorizontal,{className:"size-4"})}),(0,b.jsxs)(M.DropdownMenuContent,{align:"end",sideOffset:6,children:["chat"!==q&&(0,b.jsxs)(M.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/agents/${o}`),children:[(0,b.jsx)(G.MessageSquare,{className:"size-3.5"})," Chat"]}),"email"!==q&&(0,b.jsxs)(M.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/agents/${o}/email`),children:[(0,b.jsx)(F.Mail,{className:"size-3.5"})," Email"]}),"meetings"!==q&&(0,b.jsxs)(M.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/agents/${o}/meetings`),children:[(0,b.jsx)(K.Video,{className:"size-3.5"})," Meetings"]}),"activity"!==q&&(0,b.jsxs)(M.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/agents/${o}/activity`),children:[(0,b.jsx)(E.History,{className:"size-3.5"})," Activity"]}),"files"!==q&&(0,b.jsxs)(M.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/agents/${o}/files`),children:[(0,b.jsx)(C.FolderOpen,{className:"size-3.5"})," Files"]}),(0,b.jsxs)(M.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/threads?agentId=${o}`),children:[(0,b.jsx)(D.GitBranch,{className:"size-3.5"}),"Threads"]}),(0,b.jsx)(M.DropdownMenuSeparator,{}),(0,b.jsxs)(M.DropdownMenuItem,{onClick:()=>S(!0),children:[(0,b.jsx)(I.Pencil,{className:"size-3.5"}),"Edit"]}),(0,b.jsx)(M.DropdownMenuSeparator,{}),(0,b.jsxs)(M.DropdownMenuItem,{variant:"destructive",onClick:()=>W(!0),children:[(0,b.jsx)(J.Trash2,{className:"size-3.5"}),"Remove"]})]})]})})]})}):(0,b.jsx)("div",{className:"h-7 shrink-0"})]}),R&&w?(0,b.jsx)(y,{agent:w,runtimes:t,modelOptions:Z,saving:T,onCancel:()=>S(!1),onSave:async a=>{U(!0);try{let b=await v(w.id,a);return b&&S(!1),b}finally{U(!1)}}}):(0,b.jsxs)("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col",children:["chat"===q&&(0,b.jsx)(z.ChannelBar,{}),a]}),w&&(0,b.jsx)(i.ConfirmDialog,{open:V,onOpenChange:W,title:"Remove agent",description:`This will permanently delete "${w.name}" and all its conversations.`,loading:X,onConfirm:async()=>{Y(!0);try{await u(w.id)&&k.push(`/w/${m}/home`)}finally{Y(!1),W(!1)}}})]})}],812187)}];
|
|
1
|
+
module.exports=[812187,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(207058),e=a.i(26822),f=a.i(752792),g=a.i(506180),h=a.i(732254),i=a.i(22902),j=a.i(654461);a.i(974936);var k=a.i(911509),l=a.i(75118);let m=(0,a.i(647651).default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var n=a.i(137993),o=a.i(334235),p=a.i(76592),q=a.i(889624),r=a.i(984078),s=a.i(588339),t=a.i(921584),u=a.i(224226);a.i(735132);var v=a.i(628508),w=a.i(325848);function x({ratio:a,size:c=16,stroke:d=1.5}){let e=(c-d)/2,f=2*Math.PI*e,g=(a<=0?0:a>=1?1:Math.log1p(99*a)/Math.log(100))*f;return(0,b.jsxs)("svg",{width:c,height:c,className:"shrink-0 -rotate-90","aria-hidden":!0,children:[(0,b.jsx)("circle",{cx:c/2,cy:c/2,r:e,fill:"none",stroke:"currentColor",strokeWidth:d,className:"text-border"}),(0,b.jsx)("circle",{cx:c/2,cy:c/2,r:e,fill:"none",stroke:"currentColor",strokeWidth:d,strokeDasharray:`${g} ${f-g}`,strokeLinecap:"round",className:(0,l.cn)("transition-all duration-300",a>.9?"text-destructive/70":a>.7?"text-yellow-500/50":"text-muted-foreground/30")})]})}function y({model:a,setModel:c,runtimeId:d,setRuntimeId:e,runtimes:f,providerModels:g}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(p.Label,{className:"text-xs text-muted-foreground",children:"Runtime"}),(0,b.jsx)(r.RuntimeSelect,{value:d,onValueChange:a=>{let b=f.find(a=>a.id===d)?.provider,g=f.find(b=>b.id===a)?.provider;e(a),b&&b!==g&&c("")},runtimes:f})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(p.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsx)(o.Input,{value:a,onChange:a=>c(a.target.value),placeholder:"Default (runtime model)",list:"agent-model-options-edit"}),g.length>0&&(0,b.jsx)("datalist",{id:"agent-model-options-edit",children:g.map(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"Optional. Leave blank to use the runtime's default model."})]})]})}function z({agent:a,runtimes:d,modelOptions:e,onSave:f,onCancel:i,saving:o}){let{workspaceId:p}=(0,g.useWorkspace)(),[r,A]=(0,c.useState)("general"),[B,C]=(0,c.useState)(a.name??""),[D,E]=(0,c.useState)(a.description??""),[F,G]=(0,c.useState)(a.runtime_id??""),[H,I]=(0,c.useState)(()=>(0,w.parseAvatarUrl)(a.avatar_url)??w.DEFAULT_CONFIG),[J,K]=(0,c.useState)(()=>{let b=a.runtime_config;return"string"==typeof b?.model?b.model:""}),[L,M]=(0,c.useState)(a.instructions??""),[N,O]=(0,c.useState)(a.instructions??""),P=(0,c.useRef)(L);(0,c.useEffect)(()=>{P.current=L},[L]);let Q=(0,c.useRef)(N);(0,c.useEffect)(()=>{Q.current=N},[N]);let R=(0,c.useRef)(null),S=(0,c.useRef)(!1),T=(0,c.useRef)(()=>{}),U=(0,c.useCallback)(async()=>{if(S.current)return;let b=P.current;if(b!==Q.current){S.current=!0;try{await (0,s.updateAgent)(a.id,{instructions:b},p),O(b)}catch(a){t.toast.error(a instanceof Error?a.message:"Failed to save instructions")}finally{S.current=!1,P.current!==Q.current&&T.current()}}},[a.id,p]),V=(0,c.useCallback)(()=>{R.current&&clearTimeout(R.current),R.current=setTimeout(U,500)},[U]);(0,c.useEffect)(()=>{T.current=V},[V]);let W=(0,c.useCallback)(a=>{M(a),V()},[V]);(0,c.useEffect)(()=>{let b=()=>{if(R.current&&clearTimeout(R.current),P.current!==Q.current){let b=new URLSearchParams({workspace_id:p});fetch(`/api/agents/${a.id}?${b}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({instructions:P.current}),keepalive:!0})}};return window.addEventListener("beforeunload",b),()=>window.removeEventListener("beforeunload",b)},[a.id,p]),(0,c.useEffect)(()=>()=>{if(R.current&&clearTimeout(R.current),P.current!==Q.current){let b=new URLSearchParams({workspace_id:p});fetch(`/api/agents/${a.id}?${b}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({instructions:P.current}),keepalive:!0})}},[a.id,p]);let X=d.find(a=>a.id===F),Y=X&&e?e[X.provider]??[]:[],Z=async a=>{a.preventDefault(),await f({name:B,description:D,runtime_id:F,runtime_config:J?{model:J}:{},avatar_url:(0,w.serializeAvatarConfig)(H)})},$=[{id:"general",label:"General"},{id:"instruction",label:"Instruction"},{id:"runtime",label:"Runtime"},{id:"email",label:"Email"},{id:"permission",label:"Permission"}],_="general"===r||"runtime"===r||"email"===r,aa=L.length/5e4;return(0,b.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,b.jsx)("nav",{className:"w-48 shrink-0 border-r border-border/50 py-3 px-2 hidden md:block",children:$.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>A(a.id),className:(0,l.cn)("w-full rounded-md px-2.5 py-1.5 text-left text-sm transition-colors",r===a.id?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:a.label},a.id))}),(0,b.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,b.jsx)("div",{className:"px-4 pt-2 md:hidden",children:(0,b.jsx)(j.Tabs,{className:"items-center",value:r,onValueChange:a=>A(a),children:(0,b.jsx)(j.TabsList,{className:"h-auto gap-1",children:$.map(a=>(0,b.jsx)(j.TabsTrigger,{value:a.id,children:a.label},a.id))})})}),"instruction"===r?(0,b.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,b.jsx)("div",{className:"flex-1 px-6 pt-4 pb-4 overflow-y-auto",children:(0,b.jsx)(q.MarkdownEditor,{value:L,onChange:W,placeholder:"Write instructions for this agent...",minHeight:"calc(100vh - 240px)",contentType:"markdown",variant:"seamless"})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 px-6 py-3 border-t border-border/50",children:[(0,b.jsx)(x,{ratio:aa}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Agent-specific instruction. Your global instruction is prepended automatically."})]})]}):(0,b.jsx)("div",{className:"flex-1 overflow-y-auto thin-scrollbar px-5 py-6",children:_?(0,b.jsxs)("form",{onSubmit:Z,className:"mx-auto max-w-md space-y-4",children:["general"===r&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(v.AvatarPickerDialog,{config:H,onChange:I}),(0,b.jsx)(u.GeneralFields,{name:B,setName:C,description:D,setDescription:E,model:J,setModel:K,runtimeId:F,setRuntimeId:G,runtimes:[],providerModels:[]})]}),"runtime"===r&&(0,b.jsx)(y,{model:J,setModel:K,runtimeId:F,setRuntimeId:G,runtimes:d,providerModels:Y}),"email"===r&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"rounded-lg border border-border/50 bg-muted/30 px-4 py-3",children:[(0,b.jsxs)("div",{className:"mb-2.5 flex items-center gap-1.5",children:[(0,b.jsx)(m,{className:"size-3 text-muted-foreground/60"}),(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground/60",children:"Set at creation"})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:"Email"}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a.email_handle?(0,k.toAlookAddress)(a.email_handle):"Not configured"})]})]}),(0,b.jsx)(n.CustomEmailForm,{agentId:a.id,workspaceId:a.workspace_id}),a.email_handle&&(0,b.jsx)("div",{className:"border-t border-border/50 pt-4 mt-4",children:(0,b.jsx)(u.AllowedSendersTab,{agentId:a.id})})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,b.jsx)(h.Button,{type:"button",variant:"ghost",size:"sm",onClick:i,children:"Cancel"}),(0,b.jsx)(h.Button,{type:"submit",size:"sm",disabled:o||!B,children:o?"Saving...":"Save"})]})]}):(0,b.jsx)(u.AgentAccessTab,{agentId:a.id,ownerId:a.owner_id})})]})]})}var A=a.i(953528),B=a.i(25668),C=a.i(191525),D=a.i(426619),E=a.i(858767),F=a.i(304377),G=a.i(606896),H=a.i(113010),I=a.i(945081),J=a.i(372443),K=a.i(415584),L=a.i(110025),M=a.i(518828),N=a.i(867561),O=a.i(525132);a.s(["default",0,function({children:a}){let j=(0,d.useParams)(),k=(0,d.useRouter)(),l=(0,d.usePathname)(),{slug:m}=(0,g.useWorkspace)(),n=(0,d.useSearchParams)(),o=j.id,p=!!n.get("conv"),q=l.includes("/activity")||p?"activity":l.includes("/meetings")?"meetings":l.includes("/email")?"email":l.includes("/files")?"files":"chat",{agents:r,runtimes:t,handleDeleteAgent:u,handleUpdateAgent:v}=(0,f.useAgentContext)(),w=r.find(a=>a.id===o),x=w?t.find(a=>a.id===w.runtime_id):null,y=x?.status==="online",{activeTaskCounts:P}=(0,f.useAgentContext)(),Q=P[o]??0,[R,S]=(0,c.useState)(!1),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)(!1),[Z,$]=(0,c.useState)({});return(0,c.useEffect)(()=>{(0,s.fetchModelOptions)().then($).catch(()=>{})},[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border/50 px-4 md:px-5 py-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[w?(0,b.jsx)(C.AgentStatusBadge,{isOnline:y,taskCount:Q,agentId:o}):(0,b.jsx)(B.Skeleton,{className:"size-2 rounded-full shrink-0"}),w?(0,b.jsxs)(O.Tooltip,{children:[(0,b.jsx)(O.TooltipTrigger,{render:(0,b.jsx)(e.default,{href:`/w/${m}/agents/${o}`,onClick:()=>S(!1),className:"text-sm font-medium truncate hover:text-foreground/80 transition-colors"}),children:w.name}),(0,b.jsx)(O.TooltipContent,{children:w.description||"No description"})]}):(0,b.jsx)(B.Skeleton,{className:"h-3.5 w-24"}),(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",R?"Settings":({email:"Email",meetings:"Meetings",activity:"Activity",files:"Files"})[q]??"Chat"]})]}),w?(0,b.jsx)("div",{className:"flex items-center gap-0.5 shrink-0",children:R?(0,b.jsxs)(h.Button,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground h-7 gap-1 px-2",onClick:()=>S(!1),children:[(0,b.jsx)(M.X,{className:"size-3"}),"Cancel"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"hidden sm:flex items-center gap-0.5",children:[(0,b.jsxs)(e.default,{href:`/w/${m}/agents/${o}`,className:`group inline-flex items-center rounded-lg text-xs h-7 px-2 transition-all ${"chat"===q?"text-foreground bg-muted":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[(0,b.jsx)(H.MessageSquare,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:`overflow-hidden transition-all duration-500 ease-out ${"chat"===q?"max-w-16 opacity-100 ml-1":"max-w-0 opacity-0 group-hover:max-w-16 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300"}`,children:"Chat"})]}),(0,b.jsxs)(e.default,{href:`/w/${m}/agents/${o}/email`,className:`group inline-flex items-center rounded-lg text-xs h-7 px-2 transition-all ${"email"===q?"text-foreground bg-muted":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[(0,b.jsx)(G.Mail,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:`overflow-hidden transition-all duration-500 ease-out ${"email"===q?"max-w-16 opacity-100 ml-1":"max-w-0 opacity-0 group-hover:max-w-16 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300"}`,children:"Email"})]}),(0,b.jsxs)(e.default,{href:`/w/${m}/agents/${o}/meetings`,className:`group inline-flex items-center rounded-lg text-xs h-7 px-2 transition-all ${"meetings"===q?"text-foreground bg-muted":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[(0,b.jsx)(L.Video,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:`overflow-hidden transition-all duration-500 ease-out ${"meetings"===q?"max-w-20 opacity-100 ml-1":"max-w-0 opacity-0 group-hover:max-w-20 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300"}`,children:"Meetings"})]}),(0,b.jsxs)(e.default,{href:`/w/${m}/agents/${o}/activity`,className:`group inline-flex items-center rounded-lg text-xs h-7 px-2 transition-all ${"activity"===q?"text-foreground bg-muted":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[(0,b.jsx)(F.History,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:`overflow-hidden transition-all duration-500 ease-out ${"activity"===q?"max-w-16 opacity-100 ml-1":"max-w-0 opacity-0 group-hover:max-w-16 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300"}`,children:"Activity"})]}),(0,b.jsxs)(e.default,{href:`/w/${m}/agents/${o}/files`,className:`group inline-flex items-center rounded-lg text-xs h-7 px-2 transition-all ${"files"===q?"text-foreground bg-muted":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[(0,b.jsx)(D.FolderOpen,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:`overflow-hidden transition-all duration-500 ease-out ${"files"===q?"max-w-16 opacity-100 ml-1":"max-w-0 opacity-0 group-hover:max-w-16 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300"}`,children:"Files"})]}),(0,b.jsxs)(e.default,{href:`/w/${m}/threads?agentId=${o}`,className:"group inline-flex items-center rounded-lg text-xs text-muted-foreground h-7 px-2 hover:bg-muted hover:text-foreground transition-all",children:[(0,b.jsx)(E.GitBranch,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:"max-w-0 opacity-0 group-hover:max-w-20 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300 overflow-hidden transition-all duration-500 ease-out",children:"Threads"})]}),(0,b.jsx)("div",{className:"w-px h-4 bg-border mx-1"}),(0,b.jsxs)("button",{className:"group inline-flex items-center rounded-lg text-xs text-muted-foreground h-7 px-2 hover:bg-muted hover:text-foreground transition-all",onClick:()=>S(!0),children:[(0,b.jsx)(J.Pencil,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:"max-w-0 opacity-0 group-hover:max-w-12 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300 overflow-hidden transition-all duration-500 ease-out",children:"Edit"})]}),(0,b.jsxs)("button",{className:"group inline-flex items-center rounded-lg text-xs text-muted-foreground h-7 px-2 hover:bg-muted hover:text-destructive transition-all",onClick:()=>W(!0),children:[(0,b.jsx)(K.Trash2,{className:"size-3 shrink-0"}),(0,b.jsx)("span",{className:"max-w-0 opacity-0 group-hover:max-w-16 group-hover:opacity-100 group-hover:ml-1 group-hover:delay-300 overflow-hidden transition-all duration-500 ease-out",children:"Remove"})]})]}),(0,b.jsx)("div",{className:"sm:hidden",children:(0,b.jsxs)(N.DropdownMenu,{children:[(0,b.jsx)(N.DropdownMenuTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground"}),children:(0,b.jsx)(I.MoreHorizontal,{className:"size-4"})}),(0,b.jsxs)(N.DropdownMenuContent,{align:"end",sideOffset:6,children:["chat"!==q&&(0,b.jsxs)(N.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/agents/${o}`),children:[(0,b.jsx)(H.MessageSquare,{className:"size-3.5"})," Chat"]}),"email"!==q&&(0,b.jsxs)(N.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/agents/${o}/email`),children:[(0,b.jsx)(G.Mail,{className:"size-3.5"})," Email"]}),"meetings"!==q&&(0,b.jsxs)(N.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/agents/${o}/meetings`),children:[(0,b.jsx)(L.Video,{className:"size-3.5"})," Meetings"]}),"activity"!==q&&(0,b.jsxs)(N.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/agents/${o}/activity`),children:[(0,b.jsx)(F.History,{className:"size-3.5"})," Activity"]}),"files"!==q&&(0,b.jsxs)(N.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/agents/${o}/files`),children:[(0,b.jsx)(D.FolderOpen,{className:"size-3.5"})," Files"]}),(0,b.jsxs)(N.DropdownMenuItem,{onClick:()=>k.push(`/w/${m}/threads?agentId=${o}`),children:[(0,b.jsx)(E.GitBranch,{className:"size-3.5"}),"Threads"]}),(0,b.jsx)(N.DropdownMenuSeparator,{}),(0,b.jsxs)(N.DropdownMenuItem,{onClick:()=>S(!0),children:[(0,b.jsx)(J.Pencil,{className:"size-3.5"}),"Edit"]}),(0,b.jsx)(N.DropdownMenuSeparator,{}),(0,b.jsxs)(N.DropdownMenuItem,{variant:"destructive",onClick:()=>W(!0),children:[(0,b.jsx)(K.Trash2,{className:"size-3.5"}),"Remove"]})]})]})})]})}):(0,b.jsx)("div",{className:"h-7 shrink-0"})]}),R&&w?(0,b.jsx)(z,{agent:w,runtimes:t,modelOptions:Z,saving:T,onCancel:()=>S(!1),onSave:async a=>{U(!0);try{let b=await v(w.id,a);return b&&S(!1),b}finally{U(!1)}}}):(0,b.jsxs)("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col",children:["chat"===q&&(0,b.jsx)(A.ChannelBar,{}),a]}),w&&(0,b.jsx)(i.ConfirmDialog,{open:V,onOpenChange:W,title:"Remove agent",description:`This will permanently delete "${w.name}" and all its conversations.`,loading:X,onConfirm:async()=>{Y(!0);try{await u(w.id)&&k.push(`/w/${m}/home`)}finally{Y(!1),W(!1)}}})]})}],812187)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_web_src_app_%28app%29_w_%5Bslug%5D_agents_%5Bid%5D_layout_tsx_0juu2um._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[137993,370085,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(7455),h=a.i(525132),i=a.i(75118),j=a.i(588339),k=a.i(16831),l=a.i(606896),m=a.i(877014),n=a.i(123047),o=a.i(940723),p=a.i(143984),q=a.i(73270);let r=(0,a.i(647651).default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);a.s(["CircleHelp",0,r],370085);var s=a.i(921584),t=a.i(506180),u=a.i(390248);let v={Gmail:{imapHost:"imap.gmail.com",imapPort:993,smtpHost:"smtp.gmail.com",smtpPort:587},Outlook:{imapHost:"outlook.office365.com",imapPort:993,smtpHost:"smtp.office365.com",smtpPort:587},Yahoo:{imapHost:"imap.mail.yahoo.com",imapPort:993,smtpHost:"smtp.mail.yahoo.com",smtpPort:587}};function w({fields:a,applyPreset:c,errors:g,onClearError:h}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex gap-1.5",children:Object.keys(v).map(a=>(0,b.jsx)(d.Button,{type:"button",variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>c(a),children:a},a))}),(0,b.jsxs)("div",{className:"grid gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Email Address *"}),(0,b.jsx)(e.Input,{placeholder:"you@gmail.com",value:a.emailAddress,onChange:b=>{a.setEmailAddress(b.target.value),b.target.value.trim()&&h("emailAddress")},"aria-invalid":!!g.emailAddress,"aria-describedby":g.emailAddress?"custom-email-address-error":void 0,className:"h-8 text-sm"}),g.emailAddress&&(0,b.jsx)("p",{id:"custom-email-address-error",className:"mt-1 text-xs text-destructive",children:g.emailAddress})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Display Name"}),(0,b.jsx)(e.Input,{placeholder:"My Agent",value:a.displayName,onChange:b=>a.setDisplayName(b.target.value),className:"h-8 text-sm"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"IMAP (Receive)"}),(0,b.jsx)(e.Input,{placeholder:"imap.gmail.com",value:a.imapHost,onChange:b=>{a.setImapHost(b.target.value),b.target.value.trim()&&h("imapHost")},"aria-invalid":!!g.imapHost,"aria-describedby":g.imapHost?"custom-email-imap-host-error":void 0,className:"h-8 text-sm"}),g.imapHost&&(0,b.jsx)("p",{id:"custom-email-imap-host-error",className:"text-xs text-destructive",children:g.imapHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"993",value:a.imapPort,onChange:b=>a.setImapPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.imapUsername,onChange:b=>a.setImapUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.imapPassword,onChange:b=>{a.setImapPassword(b.target.value),b.target.value.trim()&&h("imapPassword")},"aria-invalid":!!g.imapPassword,"aria-describedby":g.imapPassword?"custom-email-imap-password-error":void 0,className:"h-8 text-sm"}),g.imapPassword&&(0,b.jsx)("p",{id:"custom-email-imap-password-error",className:"text-xs text-destructive",children:g.imapPassword})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"SMTP (Send)"}),(0,b.jsx)(e.Input,{placeholder:"smtp.gmail.com",value:a.smtpHost,onChange:b=>{a.setSmtpHost(b.target.value),b.target.value.trim()&&h("smtpHost")},"aria-invalid":!!g.smtpHost,"aria-describedby":g.smtpHost?"custom-email-smtp-host-error":void 0,className:"h-8 text-sm"}),g.smtpHost&&(0,b.jsx)("p",{id:"custom-email-smtp-host-error",className:"text-xs text-destructive",children:g.smtpHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"587",value:a.smtpPort,onChange:b=>a.setSmtpPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.smtpUsername,onChange:b=>a.setSmtpUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.smtpPassword,onChange:b=>{a.setSmtpPassword(b.target.value),b.target.value.trim()&&h("smtpPassword")},"aria-invalid":!!g.smtpPassword,"aria-describedby":g.smtpPassword?"custom-email-smtp-password-error":void 0,className:"h-8 text-sm"}),g.smtpPassword&&(0,b.jsx)("p",{id:"custom-email-smtp-password-error",className:"text-xs text-destructive",children:g.smtpPassword})]})]})]})}a.s(["CustomEmailForm",0,function({agentId:a,workspaceId:e,onDataChange:f,getDataRef:x}){let{slug:y}=(0,t.useWorkspace)(),z=!a,[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)([]),[E,F]=(0,c.useState)(!z),[G,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)({}),{fields:O,applyPreset:P,buildData:Q}=function(){let[a,b]=(0,c.useState)(""),[d,e]=(0,c.useState)(""),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(993),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(587),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),w=j||a,x=r||a;return{fields:{emailAddress:a,setEmailAddress:b,displayName:d,setDisplayName:e,imapHost:f,setImapHost:g,imapPort:h,setImapPort:i,imapUsername:j,setImapUsername:k,imapPassword:l,setImapPassword:m,smtpHost:n,setSmtpHost:o,smtpPort:p,setSmtpPort:q,smtpUsername:r,setSmtpUsername:s,smtpPassword:t,setSmtpPassword:u},applyPreset:function(a){let b=v[a];b&&(g(b.imapHost),i(b.imapPort),o(b.smtpHost),q(b.smtpPort))},buildData:function(){return a&&f&&w&&l&&n&&x&&t?{emailAddress:a,displayName:d,imapHost:f,imapPort:h,imapUsername:w,imapPassword:l,imapTls:!0,smtpHost:n,smtpPort:p,smtpUsername:x,smtpPassword:t,smtpTls:1,pollIntervalSeconds:60}:null}}}(),R=O.imapUsername||O.emailAddress,S=O.smtpUsername||O.emailAddress,T=(0,c.useCallback)(a=>{N(b=>({...b,[a]:void 0}))},[]);(0,c.useEffect)(()=>{x&&(x.current=Q)}),(0,c.useEffect)(()=>{z&&f?.(Q())},[z,Q,f,O.emailAddress,O.displayName,O.imapHost,O.imapPort,O.imapUsername,O.imapPassword,O.smtpHost,O.smtpPort,O.smtpUsername,O.smtpPassword]);let U=(0,c.useCallback)(async()=>{if(!z)try{let b=await (0,j.listEmailAccounts)(a,e);D(b)}catch{}finally{F(!1)}},[a,e,z]);(0,c.useEffect)(()=>{U()},[U]);let V=C[0]??null;async function W(){let b=(0,u.validateCustomEmailFields)({emailAddress:O.emailAddress,imapHost:O.imapHost,imapUsername:R,imapPassword:O.imapPassword,smtpHost:O.smtpHost,smtpUsername:S,smtpPassword:O.smtpPassword});if(N(b),(0,u.hasCustomEmailErrors)(b))return;let c=Q();if(c&&a){H(!0);try{await (0,j.createEmailAccount)(a,c,e),s.toast.success("Custom email configured"),B(!1),await U()}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to save")}finally{H(!1)}}}async function X(){if(V&&a){L(!0);try{await (0,j.deleteEmailAccount)(a,V.id,e),s.toast.success("Custom email removed"),D([])}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to remove")}finally{L(!1)}}}async function Y(){if(V&&a){J(!0);try{await (0,j.syncEmailAccount)(a,V.id,e),s.toast.success("Sync triggered"),setTimeout(()=>U(),2e3)}catch(a){s.toast.error(a instanceof Error?a.message:"Sync failed")}finally{J(!1)}}}let Z=z?O.emailAddress?O.emailAddress:"Connect your own mailbox via IMAP/SMTP":E?"Loading...":V?V.email_address:"Connect your own mailbox via IMAP/SMTP";return(0,b.jsxs)(g.Sheet,{open:A,onOpenChange:B,children:[(0,b.jsxs)(g.SheetTrigger,{render:(0,b.jsx)("button",{type:"button",className:"flex w-full items-center justify-between rounded-lg border border-border/50 bg-muted/30 px-4 py-3 text-left transition-colors hover:bg-muted/50"}),children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:"Custom Email"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:Z})]}),!z&&V?(0,b.jsxs)("span",{className:(0,i.cn)("inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full font-medium shrink-0","active"===V.status?"bg-green-500/10 text-green-600":"error"===V.status?"bg-red-500/10 text-red-600":"bg-yellow-500/10 text-yellow-600"),children:["active"===V.status?(0,b.jsx)(o.CheckCircle2,{className:"size-2.5"}):"error"===V.status?(0,b.jsx)(n.AlertCircle,{className:"size-2.5"}):null,V.status]}):(0,b.jsx)(p.ChevronRight,{className:"size-4 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(g.SheetContent,{side:"right",className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border",children:[(0,b.jsx)(g.SheetTitle,{className:"sr-only",children:"Custom Email"}),(0,b.jsx)(g.SheetBody,{className:"px-8 pt-10 pb-6",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"font-heading text-lg font-semibold",children:"Custom Email"}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)("a",{href:`/w/${y}/help/email-setup`,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors"}),children:(0,b.jsx)(r,{className:"size-4"})}),(0,b.jsx)(h.TooltipContent,{children:"How to get IMAP/SMTP credentials"})]})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect your own mailbox to send and receive email as your identity."})]}),!z&&V?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(l.Mail,{className:"size-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm truncate",children:V.email_address})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:Y,disabled:I,className:"rounded-full text-muted-foreground"}),children:(0,b.jsx)(m.RefreshCw,{className:(0,i.cn)("size-3.5",I&&"animate-spin")})}),(0,b.jsx)(h.TooltipContent,{children:"Sync now"})]}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:X,disabled:K,className:"rounded-full text-muted-foreground hover:bg-destructive/10 hover:text-destructive"}),children:K?(0,b.jsx)(k.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(q.XIcon,{className:"size-3.5"})}),(0,b.jsx)(h.TooltipContent,{children:"Remove"})]})]})]}),V.error_message&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:V.error_message}),V.last_synced_at&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Last synced: ",new Date(V.last_synced_at).toLocaleString()]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/50 px-3 py-2 text-xs text-muted-foreground space-y-1",children:[(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"IMAP"}),(0,b.jsxs)("span",{children:[V.imap_host,":",V.imap_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"SMTP"}),(0,b.jsxs)("span",{children:[V.smtp_host,":",V.smtp_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"Poll interval"}),(0,b.jsxs)("span",{children:[V.poll_interval_seconds,"s"]})]})]})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(w,{fields:O,applyPreset:P,errors:M,onClearError:T}),!z&&(0,b.jsxs)(d.Button,{type:"button",size:"sm",className:"w-full",onClick:W,disabled:G,children:[G&&(0,b.jsx)(k.Loader2,{className:"size-3 animate-spin mr-1"}),"Save & Connect"]}),z&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Will be connected after creating the agent."})]})]})})]})]})}],137993)},224226,984078,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(354498),h=a.i(432340),i=a.i(74414);function j({value:a,onValueChange:c,runtimes:d,disabled:e,triggerProps:f}){let h=function(a){let b=new Map;for(let c of a){let a=c.daemon_id||c.id;b.has(a)||b.set(a,{label:("string"==typeof c.device_info?c.device_info:"")||a,runtimes:[]}),b.get(a).runtimes.push(c)}return b}(d),k=e||0===d.length||d.every(a=>"online"!==a.status);return(0,b.jsxs)(g.Select,{value:a,onValueChange:a=>{a&&c(a)},disabled:k,items:d.map(a=>{let b=("string"==typeof a.device_info?a.device_info:"")||"",c=b?`${a.provider} (${b})`:a.provider;return{value:a.id,label:c}}),children:[(0,b.jsx)(g.SelectTrigger,{...f,children:(0,b.jsx)(g.SelectValue,{placeholder:0===d.length?"No runtimes — start a daemon first":d.every(a=>"online"!==a.status)?"All runtimes offline":"Select a runtime"})}),(0,b.jsx)(g.SelectContent,{children:Array.from(h.entries()).map(([a,c])=>(0,b.jsxs)(g.SelectGroup,{children:[(0,b.jsx)(g.SelectLabel,{className:"truncate",children:c.label}),c.runtimes.map(a=>(0,b.jsx)(g.SelectItem,{value:a.id,disabled:"online"!==a.status,children:(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4"}),(0,b.jsx)("span",{children:a.provider}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:["(",a.status,")"]})]})},a.id))]},a))})]})}a.s(["RuntimeSelect",0,j],984078),a.i(974936),process.env.ALOOK_DOMAIN;let k=/^[a-zA-Z0-9-]{3,}$/,l=new Set(["no-reply","noreply","admin","support","help","info","postmaster","abuse","security","mailer-daemon","root","webmaster","hostmaster","system","alook"]);function m(a){return k.test(a)&&!l.has(a.toLowerCase())}var n=a.i(75118),o=a.i(647651);let p=(0,o.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var q=a.i(73270);let r=(0,o.default)("dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);var s=a.i(28429),t=a.i(506180),u=a.i(588339),v=a.i(446827),w=a.i(921584),x=a.i(973111),y=a.i(27647);function z({children:a}){let[d,e]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"pt-1",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>e(!d),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,b.jsx)(s.ChevronDown,{className:(0,n.cn)("size-3.5 transition-transform",d&&"rotate-180")}),"Advanced"]}),d&&(0,b.jsx)("div",{className:"mt-3 space-y-4",children:a})]})}a.s(["AgentAccessTab",0,function({agentId:e,ownerId:f}){let{workspaceId:i}=(0,t.useWorkspace)(),[j,k]=(0,c.useState)("private"),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)([]),[p,r]=(0,c.useState)([]),[s,y]=(0,c.useState)(!0),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(""),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let a=!1;return y(!0),Promise.all([(0,u.listAgentAccess)(i,e),(0,u.listMembers)(i)]).then(([b,c])=>{a||(o(b),r(c))}).catch(b=>{a||(b instanceof v.ApiError&&403===b.status?A(b.message):A("Failed to load access list"))}).finally(()=>{a||y(!1)}),()=>{a=!0}},[i,e]),(0,c.useEffect)(()=>{a.A(81396).then(({listAgents:a})=>{a(i).then(a=>{let b=a.find(a=>a.id===e);b&&k(b.visibility??"private")}).catch(()=>{})})},[i,e]);let J=async a=>{k(a),m(!0);try{await (0,u.updateAgent)(e,{visibility:a},i),w.toast.success("public"===a?"Agent is now public":"Agent is now private")}catch{k(j),w.toast.error("Failed to update visibility")}finally{m(!1)}},K=p.find(a=>a.user_id===f),L=new Set(n.map(a=>a.user_id)),M=p.filter(a=>!L.has(a.user_id)&&a.user_id!==f),N=async a=>{if(a&&!D){E(!0),A(null);try{await (0,u.grantAgentAccess)(i,e,a);let b=p.find(b=>b.user_id===a);b&&o(c=>[...c,{id:a,user_id:b.user_id,name:b.name,email:b.email,created_at:new Date().toISOString()}]),C(""),w.toast.success("Access granted")}catch(a){A(a instanceof Error?a.message:"Failed to grant access")}finally{E(!1)}}},O=async()=>{if(F){o(a=>a.filter(a=>a.user_id!==F.user_id)),G(null),A(null);try{await (0,u.revokeAgentAccess)(i,e,F.user_id,H),w.toast.success(H?"Access revoked and removed from whitelist":"Access revoked")}catch{o(n),A("Failed to revoke access")}}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-6",children:[(0,b.jsx)("div",{className:"space-y-4 rounded-lg border border-border/50 p-4",children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Visibility"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"public"===j?"All workspace members can use this agent":"Only authorized members can use this agent"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:l?"Saving…":"public"===j?"Public":"Private"}),(0,b.jsx)(x.Switch,{checked:"public"===j,onCheckedChange:a=>J(a?"public":"private"),disabled:l})]})]})}),"private"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Authorized Members"}),z&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:z}),s?(0,b.jsx)("div",{className:"space-y-2",children:[1,2].map(a=>(0,b.jsx)("span",{className:"block h-10 animate-pulse rounded-md bg-muted"},a))}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[K&&(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:K.name||K.email}),K.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:K.email})]}),(0,b.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground",children:"Owner"})]}),n.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:a.name||a.email}),a.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.email})]}),(0,b.jsx)("button",{type:"button",onClick:()=>{var b;let c;return b=a.user_id,void((c=n.find(a=>a.user_id===b))&&(G(c),I(!0)))},className:"ml-2 shrink-0 rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.user_id))]}),M.length>0?(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsxs)(g.Select,{value:B,onValueChange:a=>{a&&(C(a),N(a))},children:[(0,b.jsx)(g.SelectTrigger,{className:"flex-1 text-xs",children:(0,b.jsx)(g.SelectValue,{placeholder:"Add a member..."})}),(0,b.jsx)(g.SelectContent,{children:M.map(a=>(0,b.jsx)(g.SelectItem,{value:a.user_id,children:a.name||a.email},a.user_id))})]})}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"All workspace members have been added. Invite new members from workspace settings."})]})]}),(0,b.jsx)(h.Dialog,{open:!!F,onOpenChange:a=>{a||G(null)},children:(0,b.jsxs)(h.DialogContent,{children:[(0,b.jsxs)(h.DialogHeader,{children:[(0,b.jsx)(h.DialogTitle,{children:"Remove Member Access"}),(0,b.jsxs)(h.DialogDescription,{children:["Remove"," ",(0,b.jsx)("span",{className:"font-medium text-foreground",children:F?.name||F?.email})," ","from this agent?"]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer px-1",children:[(0,b.jsx)("input",{type:"checkbox",checked:H,onChange:a=>I(a.target.checked),className:"size-4 rounded border-border accent-primary"}),(0,b.jsx)("span",{className:"text-sm",children:"Also remove from email whitelist"})]}),(0,b.jsxs)(h.DialogFooter,{children:[(0,b.jsx)(h.DialogClose,{render:(0,b.jsx)(d.Button,{variant:"outline",size:"sm"}),children:"Cancel"}),(0,b.jsx)(d.Button,{size:"sm",variant:"destructive",onClick:O,children:"Remove"})]})]})})]})},"AllowedSendersTab",0,function({agentId:a}){let{workspaceId:f}=(0,t.useWorkspace)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(!0),[m,n]=(0,c.useState)(!1),[o,r]=(0,c.useState)(null),[s,v]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let b=!1;return l(!0),(0,u.listWhitelist)(a,f).then(a=>{b||h(a)}).catch(()=>{b||r("Failed to load whitelist")}).finally(()=>{b||l(!1)}),()=>{b=!0}},[a,f]),(0,c.useEffect)(()=>{let b=!1;return(0,u.listAgents)(f).then(c=>{b||v(c.filter(b=>b.id!==a&&b.email_handle).length>0)}).catch(()=>{}),()=>{b=!0}},[a,f]);let w=i.includes("@")&&i.trim().length>0,x=async()=>{if(w&&!m){n(!0),r(null);try{let b=await (0,u.addWhitelistEmail)(a,i.toLowerCase(),f);h(a=>[...a,b]),j("")}catch(a){r(a instanceof Error?a.message:"Failed to add email")}finally{n(!1)}}},y=async b=>{h(a=>a.filter(a=>a.id!==b)),r(null);try{await (0,u.removeWhitelistEmail)(a,b,f)}catch{h(g),r("Failed to remove email")}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Allowed Senders"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Only emails from these addresses will trigger this agent. Applies to all configured email addresses (alook.ai handle and custom email)."}),s&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground/70 mt-1.5 flex items-center gap-1",children:[(0,b.jsx)(p,{className:"size-3 shrink-0"}),"Agents in this workspace can already email each other — no whitelist entry needed."]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Input,{value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),x())},placeholder:"user@example.com",type:"email",className:"flex-1"}),(0,b.jsx)(d.Button,{type:"button",size:"sm",variant:"secondary",disabled:!w||m,onClick:x,children:m?"Adding...":"Add"})]}),o&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:o}),k?(0,b.jsx)("div",{className:"space-y-2",children:[1,2,3].map(a=>(0,b.jsx)("span",{className:"block h-8 animate-pulse rounded-md bg-muted"},a))}):0===g.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No allowed senders — all inbound emails will be rejected."}):(0,b.jsx)("div",{className:"space-y-1.5",children:g.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsx)("span",{className:"text-sm",children:a.email}),(0,b.jsx)("button",{type:"button",onClick:()=>y(a.id),className:"rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(q.XIcon,{className:"size-3.5"})})]},a.id))})]})},"EmailHandleField",0,function({emailHandle:a,setEmailHandle:c,derivedHandle:d}){let e=a||d,g=e&&!m(e)?"Must be 3+ characters, letters/numbers/hyphens only":"";return(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Email"}),(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("input",{id:"agent-handle",value:a,onChange:a=>c(a.target.value.toLowerCase()),placeholder:d||"my-agent",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),(0,b.jsx)("span",{className:"shrink-0 text-sm text-muted-foreground/70",children:"@alook.ai"})]}),g&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:g})]})},"GeneralFields",0,function({name:a,setName:c,description:d,setDescription:e,instructions:g,setInstructions:h,model:k,setModel:l,runtimeId:m,setRuntimeId:o,runtimes:p,providerModels:q,errors:s,runtimeAsRadio:t=!1,onShuffle:u,emailHandleSlot:v,advancedSection:w}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("input",{id:"agent-name",value:a,onChange:a=>c(a.target.value),placeholder:"Agent name",required:!0,autoFocus:!0,"aria-invalid":!!s?.name,"aria-describedby":s?.name?"agent-name-error":void 0,className:"w-full border-0 bg-transparent px-0 py-1 text-2xl font-medium leading-[1.2] tracking-tight shadow-none outline-none placeholder:text-muted-foreground/40 placeholder:font-normal focus-visible:ring-0"}),u&&(0,b.jsx)("button",{type:"button",onClick:u,"aria-label":"Randomize name",className:"absolute right-0 top-1/2 -translate-y-1/2 rounded p-1.5 text-muted-foreground/50 hover:text-foreground hover:bg-accent transition-colors",children:(0,b.jsx)(r,{className:"size-4"})})]}),s?.name&&(0,b.jsx)("p",{id:"agent-name-error",className:"text-xs text-destructive mt-1",children:s.name})]}),(0,b.jsx)(y.AutoResizeTextarea,{id:"agent-description",value:d,onChange:a=>e(a.target.value),placeholder:"Add a description…",rows:1,className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),v,(t||p.length>0)&&(0,b.jsxs)("div",{id:"agent-runtime-select",className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Runtime"}),t?(0,b.jsx)("div",{className:"space-y-1.5",role:"radiogroup","aria-label":"Runtime",children:0===p.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"No runtimes — start a daemon first"}):p.map(a=>{let c="online"===a.status,d=m===a.id,e="string"==typeof a.device_info?a.device_info:"";return(0,b.jsxs)("label",{className:(0,n.cn)("flex items-center gap-2.5 rounded-lg border p-2.5 cursor-pointer transition-colors",d?"border-primary bg-primary/5":"border-border/50 hover:border-foreground/20",!c&&"opacity-40 pointer-events-none"),children:[(0,b.jsx)("input",{type:"radio",name:"runtime",value:a.id,checked:d,disabled:!c,onChange:()=>{let b=p.find(a=>a.id===m)?.provider,c=a.provider;o(a.id),b&&b!==c&&l("")},className:"accent-primary size-3.5"}),(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-sm",children:a.provider}),e&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:e}),!c&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:"offline"})]},a.id)})}):(0,b.jsx)(j,{value:m,onValueChange:a=>{let b=p.find(a=>a.id===m)?.provider,c=p.find(b=>b.id===a)?.provider;o(a),b&&b!==c&&l("")},runtimes:p,triggerProps:{"aria-invalid":!!s?.runtimeId,"aria-describedby":s?.runtimeId?"agent-runtime-error":void 0}}),s?.runtimeId&&(0,b.jsx)("p",{id:"agent-runtime-error",className:"text-xs text-destructive",children:s.runtimeId})]}),(h||w)&&(0,b.jsxs)(z,{children:[h&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Instructions"}),(0,b.jsx)(y.AutoResizeTextarea,{id:"agent-instructions",value:g??"",onChange:a=>h(a.target.value),placeholder:"System prompt or instructions...",rows:3,className:"w-full border-0 bg-transparent px-0 py-1 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsx)("input",{id:"agent-model",value:k,onChange:a=>l(a.target.value),placeholder:"Default (runtime model)",list:"agent-model-options",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),q.length>0&&(0,b.jsx)("datalist",{id:"agent-model-options",children:q.map(a=>(0,b.jsx)("option",{value:a},a))})]}),w]})]})},"getHandleError",0,function(a){return a&&!m(a)?"Must be 3+ characters, letters/numbers/hyphens only":""},"nameToHandle",0,function(a){return a.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-|-$/g,"")}],224226)}];
|
|
1
|
+
module.exports=[137993,370085,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(7455),h=a.i(525132),i=a.i(75118),j=a.i(588339),k=a.i(16831),l=a.i(606896),m=a.i(877014),n=a.i(123047),o=a.i(940723),p=a.i(143984),q=a.i(73270);let r=(0,a.i(647651).default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);a.s(["CircleHelp",0,r],370085);var s=a.i(921584),t=a.i(506180),u=a.i(390248);let v={Gmail:{imapHost:"imap.gmail.com",imapPort:993,smtpHost:"smtp.gmail.com",smtpPort:587},Outlook:{imapHost:"outlook.office365.com",imapPort:993,smtpHost:"smtp.office365.com",smtpPort:587},Yahoo:{imapHost:"imap.mail.yahoo.com",imapPort:993,smtpHost:"smtp.mail.yahoo.com",smtpPort:587}};function w({fields:a,applyPreset:c,errors:g,onClearError:h}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex gap-1.5",children:Object.keys(v).map(a=>(0,b.jsx)(d.Button,{type:"button",variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>c(a),children:a},a))}),(0,b.jsxs)("div",{className:"grid gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Email Address *"}),(0,b.jsx)(e.Input,{placeholder:"you@gmail.com",value:a.emailAddress,onChange:b=>{a.setEmailAddress(b.target.value),b.target.value.trim()&&h("emailAddress")},"aria-invalid":!!g.emailAddress,"aria-describedby":g.emailAddress?"custom-email-address-error":void 0,className:"h-8 text-sm"}),g.emailAddress&&(0,b.jsx)("p",{id:"custom-email-address-error",className:"mt-1 text-xs text-destructive",children:g.emailAddress})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(f.Label,{className:"text-xs",children:"Display Name"}),(0,b.jsx)(e.Input,{placeholder:"My Agent",value:a.displayName,onChange:b=>a.setDisplayName(b.target.value),className:"h-8 text-sm"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"IMAP (Receive)"}),(0,b.jsx)(e.Input,{placeholder:"imap.gmail.com",value:a.imapHost,onChange:b=>{a.setImapHost(b.target.value),b.target.value.trim()&&h("imapHost")},"aria-invalid":!!g.imapHost,"aria-describedby":g.imapHost?"custom-email-imap-host-error":void 0,className:"h-8 text-sm"}),g.imapHost&&(0,b.jsx)("p",{id:"custom-email-imap-host-error",className:"text-xs text-destructive",children:g.imapHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"993",value:a.imapPort,onChange:b=>a.setImapPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.imapUsername,onChange:b=>a.setImapUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.imapPassword,onChange:b=>{a.setImapPassword(b.target.value),b.target.value.trim()&&h("imapPassword")},"aria-invalid":!!g.imapPassword,"aria-describedby":g.imapPassword?"custom-email-imap-password-error":void 0,className:"h-8 text-sm"}),g.imapPassword&&(0,b.jsx)("p",{id:"custom-email-imap-password-error",className:"text-xs text-destructive",children:g.imapPassword})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(f.Label,{className:"text-xs font-medium",children:"SMTP (Send)"}),(0,b.jsx)(e.Input,{placeholder:"smtp.gmail.com",value:a.smtpHost,onChange:b=>{a.setSmtpHost(b.target.value),b.target.value.trim()&&h("smtpHost")},"aria-invalid":!!g.smtpHost,"aria-describedby":g.smtpHost?"custom-email-smtp-host-error":void 0,className:"h-8 text-sm"}),g.smtpHost&&(0,b.jsx)("p",{id:"custom-email-smtp-host-error",className:"text-xs text-destructive",children:g.smtpHost}),(0,b.jsx)(e.Input,{type:"number",placeholder:"587",value:a.smtpPort,onChange:b=>a.setSmtpPort(Number(b.target.value)),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{placeholder:a.emailAddress||"Username (defaults to email)",value:a.smtpUsername,onChange:b=>a.setSmtpUsername(b.target.value),className:"h-8 text-sm"}),(0,b.jsx)(e.Input,{type:"password",placeholder:"App Password",value:a.smtpPassword,onChange:b=>{a.setSmtpPassword(b.target.value),b.target.value.trim()&&h("smtpPassword")},"aria-invalid":!!g.smtpPassword,"aria-describedby":g.smtpPassword?"custom-email-smtp-password-error":void 0,className:"h-8 text-sm"}),g.smtpPassword&&(0,b.jsx)("p",{id:"custom-email-smtp-password-error",className:"text-xs text-destructive",children:g.smtpPassword})]})]})]})}a.s(["CustomEmailForm",0,function({agentId:a,workspaceId:e,onDataChange:f,getDataRef:x}){let{slug:y}=(0,t.useWorkspace)(),z=!a,[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)([]),[E,F]=(0,c.useState)(!z),[G,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)({}),{fields:O,applyPreset:P,buildData:Q}=function(){let[a,b]=(0,c.useState)(""),[d,e]=(0,c.useState)(""),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(993),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(587),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),w=j||a,x=r||a;return{fields:{emailAddress:a,setEmailAddress:b,displayName:d,setDisplayName:e,imapHost:f,setImapHost:g,imapPort:h,setImapPort:i,imapUsername:j,setImapUsername:k,imapPassword:l,setImapPassword:m,smtpHost:n,setSmtpHost:o,smtpPort:p,setSmtpPort:q,smtpUsername:r,setSmtpUsername:s,smtpPassword:t,setSmtpPassword:u},applyPreset:function(a){let b=v[a];b&&(g(b.imapHost),i(b.imapPort),o(b.smtpHost),q(b.smtpPort))},buildData:function(){return a&&f&&w&&l&&n&&x&&t?{emailAddress:a,displayName:d,imapHost:f,imapPort:h,imapUsername:w,imapPassword:l,imapTls:!0,smtpHost:n,smtpPort:p,smtpUsername:x,smtpPassword:t,smtpTls:1,pollIntervalSeconds:60}:null}}}(),R=O.imapUsername||O.emailAddress,S=O.smtpUsername||O.emailAddress,T=(0,c.useCallback)(a=>{N(b=>({...b,[a]:void 0}))},[]);(0,c.useEffect)(()=>{x&&(x.current=Q)}),(0,c.useEffect)(()=>{z&&f?.(Q())},[z,Q,f,O.emailAddress,O.displayName,O.imapHost,O.imapPort,O.imapUsername,O.imapPassword,O.smtpHost,O.smtpPort,O.smtpUsername,O.smtpPassword]);let U=(0,c.useCallback)(async()=>{if(!z)try{let b=await (0,j.listEmailAccounts)(a,e);D(b)}catch{}finally{F(!1)}},[a,e,z]);(0,c.useEffect)(()=>{U()},[U]);let V=C[0]??null;async function W(){let b=(0,u.validateCustomEmailFields)({emailAddress:O.emailAddress,imapHost:O.imapHost,imapUsername:R,imapPassword:O.imapPassword,smtpHost:O.smtpHost,smtpUsername:S,smtpPassword:O.smtpPassword});if(N(b),(0,u.hasCustomEmailErrors)(b))return;let c=Q();if(c&&a){H(!0);try{await (0,j.createEmailAccount)(a,c,e),s.toast.success("Custom email configured"),B(!1),await U()}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to save")}finally{H(!1)}}}async function X(){if(V&&a){L(!0);try{await (0,j.deleteEmailAccount)(a,V.id,e),s.toast.success("Custom email removed"),D([])}catch(a){s.toast.error(a instanceof Error?a.message:"Failed to remove")}finally{L(!1)}}}async function Y(){if(V&&a){J(!0);try{await (0,j.syncEmailAccount)(a,V.id,e),s.toast.success("Sync triggered"),setTimeout(()=>U(),2e3)}catch(a){s.toast.error(a instanceof Error?a.message:"Sync failed")}finally{J(!1)}}}let Z=z?O.emailAddress?O.emailAddress:"Connect your own mailbox via IMAP/SMTP":E?"Loading...":V?V.email_address:"Connect your own mailbox via IMAP/SMTP";return(0,b.jsxs)(g.Sheet,{open:A,onOpenChange:B,children:[(0,b.jsxs)(g.SheetTrigger,{render:(0,b.jsx)("button",{type:"button",className:"flex w-full items-center justify-between rounded-lg border border-border/50 bg-muted/30 px-4 py-3 text-left transition-colors hover:bg-muted/50"}),children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:"Custom Email"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:Z})]}),!z&&V?(0,b.jsxs)("span",{className:(0,i.cn)("inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full font-medium shrink-0","active"===V.status?"bg-green-500/10 text-green-600":"error"===V.status?"bg-red-500/10 text-red-600":"bg-yellow-500/10 text-yellow-600"),children:["active"===V.status?(0,b.jsx)(o.CheckCircle2,{className:"size-2.5"}):"error"===V.status?(0,b.jsx)(n.AlertCircle,{className:"size-2.5"}):null,V.status]}):(0,b.jsx)(p.ChevronRight,{className:"size-4 text-muted-foreground shrink-0"})]}),(0,b.jsxs)(g.SheetContent,{side:"right",className:"data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:rounded-xl data-[side=right]:sm:border",children:[(0,b.jsx)(g.SheetTitle,{className:"sr-only",children:"Custom Email"}),(0,b.jsx)(g.SheetBody,{className:"px-8 pt-10 pb-6",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"font-heading text-lg font-semibold",children:"Custom Email"}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)("a",{href:`/w/${y}/help/email-setup`,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors"}),children:(0,b.jsx)(r,{className:"size-4"})}),(0,b.jsx)(h.TooltipContent,{children:"How to get IMAP/SMTP credentials"})]})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect your own mailbox to send and receive email as your identity."})]}),!z&&V?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(l.Mail,{className:"size-3.5 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm truncate",children:V.email_address})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:Y,disabled:I,className:"rounded-full text-muted-foreground"}),children:(0,b.jsx)(m.RefreshCw,{className:(0,i.cn)("size-3.5",I&&"animate-spin")})}),(0,b.jsx)(h.TooltipContent,{children:"Sync now"})]}),(0,b.jsxs)(h.Tooltip,{children:[(0,b.jsx)(h.TooltipTrigger,{render:(0,b.jsx)(d.Button,{variant:"ghost",size:"icon-xs",onClick:X,disabled:K,className:"rounded-full text-muted-foreground hover:bg-destructive/10 hover:text-destructive"}),children:K?(0,b.jsx)(k.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsx)(q.XIcon,{className:"size-3.5"})}),(0,b.jsx)(h.TooltipContent,{children:"Remove"})]})]})]}),V.error_message&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:V.error_message}),V.last_synced_at&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Last synced: ",new Date(V.last_synced_at).toLocaleString()]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/50 px-3 py-2 text-xs text-muted-foreground space-y-1",children:[(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"IMAP"}),(0,b.jsxs)("span",{children:[V.imap_host,":",V.imap_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"SMTP"}),(0,b.jsxs)("span",{children:[V.smtp_host,":",V.smtp_port]})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("span",{children:"Poll interval"}),(0,b.jsxs)("span",{children:[V.poll_interval_seconds,"s"]})]})]})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(w,{fields:O,applyPreset:P,errors:M,onClearError:T}),!z&&(0,b.jsxs)(d.Button,{type:"button",size:"sm",className:"w-full",onClick:W,disabled:G,children:[G&&(0,b.jsx)(k.Loader2,{className:"size-3 animate-spin mr-1"}),"Save & Connect"]}),z&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Will be connected after creating the agent."})]})]})})]})]})}],137993)},224226,984078,a=>{"use strict";var b=a.i(749314),c=a.i(437199),d=a.i(732254),e=a.i(334235),f=a.i(76592),g=a.i(354498),h=a.i(432340),i=a.i(74414);function j({value:a,onValueChange:c,runtimes:d,disabled:e,triggerProps:f}){let h=function(a){let b=new Map;for(let c of a){let a=c.daemon_id||c.id;b.has(a)||b.set(a,{label:("string"==typeof c.device_info?c.device_info:"")||a,runtimes:[]}),b.get(a).runtimes.push(c)}return b}(d),k=e||0===d.length||d.every(a=>"online"!==a.status);return(0,b.jsxs)(g.Select,{value:a,onValueChange:a=>{a&&c(a)},disabled:k,items:d.map(a=>{let b=("string"==typeof a.device_info?a.device_info:"")||"",c=b?`${a.provider} (${b})`:a.provider;return{value:a.id,label:c}}),children:[(0,b.jsx)(g.SelectTrigger,{...f,children:(0,b.jsx)(g.SelectValue,{placeholder:0===d.length?"No runtimes — start a daemon first":d.every(a=>"online"!==a.status)?"All runtimes offline":"Select a runtime"})}),(0,b.jsx)(g.SelectContent,{children:Array.from(h.entries()).map(([a,c])=>(0,b.jsxs)(g.SelectGroup,{children:[(0,b.jsx)(g.SelectLabel,{className:"truncate",children:c.label}),c.runtimes.map(a=>(0,b.jsx)(g.SelectItem,{value:a.id,disabled:"online"!==a.status,children:(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4"}),(0,b.jsx)("span",{children:a.provider}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:["(",a.status,")"]})]})},a.id))]},a))})]})}a.s(["RuntimeSelect",0,j],984078),a.i(974936);var k=a.i(911509),l=a.i(75118),m=a.i(647651);let n=(0,m.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var o=a.i(73270);let p=(0,m.default)("dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);var q=a.i(28429),r=a.i(506180),s=a.i(588339),t=a.i(446827),u=a.i(921584),v=a.i(973111),w=a.i(27647);function x({children:a}){let[d,e]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"pt-1",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>e(!d),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,b.jsx)(q.ChevronDown,{className:(0,l.cn)("size-3.5 transition-transform",d&&"rotate-180")}),"Advanced"]}),d&&(0,b.jsx)("div",{className:"mt-3 space-y-4",children:a})]})}a.s(["AgentAccessTab",0,function({agentId:e,ownerId:f}){let{workspaceId:i}=(0,r.useWorkspace)(),[j,k]=(0,c.useState)("private"),[l,m]=(0,c.useState)(!1),[n,p]=(0,c.useState)([]),[q,w]=(0,c.useState)([]),[x,y]=(0,c.useState)(!0),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(""),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let a=!1;return y(!0),Promise.all([(0,s.listAgentAccess)(i,e),(0,s.listMembers)(i)]).then(([b,c])=>{a||(p(b),w(c))}).catch(b=>{a||(b instanceof t.ApiError&&403===b.status?A(b.message):A("Failed to load access list"))}).finally(()=>{a||y(!1)}),()=>{a=!0}},[i,e]),(0,c.useEffect)(()=>{a.A(81396).then(({listAgents:a})=>{a(i).then(a=>{let b=a.find(a=>a.id===e);b&&k(b.visibility??"private")}).catch(()=>{})})},[i,e]);let J=async a=>{k(a),m(!0);try{await (0,s.updateAgent)(e,{visibility:a},i),u.toast.success("public"===a?"Agent is now public":"Agent is now private")}catch{k(j),u.toast.error("Failed to update visibility")}finally{m(!1)}},K=q.find(a=>a.user_id===f),L=new Set(n.map(a=>a.user_id)),M=q.filter(a=>!L.has(a.user_id)&&a.user_id!==f),N=async a=>{if(a&&!D){E(!0),A(null);try{await (0,s.grantAgentAccess)(i,e,a);let b=q.find(b=>b.user_id===a);b&&p(c=>[...c,{id:a,user_id:b.user_id,name:b.name,email:b.email,created_at:new Date().toISOString()}]),C(""),u.toast.success("Access granted")}catch(a){A(a instanceof Error?a.message:"Failed to grant access")}finally{E(!1)}}},O=async()=>{if(F){p(a=>a.filter(a=>a.user_id!==F.user_id)),G(null),A(null);try{await (0,s.revokeAgentAccess)(i,e,F.user_id,H),u.toast.success(H?"Access revoked and removed from whitelist":"Access revoked")}catch{p(n),A("Failed to revoke access")}}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-6",children:[(0,b.jsx)("div",{className:"space-y-4 rounded-lg border border-border/50 p-4",children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Visibility"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"public"===j?"All workspace members can use this agent":"Only authorized members can use this agent"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:l?"Saving…":"public"===j?"Public":"Private"}),(0,b.jsx)(v.Switch,{checked:"public"===j,onCheckedChange:a=>J(a?"public":"private"),disabled:l})]})]})}),"private"===j&&(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Authorized Members"}),z&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:z}),x?(0,b.jsx)("div",{className:"space-y-2",children:[1,2].map(a=>(0,b.jsx)("span",{className:"block h-10 animate-pulse rounded-md bg-muted"},a))}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[K&&(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:K.name||K.email}),K.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:K.email})]}),(0,b.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground",children:"Owner"})]}),n.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-xs font-medium truncate",children:a.name||a.email}),a.name&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.email})]}),(0,b.jsx)("button",{type:"button",onClick:()=>{var b;let c;return b=a.user_id,void((c=n.find(a=>a.user_id===b))&&(G(c),I(!0)))},className:"ml-2 shrink-0 rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(o.XIcon,{className:"size-3.5"})})]},a.user_id))]}),M.length>0?(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsxs)(g.Select,{value:B,onValueChange:a=>{a&&(C(a),N(a))},children:[(0,b.jsx)(g.SelectTrigger,{className:"flex-1 text-xs",children:(0,b.jsx)(g.SelectValue,{placeholder:"Add a member..."})}),(0,b.jsx)(g.SelectContent,{children:M.map(a=>(0,b.jsx)(g.SelectItem,{value:a.user_id,children:a.name||a.email},a.user_id))})]})}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"All workspace members have been added. Invite new members from workspace settings."})]})]}),(0,b.jsx)(h.Dialog,{open:!!F,onOpenChange:a=>{a||G(null)},children:(0,b.jsxs)(h.DialogContent,{children:[(0,b.jsxs)(h.DialogHeader,{children:[(0,b.jsx)(h.DialogTitle,{children:"Remove Member Access"}),(0,b.jsxs)(h.DialogDescription,{children:["Remove"," ",(0,b.jsx)("span",{className:"font-medium text-foreground",children:F?.name||F?.email})," ","from this agent?"]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer px-1",children:[(0,b.jsx)("input",{type:"checkbox",checked:H,onChange:a=>I(a.target.checked),className:"size-4 rounded border-border accent-primary"}),(0,b.jsx)("span",{className:"text-sm",children:"Also remove from email whitelist"})]}),(0,b.jsxs)(h.DialogFooter,{children:[(0,b.jsx)(h.DialogClose,{render:(0,b.jsx)(d.Button,{variant:"outline",size:"sm"}),children:"Cancel"}),(0,b.jsx)(d.Button,{size:"sm",variant:"destructive",onClick:O,children:"Remove"})]})]})})]})},"AllowedSendersTab",0,function({agentId:a}){let{workspaceId:f}=(0,r.useWorkspace)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(!0),[m,p]=(0,c.useState)(!1),[q,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let b=!1;return l(!0),(0,s.listWhitelist)(a,f).then(a=>{b||h(a)}).catch(()=>{b||t("Failed to load whitelist")}).finally(()=>{b||l(!1)}),()=>{b=!0}},[a,f]),(0,c.useEffect)(()=>{let b=!1;return(0,s.listAgents)(f).then(c=>{b||v(c.filter(b=>b.id!==a&&b.email_handle).length>0)}).catch(()=>{}),()=>{b=!0}},[a,f]);let w=i.includes("@")&&i.trim().length>0,x=async()=>{if(w&&!m){p(!0),t(null);try{let b=await (0,s.addWhitelistEmail)(a,i.toLowerCase(),f);h(a=>[...a,b]),j("")}catch(a){t(a instanceof Error?a.message:"Failed to add email")}finally{p(!1)}}},y=async b=>{h(a=>a.filter(a=>a.id!==b)),t(null);try{await (0,s.removeWhitelistEmail)(a,b,f)}catch{h(g),t("Failed to remove email")}};return(0,b.jsxs)("div",{className:"mx-auto max-w-md space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:"Allowed Senders"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Only emails from these addresses will trigger this agent. Applies to all configured email addresses (alook.ai handle and custom email)."}),u&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground/70 mt-1.5 flex items-center gap-1",children:[(0,b.jsx)(n,{className:"size-3 shrink-0"}),"Agents in this workspace can already email each other — no whitelist entry needed."]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.Input,{value:i,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),x())},placeholder:"user@example.com",type:"email",className:"flex-1"}),(0,b.jsx)(d.Button,{type:"button",size:"sm",variant:"secondary",disabled:!w||m,onClick:x,children:m?"Adding...":"Add"})]}),q&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:q}),k?(0,b.jsx)("div",{className:"space-y-2",children:[1,2,3].map(a=>(0,b.jsx)("span",{className:"block h-8 animate-pulse rounded-md bg-muted"},a))}):0===g.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No allowed senders — all inbound emails will be rejected."}):(0,b.jsx)("div",{className:"space-y-1.5",children:g.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2",children:[(0,b.jsx)("span",{className:"text-sm",children:a.email}),(0,b.jsx)("button",{type:"button",onClick:()=>y(a.id),className:"rounded-full p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors",children:(0,b.jsx)(o.XIcon,{className:"size-3.5"})})]},a.id))})]})},"EmailHandleField",0,function({emailHandle:a,setEmailHandle:c,derivedHandle:d}){let e=a||d,g=e&&!(0,k.isValidHandle)(e)?"Must be 3+ characters, letters/numbers/hyphens only":"";return(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Email"}),(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("input",{id:"agent-handle",value:a,onChange:a=>c(a.target.value.toLowerCase()),placeholder:d||"my-agent",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),(0,b.jsx)("span",{className:"shrink-0 text-sm text-muted-foreground/70",children:"@alook.ai"})]}),g&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:g})]})},"GeneralFields",0,function({name:a,setName:c,description:d,setDescription:e,instructions:g,setInstructions:h,model:k,setModel:m,runtimeId:n,setRuntimeId:o,runtimes:q,providerModels:r,errors:s,runtimeAsRadio:t=!1,onShuffle:u,emailHandleSlot:v,advancedSection:y}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("input",{id:"agent-name",value:a,onChange:a=>c(a.target.value),placeholder:"Agent name",required:!0,autoFocus:!0,"aria-invalid":!!s?.name,"aria-describedby":s?.name?"agent-name-error":void 0,className:"w-full border-0 bg-transparent px-0 py-1 text-2xl font-medium leading-[1.2] tracking-tight shadow-none outline-none placeholder:text-muted-foreground/40 placeholder:font-normal focus-visible:ring-0"}),u&&(0,b.jsx)("button",{type:"button",onClick:u,"aria-label":"Randomize name",className:"absolute right-0 top-1/2 -translate-y-1/2 rounded p-1.5 text-muted-foreground/50 hover:text-foreground hover:bg-accent transition-colors",children:(0,b.jsx)(p,{className:"size-4"})})]}),s?.name&&(0,b.jsx)("p",{id:"agent-name-error",className:"text-xs text-destructive mt-1",children:s.name})]}),(0,b.jsx)(w.AutoResizeTextarea,{id:"agent-description",value:d,onChange:a=>e(a.target.value),placeholder:"Add a description…",rows:1,className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),v,(t||q.length>0)&&(0,b.jsxs)("div",{id:"agent-runtime-select",className:"space-y-1.5",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Runtime"}),t?(0,b.jsx)("div",{className:"space-y-1.5",role:"radiogroup","aria-label":"Runtime",children:0===q.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"No runtimes — start a daemon first"}):q.map(a=>{let c="online"===a.status,d=n===a.id,e="string"==typeof a.device_info?a.device_info:"";return(0,b.jsxs)("label",{className:(0,l.cn)("flex items-center gap-2.5 rounded-lg border p-2.5 cursor-pointer transition-colors",d?"border-primary bg-primary/5":"border-border/50 hover:border-foreground/20",!c&&"opacity-40 pointer-events-none"),children:[(0,b.jsx)("input",{type:"radio",name:"runtime",value:a.id,checked:d,disabled:!c,onChange:()=>{let b=q.find(a=>a.id===n)?.provider,c=a.provider;o(a.id),b&&b!==c&&m("")},className:"accent-primary size-3.5"}),(0,b.jsx)(i.ProviderLogo,{provider:a.provider,className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-sm",children:a.provider}),e&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:e}),!c&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:"offline"})]},a.id)})}):(0,b.jsx)(j,{value:n,onValueChange:a=>{let b=q.find(a=>a.id===n)?.provider,c=q.find(b=>b.id===a)?.provider;o(a),b&&b!==c&&m("")},runtimes:q,triggerProps:{"aria-invalid":!!s?.runtimeId,"aria-describedby":s?.runtimeId?"agent-runtime-error":void 0}}),s?.runtimeId&&(0,b.jsx)("p",{id:"agent-runtime-error",className:"text-xs text-destructive",children:s.runtimeId})]}),(h||y)&&(0,b.jsxs)(x,{children:[h&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Instructions"}),(0,b.jsx)(w.AutoResizeTextarea,{id:"agent-instructions",value:g??"",onChange:a=>h(a.target.value),placeholder:"System prompt or instructions...",rows:3,className:"w-full border-0 bg-transparent px-0 py-1 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(f.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsx)("input",{id:"agent-model",value:k,onChange:a=>m(a.target.value),placeholder:"Default (runtime model)",list:"agent-model-options",className:"w-full border-0 bg-transparent px-0 py-0.5 text-sm text-foreground shadow-none outline-none placeholder:text-muted-foreground/40 focus-visible:ring-0"}),r.length>0&&(0,b.jsx)("datalist",{id:"agent-model-options",children:r.map(a=>(0,b.jsx)("option",{value:a},a))})]}),y]})]})},"getHandleError",0,function(a){return a&&!(0,k.isValidHandle)(a)?"Must be 3+ characters, letters/numbers/hyphens only":""},"nameToHandle",0,function(a){return a.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-").replace(/^-|-$/g,"")}],224226)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_web_src_components_00xgo_-._.js.map
|