PageSourceSearch

https://traail.ai/_next/static/chunks/app/accept/%5Btoken%5D/page-72f5e3e60ffef3ce.js

js traail.ai collected 2026-10-05 14:17:38 UTC 14,722 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7613],{6326:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var r=a(95155),s=a(12115);function n({size:e=120}){let t=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=!1;async function a(){try{await document.fonts?.ready}catch{}let a=t.current;if(!a||e)return;let r=a.firstChild;for(;r&&r.nodeType!==Node.TEXT_NODE;)r=r.firstChild;if(!r)return;let{left:s,width:n}=a.getBoundingClientRect();if(0===n)return;let o=document.createRange();o.setStart(r,3),o.setEnd(r,5);let i=o.getBoundingClientRect(),c=((i.left-s)/n*100).toFixed(1),l=((s+n-i.right)/n*100).toFixed(1);a.style.setProperty("--ai-clip",`inset(0 ${l}% 0 ${c}%)`)}a();let r=setTimeout(a,200),s=()=>a();return window.addEventListener("resize",s),()=>{e=!0,clearTimeout(r),window.removeEventListener("resize",s)}},[e]),(0,r.jsx)("span",{ref:t,className:"traail-shimmer",style:{fontSize:e},children:"TRAAIL"})}},20492:(e,t,a)=>{"use strict";a.d(t,{N:()=>m,D:()=>g});var r=a(95155),s=a(12115),n=a(81381);let o="traail-theme",i=["light","dark","custom"];function c(){try{let e=localStorage.getItem(o);if(!e)return null;let t=JSON.parse(e);if(!t||!i.includes(t.mode))return null;return t}catch{return null}}function l(e){try{localStorage.setItem(o,JSON.stringify(e))}catch{}}let d=(0,s.createContext)(null),u=["#fdf8f2","#f5e9d6","#3d3230","#8e6a41","#242e22"];function h(e){return e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function f(e,t,a){let r={workspaceId:e||void 0,mode:t};if("custom"===t&&Array.isArray(a)&&5===a.length){r.customColors=a;let e=(0,n.bn)(...a),t={};Object.entries(e.colors).forEach(([e,a])=>{t[`--color-${h(e)}`]=a}),r.vars=t}return r}function m({children:e,workspaceId:t}){let a,[o,i]=(0,s.useState)("light"),[m,g]=(0,s.useState)(u),[b,p]=(0,s.useState)(!1),y=t||(a=window.location.pathname.match(/\/workspace\/([^/]+)/),a?.[1]||null),x=(0,s.useEffectEvent)((e,t)=>{let a=!1;return"string"==typeof e&&["light","dark","custom"].includes(e)&&(i(e),a=!0),Array.isArray(t)&&5===t.length&&(g(t),a=!0),a}),v=(0,s.useEffectEvent)(()=>p(!0));(0,s.useEffect)(()=>{let e=c();if(!e||y&&e.workspaceId&&e.workspaceId!==y||x(e.mode,e.customColors),!y)return void v();let t=new AbortController;return fetch(`/api/workspaces/${y}/theme`,{signal:t.signal}).then(e=>e.ok?e.json():null).then(e=>{!t.signal.aborted&&e&&(x(e.themeMode,e.themeCustomColors),l(f(y,e.themeMode,e.themeCustomColors??null)))}).catch(()=>{}).finally(()=>{t.signal.aborted||v()}),()=>t.abort()},[y]);let j=(0,s.useMemo)(()=>(function(e,t){switch(e){case"dark":return n.a5;case"custom":return(0,n.bn)(...t);default:return n._k}})(o,m),[o,m]);(0,s.useEffect)(()=>{if(!b)return;document.documentElement.setAttribute("data-theme",o);let e=document.documentElement.style;Object.entries(j.colors).forEach(([t,a])=>{e.setProperty(`--color-${h(t)}`,a)})},[o,m,b,j]);let w=(0,s.useCallback)((e,t)=>{l(f(y,e,"custom"===e?t:null)),y&&fetch(`/api/workspaces/${y}/theme`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({themeMode:e,themeCustomColors:"custom"===e?t:void 0})}).catch(()=>{})},[y]),S=(0,s.useCallback)(e=>{i(e),w(e,m)},[m,w]),k=(0,s.useCallback)(e=>{g(e),i("custom"),w("custom",e)},[w]),P=(0,s.useCallback)(e=>{g(e),i("custom")},[]),N=(0,s.useCallback)(()=>{let e=c(),t=e?.customColors;i(e?.mode??"light"),g(Array.isArray(t)&&5===t.length?t:u)},[]),C=(0,s.useMemo)(()=>({mode:o,theme:j,colors:j.colors,setMode:S,customColors:m,setCustomColors:k,previewCustomColors:P,revertPreview:N}),[o,j,m,S,k,P,N]);return(0,r.jsx)(d.Provider,{value:C,children:e})}function g(){let e=(0,s.useContext)(d);if(!e)throw Error("useTheme must be used within ThemeProvider");return e}},32300:()=>{},34520:(e,t,a)=>{Promise.resolve().then(a.bind(a,34725))},34725:(e,t,a)=>{"use strict";a.d(t,{default:()=>d});var r=a(95155),s=a(12115),n=a(73321),o=a(37882),i=a(35904),c=a(20492),l=a(67298);function d({token:e,view:t}){let{colors:a}=(0,c.D)(),d=(0,n.useRouter)(),[u,h]=(0,s.useState)(""),[f,m]=(0,s.useState)(""),[g,b]=(0,s.useState)(!1),[p,y]=(0,s.useState)(null),x=`/login?callbackUrl=${encodeURIComponent(`/accept/${e}`)}`,v=(e,t)=>
1(e instanceof l.fk?e.data?.error:null)||t,j=async()=>{b(!0),y(null);try{let t=await (0,l.hI)("/api/invites/accept",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e})});d.push(`/workspace/${t.workspacePublicId}`)}catch(e){y(v(e,"We could not accept this invitation.")),b(!1)}},w=async()=>{if(!u.trim()||f.length<8)return void y("Enter your name and a password of at least 8 characters.");b(!0),y(null);try{let t=await (0,l.hI)("/api/invites/accept-signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,firstName:u,password:f})}),a=await (0,o.signIn)("credentials",{email:t.email,password:f,redirect:!1});a?.ok?d.push(`/workspace/${t.workspacePublicId}`):(y("Your account is ready. Please sign in to continue."),d.push(x))}catch(e){y(v(e,"We could not complete your signup.")),b(!1)}},S={maxWidth:"var(--auth-form-max-w)",padding:"var(--auth-form-padding)",borderRadius:"var(--auth-form-radius)",backgroundColor:a.bgSecondary},k={fontSize:"var(--auth-text-display)",marginBottom:"var(--auth-title-mb)",color:a.textPrimary},P={fontSize:"var(--auth-text-body)",marginBottom:"var(--auth-subtitle-mb)",color:a.textSecondary},N={width:"100%",padding:"12px 14px",borderRadius:"var(--auth-btn-radius)",border:`1px solid ${a.borderPrimary}`,background:a.bgPrimary,color:a.textPrimary,fontSize:"var(--auth-text-body)"},C=e=>({display:"block",width:"100%",textAlign:"center",padding:"var(--auth-btn-py) var(--auth-btn-px)",borderRadius:"var(--auth-btn-radius)",fontSize:"var(--auth-text-body)",backgroundColor:a.btnPrimary,color:a.btnPrimaryText,opacity:e?.5:1}),A={fontSize:"var(--auth-text-sm)",color:a.textSecondary},T=p?(0,r.jsx)("div",{className:"rounded",style:{padding:"var(--auth-alert-p)",marginBottom:"var(--auth-alert-mb)",fontSize:"var(--auth-text-sm)",backgroundColor:a.bgPrimary,color:a.statusUrgent,border:`2px solid ${a.statusUrgent}`},children:p}):null;return(0,r.jsxs)("div",{className:"relative min-h-screen",children:[(0,r.jsx)(i.A,{}),(0,r.jsx)("div",{className:"relative z-10 min-h-screen flex items-center justify-center",children:(0,r.jsxs)("div",{className:"w-full shadow-2xl",style:S,children:["invalid"===t.state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h1",{className:"font-bold text-center",style:k,children:"Invitation not available"}),(0,r.jsx)("p",{className:"text-center",style:P,children:"This invitation link is invalid or has expired. Ask the workspace admin to send a new one."})]}),"accepted"===t.state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h1",{className:"font-bold text-center",style:k,children:"Already accepted"}),(0,r.jsxs)("p",{className:"text-center",style:P,children:["This invitation has already been accepted. Sign in to reach ",(0,r.jsx)("strong",{children:t.workspaceName}),"."]}),(0,r.jsx)("a",{href:x,className:"font-semibold hover:opacity-90",style:C(!1),children:"Sign in"})]}),"mismatch"===t.state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h1",{className:"font-bold text-center",style:k,children:"Wrong account"}),(0,r.jsx)("p",{className:"text-center",style:P,children:"This invitation was sent to a different email address. Sign in with that address to accept it."}),(0,r.jsx)("a",{href:x,className:"font-semibold hover:opacity-90",style:C(!1),children:"Sign in with a different account"})]}),"ready"===t.state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h1",{className:"font-bold text-center",style:k,children:"Accept your invitation"}),(0,r.jsxs)("p",{className:"text-center",style:P,children:["Signed in as ",(0,r.jsx)("strong",{children:t.email}),". Accept to join ",(0,r.jsx)("strong",{children:t.workspaceName}),"."]}),T,(0,r.jsx)("button",{type:"button",onClick:j,disabled:g,className:"font-semibold hover:opacity-90",style:C(g),children:g?"Accepting...":"Accept invitation"})]}),"login"===t.state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h1",{className:"font-bold text-center",style:k,children:"You have been invited"}),(0,r.jsxs)("p",{className:"text-center",style:P,children:["An account already exists for ",(0,r.jsx)("strong",{children:t.email}),". Sign in to join ",(0,r.jsx)("strong",{children:t.workspaceName}),"."]}),(0,r.jsx)("a",{href:x,className:"font-semibold hover:opacity-90",style:C(!1),children:"Sign in to accept"})]}),"signup"===t.state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("h1",{className:"font-bold text-center",style:k,children:["Join ",t.workspaceName]}),(0,r.jsxs)("p",{className:"text-center",style:P,children:["You have been invited as ",(0,r.jsx)("strong",{children:t.email}),". Set your name and a password to join."]}),T,(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),w()},style:{display:"flex",flexDirection:"column",gap:"var(--auth-form-gap)"},children:[(0,r.jsx)("input",{id:"accept-firstname",style:N,type:"text",placeholder:"Your name",value:u,onChange:e=>h(e.target.value),"aria-label":"Your name",autoComplete:"given-name"}),(0,r.jsx)("input",{id:"accept-password",style:N,type:"password",placeholder:"Choose a password (min 8 characters)",value:f,onChange:e=>m(e.target.value),"aria-label":"Choose a password",autoComplete:"new-password"}),(0,r.jsx)("button",{type:"submit",disabled:g,className:"font-semibold hover:opacity-90",style:C(g),
1children:g?"Joining...":"Join workspace"})]}),(0,r.jsx)("div",{style:{marginTop:"var(--auth-space-6)",textAlign:"center"},children:(0,r.jsx)("a",{href:x,className:"hover:underline",style:A,children:"Already have an account? Sign in"})})]})]})})]})}a(44866)},35904:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var r=a(95155),s=a(5772),n=a(6326);function o(){return(0,r.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,filter:"blur(8px)",opacity:.55,pointerEvents:"none",overflow:"hidden"},children:(0,r.jsx)("div",{className:"lp","data-theme":"warm","data-mode":"light",children:(0,r.jsxs)("section",{className:"lp-hero",style:{height:"100vh"},children:[(0,r.jsxs)("div",{className:"hero-photo",children:[(0,r.jsx)(s.default,{src:"/landing/hero-sunset.jpg",alt:"",fill:!0,sizes:"100vw",style:{objectFit:"cover"}}),(0,r.jsx)("div",{className:"veil"}),(0,r.jsx)("div",{className:"veil-l"})]}),(0,r.jsx)("div",{className:"dark-surface lp-hero-content",children:(0,r.jsx)("div",{className:"lp-hero-inner",children:(0,r.jsx)("div",{className:"lp-hero-mark",children:(0,r.jsx)(n.A,{size:120})})})})]})})})}a(32300)},44866:()=>{},67298:(e,t,a)=>{"use strict";a.d(t,{A8:()=>o,bH:()=>s,fk:()=>r,hI:()=>n});class r extends Error{constructor(e,t){super(`Fetch failed with status ${e}`),this.name="FetchError",this.status=e,this.data=t}}let s="api:rate-limited";async function n(e,t){let a=await fetch(e,t),n=await a.json().catch(()=>null);if(429===a.status&&n&&"object"==typeof n&&"string"==typeof n.category&&window.dispatchEvent(new CustomEvent(s,{detail:{category:n.category,retryAfterMs:n.retryAfterMs??null,resetAt:n.resetAt??new Date(Date.now()+6e4).toISOString()}})),!a.ok)throw new r(a.status,n);return n}async function o(e,t,a){return n(e,{method:t,headers:void 0!==a?{"Content-Type":"application/json"}:void 0,body:void 0!==a?JSON.stringify(a):void 0})}},73321:(e,t,a)=>{"use strict";var r=a(74645);a.o(r,"useParams")&&a.d(t,{useParams:function(){return r.useParams}}),a.o(r,"usePathname")&&a.d(t,{usePathname:function(){return r.usePathname}}),a.o(r,"useRouter")&&a.d(t,{useRouter:function(){return r.useRouter}}),a.o(r,"useSearchParams")&&a.d(t,{useSearchParams:function(){return r.useSearchParams}})},81381:(e,t,a)=>{"use strict";a.d(t,{E2:()=>i,LE:()=>o,Lh:()=>c,_k:()=>r,a:()=>n,a5:()=>s,bn:()=>l});let r={name:"light",colors:{bgPrimary:"#fdf8f2",bgSecondary:"#f5e9d6",bgSurface:"#ffffff",bgSurfaceAlt:"#faf6f1",bgMuted:"#f5e9d6",bgHover:"#f5efe7",textPrimary:"#3d3230",textSecondary:"#8e6a41",textMuted:"#8e7e75",textGhost:"#b0a8a2",borderPrimary:"#8e6a41",borderSubtle:"rgba(61,50,48,0.12)",borderFaint:"rgba(61,50,48,0.06)",accent:"#242e22",btnPrimary:"#3d3230",btnPrimaryText:"#fdf8f2",statusPositive:"#4a6b45",statusPositiveBg:"rgba(74,107,69,0.08)",statusWarning:"#c4923a",statusWarningBg:"rgba(196,146,58,0.08)",statusUrgent:"#a85244",statusUrgentBg:"rgba(168,82,68,0.08)",statusUrgentText:"#ffffff",statusInfo:"#8e6a41",statusInfoBg:"rgba(142,106,65,0.08)",avatarBg:"#e8ddd3",avatarText:"#5c4a42",progressTrack:"#f0e8df",tagBg:"#f0e8df",tagText:"#6b5c55"}},s={name:"dark",colors:{bgPrimary:"#1c1b1a",bgSecondary:"#272524",bgSurface:"#2b2928",bgSurfaceAlt:"#312f2d",bgMuted:"#3a3836",bgHover:"#434140",textPrimary:"#fdf8f2",textSecondary:"rgba(245,233,214,0.7)",textMuted:"#a8958d",textGhost:"#6b5c55",borderPrimary:"#8e6a41",borderSubtle:"rgba(61,50,48,0.15)",borderFaint:"rgba(61,50,48,0.08)",accent:"#8e6a41",btnPrimary:"#f5e9d6",btnPrimaryText:"#1c1b1a",statusPositive:"#6a9b62",statusPositiveBg:"rgba(106,155,98,0.12)",statusWarning:"#d4a24a",statusWarningBg:"rgba(212,162,74,0.12)",statusUrgent:"#c06a5c",statusUrgentBg:"rgba(192,106,92,0.12)",statusUrgentText:"#ffffff",statusInfo:"#b8935e",statusInfoBg:"rgba(184,147,94,0.12)",avatarBg:"#5c4a42",avatarText:"#e8ddd3",progressTrack:"#3d3230",tagBg:"#3d3230",tagText:"#d4b896"}},n=["#C4A97D","#8B7355","#5B7F5B","#D4A574","#3D6B3D","#C17B5F","#7B8F7B","#4A7C59"];function o(e){return .299*(parseInt(e.slice(1,3),16)/255)+.587*(parseInt(e.slice(3,5),16)/255)+.114*(parseInt(e.slice(5,7),16)/255)}function i(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function c(e,t,a){let[r,s,n]=i(e),[o,c,l]=i(t);return"#"+[r+(o-r)*a,s+(c-s)*a,n+(l-n)*a].map(e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0")).join("")}function l(e,t,a,r,s){let n=o(e)>.5;return{name:"custom",colors:{bgPrimary:e,bgSecondary:t,bgSurface:n?"#ffffff"
1:c(e,"#ffffff",.08),bgSurfaceAlt:c(e,t,.3),bgMuted:t,bgHover:c(e,t,.5),textPrimary:a,textSecondary:r,textMuted:c(r,e,.3),textGhost:c(r,e,.5),borderPrimary:r,borderSubtle:`rgba(${i(a).join(",")},0.12)`,borderFaint:`rgba(${i(a).join(",")},0.06)`,accent:s,btnPrimary:a,btnPrimaryText:e,statusPositive:n?"#4a6b45":"#6a9b62",statusPositiveBg:n?"rgba(74,107,69,0.08)":"rgba(106,155,98,0.12)",statusWarning:n?"#c4923a":"#d4a24a",statusWarningBg:n?"rgba(196,146,58,0.08)":"rgba(212,162,74,0.12)",statusUrgent:n?"#a85244":"#c06a5c",statusUrgentBg:n?"rgba(168,82,68,0.08)":"rgba(192,106,92,0.12)",statusUrgentText:"#ffffff",statusInfo:n?"#8e6a41":"#b8935e",statusInfoBg:n?"rgba(142,106,65,0.08)":"rgba(184,147,94,0.12)",avatarBg:c(t,r,.2),avatarText:c(a,r,.5),progressTrack:c(e,t,.6),tagBg:c(e,t,.6),tagText:c(a,r,.6)}}}}},e=>{e.O(0,[4261,3539,7882,5772,8441,6582,7358],()=>e(e.s=34520)),_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.