PageSourceSearch

https://www.trybased.com/static/js/333.5b35cb51.chunk.js

js trybased.com collected 2026-09-24 14:55:14 UTC 65,764 bytes, 3 lines download raw bytes

1/*! For license information please see 333.5b35cb51.chunk.js.LICENSE.txt */
2(self.webpackChunkknowledge_base_saas=self.webpackChunkknowledge_base_saas||[]).push([[333],{15003(e,t,n){"use strict";n.d(t,{A:()=>m});var a=n(89379),s=n(53986),r=n(65043),o=n(98139),i=n.n(o),l=n(66630),c=n(70579);const d=["size","fullWidth","loading","leadingIcon","trailingIcon","className","disabled","children","type"],u={sm:"py-2 px-3 text-body-sm font-medium",md:"py-2 px-4 text-body-md font-medium",lg:"py-3 px-4 text-body-md font-medium"},m=(0,r.forwardRef)(function(e,t){let n=e.size,r=void 0===n?"md":n,o=e.fullWidth,m=void 0!==o&&o,p=e.loading,g=void 0!==p&&p,h=e.leadingIcon,x=e.trailingIcon,y=e.className,f=e.disabled,w=e.children,b=e.type,v=void 0===b?"button":b,j=(0,s.A)(e,d);const A=Boolean(g),E=A?(0,c.jsx)(l.y$,{size:"sm",className:"shrink-0","aria-hidden":!0}):h;return(0,c.jsxs)("button",(0,a.A)((0,a.A)({ref:t,type:v,disabled:f||A,className:i()("inline-flex items-center justify-center font-medium bg-brand hover:bg-brand-hover text-brand-on rounded-brand-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-focus-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors",u[r]||u.md,m&&"w-full justify-center",(E||x)&&"gap-2",y)},j),{},{children:[E,w,x]}))})},80333(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>O});var a=n(89379),s=n(5544),r=n(65043),o=n(67898),i=n(55472),l=n(52395),c=n(96822),d=n(47874),u=n(66630),m=n(15003),p=n(28279),g=n(77784);const h=(0,g.A)("chrome",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["line",{x1:"21.17",x2:"12",y1:"8",y2:"8",key:"a0cw5f"}],["line",{x1:"3.95",x2:"8.54",y1:"6.06",y2:"14",key:"1kftof"}],["line",{x1:"10.88",x2:"15.46",y1:"21.94",y2:"14",key:"1ymyh8"}]]);var x=n(36210),y=n(65469),f=n(35327);const w=(0,g.A)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var b=n(35087),v=n(33868),j=n(96060),A=n(82665),E=n(68400),C=n(71638),N=n(47081),k=n(17070),_=n(10430),I=n(22371);const P=new Set(["crm.trybased.com"]);function R(e){return P.has(function(e){return String(e||"").trim().toLowerCase().replace(/\.$/,"")}(e))}function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.rememberMe,n=void 0!==t&&t,a=e.hostname;return!!R(void 0===a?"":a)||!0===n}var T=n(1862),L=n(70579);const O=()=>{const e=(0,d.Zp)(),t=(0,d.ok)(),n=(0,s.A)(t,1)[0],g=(0,d.zy)(),P=(0,p.hD)((0,o.xI)()),O=(0,s.A)(P,2),z=O[0],U=O[1],M=(0,r.useState)(null),D=(0,s.A)(M,2),B=D[0],F=D[1];(0,r.useEffect)(()=>{let e=!1;return fetch("".concat(".","/app-updates-version.json"),{cache:"no-store"}).then(e=>e.ok?e.json():null).then(t=>{e||null!==t&&void 0!==t&&t.beta&&null!==t&&void 0!==t&&t.version&&F(t.version)}).catch(()=>{}),()=>{e=!0}},[]);const V=n.get("plan"),W=n.get("source"),G=n.get("state"),H=!!G,q=n.get("returnUrl"),J=n.get("prompt"),Y=q&&decodeURIComponent(q).includes("/accept-invite"),Q=q&&decodeURIComponent(q).includes("/join/"),Z="undefined"!==typeof window?window.location.hostname:"",$=R(Z),K=n.get("mode"),X=n.get("oobCode"),ee="verifyEmail"===K&&!!X,te="signIn"===K&&!!X,ne=(0,r.useState)(()=>ee?"running":"idle"),ae=(0,s.A)(ne,2),se=ae[0],re=ae[1],oe=(0,r.useState)(()=>te?(0,C.X3)()?"running":"needs-email":"idle"),ie=(0,s.A)(oe,2),le=ie[0],ce=ie[1],de=(0,r.useState)(""),ue=(0,s.A)(de,2),me=ue[0],pe=ue[1],ge=(0,r.useState)("resetPassword"===K&&X?"reset-password":H?"login":V||Y?"signup":"login"),he=(0,s.A)(ge,2),xe=he[0],ye=he[1],fe=(0,r.useState)(V||"explorer"),we=(0,s.A)(fe,1)[0],be=(0,r.useState)(W||"direct"),ve=(0,s.A)(be,1)[0],je=(0,r.useState)({firstName:"",lastName:"",email:"",password:"",confirmPassword:"",termsAccepted:!1,rememberMe:!1}),Ae=(0,s.A)(je,2),Ee=Ae[0],Ce=Ae[1],Ne=(0,r.useState)(""),ke=(0,s.A)(Ne,2),_e=ke[0],Ie=ke[1],Pe=(0,r.useState)(!1),Re=(0,s.A)(Pe,2),Se=Re[0],Te=Re[1],Le=(0,r.useState)({newPassword:"",confirmNewPassword:""}),Oe=(0,s.A)(Le,2),ze=Oe[0],Ue=Oe[1],Me=(0,r.useState)(!1),De=(0,s.A)(Me,2),Be=De[0],Fe=De[1],Ve=(0,r.useState)(!1),We=(0,s.A)(Ve,2),Ge=We[0],He=We[1],qe=(0,r.useState)(!1),Je=(0,s.A)(qe,2),Ye=Je[0],Qe=Je[1],Ze=(0,r.useState)(!!X&&"resetPassword"===K),$e=(0,s.A)(Ze,2),Ke=$e[0],Xe=$e[1];(0,r.useEffect)(()=>{V&&W&&(0,T.gg)("Auth page loaded: plan=".concat(V,", source=").concat(W))},[V,W]),(0,r.useEffect)(()=>
2{if(!Q||!q)return;const t=(0,E.rq)(q);t&&((0,E.Qi)(q),console.info("[DomainJoin][AuthPage] redirecting domain join auth to join page",{slug:t,returnUrl:q}),e("/join/".concat(t),{replace:!0}))},[Q,q,e]),(0,r.useEffect)(()=>{if("resetPassword"===K&&X){const e=(0,o.xI)();(0,o.RE)(e,X).then(()=>{Qe(!0),Xe(!1)}).catch(e=>{(0,T.gg)("Invalid or expired reset code:",e),Ie("This password reset link is invalid or has expired. Please request a new one."),Xe(!1),ye("forgot")})}},[K,X]),(0,r.useEffect)(()=>{if(!ee||!X)return;let t=!1;const n=()=>{const t=(0,E.HV)();e(t?"/join/".concat(t):"/",{replace:!0})};return(async()=>{const e=(0,o.xI)();try{if(e.currentUser){await(0,o.sv)(e,X);try{await(0,o.yQ)(e.currentUser)}catch(a){}}else{const t=(await(0,E.dF)({oobCode:X})).customToken;if(await(0,o.p)(e,t),e.currentUser)try{await(0,o.yQ)(e.currentUser)}catch(a){}}}catch(s){if((0,T.gg)("applyActionCode (verifyEmail):",s),e.currentUser){try{await(0,o.yQ)(e.currentUser)}catch(a){}if(e.currentUser.emailVerified)return void(t||n())}return void(t||(re("error"),"auth/expired-action-code"===(null===s||void 0===s?void 0:s.code)||"functions/failed-precondition"===(null===s||void 0===s?void 0:s.code)?Ie("This verification link has expired. Send a new one from Based and try again."):Ie("This verification link is invalid or was already used. Sign in if you already verified, or send a new verification email.")))}t||n()})(),()=>{t=!0}},[ee,X,e]);const et=async t=>{if(!(0,C.k$)(window.location.href))throw new Error("This sign-in link is invalid or has expired.");const n=(0,o.xI)();if(await(0,C.u6)(t,window.location.href),n.currentUser)try{await(0,o.yQ)(n.currentUser)}catch(s){}const a=(0,C._w)();window.history.replaceState({},"",a),e(a,{replace:!0})};(0,r.useEffect)(()=>{if(!te||"running"!==le)return;let e=!1;return(async()=>{const t=(0,C.X3)();if(t)try{await et(t)}catch(n){(0,T.gg)("signInWithEmailLink (domain join):",n),e||(ce("error"),"auth/invalid-action-code"===(null===n||void 0===n?void 0:n.code)||"auth/expired-action-code"===(null===n||void 0===n?void 0:n.code)?Ie("This sign-in link has expired. Request a new link from your join page."):Ie(n.message||"Unable to complete sign-in from this link."))}else e||ce("needs-email")})(),()=>{e=!0}},[te,le]);const tt=async e=>{e.preventDefault(),Ie("");const t=me.trim().toLowerCase();if(t)try{ce("running"),await et(t)}catch(n){(0,T.gg)("signInWithEmailLink confirm (domain join):",n),ce("error"),"auth/invalid-action-code"===(null===n||void 0===n?void 0:n.code)||"auth/expired-action-code"===(null===n||void 0===n?void 0:n.code)?Ie("This sign-in link has expired. Request a new link from your join page."):Ie(n.message||"Unable to complete sign-in from this link.")}else Ie("Enter the email address where you received the sign-in link.")};(0,r.useEffect)(()=>{var e;const t=null===(e=g.state)||void 0===e?void 0:e.inviteEmail;t&&Ce(e=>(0,a.A)((0,a.A)({},e),{},{email:t}))},[g.state]);const nt=async function(t,n){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if((0,T.gg)("\ud83d\udd10 handleAuthSuccess called with REAL Firebase user:",t),(0,T.gg)("\ud83d\udd10 Real token (first 50 chars):",n.substring(0,50)+"..."),null!==a&&void 0!==a&&a.newWorkspace){const e=a.newWorkspace.id;(0,T.gg)("\ud83c\udfaf Auto-selecting default workspace for new user:",e),window.dispatchEvent(new CustomEvent("selectDefaultWorkspace",{detail:{workspaceId:e}}))}if(H){const e={token:n,user:{uid:t.uid,email:t.email,displayName:t.displayName,photoURL:t.photoURL}};(0,T.gg)("\ud83d\udd10 Sending REAL auth data to extension:",e),await(async e=>{if(G)try{(0,T.gg)("\ud83d\udd10 Completing extension auth with REAL data:",e),(0,T.gg)("\ud83d\udd10 Extension state:",G);const a={state:G,authData:e,timestamp:Date.now()};localStorage.setItem("extensionAuthResult",JSON.stringify(a)),(0,T.gg)("\u2705 Stored REAL auth result in localStorage:",a),window.extensionAuthResult=a,(0,T.gg)("\u2705 Stored REAL auth result in window");try{"undefined"!==typeof chrome&&chrome.runtime&&chrome.runtime.sendMessage?(await chrome.runtime.sendMessage({type:"extension-auth-complete",state:G,authData:e}),(0,T.gg)("\u2705 Sent direct message to extension with REAL data")):(0,T.gg)("Chrome extension APIs not available, using fallback methods")}catch(t){(0,T.gg)("Direct message failed, using localStorage fallback:",t)}try{window.postMessage({type:"EXTENSION_AUTH_COMPLETE",state:G,authData:e},"*"),(0,T.gg)("\u2705 Sent postMessage with REAL data")}catch(n){(0,T.gg)("PostMessage not available")}ye("extension-success");let s=0;const r=20,o=()=>
2{if(s++,window.extensionAuthResult||localStorage.getItem("extensionAuthResult"))if(s>=r){(0,T.gg)("\u23f1\ufe0f Max wait time reached, closing tab");try{window.close()}catch(e){(0,T.gg)("User should close tab manually")}}else setTimeout(o,1e3);else{(0,T.gg)("\u2705 Extension picked up REAL auth result, closing tab");try{window.close()}catch(e){(0,T.gg)("Cannot close window automatically")}}};setTimeout(o,2e3)}catch(_e){console.error("Error completing extension auth:",_e),Ie("Authentication successful, but failed to connect to extension. Please close this tab and try again.")}else console.error("No extension state found")})(e)}else{var s,r,o,i;const a=q?decodeURIComponent(q):null;if(Q&&a)return(0,T.gg)("\u2705 Domain join signup complete, returning to join page:",a),console.info("[DomainJoin][AuthPage] signup complete; redirecting back to join page",{decodedReturnUrl:a}),void e(a,{replace:!0});const c=null===(s=g.state)||void 0===s||null===(r=s.from)||void 0===r?void 0:r.pathname,d=(null===(o=g.state)||void 0===o||null===(i=o.from)||void 0===i?void 0:i.search)||"",u=c?c+d:null;if(u)(0,T.gg)("\u2705 Redirecting to protected page:",u),e(u,{replace:!0});else if(a)if((0,T.gg)("\u2705 Redirecting to returnUrl:",a),!a.includes("://")||a.startsWith("http://")||a.startsWith("https://"))if(a.startsWith("https://trybased.com/oauth/")||a.startsWith("https://www.trybased.com/oauth/")||a.startsWith("https://aiknowledgebase-7427e.web.app/oauth/")){try{const e=new URL(a).searchParams.get("session_id");if(e){const t=await fetch("https://aiknowledgebase-7427e.web.app/oauth/sign-callback",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify({session_id:e})}),s=await t.json();if(s.signed_token){const e=a.includes("?")?"&":"?";return void(window.location.href=a+e+"signed_token="+encodeURIComponent(s.signed_token))}}}catch(l){(0,T.gg)("\u274c OAuth sign-callback failed:",l)}e(a)}else e(a);else{(0,T.gg)("\ud83d\udd17 Detected custom URL scheme, redirecting to external app");const e=a.includes("?")?"&":"?",s=new URLSearchParams;s.set("token",n),s.set("email",t.email||""),s.set("userId",t.uid),s.set("displayName",t.displayName||""),window.location.href=a+e+s.toString()}else(0,T.gg)("\u2705 Redirecting to default page: /"),e("/")}};(0,r.useEffect)(()=>{if(!U&&z&&!H){if(Se)return;if(ee)return;if(te&&"idle"!==le)return;if(q){const t=decodeURIComponent(q);!t.includes("://")||t.startsWith("http://")||t.startsWith("https://")?t.startsWith("https://trybased.com/oauth/")||t.startsWith("https://www.trybased.com/oauth/")||t.startsWith("https://aiknowledgebase-7427e.web.app/oauth/")?z.getIdToken().then(async n=>{try{const e=new URL(t).searchParams.get("session_id");if(e){const a=await fetch("https://aiknowledgebase-7427e.web.app/oauth/sign-callback",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify({session_id:e})}),s=await a.json();if(s.signed_token){const e=t.includes("?")?"&":"?";return void(window.location.href=t+e+"signed_token="+encodeURIComponent(s.signed_token))}}}catch(a){(0,T.gg)("\u274c OAuth sign-callback failed:",a)}e(t)}).catch(()=>e(t)):e(t):((0,T.gg)("\ud83d\udd17 User already authenticated, redirecting to external app"),z.getIdToken().then(e=>{const n=t.includes("?")?"&":"?",a=new URLSearchParams;a.set("token",e),a.set("email",z.email||""),a.set("userId",z.uid),a.set("displayName",z.displayName||""),window.location.href=t+n+a.toString()}).catch(e=>{(0,T.gg)("\u274c getIdToken failed on already-signed-in redirect:",e)}))}else e("/")}},[z,U,Se,q,e,H,n,ee,te,le]),(0,r.useEffect)(()=>{if(H?ye("login"):(V||Y||Q)&&ye("signup"),!H&&!V&&!Y&&!Q){const e="true"===localStorage.getItem("rememberMe"),t=localStorage.getItem("savedEmail");e&&t&&Ce(e=>(0,a.A)((0,a.A)({},e),{},{email:t,rememberMe:!0}))}},[H,V,Y,Q]);const at=()=>{ye("login"===xe?"signup":"login"),Ie("")},st=()=>{ye("login"),Ie("")},rt=e=>{const t=e.target,n=t.name,s=t.value,r=t.type,o=t.checked;Ce((0,a.A)((0,a.A)({},Ee),{},{[n]:"checkbox"===r?o:s}))};if(U)return(0,L.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,L.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,L.jsx)(u.y$,{size:"lg",className:"text-blue-600"}),(0,L.jsx)("p",{className:"text-gray-500 text-sm",children:"Loading..."})]})});if("running"===se)return(0,L.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-gray-50",children:(0,L.jsxs)("div",{className:"flex flex-col items-center gap-4 px-4 text-center",children:[(0,L.jsx)(u.y$,{size:"lg",className:"text-blue-600"}),(0,L.jsx)("p",{className:"text-gray-700 text-sm font-medium",children:"Verifying your email\u2026"}),(0,L.jsx)("p",{className:"text-gray-500 text-xs max-w-sm",children:"Hang on while we confirm your address."})]})});if("running"===le)return(0,L.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-gray-50",children:(0,L.jsxs)("div",{className:"flex flex-col items-center gap-4 px-4 text-center",children:[(0,L.jsx)(u.y$,{size:"lg",className:"text-blue-600"}),(0,L.jsx)("p",{className:"text-gray-700 text-sm font-medium",children:"Signing you in\u2026"}),(0,L.jsx)("p",{className:"text-gray-500 text-xs max-w-sm",children:"Hang on while we finish setting up your access."})]})});if("needs-email"===le)return(0,L.jsx)("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:(0,L.jsxs)("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[(0,L.jsx)("div",{className:"flex justify-center mb-6",children:(0,L.jsx)("img",{src:v,alt:"Based Logo",className:"w-12 h-12"})}),(0,L.jsx)("h2",{className:"text-center text-2xl font-extrabold text-gray-900 mb-2",children:"Confirm your email"}),(0,L.jsx)("p",{className:"text-center text-sm text-gray-600 mb-6",children:"Enter the email address where you received the sign-in link."}),(0,L.jsxs)("form",{onSubmit:tt,className:"space-y-4",children:[_e&&(0,L.jsx)("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded text-sm",role:"alert",children:_e}),(0,L.jsx)("input",{type:"email",autoComplete:"email",required:!0,value:me,onChange:e=>pe(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 text-base",placeholder:"[email protected]"}),(0,L.jsx)(m.A,{type:"submit",fullWidth:!0,size:"lg",children:"Continue"})]})]})});if("error"===le)return(0,L.jsx)("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:(0,L.jsxs)("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[(0,L.jsx)("div",{className:"flex justify-center mb-6",children:(0,L.jsx)("img",{src:v,alt:"Based Logo",className:"w-12 h-12"})}),(0,L.jsx)("h2",{className:"text-center text-2xl font-extrabold text-gray-900 mb-2",children:"Could not sign you in"}),_e&&(0,L.jsx)("div",{className:"mt-4 bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded relative text-sm",role:"alert",children:_e}),(0,L.jsx)("div",{className:"mt-8 flex flex-col gap-3",children:(0,E.HV)()?(0,L.jsx)(m.A,{type:"button",onClick:()=>e("/join/".concat((0,E.HV)()),{replace:!0}),children:"Back to join page"}):(0,L.jsx)(m.A,{type:"button",onClick:()=>e("/",{replace:!0}),children:"Go to Based"})})]})});if("error"===se)return(0,L.jsx)("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:(0,L.jsxs)("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[(0,L.jsx)("div",{className:"flex justify-center mb-6",children:(0,L.jsx)("img",{src:v,alt:"Based Logo",className:"w-12 h-12"})}),(0,L.jsx)("h2",{className:"text-center text-2xl font-extrabold text-gray-900 mb-2",children:"Could not verify email"}),_e&&(0,L.jsx)("div",{className:"mt-4 bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded relative text-sm",role:"alert",children:_e}),(0,L.jsxs)("div",{className:"mt-8 flex flex-col gap-3",children:[(0,L.jsx)(m.A,{type:"button",onClick:()=>e("/",{replace:!0}),children:"Go to Based"}),(0,L.jsx)("button",{type:"button",onClick:()=>{re("idle"),Ie(""),e("/auth",{replace:!0})},className:"w-full py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50",children:"Back to sign in"})]})]})});if(!U&&z&&(q||H)&&"login"!==J){const e=H?"You're already logged in. Connecting your extension...":"You're already logged in. Redirecting you back to the app...";return(0,L.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,L.jsx)("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:(0,L.jsxs)("div",{className:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10 text-center",children:[(0,L.jsx)("div",{className:"flex justify-center mb-4",children:(0,L.jsx)("div",{className:"w-12 h-12 rounded flex items-center justify-center",children:(0,L.jsx)("img",{src:v,alt:"Based Logo"})})}),(0,L.jsx)("h2",{className:"text-2xl font-extrabold text-gray-900 mb-2",children:"Already Signed In"}),(0,L.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:e}),(0,L.jsx)("div",{className:"flex justify-center",children:(0,L.jsx)(u.y$,{size:"md",className:"text-blue-500"})})]})})})}return(0,L.jsxs)("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[H&&(0,L.jsx)("div",{className:"fixed top-0 left-0 right-0 bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3 text-center z-50",children:(0,L.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,L.jsx)(h,{size:16}),(0,L.jsx)("span",{className:"text-sm font-medium",children:"Connecting to Chrome Extension - Sign in to continue"})]})}),V&&!H&&(0,L.jsx)("div",{className:"fixed top-0 left-0 right-0 bg-gradient-to-r from-green-50 to-blue-50 border-b border-green-200 p-3 text-center z-50",children:(0,L.jsx)("div",{className:"flex items-center justify-center gap-2",children:(0,L.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["explorer"===V&&"\ud83c\udd93 Starting your free Explorer account","pro"===V&&"\ud83d\udc8e Starting your Pro trial (14 days free)","enterprise"===V&&"\ud83c\udfe2 Setting up Enterprise account"]})})}),(0,L.jsxs)("div",{className:"sm:mx-auto sm:w-full sm:max-w-md ".concat(H||V?"mt-16":""),children:[(0,L.jsx)("div",{className:"flex justify-center",children:(0,L.jsx)("div",{className:"w-12 h-12 rounded flex items-center justify-center",children:(0,L.jsx)("img",{src:v,alt:"Based Logo"})})}),(0,L.jsx)("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900",children:"Based"}),B&&(0,L.jsx)("div",{className:"mt-1 text-center",children:(0,L.jsxs)("span",{className:"inline-block text-xs bg-yellow-200 text-yellow-800 font-medium px-2 py-0.5 rounded",children:["Beta ",B]})}),q&&!H&&(0,L.jsxs)("p",{className:"mt-2 text-center text-sm text-gray-600",children:[Y&&"Create your account to accept the invitation",Q&&"Create your account to join your team",!Y&&!Q&&"Please sign in to continue"]}),H&&(0,L.jsx)("p",{className:"mt-2 text-center text-sm text-gray-600",children:"Sign in to connect your Chrome extension"}),V&&!H&&(0,L.jsxs)("p",{className:"mt-2 text-center text-sm text-gray-600",children:["explorer"===V&&"Create your free account to get started","pro"===V&&"Start your 14-day Pro trial - no credit card required","enterprise"===V&&"Create your Enterprise account"]})]}),_e&&(0,L.jsx)("div",{className:"mt-4 sm:mx-auto sm:w-full sm:max-w-md",children:(0,L.jsx)("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded relative",role:"alert",children:(0,L.jsx)("span",{className:"block sm:inline",children:_e})})}),(0,L.jsx)("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:(0,L.jsxs)("div",{className:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10",children:["extension-success"===xe&&(0,L.jsxs)("div",{className:"text-center",children:[(0,L.jsx)("div",{className:"mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100 mb-4",children:(0,L.jsx)(x.A,{className:"h-6 w-6 text-green-600"})}),(0,L.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Successfully Connected!"}),(0,L.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Your Chrome extension has been authenticated and connected to your Based account."}),(0,L.jsx)("div",{className:"bg-blue-50 rounded-md p-4 mb-4",children:(0,L.jsxs)("div",{className:"flex items-center",children:[(0,L.jsx)(h,{className:"h-5 w-5 text-blue-600 mr-2"}),(0,L.jsx)("p",{className:"text-sm text-blue-800",children:"You can now close this tab and return to your extension."})]})}),(0,L.jsx)("p",{className:"text-xs text-gray-500",children:"This tab will close automatically in a few seconds..."})]}),"signup"===xe&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("h3",{className:"text-lg font-medium text-center text-gray-900 mb-6",children:["explorer"===V&&"Create your free Explorer account","pro"===V&&"Start your Pro trial","enterprise"===V&&"Create your Enterprise account",Y&&"Create your account to accept the invitation",Q&&"Create your account to join your team",!V&&!Y&&!Q&&"Create your account"]}),(0,L.jsxs)("form",{className:"space-y-6",onSubmit:async e=>{if(e.preventDefault(),Ie(""),Te(!0),Ee.password!==Ee.confirmPassword)return Ie("Passwords do not match"),void Te(!1);if(!Ee.termsAccepted)return Ie("You must accept the Terms of Service and Privacy Policy"),void Te(!1);try{var t;(0,T.gg)("\ud83d\udd10 Starting signup for plan: ".concat(we,", source: ").concat(ve));const e=(0,o.xI)(),m=(0,i.aU)();await(0,o.oM)(e,S({rememberMe:Ee.rememberMe,hostname:Z})?o.F0:o.iM);const p=(await(0,o.eJ)(e,Ee.email,Ee.password)).user;(0,T.gg)("\u2705 REAL Firebase user created:",p.uid,p.email);const g=await(0,j.k5)(p.uid),h=Ee.firstName,x=Ee.lastName,y="".concat(h," ").concat(x),f="".concat(y,"'s Organization");await(0,o.r7)(p,{displayName:"".concat(Ee.firstName," ").concat(Ee.lastName)});
2const w="org-".concat(p.uid);await(0,i.BN)((0,i.doc)(m,"organizations",w),{name:f,type:"standard",createdBy:p.uid,createdAt:(0,i.O5)(),updatedAt:(0,i.O5)(),memberRoles:{[p.uid]:"admin"},settings:{allowInvites:!0,defaultRole:"admin",categoryPresets:[...k.MT]}});try{const e=(0,l.getFunctions)(c.yA,"us-central1");(0,l.httpsCallable)(e,"initializeDefaultOrganizationIntegrations")({organizationId:w}).then(()=>{(0,T.gg)("\u2705 Default organization integrations seeded")}).catch(e=>{console.warn("\u26a0\ufe0f initializeDefaultOrganizationIntegrations failed (non-blocking):",e)})}catch(n){console.warn("\u26a0\ufe0f initializeDefaultOrganizationIntegrations failed (non-blocking):",n)}(0,T.gg)("\ud83d\ude80 Creating default workspace...");let b=null;try{const e={name:"Default Workspace",organizationId:w,createdAt:new Date,visibility:"organization",memberRoles:{[p.uid]:"admin"},usageStats:{documentsCount:1,storageUsed:0},isDefault:!0,description:"Your default workspace to organize your knowledge base"},t=await(0,i.gS)((0,i.rJ)(m,"workspaces"),e);(0,T.gg)("\u2705 Default workspace created:",t.id),b=(0,a.A)({id:t.id},e);const n=t.id;(async()=>{try{const t=(0,A.Uo)({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_VERCEL_GIT_COMMIT_AUTHOR_NAME:"Gary Riger",REACT_APP_VERCEL_GIT_PROVIDER:"github",REACT_APP_VERCEL_PROJECT_ID:"prj_A5c8ZMv75ibxQVceA3I7GjPny9oD",REACT_APP_VERCEL_GIT_PULL_REQUEST_ID:"",REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"8f81e36d25c71756/script.js","viewEndpoint":"8f81e36d25c71756/view","eventEndpoint":"8f81e36d25c71756/event","sessionEndpoint":"8f81e36d25c71756/session"},"speedInsights":{"scriptSrc":"1e9f61cb490e195d/script.js","endpoint":"1e9f61cb490e195d/vitals"}}',REACT_APP_VERCEL_BRANCH_URL:"based-git-main-trybased.vercel.app",REACT_APP_VERCEL_GIT_COMMIT_MESSAGE:"Merge pull request #69 from grigerny/cursor/native-document-tables-6648\n\nNative document tables for editor and MCP agents",REACT_APP_VERCEL_DEPLOYMENT_ID:"dpl_6MQChUZTeZEjuh9PAEPmwanHsu8y",REACT_APP_VERCEL_GIT_REPO_SLUG:"knowledge-base-saas",REACT_APP_VERCEL_TARGET_ENV:"production",REACT_APP_VERCEL_GIT_COMMIT_SHA:"fe8e0cad17d5c751081fbff8964f57a16f15178c",REACT_APP_VERCEL_ENV:"production",REACT_APP_VERCEL_GIT_COMMIT_REF:"main",REACT_APP_VERCEL_URL:"based-o7e1bdtta-trybased.vercel.app",REACT_APP_VERCEL_PROJECT_PRODUCTION_URL:"www.trybased.com",REACT_APP_VERCEL_GIT_PREVIOUS_SHA:"",REACT_APP_VERCEL_GIT_REPO_ID:"980833582",REACT_APP_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"grigerny",REACT_APP_VERCEL_GIT_REPO_OWNER:"grigerny"}.REACT_APP_HELP_CENTER_URL),a=JSON.stringify(t),s=await(0,j.cI)(a,p.uid,[n]),r=(0,A.Hp)(),o={title:A.oN,category:"Welcome",tags:["welcome","getting-started","tutorial"],workspaceIds:[n],workspaceId:n,organizationId:w,userId:p.uid,createdAt:(0,i.O5)(),updatedAt:(0,i.O5)(),createdBy:p.uid,isTemplate:!1,isPublic:!1,isEncrypted:!0,encryptionMethod:"dual",userEncryptedResult:s.userEncryptedResult,workspaceEncryptedResults:s.workspaceEncryptedResults,fileType:"document",type:"document",isDefault:!0,textContent:"[Encrypted Content]",coverImageUrl:(0,A.OZ)(),summary:r.summary,keyElements:r.keyElements,relatedTopics:r.relatedTopics},l=await(0,i.gS)((0,i.rJ)(m,"knowledgeBaseDocuments"),o);(0,T.gg)("\u2705 Welcome document created:",l.id);try{window.dispatchEvent(new CustomEvent("workspacesUpdated"))}catch(e){(0,T.gg)("\u26a0\ufe0f Could not dispatch workspace update event:",e)}}catch(t){console.error("\u26a0\ufe0f Error creating welcome document (non-blocking):",t)}})()}catch(r){throw console.error("\u26a0\ufe0f Error creating default workspace (blocking for bootstrap):",r),r}const v={0:{id:w,role:"admin",updatedAt:(0,i.O5)()}},E={notifications:{email:!0,inApp:!0}},C={name:"".concat(Ee.firstName," ").concat(Ee.lastName),email:Ee.email,role:"admin",organizations:v,settings:E,providerId:"password",authProviders:[{id:"password"}],signupPlan:we,signupSource:ve,signupTimestamp:(0,i.O5)()},P=await Promise.all(Object.entries(C).map(async e=>{let t=(0,s.A)(e,2),n=t[0],a=t[1];return[n,"string"===typeof a?await(0,j.FA)(a,g):await(0,j.FA)(JSON.stringify(a),g)]})),R=Object.fromEntries(P);if(await(0,i.BN)((0,i.doc)(m,"users",p.uid),(0,a.A)((0,a.A)({},R),{},{createdAt:(0,i.O5)(),lastLogin:(0,i.O5)()})),(0,N.t6)(w),(0,I.zw)(w),null!==(t=b)&&void 0!==t&&t.id){const e=String(b.id);try{localStorage.setItem((0,_.ft)(p.uid,w),e),localStorage.setItem((0,_.ft)(p.uid),e),localStorage.setItem(_.ut,e),localStorage.setItem("activeView","workspace")}catch(d){}try{window.dispatchEvent(new CustomEvent("workspacesUpdated"))}catch(u){(0,T.gg)("\u26a0\ufe0f Could not dispatch workspace update event:",u)}
2}(0,T.gg)("\u2705 REAL user and organization created successfully"),(0,T.gg)("Organization ID:",w),"explorer"===we?(0,T.gg)("\ud83c\udd93 Initializing Explorer (free) plan"):"pro"===we&&(0,T.gg)("\ud83d\udc8e Initializing Pro trial"),(0,T.gg)("\ud83d\udcca Signup completed: plan=".concat(we,", source=").concat(ve));const L=await p.getIdToken();(0,T.gg)("\u2705 Got REAL Firebase token for signup");const O=b?{newWorkspace:b,newDocument:null}:null;await nt(p,L,O)}catch(_e){console.error("\u274c REAL Firebase signup error:",_e),Ie(_e.message||"Failed to create account")}finally{Te(!1)}},children:[(0,L.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("label",{htmlFor:"firstName",className:"block text-sm font-medium text-gray-700",children:"First name"}),(0,L.jsx)("input",{id:"firstName",name:"firstName",type:"text",autoComplete:"given-name",required:!0,value:Ee.firstName,onChange:rt,className:"mt-1 appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",placeholder:"First name"})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("label",{htmlFor:"lastName",className:"block text-sm font-medium text-gray-700",children:"Last name"}),(0,L.jsx)("input",{id:"lastName",name:"lastName",type:"text",autoComplete:"family-name",required:!0,value:Ee.lastName,onChange:rt,className:"mt-1 appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",placeholder:"Last name"})]})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700",children:"Email address"}),(0,L.jsx)("input",{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,value:Ee.email,onChange:rt,className:"mt-1 appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",placeholder:"[email protected]"})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700",children:Y||Q?"Create a password":"Password"}),(0,L.jsx)("input",{id:"password",name:"password",type:"password",autoComplete:"new-password",required:!0,value:Ee.password,onChange:rt,className:"mt-1 appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",placeholder:Y||Q?"Choose a password only you will know":"Create a strong password"})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700",children:"Confirm your password"}),(0,L.jsx)("input",{id:"confirmPassword",name:"confirmPassword",type:"password",autoComplete:"new-password",required:!0,value:Ee.confirmPassword,onChange:rt,className:"mt-1 appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",placeholder:"Confirm your password"})]}),(0,L.jsx)("div",{children:(0,L.jsxs)("div",{className:"flex items-start",children:[(0,L.jsx)("input",{id:"termsAccepted",name:"termsAccepted",type:"checkbox",checked:Ee.termsAccepted,onChange:rt,className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded mt-0.5",required:!0}),(0,L.jsxs)("label",{htmlFor:"termsAccepted",className:"ml-2 block text-sm text-gray-900",children:["I agree to the"," ",(0,L.jsx)("a",{href:"/terms-of-service",className:"text-blue-600 hover:text-blue-500 font-medium",target:"_blank",rel:"noopener noreferrer",children:"Terms of Service"})," ","and"," ",(0,L.jsx)("a",{href:"/privacy-policy",className:"text-blue-600 hover:text-blue-500 font-medium",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"})]})]})}),!H&&!$&&(0,L.jsxs)("div",{className:"flex items-center",children:[(0,L.jsx)("input",{id:"rememberMe",name:"rememberMe",type:"checkbox",checked:Ee.rememberMe,onChange:rt,className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),(0,L.jsx)("label",{htmlFor:"rememberMe",className:"ml-2 block text-sm text-gray-900",children:"Remember me"})]}),(0,L.jsx)("div",{children:(0,L.jsx)(m.A,{type:"submit",fullWidth:!0,size:"lg",loading:Se,className:"border border-transparent shadow-sm",children:Se?"Creating account...":(0,L.jsxs)(L.Fragment,{children:["explorer"===V&&"Create Free Account","pro"===V&&"Start Free Trial","enterprise"===V&&"Create Enterprise Account",!V&&"Create Account"]})})}),V&&(0,L.jsxs)("div",{className:"mt-4 p-4 bg-gray-50 rounded-md",children:[(0,L.jsx)("p",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"What you get:"}),"explorer"===V&&(0,L.jsxs)("ul",{className:"text-sm text-gray-600 space-y-1",children:[(0,L.jsx)("li",{children:"\u2022 10 documents"}),(0,L.jsx)("li",{children:"\u2022 3 projects"}),(0,L.jsx)("li",{children:"\u2022 50MB storage"}),(0,L.jsx)("li",{children:"\u2022 AI categorization"}),(0,L.jsx)("li",{children:"\u2022 Email support"})]}),"pro"===V&&(0,L.jsxs)("ul",{className:"text-sm text-gray-600 space-y-1",children:[(0,L.jsx)("li",{children:"\u2022 14-day free trial"}),(0,L.jsx)("li",{children:"\u2022 Unlimited documents & projects"}),(0,L.jsx)("li",{children:"\u2022 AI Chatbot"}),(0,L.jsx)("li",{children:"\u2022 Team collaboration"}),(0,L.jsx)("li",{children:"\u2022 Priority support"})]}),"enterprise"===V&&(0,L.jsxs)("ul",{className:"text-sm text-gray-600 space-y-1",children:[(0,L.jsx)("li",{children:"\u2022 Custom pricing"}),(0,L.jsx)("li",{children:"\u2022 Unlimited everything"}),(0,L.jsx)("li",{children:"\u2022 White-label branding"}),(0,L.jsx)("li",{children:"\u2022 SOC 2 compliance"}),(0,L.jsx)("li",{children:"\u2022 Dedicated support"})]})]}),(0,L.jsxs)("div",{className:"mt-6",children:[(0,L.jsxs)("div",{className:"relative",children:[(0,L.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,L.jsx)("div",{className:"w-full border-t border-gray-300"})}),(0,L.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,L.jsx)("span",{className:"px-2 bg-white text-gray-500",children:"Already have an account?"})})]}),(0,L.jsx)("div",{className:"mt-6",children:(0,L.jsx)("button",{type:"button",onClick:at,className:"w-full flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Sign in instead"})})]})]})]}),"login"===xe&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("h3",{className:"text-lg font-medium text-center text-gray-900 mb-6",children:H?"Sign in to connect extension":"Sign in to your account"}),(0,L.jsxs)("form",{className:"space-y-6",onSubmit:async e=>{e.preventDefault(),Ie(""),Te(!0);
2try{(0,T.gg)("\ud83d\udd10 Starting REAL Firebase login for:",Ee.email);const e=(0,o.xI)(),n=(0,i.aU)(),a=S({rememberMe:Ee.rememberMe,hostname:Z})?o.F0:o.iM;await(0,o.oM)(e,a);const s=(await(0,o.x9)(e,Ee.email,Ee.password)).user;(0,T.gg)("\u2705 REAL Firebase login successful:",s.uid,s.email,s.displayName);try{await(0,j.k5)(s.uid)}catch(t){return console.error("\u274c Encryption init failed (WebCrypto unavailable):",t),void Ie("This device/browser cannot enable encryption on this URL. Open the app over HTTPS (or localhost) and try again.")}await(0,i.BN)((0,i.doc)(n,"users",s.uid),{lastLogin:(0,i.O5)()},{merge:!0}),H||(Ee.rememberMe?(localStorage.setItem("rememberMe","true"),localStorage.setItem("savedEmail",Ee.email)):(localStorage.removeItem("rememberMe"),localStorage.removeItem("savedEmail")));const r=await s.getIdToken();(0,T.gg)("\u2705 Got REAL Firebase token (first 50 chars):",r.substring(0,50)+"..."),setTimeout(()=>{nt(s,r)},500)}catch(_e){console.error("\u274c REAL Firebase login error:",_e),Ie(_e.message||"Failed to log in")}finally{Te(!1)}},children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700",children:"Email address"}),(0,L.jsx)("input",{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,value:Ee.email,onChange:rt,className:"mt-1 appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",placeholder:"[email protected]"})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700",children:"Password"}),(0,L.jsx)("input",{id:"password",name:"password",type:"password",autoComplete:"current-password",required:!0,value:Ee.password,onChange:rt,className:"mt-1 appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",placeholder:"Enter your password"})]}),(0,L.jsxs)("div",{className:"flex items-center justify-between",children:[!H&&!$&&(0,L.jsxs)("div",{className:"flex items-center",children:[(0,L.jsx)("input",{id:"rememberMe",name:"rememberMe",type:"checkbox",checked:Ee.rememberMe,onChange:rt,className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),(0,L.jsx)("label",{htmlFor:"rememberMe",className:"ml-2 block text-sm text-gray-900",children:"Remember me"})]}),(0,L.jsx)("div",{className:"text-sm",children:(0,L.jsx)("button",{type:"button",onClick:()=>{ye("forgot"),Ie("")},className:"font-medium text-blue-600 hover:text-blue-500 cursor-pointer",children:"Forgot your password?"})})]}),(0,L.jsx)("div",{children:(0,L.jsx)(m.A,{type:"submit",fullWidth:!0,size:"lg",loading:Se,className:"border border-transparent shadow-sm",children:Se?"Signing in...":"Sign in"})}),H&&(0,L.jsx)("div",{className:"mt-4 p-4 bg-blue-50 rounded-md",children:(0,L.jsxs)("div",{className:"flex items-center",children:[(0,L.jsx)(h,{className:"h-5 w-5 text-blue-600 mr-2"}),(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-sm font-medium text-blue-800",children:"Chrome Extension Authentication"}),(0,L.jsx)("p",{className:"text-xs text-blue-600",children:"Sign in to connect your extension to your Based account"})]})]})}),!H&&(0,E.b0)()&&(0,L.jsxs)("div",{className:"rounded-md border border-blue-100 bg-blue-50 px-4 py-3",children:[(0,L.jsx)("p",{className:"text-sm text-blue-900",children:"Partner client account?"}),(0,L.jsx)("button",{type:"button",onClick:()=>e("/join/".concat((0,E.b0)()),{replace:!0}),className:"mt-2 text-sm font-medium text-blue-700 hover:text-blue-800",children:"Sign in with email link"})]})]}),(0,L.jsxs)("div",{className:"mt-6",children:[(0,L.jsxs)("div",{className:"relative",children:[(0,L.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,L.jsx)("div",{className:"w-full border-t border-gray-300"})}),(0,L.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,L.jsx)("span",{className:"px-2 bg-white text-gray-500",children:"Don't have an account?"})})]}),(0,L.jsx)("div",{className:"mt-6",children:(0,L.jsx)("button",{type:"button",onClick:at,className:"w-full flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Create new account"})})]}),!H&&(0,L.jsxs)("div",{className:"mt-6 text-center",children:[(0,L.jsx)("p",{className:"text-xs text-gray-500 mb-2",children:"New to Based?"}),(0,L.jsxs)("div",{className:"flex justify-center space-x-4 text-xs text-gray-400",children:[(0,L.jsx)("span",{children:"\ud83c\udd93 Free plan available"}),(0,L.jsx)("span",{children:"\ud83d\udc8e 14-day Pro trial"}),(0,L.jsx)("span",{children:"\ud83d\ude80 No credit card required"})]})]})]}),"forgot"===xe&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:"mb-6",children:(0,L.jsxs)("button",{onClick:st,className:"flex items-center text-gray-600 hover:text-gray-800 transition-colors",children:[(0,L.jsx)(y.A,{size:16,className:"mr-2"}),"Back to login"]})}),(0,L.jsxs)("div",{className:"mb-6",children:[(0,L.jsx)("h3",{className:"text-xl font-semibold text-gray-900",children:"Reset your password"}),(0,L.jsx)("p",{className:"mt-2 text-sm text-gray-600",children:"Enter your email address and we'll send you a link to reset your password."})]}),(0,L.jsxs)("div",{className:"space-y-6",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Email address"}),(0,L.jsx)("input",{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,value:Ee.email,onChange:rt,className:"appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm",placeholder:"Enter your email"})]}),(0,L.jsx)("div",{children:(0,L.jsx)(m.A,{type:"button",onClick:async e=>{if(e.preventDefault(),Ie(""),Te(!0),!Ee.email)return Ie("Please enter your email address"),void Te(!1);try{const e=(0,o.xI)();await(0,o.J1)(e,Ee.email),ye("forgot-sent")}catch(_e){console.error("Error sending password reset email:",_e),Ie(_e.message||"Failed to send password reset email")}finally{Te(!1)}},fullWidth:!0,size:"md",loading:Se,className:"border border-transparent shadow-sm",children:Se?"Sending...":"Send reset link"})})]})]}),"forgot-sent"===xe&&(0,L.jsxs)("div",{className:"text-center",children:[(0,L.jsx)("div",{className:"mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-blue-100 mb-4",children:(0,L.jsx)(f.A,{className:"h-6 w-6 text-blue-600"})}),(0,L.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Check your email"}),(0,L.jsxs)("p",{className:"text-sm text-gray-600 mb-6",children:["We've sent a password reset link to"," ",(0,L.jsx)("span",{className:"font-medium text-gray-900",children:Ee.email})]}),(0,L.jsxs)("p",{className:"text-xs text-gray-500 mb-6",children:["Didn't receive the email? Check your spam folder or"," ",(0,L.jsx)("button",{onClick:()=>{ye("forgot"),Ie("")},className:"text-blue-600 hover:text-blue-500 font-medium",children:"try again"})]}),(0,L.jsx)("button",{onClick:st,className:"w-full flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Back to login"})]}),"reset-password"===xe&&(0,L.jsx)(L.Fragment,{children:Ke?(0,L.jsxs)("div",{className:"text-center py-8",children:[(0,L.jsx)(u.y$,{size:"lg",className:"mx-auto mb-4"}),(0,L.jsx)("p",{className:"text-sm text-gray-600",children:"Verifying your reset link..."})]}):Ye?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:"mb-6",children:[(0,L.jsx)("h3",{className:"text-xl font-semibold text-gray-900",children:"Set new password"}),(0,L.jsx)("p",{className:"mt-2 text-sm text-gray-600",children:"Enter your new password below."})]}),(0,L.jsxs)("form",{className:"space-y-6",onSubmit:async e=>{if(e.preventDefault(),Ie(""),Te(!0),ze.newPassword.length<6)return Ie("Password must be at least 6 characters"),void Te(!1);if(ze.newPassword!==ze.confirmNewPassword)return Ie("Passwords do not match"),void Te(!1);try{const e=(0,o.xI)();await(0,o.R4)(e,X,ze.newPassword),ye("password-changed")}catch(t){console.error("Error resetting password:",t),"auth/expired-action-code"===t.code?Ie("This reset link has expired. Please request a new one."):"auth/weak-password"===t.code?Ie("Password is too weak. Please choose a stronger password."):Ie(t.message||"Failed to reset password. Please try again.")}finally{Te(!1)}},children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("label",{htmlFor:"newPassword",className:"block text-sm font-medium text-gray-700 mb-2",children:"New password"}),(0,L.jsxs)("div",{className:"relative",children:[(0,L.jsx)("input",{id:"newPassword",name:"newPassword",type:Be?"text":"password",required:!0,value:ze.newPassword,onChange:e=>Ue(t=>(0,a.A)((0,a.A)({},t),{},{newPassword:e.target.value})),className:"appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm pr-10",placeholder:"Enter new password"}),(0,L.jsx)("button",{type:"button",onClick:()=>Fe(!Be),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600",children:Be?(0,L.jsx)(w,{size:16}):(0,L.jsx)(b.A,{size:16})})]})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("label",{htmlFor:"confirmNewPassword",className:"block text-sm font-medium text-gray-700 mb-2",children:"Confirm new password"}),(0,L.jsxs)("div",{className:"relative",children:[(0,L.jsx)("input",{id:"confirmNewPassword",name:"confirmNewPassword",type:Ge?"text":"password",required:!0,value:ze.confirmNewPassword,onChange:e=>Ue(t=>(0,a.A)((0,a.A)({},t),{},{confirmNewPassword:e.target.value})),className:"appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm pr-10",placeholder:"Confirm new password"}),(0,L.jsx)("button",{type:"button",onClick:()=>He(!Ge),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600",children:Ge?(0,L.jsx)(w,{size:16}):(0,L.jsx)(b.A,{size:16})})]})]}),(0,L.jsx)("div",{children:(0,L.jsx)(m.A,{type:"submit",fullWidth:!0,size:"md",loading:Se,className:"border border-transparent shadow-sm",children:Se?"Resetting...":"Reset password"})})]})]}):(0,L.jsxs)("div",{className:"text-center py-4",children:[(0,L.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"This reset link is invali
2d or has expired."}),(0,L.jsx)("button",{onClick:()=>{ye("forgot"),Ie("")},className:"text-blue-600 hover:text-blue-500 text-sm font-medium",children:"Request a new reset link"})]})}),"password-changed"===xe&&(0,L.jsxs)("div",{className:"text-center",children:[(0,L.jsx)("div",{className:"mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100 mb-4",children:(0,L.jsx)(x.A,{className:"h-6 w-6 text-green-600"})}),(0,L.jsx)("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Password changed"}),(0,L.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:"You can now sign in with your new password"}),(0,L.jsx)(m.A,{type:"button",onClick:st,fullWidth:!0,size:"md",className:"border border-transparent shadow-sm",children:"Sign in"})]})]})})]})}},82665(e,t,n){"use strict";n.d(t,{Hp:()=>h,OZ:()=>c,Uo:()=>p,oN:()=>g});const a="Welcome to Based!";function s(e){return{type:"text",text:e,marks:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]}}function r(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{type:"paragraph",content:t}}function o(e,t){return{type:"heading",attrs:{level:e},content:[s(t)]}}function i(e){return{type:"listItem",content:[r(s(e))]}}function l(e){return{type:"listItem",content:[r(...e)]}}function c(){return"https://images.pexels.com/photos/7281926/pexels-photo-7281926.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=1200"}function d(e){return{type:"doc",content:[o(1,a),r(s("Based is a smart knowledge management platform that helps you organize, share, and interact with your documents using AI. Whether you're building a company wiki, creating training materials, or managing internal documentation, Based makes it simple.")),o(2,"What you can do with Based"),{type:"bulletList",content:[i("Create and organize documents \u2014 Write rich-text documents and group them into workspaces (projects)."),i("Ask the AI Assistant \u2014 Chat with an AI that understands your documents and can answer questions about them."),i("Share with anyone \u2014 Generate public links to share your workspace or individual documents with people outside your team."),i("Embed on your website \u2014 Add an AI chatbot or FAQ widget to your own site, powered by your Based documents."),i("Collaborate with your team \u2014 Invite team members, assign roles, and work together in real time."),i("Integrations on your documents \u2014 Embed forms, add document signatures, and connect Stripe for payments and invoicing when your organization enables them in Based Abilities.")]},o(2,"Get started in your workspace"),r(s("You already have a Default Workspace. Here are a few quick steps:")),{type:"orderedList",content:[l([s("Explore this document",[{type:"bold"}]),s(" \u2014 Click anywhere to edit and try the editor.")]),l([s("Create another document",[{type:"bold"}]),s(" \u2014 Use the + control in the sidebar to add a document.")]),l([s("Explore Based Abilities",[{type:"bold"}]),s(" \u2014 From your profile menu, open Based Abilities to enable forms, document signatures, and Stripe for payments and invoicing.")]),l([s("Open the AI Assistant",[{type:"bold"}]),s(" \u2014 Ask questions about your documents.")]),l([s("Try a public link",[{type:"bold"}]),s(" \u2014 When you're ready, share a workspace or document from the sharing options.")])]},r(s("Based Abilities let you extend what the AI can do with your knowledge base \u2014 explore them from the product when you're ready.")),o(2,"Security & privacy"),r(s("Your documents are encrypted in transit and at rest. Only you and people you invite can access your organization's content.")),o(2,"Need help?"),r(s("Visit the Based Help Center for full guides on every feature: "),s(e,[{type:"link",attrs:{href:e,target:"_blank",rel:"noopener noreferrer nofollow"}}])),r(s("Happy knowledge building!",[{type:"bold"}])),r(s("This document was automatically created to help you get started. Feel free to edit, expand, or delete it as needed!",[{type:"italic"}]))]}}function u(e){return"".concat(a,"\n\nBased is a smart knowledge management platform that helps you organize, share, and interact with your documents using AI. Whether you're building a company wiki, creating training materials, or managing internal documentation, Based makes it simple.\n\nWhat you can do with Based\n\n\u2022 Create and organize documents \u2014 Write rich-text documents and group them into workspaces (projects).\n\u2022 Ask the AI Assistant \u2014 Chat with an AI that understands your documents and can answer questions about them.\n\u2022 Share with anyone \u2014 Generate public links to share your workspace or individual documents with people outside your team.\n\u2022 Embed on your website \u2014 Add an AI chatbot or FAQ widget to your own site, powered by your Based documents.\n\u2022 Collaborate with your team \u2014 Invite team members, assign roles, and work together in real time.\n\u2022 Integrations on your documents \u2014 Embed forms, add document signatures, and connect Stripe for payments and invoicing when your organization enables them in Based Abilities.\n\nGet started in your workspace\n\nYou already have a Default Workspace. Here are a few quick steps:\n\n1. Explore this document \u2014 Click anyw
2here to edit and try the editor.\n2. Create another document \u2014 Use the + control in the sidebar to add a document.\n3. Explore Based Abilities \u2014 From your profile menu, open Based Abilities to enable forms, document signatures, and Stripe for payments and invoicing.\n4. Open the AI Assistant \u2014 Ask questions about your documents.\n5. Try a public link \u2014 When you're ready, share a workspace or document from the sharing options.\n\nBased Abilities let you extend what the AI can do with your knowledge base \u2014 explore them from the product when you're ready.\n\nSecurity & privacy\n\nYour documents are encrypted in transit and at rest. Only you and people you invite can access your organization's content.\n\nNeed help?\n\nVisit the Based Help Center: ").concat(e,"\n\nHappy knowledge building!\n\nThis document was automatically created to help you get started. Feel free to edit, expand, or delete it as needed!")}function m(e){const t=e.replace(/&/g,"&amp;").replace(/"/g,"&quot;");return"<h1>".concat(a,"</h1>\n<p>Based is a smart knowledge management platform that helps you organize, share, and interact with your documents using AI. Whether you're building a company wiki, creating training materials, or managing internal documentation, Based makes it simple.</p>\n<h2>What you can do with Based</h2>\n<ul>\n<li><p>Create and organize documents \u2014 Write rich-text documents and group them into workspaces (projects).</p></li>\n<li><p>Ask the AI Assistant \u2014 Chat with an AI that understands your documents and can answer questions about them.</p></li>\n<li><p>Share with anyone \u2014 Generate public links to share your workspace or individual documents with people outside your team.</p></li>\n<li><p>Embed on your website \u2014 Add an AI chatbot or FAQ widget to your own site, powered by your Based documents.</p></li>\n<li><p>Collaborate with your team \u2014 Invite team members, assign roles, and work together in real time.</p></li>\n<li><p>Integrations on your documents \u2014 Embed forms, add document signatures, and connect Stripe for payments and invoicing when your organization enables them in Based Abilities.</p></li>\n</ul>\n<h2>Get started in your workspace</h2>\n<p>You already have a Default Workspace. Here are a few quick steps:</p>\n<ol>\n<li><p><strong>Explore this document</strong> \u2014 Click anywhere to edit and try the editor.</p></li>\n<li><p><strong>Create another document</strong> \u2014 Use the + control in the sidebar to add a document.</p></li>\n<li><p><strong>Explore Based Abilities</strong> \u2014 From your profile menu, open Based Abilities to enable forms, document signatures, and Stripe for payments and invoicing.</p></li>\n<li><p><strong>Open the AI Assistant</strong> \u2014 Ask questions about your documents.</p></li>\n<li><p><strong>Try a public link</strong> \u2014 When you're ready, share a workspace or document from the sharing options.</p></li>\n</ol>\n<p>Based Abilities let you extend what the AI can do with your knowledge base \u2014 explore them from the product when you're ready.</p>\n<h2>Security &amp; privacy</h2>\n<p>Your documents are encrypted in transit and at rest. Only you and people you invite can access your organization's content.</p>\n<h2>Need help?</h2>\n<p>Visit the Based Help Center for full guides on every feature: <a href=\"").concat(t,'" target="_blank" rel="noopener noreferrer nofollow">').concat(e.replace(/&/g,"&amp;").replace(/</g,"&lt;"),"</a></p>\n<p><strong>Happy knowledge building!</strong></p>\n<p><em>This document was automatically created to help you get started. Feel free to edit, expand, or delete it as needed!</em></p>")}function p(e){const t=e||{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_VERCEL_GIT_COMMIT_AUTHOR_NAME:"Gary Riger",REACT_APP_VERCEL_GIT_PROVIDER:"github",REACT_APP_VERCEL_PROJECT_ID:"prj_A5c8ZMv75ibxQVceA3I7GjPny9oD",REACT_APP_VERCEL_GIT_PULL_REQUEST_ID:"",REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"8f81e36d25c71756/script.
2js","viewEndpoint":"8f81e36d25c71756/view","eventEndpoint":"8f81e36d25c71756/event","sessionEndpoint":"8f81e36d25c71756/session"},"speedInsights":{"scriptSrc":"1e9f61cb490e195d/script.js","endpoint":"1e9f61cb490e195d/vitals"}}',REACT_APP_VERCEL_BRANCH_URL:"based-git-main-trybased.vercel.app",REACT_APP_VERCEL_GIT_COMMIT_MESSAGE:"Merge pull request #69 from grigerny/cursor/native-document-tables-6648\n\nNative document tables for editor and MCP agents",REACT_APP_VERCEL_DEPLOYMENT_ID:"dpl_6MQChUZTeZEjuh9PAEPmwanHsu8y",REACT_APP_VERCEL_GIT_REPO_SLUG:"knowledge-base-saas",REACT_APP_VERCEL_TARGET_ENV:"production",REACT_APP_VERCEL_GIT_COMMIT_SHA:"fe8e0cad17d5c751081fbff8964f57a16f15178c",REACT_APP_VERCEL_ENV:"production",REACT_APP_VERCEL_GIT_COMMIT_REF:"main",REACT_APP_VERCEL_URL:"based-o7e1bdtta-trybased.vercel.app",REACT_APP_VERCEL_PROJECT_PRODUCTION_URL:"www.trybased.com",REACT_APP_VERCEL_GIT_PREVIOUS_SHA:"",REACT_APP_VERCEL_GIT_REPO_ID:"980833582",REACT_APP_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"grigerny",REACT_APP_VERCEL_GIT_REPO_OWNER:"grigerny"}.REACT_APP_HELP_CENTER_URL||"https://trybased.com/shared/based-help-center";return{editorJson:d(t),textContent:u(t),editorHtml:m(t)}}const g=a;function h(){return{summary:"Get started with Based: workspaces, AI Assistant, sharing, embeddable widgets, integrations (forms, signatures, Stripe), and Based Abilities.",keyElements:["getting started","workspaces","AI Assistant","sharing","embedding","integrations","forms","signatures","Stripe","Based Abilities","encryption"],relatedTopics:["documentation","help center","onboarding","collaboration"]}}},68400(e,t,n){"use strict";n.d(t,{E5:()=>d,HV:()=>x,JL:()=>A,LA:()=>_,MT:()=>b,Nn:()=>I,Qi:()=>h,Uc:()=>y,VJ:()=>v,Xv:()=>C,an:()=>j,b0:()=>w,dF:()=>P,dJ:()=>E,eo:()=>N,fh:()=>p,jb:()=>k,k4:()=>f,rq:()=>g});var a=n(89379),s=n(67898),r=n(52395),o=n(96822),i=n(47081);const l=(0,r.getFunctions)(o.yA,"us-central1"),c="pendingDomainJoinSlug",d="pendingDomainJoinSlugChanged",u="pendingDomainJoinSlug.persisted",m="clientJoinSlug",p=e=>{var t;if("email-not-verified"===(null===e||void 0===e||null===(t=e.details)||void 0===t?void 0:t.reason))return!1;const n=String((null===e||void 0===e?void 0:e.code)||"").replace(/^functions\//,"");return["not-found","failed-precondition","permission-denied"].includes(n)},g=e=>{if(!e)return null;try{const t=decodeURIComponent(e).match(/(?:^|\/)join\/([^/?#]+)/);return null!==t&&void 0!==t&&t[1]?decodeURIComponent(t[1]):null}catch(t){const n=String(e).match(/(?:^|\/)join\/([^/?#]+)/);return(null===n||void 0===n?void 0:n[1])||null}},h=e=>{if("undefined"===typeof window)return null;const t=g(e);return t&&(sessionStorage.setItem(c,t),localStorage.setItem(u,t),window.dispatchEvent(new CustomEvent(d,{detail:{slug:t}}))),t},x=()=>"undefined"===typeof window?null:sessionStorage.getItem(c)||localStorage.getItem(u),y=()=>{"undefined"!==typeof window&&(sessionStorage.removeItem(c),localStorage.removeItem(u),window.dispatchEvent(new CustomEvent(d,{detail:{slug:null}})))},f=e=>{"undefined"!==typeof window&&e&&localStorage.setItem(m,String(e).trim())},w=()=>"undefined"===typeof window?null:localStorage.getItem(m),b=async e=>{let t=e.slug,n=e.organizationId;const a=(0,r.httpsCallable)(l,"getDomainJoinOrganization");return(await a({slug:t,organizationId:n})).data.organization},v=async e=>{var t;let n=e.slug,a=e.organizationId;const s=(0,r.httpsCallable)(l,"joinOrganizationByDomain"),o=await s({slug:n,organizationId:a});return null!==(t=o.data)&&void 0!==t&&t.organizationId&&((0,i.t6)(o.data.organizationId),(0,i.Dt)()),o.data},j=async e=>{let t=e.parentOrganizationId,n=e.name,s=e.slug,o=e.allowedEmailDomains,c=e.domainJoin,d=e.ssoProfile,u=e.workspaces,m=e.branding,p=e.clientLoginExperience,g=e.clientSearchWorkspaceIds;const h=(0,r.httpsCallable)(l,"createChildOrganization"),x=await h((0,a.A)((0,a.A)({parentOrganizationId:t,name:n,slug:s,allowedEmailDomains:o,domainJoin:c,ssoProfile:d,workspaces:u,branding:m},null!=p?{clientLoginExperience:p}:{}),null!=g?{clientSearchWorkspaceIds:g}:{}));return(0,i.Dt)(),x.data},A=async e=>{let t=e.organizationId,n=e.name,a=e.allowedEmailDomains,s=e.domainJoin,o=e.ssoProfile,c=e.branding,d=e.clientLoginExperience,u=e.clientSearchWorkspaceIds;const m=(0,r.httpsCallable)(l,"updateChildOrganizationAccess"),p={organizationId:t};void 0!==n&&(p.name=n),void 0!==a&&(p.allowedEmailDomains=a),void 0!==s&&(p.domainJoin=s),void 0!==o&&(p.ssoProfile=o),void 0!==c&&(p.branding=c),void 0!==d&&(p.clientLoginExperience
2=d),void 0!==u&&(p.clientSearchWorkspaceIds=u);const g=await m(p);return(0,i.Dt)(),g.data.organization},E=async e=>{let t=e.organizationId,n=e.workspaces;const a=(0,r.httpsCallable)(l,"addPartnerClientWorkspaces"),s=await a({organizationId:t,workspaces:n});return(0,i.Dt)(),s.data},C=async e=>{const t=(0,r.httpsCallable)(l,"getPartnerChildOrganizations");return(await t({parentOrganizationId:e})).data.organizations||[]},N=async e=>{const t=(0,r.httpsCallable)(l,"sendPartnerPreviewRagMessage");return(await t(e)).data},k=async e=>{let t=e.organizationId,n=e.confirmationSlug;const a=(0,r.httpsCallable)(l,"deletePartnerChildOrganization"),s=await a({organizationId:t,confirmationSlug:n});return(0,i.Dt)(),s.data},_=async()=>{const e=(0,s.xI)().currentUser;return e?(await e.reload(),e.getIdToken(!0)):null},I=async e=>{let t=e.slug,n=e.email,a=e.continueUrl;const s=(0,r.httpsCallable)(l,"sendDomainJoinSignInLink");return(await s({slug:t,email:n,continueUrl:a})).data},P=async e=>{let t=e.oobCode;const n=(0,r.httpsCallable)(l,"completeEmailVerificationSignIn");return(await n({oobCode:t})).data}},17070(e,t,n){"use strict";n.d(t,{C1:()=>l,CI:()=>d,MT:()=>s,P6:()=>o,RW:()=>c,cA:()=>a,cP:()=>r,co:()=>i});const a="Uncategorized",s=["Finance","HR","Operations","Marketing","Legal","IT","Product"];function r(e){if(!Array.isArray(e))return[];const t=new Set,n=[];for(const a of e){if("string"!==typeof a)continue;const e=a.trim();if(!e)continue;const s=e.toLowerCase();t.has(s)||(t.add(s),n.push(e))}return n}function o(e){return Array.isArray(e)}function i(e){return o(e)?r(e):[...s]}function l(e){return Array.isArray(e)}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.orgPresets,n=e.workspaceOverride,a=e.orgPresetsRaw;return l(n)?r(n):void 0!==a?i(a):void 0===t||null===t?[...s]:r(t)}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.presets,n=e.currentCategory;const s=r(t),o=[],i=new Set,l=e=>{if("string"!==typeof e)return;const t=e.trim();if(!t)return;const n=t.toLowerCase();i.has(n)||(i.add(n),o.push(t))};l(a);for(const a of s)l(a);const c="string"===typeof n?n.trim():"";return c&&"general"!==c.toLowerCase()&&!i.has(c.toLowerCase())&&l(c),o}},71638(e,t,n){"use strict";n.d(t,{H9:()=>u,X3:()=>c,_w:()=>h,k$:()=>m,u6:()=>g,vn:()=>d});var a=n(67898),s=n(55472),r=n(96060),o=n(68400);const i="emailForSignIn";function l(e){const t="undefined"!==typeof window?window.location.origin:"";return{url:"".concat(t,"/join/").concat(encodeURIComponent(e)),handleCodeInApp:!0}}function c(){return"undefined"===typeof window?null:window.localStorage.getItem(i)}function d(e,t){var n;const a=null===(n=String(e||"").split("@")[1])||void 0===n?void 0:n.toLowerCase();return!(!a||!Array.isArray(t))&&t.some(e=>{const t=String(e||"").toLowerCase().replace(/^@/,"");return a===t})}async function u(e,t){const n=e.trim().toLowerCase();!function(e){"undefined"!==typeof window&&window.localStorage.setItem(i,e.trim().toLowerCase())}(n),await(0,o.Nn)({slug:t,email:n,continueUrl:l(t).url})}function m(e){return!("undefined"===typeof window||!e)&&(0,a.Pj)((0,a.xI)(),e)}async function p(e,t){const n=(0,a.xI)(),s=e.trim().toLowerCase(),r=await(0,a.hK)(n,s,t);return"undefined"!==typeof window&&window.localStorage.removeItem(i),r.user}async function g(e,t){const n=await p(e,t);return await async function(e){if(null===e||void 0===e||!e.uid)return!1;const t=(0,s.aU)(),n=(0,s.doc)(t,"users",e.uid);if((await(0,s.getDoc)(n)).exists())return await(0,s.BN)(n,{lastLogin:(0,s.O5)()},{merge:!0}),!1;const a=await(0,r.k5)(e.uid),o=e.email||"";return await(0,s.BN)(n,{name:await(0,r.FA)("",a),email:await(0,r.FA)(o,a),role:"viewer",organizations:{},settings:{notifications:{email:!0,inApp:!0}},providerId:"emailLink",authProviders:[{id:"emailLink"}],signupPlan:"domain-join",signupSource:"domain-join-magic-link",signupTimestamp:(0,s.O5)(),createdAt:(0,s.O5)(),lastLogin:(0,s.O5)()}),!0}(n),n}function h(){const e=(0,o.HV)();return e?"/join/".concat(e):"/"}},22371(e,t,n){"use strict";n.d(t,{NC:()=>o,eb:()=>i,kn:()=>r,zw:()=>s});const a="justSignedUp";function s(e){if("undefined"!==typeof window&&e)try{sessionStorage.setItem(a,String(e))}catch(t){}}function r(){if("undefined"===typeof window)return null;try{return sessionStorage.getItem(a)}catch(e){return null}}function o(){const e=r();if(!e)return null;try{sessionStorage.removeItem(a)}catch(t){}return e}function i(){return Boolean(r())}},65469(e,t,n){"use strict";n.d(t,{A:()=>a});const a=(0,n(77784).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},36210(e,t,n){"use strict";n.d(t,{A:()=>a});const a=(0,n(77784).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},35087(e,t,n){"use strict";n.d(t,{A:()=>a});const a=(0,n(77784).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},35327(e,t,n){"use strict";n.d(t,{A:()=>a});const a=(0,n(77784).A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]])},33868(e,t,n){"use strict";e.exports=n.p+"static/media/based-logo.a67d9183af33425eff79.png"},98139(e,t){var n;!function(){"use strict";var a={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];
2n&&(e=o(e,r(n)))}return e}function r(e){if("string"===typeof e||"number"===typeof e)return e;if("object"!==typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)a.call(e,n)&&e[n]&&(t=o(t,n));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0===(n=function(){return s}.apply(t,[]))||(e.exports=n)}()}}]);
3//# sourceMappingURL=333.5b35cb51.chunk.js.map

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.