@alook/app 0.0.138 → 0.0.140
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 +2 -0
- 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/{2n2-erdcjib3l.js → 0pqa0bk3fnq2q.js} +2 -2
- package/bundled/web/.open-next/assets/_next/static/chunks/0pydx20mmtmb-.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{412d684t3r9n2.js → 0u04xzcqoxacf.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{3a4lcn1k6my37.js → 0u1g621cl6cpa.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{0gadq1gaq7l2d.js → 0v8_t40u7sj2s.js} +3 -3
- package/bundled/web/.open-next/assets/_next/static/chunks/{24uei2njvsgf4.js → 10ey8by6dfgey.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{08owkyc3y3nuc.js → 1avrt94npx8p3.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{07ib-ldk87gmo.js → 1c0k_1upngs79.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/1fs7xmjtwdhjj.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{1n2ogp1w_pw5c.js → 1l3nq6kc3fbh-.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{0rmmmmqzr5q8u.js → 1vdalq9vvychb.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{19j0bml2m-9uo.js → 22y46i-vrrny_.js} +3 -3
- package/bundled/web/.open-next/assets/_next/static/chunks/25z9kj3uj7xzn.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{1uj4q_n378l_e.js → 2qc57pol1-1f3.js} +3 -3
- package/bundled/web/.open-next/assets/_next/static/chunks/2usqt49xbpqd2.css +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/3rbv_zutwzuxv.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{1ksb3nu_qkssl.js → 41k5317-tm9ix.js} +1 -1
- package/bundled/web/.open-next/cache/{0jpboe0ecrihrJF2CMdwU → WTLpHjXNd0wVnZOUBMJJz}/_global-error.cache +1 -1
- package/bundled/web/.open-next/cache/{0jpboe0ecrihrJF2CMdwU → WTLpHjXNd0wVnZOUBMJJz}/_not-found.cache +1 -1
- package/bundled/web/.open-next/cache/{0jpboe0ecrihrJF2CMdwU → WTLpHjXNd0wVnZOUBMJJz}/device.cache +1 -1
- package/bundled/web/.open-next/cache/{0jpboe0ecrihrJF2CMdwU → WTLpHjXNd0wVnZOUBMJJz}/privacy.cache +1 -1
- package/bundled/web/.open-next/cache/{0jpboe0ecrihrJF2CMdwU → WTLpHjXNd0wVnZOUBMJJz}/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 +7 -7
- 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/app-path-routes-manifest.json +1 -0
- 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/required-server-files.json +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/routes-manifest.json +8 -0
- 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]/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]/traces/[traceId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/traces/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/artifacts/[id]/thumbnail/route.js +14 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/api/artifacts/[id]/thumbnail/route_client-reference-manifest.js +3 -0
- 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/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/app-paths-manifest.json +1 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/0_kl__next-internal_server_app_api_artifacts_[id]_thumbnail_route_actions_17k4myq.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__1_d30qf._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[root-of-the-server]__1lpr5ex._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[turbopack]_runtime.js +15 -13
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_0v95a0y._.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_139j3zh._.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1nfaney._.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__13aweo1._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{[root-of-the-server]__172hwkq._.js → [root-of-the-server]__1e237f4._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[turbopack]_runtime.js +15 -13
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_04ht2b1._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_09v4-yk._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0kozrym._.js → _0g_x3qh._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0lil2o-._.js +65 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0qgcnj5._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_00ft3vz._.js → _10-8eci._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_15s-tjk._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_17z3ujw._.js → _19hsbaa._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1vs9m39._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1xq5127._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0wq6umk._.js → node_modules__pnpm_0-sy0jc._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0fjz-0c._.js → node_modules__pnpm_03t1_eh._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0s5w--e._.js → node_modules__pnpm_0b_f_5l._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1ve6v4p._.js → node_modules__pnpm_0lmr_qu._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_17siyfl._.js → node_modules__pnpm_0os8mdu._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1ajm7qp._.js → node_modules__pnpm_0pd1a42._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1o8q6qh._.js → node_modules__pnpm_0z21f3h._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_198l9yo._.js → node_modules__pnpm_1tajvfi._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_0pwl5s4._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_1kzi5ju._.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]_email_page_tsx_0gv3qni._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_home_page_tsx_0-vs82-._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_(app)_w_[slug]_runtimes_page_tsx_11-1juy._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_avatar_0hmu31-._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_home_home-page_tsx_1e1vr_i._.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 +162 -162
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +388 -269
- package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +6 -6
- package/bundled/web/migrations/0042_artifact_thumbnail.sql +1 -0
- package/bundled/web/wrangler.toml +1 -1
- package/bundled/ws-do/index.js +2 -0
- package/dist/cli/index.js +28 -10
- package/dist/cli/session-runner.js +1 -0
- package/dist/index.js +38 -11
- package/package.json +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0b0bf61oxocmd.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/1o14pyvttt8vl.css +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/2l42wg35hly5d.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/2tyy_fxi6rlas.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/3ad50t_oqhpk_.js +0 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1xvbchf._.js +0 -65
- /package/bundled/web/.open-next/assets/_next/static/{0jpboe0ecrihrJF2CMdwU → WTLpHjXNd0wVnZOUBMJJz}/_buildManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{0jpboe0ecrihrJF2CMdwU → WTLpHjXNd0wVnZOUBMJJz}/_clientMiddlewareManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{0jpboe0ecrihrJF2CMdwU → WTLpHjXNd0wVnZOUBMJJz}/_ssgManifest.js +0 -0
- /package/bundled/web/.open-next/cache/{0jpboe0ecrihrJF2CMdwU → WTLpHjXNd0wVnZOUBMJJz}/robots.txt.cache +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[450817,a=>{"use strict";var b=a.i(221604);a.s(["ChevronDown",()=>b.default])},74414,a=>{"use strict";var b=a.i(616612),c=a.i(515837);function d({className:a}){return(0,b.jsx)("svg",{viewBox:"0 0 16 16",fill:"#D97757",className:a,children:(0,b.jsx)("path",{d:"m3.127 10.604 3.135-1.76.053-.153-.053-.085H6.11l-.525-.032-1.791-.048-1.554-.065-1.505-.08-.38-.081L0 7.832l.036-.234.32-.214.455.04 1.009.069 1.513.105 1.097.064 1.626.17h.259l.036-.105-.089-.065-.068-.064-1.566-1.062-1.695-1.121-.887-.646-.48-.327-.243-.306-.104-.67.435-.48.585.04.15.04.593.456 1.267.981 1.654 1.218.242.202.097-.068.012-.049-.109-.181-.9-1.626-.96-1.655-.428-.686-.113-.411a2 2 0 0 1-.068-.484l.496-.674L4.446 0l.662.089.279.242.411.94.666 1.48 1.033 2.014.302.597.162.553.06.17h.105v-.097l.085-1.134.157-1.392.154-1.792.052-.504.25-.605.497-.327.387.186.319.456-.045.294-.19 1.23-.37 1.93-.243 1.29h.142l.161-.16.654-.868 1.097-1.372.484-.545.565-.601.363-.287h.686l.505.751-.226.775-.707.895-.585.759-.839 1.13-.524.904.048.072.125-.012 1.897-.403 1.024-.186 1.223-.21.553.258.06.263-.218.536-1.307.323-1.533.307-2.284.54-.028.02.032.04 1.029.098.44.024h1.077l2.005.15.525.346.315.424-.053.323-.807.411-3.631-.863-.872-.218h-.12v.073l.726.71 1.331 1.202 1.667 1.55.084.383-.214.302-.226-.032-1.464-1.101-.565-.497-1.28-1.077h-.084v.113l.295.432 1.557 2.34.08.718-.112.234-.404.141-.444-.08-.911-1.28-.94-1.44-.759-1.291-.093.053-.448 4.821-.21.246-.484.186-.403-.307-.214-.496.214-.98.258-1.28.21-1.016.19-1.263.112-.42-.008-.028-.092.012-.953 1.307-1.448 1.957-1.146 1.227-.274.109-.477-.247.045-.44.266-.39 1.586-2.018.956-1.25.617-.723-.004-.105h-.036l-4.212 2.736-.75.096-.324-.302.04-.496.154-.162 1.267-.871z"})})}function e({className:a}){return(0,b.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:a,children:(0,b.jsx)("path",{d:"M14.949 6.547a3.94 3.94 0 0 0-.348-3.273 4.11 4.11 0 0 0-4.4-1.934A4.1 4.1 0 0 0 8.423.2 4.15 4.15 0 0 0 6.305.086a4.1 4.1 0 0 0-1.891.948 4.04 4.04 0 0 0-1.158 1.753 4.1 4.1 0 0 0-1.563.679A4 4 0 0 0 .554 4.72a3.99 3.99 0 0 0 .502 4.731 3.94 3.94 0 0 0 .346 3.274 4.11 4.11 0 0 0 4.402 1.933c.382.425.852.764 1.377.995.526.231 1.095.35 1.67.346 1.78.002 3.358-1.132 3.901-2.804a4.1 4.1 0 0 0 1.563-.68 4 4 0 0 0 1.14-1.253 3.99 3.99 0 0 0-.506-4.716m-6.097 8.406a3.05 3.05 0 0 1-1.945-.694l.096-.054 3.23-1.838a.53.53 0 0 0 .265-.455v-4.49l1.366.778q.02.011.025.035v3.722c-.003 1.653-1.361 2.992-3.037 2.996m-6.53-2.75a2.95 2.95 0 0 1-.36-2.01l.095.057L5.29 12.09a.53.53 0 0 0 .527 0l3.949-2.246v1.555a.05.05 0 0 1-.022.041L6.473 13.3c-1.454.826-3.311.335-4.15-1.098m-.85-6.94A3.02 3.02 0 0 1 3.07 3.949v3.785a.51.51 0 0 0 .262.451l3.93 2.237-1.366.779a.05.05 0 0 1-.048 0L2.585 9.342a2.98 2.98 0 0 1-1.113-4.094zm11.216 2.571L8.747 5.576l1.362-.776a.05.05 0 0 1 .048 0l3.265 1.86a3 3 0 0 1 1.173 1.207 2.96 2.96 0 0 1-.27 3.2 3.05 3.05 0 0 1-1.36.997V8.279a.52.52 0 0 0-.276-.445m1.36-2.015-.097-.057-3.226-1.855a.53.53 0 0 0-.53 0L6.249 6.153V4.598a.04.04 0 0 1 .019-.04L9.533 2.7a3.07 3.07 0 0 1 3.257.139c.474.325.843.778 1.066 1.303.223.526.289 1.103.191 1.664zM5.503 8.575 4.139 7.8a.05.05 0 0 1-.026-.037V4.049c0-.57.166-1.127.476-1.607s.752-.864 1.275-1.105a3.08 3.08 0 0 1 3.234.41l-.096.054-3.23 1.838a.53.53 0 0 0-.265.455zm.742-1.577 1.758-1 1.762 1v2l-1.755 1-1.762-1z"})})}function f({className:a}){return(0,b.jsxs)("svg",{viewBox:"0 0 240 300",fill:"none",className:a,children:[(0,b.jsx)("path",{d:"M180 240H60V120H180V240Z",fill:"#CFCECD"}),(0,b.jsx)("path",{d:"M180 60H60V240H180V60ZM240 300H0V0H240V300Z",fill:"#211E1E"})]})}function g({className:a}){return(0,b.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:a,children:[(0,b.jsx)("path",{d:"M8 2C5.5 2 3.5 4 3.5 6.5S5 10.5 6.5 11v1.5H8V11c.3.1.7.1 1 0v1.5h1.5V11c1.5-.5 3-2.5 3-4.5S10.5 2 8 2Z",fill:"#E8453A"}),(0,b.jsx)("path",{d:"M3.5 5.5C2 5 1 6 1.5 7s2 .5 2.2-.7",fill:"#FF6B5A"}),(0,b.jsx)("path",{d:"M12.5 5.5c1.5-.5 2.5.5 2 1.5s-2 .5-2.2-.7",fill:"#FF6B5A"}),(0,b.jsx)("path",{d:"M6.5 3Q5 1.2 4.3 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,b.jsx)("path",{d:"M9.5 3Q11 1.2 11.7 1.5",stroke:"#FF6B5A",strokeWidth:"0.8",strokeLinecap:"round"}),(0,b.jsx)("circle",{cx:"6.2",cy:"5.2",r:"0.9",fill:"#050810"}),(0,b.jsx)("circle",{cx:"9.8",cy:"5.2",r:"0.9",fill:"#050810"}),(0,b.jsx)("circle",{cx:"6.4",cy:"5",r:"0.3",fill:"#00E5CC"}),(0,b.jsx)("circle",{cx:"10",cy:"5",r:"0.3",fill:"#00E5CC"})]})}function h({className:a}){return(0,b.jsx)("img",{src:"data:image/webp;base64,UklGRuYDAABXRUJQVlA4INoDAADQEwCdASowADAAPm0uk0ckIiGhKrqpWIANiWkAEyQea/fD8IewvGL5V7Nb3H8u/MA8G9rT+4flL+UfIe42/23GB8zPqF/o3E0UAP5h/h/+F6ZX+x5evnX/r+4T/K/67/u/zg7znogfrusMANZLkn1gvlY/vNsKubtj/9xLSzxTsLr7K9GLdFNs5rwtISRcPXvH4z57n2fg0XR3aQ2D+pPpycwyl7TwAAD+/2DbjivnePzfyHCsdOgJXKlUR/OgAkofD7K4AdmsPKyP5Ml4/4HBYmIm5/efn/H+X3IZtngyaUOvwbFuRS/1yODFYO3vf3qeXGgPdfgIROXd/EPT7K2jysfvY9N71+w6g2gBPs+P6lxYkPf6S9QfpvH/7Pp7i8xRh0nVDBTEQyczSz7V9hoqo4nDJuii+SfibZRR/d5zB+9jkcb1DNN7YnC5Y7+WfGrE3eseXt3hSm+NS5++m1MHbjsrd9z/Q4HPRP/C85Po41XObalGyIUcFUL2j2n3uI/Yh6U8r6trCUJFB4kT3fsv6+8ylX/d96y2hq869FCXLjq4YqEO8vs5BtT52sf7KyDxPAWkH/b06YbfVXf4/7y5THL6Sr/4mOrrY9P2LW81f05HHFN8n0jcyqKOH7AluMm0AHPgFyz8RVrfBdmnPiC2FLMQfNDte5yGFzGC3fMlDed/tS/PO3Q/hjsNLvAXUUjqHyCo3JeN69jyNgWjjf8iUqoBsXT+lJyp2r8p60ad1jxhNyTblyJwda8aWEw1hFDeGjpMGguDF66RL4c+ZO+PhculC6WxvCsZ7IPAsdD7/ywx3w3AowJ66hAAK7k+m6X2QV06OVOCwyIGERex/AUyuBbLUK93X58+M+Si7YfYjVYGpoJ7JvSgD8ExaA21z9OY+si+1wreacDanKnFDmhwBQC3t6MLeXCOGp3VURDKl10K7tdKHQcb4hr48ba+1x/MrMRwHfq3IQrDIXPYCg4b0OLnVN9JyXttKGM63B5imIdKuU0r6hhSslT10lGLjnIJuwO5WKR0RHs+BX5vs6H63y3K7IuuZ1eRN+Aczvbs4QuDs6ZRuzjJ/1DJ5R/3ZrFPrtxvMwT06vAXIgcbhLGNLhOQUYRPdUN5MgyCtL5NH71ArTPLRRkIjhGwoCYXKKqlqIKKT9NX3vwp/nlh4SX71dlYg/mPXbJ9bMeVugyjqFahjFTJ/rT3HtBCWG8h+OvvbOFDFKurCG9BOhO9B719OS7zsP0KPqoymnv7hVvoJyZp0iziCbBvaJpmF9Cvfs8/vWqWr7TUo616WfMW+X9nkgpuqtnfAAAAAA==",alt:"Hermes",className:`${a} rounded-sm`})}function i({className:a}){return(0,b.jsxs)("svg",{viewBox:"0 0 800 800",fill:"none",className:a,children:[(0,b.jsx)("rect",{width:"800",height:"800",rx:"150",fill:"#09090b"}),(0,b.jsx)("path",{fill:"#fff",fillRule:"evenodd",d:"M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z"}),(0,b.jsx)("path",{fill:"#fff",d:"M517.36 400H634.72V634.72H517.36Z"})]})}function j({className:a}){return(0,b.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:a,children:(0,b.jsx)("path",{d:"M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"})})}function k({className:a}){return(0,b.jsxs)("svg",{viewBox:"600 300 400 400",fill:"none",className:a,children:[(0,b.jsx)("path",{fill:"#14120B",d:"M999.994 554.294C999.994 559.859 999.994 565.419 999.962 570.984C999.935 575.67 999.882 580.357 999.753 585.038C999.475 595.247 998.875 605.542 997.059 615.639C995.217 625.88 992.212 635.409 987.477 644.718C982.822 653.861 976.738 662.233 969.485 669.491C962.227 676.748 953.861 682.828 944.712 687.482C935.409 692.217 925.875 695.222 915.633 697.065C905.537 698.88 895.242 699.48 885.033 699.759C880.346 699.887 875.665 699.941 870.978 699.968C865.413 700.005 859.853 700 854.288 700H745.695C740.13 700 734.571 700 729.005 699.968C724.319 699.941 719.632 699.887 714.951 699.759C704.742 699.48 694.447 698.88 684.35 697.065C674.109 695.222 664.58 692.217 655.271 687.482C646.128 682.828 637.756 676.743 630.499 669.491C623.241 662.233 617.161 653.866 612.507 644.718C607.772 635.414 604.767 625.88 602.925 615.639C601.109 605.542 600.509 595.247 600.23 585.038C600.102 580.352 600.048 575.67 600.021 570.984C600 565.419 600 559.859 600 554.294V445.701C600 440.136 600 434.576 600.032 429.011C600.059 424.324 600.112 419.637 600.241 414.956C600.52 404.747 601.119 394.452 602.935 384.356C604.778 374.115 607.783 364.586 612.518 355.277C617.172 346.133 623.257 337.762 630.509 330.504C637.767 323.246 646.133 317.167 655.282 312.512C664.586 307.777 674.12 304.772 684.361 302.93C694.458 301.114 704.752 300.514 714.961 300.236C719.648 300.107 724.329 300.054 729.016 300.027C734.576 300 740.136 300 745.701 300H854.294C859.859 300 865.419 300 870.984 300.032C875.67 300.059 880.357 300.112 885.038 300.241C895.247 300.52 905.542 301.119 915.639 302.935C925.88 304.778 935.409 307.783 944.718 312.518C953.861 317.172 962.233 323.257 969.491 330.509C976.748 337.767 982.828 346.133 987.482 355.282C992.217 364.586 995.222 374.12 997.065 384.361C998.88 394.458 999.48 404.752 999.759 414.961C999.887 419.648 999.941 424.329 999.968 429.016C1000.01 434.581 1000 440.141 1000 445.706V554.299L999.994 554.294Z"}),(0,b.jsx)("path",{fill:"#72716D",d:"M800.004 500L923.821 571.486C923.061 572.804 921.957 573.929 920.591 574.716L804.863 641.531C801.858 643.266 798.151 643.266 795.146 641.531L679.417 574.716C678.052 573.929 676.948 572.804 676.188 571.486L800.004 500Z"}),(0,b.jsx)("path",{fill:"#55544F",d:"M800.005 357.168V500L676.188 571.486C675.427 570.168 675.004 568.647 675.004 567.072V432.928C675.004 429.774 676.686 426.865 679.418 425.285L795.141 358.47C796.646 357.602 798.323 357.168 799.999 357.168H800.005Z"}),(0,b.jsx)("path",{fill:"#43413C",d:"M923.815 428.515C923.055 427.197 921.951 426.072 920.586 425.285L804.857 358.47C803.357 357.602 801.68 357.168 800.004 357.168V500L923.821 571.486C924.581 570.168 925.005 568.647 925.005 567.072V432.928C925.005 431.348 924.587 429.838 923.821 428.515H923.815Z"}),(0,b.jsx)("path",{fill:"#D6D5D2",d:"M915.156 433.518C915.857 434.728 915.954 436.281 915.156 437.663L802.764 632.323C802.008 633.641 800 633.1 800 631.584V503.311C800 502.287 799.727 501.302 799.229 500.44L915.15 433.512H915.156V433.518Z"}),(0,b.jsx)("path",{fill:"white",d:"M915.155 433.518L799.233 500.445C798.741 499.588 798.023 498.86 797.134 498.345L686.049 434.209C684.731 433.453 685.272 431.445 686.788 431.445H911.566C913.162 431.445 914.459 432.307 915.155 433.518Z"})]})}function l({className:a}){return(0,b.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:a,children:[(0,b.jsx)("path",{d:"M12 24C12 18.2 12 15.5 10.1 13.9C8.5 12 5.8 12 0 12C5.8 12 8.5 12 10.1 10.1C12 8.5 12 5.8 12 0C12 5.8 12 8.5 13.9 10.1C15.5 12 18.2 12 24 12C18.2 12 15.5 12 13.9 13.9C12 15.5 12 18.2 12 24Z",fill:"url(#gemini-gradient)"}),(0,b.jsx)("defs",{children:(0,b.jsxs)("linearGradient",{id:"gemini-gradient",x1:"0",y1:"0",x2:"24",y2:"24",gradientUnits:"userSpaceOnUse",children:[(0,b.jsx)("stop",{stopColor:"#4285F4"}),(0,b.jsx)("stop",{offset:"1",stopColor:"#886FBF"})]})})]})}a.s(["ProviderLogo",0,function({provider:a,className:m="h-4 w-4"}){switch(a){case"claude":return(0,b.jsx)(d,{className:m});case"codex":return(0,b.jsx)(e,{className:m});case"opencode":return(0,b.jsx)(f,{className:m});case"openclaw":return(0,b.jsx)(g,{className:m});case"hermes":return(0,b.jsx)(h,{className:m});case"pi":return(0,b.jsx)(i,{className:m});case"copilot":return(0,b.jsx)(j,{className:m});case"cursor":return(0,b.jsx)(k,{className:m});case"gemini":return(0,b.jsx)(l,{className:m});default:return(0,b.jsx)(c.Monitor,{className:m})}}])},402656,a=>{"use strict";let b=(0,a.i(410732).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);a.s(["CheckCircle2",0,b],402656)},66110,552619,a=>{"use strict";var b=a.i(734803);let c=b.createContext({disabled:!1});a.s(["FieldItemContext",0,c,"useFieldItemContext",0,function(){return b.useContext(c)}],66110);var d=a.i(795845);let e=b.createContext(void 0);a.s(["useCheckboxGroupContext",0,function(a=!0){let c=b.useContext(e);if(void 0===c&&!a)throw Error((0,d.default)(3));return c}],552619)},76592,a=>{"use strict";var b=a.i(616612),c=a.i(75118);a.s(["Label",0,function({className:a,...d}){return(0,b.jsx)("label",{"data-slot":"label",className:(0,c.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",a),...d})}])},63595,a=>{"use strict";var b=a.i(734803),c=a.i(27278),d=a.i(686200);a.s(["useAriaLabelledBy",0,function(a,e,f,g=!0,h){let[i,j]=b.useState(),k=(0,d.useBaseUiId)(h?`${h}-label`:void 0),l=a??e??i;return(0,c.useIsoLayoutEffect)(()=>{let b=a||e||!g?void 0:function(a,b){let c=function(a){if(!a)return;let b=a.parentElement;if(b&&"LABEL"===b.tagName)return b;let c=a.id;if(c){let b=a.nextElementSibling;if(b&&b.htmlFor===c)return b}let d=a.labels;return d&&d[0]}(a);if(c)return!c.id&&b&&(c.id=b),c.id||void 0}(f.current,k);i!==b&&j(b)}),l}])},973111,a=>{"use strict";var b,c=a.i(616612);a.s([],801957),a.i(801957);var d=a.i(734803),e=a.i(705944),f=a.i(28837),g=a.i(27278),h=a.i(277513),i=a.i(431090),j=a.i(384030),k=a.i(870562),l=a.i(129304),m=a.i(686200),n=a.i(904172),o=a.i(795845);let p=d.createContext(void 0);var q=a.i(523963);let r=((b={}).checked="data-checked",b.unchecked="data-unchecked",b.disabled="data-disabled",b.readonly="data-readonly",b.required="data-required",b.valid="data-valid",b.invalid="data-invalid",b.touched="data-touched",b.dirty="data-dirty",b.filled="data-filled",b.focused="data-focused",b),s={...q.fieldValidityMapping,checked:a=>a?{[r.checked]:""}:{[r.unchecked]:""}};var t=a.i(984447),u=a.i(242407),v=a.i(835911),w=a.i(804878),x=a.i(63595),y=a.i(873318),z=a.i(484548),A=a.i(775008),B=a.i(752070);let C=d.forwardRef(function(a,b){let{checked:o,className:q,defaultChecked:r,"aria-labelledby":C,form:D,id:E,inputRef:F,name:G,nativeButton:H=!1,onCheckedChange:I,readOnly:J=!1,required:K=!1,disabled:L=!1,render:M,uncheckedValue:N,value:O,style:P,...Q}=a,{clearErrors:R}=(0,v.useFormContext)(),{state:S,setTouched:T,setDirty:U,validityData:V,setFilled:W,setFocused:X,shouldValidateOnChange:Y,validationMode:Z,disabled:$,name:_,validation:aa}=(0,t.useFieldRootContext)(),{labelId:ab}=(0,w.useLabelableContext)(),ac=$||L,ad=_??G,ae=d.useRef(null),af=(0,f.useMergedRefs)(ae,F,aa.inputRef),ag=d.useRef(null),ah=(0,m.useBaseUiId)(),ai=(0,y.useLabelableId)({id:E,implicit:!1,controlRef:ag}),aj=H?void 0:ai,[ak,al]=(0,e.useControlled)({controlled:o,default:!!r,name:"Switch",state:"checked"});(0,u.useRegisterFieldControl)(ag,ah,ak),(0,g.useIsoLayoutEffect)(()=>{ae.current&&W(ae.current.checked)},[ae,W]),(0,B.useValueChanged)(ak,()=>{R(ad),U(ak!==V.initialValue),W(ak),Y()?aa.commit(ak):aa.commit(ak,!0)});let{getButtonProps:am,buttonRef:an}=(0,n.useButton)({disabled:ac,native:H}),ao=(0,x.useAriaLabelledBy)(C,ab,ae,!H,aj),ap=(0,l.mergeProps)({checked:ak,disabled:ac,form:D,id:aj,name:ad,required:K,style:ad?h.visuallyHiddenInput:h.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:af,onChange(a){if(a.nativeEvent.defaultPrevented)return;if(J)return void a.preventDefault();let b=a.currentTarget.checked,c=(0,z.createChangeEventDetails)(A.REASONS.none,a.nativeEvent);I?.(b,c),c.isCanceled||al(b)},onFocus(){ag.current?.focus()}},aa.getInputValidationProps,void 0!==O?{value:O}:i.EMPTY_OBJECT),aq=d.useMemo(()=>({...S,checked:ak,disabled:ac,readOnly:J,required:K}),[S,ak,ac,J,K]),ar=(0,k.useRenderElement)("span",a,{state:aq,ref:[b,ag,an],props:[{id:H?ai:ah,role:"switch","aria-checked":ak,"aria-readonly":J||void 0,"aria-required":K||void 0,"aria-labelledby":ao,onFocus(){ac||X(!0)},onBlur(){let a=ae.current;a&&!ac&&(T(!0),X(!1),"onBlur"===Z&&aa.commit(a.checked))},onClick(a){if(J||ac)return;a.preventDefault();let b=ae.current;b&&b.dispatchEvent(new((0,j.ownerWindow)(b)).PointerEvent("click",{bubbles:!0,shiftKey:a.shiftKey,ctrlKey:a.ctrlKey,altKey:a.altKey,metaKey:a.metaKey}))}},aa.getValidationProps,Q,am],stateAttributesMapping:s});return(0,c.jsxs)(p.Provider,{value:aq,children:[ar,!ak&&ad&&void 0!==N&&(0,c.jsx)("input",{type:"hidden",form:D,name:ad,value:N}),(0,c.jsx)("input",{...ap,suppressHydrationWarning:!0})]})}),D=d.forwardRef(function(a,b){let{render:c,className:e,style:f,...g}=a,h=function(){let a=d.useContext(p);if(void 0===a)throw Error((0,o.default)(63));return a}();return(0,k.useRenderElement)("span",a,{state:h,ref:b,stateAttributesMapping:s,props:g})});a.s(["Root",0,C,"Thumb",0,D],863404);var E=a.i(863404),E=E,F=a.i(75118);a.s(["Switch",0,function({className:a,size:b="default",...d}){return(0,c.jsx)(E.Root,{"data-slot":"switch","data-size":b,className:(0,F.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",a),...d,children:(0,c.jsx)(E.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}],973111)},390248,a=>{"use strict";a.s(["hasCustomEmailErrors",0,function(a){return!!(a.emailAddress||a.imapHost||a.imapPassword||a.smtpHost||a.smtpPassword)},"hasWorkspaceFormErrors",0,function(a){return!!(a.name||a.slug)},"validateCustomEmailFields",0,function({emailAddress:a,imapHost:b,imapUsername:c,imapPassword:d,smtpHost:e,smtpUsername:f,smtpPassword:g}){let h={};return a.trim()||(h.emailAddress="Email address is required"),b.trim()||(h.imapHost="IMAP host is required"),c.trim()&&d.trim()||(h.imapPassword="IMAP credentials are required"),e.trim()||(h.smtpHost="SMTP host is required"),f.trim()&&g.trim()||(h.smtpPassword="SMTP credentials are required"),h},"validateWorkspaceForm",0,function({name:a,slug:b}){let c={};return a.trim()||(c.name="Workspace name is required"),b.trim()||(c.slug="Workspace slug is required"),c}])},588709,a=>{"use strict";var b=a.i(616612),c=a.i(734803),d=a.i(630991),e=a.i(752792),f=a.i(506180),g=a.i(732254),h=a.i(224226),i=a.i(137993);a.i(735132);var j=a.i(628508),k=a.i(325848),l=a.i(854445);let m={shape:"circle",eye:"dots",nose:"dot",bg:0};async function n(){let b=await ((a,b=3e3)=>new Promise(c=>{let d=document.querySelector(a);if(d)return void c(d);let e=new MutationObserver(()=>{let b=document.querySelector(a);b&&(e.disconnect(),c(b))});e.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{e.disconnect(),c(null)},b)}))("#agent-name");if(!b||(await new Promise(a=>{requestAnimationFrame(()=>requestAnimationFrame(()=>a()))}),!b.getBoundingClientRect().height))return;let{driver:c}=await a.A(995011);await Promise.resolve({}),c({showProgress:!0,animate:!0,allowClose:!0,overlayClickBehavior:()=>{},overlayColor:"black",overlayOpacity:.4,popoverClass:"agent-tour-popover",steps:[{element:"#agent-name",popover:{title:"Name your agent",description:"Give your agent a name — this is how you'll identify it.",side:"bottom",align:"start"}},{element:"#agent-runtime-select",disableActiveInteraction:!1,popover:{title:"Choose a runtime",description:"Select which machine and provider will run this agent.",side:"bottom",align:"start"}}]}).drive()}function o({runtimes:a,defaultRuntimeId:d="",modelOptions:e,guided:p=!1,onTourReady:q,onSave:r,onCancel:s,saving:t}){let{workspaceId:u}=(0,f.useWorkspace)(),[v,w]=(0,c.useState)(""),[x,y]=(0,c.useState)(""),[z,A]=(0,c.useState)(""),[B,C]=(0,c.useState)(d),[D,E]=(0,c.useState)(""),[F,G]=(0,c.useState)({}),[H,I]=(0,c.useState)(null),J=(0,c.useRef)(null),[K,L]=(0,c.useState)(""),[M,N]=(0,c.useState)(m),O=(0,c.useRef)(!1);(0,c.useEffect)(()=>{O.current||(O.current=!0,N((0,k.randomConfig)()),w((0,l.uniqueNamesGenerator)({dictionaries:[l.names],length:1,style:"capital"})))},[]);let P=(0,c.useCallback)(()=>{w((0,l.uniqueNamesGenerator)({dictionaries:[l.names],length:1,style:"capital"})),G(a=>({...a,name:void 0}))},[]),Q=a.find(a=>a.id===B),R=Q&&e?e[Q.provider]??[]:[],S=(0,h.nameToHandle)(v),T=D||S,U=(0,h.getHandleError)(T),V=(0,c.useRef)(!1);(0,c.useEffect)(()=>{q?.(()=>n())},[q]),(0,c.useEffect)(()=>{p&&!V.current&&(V.current=!0,n())},[p]);let W=async a=>{a.preventDefault();let b=function({name:a,runtimeId:b}){let c={};return a.trim()||(c.name="Name is required"),b||(c.runtimeId="Select an online runtime"),c}({name:v,runtimeId:B});G(b),b.name||b.runtimeId||await r({name:v.trim(),description:x,instructions:z,runtime_id:B,email_handle:D||S||void 0,runtime_config:K?{model:K}:{},custom_email:J.current?.()??H??void 0,avatar_url:(0,k.serializeAvatarConfig)(M)})};return(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto thin-scrollbar",children:(0,b.jsxs)("form",{onSubmit:W,noValidate:!0,className:"mx-auto max-w-md flex flex-col gap-5 px-8 pt-8 pb-6",children:[(0,b.jsx)(j.AvatarPickerDialog,{config:M,onChange:N}),(0,b.jsx)(h.GeneralFields,{name:v,setName:a=>{w(a),F.name&&a.trim()&&G(a=>({...a,name:void 0}))},description:x,setDescription:y,instructions:z,setInstructions:A,model:K,setModel:L,runtimeId:B,setRuntimeId:b=>{let c=a.find(a=>a.id===B)?.provider,d=a.find(a=>a.id===b)?.provider;C(b),c&&c!==d&&L(""),F.runtimeId&&b&&G(a=>({...a,runtimeId:void 0}))},runtimes:a,providerModels:R,errors:F,runtimeAsRadio:!0,onShuffle:P,emailHandleSlot:(0,b.jsx)(h.EmailHandleField,{emailHandle:D,setEmailHandle:E,derivedHandle:S}),advancedSection:(0,b.jsx)(i.CustomEmailForm,{workspaceId:u,onDataChange:I,getDataRef:J})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,b.jsx)(g.Button,{type:"button",variant:"ghost",size:"sm",onClick:s,children:"Cancel"}),(0,b.jsx)(g.Button,{type:"submit",size:"sm",disabled:t||!!U,children:t?"Creating...":"Create"})]})]})})}var p=a.i(588339),q=a.i(780956),r=a.i(807532),s=a.i(946621),t=a.i(525132);a.s(["default",0,function(){let a=(0,d.useRouter)(),{slug:h,workspaceId:i}=(0,f.useWorkspace)(),{agents:j,runtimes:k,handleCreateAgent:l,getFirstOnlineRuntimeId:m}=(0,e.useAgentContext)(),[n,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)({}),x=(0,c.useRef)(null);(0,c.useEffect)(()=>{(0,p.fetchModelOptions)().then(w).catch(()=>{})},[]);let y=(0,c.useCallback)(a=>{x.current=a},[]);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/50 px-3 md:px-5 py-2.5",children:[(0,b.jsx)("h1",{className:"text-sm font-medium",children:"Create Agent"}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",onClick:()=>x.current?.(),className:"text-muted-foreground"}),children:(0,b.jsx)(r.CircleHelp,{className:"size-3.5"})}),(0,b.jsx)(t.TooltipContent,{children:"Show guided tour"})]})]}),(0,b.jsx)(o,{runtimes:k,defaultRuntimeId:m(),modelOptions:v,guided:0===j.length,onTourReady:y,saving:n,onCancel:()=>a.back(),onSave:async b=>{u(!0);try{let c=await l({name:b.name,description:b.description||void 0,instructions:b.instructions||void 0,runtime_id:b.runtime_id,email_handle:b.email_handle||void 0,runtime_config:b.runtime_config,avatar_url:b.avatar_url});if(c){if((0,s.trackAgentCreated)({is_first_agent:0===j.length,has_email:!!b.email_handle||!!b.custom_email}),1===j.length&&(0,s.trackSecondAgentCreated)({total_agents:2}),b.custom_email)try{await (0,p.createEmailAccount)(c.id,b.custom_email,i),q.toast.success("Custom email connected");let a=b.custom_email.emailAddress?.split("@")[1]??"";(0,s.trackCustomEmailConnected)({email_domain:a})}catch(a){q.toast.error(a instanceof Error?a.message:"Failed to connect custom email")}a.push(`/w/${h}/agents/${c.id}/chat`)}return!!c}finally{u(!1)}}})]})}],588709)},81396,a=>{a.v(a=>Promise.resolve().then(()=>a(588339)))},995011,a=>{a.v(b=>Promise.all(["server/chunks/ssr/1pzb_driver_js_dist_driver_js_mjs_02y1dhm._.js"].map(b=>a.l(b))).then(()=>b(569973)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=_0g_x3qh._.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
module.exports=[562706,a=>{"use strict";let b,c,d,e,f=(a,b)=>b.some(b=>a instanceof b),g=new WeakMap,h=new WeakMap,i=new WeakMap,j={get(a,b,c){if(a instanceof IDBTransaction){if("done"===b)return g.get(a);if("store"===b)return c.objectStoreNames[1]?void 0:c.objectStore(c.objectStoreNames[0])}return k(a[b])},set:(a,b,c)=>(a[b]=c,!0),has:(a,b)=>a instanceof IDBTransaction&&("done"===b||"store"===b)||b in a};function k(a){if(a instanceof IDBRequest){let b;return b=new Promise((b,c)=>{let d=()=>{a.removeEventListener("success",e),a.removeEventListener("error",f)},e=()=>{b(k(a.result)),d()},f=()=>{c(a.error),d()};a.addEventListener("success",e),a.addEventListener("error",f)}),i.set(b,a),b}if(h.has(a))return h.get(a);let b=function(a){if("function"==typeof a)return(e||(e=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(a)?function(...b){return a.apply(l(this),b),k(this.request)}:function(...b){return k(a.apply(l(this),b))};return(a instanceof IDBTransaction&&function(a){if(g.has(a))return;let b=new Promise((b,c)=>{let d=()=>{a.removeEventListener("complete",e),a.removeEventListener("error",f),a.removeEventListener("abort",f)},e=()=>{b(),d()},f=()=>{c(a.error||new DOMException("AbortError","AbortError")),d()};a.addEventListener("complete",e),a.addEventListener("error",f),a.addEventListener("abort",f)});g.set(a,b)}(a),f(a,d||(d=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(a,j):a}(a);return b!==a&&(h.set(a,b),i.set(b,a)),b}let l=a=>i.get(a),m=["get","getKey","getAll","getAllKeys","count"],n=["put","add","delete","clear"],o=new Map;function p(a,b){if(!(a instanceof IDBDatabase&&!(b in a)&&"string"==typeof b))return;if(o.get(b))return o.get(b);let c=b.replace(/FromIndex$/,""),d=b!==c,e=n.includes(c);if(!(c in(d?IDBIndex:IDBObjectStore).prototype)||!(e||m.includes(c)))return;let f=async function(a,...b){let f=this.transaction(a,e?"readwrite":"readonly"),g=f.store;return d&&(g=g.index(b.shift())),(await Promise.all([g[c](...b),e&&f.done]))[0]};return o.set(b,f),f}j={...b=j,get:(a,c,d)=>p(a,c)||b.get(a,c,d),has:(a,c)=>!!p(a,c)||b.has(a,c)};let q=["continue","continuePrimaryKey","advance"],r={},s=new WeakMap,t=new WeakMap,u={get(a,b){if(!q.includes(b))return a[b];let c=r[b];return c||(c=r[b]=function(...a){s.set(this,t.get(this)[b](...a))}),c}};async function*v(...a){let b=this;if(b instanceof IDBCursor||(b=await b.openCursor(...a)),!b)return;let c=new Proxy(b,u);for(t.set(c,b),i.set(c,l(b));b;)yield c,b=await (s.get(c)||b.continue()),s.delete(c)}function w(a,b){return b===Symbol.asyncIterator&&f(a,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===b&&f(a,[IDBIndex,IDBObjectStore])}j={...c=j,get:(a,b,d)=>w(a,b)?v:c.get(a,b,d),has:(a,b)=>w(a,b)||c.has(a,b)};let x=null,y=null;function z(a){return"u"<typeof indexedDB?null:x&&y===a?x:(y=a,x=function(a,{blocked:b,upgrade:c,blocking:d,terminated:e}={}){let f=indexedDB.open(a,4),g=k(f);return c&&f.addEventListener("upgradeneeded",a=>{c(k(f.result),a.oldVersion,a.newVersion,k(f.transaction),a)}),b&&f.addEventListener("blocked",a=>b(a.oldVersion,a.newVersion,a)),g.then(a=>{e&&a.addEventListener("close",()=>e()),d&&a.addEventListener("versionchange",a=>d(a.oldVersion,a.newVersion,a))}).catch(()=>{}),g}(`alook-chat-cache-${a}`,{upgrade(a,b){if(b<1){let b=a.createObjectStore("messages",{keyPath:["conversation_id","id"]});b.createIndex("by-conversation","conversation_id",{unique:!1}),b.createIndex("by-created",["conversation_id","created_at"],{unique:!1}),a.createObjectStore("cache_meta",{keyPath:"conversation_id"})}b<3&&a.createObjectStore("last_open",{keyPath:"key"}).createIndex("by-conversation","conversation_id",{unique:!1}),b<4&&a.createObjectStore("conv_extras",{keyPath:"conversation_id"})}}))}function A(a){return a?z(a):x}async function B(a,b){let c=A(b);if(!c)return null;try{let b=await c,d=await b.getAllFromIndex("messages","by-conversation",a);if(0===d.length)return null;let e=d.filter(a=>!a.id.startsWith("temp-"));e.sort((a,b)=>{let c=a.created_at.localeCompare(b.created_at);return 0!==c?c:a.id.localeCompare(b.id)});let f=await b.get("cache_meta",a);return f&&await b.put("cache_meta",{...f,lastAccessedAt:Date.now()}),e}catch{return null}}async function C(a,b,c,d,e){let f=A(e);if(!f)return null;try{let e=await f,g=await e.get("cache_meta",a);if(!g)return null;let h=IDBKeyRange.bound([a,""],[a,b],!1,!1),i=(await e.getAllFromIndex("messages","by-created",h)).filter(a=>!a.id.startsWith("temp-")&&(a.created_at!==b||!(a.id>=c)));i.sort((a,b)=>{let c=b.created_at.localeCompare(a.created_at);return 0!==c?c:b.id.localeCompare(a.id)});let j=i.slice(0,d);if(j.length<d&&g.hasMore)return null;return await e.put("cache_meta",{...g,lastAccessedAt:Date.now()}),{messages:j.reverse(),hasMore:i.length>d||g.hasMore}}catch{return null}}async function D(a,b,c,d,e){let f=A(d);if(f)try{let d=await f,g=b.filter(a=>!a.id.startsWith("temp-"));if(0===g.length)return;let h=d.transaction(["messages","cache_meta"],"readwrite"),i=h.objectStore("messages"),j=h.objectStore("cache_meta");for(let a of g)await i.put(a);let k=await i.index("by-conversation").getAllKeys(a),l=Date.now(),m=g.reduce((a,b)=>a.created_at>b.created_at?a:b),n=await j.get(a),o=c??n?.hasMore??!0,p=n?.newestMessageId&&n.newestMessageId!==m.id?await (async()=>{let b=await i.get([a,n.newestMessageId]);return b&&b.created_at>m.created_at?b.id:m.id})():m.id,q={conversation_id:a,lastFetchedAt:l,lastAccessedAt:l,messageCount:k.length,newestMessageId:p,hasMore:o,serverMessageCount:e??n?.serverMessageCount??0};await j.put(q),await h.done,L().catch(()=>{})}catch{}}async function E(a,b,c){let d=A(c);if(d&&!b.id.startsWith("temp-"))try{let c=await d,e=await c.get("cache_meta",a);if(!e)return;let f=await c.get("messages",[a,b.id]);await c.put("messages",b),await c.put("cache_meta",{...e,lastAccessedAt:Date.now(),messageCount:f?e.messageCount:e.messageCount+1,newestMessageId:b.id})}catch{}}async function F(a,b){let c=A(b);if(!c)return null;try{let b=await c;return await b.get("cache_meta",a)??null}catch{return null}}function G(a,b){return`${a}::${null==b?"":b}`}async function H(a,b,c){let d=A(c);if(!d)return null;try{let c=await d;return await c.get("last_open",G(a,b))??null}catch{return null}}async function I(a,b,c,d){let e=A(d);if(e)try{let d=await e;await d.put("last_open",{key:G(a,b),conversation_id:c.conversation_id,newestMessageId:c.newestMessageId,serverMessageCount:c.serverMessageCount,updatedAt:Date.now()})}catch{}}async function J(a,b){let c=A(b);if(!c)return null;try{let b=await c;return await b.get("conv_extras",a)??null}catch{return null}}async function K(a,b,c){let d=A(c);if(d)try{let c=await d;await c.put("conv_extras",{conversation_id:a,...b,updatedAt:Date.now()})}catch{}}async function L(a=50){let b=A();if(b)try{let c=await b,d=await c.getAll("cache_meta");if(d.length<=a)return;d.sort((a,b)=>a.lastAccessedAt-b.lastAccessedAt);let e=d.slice(0,d.length-a),f=c.transaction(["messages","cache_meta","last_open","conv_extras"],"readwrite"),g=f.objectStore("messages"),h=f.objectStore("cache_meta"),i=f.objectStore("last_open"),j=f.objectStore("conv_extras");for(let a of e){for(let b of(await g.index("by-conversation").getAllKeys(a.conversation_id)))await g.delete(b);for(let b of(await h.delete(a.conversation_id),await i.index("by-conversation").getAllKeys(a.conversation_id)))await i.delete(b);await j.delete(a.conversation_id)}await f.done}catch{}}async function M(){if("u">typeof indexedDB)try{x&&((await x).close(),x=null),y&&(await N(`alook-chat-cache-${y}`),y=null)}catch{}}async function N(a){return new Promise((b,c)=>{let d=indexedDB.deleteDatabase(a);d.onsuccess=()=>b(),d.onerror=()=>c(d.error),d.onblocked=()=>b()})}a.s(["appendCachedMessage",0,E,"clearAllCache",0,M,"getCacheMeta",0,F,"getCachedMessages",0,B,"getCachedMessagesBefore",0,C,"getConvExtras",0,J,"getLastOpenConversation",0,H,"mergeCachedMessages",0,D,"openCacheDB",0,z,"setConvExtras",0,K,"setLastOpenConversation",0,I],562706)},178472,(a,b,c)=>{"use strict";let d;Object.defineProperty(c,"__esModule",{value:!0});var e={getAssetToken:function(){return i},getAssetTokenQuery:function(){return j},getDeploymentId:function(){return g},getDeploymentIdQuery:function(){return h}};for(var f in e)Object.defineProperty(c,f,{enumerable:!0,get:e[f]});function g(){return d}function h(a=!1){return d?`${a?"&":"?"}dpl=${d}`:""}function i(){return!1}function j(a=!1){return""}d=void 0},215544,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"useMergedRef",{enumerable:!0,get:function(){return e}});let d=a.r(734803);function e(a,b){let c=(0,d.useRef)(null),e=(0,d.useRef)(null);return(0,d.useCallback)(d=>{if(null===d){let a=c.current;a&&(c.current=null,a());let b=e.current;b&&(e.current=null,b())}else a&&(c.current=f(a,d)),b&&(e.current=f(b,d))},[a,b])}function f(a,b){if("function"!=typeof a)return a.current=b,()=>{a.current=null};{let c=a(b);return"function"==typeof c?c:()=>a(null)}}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},130651,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return d}});let d=a=>{}},386844,a=>{"use strict";var b=a.i(734803),c=a.i(191091),d=a.i(22558),e=a.i(27278);a.s(["useAnchoredPopupScrollLock",0,function(a,f,g,h){let[i,j]=b.useState(!1);(0,e.useIsoLayoutEffect)(()=>{if(!a||!f||null==g)return void j(!1);let b=(0,c.ownerDocument)(g).documentElement.clientWidth,d=g.offsetWidth;j(b>0&&d>0&&d>=b-20)},[a,f,g]),(0,d.useScrollLock)(a&&(!f||i),h)}])},193026,a=>{"use strict";var b=a.i(795845),c=a.i(734803);let d=c.createContext(void 0);a.s(["useToolbarRootContext",0,function(a){let e=c.useContext(d);if(void 0===e&&!a)throw Error((0,b.default)(69));return e}])},586220,a=>{"use strict";var b=a.i(734803);a.s(["useIsMobile",0,function(){let[a,c]=b.useState(void 0);return b.useEffect(()=>{let a=window.matchMedia("(max-width: 639px)"),b=()=>{c(window.innerWidth<640)};return a.addEventListener("change",b),c(window.innerWidth<640),()=>a.removeEventListener("change",b)},[]),!!a}])},655795,a=>{"use strict";var b=a.i(616612),c=a.i(75118);a.s(["Kbd",0,function({className:a,...d}){return(0,b.jsx)("kbd",{"data-slot":"kbd",className:(0,c.cn)("pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",a),...d})}])},735132,a=>{"use strict";a.i(325848),a.i(253260),a.i(628508),a.i(949409),a.s([])},377932,a=>{"use strict";let b=(0,a.i(410732).default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);a.s(["GitBranch",0,b],377932)},452906,a=>{"use strict";var b=a.i(616612),c=a.i(734803),d=a.i(588339),e=a.i(780956);let f=(0,c.createContext)(null);a.s(["ChannelProvider",0,function({workspaceId:a,children:g}){let[h,i]=(0,c.useState)([]),[j,k]=(0,c.useState)("default"),[l,m]=(0,c.useState)(!0),[n,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(null),v=(0,c.useCallback)(async()=>{try{let b=await (0,d.listChannels)(a);i(b)}catch{i([])}},[a]);(0,c.useEffect)(()=>{v().finally(()=>m(!1))},[a,v]),(0,c.useEffect)(()=>{},[a,n]);let w=(0,c.useCallback)(a=>{k(a)},[a,n]),x=(0,c.useCallback)(async b=>{if(!p){q(!0);try{let c=await (0,d.createChannelApi)(a,b);return await v(),c}finally{q(!1)}}},[a,v,p]),y=(0,c.useCallback)(async(b,c)=>{if(!t){u(b);try{let e=h.find(a=>a.id===b);await (0,d.renameChannelApi)(b,a,c),e&&e.name===j&&w(c),await v()}finally{u(null)}}},[a,h,j,w,v,t]),z=(0,c.useCallback)(async b=>{if(!r){s(b);try{let c=h.find(a=>a.id===b);await (0,d.deleteChannelApi)(b,a),c&&c.name===j&&w("default"),await v()}finally{s(null)}}},[a,h,j,w,v,r]),A=(0,c.useCallback)(async b=>{i(a=>{let c=new Map(a.map(a=>[a.id,a])),d=b.map(a=>c.get(a)).filter(a=>void 0!==a),e=new Set(b);return[...a.filter(a=>!e.has(a.id)),...d]});try{await (0,d.reorderChannelsApi)(a,b)}catch{await v(),e.toast.error("Failed to reorder channels")}},[a,v]);return(0,b.jsx)(f.Provider,{value:{channels:h,activeChannel:j,loading:l,creating:p,deleting:r,renaming:t,setActiveChannel:w,setAgentId:o,createChannel:x,renameChannel:y,deleteChannel:z,reorderChannels:A,refresh:v},children:g})},"useChannel",0,function(){let a=(0,c.useContext)(f);if(!a)throw Error("useChannel must be used within a ChannelProvider");return a}])},162363,a=>{"use strict";let b=(0,a.i(410732).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);a.s(["MessageSquare",0,b],162363)},637259,a=>{"use strict";let b=(0,a.i(410732).default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);a.s(["CircleDot",0,b],637259)},116668,a=>{"use strict";let b=(0,a.i(410732).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);a.s(["ArrowUp",0,b],116668)},170016,a=>{"use strict";let b=(0,a.i(410732).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);a.s(["default",0,b])},157887,a=>{"use strict";var b=a.i(170016);a.s(["ChevronRight",()=>b.default])},387123,a=>{"use strict";a.s(["relativeTime",0,function(a){let b=new Date(a);if(isNaN(b.getTime()))return"";let 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"})}])},469249,63592,a=>{"use strict";var b=a.i(616612),c=a.i(734803),d=a.i(387123);a.i(735132);var e=a.i(253260),f=a.i(325848),g=a.i(157887),h=a.i(162363),i=a.i(7455);function j(a,{delay:b=450,moveThreshold:d=10}={}){let e=c.useRef(null),f=c.useRef(null),g=c.useRef(!1),h=c.useRef(a);c.useEffect(()=>{h.current=a});let i=c.useCallback(()=>{e.current&&(clearTimeout(e.current),e.current=null),f.current=null},[]),k=c.useCallback(a=>{"mouse"!==a.pointerType&&(i(),g.current=!1,f.current={x:a.clientX,y:a.clientY},e.current=setTimeout(()=>{g.current=!0,f.current=null,e.current=null,h.current()},b))},[i,b]),l=c.useCallback(a=>{let b=f.current;if(!b)return;let c=Math.abs(a.clientX-b.x),e=Math.abs(a.clientY-b.y);(c>d||e>d)&&i()},[i,d]),m=c.useCallback(a=>{g.current&&(a.preventDefault(),a.stopPropagation(),g.current=!1)},[]);return c.useEffect(()=>i,[i]),{onPointerDown:k,onPointerMove:l,onPointerUp:i,onPointerCancel:i,onPointerLeave:i,onClick:m}}a.s(["useLongPress",0,j],63592),a.s(["EmailCard",0,function({subject:a,address:k,direction:l,onClick:m,timestamp:n,isInternal:o,internalHandle:p,targetConvId:q,targetAgentId:r,agents:s,onAgentChatOpen:t,touchAction:u}){let[v,w]=(0,c.useState)(null),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(!1),B=j(()=>{u&&A(!0)}),C=(0,c.useCallback)(()=>{if(!o||x)return;y(!0);let a=s?.find(a=>a.email_handle===p);a&&w({name:a.name,avatarConfig:(0,f.parseAvatarUrl)(a.avatar_url)})},[o,x,s,p]);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{type:"button",onClick:a=>{u&&B.onClick&&(B.onClick(a),a.defaultPrevented)||m?.()},disabled:!m,onPointerEnter:C,...u?{onPointerDown:B.onPointerDown,onPointerMove:B.onPointerMove,onPointerUp:B.onPointerUp,onPointerCancel:B.onPointerCancel,onPointerLeave:B.onPointerLeave}:{},className:`card-grain w-104 max-w-full rounded-(--radius) border border-(--border) bg-(--paper) text-left flex flex-col cursor-pointer [transition:translate_.2s_cubic-bezier(.2,.8,.2,1),box-shadow_.2s_ease] hover:-translate-y-0.5 [box-shadow:var(--e1)] hover:[box-shadow:var(--e2)] ${o&&q?"overflow-visible group/ecard relative hover:z-20":"overflow-hidden"}`,children:[(0,b.jsx)("span",{className:"h-2.5 relative block",children:(0,b.jsx)("svg",{viewBox:"0 0 100 10",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:(0,b.jsx)("path",{d:"M8,-1 L50,9 L92,-1",stroke:"var(--te)",strokeWidth:"2.5",opacity:"0.4",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"})})}),(0,b.jsxs)("span",{className:"p-3 flex flex-col",children:[(0,b.jsxs)("span",{className:"flex items-start gap-1 mb-1",children:[(0,b.jsxs)("span",{className:"text-[0.72rem] text-(--muted-foreground) flex-1 min-w-0 whitespace-nowrap overflow-hidden text-ellipsis",children:["inbound"===l?"from ":"to ",k]}),(0,b.jsxs)("span",{className:"shrink-0 flex flex-col items-end gap-0.5",children:[n&&(0,b.jsx)("span",{className:"text-[0.62rem] font-mono text-muted-foreground/65",children:(0,d.relativeTime)(n)}),(0,b.jsx)("span",{className:"text-[0.5rem] font-bold uppercase tracking-wider text-(--te) px-1 py-0.5 rounded-[3px] border-[1.5px] border-(--te) opacity-45 -rotate-3",children:"inbound"===l?"Inbound":"Sent"})]})]}),(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold tracking-[-0.01em] leading-[1.35] line-clamp-2",children:a})]}),o&&v&&q&&(0,b.jsx)("span",{className:"absolute -bottom-2.5 left-1/2 -translate-x-1/2 translate-y-1 opacity-0 group-hover/ecard:opacity-100 group-hover/ecard:translate-y-0 transition-all duration-200 ease-out pointer-events-none group-hover/ecard:pointer-events-auto z-10",children:(0,b.jsxs)("span",{role:"button",tabIndex:0,onClick:a=>{a.stopPropagation(),q&&r&&t?.(r,q)},onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&(a.stopPropagation(),q&&r&&t?.(r,q))},className:"flex items-center gap-1.5 py-0.5 pl-0.5 pr-2 bg-(--paper) border border-(--border) rounded-full shadow-md hover:bg-(--secondary) cursor-pointer whitespace-nowrap",children:[v.avatarConfig&&(0,b.jsx)(e.AnimatedAvatar,{config:v.avatarConfig,size:20,isHovered:!1,className:"rounded-full"}),(0,b.jsx)("span",{className:"text-[0.62rem] font-semibold opacity-80",children:v.name}),(0,b.jsx)(g.ChevronRight,{className:"w-2.5 h-2.5 text-muted-foreground/45 -ml-0.5"})]})})]}),u&&(0,b.jsx)(i.Sheet,{open:z,onOpenChange:A,children:(0,b.jsx)(i.SheetContent,{side:"bottom",showCloseButton:!1,className:"rounded-t-2xl p-2",children:(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsxs)("button",{type:"button",onClick:()=>{u.onClick(),A(!1)},className:"flex items-center gap-3 rounded-lg px-3 py-3 text-left text-[0.95rem] active:bg-muted text-foreground",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:(0,b.jsx)(h.MessageSquare,{className:"w-5 h-5"})}),u.label]})})})})]})}],469249)},358920,633560,16981,a=>{"use strict";var b=a.i(616612),c=a.i(75118);let d={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-br-[0.35rem]",middle:"rounded-[1.05rem] rounded-tr-[0.35rem] rounded-br-[0.35rem]",last:"rounded-[1.05rem] rounded-tr-[0.35rem]"},e={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-bl-[0.35rem]",middle:"rounded-[1.05rem] rounded-tl-[0.35rem] rounded-bl-[0.35rem]",last:"rounded-[1.05rem] rounded-tl-[0.35rem]"};function f(){return(0,b.jsxs)("span",{className:"inline-flex items-center gap-0.5","aria-hidden":!0,children:[(0,b.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_infinite]"}),(0,b.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.2s_infinite]"}),(0,b.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.4s_infinite]"})]})}a.s(["MessageBubble",0,function({variant:a,position:f,children:g,className:h,...i}){let j="user"===a?d[f]:e[f];return(0,b.jsx)("div",{className:(0,c.cn)("px-3 py-1.5 text-base",j,"user"===a?"bg-primary text-primary-foreground":"bg-muted text-foreground",h),...i,children:g})}],358920),a.s(["AVATAR_SIZE",0,30,"MessageCluster",0,function({avatar:a,name:d,children:e,position:f,className:g}){let h="first"===f||"solo"===f;return(0,b.jsxs)("div",{className:(0,c.cn)("flex justify-start items-start gap-2 min-w-0",g),children:[(0,b.jsx)("div",{className:(0,c.cn)("w-[30px]","shrink-0"),"aria-hidden":!h,children:h&&a}),(0,b.jsxs)("div",{className:"min-w-0 max-w-[86%] flex flex-col items-start gap-0.5",children:[h&&(0,b.jsx)("span",{className:"text-[0.85rem] font-semibold text-foreground leading-[1.15] pt-0.5 mb-1",children:d}),e]})]})}],633560),a.s(["PresenceLine",0,function({agentFirstName:a,taskStatus:d}){let e="running"===d?"typing":"queued"===d||"dispatched"===d?"reading":"idle";return(0,b.jsx)("div",{className:"h-5 px-1 mb-2 flex items-center","aria-live":"polite",children:(0,b.jsx)("span",{className:(0,c.cn)("inline-flex items-center gap-1.5 text-sm text-muted-foreground","idle"!==e&&"motion-safe:animate-[fade-up_200ms_ease-out_both]"),children:"idle"!==e&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"reading"===e?`${a} is reading`:`${a} is typing`}),(0,b.jsx)(f,{})]})},e)})}],16981)},564616,893527,731986,213187,a=>{"use strict";var b=a.i(675767),c=(0,a.i(86424).default)(Object.keys,Object),d=Object.prototype.hasOwnProperty;let e=function(a){if(!(0,b.default)(a))return c(a);var e=[];for(var f in Object(a))d.call(a,f)&&"constructor"!=f&&e.push(f);return e};a.s(["default",0,e],893527);var f=a.i(900241),g=a.i(324902),h=(0,f.default)(g.default,"DataView"),i=a.i(711474),j=(0,f.default)(g.default,"Promise"),k=(0,f.default)(g.default,"Set");a.s(["default",0,k],731986);var l=(0,f.default)(g.default,"WeakMap"),m=a.i(380845),n=a.i(355913),o="[object Map]",p="[object Promise]",q="[object Set]",r="[object WeakMap]",s="[object DataView]",t=(0,n.default)(h),u=(0,n.default)(i.default),v=(0,n.default)(j),w=(0,n.default)(k),x=(0,n.default)(l),y=m.default;(h&&y(new h(new ArrayBuffer(1)))!=s||i.default&&y(new i.default)!=o||j&&y(j.resolve())!=p||k&&y(new k)!=q||l&&y(new l)!=r)&&(y=function(a){var b=(0,m.default)(a),c="[object Object]"==b?a.constructor:void 0,d=c?(0,n.default)(c):"";if(d)switch(d){case t:return s;case u:return o;case v:return p;case w:return q;case x:return r}return b});let z=y;a.s(["default",0,z],213187);var A=a.i(569825),B=a.i(42252),C=a.i(886777),D=a.i(578774),E=a.i(960922),F=Object.prototype.hasOwnProperty;a.s(["default",0,function(a){if(null==a)return!0;if((0,C.default)(a)&&((0,B.default)(a)||"string"==typeof a||"function"==typeof a.splice||(0,D.default)(a)||(0,E.default)(a)||(0,A.default)(a)))return!a.length;var c=z(a);if("[object Map]"==c||"[object Set]"==c)return!a.size;if((0,b.default)(a))return!e(a).length;for(var d in a)if(F.call(a,d))return!1;return!0}],564616)},630737,a=>{"use strict";var b=a.i(115499),c=a.i(30531);a.i(43066);var d=a.i(455784),e=(0,c.__name)(a=>{let{securityLevel:c}=(0,b.getConfig2)(),e=(0,d.select)("body");if("sandbox"===c){let b=(0,d.select)(`#i${a}`),c=b.node()?.contentDocument??document;e=(0,d.select)(c.body)}return e.select(`#${a}`)},"selectSvgElement");a.s(["selectSvgElement",0,e])},598169,a=>{"use strict";let b=(0,a.i(410732).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);a.s(["ArrowLeft",0,b],598169)},354875,a=>{"use strict";let b=(0,a.i(410732).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);a.s(["File",0,b],354875)},702082,a=>{"use strict";let b=(0,a.i(410732).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);a.s(["FileText",0,b],702082)},405965,971313,a=>{"use strict";var b=a.i(975326);a.s([],405965),a.s(["Streamdown",()=>b.C],971313)},596174,a=>{"use strict";var b=a.i(616612),c=a.i(734803),d=a.i(75118);a.s(["SheetResizeHandle",0,function({onPointerDown:a,onPointerMove:c,onPointerUp:e,className:f,withHandle:g=!0}){return(0,b.jsx)("div",{onPointerDown:a,onPointerMove:c,onPointerUp:e,onLostPointerCapture:e,className:(0,d.cn)("hidden sm:flex absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize z-10 items-center justify-center hover:bg-primary/10 active:bg-primary/20 transition-colors rounded-l-xl",f),children:g&&(0,b.jsx)("div",{className:"h-6 w-1 rounded-lg bg-border"})})},"useSheetResize",0,function({defaultWidth:a=480,minWidth:b=320,maxWidthRatio:d=.8}={}){let[e,f]=(0,c.useState)(a),g=(0,c.useRef)(!1),h=(0,c.useCallback)(a=>{a.preventDefault(),a.target.setPointerCapture(a.pointerId),g.current=!0},[]);return{width:e,onPointerDown:h,onPointerMove:(0,c.useCallback)(a=>{g.current&&f(Math.min(window.innerWidth*d,Math.max(b,window.innerWidth-a.clientX)))},[b,d]),onPointerUp:(0,c.useCallback)(a=>{g.current=!1,a.target.releasePointerCapture(a.pointerId)},[])}}])},804608,a=>{"use strict";let b=(0,a.i(410732).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);a.s(["User",0,b],804608)},25668,a=>{"use strict";var b=a.i(616612),c=a.i(75118);a.s(["Skeleton",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"skeleton",className:(0,c.cn)("animate-pulse rounded-md bg-muted",a),...d})}])},440904,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DEFAULT_SEGMENT_KEY:function(){return l},NOT_FOUND_SEGMENT_KEY:function(){return m},PAGE_SEGMENT_KEY:function(){return k},addSearchParamsIfPageSegment:function(){return i},computeSelectedLayoutSegment:function(){return j},getSegmentValue:function(){return f},getSelectedLayoutSegmentPath:function(){return function a(b,c,d=!0,e=[]){let g;if(d)g=b[1][c];else{let a=b[1];g=a.children??Object.values(a)[0]}if(!g)return e;let h=f(g[0]);return!h||h.startsWith(k)?e:(e.push(h),a(g,c,!1,e))}},isGroupSegment:function(){return g},isParallelRouteSegment:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return Array.isArray(a)?a[1]:a}function g(a){return"("===a[0]&&a.endsWith(")")}function h(a){return a.startsWith("@")&&"@children"!==a}function i(a,b){if(a.includes(k)){let a=JSON.stringify(b);return"{}"!==a?k+"?"+a:k}return a}function j(a,b){if(!a||0===a.length)return null;let c="children"===b?a[0]:a[a.length-1];return c===l?null:c}let k="__PAGE__",l="__DEFAULT__",m="/_not-found"},123122,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"InvariantError",{enumerable:!0,get:function(){return d}});class d extends Error{constructor(a,b){super(`Invariant: ${a.endsWith(".")?a:a+"."} This is a bug in Next.js.`,b),this.name="InvariantError"}}},819366,(a,b,c)=>{"use strict";function d(){let a,b,c=new Promise((c,d)=>{a=c,b=d});return{resolve:a,reject:b,promise:c}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"createPromiseWithResolvers",{enumerable:!0,get:function(){return d}})},148133,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={BailoutToCSRError:function(){return g},isBailoutToCSRError:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f="BAILOUT_TO_CLIENT_SIDE_RENDERING";class g extends Error{constructor(a){super(`Bail out to client-side rendering: ${a}`),this.reason=a,this.digest=f}}function h(a){return"object"==typeof a&&null!==a&&"digest"in a&&a.digest===f}},506180,a=>{"use strict";var b=a.i(616612),c=a.i(734803);let d=(0,c.createContext)(null);a.s(["WorkspaceProvider",0,function({workspaceId:a,slug:e,children:f}){return(0,c.useEffect)(()=>{try{localStorage.setItem("lastWorkspace",e)}catch{}},[e]),(0,b.jsx)(d.Provider,{value:{workspaceId:a,slug:e},children:f})},"useWorkspace",0,function(){let a=(0,c.useContext)(d);if(!a)throw Error("useWorkspace must be used within WorkspaceProvider");return a}])},551798,a=>{"use strict";let b=(0,a.i(410732).default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);a.s(["Mail",0,b],551798)},351360,a=>{"use strict";var b=a.i(99597);a.s(["X",()=>b.default])},343558,135510,a=>{"use strict";let b=(0,a.i(410732).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);a.s(["Paperclip",0,b],343558);var c=a.i(616612),d=a.i(734803),e=a.i(401138);let f=`
|
|
2
|
+
html, body {
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
}
|
|
5
|
+
`,g=`
|
|
6
|
+
html, body {
|
|
7
|
+
--sb-thumb: rgba(0,0,0,0.15);
|
|
8
|
+
--sb-hover: rgba(0,0,0,0.3);
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
background: transparent;
|
|
12
|
+
color: #1a1a1a;
|
|
13
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
14
|
+
font-size: 15px;
|
|
15
|
+
line-height: 1.6;
|
|
16
|
+
word-wrap: break-word;
|
|
17
|
+
overflow-wrap: break-word;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
a { color: inherit; }
|
|
21
|
+
img { max-width: 100%; height: auto; }
|
|
22
|
+
`,h=`
|
|
23
|
+
html, body {
|
|
24
|
+
--sb-thumb: rgba(255,255,255,0.1);
|
|
25
|
+
--sb-hover: rgba(255,255,255,0.25);
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: 0;
|
|
28
|
+
background: transparent;
|
|
29
|
+
color: #e8e5e0;
|
|
30
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
31
|
+
font-size: 15px;
|
|
32
|
+
line-height: 1.6;
|
|
33
|
+
word-wrap: break-word;
|
|
34
|
+
overflow-wrap: break-word;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
color-scheme: dark;
|
|
37
|
+
}
|
|
38
|
+
a { color: inherit; }
|
|
39
|
+
img { max-width: 100%; height: auto; }
|
|
40
|
+
/* Force dark-friendly defaults on common email patterns */
|
|
41
|
+
body, div, td, th, p, span, li {
|
|
42
|
+
color: #e8e5e0 !important;
|
|
43
|
+
}
|
|
44
|
+
table, tr, td, th, div, section, article, header, footer, main {
|
|
45
|
+
background-color: transparent !important;
|
|
46
|
+
border-color: rgba(255, 255, 255, 0.1) !important;
|
|
47
|
+
}
|
|
48
|
+
/* Preserve image backgrounds (logos, etc) */
|
|
49
|
+
img { background-color: transparent !important; }
|
|
50
|
+
h1, h2, h3, h4, h5, h6 {
|
|
51
|
+
color: #f0ede8 !important;
|
|
52
|
+
}
|
|
53
|
+
a { color: #93b5ff !important; }
|
|
54
|
+
`;a.s(["EmailBodyFrame",0,function({html:a,className:b}){let i=(0,d.useRef)(null),{resolvedTheme:j}=(0,e.useTheme)(),[k,l]=(0,d.useState)(200),m="dark"===j;return(0,d.useEffect)(()=>{let b=i.current;if(!b)return;let c=null;b.srcdoc=`<!DOCTYPE html>
|
|
55
|
+
<html>
|
|
56
|
+
<head>
|
|
57
|
+
<meta charset="utf-8">
|
|
58
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
59
|
+
<meta name="color-scheme" content="${m?"dark":"light"}">
|
|
60
|
+
<style>${f}${m?h:g}</style>
|
|
61
|
+
</head>
|
|
62
|
+
<body>${a}</body>
|
|
63
|
+
</html>`;let d=()=>{let a=b.contentDocument;if(!a)return;let d=()=>{let b=a.documentElement.scrollHeight;b>0&&l(b)};d(),(c=new ResizeObserver(d)).observe(a.documentElement)};return b.addEventListener("load",d),()=>{b.removeEventListener("load",d),c?.disconnect()}},[a,m]),(0,c.jsx)("iframe",{ref:i,sandbox:"allow-same-origin",className:b,style:{width:"100%",height:`${k}px`,border:"none",display:"block"},title:"Email content"})}],135510)},611606,a=>{"use strict";let b=(0,a.i(410732).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"}]]);a.s(["default",0,b])},464830,a=>{"use strict";var b=a.i(129304),c=a.i(870562),d=a.i(142261),e=a.i(75118);let f=(0,d.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});a.s(["Badge",0,function({className:a,variant:d="default",render:g,...h}){var i;return i={defaultTagName:"span",props:(0,b.mergeProps)({className:(0,e.cn)(f({variant:d}),a)},h),render:g,state:{slot:"badge",variant:d}},(0,c.useRenderElement)(i.defaultTagName??"div",i,i)},"badgeVariants",0,f],464830)},973576,a=>{"use strict";var b=a.i(734803),c=a.i(28837),d=a.i(256577),e=a.i(595637);a.s(["useCompositeItem",0,function(a={}){let{highlightItemOnHover:f,highlightedIndex:g,onHighlightedIndexChange:h}=(0,d.useCompositeRootContext)(),{ref:i,index:j}=(0,e.useCompositeListItem)(a),k=g===j,l=b.useRef(null),m=(0,c.useMergedRefs)(i,l);return{compositeProps:b.useMemo(()=>({tabIndex:k?0:-1,onFocus(){h(j)},onMouseMove(){let a=l.current;if(!f||!a)return;let b=a.hasAttribute("disabled")||"true"===a.ariaDisabled;k||b||a.focus()}}),[k,h,j,f]),compositeRef:m,index:j}}])},340490,a=>{"use strict";let b=(0,a.i(410732).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);a.s(["Copy",0,b],340490)},919690,a=>{"use strict";let b=(0,a.i(410732).default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);a.s(["ArrowUpRight",0,b],919690)},626806,a=>{"use strict";let b=["completed","failed"];function c(){return!1}async function d(){if(!c())return!1}a.s(["NOTIFICATION_EVENTS",0,b,"NOTIFICATION_EVENT_LABELS",0,{completed:"Task Completed",failed:"Task Failed"},"getNotificationEnabled",0,function(){return!1},"getNotificationEvents",0,function(){return[...b]},"isNotificationSupported",0,c,"requestNotificationPermission",0,d,"sendTaskNotification",0,function(a,b,c){},"setNotificationEnabled",0,function(a){localStorage.setItem("browser-notification-enabled",String(a))},"setNotificationEvents",0,function(a){localStorage.setItem("browser-notification-events",JSON.stringify(a))}])},224583,a=>{"use strict";let b=(0,a.i(410732).default)("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);a.s(["CalendarDays",0,b],224583)},738242,389660,a=>{"use strict";var b=a.i(410732);let c=(0,b.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);a.s(["RotateCw",0,c],738242);var d=a.i(616612),e=a.i(734803),f=a.i(732254),g=a.i(525132);let h=(0,b.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var i=a.i(75118);a.s(["ScrollToBottomButton",0,function({scrollRef:a,threshold:b=100}){let[c,j]=(0,e.useState)(!1),k=(0,e.useCallback)(()=>{let c=a.current;if(!c)return;let d=c.scrollHeight-c.scrollTop-c.clientHeight<b;j(c.scrollHeight>c.clientHeight&&!d)},[a,b]);return(0,e.useEffect)(()=>{let b=a.current;if(!b)return;b.addEventListener("scroll",k,{passive:!0}),k();let c=new ResizeObserver(k);return c.observe(b),()=>{b.removeEventListener("scroll",k),c.disconnect()}},[a,k]),(0,d.jsx)("div",{className:(0,i.cn)("absolute bottom-1 left-1/2 -translate-x-1/2 z-10 transition-all duration-200 ease-out",c?"opacity-100 translate-y-0":"opacity-0 translate-y-2 pointer-events-none"),children:(0,d.jsxs)(g.Tooltip,{children:[(0,d.jsx)(g.TooltipTrigger,{render:(0,d.jsx)(f.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let b=a.current;b&&b.scrollTo({top:b.scrollHeight,behavior:"smooth"})},className:"rounded-full bg-background/80 backdrop-blur-sm border shadow-sm hover:bg-background"}),children:(0,d.jsx)(h,{})}),(0,d.jsx)(g.TooltipContent,{side:"top",children:"Scroll to bottom"})]})})}],389660)},613348,a=>{"use strict";var b=a.i(893256);a.s(["Check",()=>b.default])},396439,a=>{"use strict";let b=(0,a.i(410732).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);a.s(["Plus",0,b],396439)},790107,a=>{"use strict";let b=(0,a.i(410732).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);a.s(["Trash2",0,b],790107)},22902,a=>{"use strict";var b=a.i(616612),c=a.i(432340),d=a.i(732254);a.s(["ConfirmDialog",0,function({open:a,onOpenChange:e,title:f,description:g,confirmLabel:h="Remove",loadingLabel:i,confirmVariant:j="destructive",loading:k=!1,onConfirm:l}){return(0,b.jsx)(c.Dialog,{open:a,onOpenChange:e,children:(0,b.jsxs)(c.DialogContent,{showCloseButton:!1,children:[(0,b.jsxs)(c.DialogHeader,{children:[(0,b.jsx)(c.DialogTitle,{children:f}),(0,b.jsx)(c.DialogDescription,{children:g})]}),(0,b.jsxs)(c.DialogFooter,{children:[(0,b.jsx)(d.Button,{variant:"outline",size:"sm",onClick:()=>e(!1),disabled:k,children:"Cancel"}),(0,b.jsx)(d.Button,{variant:j,size:"sm",onClick:l,disabled:k,children:k?i??`${h}...`:h})]})]})})}])},903919,a=>{"use strict";let b=(0,a.i(410732).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);a.s(["AlertCircle",0,b],903919)},350860,a=>{"use strict";let b=(0,a.i(410732).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);a.s(["Clock",0,b],350860)},707190,a=>{"use strict";let b=(0,a.i(410732).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);a.s(["Square",0,b],707190)}];
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=_0lil2o-._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[597047,a=>a.a(async(b,c)=>{try{var d=a.i(616612),e=a.i(734803),f=a.i(780956),g=a.i(630991),h=a.i(506180),i=a.i(454607),j=a.i(588339),k=a.i(732254),l=a.i(334235),m=a.i(76592),n=a.i(25668),o=a.i(390248),p=a.i(946621),q=b([i]);[i]=q.then?(await q)():q,a.s(["GeneralTab",0,function(){let{workspaceId:a,slug:b}=(0,h.useWorkspace)(),c=(0,i.useSession)(),q=(0,g.useRouter)(),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(!0),[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(""),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)({}),[H,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(!1),L=(0,e.useCallback)(async()=>{u(!0);try{let b=c.data?.user?.id,[d,e]=await Promise.all([(0,j.listMembers)(a),(0,j.listWorkspaces)()]),f=d.find(a=>a.user_id===b);s(f?.role??"");let g=e.find(b=>b.id===a);g&&(w(g.name),y(g.slug),A(g.name),C(g.slug))}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to load workspace info")}finally{u(!1)}},[a,c.data?.user?.id]);(0,e.useEffect)(()=>{c.data&&L()},[L,c.data]);let M=v!==z||x!==B,N=async()=>{let c=(0,o.validateWorkspaceForm)({name:v,slug:x});if(G(c),!(0,o.hasWorkspaceFormErrors)(c)){E(!0);try{let c=await (0,j.updateWorkspace)(a,{name:v.trim(),slug:x.trim()});(0,p.trackSettingsUpdated)({setting_tab:"general"}),A(c.name),C(c.slug),f.toast.success("Workspace updated"),c.slug!==b&&q.replace(`/w/${c.slug}/settings`)}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to update workspace")}finally{E(!1)}}},O=async()=>{if(H===z){K(!0);try{await (0,j.deleteWorkspace)(a,z),f.toast.success("Workspace deleted"),q.replace("/workspaces")}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to delete workspace")}finally{K(!1)}}};return t?(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)(n.Skeleton,{className:"h-4 w-32"}),(0,d.jsx)(n.Skeleton,{className:"h-10 w-full"}),(0,d.jsx)(n.Skeleton,{className:"h-10 w-full"})]}):"owner"!==r?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Only workspace owners can edit workspace settings."}):(0,d.jsxs)("div",{className:"space-y-10",children:[(0,d.jsxs)("section",{className:"space-y-4",children:[(0,d.jsx)("h2",{className:"text-sm font-medium",children:"Workspace"}),(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)(m.Label,{htmlFor:"workspace-name",children:"Name"}),(0,d.jsx)(l.Input,{id:"workspace-name",value:v,onChange:a=>{let b=a.target.value;w(b),F.name&&b.trim()&&G(a=>({...a,name:void 0}))},placeholder:"Workspace name","aria-invalid":!!F.name,"aria-describedby":F.name?"workspace-name-error":void 0}),F.name&&(0,d.jsx)("p",{id:"workspace-name-error",className:"text-xs text-destructive",children:F.name})]}),(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)(m.Label,{htmlFor:"workspace-slug",children:"Slug"}),(0,d.jsx)(l.Input,{id:"workspace-slug",value:x,onChange:a=>{let b=a.target.value;y(b),F.slug&&b.trim()&&G(a=>({...a,slug:void 0}))},placeholder:"workspace-slug","aria-invalid":!!F.slug,"aria-describedby":F.slug?"workspace-slug-error":void 0}),F.slug&&(0,d.jsx)("p",{id:"workspace-slug-error",className:"text-xs text-destructive",children:F.slug}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground/70",children:["Used in URLs: /w/",x,"/"]})]})]}),(0,d.jsx)(k.Button,{size:"sm",onClick:N,disabled:!M||D,children:D?"Saving…":"Save"})]}),(0,d.jsxs)("section",{className:"space-y-4",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-destructive",children:"Danger Zone"}),(0,d.jsxs)("div",{className:"rounded-md border border-destructive/30 p-4 space-y-3",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Deleting this workspace is permanent and cannot be undone. All agents, conversations, and data will be lost."}),(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)(m.Label,{htmlFor:"delete-confirm",className:"text-xs",children:["Type ",(0,d.jsx)("span",{className:"font-medium text-foreground",children:z})," to confirm"]}),(0,d.jsx)(l.Input,{id:"delete-confirm",value:H,onChange:a=>I(a.target.value),placeholder:z})]}),(0,d.jsx)(k.Button,{size:"sm",variant:"destructive",onClick:O,disabled:H!==z||J,children:J?"Deleting…":"Delete Workspace"})]})]})]})}]),c()}catch(a){c(a)}},!1),53909,a=>{"use strict";var b=a.i(616612),c=a.i(734803),d=a.i(780956),e=a.i(506180),f=a.i(588339),g=a.i(889624),h=a.i(25668),i=a.i(75118);function j({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,i.cn)("transition-all duration-300",a>.9?"text-destructive/70":a>.7?"text-yellow-500/50":"text-muted-foreground/30")})]})}a.s(["InstructionTab",0,function(){let{workspaceId:a}=(0,e.useWorkspace)(),[i,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(!0),p=(0,c.useRef)(i);(0,c.useEffect)(()=>{p.current=i},[i]);let q=(0,c.useRef)(l);(0,c.useEffect)(()=>{q.current=l},[l]);let r=(0,c.useRef)(null),s=(0,c.useRef)(!1),t=(0,c.useCallback)(async()=>{o(!0);try{let b=await (0,f.getMemberMe)(a);k(b.global_instruction),m(b.global_instruction)}catch(a){d.toast.error(a instanceof Error?a.message:"Failed to load settings")}finally{o(!1)}},[a]);(0,c.useEffect)(()=>{t()},[t]);let u=(0,c.useRef)(()=>{}),v=(0,c.useCallback)(async()=>{if(s.current)return;let b=p.current;if(b!==q.current){s.current=!0;try{let c=await (0,f.updateMemberMe)(a,b);m(c.global_instruction)}catch(a){d.toast.error(a instanceof Error?a.message:"Failed to save")}finally{s.current=!1,p.current!==q.current&&u.current()}}},[a]),w=(0,c.useCallback)(()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(v,500)},[v]);(0,c.useEffect)(()=>{u.current=w},[w]);let x=(0,c.useCallback)(a=>{k(a),w()},[w]);(0,c.useEffect)(()=>{let b=()=>{if(r.current&&clearTimeout(r.current),p.current!==q.current){let b=new URLSearchParams({workspace_id:a});fetch(`/api/members/me?${b}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({global_instruction:p.current}),keepalive:!0})}};return window.addEventListener("beforeunload",b),()=>window.removeEventListener("beforeunload",b)},[a]),(0,c.useEffect)(()=>()=>{if(r.current&&clearTimeout(r.current),p.current!==q.current){let b=new URLSearchParams({workspace_id:a});fetch(`/api/members/me?${b}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({global_instruction:p.current}),keepalive:!0})}},[a]);let y=i.length/5e4;return n?(0,b.jsxs)("div",{className:"px-6 py-6 space-y-4",children:[(0,b.jsx)(h.Skeleton,{className:"h-4 w-48"}),(0,b.jsx)(h.Skeleton,{className:"h-40 w-full"})]}):(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsx)("div",{className:"flex-1 px-6 pt-4 pb-4",children:(0,b.jsx)(g.MarkdownEditor,{value:i,onChange:x,placeholder:"Write instructions that every agent you own will follow...",minHeight:"calc(100vh - 240px)",contentType:"markdown",variant:"seamless"})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 px-6 py-3",children:[(0,b.jsx)(j,{ratio:y}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"This instruction is prepended to every agent's individual instruction."})]})]})}])},851688,a=>{"use strict";let b=(0,a.i(410732).default)("user-minus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);a.s(["UserMinus",0,b],851688)},616131,a=>a.a(async(b,c)=>{try{var d=a.i(616612),e=a.i(734803),f=a.i(780956),g=a.i(340490),h=a.i(790107),i=a.i(396439),j=a.i(851688),k=a.i(506180),l=a.i(454607),m=a.i(588339),n=a.i(732254),o=a.i(25668),p=a.i(525132),q=a.i(75118),r=a.i(946621),s=b([l]);function t(a){return`${window.location.origin}/invite/${a}`}[l]=s.then?(await s)():s,a.s(["MembersTab",0,function(){let{workspaceId:a}=(0,k.useWorkspace)(),b=(0,l.useSession)(),c=b.data?.user?.id,[s,u]=(0,e.useState)([]),[v,w]=(0,e.useState)([]),[x,y]=(0,e.useState)(!0),[z,A]=(0,e.useState)(!1),B=s.find(a=>a.user_id===c)?.role==="owner",C=(0,e.useCallback)(async()=>{y(!0);try{let[b,c]=await Promise.all([(0,m.listMembers)(a),(0,m.listInvites)(a).catch(()=>[])]);u(b),w(c)}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to load members")}finally{y(!1)}},[a]);(0,e.useEffect)(()=>{C()},[C]);let D=async()=>{A(!0);try{let b=await (0,m.createInvite)(a);(0,r.trackTeamMemberInvited)({workspace_id:a}),w(a=>[...a,b]);let c=t(b.token);await navigator.clipboard.writeText(c),f.toast.success("Invite link copied to clipboard")}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to generate invite")}finally{A(!1)}},E=async a=>{let b=t(a);try{await navigator.clipboard.writeText(b),f.toast.success("Invite link copied")}catch{f.toast.error("Failed to copy link")}},F=async b=>{try{await (0,m.revokeInvite)(a,b),w(a=>a.filter(a=>a.id!==b)),f.toast.success("Invite revoked")}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to revoke invite")}},G=async b=>{try{await (0,m.removeMember)(a,b),u(a=>a.filter(a=>a.id!==b)),f.toast.success("Member removed")}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to remove member")}};return x?(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)(o.Skeleton,{className:"h-4 w-24"}),(0,d.jsx)(o.Skeleton,{className:"h-10 w-full"}),(0,d.jsx)(o.Skeleton,{className:"h-10 w-full"}),(0,d.jsx)(o.Skeleton,{className:"h-4 w-24 mt-6"}),(0,d.jsx)(o.Skeleton,{className:"h-10 w-full"}),(0,d.jsx)(o.Skeleton,{className:"h-10 w-full"})]}):(0,d.jsxs)("div",{className:"space-y-8",children:[B&&(0,d.jsxs)("section",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("h2",{className:"text-sm font-medium",children:"Pending Invites"}),(0,d.jsxs)(n.Button,{size:"sm",variant:"outline",onClick:D,disabled:z,children:[(0,d.jsx)(i.Plus,{className:"size-3.5 mr-1"}),z?"Generating…":"Generate invite link"]})]}),0===v.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:"No active invite links. Generate one to invite someone to this workspace."}):(0,d.jsx)("div",{className:"space-y-1.5",children:v.map(a=>{let b=new Date(a.expires_at),c=b<new Date;return(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2 text-xs",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:(0,q.cn)("font-mono truncate",c&&"text-muted-foreground line-through"),children:["/invite/",a.token.slice(0,12),"…"]}),(0,d.jsx)("p",{className:(0,q.cn)("text-muted-foreground/70 mt-0.5",c&&"text-destructive/70"),children:c?"Expired":`Expires ${b.toLocaleDateString()}`})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-2 shrink-0",children:[!c&&(0,d.jsxs)(p.Tooltip,{children:[(0,d.jsx)(p.TooltipTrigger,{render:(0,d.jsx)(n.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>E(a.token)}),children:(0,d.jsx)(g.Copy,{className:"size-3.5"})}),(0,d.jsx)(p.TooltipContent,{children:"Copy invite link"})]}),(0,d.jsxs)(p.Tooltip,{children:[(0,d.jsx)(p.TooltipTrigger,{render:(0,d.jsx)(n.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-destructive hover:text-destructive",onClick:()=>F(a.id)}),children:(0,d.jsx)(h.Trash2,{className:"size-3.5"})}),(0,d.jsx)(p.TooltipContent,{children:"Revoke invite"})]})]})]},a.id)})})]}),(0,d.jsxs)("section",{className:"space-y-3",children:[(0,d.jsx)("h2",{className:"text-sm font-medium",children:"Members"}),(0,d.jsx)("div",{className:"space-y-1.5",children:s.map(a=>{let b=a.user_id===c,e=a.name?a.name.split(" ").map(a=>a[0]).join("").slice(0,2).toUpperCase():a.email.slice(0,2).toUpperCase();return(0,d.jsxs)("div",{className:"flex items-center gap-3 rounded-md border border-border/50 px-3 py-2",children:[(0,d.jsx)("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center text-xs font-medium text-muted-foreground shrink-0 overflow-hidden",children:a.image?(0,d.jsx)("img",{src:a.image,alt:a.name,className:"size-full object-cover"}):e}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"text-sm font-medium truncate leading-tight",children:[a.name||a.email,b&&(0,d.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"(you)"})]}),a.name&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.email})]}),(0,d.jsx)("span",{className:(0,q.cn)("text-xs px-1.5 py-0.5 rounded shrink-0","owner"===a.role?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:a.role}),B&&!b&&(0,d.jsxs)(p.Tooltip,{children:[(0,d.jsx)(p.TooltipTrigger,{render:(0,d.jsx)(n.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive shrink-0",onClick:()=>G(a.id)}),children:(0,d.jsx)(j.UserMinus,{className:"size-3.5"})}),(0,d.jsx)(p.TooltipContent,{children:"Remove member"})]})]},a.id)})})]})]})}]),c()}catch(a){c(a)}},!1),93590,a=>{"use strict";var b=a.i(616612),c=a.i(734803),d=a.i(780956),e=a.i(951687),f=a.i(973111),g=a.i(626806);a.s(["NotificationTab",0,function(){let[a,h]=(0,c.useState)(!1),[i,j]=(0,c.useState)([...g.NOTIFICATION_EVENTS]),[k,l]=(0,c.useState)(!0),[m,n]=(0,c.useState)(!1);(0,c.useEffect)(()=>{l((0,g.isNotificationSupported)()),h((0,g.getNotificationEnabled)()),j((0,g.getNotificationEvents)()),(0,g.isNotificationSupported)()&&n("denied"===Notification.permission)},[]);let o=async a=>{if(!a){h(!1),(0,g.setNotificationEnabled)(!1);return}await (0,g.requestNotificationPermission)()?(h(!0),(0,g.setNotificationEnabled)(!0)):(n(!0),d.toast.error("Notification permission denied. Please enable it in browser settings."))};return k?(0,b.jsx)("div",{className:"space-y-6",children:(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)("h2",{className:"text-sm font-medium",children:"Browser Notifications"}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("p",{className:"text-sm",children:"Enable notifications"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Get notified when tasks finish while the tab is in the background"})]}),(0,b.jsx)(f.Switch,{checked:a,onCheckedChange:o,disabled:m&&!a})]}),m&&!a&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:"Notification permission was denied. Please allow it in your browser settings."}),a&&(0,b.jsxs)("div",{className:"space-y-2 pl-0.5",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Notify me when:"}),g.NOTIFICATION_EVENTS.map(a=>(0,b.jsxs)("label",{className:"flex items-center gap-2 text-sm cursor-pointer select-none",children:[(0,b.jsx)(e.Checkbox,{checked:i.includes(a),onCheckedChange:()=>{j(b=>{let c=b.includes(a)?b.filter(b=>b!==a):[...b,a];return(0,g.setNotificationEvents)(c),c})}}),g.NOTIFICATION_EVENT_LABELS[a]]},a))]})]})]})}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your browser does not support notifications."})}])},390946,a=>{"use strict";var b=a.i(616612),c=a.i(734803);let d=(0,a.i(410732).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),e="alook-cloud-code-monster-pet-preset-v1",f="alook-cloud-code-monster-pet-preset-changed",g=new Map([{id:"pet-02",name:"Pocket Bell Bot",group:"Inspired Mascots",feature:"bell",shape:"gadget-buddy"},{id:"pet-03",name:"Spark Bolt Pal",group:"Inspired Mascots",feature:"bolt",shape:"electric-mascot"},{id:"pet-04",name:"Star Puff",group:"Inspired Mascots",feature:"star",shape:"star-puff"},{id:"pet-05",name:"Leaf Bud",group:"Inspired Mascots",feature:"leaf",shape:"leaf-bud-shape"},{id:"pet-06",name:"Tiny Flame",group:"Inspired Mascots",feature:"flame",shape:"ember-scout"},{id:"pet-07",name:"Shell Fin",group:"Inspired Mascots",feature:"fins",shape:"shell-sprout"},{id:"pet-08",name:"Block Builder",group:"Inspired Mascots",feature:"visor",shape:"block-builder-shape"},{id:"pet-09",name:"Block Hiss",group:"Inspired Mascots",feature:"mask",shape:"block-hiss-shape"},{id:"pet-10",name:"Block Walker",group:"Inspired Mascots",feature:"visor",shape:"block-walker-shape"},{id:"pet-11",name:"Mushroom Pal",group:"Inspired Mascots",feature:"mushroom",shape:"mushroom-pal-shape"},{id:"pet-12",name:"Blue Spin",group:"Inspired Mascots",feature:"spin",shape:"blue-spinner"},{id:"pet-13",name:"Arcade Chomp",group:"Inspired Mascots",feature:"chomp",shape:"arcade-chomper"},{id:"pet-14",name:"Peek Ghost",group:"Inspired Mascots",feature:"ghost",shape:"peek-ghost-shape"},{id:"pet-15",name:"Red Cap Jumper",group:"Inspired Mascots",feature:"cap",shape:"cap-jumper"},{id:"pet-16",name:"Honey Cub",group:"Inspired Mascots",feature:"ears",shape:"honey-cub-shape"},{id:"pet-17",name:"Ribbon Cat",group:"Inspired Mascots",feature:"bow",shape:"ribbon-cat-shape"},{id:"pet-18",name:"Cozy Hood Bunny",group:"Inspired Mascots",feature:"hood",shape:"cozy-hood-bunny-shape"},{id:"pet-19",name:"Imp Hood",group:"Inspired Mascots",feature:"mask",shape:"imp-hood-shape"},{id:"pet-20",name:"Forest Neighbor",group:"Inspired Mascots",feature:"ears",shape:"forest-neighbor-shape"},{id:"pet-21",name:"Dust Puff",group:"Inspired Mascots",feature:"soot",shape:"dust-puff-shape"},{id:"pet-22",name:"Straw Voyager",group:"Inspired Mascots",feature:"straw",shape:"straw-voyager-shape"},{id:"pet-23",name:"Leaf Runner",group:"Inspired Mascots",feature:"ninja",shape:"leaf-runner-shape"},{id:"pet-24",name:"Energy Pearl",group:"Inspired Mascots",feature:"pearl",shape:"energy-pearl-shape"},{id:"pet-25",name:"Moon Wand",group:"Inspired Mascots",feature:"wand",shape:"moon-wand-shape"},{id:"pet-26",name:"Mecha Guard",group:"Inspired Mascots",feature:"mecha",shape:"mecha-guard-shape"},{id:"pet-27",name:"Teardrop Slime",group:"Inspired Mascots",feature:"slime",shape:"teardrop-slime-shape"},{id:"pet-28",name:"Ink Runner",group:"Inspired Mascots",feature:"ink",shape:"ink-runner-shape"},{id:"pet-29",name:"Little Beagle",group:"Inspired Mascots",feature:"ears",shape:"little-beagle-shape"},{id:"pet-30",name:"Tiny Antler",group:"Inspired Mascots",feature:"horns",shape:"tiny-antler-shape"}].map(a=>[a.id,a])),h=[{id:"pet-01",name:"Claude Pixel",group:"Codex",feature:"square",bodyTop:"#e0845f",body:"#d87352",bodyDark:"#cf684a",bodyLight:"#e88d68",bodySideLight:"#df7d5a",bodySideDark:"#c86347",accent:"#d7654a",accessory:"#f1bc62",eye:"#12100f",highlight:"#f6e7d7"},{id:"pet-02",name:"Blue Pocket Bot",group:"Gadget Buddy",feature:"bell",bodyTop:"#4aa8d8",body:"#2f8fc4",bodyDark:"#2674a4",bodyLight:"#68bce5",bodySideLight:"#48a8d5",bodySideDark:"#1f6591",accent:"#d84e4a",accessory:"#f4c94f",eye:"#10141a",highlight:"#f7fbff",facePatch:"#f6fbff",cheek:"#d84e4a"},{id:"pet-03",name:"Spark Arcade Pal",group:"Electric Mascot",feature:"bolt",bodyTop:"#f2d45a",body:"#e6bd37",bodyDark:"#c89a2a",bodyLight:"#ffe37a",bodySideLight:"#f0cc4c",bodySideDark:"#b58724",accent:"#2f2520",accessory:"#df5145",eye:"#17120e",highlight:"#fff7c7",cheek:"#e94d43"},{id:"pet-04",name:"Pink Star Puff",group:"Star Puff",feature:"star",bodyTop:"#eba0b7",body:"#df7fa0",bodyDark:"#c76589",bodyLight:"#f2b6c8",bodySideLight:"#e993ac",bodySideDark:"#b95778",accent:"#c84d64",accessory:"#f0d862",eye:"#171016",highlight:"#fff0f6",cheek:"#e75c7a"},{id:"pet-05",name:"Leaf Sprite",group:"Forest Starter",feature:"leaf",bodyTop:"#76aa7b",body:"#5f9666",bodyDark:"#4d7c54",bodyLight:"#91bd8f",bodySideLight:"#72a875",bodySideDark:"#426d49",accent:"#2f6f46",accessory:"#d6e78a",eye:"#11160f",highlight:"#f0f8e4",facePatch:"#dceec2"},{id:"pet-06",name:"Ember Starter",group:"Fire Buddy",feature:"flame",bodyTop:"#df8755",body:"#ce6b3f",bodyDark:"#af5333",bodyLight:"#ee9d6b",bodySideLight:"#dd7b4c",bodySideDark:"#9a482c",accent:"#8d3d2f",accessory:"#f3c34b",eye:"#17100c",highlight:"#ffe8d4",cheek:"#e45842"},{id:"pet-07",name:"Ripple Buddy",group:"Water Buddy",feature:"fins",bodyTop:"#82b5d6",body:"#629dcc",bodyDark:"#4f82ad",bodyLight:"#9bc8e5",bodySideLight:"#73add6",bodySideDark:"#44749b",accent:"#5f6f8d",accessory:"#ead59a",eye:"#10151b",highlight:"#eff8ff",facePatch:"#d9eef8"},{id:"pet-08",name:"Moon Alley Cat",group:"Moon Cat",feature:"moon",bodyTop:"#4f4b69",body:"#3f3a59",bodyDark:"#332f49",bodyLight:"#67607e",bodySideLight:"#554f6d",bodySideDark:"#2b283e",accent:"#e5c85c",accessory:"#d66f91",eye:"#f5e8a7",highlight:"#fff6c8",cheek:"#cf6d8f"},{id:"pet-09",name:"Spore Runner",group:"Mushroom Runner",feature:"mushroom",bodyTop:"#e0524f",body:"#f0dcc6",bodyDark:"#d7c0aa",bodyLight:"#f7ead9",bodySideLight:"#f1dfcb",bodySideDark:"#c7aa95",accent:"#b83736",accessory:"#ffffff",eye:"#17120f",highlight:"#fff8ea"},{id:"pet-10",name:"Dash Quill",group:"Speed Mascot",feature:"spin",bodyTop:"#4e83d0",body:"#356dbd",bodyDark:"#2a579b",bodyLight:"#6896de",bodySideLight:"#477dd0",bodySideDark:"#244c88",accent:"#f2c45b",accessory:"#f2ece1",eye:"#10131a",highlight:"#eef4ff",facePatch:"#ead3b9"},{id:"pet-11",name:"Lemon Chomper",group:"Arcade Chomper",feature:"chomp",bodyTop:"#f0ce45",body:"#e5ba2f",bodyDark:"#c89924",bodyLight:"#ffe26c",bodySideLight:"#efc73f",bodySideDark:"#b18520",accent:"#1f1b18",accessory:"#f2845f",eye:"#15110d",highlight:"#fff2b6"},{id:"pet-12",name:"Lantern Ghost",group:"Round Ghost",feature:"ghost",bodyTop:"#d9dff0",body:"#c4cee6",bodyDark:"#aab6d2",bodyLight:"#edf2ff",bodySideLight:"#d3dced",bodySideDark:"#9aa8c6",accent:"#6d7da8",accessory:"#e77c9c",eye:"#151926",highlight:"#ffffff"},{id:"pet-13",name:"Red Cap Jumper",group:"Platform Pal",feature:"cap",bodyTop:"#d84f45",body:"#c5a17d",bodyDark:"#a98263",bodyLight:"#e0ba94",bodySideLight:"#d3ad86",bodySideDark:"#936f54",accent:"#2c4f99",accessory:"#f6e9d1",eye:"#16110d",highlight:"#fff2df"},{id:"pet-14",name:"Honey Cub",group:"Classic Toy",feature:"ears",bodyTop:"#e4b25a",body:"#d0993e",bodyDark:"#ad7d30",bodyLight:"#efc46d",bodySideLight:"#dba84d",bodySideDark:"#996d2a",accent:"#b54d3f",accessory:"#f4d991",eye:"#17110d",highlight:"#fff0c8",facePatch:"#f2d083"},{id:"pet-15",name:"Ribbon Puff",group:"Bow Buddy",feature:"bow",bodyTop:"#f2f0e8",body:"#e3ded4",bodyDark:"#c9c2b7",bodyLight:"#ffffff",bodySideLight:"#eee9df",bodySideDark:"#bab2a7",accent:"#d84b5b",accessory:"#f3cc56",eye:"#15110f",highlight:"#ffffff",cheek:"#df6d80"},{id:"pet-16",name:"Cozy Hood Cub",group:"Hooded Mascot",feature:"hood",bodyTop:"#ef9eba",body:"#e681a4",bodyDark:"#c96789",bodyLight:"#f5b6ca",bodySideLight:"#ee94b2",bodySideDark:"#b85878",accent:"#f0d6de",accessory:"#f3d66b",eye:"#171017",highlight:"#fff0f6",facePatch:"#fff6f2"},{id:"pet-17",name:"Masked Beetle",group:"Bug Hero",feature:"mask",bodyTop:"#6e617d",body:"#554761",bodyDark:"#41374b",bodyLight:"#837491",bodySideLight:"#655570",bodySideDark:"#382f41",accent:"#cf6f8e",accessory:"#f0d46a",eye:"#f7edf4",highlight:"#fff7ff",facePatch:"#ece0ea"},{id:"pet-18",name:"Round Forest Pal",group:"Forest Neighbor",feature:"ears",bodyTop:"#8c8d7d",body:"#74766a",bodyDark:"#606257",bodyLight:"#a0a293",bodySideLight:"#838578",bodySideDark:"#55574d",accent:"#d9d3b8",accessory:"#c6d68c",eye:"#121411",highlight:"#efead8",facePatch:"#dad4ba"},{id:"pet-19",name:"Dust Puff",group:"Tiny Soot",feature:"soot",bodyTop:"#34343a",body:"#25262c",bodyDark:"#1d1e24",bodyLight:"#4a4b52",bodySideLight:"#383941",bodySideDark:"#171820",accent:"#6c6f7a",accessory:"#f0f0d8",eye:"#f7f7e8",highlight:"#ffffff"},{id:"pet-20",name:"Straw Field Pal",group:"Harvest Buddy",feature:"straw",bodyTop:"#d96a50",body:"#c65342",bodyDark:"#a74336",bodyLight:"#e47d64",bodySideLight:"#d0614d",bodySideDark:"#933a30",accent:"#2f5f93",accessory:"#e8c866",eye:"#15100d",highlight:"#ffe6d9"},{id:"pet-21",name:"Shadow Ninja Bean",group:"Ninja Mascot",feature:"ninja",bodyTop:"#e7a04d",body:"#d88432",bodyDark:"#b96c27",bodyLight:"#efb464",bodySideLight:"#df943e",bodySideDark:"#a25d22",accent:"#2d415c",accessory:"#ded5c6",eye:"#15100c",highlight:"#ffe7c8",facePatch:"#f3c78d"},{id:"pet-22",name:"Pearl Quest Cub",group:"Pearl Hero",feature:"pearl",bodyTop:"#e3a54e",body:"#ce8438",bodyDark:"#ac682e",bodyLight:"#efbc68",bodySideLight:"#db9345",bodySideDark:"#985a28",accent:"#476ca6",accessory:"#f0d464",eye:"#15100c",highlight:"#ffe8c4"},{id:"pet-23",name:"Wand Starling",group:"Magic Mascot",feature:"wand",bodyTop:"#f0a6c4",body:"#df87ad",bodyDark:"#c26b92",bodyLight:"#f5bad2",bodySideLight:"#e99ab9",bodySideDark:"#ad5d82",accent:"#d8b34a",accessory:"#e9d7ff",eye:"#171017",highlight:"#fff0f7",cheek:"#e76791"},{id:"pet-24",name:"Mecha Bean",group:"Tiny Mecha",feature:"mecha",bodyTop:"#d7dbe2",body:"#bdc3ce",bodyDark:"#9ea6b3",bodyLight:"#edf0f5",bodySideLight:"#cbd1da",bodySideDark:"#8d96a5",accent:"#d44d4a",accessory:"#f0c748",eye:"#151923",highlight:"#ffffff"},{id:"pet-25",name:"Bubble Slimelet",group:"Slime Buddy",feature:"slime",bodyTop:"#79b8e8",body:"#5aa0d8",bodyDark:"#4384ba",bodyLight:"#96cdf0",bodySideLight:"#70b3e3",bodySideDark:"#3975a6",accent:"#2a658f",accessory:"#f3f7ff",eye:"#101722",highlight:"#f5fbff"},{id:"pet-26",name:"Ink Courier",group:"Ink Runner",feature:"ink",bodyTop:"#75c8bb",body:"#54afa2",bodyDark:"#3f9188",bodyLight:"#90d9ce",bodySideLight:"#67c1b5",bodySideDark:"#377f77",accent:"#d7668f",accessory:"#e4f2ef",eye:"#101716",highlight:"#effffb"},{id:"pet-27",name:"Drum Marcher",group:"Rhythm Pal",feature:"drum",bodyTop:"#ef7f5f",body:"#df6349",bodyDark:"#bd4d3b",bodyLight:"#f39a7b",bodySideLight:"#e77358",bodySideDark:"#a84434",accent:"#4f78b6",accessory:"#f3e4c6",eye:"#15100d",highlight:"#fff0e4"},{id:"pet-28",name:"Sprout Forestling",group:"Sprout Buddy",feature:"sprout",bodyTop:"#a58f5d",body:"#8f7548",bodyDark:"#755f3a",bodyLight:"#b9a26e",bodySideLight:"#9b8354",bodySideDark:"#655233",accent:"#5d8b56",accessory:"#dfc86e",eye:"#15110c",highlight:"#f8ecc0",facePatch:"#d8be71"},{id:"pet-29",name:"Frost Star Pup",group:"Ice Pal",feature:"star",bodyTop:"#8aa7d8",body:"#6e91c8",bodyDark:"#5877aa",bodyLight:"#a1bce5",bodySideLight:"#7f9fd3",bodySideDark:"#4e6898",accent:"#f0cf5b",accessory:"#f3edf5",eye:"#10151c",highlight:"#eff5ff",cheek:"#d66d86"},{id:"pet-30",name:"Tiny Quest Cub",group:"Quest Mascot",feature:"bow",bodyTop:"#efa2c8",body:"#df84b2",bodyDark:"#c46999",bodyLight:"#f5b9d5",bodySideLight:"#eb96c2",bodySideDark:"#ad5a86",accent:"#cf4d78",accessory:"#f0d66a",eye:"#171016",highlight:"#fff0f8",cheek:"#df688f"}].map(a=>({...a,...g.get(a.id)}));function i(a){return h.find(b=>b.id===a)??h[0]}function j(){if("u"<typeof localStorage)return h[0].id;try{return i(localStorage.getItem(e)).id}catch{return h[0].id}}var k=a.i(535510);let l=(0,c.lazy)(()=>a.A(76574).then(a=>({default:a.MonsterDirectPixelCharacter})));function m({activityId:a,preset:c,reacting:d,shaken:e,fainted:f=!1,eyeOffset:g={x:0,y:0}}){let h=(0,k.getCloudCodeMonsterExpression)(a,d,e,f);return"fainted"===h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"43",y:"39",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"49",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"43",y:"51",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"49",y:"39",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"43",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"76",y:"39",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"82",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"76",y:"51",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"82",y:"39",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"76",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"58",y:"64",width:"14",height:"4",fill:c.eye})]}):"shaken"===h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"45",y:"40",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"50",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"45",y:"50",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"82",y:"40",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"77",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"82",y:"50",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"62",y:"61",width:"6",height:"4",fill:c.eye})]}):"shocked"===h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("g",{className:"cloud-code-monster-pet-eyes-track",transform:`translate(${g.x} ${g.y})`,children:[(0,b.jsx)("rect",{className:"cloud-code-monster-pet-eye-blink",x:"44",y:"39",width:"12",height:"13",fill:c.eye}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-eye-blink",x:"76",y:"39",width:"12",height:"13",fill:c.eye}),(0,b.jsxs)("g",{transform:`translate(${.45*g.x} ${.45*g.y})`,children:[(0,b.jsx)("rect",{x:"47",y:"42",width:"4",height:"4",fill:c.highlight}),(0,b.jsx)("rect",{x:"79",y:"42",width:"4",height:"4",fill:c.highlight})]})]}),(0,b.jsx)("rect",{x:"60",y:"60",width:"10",height:"12",fill:c.eye}),(0,b.jsx)("rect",{x:"62",y:"62",width:"6",height:"3",fill:"#332520"})]}):"sleeping"===h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"45",y:"46",width:"11",height:"4",fill:c.eye}),(0,b.jsx)("rect",{x:"76",y:"46",width:"11",height:"4",fill:c.eye})]}):(0,b.jsxs)("g",{className:"cloud-code-monster-pet-eyes-track",transform:`translate(${g.x} ${g.y})`,children:[(0,b.jsx)("rect",{className:"cloud-code-monster-pet-eye-blink",x:"44",y:"42",width:"11",height:"12",fill:c.eye}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-eye-blink",x:"77",y:"42",width:"11",height:"12",fill:c.eye}),(0,b.jsxs)("g",{transform:`translate(${.55*g.x} ${.55*g.y})`,children:[(0,b.jsx)("rect",{x:"46",y:"44",width:"4",height:"4",fill:"#2c2521"}),(0,b.jsx)("rect",{x:"79",y:"44",width:"4",height:"4",fill:"#2c2521"})]})]})}function n({preset:a}){let{feature:c}=a;return"horns"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"29",y:"20",width:"10",height:"8",fill:a.accent}),(0,b.jsx)("rect",{x:"91",y:"20",width:"10",height:"8",fill:a.accent}),(0,b.jsx)("rect",{x:"34",y:"16",width:"7",height:"7",fill:a.accessory}),(0,b.jsx)("rect",{x:"88",y:"16",width:"7",height:"7",fill:a.accessory})]}):"ears"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"18",y:"38",width:"10",height:"18",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"100",y:"38",width:"10",height:"18",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"21",y:"42",width:"5",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"102",y:"42",width:"5",height:"8",fill:a.bodyLight})]}):"visor"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"41",y:"36",width:"47",height:"5",fill:a.accent}),(0,b.jsx)("rect",{x:"45",y:"38",width:"39",height:"3",fill:a.highlight})]}):"antenna"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"62",y:"15",width:"5",height:"13",fill:a.accent}),(0,b.jsx)("rect",{x:"58",y:"10",width:"13",height:"6",fill:a.accessory})]}):"crown"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"43",y:"18",width:"8",height:"10",fill:a.accessory}),(0,b.jsx)("rect",{x:"60",y:"14",width:"8",height:"14",fill:a.accessory}),(0,b.jsx)("rect",{x:"77",y:"18",width:"8",height:"10",fill:a.accessory}),(0,b.jsx)("rect",{x:"42",y:"26",width:"44",height:"5",fill:a.accent})]}):"bell"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"22",y:"42",width:"8",height:"14",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"98",y:"42",width:"8",height:"14",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"59",y:"21",width:"11",height:"7",fill:a.accent})]}):"bolt"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"29",y:"20",width:"8",height:"17",fill:a.accent}),(0,b.jsx)("rect",{x:"91",y:"20",width:"8",height:"17",fill:a.accent}),(0,b.jsx)("rect",{x:"33",y:"32",width:"8",height:"9",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"87",y:"32",width:"8",height:"9",fill:a.bodyTop})]}):"star"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"60",y:"13",width:"8",height:"24",fill:a.accessory}),(0,b.jsx)("rect",{x:"52",y:"21",width:"24",height:"8",fill:a.accessory}),(0,b.jsx)("rect",{x:"56",y:"17",width:"16",height:"16",fill:a.accessory})]}):"leaf"===c||"sprout"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"61",y:"15",width:"6",height:"18",fill:a.accent}),(0,b.jsx)("rect",{x:"49",y:"18",width:"16",height:"10",fill:a.accent}),(0,b.jsx)("rect",{x:"66",y:"18",width:"16",height:"10",fill:a.bodyLight})]}):"flame"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"58",y:"9",width:"12",height:"20",fill:a.accessory}),(0,b.jsx)("rect",{x:"52",y:"18",width:"9",height:"14",fill:a.accent}),(0,b.jsx)("rect",{x:"69",y:"17",width:"8",height:"15",fill:a.bodyLight})]}):"fins"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"18",y:"45",width:"10",height:"18",fill:a.accent}),(0,b.jsx)("rect",{x:"100",y:"45",width:"10",height:"18",fill:a.accent}),(0,b.jsx)("rect",{x:"55",y:"18",width:"18",height:"10",fill:a.accessory})]}):"moon"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"57",y:"14",width:"18",height:"18",fill:a.accessory}),(0,b.jsx)("rect",{x:"64",y:"12",width:"15",height:"19",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"24",y:"37",width:"7",height:"18",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"97",y:"37",width:"7",height:"18",fill:a.bodyDark})]}):"mushroom"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"31",y:"18",width:"66",height:"22",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"42",y:"13",width:"44",height:"11",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"45",y:"22",width:"9",height:"8",fill:a.accessory}),(0,b.jsx)("rect",{x:"73",y:"20",width:"10",height:"8",fill:a.accessory})]}):"spin"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"47",y:"17",width:"34",height:"9",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"37",y:"24",width:"14",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"78",y:"24",width:"13",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"29",y:"31",width:"11",height:"7",fill:a.bodyLight})]}):"chomp"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"88",y:"48",width:"14",height:"8",fill:a.highlight}),(0,b.jsx)("rect",{x:"88",y:"60",width:"14",height:"8",fill:a.highlight})]}):"ghost"===c||"slime"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"44",y:"19",width:"40",height:"12",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"36",y:"27",width:"56",height:"10",fill:a.bodyLight})]}):"cap"===c||"straw"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"34",y:"18",width:"58",height:"12",fill:"straw"===c?a.accessory:a.bodyTop}),(0,b.jsx)("rect",{x:"45",y:"12",width:"36",height:"10",fill:"straw"===c?a.accessory:a.bodyTop}),(0,b.jsx)("rect",{x:"58",y:"22",width:"14",height:"5",fill:"straw"===c?a.accent:a.accessory})]}):"bow"===c||"hood"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"76",y:"17",width:"13",height:"13",fill:a.accent}),(0,b.jsx)("rect",{x:"91",y:"17",width:"13",height:"13",fill:a.accent}),(0,b.jsx)("rect",{x:"88",y:"21",width:"7",height:"7",fill:a.accessory})]}):"mask"===c||"ninja"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"35",y:"25",width:"58",height:"8",fill:a.accent}),(0,b.jsx)("rect",{x:"48",y:"18",width:"12",height:"10",fill:a.accent}),(0,b.jsx)("rect",{x:"69",y:"18",width:"12",height:"10",fill:a.accent})]}):"soot"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"27",y:"25",width:"8",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"92",y:"23",width:"9",height:"9",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"61",y:"12",width:"7",height:"7",fill:a.bodyLight})]}):"pearl"===c||"wand"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"58",y:"12",width:"13",height:"13",fill:a.accessory}),(0,b.jsx)("rect",{x:"61",y:"7",width:"7",height:"7",fill:a.accent}),(0,b.jsx)("rect",{x:"73",y:"17",width:"9",height:"9",fill:a.accent})]}):"mecha"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"29",y:"24",width:"12",height:"13",fill:a.accent}),(0,b.jsx)("rect",{x:"87",y:"24",width:"12",height:"13",fill:a.accent}),(0,b.jsx)("rect",{x:"51",y:"18",width:"27",height:"9",fill:a.accessory})]}):"ink"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"35",y:"19",width:"12",height:"16",fill:a.accent}),(0,b.jsx)("rect",{x:"56",y:"14",width:"14",height:"20",fill:a.accent}),(0,b.jsx)("rect",{x:"80",y:"19",width:"12",height:"16",fill:a.accent})]}):"drum"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"31",y:"27",width:"66",height:"7",fill:a.accent}),(0,b.jsx)("rect",{x:"41",y:"18",width:"46",height:"10",fill:a.accessory})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"38",y:"30",width:"10",height:"4",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"80",y:"30",width:"10",height:"4",fill:a.bodyDark})]})}function o({preset:a}){let c=a.feature;return(0,b.jsxs)(b.Fragment,{children:[a.facePatch?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"40",y:"39",width:"48",height:"34",fill:a.facePatch}),(0,b.jsx)("rect",{x:"46",y:"73",width:"36",height:"10",fill:a.facePatch})]}):null,"bell"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"50",y:"74",width:"28",height:"6",fill:a.accent}),(0,b.jsx)("rect",{x:"58",y:"80",width:"13",height:"11",fill:a.accessory}),(0,b.jsx)("rect",{x:"61",y:"84",width:"7",height:"3",fill:a.eye})]}):null,"bolt"===c?(0,b.jsx)("rect",{x:"89",y:"76",width:"13",height:"8",fill:a.accent}):null,"chomp"===c?(0,b.jsx)("rect",{x:"72",y:"56",width:"22",height:"16",fill:a.highlight}):null,"ghost"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"28",y:"91",width:"12",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"52",y:"91",width:"12",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"76",y:"91",width:"12",height:"8",fill:a.bodyLight})]}):null,"drum"===c?(0,b.jsx)("rect",{x:"31",y:"55",width:"66",height:"8",fill:a.accessory}):null,"mecha"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"41",y:"35",width:"45",height:"6",fill:a.accent}),(0,b.jsx)("rect",{x:"57",y:"58",width:"14",height:"9",fill:a.accessory})]}):null,a.cheek?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"36",y:"58",width:"8",height:"7",fill:a.cheek}),(0,b.jsx)("rect",{x:"86",y:"58",width:"8",height:"7",fill:a.cheek})]}):null]})}function p({preset:a,activityId:d,animated:e=!1,reacting:f=!1,shaken:g=!1,fainted:h=!1,eyeOffset:i}){return"monster"!==(a.shape??"monster")?(0,b.jsx)("g",{className:e?"cloud-code-monster-pet-character":void 0,children:(0,b.jsx)(c.Suspense,{fallback:null,children:(0,b.jsx)(l,{activityId:d,preset:a,reacting:f,shaken:g,fainted:h,eyeOffset:i})})}):(0,b.jsxs)("g",{className:e?"cloud-code-monster-pet-character":void 0,children:[(0,b.jsx)(n,{preset:a}),(0,b.jsx)("rect",{x:"32",y:"22",width:"64",height:"12",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"24",y:"34",width:"80",height:"17",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"16",y:"51",width:"12",height:"24",fill:a.body}),(0,b.jsx)("rect",{x:"24",y:"51",width:"80",height:"41",fill:a.body}),(0,b.jsx)("rect",{x:"100",y:"51",width:"12",height:"24",fill:a.body}),(0,b.jsx)("rect",{x:"16",y:"63",width:"12",height:"12",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"30",y:"86",width:"68",height:"10",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"34",y:"34",width:"60",height:"6",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"24",y:"51",width:"9",height:"35",fill:a.bodySideLight}),(0,b.jsx)("rect",{x:"95",y:"51",width:"9",height:"35",fill:a.bodySideDark}),(0,b.jsx)(o,{preset:a}),(0,b.jsx)(m,{activityId:d,preset:a,reacting:f,shaken:g,fainted:h,eyeOffset:i}),(0,b.jsx)("rect",{x:"36",y:"69",width:"8",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"84",y:"69",width:"8",height:"8",fill:a.bodySideDark}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-left-foot",x:"29",y:"96",width:"12",height:"22",fill:a.body}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-left-foot",x:"52",y:"96",width:"12",height:"22",fill:a.body}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-right-foot",x:"76",y:"96",width:"12",height:"22",fill:a.bodyDark}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-right-foot",x:"96",y:"96",width:"12",height:"22",fill:a.bodyDark})]})}function q({preset:a,className:c}){return(0,b.jsxs)("svg",{className:c,viewBox:"0 0 128 128",role:"img","aria-label":`${a.name} pixel PET preset`,shapeRendering:"crispEdges",children:[(0,b.jsx)("rect",{x:"31",y:"116",width:"66",height:"5",fill:"rgba(45,40,36,.12)"}),(0,b.jsx)("rect",{x:"40",y:"121",width:"48",height:"3",fill:"rgba(45,40,36,.07)"}),(0,b.jsx)(p,{preset:a,activityId:null})]})}var r=a.i(76592),s=a.i(973111),t=a.i(272818),u=a.i(75118);a.s(["PetTab",0,function(){let[a,g]=(0,c.useState)(!1),[k,l]=(0,c.useState)(h[0].id),m=i(k);return(0,c.useEffect)(()=>{g((0,t.readHomePetSettings)().enabled),l(j());let a=a=>{let b=a.detail?.presetId;l(b?i(b).id:j())};return window.addEventListener(f,a),()=>{window.removeEventListener(f,a)}},[]),(0,b.jsxs)("div",{className:"space-y-8",children:[(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)("h2",{className:"text-sm font-medium",children:"Pet"}),(0,b.jsx)("div",{className:"space-y-4",children:(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(r.Label,{htmlFor:"pet-enabled",className:"text-sm",children:"Enable pet"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Off by default. Turn it on when you want the workspace companion."})]}),(0,b.jsx)(s.Switch,{id:"pet-enabled",checked:a,onCheckedChange:a=>{g(a),(0,t.writeHomePetSettings)({enabled:a})}})]})})]}),a?(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-sm font-medium",children:"Preset"}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:m.name})]}),(0,b.jsx)("div",{className:"grid size-14 place-items-center rounded-md bg-card ring-1 ring-border/60",children:(0,b.jsx)(q,{preset:m,className:"size-11"})})]}),(0,b.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:h.map(a=>{let c=a.id===m.id;return(0,b.jsxs)("button",{type:"button","aria-pressed":c,onClick:()=>{l(function(a){let b=i(a);if("u">typeof localStorage)try{localStorage.setItem(e,b.id)}catch{}return b.id}(a.id))},className:(0,u.cn)("group grid h-28 min-w-0 grid-rows-[1fr_auto] rounded-md border bg-card/60 p-2 text-left transition-all hover:border-foreground/20 hover:bg-accent/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70",c?"border-primary/50 bg-accent text-foreground":"border-border/50 text-muted-foreground"),children:[(0,b.jsx)("div",{className:"grid place-items-center rounded bg-background/70 ring-1 ring-border/35",children:(0,b.jsx)(q,{preset:a,className:"size-14 transition-transform duration-200 group-hover:scale-105"})}),(0,b.jsxs)("div",{className:"mt-1.5 flex min-w-0 items-center justify-between gap-1 text-[10px] leading-none",children:[(0,b.jsx)("span",{className:"truncate font-medium text-foreground",children:a.name}),c?(0,b.jsx)(d,{className:"size-3 shrink-0 text-primary"}):(0,b.jsx)("span",{className:"shrink-0 text-muted-foreground",children:a.id.replace("pet-","#")})]})]},a.id)})})]}):null]})}],390946)},617168,a=>{"use strict";var b=a.i(616612),c=a.i(734803),d=a.i(752792),e=a.i(506180),f=a.i(25668),g=a.i(588339),h=a.i(439882),i=a.i(464830),j=a.i(410732);let k=(0,j.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var l=a.i(551798),m=a.i(554705);let n=(0,j.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var o=a.i(515837);let p=(0,j.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function q({icon:a,label:c,value:d,sub:e}){return(0,b.jsx)(h.Card,{size:"sm",children:(0,b.jsxs)(h.CardContent,{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,b.jsx)(a,{className:"size-4"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,b.jsx)("p",{className:"text-2xl font-semibold leading-none tracking-tight",children:d}),e&&(0,b.jsx)(i.Badge,{variant:"secondary",className:"text-[10px] px-1.5 h-4 font-normal",children:e})]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground truncate",children:c})]})]})})}function r({agents:a,runtimes:c,activeTaskCounts:d,overview:e}){let f=new Map;for(let a of c){let b=a.daemon_id??a.id;f.set(b,f.get(b)||"online"===a.status)}let g=f.size,h=[...f.values()].filter(Boolean).length,i=Object.values(d).reduce((a,b)=>a+b,0),j=a.filter(a=>{let b=c.find(b=>b.id===a.runtime_id);return b?.status==="online"}).length;return(0,b.jsxs)("div",{className:"grid gap-3 grid-cols-2 sm:grid-cols-3 lg:grid-cols-6",children:[(0,b.jsx)(q,{icon:o.Monitor,label:"Machines",value:`${h}/${g}`,sub:"online"}),(0,b.jsx)(q,{icon:k,label:"Agents",value:a.length,sub:`${j} online`}),(0,b.jsx)(q,{icon:n,label:"Members",value:e.members.length,sub:e.pending_invites>0?`${e.pending_invites} pending`:void 0}),(0,b.jsx)(q,{icon:p,label:"Active Tasks",value:i,sub:e.task_stats.queued>0?`${e.task_stats.queued} queued`:void 0}),(0,b.jsx)(q,{icon:m.Send,label:"Emails Sent",value:e.email_stats.outbound,sub:`${e.email_stats.unread} unread`}),(0,b.jsx)(q,{icon:l.Mail,label:"Custom Emails",value:e.email_accounts.length})]})}function s({overview:a}){let{completed:c,failed:d,cancelled:e,queued:f,stale:g}=a.task_stats,i=c+d,j=i>0?(d/i*100).toFixed(1):"0";return(0,b.jsxs)(h.Card,{children:[(0,b.jsx)(h.CardHeader,{children:(0,b.jsx)(h.CardTitle,{children:"Task Health (Today)"})}),(0,b.jsx)(h.CardContent,{children:(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsx)(t,{label:"Completed",value:c}),(0,b.jsx)(t,{label:"Failed",value:d,className:d>0?"text-destructive":void 0}),(0,b.jsx)(t,{label:"Cancelled",value:e}),(0,b.jsx)(t,{label:"Failure Rate",value:`${j}%`,className:Number(j)>10?"text-destructive":void 0}),(0,b.jsx)(t,{label:"Queue Backlog",value:f,className:f>10?"text-amber-500":void 0}),(0,b.jsx)(t,{label:"Stale Tasks",value:g,className:g>0?"text-destructive":void 0})]})})]})}function t({label:a,value:c,className:d}){return(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:`text-xl font-semibold ${d??""}`,children:c}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a})]})}var u=a.i(525132);function v({overview:a,agents:c}){let{inbound:d,outbound:e,unread:f,rejected:g}=a.email_stats,i=new Map(c.map(a=>[a.id,a.name]));return(0,b.jsxs)(h.Card,{children:[(0,b.jsx)(h.CardHeader,{children:(0,b.jsx)(h.CardTitle,{children:"Email Summary"})}),(0,b.jsxs)(h.CardContent,{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-xl font-semibold",children:d}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Received"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-xl font-semibold",children:e}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Sent"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:`text-xl font-semibold ${f>0?"text-primary":""}`,children:f}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Unread"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:`text-xl font-semibold ${g>0?"text-amber-500":""}`,children:g}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Untrust"})]})]}),a.email_accounts.length>0&&(0,b.jsxs)("div",{className:"space-y-2 pt-2 border-t border-border/50",children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Custom Mailboxes"}),a.email_accounts.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)("span",{className:`size-1.5 shrink-0 rounded-full ${"active"===a.status?"bg-emerald-500":"bg-destructive"}`})}),(0,b.jsx)(u.TooltipContent,{side:"top",children:"active"===a.status?"Active":`Error: ${a.error_message||"inactive"}`})]}),(0,b.jsx)("span",{className:"truncate",children:a.email_address})]}),(0,b.jsx)("span",{className:"text-muted-foreground shrink-0",children:i.get(a.agent_id)??"—"})]},a.id))]})]})]})}var w=a.i(630991),x=a.i(919690);function y({runtimes:a,agents:c}){let d=(0,w.useRouter)(),{slug:f}=(0,e.useWorkspace)(),g=new Map;for(let b of a){let a=b.daemon_id??b.id;g.has(a)||g.set(a,{runtimes:[],deviceInfo:b.device_info??""}),g.get(a).runtimes.push(b)}let j=[...g.entries()];return 0===j.length?(0,b.jsxs)(h.Card,{children:[(0,b.jsxs)(h.CardHeader,{children:[(0,b.jsx)(h.CardTitle,{children:"Machines"}),(0,b.jsx)(h.CardAction,{children:(0,b.jsx)("button",{type:"button",onClick:()=>d.push(`/w/${f}/runtimes`),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:(0,b.jsx)(x.ArrowUpRight,{className:"size-4"})})})]}),(0,b.jsx)(h.CardContent,{children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"No machines connected."})})]}):(0,b.jsxs)(h.Card,{children:[(0,b.jsx)(h.CardHeader,{children:(0,b.jsx)(h.CardTitle,{children:"Machines"})}),(0,b.jsx)(h.CardContent,{className:"space-y-3",children:j.map(([a,d])=>{let e=d.runtimes.some(a=>"online"===a.status),f=d.runtimes.map(a=>a.last_seen_at).filter(Boolean).sort().reverse()[0],g=c.filter(a=>d.runtimes.some(b=>b.id===a.runtime_id)),h=d.runtimes.some(a=>a.pending_update_version),j=d.runtimes.find(a=>a.pending_update_version)?.pending_update_version;return(0,b.jsxs)("div",{className:"flex items-start gap-3 text-xs",children:[(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)("span",{className:`mt-1 size-2 shrink-0 rounded-full ${e?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,b.jsx)(u.TooltipContent,{side:"top",children:e?"Online":"Offline"})]}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"font-medium truncate",children:d.deviceInfo||a.slice(0,12)}),h&&(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)("span",{children:(0,b.jsx)(i.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0 text-amber-500 border-amber-500/30",children:"update"})})}),(0,b.jsxs)(u.TooltipContent,{side:"top",children:["Pending update to v",j]})]})]}),(0,b.jsxs)("div",{className:"text-muted-foreground mt-0.5",children:[g.length>0?g.map(a=>a.name).join(", "):"No agents"," · ",function(a){if(!a)return"never";let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return`${b}s ago`;let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}(f??null)]})]})]},a)})})]})}function z({overview:a}){let c=(0,w.useRouter)(),{slug:d}=(0,e.useWorkspace)(),{members:f,pending_invites:g}=a;return(0,b.jsxs)(h.Card,{children:[(0,b.jsxs)(h.CardHeader,{children:[(0,b.jsx)(h.CardAction,{children:(0,b.jsx)("button",{type:"button",onClick:()=>c.push(`/w/${d}/settings`),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:(0,b.jsx)(x.ArrowUpRight,{className:"size-4"})})}),(0,b.jsxs)(h.CardTitle,{children:["Team",g>0&&(0,b.jsxs)("span",{className:"ml-2 text-xs text-muted-foreground font-normal",children:["(",g," pending invite",g>1?"s":"",")"]})]})]}),(0,b.jsx)(h.CardContent,{className:"p-0",children:(0,b.jsx)("div",{className:"divide-y divide-border/50",children:[...f].sort((a,b)=>"owner"===a.role?-1:+("owner"===b.role)).map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[a.image?(0,b.jsx)("img",{src:a.image,alt:a.name,className:"size-7 rounded-full shrink-0"}):(0,b.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-secondary text-xs font-medium",children:(a.name||a.email).charAt(0).toUpperCase()}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("span",{className:"text-sm font-medium truncate block",children:a.name||a.email}),a.name&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground truncate block",children:a.email})]}),(0,b.jsx)(i.Badge,{variant:"owner"===a.role?"default":"secondary",className:"text-[10px] px-1.5 py-0 shrink-0",children:a.role})]},a.id))})})]})}a.s(["UsagesTab",0,function(){let{agents:a,runtimes:h,loading:i,activeTaskCounts:j}=(0,d.useAgentContext)(),{workspaceId:k}=(0,e.useWorkspace)(),[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)(!1);return((0,c.useEffect)(()=>{if(i)return;let a=!1;return o(!0),(0,g.getWorkspaceOverview)(k).then(b=>{a||m(b)}).catch(()=>{}).finally(()=>{a||o(!1)}),()=>{a=!0}},[i,k]),n||!l)?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(f.Skeleton,{className:"h-44 rounded-xl"}),(0,b.jsx)(f.Skeleton,{className:"h-44 rounded-xl"}),(0,b.jsx)(f.Skeleton,{className:"h-44 rounded-xl"}),(0,b.jsx)(f.Skeleton,{className:"h-44 rounded-xl"})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(r,{agents:a,runtimes:h,activeTaskCounts:j,overview:l}),(0,b.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,b.jsx)(s,{overview:l}),(0,b.jsx)(v,{overview:l,agents:a})]}),(0,b.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,b.jsx)(y,{runtimes:h,agents:a}),(0,b.jsx)(z,{overview:l})]})]})}],617168)},294526,a=>a.a(async(b,c)=>{try{var d=a.i(616612),e=a.i(734803),f=a.i(654461),g=a.i(75118),h=a.i(597047),i=a.i(53909),j=a.i(616131),k=a.i(93590),l=a.i(390946),m=a.i(617168),n=b([h,j]);[h,j]=n.then?(await n)():n;let o=[{id:"general",label:"General"},{id:"pet",label:"Pet"},{id:"instruction",label:"Global Instruction"},{id:"notifications",label:"Notifications"},{id:"members",label:"Members"},{id:"usages",label:"Usages"}];a.s(["default",0,function(){let[a,b]=(0,e.useState)("general");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"flex items-center justify-between border-b border-border/50 px-3 md:px-5 py-2.5 gap-3",children:(0,d.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,d.jsx)("h1",{className:"text-sm font-medium",children:"Settings"})})}),(0,d.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,d.jsxs)("nav",{className:"w-48 shrink-0 border-r border-border/50 py-3 px-2 hidden md:flex md:flex-col",children:[(0,d.jsx)("div",{className:"flex-1",children:o.map(c=>(0,d.jsx)("button",{onClick:()=>b(c.id),className:(0,g.cn)("w-full rounded-md px-2.5 py-1.5 text-left text-sm transition-colors",a===c.id?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:c.label},c.id))}),(0,d.jsxs)("div",{className:"px-2.5 pt-3 border-t border-border/50 text-[11px] text-muted-foreground/60",children:["v","0.0.138"]})]}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,d.jsx)("div",{className:"px-4 pt-2 md:hidden",children:(0,d.jsx)(f.Tabs,{className:"items-center",value:a,onValueChange:a=>b(a),children:(0,d.jsx)(f.TabsList,{className:"h-auto gap-1",children:o.map(a=>(0,d.jsx)(f.TabsTrigger,{value:a.id,children:a.label},a.id))})})}),(0,d.jsx)("div",{className:(0,g.cn)("flex-1 overflow-y-auto thin-scrollbar","instruction"!==a&&"px-5 py-5"),children:"instruction"===a?(0,d.jsx)(i.InstructionTab,{}):"usages"===a?(0,d.jsx)(m.UsagesTab,{}):(0,d.jsxs)("div",{className:"mx-auto max-w-md",children:["general"===a&&(0,d.jsx)(h.GeneralTab,{}),"pet"===a&&(0,d.jsx)(l.PetTab,{}),"notifications"===a&&(0,d.jsx)(k.NotificationTab,{}),"members"===a&&(0,d.jsx)(j.MembersTab,{})]})}),(0,d.jsxs)("div",{className:"px-4 py-2 text-[11px] text-muted-foreground/60 md:hidden",children:["v","0.0.138"]})]})]})]})}]),c()}catch(a){c(a)}},!1)];
|
|
1
|
+
module.exports=[597047,a=>a.a(async(b,c)=>{try{var d=a.i(616612),e=a.i(734803),f=a.i(780956),g=a.i(630991),h=a.i(506180),i=a.i(454607),j=a.i(588339),k=a.i(732254),l=a.i(334235),m=a.i(76592),n=a.i(25668),o=a.i(390248),p=a.i(946621),q=b([i]);[i]=q.then?(await q)():q,a.s(["GeneralTab",0,function(){let{workspaceId:a,slug:b}=(0,h.useWorkspace)(),c=(0,i.useSession)(),q=(0,g.useRouter)(),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(!0),[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(""),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)({}),[H,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(!1),L=(0,e.useCallback)(async()=>{u(!0);try{let b=c.data?.user?.id,[d,e]=await Promise.all([(0,j.listMembers)(a),(0,j.listWorkspaces)()]),f=d.find(a=>a.user_id===b);s(f?.role??"");let g=e.find(b=>b.id===a);g&&(w(g.name),y(g.slug),A(g.name),C(g.slug))}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to load workspace info")}finally{u(!1)}},[a,c.data?.user?.id]);(0,e.useEffect)(()=>{c.data&&L()},[L,c.data]);let M=v!==z||x!==B,N=async()=>{let c=(0,o.validateWorkspaceForm)({name:v,slug:x});if(G(c),!(0,o.hasWorkspaceFormErrors)(c)){E(!0);try{let c=await (0,j.updateWorkspace)(a,{name:v.trim(),slug:x.trim()});(0,p.trackSettingsUpdated)({setting_tab:"general"}),A(c.name),C(c.slug),f.toast.success("Workspace updated"),c.slug!==b&&q.replace(`/w/${c.slug}/settings`)}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to update workspace")}finally{E(!1)}}},O=async()=>{if(H===z){K(!0);try{await (0,j.deleteWorkspace)(a,z),f.toast.success("Workspace deleted"),q.replace("/workspaces")}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to delete workspace")}finally{K(!1)}}};return t?(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)(n.Skeleton,{className:"h-4 w-32"}),(0,d.jsx)(n.Skeleton,{className:"h-10 w-full"}),(0,d.jsx)(n.Skeleton,{className:"h-10 w-full"})]}):"owner"!==r?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Only workspace owners can edit workspace settings."}):(0,d.jsxs)("div",{className:"space-y-10",children:[(0,d.jsxs)("section",{className:"space-y-4",children:[(0,d.jsx)("h2",{className:"text-sm font-medium",children:"Workspace"}),(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)(m.Label,{htmlFor:"workspace-name",children:"Name"}),(0,d.jsx)(l.Input,{id:"workspace-name",value:v,onChange:a=>{let b=a.target.value;w(b),F.name&&b.trim()&&G(a=>({...a,name:void 0}))},placeholder:"Workspace name","aria-invalid":!!F.name,"aria-describedby":F.name?"workspace-name-error":void 0}),F.name&&(0,d.jsx)("p",{id:"workspace-name-error",className:"text-xs text-destructive",children:F.name})]}),(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)(m.Label,{htmlFor:"workspace-slug",children:"Slug"}),(0,d.jsx)(l.Input,{id:"workspace-slug",value:x,onChange:a=>{let b=a.target.value;y(b),F.slug&&b.trim()&&G(a=>({...a,slug:void 0}))},placeholder:"workspace-slug","aria-invalid":!!F.slug,"aria-describedby":F.slug?"workspace-slug-error":void 0}),F.slug&&(0,d.jsx)("p",{id:"workspace-slug-error",className:"text-xs text-destructive",children:F.slug}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground/70",children:["Used in URLs: /w/",x,"/"]})]})]}),(0,d.jsx)(k.Button,{size:"sm",onClick:N,disabled:!M||D,children:D?"Saving…":"Save"})]}),(0,d.jsxs)("section",{className:"space-y-4",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-destructive",children:"Danger Zone"}),(0,d.jsxs)("div",{className:"rounded-md border border-destructive/30 p-4 space-y-3",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Deleting this workspace is permanent and cannot be undone. All agents, conversations, and data will be lost."}),(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)(m.Label,{htmlFor:"delete-confirm",className:"text-xs",children:["Type ",(0,d.jsx)("span",{className:"font-medium text-foreground",children:z})," to confirm"]}),(0,d.jsx)(l.Input,{id:"delete-confirm",value:H,onChange:a=>I(a.target.value),placeholder:z})]}),(0,d.jsx)(k.Button,{size:"sm",variant:"destructive",onClick:O,disabled:H!==z||J,children:J?"Deleting…":"Delete Workspace"})]})]})]})}]),c()}catch(a){c(a)}},!1),53909,a=>{"use strict";var b=a.i(616612),c=a.i(734803),d=a.i(780956),e=a.i(506180),f=a.i(588339),g=a.i(889624),h=a.i(25668),i=a.i(75118);function j({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,i.cn)("transition-all duration-300",a>.9?"text-destructive/70":a>.7?"text-yellow-500/50":"text-muted-foreground/30")})]})}a.s(["InstructionTab",0,function(){let{workspaceId:a}=(0,e.useWorkspace)(),[i,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(!0),p=(0,c.useRef)(i);(0,c.useEffect)(()=>{p.current=i},[i]);let q=(0,c.useRef)(l);(0,c.useEffect)(()=>{q.current=l},[l]);let r=(0,c.useRef)(null),s=(0,c.useRef)(!1),t=(0,c.useCallback)(async()=>{o(!0);try{let b=await (0,f.getMemberMe)(a);k(b.global_instruction),m(b.global_instruction)}catch(a){d.toast.error(a instanceof Error?a.message:"Failed to load settings")}finally{o(!1)}},[a]);(0,c.useEffect)(()=>{t()},[t]);let u=(0,c.useRef)(()=>{}),v=(0,c.useCallback)(async()=>{if(s.current)return;let b=p.current;if(b!==q.current){s.current=!0;try{let c=await (0,f.updateMemberMe)(a,b);m(c.global_instruction)}catch(a){d.toast.error(a instanceof Error?a.message:"Failed to save")}finally{s.current=!1,p.current!==q.current&&u.current()}}},[a]),w=(0,c.useCallback)(()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(v,500)},[v]);(0,c.useEffect)(()=>{u.current=w},[w]);let x=(0,c.useCallback)(a=>{k(a),w()},[w]);(0,c.useEffect)(()=>{let b=()=>{if(r.current&&clearTimeout(r.current),p.current!==q.current){let b=new URLSearchParams({workspace_id:a});fetch(`/api/members/me?${b}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({global_instruction:p.current}),keepalive:!0})}};return window.addEventListener("beforeunload",b),()=>window.removeEventListener("beforeunload",b)},[a]),(0,c.useEffect)(()=>()=>{if(r.current&&clearTimeout(r.current),p.current!==q.current){let b=new URLSearchParams({workspace_id:a});fetch(`/api/members/me?${b}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({global_instruction:p.current}),keepalive:!0})}},[a]);let y=i.length/5e4;return n?(0,b.jsxs)("div",{className:"px-6 py-6 space-y-4",children:[(0,b.jsx)(h.Skeleton,{className:"h-4 w-48"}),(0,b.jsx)(h.Skeleton,{className:"h-40 w-full"})]}):(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsx)("div",{className:"flex-1 px-6 pt-4 pb-4",children:(0,b.jsx)(g.MarkdownEditor,{value:i,onChange:x,placeholder:"Write instructions that every agent you own will follow...",minHeight:"calc(100vh - 240px)",contentType:"markdown",variant:"seamless"})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 px-6 py-3",children:[(0,b.jsx)(j,{ratio:y}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"This instruction is prepended to every agent's individual instruction."})]})]})}])},851688,a=>{"use strict";let b=(0,a.i(410732).default)("user-minus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);a.s(["UserMinus",0,b],851688)},616131,a=>a.a(async(b,c)=>{try{var d=a.i(616612),e=a.i(734803),f=a.i(780956),g=a.i(340490),h=a.i(790107),i=a.i(396439),j=a.i(851688),k=a.i(506180),l=a.i(454607),m=a.i(588339),n=a.i(732254),o=a.i(25668),p=a.i(525132),q=a.i(75118),r=a.i(946621),s=b([l]);function t(a){return`${window.location.origin}/invite/${a}`}[l]=s.then?(await s)():s,a.s(["MembersTab",0,function(){let{workspaceId:a}=(0,k.useWorkspace)(),b=(0,l.useSession)(),c=b.data?.user?.id,[s,u]=(0,e.useState)([]),[v,w]=(0,e.useState)([]),[x,y]=(0,e.useState)(!0),[z,A]=(0,e.useState)(!1),B=s.find(a=>a.user_id===c)?.role==="owner",C=(0,e.useCallback)(async()=>{y(!0);try{let[b,c]=await Promise.all([(0,m.listMembers)(a),(0,m.listInvites)(a).catch(()=>[])]);u(b),w(c)}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to load members")}finally{y(!1)}},[a]);(0,e.useEffect)(()=>{C()},[C]);let D=async()=>{A(!0);try{let b=await (0,m.createInvite)(a);(0,r.trackTeamMemberInvited)({workspace_id:a}),w(a=>[...a,b]);let c=t(b.token);await navigator.clipboard.writeText(c),f.toast.success("Invite link copied to clipboard")}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to generate invite")}finally{A(!1)}},E=async a=>{let b=t(a);try{await navigator.clipboard.writeText(b),f.toast.success("Invite link copied")}catch{f.toast.error("Failed to copy link")}},F=async b=>{try{await (0,m.revokeInvite)(a,b),w(a=>a.filter(a=>a.id!==b)),f.toast.success("Invite revoked")}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to revoke invite")}},G=async b=>{try{await (0,m.removeMember)(a,b),u(a=>a.filter(a=>a.id!==b)),f.toast.success("Member removed")}catch(a){f.toast.error(a instanceof Error?a.message:"Failed to remove member")}};return x?(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)(o.Skeleton,{className:"h-4 w-24"}),(0,d.jsx)(o.Skeleton,{className:"h-10 w-full"}),(0,d.jsx)(o.Skeleton,{className:"h-10 w-full"}),(0,d.jsx)(o.Skeleton,{className:"h-4 w-24 mt-6"}),(0,d.jsx)(o.Skeleton,{className:"h-10 w-full"}),(0,d.jsx)(o.Skeleton,{className:"h-10 w-full"})]}):(0,d.jsxs)("div",{className:"space-y-8",children:[B&&(0,d.jsxs)("section",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("h2",{className:"text-sm font-medium",children:"Pending Invites"}),(0,d.jsxs)(n.Button,{size:"sm",variant:"outline",onClick:D,disabled:z,children:[(0,d.jsx)(i.Plus,{className:"size-3.5 mr-1"}),z?"Generating…":"Generate invite link"]})]}),0===v.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:"No active invite links. Generate one to invite someone to this workspace."}):(0,d.jsx)("div",{className:"space-y-1.5",children:v.map(a=>{let b=new Date(a.expires_at),c=b<new Date;return(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border/50 px-3 py-2 text-xs",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:(0,q.cn)("font-mono truncate",c&&"text-muted-foreground line-through"),children:["/invite/",a.token.slice(0,12),"…"]}),(0,d.jsx)("p",{className:(0,q.cn)("text-muted-foreground/70 mt-0.5",c&&"text-destructive/70"),children:c?"Expired":`Expires ${b.toLocaleDateString()}`})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-2 shrink-0",children:[!c&&(0,d.jsxs)(p.Tooltip,{children:[(0,d.jsx)(p.TooltipTrigger,{render:(0,d.jsx)(n.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>E(a.token)}),children:(0,d.jsx)(g.Copy,{className:"size-3.5"})}),(0,d.jsx)(p.TooltipContent,{children:"Copy invite link"})]}),(0,d.jsxs)(p.Tooltip,{children:[(0,d.jsx)(p.TooltipTrigger,{render:(0,d.jsx)(n.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-destructive hover:text-destructive",onClick:()=>F(a.id)}),children:(0,d.jsx)(h.Trash2,{className:"size-3.5"})}),(0,d.jsx)(p.TooltipContent,{children:"Revoke invite"})]})]})]},a.id)})})]}),(0,d.jsxs)("section",{className:"space-y-3",children:[(0,d.jsx)("h2",{className:"text-sm font-medium",children:"Members"}),(0,d.jsx)("div",{className:"space-y-1.5",children:s.map(a=>{let b=a.user_id===c,e=a.name?a.name.split(" ").map(a=>a[0]).join("").slice(0,2).toUpperCase():a.email.slice(0,2).toUpperCase();return(0,d.jsxs)("div",{className:"flex items-center gap-3 rounded-md border border-border/50 px-3 py-2",children:[(0,d.jsx)("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center text-xs font-medium text-muted-foreground shrink-0 overflow-hidden",children:a.image?(0,d.jsx)("img",{src:a.image,alt:a.name,className:"size-full object-cover"}):e}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"text-sm font-medium truncate leading-tight",children:[a.name||a.email,b&&(0,d.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"(you)"})]}),a.name&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a.email})]}),(0,d.jsx)("span",{className:(0,q.cn)("text-xs px-1.5 py-0.5 rounded shrink-0","owner"===a.role?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:a.role}),B&&!b&&(0,d.jsxs)(p.Tooltip,{children:[(0,d.jsx)(p.TooltipTrigger,{render:(0,d.jsx)(n.Button,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive shrink-0",onClick:()=>G(a.id)}),children:(0,d.jsx)(j.UserMinus,{className:"size-3.5"})}),(0,d.jsx)(p.TooltipContent,{children:"Remove member"})]})]},a.id)})})]})]})}]),c()}catch(a){c(a)}},!1),93590,a=>{"use strict";var b=a.i(616612),c=a.i(734803),d=a.i(780956),e=a.i(951687),f=a.i(973111),g=a.i(626806);a.s(["NotificationTab",0,function(){let[a,h]=(0,c.useState)(!1),[i,j]=(0,c.useState)([...g.NOTIFICATION_EVENTS]),[k,l]=(0,c.useState)(!0),[m,n]=(0,c.useState)(!1);(0,c.useEffect)(()=>{l((0,g.isNotificationSupported)()),h((0,g.getNotificationEnabled)()),j((0,g.getNotificationEvents)()),(0,g.isNotificationSupported)()&&n("denied"===Notification.permission)},[]);let o=async a=>{if(!a){h(!1),(0,g.setNotificationEnabled)(!1);return}await (0,g.requestNotificationPermission)()?(h(!0),(0,g.setNotificationEnabled)(!0)):(n(!0),d.toast.error("Notification permission denied. Please enable it in browser settings."))};return k?(0,b.jsx)("div",{className:"space-y-6",children:(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)("h2",{className:"text-sm font-medium",children:"Browser Notifications"}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("p",{className:"text-sm",children:"Enable notifications"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Get notified when tasks finish while the tab is in the background"})]}),(0,b.jsx)(f.Switch,{checked:a,onCheckedChange:o,disabled:m&&!a})]}),m&&!a&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:"Notification permission was denied. Please allow it in your browser settings."}),a&&(0,b.jsxs)("div",{className:"space-y-2 pl-0.5",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Notify me when:"}),g.NOTIFICATION_EVENTS.map(a=>(0,b.jsxs)("label",{className:"flex items-center gap-2 text-sm cursor-pointer select-none",children:[(0,b.jsx)(e.Checkbox,{checked:i.includes(a),onCheckedChange:()=>{j(b=>{let c=b.includes(a)?b.filter(b=>b!==a):[...b,a];return(0,g.setNotificationEvents)(c),c})}}),g.NOTIFICATION_EVENT_LABELS[a]]},a))]})]})]})}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your browser does not support notifications."})}])},390946,a=>{"use strict";var b=a.i(616612),c=a.i(734803);let d=(0,a.i(410732).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),e="alook-cloud-code-monster-pet-preset-v1",f="alook-cloud-code-monster-pet-preset-changed",g=new Map([{id:"pet-02",name:"Pocket Bell Bot",group:"Inspired Mascots",feature:"bell",shape:"gadget-buddy"},{id:"pet-03",name:"Spark Bolt Pal",group:"Inspired Mascots",feature:"bolt",shape:"electric-mascot"},{id:"pet-04",name:"Star Puff",group:"Inspired Mascots",feature:"star",shape:"star-puff"},{id:"pet-05",name:"Leaf Bud",group:"Inspired Mascots",feature:"leaf",shape:"leaf-bud-shape"},{id:"pet-06",name:"Tiny Flame",group:"Inspired Mascots",feature:"flame",shape:"ember-scout"},{id:"pet-07",name:"Shell Fin",group:"Inspired Mascots",feature:"fins",shape:"shell-sprout"},{id:"pet-08",name:"Block Builder",group:"Inspired Mascots",feature:"visor",shape:"block-builder-shape"},{id:"pet-09",name:"Block Hiss",group:"Inspired Mascots",feature:"mask",shape:"block-hiss-shape"},{id:"pet-10",name:"Block Walker",group:"Inspired Mascots",feature:"visor",shape:"block-walker-shape"},{id:"pet-11",name:"Mushroom Pal",group:"Inspired Mascots",feature:"mushroom",shape:"mushroom-pal-shape"},{id:"pet-12",name:"Blue Spin",group:"Inspired Mascots",feature:"spin",shape:"blue-spinner"},{id:"pet-13",name:"Arcade Chomp",group:"Inspired Mascots",feature:"chomp",shape:"arcade-chomper"},{id:"pet-14",name:"Peek Ghost",group:"Inspired Mascots",feature:"ghost",shape:"peek-ghost-shape"},{id:"pet-15",name:"Red Cap Jumper",group:"Inspired Mascots",feature:"cap",shape:"cap-jumper"},{id:"pet-16",name:"Honey Cub",group:"Inspired Mascots",feature:"ears",shape:"honey-cub-shape"},{id:"pet-17",name:"Ribbon Cat",group:"Inspired Mascots",feature:"bow",shape:"ribbon-cat-shape"},{id:"pet-18",name:"Cozy Hood Bunny",group:"Inspired Mascots",feature:"hood",shape:"cozy-hood-bunny-shape"},{id:"pet-19",name:"Imp Hood",group:"Inspired Mascots",feature:"mask",shape:"imp-hood-shape"},{id:"pet-20",name:"Forest Neighbor",group:"Inspired Mascots",feature:"ears",shape:"forest-neighbor-shape"},{id:"pet-21",name:"Dust Puff",group:"Inspired Mascots",feature:"soot",shape:"dust-puff-shape"},{id:"pet-22",name:"Straw Voyager",group:"Inspired Mascots",feature:"straw",shape:"straw-voyager-shape"},{id:"pet-23",name:"Leaf Runner",group:"Inspired Mascots",feature:"ninja",shape:"leaf-runner-shape"},{id:"pet-24",name:"Energy Pearl",group:"Inspired Mascots",feature:"pearl",shape:"energy-pearl-shape"},{id:"pet-25",name:"Moon Wand",group:"Inspired Mascots",feature:"wand",shape:"moon-wand-shape"},{id:"pet-26",name:"Mecha Guard",group:"Inspired Mascots",feature:"mecha",shape:"mecha-guard-shape"},{id:"pet-27",name:"Teardrop Slime",group:"Inspired Mascots",feature:"slime",shape:"teardrop-slime-shape"},{id:"pet-28",name:"Ink Runner",group:"Inspired Mascots",feature:"ink",shape:"ink-runner-shape"},{id:"pet-29",name:"Little Beagle",group:"Inspired Mascots",feature:"ears",shape:"little-beagle-shape"},{id:"pet-30",name:"Tiny Antler",group:"Inspired Mascots",feature:"horns",shape:"tiny-antler-shape"}].map(a=>[a.id,a])),h=[{id:"pet-01",name:"Claude Pixel",group:"Codex",feature:"square",bodyTop:"#e0845f",body:"#d87352",bodyDark:"#cf684a",bodyLight:"#e88d68",bodySideLight:"#df7d5a",bodySideDark:"#c86347",accent:"#d7654a",accessory:"#f1bc62",eye:"#12100f",highlight:"#f6e7d7"},{id:"pet-02",name:"Blue Pocket Bot",group:"Gadget Buddy",feature:"bell",bodyTop:"#4aa8d8",body:"#2f8fc4",bodyDark:"#2674a4",bodyLight:"#68bce5",bodySideLight:"#48a8d5",bodySideDark:"#1f6591",accent:"#d84e4a",accessory:"#f4c94f",eye:"#10141a",highlight:"#f7fbff",facePatch:"#f6fbff",cheek:"#d84e4a"},{id:"pet-03",name:"Spark Arcade Pal",group:"Electric Mascot",feature:"bolt",bodyTop:"#f2d45a",body:"#e6bd37",bodyDark:"#c89a2a",bodyLight:"#ffe37a",bodySideLight:"#f0cc4c",bodySideDark:"#b58724",accent:"#2f2520",accessory:"#df5145",eye:"#17120e",highlight:"#fff7c7",cheek:"#e94d43"},{id:"pet-04",name:"Pink Star Puff",group:"Star Puff",feature:"star",bodyTop:"#eba0b7",body:"#df7fa0",bodyDark:"#c76589",bodyLight:"#f2b6c8",bodySideLight:"#e993ac",bodySideDark:"#b95778",accent:"#c84d64",accessory:"#f0d862",eye:"#171016",highlight:"#fff0f6",cheek:"#e75c7a"},{id:"pet-05",name:"Leaf Sprite",group:"Forest Starter",feature:"leaf",bodyTop:"#76aa7b",body:"#5f9666",bodyDark:"#4d7c54",bodyLight:"#91bd8f",bodySideLight:"#72a875",bodySideDark:"#426d49",accent:"#2f6f46",accessory:"#d6e78a",eye:"#11160f",highlight:"#f0f8e4",facePatch:"#dceec2"},{id:"pet-06",name:"Ember Starter",group:"Fire Buddy",feature:"flame",bodyTop:"#df8755",body:"#ce6b3f",bodyDark:"#af5333",bodyLight:"#ee9d6b",bodySideLight:"#dd7b4c",bodySideDark:"#9a482c",accent:"#8d3d2f",accessory:"#f3c34b",eye:"#17100c",highlight:"#ffe8d4",cheek:"#e45842"},{id:"pet-07",name:"Ripple Buddy",group:"Water Buddy",feature:"fins",bodyTop:"#82b5d6",body:"#629dcc",bodyDark:"#4f82ad",bodyLight:"#9bc8e5",bodySideLight:"#73add6",bodySideDark:"#44749b",accent:"#5f6f8d",accessory:"#ead59a",eye:"#10151b",highlight:"#eff8ff",facePatch:"#d9eef8"},{id:"pet-08",name:"Moon Alley Cat",group:"Moon Cat",feature:"moon",bodyTop:"#4f4b69",body:"#3f3a59",bodyDark:"#332f49",bodyLight:"#67607e",bodySideLight:"#554f6d",bodySideDark:"#2b283e",accent:"#e5c85c",accessory:"#d66f91",eye:"#f5e8a7",highlight:"#fff6c8",cheek:"#cf6d8f"},{id:"pet-09",name:"Spore Runner",group:"Mushroom Runner",feature:"mushroom",bodyTop:"#e0524f",body:"#f0dcc6",bodyDark:"#d7c0aa",bodyLight:"#f7ead9",bodySideLight:"#f1dfcb",bodySideDark:"#c7aa95",accent:"#b83736",accessory:"#ffffff",eye:"#17120f",highlight:"#fff8ea"},{id:"pet-10",name:"Dash Quill",group:"Speed Mascot",feature:"spin",bodyTop:"#4e83d0",body:"#356dbd",bodyDark:"#2a579b",bodyLight:"#6896de",bodySideLight:"#477dd0",bodySideDark:"#244c88",accent:"#f2c45b",accessory:"#f2ece1",eye:"#10131a",highlight:"#eef4ff",facePatch:"#ead3b9"},{id:"pet-11",name:"Lemon Chomper",group:"Arcade Chomper",feature:"chomp",bodyTop:"#f0ce45",body:"#e5ba2f",bodyDark:"#c89924",bodyLight:"#ffe26c",bodySideLight:"#efc73f",bodySideDark:"#b18520",accent:"#1f1b18",accessory:"#f2845f",eye:"#15110d",highlight:"#fff2b6"},{id:"pet-12",name:"Lantern Ghost",group:"Round Ghost",feature:"ghost",bodyTop:"#d9dff0",body:"#c4cee6",bodyDark:"#aab6d2",bodyLight:"#edf2ff",bodySideLight:"#d3dced",bodySideDark:"#9aa8c6",accent:"#6d7da8",accessory:"#e77c9c",eye:"#151926",highlight:"#ffffff"},{id:"pet-13",name:"Red Cap Jumper",group:"Platform Pal",feature:"cap",bodyTop:"#d84f45",body:"#c5a17d",bodyDark:"#a98263",bodyLight:"#e0ba94",bodySideLight:"#d3ad86",bodySideDark:"#936f54",accent:"#2c4f99",accessory:"#f6e9d1",eye:"#16110d",highlight:"#fff2df"},{id:"pet-14",name:"Honey Cub",group:"Classic Toy",feature:"ears",bodyTop:"#e4b25a",body:"#d0993e",bodyDark:"#ad7d30",bodyLight:"#efc46d",bodySideLight:"#dba84d",bodySideDark:"#996d2a",accent:"#b54d3f",accessory:"#f4d991",eye:"#17110d",highlight:"#fff0c8",facePatch:"#f2d083"},{id:"pet-15",name:"Ribbon Puff",group:"Bow Buddy",feature:"bow",bodyTop:"#f2f0e8",body:"#e3ded4",bodyDark:"#c9c2b7",bodyLight:"#ffffff",bodySideLight:"#eee9df",bodySideDark:"#bab2a7",accent:"#d84b5b",accessory:"#f3cc56",eye:"#15110f",highlight:"#ffffff",cheek:"#df6d80"},{id:"pet-16",name:"Cozy Hood Cub",group:"Hooded Mascot",feature:"hood",bodyTop:"#ef9eba",body:"#e681a4",bodyDark:"#c96789",bodyLight:"#f5b6ca",bodySideLight:"#ee94b2",bodySideDark:"#b85878",accent:"#f0d6de",accessory:"#f3d66b",eye:"#171017",highlight:"#fff0f6",facePatch:"#fff6f2"},{id:"pet-17",name:"Masked Beetle",group:"Bug Hero",feature:"mask",bodyTop:"#6e617d",body:"#554761",bodyDark:"#41374b",bodyLight:"#837491",bodySideLight:"#655570",bodySideDark:"#382f41",accent:"#cf6f8e",accessory:"#f0d46a",eye:"#f7edf4",highlight:"#fff7ff",facePatch:"#ece0ea"},{id:"pet-18",name:"Round Forest Pal",group:"Forest Neighbor",feature:"ears",bodyTop:"#8c8d7d",body:"#74766a",bodyDark:"#606257",bodyLight:"#a0a293",bodySideLight:"#838578",bodySideDark:"#55574d",accent:"#d9d3b8",accessory:"#c6d68c",eye:"#121411",highlight:"#efead8",facePatch:"#dad4ba"},{id:"pet-19",name:"Dust Puff",group:"Tiny Soot",feature:"soot",bodyTop:"#34343a",body:"#25262c",bodyDark:"#1d1e24",bodyLight:"#4a4b52",bodySideLight:"#383941",bodySideDark:"#171820",accent:"#6c6f7a",accessory:"#f0f0d8",eye:"#f7f7e8",highlight:"#ffffff"},{id:"pet-20",name:"Straw Field Pal",group:"Harvest Buddy",feature:"straw",bodyTop:"#d96a50",body:"#c65342",bodyDark:"#a74336",bodyLight:"#e47d64",bodySideLight:"#d0614d",bodySideDark:"#933a30",accent:"#2f5f93",accessory:"#e8c866",eye:"#15100d",highlight:"#ffe6d9"},{id:"pet-21",name:"Shadow Ninja Bean",group:"Ninja Mascot",feature:"ninja",bodyTop:"#e7a04d",body:"#d88432",bodyDark:"#b96c27",bodyLight:"#efb464",bodySideLight:"#df943e",bodySideDark:"#a25d22",accent:"#2d415c",accessory:"#ded5c6",eye:"#15100c",highlight:"#ffe7c8",facePatch:"#f3c78d"},{id:"pet-22",name:"Pearl Quest Cub",group:"Pearl Hero",feature:"pearl",bodyTop:"#e3a54e",body:"#ce8438",bodyDark:"#ac682e",bodyLight:"#efbc68",bodySideLight:"#db9345",bodySideDark:"#985a28",accent:"#476ca6",accessory:"#f0d464",eye:"#15100c",highlight:"#ffe8c4"},{id:"pet-23",name:"Wand Starling",group:"Magic Mascot",feature:"wand",bodyTop:"#f0a6c4",body:"#df87ad",bodyDark:"#c26b92",bodyLight:"#f5bad2",bodySideLight:"#e99ab9",bodySideDark:"#ad5d82",accent:"#d8b34a",accessory:"#e9d7ff",eye:"#171017",highlight:"#fff0f7",cheek:"#e76791"},{id:"pet-24",name:"Mecha Bean",group:"Tiny Mecha",feature:"mecha",bodyTop:"#d7dbe2",body:"#bdc3ce",bodyDark:"#9ea6b3",bodyLight:"#edf0f5",bodySideLight:"#cbd1da",bodySideDark:"#8d96a5",accent:"#d44d4a",accessory:"#f0c748",eye:"#151923",highlight:"#ffffff"},{id:"pet-25",name:"Bubble Slimelet",group:"Slime Buddy",feature:"slime",bodyTop:"#79b8e8",body:"#5aa0d8",bodyDark:"#4384ba",bodyLight:"#96cdf0",bodySideLight:"#70b3e3",bodySideDark:"#3975a6",accent:"#2a658f",accessory:"#f3f7ff",eye:"#101722",highlight:"#f5fbff"},{id:"pet-26",name:"Ink Courier",group:"Ink Runner",feature:"ink",bodyTop:"#75c8bb",body:"#54afa2",bodyDark:"#3f9188",bodyLight:"#90d9ce",bodySideLight:"#67c1b5",bodySideDark:"#377f77",accent:"#d7668f",accessory:"#e4f2ef",eye:"#101716",highlight:"#effffb"},{id:"pet-27",name:"Drum Marcher",group:"Rhythm Pal",feature:"drum",bodyTop:"#ef7f5f",body:"#df6349",bodyDark:"#bd4d3b",bodyLight:"#f39a7b",bodySideLight:"#e77358",bodySideDark:"#a84434",accent:"#4f78b6",accessory:"#f3e4c6",eye:"#15100d",highlight:"#fff0e4"},{id:"pet-28",name:"Sprout Forestling",group:"Sprout Buddy",feature:"sprout",bodyTop:"#a58f5d",body:"#8f7548",bodyDark:"#755f3a",bodyLight:"#b9a26e",bodySideLight:"#9b8354",bodySideDark:"#655233",accent:"#5d8b56",accessory:"#dfc86e",eye:"#15110c",highlight:"#f8ecc0",facePatch:"#d8be71"},{id:"pet-29",name:"Frost Star Pup",group:"Ice Pal",feature:"star",bodyTop:"#8aa7d8",body:"#6e91c8",bodyDark:"#5877aa",bodyLight:"#a1bce5",bodySideLight:"#7f9fd3",bodySideDark:"#4e6898",accent:"#f0cf5b",accessory:"#f3edf5",eye:"#10151c",highlight:"#eff5ff",cheek:"#d66d86"},{id:"pet-30",name:"Tiny Quest Cub",group:"Quest Mascot",feature:"bow",bodyTop:"#efa2c8",body:"#df84b2",bodyDark:"#c46999",bodyLight:"#f5b9d5",bodySideLight:"#eb96c2",bodySideDark:"#ad5a86",accent:"#cf4d78",accessory:"#f0d66a",eye:"#171016",highlight:"#fff0f8",cheek:"#df688f"}].map(a=>({...a,...g.get(a.id)}));function i(a){return h.find(b=>b.id===a)??h[0]}function j(){if("u"<typeof localStorage)return h[0].id;try{return i(localStorage.getItem(e)).id}catch{return h[0].id}}var k=a.i(535510);let l=(0,c.lazy)(()=>a.A(76574).then(a=>({default:a.MonsterDirectPixelCharacter})));function m({activityId:a,preset:c,reacting:d,shaken:e,fainted:f=!1,eyeOffset:g={x:0,y:0}}){let h=(0,k.getCloudCodeMonsterExpression)(a,d,e,f);return"fainted"===h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"43",y:"39",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"49",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"43",y:"51",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"49",y:"39",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"43",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"76",y:"39",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"82",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"76",y:"51",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"82",y:"39",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"76",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"58",y:"64",width:"14",height:"4",fill:c.eye})]}):"shaken"===h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"45",y:"40",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"50",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"45",y:"50",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"82",y:"40",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"77",y:"45",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"82",y:"50",width:"5",height:"5",fill:c.eye}),(0,b.jsx)("rect",{x:"62",y:"61",width:"6",height:"4",fill:c.eye})]}):"shocked"===h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("g",{className:"cloud-code-monster-pet-eyes-track",transform:`translate(${g.x} ${g.y})`,children:[(0,b.jsx)("rect",{className:"cloud-code-monster-pet-eye-blink",x:"44",y:"39",width:"12",height:"13",fill:c.eye}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-eye-blink",x:"76",y:"39",width:"12",height:"13",fill:c.eye}),(0,b.jsxs)("g",{transform:`translate(${.45*g.x} ${.45*g.y})`,children:[(0,b.jsx)("rect",{x:"47",y:"42",width:"4",height:"4",fill:c.highlight}),(0,b.jsx)("rect",{x:"79",y:"42",width:"4",height:"4",fill:c.highlight})]})]}),(0,b.jsx)("rect",{x:"60",y:"60",width:"10",height:"12",fill:c.eye}),(0,b.jsx)("rect",{x:"62",y:"62",width:"6",height:"3",fill:"#332520"})]}):"sleeping"===h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"45",y:"46",width:"11",height:"4",fill:c.eye}),(0,b.jsx)("rect",{x:"76",y:"46",width:"11",height:"4",fill:c.eye})]}):(0,b.jsxs)("g",{className:"cloud-code-monster-pet-eyes-track",transform:`translate(${g.x} ${g.y})`,children:[(0,b.jsx)("rect",{className:"cloud-code-monster-pet-eye-blink",x:"44",y:"42",width:"11",height:"12",fill:c.eye}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-eye-blink",x:"77",y:"42",width:"11",height:"12",fill:c.eye}),(0,b.jsxs)("g",{transform:`translate(${.55*g.x} ${.55*g.y})`,children:[(0,b.jsx)("rect",{x:"46",y:"44",width:"4",height:"4",fill:"#2c2521"}),(0,b.jsx)("rect",{x:"79",y:"44",width:"4",height:"4",fill:"#2c2521"})]})]})}function n({preset:a}){let{feature:c}=a;return"horns"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"29",y:"20",width:"10",height:"8",fill:a.accent}),(0,b.jsx)("rect",{x:"91",y:"20",width:"10",height:"8",fill:a.accent}),(0,b.jsx)("rect",{x:"34",y:"16",width:"7",height:"7",fill:a.accessory}),(0,b.jsx)("rect",{x:"88",y:"16",width:"7",height:"7",fill:a.accessory})]}):"ears"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"18",y:"38",width:"10",height:"18",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"100",y:"38",width:"10",height:"18",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"21",y:"42",width:"5",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"102",y:"42",width:"5",height:"8",fill:a.bodyLight})]}):"visor"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"41",y:"36",width:"47",height:"5",fill:a.accent}),(0,b.jsx)("rect",{x:"45",y:"38",width:"39",height:"3",fill:a.highlight})]}):"antenna"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"62",y:"15",width:"5",height:"13",fill:a.accent}),(0,b.jsx)("rect",{x:"58",y:"10",width:"13",height:"6",fill:a.accessory})]}):"crown"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"43",y:"18",width:"8",height:"10",fill:a.accessory}),(0,b.jsx)("rect",{x:"60",y:"14",width:"8",height:"14",fill:a.accessory}),(0,b.jsx)("rect",{x:"77",y:"18",width:"8",height:"10",fill:a.accessory}),(0,b.jsx)("rect",{x:"42",y:"26",width:"44",height:"5",fill:a.accent})]}):"bell"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"22",y:"42",width:"8",height:"14",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"98",y:"42",width:"8",height:"14",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"59",y:"21",width:"11",height:"7",fill:a.accent})]}):"bolt"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"29",y:"20",width:"8",height:"17",fill:a.accent}),(0,b.jsx)("rect",{x:"91",y:"20",width:"8",height:"17",fill:a.accent}),(0,b.jsx)("rect",{x:"33",y:"32",width:"8",height:"9",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"87",y:"32",width:"8",height:"9",fill:a.bodyTop})]}):"star"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"60",y:"13",width:"8",height:"24",fill:a.accessory}),(0,b.jsx)("rect",{x:"52",y:"21",width:"24",height:"8",fill:a.accessory}),(0,b.jsx)("rect",{x:"56",y:"17",width:"16",height:"16",fill:a.accessory})]}):"leaf"===c||"sprout"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"61",y:"15",width:"6",height:"18",fill:a.accent}),(0,b.jsx)("rect",{x:"49",y:"18",width:"16",height:"10",fill:a.accent}),(0,b.jsx)("rect",{x:"66",y:"18",width:"16",height:"10",fill:a.bodyLight})]}):"flame"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"58",y:"9",width:"12",height:"20",fill:a.accessory}),(0,b.jsx)("rect",{x:"52",y:"18",width:"9",height:"14",fill:a.accent}),(0,b.jsx)("rect",{x:"69",y:"17",width:"8",height:"15",fill:a.bodyLight})]}):"fins"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"18",y:"45",width:"10",height:"18",fill:a.accent}),(0,b.jsx)("rect",{x:"100",y:"45",width:"10",height:"18",fill:a.accent}),(0,b.jsx)("rect",{x:"55",y:"18",width:"18",height:"10",fill:a.accessory})]}):"moon"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"57",y:"14",width:"18",height:"18",fill:a.accessory}),(0,b.jsx)("rect",{x:"64",y:"12",width:"15",height:"19",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"24",y:"37",width:"7",height:"18",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"97",y:"37",width:"7",height:"18",fill:a.bodyDark})]}):"mushroom"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"31",y:"18",width:"66",height:"22",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"42",y:"13",width:"44",height:"11",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"45",y:"22",width:"9",height:"8",fill:a.accessory}),(0,b.jsx)("rect",{x:"73",y:"20",width:"10",height:"8",fill:a.accessory})]}):"spin"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"47",y:"17",width:"34",height:"9",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"37",y:"24",width:"14",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"78",y:"24",width:"13",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"29",y:"31",width:"11",height:"7",fill:a.bodyLight})]}):"chomp"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"88",y:"48",width:"14",height:"8",fill:a.highlight}),(0,b.jsx)("rect",{x:"88",y:"60",width:"14",height:"8",fill:a.highlight})]}):"ghost"===c||"slime"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"44",y:"19",width:"40",height:"12",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"36",y:"27",width:"56",height:"10",fill:a.bodyLight})]}):"cap"===c||"straw"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"34",y:"18",width:"58",height:"12",fill:"straw"===c?a.accessory:a.bodyTop}),(0,b.jsx)("rect",{x:"45",y:"12",width:"36",height:"10",fill:"straw"===c?a.accessory:a.bodyTop}),(0,b.jsx)("rect",{x:"58",y:"22",width:"14",height:"5",fill:"straw"===c?a.accent:a.accessory})]}):"bow"===c||"hood"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"76",y:"17",width:"13",height:"13",fill:a.accent}),(0,b.jsx)("rect",{x:"91",y:"17",width:"13",height:"13",fill:a.accent}),(0,b.jsx)("rect",{x:"88",y:"21",width:"7",height:"7",fill:a.accessory})]}):"mask"===c||"ninja"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"35",y:"25",width:"58",height:"8",fill:a.accent}),(0,b.jsx)("rect",{x:"48",y:"18",width:"12",height:"10",fill:a.accent}),(0,b.jsx)("rect",{x:"69",y:"18",width:"12",height:"10",fill:a.accent})]}):"soot"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"27",y:"25",width:"8",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"92",y:"23",width:"9",height:"9",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"61",y:"12",width:"7",height:"7",fill:a.bodyLight})]}):"pearl"===c||"wand"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"58",y:"12",width:"13",height:"13",fill:a.accessory}),(0,b.jsx)("rect",{x:"61",y:"7",width:"7",height:"7",fill:a.accent}),(0,b.jsx)("rect",{x:"73",y:"17",width:"9",height:"9",fill:a.accent})]}):"mecha"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"29",y:"24",width:"12",height:"13",fill:a.accent}),(0,b.jsx)("rect",{x:"87",y:"24",width:"12",height:"13",fill:a.accent}),(0,b.jsx)("rect",{x:"51",y:"18",width:"27",height:"9",fill:a.accessory})]}):"ink"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"35",y:"19",width:"12",height:"16",fill:a.accent}),(0,b.jsx)("rect",{x:"56",y:"14",width:"14",height:"20",fill:a.accent}),(0,b.jsx)("rect",{x:"80",y:"19",width:"12",height:"16",fill:a.accent})]}):"drum"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"31",y:"27",width:"66",height:"7",fill:a.accent}),(0,b.jsx)("rect",{x:"41",y:"18",width:"46",height:"10",fill:a.accessory})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"38",y:"30",width:"10",height:"4",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"80",y:"30",width:"10",height:"4",fill:a.bodyDark})]})}function o({preset:a}){let c=a.feature;return(0,b.jsxs)(b.Fragment,{children:[a.facePatch?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"40",y:"39",width:"48",height:"34",fill:a.facePatch}),(0,b.jsx)("rect",{x:"46",y:"73",width:"36",height:"10",fill:a.facePatch})]}):null,"bell"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"50",y:"74",width:"28",height:"6",fill:a.accent}),(0,b.jsx)("rect",{x:"58",y:"80",width:"13",height:"11",fill:a.accessory}),(0,b.jsx)("rect",{x:"61",y:"84",width:"7",height:"3",fill:a.eye})]}):null,"bolt"===c?(0,b.jsx)("rect",{x:"89",y:"76",width:"13",height:"8",fill:a.accent}):null,"chomp"===c?(0,b.jsx)("rect",{x:"72",y:"56",width:"22",height:"16",fill:a.highlight}):null,"ghost"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"28",y:"91",width:"12",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"52",y:"91",width:"12",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"76",y:"91",width:"12",height:"8",fill:a.bodyLight})]}):null,"drum"===c?(0,b.jsx)("rect",{x:"31",y:"55",width:"66",height:"8",fill:a.accessory}):null,"mecha"===c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"41",y:"35",width:"45",height:"6",fill:a.accent}),(0,b.jsx)("rect",{x:"57",y:"58",width:"14",height:"9",fill:a.accessory})]}):null,a.cheek?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("rect",{x:"36",y:"58",width:"8",height:"7",fill:a.cheek}),(0,b.jsx)("rect",{x:"86",y:"58",width:"8",height:"7",fill:a.cheek})]}):null]})}function p({preset:a,activityId:d,animated:e=!1,reacting:f=!1,shaken:g=!1,fainted:h=!1,eyeOffset:i}){return"monster"!==(a.shape??"monster")?(0,b.jsx)("g",{className:e?"cloud-code-monster-pet-character":void 0,children:(0,b.jsx)(c.Suspense,{fallback:null,children:(0,b.jsx)(l,{activityId:d,preset:a,reacting:f,shaken:g,fainted:h,eyeOffset:i})})}):(0,b.jsxs)("g",{className:e?"cloud-code-monster-pet-character":void 0,children:[(0,b.jsx)(n,{preset:a}),(0,b.jsx)("rect",{x:"32",y:"22",width:"64",height:"12",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"24",y:"34",width:"80",height:"17",fill:a.bodyTop}),(0,b.jsx)("rect",{x:"16",y:"51",width:"12",height:"24",fill:a.body}),(0,b.jsx)("rect",{x:"24",y:"51",width:"80",height:"41",fill:a.body}),(0,b.jsx)("rect",{x:"100",y:"51",width:"12",height:"24",fill:a.body}),(0,b.jsx)("rect",{x:"16",y:"63",width:"12",height:"12",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"30",y:"86",width:"68",height:"10",fill:a.bodyDark}),(0,b.jsx)("rect",{x:"34",y:"34",width:"60",height:"6",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"24",y:"51",width:"9",height:"35",fill:a.bodySideLight}),(0,b.jsx)("rect",{x:"95",y:"51",width:"9",height:"35",fill:a.bodySideDark}),(0,b.jsx)(o,{preset:a}),(0,b.jsx)(m,{activityId:d,preset:a,reacting:f,shaken:g,fainted:h,eyeOffset:i}),(0,b.jsx)("rect",{x:"36",y:"69",width:"8",height:"8",fill:a.bodyLight}),(0,b.jsx)("rect",{x:"84",y:"69",width:"8",height:"8",fill:a.bodySideDark}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-left-foot",x:"29",y:"96",width:"12",height:"22",fill:a.body}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-left-foot",x:"52",y:"96",width:"12",height:"22",fill:a.body}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-right-foot",x:"76",y:"96",width:"12",height:"22",fill:a.bodyDark}),(0,b.jsx)("rect",{className:"cloud-code-monster-pet-right-foot",x:"96",y:"96",width:"12",height:"22",fill:a.bodyDark})]})}function q({preset:a,className:c}){return(0,b.jsxs)("svg",{className:c,viewBox:"0 0 128 128",role:"img","aria-label":`${a.name} pixel PET preset`,shapeRendering:"crispEdges",children:[(0,b.jsx)("rect",{x:"31",y:"116",width:"66",height:"5",fill:"rgba(45,40,36,.12)"}),(0,b.jsx)("rect",{x:"40",y:"121",width:"48",height:"3",fill:"rgba(45,40,36,.07)"}),(0,b.jsx)(p,{preset:a,activityId:null})]})}var r=a.i(76592),s=a.i(973111),t=a.i(272818),u=a.i(75118);a.s(["PetTab",0,function(){let[a,g]=(0,c.useState)(!1),[k,l]=(0,c.useState)(h[0].id),m=i(k);return(0,c.useEffect)(()=>{g((0,t.readHomePetSettings)().enabled),l(j());let a=a=>{let b=a.detail?.presetId;l(b?i(b).id:j())};return window.addEventListener(f,a),()=>{window.removeEventListener(f,a)}},[]),(0,b.jsxs)("div",{className:"space-y-8",children:[(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)("h2",{className:"text-sm font-medium",children:"Pet"}),(0,b.jsx)("div",{className:"space-y-4",children:(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(r.Label,{htmlFor:"pet-enabled",className:"text-sm",children:"Enable pet"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Off by default. Turn it on when you want the workspace companion."})]}),(0,b.jsx)(s.Switch,{id:"pet-enabled",checked:a,onCheckedChange:a=>{g(a),(0,t.writeHomePetSettings)({enabled:a})}})]})})]}),a?(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-sm font-medium",children:"Preset"}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:m.name})]}),(0,b.jsx)("div",{className:"grid size-14 place-items-center rounded-md bg-card ring-1 ring-border/60",children:(0,b.jsx)(q,{preset:m,className:"size-11"})})]}),(0,b.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:h.map(a=>{let c=a.id===m.id;return(0,b.jsxs)("button",{type:"button","aria-pressed":c,onClick:()=>{l(function(a){let b=i(a);if("u">typeof localStorage)try{localStorage.setItem(e,b.id)}catch{}return b.id}(a.id))},className:(0,u.cn)("group grid h-28 min-w-0 grid-rows-[1fr_auto] rounded-md border bg-card/60 p-2 text-left transition-all hover:border-foreground/20 hover:bg-accent/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70",c?"border-primary/50 bg-accent text-foreground":"border-border/50 text-muted-foreground"),children:[(0,b.jsx)("div",{className:"grid place-items-center rounded bg-background/70 ring-1 ring-border/35",children:(0,b.jsx)(q,{preset:a,className:"size-14 transition-transform duration-200 group-hover:scale-105"})}),(0,b.jsxs)("div",{className:"mt-1.5 flex min-w-0 items-center justify-between gap-1 text-[10px] leading-none",children:[(0,b.jsx)("span",{className:"truncate font-medium text-foreground",children:a.name}),c?(0,b.jsx)(d,{className:"size-3 shrink-0 text-primary"}):(0,b.jsx)("span",{className:"shrink-0 text-muted-foreground",children:a.id.replace("pet-","#")})]})]},a.id)})})]}):null]})}],390946)},617168,a=>{"use strict";var b=a.i(616612),c=a.i(734803),d=a.i(752792),e=a.i(506180),f=a.i(25668),g=a.i(588339),h=a.i(439882),i=a.i(464830),j=a.i(410732);let k=(0,j.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var l=a.i(551798),m=a.i(554705);let n=(0,j.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var o=a.i(515837);let p=(0,j.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function q({icon:a,label:c,value:d,sub:e}){return(0,b.jsx)(h.Card,{size:"sm",children:(0,b.jsxs)(h.CardContent,{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,b.jsx)(a,{className:"size-4"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,b.jsx)("p",{className:"text-2xl font-semibold leading-none tracking-tight",children:d}),e&&(0,b.jsx)(i.Badge,{variant:"secondary",className:"text-[10px] px-1.5 h-4 font-normal",children:e})]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground truncate",children:c})]})]})})}function r({agents:a,runtimes:c,activeTaskCounts:d,overview:e}){let f=new Map;for(let a of c){let b=a.daemon_id??a.id;f.set(b,f.get(b)||"online"===a.status)}let g=f.size,h=[...f.values()].filter(Boolean).length,i=Object.values(d).reduce((a,b)=>a+b,0),j=a.filter(a=>{let b=c.find(b=>b.id===a.runtime_id);return b?.status==="online"}).length;return(0,b.jsxs)("div",{className:"grid gap-3 grid-cols-2 sm:grid-cols-3 lg:grid-cols-6",children:[(0,b.jsx)(q,{icon:o.Monitor,label:"Machines",value:`${h}/${g}`,sub:"online"}),(0,b.jsx)(q,{icon:k,label:"Agents",value:a.length,sub:`${j} online`}),(0,b.jsx)(q,{icon:n,label:"Members",value:e.members.length,sub:e.pending_invites>0?`${e.pending_invites} pending`:void 0}),(0,b.jsx)(q,{icon:p,label:"Active Tasks",value:i,sub:e.task_stats.queued>0?`${e.task_stats.queued} queued`:void 0}),(0,b.jsx)(q,{icon:m.Send,label:"Emails Sent",value:e.email_stats.outbound,sub:`${e.email_stats.unread} unread`}),(0,b.jsx)(q,{icon:l.Mail,label:"Custom Emails",value:e.email_accounts.length})]})}function s({overview:a}){let{completed:c,failed:d,cancelled:e,queued:f,stale:g}=a.task_stats,i=c+d,j=i>0?(d/i*100).toFixed(1):"0";return(0,b.jsxs)(h.Card,{children:[(0,b.jsx)(h.CardHeader,{children:(0,b.jsx)(h.CardTitle,{children:"Task Health (Today)"})}),(0,b.jsx)(h.CardContent,{children:(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsx)(t,{label:"Completed",value:c}),(0,b.jsx)(t,{label:"Failed",value:d,className:d>0?"text-destructive":void 0}),(0,b.jsx)(t,{label:"Cancelled",value:e}),(0,b.jsx)(t,{label:"Failure Rate",value:`${j}%`,className:Number(j)>10?"text-destructive":void 0}),(0,b.jsx)(t,{label:"Queue Backlog",value:f,className:f>10?"text-amber-500":void 0}),(0,b.jsx)(t,{label:"Stale Tasks",value:g,className:g>0?"text-destructive":void 0})]})})]})}function t({label:a,value:c,className:d}){return(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:`text-xl font-semibold ${d??""}`,children:c}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a})]})}var u=a.i(525132);function v({overview:a,agents:c}){let{inbound:d,outbound:e,unread:f,rejected:g}=a.email_stats,i=new Map(c.map(a=>[a.id,a.name]));return(0,b.jsxs)(h.Card,{children:[(0,b.jsx)(h.CardHeader,{children:(0,b.jsx)(h.CardTitle,{children:"Email Summary"})}),(0,b.jsxs)(h.CardContent,{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-xl font-semibold",children:d}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Received"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-xl font-semibold",children:e}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Sent"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:`text-xl font-semibold ${f>0?"text-primary":""}`,children:f}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Unread"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:`text-xl font-semibold ${g>0?"text-amber-500":""}`,children:g}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Untrust"})]})]}),a.email_accounts.length>0&&(0,b.jsxs)("div",{className:"space-y-2 pt-2 border-t border-border/50",children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Custom Mailboxes"}),a.email_accounts.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)("span",{className:`size-1.5 shrink-0 rounded-full ${"active"===a.status?"bg-emerald-500":"bg-destructive"}`})}),(0,b.jsx)(u.TooltipContent,{side:"top",children:"active"===a.status?"Active":`Error: ${a.error_message||"inactive"}`})]}),(0,b.jsx)("span",{className:"truncate",children:a.email_address})]}),(0,b.jsx)("span",{className:"text-muted-foreground shrink-0",children:i.get(a.agent_id)??"—"})]},a.id))]})]})]})}var w=a.i(630991),x=a.i(919690);function y({runtimes:a,agents:c}){let d=(0,w.useRouter)(),{slug:f}=(0,e.useWorkspace)(),g=new Map;for(let b of a){let a=b.daemon_id??b.id;g.has(a)||g.set(a,{runtimes:[],deviceInfo:b.device_info??""}),g.get(a).runtimes.push(b)}let j=[...g.entries()];return 0===j.length?(0,b.jsxs)(h.Card,{children:[(0,b.jsxs)(h.CardHeader,{children:[(0,b.jsx)(h.CardTitle,{children:"Machines"}),(0,b.jsx)(h.CardAction,{children:(0,b.jsx)("button",{type:"button",onClick:()=>d.push(`/w/${f}/runtimes`),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:(0,b.jsx)(x.ArrowUpRight,{className:"size-4"})})})]}),(0,b.jsx)(h.CardContent,{children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"No machines connected."})})]}):(0,b.jsxs)(h.Card,{children:[(0,b.jsx)(h.CardHeader,{children:(0,b.jsx)(h.CardTitle,{children:"Machines"})}),(0,b.jsx)(h.CardContent,{className:"space-y-3",children:j.map(([a,d])=>{let e=d.runtimes.some(a=>"online"===a.status),f=d.runtimes.map(a=>a.last_seen_at).filter(Boolean).sort().reverse()[0],g=c.filter(a=>d.runtimes.some(b=>b.id===a.runtime_id)),h=d.runtimes.some(a=>a.pending_update_version),j=d.runtimes.find(a=>a.pending_update_version)?.pending_update_version;return(0,b.jsxs)("div",{className:"flex items-start gap-3 text-xs",children:[(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)("span",{className:`mt-1 size-2 shrink-0 rounded-full ${e?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,b.jsx)(u.TooltipContent,{side:"top",children:e?"Online":"Offline"})]}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"font-medium truncate",children:d.deviceInfo||a.slice(0,12)}),h&&(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{render:(0,b.jsx)("span",{children:(0,b.jsx)(i.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0 text-amber-500 border-amber-500/30",children:"update"})})}),(0,b.jsxs)(u.TooltipContent,{side:"top",children:["Pending update to v",j]})]})]}),(0,b.jsxs)("div",{className:"text-muted-foreground mt-0.5",children:[g.length>0?g.map(a=>a.name).join(", "):"No agents"," · ",function(a){if(!a)return"never";let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return`${b}s ago`;let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}(f??null)]})]})]},a)})})]})}function z({overview:a}){let c=(0,w.useRouter)(),{slug:d}=(0,e.useWorkspace)(),{members:f,pending_invites:g}=a;return(0,b.jsxs)(h.Card,{children:[(0,b.jsxs)(h.CardHeader,{children:[(0,b.jsx)(h.CardAction,{children:(0,b.jsx)("button",{type:"button",onClick:()=>c.push(`/w/${d}/settings`),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:(0,b.jsx)(x.ArrowUpRight,{className:"size-4"})})}),(0,b.jsxs)(h.CardTitle,{children:["Team",g>0&&(0,b.jsxs)("span",{className:"ml-2 text-xs text-muted-foreground font-normal",children:["(",g," pending invite",g>1?"s":"",")"]})]})]}),(0,b.jsx)(h.CardContent,{className:"p-0",children:(0,b.jsx)("div",{className:"divide-y divide-border/50",children:[...f].sort((a,b)=>"owner"===a.role?-1:+("owner"===b.role)).map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[a.image?(0,b.jsx)("img",{src:a.image,alt:a.name,className:"size-7 rounded-full shrink-0"}):(0,b.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-secondary text-xs font-medium",children:(a.name||a.email).charAt(0).toUpperCase()}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("span",{className:"text-sm font-medium truncate block",children:a.name||a.email}),a.name&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground truncate block",children:a.email})]}),(0,b.jsx)(i.Badge,{variant:"owner"===a.role?"default":"secondary",className:"text-[10px] px-1.5 py-0 shrink-0",children:a.role})]},a.id))})})]})}a.s(["UsagesTab",0,function(){let{agents:a,runtimes:h,loading:i,activeTaskCounts:j}=(0,d.useAgentContext)(),{workspaceId:k}=(0,e.useWorkspace)(),[l,m]=(0,c.useState)(null),[n,o]=(0,c.useState)(!1);return((0,c.useEffect)(()=>{if(i)return;let a=!1;return o(!0),(0,g.getWorkspaceOverview)(k).then(b=>{a||m(b)}).catch(()=>{}).finally(()=>{a||o(!1)}),()=>{a=!0}},[i,k]),n||!l)?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(f.Skeleton,{className:"h-44 rounded-xl"}),(0,b.jsx)(f.Skeleton,{className:"h-44 rounded-xl"}),(0,b.jsx)(f.Skeleton,{className:"h-44 rounded-xl"}),(0,b.jsx)(f.Skeleton,{className:"h-44 rounded-xl"})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(r,{agents:a,runtimes:h,activeTaskCounts:j,overview:l}),(0,b.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,b.jsx)(s,{overview:l}),(0,b.jsx)(v,{overview:l,agents:a})]}),(0,b.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,b.jsx)(y,{runtimes:h,agents:a}),(0,b.jsx)(z,{overview:l})]})]})}],617168)},294526,a=>a.a(async(b,c)=>{try{var d=a.i(616612),e=a.i(734803),f=a.i(654461),g=a.i(75118),h=a.i(597047),i=a.i(53909),j=a.i(616131),k=a.i(93590),l=a.i(390946),m=a.i(617168),n=b([h,j]);[h,j]=n.then?(await n)():n;let o=[{id:"general",label:"General"},{id:"pet",label:"Pet"},{id:"instruction",label:"Global Instruction"},{id:"notifications",label:"Notifications"},{id:"members",label:"Members"},{id:"usages",label:"Usages"}];a.s(["default",0,function(){let[a,b]=(0,e.useState)("general");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"flex items-center justify-between border-b border-border/50 px-3 md:px-5 py-2.5 gap-3",children:(0,d.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,d.jsx)("h1",{className:"text-sm font-medium",children:"Settings"})})}),(0,d.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,d.jsxs)("nav",{className:"w-48 shrink-0 border-r border-border/50 py-3 px-2 hidden md:flex md:flex-col",children:[(0,d.jsx)("div",{className:"flex-1",children:o.map(c=>(0,d.jsx)("button",{onClick:()=>b(c.id),className:(0,g.cn)("w-full rounded-md px-2.5 py-1.5 text-left text-sm transition-colors",a===c.id?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:c.label},c.id))}),(0,d.jsxs)("div",{className:"px-2.5 pt-3 border-t border-border/50 text-[11px] text-muted-foreground/60",children:["v","0.0.140"]})]}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,d.jsx)("div",{className:"px-4 pt-2 md:hidden",children:(0,d.jsx)(f.Tabs,{className:"items-center",value:a,onValueChange:a=>b(a),children:(0,d.jsx)(f.TabsList,{className:"h-auto gap-1",children:o.map(a=>(0,d.jsx)(f.TabsTrigger,{value:a.id,children:a.label},a.id))})})}),(0,d.jsx)("div",{className:(0,g.cn)("flex-1 overflow-y-auto thin-scrollbar","instruction"!==a&&"px-5 py-5"),children:"instruction"===a?(0,d.jsx)(i.InstructionTab,{}):"usages"===a?(0,d.jsx)(m.UsagesTab,{}):(0,d.jsxs)("div",{className:"mx-auto max-w-md",children:["general"===a&&(0,d.jsx)(h.GeneralTab,{}),"pet"===a&&(0,d.jsx)(l.PetTab,{}),"notifications"===a&&(0,d.jsx)(k.NotificationTab,{}),"members"===a&&(0,d.jsx)(j.MembersTab,{})]})}),(0,d.jsxs)("div",{className:"px-4 py-2 text-[11px] text-muted-foreground/60 md:hidden",children:["v","0.0.140"]})]})]})]})}]),c()}catch(a){c(a)}},!1)];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_0qgcnj5._.js.map
|