hackagent-webui 0.5.7.dev44__py3-none-any.whl → 0.5.9.dev46__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.
- hackagent_webui/__init__.py +1 -1
- hackagent_webui/static/404.html +1 -1
- hackagent_webui/static/VERSION +1 -1
- hackagent_webui/static/_next/static/chunks/355-e2dea3684934b9a8.js +1 -0
- hackagent_webui/static/_next/static/chunks/472-9c35d1aa1a5e3033.js +1 -0
- hackagent_webui/static/_next/static/chunks/874-12bc26fc27858118.js +1 -0
- hackagent_webui/static/_next/static/chunks/924-a6df0b0f1eaa3193.js +1 -0
- hackagent_webui/static/_next/static/chunks/928-9af782d87164cac8.js +1 -0
- hackagent_webui/static/_next/static/chunks/app/agents/page-601afcbb1d489291.js +1 -0
- hackagent_webui/static/_next/static/chunks/app/{layout-7c1fdd2e3cdffab4.js → layout-026360403787aaa4.js} +1 -1
- hackagent_webui/static/_next/static/chunks/app/page-b3f42114f30a338c.js +1 -0
- hackagent_webui/static/_next/static/chunks/app/reports/page-5c34dba5cdb5c82a.js +1 -0
- hackagent_webui/static/_next/static/chunks/app/stats/page-59e6617db542e2d8.js +1 -0
- hackagent_webui/static/_next/static/css/01ff9a760430c5b3.css +1 -0
- hackagent_webui/static/agents.html +1 -1
- hackagent_webui/static/agents.txt +5 -5
- hackagent_webui/static/api-keys.html +1 -1
- hackagent_webui/static/api-keys.txt +5 -5
- hackagent_webui/static/attacks/builder.html +1 -1
- hackagent_webui/static/attacks/builder.txt +5 -5
- hackagent_webui/static/attacks.html +1 -1
- hackagent_webui/static/attacks.txt +5 -5
- hackagent_webui/static/index.html +1 -1
- hackagent_webui/static/index.txt +5 -5
- hackagent_webui/static/profile.html +1 -1
- hackagent_webui/static/profile.txt +5 -5
- hackagent_webui/static/reports.html +1 -1
- hackagent_webui/static/reports.txt +5 -5
- hackagent_webui/static/stats.html +1 -1
- hackagent_webui/static/stats.txt +5 -5
- {hackagent_webui-0.5.7.dev44.dist-info → hackagent_webui-0.5.9.dev46.dist-info}/METADATA +1 -1
- {hackagent_webui-0.5.7.dev44.dist-info → hackagent_webui-0.5.9.dev46.dist-info}/RECORD +35 -36
- hackagent_webui/static/_next/static/chunks/391-c0e09f348021cffc.js +0 -1
- hackagent_webui/static/_next/static/chunks/680-25d8e1ea98a28dad.js +0 -1
- hackagent_webui/static/_next/static/chunks/8-42d532ba984375d8.js +0 -1
- hackagent_webui/static/_next/static/chunks/816-19f20afc3075826e.js +0 -1
- hackagent_webui/static/_next/static/chunks/9-22df388e4049bb14.js +0 -1
- hackagent_webui/static/_next/static/chunks/924-bbaf675cfa822d94.js +0 -1
- hackagent_webui/static/_next/static/chunks/app/agents/page-63d562af288bd470.js +0 -1
- hackagent_webui/static/_next/static/chunks/app/page-44982fec817d0e96.js +0 -1
- hackagent_webui/static/_next/static/chunks/app/reports/page-1507b6373935769e.js +0 -1
- hackagent_webui/static/_next/static/chunks/app/stats/page-3d22606b7f9ba4b8.js +0 -1
- hackagent_webui/static/_next/static/css/c66d365ae0bced97.css +0 -1
- /hackagent_webui/static/_next/static/{HIoXscjHtxVCsDuJEjr4J → hr-gTAuE62YYpavO4AEWM}/_buildManifest.js +0 -0
- /hackagent_webui/static/_next/static/{HIoXscjHtxVCsDuJEjr4J → hr-gTAuE62YYpavO4AEWM}/_ssgManifest.js +0 -0
- {hackagent_webui-0.5.7.dev44.dist-info → hackagent_webui-0.5.9.dev46.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[924],{3998:(e,t,a)=>{a.d(t,{$:()=>u,r:()=>s});var n=a(95155);a(12115);var i=a(32467),r=a(83101),o=a(64269);let s=(0,r.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-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",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function u(e){let{className:t,variant:a,size:r,asChild:u=!1,...c}=e,l=u?i.DX:"button";return(0,n.jsx)(l,{"data-slot":"button",className:(0,o.cn)(s({variant:a,size:r,className:t})),...c})}},7831:(e,t,a)=>{a.d(t,{DR:()=>u,Iu:()=>f,KC:()=>p,ME:()=>l,gb:()=>g,in:()=>c,ki:()=>o,nu:()=>y,ui:()=>d,userApi:()=>w,vm:()=>h});var n=a(17983);let i=(0,a(41444).h)("apiClient"),r=null;function o(e){r=e,i.debug(e?"Access token set":"Access token cleared")}let s=async()=>(r||i.debug("No access token available."),r),u=new n.Vk6({basePath:"/api/proxy",middleware:[{pre:async e=>{i.debug("Running pre-request middleware...");let t=await s();t?(i.debug("Token found, adding Authorization header."),e.init.headers={...e.init.headers,Authorization:"Bearer ".concat(t)}):i.warn("No token found, Authorization header not added.")},post:async e=>{let t=e.response.headers.get("content-type");if(!e.response.ok&&t&&!t.includes("application/json")){let a=await e.response.text();throw i.error({status:e.response.status,contentType:t,preview:a.substring(0,200)},"API returned non-JSON response"),Error("API error ".concat(e.response.status,": Server returned ").concat(t," instead of JSON. Check API endpoint and CORS configuration."))}}}]}),c=new n.cwn(u),l=new n.uzR(u),d=new n.cdi(u),h=new n.Lev(u),g=new n.At2(u),w=new n.ipj(u),f=new n.UYx(u),p=new n.OgW(u),y=new n.XoK(u)},17983:(e,t,a)=>{a.d(t,{cwn:()=>I,OgW:()=>K,Lev:()=>x,Vk6:()=>i,XoK:()=>B,on2:()=>T,At2:()=>D,UYx:()=>J,cdi:()=>L,v3H:()=>W,uzR:()=>O,S5d:()=>_,Esj:()=>v,ipj:()=>N});let n="http://localhost".replace(/\/+$/,"");class i{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:n}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(n=>(function t(a,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=i+(i.length?"[".concat(a,"]"):a);if(n instanceof Array){let e=n.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return n instanceof Set?t(a,Array.from(n),i):n instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(n.toISOString())):n instanceof Object?e(n,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(n)))})(n,t[n],a)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){this.configuration=e}}let r=new i;class o{withMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=this.clone();return n.middleware=n.middleware.concat(...t),n}withPreMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({pre:e}));return this.withMiddleware(...n)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({post:e}));return this.withMiddleware(...n)}isJsonMime(e){return!!e&&o.jsonRegex.test(e)}async request(e,t){let{url:a,init:n}=await this.createFetchParams(e,t),i=await this.fetchApi(a,n);if(i&&i.status>=200&&i.status<300)return i;throw new s(i,"Response returned an error code")}async createFetchParams(e,t){var a,n;let i,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let o=Object.assign({},this.configuration.headers,e.headers);Object.keys(o).forEach(e=>void 0===o[e]?delete o[e]:{});let s={method:e.method,headers:o,body:e.body,credentials:this.configuration.credentials},u={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return a=u.body,i="undefined"!=typeof FormData&&a instanceof FormData||u.body instanceof URLSearchParams||(n=u.body,"undefined"!=typeof Blob&&n instanceof Blob)?u.body:this.isJsonMime(o["Content-Type"])?JSON.stringify(u.body):u.body,{url:r,init:{...u,body:i}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=r){this.configuration=e,this.fetchApi=async(e,t)=>{let a,n={url:e,init:t};for(let e of this.middleware)e.pre&&(n=await e.pre({fetch:this.fetchApi,...n})||n);try{a=await (this.configuration.fetchApi||fetch)(n.url,n.init)}catch(e){for(let t of this.middleware)t.onError&&(a=await t.onError({fetch:this.fetchApi,url:n.url,init:n.init,error:e,response:a?a.clone():void 0})||a);if(void 0===a)if(e instanceof Error)throw new u(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(a=await e.post({fetch:this.fetchApi,url:n.url,init:n.init,response:a.clone()})||a);return a},this.middleware=e.middleware}}o.jsonRegex=RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");class s extends Error{constructor(e,t){super(t),this.response=e,this.name="ResponseError"}}class u extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class c extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}class l{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){this.raw=e,this.transformer=t}}class d{async value(){}constructor(e){this.raw=e}}function h(e){var t;return null==(t=e)?t:{id:t.id,timestamp:new Date(t.timestamp),apiKeyPrefix:t.api_key_prefix,userUsername:t.user_username,organizationName:t.organization_name,modelIdUsed:t.model_id_used,apiEndpoint:t.api_endpoint,inputTokens:t.input_tokens,outputTokens:t.output_tokens,creditsDeducted:t.credits_deducted,requestPayloadPreview:t.request_payload_preview,responsePayloadPreview:t.response_payload_preview}}function g(e,t){return null==e?e:{id:e.id,name:e.name}}function w(e,t){return null==e?e:{user:e.user,username:e.username,organization:e.organization}}function f(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,endpoint:t.endpoint,agentType:null==t.agent_type?void 0:t.agent_type,description:null==t.description?void 0:t.description,metadata:null==t.metadata?void 0:t.metadata,organization:t.organization,organizationDetail:g(t.organization_detail,!1),owner:t.owner,ownerDetail:w(t.owner_detail,!1),createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function p(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,endpoint:e.endpoint,agent_type:e.agentType,description:e.description,metadata:e.metadata}}function y(e){var t;return null==(t=e)?t:{id:t.id,type:t.type,agent:t.agent,agentName:t.agent_name,owner:t.owner,ownerUsername:t.owner_username,organization:t.organization,organizationName:t.organization_name,_configuration:t.configuration,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function k(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}let T={NotEvaluated:"NOT_EVALUATED",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK",FailedJailbreak:"FAILED_JAILBREAK",ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",PassedCriteria:"PASSED_CRITERIA",FailedCriteria:"FAILED_CRITERIA"};function R(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at),credits:t.credits,creditsLastUpdated:new Date(t.credits_last_updated)}}function m(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}let v={ToolCall:"TOOL_CALL",ToolResponse:"TOOL_RESPONSE",AgentThought:"AGENT_THOUGHT",AgentResponseChunk:"AGENT_RESPONSE_CHUNK",Other:"OTHER",McpStep:"MCP_STEP",A2AComm:"A2A_COMM"};function A(e){var t,a=e;if(null==a)return a;return{id:a.id,result:a.result,sequence:a.sequence,stepType:null==a.step_type?void 0:(t=a.step_type,t),timestamp:new Date(a.timestamp),content:null==a.content?void 0:a.content}}function q(e){var t,a=e;if(null==a)return a;return{id:a.id,run:a.run,runId:a.run_id,requestPayload:null==a.request_payload?void 0:a.request_payload,responseStatusCode:null==a.response_status_code?void 0:a.response_status_code,responseHeaders:null==a.response_headers?void 0:a.response_headers,responseBody:null==a.response_body?void 0:a.response_body,latencyMs:null==a.latency_ms?void 0:a.latency_ms,detectedToolCalls:null==a.detected_tool_calls?void 0:a.detected_tool_calls,evaluationStatus:null==a.evaluation_status?void 0:(t=a.evaluation_status,t),evaluationNotes:null==a.evaluation_notes?void 0:a.evaluation_notes,evaluationMetrics:null==a.evaluation_metrics?void 0:a.evaluation_metrics,agentSpecificData:null==a.agent_specific_data?void 0:a.agent_specific_data,timestamp:new Date(a.timestamp),traces:a.traces.map(A)}}let _={Pending:"PENDING",Running:"RUNNING",Completed:"COMPLETED",Failed:"FAILED",Cancelled:"CANCELLED"};function z(e){var t,a=e;if(null==a)return a;return{id:a.id,agent:a.agent,agentName:a.agent_name,attack:a.attack,attackType:a.attack_type,owner:a.owner,ownerUsername:a.owner_username,organization:a.organization,organizationName:a.organization_name,runConfig:a.run_config,timestamp:new Date(a.timestamp),status:(t=a.status,t),runNotes:a.run_notes,isClientExecuted:a.is_client_executed,totalResults:a.total_results,successfulJailbreaks:a.successful_jailbreaks,failedJailbreaks:a.failed_jailbreaks,errors:a.errors,notEvaluated:a.not_evaluated}}function C(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,prefix:t.prefix,created:new Date(t.created),revoked:t.revoked,expiryDate:null==t.expiry_date?null:new Date(t.expiry_date),user:t.user,userDetail:w(t.user_detail,!1),organization:t.organization,organizationDetail:g(t.organization_detail,!1)}}function P(e){var t;return null==(t=e)?t:{id:t.id,user:t.user,username:t.username,email:null==t.email?void 0:t.email,firstName:null==t.first_name?void 0:t.first_name,lastName:null==t.last_name?void 0:t.last_name,organization:t.organization,organizationName:t.organization_name,keycloakUserId:t.keycloak_user_id,auth0UserId:t.auth0_user_id,analyticsConsent:null==t.analytics_consent?void 0:t.analytics_consent}}function U(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData}}function E(e){var t,a=e;if(null==a)return a;return{id:a.id,agent:a.agent,agentName:a.agent_name,attack:null==a.attack?void 0:a.attack,owner:a.owner,ownerUsername:a.owner_username,organization:a.organization,organizationName:a.organization_name,runConfig:null==a.run_config?void 0:a.run_config,timestamp:new Date(a.timestamp),status:null==a.status?void 0:(t=a.status,t),runNotes:null==a.run_notes?void 0:a.run_notes,isClientExecuted:a.is_client_executed,results:a.results.map(q)}}function S(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{agent:e.agent,attack:e.attack,run_config:e.runConfig,status:e.status,run_notes:e.runNotes}}function b(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:e.analyticsConsent}}class I extends o{async agentCreateRaw(e,t){if(null==e.agentRequest)throw new c("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"POST",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>f(e))}async agentCreate(e,t){let a=await this.agentCreateRaw(e,t);return await a.value()}async agentDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling agentDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async agentDestroy(e,t){await this.agentDestroyRaw(e,t)}async agentListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(f)}})}async agentList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.agentListRaw(e,t);return await a.value()}async agentPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling agentPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,endpoint:e.endpoint,agent_type:e.agentType,description:e.description,metadata:e.metadata}}(e.patchedAgentRequest,!1)},t),e=>f(e))}async agentPartialUpdate(e,t){let a=await this.agentPartialUpdateRaw(e,t);return await a.value()}async agentRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling agentRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>f(e))}async agentRetrieve(e,t){let a=await this.agentRetrieveRaw(e,t);return await a.value()}async agentUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling agentUpdate().');if(null==e.agentRequest)throw new c("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>f(e))}async agentUpdate(e,t){let a=await this.agentUpdateRaw(e,t);return await a.value()}}class K extends o{async apilogsListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(h)}})}async apilogsList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.apilogsListRaw(e,t);return await a.value()}async apilogsRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling apilogsRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>h(e))}async apilogsRetrieve(e,t){let a=await this.apilogsRetrieveRaw(e,t);return await a.value()}async apilogsSummaryRetrieveRaw(e,t){if(null==e.endDate)throw new c("endDate",'Required parameter "endDate" was null or undefined when calling apilogsSummaryRetrieve().');if(null==e.startDate)throw new c("startDate",'Required parameter "startDate" was null or undefined when calling apilogsSummaryRetrieve().');let a={};null!=e.byKey&&(a.by_key=e.byKey),null!=e.endDate&&(a.end_date=e.endDate.toISOString().substring(0,10)),null!=e.startDate&&(a.start_date=e.startDate.toISOString().substring(0,10)),null!=e.tz&&(a.tz=e.tz);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/summary",method:"GET",headers:n,query:a},t),e=>h(e))}async apilogsSummaryRetrieve(e,t){let a=await this.apilogsSummaryRetrieveRaw(e,t);return await a.value()}}class x extends o{async attackCreateRaw(e,t){if(null==e.attackRequest)throw new c("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"POST",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>y(e))}async attackCreate(e,t){let a=await this.attackCreateRaw(e,t);return await a.value()}async attackDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling attackDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async attackDestroy(e,t){await this.attackDestroyRaw(e,t)}async attackListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(y)}})}async attackList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.attackListRaw(e,t);return await a.value()}async attackPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling attackPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}(e.patchedAttackRequest,!1)},t),e=>y(e))}async attackPartialUpdate(e,t){let a=await this.attackPartialUpdateRaw(e,t);return await a.value()}async attackRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling attackRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>y(e))}async attackRetrieve(e,t){let a=await this.attackRetrieveRaw(e,t);return await a.value()}async attackUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling attackUpdate().');if(null==e.attackRequest)throw new c("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>y(e))}async attackUpdate(e,t){let a=await this.attackUpdateRaw(e,t);return await a.value()}}class B extends o{async creditsRequestCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/credits/request",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{amount:e.amount,reason:e.reason}}(e.creditRequestRequest,!1)},t),e=>{var t;return null==(t=e)?t:{status:t.status}})}async creditsRequestCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.creditsRequestCreateRaw(e,t);return await a.value()}}class D extends o{async keyContextRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/key/context",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{userId:null==t.user_id?void 0:t.user_id,username:null==t.username?void 0:t.username,organizationId:null==t.organization_id?void 0:t.organization_id,organizationName:null==t.organization_name?void 0:t.organization_name}})}async keyContextRetrieve(e){let t=await this.keyContextRetrieveRaw(e);return await t.value()}async keyCreateRaw(e,t){if(null==e.userAPIKeyRequest)throw new c("userAPIKeyRequest",'Required parameter "userAPIKeyRequest" was null or undefined when calling keyCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,key:e.key}}(e.userAPIKeyRequest,!1)},t),e=>C(e))}async keyCreate(e,t){let a=await this.keyCreateRaw(e,t);return await a.value()}async keyDestroyRaw(e,t){if(null==e.prefix)throw new c("prefix",'Required parameter "prefix" was null or undefined when calling keyDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"DELETE",headers:a,query:{}},t))}async keyDestroy(e,t){await this.keyDestroyRaw(e,t)}async keyListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(C)}})}async keyList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.keyListRaw(e,t);return await a.value()}async keyRetrieveRaw(e,t){if(null==e.prefix)throw new c("prefix",'Required parameter "prefix" was null or undefined when calling keyRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"GET",headers:a,query:{}},t),e=>C(e))}async keyRetrieve(e,t){let a=await this.keyRetrieveRaw(e,t);return await a.value()}}class J extends o{async organizationCreateRaw(e,t){if(null==e.organizationRequest)throw new c("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"POST",headers:a,query:{},body:m(e.organizationRequest,!1)},t),e=>R(e))}async organizationCreate(e,t){let a=await this.organizationCreateRaw(e,t);return await a.value()}async organizationDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling organizationDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async organizationDestroy(e,t){await this.organizationDestroyRaw(e,t)}async organizationListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(R)}})}async organizationList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.organizationListRaw(e,t);return await a.value()}async organizationMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/organization/me",method:"GET",headers:t,query:{}},e),e=>R(e))}async organizationMeRetrieve(e){let t=await this.organizationMeRetrieveRaw(e);return await t.value()}async organizationPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling organizationPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}(e.patchedOrganizationRequest,!1)},t),e=>R(e))}async organizationPartialUpdate(e,t){let a=await this.organizationPartialUpdateRaw(e,t);return await a.value()}async organizationRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling organizationRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>R(e))}async organizationRetrieve(e,t){let a=await this.organizationRetrieveRaw(e,t);return await a.value()}async organizationUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling organizationUpdate().');if(null==e.organizationRequest)throw new c("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:m(e.organizationRequest,!1)},t),e=>R(e))}async organizationUpdate(e,t){let a=await this.organizationUpdateRaw(e,t);return await a.value()}}class L extends o{async resultCreateRaw(e,t){if(null==e.resultRequest)throw new c("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"POST",headers:a,query:{},body:U(e.resultRequest,!1)},t),e=>q(e))}async resultCreate(e,t){let a=await this.resultCreateRaw(e,t);return await a.value()}async resultDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling resultDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async resultDestroy(e,t){await this.resultDestroyRaw(e,t)}async resultListRaw(e,t){let a={};null!=e.evaluationStatus&&(a.evaluation_status=e.evaluationStatus),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.run&&(a.run=e.run),null!=e.runOrganization&&(a.run__organization=e.runOrganization);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(q)}})}async resultList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.resultListRaw(e,t);return await a.value()}async resultPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling resultPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData}}(e.patchedResultRequest,!1)},t),e=>q(e))}async resultPartialUpdate(e,t){let a=await this.resultPartialUpdateRaw(e,t);return await a.value()}async resultRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling resultRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>q(e))}async resultRetrieve(e,t){let a=await this.resultRetrieveRaw(e,t);return await a.value()}async resultTraceCreateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling resultTraceCreate().');if(null==e.traceRequest)throw new c("traceRequest",'Required parameter "traceRequest" was null or undefined when calling resultTraceCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}/trace".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{sequence:e.sequence,step_type:e.stepType,content:e.content}}(e.traceRequest,!1)},t),e=>A(e))}async resultTraceCreate(e,t){let a=await this.resultTraceCreateRaw(e,t);return await a.value()}async resultUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling resultUpdate().');if(null==e.resultRequest)throw new c("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:U(e.resultRequest,!1)},t),e=>q(e))}async resultUpdate(e,t){let a=await this.resultUpdateRaw(e,t);return await a.value()}}let W={ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",FailedCriteria:"FAILED_CRITERIA",FailedJailbreak:"FAILED_JAILBREAK",NotEvaluated:"NOT_EVALUATED",PassedCriteria:"PASSED_CRITERIA",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK"};class O extends o{async runCreateRaw(e,t){if(null==e.runRequest)throw new c("runRequest",'Required parameter "runRequest" was null or undefined when calling runCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run",method:"POST",headers:a,query:{},body:S(e.runRequest,!1)},t),e=>E(e))}async runCreate(e,t){let a=await this.runCreateRaw(e,t);return await a.value()}async runDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling runDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async runDestroy(e,t){await this.runDestroyRaw(e,t)}async runListRaw(e,t){let a={};null!=e.agent&&(a.agent=e.agent),null!=e.attack&&(a.attack=e.attack),null!=e.isClientExecuted&&(a.is_client_executed=e.isClientExecuted),null!=e.organization&&(a.organization=e.organization),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.status&&(a.status=e.status);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(z)}})}async runList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.runListRaw(e,t);return await a.value()}async runPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling runPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{agent:e.agent,attack:e.attack,run_config:e.runConfig,status:e.status,run_notes:e.runNotes}}(e.patchedRunRequest,!1)},t),e=>E(e))}async runPartialUpdate(e,t){let a=await this.runPartialUpdateRaw(e,t);return await a.value()}async runResultCreateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling runResultCreate().');if(null==e.runRequest)throw new c("runRequest",'Required parameter "runRequest" was null or undefined when calling runResultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/result".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:S(e.runRequest,!1)},t),e=>q(e))}async runResultCreate(e,t){let a=await this.runResultCreateRaw(e,t);return await a.value()}async runRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling runRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>E(e))}async runRetrieve(e,t){let a=await this.runRetrieveRaw(e,t);return await a.value()}async runRunTestsCreateRaw(e,t){if(null==e.runRequest)throw new c("runRequest",'Required parameter "runRequest" was null or undefined when calling runRunTestsCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/run_tests",method:"POST",headers:a,query:{},body:S(e.runRequest,!1)},t),e=>E(e))}async runRunTestsCreate(e,t){let a=await this.runRunTestsCreateRaw(e,t);return await a.value()}async runUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling runUpdate().');if(null==e.runRequest)throw new c("runRequest",'Required parameter "runRequest" was null or undefined when calling runUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:S(e.runRequest,!1)},t),e=>E(e))}async runUpdate(e,t){let a=await this.runUpdateRaw(e,t);return await a.value()}}class N extends o{async userCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"POST",headers:a,query:{},body:b(e.userProfileRequest,!1)},t),e=>P(e))}async userCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userCreateRaw(e,t);return await a.value()}async userDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling userDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async userDestroy(e,t){await this.userDestroyRaw(e,t)}async userListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(P)}})}async userList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userListRaw(e,t);return await a.value()}async userMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/user/me",method:"GET",headers:t,query:{}},e),e=>P(e))}async userMeRetrieve(e){let t=await this.userMeRetrieveRaw(e);return await t.value()}async userMeUpdateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/me",method:"PUT",headers:a,query:{},body:b(e.userProfileRequest,!1)},t),e=>P(e))}async userMeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userMeUpdateRaw(e,t);return await a.value()}async userPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling userPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:e.analyticsConsent}}(e.patchedUserProfileRequest,!1)},t),e=>P(e))}async userPartialUpdate(e,t){let a=await this.userPartialUpdateRaw(e,t);return await a.value()}async userRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling userRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>P(e))}async userRetrieve(e,t){let a=await this.userRetrieveRaw(e,t);return await a.value()}async userUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling userUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:b(e.userProfileRequest,!1)},t),e=>P(e))}async userUpdate(e,t){let a=await this.userUpdateRaw(e,t);return await a.value()}}},41444:(e,t,a)=>{a.d(t,{h:()=>r});var n=a(65727);let i=a.n(n)()({level:"info",browser:{asObject:!1,write:{debug:e=>!1,info:e=>console.info(e),warn:e=>console.warn(e),error:e=>console.error(e)}},redact:{paths:["token","password","authorization","apiKey","api_key","wallet.address","user.wallet.address","privateKey","private_key"],censor:"[REDACTED]"}}),r=e=>i.child({module:e})},64269:(e,t,a)=>{a.d(t,{cn:()=>r});var n=a(2821),i=a(75889);function r(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,i.QP)((0,n.$)(t))}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[928],{12108:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},15870:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},24595:(e,t,r)=>{r.d(t,{UC:()=>ro,q7:()=>ra,ZL:()=>rn,bL:()=>rt,wv:()=>rl,l9:()=>rr});var n,o,a=r(12115),l=r(92556),i=r(94446),u=r(3468),s=r(23558),c=r(47650),d=r(95155);function f(e){let t=function(e){let t=a.forwardRef((e,t)=>{var r,n,o;let l,u,{children:s,...c}=e,d=a.isValidElement(s)?(u=(l=null==(n=Object.getOwnPropertyDescriptor((r=s).props,"ref"))?void 0:n.get)&&"isReactWarning"in l&&l.isReactWarning)?r.ref:(u=(l=null==(o=Object.getOwnPropertyDescriptor(r,"ref"))?void 0:o.get)&&"isReactWarning"in l&&l.isReactWarning)?r.props.ref:r.props.ref||r.ref:void 0,f=(0,i.s)(d,t);if(a.isValidElement(s)){let e=function(e,t){let r={...t};for(let n in t){let o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=a(...t);return o(...t),n}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(c,s.props);return s.type!==a.Fragment&&(e.ref=f),a.cloneElement(s,e)}return a.Children.count(s)>1?a.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),r=a.forwardRef((e,r)=>{let{children:n,...o}=e,l=a.Children.toArray(n),i=l.find(v);if(i){let e=i.props.children,n=l.map(t=>t!==i?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,d.jsx)(t,{...o,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,d.jsx)(t,{...o,ref:r,children:n})});return r.displayName="".concat(e,".Slot"),r}var p=Symbol("radix.slottable");function v(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===p}var h=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=a.forwardRef((e,n)=>{let{asChild:o,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,d.jsx)(o?r:t,{...a,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function m(e,t){e&&c.flushSync(()=>e.dispatchEvent(t))}var y=r(97239),w=r(97999),g=r(69023);function x(e){let t=e+"CollectionProvider",[r,n]=(0,u.A)(t),[o,l]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:t,children:r}=e,n=a.useRef(null),l=a.useRef(new Map).current;return(0,d.jsx)(o,{scope:t,itemMap:l,collectionRef:n,children:r})};s.displayName=t;let c=e+"CollectionSlot",p=f(c),v=a.forwardRef((e,t)=>{let{scope:r,children:n}=e,o=l(c,r),a=(0,i.s)(t,o.collectionRef);return(0,d.jsx)(p,{ref:a,children:n})});v.displayName=c;let h=e+"CollectionItemSlot",m="data-radix-collection-item",y=f(h),w=a.forwardRef((e,t)=>{let{scope:r,children:n,...o}=e,u=a.useRef(null),s=(0,i.s)(t,u),c=l(h,r);return a.useEffect(()=>(c.itemMap.set(u,{ref:u,...o}),()=>void c.itemMap.delete(u))),(0,d.jsx)(y,{...{[m]:""},ref:s,children:n})});return w.displayName=h,[{Provider:s,Slot:v,ItemSlot:w},function(t){let r=l(e+"CollectionConsumer",t);return a.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(m,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},n]}var b=new WeakMap;function E(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=function(e,t){let r=e.length,n=C(t),o=n>=0?n:r+n;return o<0||o>=r?-1:o}(e,t);return -1===r?void 0:e[r]}function C(e){return e!=e||0===e?0:Math.trunc(e)}n=new WeakMap,class e extends Map{set(e,t){return b.get(this)&&(this.has(e)?(0,y._)(this,n)[(0,y._)(this,n).indexOf(e)]=e:(0,y._)(this,n).push(e)),super.set(e,t),this}insert(e,t,r){let o,a=this.has(t),l=(0,y._)(this,n).length,i=C(e),u=i>=0?i:l+i,s=u<0||u>=l?-1:u;if(s===this.size||a&&s===this.size-1||-1===s)return this.set(t,r),this;let c=this.size+ +!a;i<0&&u++;let d=[...(0,y._)(this,n)],f=!1;for(let e=u;e<c;e++)if(u===e){let n=d[e];d[e]===t&&(n=d[e+1]),a&&this.delete(t),o=this.get(n),this.set(t,r)}else{f||d[e-1]!==t||(f=!0);let r=d[f?e:e-1],n=o;o=this.get(r),this.delete(r),this.set(r,n)}return this}with(t,r,n){let o=new e(this);return o.insert(t,r,n),o}before(e){let t=(0,y._)(this,n).indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let o=(0,y._)(this,n).indexOf(e);return -1===o?this:this.insert(o,t,r)}after(e){let t=(0,y._)(this,n).indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let o=(0,y._)(this,n).indexOf(e);return -1===o?this:this.insert(o+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return(0,g._)(this,n,[]),super.clear()}delete(e){let t=super.delete(e);return t&&(0,y._)(this,n).splice((0,y._)(this,n).indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=E((0,y._)(this,n),e);if(void 0!==t)return this.get(t)}entryAt(e){let t=E((0,y._)(this,n),e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return(0,y._)(this,n).indexOf(e)}keyAt(e){return E((0,y._)(this,n),e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&n.push(e),o++;return new e(n)}map(t,r){let n=[],o=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(n)}reduce(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,o]=t,a=0,l=null!=o?o:this.at(0);for(let e of this)l=0===a&&1===t.length?e:Reflect.apply(n,this,[l,e,a,this]),a++;return l}reduceRight(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,o]=t,a=null!=o?o:this.at(-1);for(let e=this.size-1;e>=0;e--){let r=this.at(e);a=e===this.size-1&&1===t.length?r:Reflect.apply(n,this,[a,r,e,this])}return a}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];let o=[...this.entries()];return o.splice(...r),new e(o)}slice(t,r){let n=new e,o=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}constructor(e){super(e),(0,w._)(this,n,{writable:!0,value:void 0}),(0,g._)(this,n,[...super.keys()]),b.set(this,!0)}};var R=r(66218),M=r(70222),j=r(59584),k="dismissableLayer.update",D=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),P=a.forwardRef((e,t)=>{var r,n;let{disableOutsidePointerEvents:u=!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:p,onDismiss:v,...m}=e,y=a.useContext(D),[w,g]=a.useState(null),x=null!=(n=null==w?void 0:w.ownerDocument)?n:null==(r=globalThis)?void 0:r.document,[,b]=a.useState({}),E=(0,i.s)(t,e=>g(e)),C=Array.from(y.layers),[R]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),P=C.indexOf(R),_=w?C.indexOf(w):-1,N=y.layersWithOutsidePointerEventsDisabled.size>0,L=_>=P,T=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,M.c)(e),o=a.useRef(!1),l=a.useRef(()=>{});return a.useEffect(()=>{let e=e=>{if(e.target&&!o.current){let t=function(){A("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",l.current),l.current=t,r.addEventListener("click",l.current,{once:!0})):t()}else r.removeEventListener("click",l.current);o.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",l.current)}},[r,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target,r=[...y.branches].some(e=>e.contains(t));L&&!r&&(null==c||c(e),null==p||p(e),e.defaultPrevented||null==v||v())},x),O=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,M.c)(e),o=a.useRef(!1);return a.useEffect(()=>{let e=e=>{e.target&&!o.current&&A("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{let t=e.target;![...y.branches].some(e=>e.contains(t))&&(null==f||f(e),null==p||p(e),e.defaultPrevented||null==v||v())},x);return(0,j.U)(e=>{_===y.layers.size-1&&(null==s||s(e),!e.defaultPrevented&&v&&(e.preventDefault(),v()))},x),a.useEffect(()=>{if(w)return u&&(0===y.layersWithOutsidePointerEventsDisabled.size&&(o=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(w)),y.layers.add(w),S(),()=>{u&&1===y.layersWithOutsidePointerEventsDisabled.size&&(x.body.style.pointerEvents=o)}},[w,x,u,y]),a.useEffect(()=>()=>{w&&(y.layers.delete(w),y.layersWithOutsidePointerEventsDisabled.delete(w),S())},[w,y]),a.useEffect(()=>{let e=()=>b({});return document.addEventListener(k,e),()=>document.removeEventListener(k,e)},[]),(0,d.jsx)(h.div,{...m,ref:E,style:{pointerEvents:N?L?"auto":"none":void 0,...e.style},onFocusCapture:(0,l.m)(e.onFocusCapture,O.onFocusCapture),onBlurCapture:(0,l.m)(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:(0,l.m)(e.onPointerDownCapture,T.onPointerDownCapture)})});function S(){let e=new CustomEvent(k);document.dispatchEvent(e)}function A(e,t,r,n){let{discrete:o}=n,a=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?m(a,l):a.dispatchEvent(l)}P.displayName="DismissableLayer",a.forwardRef((e,t)=>{let r=a.useContext(D),n=a.useRef(null),o=(0,i.s)(t,n);return a.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,d.jsx)(h.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var _=r(19526),N="focusScope.autoFocusOnMount",L="focusScope.autoFocusOnUnmount",T={bubbles:!1,cancelable:!0},O=a.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[s,c]=a.useState(null),f=(0,M.c)(o),p=(0,M.c)(l),v=a.useRef(null),m=(0,i.s)(t,e=>c(e)),y=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(n){let e=function(e){if(y.paused||!s)return;let t=e.target;s.contains(t)?v.current=t:K(v.current,{select:!0})},t=function(e){if(y.paused||!s)return;let t=e.relatedTarget;null!==t&&(s.contains(t)||K(v.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&K(s)});return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,s,y.paused]),a.useEffect(()=>{if(s){z.add(y);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(N,T);s.addEventListener(N,f),s.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.activeElement;for(let n of e)if(K(n,{select:t}),document.activeElement!==r)return}(I(s).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&K(s))}return()=>{s.removeEventListener(N,f),setTimeout(()=>{let t=new CustomEvent(L,T);s.addEventListener(L,p),s.dispatchEvent(t),t.defaultPrevented||K(null!=e?e:document.body,{select:!0}),s.removeEventListener(L,p),z.remove(y)},0)}}},[s,f,p,y]);let w=a.useCallback(e=>{if(!r&&!n||y.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[n,a]=function(e){let t=I(e);return[F(t,e),F(t.reverse(),e)]}(t);n&&a?e.shiftKey||o!==a?e.shiftKey&&o===n&&(e.preventDefault(),r&&K(a,{select:!0})):(e.preventDefault(),r&&K(n,{select:!0})):o===t&&e.preventDefault()}},[r,n,y.paused]);return(0,d.jsx)(h.div,{tabIndex:-1,...u,ref:m,onKeyDown:w})});function I(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function F(e,t){for(let r of e)if(!function(e,t){let{upTo:r}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===r||e!==r);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function K(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}O.displayName="FocusScope";var z=function(){let e=[];return{add(t){let r=e[0];t!==r&&(null==r||r.pause()),(e=B(e,t)).unshift(t)},remove(t){var r;null==(r=(e=B(e,t))[0])||r.resume()}}}();function B(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var W=r(68946),U=r(88334),H=r(58146),X=a.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...a}=e;return(0,d.jsx)(h.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,d.jsx)("polygon",{points:"0,0 30,0 15,10"})})});X.displayName="Arrow";var G=r(4129),V=r(84288),Y="Popper",[Z,q]=(0,u.A)(Y),[$,J]=Z(Y),Q=e=>{let{__scopePopper:t,children:r}=e,[n,o]=a.useState(null);return(0,d.jsx)($,{scope:t,anchor:n,onAnchorChange:o,children:r})};Q.displayName=Y;var ee="PopperAnchor",et=a.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...o}=e,l=J(ee,r),u=a.useRef(null),s=(0,i.s)(t,u);return a.useEffect(()=>{l.onAnchorChange((null==n?void 0:n.current)||u.current)}),n?null:(0,d.jsx)(h.div,{...o,ref:s})});et.displayName=ee;var er="PopperContent",[en,eo]=Z(er),ea=a.forwardRef((e,t)=>{var r,n,o,l,u,s,c,f;let{__scopePopper:p,side:v="bottom",sideOffset:m=0,align:y="center",alignOffset:w=0,arrowPadding:g=0,avoidCollisions:x=!0,collisionBoundary:b=[],collisionPadding:E=0,sticky:C="partial",hideWhenDetached:R=!1,updatePositionStrategy:j="optimized",onPlaced:k,...D}=e,P=J(er,p),[S,A]=a.useState(null),_=(0,i.s)(t,e=>A(e)),[N,L]=a.useState(null),T=(0,V.X)(N),O=null!=(c=null==T?void 0:T.width)?c:0,I=null!=(f=null==T?void 0:T.height)?f:0,F="number"==typeof E?E:{top:0,right:0,bottom:0,left:0,...E},K=Array.isArray(b)?b:[b],z=K.length>0,B={padding:F,boundary:K.filter(es),altBoundary:z},{refs:W,floatingStyles:X,placement:Y,isPositioned:Z,middlewareData:q}=(0,U.we)({strategy:"fixed",placement:v+("center"!==y?"-"+y:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,H.ll)(...t,{animationFrame:"always"===j})},elements:{reference:P.anchor},middleware:[(0,U.cY)({mainAxis:m+I,alignmentAxis:w}),x&&(0,U.BN)({mainAxis:!0,crossAxis:!1,limiter:"partial"===C?(0,U.ER)():void 0,...B}),x&&(0,U.UU)({...B}),(0,U.Ej)({...B,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:o}=e,{width:a,height:l}=r.reference,i=t.floating.style;i.setProperty("--radix-popper-available-width","".concat(n,"px")),i.setProperty("--radix-popper-available-height","".concat(o,"px")),i.setProperty("--radix-popper-anchor-width","".concat(a,"px")),i.setProperty("--radix-popper-anchor-height","".concat(l,"px"))}}),N&&(0,U.UE)({element:N,padding:g}),ec({arrowWidth:O,arrowHeight:I}),R&&(0,U.jD)({strategy:"referenceHidden",...B})]}),[$,Q]=ed(Y),ee=(0,M.c)(k);(0,G.N)(()=>{Z&&(null==ee||ee())},[Z,ee]);let et=null==(r=q.arrow)?void 0:r.x,eo=null==(n=q.arrow)?void 0:n.y,ea=(null==(o=q.arrow)?void 0:o.centerOffset)!==0,[el,ei]=a.useState();return(0,G.N)(()=>{S&&ei(window.getComputedStyle(S).zIndex)},[S]),(0,d.jsx)("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:Z?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:el,"--radix-popper-transform-origin":[null==(l=q.transformOrigin)?void 0:l.x,null==(u=q.transformOrigin)?void 0:u.y].join(" "),...(null==(s=q.hide)?void 0:s.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,d.jsx)(en,{scope:p,placedSide:$,onArrowChange:L,arrowX:et,arrowY:eo,shouldHideArrow:ea,children:(0,d.jsx)(h.div,{"data-side":$,"data-align":Q,...D,ref:_,style:{...D.style,animation:Z?void 0:"none"}})})})});ea.displayName=er;var el="PopperArrow",ei={top:"bottom",right:"left",bottom:"top",left:"right"},eu=a.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,o=eo(el,r),a=ei[o.placedSide];return(0,d.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,d.jsx)(X,{...n,ref:t,style:{...n.style,display:"block"}})})});function es(e){return null!==e}eu.displayName=el;var ec=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o,a,l;let{placement:i,rects:u,middlewareData:s}=t,c=(null==(r=s.arrow)?void 0:r.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[p,v]=ed(i),h={start:"0%",center:"50%",end:"100%"}[v],m=(null!=(a=null==(n=s.arrow)?void 0:n.x)?a:0)+d/2,y=(null!=(l=null==(o=s.arrow)?void 0:o.y)?l:0)+f/2,w="",g="";return"bottom"===p?(w=c?h:"".concat(m,"px"),g="".concat(-f,"px")):"top"===p?(w=c?h:"".concat(m,"px"),g="".concat(u.floating.height+f,"px")):"right"===p?(w="".concat(-f,"px"),g=c?h:"".concat(y,"px")):"left"===p&&(w="".concat(u.floating.width+f,"px"),g=c?h:"".concat(y,"px")),{data:{x:w,y:g}}}});function ed(e){let[t,r="center"]=e.split("-");return[t,r]}var ef=a.forwardRef((e,t)=>{var r,n;let{container:o,...l}=e,[i,u]=a.useState(!1);(0,G.N)(()=>u(!0),[]);let s=o||i&&(null==(n=globalThis)||null==(r=n.document)?void 0:r.body);return s?c.createPortal((0,d.jsx)(h.div,{...l,ref:t}),s):null});ef.displayName="Portal";var ep=r(76842),ev="rovingFocusGroup.onEntryFocus",eh={bubbles:!1,cancelable:!0},em="RovingFocusGroup",[ey,ew,eg]=x(em),[ex,eb]=(0,u.A)(em,[eg]),[eE,eC]=ex(em),eR=a.forwardRef((e,t)=>(0,d.jsx)(ey.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(ey.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(eM,{...e,ref:t})})}));eR.displayName=em;var eM=a.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:u,currentTabStopId:c,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:p,onEntryFocus:v,preventScrollOnEntryFocus:m=!1,...y}=e,w=a.useRef(null),g=(0,i.s)(t,w),x=(0,R.jH)(u),[b,E]=(0,s.i)({prop:c,defaultProp:null!=f?f:null,onChange:p,caller:em}),[C,j]=a.useState(!1),k=(0,M.c)(v),D=ew(r),P=a.useRef(!1),[S,A]=a.useState(0);return a.useEffect(()=>{let e=w.current;if(e)return e.addEventListener(ev,k),()=>e.removeEventListener(ev,k)},[k]),(0,d.jsx)(eE,{scope:r,orientation:n,dir:x,loop:o,currentTabStopId:b,onItemFocus:a.useCallback(e=>E(e),[E]),onItemShiftTab:a.useCallback(()=>j(!0),[]),onFocusableItemAdd:a.useCallback(()=>A(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>A(e=>e-1),[]),children:(0,d.jsx)(h.div,{tabIndex:C||0===S?-1:0,"data-orientation":n,...y,ref:g,style:{outline:"none",...e.style},onMouseDown:(0,l.m)(e.onMouseDown,()=>{P.current=!0}),onFocus:(0,l.m)(e.onFocus,e=>{let t=!P.current;if(e.target===e.currentTarget&&t&&!C){let t=new CustomEvent(ev,eh);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);eP([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),m)}}P.current=!1}),onBlur:(0,l.m)(e.onBlur,()=>j(!1))})})}),ej="RovingFocusGroupItem",ek=a.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:u,...s}=e,c=(0,W.B)(),f=i||c,p=eC(ej,r),v=p.currentTabStopId===f,m=ew(r),{onFocusableItemAdd:y,onFocusableItemRemove:w,currentTabStopId:g}=p;return a.useEffect(()=>{if(n)return y(),()=>w()},[n,y,w]),(0,d.jsx)(ey.ItemSlot,{scope:r,id:f,focusable:n,active:o,children:(0,d.jsx)(h.span,{tabIndex:v?0:-1,"data-orientation":p.orientation,...s,ref:t,onMouseDown:(0,l.m)(e.onMouseDown,e=>{n?p.onItemFocus(f):e.preventDefault()}),onFocus:(0,l.m)(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:(0,l.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let o=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)))return eD[o]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>eP(r))}}),children:"function"==typeof u?u({isCurrentTabStop:v,hasTabStop:null!=g}):u})})});ek.displayName=ej;var eD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eP(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var eS=r(97745),eA=r(71450),e_=r(60216),eN=r(78357),eL=(0,r(43711).f)(),eT=function(){},eO=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:eT,onWheelCapture:eT,onTouchMoveCapture:eT}),o=n[0],l=n[1],i=e.forwardProps,u=e.children,s=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,v=e.noRelative,h=e.noIsolation,m=e.inert,y=e.allowPinchZoom,w=e.as,g=e.gapMode,x=(0,eA.Tt)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=(0,eN.S)([r,t]),E=(0,eA.Cl)((0,eA.Cl)({},x),o);return a.createElement(a.Fragment,null,d&&a.createElement(p,{sideCar:eL,removeScrollBar:c,shards:f,noRelative:v,noIsolation:h,inert:m,setCallbacks:l,allowPinchZoom:!!y,lockRef:r,gapMode:g}),i?a.cloneElement(a.Children.only(u),(0,eA.Cl)((0,eA.Cl)({},E),{ref:b})):a.createElement(void 0===w?"div":w,(0,eA.Cl)({},E,{className:s,ref:b}),u))});eO.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},eO.classNames={fullWidth:e_.pN,zeroRight:e_.Mi};var eI=r(39615),eF=r(46810),eK=r(65841),ez=!1;if("undefined"!=typeof window)try{var eB=Object.defineProperty({},"passive",{get:function(){return ez=!0,!0}});window.addEventListener("test",eB,eB),window.removeEventListener("test",eB,eB)}catch(e){ez=!1}var eW=!!ez&&{passive:!1},eU=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},eH=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),eX(e,n)){var o=eG(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},eX=function(e,t){return"v"===e?eU(t,"overflowY"):eU(t,"overflowX")},eG=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},eV=function(e,t,r,n,o){var a,l=(a=window.getComputedStyle(t).direction,"h"===e&&"rtl"===a?-1:1),i=l*n,u=r.target,s=t.contains(u),c=!1,d=i>0,f=0,p=0;do{var v=eG(e,u),h=v[0],m=v[1]-v[2]-l*h;(h||m)&&eX(e,u)&&(f+=m,p+=h),u=u.parentNode.host||u.parentNode}while(!s&&u!==document.body||s&&(t.contains(u)||t===u));return d&&(o&&1>Math.abs(f)||!o&&i>f)?c=!0:!d&&(o&&1>Math.abs(p)||!o&&-i>p)&&(c=!0),c},eY=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eZ=function(e){return[e.deltaX,e.deltaY]},eq=function(e){return e&&"current"in e?e.current:e},e$=0,eJ=[];let eQ=(0,eI.m)(eL,function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),o=a.useState(e$++)[0],l=a.useState(eK.T0)[0],i=a.useRef(e);a.useEffect(function(){i.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(0,eA.fX)([e.lockRef.current],(e.shards||[]).map(eq),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=eY(e),l=r.current,u="deltaX"in e?e.deltaX:l[0]-a[0],s="deltaY"in e?e.deltaY:l[1]-a[1],c=e.target,d=Math.abs(u)>Math.abs(s)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=eH(d,c);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=eH(d,c)),!f)return!1;if(!n.current&&"changedTouches"in e&&(u||s)&&(n.current=o),!o)return!0;var p=n.current||o;return eV(p,t,e,"h"===p?u:s,!0)},[]),s=a.useCallback(function(e){if(eJ.length&&eJ[eJ.length-1]===l){var r="deltaY"in e?eZ(e):eY(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var o=(i.current.shards||[]).map(eq).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?u(e,o[0]):!i.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=a.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=a.useCallback(function(e){r.current=eY(e),n.current=void 0},[]),f=a.useCallback(function(t){c(t.type,eZ(t),t.target,u(t,e.lockRef.current))},[]),p=a.useCallback(function(t){c(t.type,eY(t),t.target,u(t,e.lockRef.current))},[]);a.useEffect(function(){return eJ.push(l),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",s,eW),document.addEventListener("touchmove",s,eW),document.addEventListener("touchstart",d,eW),function(){eJ=eJ.filter(function(e){return e!==l}),document.removeEventListener("wheel",s,eW),document.removeEventListener("touchmove",s,eW),document.removeEventListener("touchstart",d,eW)}},[]);var v=e.removeScrollBar,h=e.inert;return a.createElement(a.Fragment,null,h?a.createElement(l,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,v?a.createElement(eF.jp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)});var e0=a.forwardRef(function(e,t){return a.createElement(eO,(0,eA.Cl)({},e,{ref:t,sideCar:eQ}))});e0.classNames=eO.classNames;var e1=["Enter"," "],e2=["ArrowUp","PageDown","End"],e5=["ArrowDown","PageUp","Home",...e2],e7={ltr:[...e1,"ArrowRight"],rtl:[...e1,"ArrowLeft"]},e3={ltr:["ArrowLeft"],rtl:["ArrowRight"]},e8="Menu",[e4,e9,e6]=x(e8),[te,tt]=(0,u.A)(e8,[e6,q,eb]),tr=q(),tn=eb(),[to,ta]=te(e8),[tl,ti]=te(e8),tu=e=>{let{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:l,modal:i=!0}=e,u=tr(t),[s,c]=a.useState(null),f=a.useRef(!1),p=(0,M.c)(l),v=(0,R.jH)(o);return a.useEffect(()=>{let e=()=>{f.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,d.jsx)(Q,{...u,children:(0,d.jsx)(to,{scope:t,open:r,onOpenChange:p,content:s,onContentChange:c,children:(0,d.jsx)(tl,{scope:t,onClose:a.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:v,modal:i,children:n})})})};tu.displayName=e8;var ts=a.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,o=tr(r);return(0,d.jsx)(et,{...o,...n,ref:t})});ts.displayName="MenuAnchor";var tc="MenuPortal",[td,tf]=te(tc,{forceMount:void 0}),tp=e=>{let{__scopeMenu:t,forceMount:r,children:n,container:o}=e,a=ta(tc,t);return(0,d.jsx)(td,{scope:t,forceMount:r,children:(0,d.jsx)(ep.C,{present:r||a.open,children:(0,d.jsx)(ef,{asChild:!0,container:o,children:n})})})};tp.displayName=tc;var tv="MenuContent",[th,tm]=te(tv),ty=a.forwardRef((e,t)=>{let r=tf(tv,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,a=ta(tv,e.__scopeMenu),l=ti(tv,e.__scopeMenu);return(0,d.jsx)(e4.Provider,{scope:e.__scopeMenu,children:(0,d.jsx)(ep.C,{present:n||a.open,children:(0,d.jsx)(e4.Slot,{scope:e.__scopeMenu,children:l.modal?(0,d.jsx)(tw,{...o,ref:t}):(0,d.jsx)(tg,{...o,ref:t})})})})}),tw=a.forwardRef((e,t)=>{let r=ta(tv,e.__scopeMenu),n=a.useRef(null),o=(0,i.s)(t,n);return a.useEffect(()=>{let e=n.current;if(e)return(0,eS.Eq)(e)},[]),(0,d.jsx)(tb,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:(0,l.m)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),tg=a.forwardRef((e,t)=>{let r=ta(tv,e.__scopeMenu);return(0,d.jsx)(tb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),tx=f("MenuContent.ScrollLock"),tb=a.forwardRef((e,t)=>{let{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:u,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:v,onFocusOutside:h,onInteractOutside:m,onDismiss:y,disableOutsideScroll:w,...g}=e,x=ta(tv,r),b=ti(tv,r),E=tr(r),C=tn(r),R=e9(r),[M,j]=a.useState(null),k=a.useRef(null),D=(0,i.s)(t,k,x.onContentChange),S=a.useRef(0),A=a.useRef(""),N=a.useRef(0),L=a.useRef(null),T=a.useRef("right"),I=a.useRef(0),F=w?e0:a.Fragment;a.useEffect(()=>()=>window.clearTimeout(S.current),[]),(0,_.Oh)();let K=a.useCallback(e=>{var t,r;return T.current===(null==(t=L.current)?void 0:t.side)&&function(e,t){return!!t&&function(e,t){let{x:r,y:n}=e,o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let l=t[e],i=t[a],u=l.x,s=l.y,c=i.x,d=i.y;s>n!=d>n&&r<(c-u)*(n-s)/(d-s)+u&&(o=!o)}return o}({x:e.clientX,y:e.clientY},t)}(e,null==(r=L.current)?void 0:r.area)},[]);return(0,d.jsx)(th,{scope:r,searchRef:A,onItemEnter:a.useCallback(e=>{K(e)&&e.preventDefault()},[K]),onItemLeave:a.useCallback(e=>{var t;K(e)||(null==(t=k.current)||t.focus(),j(null))},[K]),onTriggerLeave:a.useCallback(e=>{K(e)&&e.preventDefault()},[K]),pointerGraceTimerRef:N,onPointerGraceIntentChange:a.useCallback(e=>{L.current=e},[]),children:(0,d.jsx)(F,{...w?{as:tx,allowPinchZoom:!0}:void 0,children:(0,d.jsx)(O,{asChild:!0,trapped:o,onMountAutoFocus:(0,l.m)(u,e=>{var t;e.preventDefault(),null==(t=k.current)||t.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,d.jsx)(P,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:v,onFocusOutside:h,onInteractOutside:m,onDismiss:y,children:(0,d.jsx)(eR,{asChild:!0,...C,dir:b.dir,orientation:"vertical",loop:n,currentTabStopId:M,onCurrentTabStopIdChange:j,onEntryFocus:(0,l.m)(f,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,d.jsx)(ea,{role:"menu","aria-orientation":"vertical","data-state":tV(x.open),"data-radix-menu-content":"",dir:b.dir,...E,...g,ref:D,style:{outline:"none",...g.style},onKeyDown:(0,l.m)(g.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&(e=>{var t,r;let n=A.current+e,o=R().filter(e=>!e.disabled),a=document.activeElement,l=null==(t=o.find(e=>e.ref.current===a))?void 0:t.textValue,i=function(e,t,r){var n;let o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1,l=(n=Math.max(a,0),e.map((t,r)=>e[(n+r)%e.length]));1===o.length&&(l=l.filter(e=>e!==r));let i=l.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return i!==r?i:void 0}(o.map(e=>e.textValue),n,l),u=null==(r=o.find(e=>e.textValue===i))?void 0:r.ref.current;!function e(t){A.current=t,window.clearTimeout(S.current),""!==t&&(S.current=window.setTimeout(()=>e(""),1e3))}(n),u&&setTimeout(()=>u.focus())})(e.key));let o=k.current;if(e.target!==o||!e5.includes(e.key))return;e.preventDefault();let a=R().filter(e=>!e.disabled).map(e=>e.ref.current);e2.includes(e.key)&&a.reverse(),function(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(a)}),onBlur:(0,l.m)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(S.current),A.current="")}),onPointerMove:(0,l.m)(e.onPointerMove,tq(e=>{let t=e.target,r=I.current!==e.clientX;e.currentTarget.contains(t)&&r&&(T.current=e.clientX>I.current?"right":"left",I.current=e.clientX)}))})})})})})})});ty.displayName=tv;var tE=a.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,d.jsx)(h.div,{role:"group",...n,ref:t})});tE.displayName="MenuGroup";var tC=a.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,d.jsx)(h.div,{...n,ref:t})});tC.displayName="MenuLabel";var tR="MenuItem",tM="menu.itemSelect",tj=a.forwardRef((e,t)=>{let{disabled:r=!1,onSelect:n,...o}=e,u=a.useRef(null),s=ti(tR,e.__scopeMenu),c=tm(tR,e.__scopeMenu),f=(0,i.s)(t,u),p=a.useRef(!1);return(0,d.jsx)(tk,{...o,ref:f,disabled:r,onClick:(0,l.m)(e.onClick,()=>{let e=u.current;if(!r&&e){let t=new CustomEvent(tM,{bubbles:!0,cancelable:!0});e.addEventListener(tM,e=>null==n?void 0:n(e),{once:!0}),m(e,t),t.defaultPrevented?p.current=!1:s.onClose()}}),onPointerDown:t=>{var r;null==(r=e.onPointerDown)||r.call(e,t),p.current=!0},onPointerUp:(0,l.m)(e.onPointerUp,e=>{var t;p.current||null==(t=e.currentTarget)||t.click()}),onKeyDown:(0,l.m)(e.onKeyDown,e=>{let t=""!==c.searchRef.current;r||t&&" "===e.key||e1.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});tj.displayName=tR;var tk=a.forwardRef((e,t)=>{let{__scopeMenu:r,disabled:n=!1,textValue:o,...u}=e,s=tm(tR,r),c=tn(r),f=a.useRef(null),p=(0,i.s)(t,f),[v,m]=a.useState(!1),[y,w]=a.useState("");return a.useEffect(()=>{let e=f.current;if(e){var t;w((null!=(t=e.textContent)?t:"").trim())}},[u.children]),(0,d.jsx)(e4.ItemSlot,{scope:r,disabled:n,textValue:null!=o?o:y,children:(0,d.jsx)(ek,{asChild:!0,...c,focusable:!n,children:(0,d.jsx)(h.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...u,ref:p,onPointerMove:(0,l.m)(e.onPointerMove,tq(e=>{n?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,l.m)(e.onPointerLeave,tq(e=>s.onItemLeave(e))),onFocus:(0,l.m)(e.onFocus,()=>m(!0)),onBlur:(0,l.m)(e.onBlur,()=>m(!1))})})})}),tD=a.forwardRef((e,t)=>{let{checked:r=!1,onCheckedChange:n,...o}=e;return(0,d.jsx)(tO,{scope:e.__scopeMenu,checked:r,children:(0,d.jsx)(tj,{role:"menuitemcheckbox","aria-checked":tY(r)?"mixed":r,...o,ref:t,"data-state":tZ(r),onSelect:(0,l.m)(o.onSelect,()=>null==n?void 0:n(!!tY(r)||!r),{checkForDefaultPrevented:!1})})})});tD.displayName="MenuCheckboxItem";var tP="MenuRadioGroup",[tS,tA]=te(tP,{value:void 0,onValueChange:()=>{}}),t_=a.forwardRef((e,t)=>{let{value:r,onValueChange:n,...o}=e,a=(0,M.c)(n);return(0,d.jsx)(tS,{scope:e.__scopeMenu,value:r,onValueChange:a,children:(0,d.jsx)(tE,{...o,ref:t})})});t_.displayName=tP;var tN="MenuRadioItem",tL=a.forwardRef((e,t)=>{let{value:r,...n}=e,o=tA(tN,e.__scopeMenu),a=r===o.value;return(0,d.jsx)(tO,{scope:e.__scopeMenu,checked:a,children:(0,d.jsx)(tj,{role:"menuitemradio","aria-checked":a,...n,ref:t,"data-state":tZ(a),onSelect:(0,l.m)(n.onSelect,()=>{var e;return null==(e=o.onValueChange)?void 0:e.call(o,r)},{checkForDefaultPrevented:!1})})})});tL.displayName=tN;var tT="MenuItemIndicator",[tO,tI]=te(tT,{checked:!1}),tF=a.forwardRef((e,t)=>{let{__scopeMenu:r,forceMount:n,...o}=e,a=tI(tT,r);return(0,d.jsx)(ep.C,{present:n||tY(a.checked)||!0===a.checked,children:(0,d.jsx)(h.span,{...o,ref:t,"data-state":tZ(a.checked)})})});tF.displayName=tT;var tK=a.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,d.jsx)(h.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});tK.displayName="MenuSeparator";var tz=a.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,o=tr(r);return(0,d.jsx)(eu,{...o,...n,ref:t})});tz.displayName="MenuArrow";var[tB,tW]=te("MenuSub"),tU="MenuSubTrigger",tH=a.forwardRef((e,t)=>{let r=ta(tU,e.__scopeMenu),n=ti(tU,e.__scopeMenu),o=tW(tU,e.__scopeMenu),u=tm(tU,e.__scopeMenu),s=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=u,p={__scopeMenu:e.__scopeMenu},v=a.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return a.useEffect(()=>v,[v]),a.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),f(null)}},[c,f]),(0,d.jsx)(ts,{asChild:!0,...p,children:(0,d.jsx)(tk,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":tV(r.open),...e,ref:(0,i.t)(t,o.onTriggerChange),onClick:t=>{var n;null==(n=e.onClick)||n.call(e,t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:(0,l.m)(e.onPointerMove,tq(t=>{u.onItemEnter(t),!t.defaultPrevented&&(e.disabled||r.open||s.current||(u.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{r.onOpenChange(!0),v()},100)))})),onPointerLeave:(0,l.m)(e.onPointerLeave,tq(e=>{var t,n;v();let o=null==(t=r.content)?void 0:t.getBoundingClientRect();if(o){let t=null==(n=r.content)?void 0:n.dataset.side,a="right"===t,l=o[a?"left":"right"],i=o[a?"right":"left"];u.onPointerGraceIntentChange({area:[{x:e.clientX+(a?-5:5),y:e.clientY},{x:l,y:o.top},{x:i,y:o.top},{x:i,y:o.bottom},{x:l,y:o.bottom}],side:t}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(e),e.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:(0,l.m)(e.onKeyDown,t=>{let o=""!==u.searchRef.current;if(!e.disabled&&(!o||" "!==t.key)&&e7[n.dir].includes(t.key)){var a;r.onOpenChange(!0),null==(a=r.content)||a.focus(),t.preventDefault()}})})})});tH.displayName=tU;var tX="MenuSubContent",tG=a.forwardRef((e,t)=>{let r=tf(tv,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,u=ta(tv,e.__scopeMenu),s=ti(tv,e.__scopeMenu),c=tW(tX,e.__scopeMenu),f=a.useRef(null),p=(0,i.s)(t,f);return(0,d.jsx)(e4.Provider,{scope:e.__scopeMenu,children:(0,d.jsx)(ep.C,{present:n||u.open,children:(0,d.jsx)(e4.Slot,{scope:e.__scopeMenu,children:(0,d.jsx)(tb,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:p,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;s.isUsingKeyboardRef.current&&(null==(t=f.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,l.m)(e.onFocusOutside,e=>{e.target!==c.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:(0,l.m)(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:(0,l.m)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),r=e3[s.dir].includes(e.key);if(t&&r){var n;u.onOpenChange(!1),null==(n=c.trigger)||n.focus(),e.preventDefault()}})})})})})});function tV(e){return e?"open":"closed"}function tY(e){return"indeterminate"===e}function tZ(e){return tY(e)?"indeterminate":e?"checked":"unchecked"}function tq(e){return t=>"mouse"===t.pointerType?e(t):void 0}tG.displayName=tX;var t$="DropdownMenu",[tJ,tQ]=(0,u.A)(t$,[tt]),t0=tt(),[t1,t2]=tJ(t$),t5=e=>{let{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:l,onOpenChange:i,modal:u=!0}=e,c=t0(t),f=a.useRef(null),[p,v]=(0,s.i)({prop:o,defaultProp:null!=l&&l,onChange:i,caller:t$});return(0,d.jsx)(t1,{scope:t,triggerId:(0,W.B)(),triggerRef:f,contentId:(0,W.B)(),open:p,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(e=>!e),[v]),modal:u,children:(0,d.jsx)(tu,{...c,open:p,onOpenChange:v,dir:n,modal:u,children:r})})};t5.displayName=t$;var t7="DropdownMenuTrigger",t3=a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,a=t2(t7,r),u=t0(r);return(0,d.jsx)(ts,{asChild:!0,...u,children:(0,d.jsx)(h.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:(0,i.t)(t,a.triggerRef),onPointerDown:(0,l.m)(e.onPointerDown,e=>{!n&&0===e.button&&!1===e.ctrlKey&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:(0,l.m)(e.onKeyDown,e=>{!n&&(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});t3.displayName=t7;var t8=e=>{let{__scopeDropdownMenu:t,...r}=e,n=t0(t);return(0,d.jsx)(tp,{...n,...r})};t8.displayName="DropdownMenuPortal";var t4="DropdownMenuContent",t9=a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t2(t4,r),i=t0(r),u=a.useRef(!1);return(0,d.jsx)(ty,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...n,ref:t,onCloseAutoFocus:(0,l.m)(e.onCloseAutoFocus,e=>{var t;u.current||null==(t=o.triggerRef.current)||t.focus(),u.current=!1,e.preventDefault()}),onInteractOutside:(0,l.m)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!o.modal||n)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});t9.displayName=t4,a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tE,{...o,...n,ref:t})}).displayName="DropdownMenuGroup",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tC,{...o,...n,ref:t})}).displayName="DropdownMenuLabel";var t6=a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tj,{...o,...n,ref:t})});t6.displayName="DropdownMenuItem",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tD,{...o,...n,ref:t})}).displayName="DropdownMenuCheckboxItem",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(t_,{...o,...n,ref:t})}).displayName="DropdownMenuRadioGroup",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tL,{...o,...n,ref:t})}).displayName="DropdownMenuRadioItem",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tF,{...o,...n,ref:t})}).displayName="DropdownMenuItemIndicator";var re=a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tK,{...o,...n,ref:t})});re.displayName="DropdownMenuSeparator",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tz,{...o,...n,ref:t})}).displayName="DropdownMenuArrow",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tH,{...o,...n,ref:t})}).displayName="DropdownMenuSubTrigger",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tG,{...o,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";var rt=t5,rr=t3,rn=t8,ro=t9,ra=t6,rl=re},57268:(e,t,r)=>{r.d(t,{b:()=>s});var n=r(12115),o=r(88142),a=r(95155),l="horizontal",i=["horizontal","vertical"],u=n.forwardRef((e,t)=>{var r;let{decorative:n,orientation:u=l,...s}=e,c=(r=u,i.includes(r))?u:l;return(0,a.jsx)(o.sG.div,{"data-orientation":c,...n?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...s,ref:t})});u.displayName="Separator";var s=u},89715:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[165],{11186:(e,t,n)=>{"use strict";n.d(t,{bq:()=>p,eb:()=>g,gC:()=>u,l6:()=>d,yv:()=>c});var s=n(95155);n(12115);var a=n(59929),i=n(24033),r=n(5917),l=n(12108),o=n(64269);function d(e){let{...t}=e;return(0,s.jsx)(a.bL,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,s.jsx)(a.WT,{"data-slot":"select-value",...t})}function p(e){let{className:t,size:n="default",children:r,...l}=e;return(0,s.jsxs)(a.l9,{"data-slot":"select-trigger","data-size":n,className:(0,o.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...l,children:[r,(0,s.jsx)(a.In,{asChild:!0,children:(0,s.jsx)(i.A,{className:"size-4 opacity-50"})})]})}function u(e){let{className:t,children:n,position:i="popper",...r}=e;return(0,s.jsx)(a.ZL,{children:(0,s.jsxs)(a.UC,{"data-slot":"select-content",className:(0,o.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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:i,...r,children:[(0,s.jsx)(x,{}),(0,s.jsx)(a.LM,{className:(0,o.cn)("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),(0,s.jsx)(h,{})]})})}function g(e){let{className:t,children:n,...i}=e;return(0,s.jsxs)(a.q7,{"data-slot":"select-item",className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[(0,s.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(a.VF,{children:(0,s.jsx)(r.A,{className:"size-4"})})}),(0,s.jsx)(a.p4,{children:n})]})}function x(e){let{className:t,...n}=e;return(0,s.jsx)(a.PP,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,s.jsx)(l.A,{className:"size-4"})})}function h(e){let{className:t,...n}=e;return(0,s.jsx)(a.wn,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,s.jsx)(i.A,{className:"size-4"})})}},12108:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});let s=(0,n(71847).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},17254:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>P});var s=n(95155),a=n(12115),i=n(80230),r=n(7831),l=n(41444),o=n(22470),d=n(56419),c=n(35835),p=n(87270),u=n(20243),g=n(18332),x=n(98053),h=n(50803),m=n(78192),f=n(35299),j=n(3998),v=n(46826),y=n(18514),b=n(71360),N=n(51834),w=n(11186),A=n(46767),C=n(65142),E=n(76444);let k=[{value:"LITELLM",label:"LiteLLM"},{value:"OPENAI_SDK",label:"OpenAI SDK/API"},{value:"GOOGLE_ADK",label:"Google ADK"},{value:"OTHER",label:"Other / Proprietary"},{value:"UNKNOWN",label:"Unknown"}],I={LITELLM:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",OPENAI_SDK:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",GOOGLE_ADK:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",OTHER:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",UNKNOWN:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400"},z=(0,l.h)("AgentsPage");function P(){var e;let{isAuthenticated:t,isLoading:n}=(0,i.h)(),[l,P]=(0,a.useState)([]),[T,D]=(0,a.useState)(!0),[_,L]=(0,a.useState)(null),[O,F]=(0,a.useState)(null),[S,K]=(0,a.useState)(!1),[U,M]=(0,a.useState)({open:!1,title:"",description:""}),[$,q]=(0,a.useState)({open:!1,agent:null}),[G,J]=(0,a.useState)(null),[R,H]=(0,a.useState)(!0),[Z,V]=(0,a.useState)(null),[W,X]=(0,a.useState)(!1),[B,Q]=(0,a.useState)(!1),[Y,ee]=(0,a.useState)(null),[et,en]=(0,a.useState)({name:"",endpoint:"",agentType:"",description:""}),es=(0,a.useCallback)(async()=>{D(!0),L(null),z.debug("Fetching agents...");try{var e;let t=await r.in.agentList();z.info({count:null==(e=t.results)?void 0:e.length},"Agents fetched successfully"),P(t.results||[])}catch(t){z.error({err:t},"Error fetching agents");let e=t.message||"Failed to load agents. Please try again later.";if(t.response){let n=t.response.status,s="Could not read error body";try{s=await t.response.text()}catch(e){}z.error({status:n,responseBody:s},"API Error"),e=403===n?"Forbidden: Check your permissions.":401===n?"Unauthorized: Please log in again.":"API Error (".concat(n,"): ").concat(s||e)}L(e),P([])}finally{D(!1)}},[]);(0,a.useEffect)(()=>{(async()=>{if(!n&&t){H(!0),V(null);try{z.debug("Fetching user profile via /user/me...");let e=await r.userApi.userMeRetrieve();J(e),z.debug({org:e.organization},"User profile fetched")}catch(t){z.error({err:t},"Error fetching user profile");let e=t.message||"Failed to load user profile.";if(t.response){let n=t.response.status,s="Could not read error body";try{s=await t.response.text()}catch(e){}e="Profile API Error (".concat(n,"): ").concat(s||e)}V(e)}finally{H(!1)}}})()},[n,t]);let ea=()=>{en({name:"",endpoint:"",agentType:"",description:""}),X(!0)},ei=async()=>{if(!et.name||!et.endpoint)return void M({open:!0,title:"Validation Error",description:"Name and API Endpoint are required."});if(R)return void M({open:!0,title:"Please Wait",description:"User profile is still loading. Please wait a moment."});if(Z||!(null==G?void 0:G.organization))return void M({open:!0,title:"Organization Error",description:"Cannot create agent: Organization ID not found. ".concat(Z||"Organization ID missing from profile.")});K(!0);let e={name:et.name,endpoint:et.endpoint,...et.agentType&&{agentType:et.agentType},...et.description&&{description:et.description}};try{await r.in.agentCreate({agentRequest:e}),z.info({name:e.name},"Agent created successfully"),await es(),X(!1)}catch(t){z.error({err:t},"Error creating agent");let e=t.message||"Failed to create agent. Please try again.";if(t.response){let n=t.response.status,s="Could not read error body";try{s=await t.response.text()}catch(e){}z.error({status:n,responseBody:s},"Create API Error"),e="Create API Error (".concat(n,"): ").concat(s||e)}M({open:!0,title:"Error Creating Agent",description:e})}finally{K(!1)}},er=async()=>{if(!(null==Y?void 0:Y.id))return void M({open:!0,title:"Invalid Agent",description:"No agent selected for editing or ID is missing."});if(!et.name||!et.endpoint)return void M({open:!0,title:"Validation Error",description:"Name and API Endpoint are required."});K(!0);let e={name:et.name,endpoint:et.endpoint,...et.agentType&&{agentType:et.agentType},...void 0!==et.description&&{description:et.description}};try{await r.in.agentUpdate({id:Y.id,agentRequest:e}),z.info({agentId:Y.id},"Agent updated successfully"),await es(),Q(!1),ee(null)}catch(t){z.error({err:t},"Error updating agent");let e=t.message||"Failed to update agent. Please try again.";if(t.response){let n=t.response.status,s="Could not read error body";try{s=await t.response.text()}catch(e){}z.error({status:n,responseBody:s},"Update API Error"),e="Update API Error (".concat(n,"): ").concat(s||e)}M({open:!0,title:"Error Updating Agent",description:e})}finally{K(!1)}},el=async()=>{let e=$.agent;if(!(null==e?void 0:e.id))return;let t=e.id;q({open:!1,agent:null}),F(t);try{await r.in.agentDestroy({id:t}),z.info({agentId:t},"Agent deleted successfully"),P(e=>e.filter(e=>e.id!==t))}catch(n){z.error({err:n},"Error deleting agent");let t=n.message||'Failed to delete agent "'.concat(e.name,'". Please try again.');if(n.response){let e=n.response.status,s="Could not read error body";try{s=await n.response.text()}catch(e){}z.error({status:e,responseBody:s},"Delete API Error"),t="Delete API Error (".concat(e,"): ").concat(s||t)}M({open:!0,title:"Error Deleting Agent",description:t})}finally{F(null)}};return((0,a.useEffect)(()=>{!n&&t?es():n||t||(D(!1),P([]),L(null),F(null))},[n,t,es]),n||T&&0===l.length&&!_||R)?(0,s.jsx)(o.M,{title:"Agents",description:"Configure and monitor your AI agents for security testing.",children:(0,s.jsx)("div",{className:"px-6 space-y-3",children:[void 0,void 0,void 0].map((e,t)=>(0,s.jsxs)("div",{className:"border rounded-lg p-4 flex items-start gap-4",children:[(0,s.jsx)(u.E,{className:"h-10 w-10 rounded-md flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,s.jsx)(u.E,{className:"h-4 w-1/4"}),(0,s.jsx)(u.E,{className:"h-3 w-1/2"})]}),(0,s.jsx)(u.E,{className:"h-6 w-20 rounded-full"}),(0,s.jsx)(u.E,{className:"h-8 w-8 rounded"}),(0,s.jsx)(u.E,{className:"h-8 w-8 rounded"})]},"skeleton-".concat(t)))})}):(0,s.jsxs)(o.M,{title:"Agents",description:"Configure and monitor your AI agents for security testing.",action:t&&(0,s.jsxs)(j.$,{onClick:ea,children:[(0,s.jsx)(v.A,{className:"mr-2 h-4 w-4"})," Create Agent"]}),children:[(0,s.jsxs)("div",{className:"px-6 space-y-4",children:[!t&&!n&&(0,s.jsxs)(g.Fc,{children:[(0,s.jsx)(h.A,{className:"h-4 w-4"}),(0,s.jsx)(g.XL,{children:"Authentication Required"}),(0,s.jsx)(g.TN,{children:"Please log in to manage agents."})]}),t&&_&&(0,s.jsxs)(g.Fc,{variant:"destructive",children:[(0,s.jsx)(h.A,{className:"h-4 w-4"}),(0,s.jsx)(g.XL,{children:"Error Loading Agents"}),(0,s.jsx)(g.TN,{children:_})]}),t&&Z&&(0,s.jsxs)(g.Fc,{variant:"destructive",children:[(0,s.jsx)(h.A,{className:"h-4 w-4"}),(0,s.jsx)(g.XL,{children:"Profile Error"}),(0,s.jsxs)(g.TN,{children:[Z," — Agent creation may not be available."]})]}),t&&!T&&0===l.length&&!_&&(0,s.jsx)(d.p,{icon:m.A,title:"No agents configured",description:"Get started by creating your first AI agent for security testing.",action:(0,s.jsxs)(j.$,{onClick:ea,children:[(0,s.jsx)(v.A,{className:"mr-2 h-4 w-4"})," Create Agent"]})}),t&&l.length>0&&(0,s.jsx)(A.Bc,{children:(0,s.jsx)("div",{className:"rounded-lg border overflow-hidden",children:(0,s.jsxs)(p.XI,{children:[(0,s.jsx)(p.A0,{children:(0,s.jsxs)(p.Hj,{className:"bg-muted/50 hover:bg-muted/50",children:[(0,s.jsx)(p.nd,{className:"w-[30%] pl-4",children:"Agent"}),(0,s.jsx)(p.nd,{className:"w-[30%]",children:"Endpoint"}),(0,s.jsx)(p.nd,{className:"w-[15%]",children:"Type"}),(0,s.jsx)(p.nd,{className:"w-[12%]",children:"Created"}),(0,s.jsx)(p.nd,{className:"w-[13%] text-right pr-4",children:"Actions"})]})}),(0,s.jsx)(p.BF,{children:l.map(e=>{var t,n,a,i;return(0,s.jsxs)(p.Hj,{className:"group",children:[(0,s.jsx)(p.nA,{className:"pl-4",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-0.5 h-8 w-8 rounded-md bg-muted flex items-center justify-center flex-shrink-0",children:(0,s.jsx)(m.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"font-medium text-sm leading-tight",children:e.name}),e.description&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:e.description}),(null==(t=e.organizationDetail)?void 0:t.name)&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-0.5",children:e.organizationDetail.name})]})]})}),(0,s.jsx)(p.nA,{children:(0,s.jsxs)(A.m_,{children:[(0,s.jsx)(A.k$,{asChild:!0,children:(0,s.jsx)("span",{className:"text-sm text-muted-foreground font-mono truncate block max-w-[260px] cursor-default",children:e.endpoint})}),(0,s.jsx)(A.ZI,{side:"bottom",className:"max-w-sm break-all",children:e.endpoint})]})}),(0,s.jsx)(p.nA,{children:e.agentType?(0,s.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ".concat(null!=(a=I[e.agentType])?a:I.UNKNOWN),children:null!=(i=null==(n=k.find(t=>t.value===e.agentType))?void 0:n.label)?i:e.agentType}):(0,s.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"—"})}),(0,s.jsx)(p.nA,{children:(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:e.createdAt?new Date(e.createdAt).toLocaleDateString():"—"})}),(0,s.jsx)(p.nA,{className:"text-right pr-4",children:(0,s.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,s.jsxs)(A.m_,{children:[(0,s.jsx)(A.k$,{asChild:!0,children:(0,s.jsx)(j.$,{variant:"ghost",size:"icon",onClick:()=>(e=>{if(!e.id)return void M({open:!0,title:"Invalid Agent",description:"Cannot edit agent: ID is missing."});ee(e),en({name:e.name||"",endpoint:e.endpoint||"",agentType:e.agentType||"",description:e.description||""}),Q(!0)})(e),disabled:!!O,className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,s.jsx)(y.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(A.ZI,{children:"Edit agent"})]}),(0,s.jsxs)(A.m_,{children:[(0,s.jsx)(A.k$,{asChild:!0,children:(0,s.jsx)(j.$,{variant:"ghost",size:"icon",onClick:()=>(e=>{if(!e.id)return void M({open:!0,title:"Invalid Agent",description:"Cannot delete agent: ID missing or invalid."});q({open:!0,agent:e})})(e),disabled:!!O,className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity ".concat(O===e.id?"text-destructive opacity-100":"hover:text-destructive"),children:O===e.id?(0,s.jsx)(f.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(b.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(A.ZI,{children:"Delete agent"})]})]})})]},e.id)})})]})})})]}),(0,s.jsx)(N.lG,{open:W,onOpenChange:X,children:(0,s.jsxs)(N.Cf,{className:"sm:max-w-[480px]",children:[(0,s.jsxs)(N.c7,{children:[(0,s.jsx)(N.L3,{children:"Create New Agent"}),(0,s.jsx)(N.rr,{children:"Configure a new AI agent for security testing. Provide the endpoint and details below."})]}),(0,s.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsxs)(E.J,{htmlFor:"create-name",children:["Name ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(C.p,{id:"create-name",value:et.name,onChange:e=>en(t=>({...t,name:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&ei()},placeholder:"My Awesome Agent"})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsxs)(E.J,{htmlFor:"create-endpoint",children:["API Endpoint ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(C.p,{id:"create-endpoint",value:et.endpoint,onChange:e=>en(t=>({...t,endpoint:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&ei()},placeholder:"https://your-agent-api.com/invoke",className:"font-mono text-sm"})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsx)(E.J,{htmlFor:"create-type",children:"Agent Type"}),(0,s.jsxs)(w.l6,{value:et.agentType,onValueChange:e=>en(t=>({...t,agentType:e})),children:[(0,s.jsx)(w.bq,{id:"create-type",children:(0,s.jsx)(w.yv,{placeholder:"Select agent type..."})}),(0,s.jsx)(w.gC,{children:k.map(e=>(0,s.jsx)(w.eb,{value:e.value,children:e.label},e.value))})]})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsx)(E.J,{htmlFor:"create-description",children:"Description"}),(0,s.jsx)("textarea",{id:"create-description",value:et.description,onChange:e=>en(t=>({...t,description:e.target.value})),placeholder:"A brief description of what this agent does...",rows:3,className:"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none"})]})]}),(0,s.jsxs)(N.Es,{children:[(0,s.jsx)(N.HM,{asChild:!0,children:(0,s.jsx)(j.$,{variant:"outline",disabled:S,children:"Cancel"})}),(0,s.jsxs)(j.$,{onClick:ei,disabled:S,children:[S&&(0,s.jsx)(f.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Create Agent"]})]})]})}),(0,s.jsx)(N.lG,{open:B,onOpenChange:e=>{Q(e),e||ee(null)},children:(0,s.jsxs)(N.Cf,{className:"sm:max-w-[480px]",children:[(0,s.jsxs)(N.c7,{children:[(0,s.jsx)(N.L3,{children:"Edit Agent"}),(0,s.jsxs)(N.rr,{children:["Update the details for ",(0,s.jsx)("strong",{children:null==Y?void 0:Y.name}),"."]})]}),(0,s.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsxs)(E.J,{htmlFor:"edit-name",children:["Name ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(C.p,{id:"edit-name",value:et.name,onChange:e=>en(t=>({...t,name:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&er()},placeholder:"My Awesome Agent"})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsxs)(E.J,{htmlFor:"edit-endpoint",children:["API Endpoint ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(C.p,{id:"edit-endpoint",value:et.endpoint,onChange:e=>en(t=>({...t,endpoint:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&er()},placeholder:"https://your-agent-api.com/invoke",className:"font-mono text-sm"})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsx)(E.J,{htmlFor:"edit-type",children:"Agent Type"}),(0,s.jsxs)(w.l6,{value:et.agentType,onValueChange:e=>en(t=>({...t,agentType:e})),children:[(0,s.jsx)(w.bq,{id:"edit-type",children:(0,s.jsx)(w.yv,{placeholder:"Select agent type..."})}),(0,s.jsx)(w.gC,{children:k.map(e=>(0,s.jsx)(w.eb,{value:e.value,children:e.label},e.value))})]})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsx)(E.J,{htmlFor:"edit-description",children:"Description"}),(0,s.jsx)("textarea",{id:"edit-description",value:et.description,onChange:e=>en(t=>({...t,description:e.target.value})),placeholder:"A brief description of what this agent does...",rows:3,className:"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none"})]})]}),(0,s.jsxs)(N.Es,{children:[(0,s.jsx)(N.HM,{asChild:!0,children:(0,s.jsx)(j.$,{variant:"outline",disabled:S,onClick:()=>ee(null),children:"Cancel"})}),(0,s.jsxs)(j.$,{onClick:er,disabled:S,children:[S&&(0,s.jsx)(f.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Changes"]})]})]})}),(0,s.jsx)(x.Lt,{open:U.open,onOpenChange:e=>M(t=>({...t,open:e})),children:(0,s.jsxs)(x.EO,{children:[(0,s.jsxs)(x.wd,{children:[(0,s.jsx)(x.r7,{children:U.title}),(0,s.jsx)(x.$v,{children:U.description})]}),(0,s.jsx)(x.ck,{children:(0,s.jsx)(x.Rx,{onClick:()=>M(e=>({...e,open:!1})),children:"OK"})})]})}),(0,s.jsx)(c.T,{open:$.open,onOpenChange:e=>q(t=>({...t,open:e})),title:"Delete Agent",description:'Are you sure you want to delete "'.concat(null==(e=$.agent)?void 0:e.name,'"? This action cannot be undone.'),onConfirm:el,confirmText:"Delete",variant:"destructive"})]})}},34212:(e,t,n)=>{"use strict";function s(e,[t,n]){return Math.min(n,Math.max(t,e))}n.d(t,{q:()=>s})},46767:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>r,ZI:()=>d,k$:()=>o,m_:()=>l});var s=n(95155);n(12115);var a=n(53583),i=n(64269);function r(e){let{delayDuration:t=0,...n}=e;return(0,s.jsx)(a.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...n})}function l(e){let{...t}=e;return(0,s.jsx)(r,{children:(0,s.jsx)(a.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,s.jsx)(a.l9,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:n=0,children:r,...l}=e;return(0,s.jsx)(a.ZL,{children:(0,s.jsxs)(a.UC,{"data-slot":"tooltip-content",sideOffset:n,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:[r,(0,s.jsx)(a.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},50952:(e,t,n)=>{Promise.resolve().then(n.bind(n,17254))}},e=>{e.O(0,[187,539,292,355,594,924,905,441,493,358],()=>e(e.s=50952)),_N_E=e.O()}]);
|
|
@@ -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:()=>x,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 x(){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:()=>{},27180:(e,t,a)=>{"use strict";a.d(t,{Authorization:()=>C});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)(),[x,g]=(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),g(!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||g(!0)}};return n(),e=setInterval(()=>void n(),6e5),()=>{t=!0,e&&clearInterval(e)}},[c,u,v]);let j=(0,s.useCallback)(async()=>{await h({appState:{returnTo:"/"}})},[h]),y=(0,s.useCallback)(async()=>{(0,o.ki)(null),await m({logoutParams:{returnTo:window.location.origin}})},[m]),k=(0,s.useMemo)(()=>({provider:"auth0",user:f,isAuthenticated:c,isLoading:u||c&&!x,login:j,logout:y,getAccessTokenSilently:v}),[f,c,u,x,j,y,v]);return(0,n.jsx)(l.c.Provider,{value:k,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."]})})}let f=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:{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>'},isAuthenticated:!0,isLoading:!a,login:void 0,logout:void 0,getAccessTokenSilently:f}),[a]);return(0,n.jsx)(l.c.Provider,{value:i,children:t})}var g=a(5313);let p=(0,c.h)("KeycloakAdapter"),v=async()=>"",j={provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:v};function y(e){let{config:t,children:r}=e,[i,c]=(0,s.useState)(j);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=i>=0?"".concat(n.origin).concat(n.pathname.slice(0,i)):n.origin,l=i>=0?n.pathname.slice(i+r.length).split("/")[0]:n.pathname.split("/").filter(Boolean).at(-1)||"hackagent",d=new g.A({url:s,realm:l,clientId:t.keycloakClientId}),u=!1,h=async()=>{await d.updateToken(60);let e=d.token||"";return(0,o.ki)(e||null),e};return(async()=>{try{var t,n,r,i,s;let l=await d.init({onLoad:"login-required",silentCheckSsoRedirectUri:"".concat(window.location.origin,"/silent-check-sso.html"),pkceMethod:"S256"});if(u)return;if(!l){(0,o.ki)(null),c({provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!1,login:async()=>{await d.login()},logout:void 0,getAccessTokenSilently:v});return}let m={sub:d.subject,email:null==(t=d.tokenParsed)?void 0:t.email,name:null==(n=d.tokenParsed)?void 0:n.name,given_name:null==(r=d.tokenParsed)?void 0:r.given_name,family_name:null==(i=d.tokenParsed)?void 0:i.family_name,preferred_username:null==(s=d.tokenParsed)?void 0:s.preferred_username};await h();let{userApi:f}=await Promise.resolve().then(a.bind(a,7831));f.userMeRetrieve().catch(()=>p.debug("User profile synchronization deferred")),c({provider:"keycloak",user:m,isAuthenticated:!0,isLoading:!1,login:async()=>{await d.login()},logout:async()=>{(0,o.ki)(null),await d.logout({redirectUri:window.location.origin})},getAccessTokenSilently:h}),e=setInterval(()=>{h().catch(e=>p.error({err:e},"Unable to refresh Keycloak access token"))},3e4)}catch(e){p.error({err:e},"Keycloak initialization failed"),(0,o.ki)(null),u||c({...j,isLoading:!1})}})(),()=>{u=!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."})})}function k(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 b=a(95704);let w=(0,c.h)("useRuntimeConfig"),N=k({authProvider:b.env.NEXT_PUBLIC_AUTH_PROVIDER,auth0Domain:b.env.NEXT_PUBLIC_AUTH0_DOMAIN,auth0ClientId:b.env.NEXT_PUBLIC_AUTH0_CLIENT_ID,auth0Audience:b.env.NEXT_PUBLIC_AUTH0_AUDIENCE,auth0RedirectUri:b.env.NEXT_PUBLIC_AUTH0_REDIRECT_URI,keycloakRealmUrl:b.env.NEXT_PUBLIC_KEYCLOAK_REALM_URL||"",keycloakClientId:b.env.NEXT_PUBLIC_KEYCLOAK_CLIENT_ID||"",apiUrl:b.env.NEXT_PUBLIC_API_URL||"",disableAuth:!0});function C(e){let{children:t}=e,{config:a,isLoading:r}=function(){let[e,t]=(0,s.useState)(N),[a,n]=(0,s.useState)(!0);return(0,s.useEffect)(()=>{(async()=>{try{let e=await fetch("/config.json");if(!e.ok)throw Error("Failed to load config: ".concat(e.status));let a=k(await e.json());w.info("Runtime config loaded successfully"),t(a)}catch(e){w.warn("Failed to load runtime config, using build-time defaults"),t(N)}finally{n(!1)}})()},[]),{config:e,isLoading:a}}();if(r)return null;switch(a.authProvider){case"auth0":return(0,n.jsx)(h,{config:a,children:t});case"keycloak":return(0,n.jsx)(y,{config:a,children:t});case"disabled":return(0,n.jsx)(x,{children:t})}}},34105:(e,t,a)=>{"use strict";a.d(t,{c:()=>n});let n=(0,a(12115).createContext)(void 0)},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]"})]})})}},51834:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>u,Es:()=>m,HM:()=>c,L3:()=>f,c7:()=>h,lG:()=>l,rr:()=>x});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 x(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})}},63479:(e,t,a)=>{"use strict";a.d(t,{D:()=>s,N:()=>c});var n=a(95155),r=a(12115);let i=(0,r.createContext)({theme:"system",resolvedTheme:"light",setTheme:()=>{}});function s(){return(0,r.useContext)(i)}let l="hackagent-theme";function o(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function c(e){let{children:t}=e,[a,s]=(0,r.useState)("system"),[c,d]=(0,r.useState)("light"),u=e=>{let t=document.documentElement;"dark"===e?t.classList.add("dark"):t.classList.remove("dark")};return(0,r.useEffect)(()=>{var e;let t=null!=(e=localStorage.getItem(l))?e:"system";s(t);let a="system"===t?o():t;d(a),u(a)},[]),(0,r.useEffect)(()=>{let e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{if("system"===a){let e=o();d(e),u(e)}};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[a]),(0,n.jsx)(i.Provider,{value:{theme:a,resolvedTheme:c,setTheme:e=>{localStorage.setItem(l,e),s(e);let t="system"===e?o():e;d(t),u(t)}},children:t})}},75377:(e,t,a)=>{Promise.resolve().then(a.bind(a,27180)),Promise.resolve().then(a.bind(a,96280)),Promise.resolve().then(a.t.bind(a,93836,23))},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:()=>{},96280:(e,t,a)=>{"use strict";a.d(t,{default:()=>K});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 x(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 g(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);let j=(0,r.createContext)(void 0),y=e=>{let{children:t}=e,[a,i]=(0,r.useState)(!1);return(0,n.jsx)(j.Provider,{value:{isCollapsed:a,toggleSidebar:()=>{i(e=>!e)}},children:t})},k=()=>{let e=(0,r.useContext)(j);if(!e)throw Error("useSidebar must be used within a SidebarProvider");return e};var b=a(65993),w=a(78192),N=a(37397),C=a(46826),A=a(80534),_=a(89715),I=a(5370),U=a(47937);let L=[{items:[{href:"/",label:"Home",icon:b.A}]},{title:"Test",items:[{href:"/agents",label:"Agents",icon:w.A},{href:"/attacks",label:"Attacks",icon:N.A},{href:"/attacks/builder",label:"New attack",icon:C.A}]},{title:"Results",items:[{href:"/stats",label:"Runs",icon:A.A},{href:"/reports",label:"Reports",icon:_.A}]},{title:"Resources",items:[{href:"/api-keys",label:"API Keys",icon:I.A},{href:"https://docs.hackagent.dev",label:"Docs",icon:U.A,external:!0}]}];var E=a(77931),P=a(26550),R=a(12108),T=a(15870),z=a(84926);let S=()=>{let{user:e,isLoading:t,isAuthenticated:a,logout:i}=(0,l.h)(),h=(0,o.usePathname)(),{isCollapsed:j,toggleSidebar:y}=k();if(t||!a||!e)return null;let b=e.name||e.preferred_username||e.email||"User",w=(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()})(b),N=function(e,t){let a=e.split(/[?#]/)[0].replace(/(.)\/+$/,"$1");return t.filter(e=>"/"===e?"/"===a:a===e||a.startsWith("".concat(e,"/"))).sort((e,t)=>t.length-e.length)[0]}(h,L.flatMap(e=>e.items.filter(e=>!e.external).map(e=>e.href))),C=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-current":i?"page":void 0,children:(0,n.jsxs)(d.$,{variant:i?"secondary":"ghost",className:(0,m.cn)("w-full",j?"justify-center px-2":"justify-start",i&&"font-semibold"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!j&&"mr-2")}),!j&&r]})})}),j&&(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:r})})]})},A=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,target:"_blank",rel:"noopener noreferrer",className:"block",children:(0,n.jsxs)(d.$,{variant:"ghost",className:(0,m.cn)("w-full cursor-pointer",j?"justify-center px-2":"justify-start"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!j&&"mr-2")}),!j&&r]})})}),j&&(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-background p-4 fixed left-0 top-0 transition-all duration-300",j?"w-16":"w-52"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("mb-6 flex",j?"flex-col items-center gap-2 px-0":"flex-row items-center justify-between px-2"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(c.default,{src:"/raccoon.png",alt:"HackAgent Logo",width:24,height:24,className:"text-primary"}),!j&&(0,n.jsx)("h3",{className:"font-semibold text-lg",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:y,"aria-label":j?"Expand sidebar":"Collapse sidebar",className:"h-7 w-7 shrink-0",children:j?(0,n.jsx)(E.A,{className:"h-4 w-4"}):(0,n.jsx)(P.A,{className:"h-4 w-4"})})}),(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:j?"Expand sidebar":"Collapse sidebar"})})]})]}),(0,n.jsx)("nav",{className:(0,m.cn)("flex-1 space-y-4",j?"px-0":"px-2"),children:L.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&&!j&&(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)(A,{href:e.href,icon:e.icon,label:e.label},e.href):(0,n.jsx)(C,{href:e.href,icon:e.icon,label:e.label,isActive:e.href===N},e.href))]})]},null!=(a=e.title)?a:t)})}),(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",className:(0,m.cn)("w-full p-2 h-auto hover:bg-accent hover:text-accent-foreground",j?"justify-center":"justify-between"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("flex items-center",j?"justify-center":"gap-3"),children:[(0,n.jsxs)(f,{className:"h-8 w-8",children:[e.picture&&(0,n.jsx)(x,{src:e.picture,alt:b}),(0,n.jsx)(g,{children:w})]}),!j&&(0,n.jsxs)("div",{className:"text-sm text-left",children:[(0,n.jsx)("p",{className:"font-medium leading-none truncate max-w-[105px]",children:b}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Account"})]})]}),!j&&(0,n.jsx)(R.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)(T.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 D=a(35299),B=a(63479),H=a(24323);let M=(0,a(41444).h)("ClientLayout"),$=e=>{let{children:t}=e,{isCollapsed:a}=k();return(0,n.jsx)("main",{className:"flex-1 overflow-y-auto transition-all duration-300 ".concat(a?"ml-16":"ml-52"),children:t})},K=e=>{let{children:t}=e,{isAuthenticated:a,isLoading:i,user:s,provider:o}=(0,l.h)();return((0,r.useEffect)(()=>{M.info("ClientLayout initialized - provider=".concat(o,", isLoading=").concat(i,", isAuthenticated=").concat(a))},[o,i,a]),i)?(M.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)(D.A,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,n.jsx)("p",{className:"text-muted-foreground",children:"Loading Authentication..."})]})})):a?(M.info("User authenticated - provider=".concat(o,", userId=").concat(null==s?void 0:s.sub,", email=").concat(null==s?void 0:s.email)),(0,n.jsx)(B.N,{children:(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"flex h-screen overflow-hidden print-layout-root",children:[(0,n.jsx)(S,{}),(0,n.jsx)($,{children:t})]}),(0,n.jsx)(H.P,{})]})})):(M.info("User not authenticated, rendering public view"),(0,n.jsx)(n.Fragment,{children:t}))}}},e=>{e.O(0,[475,330,187,539,292,619,8,9,391,921,130,924,441,493,358],()=>e(e.s=75377)),_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:()=>x,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 x(){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:()=>{},27180:(e,t,a)=>{"use strict";a.d(t,{Authorization:()=>C});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)(),[x,g]=(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),g(!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||g(!0)}};return n(),e=setInterval(()=>void n(),6e5),()=>{t=!0,e&&clearInterval(e)}},[c,u,v]);let j=(0,s.useCallback)(async()=>{await h({appState:{returnTo:"/"}})},[h]),y=(0,s.useCallback)(async()=>{(0,o.ki)(null),await m({logoutParams:{returnTo:window.location.origin}})},[m]),k=(0,s.useMemo)(()=>({provider:"auth0",user:f,isAuthenticated:c,isLoading:u||c&&!x,login:j,logout:y,getAccessTokenSilently:v}),[f,c,u,x,j,y,v]);return(0,n.jsx)(l.c.Provider,{value:k,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."]})})}let f=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:{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>'},isAuthenticated:!0,isLoading:!a,login:void 0,logout:void 0,getAccessTokenSilently:f}),[a]);return(0,n.jsx)(l.c.Provider,{value:i,children:t})}var g=a(5313);let p=(0,c.h)("KeycloakAdapter"),v=async()=>"",j={provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:v};function y(e){let{config:t,children:r}=e,[i,c]=(0,s.useState)(j);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=i>=0?"".concat(n.origin).concat(n.pathname.slice(0,i)):n.origin,l=i>=0?n.pathname.slice(i+r.length).split("/")[0]:n.pathname.split("/").filter(Boolean).at(-1)||"hackagent",d=new g.A({url:s,realm:l,clientId:t.keycloakClientId}),u=!1,h=async()=>{await d.updateToken(60);let e=d.token||"";return(0,o.ki)(e||null),e};return(async()=>{try{var t,n,r,i,s;let l=await d.init({onLoad:"login-required",silentCheckSsoRedirectUri:"".concat(window.location.origin,"/silent-check-sso.html"),pkceMethod:"S256"});if(u)return;if(!l){(0,o.ki)(null),c({provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!1,login:async()=>{await d.login()},logout:void 0,getAccessTokenSilently:v});return}let m={sub:d.subject,email:null==(t=d.tokenParsed)?void 0:t.email,name:null==(n=d.tokenParsed)?void 0:n.name,given_name:null==(r=d.tokenParsed)?void 0:r.given_name,family_name:null==(i=d.tokenParsed)?void 0:i.family_name,preferred_username:null==(s=d.tokenParsed)?void 0:s.preferred_username};await h();let{userApi:f}=await Promise.resolve().then(a.bind(a,7831));f.userMeRetrieve().catch(()=>p.debug("User profile synchronization deferred")),c({provider:"keycloak",user:m,isAuthenticated:!0,isLoading:!1,login:async()=>{await d.login()},logout:async()=>{(0,o.ki)(null),await d.logout({redirectUri:window.location.origin})},getAccessTokenSilently:h}),e=setInterval(()=>{h().catch(e=>p.error({err:e},"Unable to refresh Keycloak access token"))},3e4)}catch(e){p.error({err:e},"Keycloak initialization failed"),(0,o.ki)(null),u||c({...j,isLoading:!1})}})(),()=>{u=!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."})})}function k(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 b=a(95704);let w=(0,c.h)("useRuntimeConfig"),N=k({authProvider:b.env.NEXT_PUBLIC_AUTH_PROVIDER,auth0Domain:b.env.NEXT_PUBLIC_AUTH0_DOMAIN,auth0ClientId:b.env.NEXT_PUBLIC_AUTH0_CLIENT_ID,auth0Audience:b.env.NEXT_PUBLIC_AUTH0_AUDIENCE,auth0RedirectUri:b.env.NEXT_PUBLIC_AUTH0_REDIRECT_URI,keycloakRealmUrl:b.env.NEXT_PUBLIC_KEYCLOAK_REALM_URL||"",keycloakClientId:b.env.NEXT_PUBLIC_KEYCLOAK_CLIENT_ID||"",apiUrl:b.env.NEXT_PUBLIC_API_URL||"",disableAuth:!0});function C(e){let{children:t}=e,{config:a,isLoading:r}=function(){let[e,t]=(0,s.useState)(N),[a,n]=(0,s.useState)(!0);return(0,s.useEffect)(()=>{(async()=>{try{let e=await fetch("/config.json");if(!e.ok)throw Error("Failed to load config: ".concat(e.status));let a=k(await e.json());w.info("Runtime config loaded successfully"),t(a)}catch(e){w.warn("Failed to load runtime config, using build-time defaults"),t(N)}finally{n(!1)}})()},[]),{config:e,isLoading:a}}();if(r)return null;switch(a.authProvider){case"auth0":return(0,n.jsx)(h,{config:a,children:t});case"keycloak":return(0,n.jsx)(y,{config:a,children:t});case"disabled":return(0,n.jsx)(x,{children:t})}}},34105:(e,t,a)=>{"use strict";a.d(t,{c:()=>n});let n=(0,a(12115).createContext)(void 0)},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]"})]})})}},51834:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>u,Es:()=>m,HM:()=>c,L3:()=>f,c7:()=>h,lG:()=>l,rr:()=>x});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 x(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})}},63479:(e,t,a)=>{"use strict";a.d(t,{D:()=>s,N:()=>c});var n=a(95155),r=a(12115);let i=(0,r.createContext)({theme:"system",resolvedTheme:"light",setTheme:()=>{}});function s(){return(0,r.useContext)(i)}let l="hackagent-theme";function o(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function c(e){let{children:t}=e,[a,s]=(0,r.useState)("system"),[c,d]=(0,r.useState)("light"),u=e=>{let t=document.documentElement;"dark"===e?t.classList.add("dark"):t.classList.remove("dark")};return(0,r.useEffect)(()=>{var e;let t=null!=(e=localStorage.getItem(l))?e:"system";s(t);let a="system"===t?o():t;d(a),u(a)},[]),(0,r.useEffect)(()=>{let e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{if("system"===a){let e=o();d(e),u(e)}};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[a]),(0,n.jsx)(i.Provider,{value:{theme:a,resolvedTheme:c,setTheme:e=>{localStorage.setItem(l,e),s(e);let t="system"===e?o():e;d(t),u(t)}},children:t})}},75377:(e,t,a)=>{Promise.resolve().then(a.bind(a,27180)),Promise.resolve().then(a.bind(a,96280)),Promise.resolve().then(a.t.bind(a,93836,23))},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:()=>{},96280:(e,t,a)=>{"use strict";a.d(t,{default:()=>K});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 x(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 g(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);let j=(0,r.createContext)(void 0),y=e=>{let{children:t}=e,[a,i]=(0,r.useState)(!1);return(0,n.jsx)(j.Provider,{value:{isCollapsed:a,toggleSidebar:()=>{i(e=>!e)}},children:t})},k=()=>{let e=(0,r.useContext)(j);if(!e)throw Error("useSidebar must be used within a SidebarProvider");return e};var b=a(65993),w=a(78192),N=a(37397),C=a(46826),A=a(80534),_=a(89715),I=a(5370),U=a(47937);let L=[{items:[{href:"/",label:"Home",icon:b.A}]},{title:"Test",items:[{href:"/agents",label:"Agents",icon:w.A},{href:"/attacks",label:"Attacks",icon:N.A},{href:"/attacks/builder",label:"New attack",icon:C.A}]},{title:"Results",items:[{href:"/stats",label:"Runs",icon:A.A},{href:"/reports",label:"Reports",icon:_.A}]},{title:"Resources",items:[{href:"/api-keys",label:"API Keys",icon:I.A},{href:"https://docs.hackagent.dev",label:"Docs",icon:U.A,external:!0}]}];var E=a(77931),P=a(26550),R=a(12108),T=a(15870),z=a(84926);let S=()=>{let{user:e,isLoading:t,isAuthenticated:a,logout:i}=(0,l.h)(),h=(0,o.usePathname)(),{isCollapsed:j,toggleSidebar:y}=k();if(t||!a||!e)return null;let b=e.name||e.preferred_username||e.email||"User",w=(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()})(b),N=function(e,t){let a=e.split(/[?#]/)[0].replace(/(.)\/+$/,"$1");return t.filter(e=>"/"===e?"/"===a:a===e||a.startsWith("".concat(e,"/"))).sort((e,t)=>t.length-e.length)[0]}(h,L.flatMap(e=>e.items.filter(e=>!e.external).map(e=>e.href))),C=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-current":i?"page":void 0,children:(0,n.jsxs)(d.$,{variant:i?"secondary":"ghost",className:(0,m.cn)("w-full",j?"justify-center px-2":"justify-start",i&&"font-semibold"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!j&&"mr-2")}),!j&&r]})})}),j&&(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:r})})]})},A=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,target:"_blank",rel:"noopener noreferrer",className:"block",children:(0,n.jsxs)(d.$,{variant:"ghost",className:(0,m.cn)("w-full cursor-pointer",j?"justify-center px-2":"justify-start"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!j&&"mr-2")}),!j&&r]})})}),j&&(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-background p-4 fixed left-0 top-0 transition-all duration-300",j?"w-16":"w-52"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("mb-6 flex",j?"flex-col items-center gap-2 px-0":"flex-row items-center justify-between px-2"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(c.default,{src:"/raccoon.png",alt:"HackAgent Logo",width:24,height:24,className:"text-primary"}),!j&&(0,n.jsx)("h3",{className:"font-semibold text-lg",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:y,"aria-label":j?"Expand sidebar":"Collapse sidebar",className:"h-7 w-7 shrink-0",children:j?(0,n.jsx)(E.A,{className:"h-4 w-4"}):(0,n.jsx)(P.A,{className:"h-4 w-4"})})}),(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:j?"Expand sidebar":"Collapse sidebar"})})]})]}),(0,n.jsx)("nav",{className:(0,m.cn)("flex-1 space-y-4",j?"px-0":"px-2"),children:L.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&&!j&&(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)(A,{href:e.href,icon:e.icon,label:e.label},e.href):(0,n.jsx)(C,{href:e.href,icon:e.icon,label:e.label,isActive:e.href===N},e.href))]})]},null!=(a=e.title)?a:t)})}),(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",className:(0,m.cn)("w-full p-2 h-auto hover:bg-accent hover:text-accent-foreground",j?"justify-center":"justify-between"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("flex items-center",j?"justify-center":"gap-3"),children:[(0,n.jsxs)(f,{className:"h-8 w-8",children:[e.picture&&(0,n.jsx)(x,{src:e.picture,alt:b}),(0,n.jsx)(g,{children:w})]}),!j&&(0,n.jsxs)("div",{className:"text-sm text-left",children:[(0,n.jsx)("p",{className:"font-medium leading-none truncate max-w-[105px]",children:b}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Account"})]})]}),!j&&(0,n.jsx)(R.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)(T.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 D=a(35299),B=a(63479),H=a(24323);let M=(0,a(41444).h)("ClientLayout"),$=e=>{let{children:t}=e,{isCollapsed:a}=k();return(0,n.jsx)("main",{className:"flex-1 overflow-y-auto transition-all duration-300 ".concat(a?"ml-16":"ml-52"),children:t})},K=e=>{let{children:t}=e,{isAuthenticated:a,isLoading:i,user:s,provider:o}=(0,l.h)();return((0,r.useEffect)(()=>{M.info("ClientLayout initialized - provider=".concat(o,", isLoading=").concat(i,", isAuthenticated=").concat(a))},[o,i,a]),i)?(M.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)(D.A,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,n.jsx)("p",{className:"text-muted-foreground",children:"Loading Authentication..."})]})})):a?(M.info("User authenticated - provider=".concat(o,", userId=").concat(null==s?void 0:s.sub,", email=").concat(null==s?void 0:s.email)),(0,n.jsx)(B.N,{children:(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"flex h-screen overflow-hidden print-layout-root",children:[(0,n.jsx)(S,{}),(0,n.jsx)($,{children:t})]}),(0,n.jsx)(H.P,{})]})})):(M.info("User not authenticated, rendering public view"),(0,n.jsx)(n.Fragment,{children:t}))}}},e=>{e.O(0,[475,330,187,539,292,355,619,928,921,130,924,441,493,358],()=>e(e.s=75377)),_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})}},17037:(e,t,a)=>{"use strict";a.d(t,{$:()=>i,F:()=>l});var s=a(95155);a(12115);var n=a(47397),r=a(64269);function l(e){let{className:t,children:a,...l}=e;return(0,s.jsxs)(n.bL,{"data-slot":"scroll-area",className:(0,r.cn)("relative",t),...l,children:[(0,s.jsx)(n.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)(i,{}),(0,s.jsx)(n.OK,{})]})}function i(e){let{className:t,orientation:a="vertical",...l}=e;return(0,s.jsx)(n.VM,{"data-slot":"scroll-area-scrollbar",orientation:a,className:(0,r.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),...l,children:(0,s.jsx)(n.lr,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}},18299:(e,t,a)=>{"use strict";a.d(t,{t:()=>l});var s=a(95155);a(12115);var n=a(46767),r=a(36947);function l(e){let{children:t}=e;return(0,s.jsxs)(n.m_,{children:[(0,s.jsx)(n.k$,{asChild:!0,children:t}),(0,s.jsx)(n.ZI,{className:"max-w-xs",children:r.CZ})]})}},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"}=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 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 px-6 pb-5 border-b",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]})}},29147:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>Y});var s=a(95155),n=a(80230),r=a(12115),l=a(3998),i=a(86948),c=a(11647),o=a(13406),d=a(20243),m=a(17037),u=a(22470),x=a(52619),h=a.n(x),g=a(10281),f=a(56373),p=a(69386),j=a(26265),v=a(96324),N=a(68425),b=a(47734),k=a(73697),y=a(33420),w=a(86618),A=a(78192),E=a(52987),L=a(52056),_=a(7831),C=a(50113),S=a(63479),M=a(18299),R=a(41444),z=a(36947),D=a(87066),I=a(35795);function O(e){let{targets:t,runs:a,jailbreaks:n}=e,r=[{label:"Targets",value:t,icon:A.A,href:"/agents"},{label:"Runs",value:a,icon:D.A,href:"/stats"},{label:"Jailbreaks",value:n,icon:I.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)(h(),{href:r,className:"group",children:(0,s.jsx)(i.Zp,{className:"transition-colors group-hover:bg-muted/40",children:(0,s.jsxs)(i.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 T=a(37397),Z=a(80534);let H=[{icon:A.A,title:"Add a target agent",description:"Connect the AI agent you want to probe for vulnerabilities.",cta:"Add target",href:"/agents"},{icon:T.A,title:"Build an attack",description:"Configure jailbreak and red-team techniques to run against it.",cta:"Build attack",href:"/attacks/builder"},{icon:Z.A,title:"Review results",description:"See which attacks succeeded and read the risk reports.",cta:"View results",href:"/stats"}];function K(){return(0,s.jsxs)(i.Zp,{children:[(0,s.jsxs)(i.aR,{children:[(0,s.jsx)(i.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 report."})]}),(0,s.jsx)(i.Wu,{children:(0,s.jsx)("ol",{className:"grid gap-4 md:grid-cols-3",children:H.map((e,t)=>{let{icon:a,title:n,description:r,cta:i,href:c}=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)(l.$,{asChild:!0,variant:"outline",size:"sm",className:"mt-auto w-full",children:(0,s.jsxs)(h(),{href:c,children:[i,(0,s.jsx)(E.A,{className:"h-3.5 w-3.5"})]})})]},n)})})})]})}let P=(0,R.h)("HomeStats"),G={total:0,jailbreaks:0,mitigated:0,errors:0,pending:0};function B(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)}},{...G})}function W(){let{hideEmptyState:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{resolvedTheme:t}=(0,S.D)(),a="dark"===t,n=a?C.xk:C.Ez,l=a?"#3f3f46":"#e5e7eb",[o,m]=(0,r.useState)(!0),[u,x]=(0,r.useState)([]),[R,D]=(0,r.useState)(0),[I,T]=(0,r.useState)(0),[Z,H]=(0,r.useState)(0),[W,F]=(0,r.useState)("—"),[U,J]=(0,r.useState)(G);(0,r.useEffect)(()=>{let e=!1;return(async()=>{m(!0);try{var t,a;let s=await _.ME.runList({page:1,pageSize:100});if(e)return;let n=null!=(t=s.results)?t:[],r=B(n),l=new Set(n.map(e=>e.agent).filter(Boolean));D(null!=(a=s.count)?a:n.length),T(l.size),H(r.jailbreaks),x(n.slice(0,5));let i=n[0];if(!i){F("—"),J(G);return}F(i.agentName||"".concat(i.agent.slice(0,8),"…")),J(B(n.filter(e=>e.agent===i.agent)))}catch(t){e||P.error({err:t},"Failed to load home stats")}finally{e||m(!1)}})(),()=>{e=!0}},[]);let V=(0,r.useMemo)(()=>0===U.total?0:Math.round(100*U.jailbreaks/U.total),[U]),$=U.total>0,X=(0,z.PU)($?V:null),q=C.xv[(0,z.lN)(V)],Q=(0,r.useMemo)(()=>[{name:"Jailbreaks",value:U.jailbreaks,color:n.vulnerable},{name:"Mitigated",value:U.mitigated,color:n.safe},{name:"Errors",value:U.errors,color:n.error},{name:"Pending",value:U.pending,color:n.pending}],[U,n]);return o?(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)(d.E,{className:"h-24 w-full"},e))}),(0,s.jsx)(d.E,{className:"h-56 w-full"})]}):0===R?e?null:(0,s.jsx)(K,{}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(O,{targets:I,runs:R,jailbreaks:Z}),(0,s.jsxs)(i.Zp,{children:[(0,s.jsx)(i.aR,{className:"pb-2",children:(0,s.jsxs)(i.ZB,{className:"text-lg flex flex-wrap items-center gap-2",children:["Latest Target Statistics",(0,s.jsxs)(c.E,{variant:"secondary",className:"font-mono font-normal gap-1",children:[(0,s.jsx)(A.A,{className:"h-3 w-3"}),W]})]})}),(0,s.jsx)(i.Wu,{children:$?(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)(M.t,{children:(0,s.jsx)("div",{children:(0,s.jsxs)(g.r,{width:200,height:180,children:[(0,s.jsxs)(f.Fq,{data:[{name:"Risk",value:V,color:q},{name:"Remaining",value:100-V,color:l}],cx:100,cy:90,innerRadius:58,outerRadius:82,startAngle:90,endAngle:-270,dataKey:"value",isAnimationActive:!1,children:[(0,s.jsx)(p.f,{fill:q}),(0,s.jsx)(p.f,{fill:l})]}),(0,s.jsxs)("text",{x:100,y:84,textAnchor:"middle",fontSize:26,fontWeight:700,fill:q,children:[V,"%"]}),(0,s.jsx)("text",{x:100,y:106,textAnchor:"middle",fontSize:12,fill:q,children:X})]})})})]}),(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)(j.u,{width:"100%",height:150,children:(0,s.jsxs)(v.E,{data:Q,margin:{top:8,right:8,left:-16,bottom:0},children:[(0,s.jsx)(N.d,{vertical:!1,strokeDasharray:"3 3",stroke:a?"rgba(255,255,255,0.12)":"#e5e7eb"}),(0,s.jsx)(b.W,{dataKey:"name",tick:{fontSize:11},axisLine:!1,tickLine:!1}),(0,s.jsx)(k.h,{allowDecimals:!1,tick:{fontSize:11},axisLine:!1,tickLine:!1}),(0,s.jsx)(y.m,{wrapperStyle:{fontSize:12},cursor:{fill:"rgba(0,0,0,0.04)"}}),(0,s.jsx)(w.yP,{dataKey:"value",radius:[4,4,0,0],isAnimationActive:!1,children:Q.map(e=>(0,s.jsx)(p.f,{fill:e.color},e.name))})]})}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[U.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)(i.Zp,{children:[(0,s.jsxs)(i.aR,{className:"pb-2 flex-row items-center justify-between",children:[(0,s.jsx)(i.ZB,{className:"text-base",children:"Recent Runs"}),(0,s.jsxs)(h(),{href:"/stats",className:"text-xs text-muted-foreground hover:text-foreground flex items-center gap-1",children:["View all ",(0,s.jsx)(E.A,{className:"h-3 w-3"})]})]}),(0,s.jsx)(i.Wu,{className:"p-0",children:(0,s.jsx)("div",{className:"divide-y",children:u.map(e=>{var t,a;return(0,s.jsxs)(h(),{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",children:[e.id.slice(0,8),"…"]}),(0,s.jsx)("span",{className:"text-sm truncate",children:e.agentName||"—"}),e.attackType&&(0,s.jsx)(c.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.Ez.vulnerable},children:[(0,s.jsx)(L.A,{className:"h-3 w-3"}),e.successfulJailbreaks]}),(0,s.jsx)(c.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 F=a(17910),U=a(28150),J=a(50803),V=a(61362),$=a(75426),X=a(89715),q=a(85921);let Q={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 Y(){let{user:e,isAuthenticated:t,isLoading:a,login:x}=(0,n.h)(),[g,f]=(0,r.useState)("google_adk"),[p,j]=(0,r.useState)(null);(0,r.useEffect)(()=>{if(t||a||!x)return;let e=new URLSearchParams(window.location.search);e.has("code")&&e.has("state")||x()},[a,t,x]);let v=(e,t)=>{navigator.clipboard.writeText(e),j(t),setTimeout(()=>j(null),2e3)};if(a)return(0,s.jsx)(u.M,{title:"Welcome",children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(d.E,{className:"h-8 w-64 mx-auto"}),(0,s.jsx)(d.E,{className:"h-5 w-96 mx-auto"})]}),(0,s.jsxs)(i.Zp,{children:[(0,s.jsxs)(i.aR,{children:[(0,s.jsx)(d.E,{className:"h-6 w-48"}),(0,s.jsx)(d.E,{className:"h-4 w-72"})]}),(0,s.jsxs)(i.Wu,{className:"space-y-4",children:[(0,s.jsx)(d.E,{className:"h-10 w-full"}),(0,s.jsx)(d.E,{className:"h-32 w-full"}),(0,s.jsx)(d.E,{className:"h-32 w-full"})]})]})]})});if(!t)return null;let N=Q[g];return(0,s.jsx)(u.M,{maxWidth:"5xl",children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"text-center space-y-2",children:[(0,s.jsxs)("h1",{className:"text-3xl font-bold",children:["Welcome, ",e&&(e.name||e.preferred_username||e.nickname||e.email)||"User","!"]}),(0,s.jsx)("p",{className:"text-lg text-muted-foreground",children:"Get a security risk assessment for your AI agent in minutes"})]}),(0,s.jsx)(W,{hideEmptyState:!0}),(0,s.jsxs)(i.Zp,{className:"shadow-lg",children:[(0,s.jsxs)(i.aR,{className:"pb-4",children:[(0,s.jsxs)(i.ZB,{className:"text-xl flex items-center gap-2",children:[(0,s.jsx)(F.A,{className:"h-5 w-5 text-primary"}),"Quick Start: Run Your First Attack"]}),(0,s.jsx)(i.BT,{children:"Select your agent framework, then copy the Python snippet to get started"})]}),(0,s.jsx)(i.Wu,{className:"space-y-6",children:(0,s.jsxs)(o.tU,{value:g,onValueChange:e=>f(e),className:"w-full",children:[(0,s.jsxs)(o.j7,{className:"grid w-full grid-cols-3",children:[(0,s.jsxs)(o.Xi,{value:"google_adk",className:"gap-2",children:[(0,s.jsx)(A.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Google ADK"})]}),(0,s.jsxs)(o.Xi,{value:"openai_sdk",className:"gap-2",children:[(0,s.jsx)(U.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"OpenAI SDK"})]}),(0,s.jsxs)(o.Xi,{value:"litellm",className:"gap-2",children:[(0,s.jsx)(J.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"LiteLLM / Ollama"})]})]}),(0,s.jsxs)(o.av,{value:g,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:N.description}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(c.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)(l.$,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>v(N.installCmd,"install"),children:"install"===p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.A,{className:"h-4 w-4 text-green-500 mr-1"}),"Copied!"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)($.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:N.installCmd})})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(c.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)(l.$,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>v(N.sdkCode,"sdk"),children:"sdk"===p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.A,{className:"h-4 w-4 text-green-500 mr-1"}),"Copied!"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)($.A,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),(0,s.jsx)(m.F,{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:N.sdkCode})})})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(c.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 risk report"})]}),(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:"}),N.riskAreas.map(e=>(0,s.jsxs)(c.E,{variant:"secondary",className:"flex items-center gap-1",children:[(0,s.jsx)(L.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)(X.A,{className:"h-4 w-4"}),"Vulnerability summary"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(Z.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)(h(),{href:"/agents",children:(0,s.jsxs)(l.$,{variant:"outline",children:[(0,s.jsx)(A.A,{className:"h-4 w-4"}),"Configure Agent"]})}),(0,s.jsx)(h(),{href:"/reports",children:(0,s.jsxs)(l.$,{children:[(0,s.jsx)(q.A,{className:"h-4 w-4"}),"View Reports",(0,s.jsx)(E.A,{className:"h-4 w-4"})]})})]})]})]})]})})]})]})})}},34105:(e,t,a)=>{"use strict";a.d(t,{c:()=>s});let s=(0,a(12115).createContext)(void 0)},36947:(e,t,a)=>{"use strict";a.d(t,{CZ:()=>l,PU:()=>c,WA:()=>s,lN:()=>i});let s=["low","medium","high","critical"],n={low:10,medium:30,high:60},r={low:"Low",medium:"Medium",high:"High",critical:"Critical"},l="Risk from attack success rate (ASR): Low ≤".concat(n.low,"%, ")+"Medium ≤".concat(n.medium,"%, High ≤").concat(n.high,"%, ")+"Critical >".concat(n.high,"%.");function i(e){return e<=n.low?"low":e<=n.medium?"medium":e<=n.high?"high":"critical"}function c(e){return null==e||Number.isNaN(e)?"No data":r[i(e)]}},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]"})]})})}},50113:(e,t,a)=>{"use strict";a.d(t,{CG:()=>i,Ez:()=>s,JX:()=>l,xk:()=>n,xv:()=>r});let s={vulnerable:"#ef4444",safe:"#22c55e",error:"#f59e0b",pending:"#94a3b8"},n={vulnerable:"#f87171",safe:"#4ade80",error:"#fbbf24",pending:"#cbd5e1"},r={low:"#22c55e",medium:"#eab308",high:"#f97316",critical:"#ef4444"},l={LITELLM:"LiteLLM",OPENAI_SDK:"OpenAI SDK / API",GOOGLE_ADK:"Google ADK",OTHER:"Other / Proprietary",UNKNOWN:"Unknown"},i=new Set(["attack_type","generator"])},63479:(e,t,a)=>{"use strict";a.d(t,{D:()=>l,N:()=>o});var s=a(95155),n=a(12115);let r=(0,n.createContext)({theme:"system",resolvedTheme:"light",setTheme:()=>{}});function l(){return(0,n.useContext)(r)}let i="hackagent-theme";function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function o(e){let{children:t}=e,[a,l]=(0,n.useState)("system"),[o,d]=(0,n.useState)("light"),m=e=>{let t=document.documentElement;"dark"===e?t.classList.add("dark"):t.classList.remove("dark")};return(0,n.useEffect)(()=>{var e;let t=null!=(e=localStorage.getItem(i))?e:"system";l(t);let a="system"===t?c():t;d(a),m(a)},[]),(0,n.useEffect)(()=>{let e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{if("system"===a){let e=c();d(e),m(e)}};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[a]),(0,s.jsx)(r.Provider,{value:{theme:a,resolvedTheme:o,setTheme:e=>{localStorage.setItem(i,e),l(e);let t="system"===e?c():e;d(t),m(t)}},children:t})}},65761:(e,t,a)=>{Promise.resolve().then(a.bind(a,29147))},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:()=>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-content",className:(0,n.cn)("px-6",t),...a})}}},e=>{e.O(0,[187,355,619,144,855,532,641,874,924,441,493,358],()=>e(e.s=65761)),_N_E=e.O()}]);
|