PageSourceSearch

https://www.creatorsenseai.com/app/assets/useOnboardingResolve-Dmmhp6LW.js

js creatorsenseai.com collected 2026-10-02 01:29:33 UTC 5,761 bytes, 1 lines download raw bytes

1import{u as B}from"./vendor-vue-BIDZeepx.js";import{o as _,y as U,e as J,k as C,P as Y,ac as k}from"./index-BNPflmqD.js";import{r as l,c as g,_ as D}from"./vendor-misc-5pJBpqhN.js";const O="cs_seed_identity";function G(e){const o=e.trim();return o?o.includes("@")&&o.includes(".")?"email":o.startsWith("@")||/^[a-zA-Z0-9_.]+$/.test(o)?"handle":"name":"name"}function K(e){switch(e){case"email":return"Looks like an email — we will search profiles and linked accounts.";case"handle":return"Looks like a social handle — we will map likely platforms.";default:return"We will search the web for this creator or brand name."}}function V(){const e=l(""),o=l(""),c=l(!1),f=g(()=>G(e.value)),b=g(()=>e.value.trim()?K(f.value):""),s=["[email protected]","@MrBeast","MrBeast"],r=l(0),v=g(()=>s[r.value%s.length]);let u=null;function y(){u||(u=setInterval(()=>{r.value+=1},3500))}function m(){u&&(clearInterval(u),u=null)}function w(){const d=e.value.trim();return d?{raw:d,type:f.value,optionalUrl:o.value.trim()||null}:null}function S(d){sessionStorage.setItem(O,JSON.stringify(d))}function P(){const d=sessionStorage.getItem(O);if(!d)return null;try{return JSON.parse(d)}catch{return null}}function p(){sessionStorage.removeItem(O)}return{raw:e,optionalUrl:o,showOptionalUrl:c,identityType:f,hint:b,rotatingPlaceholder:v,startPlaceholderRotation:y,stopPlaceholderRotation:m,buildSeed:w,persistSeed:S,consumeSeed:P,clearSeed:p}}async function j(e){const{data:o}=await _.post("/v1/onboarding/resolve",e);return o}async function x(){const{data:e}=await _.post("/v1/onboarding/complete",{});return e}async function F(){const{data:e}=await _.get("/v1/onboarding/progress");return e}async function I(e,o){try{await _.post("/v1/onboarding/progress",{step:e,data:o})}catch{}}const H="cs:activation";function h(e,o={}){const c={step:e,...o,ts:Date.now()};try{typeof window<"u"&&typeof window.dispatchEvent=="function"&&window.dispatchEvent(new CustomEvent(H,{detail:c}))}catch{}}async function W(){if(!(typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches))try{const{default:o}=await U(async()=>{const{default:c}=await import("./vendor-misc-5pJBpqhN.js").then(f=>f.af);return{default:c}},[]);o({particleCount:100,spread:72,origin:{y:.62},colors:["#fcd34d","#6eb0ff","#2563eb","#d97706"]})}catch{}}const $={enrich:"Scanning public creator signals…",web:"Searching the open web…",web_search:"Searching the open web…",social:"Mapping social handles…",oauth:"Reading your connected accounts…",mcp:"Enriching from creator data sources…",influencers_club:"Enriching from creator data sources…"};function R(e){sessionStorage.setItem(k,JSON.stringify(e))}function X(){const e=sessionStorage.getItem(k);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function ee(){const e=B(),o=J(),{consumeSeed:c,clearSeed:f,persistSeed:b}=V(),s=l("building"),r=l(null),v=l(null),u=l("Building your creator profile…"),y=l(""),m=l("youtube"),w=g(()=>{var t,a;return((t=r.value)==null?void 0:t.display_name)??((a=r.value)==null?void 0:a.creator_name)??"Creator"}),S=g(()=>{var a;return(((a=r.value)==null?void 0:a.sources)??["enrich"]).map(n=>$[n]??`Checking ${n}…`)}),P={building:1,confirm:2,connect:3,not_found:4,error:1};async function p(t){const a=c();if(!a)return;const n={flow:"frictionless",seed:a,phase:t==="error"?"building":t,resolved_profile:r.value??void 0};await I(P[t],n)}async function d(){var t;try{const n=(await F()).data;return(n==null?void 0:n.flow)!=="frictionless"||!((t=n.seed)!=null&&t.raw)?!1:(b(n.seed),n.resolved_profile&&(r.value=n.resolved_profile,R(r.value)),n.phase&&n.phase!=="building"?(s.value=n.phase,!0):!!n.seed)}catch{return!1}}async function E(){var a,n;s.value="building",v.value=null,u.value="Building your creator profile…";let t=c();if(!t){const i=await d();if(t=c(),!i||!t){await e.push("/start");return}if(["confirm","connect"].includes(s.value))return}await p("building");try{const i=await j({seed_identity:t.raw,seed_type:t.type,optional_url:t.optionalUrl});if(i.status==="pending"){u.value="Still searching — this can take a few seconds…",setTimeout(()=>void E(),1500);return}if(i.status==="not_found"||!((a=i.profile)!=null&&a.found)){h("resolve",{found:!1,sources:(i.sources??[]).join(",")}),s.value="not_found",r.value=i.profile??{found:!1,display_name:t.raw,creator_name:t.raw},await p("not_found");return}h("resolve",{found:!0,platform_count:((n=i.profile.connected_socials)==null?void 0:n.length)??0}),r.value=i.profile,R(i.profile),s.value="confirm",await p("confirm")}catch(i){s.value="error",v.value=C(i,"Could not resolve your profile.")}}async function T(){var t,a;h("aha",{confirmed:!0}),h("connect",{platform_count:((a=(t=r.value)==null?void 0:t.connected_socials)==null?void 0:a.length)??0}),W();try{await x(),o.user&&(o.user.onboarding_completed=!0)}catch(n){v.value=C(n,"Could not save your profile confirmation.");return}s.value="connect",p("connect")}function A(){s.value="not_found",r.value&&(r.value={...r.value,found:!1})}function M(){s.value="not_found"}function N(){const t=c(),a=(t==null?void 0:t.raw)??w.value;r.value={found:!0,display_name:a,creator_name:a,niche:y.value||null,connected_socials:m.value?[{platform:m.value,estimated:!0}]:[],sources:["manual"]},R(r.value),s.value="confirm",p("confirm")}async function L(t=!1){f(),h("activated");try{sessionStorage.setItem(Y,"1")}catch{}try{await I(-1,{flow:"frictionless",phase:"connect",resolved_profile:r.value??void 0})}catch{}await e.push("/dashboard")}return D(()=>{E()}),{phase:s,profile:r,error:v,statusCopy:u,displayName:w,rotatingSources:S,manualNiche:y,manualPlatform:m,resolve:E,confirmProfile:T,rejectProfile:A,editProfile:M,applyManualProfile:N,finishOnboarding:L}}export{X as c,h as t,ee as u};

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.