PageSourceSearch

https://marketgenius.ai/build/assets/Billing-r7zb30ap.js

js marketgenius.ai collected 2026-10-05 12:22:32 UTC 11,637 bytes, 1 lines download raw bytes

1import{_ as y}from"./index-Cm2NyWRD.js";import{a as M}from"./app-Kw809Gnz.js";import{E as R,B as A,D as E,R as U,_ as Y,a as I,f as O}from"./SimpleLayout-Cawc_YTH.js";import{R as j}from"./receipt-CefvzpWQ.js";import{d as P,e as u,j as s,k as t,l as e,u as h,D as m,v as i,z as b,A as c,B as f,t as o,F as w,q as T,n as V,E as q}from"./runtime-dom.esm-bundler-DdBXkmLx.js";import{T as H}from"./triangle-alert-jQlXUFfP.js";import{S as G}from"./settings-DGvde607.js";import{C as J}from"./Container-C9Q3-_T1.js";import{C as K}from"./circle-check-C31-ljJq.js";import"./utils-D1uChyec.js";import"./ToolGraphVisualization.vue_vue_type_style_index_0_lang-ClVE3yK1.js";import"./VisuallyHidden-BqGpkTS3.js";import"./useForwardExpose-CqAqrUBb.js";import"./DropdownMenuTrigger.vue_vue_type_script_setup_true_lang-E7BsqTlt.js";import"./createLucideIcon-C6d8F1K4.js";import"./check-waiDKcie.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./loader-circle-CubqeW6I.js";import"./toolCategoryColors-BdnRQr9E.js";import"./link-2-CZt34V5h.js";import"./Textarea.vue_vue_type_script_setup_true_lang-DJL5xaFY.js";import"./useFormControl-D2E9wW6S.js";import"./chevron-down-Bc7nFUE_.js";import"./externalUrl-DcNfzGbQ.js";import"./eye-vyr2_g1a.js";import"./Input.vue_vue_type_script_setup_true_lang-CNsVW-Ru.js";import"./search-B8BLICxJ.js";import"./ToolsPanelContent-CE009UE5.js";import"./Label.vue_vue_type_script_setup_true_lang-Duzp_pGH.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Header.vue_vue_type_script_setup_true_lang-DEL32BSr.js";import"./index-CMWG4mbA.js";import"./arrow-left-zG43F0pz.js";import"./VisuallyHiddenInput-C8E-VJ-X.js";import"./globe-DSt3Y141.js";const Q={class:"rounded-xl border border-border bg-card shadow-sm"},W={class:"flex items-center justify-between px-6 py-5 sm:px-8"},X={class:"px-6 pb-6 sm:px-8"},Z={key:0,class:"mb-4 rounded-xl border border-border bg-background/60 p-4"},ee={class:"mb-2 flex items-center gap-2 text-sm text-muted-foreground"},te={class:"text-base font-semibold text-foreground"},se={key:0,class:"mt-1 text-sm text-muted-foreground"},re={key:1,class:"space-y-2.5"},oe={class:"flex items-center gap-3"},ie={class:"flex size-10 items-center justify-center rounded-lg bg-secondary"},ne={class:"flex items-center gap-2 text-sm font-medium text-foreground"},le={class:"text-xs text-muted-foreground"},ae={class:"flex items-center gap-3"},de={class:"font-semibold text-foreground"},ue={class:"flex gap-1"},ce={key:2,class:"rounded-xl border border-dashed border-border bg-background/40 p-8 text-center"},me=P({__name:"BillingHistory",props:{invoices:{}},setup($){const p=$,g=M(),n=u(()=>g.props.auth?.user),_=u(()=>p.invoices&&p.invoices.length>0),k=u(()=>n.value?.billing_company_name||n.value?.billing_tax_id);function z(){window.location.href="/billing/portal"}function S(v){return{paid:{text:"Paid",class:"border-border bg-secondary text-foreground"},open:{text:"Open",class:"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400"},draft:{text:"Draft",class:"border-border bg-muted text-muted-foreground"},uncollectible:{text:"Uncollectible",class:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400"},void:{text:"Void",class:"border-border bg-muted text-muted-foreground"}}[v]||{text:v,class:"border-border bg-muted text-muted-foreground"}}return(v,l)=>(t(),s("section",Q,[e("div",W,[l[1]||(l[1]=e("h2",{class:"text-lg font-semibold text-foreground"}," Billing history ",-1)),_.value?(t(),h(i(y),{key:0,variant:"outline",size:"sm",onClick:z},{default:b(()=>[c(i(R),{class:"mr-2 size-4"}),l[0]||(l[0]=f(" View all ",-1))]),_:1,__:[0]})):m("",!0)]),e("div",X,[k.value?(t(),s("div",Z,[e("div",ee,[c(i(A),{class:"size-4"}),l[2]||(l[2]=e("span",null,"Billing company",-1))]),e("div",te,o(n.value?.billing_company_name),1),n.value?.billing_tax_id?(t(),s("div",se," Tax ID: "+o(n.value?.billing_tax_id),1)):m("",!0)])):m("",!0),_.value?(t(),s("div",re,[(t(!0),s(w,null,T(v.invoices,a=>(t(),s("div",{key:a.id,class:"flex items-center justify-between rounded-xl border border-border bg-background/60 p-4 transition-colors hover:border-foreground
1/20"},[e("div",oe,[e("div",ie,[c(i(j),{class:"size-5 text-muted-foreground"})]),e("div",null,[e("div",ne,[f(o(a.date)+" ",1),e("span",{class:V(["inline-flex items-center rounded-full border px-2 py-0.5 text-[11px] font-medium",S(a.status).class])},o(S(a.status).text),3)]),e("div",le," Invoice #"+o(a.id.slice(-8)),1)])]),e("div",ae,[e("div",de,o(a.total),1),e("div",ue,[a.invoice_pdf?(t(),h(i(y),{key:0,variant:"ghost",size:"icon",class:"size-8",as:"a",href:a.invoice_pdf,target:"_blank"},{default:b(()=>[c(i(E),{class:"size-4"})]),_:2},1032,["href"])):m("",!0),a.hosted_invoice_url?(t(),h(i(y),{key:1,variant:"ghost",size:"icon",class:"size-8",as:"a",href:a.hosted_invoice_url,target:"_blank"},{default:b(()=>[c(i(R),{class:"size-4"})]),_:2},1032,["href"])):m("",!0)])])]))),128))])):(t(),s("div",ce,[c(i(j),{class:"mx-auto size-10 text-muted-foreground"}),l[3]||(l[3]=e("p",{class:"mt-3 text-sm font-medium text-foreground"}," No invoices yet ",-1)),l[4]||(l[4]=e("p",{class:"mt-1 text-xs text-muted-foreground"}," Your billing history appears here once you have an active subscription. ",-1))]))])]))}}),pe={class:"rounded-xl border border-border bg-card shadow-sm"},fe={class:"flex flex-col gap-4 px-6 py-5 sm:flex-row sm:items-center sm:justify-between"},be={class:"flex flex-wrap items-center gap-2"},xe={class:"text-xl font-semibold text-foreground"},ge={key:0,class:"mt-1 text-sm text-muted-foreground"},_e={class:"text-left sm:text-right"},ve={class:"text-2xl font-semibold text-foreground"},he={key:0,class:"text-sm font-normal text-muted-foreground"},ye={key:0,class:"text-xs text-muted-foreground"},ke={key:0,class:"flex flex-col gap-3 border-t border-border bg-muted/40 px-6 py-4 sm:flex-row sm:items-center sm:justify-between"},we={class:"flex items-start gap-2.5"},$e={class:"text-sm"},Se={class:"font-medium text-foreground"},ze={class:"border-t border-border px-6 py-5"},Be={class:"mb-3 flex items-center justify-between"},Ce={key:0,class:"text-xs text-muted-foreground"},Pe={key:0,class:"rounded-lg border border-border bg-muted/40 px-4 py-3 text-sm text-foreground"},De={key:1,class:"grid gap-3 sm:grid-cols-3"},Ne={class:"text-xs text-muted-foreground"},Re={class:"mt-0.5 flex items-baseline gap-1"},je={class:"text-lg font-semibold text-foreground"},Me={key:0,class:"text-xs text-muted-foreground"},Te={key:0,class:"mt-2 h-1 overflow-hidden rounded-full bg-secondary"},Ve={class:"mt-1.5 text-[11px] text-muted-foreground"},Fe={class:"flex flex-col gap-3 border-t border-border px-6 py-4 sm:flex-row sm:items-center sm:justify-between"},Le={class:"text-xs text-muted-foreground"},Ae=P({__name:"SubscriptionOverview",props:{subscriptionPlan:{},stripeSubscription:{}},setup($){const p=$,g=M(),n=u(()=>g.props.credits),_=u(()=>!!p.stripeSubscription?.cancelled),k=u(()=>!!p.stripeSubscription?.active&&!_.value),z=u(()=>p.subscriptionPlan?.slug==="trial"),S=u(()=>!!p.stripeSubscription),v=u(()=>{const r=Number(p.subscriptionPlan?.monthly_price??0);return r>0?`$${r}`:"Free"}),l=u(()=>p.stripeSubscription?.ends_at??p.stripeSubscription?.current_period_end??null),a=u(()=>p.stripeSubscription?.current_period_end??null),B=u(()=>_.value?{text:"Canceling",cls:"border-border bg-secondary text-foreground"}:k.value?{text:"Active",cls:"border-border bg-secondary text-foreground"}:z.value?{text:"Free plan",cls:"border-border bg-secondary text-muted-foreground"}:null),F=u(()=>{const r=n.value;if(!r)return[];const d=[];return r.daily?.limit!=null&&d.push({key:"daily",label:"Daily",remaining:r.daily.remaining??0,limit:r.daily.limit,pct:r.daily.percentage??0,sub:"Refreshes daily"}),r.monthly?.limit!=null&&d.push({key:"monthly",label:"Monthly",remaining:r.monthly.remaining??0,limit:r.monthly.limit,pct:r.monthly.percentage??0,sub:"Refreshes monthly"}),d.push({key:"reserve",label:"Reserve",remaining:r.reserve??0,limit:null,pct:100,sub:"Never expires"}),d}),D=u(()=>!!n.value?.is_unlimited);function C(r){return Number(r||0).toLocaleString(void 0,{maximumFractionDigits:0})}function N(){window.location.href="/billing/portal"}function L(){N()}return(r,d)=>(t(),s("section",pe,[e("div",fe,[e("div",null,[e("div",be,[e("h2",xe,o(r.subscriptionPlan?.display_name||"No plan"),1),B.value?(t(),s("span",{key:0,class:V(["inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium",B.value.cls])},o(B.value.text),3)):m("",!0)]),r.subscriptionPlan?.description?(t(),s("p",ge,o(r.subscriptionPlan.description),1)):m("",!0)]),e("div",_e,[e("div",ve,[f(o(v.value),1),v.value!=="Free"?(t(),s("span",he,"/mo")):m("",!0)]),k.value&&a.value?(t(),s("div",ye," Renews "+o(a.value),1)):m("",!0)])]),_.value?(t(),s("div",ke,[e("div",we,[c(i(H),{class:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),e("div",$e,[e("p",Se," Plan ends "+o(l.value||"at the end of the peri
1od"),1),d[0]||(d[0]=e("p",{class:"mt-0.5 text-muted-foreground"}," You keep access until then, then revert to the free Trial plan. Purchased credit packs are kept. ",-1))])]),c(i(y),{variant:"outline",size:"sm",class:"shrink-0",onClick:L},{default:b(()=>[c(i(U),{class:"mr-2 size-4"}),d[1]||(d[1]=f(" Resume ",-1))]),_:1,__:[1]})])):m("",!0),e("div",ze,[e("div",Be,[d[2]||(d[2]=e("h3",{class:"text-sm font-medium text-foreground"},"Credits",-1)),n.value?.total!=null&&!D.value?(t(),s("span",Ce,o(C(n.value.total))+" total ",1)):m("",!0)]),D.value?(t(),s("div",Pe," Unlimited credits on your plan ")):(t(),s("div",De,[(t(!0),s(w,null,T(F.value,x=>(t(),s("div",{key:x.key,class:"rounded-lg border border-border p-3"},[e("div",Ne,o(x.label),1),e("div",Re,[e("span",je,o(C(x.remaining)),1),x.limit!=null?(t(),s("span",Me," / "+o(C(x.limit)),1)):m("",!0)]),x.limit!=null?(t(),s("div",Te,[e("div",{class:"h-full rounded-full bg-foreground/40",style:q({width:`${Math.min(100,Math.max(0,x.pct))}%`})},null,4)])):m("",!0),e("div",Ve,o(x.sub),1)]))),128))]))]),e("div",Fe,[e("p",Le,[_.value&&l.value?(t(),s(w,{key:0},[f(" Access ends "+o(l.value),1)],64)):k.value&&a.value?(t(),s(w,{key:1},[f(" Next billing date: "+o(a.value),1)],64)):(t(),s(w,{key:2},[f(" You're on the free Trial plan. ")],64))]),S.value?(t(),h(i(y),{key:0,variant:"outline",size:"sm",onClick:N},{default:b(()=>[c(i(G),{class:"mr-2 size-4"}),d[3]||(d[3]=f(" Manage subscription ",-1))]),_:1,__:[3]})):(t(),h(i(y),{key:1,variant:"outline",size:"sm",as:"a",href:"/pricing"},{default:b(()=>d[4]||(d[4]=[f(" View plans ",-1)])),_:1,__:[4]}))])]))}}),Ee={class:"mx-auto max-w-7xl"},Ue={class:"space-y-8"},wt=P({__name:"Billing",props:{subscriptionPlan:{},stripeSubscription:{},invoices:{}},setup($){const p=u(()=>typeof window<"u"?new URLSearchParams(window.location.search).get("checkout")==="success":!1);return(g,n)=>(t(),h(O,{title:"Billing"},{default:b(()=>[c(J,{class:"!py-8"},{default:b(()=>[e("div",Ee,[n[1]||(n[1]=e("div",{class:"mb-8"},[e("h1",{class:"text-3xl font-bold tracking-tight text-foreground sm:text-4xl"}," Subscription & billing "),e("p",{class:"mt-2 text-muted-foreground"}," Manage your plan, credits, and payment history. ")],-1)),p.value?(t(),h(i(Y),{key:0,class:"mb-8"},{default:b(()=>[c(i(K),{class:"size-4"}),c(i(I),null,{default:b(()=>n[0]||(n[0]=[f(" Payment received — thank you! Your credits and plan update within a few moments of Stripe confirming the payment. ",-1)])),_:1,__:[0]})]),_:1})):m("",!0),e("div",Ue,[c(Ae,{"subscription-plan":g.subscriptionPlan,"stripe-subscription":g.stripeSubscription},null,8,["subscription-plan","stripe-subscription"]),c(me,{invoices:g.invoices},null,8,["invoices"])])])]),_:1})]),_:1}))}});export{wt 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.