PageSourceSearch

https://mycontractor.ai/assets/Callback-Cfw-g848.js

js mycontractor.ai collected 2026-10-05 15:40:31 UTC 3,052 bytes, 1 lines download raw bytes

1import{r as i,j as e}from"./react-Pe6FWNW2.js";import{f as d,i as f}from"./main-BTubGsQu.js";import{f as x,a as p}from"./maps-B1vufc5k.js";import{L as g}from"./loader-circle-B896Qya4.js";import{C as h}from"./circle-check-big-DzZP5XuY.js";import{C as b}from"./circle-x-DgEphz_4.js";import"./react-three-DilIC-6x.js";import"./three-core-DCf5pMsm.js";import"./radix-DW5jFSHj.js";import"./index-BwSk_aDc.js";import"./maplibre-D6DpX2vu.js";function y(t){if(typeof t!="string")return"/dashboard";const r=t.trim();return!r||!r.startsWith("/")||r.startsWith("//")||r.includes("://")?"/dashboard":r}async function j(t,r){try{const s=y(r),o=await x.action(p.migration.invokeSsoCallback,{token:t,returnTo:s}),n=o&&typeof o.actionLink=="string"?String(o.actionLink):"";return n?{success:!0,actionLink:n}:{success:!1,error:"SSO exchange failed"}}catch(s){return{success:!1,error:s instanceof Error?s.message:"SSO exchange failed"}}}function u(t){window.location.assign(t)}const F=()=>{const t=d(),[r]=f(),[s,o]=i.useState("processing"),[n,c]=i.useState("");return i.useEffect(()=>{(async()=>{const l=r.get("token")||r.get("sso_token"),m=r.get("return_to")||"/dashboard";if(r.get("error")){const a=r.get("error_description");o("error"),c(a?decodeURIComponent(a.replace(/\+/g," ")):"Sign-in failed. Please try again.");return}if(l){const a=await j(l,m);if(a.success&&a.actionLink){u(a.actionLink);return}o("error"),c(a.error||"Authentication failed");return}o("success"),setTimeout(()=>t(m),500)})()},[r,t]),e.jsx("main",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center max-w-md px-6",children:[s==="processing"&&e.jsxs(e.Fragment,{children:[e.jsx(g,{className:"w-16 h-16 text-primary mx-auto mb-6 animate-spin"}),e.jsx("h1",{className:"font-display text-2xl font-bold mb-2",children:"Verifying your account..."}),e.jsx("p",{className:"text-muted-foreground",children:"Please wait while we complete your sign-in."})]}),s==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{className:"w-16 h-16 text-green-500 mx-auto mb-6"}),e.jsx("h1",{className:"font-display text-2xl font-bold mb-2",children:"Welcome to Contractor AI!"}),e.jsx("p",{className:"text-muted-foreground",children:"Redirecting you to your dashboard..."})]}),s==="error"&&e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"w-16 h-16 text-red-500 mx-auto mb-6"}),e.jsx("h1",{className:"font-display text-2xl font-bold mb-2",children:"Sign-In Issue"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:n}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("button",{type:"button",onClick:()=>t("/sign-in"),className:"w-full py-3 px-6 rounded-xl bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors",children:"Try Again"}),e.jsx("button",{type:"button",onClick:()=>u("https://mycontractor.ai"),className:"w-full py-3 px-6 rounded-xl bg-secondary text-secondary-foreground font-medium hover:bg-secondary/80 transition-colors",children:"Return to Contractor AI"})]})]})]})})};export{F 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.