1import{u as yt}from"./Cj6o8gj4.js";import{c as u,b as c,p as H,f as _t,w as ht,_ as $t}from"./DkM5t5Al.js";import{a as Wt,_ as Nt}from"./C78pv67k.js";import{a as At}from"./C9r8xDPA.js";import{_ as ot}from"./B_Iff1jV.js";import{i as ft}from"./CPqSGeo9.js";import{d as ut,l as f,o as a,n as t,p as e,f as A,e as r,q as l,t as j,k as n,b as m,c as x,F as I,r as et,N as F,z as V,v as Ct,i as Et,E as Ut,w as wt,R as Lt,L as Mt,g as Rt,a as Ft}from"./BwFcdny1.js";import{u as Vt}from"./DpQA9i2M.js";import{b as Gt,c as Ht,s as Ot,a as Xt}from"./D3cGkkY6.js";import{_ as Kt}from"./DRrCSYY7.js";import{g as Qt,a as Bt,b as Zt,c as Dt,f as rt,p as Yt,d as Jt,e as vt,h as qt,i as te,u as Pt,j as ee,k as re,l as ae,n as ie,m as se,P as le,o as oe,q as ne,r as de,s as ce,t as ue,v as xe}from"./BV0UtNp_.js";import{_ as J}from"./Co0RJrH2.js";import{p as B}from"./BVuKbnQT.js";import{_ as ye}from"./B9r26MeX.js";import{C as pe}from"./oy1H6nv7.js";import{u as ge}from"./B7pd4IGW.js";import{c as me}from"./B8XbsPnU.js";import{r as ve}from"./Bho7VZP4.js";import"./Dey--rAa.js";import"./D329u65N.js";import"./U-OB8jVM.js";import"./DDhhv6tw.js";import"./CRCPLy0X.js";import"./D7UWLHqT.js";const Ce=ut({__name:"CreditUsageHeaderActions",props:{periodLabel:{},isTrialing:{type:Boolean}},emits:["manageSubscription","purchaseCredits"],setup(v,{emit:y}){const i=y;return(D,k)=>(a(),f(t(u),{orientation:"horizontal",gap:"3",align:"center",justify:"end"},{default:e(()=>[v.periodLabel?(a(),f(t(c),{key:0,variant:"caption",color:"secondary"},{default:e(()=>[l(j(v.periodLabel),1)]),_:1})):A("",!0),r(t(ot),{variant:"secondary",size:"md",onClick:k[0]||(k[0]=W=>i("manageSubscription"))},{default:e(()=>[...k[2]||(k[2]=[l(" Manage my subscription ",-1)])]),_:1}),v.isTrialing?A("",!0):(a(),f(t(ot),{key:1,variant:"primary",size:"md","data-testid":"purchase-credits",onClick:k[1]||(k[1]=W=>i("purchaseCredits"))},{default:e(()=>[...k[3]||(k[3]=[l(" Purchase credits ",-1)])]),_:1}))]),_:1}))}}),It=Object.assign(Ce,{__name:"BillingCreditUsageHeaderActions"});var Z=ft;Z({ltr:".x1jcbksy{max-height:420px}",priority:4e3});Z({ltr:".xe8uvvx{list-style:none}",priority:2e3});Z({ltr:".x1ghz6dp{margin:0}",priority:1e3});Z({ltr:".x1717udv{padding:0}",priority:1e3});Z({ltr:".x78zum5{display:flex}",priority:3e3});Z({ltr:".x6s0dn4{align-items:center}",priority:3e3});Z({ltr:".x1qughib{justify-content:space-between}",priority:3e3});Z({ltr:".x1cupfz0{gap:var(--x1x8qh71)}",priority:2e3});Z({ltr:".x1h4g5ls{padding-block:var(--x1x8qh71)}",priority:2e3});Z({ltr:".xdoxh13{padding-inline:var(--x1fqdx39)}",priority:2e3});Z({ltr:".xso031l{border-bottom-width:1px}",priority:4e3});Z({ltr:".x1t1lzn6:last-child{border-bottom-width:0}",priority:4054});Z({ltr:".x1q0q8m5{border-bottom-style:solid}",priority:4e3});Z({ltr:".xe6y43f{border-bottom-color:var(--x1k34xyn)}",priority:4e3});const St={scroller:{"CreditHistoryCard__styles.scroller":"CreditHistoryCard__styles.scroller","maxHeight-kskxy":"x1jcbksy",$$css:"nuxt-app:components/Billing/CreditUsage/CreditHistoryCard.stylex.ts:4"},list:{"CreditHistoryCard__styles.list":"CreditHistoryCard__styles.list","listStyle-kB88ic":"xe8uvvx","margin-kogj98":"x1ghz6dp","padding-kmVPX3":"x1717udv",$$css:"nuxt-app:components/Billing/CreditUsage/CreditHistoryCard.stylex.ts:8"},row:{"CreditHistoryCard__styles.row":"CreditHistoryCard__styles.row","display-k1xSpc":"x78zum5","alignItems-kGNEyG":"x6s0dn4","justifyContent-kjj79g":"x1qughib","gap-kOIVth":"x1cupfz0","paddingBlock-k8WAf4":"x1h4g5ls","paddingInline-kg3NbH":"xdoxh13","borderBottomWidth-kt9PQ7":"xso031l x1t1lzn6","borderBottomStyle-kfdmCh":"x1q0q8m5","borderBottomColor-kL6WhQ":"xe6y43f",$$css:"nuxt-app:components/Billing/CreditUsage/CreditHistoryCard.stylex.ts:14"}};var o=ft;o({ltr:".xxhr3t{gap:0}",priority:2e3});o({ltr:".xogrr9c{grid-template-rows:auto 1fr}",priority:3e3});o({ltr:".xso031l{border-bottom-width:1px}",priority:4e3});o({ltr:".x1q0q8m5{border-bottom-style:solid}",priority:4e3});o({ltr:".xe6y43f{border-bottom-color:var(--x1k34xyn)}",priority:4e3});o({ltr:".x68611x{padding-top:var(--x1elr863)}",priority:4e3});o({ltr:".x1xjv24x{padding-bottom:var(--x1x8qh71)}",priority:4e3});o({ltr:".xdoxh13{padding-inline:var(--x1fqdx39)}",priority:2e3});o({ltr:".x1qughib{justify-content:space-between}",priority:3e3});o({ltr:".x1ngm8q8{padding-block:var(--xh03zyl)}",priority:2e3});o({ltr:".x1n2onr6{position:relative}",priority:3e3});o({ltr:".x9f619{box-sizing:border-box}",priority:3e3});o({ltr:".xbfejnn{height:var(--x1x8qh71)}",priority:4e3});o({ltr:".xh8yej3{width:100%}",priority:4e3});o({ltr:".xb3r6kr{overflow:hidden}",priority:2e3});o({ltr:".xmkeg23{border-width:1px}",priority:2e3});o({ltr:".x1y0btm7{border-style:solid}",priority:2e3});o({ltr:".xccauxo{border-color:var(--x19jfav4)}",priority:2e3});o({ltr:".xx2mnjq{border-radius:var(--x15uwqle)}",priority:2e3});o({ltr:".x19o8vv1{background-color:var(--xin28mz)}",priority:3e3});o({ltr:".xp8buda{background-image:repeating-linear-gradient(45deg,var(--x1uj2wdx) 0 3px,var(--xr701mc) 3px 7px)}",priority:3e3});o({ltr:".x10l6tqk{position:absolute}",priority:3e3});o({ltr:".x10no89f{inset-block:0}",priority:2e3});o({ltr:".x1o0tod{inset-inline-start:0}",priority:3e3});o({ltr:".x1d8dygf{min-width:var(--x1x8qh71)}",priority:4e3});o({ltr:".x2v8yto{background-color:var(--xnyf1fh)}",priority:3e3});o({ltr:".x1lun4ml{border-inline-end-width:1px}",priority:3e3});o({ltr:".x18b5jzi{border-inline-end-style:solid}",priority:3e3});o({ltr:".x1tdqf06{border-inline-end-color:var(--x19jfav4)}",priority:3e3});o({ltr:".xqxyecd{background-image:repeating-linear-gradient(45deg,var(--xnyf1fh) 0 3px,var(--x1xnd8xy) 3px 7px)}",priority:3e3});o({ltr:".xbwggb3{width:var(--x1x8qh71)}",priority:4e3});o({ltr:".x2lah0s{flex-shrink:0}",priority:3e3});o({ltr:".xpub7c2{border-radius:var(--x1qu9smg)}",priority:2e3});o({ltr:".x17w5zt6{border-color:var(--x1nlgq8k)}",priority:2e3});o({ltr:".x1qh4g0a{background-image:repeating-linear-gradient(45deg,var(--x1uj2wdx) 0 2px,var(--xr701mc) 2px 4px)}",priority:3e3});o({ltr:".x10gg58h{background-color:var(--xr701mc)}",priority:3e3});o({ltr:".x16fab64{border-color:var(--x1uj2wdx)}",priority:2e3});o({ltr:".xox8py9{background-color:var(--x6g3v3u)}",priority:3e3});o({ltr:".xamitd3{align-self:center}",priority:3e3});o({ltr:".x1iyjqo2{flex-grow:1}",priority:3e3});o({ltr:".x1np7mr0{color:var(--xstrnro)}",priority:3e3});o({ltr:".x78zum5{display:flex}",priority:3e3});const C={card:{"CreditStatusCard__styles.card":"CreditStatusCard__styles.card","gap-kOIVth":"xxhr3t","gridTemplateRows-k9llMU":"xogrr9c",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:7"},header:{"CreditStatusCard__styles.header":"CreditStatusCard__styles.header","borderBottomWidth-kt9PQ7":"xso031l","borderBottomStyle-kfdmCh":"x1q0q8m5","borderBottomColor-kL6WhQ":"xe6y43f","paddingTop-kLKAdn":"x68611x","paddingBottom-kGO01o":"x1xjv24x","paddingInline-kg3NbH":"xdoxh13",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:13"},body:{"CreditStatusCard__styles.body":"CreditStatusCard__styles.body","justifyContent-kjj79g":"x1qughib",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:22"},barWrap:{"CreditStatusCard__styles.barWrap":"CreditStatusCard__styles.barWrap","paddingBlock-k8WAf4":"x1ngm8q8",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:28"},bar:{"CreditStatusCard__styles.bar":"CreditStatusCard__styles.bar","position-kVAEAm":"x1n2onr6","boxSizing-kB7OPa":"x9f619","height-kZKoxP":"xbfejnn","width-kzqmXN":"xh8yej3","overflow-kVQacm":"xb3r6kr","borderWidth-kMzoRj":"xmkeg23","borderStyle-ksu8eU":"x1y0btm7","borderColor-kVAM5u":"xccauxo","borderRadius-kaIpWk":"xx2mnjq","backgroundColor-kWkggS":"x19o8vv1",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:31"},barOverflow:{"CreditStatusCard__styles.barOverflow":"CreditStatusCard__styles.barOverflow","backgroundImage-kKwaWg":"xp8buda",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:43"},barFill:{"CreditStatusCard__styles.barFill":"CreditStatusCard__styles.barFill","position-kVAEAm":"x10l6tqk","insetBlock-kYYq5F":"x10no89f","insetInlineStart-kLqNvP":"x1o0tod","minWidth-k7Eaqz":"x1d8dygf","boxSizing-kB7OPa":"x9f619","backgroundColor-kWkggS":"x2v8yto","borderInlineEndWidth-ke9TFa":"x1lun4ml","borderInlineEndStyle-k8ry5P":"x18b5jzi","borderInlineEndColor-kBCPoo":"x1tdqf06",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:46"},barProjected:{"CreditStatusCard__styles.barProjected":"CreditStatusCard__styles.barProjected","position-kVAEAm":"x10l6tqk","insetBlock-kYYq5F":"x10no89f","boxSizing-kB7OPa":"x9f619","backgroundImage-kKwaWg":"xqxyecd","borderInlineEndWidth-ke9TFa":"x1lun4ml","borderInlineEndStyle-k8ry5P":"x18b5jzi","borderInlineEndColor-kBCPoo":"x1tdqf06",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:58"},swatch:{"CreditStatusCard__styles.swatch":"CreditStatusCard__styles.swatch","width-kzqmXN":"xbwggb3","height-kZKoxP":"xbfejnn","flexShrink-kmuXW":"x2lah0s","borderRadius-kaIpWk":"xpub7c2","borderWidth-kMzoRj":"xmkeg23","borderStyle-ksu8eU":"x1y0btm7","borderColor-kVAM5u":"x17w5zt6",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:68"},swatchBalance:{"CreditStatusCard__styles.swatchBalance":"CreditStatusCard__styles.swatchBalance","backgroundColor-kWkggS":"x2v8yto",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:77"},swatchOverage:{"CreditStatusCard__styles.swatchOverage":"CreditStatusCard__styles.swatchOverage","backgroundImage-kKwaWg":"x1qh4g0a",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:80"},callout:{"CreditStatusCard__styles.callout":"CreditStatusCard__styles.callout","backgroundColor-kWkggS":"x10gg58h","borderWidth-kMzoRj":"xmkeg23","borderStyle-ksu8eU":"x1y0btm7","borderColor-kVAM5u":"x16fab64",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:84"},calloutInfo:{"CreditStatusCard__styles.calloutInfo":"CreditStatusCard__styles.calloutInfo","backgroundColor-kWkggS":"xox8py9","borderWidth-kMzoRj":"xmkeg23","borderStyle-ksu8eU":"x1y0btm7","borderColor-kVAM5u":"xccauxo",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:91"},calloutActions:{"CreditStatusCard__styles.calloutActions":"CreditStatusCard__styles.calloutActions","flexShrink-kmuXW":"x2lah0s","alignSelf-kSGwAc":"xamitd3",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:97"},calloutButton:{"CreditStatusCard__styles.calloutButton":"CreditStatusCard__styles.calloutButton","flexShrink-kmuXW":"x2lah0s","alignSelf-kSGwAc":"xamitd3",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:101"},calloutText:{"CreditStatusCard__styles.calloutText":"CreditStatusCard__styles.calloutText","flexGrow-kzQI83":"x1iyjqo2",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:105"},statusIcon:{"CreditStatusCard__styles.statusIcon":"CreditStatusCard__styles.statusIcon","color-kMwMTN":"x1np7mr0","display-k1xSpc":"x78zum5",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:108"}},fe={"CreditStatusCard__barGeometry.fillWidth":"CreditStatusCard__barGeometry.fillWidth","width-kzqmXN":"x5lhr3w",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:114"},ke={"CreditStatusCard__barGeometry.segment":"CreditStatusCard__barGeometry.segment","insetInlineStart-kLqNvP":"x1lxsm33","
1width-kzqmXN":"x5lhr3w",$$css:"nuxt-app:components/Billing/CreditUsage/CreditStatusCard.stylex.ts:115"};o({ltr:".x5lhr3w{width:var(--x-width)}",priority:4e3});o({ltr:".x1lxsm33{inset-inline-start:var(--x-insetInlineStart)}",priority:3e3});o({ltr:'@property --x-width { syntax: "*"; inherits: false;}',priority:0});o({ltr:'@property --x-insetInlineStart { syntax: "*"; inherits: false;}',priority:0});const Tt={fillWidth:v=>[fe,{"--x-width":(y=>typeof y=="number"?y+"px":y??void 0)(`${v}%`)}],segment:(v,y)=>[ke,{"--x-insetInlineStart":(i=>typeof i=="number"?i+"px":i??void 0)(`${v}%`),"--x-width":(i=>typeof i=="number"?i+"px":i??void 0)(`${y}%`)}]},be=ut({__name:"CreditHistoryCard",props:{resource:{},now:{}},setup(v){const y=v,{data:i,isLoading:D,isError:k,refetch:W}=yt({queryKey:["credit-grants"],queryFn:()=>y.resource.grants()}),$=n(()=>i.value?Gt(i.value):null),P=n(()=>y.now??new Date),G=H(St.list),T=H(St.row);return(O,g)=>(a(),f(t(_t),{"no-padding":"",xstyle:t(C).card},{default:e(()=>[r(t(ht),{xstyle:t(C).header},{default:e(()=>[r(t(c),{variant:"body",weight:"semibold",color:"primary"},{default:e(()=>[...g[0]||(g[0]=[l("Credit history",-1)])]),_:1})]),_:1},8,["xstyle"]),t(D)?(a(),f(t(u),{key:0,orientation:"vertical",padding:"5",align:"center"},{default:e(()=>[r(t(c),{variant:"body",color:"secondary"},{default:e(()=>[...g[1]||(g[1]=[l("Loading credit historyâ¦",-1)])]),_:1})]),_:1})):t(k)||!$.value?(a(),f(t(u),{key:1,orientation:"vertical",gap:"3",padding:"5",align:"center"},{default:e(()=>[r(t(c),{variant:"body",color:"secondary"},{default:e(()=>[...g[2]||(g[2]=[l(" Credit history is unavailable right now. ",-1)])]),_:1}),r(t(ot),{variant:"secondary",size:"sm",onClick:t(W)},{default:e(()=>[...g[3]||(g[3]=[l("Retry",-1)])]),_:1},8,["onClick"])]),_:1})):$.value.length===0?(a(),f(t(u),{key:2,orientation:"vertical",padding:"5",align:"center"},{default:e(()=>[r(t(c),{variant:"body",color:"secondary"},{default:e(()=>[...g[4]||(g[4]=[l("No credits granted yet",-1)])]),_:1})]),_:1})):(a(),f(t(u),{key:3,orientation:"vertical",scroll:"y",xstyle:t(St).scroller},{default:e(()=>[m("ul",{class:V(t(G).className),style:F(t(G).style),"data-part":"credit-history-list"},[(a(!0),x(I,null,et($.value,b=>(a(),x("li",{key:`${b.grantedAt}-${b.source}-${b.credits}`,class:V(t(T).className),style:F(t(T).style)},[r(t(u),{orientation:"vertical",gap:"0"},{default:e(()=>[r(t(u),{orientation:"horizontal",gap:"2",align:"center"},{default:e(()=>[r(t(c),{variant:"body",weight:"semibold",color:"primary"},{default:e(()=>[l(j(t(Qt)(b)),1)]),_:2},1024),r(t(Kt),{color:t(Bt)(b.status).color,size:"sm"},{default:e(()=>[l(j(t(Bt)(b.status).label),1)]),_:2},1032,["color"])]),_:2},1024),r(t(c),{variant:"caption",color:"secondary"},{default:e(()=>[l(j(t(Zt)(b,P.value)),1)]),_:2},1024)]),_:2},1024),r(t(u),{orientation:"vertical",gap:"0",align:"end"},{default:e(()=>[r(t(c),{variant:"body",weight:"semibold",color:"primary"},{default:e(()=>[l(j(t(Dt)(b).primary),1)]),_:2},1024),r(t(c),{variant:"caption",color:"secondary"},{default:e(()=>[l(j(t(Dt)(b).secondary),1)]),_:2},1024)]),_:2},1024)],6))),128))],6)]),_:1},8,["xstyle"]))]),_:1},8,["xstyle"]))}}),_e=Object.assign(be,{__name:"BillingCreditUsageCreditHistoryCard"}),he=ut({__name:"CreditStatusCard",props:{projection:{},isTrialing:{type:Boolean}},emits:["purchaseCredits"],setup(v,{emit:y}){const i=v,D=y,k={onTrack:"On track",overageProjected:"Overage projected",outOfCredits:"Out of credits"},W=n(()=>k[i.projection.status]),$=n(()=>i.projection.status!=="onTrack"),P=n(()=>Yt(i.projection)),G=n(()=>P.value.overflow>0?[C.bar,C.barOverflow]:C.bar),T=U=>Number((U*100).toFixed(2)),O=n(()=>[C.barFill,Tt.fillWidth(T(P.value.filled))]),g=n(()=>[C.barProjected,Tt.segment(T(P.value.filled),T(P.value.projected))]),b=n(()=>$.value?`Balance covers ${Math.round(P.value.filled*100)}% of projected usage`:`${Math.round(P.value.filled*100)}% of this cycle's credits used, ${Math.round(P.value.projected*100)}% more projected`),Q=n(()=>$.value?{label:"Projected overage",value:i.projection.projectedOverage,testId:"overage-value"}:{label:"Amount remaining",value:Jt(i.projection),testId:"remaining-value"}),tt=n(()=>i.projection.status==="outOfCredits"?"Signals and tracking are paused.":"Signals and tracking will pause when you run out."),Y=n(()=>{const U=`Your next allotment will occur ${vt(i.projection.cycleEnd)}.`;return i.projection.status==="outOfCredits"?`You are out of credits. ${U}`:`${i.projection.runOutDate?`Credits run out around ${vt(i.projection.runOutDate)}. `:""}${U}`}),L=H(C.swatch,C.swatchBalance),N=H(C.swatch,C.swatchOverage),w=H(C.statusIcon);return(U,d)=>(a(),f(t(_t),{"no-padding":"",xstyle:t(C).card},{default:e(()=>[r(t(ht),{xstyle:t(C).header},{default:e(()=>[r(t(c),{variant:"body",weight:"semibold",color:"primary"},{default:e(()=>[...d[3]||(d[3]=[l("Credit status",-1)])]),_:1})]),_:1}
1,8,["xstyle"]),r(t(u),{orientation:"vertical",gap:"5",padding:"5","padding-block":"5",xstyle:t(C).body},{default:e(()=>[r(t(u),{orientation:"vertical",gap:"2"},{default:e(()=>[r(t(u),{orientation:"horizontal",gap:"1",align:"center"},{default:e(()=>[$.value?(a(),x("span",{key:0,class:V(t(w).className),style:F(t(w).style),"aria-hidden":"true"},[r(t($t),{name:"warning",variant:"thin",size:"lg"})],6)):A("",!0),r(t(c),{variant:"heading",color:$.value?"error":"primary"},{default:e(()=>[l(j(W.value),1)]),_:1},8,["color"])]),_:1}),r(t(u),{orientation:"vertical",gap:"3"},{default:e(()=>[r(t(J),{xstyle:t(C).barWrap},{default:e(()=>[r(t(J),{xstyle:G.value,role:"img","aria-label":b.value},{default:e(()=>[P.value.filled>0?(a(),f(t(J),{key:0,xstyle:O.value,"data-testid":"bar-fill"},null,8,["xstyle"])):A("",!0),P.value.projected>0?(a(),f(t(J),{key:1,xstyle:g.value,"data-testid":"bar-projected"},null,8,["xstyle"])):A("",!0)]),_:1},8,["xstyle","aria-label"])]),_:1},8,["xstyle"]),r(t(u),{orientation:"horizontal",gap:"5",align:"end",wrap:!0},{default:e(()=>[r(t(u),{orientation:"vertical",gap:"0"},{default:e(()=>[r(t(c),{variant:"caption"},{default:e(()=>[...d[4]||(d[4]=[l("Current credit balance",-1)])]),_:1}),r(t(u),{orientation:"horizontal",gap:"2",align:"center"},{default:e(()=>[m("span",{class:V(t(L).className),style:F(t(L).style),"aria-hidden":"true"},null,6),r(t(c),{variant:"metricMd","data-testid":"balance-value"},{default:e(()=>[l(j(t(rt)(v.projection.balanceCredits)),1)]),_:1})]),_:1})]),_:1}),r(t(c),{variant:"metric",weight:"regular",color:"secondary","aria-hidden":"true"},{default:e(()=>[...d[5]||(d[5]=[l(" - ",-1)])]),_:1}),r(t(u),{orientation:"vertical",gap:"0"},{default:e(()=>[r(t(c),{variant:"caption"},{default:e(()=>[...d[6]||(d[6]=[l("Projected remaining usage",-1)])]),_:1}),r(t(c),{variant:"metricMd","data-testid":"projected-value"},{default:e(()=>[l(j(t(rt)(v.projection.projectedRemainingUsage)),1)]),_:1})]),_:1}),r(t(c),{variant:"metric",weight:"regular",color:"secondary","aria-hidden":"true"},{default:e(()=>[...d[7]||(d[7]=[l(" = ",-1)])]),_:1}),r(t(u),{orientation:"vertical",gap:"0"},{default:e(()=>[r(t(c),{variant:"caption"},{default:e(()=>[l(j(Q.value.label),1)]),_:1}),r(t(u),{orientation:"horizontal",gap:"2",align:"center"},{default:e(()=>[$.value&&v.projection.projectedOverage>0?(a(),x("span",{key:0,class:V(t(N).className),style:F(t(N).style),"aria-hidden":"true"},null,6)):A("",!0),r(t(c),{variant:"metricMd",color:$.value&&v.projection.projectedOverage>0?"error":"primary","data-testid":Q.value.testId},{default:e(()=>[l(j(t(rt)(Q.value.value)),1)]),_:1},8,["color","data-testid"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),$.value?(a(),f(t(u),{key:0,orientation:"horizontal",gap:"2",align:"center",radius:"sm",padding:"3","padding-block":"2",xstyle:t(C).callout},{default:e(()=>[r(t(u),{orientation:"horizontal",gap:"2",align:"center",xstyle:t(C).calloutText},{default:e(()=>[m("span",{class:V(t(w).className),style:F(t(w).style),"aria-hidden":"true"},[r(t($t),{name:"warning",variant:"thin",size:"md"})],6),r(t(u),{orientation:"vertical"},{default:e(()=>[r(t(c),{variant:"caption",weight:"semibold",color:"error"},{default:e(()=>[l(j(tt.value),1)]),_:1}),r(t(c),{variant:"caption",color:"error"},{default:e(()=>[l(j(Y.value),1)]),_:1})]),_:1})]),_:1},8,["xstyle"]),v.isTrialing?A("",!0):(a(),f(t(ot),{key:0,variant:"secondary",size:"sm",xstyle:t(C).calloutButton,"data-testid":"callout-purchase-credits",onClick:d[0]||(d[0]=at=>D("purchaseCredits"))},{default:e(()=>[...d[8]||(d[8]=[l(" Purchase credits ",-1)])]),_:1},8,["xstyle"]))]),_:1},8,["xstyle"])):(a(),f(t(u),{key:1,orientation:"horizontal",gap:"2",align:"center",radius:"sm",padding:"3","padding-block":"2",xstyle:t(C).calloutInfo,"data-testid":"on-track-callout"},{default:e(()=>[r(t(u),{orientation:"vertical",xstyle:t(C).calloutText},{default:e(()=>[r(t(c),{variant:"caption",weight:"semibold",color:"primary"},{default:e(()=>[...d[9]||(d[9]=[l(" Utilize your remaining credits ",-1)])]),_:1}),r(t(c),{variant:"caption",color:"primary"},{default:e(()=>[...d[10]||(d[10]=[l(" Turn on more signals or accounts to get more visibility. ",-1)])]),_:1})]),_:1},8,["xstyle"]),r(t(u),{orientation:"horizontal",gap:"2",xstyle:t(C).calloutActions},{default:e(()=>[r(t(ot),{variant:"secondary",size:"sm","data-testid":"callout-go-to-accounts",onClick:d[1]||(d[1]=at=>("navigateTo"in U?U.navigateTo:t(Ct))("/accounts"))},{default:e(()=>[...d[11]||(d[11]=[l(" Go to accounts ",-1)])]),_:1}),r(t(ot),{variant:"secondary",size:"sm","data-testid":"callout-go-to-signals",onClick:d[2]||(d[2]=at=>("navigateTo"in U?U.navigateTo:t(Ct))("/signals"))},{default:e(()=>[...d[12]||(d[12]=[l(" Go to signals ",-1)])]),_:1})]),_:1},8,["xstyle"])]),_:1},8,["xstyle"]))]),_:1},8,["xstyle"])]),_:1},8,["xstyle"]))}}
1),we=Object.assign(he,{__name:"BillingCreditUsageCreditStatusCard"});var pt=ft;pt({ltr:".xrvj5dj{display:grid}",priority:3e3});pt({ltr:".xnby9oq{grid-template-columns:repeat(2,minmax(0,1fr))}",priority:3e3});pt({ltr:"@media (max-width: 1100px){.xesxnj2.xesxnj2{grid-template-columns:minmax(0,1fr)}}",priority:3200});pt({ltr:".xbttxv9{gap:var(--x1fqdx39)}",priority:2e3});pt({ltr:".x1qjc9v5{align-items:stretch}",priority:3e3});pt({ltr:".x1ficeh5{min-height:240px}",priority:4e3});const jt={grid:{"CreditUsagePage__styles.grid":"CreditUsagePage__styles.grid","display-k1xSpc":"xrvj5dj","gridTemplateColumns-kumcoG":"xnby9oq xesxnj2","gap-kOIVth":"xbttxv9","alignItems-kGNEyG":"x1qjc9v5",$$css:"nuxt-app:components/Billing/CreditUsage/CreditUsagePage.stylex.ts:5"},centered:{"CreditUsagePage__styles.centered":"CreditUsagePage__styles.centered","minHeight-kAzted":"x1ficeh5",$$css:"nuxt-app:components/Billing/CreditUsage/CreditUsagePage.stylex.ts:14"}};var s=ft;s({ltr:".x78zum5{display:flex}",priority:3e3});s({ltr:".x1q0g3np{flex-direction:row}",priority:3e3});s({ltr:".x1epm3qj{gap:var(--xwia35l)}",priority:2e3});s({ltr:".xwe1c3o{padding:var(--x1fqdx39)}",priority:1e3});s({ltr:".xdt5ytf{flex-direction:column}",priority:3e3});s({ltr:".x6s0dn4{align-items:center}",priority:3e3});s({ltr:".xbttxv9{gap:var(--x1fqdx39)}",priority:2e3});s({ltr:".x2lah0s{flex-shrink:0}",priority:3e3});s({ltr:".xkh2ocl{align-self:stretch}",priority:3e3});s({ltr:".xso031l{border-bottom-width:1px}",priority:4e3});s({ltr:".xpvcztv{border-bottom-style:dashed}",priority:4e3});s({ltr:".xe6y43f{border-bottom-color:var(--x1k34xyn)}",priority:4e3});s({ltr:".x1n2onr6{position:relative}",priority:3e3});s({ltr:".x1f1nzxn{width:176px}",priority:4e3});s({ltr:".xkq7avx{height:176px}",priority:4e3});s({ltr:".xh8yej3{width:100%}",priority:4e3});s({ltr:".x5yr21d{height:100%}",priority:4e3});s({ltr:".x10l6tqk{position:absolute}",priority:3e3});s({ltr:".x10a8y8t{inset:0}",priority:1e3});s({ltr:".xl56j7k{justify-content:center}",priority:3e3});s({ltr:".x17hoizr{gap:var(--xh03zyl)}",priority:2e3});s({ltr:".x2b8uid{text-align:center}",priority:3e3});s({ltr:".x1ln22hn{font-family:var(--x1ez9llr)}",priority:3e3});s({ltr:".x1n50c4w{font-size:var(--x1tcmxv7)}",priority:3e3});s({ltr:".x1dbvd8l{color:var(--xspvmvd)}",priority:3e3});s({ltr:".x1iyjqo2{flex-grow:1}",priority:3e3});s({ltr:".xeuugli{min-width:0}",priority:4e3});s({ltr:".xw2csxc{overflow-x:auto}",priority:4e3});s({ltr:".xrvj5dj{display:grid}",priority:3e3});s({ltr:".x1od5acm{grid-template-columns:minmax(180px,1.4fr) repeat(4,minmax(120px,1fr))}",priority:3e3});s({ltr:".xzl8ltb{min-width:640px}",priority:4e3});s({ltr:".x1xjv24x{padding-bottom:var(--x1x8qh71)}",priority:4e3});s({ltr:".xast0yk{padding-top:calc(var(--x1elr863) + var(--xh03zyl))}",priority:4e3});s({ltr:".xkcbnis{padding-bottom:var(--xh03zyl)}",priority:4e3});s({ltr:".x8ua8ai{padding-block:calc(var(--xh03zyl) / 2)}",priority:2e3});s({ltr:".x1q0q8m5{border-bottom-style:solid}",priority:4e3});s({ltr:".x1g3usdi{border-bottom-color:var(--xd9c8u8)}",priority:4e3});s({ltr:".x1yizgjh{background-color:var(--x1hof7pr)}",priority:3e3});s({ltr:".x1oov92n{padding-inline-start:var(--x1elr863)}",priority:3e3});s({ltr:".xpilrb4{border-inline-start-width:1px}",priority:3e3});s({ltr:".x11nt7xy{border-inline-start-style:dashed}",priority:3e3});s({ltr:".x1muzm16{border-inline-start-color:var(--xd9c8u8)}",priority:3e3});s({ltr:".x11idwlm{letter-spacing:var(--x595k80)}",priority:3e3});s({ltr:".xbwggb3{width:var(--x1x8qh71)}",priority:4e3});s({ltr:".xbfejnn{height:var(--x1x8qh71)}",priority:4e3});s({ltr:".x1cum3z5{border-radius:2px}",priority:2e3});s({ltr:".xmkeg23{border-width:1px}",priority:2e3});s({ltr:".x1y0btm7{border-style:solid}",priority:2e3});s({ltr:".x1ov19n{border-color:var(--xspvmvd)}",priority:2e3});s({ltr:".x1p5mu5g{padding-inline-start:calc(var(--x1x8qh71) + var(--x1maq5wx))}",priority:3e3});const q={body:{"UsageDriversCard__styles.body":"UsageDriversCard__styles.body","display-k1xSpc":"x78zum5","flexDirection-kXwgrk":"x1q0g3np","gap-kOIVth":"x1epm3qj","padding-kmVPX3":"xwe1c3o",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:4"},donutColumn:{"UsageDriversCard__styles.donutColumn":"UsageDriversCard__styles.donutColumn","display-k1xSpc":"x78zum5","flexDirection-kXwgrk":"xdt5ytf","alignItems-kGNEyG":"x6s0dn4","gap-kOIVth":"xbttxv9","flexShrink-kmuXW":"x2lah0s",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:11"},donutDivider:{"UsageDriversCard__styles.donutDivider":"UsageDriversCard__styles.donutDivider","alignSelf-kSGwAc":"xkh2ocl","borderBottomWidth-kt9PQ7":"xso031l","borderBottomStyle-kfdmCh":"xpvcztv","borderBottomColor-kL6WhQ":"xe6y43f",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:18"},donutWrap:{"UsageDriversCard__styles.donutWrap":"UsageDriversCard__styles.donutWrap","position-kVAEAm":"x1n2onr6","width-kzqmXN":"x1f1nzxn","height-kZKoxP":"xkq7avx",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:24"},donutSvg:{"UsageDriversCard__styles.donutSvg":"UsageDriversCard__styles.donutSvg","width-kzqmXN":"xh8yej3","height-kZKoxP":"x5yr21d",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:30"},donutCenter:{"UsageDriversCard__styles.donutCenter":"UsageDriversCard__styles.donutCenter","position-kVAEAm":"x10l6tqk","inset-kpwlN0":"x10a8y8t","display-k1xSpc":"x78zum5","flexDirection-kXwgrk":"xdt5ytf","alignItems-kGNEyG":"x6s0dn4","justifyContent-kjj79g":"xl56j7k","gap-kOIVth":"x17hoizr","textAlign-k9WMMc":"x2b8uid",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:34"},donutValue:{"UsageDriversCard__styles.donutValue":"UsageDriversCard__styles.donutValue","fontFamily-kMv6JI":"x1ln22hn","fontSize-kGuDYH":"x1n50c4w","color-kMwMTN":"x1dbvd8l",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:44"},tableScroller:{"UsageDriversCard__styles.tableScroller":"UsageDriversCard__styles.tableScroller","flexGrow-kzQI83":"x1iyjqo2","minWidth-k7Eaqz":"xeuugli","overflowX-kXHlph":"xw2csxc",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:50"},table:{"UsageDriversCard__styles.table":"UsageDriversCard__styles.table","display-k1xSpc":"xrvj5dj","gridTemplateColumns-kumcoG":"x1od5acm","alignItems-kGNEyG":"x6s0dn4","minWidth-k7Eaqz":"xzl8ltb",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:56"},headerCell:{"UsageDriversCard__styles.headerCell":"UsageDriversCard__styles.headerCell","paddingBottom-kGO01o":"x1xjv24x",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:62"},categoryCell:{"UsageDriversCard__styles.categoryCell":"UsageDriversCard__styles.categoryCell","paddingTop-kLKAdn":"xast0yk","paddingBottom-kGO01o":"xkcbnis",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:66"},cell:{"UsageDriversCard__styles.cell":"UsageDriversCard__styles.cell","paddingBlock-k8WAf4":"x8ua8ai",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:71"},cellRule:{"UsageDriversCard__styles.cellRule":"UsageDriversCard__styles.cellRule","borderBottomWidth-kt9PQ7":"xso031l","borderBottomStyle-kfdmCh":"x1q0q8m5","borderBottomColor-kL6WhQ":"x1g3usdi",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:74"},cellZebra:{"UsageDriversCard__styles.cellZebra":"UsageDriversCard__styles.cellZebra","backgroundColor-kWkggS":"x1yizgjh",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:79"},valueCell:{"UsageDriversCard__styles.valueCell":"UsageDriversCard__styles.valueCell","paddingInlineStart-kZCmMZ":"x1oov92n",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:83"},dividerCell:{"UsageDriversCard__styles.dividerCell":"UsageDriversCard__styles.dividerCell","borderInlineStartWidth-k2ei4v":"xpilrb4","borderInlineStartStyle-kVhnKS":"x11nt7xy","borderInlineStartColor-kGJrpR":"x1muzm16",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:86"},driverText:{"UsageDriversCard__styles.driverText":"UsageDriversCard__styles.driverText","letterSpacing-kb6lSQ":"x11idwlm",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:91"},swatch:{"UsageDriversCard__styles.swatch":"UsageDriversCard__styles.swatch","width-kzqmXN":"xbwggb3","height-kZKoxP":"xbfejnn","borderRadius-kaIpWk":"x1cum3z5","borderWidth-kMzoRj":"xmkeg23","borderStyle-ksu8eU":"x1y0btm7","borderColor-kVAM5u":"x1ov19n","flexShrink-kmuXW":"x2lah0s",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:95"},driverLabel:{"UsageDriversCard__styles.driverLabel":"UsageDriversCard__styles.driverLabel","paddingInlineStart-kZCmMZ":"x1p5mu5g",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:105"}};s({ltr:".xrnnn4u{background-color:var(--xxbgvmf)}",priority:3e3});s({ltr:".x1lboxx{background-color:var(--x13m48dj)}",priority:3e3});s({ltr:".xtpyhuh{background-color:var(--x1kfk0vv)}",priority:3e3});const Se={events:{"UsageDriversCard__swatchFill.events":"UsageDriversCard__swatchFill.events","backgroundColor-kWkggS":"xrnnn4u",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:110"},signals:{"UsageDriversCard__swatchFill.signals":"UsageDriversCard__swatchFill.signals","backgroundColor-kWkggS":"x1lboxx",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:111"},tracked_accounts:{"UsageDriversCard__swatchFill.tracked_accounts":"UsageDriversCard__swatchFill.tracked_accounts","backgroundColor-kWkggS":"xtpyhuh",$$css:"nuxt-app:components/Billing/CreditUsage/UsageDriversCard.stylex.ts:112"}},je=["aria-label"],$e=["stroke","stroke-width"],Ue=["stroke"],ze=["d","stroke","stroke-width"],Be=["d","stroke"],De={key:0},qe=["cx","cy","r","fill"],Pe=["d","stroke"],Te=["cx","cy","r","fill"],dt=54,st=9,kt=1,Oe=3,Ie=ut({__name:"UsageDriversCard",props:{resource:{},projection:{}},setup(v){const y=v,{data:i,isLoading:D,isError:k,refetch:W}=yt({queryKey:["credit-usage-drivers"],queryFn:()=>y.resource.usageDrivers()}),{data:$}=yt({queryKey:["credit-projection"],queryFn:()=>y.resource.projection()}),P=n(()=>$.value?Ot($.value):null),G=n(()=>i.value?Ht(i.value):null),T=n(()=>G.value?te(G.value,P.value):[]),O=n(()=>
1T.value.reduce((z,S)=>z+S.projectedCredits,0)),g={events:B.color.pinkBackgroundHover,signals:B.color.warningBackgroundHover,tracked_accounts:B.color.successBackgroundHover},b=B.color.textPrimary,Q=z=>{const S=2*Math.PI*z;return{x:64+dt*Math.sin(S),y:64-dt*Math.cos(S)}},tt=(z,S)=>{const _=Q(z),K=Q(S),p=S-z>.5?1:0;return`M ${_.x.toFixed(2)} ${_.y.toFixed(2)} A ${dt} ${dt} 0 ${p} 1 ${K.x.toFixed(2)} ${K.y.toFixed(2)}`},Y=z=>{const S=z.length===1,_=2*Math.PI*dt,K=(st/2+kt)/_;return z.map(p=>{const xt=p.offset+p.fraction;return{type:p.type,full:S,path:tt(p.offset,xt),stubPath:tt(Math.max(xt-K,p.offset),xt),head:Q(xt)}})},L=H(q.body),N=H(q.donutColumn),w=H(q.donutDivider),U=H(q.donutWrap),d=H(q.donutSvg),at=H(q.donutCenter),it=H(q.donutValue),nt=["Category","Projected percent","Projected credits","Percent to date","Credits to date"],M=z=>[...z>0?[q.valueCell]:[],...z===Oe?[q.dividerCell]:[]],h=(z,S,_)=>[q.cell,...z%2===1?[q.cellZebra]:[],...z<S-1?[q.cellRule]:[],...M(_)],R=z=>[qt(z.projectedShare),`${rt(z.projectedCredits)} credits`,qt(z.share),`${rt(z.credits)} credits`],X=n(()=>[{key:"projected",label:"Projected Usage",value:O.value,arcs:Y(Pt(T.value,"projected"))},{key:"toDate",label:"Usage to date",value:y.projection.usedCredits,arcs:Y(Pt(T.value))}]);return(z,S)=>(a(),f(t(_t),{"no-padding":"",xstyle:t(C).card},{default:e(()=>[r(t(ht),{xstyle:t(C).header},{default:e(()=>[r(t(c),{variant:"body",weight:"semibold",color:"primary"},{default:e(()=>[...S[1]||(S[1]=[l("Usage drivers",-1)])]),_:1})]),_:1},8,["xstyle"]),t(D)?(a(),f(t(u),{key:0,orientation:"vertical",padding:"5",align:"center"},{default:e(()=>[r(t(c),{variant:"body",color:"secondary"},{default:e(()=>[...S[2]||(S[2]=[l("Loading usage driversâ¦",-1)])]),_:1})]),_:1})):t(k)||!G.value?(a(),f(t(u),{key:1,orientation:"vertical",gap:"3",padding:"5",align:"center"},{default:e(()=>[r(t(c),{variant:"body",color:"secondary"},{default:e(()=>[...S[3]||(S[3]=[l(" Usage drivers are unavailable right now. ",-1)])]),_:1}),r(t(ot),{variant:"secondary",size:"sm",onClick:t(W)},{default:e(()=>[...S[4]||(S[4]=[l("Retry",-1)])]),_:1},8,["onClick"])]),_:1})):T.value.length===0?(a(),f(t(u),{key:2,orientation:"vertical",padding:"5",align:"center"},{default:e(()=>[r(t(c),{variant:"body",color:"secondary"},{default:e(()=>[...S[5]||(S[5]=[l("No usage recorded yet this cycle",-1)])]),_:1})]),_:1})):(a(),x("div",{key:3,class:V(t(L).className),style:F(t(L).style)},[m("div",{class:V(t(N).className),style:F(t(N).style)},[(a(!0),x(I,null,et(X.value,(_,K)=>(a(),x(I,{key:_.key},[K>0?(a(),x("div",{key:0,class:V(t(w).className),style:F(t(w).style)},null,6)):A("",!0),m("div",{class:V(t(U).className),style:F(t(U).style)},[(a(),x("svg",{viewBox:"0 0 128 128",class:V(t(d).className),style:F(t(d).style),role:"img","aria-label":`${_.label}: ${t(rt)(_.value)} credits`},[(a(!0),x(I,null,et(_.arcs,p=>(a(),x("g",{key:p.type},[p.full?(a(),x(I,{key:0},[m("circle",{cx:"64",cy:"64",r:dt,fill:"none",stroke:t(b),"stroke-width":st+kt*2},null,8,$e),m("circle",{cx:"64",cy:"64",r:dt,fill:"none",stroke:g[p.type],"stroke-width":st},null,8,Ue)],64)):(a(),x(I,{key:1},[m("path",{d:p.path,fill:"none",stroke:t(b),"stroke-width":st+kt*2},null,8,ze),m("path",{d:p.path,fill:"none",stroke:g[p.type],"stroke-width":st},null,8,Be)],64))]))),128)),(a(!0),x(I,null,et(_.arcs,p=>(a(),x(I,{key:`head-${p.type}`},[p.full?A("",!0):(a(),x("g",De,[m("circle",{cx:p.head.x,cy:p.head.y,r:st/2+kt,fill:t(b)},null,8,qe),m("path",{d:p.stubPath,fill:"none",stroke:g[p.type],"stroke-width":st},null,8,Pe),m("circle",{cx:p.head.x,cy:p.head.y,r:st/2,fill:g[p.type]},null,8,Te)]))],64))),128))],14,je)),m("div",{class:V(t(at).className),style:F(t(at).style)},[r(t(c),{variant:"caption",color:"secondary"},{default:e(()=>[l(j(_.label),1)]),_:2},1024),m("span",{class:V(t(it).className),style:F(t(it).style)},j(t(rt)(_.value)),7)],6)],6)],64))),128))],6),r(t(J),{xstyle:t(q).tableScroller},{default:e(()=>[r(t(J),{xstyle:t(q).table,"data-part":"usage-drivers-table"},{default:e(()=>[(a(),x(I,null,et(nt,(_,K)=>r(t(J),{key:_,xstyle:[t(q).headerCell,...M(K)]},{default:e(()=>[r(t(c),{variant:"caption",weight:"semibold",color:"primary"},{default:e(()=>[l(j(_),1)]),_:2},1024)]),_:2},1032,["xstyle"])),64)),(a(!0),x(I,null,et(T.value,_=>(a(),x(I,{key:_.type},[r(t(J),{xstyle:t(q).categoryCell},{default:e(()=>[r(t(u),{orientation:"horizontal",gap:"2",align:"center"},{default:e(()=>[r(t(J),{xstyle:[t(q).swatch,t(Se)[_.type]],"aria-hidden":"true"},null,8,["xstyle"]),r(t(u),{orientation:"horizontal",gap:"1",align:"center"},{default:e(()=>[r(t(c),{variant:"caption",weight:"semibold",color:"primary"},{default:e(()=>[l(j(_.label),1)]),_:2},1024),_.type==="signals"?(a(),f(t(ye),{key:0,variant:"flush",size:"sm",ariaLabel:"Signals settings","data-testid":"signals-settings",onClick:S[0]||(S[0]=K=>("navigateTo"in z?z.navigateTo:t(Ct))("/signals"))},{default:e(()=>[r(t($t),{name:"settings",size:"sm",variant:"bold",color:"primary"})]),_:1})):A("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1032,["xstyle"]),(a(!0),x(I,null,et(R(_),(K,p)=>(a(),f(t(J),{key:p,xstyle:[t(q).categoryCell,...M(p+1)]},{default:e(()=>[r(t(c),{variant:"caption",weight:p%2===0?"semibold":"regular",color:"primary"},{default:e(()=>[l(j(K),1)]),_:2},1032,["weight"])]),_:2},1032,["xstyle"]))),128)),(a(!0),x(I,null,et(_.drivers,(K,p)=>(a(),x(I,{key:K.subtype??"other"},[r(t(J),{xstyle:[...h(p,_.drivers.length,0),t(q).driverLabel]},{default:e(()=>[r(t(c),{variant:"caption",size:"xs",xstyle:t(q).driverText},{default:e(()=>[l(j(K.label),1)]),_:2},1032,["xstyle"])]),_:2},1032,["xstyle"]),(a(!0),x(I,null,et(R(K),(xt,zt)=>(a(),f(t(J),{key:zt,xstyle:h(p,_.drivers.length,zt+1)},{default:e(()=>[r(t(c),{variant:"caption",size:"xs",xstyle:t(q).driverText},{default:e(()=>[l(j(xt),1)]),_:2},1032,["xstyle"])]),_:2},1032,["xstyle"]))),128))],64))),128))],64))),128))]),_:1},8,["xstyle"])]),_:1},8,["xstyle"])],6))]),_:1},8,["xstyle"]))}}
1),We=Object.assign(Ie,{__name:"BillingCreditUsageDriversCard"});var E=ft;E({ltr:".xh8yej3{width:100%}",priority:4e3});E({ltr:".xt7dq6l{height:auto}",priority:4e3});E({ltr:".x1lliihq{display:block}",priority:3e3});E({ltr:".x1rg5ohu{display:inline-block}",priority:3e3});E({ltr:".xdvko4i{width:var(--x1maq5wx)}",priority:4e3});E({ltr:".x36qwtl{height:2px}",priority:4e3});E({ltr:".x2lah0s{flex-shrink:0}",priority:3e3});E({ltr:".xwkw5gi{background-color:var(--xr2nqmf)}",priority:3e3});E({ltr:".x1gn072l{background-image:linear-gradient(to right,var(--x1c66h2s) 0 3px,transparent 3px 5px,var(--x1c66h2s) 5px 8px)}",priority:3e3});E({ltr:".x10l6tqk{position:absolute}",priority:3e3});E({ltr:".x1i1rx1s{width:1px}",priority:4e3});E({ltr:".xjm9jq1{height:1px}",priority:4e3});E({ltr:".x1odvyl1{margin:calc(-1 * var(--xh03zyl))}",priority:1e3});E({ltr:".x1717udv{padding:0}",priority:1e3});E({ltr:".xb3r6kr{overflow:hidden}",priority:2e3});E({ltr:".xeh89do{clip:rect(0 0 0 0)}",priority:3e3});E({ltr:".xuxw1ft{white-space:nowrap}",priority:3e3});E({ltr:".xc342km{border-width:0}",priority:2e3});const gt={chart:{"UsageOverTimeCard__styles.chart":"UsageOverTimeCard__styles.chart","width-kzqmXN":"xh8yej3","height-kZKoxP":"xt7dq6l","display-k1xSpc":"x1lliihq",$$css:"nuxt-app:components/Billing/CreditUsage/UsageOverTimeCard.stylex.ts:6"},legendSwatch:{"UsageOverTimeCard__styles.legendSwatch":"UsageOverTimeCard__styles.legendSwatch","display-k1xSpc":"x1rg5ohu","width-kzqmXN":"xdvko4i","height-kZKoxP":"x36qwtl","flexShrink-kmuXW":"x2lah0s",$$css:"nuxt-app:components/Billing/CreditUsage/UsageOverTimeCard.stylex.ts:11"},legendSwatchCurrent:{"UsageOverTimeCard__styles.legendSwatchCurrent":"UsageOverTimeCard__styles.legendSwatchCurrent","backgroundColor-kWkggS":"xwkw5gi",$$css:"nuxt-app:components/Billing/CreditUsage/UsageOverTimeCard.stylex.ts:18"},legendSwatchProjected:{"UsageOverTimeCard__styles.legendSwatchProjected":"UsageOverTimeCard__styles.legendSwatchProjected","backgroundImage-kKwaWg":"x1gn072l",$$css:"nuxt-app:components/Billing/CreditUsage/UsageOverTimeCard.stylex.ts:22"}},Ne=["viewBox","aria-label"],Ae=["y1","y2","stroke"],Ee=["x","y","font-size","fill","font-family"],Le=["stroke"],Me=["x","y","font-size","fill","font-family"],Re=["y1","y2","stroke"],Fe=["x","y","font-size","fill","font-family"],Ve={key:0},Ge=["x1","x2","y1","stroke"],He=["x","y","font-size","fill","font-family"],Xe={key:1},Ke=["x1","x2","y1","stroke"],Qe=["x","y","font-size","fill","font-family"],Ze=["x"],Ye=["x"],Je=["points","stroke"],tr=["points","stroke"],er=["cx","cy","fill"],rr=["cx","cy","fill","stroke"],ar=["x","font-size","fill","font-family"],ir=560,sr=264,lt=40,bt=552,mt=36,ct=236,lr=254,or=ut({__name:"UsageOverTimeCard",props:{timeline:{},projection:{},now:{}},setup(v){const y=[.25,.5,.75,1],i=v,D=Number.parseInt(B.typography.fontSize.xs,10),k=B.typography.fontFamily.mono,W=n(()=>re(i.timeline,i.now)),$=n(()=>ae(i.projection,i.now)),P=n(()=>ie(Math.max(i.projection.availableCredits,...W.value.map(h=>h.cumulative),...$.value.map(h=>h.cumulative))*1.05)),G=n(()=>i.projection.cycleStart.getTime()),T=n(()=>i.projection.cycleEnd.getTime());function O(h){const R=T.value-G.value,X=R>0?(h.getTime()-G.value)/R:0;return lt+(bt-lt)*Math.max(0,Math.min(1,X))}function g(h){return ct-(ct-mt)*(h/P.value)}const b=h=>h.map(R=>`${O(R.date).toFixed(2)},${g(R.cumulative).toFixed(2)}`).join(" "),Q=n(()=>b(W.value)),tt=n(()=>b($.value)),Y=n(()=>y.map(h=>P.value*h)),L=n(()=>se(i.projection.cycleStart,i.projection.cycleEnd)),N=n(()=>W.value[W.value.length-1]??null),w=n(()=>{const h=i.projection.runOutDate;return h?{date:h,x:O(h),y:g(i.projection.availableCredits)}:null}),U=n(()=>g(i.projection.availableCredits)),d=n(()=>`${rt(i.projection.availableCredits)} credits available this cycle`),at=n(()=>{const h=rt(i.projection.usedCredits),R=rt(i.projection.usedCredits+i.projection.projectedRemainingUsage),X=i.projection.runOutDate?` Credits are projected to run out around ${vt(i.projection.runOutDate)}.`:"";return`Cumulative credit usage from ${vt(i.projection.cycleStart)}: ${h} used so far, projected ${R} by cycle end, of ${d.value}.${X}`}),it=H(gt.chart),nt=H(gt.legendSwatch,gt.legendSwatchCurrent),M=H(gt.legendSwatch,gt.legendSwatchProjected);
1return(h,R)=>(a(),f(t(_t),{"no-padding":"",xstyle:t(C).card},{default:e(()=>[r(t(ht),{xstyle:t(C).header},{default:e(()=>[r(t(c),{variant:"body",weight:"semibold",color:"primary"},{default:e(()=>[...R[0]||(R[0]=[l("Balance over time",-1)])]),_:1})]),_:1},8,["xstyle"]),r(t(u),{orientation:"vertical",gap:"4",padding:"5","padding-block":"5",xstyle:t(C).body},{default:e(()=>[r(t(u),{orientation:"horizontal",gap:"4",align:"center"},{default:e(()=>[r(t(u),{orientation:"horizontal",gap:"2",align:"center"},{default:e(()=>[m("span",{class:V(t(nt).className),style:F(t(nt).style),"aria-hidden":"true"},null,6),r(t(c),{variant:"monoLight"},{default:e(()=>[...R[1]||(R[1]=[l("Usage",-1)])]),_:1})]),_:1}),r(t(u),{orientation:"horizontal",gap:"2",align:"center"},{default:e(()=>[m("span",{class:V(t(M).className),style:F(t(M).style),"aria-hidden":"true"},null,6),r(t(c),{variant:"monoLight"},{default:e(()=>[...R[2]||(R[2]=[l("Projected Usage",-1)])]),_:1})]),_:1})]),_:1}),(a(),x("svg",{viewBox:`0 0 ${ir} ${sr}`,class:V(t(it).className),style:F(t(it).style),role:"img","aria-label":at.value,"data-testid":"usage-over-time-chart"},[(a(!0),x(I,null,et(Y.value,X=>(a(),x("g",{key:X},[m("line",{x1:lt,x2:bt,y1:g(X),y2:g(X),stroke:t(B).color.borderSubtle,"stroke-width":"1"},null,8,Ae),m("text",{x:lt-6,y:g(X)+3,"text-anchor":"end","font-size":t(D),fill:t(B).color.textSecondary,"font-family":t(k)},j(t(ee)(X)),9,Ee)]))),128)),m("line",{x1:lt,x2:bt,y1:ct,y2:ct,stroke:t(B).color.borderPrimary,"stroke-width":"1"},null,8,Le),m("text",{x:lt-6,y:ct+3,"text-anchor":"end","font-size":t(D),fill:t(B).color.textSecondary,"font-family":t(k)}," 0 ",8,Me),m("line",{x1:lt,x2:bt,y1:U.value,y2:U.value,stroke:t(B).color.borderPrimary,"stroke-width":"1"},null,8,Re),m("text",{x:lt+8,y:U.value-6,"font-size":t(D),fill:t(B).color.textSecondary,"font-family":t(k)},j(d.value),9,Fe),N.value?(a(),x("g",Ve,[m("line",{x1:O(N.value.date),x2:O(N.value.date),y1:mt-4,y2:ct,stroke:t(B).color.borderTertiary,"stroke-width":"1"},null,8,Ge),m("text",{x:O(N.value.date),y:mt-10,"text-anchor":"middle","font-size":t(D),fill:t(B).color.textSecondary,"font-family":t(k)}," Today ",8,He)])):A("",!0),w.value?(a(),x("g",Xe,[m("line",{x1:w.value.x,x2:w.value.x,y1:mt-4,y2:ct,stroke:t(B).color.borderTertiary,"stroke-width":"1"},null,8,Ke),m("text",{x:w.value.x,y:mt-22,"text-anchor":"middle","font-size":t(D),fill:t(B).color.textSecondary,"font-family":t(k)},[m("tspan",{x:w.value.x,dy:"0"},"Credits run out",8,Ze),m("tspan",{x:w.value.x,dy:"12"},"on "+j(t(vt)(w.value.date)),9,Ye)],8,Qe)])):A("",!0),W.value.length>1?(a(),x("polyline",{key:2,points:Q.value,fill:"none",stroke:t(B).color.infoFeedback,"stroke-width":"1.5","stroke-linejoin":"round"},null,8,Je)):A("",!0),$.value.length>1?(a(),x("polyline",{key:3,points:tt.value,fill:"none",stroke:t(B).color.orangeAccent,"stroke-width":"1.5","stroke-dasharray":"4 3","stroke-linejoin":"round"},null,8,tr)):A("",!0),N.value?(a(),x("circle",{key:4,cx:O(N.value.date),cy:g(N.value.cumulative),r:"4",fill:t(B).color.infoFeedback},null,8,er)):A("",!0),w.value?(a(),x("circle",{key:5,cx:w.value.x,cy:w.value.y,r:"4",fill:t(B).color.backgroundSurface,stroke:t(B).color.orangeAccent,"stroke-width":"1.5"},null,8,rr)):A("",!0),(a(!0),x(I,null,et(L.value,X=>(a(),x("text",{key:X.date.toISOString(),x:O(X.date),y:lr,"text-anchor":"middle","font-size":t(D),fill:t(B).color.textSecondary,"font-family":t(k)},j(X.label),9,ar))),128))],14,Ne))]),_:1},8,["xstyle"])]),_:1},8,["xstyle"]))}}),nr=Object.assign(or,{__name:"BillingCreditUsageOverTimeCard"}),dr=ut({__name:"CreditUsagePage",props:{resource:{},now:{},initialState:{},subscription:{},hideHeader:{type:Boolean}},emits:["manageSubscription","purchased","periodLabel"],setup(v,{expose:y,emit:i}){const D=v,k=i,W=Vt(),{data:$,isLoading:P,isError:G,refetch:T}=yt({queryKey:["credit-usage-timeline"],queryFn:()=>D.resource.timeline()}),O=n(()=>$.value?Xt($.value):null),{data:g}=yt({queryKey:["credit-projection"],queryFn:()=>D.resource.projection()}),b=n(()=>g.value?Ot(g.value):null),Q=n(()=>b.value?de(b.value):null),tt=n(()=>b.value?ce(b.value):null),Y=n(()=>D.now??new Date),L=n(()=>O.value?oe(O.value,Y.value,Q.value,tt.value):null),N=n(()=>L.value?ne(L.value.cycleStart,L.value.cycleEnd):null);Et(N,nt=>k("periodLabel",nt),{immediate:!0});const w=n(()=>D.subscription?.isTrialing??!1),U=Ut(D.initialState?.purchaseOpen??!1),d=()=>{w.value||(U.value=!0)};
1y({openPurchase:d});const at=()=>{W.invalidateQueries({queryKey:["credit-usage-timeline"]}),W.invalidateQueries({queryKey:["credit-grants"]}),k("purchased")},it=H(jt.grid);return(nt,M)=>(a(),x(I,null,[r(t(u),{orientation:"vertical",gap:"5"},{default:e(()=>[v.hideHeader?A("",!0):(a(),f(It,{key:0,"period-label":N.value,"is-trialing":w.value,onManageSubscription:M[0]||(M[0]=h=>k("manageSubscription")),onPurchaseCredits:d},null,8,["period-label","is-trialing"])),t(P)?(a(),f(t(u),{key:1,orientation:"vertical",gap:"3",align:"center",justify:"center",padding:"5",xstyle:t(jt).centered},{default:e(()=>[r(t(c),{variant:"body"},{default:e(()=>[...M[2]||(M[2]=[l("Loading credit usageâ¦",-1)])]),_:1})]),_:1},8,["xstyle"])):t(G)||!O.value||!L.value?(a(),f(t(u),{key:2,orientation:"vertical",gap:"3",align:"center",justify:"center",padding:"5",xstyle:t(jt).centered},{default:e(()=>[r(t(c),{variant:"body"},{default:e(()=>[...M[3]||(M[3]=[l("Credit usage is unavailable right now.",-1)])]),_:1}),r(t(ot),{variant:"secondary",size:"sm",onClick:t(T)},{default:e(()=>[...M[4]||(M[4]=[l("Retry",-1)])]),_:1},8,["onClick"])]),_:1},8,["xstyle"])):(a(),x(I,{key:3},[m("div",{class:V(t(it).className),style:F(t(it).style)},[r(we,{projection:L.value,"is-trialing":w.value,onPurchaseCredits:d},null,8,["projection","is-trialing"]),r(nr,{timeline:O.value,projection:L.value,now:Y.value},null,8,["timeline","projection","now"])],6),r(We,{resource:v.resource,projection:L.value},null,8,["resource","projection"]),r(_e,{resource:v.resource,now:Y.value},null,8,["resource","now"])],64))]),_:1}),w.value?A("",!0):(a(),f(le,{key:0,modelValue:U.value,"onUpdate:modelValue":M[1]||(M[1]=h=>U.value=h),resource:v.resource,onPurchased:at},null,8,["modelValue","resource"]))],64))}}),cr=Object.assign(dr,{__name:"BillingCreditUsagePage"}),ur=()=>me(ge()),Ir=ut({__name:"credit-usage",async setup(v){let y,i;const D=ve();!([y,i]=wt(()=>Ft()),y=await y,i(),y).vectorPlatform&&([y,i]=wt(()=>D),y=await y,i(),!y)&&([y,i]=wt(()=>Ct("/")),await y,i());const W=ur(),$=ue(),P=Lt(),G=yt({queryKey:["platform-billing-subscription"],queryFn:()=>$.subscription()}),T=n(()=>G.data.value?xe(G.data.value):null),O=[{label:"Settings",to:"/settings"},{label:"Credit usage",active:!0}],g={purchaseOpen:P.query.purchase==="true"};Mt({title:"Vector - Credit Usage",meta:[{name:"description",content:"Credit balance, usage, and projections"}]});const b=()=>Ct("/settings/platform-billing"),Q=Ut(null),tt=Ut(null),Y=()=>Q.value?.openPurchase(),L=Rt(pe,()=>0),N=()=>{L.value+=1};return(w,U)=>(a(),f(t(u),{gap:"0",grow:"",scroll:"y",background:"canvas"},{default:e(()=>[r(t(Wt),null,{actions:e(()=>[r(It,{"period-label":tt.value,"is-trialing":T.value?.isTrialing??!1,onManageSubscription:b,onPurchaseCredits:Y},null,8,["period-label","is-trialing"])]),default:e(()=>[r(t(Nt),{items:O})]),_:1}),r(t(At),{variant:"gradient3","max-width":"1440px"},{default:e(()=>[r(cr,{ref_key:"shellRef",ref:Q,resource:t(W),"initial-state":g,subscription:T.value,"hide-header":"",onManageSubscription:b,onPeriodLabel:U[0]||(U[0]=d=>tt.value=d),onPurchased:N},null,8,["resource","subscription"])]),_:1})]),_:1}))}});export{Ir as default}; 2//# sourceMappingURL=yL86EPIq.js.map
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.