PageSourceSearch

https://www.startmyclaim.ai/assets/Start-BkiVNP1O.js

js startmyclaim.ai collected 2026-10-05 14:09:18 UTC 2,978 bytes, 1 lines download raw bytes

1import{j as s}from"./client-6l7EspPw.js";import{f as P,a as T,r as u,N as I}from"./vendor-react-DrAGubKe.js";import{u as C,s as k,g as A,t as E,b as R,o as j,e as w,p as D}from"./AuthContext-Da0jsCTA.js";import{i as L}from"./track-fqGQEj0M.js";import"./vendor-supabase-ClVc2H6D.js";function _(t){return L({tier:t.tier,claim_types:t.claim_types})}function W(t){return typeof t!="string"||t.length===0||!t.startsWith("/")||t.startsWith("//")||t.includes("\\")||t==="/login"||t==="/start"?null:t}function J(){const{user:t,loading:c}=C(),r=P(),d=T(),[f,m]=u.useState(null),[v,N]=u.useState(0);return u.useEffect(()=>{if(c||!t)return;let n=!1;return(async()=>{var x;m(null);try{const e=Number(localStorage.getItem("smc.admin_return")||0);if(e&&(localStorage.removeItem("smc.admin_return"),Date.now()-e<15*60*1e3)){r("/admin",{replace:!0});return}}catch{}const p=W((x=d.state)==null?void 0:x.from);if(p){r(p,{replace:!0});return}const{data:S,error:o}=await k.from("cases").select("id, situation, tier, claim_types").eq("user_id",t.id).order("created_at",{ascending:!1});if(n)return;if(o){const e=(o.message??"").toLowerCase();if((o.code??"")==="PGRST301"||e.includes("jwt")||e.includes("unauth")||e.includes("expired")){await k.auth.signOut().catch(()=>{}),r("/login?expired=1",{replace:!0});return}m("Could not load your account — please check your connection and try again.");return}const g=S??[],a=A(),O=new Set(g.filter(e=>e.situation!==null).map(e=>_(e)));if(a){const e=E(a),l=O.has(e),b=(()=>{if(e!=="rr")return!1;try{const i=localStorage.getItem("smc.rrTriage");if(!i)return!1;const y=JSON.parse(i);return y.savedAt?Date.now()-y.savedAt<=30*60*1e3:!1}catch{return!1}})();if(R(a))if(l&&!b){const i=e==="sc"?"/small-claims/choose-plan":e==="sr"?"/scam-recovery/choose-plan":D(e);r(i,{replace:!0})}else r(j(a),{replace:!0});else if(l){try{sessionStorage.setItem("smc_just_finished_onboarding","1")}catch{}r(w(e),{replace:!0,state:{exitedOnboarding:!0}})}else r(j(a),{replace:!0});return}const h=g.find(e=>e.situation!==null);if(h){const e=_(h);try{sessionStorage.setItem("smc_just_finished_onboarding","1")}catch{}r(w(e),{replace:!0,state:{exitedOnboarding:!0}})}else r("/onboarding",{replace:!0})})(),()=>{n=!0}},[c,t,r,v,d.state]),!c&&!t?s.jsx(I,{to:"/login",replace:!0}):f?s.jsx("div",{className:"min-h-screen bg-ink-bg flex items-center justify-center px-6",children:s.jsxs("div",{className:"max-w-sm text-center",children:[s.jsx("p",{className:"text-sm font-semibold text-ink mb-2",children:"Couldn't load your account"}),s.jsx("p",{className:"text-xs text-ink-muted mb-5",children:f}),s.jsx("button",{onClick:()=>N(n=>n+1),className:"px-5 py-2.5 bg-ink text-white text-sm font-bold rounded-xl hover:opacity-90 transition-opacity",children:"Try again"})]})}):s.jsx("div",{className:"min-h-screen bg-ink-bg flex items-center justify-center",children:s.jsx("div",{className:"animate-spin h-8 w-8 border-4 border-ink border-t-transparent rounded-full"})})}export{J as Start};

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.