1import X from"./VKQS5tGV.js";import{_ as Z}from"./Bdv2xjB9.js";import{d as ee,v as te,x as ne,bz as ae,B as w,ae as oe,c as re,an as se,y as le,I as ie,A as $,ac as E,f as r,o as s,g as a,T as ce,k as D,G as m,p as de,F as g,l as B,i,H as o,bG as me,h as u,a3 as M,E as ue,L as pe,bD as ye,a0 as fe,a2 as xe,M as ge}from"#entry";import{u as he,i as _e}from"./D9mwoY06.js";import{b as ve}from"./FXANGjSJ.js";import{u as ke}from"./CCIbnOLw.js";import{preloadYunoSdk as be}from"./CsFO-zxd.js";import{s as Pe}from"./DL0Xpu2v.js";import"./FC47SwYL.js";import"./DU95hI5u.js";import"./DLNpcykF.js";import"./DY3Yz_TZ.js";import"./1fs1yw9t.js";import"./DrPVW_0W.js";const we={class:"plan-section rounded-2xl border border-gray-200 dark:bg-zinc-900 dark:border-zinc-700 overflow-hidden shadow-xl"},$e={class:"p-4 flex flex-col gap-6 max-md:gap-4"},De={class:"rounded-xl bg-gray-50 dark:bg-zinc-950 p-3 flex flex-col gap-2"},Ce={class:"flex flex-col gap-4"},Se={key:0,class:"flex items-center justify-center text-xs text-center gap-1 py-1 font-semibold bg-fire rounded-t-2xl pb-4 -mb-4 text-zinc-900"},Fe=["onClick"],Te={class:"flex gap-3 items-center min-w-0"},Ie={key:0,class:"block w-3 h-3 m-0.5 rounded-full bg-primary"},Ae={class:"flex flex-col gap-1 min-w-0"},Ee={class:"flex max-md:flex-col md:items-center gap-2 max-md:gap-1 flex-wrap"},Be={class:"font-semibold tracking-tight flex items-end gap-1 uppercase"},Me={class:"text-xl md:text-3xl"},ze={class:"md:text-lg"},Re={key:0,class:"text-xs font-semibold px-2 py-0.5 rounded-full bg-hot text-white mb-1 w-max"},Ue={class:"flex items-center gap-2 text-sm"},Ne={key:0,class:"line-through text-gray-400"},Ge={class:"font-semibold"},Le={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Oe={key:0,class:"flex max-md:flex-col flex-shrink-0 items-center gap-2"},je={key:0,class:"line-through text-gray-400"},Ve={class:"flex items-center px-2 py-0.5 rounded-full bg-violet-100 dark:bg-violet-950/60 text-purple-700 dark:text-violet-200"},Ye={class:"font-semibold text-lg"},He={class:"text-gray-400 text-sm text-center"},We={class:"flex gap-2 items-center justify-center p-2 rounded-lg bg-[#DCFCE7] text-[#166534]"},qe=700,Ke=1500,Je=ee({__name:"PlanSelector",setup(Qe){const z=pe(),{user:C}=te(),{prefetchInvoice:R}=he(),{sendEvent:h}=ne(),{axonAddToCart:U}=ae(),{bookId:N,chapterId:G,chapterNumber:L}=ve(),{selectedSubscription:c,subscriptions:O,selectSubscription:j,showPayment:V,selectedSubscriptionItem:d,pricingEventProps:_}=ke(),v=[{name:"sarah_b***",amount:"$9.99"},{name:"maddie_s**",amount:"$19.99"},{name:"marry****",amount:"$44.99"},{name:"jenna_w**",amount:"$9.99"},{name:"alex.m***",amount:"$19.99"},{name:"mike****",amount:"$9.99"},{name:"lisa****",amount:"$44.99"},{name:"emily_r****",amount:"$44.99"},{name:"sophia_m****",amount:"$9.99"},{name:"olivia.b****",amount:"$9.99"},{name:"ava_l**",amount:"$19.99"},{name:"charlotte_k***",amount:"$9.99"},{name:"amelia.j**",amount:"$19.99"},{name:"harper_t****",amount:"$44.99"},{name:"evelyn_w**",amount:"$9.99"},{name:"abigail.d***",amount:"$19.99"},{name:"ella_p****",amount:"$44.99"},{name:"scarlett_h****",amount:"$9.99"},{name:"grace_f****",amount:"$9.99"},{name:"lily.c**",amount:"$19.99"},{name:"chloe_n***",amount:"$9.99"},{name:"zoey_r**",amount:"$19.99"},{name:"hannah.v****",amount:"$44.99"},{name:"natalie_g**",amount:"$9.99"},{name:"victoria.s***",amount:"$19.99"}];let S=0;const k=w(v.map(e=>({...e,_id:S++}))),p=w(null),b=w(null),Y=()=>{const e=p.value;if(!e)return;const t=e.scrollLeft,l=e.scrollWidth-e.clientWidth;if(l<=t)return;const y=2600,n=performance.now(),f=J=>{const A=Math.min((J-n)/y,1),Q=1-Math.pow(1-A,3);e.scrollLeft=t+(l-t)*Q,A<1&&requestAnimationFrame(f)};requestAnimationFrame(f)};let F=0,P=null;oe(()=>{P&&clearInterval(P)});const H=se,W=re(()=>O.value.map(e=>{const t=_e(e);if(t)return{...e,originalPrice:null,perDay:t.perDayPrice.toFixed(2),originalPerDay:null,savingsPercent:t.hasSavings?t.discountPercent:null,thenPrice:e.cycle?e.cycle.price.toFixed(2):null,thenDays:e.cycle?e.cycle.days:null};const l=H[e.key];if(!l)return{...e,originalPrice:null,perDay:null,originalPerDay:null,savingsPercent:null,thenPrice:null,thenDays:null};const y=e.price.base/l.days,n=l.originalPrice/l.days,f=Math.round((1-e.price.base/l.originalPrice)*100);
1return{...e,originalPrice:l.originalPrice.toFixed(2),perDay:y.toFixed(2),originalPerDay:n.toFixed(2),savingsPercent:f,thenPrice:null,thenDays:null}})),T=()=>{if(!c.value)return;const e=z.public.siteURL+"/payments/processing";R(c.value,C.value?.id,C.value?.email,e).catch(t=>console.warn("[PlanSelector] Invoice prefetch failed:",t))};let x=null;const I=(e=qe)=>{x&&clearTimeout(x),x=setTimeout(()=>{x=null,T()},e)},q=e=>{j(e),I()},K=()=>{V(),U(d.value),h($.GetFullAccessClicked,{package:c.value,type:E.CoinBundle,..._()}),h($.PaywallButtonClicked,{book_id:N.value,chapter_id:G.value,chapter_number:L.value,type:xe.SubscriptionFlow,placement:fe.Reader,button:ye.GetFullAccess,..._()})};return le(()=>{if(be().catch(e=>console.warn("[PlanSelector] Yuno SDK preload failed:",e)),I(Ke),p.value&&p.value.scrollTo({left:p.value.scrollWidth}),P=Pe(()=>{k.value.push({...v[F%v.length],_id:S++}),F++,ie(()=>{Y(),setTimeout(()=>k.value.shift(),3200)})},5e3),b.value){const e=new IntersectionObserver(t=>{t[0].isIntersecting&&(h($.GetFullAccessShown,{package:c.value,type:E.CoinBundle,..._()}),e.disconnect())});e.observe(b.value)}}),(e,t)=>{const l=X,y=Z;return s(),r("section",we,[a("div",$e,[t[8]||(t[8]=a("h2",{class:"text-4xl max-md:text-2xl font-semibold text-center"},"Choose Your Plan",-1)),ce(e.$slots,"social-proof",{},()=>[a("div",De,[t[0]||(t[0]=a("p",{class:"text-center text-primary dark:text-purple-300"},[a("b",null,"769"),m(" people joined today ")],-1)),a("div",{ref_key:"trackEl",ref:p,class:"overflow-hidden"},[D(me,{tag:"div",name:"tag-fade",class:"purchase-track flex gap-1 text-sm !text-gray-950 dark:!text-gray-200"},{default:de(()=>[(s(!0),r(g,null,B(i(k),n=>(s(),r("span",{key:n._id,class:"purchase-tag rounded px-2 py-0.5 text-nowrap border shrink-0 bg-white dark:bg-zinc-950 border-primary"},[m(o(n.name)+" ",1),a("strong",null,"chose "+o(n.amount),1)]))),128))]),_:1})],512)])],!0),a("div",Ce,[(s(!0),r(g,null,B(i(W),n=>(s(),r("div",{key:n.key},[n.is_popular?(s(),r("div",Se,[...t[1]||(t[1]=[a("span",null,"ð¥",-1),m(" MOST POPULAR ",-1)])])):u("",!0),a("div",{class:M(["plan-card relative flex items-center justify-between gap-4 px-5 max-md:px-3 py-4 max-md:py-2 border-2 rounded-2xl cursor-pointer transition-all bg-neutral-50 dark:bg-zinc-950",n.key===i(c)?"border-primary shadow-md shadow-purple-100 dark:shadow-purple-900/20":"border-gray-200 dark:border-zinc-700"]),onClick:f=>q(n.key)},[a("div",Te,[a("span",{class:M(["radio-btn shrink-0 w-6 h-6 rounded-full border-2",n.key===i(c)?"border-primary":"border-gray-300 dark:border-zinc-600"])},[n.key===i(c)?(s(),r("span",Ie)):u("",!0)],2),a("div",Ae,[a("div",Ee,[a("span",Be,[a("span",Me,o(n.period.split(" ")[0]),1),a("span",ze,o(n.period.split(" ")[1]),1)]),n.savingsPercent?(s(),r("span",Re,o(n.savingsPercent)+"% OFF ",1)):u("",!0)]),a("div",Ue,[n.originalPrice?(s(),r("span",Ne,"$"+o(n.originalPrice),1)):u("",!0),a("span",Ge,"$"+o(n.price.base.toFixed(2)),1)]),n.thenPrice?(s(),r("div",Le," Then $"+o(n.thenPrice)+" every "+o(n.thenDays)+" days ",1)):u("",!0)])]),n.perDay?(s(),r("div",Oe,[n.originalPerDay?(s(),r("span",je,"$"+o(n.originalPerDay),1)):u("",!0),a("span",Ve,[a("span",Ye,"$"+o(n.perDay),1),t[2]||(t[2]=a("span",{class:"text-xs"},"/ day",-1))])])):u("",!0)],10,Fe)]))),128))]),a("button",{ref_key:"getFullAccessBtn",ref:b,class:"w-full py-4 bg-fm-gradient hover:bg-fm-gradient-active !text-white text-xl rounded-xl transition-all",onClick:ue(K,["prevent"]),onMouseenter:T}," Get Full Access ",544),a("p",He,[i(d)?.intro?(s(),r(g,{key:0},[m(" By continuing, you agree that following the introductory "+o(i(d).intro.days)+"-day period, you will automatically be charged the full price of "+o(i(d).cycle?.price)+" USD every "+o(i(d).cycle?.days)+" days until you cancel in settings. ",1)],64)):(s(),r(g,{key:1},[m(" By continuing, you agree that you will automatically be charged the full price of "+o(i(d)?.price.base)+" USD every "+o(i(d)?.period)+" until you cancel in settings. ",1)],64)),t[3]||(t[3]=m(" Learn more about our cancellation and refund policy in ",-1)),t[4]||(t[4]=a("a",{class:"underline",href:"/public/web-terms-of-use.html"},"Terms of Use",-1)),t[5]||(t[5]=m(" and ",-1)),t[6]||(t[6]=a("a",{class:"underline",href:"/public/refund-policy.html"},"Refund Policy.",-1))]),a("div",We,[D(l,{name:"fm:shield",class:"text-2xl w-[24px] flex-shrink-0 mb-1"}
1),t[7]||(t[7]=a("span",null,"Pay safe & secure",-1))]),D(y,{src:"/img/funnel/payment_providers.webp",format:"webp",width:"228",height:"76",class:"mx-auto"})])])}}}),ut=ge(Je,[["__scopeId","data-v-c1a858f4"]]);export{ut 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.