PageSourceSearch

https://demo.sonraisecurity.com/_next/static/chunks/pages/no-memberships-b50748f26d27f63d.js

js sonraisecurity.com collected 2026-10-01 11:38:05 UTC 14,802 bytes, 5 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2a674249-423b-5490-b964-9e65124fe868")}catch(e){}}();
3(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7137],{4070:(e,a,r)=>{"use strict";r.r(a),r.d(a,{default:()=>p});var t=r(6029),n=r(1237),s=r(15094),o=r(17738),l=r(99392),i=r(5178),c=r(51260),u=r(3967),d=r(81278);function m(){let e=(0,d.useRouter)(),[{data:a}]=(0,c.f)(),r=((null==a?void 0:a.matchingWorkspaces)||[]).length>0,n=async a=>{if(!(null==a?void 0:a.slug))return void(0,u.V2)("Failed to join or create workspace. Please try again.");try{await e.push({pathname:"/[workspace_slug]/product-demos",query:{workspace_slug:a.slug}})}catch(e){console.error("Failed to navigate to workspace:",e),(0,u.V2)("Failed to navigate to workspace. Please try refreshing the page.")}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.A,{title:"Join or create workspace"}),(0,t.jsx)(s._R,{children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(o.A,{}),(0,t.jsxs)("div",{className:"mx-auto my-14 w-full max-w-lg",children:[(0,t.jsx)("h3",{className:"mb-3 text-center text-2xl font-semibold text-gray-800",children:r?"Join or create a workspace":"Create a workspace"}),r?(0,t.jsx)(l.V,{workspaceId:null,next:n}):(0,t.jsx)(l._,{workspaceId:null,next:n})]})]})})]})}m.getLayout=function(e){return(0,t.jsx)(n.A,{showNav:!1,children:e})};let p=m},15094:(e,a,r)=>{"use strict";r.d(a,{Ml:()=>l,_R:()=>o,sx:()=>i});var t=r(6029),n=r(55729);let s=(0,n.createContext)(void 0);function o(e){let{children:a,currentUser:r}
3=e,[o,l]=(0,n.useState)(()=>{var e,a;return r?{firstName:null!=(e=r.firstName)?e:"",lastName:null!=(a=r.lastName)?a:""}:{}}),i=(0,n.useCallback)(e=>{l(a=>({...a,...e}))},[]),c=(0,n.useCallback)(()=>{l({})},[]);return(0,t.jsx)(s.Provider,{value:{formState:o,setFormState:i,clearFormState:c},children:a})}function l(){let e=(0,n.useContext)(s);if(void 0===e)throw Error("useOnboardingFormState must be used within an OnboardingFormStateProvider");return e}function i(){return(0,n.useContext)(s)}},17738:(e,a,r)=>{"use strict";r.d(a,{A:()=>l});var t=r(6029),n=r(99454),s=r(23397),o=r(98077);function l(){return(0,t.jsxs)("div",{className:"fixed top-0 right-0 left-0 z-10 flex justify-between p-4 px-10",children:[(0,t.jsx)("button",{onClick:()=>(0,n.v)(),"aria-label":"Sign out",children:(0,t.jsx)(o.Ay,{})}),(0,t.jsxs)("div",{className:"space-x-1.5 text-sm font-medium",children:[(0,t.jsx)("span",{className:"text-subtle",children:"Need help?"}),(0,t.jsx)("a",{className:"text-gray-900 transition-opacity duration-150 hover:opacity-80",href:"mailto:".concat(s.Teh),children:"Get in touch"})]})]})}r(55729).forwardRef((e,a)=>{let{height:r=21,...n}=e;return(0,t.jsx)("div",{ref:a,className:"rounded-lg border bg-linear-to-t from-gray-50 to-white p-2 shadow-xs",...n,children:(0,t.jsx)(o.ys,{height:r})})}).displayName="OnboardingLogo"},51260:(e,a,r)=>{"use strict";r.d(a,{f:()=>i});var t=r(85966),n=r(26626),s=r(1559);function o(){let e=(0,t._)(["\n    query ListMatchingWorkspaces {\n  matchingWorkspaces {\n    id\n    name\n    slug\n    domain\n    membershipStatus\n  }\n}\n    "]);return o=function(){return e},e}let l=(0,n.Ay)(o());function i(e){return(0,s.s)(l,"matchingWorkspaces",e)}},76091:(e,a,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/no-memberships",function(){return r(4070)}])},81457:(e,a,r)=>{"use strict";r.d(a,{Im:()=>n,mS:()=>s});let t=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function n(e){return e.trim().toLowerCase().replace(/\s+/g,"-")}function s(e){return e.length<64&&t.test(e)?e:null}},99392:(e,a,r)=>{"use strict";r.d(a,{V:()=>V,_:()=>A});var t=r(6029),n=r(13717),s=r(72807),o=r(34584),l=r(3947),i=r(55809),c=r(55613),u=r(95678),d=r(16229),m=r(99798),p=r(85966),h=r(26626),f=r(87098),x=r(50197);function w(){let e=(0,p._)(["\n    mutation CreateWorkspace($name: String!, $slug: String!, $size: CompanySize, $referredBy: ReferredBy, $domain: String) {\n  createWorkspace(\n    name: $name\n    slug: $slug\n    size: $size\n    referredBy: $referredBy\n    domain: $domain\n  ) {\n    ...Membership\n  }\n}\n    ",""]);return w=function(){return e},e}let g=(0,h.Ay)(w(),f.t);function k(){let e=(0,p._)(["\n    mutation JoinWorkspaces($workspaceIds: [String!]!) {\n  joinWorkspaces(workspaceIds: $workspaceIds) {\n    ...Membership\n  }\n}\n    ",""]);return k=function(){return e},e}let v=(0,h.Ay)(k(),f.t);var j=r(51260),y=r(23397),N=r(62019),b=r(48642),S=r(22391),C=r(81457),_=r(84379),E=r(3967),L=r(13415),R=r(15094),D=r(81278),I=r(55729);let T=Object.values(l.tSY);function A(e){var a,r,c,u;let d=(0,D.useRouter)(),m=(0,s.cM)()&&"/create-workspace"===d.pathname,{currentUser:p}=(0,_.iZ)(),{formState:h,setFormState:f}=(0,R.Ml)(),[w,k]=(0,I.useState)(!1),[v,j]=(0,I.useState)(null),[,A]=x.n_(g),{setActiveMembership:$,refetch:V}=(0,_.hA)(),z=(0,I.useRef)(!1),W=(0,I.useRef)(!1),F=null!=(a=h.workspaceName)?a:"",M=null!=(r=h.workspaceSlug)?r:"",q=(0,C.Im)(M),G=!v&&""!==q&&q!==M,O=(null==p?void 0:p.email)?(0,b.in)(p.email):"",P=!!(null==p?void 0:p.email)&&(0,b.Yc)(O),{fetching:B,suggestion:Y,error:J}=function(e){let{pause:a}=e,[r,t]=(0,I.useState)(!1),[n,s]=(0,I.useState)(null),[l,i]=(0,I.useState)(null);return(0,I.useEffect)(()=>{if(a)return;let e=new AbortController;return(async()=>{t(!0),i(null);try{let a=await fetch((0,o.bz$)(),{signal:e.signal});if(!a.ok)throw Error("Failed to fetch workspace slug");let r=await a.json();if(!r.workspaceName||!r.workspaceSlug)throw Error("Invalid workspace slug response");s({workspaceName:r.workspaceName,workspaceSlug:r.workspaceSlug})}catch(a){e.signal.aborted||(i(a instanceof Error?a:Error("Unknown error")),s(null))}
3finally{e.signal.aborted||t(!1)}})(),()=>{e.abort()}},[a]),{fetching:r,suggestion:n,error:l}}({pause:!P});(0,I.useEffect)(()=>{if(!(null==p?void 0:p.email))return;let e=(0,b.in)(p.email);if(!e)return;let a=()=>{var a;""===(null!=(a=h.emailDomain)?a:"").trim()&&f({emailDomain:e})};if(z.current||""!==(null!=F?F:"").trim())return void a();if(P){if(B||!Y&&!J)return void a();if(J||!Y){f({emailDomain:e,workspaceName:"New Workspace",workspaceSlug:"new-workspace"}),z.current=!0;return}return f({emailDomain:e,workspaceName:Y.workspaceName,workspaceSlug:Y.workspaceSlug}),void(z.current=!0)}let r=function(e){let a=e.split(".");return a.length<2?"":a[a.length-2]}(e);f({emailDomain:e,workspaceName:(0,N.ZH)(r),workspaceSlug:r}),z.current=!0},[null==p?void 0:p.email,J,B,h.emailDomain,f,Y,P,F]),(0,I.useEffect)(()=>{if(!m||!(null==p?void 0:p.email)||W.current)return;let e=(0,b.gG)(p.email);e&&f({workspaceCompanyDomain:e}),W.current=!0},[null==p?void 0:p.email,f,m]);let X=async()=>{let a;if(!p)return;let r=T.includes(d.query.referredBy)?d.query.referredBy:l.tSY.None;if(m){var t;let e=(null!=(t=h.workspaceCompanyDomain)?t:"").trim();if(e){let r=(0,b.XX)(e);if(!r||!(0,b.UT)(r))return void(0,E.V2)("Enter a valid company domain (for example, acme.com).");if((0,b.Yc)(r))return void(0,E.V2)("Use your company’s website domain, not a personal email provider (e.g. Gmail).");a=r}else a=void 0}else{let e=(0,b.gG)(p.email);a=null===e?void 0:e}j(null),k(!0);let s=await (async()=>{var e;let t=await A({name:F,slug:q,domain:a,referredBy:r});if(t.error){console.error(t.error);let e=t.error.graphQLErrors.find(e=>e.extensions.code===y.plD.SLUG_CONFLICT||e.extensions.code===y.plD.SLUG_REDIRECT_CONFLICT||e.extensions.code===y.plD.SLUG_RESERVED||e.extensions.code===y.plD.SLUG_INVALID),a="Failed to create workspace";if(e)switch(e.extensions.code){case y.plD.SLUG_CONFLICT:return j(q),(0,b.Yc)(O)&&Y&&f({workspaceName:Y.workspaceName,workspaceSlug:Y.workspaceSlug}),null;case y.plD.SLUG_REDIRECT_CONFLICT:return j(q),null;case y.plD.SLUG_RESERVED:a='Slug "'.concat(q,'" is reserved and cannot be used');break;case y.plD.SLUG_INVALID:a='Slug "'.concat(q,'" contains invalid characters. Use only lowercase letters, numbers, and hyphens')}return(0,E.V2)(a),null}return n.A.track("onboarding_workspace_created"),null==(e=t.data)?void 0:e.createWorkspace})();k(!1),s&&("id"in s&&s.id&&($(s),V()),await e.next({slug:s.workspace.slug}))},Z=!q||!F;return(0,t.jsx)(L.A,{next:{onClick:X,disabled:Z,label:"Continue",loading:w},back:e.showBack&&e.back?{onClick:()=>{var a;return null==(a=e.back)?void 0:a.call(e)}}:void 0,skip:{onClick:S.fZ,hidden:!0},children:(0,t.jsxs)("div",{className:"space-y-10 px-0.5",children:[(0,t.jsxs)("div",{className:"flex flex-row space-x-3",children:[(0,t.jsx)(i.p,{className:"flex-1",isRequired:!0,name:"workspaceName",label:"Workspace name",placeholder:"ACME Corporation",maxLength:40,value:F,size:"lg",onValueChange:e=>f({workspaceName:e})}),(0,t.jsx)(i.p,{className:"flex-1",isRequired:!0,name:"slug",label:"Workspace URL",placeholder:"acme",value:M,size:"lg",description:G?(0,t.jsxs)(t.Fragment,{children:["Will be saved as"," ",(0,t.jsx)("span",{className:"text-default font-medium",children:q})]}):void 0,error:v?(0,t.jsx)(U,{slug:v,userEmail:null!=(c=null==p?void 0:p.email)?c:""}):void 0,onValueChange:e=>{j(null),f({workspaceSlug:e})},elementRight:".navattic.com"})]}),m?(0,t.jsx)(i.p,{isRequired:!0,name:"workspaceCompanyDomain",label:"Company domain",description:"Used for this workspace's logo and branding.",placeholder:"acme.com",value:null!=(u=h.workspaceCompanyDomain)?u:"",size:"lg",onValueChange:e=>f({workspaceCompanyDomain:e})}):null,e.footerExtra]})})}function U(e){let{slug:a,userEmail:r}=e,n=encodeURIComponent('Request to claim workspace URL "'.concat(a,'"')),s=encodeURIComponent("I'd like to claim the workspace URL \"".concat(a,'" for my new workspace. My account email is ').concat(r,"."));return(0,t.jsxs)("span",{children:["URL is taken. Try another, or"," ",(0,t.jsx)("a",{className:"underline",href:"mailto:".concat(y.Teh,"?subject=").concat(n,"&body=").concat(s),children:"contact support"}
3)," ","if it's yours."]})}let $={create:{buttonText:"Join an existing workspace",component:A},join:{buttonText:"Or create a workspace",component:z}};function V(e){let[a,r]=(0,I.useState)("join"),s=()=>{let e="create"===a?"join":"create";n.A.track("onboarding_workspace_mode_switched",{mode:e,stepName:"You may already have a workspace",stepType:"workspace"}),r(e)};return"create"===a?(0,t.jsx)(A,{...e,footerExtra:(0,t.jsx)("div",{className:"flex flex-row items-center justify-center pt-2",children:(0,t.jsx)(c.$,{onClick:s,variant:"ghost",size:"sm",children:$.create.buttonText})})}):(0,t.jsx)(z,{...e,onSwitchToCreate:s})}function z(e){let[{data:a}]=(0,j.f)({requestPolicy:"cache-only"}),[r,s]=(0,I.useState)(null),[o,p]=(0,I.useState)(new Set),[h,f]=(0,I.useState)(""),[w,g]=(0,I.useState)(0),k=(null==a?void 0:a.matchingWorkspaces)||[],{setActiveMembership:y,refetch:N}=(0,_.hA)(),S=k.length>6,C=(0,I.useMemo)(()=>[...k].sort((e,a)=>e.name.localeCompare(a.name,void 0,{sensitivity:"base"})||e.slug.localeCompare(a.slug,void 0,{sensitivity:"base"})),[k]),R=(0,I.useMemo)(()=>{let e=h.trim().toLowerCase();return S&&e?C.filter(a=>a.name.toLowerCase().includes(e)||a.slug.toLowerCase().includes(e)):C}
3,[S,C,h]),D=(0,I.useMemo)(()=>{if(!S)return R;let e=6*w;return R.slice(e,e+6)},[S,R,w]),T=S&&h.trim().length>0&&0===R.length,[,A]=x.n_(v),{currentUser:U}=(0,_.iZ)(),V=async e=>{let{id:a,slug:r}=e;if(!U)return;s(a);let t=await W(r);if(s(null),!t)return void(0,E.V2)("Could not request access to ".concat(r));(0,E.kX)("Sent email request to the admins of ".concat(r))},z=async a=>{if(!U)return;s(a);let[r,o]=await (async()=>{var e;let r=await A({workspaceIds:[a]});if(r.error){let e=(0,m.SP)(r.error.message),a=r.error.graphQLErrors.find(e=>!!e.extensions.slugs);if(a){let r=a.extensions.slugs.join(", ");(0,E.V2)((0,t.jsxs)("div",{"data-test-id":"workspace-join-error",children:[(0,t.jsx)("div",{className:"font-semibold",children:e}),(0,t.jsxs)("div",{children:["Affected workspaces: ",r]}),(0,t.jsx)("div",{children:"Please reach out to a workspace admin to receive an invitation."})]}))}else(0,E.V2)(e);return[!1,null]}return n.A.track("onboarding_workspace_joined"),[!0,null==(e=r.data)?void 0:e.joinWorkspaces]})();s(null),r&&o&&(y(o),N(),await e.next({slug:o.workspace.slug}))};return(0,t.jsxs)(L.M,{bodyClassName:"flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto",footer
3:(0,t.jsx)("div",{className:"flex justify-between pt-4",children:(0,t.jsx)("div",{className:"flex gap-3 text-sm",children:e.showBack&&(0,t.jsx)(c.$,{variant:"ghost",onClick:e.back,"aria-label":"Back","data-test-id":"onboarding-back",children:"Back"})})}),children:[S&&(0,t.jsx)(i.p,{name:"workspace-search",placeholder:"Search workspaces",iconLeft:"search",value:h,className:"max-w-[200px] shrink-0 m-0.5",onValueChange:e=>{f(e),g(0)}}),(0,t.jsxs)("div",{className:"space-y-3",children:[D.map(e=>{let a=r===e.id,n=e.slug,s=(0,b.Yc)(e.domain)||o.has(e.id);return(0,t.jsxs)("div",{className:"flex flex-row justify-between border border-gray-200 rounded-xl p-4",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center space-x-3",children:[s?(0,t.jsx)(u.I,{name:"building",className:"size-8 text-gray-400"}):(0,t.jsx)("img",{src:"https://logo.navattic.com/".concat(e.domain),alt:e.name,className:"size-8 rounded",onError:()=>{p(a=>new Set(a).add(e.id))}}),(0,t.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,t.jsx)("div",{className:"text-lg font-medium",children:e.name}),(0,t.jsxs)("div",{className:"text-gray-500",children:["(",e.slug,")"]})]})]}),e.membershipStatus===l.tDZ.Member?(0,t.jsx)(c.$,{variant:"outline","data-test-id":n,isLoading:a,onClick:()=>{z(e.id)},children:"Join workspace"}):(0,t.jsx)(c.$,{isLoading:a,"data-test-id":n,variant:"outline",onClick:()=>{V({id:e.id,slug:e.slug})},children:"Request access"})]},e.id)}),S&&0===R.length&&(0,t.jsx)("div",{className:"text-subtle py-4 text-center text-sm",children:"No workspaces match your search."})]}),S&&(0,t.jsx)(d.d,{page:w,pageSize:6,maxRow:R.length,onPageChange:g,variant:"compact",hidePageSizeSelector:!0,hideIfNotNeeded:!0}),e.onSwitchToCreate&&(0,t.jsx)("div",{className:"flex flex-row items-center justify-center pt-2",children:(0,t.jsx)(c.$,{onClick:e.onSwitchToCreate,variant:T?"outline":"ghost",size:"sm",children:T?"Create a workspace":$.join.buttonText})})]})}async function W(e){return(await fetch((0,o.vwo)({slug:e}),{method:"POST"})).ok}}},e=>{e.O(0,[6593,8635,8213,1663,9616,4254,4664,238,9913,8277,3684,4446,919,6838,9391,2292,1642,8750,1652,9047,6450,9899,7283,5460,488,5742,9928,7929,330,2726,2532,8975,6100,865,2593,4379,2146,1224,5389,2045,2444,5720,7676,7135,8938,1362,500,4641,3482,7205,8388,1237,8255,8792],()=>e(e.s=76091)),_N_E=e.O()}]);
4//# sourceMappingURL=no-memberships-b50748f26d27f63d.js.map
5//# debugId=2a674249-423b-5490-b964-9e65124fe868

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.