1import{r as m,j as e}from"./client-D-PhZTIa.js";import{A as w}from"./app-layout-dMOqsqlW.js";import{a as b,H as v,L as p}from"./index.esm-fE4iyb0u.js";import{B as x}from"./button-rAoMxrjy.js";import{U as N}from"./UpgradeDialog-P76R-onG.js";import{D as y,a as k,g as S,b as C,c as L}from"./dialog-Ce6BS-78.js";import{C as D}from"./check-X4enH_05.js";import"./index-BJEx5VHc.js";import"./createLucideIcon-DsKImHZC.js";import"./index-D2bBsIKs.js";import"./index-BSDq4O6q.js";import"./x-zsYOzHFa.js";import"./globe-S_Gm-t0l.js";import"./analytics-Br6qU8FF.js";import"./app-Boz4lI4L.js";/* empty css */import"./app-logo-icon-BpZ4x529.js";import"./zap-ZQExKcbj.js";function $({className:s}){const r=m.useId();return e.jsxs("svg",{className:s,fill:"none",children:[e.jsx("defs",{children:e.jsx("pattern",{id:r,x:"0",y:"0",width:"10",height:"10",patternUnits:"userSpaceOnUse",children:e.jsx("path",{d:"M-3 13 15-5M-5 5l18-18M-1 21 17 3"})})}),e.jsx("rect",{stroke:"none",fill:`url(#${r})`,width:"100%",height:"100%"})]})}function P({data:s,width:r=100,height:t=30,className:o,color:i="#3b82f6"}){const a=m.useId(),n=2,c=Math.max(1,t-n*2),d=s&&s.length>0?Math.max(...s):0,u=m.useMemo(()=>!s||s.length===0?"":s.map((h,l)=>{const f=l/(s.length-1)*r,j=d===0?t/2:n+c-h/d*c;return`${f},${j}`}).join(" "),[s,r,t,d,c]);return e.jsxs("svg",{width:r,height:t,viewBox:`0 0 ${r} ${t}`,className:o,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:`${a}-bg`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:i,stopOpacity:"0.06"}),e.jsx("stop",{offset:"100%",stopColor:i,stopOpacity:"0"})]})}),e.jsx("rect",{x:"0",y:"0",width:r,height:t,fill:`url(#${a}-bg)`}),e.jsx("polyline",{fill:"none",stroke:i,strokeWidth:"1",strokeLinecap:"round",points:u})]})}function U({open:s,onOpenChange:r,plans:t,csrfToken:o}){const i=()=>{r(!1)};return e.jsx(y,{open:s,onOpenChange:r,children:e.jsxs(k,{className:"sm:max-w-6xl overflow-hidden p-0 max-h-[85vh] overflow-y-auto",children:[e.jsx("div",{className:"px-6 py-6 border-b border-border",children:e.jsxs(S,{children:[e.jsx(C,{className:"text-2xl",children:"Select your plan"}),e.jsx(L,{className:"mt-2 text-base",children:"Pick one of the following Tailstream plans."})]})}),e.jsxs("div",{className:"px-6 py-8",children:[e.jsx("div",{className:"grid gap-6 grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",children:t.map(a=>{const n=a.isRecommended||a.name.toLowerCase()==="starter";return e.jsxs("div",{className:["relative rounded-2xl ring-1 p-6 flex flex-col bg-card/60 transition-all hover:scale-[1.02]",n?"ring-primary/30 bg-gradient-to-b from-primary/10 to-primary/5 shadow-lg shadow-primary/25":"ring-border hover:ring-primary/20"].join(" "),children:[n&&e.jsx("div",{className:"absolute -top-3 left-1/2 transform -translate-x-1/2",children:e.jsx("span",{className:"px-3 py-1 rounded-full bg-primary text-primary-foreground text-xs font-medium shadow-sm",children:"Recommended"})}),e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h3",{className:"text-lg font-semibold",children:a.name}),a.name.toLowerCase()==="free"?e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"For small applications"}):a.name.toLowerCase()==="starter"?e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"For growing applications"}):a.name.toLowerCase()==="growth"?e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"For teams with large applications"}):e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"For large teams and high-usage"})]}),e.jsx("div",{className:"text-center mb-8",children:e.jsxs("div",{className:"text-4xl font-bold",children:["$",a.monthly_cost,e.jsx("span",{className:"text-base font-normal text-muted-foreground",children:"/mo"})]})}),e.jsx("ul",{className:"space-y-3 mb-8 flex-grow",children:a.features.map((c,d)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[e.jsx(D,{className:"size-4 text-primary flex-shrink-0 mt-0.5"}),e.jsx("span",{children:c})]},d))}),a.price_id?e.jsxs("form",{method:"post",action:route("subscription.checkout"),className:"mt-auto",children:[e.jsx("input",{type:"hidden",name:"price",value:a.price_id}),o&&e.jsx("input",{type:"hidden",name:"_token",value:o}),e.jsx(x,{type:"submit",className:["w-full",n?"shadow-sm":""].join(" "),variant:n?"default":"outline",children:a.name.toLowerCase()==="free"?"Start with Free":`Start with ${a.name}`})]}):e.jsx(x,{onClick:()=>r(!1),className:["w-full mt-auto",n?"shadow-sm":""].join(" "),variant:n?"default":"outline",children:a.name.toLowerCase()==="free"?"Start with Free":`Start with ${a.name}`})]},a.id)})}),e.jsx("div",{className:"mt-8 text-center",children:e.jsx("button",{onClick:i,className:"text-sm text-muted-foreground hover:text-foreground transition-colors underline underline-offset-4",children:"Skip for now"})})]})]})})}function _(s){return new Promise(r=>{if(typeof window<"u"&&window.gtag){r();return}const t=document.createElement("script");
1t.async=!0,t.src=`https://www.googletagmanager.com/gtag/js?id=${s}`,t.onload=()=>{const o=document.createElement("script");o.innerHTML=` 2 window.dataLayer = window.dataLayer || []; 3 function gtag(){dataLayer.push(arguments);} 4 gtag('js', new Date()); 5 gtag('config', '${s}'); 6 `,document.head.appendChild(o),setTimeout(()=>r(),100)},document.head.appendChild(t)})}async function M(s){await _(s.tagId),window.gtag&&window.gtag("event","conversion",{send_to:`${s.tagId}/${s.conversionLabel}`,value:s.value||1,currency:s.currency||"EUR",transaction_id:s.transactionId||`${Date.now()}_${Math.random()}`})}function g(s){const r=new URL(window.location.href);let t=!1;s.forEach(o=>{r.searchParams.has(o)&&(r.searchParams.delete(o),t=!0)}),t&&window.history.replaceState({},document.title,r.toString())}const E=[{title:"Dashboard",href:"/dashboard"}];function Z(){const{props:s}=b(),r=s.streams,t=s.streamLimits,o=s.planSelector,i=s.conversionData,[a,n]=m.useState(!1),[c,d]=m.useState(!!o);m.useEffect(()=>{new URLSearchParams(window.location.search).get("checkout_success")==="1"&&i?(M({tagId:"AW-17578507508",conversionLabel:"e-DuCNzR-5wbEPT5ir5B",value:i.amount||29,currency:"EUR",transactionId:`${Date.now()}_${s.auth?.user?.id||"guest"}`}),g(["checkout_success","verified"])):g(["verified"])},[s.auth?.user?.id,i]);const u=m.useCallback(l=>{t&&t.canCreate===!1&&(l?.preventDefault(),n(!0))},[t]),h=!r||r.length===0;return e.jsxs(w,{breadcrumbs:E,children:[e.jsx(v,{title:"Dashboard"}),e.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 roun
6ded-xl p-4 overflow-x-auto",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Streams"}),e.jsx(p,{href:route("streams.create"),onClick:u,children:e.jsx(x,{size:"sm",children:"New stream"})})]}),h?e.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-sidebar-border/70 dark:border-sidebar-border p-8 bg-card",children:[e.jsx($,{className:"absolute inset-0 size-full stroke-neutral-900/10 dark:stroke-neutral-100/10"}),e.jsxs("div",{className:"relative z-10 max-w-xl",children:[e.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Set up your first stream"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Create a named event stream and follow the ingest steps to start visualizing traffic."}),e.jsx(p,{href:route("streams.create"),onClick:u,children:e.jsx(x,{children:"Create stream"})})]})]}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:r.map(l=>e.jsx(p,{href:route("streams.show",{stream:l.uuid}),className:"block",children:e.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-sidebar-border/70 dark:border-sidebar-border p-6 hover:bg-muted/40 transition-colors",children:[e.jsx("div",{className:"mb-2 text-lg font-medium",children:l.name}),e.jsx(P,{data:l.sparkline,className:"text-primary"})]})},l.uuid))})]}),t&&e.jsx(N,{open:a,onOpenChange:n,planName:t.planName,streamsLimit:t.streamsLimit,upgradeUrl:t.upgradeUrl}),o&&e.jsx(U,{open:c,onOpenChange:d,plans:o.plans,csrfToken:o.csrfToken})]})}export{Z 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.