1import{j as e,b as s,x as f}from"./app-CIuxhNvr.js";import{u as N}from"./useMediaQuery-VXtSHDHQ.js";import{UsageMeterLinear as v}from"./UsageMeter-BSE4ARBX.js";import{T as _}from"./triangle-alert-BK8FE-JQ.js";import{G as m}from"./gift-NL8borA5.js";import{C as c}from"./clock-S4veKETV.js";import{C as T}from"./calendar-C29LjzGM.js";import{S as k}from"./sparkles-q545gPDu.js";import{A as D}from"./arrow-right-CidMgkmZ.js";import"./createLucideIcon-A60rVhkV.js";function L({credits:t,mode:p="trial",totalCredits:i=3,trialDays:b=7,className:h}){const r=N(),d=p==="trial",o=l=>new Date(l).toLocaleDateString("en-US",{year:r?void 0:"numeric",month:r?"short":"long",day:"numeric"}),x=l=>{const g=new Date(l),u=new Date,w=g.getTime()-u.getTime(),j=Math.ceil(w/(1e3*60*60*24));return Math.max(0,j)},y=Math.max(0,i-t.available),a=d&&t.trial_ends_at&&x(t.trial_ends_at)===0,n=t.trial_ends_at?x(t.trial_ends_at):b;return e.jsxs("div",{className:s("overflow-hidden rounded-md bg-bg-card/60 neo-card",h),children:[e.jsxs("div",{className:r?"p-0":"p-2 sm:p-4",children:[e.jsxs("div",{className:s("flex justify-between items-start",r?"mb-3 gap-2":"mb-6"),children:[e.jsxs("div",{className:s("flex items-center min-w-0",r?"gap-2":"gap-3"),children:[e.jsx("div",{className:s("flex justify-center items-center rounded-md border shrink-0",r?"w-9 h-9":"w-12 h-12",a?"border-red-500/40 bg-red-500/20":"border-purple/40 bg-purple/20"),children:a?e.jsx(_,{className:s("text-red-400",r?"w-4 h-4":"w-6 h-6")}):e.jsx(m,{className:s("text-purple-light",r?"w-4 h-4":"w-6 h-6")})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:s("font-semibold text-text-primary",r?"text-base":"text-lg"),children:d?"Free Trial":"Free Plan"}),e.jsx("p",{className:s("text-text-secondary",r?"text-xs":"text-sm"),children:d?`${i} one-time trial credits`:`${i} reel credits/month`})]})]}),e.jsx("span",{className:s("inline-flex gap-1 items-center font-semibold uppercase rounded-md border shrink-0",r?"px-2 py-0.5 text-[10px]":"px-3 py-1 text-xs",a?"text-red-400 bg-red-500/20 border-red-500/40":"text-purple-light bg-purple/20 border-purple/40"),children:a?"Expired":"Active"})]}),e.jsx("div",{className:r?"mb-3":"mb-6",children:e.jsx(v,{used:y,total:i,label:d?"Trial Credits":"Monthly Reel Credits",size:r?"sm":"md"})}),e.jsx("div",{className:s(r?"mb-3 space-y-2":"mb-6 space-y-3"),children:d?e.jsxs(e.Fragment,{children:[t.trial_ends_at&&e.jsxs("div",{className:s("flex gap-2 items-center rounded-md border",r?"px-2.5 py-1.5 text-xs":"px-3 py-2 text-sm",a?"bg-red-500/10 border-red-500/30":n<=2?"bg-yellow-500/10 border-yellow-500/30":"bg-bg-secondary/70 border-border-color-subtle"),children:[e.jsx(c,{className:s("shrink-0",r?"w-3.5 h-3.5":"w-4 h-4",a?"text-red-400":n<=2?"text-yellow-400":"text-text-secondary")}),e.jsx("span",{className:s(a?"text-red-400":n<=2?"text-yellow-400":"text-text-secondary"),children:a?"Trial expired":`${n} day${n!==1?"s":""} remaining (expires ${o(t.trial_ends_at)})`})]}),e.jsxs("div",{className:s("flex gap-2 items-center rounded-md border bg-bg-secondary/70 border-border-color-subtle",r?"px-2.5 py-1.5 text-xs":"px-3 py-2 text-sm"),children:[e.jsx(m,{className:s("text-text-secondary shrink-0",r?"w-3.5 h-3.5":"w-4 h-4")}),e.jsx("span",{className:"text-text-secondary",children:"One-time trial credits (do not renew)"})]})]}):e.jsxs(e.Fragment,{children:[t.reset_date&&e.jsxs("div",{className:s("flex gap-2 items-center rounded-md border bg-bg-secondary/70 border-border-color-subtle",r?"px-2.5 py-1.5 text-xs":"px-3 py-2 text-sm"),children:[e.jsx(c,{className:s("text-text-secondary shrink-0",r?"w-3.5 h-3.5":"w-4 h-4")}),e.jsxs("span",{className:"text-text-secondary",children:["Credits renew on ",o(t.reset_date)]})]}),e.jsxs("div",{className:s("flex gap-2 items-center rounded-md border bg-bg-secondary/70 border-border-color-subtle",r?"px-2.5 py-1.5 text-xs":"px-3 py-2 text-sm"),children:[e.jsx(T,{className:s("text-text-secondary shrink-0",r?"w-3.5 h-3.5":"w-4 h-4")}),e.jsx("span",{className:"text-text-secondary",children:"Unused credits expire at renewal"})]})]})}),e.jsxs(f,{href:"/billing/pricing",className:s("inline-flex gap-2 items-center font-medium text-white rounded-md border border-primary/40 bg-primary/80 hover:bg-primary shadow-glow",r?"w-full justify-center px-3 py-2 text-xs":"px-4 py-2 text-sm"),children:[e.jsx(k,{className:r?"w-3.5 h-3.5":"w-4 h-4"}),a?"Get Started":"Upgrade",e.jsx(D,{className:r?"w-3.5 h-3.5":"w-4 h-4"})]})]}),e.jsx("div",{className:s("border-t border-border-color-subtle bg-bg-secondary/50",r?"px-3 py-2":"px-6 py-3"),children:e.jsx("p",{className:s("text-text-secondary",r?"text-xs":"text-sm"),children:d?"Upgrade to unlock unlimited access - your credits never expire with a paid plan.":"Upgrade to a paid plan for more monthly credits, and your credits never expire."})})]})}export{L as FreePlanCard,L 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.