1import{Q as r}from"./QCardSection.58bbea8d.js";import{am as U,I as q,r as l,O as w,N as e,K as p,V as s,M as t,T as f,L as S,Z as u,Q as b,X as B,R as I,P as V}from"./index.bf554e03.js";import{Q as k}from"./QCard.23110fef.js";import{Q as z}from"./QDialog.4e32b94d.js";import{Q as N}from"./QBanner.82347e0b.js";import{Q as L}from"./QPage.8c7a8d03.js";import{P as A}from"./PlanSelectCard.9fc4d432.js";import{u as R}from"./network.90d8ad14.js";import{u as T,e as C}from"./token.13043f61.js";import"./use-dark.130db749.js";import"./use-prevent-scroll.5fd69a37.js";import"./use-model-toggle.2791f16d.js";import"./use-timeout.f7edc436.js";import"./use-tick.bb601f36.js";import"./use-transition.c99d129a.js";import"./use-checkbox.7fa6e694.js";import"./option-sizes.ab20310e.js";import"./axios.0ebeb90f.js";import"./index.10303280.js";const E={class:"row justify-center row-full-height items-center"},Y={class:"col col-10 col-sm-8 col-md-6"},$={key:0},j={key:1},F=s("h1",{class:"fontsize-20 inherit text-center"},"Change Plan",-1),K={class:"row"},M={class:"col-2 flex flex-center"},O=s("div",{class:"col-10 fontsize-12"}," You need to change to our premium plan to use that feature. Upgrade now to get started! ",-1),fe={__name:"ChangePlanPage",setup(X){const c=U(),y=q(),_=R(y),P=T(),i=l(!1),Q=c.query.upgrade==="true",d=l(0),m=l(null),h=l(null),g=l(c.query.plan?c.query.plan:"BASIC"),v=l(!0);function D(a){g.value=a.plan,v.value=a.yearly;let o=C(a.plan,a.yearly);o&&_.post("/subscription/preview",{priceId:o}).then(n=>{d.value=n.data.amount_due,m.value=new Date(n.data.created*1e3),h.value=new Date(n.data.period_end*1e3),i.value=!0})}function x(){_.post("/subscription/update",{priceId:C(g.value,v.value)}).then(a=>{P.logIn(a.data.token),y.push({name:"Account"})})}return(a,o)=>(p(),w(L,null,{default:e(()=>[s("div",E,[s("div",Y,[t(z,{modelValue:i.value,"onUpdate:modelValue":o[1]||(o[1]=n=>i.value=n),class:"q-pa-none"},{default:e(()=>[t(k,null,{default:e(()=>[t(r,{class:"fontsize-18 text-center"},{default:e(()=>[f(" Change Plan? ")]),_:1}),t(r,{class:"fontsize-12"},{default:e(()=>[f(" Are you sure you want to change your plan? "),m.value>new Date?(p(),S("span",$,"Since you're in the trial period, you have no payment due until "+u(m.value?m.value.toLocaleDateString("en-US",{day:"numeric",month:"numeric",year:"numeric"}):"")+", at which point you'll be charged the full amount of "+u((d.value/100).toLocaleString("en-US",{style:"currency",currency:"USD"}))+".",1)):(p(),S("span",j,"Your card will be "+u(d.value>=0?"charged":"refunded")+" a prorated rate of "+u((d.value/100).toLocaleString("en-US",{style:"currency",currency:"USD"}))+" to cover the remainder of the billing period, then will be charged the full amount at your next billing date ("+u(h.value?h.value.toLocaleDateString("en-US",{day:"numeric",month:"numeric",year:"numeric"}):"")+").",1))]),_:1}),t(r,null,{default:e(()=>[t(b,{color:"primary",onClick:x,class:"q-mr-lg fontsize-12"},{default:e(()=>[f("Change Plan")]),_:1}),t(b,{color:"primary",outline:"",onClick:o[0]||(o[0]=n=>i.value=!1),class:"fontsize-12"},{default:e(()=>[f("Cancel")]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),t(k,{class:"bg-background br-lg q-pa-md"},{default:e(()=>[t(r,{class:"q-pb-none"},{default:e(()=>[F]),_:1}),Q?(p(),w(r,{key:0},{default:e(()=>[t(N,{class:"border-negative text-negative"},{default:e(()=>[s("div",K,[s("div",M,[t(B,{name:"warning",class:"fontsize-20"})]),O])]),_:1})]),_:1})):I("",!0),t(r,null,{default:e(()=>[t(A,{onSelectPlan:D,selected:V(c).query.selected,update:!0},null,8,["selected"])]),_:1})]),_:1})])])]),_:1}))}};export{fe 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.