1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5208],{65708:(e,n,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/add-brand-space",function(){return a(76935)}])},76935:(e,n,a)=>{"use strict";a.r(n),a.d(n,{default:()=>U});var i=a(37876),t=a(14232),r=a(89099),s=a(77328),o=a.n(s),l=a(38061),d=a(39955),c=a(38890),h=a(20339),u=a(82736),g=a(38443),m=a(60851),p=a(9552),b=a(80192),f=a(74049),y=a(5377),x=a(24836),j=a(51362),w=a(91921),S=a(79736),z=a(53869),v=a(46676),E=a(96491),F=a(67768),C=a(67914),B=a(6433),A=a(90068),_=a(93606),k=a(4784);function T(){var e,n,a;let s=(0,r.useRouter)(),o=(0,y.d)(),h=(0,F.jE)(),{billingStatus:u}=(0,f.H)(),{setActive:g}=(0,b.D_)(),p=null!=(n=null==u?void 0:u.isInTrial)&&n,{daysLeft:T}=(0,_.O)(),{isOpen:O,onOpen:U,onClose:I}=(0,x.j)(),[L,W]=(0,t.useState)(""),[N,R]=(0,t.useState)(!1),H=(0,l.dU)("slate.500","slate.400"),P=(0,l.dU)("slate.50","surface.700"),$=(0,l.dU)("slate.200","surface.600"),q=(0,l.dU)("slate.800","slate.100"),D=(0,C.I)({queryKey:["billing","brands","preview-charge"],queryFn:()=>B.c.previewBrandCharge(),enabled:!p,staleTime:3e4}),Y=null==(e=D.data)?void 0:e.data,K=null!=(a=null==u?void 0:u.currency)?a:"usd",X=async()=>{if(L.trim().length<2)return void o({title:"Brand space name is too short",description:"Please enter at least 2 characters.",status:"warning",duration:3e3});R(!0);try{let e=await B.c.createBrand(L.trim());h.invalidateQueries({queryKey:["billing"]}),g&&await g({organization:e.data.clerkOrgId}),await s.push("/onboarding")}catch(e){o({title:"Failed to create brand space",description:"Please try again or contact support.",status:"error",duration:4e3}),R(!1)}},J=(null==u?void 0:u.billingInterval)==="annual"&&Y&&Y.recurringAmount>0&&Y.immediateCharge>Y.recurringAmount/12;return p?(0,i.jsxs)(j.T,{spacing:5,align:"stretch",py:4,children:[(0,i.jsx)(w.E,{fontFamily:"body",fontSize:"sm",color:H,lineHeight:"tall",children:"Brand spaces are available on active subscriptions. You're currently on a free trial. Choose your plan to activate your subscription, then come back to add a brand space."}),(0,i.jsx)(c.$,{colorScheme:"brand",onClick:U,fontFamily:"heading",fontWeight:"bold",size:"md",children:"Choose Your Plan"}),(0,i.jsx)(k.Ay,{isOpen:O,onClose:I,showUrgency:!1,daysLeft:T})]}):D.isLoading?(0,i.jsxs)(S.z,{justify:"center",py:10,children:[(0,i.jsx)(m.y,{size:"md",color:"brand.500"}),(0,i.jsx)(w.E,{fontSize:"sm",color:H,children:"Loading pricing details..."})]}):(0,i.jsxs)(j.T,{spacing:6,align:"stretch",children:[(0,i.jsxs)(z.MJ,{isRequired:!0,children:[(0,i.jsx)(v.l,{fontSize:"sm",fontWeight:"medium",fontFamily:"heading",children:"Brand Space Name"}),(0,i.jsx)(E.p,{placeholder:"Enter brand space name",value:L,onChange:e=>W(e.target.value),size:"lg",borderRadius:"lg",fontFamily:"body"})]}),Y&&(0,i.jsx)(d.a,{bg:P,borderRadius:"xl",p:5,children:(0,i.jsxs)(j.T,{spacing:3,align:"stretch",children:[(0,i.jsxs)(S.z,{justify:"space-between",children:[(0,i.jsx)(w.E,{fontSize:"sm",color:H,fontFamily:"heading",children:"Immediate prorated charge"}),(0,i.jsx)(w.E,{fontSize:"sm",fontWeight:"bold",fontFamily:"heading",children:(0,A.$g)(Y.immediateCharge,K)})]}),(0,i.jsxs)(S.z,{justify:"space-between",children:[(0,i.jsx)(w.E,{fontSize:"sm",color:H,fontFamily:"heading",children:"Recurring"}),(0,i.jsxs)(w.E,{fontSize:"sm",fontWeight:"bold",fontFamily:"heading",children:[(0,A.$g)(Y.recurringAmount,K),"/","annual"===Y.interval?"year":"month"]})]}),(0,i.jsxs)(w.E,{fontSize:"xs",color:H,pt:1,fontFamily:"body",children:["You'll have ",Y.newBranchLabCount+1," brand space",Y.newBranchLabCount+1!==1?"s":""," total"]}),J&&(0,i.jsx)(w.E,{fontSize:"xs",color:"amber.600",fontStyle:"italic",fontFamily:"body",children:"This is a prorated amount for the remainder of your current annual billing cycle."})]})}),(0,i.jsx)(d.a,{borderRadius:"xl",border:"1px solid",borderColor:$,p:5,children:(0,i.jsxs)(j.T,{spacing:2,align:"stretch",children:[(0,i.jsx)(w.E,{fontSize:"sm",fontWeight:"semibold",fontFamily:"heading",color:q,children:"What happens next"}),(0,i.jsx)(w.E,{fontSize:"sm",color:H,fontFamily:"body",lineHeight:"tall",children:"Once confirmed, you'll be taken to
1set up your new Brand DNA, which helps Sosh AI understand your brand's voice, audience, and content style."}),(0,i.jsx)(w.E,{fontSize:"sm",color:H,fontFamily:"body",lineHeight:"tall",children:"You can switch between your brand spaces anytime using the brand space switcher in the sidebar. Each brand space has its own content calendar, posts, and social accounts."})]})}),(0,i.jsx)(c.$,{colorScheme:"brand",onClick:X,isLoading:N,loadingText:"Creating...",isDisabled:L.trim().length<2||D.isLoading||!Y,fontFamily:"heading",fontWeight:"bold",size:"lg",children:L.trim()?"Add ".concat(L.trim()):"Add Brand Space"})]})}function O(){let e=(0,l.dU)("slate.500","slate.400");return(0,i.jsxs)(j.T,{spacing:6,align:"stretch",children:[(0,i.jsx)(d.a,{children:(0,i.jsx)(w.E,{fontFamily:"body",fontSize:"sm",color:e,lineHeight:"tall",children:"Name your Brand Space to get started. On the next step you'll choose your plan and set up billing, and your subscription starts right away."})}),(0,i.jsx)(b.ul,{skipInvitationScreen:!0,afterCreateOrganizationUrl:"/card-capture?noTrial=1",appearance:{elements:{rootBox:{width:"100%"},card:{boxShadow:"none",width:"100%"}}}})]})}function U(){let e=(0,r.useRouter)(),{isSignedIn:n,isLoaded:a}=(0,b.As)(),{billingStatus:s,isLoading:y}=(0,f.H)(),x=(0,l.dU)("slate.50","surface.900"),j=(0,l.dU)("white","surface.800"),w=(0,l.dU)("slate.900","slate.50"),S=(0,l.dU)("slate.500","slate.400");(0,t.useEffect)(()=>{a&&!n&&e.replace("/sign-in")},[a,n,e]);let z=!a||y;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(o(),{children:[(0,i.jsx)("title",{children:"Add a Brand Space | Sosh AI"}),(0,i.jsx)("meta",{name:"robots",content:"noindex"})]}),(0,i.jsxs)(d.a,{minH:"100vh",bg:x,py:{base:8,md:16},position:"relative",children:[(0,i.jsx)(c.$,{variant:"ghost",size:"sm",leftIcon:(0,i.jsx)(p.A,{size:16}),onClick:()=>e.push("/dashboard"),color:S,fontFamily:"heading",fontWeight:"medium",position:"absolute",top:{base:4,md:6},left:{base:4,md:6},px:2,children:"Back to dashboard"}),(0,i.jsxs)(h.m,{maxW:"lg",children:[(0,i.jsx)(u.D,{fontFamily:"heading",fontSize:"2xl",color:w,mb:6,textAlign:"center",children:"Add a Brand Space"}),(0,i.jsx)(d.a,{bg:j,borderRadius:"2xl",p:{base:5,md:8},boxShadow:"sm",children:z?(0,i.jsx)(g.o,{py:12,children:(0,i.jsx)(m.y,{size:"lg",color:"brand.500"})}):(null==s?void 0:s.isBillingOwner)?(0,i.jsx)(T,{}):(0,i.jsx)(O,{})})]})]})]})}}},e=>{e.O(0,[5533,2900,3995,8892,8977,636,6593,8792],()=>e(e.s=65708)),_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.