1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[724],{97198:function(e,t,s){"use strict";s.d(t,{y:function(){return a}});var o=s(13590),i=s(15487),n=s(11874),r=s(75271);let u=r.createContext(null);function a(e={}){let t=(0,n.useRouter)(),s=r.useContext(u),a=s;return(s&&"then"in s&&(a=r.use(s)),"undefined"!=typeof window)?(0,o.aC)({...a,...e}):t?(0,o.aC)(e):(0,i.aw)({...a,...e})}},43075:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/portal/project/new",function(){return s(26342)}])},94012:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return a},useUserSubscription:function(){return u}});var o=s(52676),i=s(75271),n=s(13590),r=s(97198);function u(){var e;let{user:t}=(0,n.aF)(),[s,o]=(0,i.useState)(null),[u,a]=(0,i.useState)(!1),{isLoaded:c,isSignedIn:l,userId:d}=(0,r.y)();return(0,i.useLayoutEffect)(()=>{if(!d)return;let e="true"===new URLSearchParams(window.location.search).get("subscription_success")||"true"===sessionStorage.getItem("subscription_success"),t="true"===sessionStorage.getItem("waiting_for_webhook");if(!e&&!t){let e=localStorage.getItem("subscription_status_".concat(d));null!==e&&(console.log("[Cache] Using cached subscription status (useLayoutEffect):","true"===e),o("true"===e))}},[d]),(0,i.useEffect)(()=>{if(c&&!d){window.location.href="/sign-in";return}if(!d)return;let e=!1,s=!1;e="true"===new URLSearchParams(window.location.search).get("subscription_success")||"true"===sessionStorage.getItem("subscription_success"),s="true"===sessionStorage.getItem("waiting_for_webhook"),e&&d&&(console.log("[Payment Success] Clearing subscription cache for user:",d),localStorage.removeItem("subscription_status_".concat(d)),sessionStorage.setItem("subscription_success","true")),s&&console.log("[Webhook Wait] Waiting for webhook to process, skipping cache"),console.log("===== before =fetchSubscriptionStatus=>>>>>>>>>>userId=",d);let i=async(e,t)=>{let s=!1;console.log("======fetchSubscriptionStatus=>>>>>>>>>>userId=",e,"email=",t||"N/A");try{let o=t?"/bapi/checkout-session-status-by-user?userid=".concat(e,"&email=").concat(encodeURIComponent(t)):"/bapi/checkout-session-status-by-user?userid=".concat(e),i=await fetch(o),n=await i.json();console.log("[Subscription Status Response]",n),"Effective subscription"===n.status?(s=!0,"trial on 14 days"===n.message?console.log("[Trial User] User is on trial, subscription status set to true"):n.orders&&n.orders.length>0&&console.log("[Paid Subscription] User has valid paid subscription:",n.orders[0])):(s=!1,console.log("[No Subscription] User does not have valid subscription"))}catch(e){console.error("query subscripiton status failed:",e),s=!1}console.log("======fetchSubscriptionStatus=>>>>>>>>>>subscriptionStatus=",s),o(s),e&&localStorage.setItem("subscription_status_".concat(e),s.toString())};(async()=>{var e;if(!d){a(!1);return}let s=null==t?void 0:null===(e=t.primaryEmailAddress)||void 0===e?void 0:e.emailAddress;if(!s){console.log("[Warning] Email not available yet, will retry in 500ms"),setTimeout(()=>{var e;let s=null==t?void 0:null===(e=t.primaryEmailAddress)||void 0===e?void 0:e.emailAddress;s?i(d,s):(console.log("[Warning] Email still not available, calling API without email"),i(d,null))},500);return}await i(d,s)})()},[c,d,null==t?void 0:t.id,null==t?void 0:null===(e=t.primaryEmailAddress)||void 0===e?void 0:e.emailAddress]),{userId:d,isSignedIn:l,isSubscription:s,isLoading:u}}function a(){return(0,o.jsx)("div",{children:"API Documentation"})}},26342:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return l}});var o=s(52676),i=s(75271),n=s(18331),r=s(2649),u=s(94012),a=s(97198),c=s(13590);function l(){let{user:e}=(0,c.aF)(),{isLoaded:t}=(0,a.y)(),{isSubscription:s}=(0,u.useUserSubscription)(),l=(0,i.useRef)(s,null);return((0,i.useEffect)(()=>{l.current=s},[s]),(0,i.useEffect)(()=>{if((null==e?void 0:e.id)&&null!==l.current&&!l.current){window.location.href="/pricing";return}},[null==e?void 0:e.id,s]),(0,i.useEffect)(()=>(document.body.style.overflow="hidden",document.body.style.height="100vh",()=>{document.body.style.overflow="",document.body.style.height=""}),[]),t)?(0,o.jsxs)("div",{className:"fixed inset-0 flex",children:[(0,o.jsx)(n.Z,{activeTable:"project",onTabChange:()=>{},className:"h-full w-16 overflow-y-auto bg-white shadow-md md:w-64"}),(0,o.jsx)("div",{className:"relative h-full min-h-0 w-full min-w-0 flex-1 overflow-y-auto",children:(0,o.jsx)(r.default,{})})]}):(0,o.jsxs)("div",{className:"fixed inset-0 flex items-center justify-center bg-gray-50",children:[(0,o.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-b-2 border-gray-900"}),(0,o.jsx)("p",{className:"ml-2",children:"Loading authentication..."})]})}}},function(e){e.O(0,[7077,5354,8331,2649,2888,9774,179],function(){return e(e.s=43075)}),_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.