1import{a as W}from"./chunk-5VPXBEUU.js";import{A as le,b as X,c as L,d as ee,e as te,i as ne,p as ie,q as ae,y as oe,z as re}from"./chunk-P5GJR4AC.js";import"./chunk-ME32OR76.js";import"./chunk-RGZ4OJ2S.js";import{s as K,w as Z,z as Q}from"./chunk-BQVU46A6.js";import{$a as q,$b as O,A as D,Ab as s,Ib as y,J as f,Mb as m,N as Y,Na as o,Ob as d,S as F,Ub as A,Vb as M,X as u,Xb as I,Y as _,Yb as a,Z as v,Zb as P,_ as x,_b as h,ac as J,h as S,ha as C,kc as T,lc as G,m as U,mc as j,pb as R,qb as $,rb as p,sb as g,tc as k,vb as V,w,wb as z,xb as N,yb as t,zb as n}from"./chunk-NLDCKMPI.js";import{a as E,b as H}from"./chunk-ODN5LVDJ.js";var de=(()=>{class i{constructor(){this.api=F(W),this.basePath="/billing",this._subscription=C(null),this._plans=C([]),this._paymentMethods=C([]),this._invoices=C([]),this._usage=C(null),this._billingInfo=C(null),this._isLoading=C(!1),this._isSaving=C(!1),this._error=C(null),this.subscription=this._subscription.asReadonly(),this.plans=this._plans.asReadonly(),this.paymentMethods=this._paymentMethods.asReadonly(),this.invoices=this._invoices.asReadonly(),this.usage=this._usage.asReadonly(),this.billingInfo=this._billingInfo.asReadonly(),this.isLoading=this._isLoading.asReadonly(),this.isSaving=this._isSaving.asReadonly(),this.error=this._error.asReadonly(),this.currentPlan=k(()=>{let e=this._subscription();return e?this._plans().find(r=>r.id===e.planId):null}),this.defaultPaymentMethod=k(()=>this._paymentMethods().find(e=>e.isDefault)),this.unpaidInvoices=k(()=>this._invoices().filter(e=>e.status==="pending"||e.status==="failed")),this.isTrialing=k(()=>this._subscription()?.status==="trialing"),this.canUpgrade=k(()=>{let e=this._subscription();return e&&e.planTier!=="enterprise"})}getSubscription(){return this._isLoading.set(!0),this._error.set(null),this.api.get(`${this.basePath}/subscription`).pipe(f(e=>{this._subscription.set(e),this._isLoading.set(!1)}),w(()=>{let e=this.getMockSubscription();return this._subscription.set(e),this._isLoading.set(!1),S(e)}))}getPlans(){return this.api.get(`${this.basePath}/plans`).pipe(f(e=>this._plans.set(e)),w(()=>{let e=this.getMockPlans();return this._plans.set(e),S(e)}))}updateSubscription(e){return this._isSaving.set(!0),this.api.patch(`${this.basePath}/subscription`,e).pipe(f(r=>{this._subscription.set(r),this._isSaving.set(!1)}),w(()=>S(null).pipe(D(1e3),U(()=>{let r=this._subscription(),l=H(E(E({},r),e),{planTier:e.planId?this.getPlanTierById(e.planId):r.planTier});return this._subscription.set(l),this._isSaving.set(!1),l}))))}cancelSubscription(){return this.updateSubscription({cancelAtPeriodEnd:!0})}resumeSubscription(){return this.updateSubscription({cancelAtPeriodEnd:!1})}getPaymentMethods(){return this.api.get(`${this.basePath}/payment-methods`).pipe(f(e=>this._paymentMethods.set(e)),w(()=>{let e=this.getMockPaymentMethods();return this._paymentMethods.set(e),S(e)}))}addPaymentMethod(e){return this._isSaving.set(!0),this.api.post(`${this.basePath}/payment-methods`,{token:e}).pipe(f(r=>{this._paymentMethods.update(l=>[...l,r]),this._isSaving.set(!1)}),w(()=>{let r={id:crypto.randomUUID(),type:"card",isDefault:this._paymentMethods().length===0,card:{brand:"visa",last4:"4242",expMonth:12,expYear:2028},createdAt:new Date().toISOString()};return S(r).pipe(D(500),f(l=>{this._paymentMethods.update(b=>[...b,l]),this._isSaving.set(!1)}))}))}setDefaultPaymentMethod(e){return this._isSaving.set(!0),this.api.post(`${this.basePath}/payment-methods/${e}/default`,{}).pipe(f(()=>{this._paymentMethods.update(r=>r.map(l=>H(E({},l),{isDefault:l.id===e}))),this._isSaving.set(!1)}),w(()=>S(null).pipe(D(300),f(()=>{this._paymentMethods.update(r=>r.map(l=>H(E({},l),{isDefault:l.id===e}))),this._isSaving.set(!1)}),U(()=>{}))))}removePaymentMethod(e){return this._isSaving.set(!0),this.api.delete(`${this.basePath}/payment-methods/${e}`).pipe(f(()=>{this._paymentMethods.update(r=>r.filter(l=>l.id!==e)),this._isSaving.set(!1)}),w(()=>S(null).pipe(D(300),f(()=>{this._paymentMethods.update(r=>r.filter(l=>l.id!==e)),this._isSaving.set(!1)}),U(()=>{}))))}getInvoices(){return this.api.get(`${this.basePath}
1/invoices`).pipe(f(e=>this._invoices.set(e)),w(()=>{let e=this.getMockInvoices();return this._invoices.set(e),S(e)}))}downloadInvoice(e){window.open(`/api/v1/billing/invoices/${e}/download`,"_blank")}getUsage(){return this.api.get(`${this.basePath}/usage`).pipe(f(e=>this._usage.set(e)),w(()=>{let e=this.getMockUsage();return this._usage.set(e),S(e)}))}getBillingInfo(){return this.api.get(`${this.basePath}/info`).pipe(f(e=>this._billingInfo.set(e)),w(()=>{let e=this.getMockBillingInfo();return this._billingInfo.set(e),S(e)}))}updateBillingInfo(e){return this._isSaving.set(!0),this.api.patch(`${this.basePath}/info`,e).pipe(f(r=>{this._billingInfo.set(r),this._isSaving.set(!1)}),w(()=>S(null).pipe(D(500),U(()=>{let r=this._billingInfo(),l=E(E({},r),e);return this._billingInfo.set(l),this._isSaving.set(!1),l}))))}getPlanTierById(e){return this._plans().find(l=>l.id===e)?.tier||"free"}formatPrice(e,r="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(e/100)}formatDate(e){return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}getMockSubscription(){return{id:"sub-1",planId:"plan-pro",planName:"Pro",planTier:"pro",status:"active",billingCycle:"monthly",currentPeriodStart:new Date(Date.now()-360*60*60*1e3).toISOString(),currentPeriodEnd:new Date(Date.now()+360*60*60*1e3).toISOString(),cancelAtPeriodEnd:!1,amount:4900,currency:"USD"}}getMockPlans(){return[{id:"plan-free",name:"Free",tier:"free",description:"Perfect for getting started",monthlyPrice:0,annualPrice:0,features:[{name:"Team Members",included:!0,limit:"1"},{name:"Storage",included:!0,limit:"500 MB"},{name:"Custom Domain",included:!1},{name:"AI Generation",included:!1},{name:"API Access",included:!1},{name:"Priority Support",included:!1}],limits:{users:1,storageMb:500,monthlyBandwidthMb:1e3,aiGenerations:0,customDomains:0,apiRequestsPerMonth:1e3}},{id:"plan-starter",name:"Starter",tier:"starter",description:"For small teams",monthlyPrice:1900,annualPrice:15900,features:[{name:"Team Members",included:!0,limit:"Up to 5"},{name:"Storage",included:!0,limit:"5 GB"},{name:"Custom Domain",included:!0,limit:"1"},{name:"AI Generation",included:!0,limit:"100/mo"},{name:"API Access",included:!1},{name:"Priority Support",included:!1}],limits:{users:5,storageMb:5e3,monthlyBandwidthMb:1e4,aiGenerations:100,customDomains:1,apiRequestsPerMonth:1e4}},{id:"plan-pro",name:"Pro",tier:"pro",description:"For growing businesses",monthlyPrice:4900,annualPrice:41900,recommended:!0,features:[{name:"Team Members",included:!0,limit:"Up to 25"},{name:"Storage",included:!0,limit:"50 GB"},{name:"Custom Domains",included:!0,limit:"5"},{name:"AI Generation",included:!0,limit:"1,000/mo"},{name:"API Access",included:!0},{name:"Priority Support",included:!0}],limits:{users:25,storageMb:5e4,monthlyBandwidthMb:2e5,aiGenerations:1e3,customDomains:5,apiRequestsPerMonth:1e5}},{id:"plan-enterprise",name:"Enterprise",tier:"enterprise",description:"For large organizations",monthlyPrice:19900,annualPrice:167900,features:[{name:"Team Members",included:!0,limit:"Unlimited"},{name:"Storage",included:!0,limit:"Unlimited"},{name:"Custom Domains",included:!0,limit:"Unlimited"},{name:"AI Generation",included:!0,limit:"Unlimited"},{name:"API Access",included:!0},{name:"Dedicated Support",included:!0},{name:"Custom Integrations",included:!0},{name:"SLA Guarantee",included:!0}],limits:{users:-1,storageMb:-1,monthlyBandwidthMb:-1,aiGenerations:-1,customDomains:-1,apiRequestsPerMonth:-1}}]}getMockPaymentMethods(){return[{id:"pm-1",type:"card",isDefault:!0,card:{brand:"visa",last4:"4242",expMonth:12,expYear:2027},createdAt:"2024-06-20T00:00:00Z"}]}getMockInvoices(){let e=new Date;return[{id:"inv-1",number:"INV-2026-0001",status:"paid",amount:4900,currency:"USD",description:"Pro Plan - January 2026",periodStart:new Date(Date.now()-720*60*60*1e3).toISOString(),periodEnd:e.toISOString(),paidAt:new Date(Date.now()-720*60*60*1e3).toISOString(),dueDate:new Date(Date.now()-720*60*60*1e3).toISOString(),items:[{description:"Pro Plan (Monthly)",quantity:1,unitPrice:4900,amount:4900}],createdAt:new Date(Date.now()-720*60*60*1e3).toISOString()},{id:"inv-2",number:"INV-2025-0012",status:"paid",amount:4900,currency:"USD",description:"Pro Plan - December 2025",periodStart:new Date(Date.now()-1440*60*60*1e3).toISOString(),periodEnd:new Date(Date.now()-720*60*60*1e3).toISOString(),paidAt:new Date(Date.now()-1440*60*60*1e3).toISOString(),dueDate:new Date(Date.now()-1440*60*60*1e3).toISOString(),items:[{description:"Pro Plan (Monthly)",quantity:1,unitPrice:4900,amount:4900}],createdAt:new Date(Date.now()-1440*60*60*1e3).toISOString()},{id:"inv-3",number:"INV-2025-0011",status:"paid",amount:4900,currency:"USD",description:"Pro Plan -
1November 2025",periodStart:new Date(Date.now()-2160*60*60*1e3).toISOString(),periodEnd:new Date(Date.now()-1440*60*60*1e3).toISOString(),paidAt:new Date(Date.now()-2160*60*60*1e3).toISOString(),dueDate:new Date(Date.now()-2160*60*60*1e3).toISOString(),items:[{description:"Pro Plan (Monthly)",quantity:1,unitPrice:4900,amount:4900}],createdAt:new Date(Date.now()-2160*60*60*1e3).toISOString()}]}getMockUsage(){return{users:{current:8,limit:25,unit:"members",percentage:32},storage:{current:12300,limit:5e4,unit:"MB",percentage:25},bandwidth:{current:85e3,limit:2e5,unit:"MB",percentage:43},aiGenerations:{current:450,limit:1e3,unit:"generations",percentage:45},apiRequests:{current:45e3,limit:1e5,unit:"requests",percentage:45}}}getMockBillingInfo(){return{companyName:"TechStartup Inc",email:"[email protected]",address:{line1:"123 Innovation Drive",city:"San Francisco",state:"CA",postalCode:"94105",country:"United States"}}}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275prov=Y({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var ce=(i,c)=>c.name;function me(i,c){i&1&&(t(0,"div",11),s(1,"div",13),t(2,"p"),a(3,"Loading billing information..."),n()())}function pe(i,c){if(i&1){let e=y();t(0,"div",28),v(),t(1,"svg",32),s(2,"path",33),n(),x(),t(3,"span"),a(4),n(),t(5,"button",34),m("click",function(){u(e);let l=d(4);return _(l.resumeSubscription())}),a(6,"Resume"),n()()}if(i&2){let e=d(4);o(4),h("Your subscription will end on ",e.formatDate(e.subscription().currentPeriodEnd))}}function ge(i,c){if(i&1){let e=y();t(0,"button",35),m("click",function(){u(e);let l=d(4);return _(l.setTab("plans"))}),v(),t(1,"svg",6),s(2,"path",36),n(),a(3," Upgrade Plan "),n()}}function ue(i,c){if(i&1){let e=y();t(0,"button",37),m("click",function(){u(e);let l=d(4);return _(l.openCancelModal())}),a(1,"Cancel Subscription"),n()}}function _e(i,c){if(i&1&&(t(0,"div",15)(1,"div",17)(2,"div",18)(3,"span",19),a(4),n(),t(5,"span",20),a(6),T(7,"titlecase"),n()(),t(8,"div",21)(9,"span",22),a(10),n(),t(11,"span",23),a(12),n()()(),t(13,"div",24)(14,"div",25)(15,"span",26),a(16,"Current Period"),n(),t(17,"span",27),a(18),n()(),p(19,pe,7,1,"div",28),n(),t(20,"div",29),p(21,ge,4,0,"button",30),p(22,ue,2,0,"button",31),n()()),i&2){let e=d(3);o(4),h("",e.subscription().planName," Plan"),o(),I(e.getStatusClass(e.subscription().status)),o(),h(" ",G(7,11,e.subscription().status)," "),o(4),P(e.formatPrice(e.subscription().amount)),o(2),h("/ ",e.subscription().billingCycle==="annual"?"year":"month"),o(6),O(" ",e.formatDate(e.subscription().currentPeriodStart)," - ",e.formatDate(e.subscription().currentPeriodEnd)," "),o(),g(e.subscription().cancelAtPeriodEnd?19:-1),o(2),g(e.canUpgrade()?21:-1),o(),g(e.subscription().cancelAtPeriodEnd?-1:22)}}function ve(i,c){if(i&1&&(t(0,"div",16)(1,"h2",38),a(2,"Current Usage"),n(),t(3,"div",39)(4,"div",40)(5,"div",41)(6,"span",42),a(7,"Team Members"),n(),t(8,"span",43),a(9),n()(),t(10,"div",44),s(11,"div",45),n()(),t(12,"div",40)(13,"div",41)(14,"span",42),a(15,"Storage"),n(),t(16,"span",43),a(17),T(18,"number"),n()(),t(19,"div",44),s(20,"div",45),n()(),t(21,"div",40)(22,"div",41)(23,"span",42),a(24,"AI Generations"),n(),t(25,"span",43),a(26),n()(),t(27,"div",44),s(28,"div",45),n()(),t(29,"div",40)(30,"div",41)(31,"span",42),a(32,"API Requests"),n(),t(33,"span",43),a(34),T(35,"number"),n()(),t(36,"div",44),s(37,"div",45),n()()()()),i&2){let e=d(3);o(9),O("",e.usage().users.current," / ",e.usage().users.limit),o(2),I(e.getUsageColor(e.usage().users.percentage)),A("width",e.usage().users.percentage,"%"),o(6),O("",j(18,24,e.usage().storage.current/1e3,"1.1-1")," / ",e.usage().storage.limit/1e3," GB"),o(3),I(e.getUsageColor(e.usage().storage.percentage)),A("width",e.usage().storage.percentage,"%"),o(6),O("",e.usage().aiGenerations.current," / ",e.usage().aiGenerations.limit),o(2),I(e.getUsageColor(e.usage().aiGenerations.percentage)),A("width",e.usage().aiGenerations.percentage,"%"),o(6),O("",j(35,27,e.usage().apiRequests.current/1e3,"1.0-0"),"k / ",e.usage().apiRequests.limit/1e3,"k"),o(3),I(e.getUsageColor(e.usage().apiRequests.percentage)),A("width",e.usage().apiRequests.percentage,"%")}}function be(i,c){if(i&1){let e=y();t(0,"div",16)(1,"div",46)(2,"h2",38),a(3,"Payment Method"),n(),t(4,"button",47),m("click",function(){u(e);let l=d(3);return _(l.setTab("payment"))}),a(5,"Manage"),n()(),t(6,"div",48)(7,"div",49),v(),t(8,"svg",32),s(9,"path"),n()(),x(),t(10,"div",50)(11,"span",51),a(12),T(13,"titlecase"),n(),t(14,"span",52),a(15),n()(),t(16,"span",53),a(17),n()()()}if(i&2){let e,r,l,b,B=d(3);o(9),R("d",B.getCardIcon(((e=B.defaultPaymentMethod().card)==null?null:e.brand)||"visa")),o(3),P(G(13,5,(r=B.defaultPaymentMethod().card)==null?null:r.brand)),o(3),h("\u2022\u2022\u2022\u2022 ",(l=B.defaultPaymentMethod().card)==null?null:l.last4),o(2),O("Expires ",(b=B.defaultPaymentMethod().card)==null?null:b.expMonth,"/",(b=B.defaultPaymentMethod().card)==null?null:b.expYear)}}function he(i,c){if(i&1&&(t(0,"div",14),p(1,_e,23,13,"div",15),p(2,ve,38,30,"div",16),p(3,be,18,7,"div",16),n()),i&2){let e=d(2);o(),g(e.subscription()?1:-1),o(),g(e.usage()?2:-1),o(),g(e.defaultPaymentMethod()?3:-1)}}function Ce(i,c){i&1&&(t(0,"div",60),a(1,"Most Popular"),n())}function fe(i,c){i&1&&(v(),t(0,"svg",70),s(1,"path",73),n())}function xe(i,c){i&1&&(v(),t(0,"svg",71),s(1,"path",74),n())}function Me(i,c){if(i&1&&(t(0,"span",72),a(1),n()),i&2){let e=d().$implicit;o(),h("(",e.limit,")")}}function Pe(i,c){if(i&1&&(t(0,"li"),p(1,fe,2,0,":svg:svg",70)(2,xe,2,0,":svg:svg",71),a(3),p(4,Me,2,1,"span",72),n()),i&2){let e=c.$implicit;M("included",e.included),o(),g(e.included?1:2),o(2),h(" ",e.name," "),o(),g(e.limit?4:-1)}}function ye(i,c){i&1&&(t(0,"button",68),a(1,"Current Plan"),n())}function Se(i,c){i&1&&(t(0,"button",69),a(1,"Contact Sales"),n())}
1function we(i,c){if(i&1){let e=y();t(0,"button",35),m("click",function(){u(e);let l=d().$implicit,b=d(3);return _(b.openUpgradeModal(l))}),a(1),n()}if(i&2){let e,r=d(4);o(),h(" ",((e=r.subscription())==null?null:e.planTier)==="free"||!r.subscription()?"Get Started":"Upgrade"," ")}}function Oe(i,c){if(i&1&&(t(0,"div",59),p(1,Ce,2,0,"div",60),t(2,"div",61)(3,"h3",62),a(4),n(),t(5,"p",63),a(6),n(),t(7,"div",64)(8,"span",22),a(9),n(),t(10,"span",23),a(11),n()()(),t(12,"ul",65),V(13,Pe,5,5,"li",66,ce),n(),t(15,"div",67),p(16,ye,2,0,"button",68)(17,Se,2,0,"button",69)(18,we,2,1,"button",30),n()()),i&2){let e=c.$implicit,r=d(3);M("recommended",e.recommended)("current",r.isCurrentPlan(e)),o(),g(e.recommended?1:-1),o(3),P(e.name),o(2),P(e.description),o(3),P(r.formatPrice(r.getPlanPrice(e))),o(2),h("/ ",r.billingCycle()==="annual"?"year":"month"),o(2),z(e.features),o(3),g(r.isCurrentPlan(e)?16:e.tier==="enterprise"?17:18)}}function ke(i,c){if(i&1){let e=y();t(0,"div",14)(1,"div",54)(2,"button",55),m("click",function(){u(e);let l=d(2);return _(l.setBillingCycle("monthly"))}),a(3," Monthly "),n(),t(4,"button",55),m("click",function(){u(e);let l=d(2);return _(l.setBillingCycle("annual"))}),a(5," Annual "),t(6,"span",56),a(7,"Save 30%"),n()()(),t(8,"div",57),V(9,Oe,19,10,"div",58,$().trackByPlanId,!0),n()()}if(i&2){let e=d(2);o(2),M("active",e.billingCycle()==="monthly"),o(2),M("active",e.billingCycle()==="annual"),o(5),z(e.plans())}}function Ee(i,c){if(i&1){let e=y();t(0,"div",76)(1,"div",78)(2,"span",79),a(3),n(),t(4,"span",80),a(5),n()(),t(6,"span",81),a(7),n(),t(8,"span",82),a(9),n(),t(10,"span",20),a(11),T(12,"titlecase"),n(),t(13,"button",47),m("click",function(){let l=u(e).$implicit,b=d(3);return _(b.downloadInvoice(l))}),v(),t(14,"svg",83),s(15,"path",84),n(),a(16," Download "),n()()}if(i&2){let e=c.$implicit,r=d(3);o(3),P(e.number),o(2),P(r.formatDate(e.createdAt)),o(2),P(e.description),o(2),P(r.formatPrice(e.amount)),o(),I(r.getStatusClass(e.status)),o(),h(" ",G(12,7,e.status)," ")}}function Ie(i,c){i&1&&(t(0,"div",77),v(),t(1,"svg",32),s(2,"path",85),n(),x(),t(3,"h3"),a(4,"No Invoices Yet"),n(),t(5,"p"),a(6,"Your invoices will appear here once you have billing activity"),n()())}function Te(i,c){if(i&1&&(t(0,"div",14)(1,"div",75),V(2,Ee,17,9,"div",76,$().trackByInvoiceId,!0,Ie,7,0,"div",77),n()()),i&2){let e=d(2);o(2),z(e.invoices())}}function Be(i,c){i&1&&(t(0,"span",93),a(1,"Default"),n())}function De(i,c){if(i&1){let e=y();t(0,"button",47),m("click",function(){u(e);let l=d().$implicit,b=d(3);return _(b.setDefaultPayment(l))}),a(1,"Set Default"),n(),t(2,"button",95),m("click",function(){u(e);let l=d().$implicit,b=d(3);return _(b.removePayment(l))}),a(3,"Remove"),n()}}function Ve(i,c){if(i&1&&(t(0,"div",91)(1,"div",49),v(),t(2,"svg",32),s(3,"path"),n()(),x(),t(4,"div",92)(5,"span",51),a(6),T(7,"titlecase"),n(),t(8,"span",52),a(9),n(),t(10,"span",53),a(11),n()(),p(12,Be,2,0,"span",93),t(13,"div",94),p(14,De,4,0),n()()),i&2){let e=c.$implicit,r=d(3);M("default",e.isDefault),o(3),R("d",r.getCardIcon((e.card==null?null:e.card.brand)||"visa")),o(3),P(G(7,9,e.card==null?null:e.card.brand)),o(3),h("\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 ",e.card==null?null:e.card.last4),o(2),O("Expires ",e.card==null?null:e.card.expMonth,"/",e.card==null?null:e.card.expYear),o(),g(e.isDefault?12:-1),o(2),g(e.isDefault?-1:14)}}function ze(i,c){i&1&&(t(0,"div",90),v(),t(1,"svg",32),s(2,"path",10),n(),x(),t(3,"h3"),a(4,"No Payment Methods"),n(),t(5,"p"),a(6,"Add a payment method to keep your subscription active"),n()())}function Ue(i,c){if(i&1&&(t(0,"div",97)(1,"span",98),a(2,"Address"),n(),t(3,"span",99),a(4),s(5,"br"),a(6),s(7,"br"),a(8),n()()),i&2){let e=d(4);o(4),h(" ",e.billingInfo().address.line1),o(2),J(" ",e.billingInfo().address.city,", ",e.billingInfo().address.state," ",e.billingInfo().address.postalCode),o(2),h(" ",e.billingInfo().address.country," ")}}function Fe(i,c){if(i&1&&(t(0,"div",16)(1,"h2",38),a(2,"Billing Information"),n(),t(3,"div",96)(4,"div",97)(5,"span",98),a(6,"Company"),n(),t(7,"span",99),a(8),n()(),t(9,"div",97)(10,"span",98),a(11,"Email"),n(),t(12,"
1span",99),a(13),n()(),p(14,Ue,9,5,"div",97),n()()),i&2){let e=d(3);o(8),P(e.billingInfo().companyName||"Not set"),o(5),P(e.billingInfo().email),o(),g(e.billingInfo().address?14:-1)}}function Ne(i,c){if(i&1){let e=y();t(0,"div",14)(1,"div",16)(2,"div",46)(3,"h2",38),a(4,"Payment Methods"),n(),t(5,"button",86),m("click",function(){u(e);let l=d(2);return _(l.openPaymentModal())}),v(),t(6,"svg",83),s(7,"path",87),n(),a(8," Add Card "),n()(),x(),t(9,"div",88),V(10,Ve,15,11,"div",89,$().trackByPaymentId,!0,ze,7,0,"div",90),n()(),p(13,Fe,15,3,"div",16),n()}if(i&2){let e=d(2);o(10),z(e.paymentMethods()),o(3),g(e.billingInfo()?13:-1)}}function Ae(i,c){if(i&1&&(p(0,he,4,3,"div",14),p(1,ke,11,4,"div",14),p(2,Te,5,1,"div",14),p(3,Ne,14,2,"div",14)),i&2){let e=d();g(e.activeTab()==="overview"?0:-1),o(),g(e.activeTab()==="plans"?1:-1),o(),g(e.activeTab()==="invoices"?2:-1),o(),g(e.activeTab()==="payment"?3:-1)}}function Ge(i,c){if(i&1&&a(0),i&2){let e=d(2).$implicit;h(" (",e.limit,") ")}}function Le(i,c){if(i&1&&(t(0,"div",113),v(),t(1,"svg",32),s(2,"path",73),n(),a(3),p(4,Ge,1,1),n()),i&2){let e=d().$implicit;o(3),h(" ",e.name," "),o(),g(e.limit?4:-1)}}function He(i,c){if(i&1&&p(0,Le,5,2,"div",113),i&2){let e=c.$implicit;g(e.included?0:-1)}}function $e(i,c){i&1&&s(0,"span",112)}function Re(i,c){if(i&1){let e=y();t(0,"div",100),m("click",function(){u(e);let l=d();return _(l.closeUpgradeModal())}),t(1,"div",101),m("click",function(l){return l.stopPropagation()}),t(2,"div",102)(3,"h2"),a(4),n(),t(5,"button",103),m("click",function(){u(e);let l=d();return _(l.closeUpgradeModal())}),v(),t(6,"svg",32),s(7,"path",74),n()()(),x(),t(8,"div",104)(9,"div",105)(10,"div",106)(11,"span",19),a(12),n(),t(13,"span",21),a(14),n()(),t(15,"p",107),a(16),n(),t(17,"div",108),V(18,He,1,1,null,null,ce),n()()(),t(20,"div",109)(21,"button",110),m("click",function(){u(e);let l=d();return _(l.closeUpgradeModal())}),a(22,"Cancel"),n(),t(23,"button",111),m("click",function(){u(e);let l=d();return _(l.confirmUpgrade())}),p(24,$e,1,0,"span",112),a(25," Confirm Upgrade "),n()()()()}if(i&2){let e=d();o(4),h("Upgrade to ",e.selectedPlan().name),o(8),h("",e.selectedPlan().name," Plan"),o(2),O(" ",e.formatPrice(e.getPlanPrice(e.selectedPlan()))," / ",e.billingCycle()==="annual"?"year":"month"," "),o(2),P(e.selectedPlan().description),o(2),z(e.selectedPlan().features.slice(0,4)),o(5),N("disabled",e.isSaving()),o(),g(e.isSaving()?24:-1)}}function je(i,c){i&1&&s(0,"span",112)}function Ye(i,c){if(i&1){let e=y();t(0,"div",100),m("click",function(){u(e);let l=d();return _(l.closeCancelModal())}),t(1,"div",114),m("click",function(l){return l.stopPropagation()}),t(2,"div",115)(3,"h2"),a(4,"Cancel Subscription"),n(),t(5,"button",103),m("click",function(){u(e);let l=d();return _(l.closeCancelModal())}),v(),t(6,"svg",32),s(7,"path",74),n()()(),x(),t(8,"div",104)(9,"div",116),v(),t(10,"svg",32),s(11,"path",33),n()(),x(),t(12,"p",117),a(13,"Are you sure you want to cancel your subscription?"),n(),t(14,"p",118),a(15," You'll continue to have access until the end of your current billing period. After that, you'll be downgraded to the Free plan. "),n()(),t(16,"div",109)(17,"button",110),m("click",function(){u(e);let l=d();return _(l.closeCancelModal())}),a(18,"Keep Subscription"),n(),t(19,"button",119),m("click",function(){u(e);let l=d();return _(l.confirmCancel())}),p(20,je,1,0,"span",112),a(21," Cancel Subscription "),n()()()()}if(i&2){let e=d();o(19),N("disabled",e.isSaving()),o(),g(e.isSaving()?20:-1)}}function qe(i,c){i&1&&s(0,"span",112)}function Je(i,c){if(i&1){let e=y();t(0,"div",100),m("click",function(){u(e);let l=d();return _(l.closePaymentModal())}),t(1,"div",101),m("click",function(l){return l.stopPropagation()}),t(2,"div",102)(3,"h2"),a(4,"Add Payment Method"),n(),t(5,"button",103),m("click",function(){u(e);let l=d();return _(l.closePaymentModal())}),v(),t(6,"svg",32),s(7,"path",74),n()()(),x(),t(8,"form",120),m("ngSubmit",function(){u(e);let l=d();return _(l.submitPayment())}),t(9,"div",104)(10,"div",121)(11,"label",122),a(12,"Card Number"),n(),s(13,"input",123),n(),t(14,"div",124)(15,"div",121)(16,"label",122),a(17,"Expiry Date"),n(),s(18,"input",125),n(),t(19,"div",121)(20,"label",122),a(21,"CVC"),n(),s(22,"input",126),n()(),t(23,"div",121)(24,"label",122),a(25,"Name on Card"),n(),s(26,"input",127),n(),t(27,"p",128),v(
1),t(28,"svg",83),s(29,"path",129),n(),a(30," Your payment information is encrypted and secure "),n()(),x(),t(31,"div",109)(32,"button",110),m("click",function(){u(e);let l=d();return _(l.closePaymentModal())}),a(33,"Cancel"),n(),t(34,"button",130),p(35,qe,1,0,"span",112),a(36," Add Card "),n()()()()()}if(i&2){let e=d();o(8),N("formGroup",e.paymentForm),o(5),M("error",e.hasError("cardNumber")),o(5),M("error",e.hasError("expiry")),o(4),M("error",e.hasError("cvc")),o(4),M("error",e.hasError("name")),o(8),N("disabled",e.paymentForm.invalid||e.isSaving()),o(),g(e.isSaving()?35:-1)}}var dt=(()=>{class i{constructor(){this.fb=F(oe),this.billingService=F(de),this.activeTab=C("overview"),this.billingCycle=C("monthly"),this.showUpgradeModal=C(!1),this.showCancelModal=C(!1),this.showPaymentModal=C(!1),this.selectedPlan=C(null),this.subscription=this.billingService.subscription,this.plans=this.billingService.plans,this.paymentMethods=this.billingService.paymentMethods,this.invoices=this.billingService.invoices,this.usage=this.billingService.usage,this.billingInfo=this.billingService.billingInfo,this.isLoading=this.billingService.isLoading,this.isSaving=this.billingService.isSaving,this.currentPlan=this.billingService.currentPlan,this.defaultPaymentMethod=this.billingService.defaultPaymentMethod,this.canUpgrade=this.billingService.canUpgrade,this.annualSavings=k(()=>{let e=this.currentPlan();return e?e.monthlyPrice*12-e.annualPrice:0})}ngOnInit(){this.initForm(),this.loadData()}initForm(){this.paymentForm=this.fb.group({cardNumber:["",[L.required]],expiry:["",[L.required]],cvc:["",[L.required]],name:["",[L.required]]})}loadData(){this.billingService.getSubscription().subscribe(),this.billingService.getPlans().subscribe(),this.billingService.getPaymentMethods().subscribe(),this.billingService.getInvoices().subscribe(),this.billingService.getUsage().subscribe(),this.billingService.getBillingInfo().subscribe()}setTab(e){this.activeTab.set(e)}setBillingCycle(e){this.billingCycle.set(e)}openUpgradeModal(e){this.selectedPlan.set(e),this.showUpgradeModal.set(!0)}closeUpgradeModal(){this.showUpgradeModal.set(!1),this.selectedPlan.set(null)}confirmUpgrade(){let e=this.selectedPlan();e&&this.billingService.updateSubscription({planId:e.id,billingCycle:this.billingCycle()}).subscribe({next:()=>{this.closeUpgradeModal(),this.activeTab.set("overview")}})}openCancelModal(){this.showCancelModal.set(!0)}closeCancelModal(){this.showCancelModal.set(!1)}confirmCancel(){this.billingService.cancelSubscription().subscribe({next:()=>this.closeCancelModal()})}resumeSubscription(){this.billingService.resumeSubscription().subscribe()}openPaymentModal(){this.paymentForm.reset(),this.showPaymentModal.set(!0)}closePaymentModal(){this.showPaymentModal.set(!1),this.paymentForm.reset()}submitPayment(){if(this.paymentForm.invalid){this.paymentForm.markAllAsTouched();return}let e="tok_"+Math.random().toString(36).substring(7);this.billingService.addPaymentMethod(e).subscribe({next:()=>this.closePaymentModal()})}setDefaultPayment(e){this.billingService.setDefaultPaymentMethod(e.id).subscribe()}removePayment(e){e.isDefault||this.billingService.removePaymentMethod(e.id).subscribe()}downloadInvoice(e){this.billingService.downloadInvoice(e.id)}formatPrice(e){return this.billingService.formatPrice(e)}formatDate(e){return this.billingService.formatDate(e)}getCardIcon(e){let r={visa:"M2 6h20v12H2V6zm3 3v6h14V9H5zm0 2h4v2H5v-2z",mastercard:"M12 4C7.58 4 4 7.58 4 12s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm-2.5 11.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5c.97 0 1.85.4 2.49 1.04a3.48 3.48 0 010 4.92A3.48 3.48 0 019.5 15.5zm5 0c-.97 0-1.85-.4-2.49-1.04a3.48 3.48 0 010-4.92 3.48 3.48 0 012.49-1.04c1.93 0 3.5 1.57 3.5 3.5s-1.57 3.5-3.5 3.5z",amex:"M2 6h20v12H2V6zm4 3l-2 6h3l.5-1h3l.5 1h3l-2-6H6zm1.5 2h2l1 3h-4l1-3z"};return r[e.toLowerCase()]||r.visa}getPlanPrice(e){return this.billingCycle()==="annual"?e.annualPrice:e.monthlyPrice}isCurrentPlan(e){return this.subscription()?.planId===e.id}getUsageColor(e){return e>=90?"critical":e>=75?"warning":"normal"}getStatusClass(e){return{paid:"success",pending:"warning",failed:"danger",active:"success",trialing:"info",past_due:"warning",cancelled:"danger"}[e]||""}hasError(e){let r=this.paymentForm.get(e);return!!(r&&r.invalid&&r.touched)}trackByPlanId(e,r){return r.id}trackByInvoiceId(e,r){return r.id}trackByPaymentId(e,r){return r.id}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=q({type:i,selectors:[["app-billing"]],decls:29,vars:12,consts:[[1,"billing-page"],[1,"page-header"],[1,"header-content"],[1,"subtitle"],[1,"tab-nav"],[1,"tab-btn",3,"click"],["viewBox","0 0 24 24","fill","currentColor","width","18","height","18"],["d","M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z"],["d","M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 14l-5-5 1.41-1.41L12 14.17l7.59-7.59L21 8l-9 9z"],["d","M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"],["d","M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"],[1,"loading-state"],[1,"modal-overlay"],[1,"spinner"],[1,"tab-content"],[1,"plan-card"],[1,"section"],[1,"plan-card-header"],[1,"plan-info"],[1,"plan-name"],[1,"status-badge"],[1,"plan-price"],[1,"price"],[1,"period"],[1,"plan-card-body"],[1,"plan-detail"],[1,"detail-label"],[1,"detail-value"],[1,"cancel-notice"],[1,"plan-card-actions"],[1,"btn","btn-primary"],[1,"btn","btn-ghost"],["viewBox","0 0 24 24","fill","currentColor"],["d","M1 21h22L12 2
11 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"],[1,"btn","btn-sm","btn-secondary",3,"click"],[1,"btn","btn-primary",3,"click"],["d","M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"],[1,"btn","btn-ghost",3,"click"],[1,"section-title"],[1,"usage-grid"],[1,"usage-card"],[1,"usage-header"],[1,"usage-label"],[1,"usage-value"],[1,"usage-bar"],[1,"usage-fill"],[1,"section-header"],[1,"btn","btn-ghost","btn-sm",3,"click"],[1,"payment-summary"],[1,"card-icon"],[1,"card-info"],[1,"card-brand"],[1,"card-number"],[1,"card-expiry"],[1,"billing-toggle"],[1,"toggle-btn",3,"click"],[1,"save-badge"],[1,"plans-grid"],[1,"plan-option",3,"recommended","current"],[1,"plan-option"],[1,"recommended-badge"],[1,"plan-option-header"],[1,"plan-option-name"],[1,"plan-option-desc"],[1,"plan-option-price"],[1,"features-list"],[3,"included"],[1,"plan-option-footer"],["disabled","",1,"btn","btn-secondary"],[1,"btn","btn-secondary"],["viewBox","0 0 24 24","fill","currentColor",1,"check"],["viewBox","0 0 24 24","fill","currentColor",1,"x"],[1,"feature-limit"],["d","M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"],[1,"invoices-list"],[1,"invoice-row"],[1,"empty-state"],[1,"invoice-info"],[1,"invoice-number"],[1,"invoice-date"],[1,"invoice-desc"],[1,"invoice-amount"],["viewBox","0 0 24 24","fill","currentColor","width","16","height","16"],["d","M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"],["d","M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"],[1,"btn","btn-primary","btn-sm",3,"click"],["d","M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"],[1,"payment-methods"],[1,"payment-card",3,"default"],[1,"empty-state","small"],[1,"payment-card"],[1,"card-details"],[1,"default-badge"],[1,"card-actions"],[1,"btn","btn-ghost","btn-sm","danger",3,"click"],[1,"billing-info-card"],[1,"billing-row"],[1,"billing-label"],[1,"billing-value"],[1,"modal-overlay",3,"click"],[1,"modal",3,"click"],[1,"modal-header"],[1,"close-btn",3,"click"],[1,"modal-body"],[1,"upgrade-summary"],[1,"upgrade-plan"],[1,"upgrade-desc"],[1,"upgrade-features"],[1,"modal-footer"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"],[1,"spinner-sm"],[1,"feature-item"],[1,"modal","modal-sm",3,"click"],[1,"modal-header","danger"],[1,"warning-icon"],[1,"modal-text"],[1,"modal-subtext"],["type","button",1,"btn","btn-danger",3,"click","disabled"],[3,"ngSubmit","formGroup"],[1,"form-group"],[1,"form-label"],["type","text","formControlName","cardNumber","placeholder","1234 5678 9012 3456",1,"form-input"],[1,"form-row"],["type","text","formControlName","expiry","placeholder","MM/YY",1,"form-input"],["type","text","formControlName","cvc","placeholder","123",1,"form-input"],["type","text","formControlName","name","placeholder","John Doe",1,"form-input"],[1,"security-note"],["d","M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(r,l){r&1&&(t(0,"div",0)(1,"header",1)(2,"div",2)(3,"h1"),a(4,"Billing & Subscription"),n(),t(5,"p",3),a(6,"Manage your plan, payment methods, and invoices"),n()()(),t(7,"nav",4)(8,"button",5),m("click",function(){return l.setTab("overview")}),v(),t(9,"svg",6),s(10,"path",7),n(),a(11," Overview "),n(),x(),t(12,"button",5),m("click",function(){return l.setTab("plans")}),v(),t(13,"svg",6),s(14,"path",8),n(),a(15," Plans "),n(),x(),t(16,"button",5),m("click",function(){return l.setTab("invoices")}),v(),t(17,"svg",6),s(18,"path",9),n(),a(19," Invoices "),n(),x(),t(20,"button",5),m("click",function(){return l.setTab("payment")}),v(),t(21,"svg",6),s(22,"path",10),n(),a(23," Payment "),n()(),p(24,me,4,0,"div",11)(25,Ae,4,4),n(),p(26,Re,26,7,"div",12),p(27,Ye,22,2,"div",12),p(28,Je,37,11,"div",12)),r&2&&(o(8),M("active",l.activeTab()==="overview"),o(4),M("active",l.activeTab()==="plans"),o(4),M("active",l.activeTab()==="invoices"),o(4),M("active",l.activeTab()==="payment"),o(4),g(l.isLoading()?24:25),o(2),g(l.showUpgradeModal()&&l.selectedPlan()?26:-1),o(),g(l.showCancelModal()?27:-1),o(),g(l.showPaymentModal()?28:-1))},dependencies:[Q,re,ne,X,ee,te,le,ae,ie,Z,K],styles:[".billing-page[_ngcontent-%COMP%]{padding:2rem;max-width:1200px;background:linear-gradient(135deg,#f8fafc,#eef2ff);min-height:100vh}.page-header[_ngcontent-%COMP%]{margin-bottom:2rem}.page-header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:2rem;font-weight:800;color:var(--gray-900);margin-bottom:.25rem;background:linear-gradient(135deg,#1e293b,#475569);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}.page-header[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{color:var(--text-secondary);font-size:.9375rem}.tab-nav[_ngcontent-%COMP%]{display:flex;gap:.5rem;margin-bottom:2rem;padding:.25rem;background:var(--bg-primary);border-radius:var(--radius-xl);box-shadow:var(--shadow-md);border:1px solid var(--border-light);width:fit-content;flex-wrap:wrap}.tab-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.25rem;font-size:.875rem;font-weight:600;color:var(--text-secondary);background:transparent;border:none;border-radius:var(--radius-lg);cursor:pointer;transition:all var(--transition-fast)}.tab-btn[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{opacity:.7}.tab-btn[_ngcontent-%COMP%]:hover{color:var(--text-primary);background:var(--gray-100)}.tab-btn.active[_ngcontent-%COMP%]{background:linear-gradient(135deg,var(--primary-600) 0%,var(--primary-700) 100%);color:#fff;box-shadow:var(--shadow-md)}.tab-btn.active[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{opacity:1}.loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:6rem;gap:1rem}.loading-state[_ngcontent-%COMP%] .spinner[_ngcontent-%COMP%]{width:48px;height:48px;border:4px solid var(--gray-200);border-top-color:var(--primary-600);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}.loading-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--text-secondary);font-size:.9375rem}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.tab-content[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fadeIn .3s ease}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.plan-card[_ngcontent-%COMP%]{background:var(--bg-primary);border-radius:var(--radius-xl);box-shadow:var(--shadow-lg);border:1px solid var(--border-light);overflow:hidden;margin-bottom:2rem}.plan-card-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:1.5rem;background:linear-gradient(135deg,var(--primary-600),var(--primary-700));color:#fff}.plan-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem}
1.plan-name[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:700}.plan-price[_ngcontent-%COMP%]{text-align:right}.plan-price[_ngcontent-%COMP%] .price[_ngcontent-%COMP%]{font-size:1.75rem;font-weight:700}.plan-price[_ngcontent-%COMP%] .period[_ngcontent-%COMP%]{font-size:.875rem;opacity:.9}.plan-card-body[_ngcontent-%COMP%]{padding:1.5rem}.plan-detail[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding:.75rem 0;border-bottom:1px solid var(--border-light)}.plan-detail[_ngcontent-%COMP%]:last-child{border-bottom:none}.detail-label[_ngcontent-%COMP%]{color:var(--text-secondary);font-size:.875rem}.detail-value[_ngcontent-%COMP%]{font-weight:500;color:var(--text-primary)}.cancel-notice[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:1rem;background:#fef3c7;border-radius:var(--radius-lg);margin-top:1rem}.cancel-notice[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:20px;height:20px;color:#d97706;flex-shrink:0}.cancel-notice[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1;font-size:.875rem;color:#92400e}.plan-card-actions[_ngcontent-%COMP%]{display:flex;gap:1rem;padding:1rem 1.5rem;border-top:1px solid var(--border-light);background:var(--gray-50)}.section[_ngcontent-%COMP%]{margin-bottom:2rem}.section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.section-title[_ngcontent-%COMP%]{font-size:1.125rem;font-weight:600;color:var(--text-primary)}.usage-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}@media(max-width:768px){.usage-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.usage-card[_ngcontent-%COMP%]{background:var(--bg-primary);border-radius:var(--radius-lg);padding:1.25rem;box-shadow:var(--shadow-md);border:1px solid var(--border-light)}.usage-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:.75rem}.usage-label[_ngcontent-%COMP%]{font-size:.875rem;color:var(--text-secondary)}.usage-value[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;color:var(--text-primary)}.usage-bar[_ngcontent-%COMP%]{height:8px;background:var(--gray-200);border-radius:var(--radius-full);overflow:hidden}.usage-fill[_ngcontent-%COMP%]{height:100%;border-radius:var(--radius-full);transition:width .5s ease}.usage-fill.normal[_ngcontent-%COMP%]{background:linear-gradient(90deg,#22c55e,#16a34a)}.usage-fill.warning[_ngcontent-%COMP%]{background:linear-gradient(90deg,#f59e0b,#d97706)}.usage-fill.critical[_ngcontent-%COMP%]{background:linear-gradient(90deg,#ef4444,#dc2626)}.payment-summary[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1.25rem;background:var(--bg-primary);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);border:1px solid var(--border-light)}.card-icon[_ngcontent-%COMP%]{width:48px;height:32px;display:flex;align-items:center;justify-content:center;background:var(--gray-100);border-radius:var(--radius-md)}.card-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:28px;height:20px;color:var(--text-secondary)}.card-info[_ngcontent-%COMP%]{flex:1}.card-info[_ngcontent-%COMP%] .card-brand[_ngcontent-%COMP%]{font-weight:600;color:var(--text-primary)}.card-info[_ngcontent-%COMP%] .card-number[_ngcontent-%COMP%]{font-size:.875rem;color:var(--text-secondary);margin-left:.5rem}.card-expiry[_ngcontent-%COMP%]{font-size:.875rem;color:var(--text-muted)}.billing-toggle[_ngcontent-%COMP%]{display:flex;background:var(--bg-primary);border-radius:var(--radius-lg);padding:.25rem;box-shadow:var(--shadow-md);border:1px solid var(--border-light);width:fit-content;margin-bottom:2rem}.toggle-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;font-size:.9375rem;font-weight:600;color:var(--text-secondary);background:transparent;border:none;border-radius:var(--radius-md);cursor:pointer;transition:all var(--transition-fast)}.toggle-btn[_ngcontent-%COMP%]:hover{color:var(--text-primary)}.toggle-btn.active[_ngcontent-%COMP%]{background:linear-gradient(135deg,var(--primary-600),var(--primary-700));color:#fff}.save-badge[_ngcontent-%COMP%]{padding:.125rem .5rem;font-size:.6875rem;font-weight:700;background:#22c55e;color:#fff;border-radius:var(--radius-full);text-transform:uppercase}.active[_ngcontent-%COMP%] .save-badge[_ngcontent-%COMP%]{background:#ffffff4d}.plans-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,1fr);gap:1.5rem}@media(max-width:1200px){.plans-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}}@media(max-width:640px){.plans-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.plan-option[_ngcontent-%COMP%]{position:relative;background:var(--bg-primary);border-radius:var(--radius-xl);box-shadow:var(--shadow-md);border:2px solid var(--border-light);padding:1.5rem;transition:all var(--transition-base)}.plan-option[_ngcontent-%COMP%]:hover{box-shadow:var(--shadow-lg);transform:translateY(-4px)}.plan-option.recommended[_ngcontent-%COMP%]{border-color:var(--primary-500);box-shadow:var(--shadow-lg),0 0 0 1px var(--primary-200)}.plan-option.current[_ngcontent-%COMP%]{border-color:#22c55e;background:linear-gradient(135deg,#f0fdf4,#dcfce7)}.recommended-badge[_ngcontent-%COMP%]{position:absolute;top:-12px;left:50%;transform:translate(-50%);padding:.25rem .75rem;font-size:.6875rem;font-weight:700;background:linear-gradient(135deg,var(--primary-600),var(--primary-700));color:#fff;border-radius:var(--radius-full);text-transform:uppercase;letter-spacing:.03em}.plan-option-header[_ngcontent-%COMP%]{text-align:center;margin-bottom:1.5rem}
1.plan-option-name[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:700;color:var(--text-primary)}.plan-option-desc[_ngcontent-%COMP%]{font-size:.875rem;color:var(--text-secondary);margin-top:.25rem}.plan-option-price[_ngcontent-%COMP%]{margin-top:1rem}.plan-option-price[_ngcontent-%COMP%] .price[_ngcontent-%COMP%]{font-size:2rem;font-weight:800;color:var(--text-primary)}.plan-option-price[_ngcontent-%COMP%] .period[_ngcontent-%COMP%]{font-size:.875rem;color:var(--text-muted)}.features-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0 0 1.5rem}.features-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.5rem 0;font-size:.875rem;color:var(--text-secondary)}.features-list[_ngcontent-%COMP%] li.included[_ngcontent-%COMP%]{color:var(--text-primary)}.features-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:18px;height:18px;flex-shrink:0;margin-top:1px}.features-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%] svg.check[_ngcontent-%COMP%]{color:#22c55e}.features-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%] svg.x[_ngcontent-%COMP%]{color:var(--gray-400)}.feature-limit[_ngcontent-%COMP%]{color:var(--text-muted);font-size:.8125rem}.plan-option-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{width:100%}.invoices-list[_ngcontent-%COMP%]{background:var(--bg-primary);border-radius:var(--radius-xl);box-shadow:var(--shadow-md);border:1px solid var(--border-light);overflow:hidden}.invoice-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1rem 1.5rem;border-bottom:1px solid var(--border-light)}.invoice-row[_ngcontent-%COMP%]:last-child{border-bottom:none}.invoice-info[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:140px}.invoice-number[_ngcontent-%COMP%]{font-weight:600;color:var(--text-primary)}.invoice-date[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--text-muted)}.invoice-desc[_ngcontent-%COMP%]{flex:1;font-size:.9375rem;color:var(--text-secondary)}.invoice-amount[_ngcontent-%COMP%]{font-weight:600;color:var(--text-primary);min-width:80px;text-align:right}.status-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.25rem .75rem;font-size:.75rem;font-weight:600;border-radius:var(--radius-full);text-transform:uppercase;letter-spacing:.03em}.status-badge.success[_ngcontent-%COMP%]{background:#dcfce7;color:#166534}.status-badge.warning[_ngcontent-%COMP%]{background:#fef3c7;color:#92400e}.status-badge.danger[_ngcontent-%COMP%]{background:#fee2e2;color:#991b1b}.status-badge.info[_ngcontent-%COMP%]{background:#dbeafe;color:#1e40af}.payment-methods[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.payment-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1.25rem;background:var(--bg-primary);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);border:1px solid var(--border-light)}.payment-card.default[_ngcontent-%COMP%]{border-color:var(--primary-300);background:var(--primary-50)}.card-details[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.125rem}.card-details[_ngcontent-%COMP%] .card-brand[_ngcontent-%COMP%]{font-weight:600;color:var(--text-primary)}.card-details[_ngcontent-%COMP%] .card-number[_ngcontent-%COMP%]{font-size:.875rem;color:var(--text-secondary);font-family:var(--font-mono)}.card-details[_ngcontent-%COMP%] .card-expiry[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--text-muted)}.default-badge[_ngcontent-%COMP%]{padding:.25rem .5rem;font-size:.6875rem;font-weight:600;background:var(--primary-100);color:var(--primary-700);border-radius:var(--radius-full);text-transform:uppercase}.card-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.billing-info-card[_ngcontent-%COMP%]{background:var(--bg-primary);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);border:1px solid var(--border-light);padding:1.5rem}.billing-row[_ngcontent-%COMP%]{display:flex;padding:.75rem 0;border-bottom:1px solid var(--border-light)}.billing-row[_ngcontent-%COMP%]:last-child{border-bottom:none}.billing-label[_ngcontent-%COMP%]{width:120px;font-size:.875rem;color:var(--text-secondary)}.billing-value[_ngcontent-%COMP%]{flex:1;font-weight:500;color:var(--text-primary);line-height:1.5}.empty-state[_ngcontent-%COMP%]{text-align:center;padding:4rem 1.5rem}.empty-state.small[_ngcontent-%COMP%]{padding:2rem 1.5rem}.empty-state[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:64px;
1height:64px;color:var(--gray-300);margin-bottom:1rem}.empty-state[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:1.125rem;font-weight:600;color:var(--text-primary);margin-bottom:.5rem}.empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--text-secondary)}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.75rem 1.5rem;font-size:.9375rem;font-weight:600;line-height:1.5;border:none;border-radius:var(--radius-lg);cursor:pointer;transition:all var(--transition-base);text-decoration:none}.btn[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.btn-primary[_ngcontent-%COMP%]{background:linear-gradient(135deg,var(--primary-600) 0%,var(--primary-700) 100%);color:var(--text-inverse);box-shadow:var(--shadow-md)}.btn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:linear-gradient(135deg,var(--primary-700) 0%,var(--primary-800) 100%);box-shadow:var(--shadow-lg);transform:translateY(-1px)}.btn-secondary[_ngcontent-%COMP%]{background:var(--bg-primary);color:var(--text-primary);border:2px solid var(--border-default)}.btn-secondary[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--primary-500);color:var(--primary-600)}.btn-ghost[_ngcontent-%COMP%]{background:transparent;color:var(--text-secondary);padding:.5rem .75rem}.btn-ghost[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--gray-100);color:var(--text-primary)}.btn-ghost.danger[_ngcontent-%COMP%]:hover:not(:disabled){background:#fee2e2;color:#dc2626}.btn-danger[_ngcontent-%COMP%]{background:#ef4444;color:#fff}.btn-danger[_ngcontent-%COMP%]:hover:not(:disabled){background:#dc2626}.btn-sm[_ngcontent-%COMP%]{padding:.5rem .75rem;font-size:.8125rem}.spinner-sm[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:_ngcontent-%COMP%_spin .75s linear infinite}.modal-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000;padding:1rem;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);animation:_ngcontent-%COMP%_fadeIn .2s ease}.modal[_ngcontent-%COMP%]{width:100%;max-width:480px;background:var(--bg-primary);border-radius:var(--radius-xl);box-shadow:var(--shadow-xl);animation:_ngcontent-%COMP%_slideUp .3s ease}.modal.modal-sm[_ngcontent-%COMP%]{max-width:400px}@keyframes _ngcontent-%COMP%_slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.modal-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:1.25rem 1.5rem;border-bottom:1px solid var(--border-light)}.modal-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:1.125rem;font-weight:600;color:var(--text-primary)}.modal-header.danger[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{color:#dc2626}.close-btn[_ngcontent-%COMP%]{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--text-secondary);border-radius:var(--radius-md);cursor:pointer;transition:all var(--transition-fast)}.close-btn[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:20px;height:20px}.close-btn[_ngcontent-%COMP%]:hover{background:var(--gray-100);color:var(--text-primary)}.modal-body[_ngcontent-%COMP%]{padding:1.5rem}.modal-text[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--text-secondary);text-align:center;margin-bottom:.5rem}.modal-text[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-primary)}.modal-subtext[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--text-muted);text-align:center}.warning-icon[_ngcontent-%COMP%]{width:64px;height:64px;margin:0 auto 1rem;display:flex;align-items:center;justify-content:center;background:#fef3c7;border-radius:50%}.warning-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:32px;height:32px;color:#d97706}.modal-footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.75rem;padding:1rem 1.5rem;border-top:1px solid var(--border-light);background:var(--gray-50);border-radius:0 0 var(--radius-xl) var(--radius-xl)}.upgrade-summary[_ngcontent-%COMP%]{text-align:center}.upgrade-plan[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;margin-bottom:1rem}
1.upgrade-plan[_ngcontent-%COMP%] .plan-name[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:700;color:var(--text-primary)}.upgrade-plan[_ngcontent-%COMP%] .plan-price[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:600;color:var(--primary-600)}.upgrade-desc[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--text-secondary);margin-bottom:1.5rem}.upgrade-features[_ngcontent-%COMP%]{text-align:left;background:var(--gray-50);border-radius:var(--radius-lg);padding:1rem}.feature-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.375rem 0;font-size:.875rem;color:var(--text-primary)}.feature-item[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:18px;height:18px;color:#22c55e}.form-group[_ngcontent-%COMP%]{margin-bottom:1.25rem}.form-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}.form-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;font-size:.875rem;color:var(--text-primary)}.form-input[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:.9375rem;border:2px solid var(--border-light);border-radius:var(--radius-lg);background:var(--bg-primary);color:var(--text-primary);transition:all var(--transition-fast)}.form-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--primary-500);box-shadow:0 0 0 3px #6366f11a}.form-input[_ngcontent-%COMP%]::placeholder{color:var(--text-muted)}.form-input.error[_ngcontent-%COMP%]{border-color:#ef4444}.security-note[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:.8125rem;color:var(--text-muted);margin-top:1rem}.security-note[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{color:#22c55e}@media(max-width:768px){.billing-page[_ngcontent-%COMP%]{padding:1.25rem}.page-header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:1.5rem}.tab-nav[_ngcontent-%COMP%]{width:100%;overflow-x:auto;flex-wrap:nowrap}.tab-btn[_ngcontent-%COMP%]{flex-shrink:0;padding:.625rem 1rem;font-size:.8125rem}.plan-card-header[_ngcontent-%COMP%]{flex-direction:column;gap:1rem;text-align:center}.invoice-row[_ngcontent-%COMP%]{flex-wrap:wrap;gap:.5rem}.invoice-row[_ngcontent-%COMP%] .invoice-desc[_ngcontent-%COMP%]{width:100%;order:3}.payment-card[_ngcontent-%COMP%]{flex-wrap:wrap}.card-actions[_ngcontent-%COMP%]{width:100%;margin-top:.5rem;justify-content:flex-end}}@media(max-width:480px){.form-row[_ngcontent-%COMP%]{grid-template-columns:1fr}}"]})}}return i})();export{dt as BillingComponent};
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.