PageSourceSearch

https://app.qeen.ai/_nuxt/DN2MGnlF.js

js qeen.ai collected 2026-09-24 09:48:08 UTC 6,766 bytes, 1 lines download raw bytes

1import{_ as F}from"./BdPw6rnu.js";import{g as G,p as M,r as z,K as $,A as d,c as a,a as t,t as o,k as e,E as H,d as _,q as T,b as J,w as Q,S as W,o as l,y as X}from"./D8JAWOXc.js";import{u as Y}from"./BBOnd2Dq.js";import{u as Z}from"./BQD4DTa-.js";import{_ as tt}from"./DlAUqK2U.js";import"./XXI8HlUT.js";const et={class:"container mx-auto p-6 max-w-2xl"},st={class:"bg-white rounded-lg shadow-md p-6"},ot={class:"text-3xl font-bold text-gray-900 mb-6"},nt={key:0,class:"flex justify-center items-center py-8"},rt={class:"ml-3 text-gray-600"},it={key:1,class:"bg-red-50 border border-red-200 rounded-md p-4 mb-6"},at={class:"flex"},lt={class:"ml-3"},ct={class:"text-sm font-medium text-red-800"},dt={class:"mt-2 text-sm text-red-700"},ut={key:2,class:"space-y-6"},_t={class:"bg-gray-50 rounded-lg p-6"},mt={class:"text-xl font-semibold text-gray-900 mb-4"},pt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},gt={class:"block text-sm font-medium text-gray-700"},xt={class:"mt-1 text-sm text-gray-900"},ft={class:"block text-sm font-medium text-gray-700"},bt={class:"flex items-center gap-2 flex-wrap"},ht={key:0,class:"inline-flex items-center px-2 py-1 text-xs font-medium rounded-full bg-gray-100 text-gray-700"},vt={class:"bg-gray-50 rounded-lg p-6"},yt={class:"text-lg font-semibold text-gray-900 mb-4"},kt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},wt={class:"block text-sm font-medium text-gray-700"},Lt={class:"mt-1 text-sm text-gray-900"},Ct={class:"block text-sm font-medium text-gray-700"},Dt={class:"mt-1 text-sm text-gray-900"},Nt={class:"flex flex-col sm:flex-row gap-4"},Pt=["disabled"],Bt={key:0,class:"pi pi-spin pi-spinner me-2"},St={key:1,class:"pi pi-cog me-2"},Et={key:0,class:"bg-red-50 border border-red-200 rounded-md p-4"},Mt={class:"flex"},zt={class:"ml-3"},Tt={class:"text-sm font-medium text-red-800"},At={class:"mt-2 text-sm text-red-700"},It={__name:"billing",setup(jt){const{t:s,locale:A}=G(),{setTitle:I}=Y(),{refreshAuthToken:j}=W();I(s("billing")),M(()=>{j()});const m=z(typeof navigator<"u"?navigator.language:A.value),V=X(),c=Z(),p=z(!0);M(async()=>{await $();try{await c.checkSubscriptionStatus()}catch(i){console.error("Failed to fetch subscription status:",i)}finally{p.value=!1}});const r=d(()=>c.subscriptionDetails),O=d(()=>p.value||c.isLoadingStatus),g=d(()=>c.statusError),u=d(()=>c.isCreatingPortal),x=d(()=>c.portalError),f=d(()=>V.public.SUBSCRIPTION_PRODUCT_MAPPING),b=Object.keys(f.value).find(i=>{var n;return f.value[i]===((n=r.value)==null?void 0:n.product_id)}),R=b?s(`plan_${b}_title`):"",h=i=>{if(!i)return"N/A";try{return new Date(i).toLocaleDateString(m.value,{year:"numeric",month:"long",day:"numeric"})}catch(n){return console.error("Error formatting date:",n),i}},K=i=>{if(!i)return"N/A";try{return new Date(i).toLocaleDateString(m.value,{month:"short",day:"numeric"})}catch(n){return console.error("Error formatting date:",n),i}},U=async()=>{try{await c.openBillingPortal()}catch(i){console.error("Error opening billing portal:",i)}};return(i,n)=>{var v,y,k,w,L,C,D,N,P,B,S,E;const q=F;return l(),a("div",et,[t("div",st,[t("h1",ot,o(e(s)("billing_subscription")),1),e(O)?(l(),a("div",nt,[n[0]||(n[0]=t("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-green-600"},null,-1)),t("span",rt,o(e(s)("loading_subscription_details")),1)])):e(g)?(l(),a("div",it,[t("div",at,[n[1]||(n[1]=t("div",{class:"flex-shrink-0"},[t("svg",{class:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor"},[t("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"})])],-1)),t("div",lt,[t("h3",ct,o(e(s)("error_loading_subscription")),1),t("div",dt,o(e(g)),1)])])])):(l(),a("div",ut,[t("div",_t,[t("h2",mt,o(e(s)("current_subscription")),1),t("div",pt,[t("div",null,[t("label",gt,o(e(s)("plan")),1),t("p",xt,o(e(R)||e(s)("n/a")),1)]),t("div",null,[t("label",ft,o(e(s)("status")),1),t("div",bt,[t("span",{class:H(["inline-flex px-2 py-1 text-xs font-semibold rounded-full",{"bg-green-100 text-green-800":((v=e(r))==null?void 0:v.status)==="active","bg-red-100 text-red-800":((y=e(r))==null?void 0:y.status)==="cancelled","bg-gray-100 text-gray-800":((k=e(r))==null?void 0:k.status)&&((w=e(r))==null?void 0:w.status)!=="active"&&((L=e(r))==null?void 0:L.status)!=="cancelled"}])},o(((C=e(r))==null?void 0:C.status)==="active"?e(s)("active"):((D=e(r))==null?void 0:D.status)==="cancelled"?e(s)("cancelled"):((N=e(r))==null?void 0:N.status)||e(s)("unknown")),3),(P=e(r))!=null&&P.cancel_at?(l(),a("span",ht,[n[2]||(n[2]=t("svg",{class:"w-3 h-3 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}
1)],-1)),_(" "+o(e(s)("cancelling"))+": "+o(K(e(r).cancel_at)),1)])):T("",!0)])])])]),t("div",vt,[t("h3",yt,o(e(s)("billing_period")),1),t("div",kt,[t("div",null,[t("label",wt,o(e(s)("start_date")),1),t("p",Lt,o(h((B=e(r))==null?void 0:B.current_period_start)),1)]),t("div",null,[t("label",Ct,o(e(s)("next_billing")),1),t("p",Dt,o((S=e(r))!=null&&S.cancel_at?e(s)("no_invoice_at_end"):h((E=e(r))==null?void 0:E.current_period_end)),1)])])]),t("div",Nt,[J(q,{to:"/plans",class:"inline-flex items-center justify-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500"},{default:Q(()=>[n[3]||(n[3]=t("i",{class:"pi pi-list me-2"},null,-1)),_(" "+o(e(s)("view_plans")),1)]),_:1}),t("button",{onClick:U,disabled:e(u),class:"inline-flex items-center justify-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"},[e(u)?(l(),a("i",Bt)):(l(),a("i",St)),_(" "+o(e(u)?e(s)("opening"):e(s)("billing_portal")),1)],8,Pt)]),e(x)?(l(),a("div",Et,[t("div",Mt,[n[4]||(n[4]=t("div",{class:"flex-shrink-0"},[t("svg",{class:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor"},[t("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"})])],-1)),t("div",zt,[t("h3",Tt,o(e(s)("error_opening_billing_portal")),1),t("div",At,o(e(x)),1)])])])):T("",!0)]))])])}}},Ft=tt(It,[["__scopeId","data-v-aa4b9230"]]);export{Ft as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.