@fleek-platform/agents-ui
Version:
The Fleek Platform Agents UI provides a simple interface for deploying, monitoring, and configuring your agents––making management straightforward
15 lines • 73.9 kB
JavaScript
var qt=Object.defineProperty;var $t=(e,t)=>{for(var r in t)qt(e,r,{get:t[r],enumerable:!0})};var pt={};$t(pt,{changeAgentStatus:()=>ur,createAgentDraft:()=>nr,createApiToken:()=>Er,createCreditsCheckout:()=>We,createSubscription:()=>qe,createSubscriptionCheckout:()=>sr,deleteAgent:()=>dr,deleteApiToken:()=>fr,deployAgent:()=>ar,generateCharacterfile:()=>Ir,getAgentAttestation:()=>cr,getAgentLogs:()=>lr,getAgentStatus:()=>pr,getAgentsByProjectId:()=>Ye,getApiTokens:()=>mr,getCredits:()=>je,getElizaAgent:()=>Ar,getElizaOsVersions:()=>_r,getPlans:()=>He,getProjects:()=>yr,getSubscriptions:()=>Fe,sendAssistantMessageStream:()=>Tr,sendMessageAgent:()=>br,updateAgentById:()=>gr,updateSubscription:()=>hr,updateSubscriptionQuantity:()=>$e});var Xt={PUBLIC_FLEEK_REST_API_HOST:"api.fleek.xyz",PUBLIC_DASHBOARD_APP_URL:"https://fleek.xyz/dashboard",PUBLIC_BEEHIIV_PROXY_SERVER_URL:"https://faas-lon1-917a94a7.doserverless.co/api/v1/web/fn-5aaf2a72-1b5b-4ac6-8c42-a2e735a32d8b/main/create-subscription",PUBLIC_AUTOFUN_CALLBACK_URL:"https://auto.fun/callback",PUBLIC_GRAPHQL_API_URL:"https://graphql.service.fleek.xyz/graphql",PUBLIC_DYNAMIC_ENVIRONMENT_ID:"de23a5f0-aaa5-412e-8212-4fb056a3b30d",PUBLIC_AGENTS_BASE_PATH:"/agents",PUBLIC_REDIRECT_URL_UNAUTHENTICATED:"https://fleek.xyz",PUBLIC_PERSONA_GENERATOR_API_URL:"https://persona-generator.flkservices.io"},M=e=>{let t=Xt[e];if(t==null)throw new Error(`Expected key "${e}" to be defined but got ${typeof t}`);if(typeof t!="string")throw new Error(`Expected key "${e}" to be string but got ${typeof t}`);return t};import Zt from"url-join";import{compile as Qt}from"path-to-regexp";import Jt from"query-string";var fe=(...e)=>Zt(...e),er=(e,t={})=>Qt(e,{encode:encodeURIComponent})(t),tr=(e,t={})=>!t||Object.keys(t).length===0?e:Jt.stringifyUrl({url:e,query:t},{skipNull:!0,skipEmptyString:!0}),he=(e,t,r)=>{let o=r?.pathParams??{},i=r?.queryParams??{};return tr(fe(e,er(t,o)),i)},Pe=e=>(t,{pathParams:r={},queryParams:o={}}={})=>{let i=typeof e=="function"?e():e;return he(i,t,{pathParams:r,queryParams:o})};var A={endpoints:{aiAgents:"/ai-agents",aiAgentUpdate:"/ai-agents/:id",aiAgentPublish:"/ai-agents/:id/publish",aiAgentLogs:"/ai-agents/:id/logs",aiAgentAttestation:"/ai-agents/:id/attestation",aiAgentStatus:"/ai-agents/:id/status",aiAgentStatusUpdate:"/ai-agents/:id/:action",aiAgentDelete:"/ai-agents/:id",aiAgentDraftCreate:"/ai-agents",projects:"/projects",teams:"/teams",subscriptions:"/subscriptions",subscriptionUpdate:"/subscriptions/:id",subscriptionCheckout:"/subscriptions/checkout",subscriptionUpdateQuantity:"/subscriptions/:id/quantity",plans:"/plans",tokens:"/tokens",tokenDelete:"/tokens/:id",aiAgentMessage:"/ai-agents/:id/api/:elizaId/message",proxyAiAgents:"/ai-agents/:id/api/agents",elizaOsVersions:"/machines/images/eliza",credits:"/credits",createCreditsCheckout:"/credits/checkout"},agentsDashboardPage:"/projects/:projectId/agents/"};var st="ai agent",lt="ai agent (standard)";var ct=e=>{let t=e.match(/^https?:\/\//i)?e:`https://${e}`,r=new URL(t);return r.protocol="https:",r.toString()};var Ge=({route:e,version:t="v1"})=>he(M("PUBLIC_PERSONA_GENERATOR_API_URL"),fe(t,e));var rr=Pe(()=>ct(M("PUBLIC_FLEEK_REST_API_HOST"))),_=(e,t,r)=>rr(fe("/api",`v${t}`,e),r);var h=e=>async(r,o)=>{try{let i=await e(r);return o?.throwOnError?i:{ok:!0,data:i}}catch(i){let n=i instanceof Error?i:new Error("Unknown error");if(o?.throwOnError)throw n;return{ok:!1,error:n}}};import{jwtDecode as or}from"jwt-decode";var ir=e=>{try{return or(e)}catch(t){console.error("Failed to decode access token",t);return}},j=(e,t)=>ir(e)?.projectId===t;var nr=h(async({projectId:e,characterfile:t,accessToken:r,name:o,avatar:i,frameworkVersion:n})=>{if(!r||!e||!t)throw new Error("Missing required parameters");if(!j(r,e))throw new Error("The access token does not match the project");let s=_(A.endpoints.aiAgentDraftCreate,2),l=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({config:t,projectId:e,name:o,avatar:i,frameworkVersion:n})});if(!l.ok){let p=await l.text();throw new Error(`HTTP Error ${l.status}: ${p}`)}return l.json()}),ar=h(async({projectId:e,characterfile:t,avatar:r,accessToken:o,draftId:i,frameworkVersion:n,tee:s=!1})=>{if(!o||!e||!i)throw new Error("Missing required parameters");if(!j(o,e))throw new Error("The access token does not match the project");let l;t&&(l=JSON.parse(t).name);let p=_(A.endpoints.aiAgentUpdate,1,{pathParams:{id:i}}),g=await fetch(p,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify({config:t,projectId:e,name:l,avatar:r,frameworkVersion:n,tee:s})});if(!g.ok){let P=await g.text();throw new Error(`HTTP Error ${g.status}: ${P}`)}let d=_(A.endpoints.aiAgentPublish,1,{pathParams:{id:i}}),f=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}});if(!f.ok){let P=await f.text();throw new Error(`HTTP Error ${f.status}: ${P}`)}return i}),Ye=h(async({projectId:e,accessToken:t})=>{if(!t||!e)throw new Error("Missing required parameters");if(!j(t,e))throw new Error("The access token does not match the project");let r=_(A.endpoints.aiAgents,1,{queryParams:{projectId:e}}),o=await fetch(r,{method:"GET",headers:{authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!o.ok){let i=await o.text();throw new Error(`HTTP Error ${o.status}: ${i}`)}return(await o.json()).data}),Fe=h(async({projectId:e,accessToken:t})=>{if(!e||!t)throw new Error("Missing required parameters");if(!j(t,e))throw new Error("The access token does not match the project");let r=_(A.endpoints.subscriptions,1,{queryParams:{projectId:e}}),o=await fetch(r,{method:"GET",headers:{"Content-Type":"application/json",authorization:`Bearer ${t}`}});if(!o.ok&&o.status===404)return[];if(!o.ok){let i=await o.text();throw new Error(`HTTP Error ${o.status}: ${i}`)}return o.json()}),sr=h(async({projectId:e,productId:t,accessToken:r,referralId:o})=>{if(!e||!r||!t)throw new Error("Missing required parameters");if(!j(r,e))throw new Error("The access token does not match the project");let i=_(A.endpoints.subscriptionCheckout,1),n=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${r}`},body:JSON.stringify({projectId:e,product:{id:t,quantity:1},metadata:{referralId:o}})});if(!n.ok){let s=await n.text();throw new Error(`HTTP Error ${n.status}: ${s}`)}return(await n.json()).url}),He=h(async({accessToken:e})=>{if(!e)throw new Error("Missing required parameters");let t=_(A.endpoints.plans,1),r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",authorization:`Bearer ${e}`}});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return r.json()}),lr=h(async({agentId:e,accessToken:t,pageCursor:r,pageSize:o=25})=>{if(!e||!t)throw new Error("Missing required parameters");let i=_(A.endpoints.aiAgentLogs,1,{pathParams:{id:e},queryParams:{cursor:r,size:o}}),n=await fetch(i,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!n.ok){let s=await n.text();throw new Error(`HTTP Error ${n.status}: ${s}`)}return n.json()}),cr=h(async({agentId:e})=>{let t=_(A.endpoints.aiAgentAttestation,1,{pathParams:{id:e}}),r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return r.bytes()}),pr=h(async({accessToken:e,agentId:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=_(A.endpoints.aiAgentStatus,1,{pathParams:{id:t}}),o=await fetch(r,{method:"GET",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let i=await o.text();throw new Error(`HTTP Error ${o.status}: ${i}`)}return(await o.json()).status}),gr=h(async({accessToken:e,agentId:t,payload:r})=>{if(!e||!t||!r)throw new Error("Missing required parameters");let o=_(A.endpoints.aiAgentUpdate,1,{pathParams:{id:t}}),i=await fetch(o,{method:"PUT",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:r});if(!i.ok){let n=await i.text();throw new Error(`HTTP Error ${i.status}: ${n}`)}return i.json()}),ur=h(async({agentId:e,accessToken:t,action:r})=>{if(!e||!t||!r)throw new Error("Missing required parameters");let o=_(A.endpoints.aiAgentStatusUpdate,1,{pathParams:{id:e,action:r}}),i=await fetch(o,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!i.ok){let n=await i.text();throw new Error(`HTTP Error ${i.status}: ${n}`)}}),dr=h(async({id:e,accessToken:t})=>{if(!t||!e)throw new Error("Missing required parameters");let r=_(A.endpoints.aiAgentDelete,1,{pathParams:{id:e}}),o=await fetch(r,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){let i=await o.text();throw new Error(`HTTP Error ${o.status}: ${i}`)}return(await o.json()).id}),mr=h(async({accessToken:e})=>{if(!e)throw new Error("Missing required parameters");let t=_(A.endpoints.tokens,1),r=await fetch(t,{method:"GET",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return r.json()}),Er=h(async({accessToken:e,payload:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=_(A.endpoints.tokens,1),o=await fetch(r,{method:"POST",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!o.ok){let i=await o.text();throw new Error(`HTTP Error ${o.status}: ${i}`)}return o.json()}),fr=h(async({accessToken:e,tokenId:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=_(A.endpoints.tokenDelete,1,{pathParams:{id:t}}),o=await fetch(r,{method:"DELETE",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let i=await o.text();throw new Error(`HTTP Error ${o.status}: ${i}`)}}),hr=h(async({projectId:e,subscriptionId:t,productId:r,accessToken:o,quantity:i})=>{if(!o||!e||!t||!r||i===void 0)throw new Error("Missing required parameters");if(!j(o,e))throw new Error("The access token does not match the project");let n=_(A.endpoints.subscriptionUpdate,1,{pathParams:{id:t}}),s=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify({projectId:e,product:{id:r,quantity:i}})});if(!s.ok){let l=await s.text();throw new Error(`HTTP Error ${s.status}: ${l}`)}return s.json()}),Ar=h(async({agentId:e,accessToken:t,timeout:r=3e4})=>{if(!e||!t)throw new Error("Missing required parameters");let o=_(A.endpoints.proxyAiAgents,1,{pathParams:{id:e}}),i=await fetch(o,{signal:AbortSignal.timeout(r),method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!i.ok){let n=await i.text();throw new Error(`HTTP Error ${i.status}: ${n}`)}return i.json()}),br=h(async({agentId:e,agentElizaId:t,accessToken:r,message:o})=>{if(!e||!r||!t||!o)throw new Error("Missing required parameters");let i=_(A.endpoints.aiAgentMessage,1,{pathParams:{id:e,elizaId:t}}),n=await fetch(i,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({text:o})});if(!n.ok){let s=await n.text();throw new Error(`HTTP Error ${n.status}: ${s}`)}return n.json()}),_r=h(async({accessToken:e})=>{if(!e)throw new Error("Missing required parameters");let t=_(A.endpoints.elizaOsVersions,1),r=await fetch(t,{method:"GET",headers:{authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return r.json()}),yr=h(async({accessToken:e})=>{if(!e)throw new Error("Missing required parameters");let r=await fetch(M("PUBLIC_GRAPHQL_API_URL"),{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify({operationName:"projects",query:`query projects($filter: ProjectsPaginationInput) {
projects(filter: $filter) {
data {
id
name
avatar
}
}
}`,variables:{}})});if(!r.ok){let o=await r.text();throw new Error(`HTTP Error ${r.status}: ${o}`)}return(await r.json()).data.projects.data}),je=h(async({accessToken:e,projectId:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=_(A.endpoints.credits,1,{queryParams:{projectId:t}}),o=await fetch(r,{method:"GET",headers:{"Content-Type":"application/json",authorization:`Bearer ${e}`}});if(!o.ok){let i=await o.text();throw new Error(`HTTP Error ${o.status}: ${i}`)}return o.json()}),We=h(async({accessToken:e,projectId:t})=>{if(!e||!t)throw new Error("Missing required parameters");let r=_(A.endpoints.createCreditsCheckout,1),o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify({projectId:t})});if(!o.ok){let i=await o.text();throw new Error(`HTTP Error ${o.status}: ${i}`)}return o.json()}),qe=h(async({projectId:e,productId:t,accessToken:r,referralId:o})=>{if(!e||!r||!t)throw new Error("Missing required parameters");if(!j(r,e))throw new Error("The access token does not match the project");let i=_(A.endpoints.subscriptions,1),n=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${r}`},body:JSON.stringify({projectId:e,product:{id:t,quantity:1},metadata:{referralId:o}})});if(!n.ok){let s=await n.text();throw new Error(`HTTP Error ${n.status}: ${s}`)}return await n.json()}),$e=h(async({subscriptionId:e,updateBy:t,projectId:r,accessToken:o})=>{if(!r||!o||!t||!e)throw new Error("Missing required parameters");if(!j(o,r))throw new Error("The access token does not match the project");let i=_(A.endpoints.subscriptionUpdateQuantity,1,{pathParams:{id:e}}),n=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${o}`},body:JSON.stringify({projectId:r,updateBy:t})});if(!n.ok){let s=await n.text();throw new Error(`HTTP Error ${n.status}: ${s}`)}return await n.json()}),Tr=h(async({content:e,messages:t,accessToken:r})=>{if(!r||!e)throw new Error("Missing required parameters");let o=Ge({route:"/assistant/stream"}),i=t.map(s=>`${s.senderRole}: ${s.content}`).join(`
`),n=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${r}`},body:JSON.stringify({content:e,messages:i})});if(!n.ok){let s=await n.text();throw new Error(`HTTP Error ${n.status}: ${s}`)}return n.body?.getReader()}),Ir=h(async({messages:e,accessToken:t,version:r="v1"})=>{if(!t||!e)throw new Error("Missing required parameters");let o=Ge({route:"/generate",version:r}),i=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",authorization:`Bearer ${t}`},body:JSON.stringify({content:JSON.stringify(e)})}),n=await i.json();if(n.status==="error"){let s=n.error;throw new Error(`HTTP Error ${i.status}: ${s}`)}return n});import{clsx as to}from"clsx";var Qe="-",Pr=e=>{let t=Cr(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{let l=s.split(Qe);return l[0]===""&&l.length!==1&&l.shift(),dt(l,t)||Sr(s)},getConflictingClassGroupIds:(s,l)=>{let p=r[s]||[];return l&&o[s]?[...p,...o[s]]:p}}},dt=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],o=t.nextPart.get(r),i=o?dt(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let n=e.join(Qe);return t.validators.find(({validator:s})=>s(n))?.classGroupId},gt=/^\[(.+)\]$/,Sr=e=>{if(gt.test(e)){let t=gt.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Cr=e=>{let{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return zr(Object.entries(e.classGroups),r).forEach(([n,s])=>{Ze(s,o,n,t)}),o},Ze=(e,t,r,o)=>{e.forEach(i=>{if(typeof i=="string"){let n=i===""?t:ut(t,i);n.classGroupId=r;return}if(typeof i=="function"){if(Rr(i)){Ze(i(o),t,r,o);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([n,s])=>{Ze(s,ut(t,n),r,o)})})},ut=(e,t)=>{let r=e;return t.split(Qe).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},Rr=e=>e.isThemeGetter,zr=(e,t)=>t?e.map(([r,o])=>{let i=o.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,l])=>[t+s,l])):n);return[r,i]}):e,wr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map,i=(n,s)=>{r.set(n,s),t++,t>e&&(t=0,o=r,r=new Map)};return{get(n){let s=r.get(n);if(s!==void 0)return s;if((s=o.get(n))!==void 0)return i(n,s),s},set(n,s){r.has(n)?r.set(n,s):i(n,s)}}},mt="!",xr=e=>{let{separator:t,experimentalParseClassName:r}=e,o=t.length===1,i=t[0],n=t.length,s=l=>{let p=[],g=0,d=0,f;for(let b=0;b<l.length;b++){let S=l[b];if(g===0){if(S===i&&(o||l.slice(b,b+n)===t)){p.push(l.slice(d,b)),d=b+n;continue}if(S==="/"){f=b;continue}}S==="["?g++:S==="]"&&g--}let P=p.length===0?l:l.substring(d),C=P.startsWith(mt),v=C?P.substring(1):P,I=f&&f>d?f-d:void 0;return{modifiers:p,hasImportantModifier:C,baseClassName:v,maybePostfixModifierPosition:I}};return r?l=>r({className:l,parseClassName:s}):s},vr=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(o=>{o[0]==="["?(t.push(...r.sort(),o),r=[]):r.push(o)}),t.push(...r.sort()),t},Lr=e=>({cache:wr(e.cacheSize),parseClassName:xr(e),...Pr(e)}),Nr=/\s+/,Or=(e,t)=>{let{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:i}=t,n=[],s=e.trim().split(Nr),l="";for(let p=s.length-1;p>=0;p-=1){let g=s[p],{modifiers:d,hasImportantModifier:f,baseClassName:P,maybePostfixModifierPosition:C}=r(g),v=!!C,I=o(v?P.substring(0,C):P);if(!I){if(!v){l=g+(l.length>0?" "+l:l);continue}if(I=o(P),!I){l=g+(l.length>0?" "+l:l);continue}v=!1}let b=vr(d).join(":"),S=f?b+mt:b,w=S+I;if(n.includes(w))continue;n.push(w);let G=i(I,v);for(let B=0;B<G.length;++B){let q=G[B];n.push(S+q)}l=g+(l.length>0?" "+l:l)}return l};function kr(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Et(t))&&(o&&(o+=" "),o+=r);return o}var Et=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=Et(e[o]))&&(r&&(r+=" "),r+=t);return r};function Mr(e,...t){let r,o,i,n=s;function s(p){let g=t.reduce((d,f)=>f(d),e());return r=Lr(g),o=r.cache.get,i=r.cache.set,n=l,l(p)}function l(p){let g=o(p);if(g)return g;let d=Or(p,r);return i(p,d),d}return function(){return n(kr.apply(null,arguments))}}var y=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},ft=/^\[(?:([a-z-]+):)?(.+)\]$/i,Dr=/^\d+\/\d+$/,Ur=new Set(["px","full","screen"]),Br=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Kr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Gr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Yr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,W=e=>pe(e)||Ur.has(e)||Dr.test(e),X=e=>ge(e,"length",Zr),pe=e=>!!e&&!Number.isNaN(Number(e)),Xe=e=>ge(e,"number",pe),Ae=e=>!!e&&Number.isInteger(Number(e)),Fr=e=>e.endsWith("%")&&pe(e.slice(0,-1)),u=e=>ft.test(e),Z=e=>Br.test(e),Hr=new Set(["length","size","percentage"]),jr=e=>ge(e,Hr,ht),Wr=e=>ge(e,"position",ht),qr=new Set(["image","url"]),$r=e=>ge(e,qr,Jr),Xr=e=>ge(e,"",Qr),be=()=>!0,ge=(e,t,r)=>{let o=ft.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):r(o[2]):!1},Zr=e=>Vr.test(e)&&!Kr.test(e),ht=()=>!1,Qr=e=>Gr.test(e),Jr=e=>Yr.test(e);var eo=()=>{let e=y("colors"),t=y("spacing"),r=y("blur"),o=y("brightness"),i=y("borderColor"),n=y("borderRadius"),s=y("borderSpacing"),l=y("borderWidth"),p=y("contrast"),g=y("grayscale"),d=y("hueRotate"),f=y("invert"),P=y("gap"),C=y("gradientColorStops"),v=y("gradientColorStopPositions"),I=y("inset"),b=y("margin"),S=y("opacity"),w=y("padding"),G=y("saturate"),B=y("scale"),q=y("sepia"),ce=y("skew"),re=y("space"),Ee=y("translate"),D=()=>["auto","contain","none"],c=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",u,t],m=()=>[u,t],oe=()=>["",W,X],$=()=>["auto",pe,u],ie=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",u],k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[pe,u];return{cacheSize:500,separator:":",theme:{colors:[be],spacing:[W,X],blur:["none","",Z,u],brightness:L(),borderColor:[e],borderRadius:["none","","full",Z,u],borderSpacing:m(),borderWidth:oe(),contrast:L(),grayscale:H(),hueRotate:L(),invert:H(),gap:m(),gradientColorStops:[e],gradientColorStopPositions:[Fr,X],inset:R(),margin:R(),opacity:L(),padding:m(),saturate:L(),scale:L(),sepia:H(),skew:L(),space:m(),translate:m()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[Z]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ie(),u]}],overflow:[{overflow:c()}],"overflow-x":[{"overflow-x":c()}],"overflow-y":[{"overflow-y":c()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[I]}],"inset-x":[{"inset-x":[I]}],"inset-y":[{"inset-y":[I]}],start:[{start:[I]}],end:[{end:[I]}],top:[{top:[I]}],right:[{right:[I]}],bottom:[{bottom:[I]}],left:[{left:[I]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ae,u]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",u]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Ae,u]}],"grid-cols":[{"grid-cols":[be]}],"col-start-end":[{col:["auto",{span:["full",Ae,u]},u]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[be]}],"row-start-end":[{row:["auto",{span:[Ae,u]},u]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",u]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",u]}],gap:[{gap:[P]}],"gap-x":[{"gap-x":[P]}],"gap-y":[{"gap-y":[P]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[re]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[re]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",u,t]}],"min-w":[{"min-w":[u,t,"min","max","fit"]}],"max-w":[{"max-w":[u,t,"none","full","min","max","fit","prose",{screen:[Z]},Z]}],h:[{h:[u,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[u,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Z,X]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xe]}],"font-family":[{font:[be]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",u]}],"line-clamp":[{"line-clamp":["none",pe,Xe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",W,u]}],"list-image":[{"list-image":["none",u]}],"list-style-type":[{list:["none","disc","decimal",u]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",W,X]}],"underline-offset":[{"underline-offset":["auto",W,u]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:m()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",u]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",u]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ie(),Wr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$r]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:Y()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[W,u]}],"outline-w":[{outline:[W,X]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[W,X]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Z,Xr]}],"shadow-color":[{shadow:[be]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...ne(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ne()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",Z,u]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[G]}],sepia:[{sepia:[q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[G]}],"backdrop-sepia":[{"backdrop-sepia":[q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[B]}],"scale-x":[{"scale-x":[B]}],"scale-y":[{"scale-y":[B]}],rotate:[{rotate:[Ae,u]}],"translate-x":[{"translate-x":[Ee]}],"translate-y":[{"translate-y":[Ee]}],"skew-x":[{"skew-x":[ce]}],"skew-y":[{"skew-y":[ce]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",u]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",u]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":m()}],"scroll-mx":[{"scroll-mx":m()}],"scroll-my":[{"scroll-my":m()}],"scroll-ms":[{"scroll-ms":m()}],"scroll-me":[{"scroll-me":m()}],"scroll-mt":[{"scroll-mt":m()}],"scroll-mr":[{"scroll-mr":m()}],"scroll-mb":[{"scroll-mb":m()}],"scroll-ml":[{"scroll-ml":m()}],"scroll-p":[{"scroll-p":m()}],"scroll-px":[{"scroll-px":m()}],"scroll-py":[{"scroll-py":m()}],"scroll-ps":[{"scroll-ps":m()}],"scroll-pe":[{"scroll-pe":m()}],"scroll-pt":[{"scroll-pt":m()}],"scroll-pr":[{"scroll-pr":m()}],"scroll-pb":[{"scroll-pb":m()}],"scroll-pl":[{"scroll-pl":m()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",u]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[W,X,Xe]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var At=Mr(eo);var T=(...e)=>At(to(e));import{cva as ro}from"class-variance-authority";import oo from"react";import{jsx as no}from"react/jsx-runtime";var io=ro("flex flex-col",{variants:{variant:{container:"bg-elz-neutral-1 p-16 gap-16 rounded-12 border border-elz-neutral-6 overflow-hidden"}}}),E=oo.forwardRef(({children:e,variant:t,className:r,...o},i)=>no("div",{ref:i,className:T(io({variant:t}),r),...o,children:e}));import{forwardRef as co}from"react";import{cva as po}from"class-variance-authority";import{forwardRef as ao}from"react";import{jsx as lo}from"react/jsx-runtime";var so=ao(({children:e,...t},r)=>lo("a",{ref:r,rel:t.target==="_blank"?"noopener noreferrer":void 0,...t,children:e})),ae=so;import{jsx as _t}from"react/jsx-runtime";var bt=po("flex min-w-fit font-medium no-underline gap-4 select-none font-elz-plex-sans cursor-pointer items-center justify-center transition-all ring-0 outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:bg-elz-neutral-3 disabled:text-elz-neutral-8",{variants:{variant:{neutral:"text-elz-neutral-11 bg-elz-neutral-3 hover:bg-elz-neutral-4 active:bg-elz-neutral-5 focus-visible:ring-elz-neutral-8",accent:"text-elz-accent-11 bg-elz-accent-3 hover:bg-elz-accent-4 active:bg-elz-accent-5 focus-visible:ring-elz-accent-8",success:"text-elz-success-11 bg-elz-success-3 hover:bg-elz-success-4 active:bg-elz-success-5 focus-visible:ring-elz-success-8",warning:"text-elz-warning-11 bg-elz-warning-3 hover:bg-elz-warning-4 active:bg-elz-warning-5 focus-visible:ring-elz-warning-8",danger:"text-elz-danger-11 bg-elz-danger-3 hover:bg-elz-danger-4 active:bg-elz-danger-5 focus-visible:ring-elz-danger-8",ghost:"text-elz-neutral-11 bg-transparent hover:bg-elz-neutral-4 active:bg-elz-neutral-5 disabled:bg-transparent focus-visible:ring-elz-neutral-8","ghost-bordered":"text-elz-neutral-11 bg-transparent hover:bg-elz-neutral-4 active:bg-elz-neutral-5 disabled:bg-transparent focus-visible:ring-elz-neutral-8 border border-elz-neutral-6",primary:"bg-elz-accent-9 hover:bg-elz-accent-10 active:bg-elz-accent-9 text-elz-accent-1 ring-elz-accent-8 disabled:bg-elz-neutral-3 disabled:text-elz-neutral-8 disabled:ring-elz-neutral-3 disabled:cursor-not-allowed",outline:"text-elz-neutral-11 bg-transparent hover:bg-elz-neutral-4 active:bg-elz-neutral-5 disabled:bg-transparent focus-visible:ring-elz-neutral-8 border border-elz-neutral-8"},size:{xs:"h-24 gap-4 px-8 rounded-8 text-[1.4rem]",sm:"h-32 gap-4 px-8 rounded-8 text-[1.4rem]",md:"h-40 gap-8 px-16 rounded-12 text-[1.6rem]",lg:"h-44 gap-8 px-16 rounded-12 text-[1.6rem]"}},defaultVariants:{variant:"accent",size:"sm"}}),Q=co(({id:e,children:t,href:r,target:o,rel:i,onClick:n,variant:s,size:l,className:p,...g},d)=>r?_t(ae,{ref:d,id:e,href:r,target:o,rel:i,className:T(bt({variant:s,size:l}),p),children:t}):_t("button",{ref:d,id:e,onClick:n,className:T(bt({variant:s,size:l}),p),...g,children:t}));import{useRef as Tt,useState as Je,useEffect as It}from"react";import{FaSpinner as Io}from"react-icons/fa6";import{IoCheckmark as Po,IoClose as So,IoPaperPlane as Co}from"react-icons/io5";import{BsFileEarmarkText as uo}from"react-icons/bs";import{IoClose as mo}from"react-icons/io5";import{jsx as se,jsxs as go}from"react/jsx-runtime";var Se=({variant:e})=>e==="small"?se("svg",{role:"img","aria-label":"small bolt icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:se("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.7365 0.0440924C19.8713 -0.0831111 20.0763 0.0903391 19.9709 0.242402L15.2549 7.04263C15.1807 7.14964 15.2656 7.29399 15.3961 7.28267L18.1684 7.04222C18.3064 7.03025 18.3897 7.19022 18.2998 7.29482L13.5419 12.835C13.4521 12.9397 13.5353 13.0996 13.6733 13.0876L16.6586 12.8287C16.8046 12.8161 16.8851 12.9929 16.7789 13.093L5.26353 23.9559C5.12868 24.0831 4.92364 23.9096 5.0291 23.7576L9.8071 16.8679C9.88131 16.7609 9.79642 16.6165 9.66594 16.6278L6.83434 16.8734C6.69677 16.8854 6.61339 16.7264 6.70226 16.6216L11.3202 11.1762C11.4091 11.0714 11.3257 10.9123 11.1881 10.9243L8.34145 11.1712C8.19545 11.1839 8.11499 11.007 8.22117 10.9069L19.7365 0.0440924Z",fill:"#B4B4B4"})}):se("svg",{role:"img","aria-label":"bolt icon",width:"22",height:"45",viewBox:"0 0 22 45",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:se("path",{d:"M20.3695 13.0981L12.7018 24.2968L18.54 23.1037C18.6552 23.2863 18.7704 23.469 18.8856 23.6516L0.661202 45H0L7.49488 31.1342L1.98736 32.2587C1.81079 32.01 1.79577 31.992 1.61919 31.7433L9.0502 20.7429L3.46755 21.8819C3.29098 21.6115 3.29474 21.6115 3.11817 21.3376L21.3313 0H22L14.6066 13.6856L20.0014 12.5827C20.1817 12.8314 20.193 12.8494 20.3695 13.0981Z",fill:"white"})}),ue=()=>go("svg",{role:"img",width:"34",height:"33",viewBox:"0 0 34 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"spin 1s linear infinite"},"aria-label":"Loading spinner",children:[se("path",{d:"M32 16.5C32 24.7843 25.2843 31.5 17 31.5C8.71573 31.5 2 24.7843 2 16.5C2 8.21573 8.71573 1.5 17 1.5C25.2843 1.5 32 8.21573 32 16.5Z",stroke:"#606060",strokeWidth:"2.42308"}),se("path",{d:"M2 16.5C2 8.21573 8.71573 1.5 17 1.5",stroke:"white",strokeWidth:"2.42308",strokeLinecap:"round"}),se("style",{children:`
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
`})]});import{useState as Eo}from"react";import{Fragment as Ao,jsx as V,jsxs as Ce}from"react/jsx-runtime";var fo=({file:e,onRemove:t})=>{let r=e.type.startsWith("image/")&&e.preview,o=e.name.split(".").pop()?.toLowerCase()||"",i=e.name.split(".").slice(0,-1).join("."),[n,s]=Eo(!0);return Ce(E,{className:`relative group rounded-7 flex-shrink-0 overflow-hidden border border-elz-neutral-6 ${r?"size-[48px]":"w-[96px] h-[48px]"}`,children:[r?Ce(Ao,{children:[n&&V(E,{className:"absolute inset-0 flex items-center justify-center bg-elz-neutral-3",children:V(ue,{})}),V("img",{src:e.preview,alt:e.name,className:`w-full h-full object-cover transition-opacity duration-200 ${n?"opacity-0":"opacity-100"}`,onLoad:()=>s(!1)})]}):Ce(E,{className:"flex flex-col size-full items-start justify-center bg-elz-neutral-3 p-2 gap-2",children:[Ce("div",{className:"flex flex-row gap-1",children:[V(uo,{className:"size-15 text-elz-neutral-8"}),V("span",{className:"text-elz-neutral-11 text-[10px]",children:o})]}),V("span",{title:i,className:"text-elz-neutral-11 text-[10px] max-w-full truncate px-1",children:i})]}),V("button",{type:"button",onClick:t,className:"absolute top-0 right-0 size-15 rounded-full bg-elz-neutral-12 text-elz-neutral-2 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:V(mo,{className:"size-10"})})]})},ho=({files:e,onRemoveFile:t})=>e.length===0?null:V(E,{className:"flex flex-row gap-6 overflow-x-auto pb-2",children:e.map((r,o)=>V(fo,{file:r,onRemove:()=>t(o)},`${r.name}-${o}`))}),yt=ho;import et from"react-hot-toast";import{cva as bo}from"class-variance-authority";import{createElement as _o,forwardRef as yo}from"react";var To=bo("font-elz-plex-sans",{variants:{variant:{title:"text-balance text-[3.6rem] font-semibold text-elz-neutral-12",description:"text-[1.6rem] font-medium text-elz-neutral-11",subtitle:"text-[1.6rem] text-elz-neutral-12 font-semibold",feature:"text-[1.2rem] font-medium uppercase tracking-[0.256rem] text-elz-neutral-11",primary:"text-elz-neutral-12",secondary:"text-elz-neutral-11"},size:{"2xs":"text-[1rem]",xs:"text-[1.2rem]",sm:"text-[1.4rem]",md:"text-[1.6rem]",lg:"text-[1.8rem]",xl:"text-[2.0rem]","2xl":"text-[2.6rem]","3xl":"text-[3.4rem]","4xl":"text-[5.8rem]"},weight:{400:"font-normal",500:"font-medium",700:"font-bold"}},defaultVariants:{variant:"title"}});var N=yo(({children:e,as:t="p",variant:r,size:o,weight:i,className:n,...s},l)=>_o(t,{ref:l,className:T(To({variant:r,size:o,weight:i}),n),...s},e));import{jsx as J,jsxs as _e}from"react/jsx-runtime";var Pt=["text/plain","application/pdf","application/json","text/markdown","image/jpeg","image/png","image/gif"],tt=20,Ro=10*1024*1024,zo=({onSubmit:e,onSuccess:t,onError:r,onDescriptionChange:o,onFilesChange:i,maxFileSize:n=Ro,showCTALabel:s=!0})=>{let[l,p]=Je(""),[g,d]=Je([]),[f,P]=Je(!1),C=Tt(null),v=Tt(null);It(()=>()=>{for(let c of g)c.preview&&URL.revokeObjectURL(c.preview)},[g]),It(()=>{f||!C.current||C.current.focus()},[f]);let I=()=>{let c=C.current;if(c){c.style.height="auto";let R=Math.min(Math.max(40,c.scrollHeight),200);c.style.height=`${R}px`}},b=c=>{p(c.target.value),I(),typeof o=="function"&&o(c.target.value)},S=c=>{if(c.size>n){let R=n/1048576;return et.error(`File ${c.name} is too large. Maximum size is ${R}MB`),!1}return Pt.includes(c.type)?!0:(et.error(`File type ${c.type} is not supported`),!1)},w=c=>(c.type.startsWith("image/")&&(c.preview=URL.createObjectURL(c)),c),G=c=>{if(c.target.files){let R=Array.from(c.target.files).filter(S).map(m=>w(m));d(m=>(typeof i=="function"&&i([...m,...R]),[...m,...R]))}c.target.value=""},B=()=>{v.current?.click()},q=c=>{d(R=>{let m=R[c];m.preview&&URL.revokeObjectURL(m.preview);let oe=R.filter(($,ie)=>ie!==c);return typeof i=="function"&&i(oe),oe})},ce=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),re())},re=async()=>{if(!(f||!D))try{P(!0),await e(l,g),typeof t=="function"&&t(),d(R=>{for(let m of R)m.preview&&URL.revokeObjectURL(m.preview);return[]})}catch(c){typeof r=="function"&&r(c),et.error(c instanceof Error?c.message:"Failed to create agent")}finally{P(!1)}},D=l.trim().length>=tt;return J(E,{className:"flex flex-col gap-4 max-w-[700px] self-center w-full",children:_e(E,{"data-testid":"chat-input-container",className:"gap-2 sm:gap-4 m-auto w-full flex-shrink-0 min-h-[5rem] max-h-[calc(100vh-8rem)] relative flex flex-col p-6 sm:p-8 rounded-[8px] bg-elz-neutral-100 border border-elz-neutral-6 bg-elz-neutral-2",children:[J(yt,{files:g,onRemoveFile:q}),J("textarea",{ref:C,className:"min-h-[6rem] sm:min-h-[8rem] w-full bg-transparent resize-none border-none outline-none overflow-y-auto placeholder:text-elz-neutral-8 text-elz-neutral-12 text-sm sm:text-base",placeholder:`What do you want your AI agent to do? Write at least ${tt} characters.`,value:l,onChange:b,onKeyDown:ce,disabled:f}),J("input",{type:"file",ref:v,onChange:G,className:"hidden",multiple:!0,accept:Pt.join(",")}),_e(E,{className:"w-full flex flex-row justify-between items-center gap-12",children:[_e(E,{className:T("gap-6 items-center flex-row text-elz-neutral-11",D&&"text-elz-success-10"),children:[D?J(Po,{className:"size-16"}):J(So,{className:"size-16"}),_e(N,{variant:"secondary",size:"xs",className:T(D&&"text-elz-success-10"),children:["Minimum ",tt," characters"]})]}),_e(Q,{variant:"accent",disabled:!D||f,onClick:re,className:"text-sm sm:text-base",children:[f?J(Io,{className:"size-16 animate-spin"}):J(Co,{className:"size-16"}),s&&"Create agent"]})]})]})})};import{useMemo as mi,useState as jt}from"react";import Ke from"react-hot-toast";var St=()=>{let e=M("PUBLIC_BEEHIIV_PROXY_SERVER_URL");return{subscribeNewUser:async o=>{if(!e)throw Error("Missing PUBLIC_BEEHIIV_PROXY_SERVER_URL env variable");if(o)try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o,utmSource:"eliza"})})}catch(i){console.error({status:"user could not be subscribed",error:i})}},updateUser:async({email:o,abandonedCart:i})=>{if(!e)throw Error("Missing PUBLIC_BEEHIIV_PROXY_SERVER_URL env variable");if(o)try{await fetch(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o,customFields:[{name:"abandonedCart",value:`${i}`}]})})}catch(n){console.error({status:"user could not be updated",error:n})}}}};import{create as wo}from"zustand";var Ct=wo((e,t)=>({captureEvent:void 0,setCaptureEvent:r=>{e({captureEvent:r})},dispatchEvent:(r,o)=>{let{captureEvent:i}=t();i&&i(r,o)}}));var xo="agent_ui_wizard",U=e=>`${xo}.${e}`,de={JOURNEY_INIT:U("journey_init"),NAVIGATION:{TRIGGERED:U("navigation")},FILE_UPLOAD:{TRIGGERED:U("file_upload")},SUBSCRIPTION:{PURCHASE_POLLING:{STARTED:U("subscription_purchase_polling_started"),COMPLETED:U("subscription_purchase_polling_completed")}},DEPLOYMENT:{VALIDATION:{STARTED:U("deployment_validation_started"),FAILED:U("deployment_validation_failed"),SUCCESS:U("deployment_validation_success")},PROCESSING:{STARTED:U("deployment_status_processing_started"),FAILED:U("deplayment_status_processing_failed"),COMPLETED:U("deployment_status_processing_completed")}}};import{create as vo}from"zustand";import{persist as Lo,createJSONStorage as No}from"zustand/middleware";var le=vo()(Lo((e,t)=>({authStoreInstance:{},setAuthStoreInstance:r=>{let o={authStoreInstance:r};(r.userProfile?.username||r.userProfile?.avatar)&&(o.userProfile={username:r.userProfile?.username,avatar:r.userProfile?.avatar}),e(o)},triggerLogin:()=>{let{authStoreInstance:r}=t(),o=r?.triggerLoginModal;try{if(typeof o!="function"){console.warn(`Expected triggerLoginModal to be a ready function but got ${typeof o}. If this issue persists, please contact support at https://fleek.xyz/support`);return}o(!0)}catch(i){console.error("Failed to trigger login modal",i)}}}),{name:"user-profile-storage",storage:No(()=>localStorage),partialize:e=>({userProfile:e.userProfile})}));import{FaArrowRight as Ei}from"react-icons/fa6";function me(e,t="USD",r=navigator.language){return new Intl.NumberFormat(r||"en-US",{style:"currency",currency:t}).format(e)}import{create as fi}from"zustand";import{useAuthStore as Oo}from"@fleek-platform/login-button";import{useQuery as ko}from"@tanstack/react-query";var Re=()=>{let{accessToken:e,projectId:t}=Oo();return ko({queryKey:["subscriptions"],queryFn:async()=>Fe({accessToken:e,projectId:t},{throwOnError:!0})})};import{useAuthStore as Mo}from"@fleek-platform/login-button";import{useQuery as Do}from"@tanstack/react-query";var Rt=()=>{let{accessToken:e}=Mo();return Do({queryKey:["plans"],queryFn:async()=>He({accessToken:e},{throwOnError:!0})})};var zt=(e,t)=>{let r=e.find(o=>o.name.toLowerCase()===t);if(r)return{...r,price:r.price/100}},ze=({planName:e})=>{let{data:t=[],isPending:r,refetch:o}=Rt();return{data:zt(t,e),isPending:r,refetch:async()=>{let i=await o();return{data:zt(i.data??[],e)}}}};var we=()=>ze({planName:st});var xe=()=>ze({planName:lt});var ve=(e,t)=>{if(!t)return;let r=e.filter(s=>["active","trialing"].includes(s.status.toLowerCase())).find(s=>s.productId===t?.id);if(!r)return;let o=r.items.find(s=>s.productId===t?.id);if(!o)return;let i=o.quantity,n=o.unitAmount/100;return{renewalDate:new Date(r.periodStartDate),activePlans:i,planTotalPrice:n*i,subscriptionId:r.id}},wt=()=>{let{data:e,isPending:t,refetch:r}=we(),{data:o,isPending:i,refetch:n}=xe(),{data:s=[],isPending:l,refetch:p}=Re();return{tee:ve(s,e),standard:ve(s,o),isPending:t||i||l,refetch:async()=>{let[g,d,f]=await Promise.all([r(),n(),p()]);return{tee:ve(f.data??[],g.data),standard:ve(f.data??[],d.data)}}}};import{useQuery as Uo}from"@tanstack/react-query";var xt=()=>{let e=le(d=>d.authStoreInstance),t=e?.projectId,r=e?.accessToken,o=!!e?.isLoggedIn,i=!!(t&&r&&o),{data:n,isPending:s,error:l,refetch:p,isRefetching:g}=Uo({queryKey:["agents",t],queryFn:async()=>Ye({projectId:t,accessToken:r},{throwOnError:!0})