1"use strict";(self.webpackChunkmeteor_app=self.webpackChunkmeteor_app||[]).push([["3345"],{8808(e,s,t){t.d(s,{A:()=>c});var i=t(1374),r=t(4848),l=t(4953),n=t(4855),a=t(1409),o=t(4563);let d={background:"#C0185E",color:"white",border:"none",fontFamily:"'Raleway', sans-serif",fontWeight:700},c=({onClose:e,reason:s,isSubscribed:t,initialTab:c,onSuccess:u})=>{var m,f,h,y,g,b;let[p,x]=(0,l.useState)(c||"subscribe"),[j,v]=(0,l.useState)(!1),[k,S]=(0,l.useState)(""),[C,N]=(0,l.useState)(null),[w,z]=(0,l.useState)(null),R=(null==(h=n.Meteor.settings)||null==(f=h.public)||null==(m=f.stripe)?void 0:m.trialDays)||0,P=(null==(b=n.Meteor.settings)||null==(g=b.public)||null==(y=g.stripe)?void 0:y.creditPacks)||[];(0,l.useEffect)(()=>{let e=!1;return n.Meteor.callAsync("billing.getStatus").then(s=>{e||z(s)}).catch(()=>{}),()=>{e=!0}},[]);let B=(null==w?void 0:w.defaultPaymentMethod)||null,M=e=>(0,i._)(function*(){v(!0),S(""),N(e);try{let{url:s}=yield n.Meteor.callAsync("billing.createCreditsCheckoutSession",e);if(!s)throw Error("No checkout URL returned.");window.location.assign(s)}catch(e){v(!1),N(null),S((null==e?void 0:e.reason)||(null==e?void 0:e.message)||"Could not start checkout.")}})(),$=e=>({flex:1,padding:"0.55rem 0.75rem",border:"none",color:e?"#C0185E":"#8a5178",fontFamily:"'Raleway', sans-serif",fontWeight:700,fontSize:"0.88rem",cursor:"pointer",borderBottom:e?"2px solid #C0185E":"2px solid transparent",transition:"all 0.15s ease"});return(0,r.jsxs)("div",{className:"modal is-active",style:{padding:"1rem"},children:[(0,r.jsx)("div",{className:"modal-background",style:{background:"rgba(30, 15, 60, 0.55)"},onClick:j?void 0:e}),(0,r.jsxs)("div",{className:"modal-card",style:{maxWidth:480,borderRadius:14,maxHeight:"calc(100vh - 2rem)",overflowY:"auto"},children:[(0,r.jsxs)("header",{className:"modal-card-head",style:{background:"white",borderBottom:"1px solid #fce9f3",position:"sticky",top:0,zIndex:1},children:[(0,r.jsxs)("p",{className:"modal-card-title",style:{fontWeight:800,fontSize:"1.15rem"},children:[(0,r.jsx)("i",{className:"fas fa-credit-card",style:{marginRight:8}}),"Manage Credits or Subscription"]}),!j&&(0,r.jsx)("button",{className:"delete","aria-label":"close",onClick:e})]}),(0,r.jsxs)("section",{className:"modal-card-body",style:{paddingTop:"0.5rem"},children:[s&&(0,r.jsx)("div",{className:"notification is-warning is-light",style:{fontSize:"0.88rem",padding:"0.75rem 1rem"},children:s}),!c&&(0,r.jsxs)("div",{style:{display:"flex",borderRadius:8,overflow:"hidden",background:"#f4eaf3",marginBottom:"1rem"},children:[(0,r.jsx)("button",{style:$("subscribe"===p),onClick:()=>x("subscribe"),disabled:j,children:t?"Unsubscribe":"Subscribe"}),(0,r.jsx)("button",{style:$("credits"===p),onClick:()=>x("credits"),disabled:j,children:"Buy Credits"})]}),"subscribe"===p?(0,r.jsx)(r.Fragment,{children:t?(0,r.jsxs)("p",{style:{fontSize:"0.92rem",color:"#555"},children:["To cancel your subscription, use the ",(0,r.jsx)("strong",{children:"Manage billing"})," button in your"," ",(0,r.jsx)("strong",{children:"Manage Profile"})," settings."]}):(0,r.jsxs)(r.Fragment,{children:[R>0&&(0,r.jsxs)("div",{style:{background:"#eafff0",border:"1px solid #c7ecd4",borderRadius:8,padding:"0.6rem 0.85rem",marginBottom:"0.85rem",fontSize:"0.88rem",color:"#1f6b3a",fontWeight:600},children:[(0,r.jsx)("i",{className:"fas fa-gift",style:{marginRight:"0.5rem"}}),"Try free for ",R," days. No charge until the trial ends â cancel anytime."]}),(0,r.jsx)("p",{className:"mb-3",style:{fontSize:"0.95rem"},children:"Unlimited access for regulars. Host and join sessions as often as you like."}),(0,r.jsxs)("ul",{style:{fontSize:"0.88rem",color:"#555",paddingLeft:"1.1rem",marginBottom:"1rem"},children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("i",{className:"fas fa-microphone-lines",style:{marginRight:6}}),"Unlimited practice and performance sessions"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("i",{className:"fas fa-comment-dots",style:{marginRight:6}}),"In-session chat, recording, and feedback"]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("i",{className:"fas fa-calendar-days",style:{marginRight:6}}),"Cancel anytime from the Stripe portal"]})]}
1),k&&(0,r.jsx)("p",{style:{fontSize:"0.85rem",color:"#ff3860",marginBottom:"0.5rem"},children:k}),(0,r.jsxs)("button",{className:`button is-fullwidth${j?" is-loading":""}`,style:d,onClick:()=>(0,i._)(function*(){v(!0),S("");try{let{url:e}=yield n.Meteor.callAsync("billing.createCheckoutSession");if(!e)throw Error("No checkout URL returned.");window.location.assign(e)}catch(e){v(!1),S((null==e?void 0:e.reason)||(null==e?void 0:e.message)||"Could not start checkout.")}})(),disabled:j,children:[(0,r.jsx)("span",{className:"icon",children:(0,r.jsx)("i",{className:"fas fa-lock"})}),(0,r.jsx)("span",{children:"Continue to subscription checkout"})]}),(0,r.jsx)("p",{className:"has-text-grey mt-3",style:{fontSize:"0.78rem"},children:"You'll be redirected to Stripe's secure checkout page. We never see your card details."})]})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"mb-2",style:{fontSize:"0.95rem"},children:"Prefer flexibility? Buy a credit bundle and use credits anytime. Hosting a session uses credits based on:"}),(0,r.jsxs)("ul",{className:"mb-2",style:{fontSize:"0.95rem",paddingLeft:"1.25rem",listStyleType:"disc"},children:[(0,r.jsx)("li",{children:"Duration"}),(0,r.jsx)("li",{children:"Room size (number of seats you set in advance)"})]}),(0,r.jsx)("p",{className:"mb-3",style:{fontSize:"0.95rem"},children:"RSVPing and joining sessions is free â no credits are deducted. We simply require at least one credit on your account to RSVP, to help ensure active users and reduce misuse of the platform."}),0===P.length&&(0,r.jsx)("p",{style:{fontSize:"0.85rem",color:"#ff3860"},children:"Credit packs aren't configured yet. Please check back soon."}),(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem",marginBottom:"0.85rem"},children:P.map(s=>{let t=C===s.id,l=j&&t;return(0,r.jsxs)("button",{className:`button${l?" is-loading":""}`,onClick:()=>(s=>{if(null==B?void 0:B.id)(0,i._)(function*(){v(!0),S(""),N(s);let t=P.find(e=>e.id===s),i=null==t?void 0:t.credits;try{let t=yield n.Meteor.callAsync("billing.purchaseCreditsOffSession",s);if("succeeded"===t.status){let s=i?`${i} credits added!`:"Credits added!";v(!1),N(null),u?u(s):(a.oR.success(s),null==e||e());return}if("requires_action"===t.status&&t.clientSecret){let s=yield(0,o.C)(),{error:r,paymentIntent:l}=yield s.confirmCardPayment(t.clientSecret);if(r){v(!1),N(null),S(r.message||"Authentication failed.");return}if((null==l?void 0:l.status)==="succeeded"){let s=i?`${i} credits added!`:"Credits added!";v(!1),N(null),u?u(s):(a.oR.success(s),null==e||e());return}v(!1),N(null),S("Payment did not complete. Please try again.");return}v(!1),N(null),S((null==t?void 0:t.message)||"Payment failed.")}catch(e){v(!1),N(null),S((null==e?void 0:e.reason)||(null==e?void 0:e.message)||"Payment failed.")}})();else M(s)})(s.id),disabled:j,style:{background:"white",border:"1.5px solid #e8d4e0",borderRadius:8,padding:"0.75rem 1rem",justifyContent:"space-between",fontFamily:"'Raleway', sans-serif",height:"auto",textAlign:"left"},children:[(0,r.jsxs)("span",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,r.jsx)("span",{style:{fontWeight:700,fontSize:"0.95rem",color:"#C0185E"},children:s.label||`${s.credits} credits`}),(0,r.jsxs)("span",{style:{fontSize:"0.78rem",color:"#888"},children:[s.credits," credits"]})]}),(0,r.jsx)("span",{style:{fontWeight:700,color:"#333"},children:(e=>{if(!Number.isFinite(e))return"";let s=e/100;return Number.isInteger(s)?`$${s}`:`$${s.toFixed(2)}`})(s.amountCents)})]},s.id)})}),k&&(0,r.jsx)("p",{style:{fontSize:"0.85rem",color:"#ff3860",marginBottom:"0.5rem"},children:k}),(null==B?void 0:B.id)?(0,r.jsxs)("div",{style:{fontSize:"0.8rem",color:"#555",background:"#f7f0ff",borderRadius:6,padding:"0.5rem 0.75rem",marginBottom:"0.6rem",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsxs)("span",{children:["Saved card: ",B.brand?`${B.brand.toUpperCase()} `:"","â¢â¢â¢â¢ ",B.last4||"????"]}),(0,r.jsx)("button",{type:"button",onClick:()=>{var e;return M(C||(null==(e=P[0])?void 0:e.id))},disabled:j||0===P.length,style:{background:"transparent",border:"none",color:"#C0185E",cursor:"pointer",fontSize:"0.78rem",padding:0,textDecoration:"underline"},children:"Use a different card"})]}):null,(0,r.jsx)("p",{className:"has-text-grey",style:{fontSize:"0.78rem"},children:(null==B?void 0:B.id)?"Credits never expire. One click charges your saved card; no redirect.":"Credits never expire. You'll be redirected to Stripe to complete your first purchase."})]})]}),(0,r.jsx)("footer",{className:"modal-card-foot",style:{background:"white",borderTop:"1px solid #fce9f3",justifyContent:"flex-end",position:"sticky",bottom:0,zIndex:1},children:(0,r.jsx)("button",{className:"button",onClick:e,disabled:j,children:"Not now"})})]})]})}},4563(e,s,t){t.d(s,{C:()=>n});var i=t(4855),r=t(9727);let l=null;function n(){var e,s,t;if(l)return l;let n=null==(t=i.Meteor.settings)||null==(s=t.public)||null==(e=s.stripe)?void 0:e.publishableKey;return n?l=(0,r.c)(n):Promise.reject(Error("Stripe publishable key not configured."))}}}]);
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.