hackagent-webui 0.6.4.dev71__py3-none-any.whl → 0.6.6.dev73__py3-none-any.whl

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.
Files changed (64) hide show
  1. hackagent_webui/__init__.py +1 -1
  2. hackagent_webui/static/404.html +2 -2
  3. hackagent_webui/static/VERSION +1 -1
  4. hackagent_webui/static/_next/static/chunks/323-48aec32488b6e5bf.js +1 -0
  5. hackagent_webui/static/_next/static/chunks/328-d42d52b81db94a35.js +1 -0
  6. hackagent_webui/static/_next/static/chunks/{921-92a9ab4120f81d51.js → 356-90f2ee305a89f642.js} +1 -1
  7. hackagent_webui/static/_next/static/chunks/{658-451b7f3b5c5a1599.js → 432-da1349ca9d0dbf5d.js} +5 -5
  8. hackagent_webui/static/_next/static/chunks/{493-34228dd02f768bba.js → 493-92a293a4bf432fc7.js} +1 -1
  9. hackagent_webui/static/_next/static/chunks/495-ac70d412256bbfe9.js +1 -0
  10. hackagent_webui/static/_next/static/chunks/546-64c7e818ab4dd2e7.js +1 -0
  11. hackagent_webui/static/_next/static/chunks/666-5ee4182c3065fd65.js +1 -0
  12. hackagent_webui/static/_next/static/chunks/683-ab457b94ca148f0e.js +1 -0
  13. hackagent_webui/static/_next/static/chunks/924-c5a440689b66a79a.js +1 -0
  14. hackagent_webui/static/_next/static/chunks/97-393ae9eee3ee20ab.js +1 -0
  15. hackagent_webui/static/_next/static/chunks/980-cc9c16cc6103edbb.js +1 -0
  16. hackagent_webui/static/_next/static/chunks/app/agents/{page-ba01b144c3c0191e.js → page-e8929149bce2396f.js} +1 -1
  17. hackagent_webui/static/_next/static/chunks/app/attacks/page-4594b3d8af3cef5c.js +1 -0
  18. hackagent_webui/static/_next/static/chunks/app/credentials/{page-ccb3279e96173cae.js → page-170ae86afa1516f9.js} +1 -1
  19. hackagent_webui/static/_next/static/chunks/app/{layout-ae76166da96be97b.js → layout-48e91819323a0ba7.js} +1 -1
  20. hackagent_webui/static/_next/static/chunks/app/page-92fb04233e8db6e2.js +1 -0
  21. hackagent_webui/static/_next/static/chunks/app/profile/{page-8d833eda8e73fb92.js → page-24382ac8cf6b7519.js} +1 -1
  22. hackagent_webui/static/_next/static/chunks/app/stats/page-742d6876a3e207d9.js +1 -0
  23. hackagent_webui/static/_next/static/chunks/{main-b2abf26ddb8313ad.js → main-c5ae269c07d252e7.js} +1 -1
  24. hackagent_webui/static/_next/static/css/920420339ac947aa.css +1 -0
  25. hackagent_webui/static/agents.html +2 -2
  26. hackagent_webui/static/agents.txt +6 -6
  27. hackagent_webui/static/api-keys.html +2 -2
  28. hackagent_webui/static/api-keys.txt +5 -5
  29. hackagent_webui/static/attacks.html +2 -2
  30. hackagent_webui/static/attacks.txt +6 -6
  31. hackagent_webui/static/campaign-export/runtime.js +96 -128
  32. hackagent_webui/static/campaign-export/styles.css +1 -1
  33. hackagent_webui/static/credentials.html +2 -2
  34. hackagent_webui/static/credentials.txt +6 -6
  35. hackagent_webui/static/index.html +2 -2
  36. hackagent_webui/static/index.txt +6 -6
  37. hackagent_webui/static/profile.html +2 -2
  38. hackagent_webui/static/profile.txt +6 -6
  39. hackagent_webui/static/secrets.html +2 -2
  40. hackagent_webui/static/secrets.txt +5 -5
  41. hackagent_webui/static/stats.html +2 -2
  42. hackagent_webui/static/stats.txt +6 -6
  43. hackagent_webui/static/usage.html +2 -2
  44. hackagent_webui/static/usage.txt +6 -6
  45. {hackagent_webui-0.6.4.dev71.dist-info → hackagent_webui-0.6.6.dev73.dist-info}/METADATA +1 -1
  46. hackagent_webui-0.6.6.dev73.dist-info/RECORD +82 -0
  47. hackagent_webui/static/_next/static/chunks/160-21f7abf9e76923d9.js +0 -1
  48. hackagent_webui/static/_next/static/chunks/452-33805ea7d3b33b29.js +0 -1
  49. hackagent_webui/static/_next/static/chunks/592-cb13179874c3bab1.js +0 -1
  50. hackagent_webui/static/_next/static/chunks/634-ef141668e76853c1.js +0 -1
  51. hackagent_webui/static/_next/static/chunks/688-74942a135eec7c34.js +0 -1
  52. hackagent_webui/static/_next/static/chunks/747-aa8aa91116de6e71.js +0 -1
  53. hackagent_webui/static/_next/static/chunks/764-b642e364454b2ac4.js +0 -1
  54. hackagent_webui/static/_next/static/chunks/888-2e968371d359a872.js +0 -1
  55. hackagent_webui/static/_next/static/chunks/924-926086aa93c839d8.js +0 -1
  56. hackagent_webui/static/_next/static/chunks/970-bc5945a148c7d8b8.js +0 -1
  57. hackagent_webui/static/_next/static/chunks/app/attacks/page-f2852f796ad98f7a.js +0 -1
  58. hackagent_webui/static/_next/static/chunks/app/page-40fdbb3c458241bf.js +0 -1
  59. hackagent_webui/static/_next/static/chunks/app/stats/page-9cc34ee4b1a8895d.js +0 -1
  60. hackagent_webui/static/_next/static/css/acc5ec9d7fb72178.css +0 -1
  61. hackagent_webui-0.6.4.dev71.dist-info/RECORD +0 -83
  62. /hackagent_webui/static/_next/static/{7av25iIXZJ4ESHYoziC9t → BB2pDANDGPKWiJdI-62Hn}/_buildManifest.js +0 -0
  63. /hackagent_webui/static/_next/static/{7av25iIXZJ4ESHYoziC9t → BB2pDANDGPKWiJdI-62Hn}/_ssgManifest.js +0 -0
  64. {hackagent_webui-0.6.4.dev71.dist-info → hackagent_webui-0.6.6.dev73.dist-info}/WHEEL +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{6259:(e,t,a)=>{"use strict";a.d(t,{SQ:()=>o,_2:()=>c,mB:()=>d,rI:()=>s,ty:()=>l});var n=a(95155);a(12115);var r=a(24595),i=a(64269);function s(e){let{...t}=e;return(0,n.jsx)(r.bL,{"data-slot":"dropdown-menu",...t})}function l(e){let{...t}=e;return(0,n.jsx)(r.l9,{"data-slot":"dropdown-menu-trigger",...t})}function o(e){let{className:t,sideOffset:a=4,...s}=e;return(0,n.jsx)(r.ZL,{children:(0,n.jsx)(r.UC,{"data-slot":"dropdown-menu-content",sideOffset:a,className:(0,i.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...s})})}function c(e){let{className:t,inset:a,variant:s="default",...l}=e;return(0,n.jsx)(r.q7,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":s,className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...l})}function d(e){let{className:t,...a}=e;return(0,n.jsx)(r.wv,{"data-slot":"dropdown-menu-separator",className:(0,i.cn)("bg-border -mx-1 my-1 h-px",t),...a})}},24323:(e,t,a)=>{"use strict";a.d(t,{P:()=>g,T:()=>f});var n=a(95155),r=a(12115),i=a(52619),s=a.n(i),l=a(68321),o=a(76784),c=a(7831),d=a(41444),u=a(3998),h=a(51834);let m=(0,d.h)("AnalyticsConsent");async function f(e){await c.userApi.userMeUpdate({userProfileRequest:{analyticsConsent:e}})}function g(){let[e,t]=(0,r.useState)(null),a=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=!1;return c.userApi.userMeRetrieve().then(a=>{var n;e||t(null!=(n=a.analyticsConsent)?n:"unset")}).catch(e=>{m.debug({err:e},"Could not load analytics consent (not authenticated yet?)")}),()=>{e=!0}},[]);let i=async e=>{a.current=!0,t(e);try{await f(e)}catch(e){m.error({err:e},"Failed to save analytics consent")}};return(0,n.jsxs)(n.Fragment,{children:["accepted"===e&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.GoogleAnalytics,{gaId:"G-2P6K2HWVEE"}),(0,n.jsx)(l.default,{id:"microsoft-clarity",strategy:"afterInteractive",children:'(function(c,l,a,r,i,t,y){\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\n t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\n })(window, document, "clarity", "script", "xowemo04qg");'})]}),(0,n.jsx)(h.lG,{open:"unset"===e,onOpenChange:e=>{e||a.current||i("declined")},children:(0,n.jsxs)(h.Cf,{children:[(0,n.jsxs)(h.c7,{children:[(0,n.jsx)(h.L3,{children:"Help us improve HackAgent"}),(0,n.jsxs)(h.rr,{children:["We'd like to use optional analytics to understand how HackAgent is used. This is separate from the cookies that keep you signed in, and you can change it anytime in Settings. See our"," ",(0,n.jsx)(s(),{href:"https://hackagent.dev/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Privacy Policy"}),"."]})]}),(0,n.jsxs)(h.Es,{children:[(0,n.jsx)(u.$,{variant:"outline",onClick:()=>i("declined"),children:"Not now"}),(0,n.jsx)(u.$,{onClick:()=>i("accepted"),children:"Sounds good"})]})]})})]})}},24394:()=>{},25164:(e,t,a)=>{"use strict";a.d(t,{W:()=>r});let n="0.6.4-stage",r=/^\d/.test(n)?"v".concat(n):n},34105:(e,t,a)=>{"use strict";a.d(t,{c:()=>n});let n=(0,a(12115).createContext)(void 0)},34720:(e,t,a)=>{Promise.resolve().then(a.bind(a,96042)),Promise.resolve().then(a.bind(a,49359)),Promise.resolve().then(a.bind(a,96280)),Promise.resolve().then(a.t.bind(a,93836,23))},46767:(e,t,a)=>{"use strict";a.d(t,{Bc:()=>s,ZI:()=>c,k$:()=>o,m_:()=>l});var n=a(95155);a(12115);var r=a(53583),i=a(64269);function s(e){let{delayDuration:t=0,...a}=e;return(0,n.jsx)(r.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function l(e){let{...t}=e;return(0,n.jsx)(s,{children:(0,n.jsx)(r.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,n.jsx)(r.l9,{"data-slot":"tooltip-trigger",...t})}function c(e){let{className:t,sideOffset:a=0,children:s,...l}=e;return(0,n.jsx)(r.ZL,{children:(0,n.jsxs)(r.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,i.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...l,children:[s,(0,n.jsx)(r.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},49359:(e,t,a)=>{"use strict";a.d(t,{Authorization:()=>N});var n=a(95155),r=a(67176),i=a(20063),s=a(12115),l=a(34105),o=a(7831),c=a(41444);let d=(0,c.h)("Auth0Adapter");function u(e){let{children:t}=e,{getAccessTokenSilently:i,isAuthenticated:c,isLoading:u,loginWithRedirect:h,logout:m,user:f}=(0,r.WB)(),[g,x]=(0,s.useState)(!1),p=(0,s.useRef)(!1),v=(0,s.useCallback)(async()=>{let e=await i()||"";return(0,o.ki)(e),e},[i]);(0,s.useEffect)(()=>{let e;if(u)return;let t=!1;if(!c){(0,o.ki)(null),x(!0),p.current=!1;return}let n=async()=>{try{if(await v(),!p.current){p.current=!0;let{userApi:e}=await Promise.resolve().then(a.bind(a,7831));e.userMeRetrieve().catch(()=>d.debug("User profile synchronization deferred"))}}catch(e){d.error({err:e},"Unable to obtain Auth0 access token"),(0,o.ki)(null)}finally{t||x(!0)}};return n(),e=setInterval(()=>void n(),6e5),()=>{t=!0,e&&clearInterval(e)}},[c,u,v]);let y=(0,s.useCallback)(async()=>{await h({appState:{returnTo:"/"}})},[h]),k=(0,s.useCallback)(async()=>{(0,o.ki)(null),await m({logoutParams:{returnTo:window.location.origin}})},[m]),j=(0,s.useMemo)(()=>({provider:"auth0",user:f,isAuthenticated:c,isLoading:u||c&&!g,login:y,logout:k,getAccessTokenSilently:v}),[f,c,u,g,y,k,v]);return(0,n.jsx)(l.c.Provider,{value:j,children:t})}function h(e){let{config:t,children:a}=e,l=(0,i.useRouter)(),o=(0,s.useCallback)(e=>{l.push((null==e?void 0:e.returnTo)||"/")},[l]);if(!t.auth0Domain||!t.auth0ClientId||!t.auth0Audience)return(0,n.jsx)(m,{provider:"Auth0"});let c=t.auth0RedirectUri||window.location.origin;return(0,n.jsx)(r.y2,{domain:t.auth0Domain,clientId:t.auth0ClientId,authorizationParams:{redirect_uri:c,audience:t.auth0Audience,scope:"openid profile email"},onRedirectCallback:o,cacheLocation:"localstorage",children:(0,n.jsx)(u,{children:a})})}function m(e){let{provider:t}=e;return(0,n.jsx)("div",{role:"alert",className:"flex min-h-screen items-center justify-center p-6 text-center",children:(0,n.jsxs)("p",{children:[t," authentication is selected but its runtime configuration is incomplete."]})})}var f=a(67062);let g=async()=>"mock-dev-token";function x(e){let{children:t}=e,[a,r]=(0,s.useState)(!1);(0,s.useEffect)(()=>((0,o.ki)("mock-dev-token"),r(!0),()=>(0,o.ki)(null)),[]);let i=(0,s.useMemo)(()=>({provider:"disabled",user:(0,f.Y)(),isAuthenticated:!0,isLoading:!a,login:void 0,logout:void 0,getAccessTokenSilently:g}),[a]);return(0,n.jsx)(l.c.Provider,{value:i,children:t})}var p=a(5313);let v=(0,c.h)("KeycloakAdapter"),y=async()=>"",k={provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:y},j=new Map;function b(e){let{config:t,children:r}=e,[i,c]=(0,s.useState)(k);return((0,s.useEffect)(()=>{let e;if(!t.keycloakRealmUrl||!t.keycloakClientId)return;let n=new URL(t.keycloakRealmUrl),r="/realms/",i=n.pathname.indexOf(r),s=function(e,t,a){let n="".concat(e,"|").concat(t,"|").concat(a),r=j.get(n);if(!r){let i=new p.A({url:e,realm:t,clientId:a});r={keycloak:i,authenticated:i.init({onLoad:"login-required",silentCheckSsoRedirectUri:"".concat(window.location.origin,"/silent-check-sso.html"),pkceMethod:"S256"})},j.set(n,r)}return r}(i>=0?"".concat(n.origin).concat(n.pathname.slice(0,i)):n.origin,i>=0?n.pathname.slice(i+r.length).split("/")[0]:n.pathname.split("/").filter(Boolean).at(-1)||"hackagent",t.keycloakClientId),{keycloak:l}=s,d=!1,u=async()=>{await l.updateToken(60);let e=l.token||"";return(0,o.ki)(e||null),e};return(async()=>{try{var t,n,r,i,h;let m=await s.authenticated;if(d)return;if(!m){(0,o.ki)(null),c({provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!1,login:async()=>{await l.login()},logout:void 0,getAccessTokenSilently:y});return}let f={sub:l.subject,email:null==(t=l.tokenParsed)?void 0:t.email,name:null==(n=l.tokenParsed)?void 0:n.name,given_name:null==(r=l.tokenParsed)?void 0:r.given_name,family_name:null==(i=l.tokenParsed)?void 0:i.family_name,preferred_username:null==(h=l.tokenParsed)?void 0:h.preferred_username};await u();let{userApi:g}=await Promise.resolve().then(a.bind(a,7831));g.userMeRetrieve().catch(()=>v.debug("User profile synchronization deferred")),c({provider:"keycloak",user:f,isAuthenticated:!0,isLoading:!1,login:async()=>{await l.login()},logout:async()=>{(0,o.ki)(null),await l.logout({redirectUri:window.location.origin})},getAccessTokenSilently:u}),e=setInterval(()=>{u().catch(e=>v.error({err:e},"Unable to refresh Keycloak access token"))},3e4)}catch(e){v.error({err:e},"Keycloak initialization failed"),(0,o.ki)(null),d||c({...k,isLoading:!1})}})(),()=>{d=!0,e&&clearInterval(e),(0,o.ki)(null)}},[t.keycloakClientId,t.keycloakRealmUrl]),t.keycloakRealmUrl&&t.keycloakClientId)?(0,n.jsx)(l.c.Provider,{value:i,children:r}):(0,n.jsx)("div",{role:"alert",className:"flex min-h-screen items-center justify-center p-6 text-center",children:(0,n.jsx)("p",{children:"Keycloak authentication is selected but its runtime configuration is incomplete."})})}var w=a(97145);function N(e){let{children:t}=e,{config:a,isLoading:r}=(0,w.y)();if(r)return null;switch(a.authProvider){case"auth0":return(0,n.jsx)(h,{config:a,children:t});case"keycloak":return(0,n.jsx)(b,{config:a,children:t});case"disabled":return(0,n.jsx)(x,{children:t})}}},51834:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>u,Es:()=>m,HM:()=>c,L3:()=>f,c7:()=>h,lG:()=>l,rr:()=>g});var n=a(95155);a(12115);var r=a(88292),i=a(65229),s=a(64269);function l(e){let{...t}=e;return(0,n.jsx)(r.bL,{"data-slot":"dialog",...t})}function o(e){let{...t}=e;return(0,n.jsx)(r.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{...t}=e;return(0,n.jsx)(r.bm,{"data-slot":"dialog-close",...t})}function d(e){let{className:t,...a}=e;return(0,n.jsx)(r.hJ,{"data-slot":"dialog-overlay",className:(0,s.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function u(e){let{className:t,children:a,...l}=e;return(0,n.jsxs)(o,{"data-slot":"dialog-portal",children:[(0,n.jsx)(d,{}),(0,n.jsxs)(r.UC,{"data-slot":"dialog-content",className:(0,s.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...l,children:[a,(0,n.jsxs)(r.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,n.jsx)(i.A,{}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function h(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"dialog-header",className:(0,s.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function m(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"dialog-footer",className:(0,s.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function f(e){let{className:t,...a}=e;return(0,n.jsx)(r.hE,{"data-slot":"dialog-title",className:(0,s.cn)("text-lg leading-none font-semibold",t),...a})}function g(e){let{className:t,...a}=e;return(0,n.jsx)(r.VY,{"data-slot":"dialog-description",className:(0,s.cn)("text-muted-foreground text-sm",t),...a})}},67062:(e,t,a)=>{"use strict";function n(){return!0}function r(){return{email:"dev@hackagent.local",name:"Dev User",preferred_username:"dev",picture:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><rect fill="%23ccc" width="48" height="48"/><text x="50%25" y="50%25" dominant-baseline="middle" text-anchor="middle" font-family="sans-serif" font-size="24" fill="%23666">D</text></svg>'}}a.d(t,{Y:()=>r,l:()=>n})},73474:(e,t,a)=>{"use strict";a.d(t,{Bc:()=>r,NQ:()=>l,zG:()=>n,wN:()=>s,AZ:()=>m,V$:()=>u,eW:()=>c,of:()=>h,_9:()=>d,f_:()=>o});let n=[{id:"classic-light",label:"Classic Light",mode:"light",description:"Soft neutral grays and a quiet, minimal feel."},{id:"slate-light",label:"Slate Light",mode:"light",description:"Cool slate surfaces with crisp white cards."},{id:"classic-dark",label:"Classic Dark",mode:"dark",description:"The original charcoal and neutral gray palette."},{id:"slate-dark",label:"Slate Dark",mode:"dark",description:"The current deep blue and slate palette."}],r={light:"slate-light",dark:"slate-dark"},i={light:"slate-light",dark:"slate-dark"},s="hackagent-theme",l="(prefers-color-scheme: dark)";function o(e){var t,a;return"light"===e||"dark"===e?i[e]:null!=(a=null==(t=n.find(t=>t.id===e))?void 0:t.id)?a:"system"}function c(e,t){let a="system"===e?r[t]:e;return n.find(e=>e.id===a)}function d(){return window.matchMedia(l).matches?"dark":"light"}function u(){try{return o(localStorage.getItem(s))}catch(e){return"system"}}function h(e){try{localStorage.setItem(s,e)}catch(e){}}function m(e){let t=document.documentElement;t.dataset.theme=e.id,t.classList.toggle("dark","dark"===e.mode),t.style.colorScheme=e.mode}let f=Object.fromEntries(n.map(e=>[e.id,e.mode]));"(() => {\n const modes = ".concat(JSON.stringify(f),";\n const defaults = ").concat(JSON.stringify(r),";\n const legacy = ").concat(JSON.stringify(i),";\n let preference;\n try { preference = localStorage.getItem('").concat(s,"'); } catch {}\n if (preference === 'light' || preference === 'dark') preference = legacy[preference];\n const system = window.matchMedia('").concat(l,"').matches ? 'dark' : 'light';\n const id = Object.prototype.hasOwnProperty.call(modes, preference) ? preference : defaults[system];\n document.documentElement.dataset.theme = id;\n document.documentElement.classList.toggle('dark', modes[id] === 'dark');\n document.documentElement.style.colorScheme = modes[id];\n})();")},80230:(e,t,a)=>{"use strict";a.d(t,{h:()=>s});var n=a(12115),r=a(34105);let i=async()=>"";function s(){let e=(0,n.useContext)(r.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:i}}},86259:(e,t,a)=>{"use strict";a.d(t,{w:()=>s});var n=a(95155);a(12115);var r=a(57268),i=a(64269);function s(e){let{className:t,orientation:a="horizontal",decorative:s=!0,...l}=e;return(0,n.jsx)(r.b,{"data-slot":"separator-root",decorative:s,orientation:a,className:(0,i.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...l})}},91903:()=>{},93836:()=>{},96042:(e,t,a)=>{"use strict";a.d(t,{D:()=>l,ThemeProvider:()=>o});var n=a(95155),r=a(12115),i=a(73474);let s=(0,r.createContext)({theme:"system",resolvedTheme:"light",resolvedStyle:i.Bc.light,setTheme:()=>{}});function l(){return(0,r.useContext)(s)}function o(e){let{children:t}=e,[a,l]=(0,r.useState)({theme:"system",resolvedTheme:"light",resolvedStyle:i.Bc.light}),o=(0,r.useCallback)(e=>{let t=(0,i.eW)(e,(0,i._9)());(0,i.AZ)(t),l({theme:e,resolvedTheme:t.mode,resolvedStyle:t.id})},[]);(0,r.useEffect)(()=>{o((0,i.V$)());let e=e=>{(e.key===i.wN||null===e.key)&&o((0,i.f_)(e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[o]),(0,r.useEffect)(()=>{if("system"!==a.theme)return;let e=window.matchMedia(i.NQ),t=()=>o("system");return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[a.theme,o]);let c=(0,r.useCallback)(e=>{o(e),(0,i.of)(e)},[o]);return(0,n.jsx)(s.Provider,{value:{...a,setTheme:c},children:t})}},96280:(e,t,a)=>{"use strict";a.d(t,{default:()=>$});var n=a(95155),r=a(12115),i=a(52619),s=a.n(i),l=a(80230),o=a(20063),c=a(15239),d=a(3998),u=a(86259),h=a(46591),m=a(64269);function f(e){let{className:t,...a}=e;return(0,n.jsx)(h.bL,{"data-slot":"avatar",className:(0,m.cn)("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...a})}function g(e){let{className:t,...a}=e;return(0,n.jsx)(h._V,{"data-slot":"avatar-image",className:(0,m.cn)("aspect-square size-full",t),...a})}function x(e){let{className:t,...a}=e;return(0,n.jsx)(h.H4,{"data-slot":"avatar-fallback",className:(0,m.cn)("bg-muted flex size-full items-center justify-center rounded-full",t),...a})}var p=a(6259),v=a(46767),y=a(25164);let k=(0,r.createContext)(void 0),j=e=>{let{children:t}=e,[a,i]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=window.matchMedia("(max-width: 1023px)"),t=()=>i(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,n.jsx)(k.Provider,{value:{isCollapsed:a,toggleSidebar:()=>{i(e=>!e)}},children:t})},b=()=>{let e=(0,r.useContext)(k);if(!e)throw Error("useSidebar must be used within a SidebarProvider");return e};var w=a(65993),N=a(78192),C=a(37397),A=a(80534),_=a(55867),E=a(77625),L=a(47937);let U=[{items:[{href:"/",label:"Home",icon:w.A}]},{title:"Evaluation",items:[{href:"/agents",label:"Targets",icon:N.A},{href:"/attacks",label:"Campaigns",icon:C.A},{href:"/stats",label:"Runs",icon:A.A}]},{title:"Workspace",items:[{href:"/credentials",label:"Credentials",icon:_.A},{href:"/usage",label:"Usage",icon:E.A}]}],I=[{href:"https://docs.hackagent.dev",label:"Documentation",icon:L.A,external:!0}];var P=a(77931),S=a(26550),T=a(12108),R=a(15870),z=a(84926);let D=()=>{let{user:e,isLoading:t,isAuthenticated:a,logout:i}=(0,l.h)(),h=(0,o.usePathname)(),{isCollapsed:k,toggleSidebar:j}=b();if(t||!a||!e)return null;let w=e.name||e.preferred_username||e.email||"User",N=(e=>{if(!e||""===e.trim())return"?";if(e.startsWith("0x")&&e.length>10)return e.substring(0,2).toUpperCase();let t=e.split(/[\s.\-_@]+/).filter(e=>e.length>0);return 0===t.length?"?":1===t.length?t[0].substring(0,2).toUpperCase():((t[0][0]||"")+(t[t.length-1][0]||"")).toUpperCase()})(w),C=function(e,t){let a=e.split(/[?#]/)[0].replace(/(.)\/+$/,"$1");return("/secrets"===a||"/api-keys"===a)&&(a="/credentials"),t.filter(e=>{let t;return t=a,"/"===e?"/"===t:t===e||t.startsWith("".concat(e,"/"))}).sort((e,t)=>t.length-e.length)[0]}(h,U.flatMap(e=>e.items.filter(e=>!e.external).map(e=>e.href))),A=e=>{let{href:t,icon:a,label:r,isActive:i}=e;return(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)(s(),{href:t,"aria-label":r,"aria-current":i?"page":void 0,children:(0,n.jsxs)(d.$,{variant:i?"secondary":"ghost",className:(0,m.cn)("w-full",k?"justify-center px-2":"justify-start",i&&"font-semibold"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!k&&"mr-2")}),!k&&r]})})}),k&&(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:r})})]})},_=e=>{let{href:t,icon:a,label:r}=e;return(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)("a",{href:t,"aria-label":r,target:"_blank",rel:"noopener noreferrer",className:"block",children:(0,n.jsxs)(d.$,{variant:"ghost",className:(0,m.cn)("w-full cursor-pointer",k?"justify-center px-2":"justify-start"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!k&&"mr-2")}),!k&&r]})})}),k&&(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:r})})]})};return(0,n.jsx)(v.Bc,{delayDuration:0,children:(0,n.jsxs)("aside",{className:(0,m.cn)("flex h-screen flex-col border-r bg-sidebar p-4 fixed left-0 top-0 transition-all duration-300",k?"w-16":"w-52"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("mb-6 flex",k?"flex-col items-center gap-2 px-0":"flex-row items-center justify-between gap-2 px-2"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("flex items-center gap-2",!k&&"min-w-0 flex-1"),children:[(0,n.jsx)(c.default,{src:"/raccoon.png",alt:"HackAgent Logo",title:k?"HackAgent ".concat(y.W):void 0,width:24,height:24,className:"shrink-0 text-primary"}),!k&&(0,n.jsx)("h3",{className:"min-w-0 truncate font-semibold text-base leading-tight",children:"HackAgent"})]}),(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)(d.$,{variant:"ghost",size:"icon",onClick:j,"aria-label":k?"Expand sidebar":"Collapse sidebar",className:"h-7 w-7 shrink-0",children:k?(0,n.jsx)(P.A,{className:"h-4 w-4"}):(0,n.jsx)(S.A,{className:"h-4 w-4"})})}),(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:k?"Expand sidebar":"Collapse sidebar"})})]})]}),(0,n.jsx)("nav",{"aria-label":"Main navigation",className:(0,m.cn)("min-h-0 flex-1 space-y-4 overflow-y-auto",k?"px-0":"px-2"),children:U.map((e,t)=>{var a;return(0,n.jsxs)(r.Fragment,{children:[t>0&&(0,n.jsx)(u.w,{}),(0,n.jsxs)("div",{className:"space-y-1",children:[e.title&&!k&&(0,n.jsx)("div",{className:"px-2 py-1",children:(0,n.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e.title})}),e.items.map(e=>e.external?(0,n.jsx)(_,{href:e.href,icon:e.icon,label:e.label},e.href):(0,n.jsx)(A,{href:e.href,icon:e.icon,label:e.label,isActive:e.href===C},e.href))]})]},null!=(a=e.title)?a:t)})}),(0,n.jsx)("nav",{"aria-label":"Help",className:(0,m.cn)("space-y-1 pt-4",k?"px-0":"px-2"),children:I.map(e=>(0,n.jsx)(_,{href:e.href,icon:e.icon,label:e.label},e.href))}),(0,n.jsx)(u.w,{className:"my-4"}),e&&(0,n.jsx)("div",{className:"mt-auto",children:(0,n.jsxs)(p.rI,{children:[(0,n.jsx)(p.ty,{asChild:!0,children:(0,n.jsxs)(d.$,{variant:"ghost","aria-label":"".concat(w," Account"),className:(0,m.cn)("w-full p-2 h-auto hover:bg-accent hover:text-accent-foreground",k?"justify-center":"justify-between"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("flex items-center",k?"justify-center":"gap-3"),children:[(0,n.jsxs)(f,{className:"h-8 w-8",children:[e.picture&&(0,n.jsx)(g,{src:e.picture,alt:w}),(0,n.jsx)(x,{children:N})]}),!k&&(0,n.jsxs)("div",{className:"text-sm text-left",children:[(0,n.jsx)("p",{className:"font-medium leading-none truncate max-w-[105px]",children:w}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Account"})]})]}),!k&&(0,n.jsx)(T.A,{className:"h-4 w-4 opacity-50"})]})}),(0,n.jsxs)(p.SQ,{align:"start",className:"w-52 mb-2",side:"top",children:[(0,n.jsx)(p._2,{asChild:!0,children:(0,n.jsxs)(s(),{href:"/profile",className:"cursor-pointer",children:[(0,n.jsx)(R.A,{className:"mr-2 h-4 w-4"}),(0,n.jsx)("span",{children:"Settings"})]})}),(0,n.jsx)(p.mB,{}),i&&(0,n.jsxs)(p._2,{onClick:()=>i(),className:"cursor-pointer text-red-600 focus:text-red-600",children:[(0,n.jsx)(z.A,{className:"mr-2 h-4 w-4"}),(0,n.jsx)("span",{children:"Log Out"})]})]})]})})]})})};var B=a(35299),M=a(24323);let O=(0,a(41444).h)("ClientLayout"),H=e=>{let{children:t}=e,{isCollapsed:a}=b();return(0,n.jsx)("main",{className:"relative flex-1 overflow-y-auto transition-all duration-300 ".concat(a?"ml-16":"ml-52"),children:t})},$=e=>{let{children:t}=e,{isAuthenticated:a,isLoading:i,user:s,provider:o}=(0,l.h)();return((0,r.useEffect)(()=>{O.info("ClientLayout initialized - provider=".concat(o,", isLoading=").concat(i,", isAuthenticated=").concat(a))},[o,i,a]),i)?(O.info("Authentication provider loading, showing spinner"),(0,n.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,n.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,n.jsx)(B.A,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,n.jsx)("p",{className:"text-muted-foreground",children:"Loading Authentication..."})]})})):a?(O.info("User authenticated - provider=".concat(o,", userId=").concat(null==s?void 0:s.sub,", email=").concat(null==s?void 0:s.email)),(0,n.jsxs)(j,{children:[(0,n.jsxs)("div",{className:"flex h-screen overflow-hidden print-layout-root",children:[(0,n.jsx)(D,{}),(0,n.jsx)(H,{children:t})]}),"disabled"!==o&&(0,n.jsx)(M.P,{})]})):(O.info("User not authenticated, rendering public view"),(0,n.jsx)(n.Fragment,{children:t}))}},97145:(e,t,a)=>{"use strict";a.d(t,{y:()=>c});var n=a(12115),r=a(41444);function i(e){return{authProvider:e.disableAuth?"disabled":"auth0"===e.authProvider||"keycloak"===e.authProvider||"disabled"===e.authProvider?e.authProvider:e.auth0Domain&&e.auth0ClientId?"auth0":"keycloak",auth0Domain:e.auth0Domain||"",auth0ClientId:e.auth0ClientId||"",auth0Audience:e.auth0Audience||"",auth0RedirectUri:e.auth0RedirectUri||"",keycloakRealmUrl:e.keycloakRealmUrl||"",keycloakClientId:e.keycloakClientId||"",apiUrl:e.apiUrl||""}}a(95704);var s=a(95704);let l=(0,r.h)("useRuntimeConfig"),o=i({authProvider:s.env.NEXT_PUBLIC_AUTH_PROVIDER,auth0Domain:s.env.NEXT_PUBLIC_AUTH0_DOMAIN,auth0ClientId:s.env.NEXT_PUBLIC_AUTH0_CLIENT_ID,auth0Audience:s.env.NEXT_PUBLIC_AUTH0_AUDIENCE,auth0RedirectUri:s.env.NEXT_PUBLIC_AUTH0_REDIRECT_URI,keycloakRealmUrl:s.env.NEXT_PUBLIC_KEYCLOAK_REALM_URL||"",keycloakClientId:s.env.NEXT_PUBLIC_KEYCLOAK_CLIENT_ID||"",apiUrl:s.env.NEXT_PUBLIC_API_URL||"",disableAuth:!0});function c(){let[e,t]=(0,n.useState)(o),[a,r]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{(async()=>{try{let e=await fetch("/config.json");if(!e.ok)throw Error("Failed to load config: ".concat(e.status));let a=i(await e.json());l.info("Runtime config loaded successfully"),t(a)}catch(e){l.warn("Failed to load runtime config, using build-time defaults"),t(o)}finally{r(!1)}})()},[]),{config:e,isLoading:a}}}},e=>{e.O(0,[475,330,187,272,619,870,583,592,921,688,924,441,493,358],()=>e(e.s=34720)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{6259:(e,t,a)=>{"use strict";a.d(t,{SQ:()=>o,_2:()=>c,mB:()=>d,rI:()=>s,ty:()=>l});var n=a(95155);a(12115);var r=a(24595),i=a(64269);function s(e){let{...t}=e;return(0,n.jsx)(r.bL,{"data-slot":"dropdown-menu",...t})}function l(e){let{...t}=e;return(0,n.jsx)(r.l9,{"data-slot":"dropdown-menu-trigger",...t})}function o(e){let{className:t,sideOffset:a=4,...s}=e;return(0,n.jsx)(r.ZL,{children:(0,n.jsx)(r.UC,{"data-slot":"dropdown-menu-content",sideOffset:a,className:(0,i.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...s})})}function c(e){let{className:t,inset:a,variant:s="default",...l}=e;return(0,n.jsx)(r.q7,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":s,className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...l})}function d(e){let{className:t,...a}=e;return(0,n.jsx)(r.wv,{"data-slot":"dropdown-menu-separator",className:(0,i.cn)("bg-border -mx-1 my-1 h-px",t),...a})}},24323:(e,t,a)=>{"use strict";a.d(t,{P:()=>g,T:()=>f});var n=a(95155),r=a(12115),i=a(52619),s=a.n(i),l=a(68321),o=a(76784),c=a(7831),d=a(41444),u=a(3998),h=a(51834);let m=(0,d.h)("AnalyticsConsent");async function f(e){await c.userApi.userMeUpdate({userProfileRequest:{analyticsConsent:e}})}function g(){let[e,t]=(0,r.useState)(null),a=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=!1;return c.userApi.userMeRetrieve().then(a=>{var n;e||t(null!=(n=a.analyticsConsent)?n:"unset")}).catch(e=>{m.debug({err:e},"Could not load analytics consent (not authenticated yet?)")}),()=>{e=!0}},[]);let i=async e=>{a.current=!0,t(e);try{await f(e)}catch(e){m.error({err:e},"Failed to save analytics consent")}};return(0,n.jsxs)(n.Fragment,{children:["accepted"===e&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.GoogleAnalytics,{gaId:"G-2P6K2HWVEE"}),(0,n.jsx)(l.default,{id:"microsoft-clarity",strategy:"afterInteractive",children:'(function(c,l,a,r,i,t,y){\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\n t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\n })(window, document, "clarity", "script", "xowemo04qg");'})]}),(0,n.jsx)(h.lG,{open:"unset"===e,onOpenChange:e=>{e||a.current||i("declined")},children:(0,n.jsxs)(h.Cf,{children:[(0,n.jsxs)(h.c7,{children:[(0,n.jsx)(h.L3,{children:"Help us improve HackAgent"}),(0,n.jsxs)(h.rr,{children:["We'd like to use optional analytics to understand how HackAgent is used. This is separate from the cookies that keep you signed in, and you can change it anytime in Settings. See our"," ",(0,n.jsx)(s(),{href:"https://hackagent.dev/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Privacy Policy"}),"."]})]}),(0,n.jsxs)(h.Es,{children:[(0,n.jsx)(u.$,{variant:"outline",onClick:()=>i("declined"),children:"Not now"}),(0,n.jsx)(u.$,{onClick:()=>i("accepted"),children:"Sounds good"})]})]})})]})}},24394:()=>{},25164:(e,t,a)=>{"use strict";a.d(t,{W:()=>r});let n="0.6.6-stage",r=/^\d/.test(n)?"v".concat(n):n},34105:(e,t,a)=>{"use strict";a.d(t,{c:()=>n});let n=(0,a(12115).createContext)(void 0)},34720:(e,t,a)=>{Promise.resolve().then(a.bind(a,96042)),Promise.resolve().then(a.bind(a,49359)),Promise.resolve().then(a.bind(a,96280)),Promise.resolve().then(a.t.bind(a,93836,23))},46767:(e,t,a)=>{"use strict";a.d(t,{Bc:()=>s,ZI:()=>c,k$:()=>o,m_:()=>l});var n=a(95155);a(12115);var r=a(53583),i=a(64269);function s(e){let{delayDuration:t=0,...a}=e;return(0,n.jsx)(r.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function l(e){let{...t}=e;return(0,n.jsx)(s,{children:(0,n.jsx)(r.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,n.jsx)(r.l9,{"data-slot":"tooltip-trigger",...t})}function c(e){let{className:t,sideOffset:a=0,children:s,...l}=e;return(0,n.jsx)(r.ZL,{children:(0,n.jsxs)(r.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,i.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...l,children:[s,(0,n.jsx)(r.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},49359:(e,t,a)=>{"use strict";a.d(t,{Authorization:()=>N});var n=a(95155),r=a(67176),i=a(20063),s=a(12115),l=a(34105),o=a(7831),c=a(41444);let d=(0,c.h)("Auth0Adapter");function u(e){let{children:t}=e,{getAccessTokenSilently:i,isAuthenticated:c,isLoading:u,loginWithRedirect:h,logout:m,user:f}=(0,r.WB)(),[g,x]=(0,s.useState)(!1),p=(0,s.useRef)(!1),v=(0,s.useCallback)(async()=>{let e=await i()||"";return(0,o.ki)(e),e},[i]);(0,s.useEffect)(()=>{let e;if(u)return;let t=!1;if(!c){(0,o.ki)(null),x(!0),p.current=!1;return}let n=async()=>{try{if(await v(),!p.current){p.current=!0;let{userApi:e}=await Promise.resolve().then(a.bind(a,7831));e.userMeRetrieve().catch(()=>d.debug("User profile synchronization deferred"))}}catch(e){d.error({err:e},"Unable to obtain Auth0 access token"),(0,o.ki)(null)}finally{t||x(!0)}};return n(),e=setInterval(()=>void n(),6e5),()=>{t=!0,e&&clearInterval(e)}},[c,u,v]);let y=(0,s.useCallback)(async()=>{await h({appState:{returnTo:"/"}})},[h]),k=(0,s.useCallback)(async()=>{(0,o.ki)(null),await m({logoutParams:{returnTo:window.location.origin}})},[m]),j=(0,s.useMemo)(()=>({provider:"auth0",user:f,isAuthenticated:c,isLoading:u||c&&!g,login:y,logout:k,getAccessTokenSilently:v}),[f,c,u,g,y,k,v]);return(0,n.jsx)(l.c.Provider,{value:j,children:t})}function h(e){let{config:t,children:a}=e,l=(0,i.useRouter)(),o=(0,s.useCallback)(e=>{l.push((null==e?void 0:e.returnTo)||"/")},[l]);if(!t.auth0Domain||!t.auth0ClientId||!t.auth0Audience)return(0,n.jsx)(m,{provider:"Auth0"});let c=t.auth0RedirectUri||window.location.origin;return(0,n.jsx)(r.y2,{domain:t.auth0Domain,clientId:t.auth0ClientId,authorizationParams:{redirect_uri:c,audience:t.auth0Audience,scope:"openid profile email"},onRedirectCallback:o,cacheLocation:"localstorage",children:(0,n.jsx)(u,{children:a})})}function m(e){let{provider:t}=e;return(0,n.jsx)("div",{role:"alert",className:"flex min-h-screen items-center justify-center p-6 text-center",children:(0,n.jsxs)("p",{children:[t," authentication is selected but its runtime configuration is incomplete."]})})}var f=a(67062);let g=async()=>"mock-dev-token";function x(e){let{children:t}=e,[a,r]=(0,s.useState)(!1);(0,s.useEffect)(()=>((0,o.ki)("mock-dev-token"),r(!0),()=>(0,o.ki)(null)),[]);let i=(0,s.useMemo)(()=>({provider:"disabled",user:(0,f.Y)(),isAuthenticated:!0,isLoading:!a,login:void 0,logout:void 0,getAccessTokenSilently:g}),[a]);return(0,n.jsx)(l.c.Provider,{value:i,children:t})}var p=a(5313);let v=(0,c.h)("KeycloakAdapter"),y=async()=>"",k={provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:y},j=new Map;function b(e){let{config:t,children:r}=e,[i,c]=(0,s.useState)(k);return((0,s.useEffect)(()=>{let e;if(!t.keycloakRealmUrl||!t.keycloakClientId)return;let n=new URL(t.keycloakRealmUrl),r="/realms/",i=n.pathname.indexOf(r),s=function(e,t,a){let n="".concat(e,"|").concat(t,"|").concat(a),r=j.get(n);if(!r){let i=new p.A({url:e,realm:t,clientId:a});r={keycloak:i,authenticated:i.init({onLoad:"login-required",silentCheckSsoRedirectUri:"".concat(window.location.origin,"/silent-check-sso.html"),pkceMethod:"S256"})},j.set(n,r)}return r}(i>=0?"".concat(n.origin).concat(n.pathname.slice(0,i)):n.origin,i>=0?n.pathname.slice(i+r.length).split("/")[0]:n.pathname.split("/").filter(Boolean).at(-1)||"hackagent",t.keycloakClientId),{keycloak:l}=s,d=!1,u=async()=>{await l.updateToken(60);let e=l.token||"";return(0,o.ki)(e||null),e};return(async()=>{try{var t,n,r,i,h;let m=await s.authenticated;if(d)return;if(!m){(0,o.ki)(null),c({provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!1,login:async()=>{await l.login()},logout:void 0,getAccessTokenSilently:y});return}let f={sub:l.subject,email:null==(t=l.tokenParsed)?void 0:t.email,name:null==(n=l.tokenParsed)?void 0:n.name,given_name:null==(r=l.tokenParsed)?void 0:r.given_name,family_name:null==(i=l.tokenParsed)?void 0:i.family_name,preferred_username:null==(h=l.tokenParsed)?void 0:h.preferred_username};await u();let{userApi:g}=await Promise.resolve().then(a.bind(a,7831));g.userMeRetrieve().catch(()=>v.debug("User profile synchronization deferred")),c({provider:"keycloak",user:f,isAuthenticated:!0,isLoading:!1,login:async()=>{await l.login()},logout:async()=>{(0,o.ki)(null),await l.logout({redirectUri:window.location.origin})},getAccessTokenSilently:u}),e=setInterval(()=>{u().catch(e=>v.error({err:e},"Unable to refresh Keycloak access token"))},3e4)}catch(e){v.error({err:e},"Keycloak initialization failed"),(0,o.ki)(null),d||c({...k,isLoading:!1})}})(),()=>{d=!0,e&&clearInterval(e),(0,o.ki)(null)}},[t.keycloakClientId,t.keycloakRealmUrl]),t.keycloakRealmUrl&&t.keycloakClientId)?(0,n.jsx)(l.c.Provider,{value:i,children:r}):(0,n.jsx)("div",{role:"alert",className:"flex min-h-screen items-center justify-center p-6 text-center",children:(0,n.jsx)("p",{children:"Keycloak authentication is selected but its runtime configuration is incomplete."})})}var w=a(97145);function N(e){let{children:t}=e,{config:a,isLoading:r}=(0,w.y)();if(r)return null;switch(a.authProvider){case"auth0":return(0,n.jsx)(h,{config:a,children:t});case"keycloak":return(0,n.jsx)(b,{config:a,children:t});case"disabled":return(0,n.jsx)(x,{children:t})}}},51834:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>u,Es:()=>m,HM:()=>c,L3:()=>f,c7:()=>h,lG:()=>l,rr:()=>g});var n=a(95155);a(12115);var r=a(88292),i=a(65229),s=a(64269);function l(e){let{...t}=e;return(0,n.jsx)(r.bL,{"data-slot":"dialog",...t})}function o(e){let{...t}=e;return(0,n.jsx)(r.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{...t}=e;return(0,n.jsx)(r.bm,{"data-slot":"dialog-close",...t})}function d(e){let{className:t,...a}=e;return(0,n.jsx)(r.hJ,{"data-slot":"dialog-overlay",className:(0,s.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function u(e){let{className:t,children:a,...l}=e;return(0,n.jsxs)(o,{"data-slot":"dialog-portal",children:[(0,n.jsx)(d,{}),(0,n.jsxs)(r.UC,{"data-slot":"dialog-content",className:(0,s.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...l,children:[a,(0,n.jsxs)(r.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,n.jsx)(i.A,{}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function h(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"dialog-header",className:(0,s.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function m(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"dialog-footer",className:(0,s.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function f(e){let{className:t,...a}=e;return(0,n.jsx)(r.hE,{"data-slot":"dialog-title",className:(0,s.cn)("text-lg leading-none font-semibold",t),...a})}function g(e){let{className:t,...a}=e;return(0,n.jsx)(r.VY,{"data-slot":"dialog-description",className:(0,s.cn)("text-muted-foreground text-sm",t),...a})}},67062:(e,t,a)=>{"use strict";function n(){return!0}function r(){return{email:"dev@hackagent.local",name:"Dev User",preferred_username:"dev",picture:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><rect fill="%23ccc" width="48" height="48"/><text x="50%25" y="50%25" dominant-baseline="middle" text-anchor="middle" font-family="sans-serif" font-size="24" fill="%23666">D</text></svg>'}}a.d(t,{Y:()=>r,l:()=>n})},73474:(e,t,a)=>{"use strict";a.d(t,{Bc:()=>r,NQ:()=>l,zG:()=>n,wN:()=>s,AZ:()=>m,V$:()=>u,eW:()=>c,of:()=>h,_9:()=>d,f_:()=>o});let n=[{id:"classic-light",label:"Classic Light",mode:"light",description:"Soft neutral grays and a quiet, minimal feel."},{id:"slate-light",label:"Slate Light",mode:"light",description:"Cool slate surfaces with crisp white cards."},{id:"classic-dark",label:"Classic Dark",mode:"dark",description:"The original charcoal and neutral gray palette."},{id:"slate-dark",label:"Slate Dark",mode:"dark",description:"The current deep blue and slate palette."}],r={light:"slate-light",dark:"slate-dark"},i={light:"slate-light",dark:"slate-dark"},s="hackagent-theme",l="(prefers-color-scheme: dark)";function o(e){var t,a;return"light"===e||"dark"===e?i[e]:null!=(a=null==(t=n.find(t=>t.id===e))?void 0:t.id)?a:"system"}function c(e,t){let a="system"===e?r[t]:e;return n.find(e=>e.id===a)}function d(){return window.matchMedia(l).matches?"dark":"light"}function u(){try{return o(localStorage.getItem(s))}catch(e){return"system"}}function h(e){try{localStorage.setItem(s,e)}catch(e){}}function m(e){let t=document.documentElement;t.dataset.theme=e.id,t.classList.toggle("dark","dark"===e.mode),t.style.colorScheme=e.mode}let f=Object.fromEntries(n.map(e=>[e.id,e.mode]));"(() => {\n const modes = ".concat(JSON.stringify(f),";\n const defaults = ").concat(JSON.stringify(r),";\n const legacy = ").concat(JSON.stringify(i),";\n let preference;\n try { preference = localStorage.getItem('").concat(s,"'); } catch {}\n if (preference === 'light' || preference === 'dark') preference = legacy[preference];\n const system = window.matchMedia('").concat(l,"').matches ? 'dark' : 'light';\n const id = Object.prototype.hasOwnProperty.call(modes, preference) ? preference : defaults[system];\n document.documentElement.dataset.theme = id;\n document.documentElement.classList.toggle('dark', modes[id] === 'dark');\n document.documentElement.style.colorScheme = modes[id];\n})();")},80230:(e,t,a)=>{"use strict";a.d(t,{h:()=>s});var n=a(12115),r=a(34105);let i=async()=>"";function s(){let e=(0,n.useContext)(r.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:i}}},86259:(e,t,a)=>{"use strict";a.d(t,{w:()=>s});var n=a(95155);a(12115);var r=a(57268),i=a(64269);function s(e){let{className:t,orientation:a="horizontal",decorative:s=!0,...l}=e;return(0,n.jsx)(r.b,{"data-slot":"separator-root",decorative:s,orientation:a,className:(0,i.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...l})}},91903:()=>{},93836:()=>{},96042:(e,t,a)=>{"use strict";a.d(t,{D:()=>l,ThemeProvider:()=>o});var n=a(95155),r=a(12115),i=a(73474);let s=(0,r.createContext)({theme:"system",resolvedTheme:"light",resolvedStyle:i.Bc.light,setTheme:()=>{}});function l(){return(0,r.useContext)(s)}function o(e){let{children:t}=e,[a,l]=(0,r.useState)({theme:"system",resolvedTheme:"light",resolvedStyle:i.Bc.light}),o=(0,r.useCallback)(e=>{let t=(0,i.eW)(e,(0,i._9)());(0,i.AZ)(t),l({theme:e,resolvedTheme:t.mode,resolvedStyle:t.id})},[]);(0,r.useEffect)(()=>{o((0,i.V$)());let e=e=>{(e.key===i.wN||null===e.key)&&o((0,i.f_)(e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[o]),(0,r.useEffect)(()=>{if("system"!==a.theme)return;let e=window.matchMedia(i.NQ),t=()=>o("system");return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[a.theme,o]);let c=(0,r.useCallback)(e=>{o(e),(0,i.of)(e)},[o]);return(0,n.jsx)(s.Provider,{value:{...a,setTheme:c},children:t})}},96280:(e,t,a)=>{"use strict";a.d(t,{default:()=>$});var n=a(95155),r=a(12115),i=a(52619),s=a.n(i),l=a(80230),o=a(20063),c=a(15239),d=a(3998),u=a(86259),h=a(46591),m=a(64269);function f(e){let{className:t,...a}=e;return(0,n.jsx)(h.bL,{"data-slot":"avatar",className:(0,m.cn)("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...a})}function g(e){let{className:t,...a}=e;return(0,n.jsx)(h._V,{"data-slot":"avatar-image",className:(0,m.cn)("aspect-square size-full",t),...a})}function x(e){let{className:t,...a}=e;return(0,n.jsx)(h.H4,{"data-slot":"avatar-fallback",className:(0,m.cn)("bg-muted flex size-full items-center justify-center rounded-full",t),...a})}var p=a(6259),v=a(46767),y=a(25164);let k=(0,r.createContext)(void 0),j=e=>{let{children:t}=e,[a,i]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=window.matchMedia("(max-width: 1023px)"),t=()=>i(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,n.jsx)(k.Provider,{value:{isCollapsed:a,toggleSidebar:()=>{i(e=>!e)}},children:t})},b=()=>{let e=(0,r.useContext)(k);if(!e)throw Error("useSidebar must be used within a SidebarProvider");return e};var w=a(65993),N=a(78192),C=a(37397),A=a(80534),_=a(55867),E=a(77625),L=a(47937);let U=[{items:[{href:"/",label:"Home",icon:w.A}]},{title:"Evaluation",items:[{href:"/agents",label:"Targets",icon:N.A},{href:"/attacks",label:"Campaigns",icon:C.A},{href:"/stats",label:"Runs",icon:A.A}]},{title:"Workspace",items:[{href:"/credentials",label:"Credentials",icon:_.A},{href:"/usage",label:"Usage",icon:E.A}]}],I=[{href:"https://docs.hackagent.dev",label:"Documentation",icon:L.A,external:!0}];var P=a(77931),S=a(26550),T=a(12108),R=a(15870),z=a(84926);let D=()=>{let{user:e,isLoading:t,isAuthenticated:a,logout:i}=(0,l.h)(),h=(0,o.usePathname)(),{isCollapsed:k,toggleSidebar:j}=b();if(t||!a||!e)return null;let w=e.name||e.preferred_username||e.email||"User",N=(e=>{if(!e||""===e.trim())return"?";if(e.startsWith("0x")&&e.length>10)return e.substring(0,2).toUpperCase();let t=e.split(/[\s.\-_@]+/).filter(e=>e.length>0);return 0===t.length?"?":1===t.length?t[0].substring(0,2).toUpperCase():((t[0][0]||"")+(t[t.length-1][0]||"")).toUpperCase()})(w),C=function(e,t){let a=e.split(/[?#]/)[0].replace(/(.)\/+$/,"$1");return("/secrets"===a||"/api-keys"===a)&&(a="/credentials"),t.filter(e=>{let t;return t=a,"/"===e?"/"===t:t===e||t.startsWith("".concat(e,"/"))}).sort((e,t)=>t.length-e.length)[0]}(h,U.flatMap(e=>e.items.filter(e=>!e.external).map(e=>e.href))),A=e=>{let{href:t,icon:a,label:r,isActive:i}=e;return(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)(s(),{href:t,"aria-label":r,"aria-current":i?"page":void 0,children:(0,n.jsxs)(d.$,{variant:i?"secondary":"ghost",className:(0,m.cn)("w-full",k?"justify-center px-2":"justify-start",i&&"font-semibold"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!k&&"mr-2")}),!k&&r]})})}),k&&(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:r})})]})},_=e=>{let{href:t,icon:a,label:r}=e;return(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)("a",{href:t,"aria-label":r,target:"_blank",rel:"noopener noreferrer",className:"block",children:(0,n.jsxs)(d.$,{variant:"ghost",className:(0,m.cn)("w-full cursor-pointer",k?"justify-center px-2":"justify-start"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!k&&"mr-2")}),!k&&r]})})}),k&&(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:r})})]})};return(0,n.jsx)(v.Bc,{delayDuration:0,children:(0,n.jsxs)("aside",{className:(0,m.cn)("flex h-screen flex-col border-r bg-sidebar p-4 fixed left-0 top-0 transition-all duration-300",k?"w-16":"w-52"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("mb-6 flex",k?"flex-col items-center gap-2 px-0":"flex-row items-center justify-between gap-2 px-2"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("flex items-center gap-2",!k&&"min-w-0 flex-1"),children:[(0,n.jsx)(c.default,{src:"/raccoon.png",alt:"HackAgent Logo",title:k?"HackAgent ".concat(y.W):void 0,width:24,height:24,className:"shrink-0 text-primary"}),!k&&(0,n.jsx)("h3",{className:"min-w-0 truncate font-semibold text-base leading-tight",children:"HackAgent"})]}),(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)(d.$,{variant:"ghost",size:"icon",onClick:j,"aria-label":k?"Expand sidebar":"Collapse sidebar",className:"h-7 w-7 shrink-0",children:k?(0,n.jsx)(P.A,{className:"h-4 w-4"}):(0,n.jsx)(S.A,{className:"h-4 w-4"})})}),(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:k?"Expand sidebar":"Collapse sidebar"})})]})]}),(0,n.jsx)("nav",{"aria-label":"Main navigation",className:(0,m.cn)("min-h-0 flex-1 space-y-4 overflow-y-auto",k?"px-0":"px-2"),children:U.map((e,t)=>{var a;return(0,n.jsxs)(r.Fragment,{children:[t>0&&(0,n.jsx)(u.w,{}),(0,n.jsxs)("div",{className:"space-y-1",children:[e.title&&!k&&(0,n.jsx)("div",{className:"px-2 py-1",children:(0,n.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e.title})}),e.items.map(e=>e.external?(0,n.jsx)(_,{href:e.href,icon:e.icon,label:e.label},e.href):(0,n.jsx)(A,{href:e.href,icon:e.icon,label:e.label,isActive:e.href===C},e.href))]})]},null!=(a=e.title)?a:t)})}),(0,n.jsx)("nav",{"aria-label":"Help",className:(0,m.cn)("space-y-1 pt-4",k?"px-0":"px-2"),children:I.map(e=>(0,n.jsx)(_,{href:e.href,icon:e.icon,label:e.label},e.href))}),(0,n.jsx)(u.w,{className:"my-4"}),e&&(0,n.jsx)("div",{className:"mt-auto",children:(0,n.jsxs)(p.rI,{children:[(0,n.jsx)(p.ty,{asChild:!0,children:(0,n.jsxs)(d.$,{variant:"ghost","aria-label":"".concat(w," Account"),className:(0,m.cn)("w-full p-2 h-auto hover:bg-accent hover:text-accent-foreground",k?"justify-center":"justify-between"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("flex items-center",k?"justify-center":"gap-3"),children:[(0,n.jsxs)(f,{className:"h-8 w-8",children:[e.picture&&(0,n.jsx)(g,{src:e.picture,alt:w}),(0,n.jsx)(x,{children:N})]}),!k&&(0,n.jsxs)("div",{className:"text-sm text-left",children:[(0,n.jsx)("p",{className:"font-medium leading-none truncate max-w-[105px]",children:w}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Account"})]})]}),!k&&(0,n.jsx)(T.A,{className:"h-4 w-4 opacity-50"})]})}),(0,n.jsxs)(p.SQ,{align:"start",className:"w-52 mb-2",side:"top",children:[(0,n.jsx)(p._2,{asChild:!0,children:(0,n.jsxs)(s(),{href:"/profile",className:"cursor-pointer",children:[(0,n.jsx)(R.A,{className:"mr-2 h-4 w-4"}),(0,n.jsx)("span",{children:"Settings"})]})}),(0,n.jsx)(p.mB,{}),i&&(0,n.jsxs)(p._2,{onClick:()=>i(),className:"cursor-pointer text-red-600 focus:text-red-600",children:[(0,n.jsx)(z.A,{className:"mr-2 h-4 w-4"}),(0,n.jsx)("span",{children:"Log Out"})]})]})]})})]})})};var B=a(35299),M=a(24323);let O=(0,a(41444).h)("ClientLayout"),H=e=>{let{children:t}=e,{isCollapsed:a}=b();return(0,n.jsx)("main",{className:"relative flex-1 overflow-y-auto transition-all duration-300 ".concat(a?"ml-16":"ml-52"),children:t})},$=e=>{let{children:t}=e,{isAuthenticated:a,isLoading:i,user:s,provider:o}=(0,l.h)();return((0,r.useEffect)(()=>{O.info("ClientLayout initialized - provider=".concat(o,", isLoading=").concat(i,", isAuthenticated=").concat(a))},[o,i,a]),i)?(O.info("Authentication provider loading, showing spinner"),(0,n.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,n.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,n.jsx)(B.A,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,n.jsx)("p",{className:"text-muted-foreground",children:"Loading Authentication..."})]})})):a?(O.info("User authenticated - provider=".concat(o,", userId=").concat(null==s?void 0:s.sub,", email=").concat(null==s?void 0:s.email)),(0,n.jsxs)(j,{children:[(0,n.jsxs)("div",{className:"flex h-screen overflow-hidden print-layout-root",children:[(0,n.jsx)(D,{}),(0,n.jsx)(H,{children:t})]}),"disabled"!==o&&(0,n.jsx)(M.P,{})]})):(O.info("User not authenticated, rendering public view"),(0,n.jsx)(n.Fragment,{children:t}))}},97145:(e,t,a)=>{"use strict";a.d(t,{y:()=>c});var n=a(12115),r=a(41444);function i(e){return{authProvider:e.disableAuth?"disabled":"auth0"===e.authProvider||"keycloak"===e.authProvider||"disabled"===e.authProvider?e.authProvider:e.auth0Domain&&e.auth0ClientId?"auth0":"keycloak",auth0Domain:e.auth0Domain||"",auth0ClientId:e.auth0ClientId||"",auth0Audience:e.auth0Audience||"",auth0RedirectUri:e.auth0RedirectUri||"",keycloakRealmUrl:e.keycloakRealmUrl||"",keycloakClientId:e.keycloakClientId||"",apiUrl:e.apiUrl||""}}a(95704);var s=a(95704);let l=(0,r.h)("useRuntimeConfig"),o=i({authProvider:s.env.NEXT_PUBLIC_AUTH_PROVIDER,auth0Domain:s.env.NEXT_PUBLIC_AUTH0_DOMAIN,auth0ClientId:s.env.NEXT_PUBLIC_AUTH0_CLIENT_ID,auth0Audience:s.env.NEXT_PUBLIC_AUTH0_AUDIENCE,auth0RedirectUri:s.env.NEXT_PUBLIC_AUTH0_REDIRECT_URI,keycloakRealmUrl:s.env.NEXT_PUBLIC_KEYCLOAK_REALM_URL||"",keycloakClientId:s.env.NEXT_PUBLIC_KEYCLOAK_CLIENT_ID||"",apiUrl:s.env.NEXT_PUBLIC_API_URL||"",disableAuth:!0});function c(){let[e,t]=(0,n.useState)(o),[a,r]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{(async()=>{try{let e=await fetch("/config.json");if(!e.ok)throw Error("Failed to load config: ".concat(e.status));let a=i(await e.json());l.info("Runtime config loaded successfully"),t(a)}catch(e){l.warn("Failed to load runtime config, using build-time defaults"),t(o)}finally{r(!1)}})()},[]),{config:e,isLoading:a}}}},e=>{e.O(0,[475,330,187,272,619,870,583,495,356,546,924,441,493,358],()=>e(e.s=34720)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{11647:(e,t,a)=>{"use strict";a.d(t,{E:()=>c});var s=a(95155);a(12115);var n=a(32467),r=a(83101),l=a(64269);let i=(0,r.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function c(e){let{className:t,variant:a,asChild:r=!1,...c}=e,o=r?n.DX:"span";return(0,s.jsx)(o,{"data-slot":"badge",className:(0,l.cn)(i({variant:a}),t),...c})}},13406:(e,t,a)=>{"use strict";a.d(t,{Xi:()=>c,av:()=>o,j7:()=>i,tU:()=>l});var s=a(95155);a(12115);var n=a(49543),r=a(64269);function l(e){let{className:t,...a}=e;return(0,s.jsx)(n.bL,{"data-slot":"tabs",className:(0,r.cn)("flex flex-col gap-2",t),...a})}function i(e){let{className:t,...a}=e;return(0,s.jsx)(n.B8,{"data-slot":"tabs-list",className:(0,r.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t),...a})}function c(e){let{className:t,...a}=e;return(0,s.jsx)(n.l9,{"data-slot":"tabs-trigger",className:(0,r.cn)("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 hover:bg-background/50 dark:hover:bg-input/20 data-[state=active]:hover:bg-background dark:data-[state=active]:hover:bg-input/30",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsx)(n.UC,{"data-slot":"tabs-content",className:(0,r.cn)("flex-1 outline-none",t),...a})}},20243:(e,t,a)=>{"use strict";a.d(t,{E:()=>r});var s=a(95155),n=a(64269);function r(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"skeleton",className:(0,n.cn)("bg-accent animate-pulse rounded-md",t),...a})}},22470:(e,t,a)=>{"use strict";a.d(t,{M:()=>n});var s=a(95155);a(12115);let n=e=>{let{title:t,description:a,action:n,children:r,maxWidth:l="full",compact:i=!1}=e;return(0,s.jsxs)("div",{className:"w-full ".concat({full:"max-w-full","8xl":"max-w-[90rem]","7xl":"max-w-7xl","6xl":"max-w-6xl","5xl":"max-w-5xl","4xl":"max-w-4xl","3xl":"max-w-3xl","2xl":"max-w-2xl"}[l]||"max-w-full"," mx-auto ").concat(i?"py-3 space-y-3":"py-6 space-y-6"),children:[t&&(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 border-b ".concat(i?"px-4 pb-3":"px-6 pb-5"),children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:t}),a&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:a})]}),n&&(0,s.jsx)("div",{className:"flex-shrink-0 pt-0.5",children:n})]}),r]})}},34105:(e,t,a)=>{"use strict";a.d(t,{c:()=>s});let s=(0,a(12115).createContext)(void 0)},46767:(e,t,a)=>{"use strict";a.d(t,{Bc:()=>l,ZI:()=>o,k$:()=>c,m_:()=>i});var s=a(95155);a(12115);var n=a(53583),r=a(64269);function l(e){let{delayDuration:t=0,...a}=e;return(0,s.jsx)(n.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function i(e){let{...t}=e;return(0,s.jsx)(l,{children:(0,s.jsx)(n.bL,{"data-slot":"tooltip",...t})})}function c(e){let{...t}=e;return(0,s.jsx)(n.l9,{"data-slot":"tooltip-trigger",...t})}function o(e){let{className:t,sideOffset:a=0,children:l,...i}=e;return(0,s.jsx)(n.ZL,{children:(0,s.jsxs)(n.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,r.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...i,children:[l,(0,s.jsx)(n.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},61984:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>em});var s=a(95155),n=a(80230),r=a(12115),l=a(52619),i=a.n(l),c=a(3998),o=a(20243),d=a(22470),m=a(12723),u=a(4035),x=a(69386),h=a(26265),g=a(96324),f=a(68425),p=a(47734),j=a(73697),v=a(33420),b=a(86618),N=a(78192),y=a(52987),k=a(52056),w=a(86948),A=a(11647),S=a(7831);let C={vulnerable:"#ef4444",safe:"#22c55e",error:"#f59e0b",pending:"#94a3b8"},E={vulnerable:"#f87171",safe:"#4ade80",error:"#fbbf24",pending:"#cbd5e1"},L={low:"#22c55e",medium:"#eab308",high:"#f97316",critical:"#ef4444"};var _=a(96042),R=a(46767);let M={low:10,medium:30,high:60},z={low:"Low",medium:"Medium",high:"High",critical:"Critical"},T="Risk from attack success rate (ASR): Low ≤".concat(M.low,"%, ")+"Medium ≤".concat(M.medium,"%, High ≤").concat(M.high,"%, ")+"Critical >".concat(M.high,"%.");function D(e){return e<=M.low?"low":e<=M.medium?"medium":e<=M.high?"high":"critical"}function O(e){let{children:t}=e;return(0,s.jsxs)(R.m_,{children:[(0,s.jsx)(R.k$,{asChild:!0,children:t}),(0,s.jsx)(R.ZI,{className:"max-w-xs",children:T})]})}var I=a(41444),B=a(87066),Z=a(35795);function H(e){let{targets:t,runs:a,jailbreaks:n}=e,r=[{label:"Targets",value:t,icon:N.A,href:"/agents"},{label:"Runs",value:a,icon:B.A,href:"/stats"},{label:"Jailbreaks",value:n,icon:Z.A,href:"/stats"}];return(0,s.jsx)("div",{className:"grid grid-cols-3 gap-4",children:r.map(e=>{let{label:t,value:a,icon:n,href:r}=e;return(0,s.jsx)(i(),{href:r,className:"group",children:(0,s.jsx)(w.Zp,{className:"transition-colors group-hover:bg-muted/40",children:(0,s.jsxs)(w.Wu,{className:"p-4",children:[(0,s.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:t}),(0,s.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-md border bg-muted/40 text-muted-foreground transition-colors group-hover:text-foreground",children:(0,s.jsx)(n,{className:"h-4 w-4"})})]}),(0,s.jsx)("span",{className:"text-3xl font-semibold tracking-tight tabular-nums",children:a})]})})},t)})})}var P=a(37397),G=a(80534);let W=[{icon:N.A,title:"Add a target agent",description:"Connect the AI agent you want to probe for vulnerabilities.",cta:"Add target",href:"/agents"},{icon:P.A,title:"Build a campaign",description:"Configure jailbreak and red-team techniques to run against it.",cta:"Create campaign",href:"/attacks"},{icon:G.A,title:"Review results",description:"See which attacks succeeded and inspect their results.",cta:"View results",href:"/stats"}];function J(){return(0,s.jsxs)(w.Zp,{children:[(0,s.jsxs)(w.aR,{children:[(0,s.jsx)(w.ZB,{className:"text-lg",children:"Get started with HackAgent"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Three steps to your first agent security evaluation."})]}),(0,s.jsx)(w.Wu,{children:(0,s.jsx)("ol",{className:"grid gap-4 md:grid-cols-3",children:W.map((e,t)=>{let{icon:a,title:n,description:r,cta:l,href:o}=e;return(0,s.jsxs)("li",{className:"flex flex-col gap-3 rounded-lg border bg-muted/20 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"flex h-6 w-6 items-center justify-center rounded-full border bg-background text-xs font-semibold tabular-nums text-muted-foreground",children:t+1}),(0,s.jsx)(a,{className:"h-4 w-4 text-muted-foreground"})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("h3",{className:"text-sm font-medium",children:n}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:r})]}),(0,s.jsx)(c.$,{asChild:!0,variant:"outline",size:"sm",className:"mt-auto w-full",children:(0,s.jsxs)(i(),{href:o,children:[l,(0,s.jsx)(y.A,{className:"h-3.5 w-3.5"})]})})]},n)})})})]})}let K=(0,I.h)("HomeStats"),V={total:0,jailbreaks:0,mitigated:0,errors:0,pending:0};function $(e){return e.reduce((e,t)=>{var a,s,n,r,l;return{total:e.total+(null!=(a=t.totalResults)?a:0),jailbreaks:e.jailbreaks+(null!=(s=t.successfulJailbreaks)?s:0),mitigated:e.mitigated+(null!=(n=t.failedJailbreaks)?n:0),errors:e.errors+(null!=(r=t.errors)?r:0),pending:e.pending+(null!=(l=t.notEvaluated)?l:0)}},{...V})}function F(){var e;let{hideEmptyState:t=!1,onLoaded:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{resolvedTheme:n}=(0,_.D)(),l="dark"===n,c=l?E:C,d=l?"#3f3f46":"#e5e7eb",[R,M]=(0,r.useState)(!0),[T,I]=(0,r.useState)([]),[B,Z]=(0,r.useState)(0),[P,G]=(0,r.useState)(0),[W,F]=(0,r.useState)(0),[U,X]=(0,r.useState)("—"),[q,Q]=(0,r.useState)(V),Y=(0,r.useRef)(a);Y.current=a,(0,r.useEffect)(()=>{let e=!1;return(async()=>{M(!0);try{var t,a,s,n;let r=await S.ME.runList({page:1,pageSize:100});if(e)return;let l=null!=(a=r.results)?a:[],i=$(l),c=new Set(l.map(e=>e.agent).filter(Boolean));Z(null!=(s=r.count)?s:l.length),G(c.size),F(i.jailbreaks),I(l.slice(0,5)),null==(t=Y.current)||t.call(Y,{totalRuns:null!=(n=r.count)?n:l.length,totalResults:i.total});let o=l[0];if(!o){X("—"),Q(V);return}X(o.agentName||"".concat(o.agent.slice(0,8),"…")),Q($(l.filter(e=>e.agent===o.agent)))}catch(t){e||K.error({err:t},"Failed to load home stats")}finally{e||M(!1)}})(),()=>{e=!0}},[]);let ee=(0,r.useMemo)(()=>0===q.total?0:Math.round(100*q.jailbreaks/q.total),[q]),et=q.total>0,ea=null==(e=et?ee:null)||Number.isNaN(e)?"No data":z[D(e)],es=L[D(ee)],en=(0,r.useMemo)(()=>[{name:"Jailbreaks",value:q.jailbreaks,color:c.vulnerable},{name:"Mitigated",value:q.mitigated,color:c.safe},{name:"Errors",value:q.errors,color:c.error},{name:"Pending",value:q.pending,color:c.pending}],[q,c]);return R?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"grid grid-cols-3 gap-4",children:[0,1,2].map(e=>(0,s.jsx)(o.E,{className:"h-24 w-full"},e))}),(0,s.jsx)(o.E,{className:"h-56 w-full"})]}):0===B?t?null:(0,s.jsx)(J,{}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(H,{targets:P,runs:B,jailbreaks:W}),(0,s.jsxs)("div",{className:"grid gap-4 xl:grid-cols-5 items-start",children:[(0,s.jsxs)(w.Zp,{className:"xl:col-span-3",children:[(0,s.jsx)(w.aR,{className:"pb-2",children:(0,s.jsxs)(w.ZB,{className:"text-lg flex flex-wrap items-center gap-2",children:["Latest Target Statistics",(0,s.jsxs)(A.E,{variant:"secondary",className:"font-mono font-normal gap-1",children:[(0,s.jsx)(N.A,{className:"h-3 w-3"}),U]})]})}),(0,s.jsx)(w.Wu,{children:et?(0,s.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium self-start",children:"Risk Overview"}),(0,s.jsx)(O,{children:(0,s.jsx)("div",{children:(0,s.jsxs)(m.r,{width:200,height:180,children:[(0,s.jsxs)(u.Fq,{data:[{name:"Risk",value:ee,color:es},{name:"Remaining",value:100-ee,color:d}],cx:100,cy:90,innerRadius:58,outerRadius:82,startAngle:90,endAngle:-270,dataKey:"value",isAnimationActive:!1,children:[(0,s.jsx)(x.f,{fill:es}),(0,s.jsx)(x.f,{fill:d})]}),(0,s.jsxs)("text",{x:100,y:84,textAnchor:"middle",fontSize:26,fontWeight:700,fill:es,children:[ee,"%"]}),(0,s.jsx)("text",{x:100,y:106,textAnchor:"middle",fontSize:12,fill:es,children:ea})]})})})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Result Distribution"}),(0,s.jsx)(h.u,{width:"100%",height:150,children:(0,s.jsxs)(g.E,{data:en,margin:{top:8,right:8,left:-16,bottom:0},children:[(0,s.jsx)(f.d,{vertical:!1,strokeDasharray:"3 3",stroke:l?"rgba(255,255,255,0.12)":"#e5e7eb"}),(0,s.jsx)(p.W,{dataKey:"name",tick:{fontSize:11},axisLine:!1,tickLine:!1}),(0,s.jsx)(j.h,{allowDecimals:!1,tick:{fontSize:11},axisLine:!1,tickLine:!1}),(0,s.jsx)(v.m,{wrapperStyle:{fontSize:12},cursor:{fill:"rgba(0,0,0,0.04)"}}),(0,s.jsx)(b.yP,{dataKey:"value",radius:[4,4,0,0],isAnimationActive:!1,children:en.map(e=>(0,s.jsx)(x.f,{fill:e.color},e.name))})]})}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[q.total," total results"]})]})]}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"No evaluated results for this target yet."})})]}),(0,s.jsxs)(w.Zp,{className:"xl:col-span-2",children:[(0,s.jsxs)(w.aR,{className:"pb-2",children:[(0,s.jsx)(w.ZB,{className:"text-base",children:"Recent Runs"}),(0,s.jsx)(w.X9,{children:(0,s.jsxs)(i(),{href:"/stats",className:"text-xs text-muted-foreground hover:text-foreground flex items-center gap-1",children:["View all ",(0,s.jsx)(y.A,{className:"h-3 w-3"})]})})]}),(0,s.jsx)(w.Wu,{className:"p-0",children:(0,s.jsx)("div",{className:"divide-y",children:T.map(e=>{var t,a;return(0,s.jsxs)(i(),{href:"/stats",className:"flex items-center justify-between gap-3 px-4 py-2.5 hover:bg-muted/50 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,s.jsxs)("span",{className:"font-mono text-xs text-muted-foreground shrink-0 xl:hidden 2xl:inline",children:[e.id.slice(0,8),"…"]}),(0,s.jsx)("span",{className:"text-sm truncate",children:e.agentName||"—"}),e.attackType&&(0,s.jsx)(A.E,{variant:"outline",className:"text-xs shrink-0",children:e.attackType})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[(null!=(t=e.successfulJailbreaks)?t:0)>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs",style:{color:C.vulnerable},children:[(0,s.jsx)(k.A,{className:"h-3 w-3"}),e.successfulJailbreaks]}),(0,s.jsx)(A.E,{variant:function(e){switch(e){case"COMPLETED":return"default";case"FAILED":return"destructive";case"RUNNING":return"secondary";default:return"outline"}}(e.status),className:"text-xs",children:null!=(a=e.status)?a:"PENDING"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground w-16 text-right",children:function(e){if(!e)return"—";let t=Math.round((Date.now()-new Date(e).getTime())/1e3);if(t<60)return"just now";let a=Math.round(t/60);if(a<60)return"".concat(a,"m ago");let s=Math.round(a/60);if(s<24)return"".concat(s,"h ago");let n=Math.round(s/24);if(n<30)return"".concat(n,"d ago");let r=Math.round(n/30);return r<12?"".concat(r,"mo ago"):"".concat(Math.round(r/12),"y ago")}(e.timestamp)})]})]},e.id)})})})]})]})]})}var U=a(13406),X=a(47397),q=a(64269);function Q(e){let{className:t,children:a,...n}=e;return(0,s.jsxs)(X.bL,{"data-slot":"scroll-area",className:(0,q.cn)("relative",t),...n,children:[(0,s.jsx)(X.LM,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:a}),(0,s.jsx)(Y,{}),(0,s.jsx)(X.OK,{})]})}function Y(e){let{className:t,orientation:a="vertical",...n}=e;return(0,s.jsx)(X.VM,{"data-slot":"scroll-area-scrollbar",orientation:a,className:(0,q.cn)("flex touch-none p-px transition-colors select-none","vertical"===a&&"h-full w-2.5 border-l border-l-transparent","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent",t),...n,children:(0,s.jsx)(X.lr,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var ee=a(17910),et=a(28150),ea=a(50803),es=a(61362),en=a(75426),er=a(89715),el=a(85921);let ei={google_adk:{name:"Google ADK",description:"Test a Google Agent Development Kit agent for jailbreaking and prompt injection. HackAgent sends adversarial goals via the ADK protocol and uses an LLM judge to evaluate whether safety guardrails were bypassed.",installCmd:"pip install hackagent",sdkCode:'from hackagent import HackAgent\n\nagent = HackAgent(\n name="my_adk_agent",\n endpoint="http://localhost:8000",\n agent_type="google-adk",\n)\n\nresults = agent.hack(attack_config={\n "attack_type": "advprefix",\n "goals": ["Bypass the agent\'s safety guidelines"],\n "generator": {\n "identifier": "gpt-4o-mini",\n "endpoint": "https://api.openai.com/v1",\n },\n "judges": [{\n "identifier": "gpt-4o-mini",\n "endpoint": "https://api.openai.com/v1",\n "type": "harmbench",\n }],\n})',riskAreas:["Jailbreaking","Prompt Injection","Goal Hijacking"]},openai_sdk:{name:"OpenAI SDK",description:"Test any OpenAI-compatible endpoint — including custom deployments, Azure OpenAI, or local models via LM Studio. HackAgent runs adversarial attack campaigns and streams results to your dashboard.",installCmd:"pip install hackagent",sdkCode:'from hackagent import HackAgent\n\nagent = HackAgent(\n name="my_openai_agent",\n endpoint="http://localhost:8000/v1", # /v1 base path\n agent_type="openai-sdk",\n)\n\nresults = agent.hack(attack_config={\n "attack_type": "pair",\n "goals": ["Extract system prompt", "Ignore previous instructions"],\n "generator": {\n "identifier": "gpt-4o-mini",\n "endpoint": "https://api.openai.com/v1",\n },\n "judges": [{\n "identifier": "gpt-4o-mini",\n "endpoint": "https://api.openai.com/v1",\n "type": "harmbench",\n }],\n})',riskAreas:["System Prompt Extraction","Instruction Override","Data Leakage"]},litellm:{name:"LiteLLM / Ollama",description:"Test any local or remote model via LiteLLM or Ollama — including Llama, Mistral, Gemma, and more. Run full jailbreak evaluations entirely offline with no external API dependencies.",installCmd:"pip install hackagent",sdkCode:'from hackagent import HackAgent\n\n# Ollama example — runs fully locally\nagent = HackAgent(\n name="llama3",\n endpoint="http://localhost:11434",\n agent_type="ollama",\n)\n\nresults = agent.hack(attack_config={\n "attack_type": "advprefix",\n "dataset": {"preset": "harmbench", "limit": 50},\n "generator": {\n "identifier": "llama2-uncensored",\n "endpoint": "http://localhost:11434",\n "agent_type": "ollama",\n },\n "judges": [{\n "identifier": "llama2-uncensored",\n "endpoint": "http://localhost:11434",\n "agent_type": "ollama",\n "type": "harmbench",\n }],\n})',riskAreas:["Jailbreaking","Safety Guardrail Bypass","Harmful Content Generation"]}};function ec(){let[e,t]=(0,r.useState)("google_adk"),[a,n]=(0,r.useState)(null),l=(e,t)=>{navigator.clipboard.writeText(e),n(t),setTimeout(()=>n(null),2e3)},o=ei[e];return(0,s.jsxs)(w.Zp,{className:"shadow-lg",children:[(0,s.jsxs)(w.aR,{className:"pb-4",children:[(0,s.jsxs)(w.ZB,{className:"text-xl flex items-center gap-2",children:[(0,s.jsx)(ee.A,{className:"h-5 w-5 text-primary"}),"Quick Start: Run Your First Attack"]}),(0,s.jsx)(w.BT,{children:"Select your agent framework, then copy the Python snippet to get started"})]}),(0,s.jsx)(w.Wu,{className:"space-y-6",children:(0,s.jsxs)(U.tU,{value:e,onValueChange:e=>t(e),className:"w-full",children:[(0,s.jsxs)(U.j7,{className:"grid w-full grid-cols-3",children:[(0,s.jsxs)(U.Xi,{value:"google_adk",className:"gap-2",children:[(0,s.jsx)(N.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Google ADK"})]}),(0,s.jsxs)(U.Xi,{value:"openai_sdk",className:"gap-2",children:[(0,s.jsx)(et.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"OpenAI SDK"})]}),(0,s.jsxs)(U.Xi,{value:"litellm",className:"gap-2",children:[(0,s.jsx)(ea.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"LiteLLM / Ollama"})]})]}),(0,s.jsxs)(U.av,{value:e,className:"mt-4 space-y-6",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground bg-muted/50 p-3 rounded-lg",children:o.description}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(A.E,{variant:"default",className:"h-7 w-7 rounded-full p-0 flex items-center justify-center",children:"1"}),(0,s.jsx)("h3",{className:"font-semibold",children:"Install HackAgent"}),(0,s.jsx)(c.$,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>l(o.installCmd,"install"),children:"install"===a?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(es.A,{className:"h-4 w-4 text-green-500 mr-1"}),"Copied!"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(en.A,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),(0,s.jsx)("div",{className:"ml-10 bg-muted rounded-lg p-4 font-mono text-xs",children:(0,s.jsx)("pre",{children:o.installCmd})})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(A.E,{variant:"secondary",className:"h-7 w-7 rounded-full p-0 flex items-center justify-center",children:"2"}),(0,s.jsx)("h3",{className:"font-semibold",children:"Configure and run the attack"}),(0,s.jsx)(c.$,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>l(o.sdkCode,"sdk"),children:"sdk"===a?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(es.A,{className:"h-4 w-4 text-green-500 mr-1"}),"Copied!"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(en.A,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),(0,s.jsx)(Q,{className:"ml-10",children:(0,s.jsx)("div",{className:"bg-muted rounded-lg p-4 font-mono text-xs overflow-x-auto",children:(0,s.jsx)("pre",{children:o.sdkCode})})})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(A.E,{variant:"outline",className:"h-7 w-7 rounded-full p-0 flex items-center justify-center",children:"3"}),(0,s.jsx)("h3",{className:"font-semibold",children:"Review your runs"})]}),(0,s.jsxs)("div",{className:"ml-10 space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"Vulnerabilities tested:"}),o.riskAreas.map(e=>(0,s.jsxs)(A.E,{variant:"secondary",className:"flex items-center gap-1",children:[(0,s.jsx)(k.A,{className:"h-3 w-3"}),e]},e))]}),(0,s.jsxs)("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(er.A,{className:"h-4 w-4"}),"Vulnerability summary"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(G.A,{className:"h-4 w-4"}),"Attack success rates"]})]})]})]}),(0,s.jsxs)("div",{className:"pt-4 border-t flex flex-col sm:flex-row items-center justify-between gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Ready to test your agent?"}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)(i(),{href:"/agents",children:(0,s.jsxs)(c.$,{variant:"outline",children:[(0,s.jsx)(N.A,{className:"h-4 w-4"}),"Configure target"]})}),(0,s.jsx)(i(),{href:"/stats",children:(0,s.jsxs)(c.$,{children:[(0,s.jsx)(el.A,{className:"h-4 w-4"}),"View Runs",(0,s.jsx)(y.A,{className:"h-4 w-4"})]})})]})]})]})]})})]})}var eo=a(46826);let ed="Get a security risk assessment for your AI agent in minutes";function em(){let{user:e,isAuthenticated:t,isLoading:a,login:l}=(0,n.h)(),[m,u]=(0,r.useState)(null);return((0,r.useEffect)(()=>{if(t||a||!l)return;let e=new URLSearchParams(window.location.search);e.has("code")&&e.has("state")||l()},[a,t,l]),a)?(0,s.jsx)(d.M,{title:"Welcome",description:ed,children:(0,s.jsxs)("div",{className:"px-6 space-y-4",children:[(0,s.jsx)("div",{className:"grid grid-cols-3 gap-4",children:[0,1,2].map(e=>(0,s.jsx)(o.E,{className:"h-24 w-full"},e))}),(0,s.jsx)(o.E,{className:"h-56 w-full"})]})}):t?(0,s.jsx)(d.M,{title:"Welcome, ".concat(e&&(e.name||e.preferred_username||e.nickname||e.email)||"User","!"),description:ed,action:(0,s.jsx)(i(),{href:"/attacks",children:(0,s.jsxs)(c.$,{size:"sm",children:[(0,s.jsx)(eo.A,{className:"h-4 w-4"}),"New campaign"]})}),children:(0,s.jsxs)("div",{className:"px-6 space-y-6",children:[(0,s.jsx)(F,{hideEmptyState:!0,onLoaded:u}),(null==m?void 0:m.totalResults)===0&&(0,s.jsx)(ec,{})]})}):null}},65761:(e,t,a)=>{Promise.resolve().then(a.bind(a,61984))},73474:(e,t,a)=>{"use strict";a.d(t,{Bc:()=>n,NQ:()=>i,zG:()=>s,wN:()=>l,AZ:()=>x,V$:()=>m,eW:()=>o,of:()=>u,_9:()=>d,f_:()=>c});let s=[{id:"classic-light",label:"Classic Light",mode:"light",description:"Soft neutral grays and a quiet, minimal feel."},{id:"slate-light",label:"Slate Light",mode:"light",description:"Cool slate surfaces with crisp white cards."},{id:"classic-dark",label:"Classic Dark",mode:"dark",description:"The original charcoal and neutral gray palette."},{id:"slate-dark",label:"Slate Dark",mode:"dark",description:"The current deep blue and slate palette."}],n={light:"slate-light",dark:"slate-dark"},r={light:"slate-light",dark:"slate-dark"},l="hackagent-theme",i="(prefers-color-scheme: dark)";function c(e){var t,a;return"light"===e||"dark"===e?r[e]:null!=(a=null==(t=s.find(t=>t.id===e))?void 0:t.id)?a:"system"}function o(e,t){let a="system"===e?n[t]:e;return s.find(e=>e.id===a)}function d(){return window.matchMedia(i).matches?"dark":"light"}function m(){try{return c(localStorage.getItem(l))}catch(e){return"system"}}function u(e){try{localStorage.setItem(l,e)}catch(e){}}function x(e){let t=document.documentElement;t.dataset.theme=e.id,t.classList.toggle("dark","dark"===e.mode),t.style.colorScheme=e.mode}let h=Object.fromEntries(s.map(e=>[e.id,e.mode]));"(() => {\n const modes = ".concat(JSON.stringify(h),";\n const defaults = ").concat(JSON.stringify(n),";\n const legacy = ").concat(JSON.stringify(r),";\n let preference;\n try { preference = localStorage.getItem('").concat(l,"'); } catch {}\n if (preference === 'light' || preference === 'dark') preference = legacy[preference];\n const system = window.matchMedia('").concat(i,"').matches ? 'dark' : 'light';\n const id = Object.prototype.hasOwnProperty.call(modes, preference) ? preference : defaults[system];\n document.documentElement.dataset.theme = id;\n document.documentElement.classList.toggle('dark', modes[id] === 'dark');\n document.documentElement.style.colorScheme = modes[id];\n})();")},80230:(e,t,a)=>{"use strict";a.d(t,{h:()=>l});var s=a(12115),n=a(34105);let r=async()=>"";function l(){let e=(0,s.useContext)(n.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:r}}},86948:(e,t,a)=>{"use strict";a.d(t,{BT:()=>c,Wu:()=>d,X9:()=>o,ZB:()=>i,Zp:()=>r,aR:()=>l});var s=a(95155);a(12115);var n=a(64269);function r(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card",className:(0,n.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded border py-6",t),...a})}function l(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-header",className:(0,n.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function i(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-title",className:(0,n.cn)("leading-none font-semibold",t),...a})}function c(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-description",className:(0,n.cn)("text-muted-foreground text-sm",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-action",className:(0,n.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...a})}function d(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-6",t),...a})}},96042:(e,t,a)=>{"use strict";a.d(t,{D:()=>i,ThemeProvider:()=>c});var s=a(95155),n=a(12115),r=a(73474);let l=(0,n.createContext)({theme:"system",resolvedTheme:"light",resolvedStyle:r.Bc.light,setTheme:()=>{}});function i(){return(0,n.useContext)(l)}function c(e){let{children:t}=e,[a,i]=(0,n.useState)({theme:"system",resolvedTheme:"light",resolvedStyle:r.Bc.light}),c=(0,n.useCallback)(e=>{let t=(0,r.eW)(e,(0,r._9)());(0,r.AZ)(t),i({theme:e,resolvedTheme:t.mode,resolvedStyle:t.id})},[]);(0,n.useEffect)(()=>{c((0,r.V$)());let e=e=>{(e.key===r.wN||null===e.key)&&c((0,r.f_)(e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[c]),(0,n.useEffect)(()=>{if("system"!==a.theme)return;let e=window.matchMedia(r.NQ),t=()=>c("system");return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[a.theme,c]);let o=(0,n.useCallback)(e=>{c(e),(0,r.of)(e)},[c]);return(0,s.jsx)(l.Provider,{value:{...a,setTheme:o},children:t})}}},e=>{e.O(0,[187,619,870,583,389,103,683,924,441,493,358],()=>e(e.s=65761)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[636],{1577:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>R});var a=s(95155),r=s(12115),n=s(20063),l=s(52619),i=s.n(l),d=s(80230),c=s(7831),o=s(41444),u=s(22470),m=s(39926),x=s(79451),g=s(5917),h=s(44846),p=s(76444),f=s(73474);function v(e){let{theme:t}=e;return(0,a.jsxs)("div",{"aria-hidden":"true","data-theme":t.id,className:"flex h-24 overflow-hidden rounded-md border ".concat("dark"===t.mode?"dark":""),style:{background:"var(--background)",borderColor:"var(--border)"},children:[(0,a.jsxs)("div",{className:"w-1/4 space-y-2 border-r p-2",style:{background:"var(--sidebar)",borderColor:"var(--border)"},children:[(0,a.jsx)("div",{className:"h-2 w-2/3 rounded-sm",style:{background:"var(--foreground)"}}),(0,a.jsx)("div",{className:"h-1.5 w-full rounded-sm",style:{background:"var(--muted)"}}),(0,a.jsx)("div",{className:"h-1.5 w-3/4 rounded-sm",style:{background:"var(--muted)"}})]}),(0,a.jsxs)("div",{className:"flex-1 space-y-2 p-3",children:[(0,a.jsx)("div",{className:"h-1.5 w-1/3 rounded-sm",style:{background:"var(--foreground)"}}),(0,a.jsx)("div",{className:"flex gap-2",children:[1,2].map(e=>(0,a.jsxs)("div",{className:"flex-1 space-y-2 rounded-sm border p-2",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,a.jsx)("div",{className:"h-1 w-2/3 rounded-sm",style:{background:"var(--muted-foreground)"}}),(0,a.jsx)("div",{className:"h-2 w-1/3 rounded-sm",style:{background:"var(--primary)"}})]},e))})]})]})}var j=s(96042);function y(){let{theme:e,resolvedStyle:t,setTheme:s}=(0,j.D)(),r=f.zG.find(e=>e.id===t);return(0,a.jsxs)("section",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6","aria-labelledby":"appearance-heading",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(m.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("h2",{id:"appearance-heading",className:"text-sm font-medium",children:"Appearance"})]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose the style that feels right for you."})]}),(0,a.jsxs)("div",{className:"lg:col-span-2 space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border p-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)(p.J,{htmlFor:"system-appearance",className:"flex items-center gap-2",children:[(0,a.jsx)(x.A,{className:"h-4 w-4"})," Follow system appearance"]}),(0,a.jsx)("p",{id:"system-appearance-description",className:"mt-1 text-xs text-muted-foreground",children:"Automatically switch between Slate Light and Slate Dark to match your device."})]}),(0,a.jsx)(h.d,{id:"system-appearance","aria-describedby":"system-appearance-description",checked:"system"===e,onCheckedChange:e=>s(e?"system":t)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Choose a style"}),(0,a.jsx)("p",{id:"theme-choice-description",className:"mt-1 text-xs text-muted-foreground",children:"Two light styles and two dark styles. Selecting one turns off system appearance."}),(0,a.jsx)("div",{role:"group","aria-label":"Color theme","aria-describedby":"theme-choice-description",className:"mt-3 grid grid-cols-1 sm:grid-cols-2 gap-3",children:f.zG.map(r=>{let n=e===r.id;return(0,a.jsxs)("button",{type:"button","aria-label":r.label,"aria-pressed":n,className:"rounded-lg border p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background ".concat(n?"border-primary bg-accent/40 ring-1 ring-primary":"border-border hover:border-muted-foreground"),onClick:()=>s(r.id),children:[(0,a.jsx)(v,{theme:r}),(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:r.label}),n&&(0,a.jsx)(g.A,{"aria-hidden":"true",className:"h-4 w-4"}),"system"===e&&t===r.id&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"In use"})]}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:r.description})]},r.id)})})]}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["system"===e?"System appearance is on. Currently using ".concat(r.label,"."):"".concat(r.label," is selected.")," ","Your choice is saved in this browser."]})]})]})}var b=s(24323),N=s(25164),w=s(3998),k=s(65142),C=s(11647),A=s(86259),S=s(18332),E=s(61362),z=s(50803),F=s(20508),L=s(18514),P=s(65229),T=s(19408),O=s(16485),D=s(26341),_=s(23327),U=s(71360),$=s(20243),I=s(98053);let M=(0,o.h)("ProfilePage");function J(e){return e?new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long",day:"numeric"}).format(e):"N/A"}let R=()=>{let{logout:e,provider:t}=(0,d.h)(),s=(0,n.useRouter)(),[l,o]=(0,r.useState)(null),[m,x]=(0,r.useState)(null),[g,h]=(0,r.useState)(""),[f,v]=(0,r.useState)(""),[j,R]=(0,r.useState)(""),[V,Y]=(0,r.useState)(!0),[H,Z]=(0,r.useState)(!1),[q,G]=(0,r.useState)(!1),[B,W]=(0,r.useState)(!1),[X,Q]=(0,r.useState)(!1),[K,ee]=(0,r.useState)(!1),[et,es]=(0,r.useState)(!1),[ea,er]=(0,r.useState)(null),[en,el]=(0,r.useState)(!1),ei=async e=>{if(l){el(!0);try{await (0,b.T)(e),o({...l,analyticsConsent:e})}catch(e){M.error({err:e},"Failed to update analytics consent"),er({type:"error",message:"Failed to update your analytics preference. Please try again."})}finally{el(!1)}}},ed=(0,r.useCallback)(async()=>{Y(!0),er(null);try{let e=await c.userApi.userMeRetrieve();if(o(e),h(e.firstName||""),v(e.lastName||""),e.organization)try{let e=await c.Iu.organizationMeRetrieve();x(e),R(e.name||"")}catch(e){M.error({err:e},"Failed to fetch organization details"),er({type:"error",message:"Could not load organization details: ".concat(e.message)})}}catch(e){M.error({err:e},"Failed to fetch profile data"),er({type:"error",message:"Failed to load your profile: ".concat(e.message)})}finally{Y(!1)}},[]);(0,r.useEffect)(()=>{ed()},[ed]);let ec=async()=>{if(l){Z(!0),er(null),M.debug("Attempting to update user profile");try{let e=await c.userApi.userMeUpdate({userProfileRequest:{firstName:g,lastName:f}});M.info({},"User profile updated successfully"),o(e),h(e.firstName||""),v(e.lastName||""),er({type:"success",message:"Profile updated successfully!"}),Q(!1),ee(!1)}catch(a){var e,t,s;M.error({err:a,details:null==(e=a.response)?void 0:e.data},"Failed to update user profile"),er({type:"error",message:"Failed to update profile: ".concat((null==(s=a.response)||null==(t=s.data)?void 0:t.detail)||a.message||"Unknown error")})}finally{Z(!1)}}},eo=async()=>{if(m){G(!0),er(null),M.debug({orgId:m.id},"Attempting to update organization");try{let e=await c.Iu.organizationPartialUpdate({id:m.id,patchedOrganizationRequest:{name:j}});M.info({},"Organization updated successfully"),x(e),R(e.name||""),er({type:"success",message:"Organization name updated successfully!"}),es(!1)}catch(a){var e,t,s;M.error({err:a,details:null==(e=a.response)?void 0:e.data},"Failed to update organization name"),er({type:"error",message:"Failed to update organization name: ".concat((null==(s=a.response)||null==(t=s.data)?void 0:t.detail)||a.message||"Unknown error")})}finally{G(!1)}}},eu=async()=>{if(!l||!l.id)return void er({type:"error",message:"User profile not loaded or profile ID is missing."});W(!0),er(null);try{await c.userApi.userDestroy({id:l.id}),er({type:"success",message:"Account deleted successfully. You will be logged out."}),e&&await e(),s.push("/login")}catch(e){M.error({err:e},"Failed to delete account"),er({type:"error",message:"Failed to delete account: ".concat(e.message)})}finally{W(!1)}};if(V)return(0,a.jsx)(u.M,{title:"Settings",children:(0,a.jsxs)("div",{className:"border divide-y mx-6",children:[(0,a.jsxs)("div",{className:"p-6 flex items-center gap-4",children:[(0,a.jsx)($.E,{className:"h-14 w-14 rounded-full"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)($.E,{className:"h-5 w-40"}),(0,a.jsx)($.E,{className:"h-4 w-24"})]})]}),[1,2,3].map(e=>(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)($.E,{className:"h-4 w-32"}),(0,a.jsx)($.E,{className:"h-3 w-48"})]}),(0,a.jsx)("div",{className:"lg:col-span-2 grid grid-cols-1 md:grid-cols-2 gap-4",children:[1,2].map(e=>(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)($.E,{className:"h-3 w-20"}),(0,a.jsx)($.E,{className:"h-9 w-full"})]},e))})]},e))]})});let em=[null==l?void 0:l.firstName,null==l?void 0:l.lastName].filter(Boolean).join(" ")||(null==l?void 0:l.username)||"User",ex=function(e,t,s){return e&&t?"".concat(e[0]).concat(t[0]).toUpperCase():e?e[0].toUpperCase():s?s[0].toUpperCase():"?"}(null==l?void 0:l.firstName,null==l?void 0:l.lastName,null==l?void 0:l.username);return(0,a.jsxs)(u.M,{title:"Settings",children:[ea&&(0,a.jsxs)(S.Fc,{variant:"error"===ea.type?"destructive":"default",className:"mx-6 mb-4 border-l-4",children:["success"===ea.type?(0,a.jsx)(E.A,{className:"h-4 w-4"}):(0,a.jsx)(z.A,{className:"h-4 w-4"}),(0,a.jsx)(S.XL,{children:"success"===ea.type?"Success":"Error"}),(0,a.jsx)(S.TN,{children:ea.message})]}),(0,a.jsxs)("div",{className:"border divide-y mx-6",children:[(0,a.jsxs)("div",{className:"p-6 flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[(0,a.jsx)("div",{className:"flex-shrink-0 h-14 w-14 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center text-xl font-bold text-primary select-none",children:ex}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h2",{className:"text-base font-semibold truncate",children:em}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-0.5",children:[(null==l?void 0:l.username)&&(0,a.jsxs)(C.E,{variant:"secondary",className:"font-mono text-xs",children:["@",l.username]}),(null==l?void 0:l.email)&&(0,a.jsx)("span",{className:"text-sm text-muted-foreground truncate",children:l.email})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(F.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Personal Information"})]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Your name and account details. Name changes are reflected across the platform."})]}),(0,a.jsxs)("div",{className:"lg:col-span-2 space-y-5",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(p.J,{htmlFor:X?"firstName":"staticFirstName",className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"First Name"}),(0,a.jsx)("div",{className:"relative group",children:X?(0,a.jsx)(k.p,{id:"firstName",value:g,onChange:e=>h(e.target.value),placeholder:"Your first name",disabled:H,className:"h-9 pr-10"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{id:"staticFirstName",className:"text-sm px-3 h-9 flex items-center border rounded bg-muted/40 w-full pr-10",children:(null==l?void 0:l.firstName)||(0,a.jsx)("span",{className:"text-muted-foreground italic",children:"Not set"})}),(0,a.jsx)(w.$,{variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 opacity-0 group-hover:opacity-100 focus-visible:opacity-100",onClick:()=>{Q(!0),h((null==l?void 0:l.firstName)||"")},"aria-label":"Edit first name",children:(0,a.jsx)(L.A,{className:"h-3.5 w-3.5"})})]})})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(p.J,{htmlFor:K?"lastName":"staticLastName",className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Last Name"}),(0,a.jsx)("div",{className:"relative group",children:K?(0,a.jsx)(k.p,{id:"lastName",value:f,onChange:e=>v(e.target.value),placeholder:"Your last name",disabled:H,className:"h-9 pr-10"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{id:"staticLastName",className:"text-sm px-3 h-9 flex items-center border rounded bg-muted/40 w-full pr-10",children:(null==l?void 0:l.lastName)||(0,a.jsx)("span",{className:"text-muted-foreground italic",children:"Not set"})}),(0,a.jsx)(w.$,{variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 opacity-0 group-hover:opacity-100 focus-visible:opacity-100",onClick:()=>{ee(!0),v((null==l?void 0:l.lastName)||"")},"aria-label":"Edit last name",children:(0,a.jsx)(L.A,{className:"h-3.5 w-3.5"})})]})})]})]}),(0,a.jsx)(A.w,{}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Username"}),(0,a.jsx)("div",{className:"text-sm px-3 h-9 flex items-center border rounded bg-muted/20 font-mono text-muted-foreground",children:(null==l?void 0:l.username)||"—"})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Email Address"}),(0,a.jsx)("div",{className:"text-sm px-3 h-9 flex items-center border rounded bg-muted/20 text-muted-foreground truncate",children:(null==l?void 0:l.email)||"—"})]})]}),(X||K)&&(0,a.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,a.jsxs)(w.$,{variant:"outline",onClick:()=>{h((null==l?void 0:l.firstName)||""),v((null==l?void 0:l.lastName)||""),Q(!1),ee(!1)},disabled:H,children:[(0,a.jsx)(P.A,{className:"mr-2 h-4 w-4"})," Cancel"]}),(0,a.jsx)(w.$,{onClick:ec,disabled:H,children:H?"Saving…":"Save Changes"})]})]})]}),(m||!V)&&(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(T.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Organization"})]}),m?(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Details for your organization. Manage consumption and credits on the Usage page."}):(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"No organization associated with this account."})]}),m&&(0,a.jsxs)("div",{className:"lg:col-span-2 space-y-5",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(p.J,{htmlFor:et?"orgName":"staticOrgName",className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Organization Name"}),(0,a.jsx)("div",{className:"relative group",children:et?(0,a.jsx)(k.p,{id:"orgName",value:j,onChange:e=>R(e.target.value),placeholder:"Your organization's name",disabled:q,className:"h-9 pr-10"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{id:"staticOrgName",className:"text-sm px-3 h-9 flex items-center border rounded bg-muted/40 w-full pr-10",children:m.name||(0,a.jsx)("span",{className:"text-muted-foreground italic",children:"Not set"})}),(0,a.jsx)(w.$,{variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 opacity-0 group-hover:opacity-100 focus-visible:opacity-100",onClick:()=>{es(!0),R(m.name||"")},"aria-label":"Edit organization name",children:(0,a.jsx)(L.A,{className:"h-3.5 w-3.5"})})]})})]}),(0,a.jsx)(A.w,{}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"border bg-muted/30 px-4 py-3 flex flex-col gap-0.5",children:[(0,a.jsxs)("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5",children:[(0,a.jsx)(O.A,{className:"h-3 w-3"})," Created"]}),(0,a.jsx)("span",{className:"text-sm font-medium mt-1",children:J(m.createdAt)})]}),(0,a.jsxs)("div",{className:"border bg-muted/30 px-4 py-3 flex flex-col gap-0.5",children:[(0,a.jsxs)("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5",children:[(0,a.jsx)(O.A,{className:"h-3 w-3"})," Last Updated"]}),(0,a.jsx)("span",{className:"text-sm font-medium mt-1",children:J(m.updatedAt)})]})]}),(0,a.jsx)(w.$,{asChild:!0,variant:"outline",children:(0,a.jsx)(i(),{href:"/usage",children:"View usage"})}),et&&(0,a.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,a.jsxs)(w.$,{variant:"outline",onClick:()=>{R((null==m?void 0:m.name)||""),es(!1)},disabled:q,children:[(0,a.jsx)(P.A,{className:"mr-2 h-4 w-4"})," Cancel"]}),(0,a.jsx)(w.$,{onClick:eo,disabled:q,children:q?"Saving…":"Save Organization"})]})]})]}),(0,a.jsx)(y,{}),"disabled"!==t&&(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(D.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Privacy"})]}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground mt-1",children:["Control analytics cookies. See our"," ",(0,a.jsx)("a",{href:"https://hackagent.dev/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Privacy Policy"}),"."]})]}),(0,a.jsx)("div",{className:"lg:col-span-2",children:(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Analytics"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:(null==l?void 0:l.analyticsConsent)==="accepted"?"Enabled — helps us understand how HackAgent is used.":(null==l?void 0:l.analyticsConsent)==="declined"?"Disabled — no analytics are collected for your account.":"Not yet decided."})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 border bg-muted/40 p-1",children:[(0,a.jsx)(w.$,{variant:(null==l?void 0:l.analyticsConsent)==="declined"?"secondary":"ghost",size:"sm",className:"h-8 px-3",disabled:en,onClick:()=>ei("declined"),children:"Disabled"}),(0,a.jsx)(w.$,{variant:(null==l?void 0:l.analyticsConsent)==="accepted"?"secondary":"ghost",size:"sm",className:"h-8 px-3",disabled:en,onClick:()=>ei("accepted"),children:"Enabled"})]})]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(_.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("h2",{className:"text-sm font-medium",children:"About"})]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"The release of HackAgent you are running."})]}),(0,a.jsx)("div",{className:"lg:col-span-2",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"HackAgent dashboard"}),(0,a.jsx)(C.E,{variant:"secondary",className:"font-mono text-xs",children:N.W})]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-destructive",children:"Danger Zone"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible actions. Please read carefully before proceeding."})]}),(0,a.jsx)("div",{className:"lg:col-span-2",children:(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 border border-destructive/30 bg-destructive/5 px-4 py-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Delete Account"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Permanently remove your account and all associated data. This cannot be undone."})]}),(0,a.jsxs)(I.Lt,{children:[(0,a.jsx)(I.tv,{asChild:!0,children:(0,a.jsxs)(w.$,{variant:"destructive",size:"sm",disabled:B,className:"shrink-0",children:[(0,a.jsx)(U.A,{className:"mr-2 h-4 w-4"}),B?"Deleting…":"Delete Account"]})}),(0,a.jsxs)(I.EO,{children:[(0,a.jsxs)(I.wd,{children:[(0,a.jsx)(I.r7,{children:"Are you absolutely sure?"}),(0,a.jsx)(I.$v,{children:"This action cannot be undone. This will permanently delete your account and remove all your data from our servers."})]}),(0,a.jsxs)(I.ck,{children:[(0,a.jsx)(I.Zr,{children:"Cancel"}),(0,a.jsx)(I.Rx,{onClick:eu,disabled:B,className:"bg-destructive hover:bg-destructive/90",children:B?"Deleting…":"Yes, delete my account"})]})]})]})]})})]})]})]})}},11647:(e,t,s)=>{"use strict";s.d(t,{E:()=>d});var a=s(95155);s(12115);var r=s(32467),n=s(83101),l=s(64269);let i=(0,n.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function d(e){let{className:t,variant:s,asChild:n=!1,...d}=e,c=n?r.DX:"span";return(0,a.jsx)(c,{"data-slot":"badge",className:(0,l.cn)(i({variant:s}),t),...d})}},18332:(e,t,s)=>{"use strict";s.d(t,{Fc:()=>i,TN:()=>c,XL:()=>d});var a=s(95155);s(12115);var r=s(83101),n=s(64269);let l=(0,r.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function i(e){let{className:t,variant:s,...r}=e;return(0,a.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,n.cn)(l({variant:s}),t),...r})}function d(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-title",className:(0,n.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...s})}function c(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-description",className:(0,n.cn)("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...s})}},20243:(e,t,s)=>{"use strict";s.d(t,{E:()=>n});var a=s(95155),r=s(64269);function n(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"skeleton",className:(0,r.cn)("bg-accent animate-pulse rounded-md",t),...s})}},22470:(e,t,s)=>{"use strict";s.d(t,{M:()=>r});var a=s(95155);s(12115);let r=e=>{let{title:t,description:s,action:r,children:n,maxWidth:l="full",compact:i=!1}=e;return(0,a.jsxs)("div",{className:"w-full ".concat({full:"max-w-full","8xl":"max-w-[90rem]","7xl":"max-w-7xl","6xl":"max-w-6xl","5xl":"max-w-5xl","4xl":"max-w-4xl","3xl":"max-w-3xl","2xl":"max-w-2xl"}[l]||"max-w-full"," mx-auto ").concat(i?"py-3 space-y-3":"py-6 space-y-6"),children:[t&&(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 border-b ".concat(i?"px-4 pb-3":"px-6 pb-5"),children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:t}),s&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:s})]}),r&&(0,a.jsx)("div",{className:"flex-shrink-0 pt-0.5",children:r})]}),n]})}},24323:(e,t,s)=>{"use strict";s.d(t,{P:()=>h,T:()=>g});var a=s(95155),r=s(12115),n=s(52619),l=s.n(n),i=s(68321),d=s(76784),c=s(7831),o=s(41444),u=s(3998),m=s(51834);let x=(0,o.h)("AnalyticsConsent");async function g(e){await c.userApi.userMeUpdate({userProfileRequest:{analyticsConsent:e}})}function h(){let[e,t]=(0,r.useState)(null),s=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=!1;return c.userApi.userMeRetrieve().then(s=>{var a;e||t(null!=(a=s.analyticsConsent)?a:"unset")}).catch(e=>{x.debug({err:e},"Could not load analytics consent (not authenticated yet?)")}),()=>{e=!0}},[]);let n=async e=>{s.current=!0,t(e);try{await g(e)}catch(e){x.error({err:e},"Failed to save analytics consent")}};return(0,a.jsxs)(a.Fragment,{children:["accepted"===e&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.GoogleAnalytics,{gaId:"G-2P6K2HWVEE"}),(0,a.jsx)(i.default,{id:"microsoft-clarity",strategy:"afterInteractive",children:'(function(c,l,a,r,i,t,y){\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\n t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\n })(window, document, "clarity", "script", "xowemo04qg");'})]}),(0,a.jsx)(m.lG,{open:"unset"===e,onOpenChange:e=>{e||s.current||n("declined")},children:(0,a.jsxs)(m.Cf,{children:[(0,a.jsxs)(m.c7,{children:[(0,a.jsx)(m.L3,{children:"Help us improve HackAgent"}),(0,a.jsxs)(m.rr,{children:["We'd like to use optional analytics to understand how HackAgent is used. This is separate from the cookies that keep you signed in, and you can change it anytime in Settings. See our"," ",(0,a.jsx)(l(),{href:"https://hackagent.dev/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Privacy Policy"}),"."]})]}),(0,a.jsxs)(m.Es,{children:[(0,a.jsx)(u.$,{variant:"outline",onClick:()=>n("declined"),children:"Not now"}),(0,a.jsx)(u.$,{onClick:()=>n("accepted"),children:"Sounds good"})]})]})})]})}},25164:(e,t,s)=>{"use strict";s.d(t,{W:()=>r});let a="0.6.4-stage",r=/^\d/.test(a)?"v".concat(a):a},34105:(e,t,s)=>{"use strict";s.d(t,{c:()=>a});let a=(0,s(12115).createContext)(void 0)},44846:(e,t,s)=>{"use strict";s.d(t,{d:()=>l});var a=s(95155);s(12115);var r=s(45927),n=s(64269);function l(e){let{className:t,...s}=e;return(0,a.jsx)(r.bL,{"data-slot":"switch",className:(0,n.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:(0,a.jsx)(r.zi,{"data-slot":"switch-thumb",className:(0,n.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},51834:(e,t,s)=>{"use strict";s.d(t,{Cf:()=>u,Es:()=>x,HM:()=>c,L3:()=>g,c7:()=>m,lG:()=>i,rr:()=>h});var a=s(95155);s(12115);var r=s(88292),n=s(65229),l=s(64269);function i(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"dialog",...t})}function d(e){let{...t}=e;return(0,a.jsx)(r.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{...t}=e;return(0,a.jsx)(r.bm,{"data-slot":"dialog-close",...t})}function o(e){let{className:t,...s}=e;return(0,a.jsx)(r.hJ,{"data-slot":"dialog-overlay",className:(0,l.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function u(e){let{className:t,children:s,...i}=e;return(0,a.jsxs)(d,{"data-slot":"dialog-portal",children:[(0,a.jsx)(o,{}),(0,a.jsxs)(r.UC,{"data-slot":"dialog-content",className:(0,l.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...i,children:[s,(0,a.jsxs)(r.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,a.jsx)(n.A,{}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function m(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"dialog-header",className:(0,l.cn)("flex flex-col gap-2 text-center sm:text-left",t),...s})}function x(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"dialog-footer",className:(0,l.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s})}function g(e){let{className:t,...s}=e;return(0,a.jsx)(r.hE,{"data-slot":"dialog-title",className:(0,l.cn)("text-lg leading-none font-semibold",t),...s})}function h(e){let{className:t,...s}=e;return(0,a.jsx)(r.VY,{"data-slot":"dialog-description",className:(0,l.cn)("text-muted-foreground text-sm",t),...s})}},65142:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var a=s(95155);s(12115);var r=s(64269);function n(e){let{className:t,type:s,...n}=e;return(0,a.jsx)("input",{type:s,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}},73474:(e,t,s)=>{"use strict";s.d(t,{Bc:()=>r,NQ:()=>i,zG:()=>a,wN:()=>l,AZ:()=>x,V$:()=>u,eW:()=>c,of:()=>m,_9:()=>o,f_:()=>d});let a=[{id:"classic-light",label:"Classic Light",mode:"light",description:"Soft neutral grays and a quiet, minimal feel."},{id:"slate-light",label:"Slate Light",mode:"light",description:"Cool slate surfaces with crisp white cards."},{id:"classic-dark",label:"Classic Dark",mode:"dark",description:"The original charcoal and neutral gray palette."},{id:"slate-dark",label:"Slate Dark",mode:"dark",description:"The current deep blue and slate palette."}],r={light:"slate-light",dark:"slate-dark"},n={light:"slate-light",dark:"slate-dark"},l="hackagent-theme",i="(prefers-color-scheme: dark)";function d(e){var t,s;return"light"===e||"dark"===e?n[e]:null!=(s=null==(t=a.find(t=>t.id===e))?void 0:t.id)?s:"system"}function c(e,t){let s="system"===e?r[t]:e;return a.find(e=>e.id===s)}function o(){return window.matchMedia(i).matches?"dark":"light"}function u(){try{return d(localStorage.getItem(l))}catch(e){return"system"}}function m(e){try{localStorage.setItem(l,e)}catch(e){}}function x(e){let t=document.documentElement;t.dataset.theme=e.id,t.classList.toggle("dark","dark"===e.mode),t.style.colorScheme=e.mode}let g=Object.fromEntries(a.map(e=>[e.id,e.mode]));"(() => {\n const modes = ".concat(JSON.stringify(g),";\n const defaults = ").concat(JSON.stringify(r),";\n const legacy = ").concat(JSON.stringify(n),";\n let preference;\n try { preference = localStorage.getItem('").concat(l,"'); } catch {}\n if (preference === 'light' || preference === 'dark') preference = legacy[preference];\n const system = window.matchMedia('").concat(i,"').matches ? 'dark' : 'light';\n const id = Object.prototype.hasOwnProperty.call(modes, preference) ? preference : defaults[system];\n document.documentElement.dataset.theme = id;\n document.documentElement.classList.toggle('dark', modes[id] === 'dark');\n document.documentElement.style.colorScheme = modes[id];\n})();")},76444:(e,t,s)=>{"use strict";s.d(t,{J:()=>l});var a=s(95155);s(12115);var r=s(85408),n=s(64269);function l(e){let{className:t,...s}=e;return(0,a.jsx)(r.b,{"data-slot":"label",className:(0,n.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",t),...s})}},76853:(e,t,s)=>{Promise.resolve().then(s.bind(s,1577))},80230:(e,t,s)=>{"use strict";s.d(t,{h:()=>l});var a=s(12115),r=s(34105);let n=async()=>"";function l(){let e=(0,a.useContext)(r.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:n}}},86259:(e,t,s)=>{"use strict";s.d(t,{w:()=>l});var a=s(95155);s(12115);var r=s(57268),n=s(64269);function l(e){let{className:t,orientation:s="horizontal",decorative:l=!0,...i}=e;return(0,a.jsx)(r.b,{"data-slot":"separator-root",decorative:l,orientation:s,className:(0,n.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...i})}},96042:(e,t,s)=>{"use strict";s.d(t,{D:()=>i,ThemeProvider:()=>d});var a=s(95155),r=s(12115),n=s(73474);let l=(0,r.createContext)({theme:"system",resolvedTheme:"light",resolvedStyle:n.Bc.light,setTheme:()=>{}});function i(){return(0,r.useContext)(l)}function d(e){let{children:t}=e,[s,i]=(0,r.useState)({theme:"system",resolvedTheme:"light",resolvedStyle:n.Bc.light}),d=(0,r.useCallback)(e=>{let t=(0,n.eW)(e,(0,n._9)());(0,n.AZ)(t),i({theme:e,resolvedTheme:t.mode,resolvedStyle:t.id})},[]);(0,r.useEffect)(()=>{d((0,n.V$)());let e=e=>{(e.key===n.wN||null===e.key)&&d((0,n.f_)(e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[d]),(0,r.useEffect)(()=>{if("system"!==s.theme)return;let e=window.matchMedia(n.NQ),t=()=>d("system");return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[s.theme,d]);let c=(0,r.useCallback)(e=>{d(e),(0,n.of)(e)},[d]);return(0,a.jsx)(l.Provider,{value:{...s,setTheme:c},children:t})}},98053:(e,t,s)=>{"use strict";s.d(t,{$v:()=>h,EO:()=>u,Lt:()=>i,Rx:()=>p,Zr:()=>f,ck:()=>x,r7:()=>g,tv:()=>d,wd:()=>m});var a=s(95155);s(12115);var r=s(35646),n=s(64269),l=s(3998);function i(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"alert-dialog",...t})}function d(e){let{...t}=e;return(0,a.jsx)(r.l9,{"data-slot":"alert-dialog-trigger",...t})}function c(e){let{...t}=e;return(0,a.jsx)(r.ZL,{"data-slot":"alert-dialog-portal",...t})}function o(e){let{className:t,...s}=e;return(0,a.jsx)(r.hJ,{"data-slot":"alert-dialog-overlay",className:(0,n.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function u(e){let{className:t,...s}=e;return(0,a.jsxs)(c,{children:[(0,a.jsx)(o,{}),(0,a.jsx)(r.UC,{"data-slot":"alert-dialog-content",className:(0,n.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...s})]})}function m(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,n.cn)("flex flex-col gap-2 text-center sm:text-left",t),...s})}function x(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,n.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s})}function g(e){let{className:t,...s}=e;return(0,a.jsx)(r.hE,{"data-slot":"alert-dialog-title",className:(0,n.cn)("text-lg font-semibold",t),...s})}function h(e){let{className:t,...s}=e;return(0,a.jsx)(r.VY,{"data-slot":"alert-dialog-description",className:(0,n.cn)("text-muted-foreground text-sm",t),...s})}function p(e){let{className:t,...s}=e;return(0,a.jsx)(r.rc,{className:(0,n.cn)((0,l.r)(),t),...s})}function f(e){let{className:t,...s}=e;return(0,a.jsx)(r.ZD,{className:(0,n.cn)((0,l.r)({variant:"outline"}),t),...s})}}},e=>{e.O(0,[187,272,619,888,921,747,924,441,493,358],()=>e(e.s=76853)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[636],{1577:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>R});var a=s(95155),r=s(12115),n=s(20063),l=s(52619),i=s.n(l),d=s(80230),c=s(7831),o=s(41444),u=s(22470),m=s(39926),x=s(79451),g=s(5917),h=s(44846),p=s(76444),f=s(73474);function v(e){let{theme:t}=e;return(0,a.jsxs)("div",{"aria-hidden":"true","data-theme":t.id,className:"flex h-24 overflow-hidden rounded-md border ".concat("dark"===t.mode?"dark":""),style:{background:"var(--background)",borderColor:"var(--border)"},children:[(0,a.jsxs)("div",{className:"w-1/4 space-y-2 border-r p-2",style:{background:"var(--sidebar)",borderColor:"var(--border)"},children:[(0,a.jsx)("div",{className:"h-2 w-2/3 rounded-sm",style:{background:"var(--foreground)"}}),(0,a.jsx)("div",{className:"h-1.5 w-full rounded-sm",style:{background:"var(--muted)"}}),(0,a.jsx)("div",{className:"h-1.5 w-3/4 rounded-sm",style:{background:"var(--muted)"}})]}),(0,a.jsxs)("div",{className:"flex-1 space-y-2 p-3",children:[(0,a.jsx)("div",{className:"h-1.5 w-1/3 rounded-sm",style:{background:"var(--foreground)"}}),(0,a.jsx)("div",{className:"flex gap-2",children:[1,2].map(e=>(0,a.jsxs)("div",{className:"flex-1 space-y-2 rounded-sm border p-2",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,a.jsx)("div",{className:"h-1 w-2/3 rounded-sm",style:{background:"var(--muted-foreground)"}}),(0,a.jsx)("div",{className:"h-2 w-1/3 rounded-sm",style:{background:"var(--primary)"}})]},e))})]})]})}var j=s(96042);function y(){let{theme:e,resolvedStyle:t,setTheme:s}=(0,j.D)(),r=f.zG.find(e=>e.id===t);return(0,a.jsxs)("section",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6","aria-labelledby":"appearance-heading",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(m.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("h2",{id:"appearance-heading",className:"text-sm font-medium",children:"Appearance"})]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose the style that feels right for you."})]}),(0,a.jsxs)("div",{className:"lg:col-span-2 space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border p-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)(p.J,{htmlFor:"system-appearance",className:"flex items-center gap-2",children:[(0,a.jsx)(x.A,{className:"h-4 w-4"})," Follow system appearance"]}),(0,a.jsx)("p",{id:"system-appearance-description",className:"mt-1 text-xs text-muted-foreground",children:"Automatically switch between Slate Light and Slate Dark to match your device."})]}),(0,a.jsx)(h.d,{id:"system-appearance","aria-describedby":"system-appearance-description",checked:"system"===e,onCheckedChange:e=>s(e?"system":t)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Choose a style"}),(0,a.jsx)("p",{id:"theme-choice-description",className:"mt-1 text-xs text-muted-foreground",children:"Two light styles and two dark styles. Selecting one turns off system appearance."}),(0,a.jsx)("div",{role:"group","aria-label":"Color theme","aria-describedby":"theme-choice-description",className:"mt-3 grid grid-cols-1 sm:grid-cols-2 gap-3",children:f.zG.map(r=>{let n=e===r.id;return(0,a.jsxs)("button",{type:"button","aria-label":r.label,"aria-pressed":n,className:"rounded-lg border p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background ".concat(n?"border-primary bg-accent/40 ring-1 ring-primary":"border-border hover:border-muted-foreground"),onClick:()=>s(r.id),children:[(0,a.jsx)(v,{theme:r}),(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:r.label}),n&&(0,a.jsx)(g.A,{"aria-hidden":"true",className:"h-4 w-4"}),"system"===e&&t===r.id&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"In use"})]}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:r.description})]},r.id)})})]}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["system"===e?"System appearance is on. Currently using ".concat(r.label,"."):"".concat(r.label," is selected.")," ","Your choice is saved in this browser."]})]})]})}var b=s(24323),N=s(25164),w=s(3998),k=s(65142),C=s(11647),A=s(86259),S=s(18332),E=s(61362),z=s(50803),F=s(20508),L=s(18514),P=s(65229),T=s(19408),O=s(16485),D=s(26341),_=s(23327),U=s(71360),$=s(20243),I=s(98053);let M=(0,o.h)("ProfilePage");function J(e){return e?new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long",day:"numeric"}).format(e):"N/A"}let R=()=>{let{logout:e,provider:t}=(0,d.h)(),s=(0,n.useRouter)(),[l,o]=(0,r.useState)(null),[m,x]=(0,r.useState)(null),[g,h]=(0,r.useState)(""),[f,v]=(0,r.useState)(""),[j,R]=(0,r.useState)(""),[V,Y]=(0,r.useState)(!0),[H,Z]=(0,r.useState)(!1),[q,G]=(0,r.useState)(!1),[B,W]=(0,r.useState)(!1),[X,Q]=(0,r.useState)(!1),[K,ee]=(0,r.useState)(!1),[et,es]=(0,r.useState)(!1),[ea,er]=(0,r.useState)(null),[en,el]=(0,r.useState)(!1),ei=async e=>{if(l){el(!0);try{await (0,b.T)(e),o({...l,analyticsConsent:e})}catch(e){M.error({err:e},"Failed to update analytics consent"),er({type:"error",message:"Failed to update your analytics preference. Please try again."})}finally{el(!1)}}},ed=(0,r.useCallback)(async()=>{Y(!0),er(null);try{let e=await c.userApi.userMeRetrieve();if(o(e),h(e.firstName||""),v(e.lastName||""),e.organization)try{let e=await c.Iu.organizationMeRetrieve();x(e),R(e.name||"")}catch(e){M.error({err:e},"Failed to fetch organization details"),er({type:"error",message:"Could not load organization details: ".concat(e.message)})}}catch(e){M.error({err:e},"Failed to fetch profile data"),er({type:"error",message:"Failed to load your profile: ".concat(e.message)})}finally{Y(!1)}},[]);(0,r.useEffect)(()=>{ed()},[ed]);let ec=async()=>{if(l){Z(!0),er(null),M.debug("Attempting to update user profile");try{let e=await c.userApi.userMeUpdate({userProfileRequest:{firstName:g,lastName:f}});M.info({},"User profile updated successfully"),o(e),h(e.firstName||""),v(e.lastName||""),er({type:"success",message:"Profile updated successfully!"}),Q(!1),ee(!1)}catch(a){var e,t,s;M.error({err:a,details:null==(e=a.response)?void 0:e.data},"Failed to update user profile"),er({type:"error",message:"Failed to update profile: ".concat((null==(s=a.response)||null==(t=s.data)?void 0:t.detail)||a.message||"Unknown error")})}finally{Z(!1)}}},eo=async()=>{if(m){G(!0),er(null),M.debug({orgId:m.id},"Attempting to update organization");try{let e=await c.Iu.organizationPartialUpdate({id:m.id,patchedOrganizationRequest:{name:j}});M.info({},"Organization updated successfully"),x(e),R(e.name||""),er({type:"success",message:"Organization name updated successfully!"}),es(!1)}catch(a){var e,t,s;M.error({err:a,details:null==(e=a.response)?void 0:e.data},"Failed to update organization name"),er({type:"error",message:"Failed to update organization name: ".concat((null==(s=a.response)||null==(t=s.data)?void 0:t.detail)||a.message||"Unknown error")})}finally{G(!1)}}},eu=async()=>{if(!l||!l.id)return void er({type:"error",message:"User profile not loaded or profile ID is missing."});W(!0),er(null);try{await c.userApi.userDestroy({id:l.id}),er({type:"success",message:"Account deleted successfully. You will be logged out."}),e&&await e(),s.push("/login")}catch(e){M.error({err:e},"Failed to delete account"),er({type:"error",message:"Failed to delete account: ".concat(e.message)})}finally{W(!1)}};if(V)return(0,a.jsx)(u.M,{title:"Settings",children:(0,a.jsxs)("div",{className:"border divide-y mx-6",children:[(0,a.jsxs)("div",{className:"p-6 flex items-center gap-4",children:[(0,a.jsx)($.E,{className:"h-14 w-14 rounded-full"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)($.E,{className:"h-5 w-40"}),(0,a.jsx)($.E,{className:"h-4 w-24"})]})]}),[1,2,3].map(e=>(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)($.E,{className:"h-4 w-32"}),(0,a.jsx)($.E,{className:"h-3 w-48"})]}),(0,a.jsx)("div",{className:"lg:col-span-2 grid grid-cols-1 md:grid-cols-2 gap-4",children:[1,2].map(e=>(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)($.E,{className:"h-3 w-20"}),(0,a.jsx)($.E,{className:"h-9 w-full"})]},e))})]},e))]})});let em=[null==l?void 0:l.firstName,null==l?void 0:l.lastName].filter(Boolean).join(" ")||(null==l?void 0:l.username)||"User",ex=function(e,t,s){return e&&t?"".concat(e[0]).concat(t[0]).toUpperCase():e?e[0].toUpperCase():s?s[0].toUpperCase():"?"}(null==l?void 0:l.firstName,null==l?void 0:l.lastName,null==l?void 0:l.username);return(0,a.jsxs)(u.M,{title:"Settings",children:[ea&&(0,a.jsxs)(S.Fc,{variant:"error"===ea.type?"destructive":"default",className:"mx-6 mb-4 border-l-4",children:["success"===ea.type?(0,a.jsx)(E.A,{className:"h-4 w-4"}):(0,a.jsx)(z.A,{className:"h-4 w-4"}),(0,a.jsx)(S.XL,{children:"success"===ea.type?"Success":"Error"}),(0,a.jsx)(S.TN,{children:ea.message})]}),(0,a.jsxs)("div",{className:"border divide-y mx-6",children:[(0,a.jsxs)("div",{className:"p-6 flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[(0,a.jsx)("div",{className:"flex-shrink-0 h-14 w-14 rounded-full bg-primary/10 border-2 border-primary/20 flex items-center justify-center text-xl font-bold text-primary select-none",children:ex}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h2",{className:"text-base font-semibold truncate",children:em}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-0.5",children:[(null==l?void 0:l.username)&&(0,a.jsxs)(C.E,{variant:"secondary",className:"font-mono text-xs",children:["@",l.username]}),(null==l?void 0:l.email)&&(0,a.jsx)("span",{className:"text-sm text-muted-foreground truncate",children:l.email})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(F.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Personal Information"})]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Your name and account details. Name changes are reflected across the platform."})]}),(0,a.jsxs)("div",{className:"lg:col-span-2 space-y-5",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(p.J,{htmlFor:X?"firstName":"staticFirstName",className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"First Name"}),(0,a.jsx)("div",{className:"relative group",children:X?(0,a.jsx)(k.p,{id:"firstName",value:g,onChange:e=>h(e.target.value),placeholder:"Your first name",disabled:H,className:"h-9 pr-10"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{id:"staticFirstName",className:"text-sm px-3 h-9 flex items-center border rounded bg-muted/40 w-full pr-10",children:(null==l?void 0:l.firstName)||(0,a.jsx)("span",{className:"text-muted-foreground italic",children:"Not set"})}),(0,a.jsx)(w.$,{variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 opacity-0 group-hover:opacity-100 focus-visible:opacity-100",onClick:()=>{Q(!0),h((null==l?void 0:l.firstName)||"")},"aria-label":"Edit first name",children:(0,a.jsx)(L.A,{className:"h-3.5 w-3.5"})})]})})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(p.J,{htmlFor:K?"lastName":"staticLastName",className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Last Name"}),(0,a.jsx)("div",{className:"relative group",children:K?(0,a.jsx)(k.p,{id:"lastName",value:f,onChange:e=>v(e.target.value),placeholder:"Your last name",disabled:H,className:"h-9 pr-10"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{id:"staticLastName",className:"text-sm px-3 h-9 flex items-center border rounded bg-muted/40 w-full pr-10",children:(null==l?void 0:l.lastName)||(0,a.jsx)("span",{className:"text-muted-foreground italic",children:"Not set"})}),(0,a.jsx)(w.$,{variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 opacity-0 group-hover:opacity-100 focus-visible:opacity-100",onClick:()=>{ee(!0),v((null==l?void 0:l.lastName)||"")},"aria-label":"Edit last name",children:(0,a.jsx)(L.A,{className:"h-3.5 w-3.5"})})]})})]})]}),(0,a.jsx)(A.w,{}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Username"}),(0,a.jsx)("div",{className:"text-sm px-3 h-9 flex items-center border rounded bg-muted/20 font-mono text-muted-foreground",children:(null==l?void 0:l.username)||"—"})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Email Address"}),(0,a.jsx)("div",{className:"text-sm px-3 h-9 flex items-center border rounded bg-muted/20 text-muted-foreground truncate",children:(null==l?void 0:l.email)||"—"})]})]}),(X||K)&&(0,a.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,a.jsxs)(w.$,{variant:"outline",onClick:()=>{h((null==l?void 0:l.firstName)||""),v((null==l?void 0:l.lastName)||""),Q(!1),ee(!1)},disabled:H,children:[(0,a.jsx)(P.A,{className:"mr-2 h-4 w-4"})," Cancel"]}),(0,a.jsx)(w.$,{onClick:ec,disabled:H,children:H?"Saving…":"Save Changes"})]})]})]}),(m||!V)&&(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(T.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Organization"})]}),m?(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Details for your organization. Manage consumption and credits on the Usage page."}):(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"No organization associated with this account."})]}),m&&(0,a.jsxs)("div",{className:"lg:col-span-2 space-y-5",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(p.J,{htmlFor:et?"orgName":"staticOrgName",className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Organization Name"}),(0,a.jsx)("div",{className:"relative group",children:et?(0,a.jsx)(k.p,{id:"orgName",value:j,onChange:e=>R(e.target.value),placeholder:"Your organization's name",disabled:q,className:"h-9 pr-10"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{id:"staticOrgName",className:"text-sm px-3 h-9 flex items-center border rounded bg-muted/40 w-full pr-10",children:m.name||(0,a.jsx)("span",{className:"text-muted-foreground italic",children:"Not set"})}),(0,a.jsx)(w.$,{variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 opacity-0 group-hover:opacity-100 focus-visible:opacity-100",onClick:()=>{es(!0),R(m.name||"")},"aria-label":"Edit organization name",children:(0,a.jsx)(L.A,{className:"h-3.5 w-3.5"})})]})})]}),(0,a.jsx)(A.w,{}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"border bg-muted/30 px-4 py-3 flex flex-col gap-0.5",children:[(0,a.jsxs)("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5",children:[(0,a.jsx)(O.A,{className:"h-3 w-3"})," Created"]}),(0,a.jsx)("span",{className:"text-sm font-medium mt-1",children:J(m.createdAt)})]}),(0,a.jsxs)("div",{className:"border bg-muted/30 px-4 py-3 flex flex-col gap-0.5",children:[(0,a.jsxs)("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground flex items-center gap-1.5",children:[(0,a.jsx)(O.A,{className:"h-3 w-3"})," Last Updated"]}),(0,a.jsx)("span",{className:"text-sm font-medium mt-1",children:J(m.updatedAt)})]})]}),(0,a.jsx)(w.$,{asChild:!0,variant:"outline",children:(0,a.jsx)(i(),{href:"/usage",children:"View usage"})}),et&&(0,a.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,a.jsxs)(w.$,{variant:"outline",onClick:()=>{R((null==m?void 0:m.name)||""),es(!1)},disabled:q,children:[(0,a.jsx)(P.A,{className:"mr-2 h-4 w-4"})," Cancel"]}),(0,a.jsx)(w.$,{onClick:eo,disabled:q,children:q?"Saving…":"Save Organization"})]})]})]}),(0,a.jsx)(y,{}),"disabled"!==t&&(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(D.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Privacy"})]}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground mt-1",children:["Control analytics cookies. See our"," ",(0,a.jsx)("a",{href:"https://hackagent.dev/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Privacy Policy"}),"."]})]}),(0,a.jsx)("div",{className:"lg:col-span-2",children:(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Analytics"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:(null==l?void 0:l.analyticsConsent)==="accepted"?"Enabled — helps us understand how HackAgent is used.":(null==l?void 0:l.analyticsConsent)==="declined"?"Disabled — no analytics are collected for your account.":"Not yet decided."})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 border bg-muted/40 p-1",children:[(0,a.jsx)(w.$,{variant:(null==l?void 0:l.analyticsConsent)==="declined"?"secondary":"ghost",size:"sm",className:"h-8 px-3",disabled:en,onClick:()=>ei("declined"),children:"Disabled"}),(0,a.jsx)(w.$,{variant:(null==l?void 0:l.analyticsConsent)==="accepted"?"secondary":"ghost",size:"sm",className:"h-8 px-3",disabled:en,onClick:()=>ei("accepted"),children:"Enabled"})]})]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(_.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("h2",{className:"text-sm font-medium",children:"About"})]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"The release of HackAgent you are running."})]}),(0,a.jsx)("div",{className:"lg:col-span-2",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"HackAgent dashboard"}),(0,a.jsx)(C.E,{variant:"secondary",className:"font-mono text-xs",children:N.W})]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 p-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-destructive",children:"Danger Zone"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible actions. Please read carefully before proceeding."})]}),(0,a.jsx)("div",{className:"lg:col-span-2",children:(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 border border-destructive/30 bg-destructive/5 px-4 py-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Delete Account"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Permanently remove your account and all associated data. This cannot be undone."})]}),(0,a.jsxs)(I.Lt,{children:[(0,a.jsx)(I.tv,{asChild:!0,children:(0,a.jsxs)(w.$,{variant:"destructive",size:"sm",disabled:B,className:"shrink-0",children:[(0,a.jsx)(U.A,{className:"mr-2 h-4 w-4"}),B?"Deleting…":"Delete Account"]})}),(0,a.jsxs)(I.EO,{children:[(0,a.jsxs)(I.wd,{children:[(0,a.jsx)(I.r7,{children:"Are you absolutely sure?"}),(0,a.jsx)(I.$v,{children:"This action cannot be undone. This will permanently delete your account and remove all your data from our servers."})]}),(0,a.jsxs)(I.ck,{children:[(0,a.jsx)(I.Zr,{children:"Cancel"}),(0,a.jsx)(I.Rx,{onClick:eu,disabled:B,className:"bg-destructive hover:bg-destructive/90",children:B?"Deleting…":"Yes, delete my account"})]})]})]})]})})]})]})]})}},11647:(e,t,s)=>{"use strict";s.d(t,{E:()=>d});var a=s(95155);s(12115);var r=s(32467),n=s(83101),l=s(64269);let i=(0,n.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function d(e){let{className:t,variant:s,asChild:n=!1,...d}=e,c=n?r.DX:"span";return(0,a.jsx)(c,{"data-slot":"badge",className:(0,l.cn)(i({variant:s}),t),...d})}},18332:(e,t,s)=>{"use strict";s.d(t,{Fc:()=>i,TN:()=>c,XL:()=>d});var a=s(95155);s(12115);var r=s(83101),n=s(64269);let l=(0,r.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function i(e){let{className:t,variant:s,...r}=e;return(0,a.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,n.cn)(l({variant:s}),t),...r})}function d(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-title",className:(0,n.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...s})}function c(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-description",className:(0,n.cn)("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...s})}},20243:(e,t,s)=>{"use strict";s.d(t,{E:()=>n});var a=s(95155),r=s(64269);function n(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"skeleton",className:(0,r.cn)("bg-accent animate-pulse rounded-md",t),...s})}},22470:(e,t,s)=>{"use strict";s.d(t,{M:()=>r});var a=s(95155);s(12115);let r=e=>{let{title:t,description:s,action:r,children:n,maxWidth:l="full",compact:i=!1}=e;return(0,a.jsxs)("div",{className:"w-full ".concat({full:"max-w-full","8xl":"max-w-[90rem]","7xl":"max-w-7xl","6xl":"max-w-6xl","5xl":"max-w-5xl","4xl":"max-w-4xl","3xl":"max-w-3xl","2xl":"max-w-2xl"}[l]||"max-w-full"," mx-auto ").concat(i?"py-3 space-y-3":"py-6 space-y-6"),children:[t&&(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 border-b ".concat(i?"px-4 pb-3":"px-6 pb-5"),children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:t}),s&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:s})]}),r&&(0,a.jsx)("div",{className:"flex-shrink-0 pt-0.5",children:r})]}),n]})}},24323:(e,t,s)=>{"use strict";s.d(t,{P:()=>h,T:()=>g});var a=s(95155),r=s(12115),n=s(52619),l=s.n(n),i=s(68321),d=s(76784),c=s(7831),o=s(41444),u=s(3998),m=s(51834);let x=(0,o.h)("AnalyticsConsent");async function g(e){await c.userApi.userMeUpdate({userProfileRequest:{analyticsConsent:e}})}function h(){let[e,t]=(0,r.useState)(null),s=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=!1;return c.userApi.userMeRetrieve().then(s=>{var a;e||t(null!=(a=s.analyticsConsent)?a:"unset")}).catch(e=>{x.debug({err:e},"Could not load analytics consent (not authenticated yet?)")}),()=>{e=!0}},[]);let n=async e=>{s.current=!0,t(e);try{await g(e)}catch(e){x.error({err:e},"Failed to save analytics consent")}};return(0,a.jsxs)(a.Fragment,{children:["accepted"===e&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.GoogleAnalytics,{gaId:"G-2P6K2HWVEE"}),(0,a.jsx)(i.default,{id:"microsoft-clarity",strategy:"afterInteractive",children:'(function(c,l,a,r,i,t,y){\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\n t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\n })(window, document, "clarity", "script", "xowemo04qg");'})]}),(0,a.jsx)(m.lG,{open:"unset"===e,onOpenChange:e=>{e||s.current||n("declined")},children:(0,a.jsxs)(m.Cf,{children:[(0,a.jsxs)(m.c7,{children:[(0,a.jsx)(m.L3,{children:"Help us improve HackAgent"}),(0,a.jsxs)(m.rr,{children:["We'd like to use optional analytics to understand how HackAgent is used. This is separate from the cookies that keep you signed in, and you can change it anytime in Settings. See our"," ",(0,a.jsx)(l(),{href:"https://hackagent.dev/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Privacy Policy"}),"."]})]}),(0,a.jsxs)(m.Es,{children:[(0,a.jsx)(u.$,{variant:"outline",onClick:()=>n("declined"),children:"Not now"}),(0,a.jsx)(u.$,{onClick:()=>n("accepted"),children:"Sounds good"})]})]})})]})}},25164:(e,t,s)=>{"use strict";s.d(t,{W:()=>r});let a="0.6.6-stage",r=/^\d/.test(a)?"v".concat(a):a},34105:(e,t,s)=>{"use strict";s.d(t,{c:()=>a});let a=(0,s(12115).createContext)(void 0)},44846:(e,t,s)=>{"use strict";s.d(t,{d:()=>l});var a=s(95155);s(12115);var r=s(45927),n=s(64269);function l(e){let{className:t,...s}=e;return(0,a.jsx)(r.bL,{"data-slot":"switch",className:(0,n.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:(0,a.jsx)(r.zi,{"data-slot":"switch-thumb",className:(0,n.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}},51834:(e,t,s)=>{"use strict";s.d(t,{Cf:()=>u,Es:()=>x,HM:()=>c,L3:()=>g,c7:()=>m,lG:()=>i,rr:()=>h});var a=s(95155);s(12115);var r=s(88292),n=s(65229),l=s(64269);function i(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"dialog",...t})}function d(e){let{...t}=e;return(0,a.jsx)(r.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{...t}=e;return(0,a.jsx)(r.bm,{"data-slot":"dialog-close",...t})}function o(e){let{className:t,...s}=e;return(0,a.jsx)(r.hJ,{"data-slot":"dialog-overlay",className:(0,l.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function u(e){let{className:t,children:s,...i}=e;return(0,a.jsxs)(d,{"data-slot":"dialog-portal",children:[(0,a.jsx)(o,{}),(0,a.jsxs)(r.UC,{"data-slot":"dialog-content",className:(0,l.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...i,children:[s,(0,a.jsxs)(r.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,a.jsx)(n.A,{}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function m(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"dialog-header",className:(0,l.cn)("flex flex-col gap-2 text-center sm:text-left",t),...s})}function x(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"dialog-footer",className:(0,l.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s})}function g(e){let{className:t,...s}=e;return(0,a.jsx)(r.hE,{"data-slot":"dialog-title",className:(0,l.cn)("text-lg leading-none font-semibold",t),...s})}function h(e){let{className:t,...s}=e;return(0,a.jsx)(r.VY,{"data-slot":"dialog-description",className:(0,l.cn)("text-muted-foreground text-sm",t),...s})}},65142:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var a=s(95155);s(12115);var r=s(64269);function n(e){let{className:t,type:s,...n}=e;return(0,a.jsx)("input",{type:s,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}},73474:(e,t,s)=>{"use strict";s.d(t,{Bc:()=>r,NQ:()=>i,zG:()=>a,wN:()=>l,AZ:()=>x,V$:()=>u,eW:()=>c,of:()=>m,_9:()=>o,f_:()=>d});let a=[{id:"classic-light",label:"Classic Light",mode:"light",description:"Soft neutral grays and a quiet, minimal feel."},{id:"slate-light",label:"Slate Light",mode:"light",description:"Cool slate surfaces with crisp white cards."},{id:"classic-dark",label:"Classic Dark",mode:"dark",description:"The original charcoal and neutral gray palette."},{id:"slate-dark",label:"Slate Dark",mode:"dark",description:"The current deep blue and slate palette."}],r={light:"slate-light",dark:"slate-dark"},n={light:"slate-light",dark:"slate-dark"},l="hackagent-theme",i="(prefers-color-scheme: dark)";function d(e){var t,s;return"light"===e||"dark"===e?n[e]:null!=(s=null==(t=a.find(t=>t.id===e))?void 0:t.id)?s:"system"}function c(e,t){let s="system"===e?r[t]:e;return a.find(e=>e.id===s)}function o(){return window.matchMedia(i).matches?"dark":"light"}function u(){try{return d(localStorage.getItem(l))}catch(e){return"system"}}function m(e){try{localStorage.setItem(l,e)}catch(e){}}function x(e){let t=document.documentElement;t.dataset.theme=e.id,t.classList.toggle("dark","dark"===e.mode),t.style.colorScheme=e.mode}let g=Object.fromEntries(a.map(e=>[e.id,e.mode]));"(() => {\n const modes = ".concat(JSON.stringify(g),";\n const defaults = ").concat(JSON.stringify(r),";\n const legacy = ").concat(JSON.stringify(n),";\n let preference;\n try { preference = localStorage.getItem('").concat(l,"'); } catch {}\n if (preference === 'light' || preference === 'dark') preference = legacy[preference];\n const system = window.matchMedia('").concat(i,"').matches ? 'dark' : 'light';\n const id = Object.prototype.hasOwnProperty.call(modes, preference) ? preference : defaults[system];\n document.documentElement.dataset.theme = id;\n document.documentElement.classList.toggle('dark', modes[id] === 'dark');\n document.documentElement.style.colorScheme = modes[id];\n})();")},76444:(e,t,s)=>{"use strict";s.d(t,{J:()=>l});var a=s(95155);s(12115);var r=s(85408),n=s(64269);function l(e){let{className:t,...s}=e;return(0,a.jsx)(r.b,{"data-slot":"label",className:(0,n.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",t),...s})}},76853:(e,t,s)=>{Promise.resolve().then(s.bind(s,1577))},80230:(e,t,s)=>{"use strict";s.d(t,{h:()=>l});var a=s(12115),r=s(34105);let n=async()=>"";function l(){let e=(0,a.useContext)(r.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:n}}},86259:(e,t,s)=>{"use strict";s.d(t,{w:()=>l});var a=s(95155);s(12115);var r=s(57268),n=s(64269);function l(e){let{className:t,orientation:s="horizontal",decorative:l=!0,...i}=e;return(0,a.jsx)(r.b,{"data-slot":"separator-root",decorative:l,orientation:s,className:(0,n.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...i})}},96042:(e,t,s)=>{"use strict";s.d(t,{D:()=>i,ThemeProvider:()=>d});var a=s(95155),r=s(12115),n=s(73474);let l=(0,r.createContext)({theme:"system",resolvedTheme:"light",resolvedStyle:n.Bc.light,setTheme:()=>{}});function i(){return(0,r.useContext)(l)}function d(e){let{children:t}=e,[s,i]=(0,r.useState)({theme:"system",resolvedTheme:"light",resolvedStyle:n.Bc.light}),d=(0,r.useCallback)(e=>{let t=(0,n.eW)(e,(0,n._9)());(0,n.AZ)(t),i({theme:e,resolvedTheme:t.mode,resolvedStyle:t.id})},[]);(0,r.useEffect)(()=>{d((0,n.V$)());let e=e=>{(e.key===n.wN||null===e.key)&&d((0,n.f_)(e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[d]),(0,r.useEffect)(()=>{if("system"!==s.theme)return;let e=window.matchMedia(n.NQ),t=()=>d("system");return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[s.theme,d]);let c=(0,r.useCallback)(e=>{d(e),(0,n.of)(e)},[d]);return(0,a.jsx)(l.Provider,{value:{...s,setTheme:c},children:t})}},98053:(e,t,s)=>{"use strict";s.d(t,{$v:()=>h,EO:()=>u,Lt:()=>i,Rx:()=>p,Zr:()=>f,ck:()=>x,r7:()=>g,tv:()=>d,wd:()=>m});var a=s(95155);s(12115);var r=s(35646),n=s(64269),l=s(3998);function i(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"alert-dialog",...t})}function d(e){let{...t}=e;return(0,a.jsx)(r.l9,{"data-slot":"alert-dialog-trigger",...t})}function c(e){let{...t}=e;return(0,a.jsx)(r.ZL,{"data-slot":"alert-dialog-portal",...t})}function o(e){let{className:t,...s}=e;return(0,a.jsx)(r.hJ,{"data-slot":"alert-dialog-overlay",className:(0,n.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function u(e){let{className:t,...s}=e;return(0,a.jsxs)(c,{children:[(0,a.jsx)(o,{}),(0,a.jsx)(r.UC,{"data-slot":"alert-dialog-content",className:(0,n.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...s})]})}function m(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,n.cn)("flex flex-col gap-2 text-center sm:text-left",t),...s})}function x(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,n.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s})}function g(e){let{className:t,...s}=e;return(0,a.jsx)(r.hE,{"data-slot":"alert-dialog-title",className:(0,n.cn)("text-lg font-semibold",t),...s})}function h(e){let{className:t,...s}=e;return(0,a.jsx)(r.VY,{"data-slot":"alert-dialog-description",className:(0,n.cn)("text-muted-foreground text-sm",t),...s})}function p(e){let{className:t,...s}=e;return(0,a.jsx)(r.rc,{className:(0,n.cn)((0,l.r)(),t),...s})}function f(e){let{className:t,...s}=e;return(0,a.jsx)(r.ZD,{className:(0,n.cn)((0,l.r)({variant:"outline"}),t),...s})}}},e=>{e.O(0,[187,272,619,328,356,323,924,441,493,358],()=>e(e.s=76853)),_N_E=e.O()}]);