1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RecentExecutions-QTivSZcQ.js","assets/vendor-_ezZoJiD.js","assets/vendor-Cd6H9538.css","assets/card-CREZV1r6.js","assets/index-DJLK6UyP.js","assets/tanstack-CMznP40l.js","assets/radix-ui-CF92MDW-.js","assets/icons-BvJ5U55O.js","assets/pdf-utils-B8cFOiHv.js","assets/router-ToXy81Ol.js","assets/index-iH5IR6RU.css","assets/badge-TvqE-Pbx.js","assets/QuickActions-gdGxe305.js","assets/button-DatArJX-.js","assets/Apicoveragewidget-DuJaof5s.js","assets/popover-AbkwtnMv.js","assets/charts-Cvyb2xhJ.js","assets/Testresultswidget-DXVgn6KE.js"])))=>i.map(i=>d[i]); 2import{j as s,r as l}from"./vendor-_ezZoJiD.js";import{_ as m}from"./pdf-utils-B8cFOiHv.js";import{D as _,a as k,d as E,e as A}from"./dialog-2s3vQ_yk.js";import{B as I}from"./button-DatArJX-.js";import{C as x,c as u}from"./card-CREZV1r6.js";import{a as y,E as C}from"./index-DJLK6UyP.js";import{u as D}from"./useWorkspace-BCJlmLaC.js";import{B as P}from"./Breadcum-DGCjQVOG.js";import{W as L}from"./Welcome_optra-oMqdsmnM.js";import{b as R,Q as T,ao as B,aj as O,aq as W}from"./icons-BvJ5U55O.js";import"./radix-ui-CF92MDW-.js";import"./tanstack-CMznP40l.js";import"./router-ToXy81Ol.js";import"./collectionStore-Fdd6KieC.js";const F=async t=>{const a=await y("GET",`${C.API_BASE_URL}/dashboard/${t}`,{headers:{"X-Workspace-ID":t}});if(!a.ok)throw new Error("Failed to fetch dashboard");return a.json()},M=async t=>{const a=await y("GET",`${C.API_BASE_URL}/summary/workspace/${t}`,{headers:{"X-Workspace-ID":t}});if(!a.ok)throw new Error("Failed to fetch test metrics");return a.json()};function d({title:t,value:a,icon:h,change:e,changeType:n="neutral",description:o,iconBgColor:c="bg-blue-100"}){return s.jsx(x,{className:"p-3 md:p-6 hover:shadow-md transition-shadow",children:s.jsxs(u,{className:"p-0",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs md:text-sm font-medium text-slate-600",children:t}),s.jsx("p",{className:"text-md md:text-3xl font-bold text-slate-900 mt-2",children:a})]}),s.jsx("div",{className:`w-6 md:w-12 h-6 md:h-12 ${c} rounded-lg flex items-center justify-center text-xl`,children:h})]}),(e||o)&&s.jsxs("div",{className:"mt-4 flex items-center text-sm",children:[e&&s.jsx("span",{className:n==="positive"?"text-green-600 font-medium":n==="negative"?"text-red-600 font-medium":"text-slate-600 font-medium",children:e}),o&&s.jsx("span",{className:`text-slate-500 ${e?"ml-2":""}`,children:o})]})]})})}const $=l.lazy(()=>m(()=>import("./RecentExecutions-QTivSZcQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),z=l.lazy(()=>m(()=>import("./QuickActions-gdGxe305.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,13]))),q=l.lazy(()=>m(()=>import("./Apicoveragewidget-DuJaof5s.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,15,16]))),V=l.lazy(()=>m(()=>import("./Testresultswidget-DXVgn6KE.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,10,15,16])));function G(){return s.jsx(s.Fragment,{children:[...Array(4)].map((t,a)=>s.jsx(x,{className:"p-3 md:p-6",children:s.jsx(u,{className:"p-0",children:s.jsxs("div",{className:"animate-pulse",children:[s.jsx("div",{className:"h-3 w-24 bg-slate-200 rounded mb-3"}),s.jsx("div",{className:"h-8 w-16 bg-slate-200 rounded"})]})})},a))})}function N(){return s.jsx(x,{className:"h-full",children:s.jsx(u,{className:"p-4 md:p-6",children:s.jsxs("div",{className:"animate-pulse space-y-3",children:[s.jsx("div",{className:"h-3 w-24 bg-slate-200 rounded"}),s.jsx("div",{className:"h-3 w-36 bg-slate-200 rounded"}),s.jsxs("div",{className:"flex items-center gap-4 mt-4",children:[s.jsx("div",{className:"h-28 w-28 rounded-full bg-slate-200 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx("div",{className:"h-4 w-24 bg-slate-200 rounded"}),s.jsx("div",{className:"h-3 w-32 bg-slate-200 rounded"}),s.jsx("div",{className:"h-3 w-20 bg-slate-200 rounded"})]})]})]})})})}function w(){return s.jsx(x,{className:"h-full",children:s.jsx(u,{className:"p-4 md:p-6 space-y-3",children:s.jsxs("div",{className:"animate-pulse space-y-3",children:[s.jsx("div",{className:"h-4 w-32 bg-slate-200 rounded"}),[...Array(3)].map((t,a)=>s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"h-3 w-28 bg-slate-200 rounded"}),s.jsx("div",{className:"h-3 w-20 bg-slate-200 rounded"})]}),s.jsx("div",{className:"h-6 w-16 bg-slate-200 rounded-full"})]},a))]})})})}function Q(){const{currentWorkspace:t}=D(),a=t==null?void 0:t.id,h=t==null?void 0:t.name,[e,n]=l.useState(),[o,c]=l.useState(!0),[i,S]=l.useState(),[j,g]=l.useState(!0),[f,p]=l.useState(!1),v=l.useCallback(async()=>{c(!0);try{const r=await F(a??"");n(r)}catch(r){console.error(r)}finally{c(!1)}},[a]),b=l.useCallback(async()=>{g(!0);try{const r=await M(a??"");S(r)}catch(r){console.error(r)}finally{g(!1)}},[a]);return l.useEffect(()=>{a&&(v(),b(),localStorage.getItem("hasSeenWelcome")||(p(!0),localStorage.setItem("hasSeenWelcome","true")))},[a,v,b]),s.jsxs("div",{className:"min-h-screen bg-slate-50",children:[s.jsx(P,{title:`Dashboard - ${h||"Workspace"}`,subtitle:"Monitor your API tests and execution schedules",showCreateButton:!1,showQuickGuide:!1,buttonTitle:"Run Execution",icon:R,iconBgClass:"bg-blue-100",iconColor:"#136fb0",iconSize:40}),s.jsxs("div",{className:"flex-1 overflow-auto mt-3 scrollbar-thin",children:[s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-2 lg:grid-cols-4 gap-1 md:gap-6 mb-3",children:o?s.jsx(G,{}):s.jsxs(s.Fragment,{children:[s.jsx(d,{title:"Collections",value:(e==null?void 0:e.totalCollections)||0,icon:s.jsx(T,{className:"w-5 h-5 text-green-600"}),iconBgColor:"bg-green-100"}),s.jsx(d,{title:"Test Suites",value:(e==null?void 0:e.totalTestSuites)||0,icon:s.jsx(B,{className:"w-5 h-5 text-blue-600"}),iconBgColor:"bg-blue-100"}),s.jsx(d,{title:"Request Chains",value:(e==null?void 0:e.totalRequestChains)||0,icon:s.jsx(O,{className:"w-5 h-5 text-purple-600"}),iconBgColor:"bg-purple-100"}),s.jsx(d,{title:"Schedules",value:(e==null?void 0:e.totalActiveSchedules)||0,icon:s.jsx(W,{className:"w-5 h-5 text-orange-600"}),iconBgColor:"bg-orange-100"})]})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 md:gap-6 mb-3",children:[s.jsx(l.Suspense,{fallback:s.jsx(N,{}),children:s.jsx(q,{totalApis:(i==null?void 0:i.apiCoverage.totalApis)??0,apisCovered:(i==null?void 0:i.apiCoverage.apisCoveredInTestSuite)??0,isLoading:j})}),s.jsx(l.Suspense,{fallback:s.jsx(N,{}),children:s.jsx(V,{totalExecuted:(i==null?void 0:i.testSuite.totalTestCasesExecuted)??0,passed:(i==null?void 0:i.testSuite.testCasesPassed)??0,failed:(i==null?void 0:i.testSuite.testCasesFailed)??0,isLoading:j})})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 md:gap-6 mb-8",children:[s.jsx(l.Suspense,{fallback:s.jsx(w,{}),children:s.jsx($,{data:(e==null?void 0:e.lastExecutions)||[]})}),s.jsx(l.Suspense,{fallback:s.jsx(w,{}),children:s.jsx(z,{})})]})]}),s.jsx(_,{open:f,onOpenChange:p,children:s.jsx(k,{className:"max-w-5xl",children:s.jsx(E,{asChild:!0,children:s.jsx("div",{className:"max-h-[88vh] overflow-y-auto scrollbar-thin pr-2",children:s.jsxs("div",{className:"rounded-xl bg-white",children:[s.jsx("div",{className:"p-2 sm:p-4",children:s.jsxs("div",{className:"grid gap-3 md:grid-cols-2 md:items-center",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-slate-900 mb-4",children:"Welcome to Optraflow.com"}),s.jsx("p",{className:"text-slate-600 mb-4",children:"Inside your workspace, you can:"}),s.jsx("ul",{className:"space-y-3 text-slate-700",children:["Import OpenAPI specs, Postman collections, curl commands â or add APIs manually","Run APIs, add response assertions, and validate schemas","Auto-generate test cases for your APIs in the Test Suite","Create static or dynamic variables using built-in functions","Perform integration testing across workflows using request chains","Test APIs across multiple environments effortlessly","Run jobs manually, schedule them, or trigger via CI/CD pipelines","Receive status updates via email, Slack, or Microsoft Teams"].map(r=>s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"mt-2 h-2 w-2 rounded-full bg-[#136fb0] flex-shrink-0"}),s.jsx("span",{children:r})]},r))}),s.jsxs("div",{className:"mt-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-900 mb-2",children:"What's next?"}),s.jsx("p",{className:"text-slate-600",children:"Create a new workspace, set up environments, import your APIs â and start testing with confidence."})]}),s.jsx("div",{className:"mt-6",children:s.jsx(I,{onClick:()=>p(!1),className:"bg-[#136fb0] hover:bg-[#0f5a94] text-white shadow-sm",children:"Start testing"})})]}),s.jsx("div",{className:"relative mx-auto w-full max-w-[480px]",children:s.jsx("div",{className:"relative rounded-2xl p-6",children:f&&s.jsx("img",{src:L,loading:"lazy",decoding:"async",alt:"Welcome to Optraflow",className:"w-full h-auto"})})})]})}),s.jsx("div",{className:"px-6 sm:px-8 pb-6",children:s.jsx(A,{className:"justify-center"})})]})})})})})]})}const os=()=>s.jsx(s.Fragment,{children:s.jsx(Q,{})});
2export{os as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.