PageSourceSearch

https://www.holdem-reports.com/_next/static/chunks/app/dashboard/page-eb36934e8318eef6.js

js holdem-reports.com collected 2026-10-02 01:32:03 UTC 14,892 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[702],{512:function(e,t,s){Promise.resolve().then(s.bind(s,5091))},9376:function(e,t,s){"use strict";var r=s(5475);s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},5091:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var r=s(7437),a=s(2265),n=s(1245),i=s(5978),l=s(9799);function c(){let{user:e}=(0,n.a)(),[t,s]=(0,a.useState)(null),[c,o]=(0,a.useState)(!0);if((0,a.useEffect)(()=>{if(!e){o(!1);return}let t=(0,i.cf)((0,i.JU)(l.db,"users",e.uid),e=>{e.exists()?s(e.data().subscription||{type:"free",status:"active"}):s({type:"free",status:"active"}),o(!1)});return()=>t()},[e]),c)return(0,r.jsx)("div",{children:"Loading subscription info..."});if(!e)return null;let d=e=>e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"N/A";return(0,r.jsxs)("div",{className:"mt-4 p-4 border rounded-lg",children:[(0,r.jsx)("h2",{className:"text-xl font-bold mb-2",children:"Subscription Status"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("p",{children:["Plan: ",(0,r.jsx)("span",{className:"capitalize",children:(null==t?void 0:t.type)||"Free"})]}),(0,r.jsxs)("p",{children:["Status: ",(0,r.jsx)("span",{className:"capitalize",children:(null==t?void 0:t.status)||"Active"})]}),(null==t?void 0:t.type)==="premium"&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{children:["Start Date: ",(0,r.jsx)("span",{children:d(null==t?void 0:t.startDate)})]}),(null==t?void 0:t.endDate)&&(0,r.jsxs)("p",{children:["Expires: ",(0,r.jsx)("span",{children:d(t.endDate)})]}),(null==t?void 0:t.status)==="canceling"&&(null==t?void 0:t.cancelDate)&&(0,r.jsxs)("p",{children:["End Date: ",(0,r.jsx)("span",{children:d(t.cancelDate)})]})]})]})]})}var o=s(3361),d=s(9376);function u(e){let{subscription:t}=e,[s,n]=(0,a.useState)(!1),i=async()=>{let e=new Date(t.nextBillDate).toLocaleDateString();if(window.confirm("Are you sure you want to cancel your premium subscription?\n\n"+"Your premium access will continue until ".concat(e,".\n")+"After that date, your account will automatically revert to the free plan."))try{n(!0),console.log("Requesting portal URL for subscription:",t.paddleSubscriptionId);let e=await fetch("/api/subscription/portal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subscriptionId:t.paddleSubscriptionId})}),s=await e.json();if(console.log("Portal response:",s),!e.ok)throw Error(s.error||s.details||"Failed to get portal URL");if(!s.url)throw Error("No portal URL received");window.location.href=s.url}catch(e){console.error("Error getting portal URL:",e),alert("Failed to open cancellation portal. Please try again or contact support.")}finally{n(!1)}};return(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Manage Subscription"}),"active"===t.status&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:i,disabled:s,className:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded disabled:opacity-50",children:s?"Canceling...":"Cancel Subscription"}),(0,r.jsx)("p",{className:"text-sm text-gray-600 mt-2",children:"Note: Cancelling your subscription will keep it active until the end of your current billing period."})]}),"canceled"===t.status&&(0,r.jsxs)("div",{className:"text-gray-600",children:["Subscription will end on ",new Date(t.nextBillDate).toLocaleDateString()]})]})}function p(){let{loading:e,user:t}=(0,n.a)(),s=(0,d.useRouter)(),[p,x]=(0,a.useState)([]),[m,h]=(0,a.useState)(!0),[f,b]=(0,a.useState)("timestamp"),[g,y]=(0,a.useState)("desc"),[j,v]=(0,a.useState)(null),[w,N]=(0,a.useState)(!0);(0,a.useEffect)(()=>{if(!e&&!t){s.push("/login");return}(async function(){if(!t){h(!1);return}try{let e=await fetch("/api/dashboard?userId=".concat(t.uid)),s=await e.json();s.items&&x(s.items),h(!1)}catch(e){console.error("Error fetching dashboard data:",e),h(!1)}})()},[e,t,s]),(0,a.useEffect)(()=>{if(!(null==t?void 0:t.uid))return;N(!0);let e=(0,i.cf)((0,i.JU)(l.db,"users",t.uid),e=>{if(e.exists()){let t=e.data();t.subscription&&v(t.subscription)}N(!1)});return()=>e()},[t]);let S=e=>{f===e?y("asc"===g?"desc":"asc"):(b(e),y("desc"))},k=e=>{let{field:t,children:s,className:a=""}=e;return(0,r.jsx)("th",{className:"px-4 py-4 text-left text-xs font-medium text-blue-900 uppercase tracking-wider cursor-pointer hover:bg-blue-50 transition-colors duration-150 ".concat(a),onClick:()=>S(t),children:(0,r.jsxs)("div",{className:"flex items-center",children:[s,f===t&&(0,r.jsx)("span",{className:"ml-2 text-blue-600",children:"desc"===g?"↓":"↑"})]})})};return e||m||w?(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,r.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500"})}):t?j?(0,r.jsxs)("main",{className:"min-h-screen p-8 max-w-6xl mx-auto",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold mb-8",children:"Account Dashboard"}),(0,r.jsx)("div",{className:"mb-8",children:(0,r.jsx)(c,{})}),(0,r.jsxs)("div",{className:"mt-8",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"Available Plans"}),(0,r.jsx)(o.Z,{})]}),(0,r.jsxs)("div",{className:"bg-white shadow-lg rounded-lg p-6 my-8",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold mb-6 text-blue-900",children:"Your Generated Reports"}),p.length>0?(0,r.jsx)("div",{className:"overflow-x-auto rounded-lg border border-gray-200",children:(0,r.jsxs)("table",{className:"w-full divide-y divide-gray-200 table-fixed",children:[(0,r.jsx)("thead",{className:"bg-blue-50",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)(k,{field:"timestamp",className:"w-[180px]",children:"Date"}),(0,r.jsx)(k,{field:"reportType",className:"w-[100px]",children:"Report Type"}),(0,r.jsx)(k,{field:"gametype",className:"w-[160px]",children:"Game Type"}),(0,r.jsx)("th",{className:"px-3 py-3 text-left text-xs font-medium text-blue-900 uppercase tracking-wider w-[120px]",children:"Preflop Line"}),(0,r.jsx)("th",{className:"px-3 py-3 text-left text-xs font-medium text-blue-900 uppercase tracking-wider w-[100px]",children:"Flop Line"}),(0,r.jsx)("th",{className:"px-3 py-3 text-left text-xs font-medium text-blue-900 uppercase tracking-wider w-[100px]",children:"Turn Line"}),(0,r.jsx)("th",{className:"px-3 py-3 text-left text-xs font-medium text-blue-900 uppercase tracking-wider w-[100px]",children:"River Line"}),(0,r.jsx)("th",{className:"px-3 py-3 text-left text-xs font-medium text-blue-900 uppercase tracking-wider w-[100px]",children:"Actions"})]})}),(0,r.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:[...p].sort((e,t)=>
1{var s,r,a,n,i,l;let c,o;switch(f){case"timestamp":c=(null===(s=e.timestamp)||void 0===s?void 0:s.seconds)||0,o=(null===(r=t.timestamp)||void 0===r?void 0:r.seconds)||0;break;case"reportType":c=(null===(a=e.reportType)||void 0===a?void 0:a.toLowerCase())||"",o=(null===(n=t.reportType)||void 0===n?void 0:n.toLowerCase())||"";break;case"gametype":c=(null===(i=e.params.gametype)||void 0===i?void 0:i.toLowerCase())||"",o=(null===(l=t.params.gametype)||void 0===l?void 0:l.toLowerCase())||"";break;default:return 0}return"asc"===g?c>o?1:-1:c<o?1:-1}).map((e,t)=>{var s;return(0,r.jsxs)("tr",{className:"\n                    hover:bg-blue-50 transition-colors duration-150\n                    ".concat(t%2==0?"bg-white":"bg-gray-50","\n                  "),children:[(0,r.jsx)("td",{className:"px-3 py-3 text-sm font-medium text-gray-900",children:function(e){if(!e)return"-";try{if("object"==typeof e&&"seconds"in e)return new Date(1e3*e.seconds).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});return"-"}catch(e){return"-"}}(e.timestamp)}),(0,r.jsx)("td",{className:"px-3 py-3 text-sm text-blue-800 font-medium",children:(null===(s=e.reportType)||void 0===s?void 0:s.toUpperCase())||"-"}),(0,r.jsx)("td",{className:"px-3 py-3 text-sm text-gray-700",children:e.params.gametype||"-"}),(0,r.jsx)("td",{className:"px-3 py-3 text-sm text-gray-700",children:e.params.preflop_actions||"-"}),(0,r.jsx)("td",{className:"px-3 py-3 text-sm text-gray-700",children:e.params.flop_actions||"-"}),(0,r.jsx)("td",{className:"px-3 py-3 text-sm text-gray-700",children:e.params.turn_actions||"-"}),(0,r.jsx)("td",{className:"px-3 py-3 text-sm text-gray-700",children:e.params.river_actions||"-"}),(0,r.jsx)("td",{className:"px-3 py-3 text-sm",children:e.downloadUrl&&(0,r.jsx)("a",{href:e.downloadUrl,className:"inline-flex items-center px-2 py-1 text-sm border border-blue-600 text-blue-600 rounded hover:bg-blue-600 hover:text-white transition-colors duration-150",target:"_blank",rel:"noopener noreferrer",children:"Download"})})]},e.id)})})]})}):(0,r.jsx)("div",{className:"text-center py-12 bg-blue-50 rounded-lg border border-blue-100",children:(0,r.jsx)("p",{className:"text-blue-800 text-lg",children:"No completed reports found. Start analyzing hands to generate reports!"})})]}),(0,r.jsx)("div",{className:"mt-8",children:(0,r.jsx)(u,{subscription:j})})]}):(0,r.jsx)("div",{children:"No subscription found"}):null}},3361:function(e,t,s){"use strict";s.d(t,{Z:function(){return d}});var r=s(7437),a=s(2265),n=s(1245),i=s(5978),l=s(9799),c=s(1151);function o(e){let{onSubscriptionComplete:t}=e,{user:s}=(0,n.a)(),{isInitialized:o,paddle:d}=(0,c.N)(),[u,p]=(0,a.useState)(null),x="pri_01jfezdq2k07x48c30e29tzp0s",m=async()=>{if(!o||!d){p("Payment system not ready");return}if(!s){p("Please log in to subscribe");return}try{var e;console.log("Opening checkout with price ID:",x);let r=await d.Checkout.open({items:[{priceId:x,quantity:1}],customData:{userId:s.uid},successUrl:"".concat(window.location.origin,"/checkout/success"),cancelUrl:"".concat(window.location.origin,"/checkout/canceled")});console.log("Checkout created:",r),(null===(e=r.data)||void 0===e?void 0:e.subscriptionId)&&(await (0,i.pl)((0,i.JU)(l.db,"users",s.uid),{subscription:{type:"premium",status:"active",paddleSubscriptionId:r.data.subscriptionId,startDate:new Date().toISOString()}},{merge:!0}),t&&t(r.data.subscriptionId))}catch(e){console.error("Checkout error:",e),p("Failed to open checkout")}};return s?(0,r.jsxs)("div",{className:"w-full",children:[(0,r.jsx)("button",{onClick:m,className:"mt-4 w-full py-2 px-4 bg-blue-600 text-white rounded hover:bg-blue-700",disabled:!o,children:o?"Upgrade to Premium":"Loading..."}),u&&(0,r.jsx)("p",{className:"mt-2 text-red-600 text-sm",children:u})]}):(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)("p",{className:"text-red-600 text-sm",children:"Please log in to subscribe"})})}function d(){let{user:e}=(0,n.a)(),[t,s]=(0,a.useState)(null),[c,d]=(0,a.useState)(!0);(0,a.useEffect)(()=>{if(!e){d(!1);return}let t=(0,i.cf)((0,i.JU)(l.db,"users",e.uid),e=>{if(e.exists()){let t=e.data();t.subscription?s(t.subscription):s({type:"free",status:"active"})}else s({type:"free",status:"active"});d(!1)});return()=>t()},[e]);let u=(null==t?void 0:t.type)==="premium"&&(null==t?void 0:t.status)==="active";return c?(0,r.jsx)("div",{children:"Loading plans..."}):(0,r.jsx)("div",{className:"mt-8",children:(0,r.jsxs)("div",{className:"grid md:grid-cols-2 gap-8",children:[(0,r.jsxs)("div",{className:"p-6 border rounded-lg",children:[(0,r.jsx)("h3",{className:"text-xl font-bold",children:"Free Plan"}),(0,r.jsx)("p",{className:"mt-2 text-gray-600",children:"Basic features for personal use"}),(0,r.jsxs)("ul",{className:"mt-4 space-y-2",children:[(0,r.jsx)("li",{children:"✓ Sample reports"}),(0,r.jsx)("li",{children:"✓ Limited exports"})]}),(0,r.jsx)("p",{className:"mt-4 text-2xl font-bold",children:"$0/month"}),(0,r.jsx)("button",{className:"mt-4 w-full py-2 px-4 bg-gray-200 text-gray-800 rounded",disabled:!0,children:(null==t?void 0:t.type)==="free"?"Current Plan":"Basic Plan"})]}),(0,r.jsxs)("div",{className:"p-6 border rounded-lg bg-blue-50",children:[(0,r.jsx)("h3",{className:"text-xl font-bold",children:"Premium Plan"}),(0,r.jsx)("p",{className:"mt-2 text-gray-600",children:"Advanced features for power users"}),(0,r.jsxs)("ul",{className:"mt-4 space-y-2",children:[(0,r.jsx)("li",{children:"✓ Full reports"}),(0,r.jsx)("li",{children:"✓ Unlimited exports"})]}),(0,r.jsx)("p",{className:"mt-4 text-2xl font-bold",children:"$22/month"}),u?(0,r.jsx)("button",{className:"mt-4 w-full py-2 px-4 bg-green-500 text-white rounded cursor-not-allowed",disabled:!0,children:"Current Plan"}):(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsx)(o,{}),(0,r.jsx)("button",{className:"mt-2 w-full py-2 px-4 bg-gray-200 text-gray-800 rounded hover:bg-gray-300",children:"Cancel"})]})]})]})})}},1245:function(e,t,s){"use strict";s.d(t,{AuthProvider:function(){return c},a:function(){return o}});var r=s(7437),a=s(2265),n=s(4752),i=s(9799);let l=(0,a.createContext)({user:null,loading:!0,subscription:null});function c(e){let{children:t}=e,[s,c]=(0,a.useState)(null),[o,d]=(0,a.useState)(!0),[u,p]=(0,a.useState)(null);return(0,a.useEffect)(()=>(0,n.Aj)(i.I8,e=>{c(e),d(!1),console.log("Auth state changed:",null==e?void 0:e.email)}),[]),(0,a.useEffect)(()=>{s&&(async()=>{try{let e=await s.getIdToken(),t=await fetch("/api/auth/token",{headers:{Authorization:"Bearer ".concat(e)}}),r=await t.json();p(r.subscription)}catch(e){console.error("Error fetching subscription:",e),p(null)}})()},[s]),(0,r.jsx)(l.Provider,{value:{user:s,loading:o,subscription:u},children:t})}let o=()=>(0,a.useContext)(l)},9799:function(e,t,s){"use strict";s.d(t,{I8:function(){return c},_p:function(){return a._p},db:function(){return o}});var r=s(738),a=s(4752),n=s(5978);let i={apiKey:"AIzaSyBCwxXPZmyeQsMP9423cIK_pJPMWWm_xCA",authDomain:"agg-reports-ce-v1.firebaseapp.com",projectId:"agg-reports-ce-v1",storageBucket:"agg-reports-ce-v1.appspot.com",messagingSenderId:"800886729638",appId:"1:800886729638:web:e93ded2d96b1ba5121bd67",measurementId:"G-RT7F06RJHD"},l=function(){try{return(0,r.Mq)()}catch(e){return(0,r.ZF)(i)}}(),c=(0,a.v0)(l),o=(0,n.ad)(l)},1151:function(e,t,s){"use strict";s.d(t,{N:function(){return o},PaddleProvider:function(){return c}});var r=s(7437),a=s(2265),n=s(5262),i=s(7900);let l=(0,a.createContext)({isInitialized:!1,paddle:null});function c(e){let{children:t}=e,[s,c]=(0,a.useState)(!1),[o,d]=(0,a.useState)(null);return(0,a.useEffect)(()=>{(0,n.J4)({environment:"production",token:"9e344ca652dbf4612a637070532e5b7ab4840a922839ffefcb"}).then(e=>{e&&(d(e),c(!0))})},[]),(0,r.jsxs)(l.Provider,{value:{isInitialized:s,paddle:o},children:[(0,r.jsx)(i.default,{src:"https://cdn.paddle.com/paddle/v2/paddle.js",onLoad:()=>{window.Paddle.Setup({token:"9e344ca652dbf4612a637070532e5b7ab4840a922839ffefcb"}),d(window.Paddle),c(!0)}}),t]})}let o=()=>(0,a.useContext)(l)}},function(e){e.O(0,[358,565,714,576,971,117,744],function(){return e(e.s=512)}),_N_E=e.O()}]);

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.