1import{i as x,r as o,s as h,D as f,g as p,j as e,E as g,t as j,v as w,P as S,a as _}from"./index-5264ce22.js";function b(){const r=x(),[a,n]=o.useState(),[c,i]=o.useState(!1),[s,d]=o.useState(),[l,v]=o.useState(h("pk_live_51NcTyGHR2YjQ1ZmeabMsqd6ME6hVx828K7SKZHBQKDrvHImpoxNJUNxXi8OddTxwq7CyWsG6P0zyAjRwFHO4j3ws00ElZZZZIO")),m=f();o.useEffect(()=>{console.log(l),console.log("no membership page"),y(),u()},[]);const u=async()=>{const t=await p.post("https://server.letscope.org/cope/ws_react",{command:"payment_start",user_token:m.accessToken},{headers:{apikey:"react_ws_for_now"}});console.log(t.data.data),d(t.data.data)},y=async()=>{const t=await p.post("https://server.letscope.org/cope/ws_react",{command:"user_get_membership",user_token:m.accessToken},{headers:{apikey:"react_ws_for_now"}});console.log(t),t.data.codres==1001?n(t.data):t.data.codres==0&&!c&&(r("/ThankYou"),i(!0))};return e.jsx("div",{className:"confirm-email-page",style:{padding:"4rem 0 2rem 0"},children:e.jsxs("div",{className:"container",children:[e.jsx("div",{className:"flex-space-between payment-container",children:e.jsxs("div",{className:"flex-center",style:{flexDirection:"column",gap:"1rem",alignItems:"flex-start"},children:[e.jsx("h1",{class:"c-primary",children:"Oops it looks like your free membership has expired."}),e.jsx("p",{style:{width:"100%",fontSize:"1.35rem"},children:"Please take a moment to add payment details so that you can continue to enjoy your cÅpe experience immediately."})]})}),a&&s&&e.jsx(g,{stripe:l,options:{clientSecret:s==null?void 0:s.clientSecret},children:e.jsx(k,{paymentData:s})})]})})}const k=({paymentData:r})=>{const a=j(),n=w();o.useEffect(()=>{console.log(a)},[a]);const c=async i=>{if(console.log("here"),i.preventDefault(),!a||!n)return;console.log(r.clientSecret);const s=await a.confirmSetup({elements:n,confirmParams:{return_url:`${window.location.origin}/ThankYou`}});console.log(s),console.log("test")};return e.jsxs("form",{onSubmit:c,children:[e.jsx(S,{}),e.jsx(_,{type:"submit",onClick:()=>{},children:"Submit"})]})};export{b 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.