1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/Cb4jpfEN.css","static/C1ZrU1qo.css","static/DIaD3O6C.css"])))=>i.map(i=>d[i]); 2(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`243f9fad78fd9d2010bdae2232d916ec6408033c`},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:surferseo-app-key":!0});var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`65300ac2-82a5-4340-911e-9ac65e977b9b`,e._sentryDebugIdIdentifier=`sentry-dbid-65300ac2-82a5-4340-911e-9ac65e977b9b`)}catch{}})();import{o as e}from"./Dn-kRqtK.js";import{a as t,c as n,i as r,o as i,s as a,t as o,u as s}from"./DnyC-zCQ.js";import{At as c,Cn as l,Ct as u,Et as d,Ot as f,St as p,Tt as m,Xt as h,_n as g,bn as _,dn as v,mn as y,pn as ee,t as b,wt as x,xn as te,xt as S}from"./BW45_iXB.js";import{c as ne,d as re,o as ie,r as C,s as ae,t as oe}from"./DEzBM4A8.js";import{a as se,i as w,r as T}from"./BgVEQLzm.js";import{n as ce,t as le}from"./GBPPSQPn.js";import{d as ue,i as E,r as D,s as de,t as O,u as fe}from"./D_yKOMiP.js";import{l as pe,u as me}from"./DNzsFWNv.js";import{t as he}from"./CoKaMhbA.js";import{i as ge,n as _e,r as ve}from"./Bb9DKiok.js";import{Q as k,S as ye,l as be,n as xe,r as Se}from"./B1pYOevN.js";import{i as Ce,r as we,t as Te}from"./B-gAx0lg.js";import{$c as Ee,$t as De,Aa as Oe,As as ke,B as Ae,Bn as je,Ci as Me,Dr as Ne,F as Pe,Fo as Fe,Gn as Ie,Gp as Le,Hu as Re,I as ze,Ia as Be,Id as Ve,Ii as He,It as Ue,Jf as We,Js as Ge,Jt as Ke,Ki as qe,Ko as Je,Ku as Ye,L as Xe,La as Ze,Lu as Qe,Ml as $e,Mo as et,Mr as tt,Op as nt,Or as rt,P as it,Q as at,Qd as ot,Qf as st,Qo as ct,Qt as lt,R as ut,Ra as dt,Sf as ft,So as pt,Su as mt,Ta as ht,To as gt,Tt as _t,Tu as vt,Ul as yt,Uo as bt,Uu as xt,V as St,Vd as Ct,Wn as wt,Wt as Tt,Xt as Et,Xu as Dt,Yp as Ot,Yt as kt,Yu as At,Zd as jt,Zo as Mt,_f as Nt,_n as Pt,a as A,af as Ft,ai as It,an as Lt,at as Rt,au as zt,bo as Bt,c as j,ci as Vt,cn as Ht,d as Ut,dl as Wt,dn as Gt,ea as Kt,en as qt,ep as Jt,et as Yt,f as Xt,fa as Zt,fn as Qt,g as $t,go as en,i as M,in as tn,io as nn,iu as rn,jp as an,kc as on,kp as sn,kr as cn,l as ln,la as un,li as dn,ln as fn,lo as pn,mt as mn,n as hn,ni as gn,nl as _n,nn as vn,o as yn,on as bn,p as xn,pa as Sn,pn as Cn,r as wn,rn as Tn,ro as En,ru as Dn,sl as On,sn as kn,st as An,tm as jn,tn as Mn,tp as Nn,u as Pn,un as Fn,uo as In,vn as Ln,wa as Rn,wi as zn,wo as Bn,wt as Vn,xf as Hn,xt as Un,xu as Wn,yt as Gn}from"./DzxLUMtp.js";import{At as Kn,Dt as qn,Ft as Jn,G as Yn,Gt as Xn,It as Zn,K as N,Lt as Qn,Pt as $n,X as er,Z as tr,_t as nr,at as rr,bt as ir,dt as ar,ft as P,ht as or,it as sr,jt as cr,kt as lr,ot as ur,pt as F,q as dr,rt as fr,st as pr,vt as mr,xt as hr,yt as gr}from"./Cx9SCPIv.js";import{F as I,Ft as _r,I as vr,N as yr,Nt as br,P as xr,Y as Sr,a as Cr,b as wr,d as Tr,dt as Er,et as Dr,ft as Or,ht as kr,i as Ar,it as jr,k as Mr,kt as Nr,m as Pr,mt as Fr,n as Ir,p as Lr,st as Rr,t as zr,u as Br,ut as Vr,v as Hr}from"./C_6jSShp.js";import{i as Ur,o as Wr,t as Gr}from"./26Iywe8E.js";import{t as Kr}from"./wlpHU3Lz.js";import{i as qr}from"./BziJGb8A.js";import{a as Jr,i as Yr,o as Xr,r as Zr,t as Qr}from"./BQJQRnul2.js";import{o as $r,r as ei}from"./DARWUKgk2.js";import{t as ti}from"./C8QDG0fq2.js";import{t as ni}from"./BNR0bQ6m2.js";import{r as ri,s as ii,t as ai}from"./B-5la9IU.js";import{n as oi,o as si,rn as ci,t as li}from"./8AWIiVOp.js";import{a as ui,i as di,n as fi,o as pi,s as mi,t as hi}from"./D92g0ky4.js";import{t as L}from"./wDaLEed6.js";import{r as R}from"./8gKoHHy1.js";import{_ as gi,a as _i,c as vi,h as yi,l as bi,m as xi,s as Si,w as Ci,y as wi}from"./BO6Uix0H.js";import{n as z,t as Ti}from"./MhzZWjri.js";import{a as Ei,i as Di,r as Oi,t as ki}from"./Czlm6Ze3.js";import{t as Ai}from"./DYvds7Oj.js";import{d as ji}from"./CT5r39ju.js";import{t as Mi}from"./BrisMrmN.js";import{t as Ni}from"./CqBhM_zk.js";import{a as Pi,i as Fi,n as Ii,r as Li,t as Ri}from"./BkfDncxC.js";import{a as zi,i as Bi,n as Vi,r as Hi,t as Ui}from"./BjaLnknV.js";import{t as Wi}from"./DWoE7sG_.js";import{a as Gi,c as Ki,n as qi,o as Ji,r as Yi,s as Xi,t as Zi}from"./B44FW54P2.js";import{t as Qi}
2from"./B19EiXrE2.js";import{n as $i,t as ea}from"./fsLEAs3H2.js";import{C as ta,S as na,T as ra,r as ia,t as aa,w as oa}from"./Dc3LC8f92.js";import{i as sa,n as ca,t as la}from"./main.O0i93o8V.js";import{t as B}from"./D6QrRWEk2.js";import{t as ua}from"./CDtMc5ij2.js";import{S as V,m as da,o as fa,s as H,t as pa,v as ma,y as U}from"./YBNFaBFn2.js";import{t as W}from"./BZ8tne3i2.js";import{C as ha,O as ga,h as _a,i as va,k as ya,n as ba,o as xa,t as G}from"./BN35mN11.js";import{a as Sa,t as Ca}from"./DcA9HeBO.js";import{t as K}from"./DHN-69DS.js";import{t as wa}from"./Cbbg-7Ik.js";import{n as Ta,r as Ea,t as Da}from"./c6RZ3chp.js";import{rt as Oa}from"./CsIPf518.js";import{a as ka,i as Aa,n as ja,o as Ma,r as Na,t as Pa}from"./CvIPR9UC2.js";import{n as Fa}from"./C7zKqN592.js";import{t as Ia}from"./BS1x_GwY2.js";import{t as La}from"./0ByOscWB2.js";import{t as Ra}from"./BLTRqCzz.js";import{t as za}from"./BKjJPtbI.js";import{n as Ba,r as Va,t as Ha}from"./DA4m_485.js";import{t as Ua}from"./C05zsCpW.js";import{t as Wa}from"./CVIs3kvO.js";import{a as Ga,r as Ka,t as qa}from"./Tmg2b75B.js";import{t as Ja}from"./DrwRTY8f.js";import{t as Ya}from"./DZt2hxYh.js";import{n as Xa,t as Za}from"./CAqRGQII.js";import{r as Qa}from"./B-So4NfP.js";import{n as $a}from"./MtLGvXsb.js";import{a as eo,c as to,i as no,l as ro,n as io,r as ao,s as oo}from"./DCdB4U3n.js";import{t as so}from"./BHBjxq6Z.js";import{t as co}from"./u8xVx-df.js";import{t as q}from"./BhLDcwWM.js";import{n as lo,t as uo}from"./CSmRwLRx.js";import{n as fo,t as po}from"./D72DCfYN.js";import{t as mo}from"./GWYy6oTA.js";import{t as ho}from"./jYSCnGmO.js";import{t as go}from"./BWuo6bVi.js";import{a as _o,c as vo,d as yo,g as bo,h as xo,m as So,n as Co,p as wo,t as To,u as Eo}from"./CdAtCyb6.js";import{i as Do,n as Oo,t as ko}from"./C0OwXRhg.js";import{t as Ao}from"./OB8_IF2F.js";import{r as jo,t as Mo}from"./BHNfjHGs.js";import{n as No}from"./CnmqG-lZ.js";import{t as Po}from"./DBhjDxbF.js";import{t as Fo}from"./CXDZOBIt.js";import{t as Io}from"./Dz7MIeUs.js";import{t as Lo}from"./D5E2wZF8.js";import{n as Ro,t as zo}from"./-7Itp6q_.js";import{t as Bo}from"./DTHZokAu.js";import{t as Vo}from"./CGL2ZIwE.js";import{n as Ho,t as Uo}from"./Bmjvftc_2.js";import{t as Wo}from"./CvbpqhiS2.js";import{t as Go}from"./Bx2d1amM2.js";import{r as Ko,t as qo}from"./C8XFONFt2.js";import{a as Jo,i as Yo,n as Xo,t as Zo}from"./DuxJAi8N2.js";import{t as Qo}from"./CmN_Ikei2.js";import{n as $o}from"./CuF_8h8H2.js";import{t as es}from"./CMdTMe4i2.js";import{n as ts,t as ns}from"./CS6IkzdR2.js";import{t as rs}from"./BuwhnyIY2.js";import{t as is}from"./SvGHD3i82.js";import{t as as}from"./BWQpouVU2.js";import{t as os}from"./pa1xY-A72.js";import{t as ss}from"./D3y1aggJ2.js";import{t as cs}from"./BF_TPodj2.js";import{i as ls,n as us}from"./wrcSpPR52.js";import{t as ds}from"./BgTmm-M82.js";import{n as fs}from"./CdAvhS792.js";import{t as ps}from"./DfUvCuTP2.js";import{t as ms}from"./DTG6Udwf2.js";import{a as hs,i as gs,n as _s,o as vs,r as ys,s as bs,t as xs}from"./BMOSFZwY2.js";import{t as Ss}from"./DLxB0Oj02.js";import{t as Cs}from"./BUQTS-rv2.js";import{t as ws}from"./Djhh39E62.js";import{i as Ts,n as Es,r as Ds,t as Os}from"./BUeqEOCH.js";import{t as ks}from"./Dw01Rmbd.js";import{t as J}from"./B0cGz9MR.js";import{n as As}from"./DdzxPMJZ.js";import{i as js,r as Ms}from"./D0Tyr99L.js";import{t as Ns}from"./CGorIhYl.js";import{t as Ps}from"./CWdsCnwe.js";import{n as Fs,t as Is}from"./DfnXd3Y9.js";import{t as Ls}from"./NYaTEgOh.js";import{n as Rs,t as zs}from"./C3ra3YyH.js";import{t as Bs}from"./nCbklENB.js";import{t as Vs}from"./CSYE8Se9.js";import{t as Hs}from"./COjFM_ww.js";import{t as Us}from"./Cw6XpMK0.js";import{t as Ws}from"./BNOMQphM.js";import{t as Gs}from"./5BWuf1GV.js";import{t as Ks}from"./-ZK07SC7.js";import{t as qs}from"./sCSRp0Rn.js";import{t as Js}from"./CkFfaE0U.js";import{t as Ys}from"./DocikZoC.js";import{a as Xs,i as Zs,n as Qs,o as $s,r as ec}from"./DZuLoo7P.js";import{t as tc}from"./DO4SUWbd.js";import{a as nc}from"./B-bV8Xn1.js";import{t as rc}from"./v9abv6Sb.js";import{n as ic,t as ac}from"./Ba245m2M.js";import{b as oc,n as sc,t as cc,x as lc,y as uc}from"./N9_3yLF2.js";import{t as dc}from"./CytjZ07L.js";import{a as fc,i as pc}from"./BR_AQkje2.js";import{a as mc,i as hc}from"./B2L8I3fL2.js";import{i as gc}from"./DuQOym_t2.js";import{B as _c,P as vc,c as yc}from"./Dd-kYBsh2.js";import"./ClJflbbp2.js";import{l as bc,n as xc,r as Sc,s as Cc}from"./BwHPP7n22.js";import{c as wc,g as Tc,m as Ec,n as Dc,o as Oc,s as kc,t as Ac,u as jc}from"./IhiGSb572.js";import{t as Mc}from"./CnzBLe7z2.js";import{t as Nc}from"./DHHHLy9y2.js";import{i as Pc,r as Fc,t as Ic}from"./_h-P09Ca2.js";import{t as Lc}from"./BfIkWYcQ2.js";import{t as Rc}from"./Dkc5nKyF2.js";import{t as zc}from"./CJjAv_ca2.js";import{t as Bc}from"./DDnvWiIn2.js";import{t as Vc}from"./C6ye6ccy2.js";import{t as Hc}from"./CFqZKmc42.js";import{t as Uc}from"./Cv_EohzK.js";import{n as Wc,t as Gc}from"./bNsiKIBV.js";import{p as Kc}from"./DLNtv9iq.js";import{n as qc}from"./BjWBPEfv.js";import{t as Jc}from"./BuRQ7YHh.js";import{t as Yc}from"./DoLmreFW.js";import{t as Xc}from"./C3dqJfcj.js";import{t as Zc}from"./DCW3GDJq.js";import{t as Qc}from"./Bt9QMVZr.js";import{n as $c}from"./DGbx7VaN.js";import{n as el,t as tl}from"./tRrJsRcz.js";import{t as nl}from"./BrSVIgGI.js";E();var Y=e(ce(),1),X=le(),rl=(0,Y.createContext)(null);rl.displayName=`SidebarContext`;var il=be(rl),al=({className:e,...t})=>{let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(rl,{value:(0,Y.useMemo)(()=>({contentOverflowing:n,setContentOverflowing:r}),[n,r]),children:(0,X.jsx)(`aside`,{className:O(D(`relative flex h-full flex-col items-center overflow-hidden bg-gray-160`,!t.compact&&`w-[16.5rem] items-stretch`),e),"data-testid":`sidebar-container`,children:t.children})})},ol=({children:e,className:t,...n})=>{let{contentOverflowing:r,setContentOverflowing:i}=il(),a=(0,Y.useRef)(null),o=(0,Y.useCallback)(()=>{let e=a.current;e&&i(e.scrollHeight>e.clientHeight)},[i]);return(0,Y.useLayoutEffect)(()=>{let e=new ResizeObserver(o);return a.current&&(e.observe(a.current),o()),()=>{e.disconnect()}},[r,i,o]),(0,X.jsx)(`div`,{className:O(`gap-2xs relative flex h-full flex-col overflow-y-auto overflow-x-hidden`,t),ref:a,...n,children:e})},sl=e=>(0,X.jsxs)(`div`,{className:O(`flex w-full items-center justify-between`,e.className),children:[(0,X.jsx)(`span`,{className:`text-xs font-semibold uppercase text-gray-70`,children:e.label}),e.children]}),cl=()=>{(0,Y.useEffect)(()=>
2(window.addEventListener(`keydown`,ur),window.addEventListener(`keydown`,pr),()=>{window.removeEventListener(`keydown`,ur),window.removeEventListener(`keydown`,pr)}),[])},ll=!1,ul=()=>{ll||!window.analytics||(ll=!0,window.analytics.addSourceMiddleware(({payload:e,next:t})=>{e.obj.context={...e.obj.context,consent:{categoryPreferences:lt().categories}},t(e)}))},dl=[`analytics`,`marketing`],fl=[{name:`meta`,categories:[`marketing`],onRevoked:()=>{var e,t;return(e=(t=window).fbq)==null?void 0:e.call(t,`consent`,`revoke`)},scripts:()=>{var e;let t=(e=window.APP_ENV)==null?void 0:e.facebook_pixel_id;return t?[` 3 !function(f,b,e,v,n,t,s) 4 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 5 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 6 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 7 n.queue=[];t=b.createElement(e);t.async=!0; 8 t.src=v;s=b.getElementsByTagName(e)[0]; 9 s.parentNode.insertBefore(t,s)}(window,document,'script', 10 'https://connect.facebook.net/en_US/fbevents.js'); 11 12 fbq('init', '${t}'); 13 fbq('track', 'PageView'); 14 `]:[]}},{name:`segment`,categories:[`analytics`,`marketing`],onGranted:ul,scripts:()=>{var e;let t=(e=window.APP_ENV)==null?void 0:e.segment_id;return t?[`window.analytics && window.analytics.load("${t}")`]:[]}},{name:`mixpanel`,categories:[`analytics`],onGranted:St,onRevoked:Ae,scripts:()=>[]},{name:`twitter`,categories:[`marketing`],scripts:()=>{var e;return(e=window.APP_ENV)!=null&&e.enable_twitter_conversion_tracking?[` 15 !function(e,t,n,s,u,a){e.twq||(s=e.twq=function(){s.exe?s.exe.apply(s,arguments):s.queue.push(arguments); 16 },s.version='1.1',s.queue=[],u=t.createElement(n),u.async=!0,u.src='https://static.ads-twitter.com/uwt.js', 17 a=t.getElementsByTagName(n)[0],a.parentNode.insertBefore(u,a))}(window,document,'script'); 18 twq('config','o2vtd'); 19 `]:[]}}],pl=e=>`script[data-consent-tracker="${e}"]`,ml=e=>{for(let t of fl)if(!(!t.categories.includes(e)||document.querySelector(pl(t.name))))for(let e of t.scripts()){let n=document.createElement(`script`);n.setAttribute(`data-consent-tracker`,t.name),n.setAttribute(`data-consent-category`,t.categories.join(` `)),n.text=e,document.head.appendChild(n)}},hl=e=>fl.filter(t=>t.categories.includes(e)),gl=`consent-active-categories`,_l=()=>{var e;let t=((e=document.getElementById(gl))==null?void 0:e.getAttribute(`content`))??``;return dl.filter(e=>t.includes(e))},vl=e=>{let t=document.getElementById(gl);t||(t=document.createElement(`meta`),t.id=gl,document.head.appendChild(t)),t.setAttribute(`content`,e.join(` `))},yl=()=>{let{categories:e}=lt(),t=_l(),n=dl.filter(t=>e[t]);for(let e of n)ml(e),hl(e).forEach(e=>{var t;return(t=e.onGranted)==null?void 0:t.call(e)});vl([...new Set([...t,...n])]),n.filter(e=>!t.includes(e)).length>0&&ut();let r=t.filter(t=>!e[t]);r.length>0&&(r.flatMap(hl).forEach(e=>{var t;return(t=e.onRevoked)==null?void 0:t.call(e)}),window.location.reload())},bl=({serverOwnsConsent:e})=>{let t=Et();return(0,Y.useEffect)(()=>{if(!t)return;let n=()=>yl();return e||(De(),n(),window.addEventListener(Tn,n)),window.addEventListener(tn,n),()=>{window.removeEventListener(Tn,n),window.removeEventListener(tn,n)}},[t,e]),(0,Y.useEffect)(()=>{if(!t)return;let e=`.ch2-settings.ch2-visible`,n=()=>document.querySelector(e)!==null,r=e=>{e.key===`Escape`&&n()&&Ht.closeSettings()},i=t=>{let n=document.querySelector(e);n&&!n.contains(t.target)&&Ht.closeSettings()};return window.addEventListener(`keydown`,r),document.addEventListener(`mousedown`,i),()=>{window.removeEventListener(`keydown`,r),document.removeEventListener(`mousedown`,i)}},[t]),null},xl=`new-layout-ai-credits-banner-minimized`;function Sl(){let{value:e,set:t}=or(xl,{defaultValue:!1});return{isMinimized:e,setIsMinimized:t}}var Z=e(ne(),1),Cl=5,wl=28,Tl=()=>{var e;let t=S(),{isEnterprise:n}=G(),{subscription:r}=xa(),i=(r==null||(e=r.plan)==null?void 0:e.interval)===Me.Month,a=e=>h(`/workspace/:workspaceId${e}`,t.pathname),o=a(`/dashboard`)||a(`/queries`)||a(`/drafts`)||a(`/audits`)||a(`/keyword_research`)||a(`/topic_research`)||a(`/humanizer`)||a(`/rank_tracker`)||a(`/reports/*`)||a(`/sites`)||a(`/settings/*`)&&!a(`/settings/billing_details`);return n&&o&&r?(0,X.jsx)(El,{subscription:r,isMonthly:i}):null},El=({subscription:e,isMonthly:t})=>{let{paymentIssue:n}=Er(),[r,i]=(0,Y.useState)(null),{channel:a}=xn(),o=(0,Y.useCallback)(async()=>{i(await za(a))},[a]);(0,Y.useEffect)(()=>{o()},[o]);let s=Z.default.unix(e.currentPeriodEnd),{value:c,set:l}=or(`enterprise-renewal-banner-dismissed-${e.id}-${s}`,{defaultValue:0,initializeWithValue:!0}),u=c&&Z.default.unix(c).add(Cl,`days`).isAfter((0,Z.default)()),d=(0,Y.useCallback)(()=>l((0,Z.default)().unix()),[l]);if(!r)return null;let f=e.status===qe.PastDue,p=!!r.cardBillingDetails,m=e.status==qe.Trialing,h=!!e.cancelAtPeriodEnd,g=s.diff((0,Z.default)(),`day`)<wl,_=Dl({renewedWithFailure:f,isTrialing:m,isScheduledToCancel:h,fromNow:s.fromNow()}),v=Ol({isScheduledToCancel:h,hasCard:p,renewedWithFailure:f,failureReason:n==null?void 0:n.failureReason});return u||t&&!h&&!f&&!m&&p?null:f||g&&h||g&&(!p||m)?(0,X.jsx)(hr,{color:f?`warning`:`info`,title:_,variant:`banner`,description:v,closeIcon:!f,onClose:d,children:(0,X.jsx)(ir,{children:(0,X.jsx)(Cr,{size:`xsmall`,variant:`secondary`})})}):null},Dl=({renewedWithFailure:e,isTrialing:t,isScheduledToCancel:n,fromNow:r})=>e?w._(`Your renewal is overdue:`,null,{hk:`3D4VOq`,project:`billing`}):t&&!n?w._(`Your trial will end and renew as a paid plan {when}:`,[w._param(`when`,r)],{hk:`2SKHrJ`,project:`billing`}):n?t?w._(`Your trial will expire {when}:`,[w._param(`when`,r)],{hk:`3RILwy`,project:`billing`}):w._(`Your plan will expire {when}:`,[w._param(`when`,r)],{hk:`NCjDB`,project:`billing`}):w._(`Your plan will be renewed {when}:`,[w._param(`when`,r)],{hk:`20fcoY`,project:`billing`}),Ol=({isScheduledToCancel:e,hasCard:t,renewedWithFailure:n,failureReason:r})=>e?w._(`Contact our team to get a renewal quote.`,null,{hk:`3QNUWN`,project:`billing`}):t?n?r===Vt.CardExpired?w._(`The previously used card has expired or contact our team to pay via invoice.`,null,{hk:`3jWTNN`,project:`billing`}):r===Vt.InsufficientFunds?w._(`The card has insufficient funds to complete the purchase or contact our team to pay via invoice.`,null,{hk:`195eq1`,project:`billing`}):w._(`Your card was declined. Please update your payment method or contact our team to pay via invoice.`,null,{hk:`3EvIBa`,project:`billing`}):w._(`Ensure sufficient funds on your attached card or contact our team to pay via invoice.`,null,{hk:`4bWZBq`,project:`billing`}):w._(`Attach a card via Settings or contact our team to pay via invoice.`,null,{hk:`2k8nAf`,project:`billing`}),kl=()=>{let e=S(),t=t=>h(`/workspace/:workspaceId${t}`,e.pathname),{isEnterprise:n}=G(),r=t(`/settings/invoices`);return n||!r?null:(0,X.jsx)(Al,{})},Al=()=>{let{paymentIssue:e}=Er(),t=K();return!e||e.status===dn.Cancelled?null:e.status===dn.PastDue?(0,X.jsx)(jl,{reason:e.failureReason,isCtaButtonEnabled:t}):null},jl=({reason:e,isCtaButtonEnabled:t})=>{let n=N(),r=t?T._(`Update your card details so we could retry the charge`,null,{hk:`3QYFnS`,project:`billing`}):T._(`Contact organization owner or admin to check card details`,null,{hk:`281hxr`,project:`billing`});return(0,X.jsx)(hr,{color:`warning`,title:T._(`Payment error:`,null,{hk:`Cdcfv`,project:`billing`}),variant:`banner`,description:Ml(e),children:(0,X.jsx)(ir,{children:(0,X.jsx)(b,{content:r,children:(0,X.jsx)(L,{to:n(`/settings/billing_details`),size:`xsmall`,variant:`secondary`,disabled:!t,children:w._(`Update payment method`,null,{hk:`4BcWcW`,project:`billing`})})})})})},Ml=e=>{switch(e){case Vt.CardExpired:return w._(`The previously used card has expired.`,null,{hk:`1ASiUQ`,project:`billing`});case Vt.InsufficientFunds:return w._(`The card has insufficient funds to complete the purchase.`,null,{hk:`zYkU4`,project:`billing`});default:return w._(`There was a problem with the payment for your subscription`,null,{hk:`s2Jzw`,project:`billing`})}},Nl=({bannerRoutes:e=[],toolRoutes:t=[]})=>{let n=S(),r=e.some(e=>h(`/workspace/:workspaceId${e}`,n.pathname)),i=t.some(e=>h(`/workspace/:workspaceId${e}`,n.pathname));return{showBanner:r||i,showOnTool:i}},Pl=[`/settings/*`],Fl=()=>{let{isFreemium:e}=G(),{showBanner:t,showOnTool:n}=Nl({bannerRoutes:Pl});return{showBanner:e&&t,showOnTool:n}},Il=()=>{let{showBanner:e}=Fl();return e?(0,X.jsx)(Ll,{}):null},Ll=()=>{var e;let{showOnTool:t}=Fl(),{previousSubscription:n}=Va(),r=Gn(n==null||(e=n.plan)==null?void 0:e.id);return(0,X.jsx)(hr,{color:`danger`,variant:`banner`,description:Rl(r,t),children:(0,X.jsx)(ir,{children:(0,X.jsx)(Ua,{children:e=>(0,X.jsx)(L,{to:e,color:`secondary`,size:`xsmall`,children:w._(`Start subscription now`,null,{hk:`3wKSlw`,project:`billing`})})})})})},Rl=(e,t)=>t?e?w._(`You are in a read-only mode because your free trial has expired. Upgrade your plan to unlock this feature.`,null,{hk:`twD4N`,project:`billing`}):w._(`You are in a read-only mode because your subscription has expired. Upgrade your plan to unlock this feature.`,null,{hk:`juFcx`,project:`billing`}):e?w._(`Your free trial has expired. Choose one of the plans.`,null,{hk:`3JyLZQ`,project:`billing`}):w._(`Your subscription has expired. Choose one of the plans.`,null,{hk:`yMDRk`,project:`billing`}),zl=()=>{let{isOnTrial:e,loading:t,completed:n,showOnboarding:r}=Wa(),{contentEditorDone:i,loading:a}=Ga();return{canSeeTrialDashboard:e&&!(n||i),loading:t||a,showOnboarding:r}},Bl=({totalChecked:e,totalTasks:t,className:n})=>(0,X.jsx)(`span`,{className:n,children:w._({"*":{"*":`{completed} of {total} complete`}},[w._param(`completed`,e,[0,e]),w._param(`total`,t,[0,t])],{hk:`1qts7Z`,project:`onboarding`})});E();var Vl=44,Hl=6,Ul=({percent:e,size:t=Vl,strokeWidth:n=Hl,trackClassName:r=`stroke-gray-20`,progressClassName:i=`stroke-green-60`,labelClassName:a=`text-gray-160 font-semibold`})=>{let o=(t-n)/2-1,s=2*Math.PI*o,c=Math.min(Math.max(e,0),100),l=s*(1-c/100),u=t/2;return(0,X.jsxs)(`span`,{className:`relative grid shrink-0 place-items-center`,style:{width:t,height:t}
19,children:[(0,X.jsxs)(`svg`,{viewBox:`0 0 ${t} ${t}`,className:`absolute inset-0 size-full -rotate-90`,children:[(0,X.jsx)(`circle`,{cx:u,cy:u,r:o,fill:`none`,strokeWidth:n,className:r}),(0,X.jsx)(`circle`,{cx:u,cy:u,r:o,fill:`none`,strokeWidth:n,strokeLinecap:`round`,strokeDasharray:s,strokeDashoffset:l,className:i,style:{transition:`stroke-dashoffset 500ms ease`}})]}),(0,X.jsxs)(`span`,{className:D(`text-[10px] tabular-nums leading-none`,a),children:[Math.round(c),`%`]})]})};E();var Wl={background:`rgba(0, 0, 0, 0.7)`,borderColor:`rgba(255, 255, 255, 0.14)`,boxShadow:`0 8px 24px rgba(0, 0, 0, 0.35)`},Gl=({variant:e=`default`,totalChecked:n,totalTasks:r,className:i,...a})=>{let o=e===`success`,s=r>0?n/r*100:0;return(0,X.jsxs)(`button`,{type:`button`,className:D(`flex w-full items-center gap-base text-left`,`rounded-full border border-solid px-md py-sm`,`backdrop-blur-[2px] transition-[transform,filter] duration-200`,`transform-gpu [backface-visibility:hidden]`,`hover:brightness-125`,i),style:Wl,...a,children:[o?(0,X.jsx)(`span`,{className:`grid size-[40px] shrink-0 place-items-center rounded-full bg-green-60`,children:(0,X.jsx)(t,{Component:Ya,size:`small`,className:`text-white-base`})}):(0,X.jsx)(Ul,{percent:s,size:42,trackClassName:`stroke-[rgba(255,255,255,0.15)]`,labelClassName:`text-white-base font-bold`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:`text-sm font-bold tracking-tight text-white-base`,children:o?w._(`All set!`,null,{hk:`1Euzb6`,project:`onboarding`}):w._(`Get started`,null,{hk:`2xGRGA`,project:`onboarding`})}),(0,X.jsx)(Bl,{totalChecked:o?r:n,totalTasks:r,className:D(`text-xs font-medium`,o?`text-green-40`:`text-gray-60`)})]})]})},Kl=({totalChecked:e,totalTasks:t,onDismiss:n})=>(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-[64px] flex justify-center`,children:(0,X.jsx)(Ja,{active:!0,config:{elementCount:30,spread:60}})}),(0,X.jsx)(Gl,{variant:`success`,onClick:n,"aria-label":T._(`Dismiss onboarding`,null,{hk:`lCkAf`,project:`onboarding`}),totalChecked:e,totalTasks:t})]}),ql=8e3,Jl=(e,t)=>{let n=(0,Y.useRef)(null),[r,i]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{if(t)return;let r=n.current;if(n.current=e,!(r===!1&&e))return;i(!0);let a=setTimeout(()=>i(!1),ql);return()=>clearTimeout(a)},[e,t]),{celebrating:r,dismiss:(0,Y.useCallback)(()=>i(!1),[])}},Yl=()=>{let{completed:e,totalChecked:t,totalTasks:n,loading:r,onboardingEligible:i}=Wa(),{celebrating:a,dismiss:o}=Jl(e,r);return!i||!a?null:(0,X.jsx)(`div`,{className:`fixed bottom-0 left-0 z-[60] flex flex-col justify-end p-md max-md:hidden`,style:{width:248},children:(0,X.jsx)(Kl,{totalChecked:t,totalTasks:n,onDismiss:o})})},Xl=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M7.13515 11.189L3.3304 4.38052C2.89291 3.59765 2.67417 3.20621 2.71103 2.88573C2.7432 2.60611 2.8917 2.353 3.1201 2.18852C3.38188 2 3.83029 2 4.72711 2H6.96193C7.29523 2 7.46187 2 7.61135 2.04813C7.74362 2.09073 7.86556 2.16042 7.96939 2.25276C8.08674 2.35712 8.17132 2.5007 8.3405 2.78788L12.0001 9L15.6597 2.78788C15.8289 2.5007 15.9135 2.35712 16.0308 2.25276C16.1347 2.16042 16.2566 2.09073 16.3889 2.04813C16.5383 2 16.705 2 17.0383 2H19.2731C20.1699 2 20.6183 2 20.8801 2.18852C21.1085 2.353 21.257 2.60611 21.2892 2.88573C21.326 3.20621 21.1073 3.59765 20.6698 4.38052L16.8651 11.189M10.5001 14L12.0001 13V18M10.7501 18H13.2501M16.5963 10.9038C19.1347 13.4422 19.1347 17.5578 16.5963 20.0962C14.0579 22.6346 9.94232 22.6346 7.40391 20.0962C4.8655 17.5578 4.8655 13.4422 7.40391 10.9038C9.94231 8.3654 14.0579 8.3654 16.5963 10.9038Z`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),Zl=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M16 4C16.93 4 17.395 4 17.7765 4.10222C18.8117 4.37962 19.6204 5.18827 19.8978 6.22354C20 6.60504 20 7.07003 20 8V17.2C20 18.8802 20 19.7202 19.673 20.362C19.3854 20.9265 18.9265 21.3854 18.362 21.673C17.7202 22 16.8802 22 15.2 22H8.8C7.11984 22 6.27976 22 5.63803 21.673C5.07354 21.3854 4.6146 20.9265 4.32698 20.362C4 19.7202 4 18.8802 4 17.2V8C4 7.07003 4 6.60504 4.10222 6.22354C4.37962 5.18827 5.18827 4.37962 6.22354 4.10222C6.60504 4 7.07003 4 8 4M9 15L11 17L15.5 12.5M9.6 6H14.4C14.9601 6 15.2401 6 15.454 5.89101C15.6422 5.79513 15.7951 5.64215 15.891 5.45399C16 5.24008 16 4.96005 16 4.4V3.6C16 3.03995 16 2.75992 15.891 2.54601C15.7951 2.35785 15.6422 2.20487 15.454 2.10899C15.2401 2 14.9601 2 14.4 2H9.6C9.03995 2 8.75992 2 8.54601 2.10899C8.35785 2.20487 8.20487 2.35785 8.10899 2.54601C8 2.75992 8 3.03995 8 3.6V4.4C8 4.96005 8 5.24008 8.10899 5.45399C8.20487 5.64215 8.35785 5.79513 8.54601 5.89101C8.75992 6 9.03995 6 9.6 6Z`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),Ql=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M22 22L20.5 20.5M22 10H2M22 12V8.2C22 7.0799 22 6.51984 21.782 6.09202C21.5903 5.7157 21.2843 5.40974 20.908 5.21799C20.4802 5 19.9201 5 18.8 5H5.2C4.0799 5 3.51984 5 3.09202 5.21799C2.7157 5.40973 2.40973 5.71569 2.21799 6.09202C2 6.51984 2 7.0799 2 8.2V15.8C2 16.9201 2 17.4802 2.21799 17.908C2.40973 18.2843 2.71569 18.5903 3.09202 18.782C3.51984 19 4.0799 19 5.2 19H10.5M21.5 18C21.5 19.933 19.933 21.5 18 21.5C16.067 21.5 14.5 19.933 14.5 18C14.5 16.067 16.067 14.5 18 14.5C19.933 14.5 21.5 16.067 21.5 18Z`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),$l=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M7.5 8V9.5M16.5 8V9.5M11 12.6001C11.8 12.6001 12.5 11.9001 12.5 11.1001V8M15.2002 15.2C13.4002 17 10.5002 17 8.7002 15.2M3 7.8L3 16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27977 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3L7.8 3C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8Z`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),eu=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M4 7C4 6.06812 4 5.60218 4.15224 5.23463C4.35523 4.74458 4.74458 4.35523 5.23463 4.15224C5.60218 4 6.06812 4 7 4H17C17.9319 4 18.3978 4 18.7654 4.15224C19.2554 4.35523 19.6448 4.74458 19.8478 5.23463C20 5.60218 20 6.06812 20 7M9 20H15M12 4V20`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),tu=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2.43695 4.83157L
195.9334 11.0883C3.79482 14.0216 4.04925 18.1559 6.6967 20.8033C9.62564 23.7322 14.3744 23.7322 17.3033 20.8033C19.9508 18.1558 20.2052 14.0216 18.0666 11.0883L21.563 4.83157C21.7642 4.4717 21.9474 4.14387 22.071 3.86564C22.1971 3.58191 22.332 3.20234 22.2824 2.77132C22.2181 2.21209 21.9211 1.70586 21.4643 1.3769C21.1122 1.12336 20.7151 1.05596 20.4059 1.02761C20.1027 0.999799 19.7271 0.999828 19.3149 0.999859L16.968 0.999693C16.7111 0.99878 16.388 0.997632 16.0822 1.09613C15.8176 1.18131 15.5737 1.32069 15.3661 1.50538C15.126 1.71893 14.963 1.99788 14.8334 2.21968L12 7.02959L9.16663 2.21967C9.03703 1.99787 8.87404 1.71893 8.63391 1.50538C8.42625 1.32069 8.18237 1.18131 7.91783 1.09613C7.61195 0.997632 7.28888 0.99878 7.03199 0.999693L4.6851 0.999859C4.27284 0.999828 3.89728 0.999799 3.5941 1.02761C3.28491 1.05596 2.88776 1.12336 2.53569 1.3769C2.07889 1.70586 1.78188 2.21209 1.71755 2.77132C1.66797 3.20234 1.80288 3.58191 1.92895 3.86564C2.05258 4.14387 2.23581 4.4717 2.43695 4.83157ZM5.1017 3.00171C4.65473 3.00115 4.43124 3.00087 4.30036 3.09468C4.18616 3.17653 4.11167 3.30266 4.09513 3.44218C4.07616 3.6021 4.18431 3.79767 4.4006 4.18883L7.38536 9.58673C8.28054 8.88634 9.29816 8.41782 10.3571 8.18116L7.53399 3.39731C7.44948 3.25412 7.40723 3.18252 7.34866 3.13045C7.29684 3.08438 7.236 3.04959 7.17001 3.02829C7.09544 3.00422 7.0123 3.00412 6.84603 3.00391L5.1017 3.00171ZM16.6146 9.58673C15.7194 8.88634 14.7018 8.41782 13.6428 8.18116L16.466 3.39731C16.5505 3.25412 16.5928 3.18252 16.6513 3.13045C16.7031 3.08438 16.764 3.04959 16.83 3.02829C16.9045 3.00422 16.9877 3.00412 17.154 3.00391L18.8983 3.00171C19.3453 3.00115 19.5687 3.00087 19.6996 3.09468C19.8138 3.17653 19.8883 3.30266 19.9049 3.44218C19.9238 3.6021 19.8157 3.79767 19.5994 4.18883L16.6146 9.58673ZM12.472 12.1183C12.7971 12.2923 13.0001 12.6312 13.0001 13V17H13.25C13.8023 17 14.25 17.4477 14.25 18C14.25 18.5523 13.8023 19 13.25 19H10.75C10.1977 19 9.75 18.5523 9.75 18C9.75 17.4477 10.1977 17 10.75 17H11.0001V14.8661C10.5471 15.1282 9.96241 14.9962 9.66806 14.5547C9.3617 14.0952 9.48588 13.4743 9.94541 13.168L11.4454 12.168C11.7523 11.9634 12.1468 11.9443 12.472 12.1183Z`,fill:`currentColor`})]})),nu=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.86178 1.01695C9.06993 0.999943 9.31573 0.999973 9.56811 1L14.4319 1C14.6843 0.999973 14.9301 0.999943 15.1382 1.01695C15.3668 1.03563 15.6366 1.07969 15.908 1.21799C16.2843 1.40974 16.5903 1.7157 16.782 2.09202C16.9203 2.36345 16.9644 2.63318 16.9831 2.86178C16.9869 2.90874 16.9899 2.95762 16.9922 3.00805C17.3874 3.02081 17.7258 3.05345 18.0354 3.13639C19.4157 3.50626 20.4939 4.58445 20.8638 5.96482C21.0009 6.47647 21.0006 7.06713 21.0001 7.86252L21.0001 17.2414C21.0001 18.0464 21.0001 18.7107 20.9559 19.2519C20.91 19.814 20.8114 20.3307 20.5641 20.8161C20.1806 21.5687 19.5687 22.1806 18.8161 22.5641C18.3307 22.8114 17.814 22.91 17.2519 22.9559C16.7107 23.0001 16.0464 23.0001 15.2414 23.0001H8.75877C7.95381 23.0001 7.28946 23.0001 6.74827 22.9559C6.18617 22.91 5.66947 22.8114 5.18413 22.5641C4.43149 22.1806 3.81956 21.5687 3.43607 20.8161C3.18878 20.3307 3.09022 19.814 3.04429 19.2519C3.00007 18.7107 3.00008 18.0464 3.0001 17.2414L3.00005 7.86252C2.99962 7.06713 2.9993 6.47647 3.13639 5.96482C3.50626 4.58445 4.58445 3.50626 5.96482 3.13639C6.27431 3.05347 6.61271 3.02082 7.00784 3.00806C7.01014 2.95762 7.01311 2.90874 7.01695 2.86178C7.03563 2.63318 7.07969 2.36345 7.21799 2.09202C7.40974 1.7157 7.7157 1.40974 8.09202 1.21799C8.36345 1.07969 8.63318 1.03563 8.86178 1.01695ZM9.10899 3.54601C9 3.75992 9 4.03995 9 4.6V5H15V4.6C15 4.03995 15 3.75992 14.891 3.54601C14.7951 3.35785 14.6422 3.20487 14.454 3.10899C14.2401 3 13.9601 3 13.4 3H10.6C10.0399 3 9.75992 3 9.54601 3.10899C9.35785 3.20487 9.20487 3.35785 9.10899 3.54601ZM16.2071 13.2071C16.5976 12.8166 16.5976 12.1834 16.2071 11.7929C15.8166 11.4024 15.1834 11.4024 14.7929 11.7929L11 15.5858L9.70711 14.2929C9.31658 13.9024 8.68342 13.9024 8.29289 14.2929C7.90237 14.6834 7.90237 15.3166 8.29289 15.7071L10.2929 17.7071C10.6834 18.0976 11.3166 18.0976 11.7071 17.7071L16.2071 13.2071Z`,fill:`currentColor`})]})),ru=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M18 14.5C15.5147 14.5 13.5 16.5147 13.5 19C13.5 21.4853 15.5147 23.5 18 23.5C18.8805 23.5 19.702 23.2471 20.3957 22.81L21.2929 23.7071C21.6834 24.0976 22.3166 24.0976 22.7071 23.7071C23.0976 23.3166 23.0976 22.6834 22.7071 22.2929L21.81 21.3957C22.2471 20.702 22.5 19.8805 22.5 19C22.5 16.5147 20.4853 14.5 18 14.5ZM15.5 19C15.5 17.6193 16.6193 16.5 18 16.5C19.3807 16.5 20.5 17.6193 20.5 19C20.5 20.3807 19.3807 21.5 18 21.5C16.6193 21.5 15.5 20.3807 15.5 19Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M5.16146 3L18.8385 3C19.3657 2.99999 19.8205 2.99997 20.195 3.03057C20.5904 3.06288 20.9836 3.13419 21.362 3.32699C21.9265 3.61461 22.3854 4.07355 22.673 4.63803C22.8658 5.01641 22.9371 5.40963 22.9694 5.80498C23 6.17954 23 6.6343 23 7.16144C23 7.62456 22.6246 8 22.1614 8H1.83859C1.37545 8 1 7.62455 1 7.16141C0.999985 6.63431 0.999972 6.17952 1.03057 5.80497C1.06287 5.40963 1.13419 5.01641 1.32698 4.63803C1.6146 4.07354 2.07355 3.6146 2.63803 3.32698C3.01641 3.13419 3.40963 3.06287 3.80498 3.03057C4.17953 2.99997 4.63434 2.99998 5.16146 3Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M2.6 10C2.03995 10 1.75992 10 1.54601 10.109C1.35785 10.2049 1.20487 10.3578 1.10899 10.546C1 10.7599 1 11.0399 1 11.6V14.8385C0.999985 15.3656 0.999972 15.8205 1.03057 16.195C1.06287 16.5904 1.13419 16.9836 1.32698 17.362C1.6146 17.9265 2.07355 18.3854 2.63803 18.673C3.01641 18.8658 3.40963 18.9371 3.80498 18.9694C4.17947 19 4.63413 19 5.16115 19H10.7C10.9791 19 11.1187 19 11.2188 18.9535C11.3146 18.909 11.377 18.8538 11.4328 18.7641C11.4911 18.6704 11.5103 18.5141 11.5486 18.2015C11.9421 14.9884 14.6805 12.5 18 12.5C19.6125 12.5 21.0879 13.0872 22.224 14.0594C22.5113 14.3053 22.655 14.4283 22.7439 14.4304C22.8272 14.4324 22.8912 14.403 22.9438 14.3384C23 14.2694 23 14.0929 23 13.7399V11.6C23 11.0399 23 10.7599 22.891 10.546C22.7951 10.3578 22.6422 10.2049 22.454 10.109C22.2401 10 21.9601 10 21.4 10H2.6Z`,fill:`currentColor`})]})),iu=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.8385 2H6.16146C5.63433 1.99998 5.17954 1.99997 4.80497 2.03057C4.40963 2.06287 4.01641 2.13419 3.63803 2.32698C3.07354 2.6146 2.6146 3.07354 2.32698 3.63803C2.13419 4.01641 2.06287 4.40963 2.03057 4.80497C1.99997 5.17954 1.99998 5.63429 2 6.16142V17.8385C1.99998 18.3657 1.99997 18.8205 2.03057 19.195C2.06287 19.5904 2.13419 19.9836 2.32698 20.362C2.6146 20.9265 3.07354 21.3854 3.63803 21.673C4.01641 21.8658 4.40963 21.9371 4.80497 21.9694C5.17954 22 5.6343 22 6.16144 22H17.8386C18.3657 22 18.8205 22 19.195 21.9694C19.5904 21.9371 19.9836 21.8658 20.362 21.673C20.9265 21.3854 21.3854 20.9265 21.673 20.362C21.8658 19.9836 21.9371 19.5904 21.9694 19.195C22 18.8205 22 18.3657 22 17.8386V6.16144C22 5.6343 22 5.17954 21.9694 4.80497C21.9371 4.40963 21.8658 4.01641 21.673 3.63803C21.3854 3.07354 20.9265 2.6146 20.362 2.32698C19.9836 2.13419 19.5904 2.06287 19.195 2.03057C18.8205 1.99997 18.3657 1.99998 17.8385 2ZM8.5 8C8.5 7.44772 8.05229 7 7.5 7C6.94772 7 6.5 7.44772 6.5 8V9.5C6.5 10.0523 6.94772 10.5 7.5 10.5C8.05229 10.5 8.5 10.0523 8.5 9.5V8ZM17.5 8C17.5 7.44772 17.0523 7 16.5 7C15.9477 7 15.5 7.44772 15.5 8V9.5C15.5 10.0523 15.9477 10.5 16.5 10.5C17.0523 10.5 17.5 10.0523 17.5 9.5V8ZM12.5 7C13.0523 7 13.5 7.44772 13.5 8V11.1001C13.5 12.4524 12.3523 13.6001 11 13.6001C10.4477 13.6001 10 13.1524 10 12.6001C10 12.0478 10.4477 11.6001 11 11.6001C11.2477 11.6001 11.5 11.3478 11.5 11.1001V8C11.5 7.44772 11.9477 7 12.5 7ZM9.4073 14.4928C9.01678 14.1023 8.38361 14.1023 7.99309 14.4928C7.60257 14.8834 7.60257 15.5165 7.99309 15.9071C10.1836 18.0976 13.7168 18.0976 15.9073 15.9071C16.2978 15.5165 16.2978 14.8834 15.9073 14.4928C15.5168 14.1023 14.8836 14.1023 14.4931 14.4928C13.0836 15.9023 10.8168 15.9023 9.4073 14.4928Z`,fill:`currentColor`})]})),au=[{to:`/audits`,label:`Audit`,translatedLabel:T._(`Audit`,null,{hk:`1xCBax`,project:`common`}),icon:Zl,activeIcon:nu},{to:`/topic_research`,label:`Topic Research`,translatedLabel:T._(`Topic Research`,null,{hk:`4Aps23`,project:`common`}),icon:$a,activeIcon:ro},{to:`/keyword_research`,label:`Keyword Research`,translatedLabel:T._(`Keyword Research`,null,{hk:`3mknqg`,project:`common`}),requireAccess:`domain_planner`,icon:eu,activeIcon:so},{to:`/queries`,label:`SERP Analyzer`,translatedLabel:T._(`SERP Analyzer`,null,{hk:`208QjX`,project:`common`}),hideOnTrial:!0,icon:Ql,activeIcon:ru},{to:`/rank_tracker`,label:`Rank Tracker`,translatedLabel:T._(`Rank Tracker`,null,{hk:`1u6NVW`,project:`common`}),icon:Xl,activeIcon:tu},{to:`/humanizer`,label:`AI Humanizer`,translatedLabel:T._(`AI Humanizer`,null,{hk:`meYjp`,project:`common`}),icon:$l,activeIcon:iu},{to:`/ai_tracker`,label:`AI Tracker`,translatedLabel:T._(`AI Tracker`,null,{hk:`35BAEb`,project:`common`}),hideOnToolsSidebar:!0,keywords:[`ai visibility`],translatedKeywords:T._(`ai visibility`,null,{hk:`14bstC`,project:`common`})},{to:`/ai_volatility`,label:`AI Volatility`,translatedLabel:T._(`AI Volatility`,null,{hk:`WJnOH`,project:`common`}),keywords:[`ai volatility`],translatedKeywords:T._(`ai volatility`,null,{hk:`2ar2Rc`,project:`common`}),hideOnBrandedWorkspaces:!0,icon:Qa,activeIcon:Qa},{to:`/drafts`,label:`Content Editor`,translatedLabel:T._(`Content Editor`,null,{hk:`385EIw`,project:`common`}),keywords:[`write`],translatedKeywords:T._(`write`,null,{hk:`4CVZMr`,project:`common`}),hideOnToolsSidebar:!0},{to:`/sites`,label:`Sites`,translatedLabel:T._(`Sites`,null,{hk:`2vyBiX`,project:`common`}),hideOnToolsSidebar:!0,hideOnCommandMenu:!0}],ou=au.filter(e=>!e.hideOnToolsSidebar),su=(0,Y.createContext)({usedCoupons:[],isCouponUsed:()=>!1});su.displayName=`UsedCouponsContext`;var cu=({children:e})=>{let t=M(),{data:n,updateQuery:r}=sn({variables:{organizationId:t}}
19);nt({variables:{organizationId:t},onData:({data:e})=>{var t;let n=(t=e.data)==null?void 0:t.usedCouponGranted;n&&r(e=>{let t=(e==null?void 0:e.usedCoupons)??[];return t.some(e=>e.id===n.id)?e:{usedCoupons:[...t,n]}})}});let i=(0,Y.useMemo)(()=>(n==null?void 0:n.usedCoupons)??[],[n==null?void 0:n.usedCoupons]),a=(0,Y.useCallback)(e=>i.some(t=>t.couponId===e),[i]);return(0,X.jsx)(su,{value:(0,Y.useMemo)(()=>({usedCoupons:i,isCouponUsed:a}),[i,a]),children:e})},lu=e=>{let{isCouponUsed:t}=(0,Y.use)(su);return t(e)};B` 20 fragment UsedCoupon on UsedCoupon { 21 id 22 couponId 23 campaignId 24 insertedAt 25 } 26 27 query UsedCoupons($organizationId: ID!) { 28 usedCoupons(organizationId: $organizationId) { 29 ...UsedCoupon 30 } 31 } 32 33 subscription UsedCouponGranted($organizationId: ID!) { 34 usedCouponGranted(organizationId: $organizationId) { 35 ...UsedCoupon 36 } 37 } 38`;var uu=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10`,clipRule:`evenodd`})]})),du=P({category:`settings`,name:`marketing_consent_banner_accepted`}),fu=P({category:`settings`,name:`marketing_consent_banner_dismissed`}),pu=P({category:`settings`,name:`marketing_consent_banner_shown`}),mu=({setConsent:e,loading:t})=>{let{send:n}=F(),{shouldHideSidebar:r}=Ra(),{isEnterprise:i}=G(),{formatPrice:a}=co(),s={left:r?16:260},c=lu(`VG-MARKETING-CONSENT-10`),l=c||i?T._(`Stay ahead in AI and Google search ð`,null,{hk:`1To352`,project:`settings`}):T._(`Get ahead in AI search â and save {amount} doing it.`,[T._param(`amount`,a(1e3))],{hk:`4s7UF5`,project:`settings`}),u=c||i?T._(`Early access to data studies, AI search strategies, and product updates â max 3 emails a month. No filler.`,null,{hk:`2oikij`,project:`settings`}):w._(`Early access to data studies, AI search strategies, and product updates â max 3 emails a month. Agree below and claim your vouchers via our {=m2}.`,[w._implicitParam(`=m2`,(0,X.jsx)(z,{theme:`dark`,to:`https://surferseo.com`,children:w._(`Voucher Giveaway`,null,{hk:`2pS23l`,project:`settings`})}))],{hk:`124Ay6`,project:`settings`});return(0,X.jsx)(`div`,{className:`fixed bottom-base z-[140] flex flex-col pr-md transition-all duration-300 ease-in-out`,style:s,children:(0,X.jsxs)(`div`,{className:`flex min-h-[48px] max-w-[377px] flex-col items-center justify-between gap-sm rounded-lg bg-gray-160 p-base text-white-base shadow-lg`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-sm font-semibold`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,X.jsx)(`div`,{className:`text-balance text-lg`,children:l}),(0,X.jsx)(o,{icon:ai,size:`small`,variant:`text`,color:`secondary`,className:`text-white-base hover:text-white-base`,onClick:()=>{e(!1),n(fu)},"aria-label":T._(`Close banner`,null,{hk:`2xpdDB`,project:`settings`})})]}),(0,X.jsx)(`div`,{className:`text-md font-normal`,children:u})]}),(0,X.jsx)(o,{disabled:t,className:`mt-base w-full`,variant:`landing-page`,rightIcon:!0,icon:uu,size:`small`,onClick:()=>{e(!0),n(du)},children:w._(`Sign me up`,null,{hk:`3OPAZ7`,project:`settings`})})]})})},hu=new Date(`2025-07-09`),gu=()=>{var e,t,n;let{data:r,loading:i}=Ft(),{isChurned:a}=G(),{isWorkspaceActive:o}=q(),{send:s}=F(),[c,{loading:l}]=ot(),u=N(),d=e=>{c({variables:{status:e},awaitRefetchQueries:!0,refetchQueries:[He]})},{showOnboarding:f}=zl(),{pathname:m}=S(),h=au.map(e=>e.to),g=!!p(u(`/dashboard`)),_=h.includes(m),v=(0,Y.useMemo)(()=>{var e;if(!(!(r==null||(e=r.myMarketingConsent)==null)&&e.updatedAt))return!1;let t=(0,Z.default)(r.myMarketingConsent.updatedAt),n=(0,Z.default)(),i=t.add(1,`month`);return r.myMarketingConsent.status===!1&&n.isAfter(i)},[r==null||(e=r.myMarketingConsent)==null?void 0:e.updatedAt,r==null||(t=r.myMarketingConsent)==null?void 0:t.status]),y=(0,Y.useMemo)(()=>{var e;return!(r==null||(e=r.myMarketingConsent)==null)&&e.updatedAt?(0,Z.default)(r.myMarketingConsent.updatedAt).isBefore(hu):!1},[r==null||(n=r.myMarketingConsent)==null?void 0:n.updatedAt]),ee=(0,Y.useMemo)(()=>!(r!=null&&r.myMarketingConsent)||y||v,[r==null?void 0:r.myMarketingConsent,y,v]),b=!a&&(_||g)&&!f&&o&&!i&ⅇreturn(0,Y.useEffect)(()=>{b&&s(pu)},[b,s]),b?(0,X.jsx)(mu,{loading:l,setConsent:d}):null};B` 39 query SettingsOverlay { 40 myMarketingConsent { 41 id 42 status 43 updatedAt 44 } 45 } 46 47 mutation SetMarketingConsentFromBanner($status: Boolean!) { 48 setMyMarketingConsent(status: $status) { 49 id 50 status 51 } 52 } 53`;var _u=P({category:`language`,name:`banner_seen`,payloadSchema:U({suggested_locale:V()})}),vu=P({category:`language`,name:`banner_switch_accepted`,payloadSchema:U({suggested_locale:V()})}),yu=()=>
53{let[e]=I(`settings_language_de`),t=(0,Y.useMemo)(()=>_(navigator.languages,[`en-US`,...e?[`de-DE`]:[],`fr-FR`,`pl-PL`])??`en-US`,[e]);return{locale:t,localeDisplayName:v[t].displayName}},bu=`language-banner-dismissed`,xu=()=>{let{showBanner:e}=Nl({bannerRoutes:[`/dashboard`]});return e?(0,X.jsx)(Su,{}):null},Su=()=>{let{locale:e,localeDisplayName:t}=yu(),{value:n,set:r}=or(bu),{preferredLocale:i,setPreferredLocale:a}=lo(),{send:s}=F(),c=e!==null&&e!==`en-US`&&i===null&&!n,l=(0,Y.useRef)(!1);return(0,Y.useEffect)(()=>{c&&!l.current&&(l.current=!0,s(_u,{suggested_locale:e}))},[c,e,s]),c?(0,X.jsx)(hr,{color:`info`,variant:`banner`,description:T._(`Surfer is now available in {languageName}. You can change the language anytime in your profile settings.`,[T._param(`languageName`,t)],{hk:`S2ir9`,project:`common`}),closeIcon:!0,onClose:()=>{r(!0)},children:(0,X.jsx)(ir,{children:(0,X.jsx)(o,{variant:`secondary`,size:`xsmall`,onClick:()=>{e&&(s(vu,{suggested_locale:e}),a(e),window.location.reload())},children:w._(`Switch to {languageName}`,[w._param(`languageName`,t)],{hk:`4Fczh1`,project:`common`})})})}):null},Cu=e=>`label`in e,wu=`recent_commands`,Tu=(0,Y.createContext)(void 0);Tu.displayName=`CommandMenuContext`;var Eu=({children:e,closeCombobox:t})=>{let n=M(),{user:r}=ze(),{value:i=[],set:a}=or(`${wu}_${n}_${r.id}`,{defaultValue:[],initializeWithValue:!0}),o=i.slice(0,3),s=e=>{a([e,...i.filter(t=>t.value!==e.value)].slice(0,10))},[c,l]=(0,Y.useState)(``);return(0,X.jsx)(Tu,{value:{search:c,setSearch:l,closeMenu:t,shouldHide:(0,Y.useCallback)(e=>!c&&!o.some(t=>t.value===e),[c,o]),recentCommands:o,setRecentCommands:s},children:e})},Q=()=>{let e=(0,Y.use)(Tu);if(e===void 0)throw Error(`useCommandMenu must be used within a CommandMenuProvider`);return e},Du=P({category:`command_menu`,name:`searched`,payloadSchema:U({search_query:V()})}),Ou=({loading:e})=>{let{search:n,setSearch:i}=Q(),{send:a}=F(),o=Rr(e=>{e.trim()&&a(Du,{search_query:e})},300);return(0,Y.useEffect)(()=>{requestAnimationFrame(()=>{let e=document.querySelector(`[cmdk-list]`);e&&(e.scrollTop=0)})},[n]),(0,X.jsxs)(`div`,{className:`flex items-center gap-xs py-xs`,children:[(0,X.jsx)(t,{size:`base`,className:`text-white-80`,Component:mo}),(0,X.jsx)(mi,{className:`w-full border-none bg-black text-md text-white-base outline-none outline-0 placeholder:text-md placeholder:text-white-60`,value:n,onValueChange:e=>{i(e),o(e)},placeholder:T._(`Search...`,null,{hk:`dKJZX`,project:`common`})}),e&&(0,X.jsx)(r,{size:`small`,className:`text-white-60`})]})},ku={[rt.ContentEditor]:`Content Editor`,[rt.Audit]:`Audit`,[rt.SerpAnalyzer]:`SERP Analyzer`},Au={[rt.ContentEditor]:T._(`Content Editor`,null,{hk:`16sAJD`,project:`common`}),[rt.Audit]:T._(`Audit`,null,{hk:`3c3Ci1`,project:`common`}),[rt.SerpAnalyzer]:T._(`SERP Analyzer`,null,{hk:`mDyuk`,project:`common`})},ju=Object.fromEntries(Object.entries(ku).map(([e,t])=>[t,e])),Mu=e=>ju[e],Nu=(e,t)=>{if(e)return e;if(t===ku[rt.ContentEditor])return T._(`Untitled`,null,{hk:`2u927a`,project:`common`})},Pu=P({category:`command_menu`,name:`select`,payloadSchema:U({value:V()})}),Fu=({title:e,label:t,date:n,translatedCategory:r})=>(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e||t}),(0,X.jsxs)(`div`,{className:`flex items-center gap-sm text-xs text-white-40`,children:[e&&t&&(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),n&&(0,X.jsx)(`span`,{className:`shrink-0`,children:Ta((0,Z.default)(n),`date`)}),r&&(0,X.jsx)(`span`,{className:`shrink-0 whitespace-nowrap text-gray-70`,children:r})]})]}),$=(0,Y.forwardRef)(({children:e,category:t,translatedCategory:n,to:r,onClick:i,hidden:a=!1,canBeRecent:o=!0,label:s,title:c,date:l,keywords:u,translatedKeywords:d,...f},p)=>{let{send:m}=F(),{closeMenu:h,setRecentCommands:g}=Q(),_=Yn(),v=(0,Y.useMemo)(()=>{let e=d?d.split(`,`).map(e=>e.trim()).filter(Boolean):[];return br([...u??[],...e])},[u,d]);if(a)return null;let y=!e&&s;return(0,X.jsx)(di,{onSelect:()=>{if(r?_(r):i==null||i(),m(Pu,{value:`${t}:${f.value}`}),h(),o){let e=f.value||``;g(s&&r&&t?{value:e,to:r,category:t,label:s,date:l,title:c}:{value:e})}},className:`flex items-center gap-sm rounded-md border border-transparent px-md py-sm text-gray-60 aria-[selected=true]:bg-gray-140 aria-[selected=true]:text-white-base`,ref:p,keywords:v,...f,children:y?(0,X.jsx)(Fu,{title:Nu(c,t),label:s,date:l,translatedCategory:n}
53):(0,X.jsxs)(X.Fragment,{children:[e,n&&(0,X.jsx)(`span`,{className:`whitespace-nowrap text-gray-70`,children:n})]})})});$.displayName=`CommandItem`;var Iu=({items:e,basePath:t,resourceId:n,category:r,translatedCategory:i})=>{let{shouldHide:a}=Q();return(0,X.jsx)(X.Fragment,{children:e.map(e=>{let o=e.segment?`/${e.segment}`:``;return(0,X.jsx)($,{value:e.value,keywords:e.keywords,translatedKeywords:e.translatedKeywords,to:`${t}/${n}${o}`,category:r,translatedCategory:i,hidden:a(e.value),children:e.displayLabel},e.intentKey)})})},Lu=()=>{var e;let{featureFlags:t}=vr(),{currentWorkspace:n}=q(),r=n==null||(e=n.brandedWorkspaceAiTrackerProject)==null?void 0:e.id,i=(0,Y.useMemo)(()=>xo.filter(e=>!e.requireFeatureFlag||(t==null?void 0:t[e.requireFeatureFlag])),[t]);return r?(0,X.jsx)(Iu,{items:i,basePath:`/ai_tracker`,resourceId:r,category:`AI Tracker`,translatedCategory:T._(`AI Tracker`,null,{hk:`DhR9z`,project:`common`})}):null},Ru=`Sites`,zu=T._(`Sites`,null,{hk:`3Bcym4`,project:`common`}),Bu=({sites:e})=>{let{connected:t}=Xa(),{handleConnectSearchConsole:n}=ko(),{shouldHide:r}=Q();return(0,X.jsxs)(X.Fragment,{children:[!t&&(0,X.jsx)($,{value:`Connect Google Search Console`,onClick:n,category:`Sites`,translatedCategory:zu,hidden:r(`Connect Google Search Console`),children:w._(`Connect Google Search Console`,null,{hk:`349S0g`,project:`common`})},`connect-google-search-console`),(0,X.jsx)($,{hidden:r(`Sites`),to:`/sites`,value:`sites`,category:Ru,translatedCategory:zu,children:w._(`Sites`,null,{hk:`d9NMa`,project:`common`})}),e.length>0&&e.map(e=>(0,X.jsxs)($,{keywords:[`www.`,`https://www.${e.gscSite.displayUrl}`],value:e.gscSite.displayUrl,category:`Sites`,translatedCategory:zu,hidden:r(e.gscSite.displayUrl),to:`/sites/${e.id}`,children:[(0,X.jsx)(Ao,{url:e.gscSite.displayUrl}),(0,X.jsx)(`div`,{className:`truncate`,children:e.gscSite.displayUrl})]},`${e.id}-${e.gscSite.googleSiteUrl}`))]})},Vu=()=>{let{availableDomains:e}=Ma(),{canCreateAnotherProject:t}=ka(),{configureSite:n}=Aa(),r=Yn(),i=wa(),{isFreemium:a}=G(),{shouldHide:o}=Q(),s=(e,a)=>{if(!(!t&&!i)){if(!t){r(`/billing/subscription/checkout`);return}n(e,a)}};return e.length?(0,X.jsx)(X.Fragment,{children:e.map(e=>(0,X.jsxs)($,{canBeRecent:!1,onClick:()=>{s(e.googleSiteUrl,e.credentialsId)},hidden:o(e.isDomainProperty?`${e.credentialsId}-${e.domain}`:`${e.credentialsId}-${e.url}`),keywords:[e.domain,e.url],value:e.isDomainProperty?`${e.credentialsId}-${e.domain}`:`${e.credentialsId}-${e.url}`,category:Ru,translatedCategory:zu,children:[(0,X.jsx)(Ao,{url:e.domain}),(0,X.jsx)(`div`,{className:`truncate`,children:e.isDomainProperty?e.domain:e.url}),(0,X.jsx)(Nr,{className:`order-1 ml-auto !text-white-80`,variant:`outline`,color:`secondary`,children:t?w._(`Not configured`,null,{hk:`3aQ0pQ`,project:`common`}):a?w._(`Start subscription to configure`,null,{hk:`3LxFEG`,project:`common`}):w._(`Upgrade plan to configure`,null,{hk:`1XRMdk`,project:`common`})})]},`${e.credentialsId}-${e.googleSiteUrl}`))}):null},Hu=()=>{let e=j(),t=ln(),n=Po(),{shouldHide:r}=Q(),{sortedActiveOrganizations:i}=xe(t),a=i.filter(t=>t.id!==(e==null?void 0:e.id)),o=(0,Y.useCallback)(e=>{n(e,`/dashboard`)},[n]);return(0,X.jsx)(X.Fragment,{children:a.map(e=>{let{label:t,displayLabel:n}=jo(e);return(0,X.jsxs)($,{value:t,keywords:[t,`switch`,`organization`],translatedKeywords:T._(`switch, organization`,null,{hk:`3vYUd9`,project:`common`}),hidden:r(t),category:`Organization`,translatedCategory:T._(`Organization`,null,{hk:`3xnqtI`,project:`common`}),onClick:()=>{o(e.id)},children:[(0,X.jsx)(Mo,{organization:e}),n]},e.id)})})},Uu=()=>({signOut:()=>{Xe(),Cn==null||Cn.logout().then(e=>{e.success&&window.location.assign(window.location.origin)})}}),Wu=()=>{let{user:e}=Pe(),{signOut:t}=Uu(),{shouldHide:n}=Q(),r=S(),i=x();return(0,X.jsxs)(X.Fragment,{children:[!!e&&(0,X.jsx)($,{hidden:n(`Sign Out`),onClick:()=>t(),value:`Sign Out`,category:`Other`,translatedCategory:T._(`Other`,null,{hk:`RlaH1`,project:`common`}),children:w._(`Sign Out`,null,{hk:`3dG3Eq`,project:`common`})}),(0,X.jsx)($,{hidden:n(`Home`),value:`Home`,to:`/`,children:w._(`Home`,null,{hk:`28MjKc`,project:`common`})}
53),(0,X.jsx)($,{hidden:n(`Activity Log`),value:`Activity Log`,keywords:[`history`,`changes`],translatedKeywords:T._(`history, changes, activity`,null,{hk:`2TKVYG`,project:`common`}),to:`/activity_log`,children:w._(`Activity Log`,null,{hk:`453EPP`,project:`common`})}),(0,X.jsx)($,{hidden:n(`Inbox`),value:`Inbox`,keywords:[`rank drops`,`new recommendation`,`notifications`],translatedKeywords:T._(`rank drops, new recommendation, notifications`,null,{hk:`4nl4Vi`,project:`common`}),onClick:()=>{i(r.pathname,{state:{openInbox:!0}})},children:w._(`Inbox`,null,{hk:`1nWDor`,project:`common`})})]})},Gu=`Support & Resources`,Ku=T._(`Support & Resources`,null,{hk:`dwiMS`,project:`common`}),qu=()=>{let{shouldHide:e}=Q(),{isEnterprise:t}=G(),{openSupport:n}=Fo();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{keywords:[`help`,`support`,`message`,`contact`,`questions`,`feedback`],translatedKeywords:T._(`help, support, message, contact, questions, feedback`,null,{hk:`1Jx2yf`,project:`common`}),onClick:n,value:`Send us a message`,category:Gu,translatedCategory:Ku,hidden:e(`Send us a message`),children:w._(`Send us a message`,null,{hk:`2Q3aFk`,project:`common`})},`send-us-a-message`),(0,X.jsx)($,{hidden:e(`What's New at Surfer?`),keywords:[`news`],translatedKeywords:T._(`news`,null,{hk:`4bridJ`,project:`common`}),onClick:()=>{window.open(`https://surferseo.com/category/release-notes/`,`_blank`)},value:`What's New at Surfer?`,category:Gu,translatedCategory:Ku,children:w._(`What's New at Surfer?`,null,{hk:`1D272F`,project:`common`})},`whats-new-at-surfer`),(0,X.jsx)($,{hidden:e(`Ask the Community`),keywords:[`community`],translatedKeywords:T._(`community`,null,{hk:`4pEISj`,project:`common`}),onClick:()=>{window.open(`https://www.facebook.com/groups/seosurfers/`,`_blank`)},value:`Ask the Community`,category:Gu,translatedCategory:Ku,children:w._(`Ask the Community`,null,{hk:`4aKiyF`,project:`common`})},`ask-the-community`),(0,X.jsx)($,{hidden:e(`Join Surfer Academy`),keywords:[`academy`],translatedKeywords:T._(`academy`,null,{hk:`1lrtTM`,project:`common`}),onClick:()=>{window.open(`https://surferseo.com/academy/`,`_blank`)},value:`Join Surfer Academy`,category:Gu,translatedCategory:Ku,children:w._(`Join Surfer Academy`,null,{hk:`1hl3Lm`,project:`common`})},`academy`),t&&(0,X.jsx)($,{hidden:e(`Contact Customer Success`),keywords:[`sales`],translatedKeywords:T._(`sales`,null,{hk:`2YtQCd`,project:`common`}),onClick:()=>{window.open(`https://calendly.com/surfer-1/surfer-enterprise-call`,`_blank`)},value:`Contact Customer Success`,category:`Support & Resources`,translatedCategory:Ku,children:w._(`Contact Customer Success`,null,{hk:`4AHqML`,project:`common`})},`contact-customer-success`)]})},Ju=T._(`General`,null,{hk:`1mcgeY`,project:`settings`}),Yu=T._(`Usage`,null,{hk:`4ckmyy`,project:`settings`}),Xu=()=>{let e=K(),{isFreemium:t}=G(),n=j(),r=(n==null?void 0:n.permissions.canManageOrganizationMembers)??!1,{isBrandedWorkspace:i,isPlaygroundWorkspace:a,isWorkspaceInactive:o,isWorkspaceProcessing:s,isWorkspaceReadyForActivation:c}=q(),{brand:l}=Ro(),[u]=I(`webflow_export`),d=kt(),f=s||c,p=i&&e,m=a&&!l;return[{title:`Organization`,translatedTitle:T._(`Organization`,null,{hk:`3q886U`,project:`settings`}),items:[{to:`/settings/organization`,label:`General`,translatedLabel:Ju},{to:`/settings/members`,label:`People`,translatedLabel:T._(`People`,null,{hk:`2YSJM8`,project:`settings`}),condition:r},{to:`/settings/current_usage`,label:`Usage`,translatedLabel:Yu,condition:!e&&!t}]},{title:`Billing`,translatedTitle:T._(`Billing`,null,{hk:`3GaKfu`,project:`settings`}),items:[{to:`/settings/subscription`,label:`Your subscription`,translatedLabel:T._(`Your subscription`,null,{hk:`1lpIME`,project:`settings`}),keywords:[`subscription`,`plan`,`billing`],translatedKeywords:T._(`subscription, plan, billing`,null,{hk:`2KrceQ`,project:`settings`}),condition:e},{to:`/settings/current_usage`,label:`Usage`,translatedLabel:Yu,condition:!t&&e},{to:`/settings/invoices`,label:`Invoices`,translatedLabel:T._(`Invoices`,null,{hk:`4vcyNV`,project:`settings`}),keywords:[`invoices`,`billing`],translatedKeywords:T._(`invoices, billing`,null,{hk:`Wn3RB`,project:`settings`}),condition:e},{to:`/settings/billing_details`,label:`Billing details`,testId:`settings-nav-billing-details`,translatedLabel:T._(`Billing details`,null,{hk:`1rXlwS`,project:`settings`}),condition:e}]},{title:`Integrations`,translatedTitle:T._(`Integrations`,null,{hk:`196bBo`,project:`settings`}),items:[{to:`/settings/google_search_console`,label:`Search Console`,translatedLabel:T._(`Search Console`,null,{hk:`kUlgN`,project:`settings`})},{to:`/settings/wordpress`,label:`WordPress`,translatedLabel:T._(`WordPress`,null,{hk:`3SuJeG`,project:`settings`})},{to:`/settings/webflow`,label:`Webflow`,translatedLabel:T._(`Webflow`,null,{hk:`2bDmRK`,project:`settings`}),condition:u}]},{title:`Workspace`,translatedTitle:T._(`Workspace`,null,{hk:`1Uz5O1`,project:`settings`}),items:[{to:o?`/setup`:`/settings/general`,label:`General`,testId:`settings-nav-workspace-details`,translatedLabel:Ju,condition:p},{to:`/settings/workspace_members`,label:`Members`,translatedLabel:T._(`Members`,null,{hk:`nPCap`,project:`settings`})},{to:o?`/setup`:f?`/setup/brand_kit`:`/settings/brand_knowledge`,label:`Brand Knowledge`,testId:`settings-nav-brand-knowledge`,translatedLabel:T._(`Brand Knowledge`,null,{hk:`yIwoi`,project:`settings`}),condition:!m,accessRestrictionContext:`brand_knowledge`},{to:o?`/setup`:f?`/setup/brand_kit`:`/settings/custom_voices`,label:`Custom Voices`,translatedLabel:T._(`Custom Voices`,null,{hk:`323Brd`,project:`settings`})}]},{title:`Your account`,translatedTitle:T._(`Your account`,null,{hk:`37AXZB`,project:`settings`}),items:[{to:`/settings/profile`,label:`Profile`,translatedLabel:T._(`Profile`,null,{hk:`2SzS6W`,project:`settings`})},{to:`/settings/notifications`,label:`Notifications`,translatedLabel:T._(`
53Notifications`,null,{hk:`2oqAd0`,project:`settings`})},{to:`/settings/consents`,label:`Privacy consents`,translatedLabel:T._(`Privacy consents`,null,{hk:`1QZI7f`,project:`settings`}),condition:d},{to:`/settings/masterclass`,label:`Masterclass`,translatedLabel:T._(`Masterclass`,null,{hk:`2LfSrw`,project:`settings`})}]}]},Zu=`Settings`,Qu=T._(`Settings`,null,{hk:`SUDRc`,project:`common`}),$u=()=>{let e=j(),t=Xu(),n=K(),r=Lo(),{billingPath:i}=Io(),{handleConnectSearchConsole:a}=ko(),{shouldHide:o}=Q(),s=(e==null?void 0:e.permissions.canManageOrganizationMembers)??!1;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{value:`settings`,to:`/settings`,hidden:o(`Settings`),children:w._(`Settings`,null,{hk:`3dAxbS`,project:`common`})},`settings-main-route`),t.map(e=>(0,X.jsx)(Y.Fragment,{children:e.items.map(t=>{if(t.condition===!1)return null;let n=t.label===`General`?e.title:t.label,r=t.label===`General`?e.translatedTitle:t.translatedLabel;return(0,X.jsx)($,{hidden:o(n),keywords:t.keywords,translatedKeywords:t.translatedKeywords,value:n,to:t.to,category:Zu,translatedCategory:Qu,children:r},`${t.label}-${t.to}`)})},e.title)),(0,X.jsx)($,{keywords:[`ai`,`credits`],translatedKeywords:T._(`ai, credits`,null,{hk:`1vUZvV`,project:`common`}),value:`Buy AI Credits`,to:`/billing/ai/packages`,category:Zu,translatedCategory:Qu,hidden:!r||o(`Buy AI Credits`),children:w._(`Buy AI Credits`,null,{hk:`PpmsF`,project:`common`})},`buy-ai-credits`),(0,X.jsx)($,{keywords:[`ai`,`tracker`],translatedKeywords:T._(`ai, tracker`,null,{hk:`1EtBxa`,project:`common`}),value:`Buy AI Tracker`,to:i,category:Zu,translatedCategory:Qu,hidden:!n||o(`Buy AI Tracker`),children:w._(`Buy AI Tracker`,null,{hk:`1GHlFV`,project:`common`})},`buy-ai-tracker`),(0,X.jsx)($,{value:`Change Plan`,keywords:[`change`,`plan`,`subscription`,`upgrade`,`billing`],translatedKeywords:T._(`change, plan, subscription, upgrade, billing`,null,{hk:`gevMZ`,project:`common`}),to:`/billing/subscription/plans`,category:Zu,translatedCategory:Qu,hidden:!n||o(`Change Plan`),children:w._(`Change Plan`,null,{hk:`3PxslL`,project:`common`})},`change-plan`),(0,X.jsx)($,{value:`Manage add-ons`,to:`/settings/subscription`,category:Zu,translatedCategory:Qu,hidden:!n||o(`Manage add-ons`),children:w._(`Manage add-ons`,null,{hk:`oCt5B`,project:`common`})}),(0,X.jsx)($,{value:`Add Search Console Account`,onClick:()=>a(),category:Zu,translatedCategory:Qu,hidden:o(`Add Search Console Account`),children:w._(`Add Search Console Account`,null,{hk:`1A8iTX`,project:`common`})}),(0,X.jsx)($,{value:`Invite People to Your Organization`,to:`/settings/members`,category:Zu,hidden:!s||o(`Invite People to Your Organization`),translatedCategory:Qu,children:w._(`Invite People to Your Organization`,null,{hk:`3EG6w8`,project:`common`})})]})},ed=`Site`,td=T._(`Site`,null,{hk:`quqJM`,project:`common`}),nd=()=>{var e;let{currentWorkspace:t}=q(),n=t==null||(e=t.brandedWorkspaceSitesProject)==null?void 0:e.id,{canUse:r}=Vr(),i=(0,Y.useMemo)(()=>to.filter(e=>!e.requireAccess||r(e.requireAccess)),[r]);return n?(0,X.jsx)(Iu,{items:i,basePath:`/sites`,resourceId:n,category:ed,translatedCategory:td}):null},rd=()=>{let{canUseTool:e}=Vr(),{customer:{hadTrial:t}}=xa();return(0,Y.useMemo)(()=>Object.fromEntries(Tt.map(n=>[n,e(n)||t])),[e,t])},id=`Tools`,ad=T._(`Tools`,null,{hk:`HSOMy`,project:`common`}),od=()=>{let{isOnTrial:e}=Pr(),{shouldHide:t}=Q(),{featureFlags:n}=vr(),r=rd(),i=Yn(),{isBrandedWorkspace:a}=q();return(0,X.jsxs)(X.Fragment,{children:[(0,Y.useMemo)(()=>au.filter(t=>!(t.hideOnTrial&&e||t.hideOnCommandMenu||t.requireFeatureFlag&&!(n!=null&&n[t.requireFeatureFlag])||t.requireAccess&&!r[t.requireAccess])),[e,n,r]).map(e=>(0,X.jsx)($,{value:e.label,keywords:e.keywords,translatedKeywords:e.translatedKeywords,to:e.to,category:id,translatedCategory:ad,hidden:t(e.label),children:e.translatedLabel},`${e.label}-${e.to}`)),(0,X.jsx)($,{category:id,translatedCategory:ad,value:`New Content`,hidden:t(`New Content`),onClick:()=>{i(`/drafts`,{state:{createContent:!0}})},children:w._(`New Content`,null,{hk:`3nXTrW`,project:`common`})}),(0,X.jsx)($,{value:`New Audit`,category:id,translatedCategory:ad,hidden:e||t(`New Audit`),onClick:()=>{i(`/audits`,{state:{createAudit:!0}})},children:w._(`New Audit`,null,{hk:`1axbxi`,project:`common`})}),(0,X.jsx)($,{onClick:()=>{i(`/topic_research`,{state:{createContent:!0}})},value:`New Topic Research`,category:id,translatedCategory:ad,hidden:t(`New Topic Research`),children:w._(`New Topic Research`,null,{hk:`sotPI`,project:`common`})}),(0,X.jsx)($,{onClick:()=>{i(`/keyword_research`,{state:{createContent:!0}})},value:`New Keyword Research`,category:id,translatedCategory:ad,hidden:t(`New Keyword Research`),children:w._(`New Keyword Research`,null,{hk:`4dZMO5`,project:`common`})}),(0,X.jsx)($,{hidden:e||t(`New Serp Analyzer`),value:`New Serp Analyzer`,category:id,translatedCategory:ad,onClick:()=>{i(`/queries`,{state:{createSerp:!0}})},children:w._(`New Serp Analyzer`,null,{hk:`1cybnI`,project:`common`})}),(0,X.jsx)($,{hidden:t(`New AI Tracker`)||a,value:`New AI Tracker`,category:id,translatedCategory:ad,to:`/ai_tracker/configure`,children:w._(`New AI Tracker`,null,{hk:`BU8Do`,project:`common`})}),(0,X.jsx)($,{hidden:t(`New Rank Tracker`),value:`New Rank Tracker`,to:`/rank_tracker/create`,category:id,translatedCategory:ad,children:w._(`New Rank Tracker`,null,{hk:`2zzLQg`,project:`common`})})]})},sd=()=>{let{connected:e}=Xa(),{handleConnectSearchConsole:t}=ko(),{shouldHide:n}=Q(),{currentWorkspace:r}=q(),i=r==null?void 0:r.brandedWorkspaceSitesProject;return(0,X.jsxs)(X.Fragment,{children:[!e&&(0,X.jsx)($,{value:`Connect Google Search Console`,onClick:t,category:`Sites`,translatedCategory:zu,hidden:n(`Connect Google Search Console`),children:w._(`Connect Google Search Console`,null,{hk:`1zVytO`,project:`common`})},`connect-google-search-console`),(0,X.jsx)($,{hidden:n(`Sites`),to:`/sites`,value:`sites`,category:ed,translatedCategory:td,children:w._(`Site`,null,{hk:`QaUqt`,project:`common`})}),i&&(0,X.jsxs)($,{keywords:[`www.`,`https://www.${i.gscSite.displayUrl}`],value:i.gscSite.displayUrl,category:`Site`,translatedCategory:td,hidden:n(i.gscSite.displayUrl),to:`/sites/${i.id}`,children:[(0,X.jsx)(Ao,{url:i.gscSite.displayUrl}),(0,X.jsx)(`div`,{className:`truncate`,children:i.gscSite.displayUrl})]},`${i.id}-${i.gscSite.googleSiteUrl}`)]})},cd=()=>{let e=j(),{shouldHide:t}=Q(),n=x(),r=e==null?void 0:e.workspaces;return r!=null&&r.length?r==null?void 0:r.map(e=>{var r;let i=e.type===ht.Playground,a=Uo(e);return(0,X.jsxs)($,{value:a,keywords:[a,`switch`,`workspace`],translatedKeywords:T._(`switch, workspace`,null,{hk:`3HDFoa`,project:`common`}),hidden:t(a),category:`Workspace`,translatedCategory:T._(`Workspace`,null,{hk:`14e5pZ`,project:`common`}),onClick:()=>{n(`${dr(e.id,e.name)}/dashboard`)},children:[!i&&(0,X.jsx)(Vo,{src:e.logo,urlFavicon:(r=e.brand)==null?void 0:r.url}),Ho(e)]},e.id)}):null},ld=({sites:e})=>{let{shouldHide:t}=Q(),n=Yn(),{isPlaygroundWorkspace:r,isBrandedWorkspace:i}
53=q(),{haveAccessToCreateWorkspace:a,availableWorkspaceSlots:o}=go();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(od,{}),r&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Vu,{}),(0,X.jsx)(Bu,{sites:e})]}),i&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(sd,{}),(0,X.jsx)(nd,{}),(0,X.jsx)(Lu,{})]}),(0,X.jsx)(cd,{}),a&&o>0&&(0,X.jsx)($,{value:`Add new workspace`,hidden:t(`Add new workspace`),onClick:()=>n(`/setup`),category:`Workspace`,translatedCategory:T._(`Workspace`,null,{hk:`1xrfx8`,project:`common`}),children:w._(`Add new workspace`,null,{hk:`4hfG1A`,project:`common`})}),(0,X.jsx)(qu,{}),(0,X.jsx)($u,{}),(0,X.jsx)(Hu,{}),(0,X.jsx)(Wu,{})]})},ud=e=>{var t,n,r;if((t=e.draft)!=null&&t.id)return`/drafts/${e.draft.id}`;if((n=e.audit)!=null&&n.id)return`/audits/${e.audit.id}`;if((r=e.serpAnalyzer)!=null&&r.id)return`/queries/${e.serpAnalyzer.id}`},dd=e=>{var t,n;let r=[];if(!((t=e.draft)==null||(t=t.keywords)==null)&&t.length)r.push(...e.draft.seoGuidelines.keywords.flatMap(e=>e!=null&&e.item?[e.item]:[]));else{let t=Wo(e);t&&r.push(t)}return(n=e.draft)!=null&&n.title&&r.push(e.draft.title),r},fd=({items:e})=>{let t=N();return e.length===0?null:(0,X.jsx)(fi,{value:`search-results`,heading:T._(`Search Results`,null,{hk:`2oWdjw`,project:`common`}),className:`empty:hidden`,children:e.map(e=>{var n;let r=Wo(e),i=(n=e.draft)==null?void 0:n.title,a=r||i,o=ud(e);return!a||!o?null:(0,X.jsx)($,{value:[i,r,e.id].filter(Boolean).join(` `),keywords:dd(e),to:t(o),category:ku[e.type],translatedCategory:Au[e.type],label:a,title:i??void 0,date:e.insertedAt?String(e.insertedAt):void 0},e.id)})})},pd=({sites:e})=>{let{recentCommands:t}=Q(),n=(0,Y.useMemo)(()=>t.filter(Cu),[t]);return t.length?(0,X.jsxs)(fi,{value:`recent`,heading:T._(`Recent`,null,{hk:`3xlZOt`,project:`common`}),children:[(0,X.jsx)(ld,{sites:e}),n.map(e=>{let t=Mu(e.category);return t?(0,X.jsx)($,{value:e.value,to:e.to,category:e.category,translatedCategory:Au[t],label:e.label,title:e.title,date:e.date},e.value):null})]}):null},md=({sites:e})=>{let{connected:t}=Xa(),{isFreemium:n}=G(),{recentCommands:r}=Q(),{handleConnectSearchConsole:i}=ko(),a=K(),{openSupport:o}=Fo(),s=(0,Y.useMemo)(()=>e.slice(0,3),[e]),c=(0,Y.useCallback)(e=>!!r.find(t=>t.value===e),[r]),l=(0,Y.useMemo)(()=>[...s.map(e=>({id:e.id,value:e.gscSite.displayUrl,key:`${e.id}-${e.gscSite.googleSiteUrl}`,category:Ru,translatedCategory:zu,to:`/sites/${e.id}`,hidden:n||c(e.gscSite.displayUrl),render:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ao,{url:e.gscSite.displayUrl}),(0,X.jsx)(`div`,{className:`truncate`,children:e.gscSite.displayUrl})]})})),{id:`connect-gsc`,value:`Connect Google Search Console`,category:Ru,translatedCategory:zu,action:i,hidden:t||c(`Connect Google Search Console`),render:w._(`Connect Google Search Console`,null,{hk:`2eW2mQ`,project:`common`})},{id:`content-editor`,value:`Content Editor`,to:`/drafts`,category:id,translatedCategory:ad,hidden:n||c(`Content Editor`),render:w._(`Content Editor`,null,{hk:`1Mx1rg`,project:`common`})},{id:`audit`,value:`Audit`,to:`/audits`,category:id,translatedCategory:ad,hidden:n||c(`Audit`),render:w._(`Audit`,null,{hk:`3q5P6P`,project:`common`})},{id:`usage-settings`,value:`Usage settings`,to:`/settings/current_usage`,category:Zu,translatedCategory:Qu,hidden:n||c(`Usage settings`),render:w._(`Usage`,null,{hk:`kgQua`,project:`common`})},{id:`your-plan`,value:`Resubscribe`,to:`/billing/subscription/plans`,category:Zu,translatedCategory:Qu,hidden:!n||!a||c(`Your plan`),render:w._(`Resubscribe`,null,{hk:`2H0WzF`,project:`common`})},{id:`api-settings`,value:`API`,to:`/settings/api`,category:`Settings`,translatedCategory:Qu,hidden:n||c(`API`),render:`API`},{id:`send-message`,value:`Send us a message`,category:Gu,translatedCategory:Ku,action:o,hidden:c(`Send us a message`),render:w._(`Send us a message`,null,{hk:`GacFq`,project:`common`})}
53],[t,n,a,i,c,s,o]),u=(0,Y.useMemo)(()=>l.filter(e=>!e.hidden),[l]);return u.length===0?null:(0,X.jsx)(fi,{value:`suggestions`,heading:T._(`Suggestions`,null,{hk:`2bcN6j`,project:`common`}),className:`empty:hidden`,children:u.map(e=>(0,X.jsx)($,{value:e.value,category:e.category,translatedCategory:e.translatedCategory,onClick:`action`in e?e.action:void 0,to:e.to,children:e.render},e.id))})},hd=({dashboardSearch:e})=>{let{search:t}=Q(),{isPlaygroundWorkspace:n}=q(),{sites:r,loading:i}=ho({connectionKey:`SitesProjectsLookup`,first:1e3,skip:!n});return i?null:(0,X.jsxs)(ui,{className:`dark-scrollbar bg-black p-xs [&[cmdk-list]]:relative [&[cmdk-list]]:top-0 [&[cmdk-list]]:h-[343px] [&[cmdk-list]]:overflow-auto`,children:[(0,X.jsx)(hi,{className:`mx-auto w-full !py-base text-center !text-gray-70`,children:e.loading?w._(`Searching...`,null,{hk:`33QpEt`,project:`common`}):w._(`No results found.`,null,{hk:`hpT2W`,project:`common`})}),t?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(fi,{value:`navigation`,children:(0,X.jsx)(ld,{sites:r})}),!e.loading&&(0,X.jsx)(fd,{items:e.items})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(pd,{sites:r}),(0,X.jsx)(md,{sites:r})]})]})},gd=2,_d=300,vd=e=>{var t,n,r;return((t=e.draft)==null?void 0:t.meta.status)??((n=e.audit)==null?void 0:n.meta.status)??((r=e.serpAnalyzer)==null?void 0:r.meta.status)},yd=()=>{let[e]=I(`command_menu_search`),{search:t}=Q(),n=A(),[r,i]=(0,Y.useState)(``);Rr(i,_d)(t);let a=!!e&&r.length>=gd,{data:o,loading:s}=on({variables:{workspaceId:n,text:r},skip:!a}),c=(0,Y.useMemo)(()=>{var e;return a?((o==null||(e=o.dashboardItems)==null?void 0:e.data)??[]).filter(e=>vd(e)===zn.Completed):[]},[o,a]),l=t.length>=gd&&t!==r;return{items:c,loading:!!e&&(l||a&&s)}},bd=(e,t)=>{if(e===t)return 1;if(e.startsWith(t))return .85;for(let n of e.split(/[\s\-_/]+/)){if(n===t)return .75;if(n.startsWith(t))return .6}return e.includes(t)?.25:0},xd=.5,Sd=(e,t,n)=>{let r=t.toLowerCase().trim(),i=r.split(/\s+/).filter(Boolean);if(i.length===0)return 1;let a=e.toLowerCase(),o=(n??[]).map(e=>e.toLowerCase()),s=0;for(let e of i){let t=bd(a,e),n=Math.max(0,...o.map(t=>bd(t,e)))*xd,r=Math.max(t,n);if(r===0)return 0;s+=r}if(i.length<2)return s;let c=bd(a,r),l=Math.max(0,...o.map(e=>bd(e,r)))*xd;return(s+Math.max(c,l))/(i.length+1)},Cd=({closeCombobox:e})=>(0,X.jsx)(Eu,{closeCombobox:e,children:(0,X.jsx)(wd,{})}),wd=()=>{let{closeMenu:e}=Q(),[t]=I(`command_menu_search`),n=yd(),r=(0,Y.useRef)(null),i=(0,Y.useRef)(n.loading);return(0,Y.useLayoutEffect)(()=>{let e=i.current;if(i.current=n.loading,!t||!e||n.loading)return;let a=requestAnimationFrame(()=>{var e;(e=r.current)==null||e.dispatchEvent(new KeyboardEvent(`keydown`,{key:`Home`,bubbles:!0}))});return()=>cancelAnimationFrame(a)},[n.loading,t]),(0,X.jsxs)(pi,{ref:r,loop:!0,className:`bg-black`,filter:t?Sd:void 0,onKeyDown:t=>{t.key===`Escape`&&(t.stopPropagation(),e())},children:[(0,X.jsx)(`div`,{className:`relative z-10 border-b border-white-5 px-md py-xs`,children:(0,X.jsx)(Ou,{loading:n.loading})}),(0,X.jsx)(`div`,{className:`relative flex-1`,children:(0,X.jsx)(hd,{dashboardSearch:n})})]})},Td=T._(`Command Menu`,null,{hk:`RpMhM`,project:`common`}),Ed=T._(`Search sites, tools, settings, resources, and more`,null,{hk:`2sIna7`,project:`common`}),Dd=e=>{let{open:t,setOpen:n}=e,{shouldHideSidebar:r}=Ra(),i=W(`(min-width: 860px)`);(0,Y.useEffect)(()=>{let e=e=>{e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),n(!t))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,t]);let a=`translateX(calc(-50% + ${!r&&i?248/2:0}px))`;return(0,X.jsxs)(X.Fragment,{children:[e.children,(0,X.jsx)(Jn,{open:t,onOpenChange:n,children:(0,X.jsxs)(Kn,{className:`left-1/2 top-0 w-full overflow-hidden bg-gray-140 md:top-md md:w-[600px]`,style:{transform:a},"aria-label":Td,size:`base`,children:[(0,X.jsx)(ci,{children:(0,X.jsx)(Zn,{children:Ed})}),(0,X.jsx)(Cd,{closeCombobox:()=>n(!1)})]})})]})},Od=()=>{let{data:e,loading:t,updateQuery:n}=Dn();return rn({onData:({data:e})=>{var t;let r=(t=e.data)==null?void 0:t.marketingEvents;(r==null?void 0:r.__typename)===`MarketingActiveAnnouncementUpdated`&&n(e=>e!=null&&e.marketing?Oa(e,e=>{e.marketing.activeAnnouncement=r.activeAnnouncement??null}):e)}}),{announcement:(e==null?void 0:e.marketing.activeAnnouncement)??null,loading:t}};B` 54 query MarketingAnnouncement { 55 marketing { 56 id 57 activeAnnouncement { 58 ...MarketingAnnouncementFields 59 } 60 } 61 } 62 63 subscription MarketingEvents { 64 marketingEvents { 65 ... on MarketingActiveAnnouncementUpdated { 66 activeAnnouncement { 67 ...MarketingAnnouncementFields 68 } 69 } 70 } 71 } 72 73 fragment MarketingAnnouncementFields on MarketingAnnouncement { 74 id 75 trackingId 76 type 77 label 78 url 79 } 80`;var kd=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>
80(0,X.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162q0-.338-.1-.661l-2.41-7.839a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.3 2.3 0 0 0-.1.661`})]})),Ad=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M2.5 12H5.88197C6.56717 12 7.19357 12.3871 7.5 13C7.80643 13.6129 8.43283 14 9.11803 14H14.882C15.5672 14 16.1936 13.6129 16.5 13C16.8064 12.3871 17.4328 12 18.118 12H21.5M8.96656 4H15.0334C16.1103 4 16.6487 4 17.1241 4.16396C17.5445 4.30896 17.9274 4.5456 18.2451 4.85675C18.6043 5.2086 18.8451 5.6902 19.3267 6.65337L21.4932 10.9865C21.6822 11.3645 21.7767 11.5535 21.8434 11.7515C21.9026 11.9275 21.9453 12.1085 21.971 12.2923C22 12.4992 22 12.7105 22 13.1331V15.2C22 16.8802 22 17.7202 21.673 18.362C21.3854 18.9265 20.9265 19.3854 20.362 19.673C19.7202 20 18.8802 20 17.2 20H6.8C5.11984 20 4.27976 20 3.63803 19.673C3.07354 19.3854 2.6146 18.9265 2.32698 18.362C2 17.7202 2 16.8802 2 15.2V13.1331C2 12.7105 2 12.4992 2.02897 12.2923C2.05471 12.1085 2.09744 11.9275 2.15662 11.7515C2.22326 11.5535 2.31776 11.3645 2.50675 10.9865L4.67331 6.65337C5.1549 5.69019 5.3957 5.2086 5.75495 4.85675C6.07263 4.5456 6.45551 4.30896 6.87589 4.16396C7.35125 4 7.88969 4 8.96656 4Z`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]}));E();var jd=P({category:`notifications`,name:`notification clicked`,payloadSchema:U({notificationId:V(),notificationType:pa([`ce_comment_new_thread`,`ce_comment_reply`,`sites_rank_drop`,`sites_new_optimize_recommendations`,`ai_tracker_new_recommendations`]),wasRead:H()})}),Md=({isRead:e,notificationId:t,setDropdownRef:n,markNotificationAsSeen:r,markNotificationAsUnseen:i,deleteNotification:a})=>(0,X.jsx)(`div`,{onClick:e=>e.stopPropagation(),className:`h-[16px]`,children:(0,X.jsxs)(xi,{modal:!1,children:[(0,X.jsx)(gi,{children:(0,X.jsx)(o,{variant:`pure`,"aria-label":T._(`Notification options`,null,{hk:`3wX0Es`,project:`common`}),children:(0,X.jsx)(Mi,{})})}),(0,X.jsxs)(Si,{className:`z-[150]`,ref:n,children:[(0,X.jsx)(vi,{onClick:n=>{n.stopPropagation(),e?i(t):r(t)},"aria-label":e?T._(`Mark notification as unread`,null,{hk:`1KIrEY`,project:`common`}):T._(`Mark notification as read`,null,{hk:`1lVV0W`,project:`common`}),children:e?w._(`Mark as unread`,null,{hk:`yBUNr`,project:`common`}):w._(`Mark as read`,null,{hk:`3zjFQV`,project:`common`})}),(0,X.jsx)(vi,{onClick:e=>{e.stopPropagation(),a(t)},"aria-label":T._(`Delete notification`,null,{hk:`c5PUA`,project:`common`}),children:w._(`Delete`,null,{hk:`22o1XP`,project:`common`})})]})]})}),Nd=e=>{let{notificationId:t,notificationType:n,link:r,linkAriaLabel:i,notificationAriaLabel:a,avatar:s,headerFirstLine:c,headerSecondLine:l,message:u,updatedAt:d,seenAt:f,onClose:p,noAccessContext:m}=e,h=(0,Y.useRef)(null),{send:g}=F(),{markNotificationAsSeen:_,markNotificationAsUnseen:v,deleteNotification:y}=$o(),{canUse:ee}=Vr(),b=m?ee(m):!0,x=(0,Y.useMemo)(()=>Z.default.utc(d).local(),[d]),te=(0,Y.useMemo)(()=>f!==null,[f]),S=e=>{e&&(h.current=e)},ne=()=>{b&&(p==null||p()),_(t),g(jd,{notificationId:t,notificationType:n,wasRead:te})},re=(0,X.jsx)(z,{to:r,className:`absolute inset-0`,variant:`pure`,onClick:ne,"aria-label":i});return(0,X.jsxs)(`div`,{className:D(`group relative flex w-full cursor-pointer flex-col gap-md rounded-md border border-gray-20 p-base transition-colors hover:border-gray-60 hover:bg-gray-5 hover:shadow-sm`,!te&&`bg-gray-5`),"aria-label":a,children:[m?(0,X.jsx)(Ca,{context:m,side:`right`,contentClassName:`m-base`,haveAccess:b,children:b?re:(0,X.jsx)(o,{variant:`pure`,className:`absolute inset-0`,onClick:ne})}):re,(0,X.jsxs)(`div`,{className:`flex gap-[10px]`,children:[(0,X.jsx)(`div`,{className:`flex shrink-0 items-start pt-[6px]`,children:s}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-md`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,X.jsxs)(`div`,{className:`flex flex-col truncate`,children:[(0,X.jsx)(`span`,{className:`truncate text-sm text-gray-80`,children:c}),(0,X.jsx)(`span`,{className:`truncate font-medium text-gray-base`,children:l})]})}),(0,X.jsx)(Md,{isRead:te,notificationId:t,setDropdownRef:S,markNotificationAsSeen:_,markNotificationAsUnseen:v,deleteNotification:y})]}),(0,X.jsx)(`div`,{className:`line-clamp-4 text-md font-normal`,children:u}),(0,X.jsxs)(`div`,{className:`text-sm font-normal text-gray-80`,children:[(0,X.jsx)(`span`,{className:`group-hover:hidden`,children:x.fromNow()}),(0,X.jsx)(`span`,{className:`hidden group-hover:inline`,children:Ta(x,`dateTimeFull`)})]})]})]})]})};E();var Pd=({isUnread:e,iconComponent:n,iconSize:r=`xsmall`,iconClassName:i})=>(0,X.jsx)(`span`,{className:D(`absolute left-md top-md inline-flex min-h-[16px] min-w-[16px] items-center justify-center rounded-full`,e?`bg-gray-5`:`bg-white-base group-hover:bg-gray-5`),children:(0,X.jsx)(t,{size:r,Component:n,className:i})}),Fd=e=>{var t;let{notification:n,onClose:r}=e,i=n.content,a=N(),{currentWorkspace:o}=q(),s=i.kind===wt.OffPage,c=o==null?void 0:o.brandedWorkspaceSitesProject,l=c==null?void 0:c.gscSite.displayUrl,u=a(c?`/sites/${c.id}/recommendations${s?`/mentions`:``}`:`/sites/connect?intent=recommendations`),d=s?T._({"*":`You have {number} new recommendations to earn brand mentions.`,_1:`You have 1 new recommendation to earn brand mentions.`},[T._plural(i.newCount,`number`)],{hk:`3UtY0l`,project:`common`}):T._({"*":`You have {number} new recommendations to improve your visibility in AI search.`,_1:`You have 1 new recommendation to improve your visibility in AI search.`},[T._plural(i.newCount,`number`)],{hk:`4fGyuj`,project:`common`}),f=s?T._({"*":`New off-page recommendations`,_1:`New off-page recommendation`},[T._plural(i.newCount)],{hk:`1x9fFn`,project:`common`}):T._({"*":`New on-page recommendations`,_1:`New on-page recommendation`},[T._plural(i.newCount)],{hk:`4rBaWM`,project:`common`}),p=o==null||(t=o.brandedWorkspaceAiTrackerProject)==null?void 0:t.brandName,m=l?jr(l):p,h=T._(`View AI Tracker recommendations for {brandName}`,[T._param(`brandName`,m??``)],{hk:`1hMrir`,project:`common`}),g=T._(`New AI Tracker recommendations available for {brandName}`,[T._param(`brandName`,m??``)],{hk:`1QgynU`,project:`common`});return(0,X.jsx)(Nd,{notificationId:n.id,notificationType:`ai_tracker_new_recommendations`,link:u,linkAriaLabel:h,notificationAriaLabel:g,avatar:(0,X.jsx)(Id,{displayUrl:l,isUnread:n.seenAt===null}),headerFirstLine:f,headerSecondLine:m??``,message:d,updatedAt:n.updatedAt,seenAt:n.seenAt??null,onClose:r})}
80,Id=({displayUrl:e,isUnread:t})=>(0,X.jsxs)(`div`,{className:`relative w-[24px]`,children:[(0,X.jsx)(Ao,{url:e??``}),(0,X.jsx)(Pd,{isUnread:t,iconComponent:Qo,iconSize:`small`,iconClassName:`text-purple-60`})]}),Ld=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M4.848 2.771A49 49 0 0 1 12 2.25c2.43 0 4.817.178 7.152.52c1.978.292 3.348 2.024 3.348 3.97v6.02c0 1.946-1.37 3.678-3.348 3.97q-2.911.428-5.922.505a.4.4 0 0 0-.266.112L8.78 21.53A.75.75 0 0 1 7.5 21v-3.955a49 49 0 0 1-2.652-.316c-1.978-.29-3.348-2.024-3.348-3.97V6.741c0-1.946 1.37-3.68 3.348-3.97`,clipRule:`evenodd`})]})),Rd=e=>{var t,n,r;let{notification:i,onClose:a}=e,o=i.content,s=N(),c=Z.default.utc(o.message.insertedAt).isSame(Z.default.utc(o.thread.insertedAt)),l=((t=o.thread.contentEditor)==null||(t=t.progressSnapshots)==null||(t=t.find(e=>(e==null?void 0:e.name)===`content_score`))==null?void 0:t.value)??0,u=i.seenAt===null,d=o.message.author.name,f=((n=o.thread.contentEditor)==null||(n=n.keywords)==null||(n=n[0])==null?void 0:n.item)||`...`,p=T._(`View message from {authorName}`,[T._param(`authorName`,d)],{hk:`41geID`,project:`common`}),m=T._(`New message from {authorName}`,[T._param(`authorName`,d)],{hk:`2e9LGA`,project:`common`}),h=c?T._(`Comment in {keyword}`,[T._param(`keyword`,f)],{hk:`43WQNH`,project:`common`}):T._(`Reply in {keyword}`,[T._param(`keyword`,f)],{hk:`1vTh9s`,project:`common`});return(0,X.jsx)(Nd,{notificationId:i.id,notificationType:c?`ce_comment_new_thread`:`ce_comment_reply`,link:s(`/drafts/${(r=o.thread.contentEditor)==null?void 0:r.id}?open-thread-id=${o.thread.id}`),linkAriaLabel:p,notificationAriaLabel:m,avatar:(0,X.jsx)(zd,{user:o.message.author,contentScore:l,isNewThread:c,isUnread:u}),headerFirstLine:h,headerSecondLine:o.message.author.name,message:o.message.content,updatedAt:i.updatedAt,seenAt:i.seenAt??null,onClose:a})},zd=({user:e,contentScore:t,isNewThread:n,isUnread:r})=>(0,X.jsxs)(`div`,{className:`w-[24px]`,children:[(0,X.jsx)(`div`,{className:`hidden group-hover:block`,children:(0,X.jsx)($i,{score:{value:t},mode:`compact`,children:(0,X.jsx)(ea,{})})}),(0,X.jsxs)(`div`,{className:`relative w-[24px] group-hover:hidden`,children:[(0,X.jsx)(ts,{user:e}),(0,X.jsx)(Pd,{isUnread:r,iconComponent:n?Ld:Ir})]})]});E();var Bd=P({category:`marketing`,name:`announcement_clicked`,payloadSchema:U({trackingId:V(),type:pa(gn),url:V(),label:V()})}),Vd=({onClose:e})=>{let{announcement:t,loading:n}=Od(),{send:r}=F();if(n||!t)return null;let i=t.type===gn.LiveWebinar;return(0,X.jsxs)(z,{href:t.url,target:`_blank`,rel:`noopener noreferrer`,variant:`pure`,onClick:()=>{e(),r(Bd,{trackingId:t.trackingId,type:t.type,url:t.url,label:t.label})},className:`group relative flex w-full cursor-pointer items-center gap-md rounded-md border border-gray-20 bg-gray-5 p-base no-underline transition-colors hover:border-gray-60 hover:bg-gray-5 hover:shadow-sm`,children:[(0,X.jsxs)(`span`,{className:`relative flex size-sm shrink-0`,children:[i&&(0,X.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-red-60 opacity-75`}),(0,X.jsx)(`span`,{className:D(`relative inline-flex size-sm rounded-full`,i?`bg-red-60`:`bg-brand-violet`)})]}),(0,X.jsx)(`span`,{className:`text-md font-medium text-gray-100`,children:t.label})]})},Hd=e=>{let{notification:t,onClose:n}=e,r=t.content,i=N(),a=T._({"*":`You have {number} new recommendations to optimize your content.`,_1:`You have 1 new recommendation to optimize your content.`},[T._plural(r.recommendationsCount,`number`)],{hk:`tUJic`,project:`common`}),o=`${i(`/sites/${r.sitesProject.id}/recommendations/optimize`)}?${new URLSearchParams({recommendationsGroupId:t.id}).toString()}`,s=t.seenAt===null,c=r.sitesProject.gscSite.displayUrl,l=T._(`View recommendations for {displayUrl}`,[T._param(`displayUrl`,c)],{hk:`48MgRl`,project:`common`}),u=T._(`New recommendations available for {displayUrl}`,[T._param(`displayUrl`,c)],{hk:`45NGDv`,project:`common`}),d=T._({"*":`New optimization recommendations`,_1:`New optimization recommendation`},[T._plural(r.recommendationsCount)],{hk:`1MdEoE`,project:`common`});return(0,X.jsx)(Nd,{notificationId:t.id,notificationType:`sites_new_optimize_recommendations`,link:o,linkAriaLabel:l,notificationAriaLabel:u,avatar:(0,X.jsx)(Ud,{displayUrl:c,isUnread:s}),headerFirstLine:d,headerSecondLine:jr(r.sitesProject.gscSite.displayUrl),message:a,updatedAt:t.updatedAt,seenAt:t.seenAt??null,onClose:n})},Ud=({displayUrl:e,isUnread:t})=>(0,X.jsxs)(`div`,{className:`relative w-[24px]`,children:[(0,X.jsx)(Ao,{url:e}),(0,X.jsx)(Pd,{isUnread:t,iconComponent:Bo,iconSize:`small`,iconClassName:`text-red-60`})]}),Wd=e=>{let{notification:t,onClose:n}=e,r=t.content,i=N(),a=T._({"*":`{number} pages have lost their ranking and haven't recovered for over 7 days. Consider revisiting them.`,_1:`1 page has lost its ranking and hasn't recovered for over 7 days. Consider revisiting it.`},[T._plural(r.rankDropsCount,`number`)],{hk:`3X3FOy`,project:`common`}),o=`${i(`/sites/${r.sitesProject.id}/content_audit/${r.sitesProject.contentAuditProject.id}`)}?${new URLSearchParams({rankDrop:`true`,rankDropsDetectionId:r.rankDropsDetectionId}).toString()}`,s=t.seenAt===null,c=r.sitesProject.gscSite.displayUrl,l=T._(`View rank drops detected in {displayUrl}`,[T._param(`displayUrl`,c)],{hk:`4tbJOK`,project:`common`}),u=T._(`Rank drops detected in {displayUrl}`,[T._param(`displayUrl`,c)],{hk:`4pztlr`,project:`common`}),d=T._({"*":`Rank drops detected`,_1:`Rank drop detected`},[T._plural(r.rankDropsCount)],{hk:`36dxrF`,project:`common`});return(0,X.jsx)(Nd,{notificationId:t.id,notificationType:`sites_rank_drop`,link:o,linkAriaLabel:l,notificationAriaLabel:u,avatar:(0,X.jsx)(Gd,{displayUrl:c,isUnread:s}),headerFirstLine:d,headerSecondLine:jr(r.sitesProject.gscSite.displayUrl),message:a,updatedAt:t.updatedAt,seenAt:t.seenAt??null,onClose:n,noAccessContext:`rank_drop_alerts`})},Gd=({displayUrl:e,isUnread:t})=>(0,X.jsxs)(`div`,{className:`relative w-[24px]`,children:[(0,X.jsx)(Ao,{url:e}),(0,X.jsx)(Pd,{isUnread:t,iconComponent:rs,iconSize:`small`})]});E();var Kd=e=>{let{send:t}=F(),[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(!1),s=(0,Y.useRef)([]),{className:c}=e,l=A(),{state:u,pathname:d}=S(),f=x(),{notifications:p,notificationsLoading:m,markAllNotificationAsSeen:h}=$o(),g=W(Ea.maxSm),{announcement:_}=Od(),v=g&&!!_,y=(0,Y.useMemo)(()=>(p.filter(e=>!e.seenAt).length??0)+ +!!v,[p,v]),ee=(0,Y.useMemo)(()=>Kr(p.filter(e=>i?!e.seenAt:!0),e=>e.updatedAt?-new Date(e.updatedAt).getTime():0),[p,i]),b=(0,Y.useCallback)(()=>{r(!0),t(P({category:`other`,name:`notifications inbox opened`}))},[t]),te=(0,Y.useCallback)(()=>{r(!1)},[]),ne=(0,Y.useCallback)(e=>{e&&!s.current.includes(e)&&s.current.push(e)},[]);return(0,Y.useEffect)(()=>{u!=null&&u.openInbox&&b()},[u==null?void 0:u.openInbox,b]),(0,X.jsxs)(Qr,{open:n,onOpenChange:e=>{r(e),u!=null&&u.openInbox&&f(d,{state:{openInbox:!1},replace:!0})},children:[(0,X.jsx)(Xr,{children:(0,X.jsx)(o,{variant:`pure`,onClick:()=>n?te():b(),"aria-label":T._(`Toggle notifications inbox`,null,{hk:`20G5XR`,project:`common`}),className:O(`text-gray-60`,c),size:`small`,icon:Ad,children:(0,X.jsx)(Yd,{numberOfUnreadNotifications:y})})}),(0,X.jsx)(Jr,{children:(0,X.jsxs)(Yr,{side:`bottom`,sideOffset:18,padding:[`base`,`vertical`],zIndex:150,"aria-label":T._(`Notifications inbox`,null,{hk:`37Bllm`,project:`common`}),className:O(D(`mr-sm flex max-h-[calc(100vh-68px)] min-h-[200px] w-[392px] flex-col gap-base overflow-y-auto !rounded-xl`),c),children:[(0,X.jsxs)(`div`,{className:`flex justify-between px-base`,children:[(0,X.jsx)(`span`,{className:`text-base font-semibold text-gray-100`,children:w._(`Inbox`,null,{hk:`3G7GH0`,project:`common`})}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-base`,children:[(0,X.jsx)(ri,{checked:i,labelHidden:!0,onChange:()=>a(!i),"aria-label":T._(`Show only unread notifications`,null,{hk:`2Bw4jQ`,project:`common`}),label:T._(`Unread only`,null,{hk:`4wClov`,project:`common`}),size:`small`}),(0,X.jsxs)(xi,{modal:!1,children:[(0,X.jsx)(gi,{children:(0,X.jsx)(o,{variant:`pure`,"aria-label":T._(`Notification options`,null,{hk:`uHgq`,project:`common`}),children:(0,X.jsx)(Mi,{})})}),(0,X.jsx)(Si,{className:`z-[150]`,ref:ne,children:(0,X.jsxs)(vi,{onClick:e=>{e.stopPropagation(),h(l)},"aria-label":T._(`Mark all notification as read`,null,{hk:`3E9rmn`,project:`common`}),disabled:y===0,className:`flex justify-between`,children:[(0,X.jsx)(`span`,{children:w._(`Mark all as read`,null,{hk:`4D5BqY`,project:`common`})}),(0,X.jsx)(`span`,{children:y})]})})]})]})]}),(0,X.jsxs)(`div`,{className:`flex grow flex-col gap-xs overflow-y-auto px-base`,children:[v&&(0,X.jsx)(Vd,{onClose:te}),(0,X.jsx)(qd,{loading:m,notifications:ee,showOnlyUnread:i,closeInbox:te})]})]})})]})},qd=e=>{let{loading:n,notifications:i,showOnlyUnread:a,closeInbox:o}=e;return n?(0,X.jsx)(r,{}):i.length===0?(0,X.jsxs)(`div`,{className:`flex h-full grow flex-col items-center justify-center gap-md text-center text-base font-semibold text-gray-100`,children:[(0,X.jsx)(t,{Component:kd,size:`large`}),a?w._(`There are currently no unread notifications`,null,{hk:`44pUqA`,project:`common`}):w._(`There are currently no notifications`,null,{hk:`7z495`,project:`common`})]}):(0,X.jsx)(Jo,{initial:!1,children:i.map(e=>(0,X.jsx)(Yo,{children:(0,X.jsx)(Jd,{notification:e,onClose:o})},e.id))})},Jd=e=>{let{notification:t,onClose:n}=e;return(e=>e.content.__typename===`NewContentEditorThreadMessageNotificationContent`)(t)?(0,X.jsx)(Rd,{notification:t,onClose:n}):(e=>e.content.__typename===`SitesContentAuditNewRankDropsDetectedNotificationContent`)(t)?(0,X.jsx)(Wd,{notification:t,onClose:n}):(e=>e.content.__typename===`SitesContentAuditNewOptimizeRecommendationsNotificationContent`)(t)?(0,X.jsx)(H
80d,{notification:t,onClose:n}):(e=>e.content.__typename===`AiTrackerNewRecommendationsNotificationContent`)(t)?(0,X.jsx)(Fd,{notification:t,onClose:n}):null},Yd=e=>{let{numberOfUnreadNotifications:t}=e;return t<1?null:(0,X.jsx)(Ei,{rounded:!0,className:`absolute -bottom-md right-full h-base min-w-base -translate-y-1/4 translate-x-1/4 rounded-full bg-orange-70 px-2xs py-0 text-[.625rem] font-semibold leading-[.625rem] text-white-base`,children:t})},Xd=({audit:e})=>{var t,n;let r=e==null||(t=e.scrape)==null?void 0:t.location,i=e==null||(n=e.scrape)==null?void 0:n.keyword,a=e==null?void 0:e.inserted_at,s=r?Gr(r):null;return(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-sm`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:i}),(0,X.jsxs)(xi,{children:[(0,X.jsx)(gi,{children:(0,X.jsx)(o,{"aria-label":T._(`Open project details`,null,{hk:`1B4OfF`,project:`audit`}),variant:`pure`,size:`xsmall`,icon:os,className:`shrink-0`})}),(0,X.jsx)(Si,{onClick:e=>e.stopPropagation(),align:`center`,sideOffset:22,className:`min-w-[240px]`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-md px-md py-xs`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(`span`,{className:`text-sm text-gray-80`,children:w._(`Location`,null,{hk:`2cEXbr`,project:`audit`})}),(0,X.jsxs)(`span`,{className:`flex items-center gap-xs text-md font-medium`,children:[s&&(0,X.jsx)(ji,{countryCode:s,width:16}),r??``]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(`span`,{className:`text-sm text-gray-80`,children:w._(`Creation date`,null,{hk:`3jtMYm`,project:`audit`})}),(0,X.jsx)(`span`,{className:`flex items-center gap-xs text-md font-medium`,children:a?Ta(Z.default.utc(a).local(),`date`):``})]})]})})]})]})},Zd=({query:e})=>{let t=Gr((e==null?void 0:e.location)??``),n=e==null?void 0:e.keyword,r=e==null?void 0:e.insertedAt;return(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-sm`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:n}),(0,X.jsxs)(xi,{children:[(0,X.jsx)(gi,{children:(0,X.jsx)(o,{"aria-label":T._(`Open project details`,null,{hk:`2X3WV`,project:`keyword-research`}),variant:`pure`,size:`xsmall`,icon:os,className:`shrink-0`})}),(0,X.jsx)(Si,{onClick:e=>e.stopPropagation(),align:`center`,sideOffset:22,className:`min-w-[240px]`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-md px-md py-xs`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(`span`,{className:`text-sm text-gray-80`,children:w._(`Location`,null,{hk:`DFZ8e`,project:`keyword-research`})}),(0,X.jsxs)(`span`,{className:`flex items-center gap-xs text-md font-medium`,children:[t&&(0,X.jsx)(ji,{countryCode:t,width:16}),(e==null?void 0:e.location)??``]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(`span`,{className:`text-sm text-gray-80`,children:w._(`Creation date`,null,{hk:`28Qa8x`,project:`keyword-research`})}),(0,X.jsx)(`span`,{className:`flex items-center gap-xs text-md font-medium`,children:r?Ta(Z.default.utc(r).local(),`date`):``})]})]})})]})]})},Qd=({query:e})=>{let t=Gr((e==null?void 0:e.location)??``),n=e==null?void 0:e.keyword,r=e==null?void 0:e.inserted_at;return(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-sm`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:n}),(0,X.jsxs)(xi,{children:[(0,X.jsx)(gi,{children:(0,X.jsx)(o,{"aria-label":T._(`Open project details`,null,{hk:`3R03SY`,project:`serp-analyzer`}),variant:`pure`,size:`xsmall`,icon:os,className:`shrink-0`})}),(0,X.jsx)(Si,{onClick:e=>e.stopPropagation(),align:`center`,sideOffset:22,className:`min-w-[240px]`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-md px-md py-xs`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(`span`,{className:`text-sm text-gray-80`,children:w._(`Location`,null,{hk:`YHyaP`,project:`serp-analyzer`})}),(0,X.jsxs)(`span`,{className:`flex items-center gap-xs text-md font-medium`,children:[t&&(0,X.jsx)(ji,{countryCode:t,width:16}),(e==null?void 0:e.location)??``]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(`span`,{className:`text-sm text-gray-80`,children:w._(`Creation date`,null,{hk:`FLb4y`,project:`serp-analyzer`})}),(0,X.jsx)(`span`,{className:`flex items-center gap-xs text-md font-medium`,children:r?Ta(Z.default.utc(r).local(),`date`):``})]})]})})]})]})},$d={"draft-keyword":e=>{let t=e.draft;return(0,X.jsx)(Xo,{draft:t})},"topical-map":e=>{let t=e.topicalMap,n=e.title;return(0,X.jsx)(ss,{topicalMap:t,title:n})},"audit-keyword":e=>{let t=e.audit;return(0,X.jsx)(Xd,{audit:t})},"keyword-research":e=>{let t=e.query;return(0,X.jsx)(Zd,{query:t})},"serp-analyzer":e=>{let t=e.query;return(0,X.jsx)(Qd,{query:t})}};E();var ef=()=>{let{breadcrumbs:e}=(0,Y.use)(po);return(0,X.jsx)(`div`,{className:`flex min-w-0 items-center gap-sm overflow-hidden`,children:e.map((n,r)=>{let i=r===e.length-1,a=n.tooltipType&&$d[n.tooltipType];return(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsx)(`div`,{className:i?`min-w-0`:`shrink-0`,children:a&&n.tooltipProps?a(n.tooltipProps):i?(0,X.jsx)(`span`,{className:`block truncate font-semibold text-white-base`,children:n.label}):(0,X.jsx)(z,{to:n.url,variant:`standalone`,noVisitedState:!0,className:D(`font-semibold text-gray-60 hover:text-white-base active:text-white-base`,i?`block truncate`:`whitespace-nowrap`),children:n.label})}),!i&&(0,X.jsx)(t,{Component:is,size:`base`,className:`shrink-0 text-gray-100`})]},n.url)})})},tf=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M7 15L12 20L17 15M7 9L12 4L17 9`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]}
80)),nf=P({category:`workspaces`,name:`add_new_workspace_dropdown_item_clicked`,payloadSchema:U({gsc_connected:H()})}),rf=({workspaces:e,closeMenu:n})=>{let{haveAccessToCreateWorkspace:r,availableWorkspaceSlots:i}=go(),a=j(),o=(a==null?void 0:a.permissions.canManageWorkspaces)??!1,s=N(),{send:c}=F(),{connected:l}=Xa(),u=A();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`max-h-[90vh] max-w-[min(600px,calc(100vw-3rem))] overflow-y-auto overflow-x-hidden`,children:(o?e:e.filter(e=>e.state!==Rn.Disabled)).map(e=>(0,X.jsx)(vs,{workspace:e,selected:e.id===u,closeMenu:n},e.id))}),r&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(yi,{}),i>0?(0,X.jsx)(vi,{asChild:!0,children:(0,X.jsxs)(z,{to:s(`/setup`),onClick:()=>{c(nf,{gsc_connected:l})},children:[(0,X.jsx)(t,{Component:ds}),w._(`Add new workspace`,null,{hk:`jUkEX`,project:`common`})]})}):(0,X.jsx)(Ca,{side:`right`,context:`workspace_limit`,triggerClassName:`w-full`,haveAccess:!1,buttonChild:!0,children:(0,X.jsx)(vi,{onClick:e=>{e.preventDefault()},icon:ds,children:w._(`Add new workspace`,null,{hk:`jUkEX`,project:`common`})})})]})]})},af=()=>{let{send:e}=F(),[n,r]=(0,Y.useState)(!1),i=j(),{currentWorkspace:a}=q(),{shouldHideSidebar:o}=Ra(),s=()=>{e(P({category:`other`,name:`workspaces dropdown clicked`}))};return(0,X.jsxs)(xi,{open:n,onOpenChange:r,children:[(0,X.jsx)(gi,{children:o?(0,X.jsx)(Pi,{active:n,onClick:s,variant:`tertiary`,className:`justify-start gap-sm rounded-xl`,children:(0,X.jsx)(of,{})}):(0,X.jsxs)(Pi,{active:n,onClick:s,variant:`tertiary`,className:`grow justify-start gap-sm rounded-xl pr-md md:w-[224px]`,children:[(0,X.jsx)(of,{}),(0,X.jsx)(`span`,{className:`hidden min-w-0 flex-1 truncate text-left text-md font-semibold text-white-base md:inline`,children:a?Ho(a):``}),(0,X.jsx)(t,{size:`base`,className:`shrink-0 text-gray-60`,Component:tf})]})}),(0,X.jsxs)(Si,{sideOffset:8,className:`z-[150] max-h-[80vh] w-full min-w-[320px] max-w-[600px] rounded-xl`,children:[(0,X.jsx)(bi,{className:`pl-[10px] text-md font-medium capitalize`,children:w._(`Workspaces`,null,{hk:`3SuxXt`,project:`common`})}),(0,X.jsx)(rf,{workspaces:(i==null?void 0:i.workspaces)??[],closeMenu:()=>r(!1)})]})]})},of=()=>{let{currentWorkspace:e}=q();return e?(0,X.jsx)(ls,{workspace:e,fallbackClassName:`size-lg p-3xs`}):null},sf=({to:e})=>{let{send:t}=F();return(0,X.jsx)(L,{className:`justify-start gap-sm rounded-xl`,onClick:()=>{t(P({category:`other`,name:`sidebar home clicked`}))},variant:`pure`,to:e,children:(0,X.jsx)(of,{})})},cf=()=>{let e=N(),{isWorkspaceActive:t,isWorkspaceInactive:n,isWorkspaceDisabled:r}=q(),{shouldHideSidebar:i,shouldHideActionsForDeprecatedPlan:a}=Ra(),{isNewUser:o}=G();return o||a?(0,X.jsx)(cs,{onlyBrandmark:!0,className:`size-lg`}):(t||r)&&i?(0,X.jsx)(sf,{to:e(`/dashboard`)}):n?(0,X.jsx)(sf,{to:e(`/setup`)}):(0,X.jsx)(af,{})},lf=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M18 8L22 12M22 12L18 16M22 12H9M15 4.20404C13.7252 3.43827 12.2452 3 10.6667 3C5.8802 3 2 7.02944 2 12C2 16.9706 5.8802 21 10.6667 21C12.2452 21 13.7252 20.5617 15 19.796`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),uf=()=>{let{send:e}=F(),t=Po(),n=j(),{organizations:r,refetch:i}=(0,Y.use)(yn),a=Se(r.filter(e=>e.status.active||e.id===(n==null?void 0:n.id))),{tour:o}=Ka(),s=(0,Y.useCallback)(n=>{e(P({category:`other`,name:`switch organization clicked`})),t(n,`/dashboard`),o==null||o.cancel(),i()},[t,o,i,e]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(bi,{children:w._(`Organization`,null,{hk:`1DMr6k`,project:`common`})}),(0,X.jsx)(`div`,{className:`max-w-[min(600px,calc(100vw-3rem))] overflow-y-auto overflow-x-hidden`,children:a.map(e=>(0,X.jsx)(hs,{organization:e,active:e.id===(n==null?void 0:n.id),onClick:s},e.id))})]})};E();var df=({ref:e,onClick:t,className:n,...r})=>{let i=j(),a=ln().length>1,{displayLabel:s,name:c}=jo(i),{data:l}=an(),u=l==null?void 0:l.userProfile,{user:d}=Pe(),f=(u==null?void 0:u.name)??(d==null?void 0:d.email),p=i!=null&&i.status.owned?i!=null&&i.name?T._(`Your organization: {label}`,[T._param(`label`,s)],{hk:`3xIZdn`,project:`common`}):null:T._(`Organization: {label}`,[T._param(`label`,s)],{hk:`1MVLkD`,project:`common`});return(0,X.jsx)(o,{className:O(`p-0 hover:bg-transparent`,n),"aria-label":c?T._(`Open {label} account menu`,[T._param(`label`,s)],{hk:`1wrapt`,project:`common`}):T._(`Open organization account menu`,null,{hk:`2BKAdp`,project:`common`}),ref:e,variant:`text`,onClick:t,...r,children:(0,X.jsx)(b,{side:`bottom`,align:`end`,portalled:!0,sideOffset:16,alignOffset:-4,content:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[f,p&&(0,X.jsx)(`span`,{children:p})]}),children:(0,X.jsxs)(`div`,{className:D(`flex items-center justify-center gap-sm rounded-full bg-gray-140 p-3xs`,a&&`pl-sm`),children:[a&&(0,X.jsx)(Mo,{organization:i,size:`small`,className:`size-[20px] bg-gray-140`}),(0,X.jsx)(es,{src:u==null?void 0:u.avatar,name:(u==null?void 0:u.name)??(d==null?void 0:d.email)??``,size:`base`})]})})})},ff=()=>{let[e,n]=(0,Y.useState)(!1),{signOut:r}=Uu(),i=j(),a=Ut(),{send:o}=F(),s=W(Ea.maxSm),{shouldHideActionsForDeprecatedPlan:c}=Ra(),{isNewUser:l}=G(),u=N(),d=Po(),f=!!a&&!(i!=null&&i.status.owned)&&!a.status.active;return(0,X.jsxs)(xi,{open:e,onOpenChange:e=>{n(e),o(P({category:`other`,name:`sidebar avatar clicked`,payloadSchema:U({menu_open:H()})}),{menu_open:e})},children:[(0,X.jsx)(gi,{children:(0,X.jsx)(df,{"data-testid":`sidebar-avatar`})}),(0,X.jsxs)(Si,{side:`bottom`,align:`end`,sideOffset:10,alignOffset:-8,className:`z-[150] max-h-[90vh] w-full min-w-[320px] max-w-[600px] rounded-xl pb-0`,children:[(0,X.jsx)(vi,{asChild:!0,children:l||c?(0,X.jsx)(pf,{}):(0,X.jsx)(z,{className:`p-0`,to:u(`/settings/profile`),children:(0,X.jsx)(pf,{})})}),!l&&!c&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(yi,{}),(0,X.jsx)(vi,{asChild:!0,children:(0,X.jsxs)(z,{"data-testid":`sidebar-settings`,to:u(`/settings`),onClick:()=>{o(P({category:`other`,name:`sidebar settings clicked`}))},children:[(0,X.jsx)(t,{size:`base`,Component:Ss}),w._(`Settings`,null,{hk:`UeWQW`,project:`common`})]})})]}),s&&(0,X.jsx)(Go,{inDropdown:!0,floating:!1}),(0,X.jsx)(uf,{}),f&&(0,X.jsx)(vi,{icon:Cs,onClick:()=>{d(a.id,`/billing`)},children:w._(`Add your organization`,null,{hk:`4aL7Uw`,project:`common`})}),(0,X.jsxs)(`div`,{className:`sticky bottom-0 rounded-xl bg-[inherit] pb-xs`,children:[(0,X.jsx)(yi,{}),(0,X.jsx)(vi,{"data-testid":`sidebar-logout`,icon:lf,onClick:r,children:w._(`Log out`,null,{hk:`3ljELm`,project:`common`})})]})]})]})},pf=()=>{let{data:e}=an(),t=e==null?void 0:e.userProfile,{user:n}=Pe();return(0,X.jsxs)(`div`,{className:`flex items-center gap-md p-md`,children:[(0,X.jsx)(es,{src:t==null?void 0:t.avatar,name:(t==null?void 0:t.name)??(n==null?void 0:n.email)??``,size:`base`}),(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{className:`font-semibold`,children:t==null?void 0:t.name}),(0,X.jsx)(`span`,{className:`text-sm text-gray-80`,children:(n==null?void 0:n.email)??``})]})]})};E();var mf=P({category:`marketing`,name:`announcement_clicked`,payloadSchema:U({trackingId:V(),type:pa(gn),url:V(),label:V()})}),hf=()=>{let{announcement:e,loading:t}=Od(),{send:n}=F();if(t||!e)return null;let r=e.type===gn.LiveWebinar;return(0,X.jsxs)(L,{className:`mr-base flex max-w-[120px] items-center gap-xs text-md font-medium text-white-base`,variant:`pure`,size:`small`,href:e.url,target:`_blank`,onClick:()=>{n(mf,{trackingId:e.trackingId,type:e.type,url:e.url,label:e.label})},children:[(0,X.jsxs)(`span`,{className:`relative flex size-sm shrink-0`,children:[r&&(0,X.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-red-60 opacity-75`}),(0,X.jsx)(`span`,{className:D(`relative inline-flex size-sm rounded-full`,r?`bg-red-60`:`bg-brand-violet`)})]}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]})};E();var gf=()=>{let{shouldHideSidebar:e}=Ra(),t=!e,{breadcrumbs:n}=(0,Y.use)(po);return(0,X.jsxs)(X.Fragment,{children:[t&&(0,X.jsx)(`div`,{className:`hidden items-center bg-gray-160 pb-0 pl-md pt-sm [grid-area:bar-over-sidebar] md:flex`,children:(0,X.jsx)(cf,{})}),(0,X.jsx)(`div`,{className:`[grid-area:bar]`,children:(0,X.jsxs)(Ui,{className:`bg-gray-160 px-md pb-0 pt-sm text-white-base max-sm:gap-2xs sm:pr-[20px]`,children:[(0,X.jsxs)(Hi,{className:`min-w-0 md:flex-1`,children:[(0,X.jsx)(`div`,{className:D(`flex shrink-0 items-center self-center pl-sm`,t&&`md:hidden`),children:(0,X.jsx)(cf,{})}),e&&n.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(as,{}),(0,X.jsx)(ef,{})]})]}),(0,X.jsx)(_f,{})]})})]})},_f=()=>{let{isNewUser:e}=G(),t=W(Ea.maxSm),{shouldHideActionsForDeprecatedPlan:n}=Ra(),{isWorkspaceActive:r}=q();return(0,X.jsxs)(X.Fragment,{children:[!e&&r&&!n&&(0,X.jsx)(Vi,{className:`w-auto grow justify-center self-stretch max-md:pr-base md:w-full md:max-w-[200px] md:grow-0 lg:max-w-[250px]`,children:(0,X.jsx)(vf,{})}),(0,X.jsx)(Bi,{className:`flex h-full gap-base py-3xs md:flex-1`,children:(0,X.jsxs)(`div`,{className:`flex h-full items-center gap-xs sm:gap-base`,children:[!t&&(0,X.jsx)(hf,{}),!e&&r&&!n&&(0,X.jsx)(Kd,{}),!t&&(0,X.jsx)(Go,{floating:!1,className:`flex items-center`}),(0,X.jsx)(ff,{})]})})]})},vf=()=>{let[e,n]=(0,Y.useState)(!1),r=sr?`âK`:`Ctrl+K`,{send:i}=F();return(0,X.jsx)(Dd,{open:e,setOpen:e=>n(e),children:(0,X.jsxs)(o,{onClick:()=>{n(!0),i(P({category:`other`,name:`sidebar search menu clicked`}))},className:`w-full items-center justify-start self-stretch rounded-full bg-gray-base px-md text-md font-medium text-gray-60 sm:w-full md:justify-between`,variant:`pure`,children:[(0,X.jsx)(t,{Component:Qi}),w._(`Search`,null,{hk:`1VHMWv`,project:`common`}),(0,X.jsx)(`div`,{className:`hidden rounded bg-gray-160 px-sm py-2xs text-md leading-4 text-gray-60 md:block`,children:r})]})})},yf=P({category:`dashboard`,name:`onboarding_checklist_skipped`}),bf=P({category:`dashboard`,name:`onboarding_checklist_item_clicked`,payloadSchema:U({taskId:V(),source:pa([`launchpad`,`dashboard`])})}),xf=()=>{var e;let t=N(),{currentWorkspace:n,isBrandedWorkspace:r}=q(),{mostRecentDraft:i}=ks(),a=r&&!(n==null||(e=n.brandedWorkspaceSitesProject)==null)&&e.id?t(`/sites/${n.brandedWorkspaceSitesProject.id}/content_audit`):t(`/sites`);return{workspaceCreated:{label:T._(`Set up your workspace`,null,{hk:`3peOkA`,project:`onboarding`}),link:t(`/setup`),timeMinutes:2,cta:T._(`Set up workspace`,null,{hk:`4FaEy9`,project:`onboarding`})},gscConnected:{label:T._(`Connect Google Search Console`,null,{hk:`MRfIW`,project:`onboarding`}),link:t(`/settings/google_search_console`),timeMinutes:1,cta:T._(`Connect Search Console`,null,{hk:`48IsmL`,project:`onboarding`})},contentAuditVisited:{label:T._(`Audit existing content and find quick wins`,null,{hk:`vXuRh`,project:`onboarding`}),link:a,timeMinutes:3,cta:T._(`See Content Audit`,null,{hk:`1IrZLp`,project:`onboarding`})},aiTrackerVisited:{label:T._(`See if AI mentions your brand`,null,{hk:`iGSvs`,project:`onboarding`}),link:t(`/ai_tracker`),timeMinutes:2,cta:T._(`See AI Visibility`,null,{hk:`2uWnVa`,project:`onboarding`})},contentEditorVisited:{label:T._(`Create content that ranks in AI Search and SEO`,null,{hk:`22LAnq`,project:`onboarding`}),link:t(i?`/drafts/${i.id}`:`/drafts/new`),timeMinutes:10,cta:T._(`Create Content Editor`,null,{hk:`3OlGxt`,project:`onboarding`})}}},Sf=()=>{let{connected:e}=Xa(),t=ln(),{showOnboarding:n,setMyOnboardingChecklist:r,loading:i,onboardingTasks:{workspaceCreated:a,gscConnected:o}}=Wa(),s=t.some(e=>e.workspaces.some(e=>e.type===ht.Branded&&e.state===Rn.Active)),c=n&&!i,l=c&&s&&!a,u=c&&e&&!o;(0,Y.useEffect)(()=>{!l&&!u||r({...l?{workspaceCreated:!0}:{},...u?{gscConnected:!0}:{}})},[l,u,r])};E();
80var Cf=({steps:e,totalChecked:n,totalTasks:r,percentDone:i,onSkip:a,onStepClick:s})=>(0,X.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-solid border-[rgba(255,255,255,0.14)] bg-[rgba(9,9,11,0.98)] shadow-[0_16px_48px_rgba(0,0,0,0.5)] backdrop-blur-xl`,children:[(0,X.jsxs)(`div`,{className:`px-lg pb-base pt-lg`,children:[(0,X.jsxs)(`div`,{className:`mb-sm flex items-center justify-between`,children:[(0,X.jsxs)(`span`,{className:`flex items-baseline gap-xs`,children:[(0,X.jsx)(`span`,{className:`text-md font-bold tracking-tight text-white-base`,children:w._(`Get started`,null,{hk:`2xGRGA`,project:`onboarding`})}),(0,X.jsx)(Bl,{totalChecked:n,totalTasks:r,className:`text-sm text-gray-60`})]}),(0,X.jsx)(Zr,{asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":T._(`Minimize`,null,{hk:`zUzlK`,project:`onboarding`}),className:`grid size-[28px] place-items-center rounded-lg bg-[rgba(255,255,255,0.08)] text-gray-40 transition-colors hover:bg-[rgba(255,255,255,0.16)]`,children:(0,X.jsx)(t,{Component:zr,size:`xsmall`})})})]}),(0,X.jsx)(`div`,{className:`h-[6px] w-full overflow-hidden rounded-full bg-[rgba(255,255,255,0.1)]`,children:(0,X.jsx)(`div`,{className:`size-full origin-left rounded-full bg-green-60 transition-transform duration-500 ease-out`,style:{transform:`scaleX(${i/100})`}})})]}),(0,X.jsx)(`div`,{className:`flex max-h-[380px] flex-col gap-sm overflow-y-auto px-base pb-base`,children:e.map(e=>(0,X.jsx)(wf,{step:e,onClick:()=>s(e.id)},e.id))}),(0,X.jsx)(`div`,{className:`border-t border-[rgba(255,255,255,0.08)] px-lg py-md`,children:(0,X.jsx)(o,{variant:`pure`,className:`text-sm text-gray-60 hover:text-white-base`,onClick:a,children:w._(`Skip checklist`,null,{hk:`3kNJ0u`,project:`onboarding`})})})]}),wf=({step:e,onClick:n})=>{let{config:r,done:i}=e,a=(0,X.jsxs)(`div`,{className:D(`flex w-full items-center gap-base rounded-[10px] p-sm text-left`,`transition-colors duration-100`,!i&&`hover:bg-[rgba(255,255,255,0.06)]`),children:[(0,X.jsx)(Tf,{done:i}),(0,X.jsx)(`span`,{className:D(`min-w-0 flex-1 text-sm leading-tight`,i?`text-gray-60 line-through`:`font-medium text-white-base`),children:r.label}),!i&&r.timeMinutes!=null&&(0,X.jsxs)(`span`,{className:`flex shrink-0 items-center gap-3xs text-xs text-gray-60`,children:[(0,X.jsx)(t,{Component:rr,size:`xsmall`}),w._({"*":`{minutes}m`},[w._param(`minutes`,r.timeMinutes,[0,r.timeMinutes])],{hk:`4xT32f`,project:`onboarding`})]})]});return i?a:r.link?(0,X.jsx)(L,{variant:`pure`,to:r.link,onClick:n,target:r.link.startsWith(`http`)?`_blank`:void 0,className:`block w-full`,children:a}):r.onClick?(0,X.jsx)(o,{variant:`pure`,onClick:()=>{var e;(e=r.onClick)==null||e.call(r),n()},className:`block w-full text-left`,children:a}):a},Tf=({done:e})=>e?(0,X.jsx)(`span`,{"aria-hidden":!0,className:`grid size-[20px] shrink-0 place-items-center rounded-full bg-green-60 text-white-base`,children:(0,X.jsx)(t,{Component:Ya,size:`xsmall`})}):(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-[20px] shrink-0 rounded-full border-2 border-[rgba(255,255,255,0.3)]`}),Ef=(e,t)=>Object.keys(e).map(n=>({id:n,done:!!e[n],config:t[n]})),Df=P({category:`dashboard`,name:`launchpad_opened`}),Of=P({category:`dashboard`,name:`launchpad_collapsed`}),kf=()=>{let{send:e}=F(),{onboardingTasks:t,totalChecked:n,totalTasks:r,percentDone:i,showOnboarding:a,skipOnboarding:o}=Wa(),s=xf(),[c,l]=(0,Y.useState)(!1),u=(0,Y.useMemo)(()=>Ef(t,s),[t,s]);return Sf(),!a||r===0?null:(0,X.jsx)(`div`,{"data-launchpad":!0,className:`absolute inset-x-0 bottom-0 z-[60] flex flex-col justify-end px-md pb-md pr-xs max-md:hidden`,children:(0,X.jsxs)(Qr,{open:c,onOpenChange:t=>{l(t),e(t?Df:Of)},children:[(0,X.jsx)(Xr,{asChild:!0,children:(0,X.jsx)(Gl,{"aria-label":T._(`Open Surfer setup`,null,{hk:`3La4Yf`,project:`onboarding`}),className:`data-[state=closed]:hover:scale-[1.01]`,totalChecked:n,totalTasks:r})}),(0,X.jsx)(Jr,{children:(0,X.jsx)(Yr,{side:`top`,align:`start`,sideOffset:8,padding:[0],zIndex:130,className:`w-[400px] [color-scheme:dark]`,style:{"--popover-background-color":`transparent`},children:(0,X.jsx)(Cf,{steps:u,totalChecked:n,totalTasks:r,percentDone:i,onSkip:()=>{o(),e(yf)},onStepClick:t=>e(bf,{taskId:t,source:`launchpad`})})})})]})})},Af=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>
80(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M3.42987 4.20315C3.35298 4.43382 3.13711 4.58942 2.89395 4.58942C2.6508 4.58942 2.43492 4.43382 2.35803 4.20315L2.25421 3.8917C2.19799 3.72302 2.06562 3.59065 1.89693 3.53442L1.58549 3.4306C1.35481 3.35371 1.19922 3.13784 1.19922 2.89468C1.19922 2.65153 1.35481 2.43565 1.58549 2.35876L1.89693 2.25495C2.06562 2.19872 2.19799 2.06635 2.25421 1.89767L2.35803 1.58622C2.43492 1.35554 2.6508 1.19995 2.89395 1.19995C3.13711 1.19995 3.35298 1.35554 3.42987 1.58622L3.53369 1.89767C3.58992 2.06635 3.72228 2.19872 3.89097 2.25495L4.20241 2.35876C4.43309 2.43565 4.58868 2.65153 4.58868 2.89468C4.58868 3.13784 4.43309 3.35371 4.20241 3.4306L3.89097 3.53442C3.72228 3.59065 3.58992 3.72302 3.53369 3.8917L3.42987 4.20315Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M1.59859 11.7173C1.60137 11.1596 2.05425 10.7089 2.61196 10.7089C3.17174 10.7089 3.62548 11.1628 3.62533 11.7226L3.62386 17.0295L3.62536 17.031L3.62686 17.0325C3.62769 18.4792 4.8088 19.6157 6.19523 19.6157H17.0338C18.472 19.6157 19.6775 18.4267 19.6775 17.031L19.702 6.05271C19.6374 4.66436 18.4839 3.59098 17.1365 3.59098H11.9389C11.3679 3.59098 10.905 3.12811 10.905 2.55713C10.905 1.98615 11.3679 1.52328 11.9389 1.52328H17.0851C19.5055 1.52328 21.5591 3.43526 21.7122 5.8803L21.7322 17.031C21.7322 19.564 19.6021 21.6834 17.0338 21.6834H6.19523C3.67823 21.6834 1.57217 19.6157 1.57217 17.031L1.59859 11.7173Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M15.1376 7.50336C15.6347 7.50336 16.0376 7.9063 16.0376 8.40336V16.5034C16.0376 17.0004 15.6347 17.4034 15.1376 17.4034C14.6406 17.4034 14.2376 17.0004 14.2376 16.5034V8.40336C14.2376 7.9063 14.6406 7.50336 15.1376 7.50336Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M11.5376 10.2034C12.0347 10.2034 12.4376 10.6063 12.4376 11.1034V16.5034C12.4376 17.0004 12.0347 17.4034 11.5376 17.4034C11.0406 17.4034 10.6376 17.0004 10.6376 16.5034V11.1034C10.6376 10.6063 11.0406 10.2034 11.5376 10.2034Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M8.83765 13.8034C8.83765 13.3063 8.4347 12.9034 7.93765 12.9034C7.44059 12.9034 7.03765 13.3063 7.03765 13.8034V16.5034C7.03765 17.0004 7.44059 17.4034 7.93765 17.4034C8.4347 17.4034 8.83765 17.0004 8.83765 16.5034V13.8034Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M7.03779 10.1756C7.41779 10.1756 7.74496 9.90742 7.81948 9.5348L8.00961 8.58413C8.07273 8.26856 8.3194 8.0219 8.63496 7.95878L9.58563 7.76865C9.95825 7.69413 10.2265 7.36696 10.2265 6.98696C10.2265 6.60697 9.95825 6.2798 9.58563 6.20527L8.63496 6.01514C8.3194 5.95203 8.07273 5.70536 8.00961 5.38979L7.81948 4.43912C7.74496 4.06651 7.41779 3.79829 7.03779 3.79829C6.6578 3.79829 6.33063 4.06651 6.25611 4.43912L6.06597 5.38979C6.00286 5.70536 5.75619 5.95203 5.44062 6.01514L4.48995 6.20527C4.11734 6.2798 3.84912 6.60697 3.84912 6.98696C3.84912 7.36696 4.11734 7.69413 4.48995 7.76865L5.44062 7.95878C5.75619 8.0219 6.00286 8.26856 6.06597 8.58413L6.25611 9.5348C6.33063 9.90742 6.6578 10.1756 7.03779 10.1756Z`,fill:`currentColor`})]})),jf=()=>{var e;let{isBrandedWorkspace:t,currentWorkspace:n}=q(),r=N(),{send:i}=F(),a=n==null||(e=n.brandedWorkspaceAiTrackerProject)==null?void 0:e.id,o=!!p(r(`/ai_tracker`)),s=r(t&&a?`/ai_tracker/${a}`:`/ai_tracker`);return(0,X.jsx)(Pi,{to:s,label:T._(`AI Tracker`,null,{hk:`3WUTMa`,project:`common`}),active:o,variant:`tertiary`,icon:Af,onClick:()=>{i(P({category:`other`,name:`sidebar ai tracker clicked`}))}})},Mf=({inDrawer:e=!1})=>{let{send:t}=F(),n=N(),r=!!p(n(`/sites`));return(0,X.jsx)(e?Pi:oo,{icon:bo,to:n(`/sites`),label:T._(`Sites`,null,{hk:`1NOqvB`,project:`common`}),variant:`tertiary`,active:r,onClick:()=>{t(P({category:`other`,name:`sidebar sites clicked`}))}})},Nf=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C15.7912 20 18.9664 17.3629 19.7914 13.8229L19.407 14.2072C19.0164 14.5977 18.3832 14.5976 17.9927 14.207C17.6023 13.8164 17.6024 13.1833 17.9929 12.7928L19.9935 10.7928C20.1811 10.6053 20.4355 10.5 20.7007 10.5C20.9659 10.5 21.2202 10.6054 21.4078 10.793L23.4072 12.793C23.7976 13.1836 23.7975 13.816
807 23.407 14.2072C23.0164 14.5977 22.3832 14.5976 21.9927 14.207L21.7976 14.0118C20.8665 18.5704 16.8338 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C15.67 2 18.8771 3.97759 20.6155 6.92048C20.8964 7.39599 20.7386 8.00919 20.2631 8.29009C19.7876 8.57098 19.1744 8.41322 18.8935 7.9377C17.5 5.57869 14.9338 4 12 4Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M13 7C13 6.44772 12.5523 6 12 6C11.4477 6 11 6.44772 11 7V12C11 12.3344 11.1671 12.6466 11.4453 12.8321L14.4453 14.8321C14.9048 15.1384 15.5257 15.0142 15.8321 14.5547C16.1384 14.0952 16.0142 13.4743 15.5547 13.1679L13 11.4648V7Z`,fill:`currentColor`})]})),Pf=()=>{let{send:e}=F(),t=N(),n=p(`/workspace/:workspaceId/activity_log`);return(0,X.jsx)(oo,{to:t(`/activity_log`),label:T._(`Activity Log`,null,{hk:`40SfXq`,project:`common`}),icon:n?Nf:Zo,onClick:()=>{e(P({category:`other`,name:`sidebar activity log clicked`}))}})},Ff=()=>{let e=N(),{send:t}=F(),n=!!p(e(`/drafts/*`));return(0,X.jsx)(oo,{"data-testid":`sidebar-content-editor`,to:e(`/drafts`),label:T._(`Content Editor`,null,{hk:`4BLNv5`,project:`common`}),icon:n?Fs:Ba,onClick:()=>{t(P({category:`other`,name:`sidebar content editor clicked`}))}})},If=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M12 3V21M7.8 3H16.2C17.8802 3 18.7202 3 19.362 3.32698C19.9265 3.6146 20.3854 4.07354 20.673 4.63803C21 5.27976 21 6.11984 21 7.8V16.2C21 17.8802 21 18.7202 20.673 19.362C20.3854 19.9265 19.9265 20.3854 19.362 20.673C18.7202 21 17.8802 21 16.2 21H7.8C6.11984 21 5.27976 21 4.63803 20.673C4.07354 20.3854 3.6146 19.9265 3.32698 19.362C3 18.7202 3 17.8802 3 16.2V7.8C3 6.11984 3 5.27976 3.32698 4.63803C3.6146 4.07354 4.07354 3.6146 4.63803 3.32698C5.27976 3 6.11984 3 7.8 3Z`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),Lf=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M11 3.6C11 3.03995 11 2.75992 10.891 2.54601C10.7951 2.35785 10.6422 2.20487 10.454 2.10899C10.2401 2 9.96005 2 9.4 2H6.16146C5.63433 1.99998 5.17954 1.99997 4.80497 2.03057C4.40963 2.06287 4.01641 2.13419 3.63803 2.32698C3.07354 2.6146 2.6146 3.07354 2.32698 3.63803C2.13419 4.01641 2.06287 4.40963 2.03057 4.80497C1.99997 5.17954 1.99998 5.63429 2 6.16142V17.8385C1.99998 18.3657 1.99997 18.8205 2.03057 19.195C2.06287 19.5904 2.13419 19.9836 2.32698 20.362C2.6146 20.9265 3.07354 21.3854 3.63803 21.673C4.01641 21.8658 4.40963 21.9371 4.80497 21.9694C5.17954 22 5.6343 22 6.16144 22H9.4C9.96005 22 10.2401 22 10.454 21.891C10.6422 21.7951 10.7951 21.6422 10.891 21.454C11 21.2401 11 20.9601 11 20.4V3.6Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M13 20.4C13 20.9601 13 21.2401 13.109 21.454C13.2049 21.6422 13.3578 21.7951 13.546 21.891C13.7599 22 14.0399 22 14.6 22H17.8386C18.3657 22 18.8205 22 19.195 21.9694C19.5904 21.9371 19.9836 21.8658 20.362 21.673C20.9265 21.3854 21.3854 20.9265 21.673 20.362C21.8658 19.9836 21.9371 19.5904 21.9694 19.195C22 18.8205 22 18.3657 22 17.8386V6.16144C22 5.6343 22 5.17954 21.9694 4.80497C21.9371 4.40963 21.8658 4.01641 21.673 3.63803C21.3854 3.07354 20.9265 2.6146 20.362 2.32698C19.9836 2.13419 19.5904 2.06287 19.195 2.03057C18.8205 1.99997 18.3657 1.99998 17.8386 2H14.6C14.0399 2 13.7599 2 13.546 2.10899C13.3578 2.20487 13.2049 2.35785 13.109 2.54601C13 2.75992 13 3.03995 13 3.6V20.4Z`,fill:`currentColor`})]})),Rf=()=>{let{send:e}=F(),t=N(),n=!!p(`/workspace/:workspaceId/content`),[r]=I(`content_inventory`);return r?(0,X.jsx)(Pi,{to:t(`/content`),label:T._(`Content`,null,{hk:`3l4XfP`,project:`common`}),active:n,variant:`tertiary`,icon:n?Lf:If,onClick:()=>{e(P({category:`other`,name:`sidebar content clicked`}))}}):null},zf=()=>{var e;let{currentWorkspace:t}=q(),n=M(),{user:r}=ze(),i=t==null||(e=t.brandedWorkspaceSitesProject)==null?void 0:e.id,{send:a}=F(),o=N()(i?`/sites/${i}`:`/sites`),s=!!p(o),c=!!p(`${o}/*`),l=s||c,{value:u,set:d}=or(`sidebar_state:content:${n}-${r.id}`,{defaultValue:!1,initializeWithValue:!0});return(0,Y.useEffect)(()=>{l&&d(!1)},[l,d]),(0,X.jsxs)(oa,{open:!u,onOpenChange:e=>d(!e),defaultOpen:!0,children:[(0,X.jsx)(ra,{className:`mt-2xs`,onClick:()=>{a(P({category:`other`,name:`sidebar content clicked`,payloadSchema:U({collapsed:H()})}),{collapsed:!u})},children:w._(`SEO`,null,{hk:`1ZfRRR`,project:`common`})}),(0,X.jsx)(ta,{inert:u,children:(0,X.jsx)(eo,{siteId:i})})]})},Bf=()=>{let{send:e}=F(),t=N(),n=p(`/workspace/:workspaceId/dashboard`);return(0,X.jsx)(oo,{to:t(`/dashboard`),label:T._(`Dashboard`,null,{hk:`40QYMX`,project:`common`}),icon:n?Li:Fi,onClick:()=>{e(P({category:`other`,name:`sidebar dashboard clicked`}))}})},Vf=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M6.5 4.5C6.5 2.567 8.067 1 10 1C11.933 1 13.5 2.567 13.5 4.5V5L13.5343 5C14.2041 4.99999 14.7569 4.99998 15.2095 5.03086C15.6788 5.06288 16.1129 5.13142 16.5307 5.30448C1
807.5108 5.71046 18.2895 6.48915 18.6955 7.46927C18.8686 7.88708 18.9371 8.32118 18.9691 8.79046C18.9837 9.00406 18.9914 9.23999 18.9955 9.5H19.5C21.433 9.5 23 11.067 23 13C23 14.933 21.433 16.5 19.5 16.5H19V17.2413C19 18.0463 19 18.7106 18.9558 19.2518C18.9099 19.8139 18.8113 20.3306 18.564 20.816C18.1805 21.5686 17.5686 22.1805 16.816 22.564C16.3306 22.8113 15.8139 22.9099 15.2518 22.9558C14.7106 23 14.0463 23 13.2413 23H12.5C11.9477 23 11.5 22.5523 11.5 22V20.25C11.5 19.5596 10.9404 19 10.25 19C9.55965 19 9 19.5596 9 20.25V22C9 22.5523 8.55229 23 8 23H6.75868C5.95372 23 5.28936 23 4.74817 22.9558C4.18608 22.9099 3.66937 22.8113 3.18404 22.564C2.43139 22.1805 1.81947 21.5686 1.43597 20.816C1.18868 20.3306 1.09012 19.8139 1.04419 19.2518C0.999977 18.7106 0.999988 18.0463 1 17.2413L1 15.5C1 14.9477 1.44772 14.5 2 14.5H3.5C4.32843 14.5 5 13.8284 5 13C5 12.1716 4.32843 11.5 3.5 11.5H2C1.44772 11.5 1 11.0523 1 10.5L1 10.4657C0.999992 9.79594 0.999984 9.24307 1.03087 8.79046C1.06288 8.32118 1.13142 7.88708 1.30448 7.46927C1.71046 6.48915 2.48915 5.71046 3.46927 5.30448C3.88708 5.13142 4.32118 5.06288 4.79046 5.03086C5.24307 4.99998 5.79594 4.99999 6.46573 5L6.5 5L6.5 4.5Z`,fill:`currentColor`})]})),Hf=()=>{let{send:e}=F(),t=N(),n=!!p(`/workspace/:workspaceId/mcp_api`);return(0,X.jsx)(Pi,{to:t(`/mcp_api`),label:T._(`MCP & API`,null,{hk:`xjtSo`,project:`common`}),icon:n?Vf:Ls,variant:`tertiary`,onClick:()=>{e(P({category:`other`,name:`sidebar mcp & api clicked`}))}})},Uf=()=>{let{send:e}=F(),t=M(),{isBrandedWorkspace:n}=q(),{user:r}=ze(),{value:i,set:a}=or(`sidebar_state:tools:${t}-${r.id}`,{defaultValue:!1,initializeWithValue:!0});return(0,X.jsxs)(oa,{open:!i,onOpenChange:e=>a(!e),defaultOpen:!0,children:[(0,X.jsx)(ra,{className:`mt-2xs`,onClick:()=>{e(P({category:`other`,name:`sidebar more tools clicked`,payloadSchema:U({collapsed:H()})}),{collapsed:!i})},children:n?T._(`More tools`,null,{hk:`2FtD6`,project:`common`}):T._(`Tools`,null,{hk:`2JeEzw`,project:`common`})}),(0,X.jsx)(ta,{inert:i,children:(0,X.jsx)(`div`,{className:`flex flex-col gap-3xs`,children:ou.map((e,t)=>(0,X.jsx)(Wf,{item:e},`nav-item-${e.to}-${t}`))})})]})},Wf=({item:e})=>{let{send:t}=F(),{isOnTrial:n}=Pr(),{featureFlags:r}=vr(),{isEurCurrency:i}=wr(),{isBrandedWorkspace:a}=q(),o=N(),s=rd(),c=S(),l=e=>{t(P({category:`tools`,name:`sidebar navigation item clicked`,payloadSchema:U({value:V()})}),{value:e})};if(e.to===`/rank_tracker`&&i||e.hideOnTrial&&n||e.requireFeatureFlag&&!(r!=null&&r[e.requireFeatureFlag])||e.requireAccess&&!s[e.requireAccess]||e.hideOnBrandedWorkspaces&&a)return null;let u=c.pathname.startsWith(o(e.to)),d=(0,X.jsx)(Pi,{to:o(e.to),label:e.translatedLabel,onClick:()=>l(e.label),badge:e.badge,icon:u?e.activeIcon:e.icon,disabled:e.requireAccess?!s[e.requireAccess]:!1,variant:`tertiary`});return e.wrapper?e.wrapper(d):d},Gf=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M9 18L2 22V6L9 2M9 18L16 22M9 18V2M16 22L22 18V2L16 6M16 22V6M16 6L9 2`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),Kf=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M8 2.79822C8 2.34553 8 2.11918 7.9049 1.98792C7.82194 1.87342 7.69439 1.79939 7.55381 1.78417C7.39266 1.76673 7.19614 1.87903 6.80309 2.10363L1.50386 5.13176C1.19229 5.3098 1 5.64114 1 6V22C1 22.3565 1.18976 22.686 1.49807 22.8649C1.80639 23.0438 2.18664 23.0451 2.49614 22.8682L7.19382 20.1839C7.48744 20.0161 7.63425 19.9322 7.74106 19.8143C7.83555 19.71 7.90697 19.5869 7.95064 19.4531C8 19.3019 8 19.1328 8 18.7947L8 2.79822Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M10 18.7947C10 19.1328 10 19.3019 10.0494 19.4531C10.093 19.5869 10.1644 19.71 10.2589 19.8143C10.3658 19.9322 10.5126 20.0161 10.8062 20.1839L13.8031 21.8964C14.1961 22.121 14.3927 22.2333 14.5538 22.2158C14.6944 22.2006 14.8219 22.1266 14.9049 22.0121C15 21.8808 15 21.6545 15 21.2018L15 5.20534C15 4.86716 15 4.69808 14.9506 4.54686C14.907 4.41306 14.8356 4.29 14.7411 4.1857C14.6342 4.06782 14.4874 3.98393 14.1938 3.81615L11.1969 2.10363C10.8039 1.87903 10.6073 1.76673 10.4462 1.78417C10.3056 1.79939 10.1781 1.87342 10.0951 1.98792C10 2.11918 10 2.34553 10 2.79822L10 18.7947Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M23 2C23 1.63121 22.797 1.29235 22.4719 1.11833C22.1467 0.944308 21.7522 0.96338 21.4453 1.16795L17.7125 3.6565C17.452 3.83016 17.3217 3.91699 17.2275 4.03171C17.144 4.13327 17.0814 4.25029 17.0431 4.37608C17 4.51817 17 4.67471 17 4.98778L17 21.0404C17 21.526 17 21.7687 17.1012 21.9026C17.1894 22.0192 17.3243 22.0913 17.4702 22.1C17.6377 22.11 17.8397 21.9754 18.2438 21.706L22.5547 18.8321C22.8329 18.6466 23 18.3344 23 18V2Z`,fill:`currentColor`})]})),qf=()=>{let{send:e}=F(),t=N(),n=!!p(`/workspace/:workspaceId/topical_map/*`),[r]=I(`topical_map_v2`);return r?(0,X.jsx)(Pi,{to:t(`/topical_map`),label:T._(`Topical Map`,null,{hk:`e20VY`,project:`topical-map`}),active:n,variant:`tertiary`,icon:n?Kf:Gf,onClick:()=>{e(P({category:`other`,name:`sidebar topical map clicked`}))}}):null},Jf=()=>{let{send:e}=F();return(0,X.jsx)(Pi,{active:h(`/workspace/:workspaceId/ai_volatility`,S().pathname)!==null,to:`/ai_volatility`,label:T._(`Volatility`,null,{hk:`3tAlVe`,project:`ai-volatility-score`}),icon:Qa,variant:`tertiary`,onClick:()=>{e(So,{sidebar_item:`volatility`})}})},Yf=()=>{var e;let t=N(),{currentWorkspace:n}=q(),{user:r}=ze(),i=n==null||(e=n.brandedWorkspaceAiTrackerProject)==null?void 0:e.id,a=M(),{hasFinished:o,isGenerating:s}=Rs({enabled:!i}),c=!i&&o,l=(0,Y.useCallback)(e=>t(`/ai_tracker/${i}${e&&e.length>0?`/${e}
80`:``}`),[i,t]),u=t(i?`/ai_tracker/${i}`:`/ai_tracker`),d=!!p(u),f=!!p(`${u}/*`),m=d||f,{value:h,set:g}=or(`sidebar_state:visibility:${a}-${r.id}`,{defaultValue:!1,initializeWithValue:!0});return(0,Y.useEffect)(()=>{m&&g(!1)},[m,g]),(0,X.jsxs)(oa,{open:!h,onOpenChange:e=>g(!e),defaultOpen:!0,children:[(0,X.jsxs)(`div`,{className:`mt-2xs flex items-center justify-between pr-xs`,children:[(0,X.jsx)(ra,{children:w._(`AI Visibility`,null,{hk:`3DBNBI`,project:`common`})}),s?(0,X.jsx)(Xf,{}):c&&(0,X.jsx)(Zf,{})]}),(0,X.jsxs)(ta,{inert:h,className:i?void 0:`opacity-50`,children:[(0,X.jsx)(yo,{aiTrackerId:i,projectPath:l}),(0,X.jsx)(Jf,{})]})]})},Xf=()=>{let e=N()(`/ai_tracker/configure`);return(0,X.jsx)(b,{side:`right`,align:`start`,sideOffset:8,delayDuration:150,arrow:{className:`fill-white-base`,padding:16},portalled:!0,className:`max-w-[320px] gap-base rounded-2xl border border-gray-20 bg-white-base p-lg text-gray-base shadow-lg`,content:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(`span`,{className:`text-[10px] font-bold uppercase leading-[14px] text-primary`,children:w._(`In progress`,null,{hk:`uzdAB`,project:`common`})}),(0,X.jsx)(`span`,{className:`text-base font-semibold text-gray-160`,children:w._(`Collecting prompts for your brand`,null,{hk:`1WiAUJ`,project:`common`})}),(0,X.jsx)(`span`,{className:`text-sm font-normal leading-[20px] text-gray-100`,children:w._(`Surfer is building your prompt list from your brand and category`,null,{hk:`4nYQV5`,project:`common`})}),(0,X.jsx)(L,{to:e,state:{disabledSteps:[Bs.BRAND_NAME,Bs.LOCALE],step:Bs.PROMPTS},size:`xsmall`,icon:Ps,rightIcon:!0,className:`mt-xs self-start bg-primary px-sm text-md text-white-base hover:bg-purple-80`,children:w._(`Check status`,null,{hk:`3JyX83`,project:`common`})})]}),children:(0,X.jsx)(`span`,{tabIndex:0,"aria-label":T._(`Collecting prompts for your brand`,null,{hk:`19vTBp`,project:`common`}),className:`-mx-xs -my-md flex items-center px-xs py-md`,children:(0,X.jsx)(qo,{from:`var(--purple-20)`,to:`var(--purple-70)`})})})},Zf=()=>{let e=N()(`/ai_tracker`);return(0,X.jsx)(b,{side:`right`,align:`start`,sideOffset:8,delayDuration:150,arrow:{className:`fill-white-base`,padding:16},portalled:!0,className:`max-w-[320px] gap-base rounded-2xl border border-gray-20 bg-white-base p-lg text-gray-base shadow-lg`,content:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(`span`,{className:`text-[10px] font-bold uppercase leading-[14px] text-primary`,children:w._(`Setup needed`,null,{hk:`3MM388`,project:`common`})}),(0,X.jsx)(`span`,{className:`text-base font-semibold text-gray-160`,children:w._(`AI Visibility needs setup`,null,{hk:`1E7ybK`,project:`common`})}),(0,X.jsx)(`span`,{className:`text-sm font-normal leading-[20px] text-gray-100`,children:w._(`Set up tracking to unlock Overview, Sources, Competitors and the rest of AI Visibility.`,null,{hk:`11OrP7`,project:`common`})})]}),(0,X.jsx)(L,{to:e,size:`xsmall`,icon:Ps,rightIcon:!0,className:`self-start bg-primary px-sm text-md text-white-base hover:bg-purple-80`,children:w._(`Set up AI Tracker`,null,{hk:`1UPmK7`,project:`common`})})]}),children:(0,X.jsx)(_e,{to:e,"aria-label":T._(`Set up AI Tracker`,null,{hk:`4C9pCp`,project:`common`}),className:`no-underline`,children:(0,X.jsx)(Ei,{color:`primary`,variant:`outline`,size:`small`,className:`bg-primary/10 uppercase`,children:w._(`Setup`,null,{hk:`dRcfg`,project:`common`})})})})},Qf=({children:e,title:t,content:n})=>{let[r,i]=(0,Y.useState)(!1),{pathname:a}=S(),o=W(Ea.maxMd);return(0,Y.useEffect)(()=>{i(!1)},[a,o]),(0,X.jsxs)(Ji,{open:r&&!!o,onOpenChange:i,children:[(0,X.jsx)(Ki,{children:e}),(0,X.jsxs)(Yi,{className:`inset-0 h-dvh w-full translate-x-0 translate-y-full overflow-hidden data-[state=closed]:animate-[slideDownOut_0.3s_cubic-bezier(0.4,0,0.2,1)_forwards] data-[state=open]:animate-[slideUpIn_0.3s_cubic-bezier(0.4,0,0.2,1)_forwards] [&>div]:bg-black`,children:[(0,X.jsx)(ci,{children:(0,X.jsx)(Gi,{children:(0,X.jsx)(Xi,{children:t})})}),(0,X.jsx)(Zi,{className:`h-full overflow-y-auto px-lg py-base`,children:n}),(0,X.jsx)(`div`,{className:`sticky bottom-0 z-[1] flex w-full grow items-center justify-center bg-black`,children:(0,X.jsx)(qi,{size:`base`,className:`mt-auto py-base text-gray-80 [&>svg]:size-2xl`})})]})]})},$f=({children:e})=>{let{isBrandedWorkspace:t}=q(),{setNode:n}=(0,Y.use)(Ri),r=p(`/workspace/:workspaceId/sites/:siteId/*`),i=t?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Rf,{}),(0,X.jsx)(zf,{}),(0,X.jsx)(Yf,{})]}):r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Mf,{inDrawer:!0}),(0,X.jsx)(`div`,{ref:n}),(0,X.jsx)(jf,{})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(jf,{}),(0,X.jsx)(Hf,{}),(0,X.jsx)(`div`,{ref:n})]});return(0,X.jsx)(Qf,{title:T._(`More`,null,{hk:`27oGHM`,project:`common`}),content:(0,X.jsxs)(X.Fragment,{children:[t&&(0,X.jsx)(qf,{}),i,(0,X.jsx)(Uf,{})]}),children:e})},ep=(0,Y.forwardRef)(function(e,t){return(0,X.jsx)(oo,{ref:t,label:T._(`More`,null,{hk:`2fs808`,project:`common`}),className:`md:hidden`,icon:Vs,...e})}),tp=()=>(0,X.jsx)(`div`,{className:`flex w-full shrink-0 grow-0 flex-col gap-3xs`,children:Xu().map(e=>{let t=e.items.filter(e=>e.condition!==!1);return t.length===0?null:(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsx)(sl,{label:e.translatedTitle,className:`pb-sm pl-xs pt-base`}),t.map(e=>e.accessRestrictionContext?(0,X.jsx)(np,{item:e,accessRestrictionContext:e.accessRestrictionContext},e.label):(0,X.jsx)(rp,{item:e},e.label))]},e.title)})}),np=({item:e,accessRestrictionContext:t})=>{let{canUse:n}=Vr();return(0,X.jsx)(Ca,{context:t,haveAccess:n(e.accessRestrictionContext),side:`right`,buttonChild:!0,children:(0,X.jsx)(rp,{item:e,disabled:!n(e.accessRestrictionContext)})},e.label)},rp=({item:e,disabled:t=!1})=>{let n=N(),{send:r}=F();return(0,X.jsx)(Pi,{className:`pl-sm`,variant:`tertiary`,to:t?void 0:n(e.to),label:e.translatedLabel,"data-testid":e.testId,onClick:()=>{r(P({category:`settings`,name:`sidebar navigation item clicked`,payloadSchema:U({value:V()})}),{value:e.label})}},e.label)},ip=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M22 10H2M11 14H6M2 8.2L2 15.8C2 16.9201 2 17.4802 2.21799 17.908C2.40973 18.2843 2.71569 18.5903 3.09202 18.782C3.51984 19 4.07989 19 5.2 19L18.8 19C19.9201 19 20.4802 19 20.908 18.782C21.2843 18.5903 21.5903 18.2843 21.782 17.908C22 17.4802 22 16.9201 22 15.8V8.2C22 7.0799 22 6.51984 21.782 6.09202C21.5903 5.7157 21.2843 5.40974 20.908 5.21799C20.4802 5 19.9201 5 18.8 5L5.2 5C4.0799 5 3.51984 5 3.09202 5.21799C2.7157 5.40973 2.40973 5.71569 2.21799 6.09202C2 6.51984 2 7.07989 2 8.2Z`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),ap=()=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`sticky top-0 z-[100] w-full bg-gray-160 max-md:hidden`,children:(0,X.jsx)(Pi,{variant:`tertiary`,to:N()(`/dashboard`),label:T._(`Back to app`,null,{hk:`3tA3b3`,project:`common`}),icon:Hs})}),(0,X.jsx)(`div`,{className:`max-md:hidden`,children:(0,X.jsx)(tp,{})}),(0,X.jsx)(op,{})]}),op=()=>(0,X.jsxs)(`div`,{className:`flex size-full gap-3xs md:hidden`,children:[(0,X.jsx)(Bf,{}),(0,X.jsx)(sp,{to:`/settings/subscription`,label:T._(`Billing`,null,{hk:`1qltGg`,project:`common`}
80),icon:ip,matchPath:`/workspace/:workspaceId/settings/subscription`}),(0,X.jsx)(sp,{to:`/settings/organization`,label:T._(`Organization`,null,{hk:`1XKyBf`,project:`common`}),icon:Us,matchPath:`/workspace/:workspaceId/settings/organization`}),(0,X.jsx)(Qf,{title:T._(`More settings`,null,{hk:`3Y4nDt`,project:`common`}),content:(0,X.jsx)(tp,{}),children:(0,X.jsx)(ep,{})})]}),sp=({to:e,label:t,icon:n,matchPath:r})=>{let i=N(),a=!!p(r);return(0,X.jsx)(oo,{to:i(e),label:t,active:a,icon:n})},cp=()=>{let{isWorkspaceActive:e,isWorkspaceDisabled:t}=q(),n=p(`/workspace/:workspaceId/settings/*`),{isNewUser:r}=G();return(r||!e&&!t)&&!n?null:(0,X.jsx)(lp,{children:n?(0,X.jsx)(ap,{}):(0,X.jsx)(up,{})})},lp=({children:e})=>(0,X.jsxs)(`div`,{className:`group/sidebar relative flex h-full px-sm pb-sm [color-scheme:dark] md:h-full md:p-2xs md:py-sm`,children:[(0,X.jsx)(`div`,{className:`relative size-full overflow-auto bg-gray-160 p-0 md:pl-sm`,children:(0,X.jsx)(al,{className:`relative w-full flex-row justify-between rounded-lg`,children:(0,X.jsx)(ol,{className:`dark-scrollbar scrollbar-stable w-full md:w-[224px] md:px-0`,children:(0,X.jsx)(`div`,{className:`flex w-full flex-row gap-3xs max-md:h-full md:flex-col md:group-has-[[data-launchpad]]/sidebar:pb-[88px]`,children:e})})})}),(0,X.jsx)(kf,{})]}),up=()=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(dp,{}),(0,X.jsx)(fp,{})]}),dp=()=>{var e;let{isBrandedWorkspace:t,currentWorkspace:n}=q(),r=n==null||(e=n.brandedWorkspaceSitesProject)==null?void 0:e.id;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Bf,{}),t?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ao,{siteId:r}),(0,X.jsx)(Ff,{}),(0,X.jsx)(Pf,{})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ff,{}),(0,X.jsx)(Pf,{}),(0,X.jsx)(Mf,{})]}),(0,X.jsx)($f,{children:(0,X.jsx)(ep,{})})]})},fp=()=>{let{isBrandedWorkspace:e}=q();return(0,X.jsxs)(`div`,{className:`max-md:hidden`,children:[e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(qf,{}),(0,X.jsx)(Hf,{}),(0,X.jsx)(Rf,{}),(0,X.jsx)(zf,{}),(0,X.jsx)(Yf,{})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`empty:hidden`,id:no}),(0,X.jsx)(jf,{}),(0,X.jsx)(`div`,{className:`empty:hidden`,id:Eo}),(0,X.jsx)(Hf,{})]}),(0,X.jsx)(Uf,{})]})},pp=()=>{let[e,t]=(0,Y.useState)(!1),n=re.get(`manifest_url`),r=l();return n==null&&!r||e?null:(0,X.jsxs)(hr,{color:`warning`,title:T._(`Warning!`,null,{hk:`2GDk3h`,project:`common`}),variant:`banner`,closeIcon:!0,onClose:()=>{t(!0)},children:[(0,X.jsxs)(`div`,{className:`flex grow flex-col gap-2xs text-md`,children:[n!=null&&(0,X.jsx)(`div`,{children:T._(`You are previewing the build from: {manifestFileName}`,[T._param(`manifestFileName`,n.split(`/`).pop()??``)],{hk:`1o18tn`,project:`common`})}),r&&(0,X.jsx)(`div`,{children:y===`en-US`?T._(`You are previewing translations published from the i18n panel - switch the app language to see them.`,null,{hk:`4b0KIv`,project:`common`}):T._(`You are previewing translations published from the i18n panel for language: {language}`,[T._param(`language`,ee)],{hk:`1041UR`,project:`common`})})]}),(0,X.jsx)(ir,{children:(0,X.jsx)(o,{variant:`secondary`,size:`xsmall`,onClick:()=>{re.remove(`manifest_url`),te(),window.location.reload()},className:`ml-sm`,children:w._(`Go back to current staging`,null,{hk:`2tuvmd`,project:`common`})})})]})},mp=U({status:pa([`ok`,`outage`]),message:V().optional(),date:V().optional()}),hp=300*1e3,gp=`status-banner-dismissed`,_p=()=>{var e,t;if((e=window.APP_ENV)!=null&&e.page_status_worker_url)return window.APP_ENV.page_status_worker_url;switch((t=window.APP_ENV)==null?void 0:t.env){case`staging`:case`dev`:return`https://page-status-staging.surferseo.com`;default:return`https://page-status.surferseo.com`}},vp=()=>{let[e,t]=(0,Y.useState)(null),[n,r]=(0,Y.useState)(!1),i=async()=>{try{let e=_p(),n=await(await fetch(`${e}/banner`)).json(),i=mp.parse(n);if(t(i),i.status===`outage`&&i.date){let e=`${gp}-${i.date}`;r(localStorage.getItem(e)===`true`)}else r(!1)}catch(e){console.error(`Failed to fetch status:`,e),t(null)}};return(0,Y.useEffect)(()=>{i();let e=setInterval(i,hp);return()=>clearInterval(e)},[]),!e||e.status===`ok`||n?null:(0,X.jsx)(hr,{className:`relative col-span-full row-span-full`,color:`warning`,title:`Service Status`,variant:`banner`,description:e.message,closeIcon:!0,onClose:()=>
80{if((e==null?void 0:e.status)===`outage`&&e.date){let t=`${gp}-${e.date}`;localStorage.setItem(t,`true`),r(!0)}}})},yp=8,bp=({children:e})=>{let t=(0,Y.useRef)(null);return(0,X.jsx)(`div`,{ref:(0,Y.useCallback)(e=>{var n;if((n=t.current)==null||n.disconnect(),!e){document.documentElement.style.setProperty(`--layout-banner-height`,`${yp}px`),t.current=null;return}let r=()=>document.documentElement.style.setProperty(`--layout-banner-height`,`${e.getBoundingClientRect().height+yp||yp}px`);r();let i=new ResizeObserver(r);i.observe(e),t.current=i},[]),className:`grid grid-cols-1 grid-rows-1 [grid-area:banner] [&>*]:relative [&>*]:col-span-full [&>*]:row-span-full [&>div]:p-xs`,children:e})},xp=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:36,height:35,viewBox:`0 0 36 35`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M4.36489 27.0616C7.57019 27.1331 13.3228 24.8489 15.7403 23.0809C20.6335 19.5025 21.0276 18.0828 23.2765 14.63C25.2819 11.2094 26.0872 9.02215 26.5944 6.47598`,stroke:`#FF5B49`,strokeWidth:2,strokeLinecap:`round`}),(0,X.jsx)(`path`,{d:`M30.0784 16.8362C29.4164 12.1578 29.2798 11.7989 28.3732 7.18593C28.1953 6.36809 28.1507 4.91736 27.6661 4.19573C27.3389 3.70847 25.9699 4.90735 25.6266 5.14179C22.9377 6.97776 20.0902 9.13404 17.4844 11.331`,stroke:`#FF5B49`,strokeWidth:2,strokeLinecap:`round`})]})),Sp=320,Cp=({onClose:e})=>{let{isOnTrial:n}=Pr(),[r,i]=(0,Y.useState)(!0),{isSubscriptionActive:a}=Er(),o=Lo();return(0,Y.useEffect)(()=>{let e=_r(()=>{let e=document.querySelector(`[data-scroll-element]`);e&&i(e.scrollTop<=Sp)},100),t=document.querySelector(`[data-scroll-element]`);return t&&t.addEventListener(`scroll`,e),()=>{t&&(t.removeEventListener(`scroll`,e),e.cancel())}},[]),n||!a||!o?null:(0,X.jsx)(Jo,{children:r&&(0,X.jsx)(Ko.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:80},transition:{duration:.3,ease:`easeInOut`},className:`absolute bottom-base left-base z-[140] w-[184px]`,children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`button`,{type:`button`,className:`absolute right-[-5px] top-[-5px] z-[141] size-[20px] rounded-full bg-gray-140 p-0 text-white-base hover:bg-gray-120`,onClick:e,children:(0,X.jsx)(t,{Component:Ai,size:`small`})}),(0,X.jsx)(Ws,{children:e=>(0,X.jsx)(L,{variant:`pure`,to:e,className:`hover:opacity-100`,children:(0,X.jsxs)(`div`,{className:`relative flex w-full items-end justify-between rounded-md bg-gray-160 p-sm px-base py-md font-semibold text-black`,children:[(0,X.jsx)(`div`,{className:`flex-1 leading-none tracking-[-0.32px] text-white-base`,children:w._(`Scale {=m1} faster with Surfer AI`,[w._implicitParam(`=m1`,(0,X.jsx)(`br`,{}))],{hk:`2GHybu`,project:`common`})}),(0,X.jsx)(`div`,{className:`flex flex-col items-end text-xs leading-none`,children:w._(`{=m0}{=m1}{=m2}`,[w._implicitParam(`=m0`,(0,X.jsx)(`div`,{className:`text-[.625rem] font-medium text-gray-60`,children:w._(`Now from`,null,{hk:`IWEbU`,project:`common`})})),w._implicitParam(`=m1`,(0,X.jsx)(`div`,{className:`flex font-bold tracking-tighter text-white-base`,children:w._(`{=m1}{=m2}`,[w._implicitParam(`=m1`,(0,X.jsx)(`div`,{className:`pt-0 font-semibold leading-tight`,children:w._(`$`,null,{hk:`1epLFk`,project:`common`})})),w._implicitParam(`=m2`,(0,X.jsx)(`div`,{className:`text-2xl font-semibold leading-none`,children:w._(`9`,null,{hk:`30B7iE`,project:`common`})}))],{hk:`SAukJ`,project:`common`})})),w._implicitParam(`=m2`,(0,X.jsx)(`div`,{className:`text-[.625rem] font-medium text-gray-60`,children:w._(`/AI credit`,null,{hk:`49ee1e`,project:`common`})}))],{hk:`3cBVta`,project:`common`})}),(0,X.jsx)(t,{Component:xp,className:`absolute bottom-xs right-[60px] top-[30px] size-[36px]`})]})})})]})})})};E();var wp=[`bg-gray-160 relative grid h-screen overflow-hidden`,`grid-cols-[1fr] grid-rows-[auto_auto_1fr_auto]`,`[grid-template-areas:'banner'_'bar'_'main'_'sidebar']`,`md:grid-cols-[auto_1fr] md:grid-rows-[auto_auto_1fr]`,`md:[grid-template-areas:'banner_banner'_'bar-over-sidebar_bar'_'sidebar_main']`].join(` `),Tp=({children:e})=>{let{shouldHideSidebar:t,shouldHideTopBar:n}=Ra(),r=N(),i=!!p({path:r(`/drafts/:draftIdOrWizard`),end:!1}),{isMinimized:a,setIsMinimized:o}=Sl(),s=!!p(r(`/dashboard`)),{showOnboarding:c}=zl();return(0,X.jsx)(Ii,{children:(0,X.jsxs)(`div`,{className:O(wp),children:[(0,X.jsxs)(bp,{children:[(0,X.jsx)(xu,{}),(0,X.jsx)(kl,{}),(0,X.jsx)(Tl,{}),(0,X.jsx)(Il,{}),(0,X.jsx)(vp,{}),(0,X.jsx)(pp,{})]}),!n&&(0,X.jsx)(gf,{}),!t&&(0,X.jsx)(Za,{children:(0,X.jsx)(`div`,{"data-sidebar":!0,className:`h-full overflow-hidden bg-gray-160 [grid-area:sidebar] sm:px-0`,children:(0,X.jsx)(cp,{})})}),(0,X.jsx)(Yl,{}),(0,X.jsxs)(`div`,{className:`relative flex flex-col overflow-hidden p-sm [grid-area:main]`,children:[!a&&s&&!c?(0,X.jsx)(Cp,{onClose:()=>{o(!0)}}):null,(0,X.jsxs)(`div`,{"data-scroll-element":!0,className:D(`relative flex-1 overflow-auto rounded-xl [color-scheme:light] has-[[data-onboarding-layout]]:bg-transparent has-[[data-onboarding-layout]]:px-0`,i?`bg-gray-5`:`bg-white-base px-base sm:px-lg`),children:[e,(0,X.jsx)(gu,{})]})]})]})})},Ep=({children:e})=>{let{isOrganizationLoading:t}=xn();return t?(0,X.jsx)(oe,{id:`organization`}):e},Dp=400,Op=700,kp=()=>{let e=m().state===`loading`,[t,n]=(0,Y.useState)(!1),r=(0,Y.useRef)(void 0),i=(0,Y.useRef)(void 0),a=(0,Y.useRef)(0);return(0,Y.useEffect)(()=>
80{if(e)clearTimeout(i.current),t||(r.current=setTimeout(()=>{a.current=Date.now(),n(!0)},Dp));else{if(clearTimeout(r.current),!t)return;let e=Op-(Date.now()-a.current);e>0?i.current=setTimeout(()=>n(!1),e):n(!1)}return()=>{clearTimeout(r.current),clearTimeout(i.current)}},[e,t]),t?(0,X.jsx)(`div`,{className:`fixed left-0 top-0 z-[120] w-full`,children:(0,X.jsx)(Ni,{indeterminate:!0,size:`3xs`,color:`brand-violet`,trackColor:`transparent`})}):null},Ap=()=>{let{user:e}=ze(),{signOut:t}=Uu(),{data:n}=an(),r=n==null?void 0:n.userProfile;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-center gap-sm`,children:[(0,X.jsx)(es,{src:r==null?void 0:r.avatar,name:(r==null?void 0:r.name)??(e==null?void 0:e.email)??``,size:`base`}),(0,X.jsx)(`span`,{className:`text-md font-medium text-gray-100`,children:e.email})]}),(0,X.jsx)(o,{size:`small`,variant:`text`,onClick:t,children:w._(`Sign out`,null,{hk:`hziT3`,project:`common`})})]})},jp=({message:e,actionSlot:t,inSharedApp:n})=>{let r=!Dr();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Gs,{text:T._(`404`,null,{hk:`3e29Vb`,project:`common`})}),(0,X.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,X.jsxs)(Ui,{children:[(0,X.jsx)(Hi,{children:r?(0,X.jsx)(z,{to:`/dashboard`,state:{fromNotFound:!0},children:(0,X.jsx)(cs,{onlyBrandmark:!0})}):null}),(0,X.jsx)(Bi,{children:n?null:(0,X.jsx)(Ap,{})})]}),(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-md`,children:[(0,X.jsx)(`div`,{className:`text-[4.75rem] font-semibold leading-none text-black`,children:w._(`404`,null,{hk:`1Uxtdj`,project:`common`})}),(0,X.jsx)(`div`,{className:`text-lg text-black`,children:e||w._(`Oops! We couldnât find this page`,null,{hk:`3i05tl`,project:`common`})}),!e&&(0,X.jsx)(`div`,{children:w._(`This page does not exist or you do not have access to it.`,null,{hk:`2w2Qki`,project:`common`})}),(0,X.jsx)(`div`,{className:`flex gap-base pt-lg`,children:n?null:t||(0,X.jsx)(L,{size:`small`,to:`/dashboard`,state:{fromNotFound:!0},children:w._(`Go to Homepage`,null,{hk:`14CmGW`,project:`common`})})})]})]})]})},Mp=4e3,Np=200,Pp=()=>{let e=kt(),t=vn(e),{data:n,loading:r}=Re({skip:!e}),[i]=Ve(),[a]=$e(),[o,s]=(0,Y.useState)(`pending`),c=(0,Y.useRef)(!1);Mn(e&&o!==`revealed`);let l=(0,Y.useCallback)(e=>i({variables:{consent:kn(e)}}),[i]),u=Rr(()=>{let e=lt();(e.answered||e.implicit)&&!Lt(e,(n==null?void 0:n.privacyConsent)??null)&&l(e)},Np);return(0,Y.useEffect)(()=>{if(!e)return;let t=qt(u);return()=>{t(),u.cancel()}},[e,u]),(0,Y.useEffect)(()=>{if(!e||r||c.current)return;let t=lt();n!=null&&n.privacyConsent||t.answered||t.implicit||(c.current=!0,a())},[e,r,n,a]),(0,Y.useEffect)(()=>{if(!e||o!==`pending`)return;let t=window.setTimeout(()=>{De()},Mp);return()=>window.clearTimeout(t)},[e,o]),(0,Y.useEffect)(()=>{if(!e||!t||r||o!==`pending`)return;let i=(n==null?void 0:n.privacyConsent)??null,a=lt(),c=bn(a,i);switch(c.action){case`restore`:Ke(c.categories),s(`restored`);break;case`push`:Lt(a,i)||l(a),s(`revealed`);break;case`none`:s(`revealed`);break}yl()},[e,t,r,o,n,l]),null},Fp=Symbol(`ON_NAVIGATION`),Ip=Symbol(`NOW`),Lp=Symbol(`NONE`),Rp=()=>(0,X.jsx)(Zn,{children:w._(`We updated the Surfer app.`,null,{hk:`2y29yh`,project:`common`})}),zp=()=>(0,X.jsx)(Zn,{children:w._(`Application Update`,null,{hk:`43haSM`,project:`common`})}),Bp=()=>w._(`That means our dev team has just improved the performance of Surfer for your better experience ðª Refresh the page or click the "Reload" button to update for the most recent version. Cheers!`,null,{hk:`qis9v`,project:`common`}),Vp=()=>w._(`Our dev team has just improved the performance of the application for your better experience ðª Refresh the page or click the "Reload" button to update for the most recent version. Cheers!`,null,{hk:`2UMCQk`,project:`common`}),Hp=()=>{let e=Dr();return(0,X.jsx)(Jn,{open:!0,children:(0,X.jsxs)(Kn,{size:`base`,children:[(0,X.jsx)($n,{hideClose:!0,children:e?(0,X.jsx)(zp,{}):(0,X.jsx)(Rp,{})}),(0,X.jsx)(qn,{children:e?(0,X.jsx)(Vp,{}):(0,X.jsx)(Bp,{})}),(0,X.jsx)(cr,{hideSeparator:!0,children:(0,X.jsx)(o,{onClick:()=>window.location.reload(!0),children:w._(`Reload`,null,{hk:`4rKakZ`,project:`common`})})})]})})},Up=e=>e.reload===Ip?(0,X.jsx)(Hp,{}):null,Wp=e=>(0,X.jsx)(Gp,{location:S(),reload:e.reload,children:e.children}),Gp=e=>{let t=ws(e.location);return e.reload===Fp&&e.location.pathname!==(t==null?void 0:t.pathname)?(window.location.reload(!0),(0,X.jsx)(C,{})):(0,X.jsx)(X.Fragment,{children:e.children})},Kp=({filter:e})=>{let t=S(),n=ws(t);return(0,Y.useEffect)(()=>
80{if(t.pathname!==(n==null?void 0:n.pathname)&&!t.hash&&((e==null?void 0:e(t,n))??!0)){var r;window.scrollTo(0,0),(r=document.querySelector(`[data-scroll-element]`))==null||r.scrollTo(0,0)}},[t,e,n]),null},qp=null,Jp=!1,Yp=e=>{if(qp!==e){var t;(t=window.analytics)==null||t.page(),qp=e}},Xp=1e3,Zp=()=>{let e=S(),t=(0,Y.useRef)(null),n=e.pathname+e.search;return(0,Y.useEffect)(()=>{if(!Jp)return t.current!==null&&window.clearTimeout(t.current),t.current=window.setTimeout(()=>{Yp(n)},Xp),()=>{t.current!==null&&(window.clearTimeout(t.current),t.current=null)}},[n]),null},Qp=()=>{let e=S(),{user:t}=Pe(),n=(0,Y.useRef)(null),r=e.pathname+e.search;return(0,Y.useEffect)(()=>(Jp=!0,()=>{Jp=!1}),[]),(0,Y.useEffect)(()=>(n.current!==null&&window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t&&Yp(r)},Xp),()=>{n.current!==null&&(window.clearTimeout(n.current),n.current=null)}),[r,t]),null},$p=()=>{let{addToast:e}=gr();return(0,Y.useEffect)(()=>{g()&&e({type:`danger`,title:`Failed to load translations for your language (${ee})`,content:`The app is running in English. Refresh the page to try again.`,actions:()=>(0,X.jsx)(o,{variant:`landing-page`,onClick:()=>window.location.reload(),children:`Refresh page`}),group:`translations-load-failed`})},[e]),null},em=`versionReloader: lastReloadVersion`,tm={"https://app.surferseo.com":`https://frontend-versions.surferseo.com`,"https://staging.surferseo.com":`https://frontend-versions-staging.surferseo.com`},nm=1e3*60*10,rm=4,im=3,am=50,om=U({supported_versions:V().array().min(1,{error:`supported_versions array should contain at least one version`})}),sm=()=>{let e=window.APP_ENV.release,t=window.APP_ENV.disable_reloader??!1,n=window.location.origin,r=window.APP_ENV.frontend_versions_url||(typeof tm[n]==`string`?tm[n]:tm[`https://app.surferseo.com`]),[i,a]=(0,Y.useState)(Lp),{value:o,set:s}=or(em,{defaultValue:``,initializeWithValue:!0}),[c,l]=(0,Y.useState)(0),u=(0,Y.useCallback)(t=>{o!==e&&t!==Lp&&s(e??``),(o!==e||i===Fp&&t===Ip)&&a(t)},[e,s,o,i]);!e&&!t&&n===`https://app.surferseo.com`&&pe(Error(`Missing window.APP_ENV.release value`));let d=(0,Y.useCallback)(async()=>{let e;try{e=await fetch(r)}catch{return null}if(e.status>=500&&e.status<600)return pe(Error(`Frontend versions endpoint returned 5xx error (CF outage?)`),{extra:{status:e.status,statusText:e.statusText,versionsEndpoint:r}}),null;try{let t=await e.json(),n=om.parse(t);return l(0),n.supported_versions}catch(e){return l(e=>e+1),pe(Error(`Couldn't fetch frontend versions`,{cause:e})),null}},[r]);return(0,Y.useEffect)(()=>{if(t||!e)return()=>{};let n=setInterval(()=>{d().then(t=>{if(!t)return;let n=t.indexOf(e);n===-1?(u(Ip),t.length===am&&ie(`Modal reload shown for user with very old version`,{currentVersion:e,supportedVersions:t.join(`,`)})):u(n>=im?Fp:Lp)})},nm);return()=>clearInterval(n)},[e,o,t,d,u]),(0,Y.useEffect)(()=>{c>rm&&(u(Ip),ae(`Modal reload shown for user due to failed requests`,{failedRequests:c}))},[c,u]),i},cm=``,lm=`width=device-width, initial-scale=1`,um=(0,Y.createContext)(null);um.displayName=`MetaViewportContext`;var dm=({children:e})=>{let t=(0,Y.useRef)(0),[n,r]=(0,Y.useState)(cm),i=(0,Y.useCallback)(()=>(t.current+=1,r(lm),()=>{t.current=Math.max(t.current-1,0),t.current===0&&r(cm)}),[r]),a=(0,Y.useMemo)(()=>({registerResponsiveViewport:i}),[i]);return(0,X.jsxs)(um.Provider,{value:a,children:[(0,X.jsx)(`meta`,{name:`viewport`,content:n}),e]})},fm=()=>{let e=(0,Y.useContext)(um);return(0,Y.useLayoutEffect)(()=>{let t=e==null?void 0:e.registerResponsiveViewport();return()=>{t==null||t()}},[e]),null},pm=`surferseo.com`;function mm(e=window.location.search){let t=new URLSearchParams(e).get(`continue`);if(!t)return null;let n;try{n=new URL(t)}catch{return null}let r=n.hostname===pm||n.hostname.endsWith(`.${pm}`);return n.protocol!==`https:`||!r?null:n.toString()}var hm=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M4.5 9.75a6 6 0 0 1 11.573-2.226q.21-.024.427-.024a3.75 3.75 0 0 1 3.706 4.327A4.5 4.5 0 0 1 18 20.25H6.75a5.25 5.25 0 0 1-2.23-10.004a6 6 0 0 1-.02-.496`,clipRule:`evenodd`})]})),gm=(e,t)=>
80{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:e,method:t})},_m=P({category:`auth`,name:`logged in`,payloadSchema:U({type:da(`social`).or(da(`password`))}),customTracking(e){gm(`login`,e.payload.type===`password`?`e-mail`:`google`),ha(`auth.login`,{label:e.payload.type})}}),vm=P({category:`auth`,name:`login failed`,payloadSchema:U({label:V()}),customTracking(e){ha(`error.login error`,{label:e.payload.label})}}),ym=({title:e,heading:t,subtitle:n,logoSlot:r,children:i})=>(0,X.jsxs)(`div`,{className:`flex min-h-full flex-col bg-black`,children:[(0,X.jsx)(Gs,{text:e,showSurferSuffix:!1}),(0,X.jsx)(zi,{className:`mx-auto hidden w-full border-b border-gray-120 bg-black p-lg sm:block`,children:(0,X.jsx)(`div`,{className:`mx-auto flex w-full max-w-[1224px] items-center justify-between`,children:(0,X.jsx)(Hi,{children:(0,X.jsx)(z,{variant:`pure`,href:`https://surferseo.com`,children:(0,X.jsx)(cs,{color:`white`})})})})}),(0,X.jsx)(Ys,{fullWidth:!0,children:(0,X.jsx)(`div`,{className:`relative mx-auto flex w-full max-w-[1920px] flex-1 items-center justify-center px-lg sm:items-start [@media(min-height:800px)]:pt-[5vh]`,children:(0,X.jsx)(`div`,{className:`w-full max-w-[600px]`,children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-base`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col items-center pt-base`,children:[(0,X.jsx)(cs,{className:`mb-base sm:hidden`,color:`white`,onlyBrandmark:!0}),(0,X.jsx)(`h1`,{className:`m-0 pb-md text-center text-xl font-semibold leading-none tracking-tighter text-white-base sm:text-5xl`,children:t}),(0,X.jsx)(`div`,{className:`min-h-lg text-center text-base font-medium text-gray-70`,children:n})]}),r,i]})})})})]}),bm=({children:e})=>(0,X.jsx)(`div`,{className:`flex w-full max-w-[480px] flex-col items-center gap-md rounded-2xl sm:mt-base sm:bg-gray-10 sm:p-xl [&>form]:w-full`,children:e}),xm=()=>{let{value:e,set:t}=or(`surfer_last_used_login_method`);return{lastUsedLoginMethod:e,setLastUsedLoginMethod:t}};function Sm(e){let t=T._(`Wrong email or password`,null,{hk:`16AhWO`,project:`auth`}),n=T._(`Invalid password or reset password token`,null,{hk:`lkaIl`,project:`auth`}),r=T._(`Please try again`,null,{hk:`1kdsKc`,project:`auth`});return{authentication_error:t,registration_error:t,password_change_failed:n,params_validation_failed:n,generic_error:r,rate_limited:r,two_factor_auth_required:T._(`Second factor authentication required`,null,{hk:`1jxIkU`,project:`auth`}),two_factor_auth_failed:T._(`Second factor authentication code invalid`,null,{hk:`1xXuaA`,project:`auth`}),token_error:``,refresh_failed:``}[e]??r}var Cm=U({email:ec,password:Xs}),wm=({onTwoFactorAuthRequired:e})=>{var t,n;let r=W(Ea.maxSm),[i,a]=(0,Y.useState)(!1),s=S().state,{execute:c,containerRef:l,isLoading:u}=Ia(),{register:d,handleSubmit:f,setError:p,watch:m,formState:{errors:h,isSubmitting:g}}=si({resolver:li(Cm),defaultValues:{email:(s==null?void 0:s.email)??``,password:``}}),_=m(`email`),v=async t=>{let n=await c(),r=t.email.toLowerCase(),i=await Js.login({email:r,password:t.password,recaptcha_token:n});if(i.success)_m.sendWithoutContext({type:`password`}),window.location.assign(mm()??i.redirectUrl);else{let n=i.error.error_code;if(vm.sendWithoutContext({label:n}),n===`two_factor_auth_required`){e({email:r,password:t.password});return}p(`root`,{type:n,message:Sm(n)})}},y=g||u;return r&&!i?(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-2xs`,children:[(0,X.jsx)(o,{color:`secondary`,fullWidth:!0,onClick:()=>a(!0),children:w._(`Continue with Email`,null,{hk:`1TqJ3I`,project:`auth`})}),(0,X.jsxs)(`div`,{className:`mt-lg flex flex-col gap-2xs`,children:[(0,X.jsx)(z,{className:`self-center text-center text-md max-sm:text-white-60`,to:`/reset_password`,state:{email:_},children:w._(`Forgot your password?`,null,{hk:`lLHGT`,project:`auth`})}),(0,X.jsx)(`span`,{className:`block text-center text-md max-sm:text-white-60`,children:w._(`New to Surfer? {createAccountLink}`,[w._param(`createAccountLink`,(0,X.jsx)(z,{className:`max-sm:text-white-60`,to:`/register`,state:{email:_},children:w._(`Create account`,null,{hk:`2W5mit`,project:`auth`})}))],{hk:`1lNMeT`,project:`auth`})})]})]}):(0,X.jsxs)(`form`,{className:`w-full`,onSubmit:f(v),children:[(0,X.jsx)(Fa,{ref:l}),(0,X.jsxs)(`div`,{className:`mp-block flex flex-col items-stretch gap-base`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(Wr,{htmlFor:`email`,className:`max-sm:text-white-60`,children:w._(`Email`,null,{hk:`aCKmP`,project:`auth`})}),(0,X.jsx)(Ti,{...d(`email`),"data-testid":`login-email-input`,id:`email`,theme:r?`dark`:`light`,className:`max-sm:!text-base sm:!bg-white-base`,placeholder:T._(`e.g. [email protected]`,null,{hk:`3pmEFY`,project:`auth`}),invalid:!!h.email,errorMessage:((t=h.email)==null?void 0:t.message)??``,disabled:y})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(Wr,{htmlFor:`password`,className:`max-sm:text-white-60`,children:w._(`Password`,null,{hk:`2LitC7`,project:`auth`})}),(0,X.jsx)(Ti,{...d(`password`),"data-testid":`login-password-input`,id:`password`,className:`max-sm:!text-base sm:!bg-white-base`,theme:r?`dark`:`light`,type:`password`,placeholder:T._(`Enter your password`,null,{hk:`1B4GDn`,project:`auth`}),invalid:!!h.password,errorMessage:((n=h.password)==null?void 0:n.message)??``,disabled:y})]}),h.root&&(0,X.jsx)(`div`,{"data-testid":`login-form-error`,className:`pb-base text-center text-red-80`,role:`alert`,children:h.root.message}),(0,X.jsx)(o,{loading:y,fullWidth:!0,type:`submit`,"data-testid":`login-form-submit`,children:w._(`Continue with Email`,null,{hk:`1TqJ3I`,project:`auth`})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(z,{className:`self-center text-center text-md max-sm:text-white-60`,to:`/reset_password`,state:{email:_},children:w._(`Forgot your password?`,null,{hk:`lLHGT`,project:`auth`})}),(0,X.jsx)(`span`,{className:`block text-center text-md max-sm:text-white-60`,children:w._(`New to Surfer? {createAccountLink}`,[w._param(`createAccountLink`,(0,X.jsx)(z,{"data-testid":`login-to-register`,className:`max-sm:text-white-60`,to:`/register`,state:{email:_},children:w._(`Create account`,null,{hk:`2W5mit`,project:`auth`})}))],{hk:`1lNMeT`,project:`auth`})})]})]})]})},Tm=({annotation:e,children:t})=>e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`absolute -top-sm right-0`,children:e}),t]}):t,Em=({annotation:e,children:n,icon:r,iconColor:i})=>r?(0,X.jsxs)(Tm,{annotation:e,children:[(0,X.jsx)(`div`,{className:`absolute left-2xs top-1/2 flex aspect-square size-[28px] translate-y-[-14px] place-content-center place-items-center rounded-[4px] bg-white-base`,children:(0,X.jsx)(t,{Component:r,className:O(`size-md`,i)})}),(0,X.jsx)(`div`,{className:`text-center`,children:n})]}):(0,X.jsx)(Tm,{annotation:e,children:n}
80),Dm=`rounded-md py-[10px] text-[12px] font-normal leading-4`,Om=`relative px-[36px]`,km=({annotation:e,children:t,className:n,icon:r,iconColor:i,...a})=>(0,X.jsx)(o,{...a,className:O(`${r?Om:``} ${e?`relative`:``} ${Dm}`,n),children:(0,X.jsx)(Em,{annotation:e,icon:r,iconColor:i,children:t})}),Am=({annotation:e,children:t,className:n,icon:r,iconColor:i,...a})=>(0,X.jsx)(L,{...a,className:O(`${r?Om:``} ${Dm}`,n),children:(0,X.jsx)(Em,{annotation:e,icon:r,iconColor:i,children:t})}),jm=({children:e,htmlFor:t})=>(0,X.jsx)(Wr,{htmlFor:t,className:`relative after:absolute after:-top-3xs after:right-auto after:text-red-base after:content-['*']`,children:e}),Mm=()=>(0,X.jsx)(`span`,{className:`rounded-2xl bg-orange-70 px-sm py-2xs text-[10px] font-semibold uppercase leading-none text-white-base`,children:w._(`Last used`,null,{hk:`2Lx9vQ`,project:`auth`})}),Nm=({children:e})=>{let{lastUsedLoginMethod:t}=xm();return t===`email`?(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`div`,{className:`absolute right-0 top-[-10px] z-[1]`,children:(0,X.jsx)(Mm,{})}),e]}):e},Pm=U({email:ec,password:Xs}),Fm=({onTwoFactorAuthRequired:e})=>{var t,n;let[r,i]=(0,Y.useState)(!1),a=S().state,{setLastUsedLoginMethod:o}=xm(),{execute:s,containerRef:c,isLoading:l}=Ia(),{register:u,handleSubmit:d,setError:f,watch:p,formState:{errors:m,isSubmitting:h}}=si({resolver:li(Pm),defaultValues:{email:(a==null?void 0:a.email)??``,password:``}}),g=p(`email`),_=u(`email`),v=Pm.shape.email.safeParse(g).success,y=()=>i(!0),ee=async t=>{let n=await s(),r=t.email.toLowerCase(),i=await Js.login({email:r,password:t.password,recaptcha_token:n});if(i.success)o(`email`),_m.sendWithoutContext({type:`password`}),window.location.assign(mm()??i.redirectUrl);else{let n=i.error.error_code;if(vm.sendWithoutContext({label:n}),n===`two_factor_auth_required`){e({email:r,password:t.password});return}f(`root`,{type:n,message:Sm(n)})}},b=h||l;if(!r){var x;return(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-base`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(jm,{htmlFor:`email`,children:w._(`Email`,null,{hk:`aCKmP`,project:`auth`})}),(0,X.jsx)(Nm,{children:(0,X.jsx)(Ti,{..._,"data-testid":`login-email-input`,id:`email`,placeholder:T._(`e.g. [email protected]`,null,{hk:`3pmEFY`,project:`auth`}),invalid:!!m.email,errorMessage:((x=m.email)==null?void 0:x.message)??``,disabled:b,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),y())},onBlur:e=>{_.onBlur(e),v&&y()}})})]}),(0,X.jsx)(km,{fullWidth:!0,onClick:()=>y(),className:`bg-purple-70 hover:bg-purple-80`,"data-testid":`login-form-submit`,children:w._(`Continue with Email`,null,{hk:`1TqJ3I`,project:`auth`})}),(0,X.jsxs)(`div`,{className:`mt-lg flex flex-col gap-2xs`,children:[(0,X.jsx)(z,{className:`self-center text-center text-md`,to:`/reset_password`,state:{email:g},children:w._(`Forgot your password?`,null,{hk:`lLHGT`,project:`auth`})}),(0,X.jsx)(`span`,{className:`block text-center text-md`,children:w._(`New to Surfer? {createAccountLink}`,[w._param(`createAccountLink`,(0,X.jsx)(z,{"data-testid":`login-to-register`,to:`/register`,state:{email:g},children:w._(`Create account`,null,{hk:`2W5mit`,project:`auth`})}))],{hk:`1lNMeT`,project:`auth`})})]})]})}return(0,X.jsxs)(`form`,{className:`w-full`,onSubmit:d(ee),children:[(0,X.jsx)(Fa,{ref:c}),(0,X.jsxs)(`div`,{className:`mp-block flex flex-col items-stretch gap-base`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(jm,{htmlFor:`email`,children:w._(`Email`,null,{hk:`aCKmP`,project:`auth`})}),(0,X.jsx)(Nm,{children:(0,X.jsx)(Ti,{..._,"data-testid":`login-email-input`,id:`email`,placeholder:T._(`e.g. [email protected]`,null,{hk:`3pmEFY`,project:`auth`}),invalid:!!m.email,errorMessage:((t=m.email)==null?void 0:t.message)??``,disabled:b,autoFocus:!v})})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(jm,{htmlFor:`password`,children:w._(`Password`,null,{hk:`2LitC7`,project:`auth`})}),(0,X.jsx)(Ti,{...u(`password`),"data-testid":`login-password-input`,id:`password`,type:`password`,placeholder:T._(`Enter your password`,null,{hk:`1B4GDn`,project:`auth`}),invalid:!!m.password,errorMessage:((n=m.password)==null?void 0:n.message)??``,disabled:b,autoFocus:v})]}),m.root&&(0,X.jsx)(`div`,{"data-testid":`login-form-error`,className:`pb-base text-center text-red-80`,role:`alert`,children:m.root.message}),(0,X.jsx)(km,{className:`bg-purple-70 hover:bg-purple-80`,loading:b,fullWidth:!0,type:`submit`,"data-testid":`login-form-submit`,children:w._(`Continue with Email`,null,{hk:`1TqJ3I`,project:`auth`})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(z,{className:`self-center text-center text-md`,to:`/reset_password`,state:{email:g},children:w._(`Forgot your password?`,null,{hk:`lLHGT`,project:`auth`})}),(0,X.jsx)(`span`,{className:`block text-center text-md`,children:w._(`New to Surfer? {createAccountLink}`,[w._param(`createAccountLink`,(0,X.jsx)(z,{"data-testid":`login-to-register`,to:`/register`,state:{email:g},children:w._(`Create account`,null,{hk:`2W5mit`,project:`auth`})}))],{hk:`1lNMeT`,project:`auth`})})]})]})]})},Im=T._(`Positive | Sparking connections that drive growth`,null,{hk:`3MhjmO`,project:`common`}),Lm=({className:e,onlyBrandmark:t,...n})=>(0,X.jsx)(`img`,{className:O(`block h-[28px]`,e),...n,src:`/static-images/logo/${t?`positiveLogo`:`positiveLogoWithText`}.svg`,alt:Im}),Rm=`/static/iconosquare.VwCPENnn.jpg`,zm=`/static/nocrm.DyvZWrJC.jpg`,Bm=`/static/signitic.BwwqR6e9.jpg`,Vm=`/static/user.BCzFmhsL.jpg`,Hm=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:19,height:19,viewBox:`0 0 19 19`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M14.6818 0C17.0655 0 19 1.93455 19 4.31818V14.6818C19 17.0655 17.0655 19 14.6818 19H4.31818C1.93455 19 0 17.0655 0 14.6818V4.31818C0 1.93455 1.9345
805 0 4.31818 0H14.6818ZM13.1748 10.7739C12.8898 11.5555 12.3673 12.2205 11.6893 12.6782C11.4518 12.838 11.2402 13.0409 11.0459 13.2525L10.9855 13.3173L7.29773 17.2727H14.6861C16.1155 17.2727 17.277 16.1111 17.277 14.6818V14.3536L13.1791 10.7695L13.1748 10.7739ZM1.72727 14.6818C1.72727 16.1111 2.88886 17.2727 4.31818 17.2727H4.93136L8.67523 13.2611C7.47045 13.002 6.47295 12.1859 5.96341 11.0934C5.6525 10.4241 5.22068 9.81955 4.64205 9.36614L1.73159 7.09477V14.6818H1.72727ZM10.3982 5.63955C11.5943 5.92023 12.5789 6.75364 13.0711 7.85477C13.3259 8.42477 13.6973 8.93432 14.168 9.34455L17.2727 12.0564V4.31818C17.2727 2.88886 16.1111 1.72727 14.6818 1.72727H14.0514L10.3982 5.63955ZM9.5 7.26318C8.29523 7.26318 7.31932 8.23909 7.31932 9.44386C7.31932 10.6486 8.29523 11.6245 9.5 11.6245C10.7048 11.6245 11.6807 10.6486 11.6807 9.44386C11.6807 8.23909 10.7048 7.26318 9.5 7.26318ZM4.31818 1.72727C2.88886 1.72727 1.72727 2.88886 1.72727 4.31818V4.90545L5.82955 8.10523C6.12318 7.30205 6.67159 6.62409 7.37545 6.16636C7.66477 5.98068 7.92818 5.75614 8.16568 5.50568L8.32114 5.34159L11.6936 1.72727H4.31818Z`,fill:`currentColor`})]})),Um=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M1.6842 0H0.538027C0.240883 0 0 0.250247 0 0.558942V19.4411C0 19.7498 0.240883 20 0.538027 20H1.6842C1.98134 20 2.22222 19.7498 2.22222 19.4411V0.558942C2.22222 0.250247 1.98134 0 1.6842 0Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M6.12859 0H4.98242C4.68528 0 4.4444 0.250247 4.4444 0.558942V12.9255C4.4444 13.2342 4.68528 13.4845 4.98242 13.4845H6.12859C6.42574 13.4845 6.66662 13.2342 6.66662 12.9255V0.558942C6.66662 0.250247 6.42574 0 6.12859 0Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M10.5731 0H9.42694C9.1298 0 8.88892 0.250247 8.88892 0.558942V9.12443C8.88892 9.43312 9.1298 9.68337 9.42694 9.68337H10.5731C10.8703 9.68337 11.1111 9.43312 11.1111 9.12443V0.558942C11.1111 0.250247 10.8703 0 10.5731 0Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M15.0176 0H13.8715C13.5743 0 13.3334 0.250247 13.3334 0.558942V6.95258C13.3334 7.26127 13.5743 7.51152 13.8715 7.51152H15.0176C15.3148 7.51152 15.5557 7.26127 15.5557 6.95258V0.558942C15.5557 0.250247 15.3148 0 15.0176 0Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M19.4618 0H18.3156C18.0185 0 17.7776 0.250247 17.7776 0.558942V6.04727C17.7776 6.35597 18.0185 6.60621 18.3156 6.60621H19.4618C19.7589 6.60621 19.9998 6.35597 19.9998 6.04727V0.558942C19.9998 0.250247 19.7589 0 19.4618 0Z`,fill:`currentColor`})]})),Wm=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:34,height:45,viewBox:`0 0 34 45`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M16.9662 34.9709C26.3229 34.9709 33.9325 27.3586 33.9325 18.0046C33.9325 17.3453 33.8913 16.6778 33.8061 15.9663V2.63449C33.8061 1.18126 32.6248 0 31.1716 0C29.7184 0 28.5371 1.18126 28.5371 2.63449V5.61512C25.3834 2.65372 21.3122 1.03567 16.9662 1.03567C7.61228 1.03567 0 8.64794 0 18.0046C0 27.3613 7.61228 34.9709 16.9662 34.9709ZM4.97229 18.0046C4.97229 11.3896 10.3539 6.00796 16.969 6.00796C23.5841 6.00796 28.9657 11.3896 28.9657 18.0046C28.9657 24.6197 23.5841 30.0013 16.969 30.0013C10.3539 30.0013 4.97229 24.6197 4.97229 18.0046Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M30.4514 34.5317C29.9927 34.5317 29.5531 34.6224 29.1548 34.8504C29.1081 34.8779 29.0532 34.9081 29.012 34.9356C29.0065 34.9356 29.0037 34.9411 28.9982 34.9438C26.2126 36.941 22.9326 38.2184 19.5097 38.6387C17.8312 38.8447 16.0977 38.8447 14.4165 38.6387C10.9991 38.2211 7.71901 36.9437 4.95265 34.963C4.91145 34.9383 4.86474 34.9081 4.79057 34.8696C4.38949 34.6389 3.93896 34.5317 3.47745 34.5317C2.01598 34.5317 0.823727 35.7212 0.823727 37.1855C0.823727 37.8558 1.07097 38.4848 1.51875 38.9766C1.57094 39.0315 1.9473 39.3502 2.16432 39.4903C5.59823 41.8611 9.60903 43.3857 13.7599 43.8939C14.8231 44.0258 15.8999 44.0917 16.9603 44.0917C18.0207 44.0917 19.1003 44.0258 20.1607 43.8939C24.3199 43.383 28.3334 41.8583 31.7673 39.4821C32.0201 39.287 32.2371 39.1387 32.3909 38.9876C32.8469 38.4958 33.0997 37.8585 33.0997 37.1855C33.0997 35.724 31.9102 34.5317 30.4487 34.5317H30.4514Z`,fill:`currentColor`})]})),Gm=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M9.69012 0C4.33308 0 0 4.33308 0 9.69012C0 15.0472 4.33308 19.3802 9.69012 19.3802C15.0472 19.3802 19.3802 15.0472 19.3802 9.69012V0H9.69012ZM9.69012 17.5C5.38431 17.5 1.88021 13.9973 1.88021 9.69012C1.88021 5.38295 5.38431 1.88158 9.69012 1.88158H17.5V9.69149C17.5 13.9973 13.9973 17.5014 9.69012 17.5014V17.5Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M9.61463 15.5463C7.64034 15.5463 5.84875 14.5387 4.57118 12.7076L4.55891 12.6885C4.41984 12.4717 4.36803 12.2004 4.41302 11.9441C4.45529 11.7068 4.57664 11.5037 4.75389 11.3687C4.90523 11.2446 5.08521 11.1805 5.27746 11.1805C5.55151 11.1805 5.81739 11.3196 5.99055 11.5514L6.00146 11.5664C6.92588 12.8999 8.20617 13.6348 9.60781 13.6348C9.67871 13.6348 9.74825 13.6334 9.82051 13.6293
80C11.1922 13.5543 12.527 12.7812 13.3914 11.5623C13.5591 11.3223 13.8182 11.1819 14.1018 11.1819C14.2927 11.1819 14.4808 11.2487 14.6349 11.3701L14.6513 11.3837C14.8312 11.5391 14.9512 11.7586 14.9853 12.0041C15.0221 12.2645 14.958 12.5304 14.8081 12.7322C13.6409 14.3833 11.8084 15.4359 9.91459 15.5382C9.81506 15.5436 9.71553 15.5463 9.61872 15.5463H9.61463Z`,fill:`currentColor`})]})),Km={name:`Surfer`,highlighted:!0,description:T._(`Turning visibility in Google and AI answers into real connections.`,null,{hk:`4FsCTw`,project:`auth`}),icon:tc},qm={iconosquare:{name:`Iconosquare`,description:T._(`Turning social media presence into meaningful connections.`,null,{hk:`4fyaLu`,project:`auth`}),dropdownLabel:T._(`Social media management`,null,{hk:`y2Uhd`,project:`auth`}),modal:{image:Rm,slogan:T._(`Social media management and analytics platform`,null,{hk:`2w5Jmw`,project:`auth`}),learnMoreUrls:{default:`https://www.iconosquare.com/`,"fr-FR":`https://www.iconosquare.com/fr`,"de-DE":`https://www.iconosquare.com/de`}},icon:Hm,loginUrls:{default:`https://app.iconosquare.com/signin`}},user:{name:`User`,description:T._(`Turning every interaction into meaningful connections.`,null,{hk:`4cmnlJ`,project:`auth`}),dropdownLabel:T._(`Marketing automation platform`,null,{hk:`q0Rkf`,project:`auth`}),modal:{image:Vm,slogan:T._(`Emailing & customer engagement platform`,null,{hk:`1ETwE8`,project:`auth`}),learnMoreUrls:{default:`https://www.user.com/`,"fr-FR":`https://www.user.com/fr`,"de-DE":`https://www.user.com/de`,"pl-PL":`https://www.user.com/pl`}},icon:Gm,loginUrls:{default:`https://app.user.com/accounts/login/`}},signitic:{name:`Signitic`,description:T._(`Turn your email signature into a growth channel.`,null,{hk:`2XSXNk`,project:`auth`}),dropdownLabel:T._(`Email signature management`,null,{hk:`YqDEt`,project:`auth`}),modal:{image:Bm,slogan:T._(`Email signature management solution`,null,{hk:`2He4xE`,project:`auth`}),learnMoreUrls:{default:`https://www.signitic.com/en`,"de-DE":`https://www.signitic.com/de`,"fr-FR":`https://www.signitic.com/fr`,"pl-PL":`https://www.signitic.com/pl`}},icon:Wm,loginUrls:{default:`https://app.signitic.com/login`}},nocrm:{name:`noCRM`,description:T._(`Turning sales interactions into connections.`,null,{hk:`2l0BW0`,project:`auth`}),dropdownLabel:T._(`Sales management tool`,null,{hk:`1N75pt`,project:`auth`}),modal:{image:zm,slogan:T._(`Action-driven sales management solution`,null,{hk:`1P5J60`,project:`auth`}),learnMoreUrls:{default:`https://www.nocrm.io`,"fr-FR":`https://www.nocrm.io/fr`,"de-DE":`https://www.nocrm.io/de`}},icon:Um,loginUrls:{default:`https://nocrm.io/sessions/signin`}}},Jm=43/28,Ym=1.2,Xm=e=>e<=640?`mobile`:e<=960?`tablet`:`desktop`;function Zm(e,t,n,r){if(e===`mobile`){let e=t*Ym,n=e/Jm;return{x:t/2-e/2,y:0,w:e,h:n}}let i=n*Ym,a=i*Jm,o=r?r.cx:t/2,s=r?r.cy:n/2;return{x:o-a/2,y:s-i/2,w:a,h:i}}function Qm(e,t,n){let r=Math.floor(e/n),i=Math.floor(t/n);return{cols:r,rows:i,offX:(e-(r-1)*n)/2,offY:(t-(i-1)*n)/2,spacing:n}}var $m=(e,t)=>e.offX+t%e.cols*e.spacing,eh=(e,t)=>e.offY+Math.floor(t/e.cols)*e.spacing;function th(e,t,n,r,i,a){let o=new Uint8Array(r.cols*r.rows);for(let s=0;s<o.length;s++){let c=$m(r,s),l=eh(r,s),u=Math.max(0,Math.floor(c-i)),d=Math.min(t-1,Math.ceil(c+i)),f=Math.max(0,Math.floor(l-i)),p=Math.min(n-1,Math.ceil(l+i));search:for(let n=f;n<=p;n++)for(let r=u;r<=d;r++){let i=(n*t+r)*4;if(e[i+3]>0&&e[i]>=a){o[s]=1;break search}}}return o}function nh(e){let t=new Float32Array(e.cols*e.rows);for(let n=0;n<t.length;n++){let r=n%e.cols,i=Math.floor(n/e.cols),a=Math.sin(r*12.9898+i*78.233)*43758.5453;t[n]=a-Math.floor(a)}return t}var rh=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 43 28" fill="none"><path d="M18.0033 5.55612C17.6411 7.81351 16.132 9.72851 14.013 10.6084L5.94226 13.9677L14.013 17.3281C16.1322 18.208 17.6411 20.1219 18.0033 22.3794L18.8972 27.9344L0 16.8858V11.0486L18.8972 0L18.0033 5.55612Z" fill="#ffffff"/><path d="M42.1407 11.0476V16.8869L23.3185 27.8883L24.2083 22.3794L24.2452 22.168C24.665 20.0027 26.1459 18.1805 28.1985 17.3281L36.2683 13.9677L28.1985 10.6084C26.1456 9.75606 24.665 7.93293 24.2452 5.76749L24.2083 5.55612L23.3185 0.0472139L42.1407 11.0476Z" fill="#ff5b49"/></svg>`,ih=`[data-wallpaper-anchor]`,ah=11,oh=.7,sh=`#161616`,ch=`#232323`,lh=`#ff5b49`,uh=150,dh=.5,fh=1200,ph=420,mh=4,hh=18,gh=e=>
80Math.max(0,Math.min(1,e)),_h=e=>e*e*(3-2*e),vh=class{constructor(e){this.canvas=e,this.silhouette=document.createElement(`canvas`),this.staticLayer=document.createElement(`canvas`),this.mark=new Image,this.width=0,this.height=0,this.cells=null,this.mode=`static`,this.reducedMotion=matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.noHover=matchMedia(`(hover: none)`).matches,this.mountedAt=this.reducedMotion?-1/0:performance.now(),this.pointer={x:window.innerWidth/2,y:window.innerHeight/2,smoothX:window.innerWidth/2,smoothY:window.innerHeight/2,inside:!0,hover:1},this.frameId=0,this.resizeId=0,this.lastFrameAt=0,this.onMouseMove=e=>{this.pointer.x=e.clientX,this.pointer.y=e.clientY,this.pointer.inside=!0,this.requestFrame()},this.onMouseLeave=()=>{this.pointer.inside=!1,this.requestFrame()},this.scheduleResize=()=>{this.resizeId||=requestAnimationFrame(()=>{this.resizeId=0,this.resize()})},this.frame=e=>{this.frameId=0;let t=this.cells;if(!t)return;let n=Math.min(100,e-this.lastFrameAt);this.lastFrameAt=e,this.advancePointer(n),this.ctx.clearRect(0,0,this.width,this.height);let r=e-this.mountedAt<1620;r?this.drawIntro(t,e):this.drawSteady(t),(r||this.pointerMoving())&&this.requestFrame()};let t=e.getContext(`2d`);if(!t)throw Error(`2d canvas context unavailable`);this.ctx=t,this.observer=new ResizeObserver(this.scheduleResize);let n=document.querySelector(ih);n&&this.observer.observe(n),window.addEventListener(`resize`,this.scheduleResize),this.reducedMotion||(window.addEventListener(`mousemove`,this.onMouseMove),window.addEventListener(`mouseleave`,this.onMouseLeave)),this.mark.onload=()=>{this.rebuild(),this.requestFrame()},this.mark.src=`data:image/svg+xml;utf8,`+encodeURIComponent(rh),this.resize()}destroy(){cancelAnimationFrame(this.frameId),cancelAnimationFrame(this.resizeId),this.observer.disconnect(),this.mark.onload=null,window.removeEventListener(`resize`,this.scheduleResize),window.removeEventListener(`mousemove`,this.onMouseMove),window.removeEventListener(`mouseleave`,this.onMouseLeave)}resize(){let e=devicePixelRatio||1;this.width=window.innerWidth,this.height=window.innerHeight;let t=Math.round(this.width*e),n=Math.round(this.height*e);this.canvas.width!==t&&(this.canvas.width=t),this.canvas.height!==n&&(this.canvas.height=n),this.ctx.setTransform(e,0,0,e,0,0);let r=Xm(this.width)===`mobile`;this.mode=this.reducedMotion||this.noHover||r?`static`:`interactive`,this.rebuild(),this.requestFrame()}rebuild(){if(!this.mark.complete||!this.mark.naturalWidth)return;let{width:e,height:t}=this;if(e<=0||t<=0)return;let n=Zm(Xm(e),e,t,this.cardCentre()),r=this.silhouette.getContext(`2d`,{willReadFrequently:!0});if(!r)return;this.silhouette.width=e,this.silhouette.height=t,r.drawImage(this.mark,n.x,n.y,n.w,n.h);let{data:i}=r.getImageData(0,0,e,t),a=Qm(e,t,ah),o=th(i,e,t,a,mh,hh),s=Int32Array.from(Array.from(o.keys()).filter(e=>o[e]));this.cells={grid:a,lit:o,litIndices:s,noise:nh(a),revealRadius:n.h*dh},this.paintStaticLayer()}cardCentre(){var e;let t=(e=document.querySelector(ih))==null?void 0:e.getBoundingClientRect();return!t||t.width===0?null:{cx:t.left+t.width/2,cy:t.top+t.height/2}}paintStaticLayer(){if(!this.cells)return;let e=this.staticLayer.getContext(`2d`);if(!e)return;this.staticLayer.width=this.canvas.width,this.staticLayer.height=this.canvas.height,e.setTransform(this.ctx.getTransform());let{grid:t,lit:n}=this.cells,r=[];for(let e=0;e<n.length;e++)n[e]||r.push($m(t,e),eh(t,e));yh(e,r,sh,1)}requestFrame(){this.frameId||=(this.lastFrameAt=performance.now(),requestAnimationFrame(this.frame))}advancePointer(e){let t=this.pointer,n=+!!t.inside;t.hover=gh(t.hover+Math.sign(n-t.hover)*(e/uh));let r=1-Math.exp(-e/uh);t.smoothX+=(t.x-t.smoothX)*r,t.smoothY+=(t.y-t.smoothY)*r}pointerMoving(){if(this.mode===`static`)return!1;let e=this.pointer,t=Math.abs(e.x-e.smoothX)<.05&&Math.abs(e.y-e.smoothY)<.05;return e.hover!==+!!e.inside||!t}reveal(e,t,n){let r=e.revealRadius,i=Math.hypot(t-this.pointer.smoothX,n-this.pointer.smoothY);return i>=r?0:1-_h(i/r)}isRevealed(e,t){if(this.mode===`static`||this.pointer.hover<=.001)return!1;let{grid:n,noise:r}=e;return this.reveal(e,$m(n,t),eh(n,t))>r[t]}drawSteady(e){let{grid:t,litIndices:n}=e;this.ctx.drawImage(this.staticLayer,0,0,this.width,this.height);let r=[],i=[];for(let a of n)(this.isRevealed(e,a)?i:r).push($m(t,a),eh(t,a));yh(this.ctx,r,ch,1),yh(this.ctx,i,lh,this.pointer.hover)}drawIntro(e,t){let{grid:n,lit:r,noise:i}=e,a=t-this.mountedAt;for(let t=0;t<r.length;t++){let o=sh,s=1;r[t]&&this.isRevealed(e,t)?(o=lh,s=this.pointer.hover):r[t]&&(o=ch);let c=gh((a-i[t]*fh)/ph);yh(this.ctx,[$m(n,t),eh(n,t)],o,s*_h(c))}}};function yh(e,t,n,r){if(!(t.length===0||r<.005)){e.globalAlpha=Math.min(1,r),e.fillStyle=n,e.beginPath();for(let n=0;n<t.length;n+=2)e.rect(t[n]-oh,t[n+1]-oh,oh*2,oh*2);e.fill(),e.globalAlpha=1}}var bh=({children:e})=>{let t=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>
80{if(!t.current)return;let e=new vh(t.current);return()=>e.destroy()},[]),(0,X.jsxs)(`div`,{className:`relative flex min-h-lvh place-items-center bg-black p-base text-gray-20`,children:[(0,X.jsx)(`canvas`,{ref:t,"aria-hidden":!0,className:`pointer-events-none fixed inset-0 size-full`}),(0,X.jsx)(`div`,{className:`relative mx-auto max-w-lg lg:max-w-[1200px]`,children:e})]})},xh=({children:e})=>(0,X.jsx)(`div`,{"data-wallpaper-anchor":!0,className:`flex flex-col gap-[20px] rounded-2xl bg-white-base p-base text-black lg:p-2xl`,children:e}),Sh=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fill:`currentColor`,d:`M21.92 2.62a1 1 0 0 0-.54-.54A1 1 0 0 0 21 2h-6a1 1 0 0 0 0 2h3.59L4 18.59V15a1 1 0 0 0-2 0v6a1 1 0 0 0 .08.38a1 1 0 0 0 .54.54A1 1 0 0 0 3 22h6a1 1 0 0 0 0-2H5.41L20 5.41V9a1 1 0 0 0 2 0V3a1 1 0 0 0-.08-.38`})]}));E();var Ch=({productConfig:e})=>{let{name:n,highlighted:r,icon:i,description:a}=e,o=`modal`in e;return(0,X.jsxs)(`div`,{className:D(`group size-full rounded-2xl bg-gray-140 p-[20px] transition-colors`,o&&`relative hover:cursor-pointer hover:bg-purple-70`),children:[o&&(0,X.jsx)(`div`,{className:`absolute right-md top-md hidden group-hover:block`,children:(0,X.jsx)(t,{Component:Sh})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-sm`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-sm`,children:[(0,X.jsx)(`div`,{className:D(`flex place-items-center rounded-lg p-sm`,r?`bg-orange-70`:`bg-black`),children:(0,X.jsx)(t,{Component:i,className:D(`transition-colors`,r?`text-gray-140`:`text-gray-60`,o&&`group-hover:text-orange-70`)})}),(0,X.jsx)(`div`,{className:`text-xl font-semibold text-white-base`,children:n})]}),(0,X.jsx)(`div`,{className:D(`text-left text-md text-gray-60 transition-colors`,o&&`group-hover:text-white-base`),children:a})]})]})},wh=e=>{let{preferredLocale:t}=lo(),{loginUrls:n,modal:{learnMoreUrls:r}}=e;return{loginUrl:ye(n,t??`default`)??n.default,learnMoreUrl:ye(r,t??`default`)??r.default}},Th=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M21 9.00001L21 3.00001M21 3.00001H15M21 3.00001L12 12M10 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V14`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),Eh=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1ZM15.7071 8.29289C16.0976 8.68342 16.0976 9.31658 15.7071 9.70711L13.4142 12L15.7071 14.2929C16.0976 14.6834 16.0976 15.3166 15.7071 15.7071C15.3166 16.0976 14.6834 16.0976 14.2929 15.7071L12 13.4142L9.70711 15.7071C9.31658 16.0976 8.68342 16.0976 8.29289 15.7071C7.90237 15.3166 7.90237 14.6834 8.29289 14.2929L10.5858 12L8.29289 9.70711C7.90237 9.31658 7.90237 8.68342 8.29289 8.29289C8.68342 7.90237 9.31658 7.90237 9.70711 8.29289L12 10.5858L14.2929 8.29289C14.6834 7.90237 15.3166 7.90237 15.7071 8.29289Z`,fill:`currentColor`})]})),Dh=({productConfig:e})=>{let[n,r]=(0,Y.useState)(!1),{learnMoreUrl:i,loginUrl:a}=wh(e),{icon:s,name:c,description:l,modal:u}=e,{image:d,slogan:f}=u;return(0,X.jsxs)(Jn,{open:n,onOpenChange:r,children:[(0,X.jsx)(Qn,{children:(0,X.jsx)(o,{className:`cursor-default hover:opacity-100`,variant:`pure`,children:(0,X.jsx)(Ch,{productC
80onfig:e})})}),(0,X.jsxs)(Kn,{className:`bg-gray-140 text-white-base`,size:`base`,children:[(0,X.jsxs)($n,{hideClose:!0,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-base`,children:[(0,X.jsx)(`div`,{className:`flex place-items-center rounded-lg bg-orange-70 p-sm`,children:(0,X.jsx)(t,{Component:s,className:`text-gray-140`,size:`xlarge`})}),(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`div`,{className:`text-xl font-semibold text-white-base`,children:c}),(0,X.jsx)(`div`,{className:`text-left text-md text-gray-60`,children:l})]})]}),(0,X.jsx)(lr,{color:`secondary`,icon:Eh,className:`text-gray-60 hover:text-white-base`})]}),(0,X.jsx)(qn,{className:`aspect-[572/402] bg-purple-70 p-0`,children:(0,X.jsx)(`img`,{src:d,alt:c,className:`size-full`})}),(0,X.jsxs)(cr,{className:`flex-col gap-lg py-xl`,hideSeparator:!0,children:[(0,X.jsx)(`div`,{children:f}),(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-base sm:flex-row`,children:[(0,X.jsx)(L,{variant:`outline`,href:i,target:`_blank`,icon:Th,className:`px-base py-md text-white-base hover:text-gray-140`,children:w._(`Learn more`,null,{hk:`2IkoYR`,project:`auth`})}),(0,X.jsx)(L,{variant:`primary`,className:`bg-purple-70 px-base py-md hover:bg-purple-80`,href:a,target:`_blank`,icon:Th,children:w._(`Login to {productName}`,[w._param(`productName`,c)],{hk:`1xGjZH`,project:`auth`})})]})]})]})]})},Oh=()=>(0,X.jsxs)(`div`,{className:`grid gap-base lg:grid-cols-2`,children:[(0,X.jsx)(Ch,{productConfig:Km}),Object.values(qm).map(e=>(0,X.jsx)(Dh,{productConfig:e},e.name))]}),kh=({productConfig:e})=>{let{loginUrl:t}=wh(e);return(0,X.jsx)(vi,{onSelect:()=>{window.location.assign(t)},selected:e.highlighted,icon:e.icon,className:`items-start [&>svg]:text-orange-70`,children:(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`div`,{className:`font-semibold`,children:e.name}),e.dropdownLabel&&(0,X.jsx)(`div`,{className:`font-normal`,children:e.dropdownLabel})]})})},Ah=()=>(0,X.jsxs)(xi,{children:[(0,X.jsx)(gi,{children:(0,X.jsx)(o,{variant:`pure`,children:(0,X.jsxs)(`div`,{className:`inline-flex items-center text-xl font-semibold text-orange-70`,children:[Km.name,(0,X.jsx)(_i,{className:`text-orange-70`})]})})}),(0,X.jsx)(Si,{className:`z-[200] max-w-[300px]`,children:Object.values(qm).map(e=>(0,X.jsx)(kh,{productConfig:e},e.name))})]}),jh=T._(`Log in to Positive Surfer to research, write, and optimize content with AI-powered SEO tools. Fast, secure access with single sign-on support.`,null,{hk:`3NgGC5`,project:`auth`}),Mh=T._(`Log in to Positive Surfer`,null,{hk:`1rkRxD`,project:`auth`}),Nh=({onTwoFactorAuthRequired:e,handleGoogleLogin:n})=>{let{lastUsedLoginMethod:r}=xm();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Gs,{text:Mh,showSurferSuffix:!1}),(0,X.jsx)(`meta`,{name:`description`,content:jh}),(0,X.jsx)(bh,{children:(0,X.jsxs)(`div`,{className:`my-3xl grid w-full lg:my-[84px] lg:grid-cols-2 lg:gap-[84px]`,children:[(0,X.jsxs)(`div`,{className:`contents gap-2xl lg:flex lg:flex-col lg:items-start`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-lg`,children:[(0,X.jsx)(Lm,{className:`h-[20px] lg:ml-[20px] lg:h-auto`}),(0,X.jsx)(uo,{className:`max-w-[128px] lg:hidden`,theme:`dark`})]}),(0,X.jsx)(`div`,{className:`order-2 my-xl text-[28px] leading-[1.2] sm:text-[35px] lg:my-0 lg:ml-[20px]`,children:w._(`Technology that sparks lasting connections`,null,{hk:`4rCGHy`,project:`auth`})}),(0,X.jsx)(`div`,{className:`order-4 lg:order-3`,children:(0,X.jsx)(Oh,{})})]}),(0,X.jsxs)(`div`,{className:`order-3 mb-xl lg:relative lg:order-4 lg:mb-0`,children:[(0,X.jsx)(`div`,{className:`absolute right-0 top-[-84px] hidden lg:block`,children:(0,X.jsx)(uo,{theme:`dark`})}),(0,X.jsxs)(xh,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-lg`,children:[(0,X.jsx)(`div`,{className:`hidden place-items-center rounded-xl bg-black p-[18px] lg:flex`,children:(0,X.jsx)(t,{Component:Km.icon,className:`size-[36px] text-orange-70`})}),(0,X.jsx)(`div`,{className:`text-xl font-semibold tracking-[-0.015em] text-black`,children:w._(`Sign in to Positive {productName}`,[w._param(`productName`,(0,X.jsx)(Ah,{}))],{hk:`4Fb1Gr`,project:`auth`})})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-md`,children:[(0,X.jsx)(km,{color:`secondary`,fullWidth:!0,onClick:()=>n(),icon:qs,annotation:r===`google`?(0,X.jsx)(Mm,{}):void 0,children:w._(`Continue with Google`,null,{hk:`36TaVI`,project:`auth`})}),(0,X.jsx)(Am,{to:`/login/sso`,icon:hm,iconColor:`text-gray-80`,color:`secondary`,fullWidth:!0,annotation:r===`sso`?(0,X.jsx)(Mm,{}):void 0,children:w._(`Continue with SSO`,null,{hk:`2ly9MR`,project:`auth`})})]}),(0,X.jsx)(Ks,{}
80),(0,X.jsx)(Fm,{onTwoFactorAuthRequired:e})]})]})]})})]})},Ph=3e4,Fh=({codeFailed:e,onCodeRequested:t})=>{let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{e&&r(!0)},[e]),fr(()=>{r(!0)},Ph),(0,X.jsxs)(X.Fragment,{children:[!i&&n&&(0,X.jsxs)(`div`,{className:`pt-xs text-md text-gray-100 max-sm:text-white-60`,children:[w._(`Didn't receive the code?`,null,{hk:`3xZsYy`,project:`auth`}),` `,(0,X.jsx)(o,{color:`secondary`,variant:`text`,className:`max-sm:text-white-60`,size:`small`,onClick:()=>{r(!1),a(!0),t()},children:w._(`Send code again`,null,{hk:`24sRgn`,project:`auth`})})]}),i&&(0,X.jsx)(`div`,{className:`text-center text-gray-100 max-sm:text-white-60`,children:w._(`Please, check your spam folder. If the code email is still missing, please contact {supportLink}.`,[w._param(`supportLink`,(0,X.jsx)(z,{noVisitedState:!0,variant:`standalone`,className:`max-sm:text-white-60`,href:`mailto:[email protected]`,children:`[email protected]`}))],{hk:`34v3Bi`,project:`auth`})})]})},Ih=6,Lh=/[0-9]/,Rh=({session:e})=>{var t;let n=W(Ea.maxSm),{execute:r,containerRef:i,isLoading:a}=Ia(),{control:s,handleSubmit:c,setError:l,setValue:u,watch:d,formState:{errors:f,isSubmitting:p}}=si({defaultValues:{code:``,rememberDevice:!1}}),m=d(`code`).length===Ih,h=p||a,g=h||!m,_=async t=>{let n=await r(),i=await Js.login({email:e.email,password:e.password,recaptcha_token:n,two_factor_auth_code:t.code,remember_device:t.rememberDevice});if(i.success)_m.sendWithoutContext({type:`password`}),window.location.assign(mm()??i.redirectUrl);else{let e=i.error.error_code;vm.sendWithoutContext({label:e}),u(`code`,``),l(`code`,{type:e,message:Sm(e)})}},v=async()=>{let t=await r();Js.login({email:e.email,password:e.password,recaptcha_token:t})},y=e=>{Lh.test(e.key)||e.key===`Enter`||e.preventDefault()};return(0,X.jsxs)(`form`,{onSubmit:c(_),children:[(0,X.jsx)(Fa,{ref:i}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-lg`,children:[(0,X.jsx)(`div`,{className:`text-center max-sm:text-white-60`,children:w._(`We didn't recognize your device! {=m1} Please enter the verification code we sent to {=m3}`,[w._implicitParam(`=m1`,(0,X.jsx)(`br`,{})),w._implicitParam(`=m3`,(0,X.jsx)(`div`,{className:`font-semibold`,children:w._(`{email}`,[w._param(`email`,e.email)],{hk:`1b1wAT`,project:`auth`})}))],{hk:`2ZFnF3`,project:`auth`})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(Wr,{htmlFor:`code`,className:`max-sm:text-white-60`,children:w._(`Code`,null,{hk:`1voKtp`,project:`auth`})}),(0,X.jsx)(oi,{control:s,name:`code`,render:({field:e})=>{var t;return(0,X.jsx)(Ti,{...e,id:`code`,theme:n?`dark`:`light`,className:`max-sm:!text-base sm:!bg-white-base`,onKeyPress:y,maxLength:Ih,autoFocus:!0,invalid:!!f.code&&!p,errorMessage:(t=f.code)==null?void 0:t.message,disabled:h})}}),(0,X.jsx)(Fh,{codeFailed:((t=f.code)==null?void 0:t.type)===`two_factor_auth_failed`,onCodeRequested:()=>void v()})]}),(0,X.jsx)(`div`,{className:`flex justify-center`,children:(0,X.jsx)(oi,{control:s,name:`rememberDevice`,render:({field:e})=>(0,X.jsx)(Ci,{size:`small`,checked:e.value,onChange:e.onChange,disabled:h,children:(0,X.jsx)(`span`,{className:`max-sm:text-white-60`,children:w._(`Remember this device`,null,{hk:`2mP6kR`,project:`auth`})})})})}),(0,X.jsx)(o,{loading:h,disabled:g,color:`secondary`,fullWidth:!0,type:`submit`,children:w._(`Login`,null,{hk:`2IcCa9`,project:`auth`})})]})]})},zh=T._(`Log in to Surfer to research, write, and optimize content with AI-powered SEO tools. Fast, secure access with single sign-on support.`,null,{hk:`uI6hF`,project:`auth`}),Bh=T._(`Log in to Surfer`,null,{hk:`42aFfG`,project:`auth`}),Vh=()=>{let{send:e}=F(),[t]=ge(),[n]=I(`positive_auth_pages`),{setLastUsedLoginMethod:r}=xm(),[i,a]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(!1),l=t.get(`token`);(0,Y.useEffect)(()=>{l&&(c(!0),Js.login({token:l}).then(e=>{e.success?(r(`email`),_m.sendWithoutContext({type:`password`}),window.location.assign(mm()??e.redirectUrl)):(vm.sendWithoutContext({label:e.error.error_code}),window.location.assign(`/login`))}))},[r,l]);let u=(0,Y.useCallback)(()=>{r(`google`),e(_m,{type:`social`}),setTimeout(()=>Gt(mm()),100)},[e,r]);return l?s?(0,X.jsx)(C,{}):null:i?(0,X.jsxs)(ym,{title:T._(`2FA - Surfer`,null,{hk:`ls1UB`,project:`auth`}),heading:T._(`Check your email`,null,{hk:`3j3UH7`,project:`auth`}),children:[(0,X.jsx)(`meta`,{name:`description`,content:zh}),(0,X.jsx)(bm,{children:(0,X.jsx)(Rh,{session:i})})]}):n?(0,X.jsx)(Nh,{handleGoogleLogin:u,onTwoFactorAuthRequired:a}):(0,X.jsxs)(ym,{title:Bh,heading:Bh,children:[(0,X.jsx)(`meta`,{name:`description`,content:zh}),(0,X.jsxs)(bm,{children:[(0,X.jsx)(o,{icon:qs,color:`secondary`,fullWidth:!0,onClick:u,children:w._(`Continue with Google`,null,{hk:`36TaVI`,project:`auth`})}),(0,X.jsx)(L,{to:`/login/sso`,icon:hm,color:`secondary`,fullWidth:!0,children:w._(`Continue with SSO`,null,{hk:`2ly9MR`,project:`auth`})}),(0,X.jsx)(Ks,{className:`max-sm:hidden`}),(0,X.jsx)(wm,{onTwoFactorAuthRequired:a})]})]})},Hh=P({category:`auth`,name:`signed up`,payloadSchema:U({type:da(`social`).or(da(`password`)),provided_phone_number:H().optional()}),customTracking(e){gm(`sign_up`,e.payload.type===`password`?`e-mail`:`google`),ha(`auth.signup`,{label:e.payload.type})}}),Uh=P({category:`auth`,name:`signup failed`,payloadSchema:U({label:V()}),customTracking(e){ha(`error.signup error`,{label:e.payload.label})}}),Wh=`surfer_registration_event`,Gh=U({email:ec,password:Qs,phoneNumber:$s,acceptTerms:H().refine(e=>e,T._(`You have to accept terms to proceed`,null,{hk:`2UQkRN`,project:`auth`})),acceptMarketing:H()}),Kh=()=>{var e,n,r;let{send:i}=F(),[a]=ge(),s=W(Ea.maxSm),[c]=I(`sign_up_phone_number`),l=S().state,{execute:u,containerRef:d,isLoading:f}=Ia(),{register:p,control:m,handleSubmit:h,setError:g,setValue:_,w
80atch:v,formState:{errors:y,isSubmitting:ee}}=si({resolver:li(Gh),defaultValues:{email:(l==null?void 0:l.email)??``,password:``,phoneNumber:``,acceptTerms:!1,acceptMarketing:!1}}),b=v(`email`),x=v(`acceptTerms`),te=v(`acceptMarketing`),ne=x&&te,ie=()=>{_(`acceptTerms`,!ne,{shouldValidate:!0}),_(`acceptMarketing`,!ne)};(0,Y.useEffect)(()=>{let e=a.get(`event`);e&&re.set(Wh,e,{expires:7,domain:`.surferseo.com`})},[a]);let C=(0,Y.useCallback)(()=>{i(Hh,{type:`social`,provided_phone_number:!1}),setTimeout(()=>Gt(mm()),100)},[i]),ae=async e=>{let t=await u(),n=await Js.signup({email:e.email.toLowerCase(),password:e.password,recaptcha_token:t,accept_marketing:e.acceptMarketing,phone_number:c?e.phoneNumber:void 0});if(n.success)Hh.sendWithoutContext({type:`password`,provided_phone_number:c?e.phoneNumber.length>0:void 0}),window.location.assign(mm()??n.redirectUrl);else{var r;if(Uh.sendWithoutContext({label:n.error.error_code}),c&&!((r=n.error.errors)==null||(r=r.phone_number)==null)&&r.length)g(`phoneNumber`,{message:Zs});else{let e=n.error.error_code;g(`root`,{type:e,message:Sm(e)})}}},oe=ee||f;return(0,X.jsxs)(ym,{title:T._(`Sign up â Surfer`,null,{hk:`3oP9bT`,project:`auth`}),heading:T._(`Sign up for Surfer`,null,{hk:`171qNh`,project:`auth`}),children:[(0,X.jsxs)(bm,{children:[(0,X.jsx)(o,{icon:qs,fullWidth:!0,color:`secondary`,onClick:C,children:w._(`Sign up with Google`,null,{hk:`3bmIzG`,project:`auth`})}),(0,X.jsx)(Ks,{className:`text-white-100`}),(0,X.jsxs)(`form`,{onSubmit:h(ae),children:[(0,X.jsx)(Fa,{ref:d}),(0,X.jsxs)(`div`,{className:`mp-block flex flex-col gap-base`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(qh,{htmlFor:`email`,children:w._(`Email`,null,{hk:`fTaS1`,project:`auth`})}),(0,X.jsx)(Ti,{...p(`email`),"data-testid":`register-email-input`,id:`email`,className:`max-sm:!text-base sm:!bg-white-base`,theme:s?`dark`:`light`,placeholder:T._(`Enter your email`,null,{hk:`2tkdDs`,project:`auth`}),invalid:!!y.email,errorMessage:((e=y.email)==null?void 0:e.message)??``,disabled:oe})]}),c&&(0,X.jsx)(La,{name:`phoneNumber`,control:m,theme:s?`dark`:`light`,label:(0,X.jsx)(`span`,{className:`max-sm:text-white-60`,children:w._(`Phone number`,null,{hk:`2pxRes`,project:`auth`})}),disabled:oe,invalid:!!y.phoneNumber,errorMessage:((n=y.phoneNumber)==null?void 0:n.message)??``,hintMessage:T._(`For validation and onboarding. No spam.`,null,{hk:`2krSe1`,project:`auth`}),containerClassName:`sm:[&_.PhoneInputInput]:!bg-white-base`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(qh,{htmlFor:`password`,children:w._(`Password`,null,{hk:`3Obkyv`,project:`auth`})}),(0,X.jsx)(Ti,{...p(`password`),"data-testid":`register-password-input`,id:`password`,className:`max-sm:!text-base sm:!bg-white-base`,theme:s?`dark`:`light`,type:`password`,placeholder:T._(`Enter your password`,null,{hk:`b2I7h`,project:`auth`}),invalid:!!y.password,errorMessage:((r=y.password)==null?void 0:r.message)??``,hintMessage:T._(`Use at least 8 characters.`,null,{hk:`3zWOzr`,project:`auth`}),disabled:oe})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-md`,children:[(0,X.jsx)(`div`,{className:`flex gap-md`,children:(0,X.jsx)(ri,{size:`small`,checked:ne,onChange:ie,children:(0,X.jsx)(`span`,{className:`max-sm:text-white-60`,children:w._(`Accept all`,null,{hk:`2zkSNw`,project:`auth`})})})}),(0,X.jsx)(`div`,{className:`flex gap-md`,children:(0,X.jsx)(oi,{control:m,name:`acceptMarketing`,render:({field:e})=>(0,X.jsx)(ri,{size:`small`,checked:e.value,onChange:e.onChange,children:(0,X.jsx)(`span`,{className:`max-sm:text-white-60`,children:w._(`Send me early access to new features, expert tutorials, and special offers.`,null,{hk:`27Y5F`,project:`auth`})})})})}),(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`div`,{className:`flex gap-md max-sm:text-white-60`,children:(0,X.jsx)(oi,{control:m,name:`acceptTerms`,render:({field:e})=>(0,X.jsx)(ri,{"data-testid":`register-terms-toggle`,size:`small`,checked:e.value,onChange:e.onChange,children:(0,X.jsx)(`span`,{className:`max-sm:text-white-60`,children:w._(`I have read and accept {regulationsLink} and {privacyPolicyLink}`,[w._param(`regulationsLink`,(0,X.jsx)(z,{className:`max-sm:text-white-60`,href:`https://surferseo.com/regulations`,rel:`noopener`,children:w._(`Regulations`,null,{hk:`fBqmj`,project:`auth`})})),w._param(`privacyPolicyLink`,(0,X.jsx)(z,{className:`max-sm:text-white-60`,href:`https://surferseo.com/privacy-policy`,rel:`noopener`,children:w._(`Privacy Policy`,null,{hk:`rS9wy`,project:`auth`})}))],{hk:`1nCuRS`,project:`auth`})})})})}),y.acceptTerms&&(0,X.jsx)(`div`,{className:`min-h-[20px] pt-xs align-middle text-sm leading-5 text-red-base`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2xs`,children:[(0,X.jsx)(t,{"aria-hidden":`true`,Component:Ur}),y.acceptTerms.message]})})]})]}),y.root&&(0,X.jsx)(`div`,{className:`pb-base text-center text-red-80`,role:`alert`,children:y.root.message}),(0,X.jsx)(o,{"data-testid":`register-form-submit`,color:`secondary`,loading:oe,fullWidth:!0,type:`submit`,children:w._(`Sign up with Email`,null,{hk:`1Uvwwk`,project:`auth`})})]})]})]}),(0,X.jsx)(`div`,{className:`text-center text-md text-white-base max-sm:text-white-60`,children:w._(`Already have an account? {loginLink}`,[w._param(`loginLink`,(0,X.jsx)(L,{"data-testid":`register-to-login`,variant:`pure`,size:`small`,className:`pl-2xs font-semibold text-white-base max-sm:text-white-60`,to:`/login`,state:{email:b},children:w._(`Log in`,null,{hk:`1xhn6B`,project:`auth`})}))],{hk:`1Bqd0v`,project:`auth`})})]})},qh=({children:e,htmlFor:t})=>(0,X.jsx)(Wr,{htmlFor:t,className:`relative after:absolute after:-top-3xs after:right-auto after:text-red-base after:content-['*'] max-sm:text-white-60`,children:e}),Jh=({className:e,email:t,theme:n})=>(0,X.jsx)(z,{to:`/login`,className:e,theme:n,state:{email:t},children:w._(`Back to login`,null,{hk:`14HORt`,project:`auth`})}),Yh=e=>(0,X.jsx)(ym,{logoSlot:(0,X.jsx)(t,{size:`xlarge`,className:`size-[56px] text-green-40`,Component:Xn}),title:T._(`Password Reset - Surfer`,null,{hk:`3tX4XJ`,project:`auth`}),heading:e.title,children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-lg text-white-base`,children:[(0,X.jsx)(`div`,{className:`text-center text-base`,children:e.actionResult}),(0,X.jsx)(Jh,{theme:`dark`,className:`self-center text-md max-sm:text-white-60`})]})}),Xh=U({password:Qs}),Zh=()=>{var e;let t=W(Ea.maxSm),[n,r]=(0,Y.useState)(!1),{register:i,handleSubmit:a,setError:s,formState:{errors:c,isSubmitting:l}}=si({resolver:li(Xh),defaultValues:{password:``}});return n?(0,X.jsx)(Yh,{title:T._(`Password changed successfully`,null,{hk:`2Vpkl5`,project:`auth`}),actionResult:T._(`Password changed.`,null,{hk:`qkL6y`,project:`auth`})}):(0,X.jsx)(ym,{title:T._(`Reset password - Surfer`,null,{hk:`2TxU2H`,project:`auth`}),heading:T._(`Reset password`,null,{hk:`3Vm00F`,project:`auth`}),children:(0,X.jsx)(bm,{children:(0,X.jsx)(`form`,{onSubmit:a(async e=>{let t=re.get(`reset_password_token`)??null;if(!t)return;let n=await Js.resetPassword({token:t,new_password:e.password});if(n.success)r(!0),window.location.assign(n.redirectUrl);else{let e=n.error.error_code;s(`root`,{type:e,message:Sm(e)})}}),children:(0,X.jsxs)(`div`,{className:`mp-block flex flex-col gap-lg`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(Wr,{htmlFor:`password`,className:`max-sm:text-white-60`,children:w._(`Password`,null,{hk:`4sdzNH`,project:`auth`})}),(0,X.jsx)(Ti,{...i(`password`),id:`password`,theme:t?`dark`:`light`,type:`password`,placeholder:T._(`Enter your new password`,null,{hk:`xaLXW`,project:`auth`}),invalid:!!c.password,errorMessage:((e=c.password)==null?void 0:e.message)??``})]}),(0,X.jsx)(o,{color:`secondary`,loading:l,fullWidth:!0,type:`submit`,children:w._(`Reset password`,null,{hk:`1qtQdI`,project:`auth`})}),c.root&&(0,X.jsx)(`div`,{className:`pb-base text-center text-red-120`,children:c.root.message}),(0,X.jsx)(Jh,{className:`self-center text-center text-md max-sm:text-white-60`})]})})})})},Qh=P({category:`auth`,name:`reset password requested`,payloadSchema:U({email:V()})}),$h=U({email:ec}),eg=()=>{var e;let t=W(Ea.maxSm),{send:n}=F(),[r,i]=(0,Y.useState)(!1),a=S().state,{register:s,handleSubmit:c,setError:l,watch:u,formState:{errors:d,isSubmitting:f}}=si({resolver:li($h),defaultValues:{email:(a==null?void 0:a.email)??``}}),p=async e=>{n(Qh,{email:e.email});let t=await Js.requestPasswordReset({email:e.email.toLowerCase()});if(t.success)i(!0);else{let e=t.error.error_code;l(`root`,{type:e,message:Sm(e)})}};if(r)return(0,X.jsx)(Yh,{title:T._(`Check your email`,null,{hk:`zd42k`,project:`auth`}),actionResult:T._(`You should receive an email with instructions for resetting your password.`,null,{hk:`1eBARy`,project:`auth`})});let m=u(`email`);return(0,X.jsx)(ym,{title:T._(`Password Reset - Surfer`,null,{hk:`1EniHS`,project:`auth`}),heading:T._(`Can't log in?`,null,{hk:`cJaCK`,project:`auth`}),children:(0,X.jsx)(bm,{children:(0,X.jsx)(`form`,{onSubmit:c(p),children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-lg`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(Wr,{htmlFor:`email`,className:`max-sm:text-white-60`,children:w._(`Email`,null,{hk:`2K6sf2`,project:`auth`})}),(0,X.jsx)(Ti,{...s(`email`),id:`email`,theme:t?`dark`:`light`,placeholder:T._(`[email protected]`,null,{hk:`33NL5D`,project:`auth`}
80),className:`max-sm:!text-base`,invalid:!!d.email,errorMessage:((e=d.email)==null?void 0:e.message)??``})]}),(0,X.jsx)(o,{color:`secondary`,loading:f,fullWidth:!0,type:`submit`,children:w._(`Reset password`,null,{hk:`43tEpN`,project:`auth`})}),d.root&&(0,X.jsx)(`div`,{className:`text-center text-red-120`,children:d.root.message}),(0,X.jsx)(Jh,{email:m,className:`block self-center text-center text-md max-sm:text-white-60`})]})})})})},tg=T._(`Log in to Surfer using Single Sign-On (SSO). Secure access to your Surfer account through your organization's identity provider.`,null,{hk:`4daBSv`,project:`auth`}),ng=U({email:ec}),rg=()=>{var e;let t=x(),n=W(Ea.maxSm),{execute:r,containerRef:i,isLoading:a}=Ia(),{setLastUsedLoginMethod:s}=xm(),{register:c,handleSubmit:l,setError:u,formState:{errors:d,isSubmitting:f}}=si({resolver:li(ng),defaultValues:{email:``}}),p=()=>{t(`/login`)},m=async e=>{let t=await r(),n=e.email.split(`@`)[1],i=await Js.getIdentityProvider({domain:n,recaptcha_token:t,redirectTo:mm()});i.success?(s(`sso`),window.location.assign(i.redirectUrl)):u(`root`,{type:i.error.error_code})},h=f||a;return(0,X.jsxs)(ym,{title:T._(`SSO Login - Surfer`,null,{hk:`1YMTlC`,project:`auth`}),heading:T._(`SSO Login`,null,{hk:`3gwoce`,project:`auth`}),subtitle:T._(`You will be redirected to your organization's login page`,null,{hk:`2KVyEG`,project:`auth`}),children:[(0,X.jsx)(`meta`,{name:`description`,content:tg}),(0,X.jsx)(bm,{children:(0,X.jsxs)(`form`,{className:`w-full`,onSubmit:l(m),children:[(0,X.jsx)(Fa,{ref:i}),(0,X.jsxs)(`div`,{className:`flex flex-col items-stretch gap-base`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(Wr,{htmlFor:`email`,className:`max-sm:text-white-60`,children:w._(`Email`,null,{hk:`2y8BFW`,project:`auth`})}),(0,X.jsx)(Ti,{...c(`email`),id:`email`,theme:n?`dark`:`light`,className:`max-sm:!text-base sm:!bg-white-base`,placeholder:T._(`e.g. [email protected]`,null,{hk:`1qajaG`,project:`auth`}),invalid:!!d.email,errorMessage:((e=d.email)==null?void 0:e.message)??``,disabled:h,autoFocus:!0})]}),d.root&&(0,X.jsx)(`div`,{className:`pb-base text-center text-red-80`,role:`alert`,children:d.root.type===`no_idp`?w._(`SSO is not supported for this email domain`,null,{hk:`27aNsz`,project:`auth`}):w._(`Please try again`,null,{hk:`f34rg`,project:`auth`})}),(0,X.jsx)(o,{icon:hm,color:`secondary`,loading:h,fullWidth:!0,type:`submit`,children:w._(`Continue with SSO`,null,{hk:`4hTGIv`,project:`auth`})}),(0,X.jsx)(o,{icon:Wi,color:`tertiary`,fullWidth:!0,onClick:p,disabled:h,children:w._(`Back to login`,null,{hk:`1PVlLY`,project:`auth`})})]})]})})]})},ig=()=>(0,X.jsx)(ua,{queryParams:{version:`2`,app:`main`},children:(0,X.jsx)(ag,{})}),ag=()=>{let[e]=On({errorPolicy:`all`});return(0,X.jsxs)(xr,{queryRef:e,children:[(0,X.jsx)(fm,{}),(0,X.jsx)(n,{})]})},og=[{element:(0,X.jsx)(ig,{}),children:[{path:`login`,element:(0,X.jsx)(Vh,{})},{path:`login/sso`,element:(0,X.jsx)(rg,{})},{path:`register`,element:(0,X.jsx)(Kh,{})},{path:`reset_password`,element:(0,X.jsx)(eg,{})},{path:`ooops/forgotten_password`,element:(0,X.jsx)(Zh,{})}]}],sg=18,cg=({children:e})=>{let{isFreemium:t,isChurned:r,isNewUser:i}=G(),{subscriptionPastDue:a}=xa(),o=S(),s=Yn(),[c,l]=(0,Y.useState)(),u=`softFreemiumRedirectDone`;(0,Y.useEffect)(()=>
80{l(re.get(u)===`true`)},[]);let d=(0,Y.useCallback)(()=>{let e=(0,Z.default)().add(sg,`hours`).toDate();re.set(u,`true`,{expires:e}),l(!0),s(`/billing/subscription/plans`)},[s]),f=!!Sr([`/workspace/:workspaceId/onboarding/survey/*`,`/workspace/:workspaceId/survey/*`,`/workspace/:workspaceId/billing/subscription/plans/*`,`/workspace/:workspaceId/billing/subscription/checkout/*`],o.pathname),p=i&&!f,m=t&&!f&&c===!1;return(0,Y.useEffect)(()=>{m&&d()},[m,d]),m?null:p?(0,X.jsx)(J,{to:`/billing/subscription/plans`,replace:!0}):a&&!dg(ug,o.pathname)?(0,X.jsx)(J,{to:`/past_due`,replace:!0}):r&&!dg(lg,o.pathname)?(0,X.jsx)(J,{to:`/expired_plan`,replace:!0}):e?(0,X.jsx)(X.Fragment,{children:e}):(0,X.jsx)(n,{})},lg=[`/workspace/:workspaceId/billing/subscription/plans/*`,`/workspace/:workspaceId/billing/subscription/checkout/*`,`/workspace/:workspaceId/expired_plan/*`,`/workspace/:workspaceId/settings/*`],ug=[`/workspace/:workspaceId/past_due/*`,`/workspace/:workspaceId/settings`,`/workspace/:workspaceId/settings/billing_details`,`/workspace/:workspaceId/settings/invoices`],dg=(e,t)=>!!Sr(e,t),fg=({children:e})=>{let t=N(),r=K(),i=`/settings/billing_details`,a=p(t(i)),[o,s]=(0,Y.useState)(!1),{addToast:c}=gr(),{channel:l}=xn();(0,Y.useEffect)(()=>{a&&s(!1)},[a]),(0,Y.useEffect)(()=>{a||za(l).then(e=>{var t;s(nc(e==null||(t=e.shipping)==null?void 0:t.address))})},[l,a]);let u=r&&o&&!a;return(0,Y.useEffect)(()=>{u&&c({type:`warning`,title:T._(`Missing state in billing address`,null,{hk:`3JnFu0`,project:`billing`}),content:T._(`Please provide a state in your billing address to continue using Surfer.`,null,{hk:`3f4yLB`,project:`billing`}),group:`billing-missing-state-billing-redirect`})},[u,c]),u?(0,X.jsx)(J,{to:i,replace:!0,state:{focusBillingState:!0}}):e?(0,X.jsx)(X.Fragment,{children:e}):(0,X.jsx)(n,{})},pg=(e,t)=>{let n=mg(e,t),r=n({from:`/keyword_research/queries/:queryId`,to:`/keyword_research/queries/:queryId/:clusterId`}),i=n({from:`/keyword_research/queries/:queryId/:clusterId`,to:`/keyword_research/queries/:queryId`}),a=n({from:`/keyword_research/queries/:queryId/:clusterId`,to:`/keyword_research/queries/:queryId/:clusterId`});return!(r||i||a)},mg=(e,t)=>({from:n,to:r})=>{let i=h({path:`/workspace/:workspaceId${n}`},e.pathname),a=h({path:`/workspace/:workspaceId${r}`},(t==null?void 0:t.pathname)||``);return!!(i&&a)},hg=P({category:`billing`,name:`segmentation_survey_completed`,payloadSchema:U({onboarding_survey_customer_segment:V().nullable(),onboarding_survey_customer_segment_other:V().nullable(),onboarding_survey_current_website:V().nullable(),onboarding_survey_seo_team_size:V().nullable(),onboarding_survey_customer_role:V().nullable(),onboarding_survey_customer_interests:V().nullable(),onboarding_survey_interests_other:V().nullable(),onboarding_survey_referral_source:V().nullable(),onboarding_survey_referral_source_other:V().nullable()})}),gg=P({category:`billing`,name:`segmentation_survey_question_answered`,payloadSchema:U({question_id:V(),question_answer:V().nullable().or(fa(V())),question_answer_other:V().nullable()})}),_g=e=>{var t;if(!e||e.length===0)return{question_answer:null,question_answer_other:null};let n=e.findIndex(e=>e.input&&e.input.inputValue),r=e.map(e=>e.value),i=n>-1?((t=e[n].input)==null?void 0:t.inputValue)??null:null;return{question_answer:e.length===1?r[0]:r,question_answer_other:i}},vg=e=>({customer_segment:bg(e.customer_segment),customer_segment_other:xg(e.customer_segment),current_website:bg(e.current_website),seo_team_size:bg(e.seo_team_size),customer_role:bg(e.customer_role),customer_interests:bg(e.customer_interests),interests_other:xg(e.customer_interests),referral_source:bg(e.referral_source),referral_source_other:xg(e.referral_source)}),yg=(e,t)=>e.map(({questions:e})=>Object.fromEntries(e.map(e=>[e.key,!!e.optional]))).some(e=>Object.entries(e).some(([e,n])=>t[e]===null&&!n)),bg=e=>e?e.map(e=>e.value).join(`, `):null,xg=e=>{var t;return(e==null||(t=e.find(e=>e.input))==null||(t=t.input)==null?void 0:t.inputValue)??null},Sg=T._(`Other`,null,{hk:`6DWN4`,project:`onboarding`}),Cg=T._(`Tell us what you want to achieve`,null,{hk:`4cyqEp`,project:`onboarding`}),wg=T._(`Tell us where you found us`,null,{hk:`1As6nc`,project:`onboarding`}),Tg=[{id:`customer_role`,title:T._(`Who are you?`,null,{hk:`39X3JZ`,project:`onboarding`}),questions:[{key:`customer_role`,type:`picker_extended`,options:[...ti([{label:T._(`Marketing Manager / Head of Marketing`,null,{hk:`3oCaj`,project:`onboarding`}),value:`Marketing Manager`},{label:T._(`Owner / CEO / GM`,null,{hk:`2FUq5T`,project:`onboarding`}),value:`Owner / CEO / GM`},{label:T._(`SEO Specialist / Manager`,null,{hk:`1UzIk3`,project:`onboarding`}),value:`SEO Specialist`},{label:T._(`Content Manager`,null,{hk:`RAIhX`,project:`onboarding`}),value:`Content Manager`},{label:T._(`Content Writer`,null,{hk:`28jpx2`,project:`onboarding`}),value:`Content Writer`},{label:T._(`PR / Branding / Influencer`,null,{hk:`2vL9zr`,project:`onboarding`}),value:`PR / Branding / Influencer`}]),{label:Sg,value:`Other`}]}]},{id:`customer_interests`,title:T._(`What's your primary goal?`,null,{hk:`3rDgkt`,project:`onboarding`}),questions:[{key:`customer_interests`,type:`picker_extended`,options:[...ti([{label:T._(`Create content that ranks`,null,{hk:`1uTkxz`,project:`onboarding`}),value:`Content creation`},{label:T._(`Research keywords`,null,{hk:`uWgyT`,project:`onboarding`}),value:`Keyword research`},{label:T._(`Track my rankings`,null,{hk:`4s0PR4`,project:`onboarding`}),value:`Rank tracking`},{label:T._(`Get visible in AI search`,null,{hk:`mP5VU`,project:`onboarding`}),value:`AI visibility`},{label:T._(`Audit and improve my site`,null,{hk:`1CAYnb`,project:`onboarding`}),value:`SEO audit`}]),{label:Sg,value:`Other`,input:{optional:!0,type:`textarea`,placeholder:Cg}}]}]},{id:`referral_source`,title:T._(`Where did you hear about us?`,null,{hk:`6IPNK`,project:`onboarding`}),questions:[{key:`referral_source`,type:`picker_extended`,options:[...ti([{label:T._(`Google Search`,null,{hk:`2KUYRk`,project:`onboarding`}),value:`Google Search`},{label:T._(`YouTube`,null,{hk:`oEChM`,project:`onboarding`}),value:`YouTube`},{label:T._(`LinkedIn`,null,{hk:`7DQeU`,project:`onboarding`}),value:`LinkedIn`},{label:T._(`ChatGPT or other AI`,null,{hk:`1KMd4i`,project:`onboarding`}),value:`ChatGPT or other AI`},{label:T._(`Facebook`,null,{hk:`11F01U`,project:`onboarding`}),value:`Facebook`},{label:T._(`Events`,null,{hk:`2lZEM7`,project:`onboarding`}),value:`Events`},{label:T._(`External Advisors`,null,{hk:`2ARQfG`,project:`onboarding`}),value:`External Advisors`},{label:T._(`Surfer Masterclass`,null,{hk:`1nGE0D`,project:`onboarding`}),value:`Content Optimization Masterclass`},{label:T._(`Software reviews (G2, Capterra)`,null,{hk:`1SmeYt`,project:`onboarding`}),value:`Software reviews (G2, Capterra)`},{label:T._(`Word of mouth and peers`,null,{hk:`18Ts1V`,project:`onboarding`}),value:`Word of mouth and peers`}]),{label:Sg,value:`Other`,input:{optional:!0,type:`textarea`,placeholder:wg}}]}]}],Eg=({onClose:e,onNext:t})=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($n,{children:(0,X.jsx)(Zn,{children:w._(`Help us understand your needs`,null,{hk:`4cyF5Z`,project:`onboarding`})})}),(0,X.jsx)(qn,{children:(0,X.jsx)(`div`,{className:`text-balance text-base`,children:w._(`Take a few moments to give us more insights about yourself and your work, so we can learn how to provide you with the best experience when using Surfer.`,null,{hk:`4zyYtM`,project:`onboarding`})})}),(0,X.jsxs)(cr,{children:[(0,X.jsx)(o,{variant:`text`,onClick:e,children:w._(`Dismiss`,null,{hk:`1q72c8`,project:`onboarding`})}),(0,X.jsx)(o,{onClick:t,children:w._(`Next`,null,{hk:`vNQWG`,project:`onboarding`})})]})]}),Dg=T._(`Fill in required fields`,null,{hk:`2nYbKY`,project:`onboarding`}
80),Og=(e,t)=>{var n;return!t&&!e.optional||e.type===`picker_multiple`&&(!t||t.length===0)?e.errorMessage??Dg:t&&(n=t[0])!=null&&n.input&&t[0].input.inputValue&&t[0].input.inputValue.length>500?T._(`Please enter at most 500 characters.`,null,{hk:`2F1go`,project:`onboarding`}):!0},kg=e=>Object.fromEntries(e.flatMap(e=>e.questions.map(e=>[e.key,`input`in e?``:null]))),Ag=T._(`Select an answer`,null,{hk:`srK3z`,project:`onboarding`}),jg=({value:e,question:t,label:n,onChange:r})=>{var i;let a=(t,n)=>{var i;let a={...t,input:{inputValue:n,placeholder:(i=t.input)==null?void 0:i.placeholder,type:`textarea`}};r((e??[]).map(e=>e.value===t.value?a:e))};if(t.type===`picker_multiple`){var o;let i=e==null?void 0:e.find(e=>{var t;return((t=e.input)==null?void 0:t.type)===`textarea`});return(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(kr,{multiple:!0,fullWidth:!0,"data-testid":`survey-question-select`,label:n??t.label,options:t.options,value:e??[],placeholder:Ag,onValueChange:e=>r(e??[])}),i&&(0,X.jsx)(nr,{className:`!text-md`,placeholder:(o=i.input)==null?void 0:o.placeholder,minHeight:75,invalid:!1,onValueChange:e=>a(i,e)})]})}let s=(e==null?void 0:e[0])??null;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(kr,{fullWidth:!0,"data-testid":`survey-question-select`,label:n??t.label,options:t.options,value:s,placeholder:Ag,onValueChange:e=>{e&&r([e])}}),(s==null||(i=s.input)==null?void 0:i.type)===`textarea`&&(0,X.jsx)(nr,{className:`!text-md`,placeholder:s.input.placeholder,minHeight:75,invalid:!1,onValueChange:e=>a(s,e)})]})},Mg=({survey:e,hideProgress:t,onChange:n,onSubmit:r})=>{let[i,a]=(0,Y.useState)(0),s=e.length,{send:c}=F(),l=e[i],{formState:u,control:d,trigger:f,handleSubmit:p,getValues:m,setValue:h}=si({defaultValues:kg(e),mode:`onChange`}),g=(0,Y.useCallback)(async e=>{u.isValid&&await r(e)},[u.isValid,r]);(0,Y.useEffect)(()=>{f()},[i,f]);let _=(0,Y.useCallback)((e,t)=>{h(t.key,e,{shouldValidate:!0}),n==null||n(l.id,{...m(),[t.key]:e})},[m,h,n,l.id]),v=(0,Y.useCallback)(()=>{let{question_answer:e,question_answer_other:t}=_g(m(l.id));c(gg,{question_id:l.id,question_answer:e,question_answer_other:t}),a(e=>e+1)},[l.id,m,c]);return(0,X.jsxs)(`form`,{onSubmit:p(g),children:[(0,X.jsx)($n,{children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-3xs`,children:[(0,X.jsx)(Zn,{children:l.title}),l.subtitle&&(0,X.jsx)(`div`,{className:`text-base`,children:l.subtitle})]})}),(0,X.jsx)(qn,{className:`flex-col`,children:l.questions.map(e=>(0,X.jsx)(oi,{name:e.key,control:d,rules:{validate:()=>Og(e,m(e.key))},render:({field:t})=>(0,X.jsx)(jg,{question:e,value:t.value,onChange:t=>_(t,e)},e.key)},e.key))}),(0,X.jsx)(cr,{children:(0,X.jsxs)(`div`,{className:`flex w-full items-center ${t?`justify-end`:`justify-between`}`,children:[!t&&(0,X.jsx)(`div`,{className:`text-gray-80`,children:w._({"*":{"*":`Question {current} of {total}`}},[w._param(`current`,i+1,[0,i+1]),w._param(`total`,s,[0,s])],{hk:`BRic4`,project:`onboarding`})}),(0,X.jsxs)(`div`,{className:`flex gap-base`,children:[i>0&&(0,X.jsx)(o,{onClick:()=>{a(e=>e-1)},variant:`pure`,disabled:u.isSubmitting,children:(0,X.jsx)(`div`,{className:`text-base font-medium`,children:w._(`Back`,null,{hk:`2DyJVa`,project:`onboarding`})})}),i<s-1&&(0,X.jsx)(o,{disabled:!u.isValid,color:`secondary`,onClick:v,children:w._(`Next`,null,{hk:`atBGf`,project:`onboarding`})}),i===s-1&&(0,X.jsx)(o,{disabled:!u.isValid||u.isSubmitting,color:`secondary`,type:`submit`,loading:u.isSubmitting,children:w._(`Finish`,null,{hk:`1Q8tWF`,project:`onboarding`})})]})]})})]})},Ng=()=>{let e=rc(),{addToast:t}=gr(),{user:n}=ze(),[r,i]=er(`segmentationSurveyModalShown_${n.id}`,!0),[a,o]=(0,Y.useState)(Tg),[s,c]=(0,Y.useState)(!1),{send:l}=F(),{surveyResponse:u}=gs(),d=(0,Y.useCallback)(async n=>{if(yg(a,n))return;let r=u!=null&&u.customerSegment?[{value:u.customerSegment,label:u.customerSegment}]:null,o=u!=null&&u.customerRole?[{value:u.customerRole,label:u.customerRole}]:null,s=vg({...n,customer_segment:n.customer_segment??r,customer_role:n.customer_role??o});await e.fetch(`onboarding:submit_survey`,s),l(hg,{onboarding_survey_customer_segment:s.customer_segment,onboarding_survey_customer_segment_other:s.customer_segment_other,onboarding_survey_current_website:s.current_website,onboarding_survey_seo_team_size:s.seo_team_size,onboarding_survey_customer_role:s.customer_role,onboarding_survey_customer_interests:s.customer_interests,onboarding_survey_interests_other:s.interests_other,onboarding_survey_referral_source:s.referral_source,onboarding_survey_referral_source_other:s.referral_source_other}),t({title:T._(`Thank you for helping us know you better!`,null,{hk:`WOtYZ`,project:`onboarding`}),content:T._(`Your insights have been sent.`,null,{hk:`bc24`,project:`onboarding`}),type:`success`,group:`onboarding-segmentation-survey-success`}),i(!1)},[t,e,i,a,u,l]);return(0,Y.useEffect)(()=>{u!=null&&u.customerRole&&o(e=>e.filter(e=>e.id!==`customer_role`))},[u==null?void 0:u.customerRole]),(0,X.jsx)(Jn,{open:r,onOpenChange:i,children:(0,X.jsx)(Kn,{className:`max-h-[95vh] max-w-[900px] overflow-visible`,children:s?(0,X.jsx)(Mg,{survey:a,onSubmit:d}):(0,X.jsx)(Eg,{onClose:()=>i(!1),onNext:()=>c(!0)})})})},Pg=()=>
80{let[e]=I(`segmentation_survey_collector`),{isOrganizationLoading:t}=xn(),{surveyResponse:n,surveyComplete:r}=gs(),i=j(),a=i==null?void 0:i.status.owned;return e&&!t&&a&&r&&!(n!=null&&n.customerInterests)?(0,X.jsx)(Ng,{}):null},Fg=({title:e,icon:n})=>(0,X.jsxs)(`div`,{className:`flex items-center gap-sm text-gray-80`,children:[(0,X.jsx)(t,{Component:n,className:`size-base shrink-0`}),(0,X.jsx)(`span`,{className:`text-md font-semibold`,children:e})]}),Ig=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M3.33789 7C5.06694 4.01099 8.29866 2 12.0001 2C17.5229 2 22.0001 6.47715 22.0001 12C22.0001 17.5228 17.5229 22 12.0001 22C8.29866 22 5.06694 19.989 3.33789 17M12 16L16 12M16 12L12 8M16 12H2`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),Lg=(e,t)=>e===0?T._(`First step`,null,{hk:`zHDLB`,project:`onboarding`}):e>=t-1?T._(`Last step`,null,{hk:`2ddKmJ`,project:`onboarding`}):T._(`Next step`,null,{hk:`2eEltv`,project:`onboarding`}),Rg=`Nvid7H4H8mk`,zg=1085,Bg=`onboarding-welcome-video-dismissed`,Vg=`onboarding-ai-tracker-welcome-video-dismissed`,Hg=(e=Bg)=>{let{value:t,set:n}=or(e,{defaultValue:!1}),r=T._(`Official Surfer Tutorial`,null,{hk:`4lpIaB`,project:`onboarding`});return{dismissed:!!t,setDismissed:n,videoTitle:r}},Ug=({startSeconds:e,dismissedLsKey:t})=>{let{dismissed:n,setDismissed:r,videoTitle:i}=Hg(t);return n?null:(0,X.jsxs)(`div`,{className:`relative flex flex-col gap-lg rounded-2xl border border-gray-20 bg-gray-5 p-sm sm:flex-row sm:items-center`,children:[(0,X.jsx)(ac,{videoId:Rg,title:i,theme:`light`,startSeconds:e,className:`flex w-full min-w-0 shrink-0 overflow-hidden sm:w-[280px]`}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-sm pr-lg`,children:[(0,X.jsx)(`span`,{className:`text-md font-semibold text-gray-160`,children:w._(`Make the most of your Surfer plan!`,null,{hk:`1Mi3yW`,project:`onboarding`})}),(0,X.jsx)(`span`,{className:`text-md text-gray-70`,children:w._(`Watch a quick guide on how to maximize your SEO and AI visibility in no time.`,null,{hk:`2SybPS`,project:`onboarding`})}),(0,X.jsx)(ac,{videoId:Rg,title:i,theme:`light`,startSeconds:e,children:(0,X.jsx)(o,{size:`small`,variant:`outline`,icon:ic,className:`mt-base self-start text-black`,children:w._(`Play tutorial`,null,{hk:`2lasjc`,project:`onboarding`})})})]}),(0,X.jsx)(o,{variant:`pure`,icon:ai,onClick:()=>r(!0),size:`small`,"aria-label":T._(`Dismiss`,null,{hk:`LjEXQ`,project:`onboarding`}),className:`absolute right-base top-base text-gray-70 hover:text-gray-160`})]})},Wg=()=>{let{videoTitle:e}=Hg();return(0,X.jsx)(ac,{videoId:Rg,title:e,theme:`light`,children:(0,X.jsxs)(o,{variant:`pure`,className:`flex w-full items-center gap-base`,children:[(0,X.jsx)(`img`,{src:`https://img.youtube.com/vi/${Rg}/maxresdefault.jpg`,alt:e,className:`h-lg w-auto shrink-0 rounded object-cover`}),(0,X.jsx)(`span`,{className:`text-left text-md`,children:(0,X.jsx)(`span`,{className:`text-gray-70`,children:w._(`Watch a quick guide on how to maximize your SEO and AI visibility in no time.`,null,{hk:`2SybPS`,project:`onboarding`})})})]})})},Gg=()=>{let{send:e}=F(),{onboardingTasks:n,totalChecked:r,totalTasks:i,percentDone:a}=Wa(),s=xf(),{dismissed:c}=Hg(),l=Object.keys(n).find(e=>!n[e]);if(!l)return null;let u=s[l],d=u.cta??T._(`Start`,null,{hk:`4jedJC`,project:`onboarding`}),f=()=>{var t;(t=u.onClick)==null||t.call(u),e(bf,{taskId:l,source:`dashboard`})},p=(0,X.jsxs)(`span`,{className:`flex items-center gap-xs text-left`,children:[(0,X.jsx)(`span`,{className:`text-base font-semibold leading-tight text-gray-160`,children:u.label}),(0,X.jsx)(t,{Component:wi,size:`xsmall`}),u.timeMinutes!=null&&(0,X.jsxs)(`span`,{className:`flex shrink-0 items-center gap-3xs text-sm text-gray-70`,children:[(0,X.jsx)(t,{Component:rr,size:`xsmall`}),w._({"*":`{minutes}m`},[w._param(`minutes`,u.timeMinutes,[0,u.timeMinutes])],{hk:`4xT32f`,project:`onboarding`})]})]}),m=(0,X.jsxs)(`div`,{className:`flex flex-col gap-base rounded-2xl border border-gray-10 bg-white-base px-lg py-base sm:flex-row sm:items-center sm:justify-between`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-base`,children:[(0,X.jsx)(Ul,{percent:a}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`div`,{className:`flex items-center gap-xs text-xs`,children:(0,X.jsx)(`span`,{className:`font-semibold uppercase`,children:Lg(r,i)})}),(0,X.jsx)(`div`,{className:`mt-3xs`,children:u.link?(0,X.jsx)(L,{variant:`pure`,to:u.link,onClick:f,target:u.link.startsWith(`http`)?`_blank`:void 0,className:`hover:opacity-80`,children:p}):(0,X.jsx)(o,{variant:`pure`,onClick:f,className:`hover:opacity-80`,children:p})})]})]}),u.link?(0,X.jsx)(L,{to:u.link,size:`small`,onClick:f,target:u.link.startsWith(`http`)?`_blank`:void 0,icon:wi,rightIcon:!0,className:`w-full shrink-0 sm:w-auto`,children:d}):(0,X.jsx)(o,{size:`small`,onClick:f,icon:wi,rightIcon:!0,className:`w-full shrink-0 sm:w-auto`,children:d})]});return(0,X.jsxs)(`div`,{className:`flex flex-col gap-base`,children:[(0,X.jsx)(Fg,{title:T._(`Get started`,null,{hk:`1QOf8D`,project:`onboarding`}),icon:Ig}),(0,X.jsx)(Ug,{}),c?(0,X.jsxs)(X.Fragment,{children:[m,(0,X.jsx)(`div`,{className:`p-sm`,children:(0,X.jsx)(Wg,{})})]}):m]})},Kg=5,qg=()=>{let{items:e,loading:t}=oc({types:[rt.ContentEditor],sort:cn.ContentUpdatedAt},{canRefreshList:!0}),n=(0,Y.useMemo)(()=>(e==null?void 0:e.slice(0,Kg))??[],[e]);return{items:n,dashboardRecentItemsToDisplay:n.filter(e=>{var t;return!(!((t=e.draft)==null||(t=t.meta)==null)&&t.isExample)}).filter(e=>e.draft&&uc(e.draft)).slice(0,4),loading:t}},Jg=()=>{var e,t;let n=S(),r=x(),i=(e=n.state)==null?void 0:e.workspaceDeleted,a=(t=n.state)==null?void 0:t.deletedWorkspaceName;return i?(0,X.jsx)(hr,{color:`info`,title:T._(`Workspace deleted`,null,{hk:`4u5Xl9`,project:`dashboard`}),closeIcon:!0,onClose:()=>r(n.pathname,{replace:!0,state:{}}),description:(0,X.jsx)(`span`,{children:w._(`The workspace {name} has been deleted.`,[w._param(`name`,(0,X.jsx)(`span`,{className:`font-medium`,children:a}))],{hk:`2XVRK4`,project:`dashboard`})})}):null},Yg=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M17 9L11.5657 14.4343C11.3677 14.6323 11.2687 14.7313 11.1545 14.7684C11.0541 14.8011 10.9459 14.8011 10.8455 14.7684C10.7313 14.7313 10.6323 14.6323 10.4343 14.4343L8.56569 12.5657C8.36768 12.3677 8.26867 12.2687 8.15451 12.2316C8.05409 12.1989 7.94591 12.1989 7.84549 12.2316C7.73133 12.2687 7.63232 12.3677 7.43431 12.5657L3 17M17 9H13M17 9V13M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),Xg=T._(`Clicks`,null,{hk:`1rkM16`,project:`dashboard`}),Zg=T._(`AI Visibility`,null,{hk:`WI9iq`,project:`dashboard`});E();var Qg=({value:e})=>{let t=Math.round(e);return t===0?null:(0,X.jsx)(`div`,{className:D(`flex items-center rounded px-2xs`,e>0?`bg-green-5`:`bg-red-5`),children:(0,X.jsxs)(`span`,{className:D(`inline-flex items-center gap-2xs text-md font-semibold`,e>0?`text-green-base`:`text-red-base`),children:[e>0?`+`:``,t,`%`]})})},$g=`text-gray-100 bg-gray-10 absolute right-sm top-sm flex items-center justify-center rounded-full`,e_=({to:e})=>{let n=`${$g} p-xs rounded-full transition-colors`,r=(0,X.jsx)(t,{Component:Sa,size:`small`});return e?(0,X.jsx)(L,{variant:`secondary`,to:e,className:`${n} hover:bg-gray-20`,children:r}):(0,X.jsx)(`div`,{className:`${n} group-hover:bg-gray-20`,children:r})},t_=({label:e,tooltip:n})=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2xs text-sm font-medium text-gray-60`,children:[e,n&&(0,X.jsx)(b,{content:n,children:(0,X.jsx)(t,{Component:os,size:`small`})})]}),n_=`radial-gradient(circle 150px at var(--x, -999px) var(--y, -999px), #000 0%, #000 40%, transparent 80%)`,r_=()=>{let e=Y.useRef(null);return(0,X.jsxs)(`div`,{ref:e,onPointerMove:t=>{let n=e.current;if(!n)return;let r=n.getBoundingClientRect();n.style.setProperty(`--x`,`${t.clientX-r.left}px`),n.style.setProperty(`--y`,`${t.clientY-r.top}px`)},className:`group/spotlight relative w-full [&_path]:[stroke-width:2px]`,children:[(0,X.jsx)(`div`,{className:`opacity-80`,children:(0,X.jsx)(Na,{})}),(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-0 opacity-0 transition-opacity group-hover/spotlight:opacity-100 [&_path:first-of-type]:stroke-purple-base`,style:{WebkitMaskImage:n_,maskImage:n_},children:(0,X.jsx)(Na,{})})]})},i_=e=>Da(e,{maximumFractionDigits:1,notation:`compact`,compactDisplay:`short`}),a_=()=>(0,X.jsx)(`div`,{className:`flex flex-1 items-end`,children:(0,X.jsx)(Na,{loading:!0,withAxis:!0})}),o_=({label:e,children:t})=>(0,X.jsxs)(`div`,{className:`flex min-h-[188px] flex-col`,children:[(0,X.jsxs)(`div`,{className:`mb-auto flex flex-col gap-3xs px-sm pt-sm`,children:[(0,X.jsx)(`div`,{className:`text-sm font-medium text-gray-60`,children:e}),(0,X.jsx)(`div`,{className:`flex items-center gap-2xs text-lg`,children:(0,X.jsx)(`div`,{className:`h-[20px] w-[80px] animate-pulse rounded bg-gray-10`})})]}),t]}),s_=({label:e,tooltip:t,message:n,link:i})=>(0,X.jsxs)(`div`,{className:`relative flex size-full min-h-[188px] flex-col`,children:[(0,X.jsx)(e_,{to:i}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs px-sm pt-sm`,children:[(0,X.jsx)(t_,{label:e,tooltip:t}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2xs`,children:[(0,X.jsx)(`div`,{className:`h-[20px] w-[80px] animate-pulse rounded bg-gray-10`}),(0,X.jsx)(`div`,{className:`h-[20px] w-[56px] animate-pulse rounded bg-gray-10`})]})]}),(0,X.jsx)(`div`,{className:`mt-auto flex w-full items-end overflow-hidden`,children:(0,X.jsx)(r_,{})}),(0,X.jsxs)(`div`,{className:`flex items-center gap-xs px-sm pb-sm pt-xs text-md font-semibold text-gray-80`,children:[(0,X.jsx)(r,{size:`small`,className:`text-purple-base`}),n]})]}),c_=({link:e,loader:t,tooltip:n,label:r,currentValue:i,trendPercentage:a,previousValue:o,children:s,onClick:c})=>{let l=Math.round(a??0),u=a!==void 0;return(0,X.jsxs)(z,{variant:`pure`,to:e,onClick:c,className:`group relative flex size-full min-h-[188px] flex-col items-stretch`,children:[(0,X.jsx)(e_,{}),(0,X.jsxs)(`div`,{className:`flex flex-col px-sm pt-sm`,children:[(0,X.jsx)(t_,{label:r,tooltip:n}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2xs`,children:[(0,X.jsx)(`div`,{className:`text-lg font-semibold`,children:t??i_(i)}),u&&(l===0?(0,X.jsx)(`div`,{className:`text-md text-gray-60`,children:w._(`same as previous 30d`,null,{hk:`2HxjAj`,project:`dashboard`})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Qg,{value:a}),!!o&&(0,X.jsx)(`div`,{className:`text-md text-gray-60`,children:w._(`{value} last 30d`,[w._param(`value`,i_(o))],{hk:`2PlBw6`,project:`dashboard`})})]}))]})]}),(0,X.jsx)(`div`,{className:`mt-auto flex w-full items-end overflow-hidden`,children:s})]})},l_=({label:e,buttonText:n,buttonIcon:i,buttonIconClassName:a,onButtonClick:s,link:c,loading:l=!1,footer:u})=>(0,X.jsxs)(`div`,{className:`relative flex h-full min-h-[188px] flex-col`,children:[(0,X.jsx)(e_,{to:c}),(0,X.jsx)(`div`,{className:`mb-auto flex flex-col gap-3xs px-sm pt-sm`,children:(0,X.jsx)(t_,{label:e})}),(0,X.jsx)(`div`,{className:u?`mb-sm`:`mb-base`,children:(0,X.jsx)(r_,{})}),u,(0,X.jsxs)(o,{className:`absolute left-1/2 top-1/2 w-fit -translate-x-1/2 -translate-y-1/2 whitespace-nowrap bg-white-base px-base text-black transition duration-200 before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-lg before:shadow-md before:transition-shadow before:content-[''] hover:scale-105 hover:bg-white-base hover:before:shadow-[0_0_#0000]`,variant:`outline`,onClick:s,children:[l?(0,X.jsx)(r,{size:`base`,className:a}):i&&(0,X.jsx)(t,{Component:i,size:`base`,className:a}),n]})]}),u_={line:`var(--gray-60)`,gradient:`var(--gray-10)`,gradientTopOpacity:1},d_=P({category:`dashboard`,name:`clicks_chart_gsc_connect_clicked`}),f_=P({category:`dashboard`,name:`clicks_chart_clicked`,payloadSchema:U({siteId:V()})}),p_=P({category:`dashboard`,name:`clicks_chart_reconnect_gsc_clicked`}),m_=()=>{var e;let{send:t}=F(),{currentWorkspace:n}=q(),r=Yn(),i=N(),a=n==null||(e=n.brandedWorkspaceSitesProject)==null?void 0:e.id;return a?(0,X.jsx)(h_,{siteId:a}):(0,X.jsx)(l_,{label:Xg,buttonText:T._(`Connect Search Console`,null,{hk:`W1QJ6`,project:`dashboard`}),buttonIcon:qs,link:i(`/sites`),onButtonClick:()=>{r(`/sites`),t(d_)}})},h_=({siteId:e})=>{let{shouldReconnectGscCredentials:t,site:n}=As();return t&&n?(0,X.jsx)(g_,{site:n}):(0,X.jsx)(__,{siteId:e})},g_=({site:e})=>{let{send:t}=F();return(0,X.jsx)(Za,{children:(0,X.jsxs)(`div`,{className:`relative flex h-full min-h-[188px] flex-col`,children:[(0,X.jsx)(`div`,{className:`mb-auto flex flex-col gap-3xs px-sm pt-sm`,children:(0,X.jsx)(`div`,{className:`text-sm font-medium text-gray-60`,children:Xg})}),(0,X.jsx)(`div`,{className:`mb-base opacity-80`,children:(0,X.jsx)(Na,{})}),(0,X.jsx)(`div`,{onClick:()=>t(p_),className:`absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`,children:(0,X.jsx)(dc,{site:e})})]})})},__=({siteId:e})=>{let{loading:t}=As(),{send:n}=F(),{loading:r,simplifiedChartData:i}=Pa(e),a=N(),o=(i==null?void 0:i.dailyData)||[],s=i==null?void 0:i.clicks,c=(s==null?void 0:s.value)??0,l=(s==null?void 0:s.previousValue)??0,u=l>0;return r||t?(0,X.jsx)(v_,{}):o.length?(0,X.jsx)(c_,{link:a(`/sites/${e}`),onClick:()=>{n(f_,{siteId:e})},label:Xg,currentValue:c,trendPercentage:u?s==null?void 0:s.trendedValueDiff:void 0,previousValue:u?l:void 0,children:(0,X.jsx)(ja,{data:o,isLoading:!1,visibleMetrics:[`clicks`],showDateLabels:!0,height:130,clicksColor:u_})}):null},v_=()=>(0,X.jsx)(o_,{label:Xg,children:(0,X.jsx)(a_,{})}),y_=30,b_=Z.default.utc(),x_=e=>{let t=(0,Y.useMemo)(()=>b_.subtract(y_,`days`).toDate(),[]),n=(0,Y.useMemo)(()=>b_.toDate(),[]),[r,i]=(0,Y.useState)(!1),{data:a,loading:o}=Bt({variables:{projectId:e,from:t,to:n},skip:!e,pollInterval:r?vo:0}),{data:s,loading:c}=et({variables:{projectId:e,from:t,to:n},skip:!e,pollInterval:r?vo:0}),l=(0,Y.useMemo)(()=>
80a==null?void 0:a.aiTracker.project.projectSummaries,[a]),u=(0,Y.useMemo)(()=>gc(l==null?void 0:l.latestReportRunStatus),[l==null?void 0:l.latestReportRunStatus]),d=s==null?void 0:s.aiTracker.project.timeSeries,f=(0,Y.useMemo)(()=>{if(!d)return;let e=new Map(d.filter(e=>e.modelFamily===Ie.All).map(e=>[Ta((0,Z.default)(e.date),`dateIso`),e.presenceScore]));return pc(hc(t,n).map(t=>e.get(Ta(t,`dateIso`))??0))},[d,t,n]),p=(0,Y.useMemo)(()=>{var e;if(l)return(e=l.modelSummaries.find(e=>e.modelFamily===Ie.All))==null?void 0:e.presenceScore},[l]);return(0,Y.useEffect)(()=>{i(u)},[u]),{reportRunInProgress:u,chartData:f,currentPresenceScore:p,from:t,to:n,loading:o||c}};B` 81 query AiTrackerProjectVisibilitySummaries( 82 $projectId: ID 83 $from: Date! 84 $to: Date! 85 ) { 86 aiTracker { 87 id 88 project(id: $projectId) { 89 id 90 projectSummaries(from: $from, to: $to) { 91 latestReportRunStatus 92 modelSummaries { 93 modelFamily 94 presenceScore 95 } 96 } 97 } 98 } 99 } 100`;var S_=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M12 8V16M8 12H16M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),C_=130,w_=T._(`Visibility Score`,null,{hk:`102yab`,project:`dashboard`}),T_=T._(`How frequently your brand shows up in responses generated by AI models`,null,{hk:`2vL08g`,project:`dashboard`}),E_=P({category:`dashboard`,name:`visibility_chart_clicked`,payloadSchema:U({aiTrackerProjectId:V()})}),D_=P({category:`dashboard`,name:`visibility_chart_add_prompts_clicked`}),O_=()=>{var e;let{send:t}=F(),{currentWorkspace:n}=q(),r=N(),i=Yn(),a=(n==null||(e=n.brandedWorkspaceAiTrackerProject)==null?void 0:e.id)??``,{chartData:o,currentPresenceScore:s,from:c,to:l,loading:u,reportRunInProgress:d}=x_(a),{isGenerating:f,hasResponded:p,hasFinished:m}=Rs({enabled:!a}),h=f||!p,g=()=>{i(`/ai_tracker/configure`,{state:{disabledSteps:[Bs.BRAND_NAME,Bs.LOCALE],step:Bs.PROMPTS}}),t(D_)},_=(0,Y.useMemo)(()=>{let e=o==null?void 0:o.data;return!e||e.length<2?!1:e.some(e=>e.y!==null&&e.y>0)&&e[e.length-1].y===0},[o]);return a?u?(0,X.jsx)(k_,{}):d?(0,X.jsx)(s_,{label:w_,tooltip:T_,link:r(`/ai_tracker/${a}`),message:w._(`Crunching your visibility dataâ¦`,null,{hk:`O1fI4`,project:`dashboard`})}):(0,X.jsx)(c_,{link:r(`/ai_tracker/${a}`),onClick:()=>{t(E_,{aiTrackerProjectId:a})},label:w_,tooltip:T_,currentValue:s??0,children:(0,X.jsx)(fc,{color:`gray-60`,gradientColor:`gray-10`,data:o??{id:``,data:[]},loading:u,height:C_,xAxisLabels:[Ta((0,Z.default)(c),`monthDay`),Ta((0,Z.default)(l),`monthDay`)],lastDayPending:_})}):(0,X.jsx)(l_,{label:Zg,buttonText:f?T._(`Check status`,null,{hk:`k4NWC`,project:`dashboard`}):T._(`Add prompts`,null,{hk:`3xXDXg`,project:`dashboard`}),buttonIcon:S_,buttonIconClassName:`text-orange-70`,link:r(`/ai_tracker`),loading:h,onButtonClick:g,footer:(f||m)&&(0,X.jsx)(A_,{isGenerating:f,onSetup:g})})},k_=()=>(0,X.jsx)(o_,{label:Zg,children:(0,X.jsx)(a_,{})}),A_=({isGenerating:e,onSetup:n})=>(0,X.jsxs)(`div`,{className:`-mx-base -mb-base flex items-center gap-xs rounded-b-xl bg-purple-5 px-base py-sm text-sm font-semibold text-purple-70`,children:[(0,X.jsx)(t,{Component:os,size:`small`,className:`shrink-0`}),(0,X.jsx)(`span`,{className:`grow truncate`,children:e?w._(`Finding prompts for your brand`,null,{hk:`1GcAIl`,project:`dashboard`}):w._(`AI Visibility needs setup to track mentions`,null,{hk:`3OUutR`,project:`dashboard`})}),!e&&(0,X.jsx)(o,{size:`xsmall`,className:`shrink-0 whitespace-nowrap bg-primary text-white-base hover:bg-purple-80`,onClick:n,children:w._(`Set up`,null,{hk:`sbldE`,project:`dashboard`})})]}),j_=()=>{let{isBrandedWorkspace:e}=q();return e?(0,X.jsxs)(`div`,{className:`flex flex-col gap-base`,children:[(0,X.jsx)(Fg,{title:T._(`Brand performance`,null,{hk:`20fx8t`,project:`dashboard`}),icon:Yg}),(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-base md:flex-row`,children:[(0,X.jsx)(M_,{children:(0,X.jsx)(m_,{})}),(0,X.jsx)(M_,{children:(0,X.jsx)(O_,{})})]})]}):null},M_=({children:e})=>(0,X.jsx)(`div`,{className:`min-w-0 flex-1 rounded-xl border border-gray-20 bg-white-base p-base`,children:e}),N_=(e,t)=>{if(!t)return null;let n=e.findIndex(e=>e.brandName===t);return n===-1?null:n+1},P_=Z.default.utc(),F_=(e,t=0)=>{var n,r;let{currentWorkspace:i}=q(),a=(i==null||(n=i.brandedWorkspaceAiTrackerProject)==null?void 0:n.brandName)??null,{data:o,loading:s}=pn({variables:{projectId:e,from:(0,Y.useMemo)(()=>P_.subtract(30,`days`).startOf(`day`).toDate(),[]),to:(0,Y.useMemo)(()=>P_.endOf(`day`).toDate(),[])},skip:!e,pollInterval:t}),{data:c,loading:l}=In({variables:{projectId:e},skip:!e,pollInterval:t}),u=(0,Y.useMemo)(()=>{var e;return bc(c==null||(e=c.aiTracker.project)==null||(e=e.canonicalization)==null?void 0:e.brandInfoMap)},[c==null||(r=c.aiTracker.project)==null||(r=r.canonicalization)==null?void 0:r.brandInfoMap]),d=(0,Y.useMemo)(()=>Di(ki(o==null?void 0:o.aiTracker.project.brandSummaries,Ie.All,u)),[o==null?void 0:o.aiTracker.project.brandSummaries,u]),f=(0,Y.useMemo)(()=>N_(d,a),[d,a]);return{topCompetitors:(0,Y.useMemo)(()=>Oi(d,f),[d,f]),brandRank:f,loading:s||l}},I_={increase:`increase`,decrease:`decrease`},L_=()=>{let e=N(),{hasAccess:t,retentionCutoffDate:n}=Tc(),{workspace:r,loading:i}=ps(),a=(0,Y.useMemo)(()=>Oc(n),[n]),o=a.to.diff(a.from,`day`)+1,{heatmapData:s,loading:c}=wc({userIds:[],eventTypes:[]}),l=(0,Y.useMemo)(()=>{let{dataMap:e,maxCount:t}=jc(s.filter(e=>e.date.isBetween(a.from,a.to,`day`,`[]`)));return Ec(e,t)},[s,a]);if(!t)return null;if(c||i)return(0,X.jsx)(R_,{className:`w-[420px]`});if(!r)return null;let u=(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-xs align-top font-semibold text-black`,children:[(0,X.jsx)(ls,{workspace:r,logoClassName:`size-[20px]`,fallbackClassName:`size-base`}),Ho(r)]});return(0,X.jsxs)(`span`,{children:[l.activeDays>0?((t,n,r,i)=>w._({"*":{"*":{"*":{"*":`In {workspace} there were {=m6} across {=m10} in the last {windowDays} days`,_1:`In {workspace} there were {=m6} across {=m10} in the last 1 day`},_1:{"*":`In {workspace} there were {=m6} across {=m10} in the last {windowDays} days`,_1:`In {workspace} there were {=m6} across {=m10} in the last 1 day`}}},_1:{_1:{"*":{"*":`In {workspace} there was {=m6} across {=m10} in the last {windowDays} days`,_1:`In {workspace} there was {=m6} across {=m10} in the last 1 day`},_1:{"*":`In {workspace} there was {=m6} across {=m10} in the last {windowDays} days`,_1:`In {workspace} there was {=m6} across {=m10} in the last 1 day`}}}},[t,n,r,i,w._param(`workspace`,u),w._implicitParam(`=m6`,(0,X.jsx)(z,{icon:Sa,className:`no-underline text-inherit hover:opacity-80 hover:text-inherit`,to:e(`/activity_log`),children:w._({"*":{"*":{"*":{"*":`{=m1}`,_1:`{=m1}`},_1:{"*":`{=m1}`,_1:`{=m1}`}}},_1:{_1:{"*":{"*":`{=m1}`,_1:`{=m1}`},_1:{"*":`{=m1}`,_1:`{=m1}`}}}},[t,n,r,i,w._implicitParam(`=m1`,(0,X.jsx)(`span`,{className:`font-semibold text-black`,children:w._({"*":{"*":{"*":{"*":`{activitiesCount} activities`,_1:`{activitiesCount} activities`},_1:{"*":`{activitiesCount} activities`,_1:`{activitiesCount} activities`}}},_1:{_1:{"*":{"*":`1 activity`,_1:`1 activity`},_1:{"*":`1 activity`,_1:`1 activity`}}}},[t,n,r,i],{hk:`1I6MJl`,project:`dashboard`})}))],{hk:`2egjCS`,project:`dashboard`})})),w._implicitParam(`=m10`,(0,X.jsx)(`span`,{className:`font-semibold text-black`,children:w._({"*":{"*":{"*":{"*":`{activeDaysCount} active days`,_1:`{activeDaysCount} active days`},_1:{"*":`1 active day`,_1:`1 active day`}}},_1:{_1:{"*":{"*":`{activeDaysCount} active days`,_1:`{activeDaysCount} active days`},_1:{"*":`1 active day`,_1:`1 active day`}}}},[t,n,r,i],{hk:`14xq0j`,project:`dashboard`})}))],{hk:`2Fk1h7`,project:`dashboard`}))(w._plural(l.totalActivities),w._plural(l.totalActivities,`activitiesCount`),w._plural(l.activeDays,`activeDaysCount`),w._plural(o,`windowDays`)):((t,n,r)=>w._({"*":{"*":{"*":`In {workspace} there were {=m6} in the last {windowDays} days`,_1:`In {workspace} there were {=m6} in the last 1 day`}},_1:{_1:{"*":`In {workspace} there was {=m6} in the last {windowDays} days`,_1:`In {workspace} there was {=m6} in the last 1 day`}}},[t,n,r,w._param(`workspace`,u),w._implicitParam(`=m6`,(0,X.jsx)(z,{icon:Sa,className:`no-underline text-inherit hover:opacity-80 hover:text-inherit`,to:e(`/activity_log`),children:w._({"*":{"*":{"*":`{=m1}`,_1:`{=m1}`}},_1:{_1:{"*":`{=m1}`,_1:`{=m1}`}}},[t,n,r,w._implicitParam(`=m1`,(0,X.jsx)(`span`,{className:`font-semibold text-black`,children:w._({"*":{"*":{"*":`{activitiesCount} activities`,_1:`{activitiesCount} activities`}},_1:{_1:{"*":`1 activity`,_1:`1 activity`}}},[t,n,r],{hk:`1yrt9g`,project:`dashboard`})}))],{hk:`1YVNNU`,project:`dashboard`})}))],{hk:`tXQLJ`,project:`dashboard`}))(w._plural(l.totalActivities),w._plural(l.totalActivities,`activitiesCount`),w._plural(o,`windowDays`)),`.`,` `]})},R_=({className:e})=>(0,X.jsx)(`span`,{className:O(`bg-gray-10 inline-block h-[24px] animate-pulse rounded-full align-middle`,e)}),z_=({rank:e})=>w._({"*":`#{rank}
100`},[w._param(`rank`,e,[0,e])],{hk:`2Hd9qh`,project:`dashboard`}),B_=()=>{var e,t;let{currentWorkspace:n}=q(),{showOnboarding:r}=zl(),i=n==null||(e=n.brandedWorkspaceSitesProject)==null?void 0:e.id,a=(n==null||(t=n.brandedWorkspaceAiTrackerProject)==null?void 0:t.id)??``;return(0,X.jsxs)(`div`,{className:`text-left text-lg text-gray-80 empty:hidden [&_strong]:text-black`,children:[!r&&(0,X.jsx)(L_,{}),i&&(0,X.jsx)(V_,{siteId:i}),a&&(0,X.jsx)(H_,{aiTrackerProjectId:a})]})},V_=({siteId:e})=>{let t=N(),{shouldReconnectGscCredentials:n,loading:r}=As(),{simplifiedChartData:i,loading:a}=Pa(e);if(a||r)return(0,X.jsx)(K_,{className:`w-[420px]`});if(n)return null;let o=(i==null?void 0:i.clicksSummary)??0,s=(i==null?void 0:i.clicks.trendedValueDiff)??0,c=Math.round(Math.abs(s));return(0,X.jsx)(`span`,{children:w._({"*":{increase:`Your site received {clicks}âa {diff}% increase vs last 30 days.`,decrease:`Your site received {clicks}âa {diff}% decrease vs last 30 days.`}},[w._param(`diff`,c,[0,c]),w._enum(s>=0?`increase`:`decrease`,I_),w._param(`clicks`,(0,X.jsx)(`strong`,{children:(0,X.jsx)(z,{icon:Sa,className:`no-underline text-inherit hover:opacity-80 hover:text-inherit`,to:t(`/sites/${e}`),children:w._({"*":{"*":`{count} clicks`,_1:`{count} click`}},[w._param(`count`,Da(o,{maximumFractionDigits:1,notation:`compact`,compactDisplay:`short`}),[0,o]),w._plural(o)],{hk:`1c4STW`,project:`dashboard`})})}))],{hk:`4oQ6Cf`,project:`dashboard`})})},H_=({aiTrackerProjectId:e})=>{let{currentPresenceScore:t,loading:n,reportRunInProgress:r}=x_(e),{brandRank:i,topCompetitors:a,loading:o}=F_(e,r?vo:0);return r?null:n||o?(0,X.jsxs)(`span`,{children:[` `,(0,X.jsx)(K_,{className:`w-[480px]`})]}):t==null?null:i===1?(0,X.jsxs)(`span`,{children:[` `,w._(`Your {visibility} is {score}. Congratulations, you rank {rank}! {competitors}.`,[w._param(`visibility`,(0,X.jsx)(q_,{})),w._param(`score`,(0,X.jsx)(G_,{children:t})),w._param(`rank`,(0,X.jsx)(`strong`,{children:(0,X.jsx)(z_,{rank:i})})),w._param(`competitors`,(0,X.jsx)(W_,{competitors:a}))],{hk:`1GrRmJ`,project:`dashboard`})]}):a.length===0?(0,X.jsxs)(`span`,{children:[` `,w._(`Your {visibility} is {score}.`,[w._param(`visibility`,(0,X.jsx)(q_,{})),w._param(`score`,(0,X.jsx)(G_,{children:t}))],{hk:`3PqoNV`,project:`dashboard`})]}):(0,X.jsxs)(`span`,{children:[` `,w._(`Your {visibility} is {score}, placing you at {rank} behind {competitors}.`,[w._param(`visibility`,(0,X.jsx)(q_,{})),w._param(`score`,(0,X.jsx)(G_,{children:t})),w._param(`rank`,(0,X.jsx)(`strong`,{children:i==null?``:(0,X.jsx)(z_,{rank:i})})),w._param(`competitors`,(0,X.jsx)(U_,{competitors:a}))],{hk:`4dOAGC`,project:`dashboard`})]})},U_=({competitors:e})=>(0,X.jsx)(X.Fragment,{children:se(e.map(e=>(0,X.jsxs)(`span`,{className:`inline-flex items-baseline gap-2xs font-semibold text-black`,children:[(0,X.jsx)(Cc,{className:`size-[20px] self-center`,url:e.url}),e.brandName,` `,(0,X.jsx)(G_,{children:e.presenceScore})]},e.brandName)),`and`,`comma`)}),W_=({competitors:e})=>(0,X.jsx)(X.Fragment,{children:se(e.map((e,t)=>(0,X.jsx)(`span`,{className:`font-normal`,children:w._(`{competitor} ranks {rank}`,[w._param(`competitor`,(0,X.jsxs)(`span`,{className:`inline-flex items-baseline gap-2xs font-semibold text-black`,children:[(0,X.jsx)(Cc,{className:`size-[20px] self-center`,url:e.url}),e.brandName,(0,X.jsx)(G_,{children:e.presenceScore})]})),w._param(`rank`,(0,X.jsx)(`span`,{className:`font-semibold text-black`,children:(0,X.jsx)(z_,{rank:t+2})}))],{hk:`hNsHw`,project:`dashboard`})},e.brandName)),`and`,`comma`)}),G_=({children:e})=>(0,X.jsx)(`span`,{className:`inline-flex rounded-full bg-gray-10 px-sm font-sans text-lg font-semibold text-black`,children:e}),K_=({className:e})=>(0,X.jsx)(`span`,{className:O(`bg-gray-10 inline-block h-[24px] animate-pulse rounded-full align-middle`,e)}),q_=()=>{var e;let t=N(),{currentWorkspace:n}=q();return(0,X.jsx)(`span`,{className:`font-semibold text-black`,children:(0,X.jsx)(z,{className:`no-underline text-inherit hover:opacity-80 hover:text-inherit`,icon:Sa,to:t(`/ai_tracker/${(n==null||(e=n.brandedWorkspaceAiTrackerProject)==null?void 0:e.id)??``}`),children:Zg})})},J_=()=>{let e=(0,Z.default)().hour(),t=T._(`Good evening`,null,{hk:`ZAdUV`,project:`dashboard`});return e<4?t:e<12?T._(`Good morning`,null,{hk:`1NZirY`,project:`dashboard`}):e<19?T._(`Good afternoon`,null,{hk:`S5O6i`,project:`dashboard`}):t},Y_=()=>{let{user:e}=Pe(),{data:t}=an(),n=t==null?void 0:t.userProfile;return(0,X.jsx)(`div`,{className:`m-0 text-xl font-semibold`,children:n!=null&&n.name?(0,X.jsxs)(`div`,{className:`flex items-center gap-sm`,children:[(0,X.jsx)(`span`,{children:J_()}),(n==null?void 0:n.avatar)&&(0,X.jsx)(es,{src:n==null?void 0:n.avatar,name:(n==null?void 0:n.name)??(e==null?void 0:e.email)??``,size:`small`}),(0,X.jsxs)(`span`,{children:[n==null?void 0:n.name,`!`]})]}):`${J_()}!`})},X_=()=>{let{data:e,loading:t}=zt();return{items:(e==null?void 0:e.marketing.learnings)??[],loading:t}};B` 101 query MarketingLearningSection { 102 marketing { 103 id 104 learnings { 105 id 106 ...MarketingLearningItem 107 } 108 } 109 } 110 111 fragment MarketingLearningItem on MarketingLearningItem { 112 trackingId 113 slot 114 id 115 imageUrl 116 url 117 label 118 title 119 summary 120 } 121`;var Z_=P({category:`marketing`,name:`learning_item_clicked`,payloadSchema:U({trackingId:V(),slot:ma(),url:V(),label:V(),title:V(),summary:V().nullable(),imageUrl:V()})}),Q_=({item:{title:e,label:t,summary:n,url:r,imageUrl:i,trackingId:a,slot:o}})=>{let{send:s}=F();return(0,X.jsxs)(z,{onClick:()=>{s(Z_,{trackingId:a,slot:o,url:r,label:t,title:e,summary:n,imageUrl:i})},href:r,variant:`pure`,target:`_blank`,rel:`noopener noreferrer`,className:`flex flex-col overflow-hidden rounded-2xl border border-solid border-gray-10 no-underline transition-[transform,box-shadow,border-color] duration-200 ease-out will-change-transform hover:translate-y-[-2px] hover:border-gray-20 hover:shadow-md`,children:[(0,X.jsx)(`div`,{className:`aspect-video w-full overflow-hidden bg-gray-10`,children:(0,X.jsx)(`img`,{src:i,alt:e,className:`size-full object-cover`})}),(0,X.jsxs)(`div`,{className:`flex grow flex-col gap-sm p-base`,children:[(0,X.jsx)(`span`,{className:`line-clamp-1 text-sm font-medium text-gray-60`,children:t}),(0,X.jsx)(`span`,{className:`line-clamp-3 text-md font-semibold leading-snug text-black`,children:e}),(0,X.jsx)(`span`,{className:`mt-auto line-clamp-1 text-sm font-medium text-gray-60`,children:n})]})]})},$_=()=>Array.from({length:4},(e,t)=>(0,X.jsx)(R,{className:`aspect-[3/4] w-full rounded-2xl`},t)),ev=()=>{let{items:e,loading:t}=X_();return e.length===0&&!t?null:(0,X.jsxs)(`div`,{className:`flex flex-col gap-base`,children:[(0,X.jsx)(Fg,{title:T._(`Learn`,null,{hk:`1dKhBk`,project:`dashboard`}),icon:Mc}),(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-md sm:grid-cols-2 lg:grid-cols-4`,children:t?(0,X.jsx)($_,{}):e.map(e=>(0,X.jsx)(Q_,{item:e},e.id))})]})},tv=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M21 21H4.6C4.03995 21 3.75992 21 3.54601 20.891C3.35785 20.7951 3.20487 20.6422 3.10899 20.454C3 20.2401 3 19.9601 3 19.4V3M21 7L15.5657 12.4343C15.3677 12.6323 15.2687 12.7313 15.1545 12.7684C15.0541 12.8011 14.9459 12.8011 14.8455 12.7684C14.7313 12.7313 14.6323 12.6323 14.4343 12.4343L12.5657 10.5657C12.3677 10.3677 12.2687 10.2687 12.1545 10.2316C12.0541 10.
1211989 11.9459 10.1989 11.8455 10.2316C11.7313 10.2687 11.6323 10.3677 11.4343 10.5657L7 15M21 7H17M21 7V11`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),nv=({icon:e,label:n,badge:r})=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-start gap-md`,children:[(0,X.jsx)(`div`,{className:`flex items-center justify-center rounded-lg border border-gray-20 bg-white-base p-sm shadow-xs`,children:(0,X.jsx)(t,{Component:e,className:`text-gray-80`})}),(0,X.jsx)(`span`,{className:`text-md font-medium text-black`,children:n})]}),!!r&&r]}),rv=e=>{let{to:t,icon:n,label:r,badge:i,onClick:a}=e;return(0,X.jsx)(z,{onClick:a,to:t,state:e.state,className:`flex items-center rounded-2xl bg-gray-5 px-lg py-base no-underline transition-colors text-inherit hover:bg-gray-10`,children:(0,X.jsx)(nv,{icon:n,label:r,badge:i})})},iv=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M12 5V19M5 12H19`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),av=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M13 2L4.09344 12.6879C3.74463 13.1064 3.57023 13.3157 3.56756 13.4925C3.56524 13.6461 3.63372 13.7923 3.75324 13.8889C3.89073 14 4.16316 14 4.70802 14H12L11 22L19.9065 11.3121C20.2553 10.8936 20.4297 10.6843 20.4324 10.5075C20.4347 10.3539 20.3663 10.2077 20.2467 10.1111C20.1092 10 19.8368 10 19.292 10H12L13 2Z`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),ov=()=>{let{send:e}=F(),{site:t}=As(),{allRecommendations:n,loading:r}=Ns(),i=N(),a=((t==null?void 0:t.writeRecommendationsCount)??0)>0&&(t==null?void 0:t.optimizeRecommendationsCount)===0;return r?null:n===0?(0,X.jsx)(rv,{icon:iv,label:T._(`Add Pages`,null,{hk:`aPH9`,project:`dashboard`}),to:i(`/sites/${t==null?void 0:t.id}/content_audit`),onClick:()=>{e(sv,{cardLabel:`Add Pages`})}}):(0,X.jsx)(rv,{icon:av,label:T._(`View Recommendations`,null,{hk:`14UfdQ`,project:`dashboard`}),onClick:()=>{e(sv,{cardLabel:`View Recommendations`})},to:i(a?`/sites/${t==null?void 0:t.id}/recommendations/content_ideas`:`/sites/${t==null?void 0:t.id}/recommendations`),badge:(0,X.jsx)(Ei,{color:`secondary`,size:`small`,className:`rounded-full bg-brand-orange px-xs`,children:n})})},sv=P({category:`dashboard`,name:`quick_start_card_clicked`,payloadSchema:U({cardLabel:V()})}),cv=()=>{var e;let[t]=I(`ce_wizard`),n=N(),{send:r}=F(),{isBrandedWorkspace:i,currentWorkspace:a}=q(),o=(a==null||(e=a.brandedWorkspaceSitesProject)==null?void 0:e.id)??``;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-base`,children:[(0,X.jsx)(Fg,{title:T._(`Quick start`,null,{hk:`fuVYg`,project:`dashboard`}),icon:Ig}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-base sm:grid-cols-2 lg:auto-cols-fr lg:grid-flow-col [&>*:last-child:nth-child(odd)]:sm:col-span-2 [&>*:last-child:nth-child(odd)]:lg:col-span-1`,children:[(0,X.jsx)(rv,{icon:Ba,label:T._(`Create Content`,null,{hk:`4ry9Pz`,project:`dashboard`}),to:n(t?`/drafts/new`:`/drafts`),state:{createContent:!0},onClick:()=>{r(sv,{cardLabel:`Create Content`})}}),(0,X.jsx)(rv,{icon:tv,label:T._(`Optimize Content`,null,{hk:`iOnU1`,project:`dashboard`}),onClick:()=>{r(sv,{cardLabel:`Optimize Content`})},to:n(i&&o?`/sites/${o}/content_audit`:`/sites`)}),i&&o&&(0,X.jsx)(ov,{})]})]})},lv=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M20 12.5V6.8C20 5.11984 20 4.27976 19.673 3.63803C19.3854 3.07354 18.9265 2.6146 18.362 2.32698C17.7202 2 16.8802 2 15.2 2H8.8C7.11984 2 6.27976 2 5.63803 2.32698C5.07354 2.6146 4.6146 3.07354 4.32698 3.63803C4 4.27976 4 5.11984 4 6.8V17.2C4 18.8802 4 19.7202 4.32698 20.362C4.6146 20.9265 5.07354 21.3854 5.63803 21.673C6.27976 22 7.11984 22 8.8 22H12M14 11H8M10 15H8M16 7H8M14.5 19L16.5 21L21 16.5`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]}));E();var uv=T._(`Untitled`,null,{hk:`2urOp6`,project:`dashboard`}),dv=({item:e,onClick:n})=>{let[r,i]=(0,Y.useState)(!1),a=yr(),o=e.draft,s=N(),c=Wo(e),l=o&&uc(o)?`/drafts/${o.id}`:void 0,u=Pc(o),d=Fc(o),[f,p]=(0,Y.useState)(!1),[m,h]=(0,Y.useState)(!1);if(!o)return null;let g=e.contentUpdatedAt?Z.default.utc(e.contentUpdatedAt).local():null;return(0,X.jsxs)(`div`,{className:D(`group relative flex cursor-pointer flex-col gap-lg rounded-2xl border border-solid border-gray-10 p-base transition-[transform,box-shadow,border-color] duration-200 ease-out will-change-transform hover:translate-y-[-2px] hover:border-gray-20 hover:shadow-md`,r?`translate-y-[-2px] border-gray-20 shadow-md`:``),children:[l&&(0,X.jsx)(z,{to:s(l),onClick:n,className:`absolute inset-0 rounded-2xl`,variant:`pure`}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(t,{className:`text-gray-60`,Component:e.status===Ne.Done?lv:Lc}),u!=null&&(0,X.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2xs`,children:[(0,X.jsx)(`div`,{className:D(`flex items-center`,a?`size-[44px] shrink-0 justify-center`:`w-base`),children:a?(0,X.jsx)(qr,{seoScore:{value:u,competitorsAvg:null,competitorsMax:null},aioScore:d??{status:Fr.Unavailable}}
121):(0,X.jsx)($i,{mode:`compact`,score:{value:u},children:(0,X.jsx)(ea,{noLabel:!0})})}),!a&&(0,X.jsx)(`span`,{className:`text-sm text-gray-80`,children:u})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(`div`,{className:`relative max-w-[14rem]`,children:(0,X.jsx)(b,{content:o.title||uv,visible:f,portalled:!0,children:(0,X.jsx)(z,{to:s(l),onClick:n,variant:`pure`,children:(0,X.jsx)(`span`,{onMouseEnter:e=>p(e.currentTarget.scrollHeight>e.currentTarget.clientHeight),className:D(`line-clamp-2 text-md font-semibold leading-snug`,!o.title&&`text-gray-70`),children:o.title||uv})})})}),(0,X.jsx)(`div`,{className:`relative max-w-[14rem]`,children:(0,X.jsx)(b,{content:c,visible:m,portalled:!0,side:`bottom`,children:(0,X.jsx)(z,{to:s(l),onClick:n,variant:`pure`,children:(0,X.jsx)(`span`,{className:`line-clamp-1 text-sm text-gray-100`,onMouseEnter:e=>h(e.currentTarget.scrollHeight>e.currentTarget.clientHeight),children:c})})})})]}),(0,X.jsxs)(`div`,{className:`mt-auto flex items-center gap-xs`,children:[e.customer&&(0,X.jsx)(sc,{item:e}),g&&(0,X.jsx)(b,{portalled:!0,content:Ta(g,`dateTime`),children:(0,X.jsx)(`span`,{className:`text-sm text-gray-60`,children:g.fromNow()})}),(0,X.jsx)(`div`,{className:`relative ml-auto flex items-center`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(Nc,{item:e,onDropdownOpenChange:i})})]})]})},fv=()=>(0,X.jsxs)(`div`,{className:`relative flex flex-col gap-lg rounded-2xl border border-solid border-gray-10 p-base`,children:[(0,X.jsx)(R,{className:`size-[20px]`}),(0,X.jsx)(R,{className:`h-[38px] w-full`}),(0,X.jsxs)(`div`,{className:`mt-auto flex items-center gap-xs`,children:[(0,X.jsx)(R,{circle:!0,className:`size-lg`}),(0,X.jsx)(R,{className:`h-base w-[80px]`})]})]}),pv=P({category:`dashboard`,name:`recent_content_editor_item_clicked`,payloadSchema:U({contentEditorId:V(),slot:ma()})}),mv=P({category:`dashboard`,name:`recent_content_editor_view_all_clicked`}),hv=()=>{let{send:e}=F(),{loading:t,items:n,dashboardRecentItemsToDisplay:r}=qg(),i=N();return r.length===0&&!t?null:(0,X.jsxs)(`div`,{className:`flex flex-col gap-base`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(Fg,{title:T._(`Recently edited`,null,{hk:`4cKB63`,project:`dashboard`}),icon:Zo}),n.length>4&&!t&&(0,X.jsx)(z,{to:i(`/drafts`),onClick:()=>{e(mv)},variant:`pure`,className:`text-sm font-medium text-gray-80 no-underline transition-colors hover:text-black`,children:w._(`View all`,null,{hk:`1F4LeQ`,project:`dashboard`})})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-md sm:grid-cols-2 lg:grid-cols-4`,children:t?Array.from({length:4},(e,t)=>(0,X.jsx)(fv,{},t)):r.map((t,n)=>(0,X.jsx)(dv,{item:t,onClick:()=>{var r;e(pv,{contentEditorId:((r=t.draft)==null?void 0:r.id)??``,slot:n+1})}},t.id))})]})},gv=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M10.868 2.884c-.321-.772-1.415-.772-1.736 0l-1.83 4.401l-4.753.381c-.833.067-1.171 1.107-.536 1.651l3.62 3.102l-1.106 4.637c-.194.813.691 1.456 1.405 1.02L10 15.591l4.069 2.485c.713.436 1.598-.207 1.404-1.02l-1.106-4.637l3.62-3.102c.635-.544.297-1.584-.536-1.65l-4.752-.382z`,clipRule:`evenodd`})]})),_v=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 14.363 22.2549 16.552 20.9869 18.3448C20.8246 18.5742 20.7435 18.6889 20.6222 18.745C20.5207 18.7919 20.3902 18.803 20.2823 18.7739C20.1533 18.7391 20.0468 18.6326 19.8339 18.4197L19.5011 18.0869C18.887 17.4724 18.4619 17.047 17.9556 16.7368C17.5083 16.4627 17.0205 16.2607 16.5104 16.1382C15.9331 15.9996 15.3317 15.9998 14.463 16L9.53698 16C8.66824 15.9998 8.06691 15.9996 7.48961 16.1382C6.97944 16.2607 6.49172 16.4627 6.04437 16.7369C5.53816 17.0471 5.11307 17.4724 4.49895 18.0869L4.16609 18.4197C3.95317 18.6327 3.8467 18.7391 3.71771 18.7739C3.60978 18.803 3.47928 18.7919 3.37781 18.745C3.25654 18.6889 3.17541 18.5742 3.01315 18.3448C1.74509 16.552 1 14.363 1 12ZM13 3C13 2.44772 12.5523 2 12 2C11.4477 2 11 2.44772 11 3V5.25C11 5.80228 11.4477 6.25 12 6.25C12.5523 6.25 13 5.80228 13 5.25V3ZM3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13H5.25C5.80228 13 6.25 12.5523 6.25 12C6.25 11.4477 5.80228 11 5.25 11
121H3ZM18.75 11C18.1977 11 17.75 11.4477 17.75 12C17.75 12.5523 18.1977 13 18.75 13H21C21.5523 13 22 12.5523 22 12C22 11.4477 21.5523 11 21 11H18.75ZM6.33656 4.99284C5.94604 4.60232 5.31287 4.60232 4.92235 4.99284C4.53182 5.38337 4.53182 6.01653 4.92235 6.40706L6.48515 7.96986C6.87568 8.36039 7.50884 8.36039 7.89937 7.96986C8.28989 7.57934 8.28989 6.94617 7.89937 6.55565L6.33656 4.99284ZM19.0727 6.41205C19.4659 6.02431 19.4704 5.39116 19.0827 4.99787C18.6949 4.60459 18.0618 4.6001 17.6685 4.98785L12.6478 9.93785C12.6052 9.97989 12.5671 10.0248 12.5336 10.072C12.3638 10.0251 12.1848 10 12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14C13.1046 14 14 13.1046 14 12C14 11.8151 13.9749 11.6361 13.928 11.4661C13.9714 11.4353 14.0129 11.4006 14.052 11.3621L19.0727 6.41205Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M18.1674 19.5817L18.4197 19.8339C18.6326 20.0469 18.7391 20.1533 18.7738 20.2823C18.8029 20.3903 18.7918 20.5208 18.7449 20.6222C18.6889 20.7435 18.5742 20.8246 18.3447 20.9869C16.5519 22.2549 14.363 23 12 23C9.63703 23 7.44808 22.2549 5.65527 20.9869C5.42586 20.8246 5.31115 20.7435 5.25509 20.6222C5.20819 20.5208 5.19708 20.3903 5.22617 20.2823C5.26093 20.1533 5.36739 20.0469 5.58032 19.834L5.8326 19.5817C6.55806 18.8562 6.81009 18.6133 7.08936 18.4421C7.35777 18.2777 7.6504 18.1565 7.95651 18.083C8.275 18.0065 8.62499 18.0001 9.65094 18.0001L14.349 18C15.375 18 15.725 18.0065 16.0435 18.0829C16.3496 18.1564 16.6422 18.2776 16.9106 18.4421C17.1899 18.6133 17.442 18.8562 18.1674 19.5817Z`,fill:`currentColor`})]})),vv=({recommendation:e,siteId:n,onClick:r,gscDisplayUrl:i})=>{let a=N(),o=e.type===`optimize`;return(0,X.jsxs)(z,{to:a(o?`/sites/${n}/recommendations/optimize/${e.id}`:`/sites/${n}/recommendations/content_ideas/${e.topicId}/${e.clusterId}`),onClick:r,variant:`pure`,className:`group flex items-center gap-2xs rounded-lg`,children:[(0,X.jsx)(t,{Component:o?_v:Is,size:`small`,className:`mr-2xs shrink-0 text-gray-80 group-hover:text-black`}),(0,X.jsx)(`span`,{className:`shrink-0 text-sm text-gray-80 group-hover:text-black`,children:o?w._(`Optimize`,null,{hk:`3beOPL`,project:`dashboard`}):w._(`Write`,null,{hk:`2RrFkd`,project:`dashboard`})}),o&&i&&(0,X.jsx)(Ao,{url:i,className:`size-base shrink-0`}),(0,X.jsx)(`span`,{className:`min-w-0 truncate text-md font-medium text-gray-80 transition-colors group-hover:text-black`,children:e.title}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2xs`,children:[(0,X.jsx)(t,{Component:gv,size:`xsmall`,className:`text-gray-60 group-hover:text-red-60`}),(0,X.jsx)(`span`,{className:`text-sm text-gray-60 group-hover:text-red-60`,children:Rc(e.recommendationScore,`0.0`)})]})]})},yv=()=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2xs rounded-lg`,children:[(0,X.jsx)(R,{className:`size-base shrink-0`}),(0,X.jsx)(R,{className:`h-[20px] w-[60px] shrink-0`}),(0,X.jsx)(R,{className:`size-base shrink-0`}),(0,X.jsx)(R,{className:`h-[20px] min-w-0 flex-1`}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2xs`,children:[(0,X.jsx)(R,{className:`size-md`}),(0,X.jsx)(R,{className:`h-base w-xl`})]})]}),bv=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M20 6L9 17L4 12`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),xv=[{key:Kt.FetchingGscData,label:T._(`Getting Search Console and site data`,null,{hk:`2YFZuX`,project:`dashboard`})},{key:Kt.ExtractingKeywords,label:T._(`Extracting and expanding keywords`,null,{hk:`3TUnoJ`,project:`dashboard`})},{key:Kt.ClusteringTopics,label:T._(`Clustering and modeling topics`,null,{hk:`2DbGJp`,project:`dashboard`})},{key:Kt.AnalyzingCompetitors,label:T._(`Analyzing competitors and coverage`,null,{hk:`3OwKG2`,project:`dashboard`})},{key:Kt.BuildingMap,label:T._(`Getting and evaluating recommendations`,null,{hk:`34B2HQ`,project:`dashboard`})}],Sv=({creationStep:e})=>{let n=Cv(e);return(0,X.jsx)(`div`,{className:`flex flex-col gap-base`,children:xv.map((e,i)=>{let a=i===n,o=i<n;return(0,X.jsxs)(`div`,{className:`flex items-center gap-xs`,children:[o&&(0,X.jsx)(t,{Component:bv,className:`size-base shrink-0 text-gray-60`}),a&&(0,X.jsx)(r,{size:`small`,className:`shrink-0`}),!a&&!o&&(0,X.jsx)(`div`,{className:`size-base shrink-0`}),(0,X.jsx)(`span`,{className:a?`text-sm font-medium`:`text-sm text-gray-60`,children:e.label})]},e.key)})})};function Cv(e){return e?xv.findIndex(t=>t.key===e):0}var wv=P({category:`dashboard`,name:`recommendations_view_all_clicked`}),Tv=P({category:`dashboard`,name:`recommendations_item_clicked`,payloadSchema:U({type:pa([`write`,`optimize`]),siteId:V(),slot:ma()})}),Ev=5,Dv=()=>{var e;let{currentWorkspace:t}=q();return!(t==null||(e=t.brandedWorkspaceSitesProject)==null)&&e.id?(0,X.jsx)(Ov,{}):null},Ov=()=>{let{send:e}=F(),{recommendations:n,loading:r,stillProcessing:i,allRecommendations:a}=Ns(Ev),{site:o}=As(),{creationStep:s}=Ms(),c=N(),l=((o==null?void 0:o.writeRecommendationsCount)??0)>0&&(o==null?void 0:o.optimizeRecommendationsCount)===0,u=i,d=r&&!u;return!r&&!u&&n.length===0?null:(0,X.jsxs)(`div`,{className:`flex flex-col gap-base`,children:[(0,X.jsx)(Fg,{title:T._(`Recommendations`,null,{hk:`3VDqTx`,project:`dashboard`}),icon:av}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-base rounded-2xl border border-solid border-gray-10 p-lg`,children:[(0,X.jsx)(`div`,{className:`flex flex-col gap-base`,children:u?(0,X.jsx)(Sv,{creationStep:s}):d?Array.from({length:Ev},(e,t)=>(0,X.jsx)(yv,{},t)):n.map((t,n)=>{var r;return(0,X.jsx)(vv,{recommendation:t,siteId:o==null?void 0:o.id,onClick:()=>{e(Tv,{siteId:(o==null?void 0:o.id)??``,slot:n+1,type:t.type===`optimize`?`optimize`:`write`})},gscDisplayUrl:o==null||(r=o.gscSite)==null?void 0:r.displayUrl},t.id)})}),n.length>0&&!r&&(0,X.jsx)(z,{size:`sm`,onClick:()=>{e(wv)},to:c(l?`/sites/${o==null?void 0:o.id}/recommendations/content_ideas`:`/sites/${o==null?void 0:o.id}/recommendations`),className:`font-medium text-gray-80 no-underline hover:text-gray-80 hover:underline`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2xs`,children:[(0,X.jsx)(`span`,{children:w._({"*":`View {number} Recommendations`,_1:`View 1 Recommendation`},[w._plural(a,`number`)],{hk:`1afeTq`,project:`dashboard`})}),(0,X.jsx)(t,{size:`small`,Component:na})]})})]})]})},kv=P({category:`dashboard`,name:`page_viewed`,payloadSchema:U({prompts_added:H(),gsc_connected:H(),onboarding_checklist_visible:H(),has_recent_content_editors:H()})}),Av=()=>{var e,t;let{connected:n}=Xa(),{currentWorkspace:r}=q(),{dashboardRecentItemsToDisplay:i,loading:a}=qg(),{loading:o,showOnboarding:s}=zl(),{send:c}=F(),l=!!((e=ba())!=null&&e.isAiTrackerPlan),{dismissed:u}=Hg(Vg),d=(r==null||(t=r.brandedWorkspaceAiTrackerProject)==null?void 0:t.id)??``,f=(0,Y.useEffectEvent)(()=>{c(kv,{prompts_added:!!d,gsc_connected:n,onboarding_checklist_visible:s,has_recent_content_editors:i.length>0})});return(0,Y.useEffect)(()=>{o||a||f()},[o,a]),o?(0,X.jsx)(C,{}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-3xl`,children:[(0,X.jsx)(Jg,{}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-lg`,children:[(0,X.jsx)(Y_,{}),(0,X.jsx)(B_,{})]}),l&&!u?(0,X.jsx)(Ug,{startSeconds:zg,dismissedLsKey:Vg}):s?(0,X.jsx)(Gg,{}):(0,X.jsx)(cv,{}),(0,X.jsx)(j_,{}),(0,X.jsx)(hv,{}),(0,X.jsx)(Dv,{}),(0,X.jsx)(ev,{})]})},jv=()=>(0,X.jsx)(Za,{children:(0,X.jsxs)(Ys,{className:`py-3xl`,children:[(0,X.jsx)(Gs,{text:T._(`Dashboard`,null,{hk:`cGoxY`,project:`dashboard`})}),(0,X.jsx)(Pg,{}),(0,X.jsx)(Av,{})]})}),Mv=({children:e})=>(0,X.jsx)(Pt,{context:(0,Y.useMemo)(()=>({version:`2024-09-01`}),[]),children:e}),Nv=[{path:`keyword_research`,element:(0,X.jsx)(()=>(0,X.jsx)(Mv,{children:(0,X.jsx)(_s,{tool:`content_planner`,children:(0,X.jsx)(n,{})})}),{}),children:[{index:!0,lazy:{Component:async()=>{let{KeywordResearchPage:e}=await i(async()=>{let{KeywordResearchPage:e}=await import(`./f3711Gcc2.js`);return{KeywordResearchPage:e}},[]);return i(()=>import(`./DxwkWaiA2.js`),[]),e}}},{path:`queries/:id/:clusterId?`,lazy:{Component:async()=>(await i(async()=>{let{ContentPlannerQueryPage:e}=await import(`./DxwkWaiA2.js`);return{ContentPlannerQueryPage:e}},[])).ContentPlannerQueryPage}}]}],Pv=()=>{let{user:e}=ze();return(0,Y.useEffect)(()=>{localStorage.removeItem(`segmentationSurveyModalShown_${e.id}`)},[e.id]),(0,X.jsx)(J,{to:`/dashboard`,replace:!0})},Fv=()=>{let e=rc(),{send:t}=F(),{resetListeners:n,setupCustomerUpdatedAfterCheckoutListener:r}=Bc(),{customer:i}=xa(),{isFreemium:a}=G(),[o]=I(`experiment_trial_opt_in`),s=o&&a&&!i.hadTrial;return{canStartOptInTrial:s,maybeStartTrial:(0,Y.useCallback)(async()=>
121{if(!s)return;n(),e.fetch(`billing:start_no_card_trial`,{});let i=await r(`customer_updated_after_payment_succeeded`),a=at(i.customer.subscriptions.data);i.invoice&&a&&_a({planId:a,invoiceId:i.invoice.id??void 0,customerId:i.customer.id,currency:i.invoice.currency,hasPaymentMethod:!1,send:t})},[e,s,n,t,r])}},Iv=()=>{let{canStartOptInTrial:e}=Fv(),{isFreemium:t}=G(),n=fn();if(n!=null&&n.startsWith(`/join/`))return n;let r=window.sessionStorage.getItem(`redirectAfterOnboarding`)??`/`;return!e&&t&&r===`/`?`/billing/subscription/plans`:r},Lv=({survey:e,onSubmit:t})=>{let{send:n}=F(),{formState:r,control:i,handleSubmit:a,getValues:s}=si({defaultValues:kg(e),mode:`onChange`}),c=(0,Y.useCallback)(async i=>{r.isValid&&(e.forEach(e=>{e.questions.forEach(t=>{let{question_answer:r,question_answer_other:a}=_g(i[t.key]);n(gg,{question_id:e.id,question_answer:r,question_answer_other:a})})}),await t(i))},[r.isValid,t,n,e]);return(0,X.jsx)(`div`,{"data-testid":`survey-page`,className:`flex min-h-full w-full flex-col items-center justify-center py-2xl`,children:(0,X.jsxs)(`div`,{className:`flex w-full max-w-[400px] flex-col gap-lg`,children:[(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-md`,children:[(0,X.jsx)(`h2`,{className:`m-0 text-lg font-semibold`,children:w._(`Tell us about yourself`,null,{hk:`2sv3AD`,project:`onboarding`})}),(0,X.jsx)(`span`,{className:`text-gray-80`,children:w._(`Answer three quick questions, so we can tailor Surfer to your needs.`,null,{hk:`3Ok8c6`,project:`onboarding`})})]}),(0,X.jsxs)(`form`,{onSubmit:a(c),className:`flex w-full flex-col gap-lg`,children:[e.map(e=>e.questions.map(t=>(0,X.jsx)(oi,{name:t.key,control:i,rules:{validate:()=>Og(t,s(t.key))},render:({field:n})=>(0,X.jsx)(jg,{question:t,label:e.title,value:n.value,onChange:n.onChange})},t.key))),(0,X.jsx)(o,{"data-testid":`survey-submit-button`,disabled:!r.isValid||r.isSubmitting,loading:r.isSubmitting,fullWidth:!0,type:`submit`,children:(0,X.jsx)(`span`,{children:w._(`Continue`,null,{hk:`LBFcv`,project:`onboarding`})})})]})]})})},Rv=[{path:`onboarding`,element:(0,X.jsx)(()=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Gs,{text:T._(`Onboarding`,null,{hk:`1WnpdR`,project:`onboarding`})}),(0,X.jsx)(n,{})]}),{}),children:[{index:!0,element:(0,X.jsx)(a,{to:`survey`,replace:!0})},{path:`survey/collect`,element:(0,X.jsx)(Pv,{})},{path:`survey/:stepName?`,element:(0,X.jsx)(()=>{let e=rc(),{surveyComplete:t}=gs(),n=Iv(),[r]=I(`skip_survey`),{maybeStartTrial:i}=Fv(),{send:a}=F(),o=(0,Y.useCallback)(async t=>{if(yg(Tg,t))return;let r=vg(t);await e.fetch(`onboarding:submit_survey`,r),a(hg,{onboarding_survey_customer_segment:r.customer_segment,onboarding_survey_customer_segment_other:r.customer_segment_other,onboarding_survey_current_website:r.current_website,onboarding_survey_seo_team_size:r.seo_team_size,onboarding_survey_customer_role:r.customer_role,onboarding_survey_customer_interests:r.customer_interests,onboarding_survey_interests_other:r.interests_other,onboarding_survey_referral_source:r.referral_source,onboarding_survey_referral_source_other:r.referral_source_other}),await i(),window.location.href=n},[e,i,n,a]);return r===void 0?null:r===!0?(0,X.jsx)(J,{to:n,replace:!0}):t?(0,X.jsx)(J,{to:`/`,replace:!0}):(0,X.jsx)(Lv,{survey:Tg,onSubmit:o})},{})},{path:`*`,element:(0,X.jsx)(a,{to:`survey`,replace:!0})}]}],zv=({children:e})=>{let{pathname:t,search:r,hash:i}=S(),{surveyComplete:a}=gs(),{customer:{hadTrial:o}}=xa(),[s]=I(`skip_survey`),c=`${t}${r}${i}`;return s===!1&&!o&&!a?(window.sessionStorage.setItem(`redirectAfterOnboarding`,c),(0,X.jsx)(J,{to:`/onboarding/survey`,replace:!0})):e?(0,X.jsx)(X.Fragment,{children:e}):(0,X.jsx)(n,{})},Bv=({children:e})=>{let{signOut:t}=Uu(),n=Yn(),{user:r}=ze();return(0,X.jsxs)(`div`,{className:`flex flex-col items-center pt-5xl`,children:[(0,X.jsx)(cs,{}),e,(0,X.jsx)(`div`,{className:`py-md text-gray-140`,children:w._(`You are logged in as {email}`,[w._param(`email`,r.email)],{hk:`58Ncn`,project:`settings`})}),(0,X.jsx)(o,{onClick:t,variant:`secondary`,className:`mb-md`,children:w._(`Sign out`,null,{hk:`43oFFO`,project:`settings`})}),(0,X.jsx)(o,{onClick:()=>n(`/dashboard`,{replace:!0}),variant:`text`,children:w._(`â¹ Go Back to the App`,null,{hk:`2n2dmg`,project:`settings`})})]})},Vv=P({category:`settings`,name:`organization_invitation_link_opened`,payloadSchema:U({invitation_id:V(),organization_id:V(),status:pa(tt)})}
121),Hv=T._(`This invitation link is invalid.`,null,{hk:`1NqCBa`,project:`settings`}),Uv=T._(`This invitation is no longer valid.`,null,{hk:`2ztLlI`,project:`settings`}),Wv={[tt.Pending]:null,[tt.Accepted]:Uv,[tt.Revoked]:Uv,[tt.Expired]:Uv},Gv={[Ln.InvalidToken]:Hv,[Ln.Expired]:Uv,[Ln.Revoked]:Uv,[Ln.MembersLimitReached]:T._(`The organization has reached its member limit.`,null,{hk:`4roCyv`,project:`settings`}),[Ln.OrganizationInactive]:T._(`This organization is not currently accepting new members.`,null,{hk:`3Ou3mn`,project:`settings`}),[Ln.AlreadyAccepted]:Uv,[Ln.EmailMismatch]:T._(`This invitation was sent to a different email address. Sign out and sign in with the invited email to accept it.`,null,{hk:`1uUbfc`,project:`settings`})},Kv=e=>e??T._(`a Surfer organization`,null,{hk:`3nBifB`,project:`settings`}),qv=()=>{let{addToast:e}=gr(),{send:t}=F(),{token:n}=f(),r=x(),i=Yn(),[a,s]=(0,Y.useState)(null),{data:c}=_n({variables:{token:n??``},skip:!n}),[l,{loading:u}]=ar(Oe,e=>e.acceptOrganizationInvitation,{variables:{token:n??``},refetchQueries:[`Organizations`],awaitRefetchQueries:!0}),d=(0,Y.useCallback)(async()=>{var t;s(null);let n=await l();if(n.success){e({type:`success`,title:T._(`Invitation accepted`,null,{hk:`2iubTs`,project:`settings`}),content:T._(`You have been added to the organization`,null,{hk:`361kQ3`,project:`settings`})});let t=n.success.organization.workspaces[0];t?r(`${dr(t.id,t.name)}/dashboard`,{replace:!0}):i(`/dashboard`,{replace:!0})}else (t=n.errors)!=null&&t.custom&&s(n.errors.custom.type)},[l,r,i,e]),p=c==null?void 0:c.emailInvitationByToken,m=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{m.current||!p||(m.current=!0,t(Vv,{invitation_id:p.id,organization_id:p.organization.id,status:p.status}))},[p,t]);let h=p&&Wv[p.status],g=(p==null?void 0:p.acceptBlocker)??a,_=p?h??(g?Gv[g]:null):Hv,v=!_&&(p==null?void 0:p.isViewerMember);return _?(0,X.jsx)(Bv,{children:(0,X.jsx)(`div`,{className:`py-lg text-base`,children:_})}):v?(0,X.jsx)(Jv,{}):(0,X.jsx)(Bv,{children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center py-lg`,children:[(0,X.jsx)(`div`,{className:`text-base`,children:(0,X.jsx)(Yv,{invitation:p})}),(0,X.jsx)(o,{onClick:d,disabled:u,className:`mb-4xl mt-base`,children:w._(`Accept invitation`,null,{hk:`3aiWF4`,project:`settings`})})]})})},Jv=()=>(0,X.jsxs)(Bv,{children:[(0,X.jsx)(`div`,{className:`flex flex-col items-center py-lg`,children:(0,X.jsx)(`div`,{className:`text-base`,children:w._(`You are already a member of this organization`,null,{hk:`2CcFgY`,project:`settings`})})}),(0,X.jsx)(o,{disabled:!0,className:`mb-4xl`,children:w._(`Join`,null,{hk:`2kSJbs`,project:`settings`})})]}),Yv=({invitation:e})=>{if(!e)return null;if(e.workspaces.length>0){let t=us[e.role].toLowerCase();return(n=>w._({"*":`You've been invited to join {=m2} as {=m6} with access to {=m10}`,_1:`You've been invited to join {=m2} as {=m6} with access to {=m10}`},[n,w._implicitParam(`=m2`,(0,X.jsx)(`span`,{className:`font-semibold`,children:w._({"*":`{organizationName}`,_1:`{organizationName}`},[n,w._param(`organizationName`,Kv(e.organization.name))],{hk:`3f2IYM`,project:`settings`})})),w._implicitParam(`=m6`,(0,X.jsx)(`span`,{className:`font-semibold`,children:w._({"*":`{role}`,_1:`{role}`},[n,w._param(`role`,t)],{hk:`2tSflF`,project:`settings`})})),w._implicitParam(`=m10`,(0,X.jsx)(`span`,{className:`font-semibold`,children:w._({"*":`{number} workspaces`,_1:`1 workspace`},[n],{hk:`2hTARO`,project:`settings`})}))],{hk:`2phDgE`,project:`settings`}))(w._plural(e.workspaces.length,`number`))}return w._(`You've been invited to join {=m2} as {=m6}`,[w._implicitParam(`=m2`,(0,X.jsx)(`span`,{className:`font-semibold`,children:w._(`{organizationName}`,[w._param(`organizationName`,Kv(e.organization.name))],{hk:`1rcpxR`,project:`settings`})})),w._implicitParam(`=m6`,(0,X.jsx)(`span`,{className:`font-semibold`,children:w._(`{role}`,[w._param(`role`,us[e.role].toLowerCase())],{hk:`2lRWG5`,project:`settings`})}))],{hk:`2wj8kX`,project:`settings`})};B` 122 query EmailInvitationByToken($token: String!) { 123 emailInvitationByToken(token: $token) { 124 ...EmailInvitation 125 isViewerMember 126 acceptBlocker 127 } 128 } 129 130 mutation AcceptOrganizationInvitation($token: String!) { 131 acceptOrganizationInvitation(token: $token) { 132 success { 133 organization { 134 id 135 workspaces { 136 id 137 name 138 } 139 } 140 } 141 error {
142 type 143 } 144 } 145 } 146`;var Xv=()=>{let{hash:e}=f(),t=x(),{data:n,loading:r}=vt({variables:{inviteHash:e??``},skip:!e}),[i]=ar(yt,e=>e.joinOrganization,{variables:{inviteHash:e??``},refetchQueries:[`Organizations`],awaitRefetchQueries:!0}),a=(0,Y.useCallback)(async()=>{var e,n,r;let a=await i(),o=(e=a.success)==null||(e=e.organization.id)==null?void 0:e.toString(),s=(n=a.success)==null?void 0:n.organization.workspaces[0].id,c=(r=a.success)==null?void 0:r.organization.workspaces[0].name;o&&s&&t(`${dr(s,c)}/dashboard`,{replace:!0})},[i,t]),o=n==null?void 0:n.organizationInvitation;return r?(0,X.jsx)(`div`,{children:w._(`Loading...`,null,{hk:`1fPkgv`,project:`settings`})}):(0,X.jsx)(Bv,{children:(0,X.jsx)(Zv,{invite:o,join:a})})},Zv=({invite:e,join:t})=>{if(!e)return(0,X.jsx)(`div`,{className:`py-lg text-base`,children:w._(`This invitation link is expired or invalid`,null,{hk:`Fgwi6`,project:`settings`})});let{ownerEmail:n,name:r}=e.details;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`flex flex-col items-center py-lg`,children:e.canJoin?(0,X.jsx)(`div`,{className:`text-base`,children:r?w._(`{ownerEmail} invited you to join {organizationName} organization in Surfer`,[w._param(`ownerEmail`,(0,X.jsx)(`span`,{className:`font-semibold`,children:n})),w._param(`organizationName`,(0,X.jsx)(`span`,{className:`font-semibold`,children:r}))],{hk:`1PSB5K`,project:`settings`}):w._(`{ownerEmail} invited you to join their organization in Surfer`,[w._param(`ownerEmail`,(0,X.jsx)(`span`,{className:`font-semibold`,children:n}))],{hk:`4axjVp`,project:`settings`})}):(0,X.jsx)(`div`,{className:`text-base`,children:e.message})}),(0,X.jsx)(o,{onClick:t,disabled:!e.canJoin,className:`mb-4xl`,children:w._(`Join`,null,{hk:`3wFwXw`,project:`settings`})})]})};B` 147 query OrganizationInvitation($inviteHash: String!) { 148 organizationInvitation(inviteHash: $inviteHash) { 149 details { 150 ownerEmail 151 name 152 } 153 canJoin 154 message 155 } 156 } 157 158 mutation JoinOrganization($inviteHash: String!) { 159 joinOrganization(inviteHash: $inviteHash) { 160 success { 161 organization { 162 id 163 workspaces { 164 id 165 name 166 } 167 } 168 } 169 } 170 } 171`;var Qv=()=>{let e=c();return(0,Y.useEffect)(()=>{e&&pe(e,e=>{let t=document.documentElement;return e.setContext(`htmlAttributes`,{htmlLangAttribute:t.getAttribute(`lang`),htmlClassList:t.getAttribute(`class`)}),e})},[e]),(0,X.jsx)(la,{error:e})},$v=()=>{let e=N();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Gs,{text:T._(`Work in progress`,null,{hk:`1iKG7e`,project:`common`})}),(0,X.jsxs)(Ui,{children:[(0,X.jsx)(Hi,{children:(0,X.jsx)(z,{to:`/dashboard`,state:{fromNotFound:!0},children:(0,X.jsx)(cs,{})})}),(0,X.jsx)(Bi,{children:(0,X.jsx)(Ap,{})})]}),(0,X.jsx)(Ys,{children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,X.jsx)(`span`,{className:`mb-base mt-5xl text-3xl font-semibold`,children:w._(`Work in progress...`,null,{hk:`43G1Cq`,project:`common`})}),(0,X.jsx)(`div`,{className:`inline-block text-center text-base font-normal`,children:w._(`The query is still in progress, please visit the page later`,null,{hk:`2vrABy`,project:`common`})}),(0,X.jsx)(`div`,{className:`mt-4xl flex gap-base`,children:(0,X.jsx)(L,{size:`small`,to:e(`/dashboard`),state:{fromNotFound:!0},children:w._(`Go to Homepage`,null,{hk:`jFO38`,project:`common`})})})]})})]})},ey=({message:e,onDismiss:t})=>{let n=Po(),{organizations:r}=Pn(),{defaultOrganizationId:i}=xe(r);return(0,X.jsx)(`div`,{className:`h-screen bg-gray-160 p-sm`,children:(0,X.jsx)(`div`,{className:`flex h-full flex-col rounded-xl bg-white-base p-base pt-0`,children:(0,X.jsx)(jp,{message:e,actionSlot:(0,X.jsx)(L,{size:`small`,onClick:()=>{n(i,`/dashboard`),t==null||t()},children:w._(`Go to your dashboard`,null,{hk:`apM8R`,project:`common`})})})})})},ty=({children:e})=>{let t=jn(),n=M(),r=Ut(),{refetch:i}=(0,Y.use)(yn),[a,o]=(0,Y.useState)(``),[s,c]=(0,Y.useState)(!1);mt({variables:{organizationId:n},onData:e=>{var n;(n=e.data.data)!=null&&n.organizationChanged&&(t.cache.evict({fieldName:`organization`}
171),t.cache.gc())}}),Wn({onData:e=>{var t;let n=(t=e.data.data)==null?void 0:t.organizationAccessChanged;if(n)switch(n.change){case It.Granted:i();break;case It.Revoked:o(T._(`You don't have access to this organization anymore.`,null,{hk:`2uzCKC`,project:`common`})),l(n.organization.id);break;case It.RevokedSubscriptionDeleted:o(T._(`Current organization is not active anymore and you can't access it.`,null,{hk:`Q3wTH`,project:`common`})),l(n.organization.id);break}}});let l=(0,Y.useCallback)(e=>{(r==null?void 0:r.id)!==e&&(t.cache.modify({fields:{organizations:(t=[],{readField:n})=>t.filter(t=>e!==n(`id`,t))}}),c(e===n))},[t.cache,n,r==null?void 0:r.id]);return s?(0,X.jsx)(ey,{message:a,onDismiss:()=>c(!1)}):e};B` 172 subscription OrganizationChanged($organizationId: ID!) { 173 organizationChanged(organizationId: $organizationId) { 174 id 175 } 176 } 177 178 subscription OrganizationAccessChanged { 179 organizationAccessChanged { 180 change 181 organization { 182 id 183 } 184 } 185 } 186`;var ny=(e,t)=>{var n;let r=(n=e.user)==null?void 0:n.userId;return(t.eventTypes.length===0||t.eventTypes.includes(e.eventType))&&(t.userIds.length===0||!!r&&t.userIds.includes(r))},ry=(e,{from:t,to:n})=>e.isBetween(t,n,`day`,`[]`),iy=({children:e})=>{let t=A(),{filters:n}=Dc(),{sort:r}=Ac(),{data:i,updateQuery:a}=dt({variables:{workspaceId:t,first:30,sort:r,filters:(0,Y.useMemo)(()=>({eventTypes:n.eventTypes,userIds:n.userIds,dateInterval:kc(n.dateInterval)}),[n])},fetchPolicy:`cache-only`}),{data:o,updateQuery:s}=Ze({variables:{workspaceId:t,filters:(0,Y.useMemo)(()=>({eventTypes:n.eventTypes,userIds:n.userIds}),[n.eventTypes,n.userIds])},fetchPolicy:`cache-only`});return Be({skip:!t||!i&&!o,variables:{workspaceId:t},onData:({data:e})=>{var t,r;let i=e==null||(t=e.data)==null?void 0:t.activityLogEvents;if(!i||!ny(i,n))return;let o=(r=i.user)==null?void 0:r.userId,c=Z.default.utc(i.occurredAt);ry(c,n.dateInterval)&&a(e=>Oa(e,e=>{var t;!(e==null||(t=e.activityLog)==null)&&t.data&&e.activityLog.data.unshift(i)})),s(e=>Oa(e,e=>{var t;if(!(!(e==null||(t=e.activityLogHeatmap)==null)&&t.data))return;let n=e.activityLogHeatmap.data.find(e=>c.isSame(e.date,`day`));n?(n.eventCount+=1,o&&!n.userIds.includes(o)&&n.userIds.push(o)):e.activityLogHeatmap.data.push({__typename:`ActivityLogDayCount`,date:c.startOf(`day`).toDate(),eventCount:1,userIds:o?[o]:[]})}))}}),e};B` 187 subscription ActivityLogEventUpdates($workspaceId: ID!) { 188 activityLogEvents(workspaceId: $workspaceId) { 189 ...ActivityLogEventFields 190 } 191 } 192`;var ay=(e,t)=>{switch(t.type){case`setModel`:return t.model===e.model?e:{...e,model:t.model};case`setDateRange`:return t.dateRange===e.dateRange?e:{...e,dateRange:t.dateRange};case`setCompetitor`:return t.competitor===e.competitor?e:{...e,competitor:t.competitor};case`setPromptIds`:return t.promptIds===e.promptIds?e:{...e,promptIds:t.promptIds}}},oy=({initialFilters:e,children:t})=>{let[n,r]=(0,Y.useReducer)(ay,e),i=(0,Y.useMemo)(()=>({...n,isComparing:n.competitor!=null}),[n]);return(0,X.jsx)(xc,{value:(0,Y.useMemo)(()=>({setModel:e=>r({type:`setModel`,model:e}),setDateRange:e=>r({type:`setDateRange`,dateRange:e}),setCompetitor:e=>r({type:`setCompetitor`,competitor:e}),setPromptIds:e=>r({type:`setPromptIds`,promptIds:e})}),[]),children:(0,X.jsx)(Sc,{value:i,children:t})})},sy=()=>{let{defaultOption:e,loading:t}=Gc(),{enabledDates:n,intervals:r,loading:i}=Wc(),a=!t&&!i;return(0,Y.useMemo)(()=>a?{model:e??`ALL`,dateRange:mc(r,n)}:void 0,[e,n,r,a])},cy=({fallback:e,children:t})=>{let n=sy();return n?(0,X.jsx)(oy,{initialFilters:n,children:t}):e},ly=({fallback:e,children:t})=>(0,X.jsx)(_o,{children:(0,X.jsx)(Co,{children:(0,X.jsx)(cy,{fallback:e,children:t})})}),uy=()=>{let{openSupportNewMessage:e}=Fo();return(0,X.jsxs)(`div`,{className:`relative h-full overflow-hidden`,children:[(0,X.jsx)(`div`,{className:`pointer-events-none select-none p-lg blur-[2px]`,"aria-hidden":!0,children:(0,X.jsx)(dy,{})}),(0,X.jsx)(`div`,{className:`absolute inset-0 z-10 flex items-center justify-center bg-white-10`,children:(0,X.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-base rounded-xl p-2xl text-center`,children:[(0,X.jsx)(`div`,{className:`text-lg font-semibold text-black`,children:w._(`Something went wrong`,null,{hk:`1CQeT0`,project:`ai-tracker`})}),(0,X.jsx)(`div`,{className:`text-md text-gray-100`,children:w._(`We c
192ouldn't load this project. Please try again or contact our support team for help.`,null,{hk:`NyR08`,project:`ai-tracker`})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-base pt-sm`,children:[(0,X.jsx)(o,{size:`small`,variant:`outline`,onClick:()=>window.location.reload(),children:w._(`Try again`,null,{hk:`XuxCw`,project:`ai-tracker`})}),(0,X.jsx)(o,{size:`xsmall`,variant:`text`,onClick:e,children:w._(`Contact support`,null,{hk:`48w35f`,project:`ai-tracker`})})]})]})})]})},dy=()=>(0,X.jsxs)(`div`,{className:`flex flex-col gap-lg`,children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-3 gap-base`,children:[(0,X.jsx)(fy,{}),(0,X.jsx)(fy,{}),(0,X.jsx)(fy,{})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-base lg:grid-cols-3`,children:[(0,X.jsx)(`div`,{className:`lg:col-span-2`,children:(0,X.jsx)(gy,{})}),(0,X.jsx)(_y,{})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-2xl lg:grid-cols-2`,children:[(0,X.jsx)(vy,{headerLabel:T._(`Prompts`,null,{hk:`4Bjpab`,project:`ai-tracker`}),valueLabel:_c}),(0,X.jsx)(vy,{headerLabel:T._(`Link`,null,{hk:`4ixiFo`,project:`ai-tracker`}),valueLabel:vc})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-2xl lg:grid-cols-2`,children:[(0,X.jsx)(yy,{}),(0,X.jsx)(yy,{})]})]}),fy=()=>(0,X.jsx)(`div`,{className:`flex items-center justify-center rounded-xl border border-gray-10 p-base`,children:(0,X.jsxs)(`div`,{className:`flex size-full flex-col items-center gap-xs`,children:[(0,X.jsx)(R,{className:`h-md w-[100px]`}),(0,X.jsx)(R,{className:`h-xl w-3xl`})]})}),py=({titleWidth:e=`w-[140px]`,subtitleWidth:t=`w-[200px]`})=>(0,X.jsxs)(`div`,{className:`flex flex-col gap-2xs`,children:[(0,X.jsx)(R,{className:`h-md ${e}`}),(0,X.jsx)(R,{className:`h-sm ${t}`})]}),my=()=>(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-sm`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-sm`,children:[(0,X.jsx)(R,{className:`size-[20px]`}),(0,X.jsx)(R,{className:`h-md w-[180px]`})]}),(0,X.jsx)(R,{className:`h-md w-xl`})]}),hy=()=>(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-sm`,children:[(0,X.jsx)(R,{className:`h-md w-[180px]`}),(0,X.jsx)(R,{className:`h-md w-xl`})]}),gy=()=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`flex items-center justify-between gap-base p-lg`,children:(0,X.jsx)(py,{titleWidth:`w-[120px]`,subtitleWidth:`w-[300px]`})}),(0,X.jsx)(`div`,{className:`p-lg`,children:(0,X.jsx)(R,{className:`h-[200px] w-full`})})]}),_y=()=>(0,X.jsxs)(`div`,{className:`rounded-xl border border-gray-10`,children:[(0,X.jsx)(`div`,{className:`flex items-center justify-between gap-base border-b border-gray-10 p-lg`,children:(0,X.jsx)(py,{titleWidth:`w-[100px]`,subtitleWidth:`w-[240px]`})}),(0,X.jsx)(`div`,{className:`p-lg`,children:(0,X.jsxs)(`div`,{className:`flex h-full flex-col justify-between gap-lg`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-base`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-sm text-sm text-gray-20`,children:[(0,X.jsx)(`div`,{children:yc}),(0,X.jsx)(`div`,{children:_c})]}),(0,X.jsx)(`div`,{className:`flex flex-col gap-base`,children:Array.from({length:5}).map((e,t)=>(0,X.jsx)(hy,{},t))})]}),(0,X.jsx)(`div`,{className:`border-t border-gray-10 pt-lg`,children:(0,X.jsx)(R,{className:`h-md w-[152px]`})})]})})]}),vy=({headerLabel:e,valueLabel:t})=>(0,X.jsxs)(`div`,{className:`rounded-xl border border-gray-10`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-base border-b border-gray-10 p-lg`,children:[(0,X.jsx)(py,{}),(0,X.jsx)(R,{className:`h-lg w-[80px] rounded-lg`})]}),(0,X.jsx)(`div`,{className:`p-lg`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-lg`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-sm text-sm text-gray-20`,children:[(0,X.jsx)(`div`,{children:e}),(0,X.jsx)(`div`,{children:t})]}),(0,X.jsx)(`div`,{className:`flex flex-col gap-lg`,children:Array.from({length:5}).map((e,t)=>(0,X.jsx)(my,{},t))})]})})]}),yy=()=>(0,X.jsxs)(`div`,{className:`rounded-xl border border-gray-10`,children:[(0,X.jsx)(`div`,{className:`flex items-center justify-between gap-base border-b border-gray-10 p-lg`,children:(0,X.jsx)(py,{})}),(0,X.jsx)(`div`,{className:`p-lg`,children:(0,X.jsx)(R,{className:`h-[200px] w-full`})})]}),by=({children:e})=>{let{project:t,loading:n}=Ts();Uc();let r=(0,X.jsx)(C,{});return n?r:t?(0,X.jsx)(ly,{fallback:r,children:e},t.id):(0,X.jsx)(uy,{})},xy=()=>{let[e]=ge(),t=e.get(`intent`);return(0,X.jsx)(J,{to:t?`/ai_tracker/configure?intent=${encodeURIComponent(t)}`:`/ai_tracker/configure`,replace:!0})},Sy=({children:e})=>{var t;let{workspace:n,loading:r}=ps(),i=S(),[a]=ge(),o=a.get(`intent`),s=i.state;if(r)return(0,X.jsx)(C,{});let c=n==null||(t=n.brandedWorkspaceAiTrackerProject)==null?void 0:t.id;return c&&!(s!=null&&s.isReactivating)?(0,X.jsx)(J,{to:zs(c,o),replace:!0}):e},Cy=[{path:`ai_tracker`,element:(0,X.jsx)(()=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Gs,{text:`AI Tracker`}),(0,X.jsx)(_s,{tool:`ai_tracker`,children:(0,X.jsx)(n,{})})]}),{}),children:[{index:!0,lazy:{element:async()=>{let{AiTrackerPage:e}=await i(async()=>{let{AiTrackerPage:e}=await import(`./DP6b7T7y2.js`);return{AiTrackerPage:e}},[]);return i(()=>import(`./Bzt2Hu9P2.js`),[]),i(()=>import(`./BYi3r2Ey.js`),__vite__mapDeps([0])),(0,X.jsx)(Sy,{children:(0,X.jsx)(e,{})})}}},{path:`create`,element:(0,X.jsx)(xy,{})},{path:`configure`,lazy:{element:async()=>{let{ConfigureProjectPage:e}=await i(async()=>{let{ConfigureProjectPage:e}=await import(`./DES0Gfdv2.js`);return{ConfigureProjectPage:e}},[]);return(0,X.jsx)(Sy,{children:(0,X.jsx)(e,{})})}}},{path:`:projectId`,lazy:{element:async()=>{let{AiTrackerProjectPage:e}=await i(async()=>{let{AiTrackerProjectPage:e}=await import(`./Bzt2Hu9P2.js`);return{AiTrackerProjectPage:e}},[]);return(0,X.jsx)(Os,{children:(0,X.jsx)(by,{children:(0,X.jsx)(e,{})})})}},children:[{index:!0,lazy:{Component:async()=>(await i(async()=>{let{OverviewPage:e}=await import(`./BYi3r2Ey.js`);return{OverviewPage:e}},__vite__mapDeps([0]))).OverviewPage}},{path:`prompts`,children:[{index:!0,lazy:{Component:async()=>(await i(async()=>{let{PromptsPage:e}=await import(`./BkVoUs9k.js`);return{PromptsPage:e}},__vite__mapDeps([0]))).PromptsPage}},{path:`manage`,lazy:{Component:async()=>(await i(async()=>{let{ManagePromptsPage:e}=await import(`./B0wcjwxO.js`);return{ManagePromptsPage:e}},__vite__mapDeps([0]))).ManagePromptsPage}}]},{path:`competitors`,lazy:{Component:async()=>(await i(async()=>{let{CompetitorsPage:e}=await import(`./BWYlPf7o2.js`);return{CompetitorsPage:e}},__vite__mapDeps([0]))).CompetitorsPage}},{path:`sources`,lazy:{Component:async()=>(await i(async()=>{let{SourcesPage:e}=await import(`./CD5diMdv.js`);return{SourcesPage:e}},__vite__mapDeps([0]))).SourcesPage}},{path:`fanouts`,lazy:{Component:async()=>(await i(async()=>{let{FanoutQueriesPage:e}=await import(`./BeC2BQyc.js`);return{FanoutQueriesPage:e}},__vite__mapDeps([0]))).FanoutQueriesPage}},{path:`debug/canonicals`,lazy:{Component:async()=>(await i(async()=>{let{BrandNamesPage:e}=await import(`./RfmPb8_J2.js`);return{BrandNamesPage:e}},[])).BrandNamesPage}},{path:`debug/sources`,lazy:{Component:async()=>(await i(async()=>{let{SourcesDebugPage:e}=await import(`./DG0ttLWl.js`);return{SourcesDebugPage:e}},[])).SourcesDebugPage}}]}]}],wy=({children:e,aitProjectPermalinkHash:t})=>{let{loading:n,data:r,refetch:i}=Fe({variables:{aitProjectPermalinkHash:t}}),a=(0,Y.useMemo)(()=>Hc(r==null?void 0:r.limits.planLimits,i),[r==null?void 0:r.limits.planLimits,i]);return n?(0,X.jsx)(oe,{id:`plan-limits:shared-ait-project`}):(0,X.jsx)(tr,{value:a,children:e})};B` 193 query AitProjectLimits($aitProjectPermalinkHash: String) { 194 limits { 195 id 196 planLimits(aitProjectPermalinkHash: $aitProjectPermalinkHash) { 197 id 198 ...PlanLimits 199 } 200 } 201 } 202`;var Ty=({children:e})=>{let{project:t,loading:n}=Ts();Uc();let r=(0,X.jsx)(oe,{id:`guard:shared-ai-tracker-project`});return n?r:t?(0,X.jsx)(ly,{fallback:r,children:e},t.id):(0,X.jsx)(`div`,{className:`h-screen px-base`,children:(0,X.jsx)(jp,{inSharedApp:!0})})},Ey=()=>{let{project:e}=Ds(),{send:t}=F();return(0,Y.useEffect)(()=>{t(Kc,{brand:e.brandName,description:e.keyword})},[e.brandName,e.id,e.keyword,t]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`relative grid h-screen grid-cols-[1fr] grid-rows-[auto_1fr_auto] overflow-hidden bg-gray-160 [grid-template-areas:'banner'_'main'_'sidebar'] sm:grid-cols-[auto_auto_1fr] sm:grid-rows-[auto_1fr_auto] sm:[grid-template-areas:'banner_banner_banner'_'sidebar_secondary-sidebar_main']`,children:[(0,X.jsx)(`div`,{className:`h-full shrink-0 flex-col gap-sm py-sm pl-xs [grid-area:secondary-sidebar] sm:flex`,style:{width:200},children:(0,X.jsx)(wo,{})}),(0,X.jsx)(`div`,{className:`relative flex flex-col overflow-hidden px-sm pt-sm [grid-area:main] sm:p-sm`,children:(0,X.jsxs)(`div`,{"data-scroll-element":!0,className:`relative flex-1 overflow-auto rounded-xl bg-white-base px-base`,children:[(0,X.jsx)(qc,{}),(0,X.jsx)(n,{})]})})]}),(0,X.jsx)(To,{})]})},Dy=[{path:`ai_tracker/s/:permalinkHash/*`,element:(0,X.jsx)(()=>{let{permalinkHash:e}=f();return e?(0,X.jsxs)(ua,{queryParams:{version:`2`,app:`shared-ai-tracker`},children:[(0,X.jsx)(Gs,{text:`AI Tracker`}),(0,X.jsx)(n,{})]}):(0,X.jsx)(`div`,{className:`h-screen px-base`,children:(0,X.jsx)(jp,{inSharedApp:!0})})},{}),children:[{element:(0,X.jsx)(()=>{let{permalinkHash:e}=f();return(0,X.jsx)(wy,{aitProjectPermalinkHash:e,children:(0,X.jsx)(Es,{children:(0,X.jsx)(Ty,{
202children:(0,X.jsx)(Ey,{})})})})},{}),children:[{index:!0,lazy:{Component:async()=>(await i(async()=>{let{OverviewPage:e}=await import(`./BYi3r2Ey.js`);return{OverviewPage:e}},__vite__mapDeps([0]))).OverviewPage}},{path:`prompts`,lazy:{Component:async()=>(await i(async()=>{let{PromptsPage:e}=await import(`./BkVoUs9k.js`);return{PromptsPage:e}},__vite__mapDeps([0]))).PromptsPage}},{path:`competitors`,lazy:{Component:async()=>(await i(async()=>{let{CompetitorsPage:e}=await import(`./BWYlPf7o2.js`);return{CompetitorsPage:e}},__vite__mapDeps([0]))).CompetitorsPage}},{path:`sources`,lazy:{Component:async()=>(await i(async()=>{let{SourcesPage:e}=await import(`./CD5diMdv.js`);return{SourcesPage:e}},__vite__mapDeps([0]))).SourcesPage}},{path:`fanouts`,lazy:{Component:async()=>(await i(async()=>{let{FanoutQueriesPage:e}=await import(`./BeC2BQyc.js`);return{FanoutQueriesPage:e}},__vite__mapDeps([0]))).FanoutQueriesPage}}]}]}],Oy=6e4,ky=({children:e})=>{var t,n;let r=A(),{currentWorkspace:i,isBrandedWorkspace:a}=q(),o=!!(!(i==null||(t=i.brandedWorkspaceAiTrackerProject)==null)&&t.id),s=!a||o,{data:c,error:l,refetch:u,startPolling:d,stopPolling:f}=nn({skip:s,fetchPolicy:`cache-and-network`,variables:{workspaceId:r}}),p=c==null||(n=c.aiTracker)==null||(n=n.promptSuggestions)==null?void 0:n.status,m=!!(l!=null&&l.message.includes(`not_found`))||p===je.Completed||p===je.Failed;return(0,Y.useEffect)(()=>{if(!(s||m))return d(Oy),()=>f()},[s,m,d,f]),gt({skip:s,fetchPolicy:`no-cache`,variables:{workspaceId:r},onData:({data:e})=>{var t;!((t=e.data)==null||(t=t.aiTrackerPromptGenerationProgress)==null)&&t.length&&u()},onError:()=>{u()}}),e};B` 203 subscription AiTrackerPromptGenerationProgress($workspaceId: ID!) { 204 aiTrackerPromptGenerationProgress(workspaceId: $workspaceId) { 205 id 206 status 207 } 208 } 209`;function Ay(){let e=A(),t=jn(),[,{updateQuery:n}]=pt({variables:{workspaceId:e},fetchPolicy:`cache-only`});En({variables:{workspaceId:e},onData({data:e}){var r;let i=e==null||(r=e.data)==null?void 0:r.aiTrackerEvents;if(!i)return;let a=i.__typename;if(a===`AiTrackerProjectCreated`){let e=i.project;e&&n(t=>Oa(t,t=>{var n;(n=t.aiTracker)!=null&&n.projects&&t.aiTracker.projects.unshift(e)}));return}if(a===`AiTrackerRecommendationsUpdated`){t.refetchQueries({include:`active`,onQueryUpdated:e=>[`SiteMentionsRecommendations`,`SiteOptimizeRecommendations`,`ContentIdeasRecommendations`].includes(e.queryName??``)});return}if(a===`AiTrackerProjectDeleted`){let e=i.project;e&&n(t=>Oa(t,t=>{var n;if((n=t.aiTracker)!=null&&n.projects){let n=t.aiTracker.projects.findIndex(t=>t.id===e.id);n!==-1&&t.aiTracker.projects.splice(n,1)}}));return}}})}var jy=(0,Y.createContext)(null);jy.displayName=`AiTrackerUpdateContext`;var My=({children:e})=>(0,X.jsx)(jy,{value:Ay(),children:e});B` 210 subscription AiTrackerEvents($workspaceId: ID!) { 211 aiTrackerEvents(workspaceId: $workspaceId) { 212 ... on AiTrackerProjectCreated { 213 project { 214 ...AiTrackerProject 215 } 216 } 217 ... on AiTrackerProjectUpdated { 218 project { 219 ...AiTrackerProject 220 } 221 } 222 ... on AiTrackerProjectDeleted { 223 project { 224 ...AiTrackerProject 225 } 226 } 227 ... on AiTrackerRecommendationsUpdated { 228 project { 229 id 230 } 231 } 232 } 233 } 234`;var Ny=({children:e})=>{var t;let{folderId:n}=f(),{folder:r}=cc(n);return(0,X.jsx)(Yc,{queryWorkspaceId:r==null||(t=r.workspace)==null?void 0:t.id,children:e})},Py=({app:e})=>{let{canUse:t}=Vr();return t(`folders`)?(0,X.jsx)(Ny,{children:(0,X.jsx)(n,{})}):(0,X.jsx)(J,{to:`/${e}`,replace:!0})},Fy=()=>(0,X.jsx)(ei,{app:`audits`,children:(0,X.jsx)(_s,{tool:`audit`,children:(0,X.jsx)(n,{})})}),Iy=async()=>{let{AuditsDashboard:e}=await i(async()=>{let{AuditsDashboard:e}=await import(`./_Ew-Sbjp.js`);return{AuditsDashboard:e}},[]);return i(()=>import(`./BHEmYArG.js`),[]),e},Ly=[{path:`audits`,element:(0,X.jsx)(Fy,{}),children:[{index:!0,lazy:{Component:Iy}},{path:`folder/:folderId`,element:(0,X.jsx)(Py,{app:`audits`}),children:[{index:!0,lazy:{Component:Iy}}]},{path:`:id`,lazy:{Component:async()=>(await i(async()=>{let{AuditPage:e}=await import(`./BHEmYArG.js`);return{AuditPage:e}},[])).AuditPage}}]}],Ry=({children:e,promoColumnSlot:t})=>(0,X.jsxs)(`div`,{"data-onboarding-layout":!0,className:`flex min-h-full grow gap-sm sm:size-full`,children:[(0,X.jsx)(`div`,{className:`flex w-full grow flex-col items-center justify-center gap-xl rounded-lg bg-white-base p-lg sm:p-2xl`,children:e}),t&&t]}),zy=({children:e,withShape:t})=>(0,X.jsxs)(`div`,{className:`relative hidden shrink-0 grow overflow-hidden rounded-lg bg-purple-70 bg-cover xl:flex xl:w-2/5 xl:grow-0`,children:[t&&(0,X.jsx)(`div`,{className:`absolute inset-x-0 top-0 h-[300px] bg-[linear-gradient(112deg,rgb(255_89_227/19%),transparent)] [clip-path:polygon(0_0,100%_0%,_100%_85%,0_40%)]`}),e]}),By=({children:e,withShape:t})=>(0,X.jsx)(zy,{withShape:t,children:(0,X.jsx)(`div`,{className:`flex w-full grow flex-col items-center justify-center gap-3xl py-4xl`,children:e})}),Vy=`/static/surfyEmail.BPkzyj9W.svg`,Hy=P({category:`auth`,name:`account confirmation requested`,payloadSchema:U({email:V()})}),Uy=()=>{let{user:{email:e}}=ze(),{addToast:t}=gr(),{send:n}=F(),[r,i]=(0,Y.useState)(!1),a=(0,Y.useRef)(null),o=(0,Y.useCallback)(()=>{i(!0),a.current=window.setTimeout(()=>i(!1),3e4)},[]);return(0,Y.useEffect)(()=>()=>{a.current&&window.clearTimeout(a.current)},[]),{request:(0,Y.useCallback)(async()=>
234{if(r)return t({type:`warning`,content:T._(`Please, check your email first before requesting another link.`,null,{hk:`3BBLVR`,project:`auth`}),group:`auth-account-confirmation-request`});o(),n(Hy,{email:e});let s=await Qt(e);return s!=null&&s.success?t({type:`success`,content:T._(`Confirmation email sent.`,null,{hk:`4yDpu1`,project:`auth`}),group:`auth-account-confirmation-request`}):(i(!1),a.current&&window.clearTimeout(a.current),t({type:`danger`,content:T._(`Ooops! Something went wrong, try again later.`,null,{hk:`425jN5`,project:`auth`}),group:`auth-account-confirmation-request`}))},[r,o,e,t,n]),requestDisabled:r}},Wy=new Date(`2023-09-14 14:00:00Z`).getTime(),Gy=()=>{let{user:e}=ze(),{verified:t,inserted_at:n,email:r}=e;return/@surferseo.com$/.exec(r)||t||n===void 0||t===void 0?{shouldBlockApplication:!1,shouldConfirmEmail:!1,email:r}:new Date(n).getTime()<Wy?{shouldBlockApplication:!1,shouldConfirmEmail:!0,email:r}:{shouldBlockApplication:!0,shouldConfirmEmail:!0,email:r}},Ky=()=>{let{shouldBlockApplication:e,email:t}=Gy(),{request:n,requestDisabled:r}=Uy(),{signOut:i}=Uu();return e?(0,X.jsxs)(Ry,{promoColumnSlot:(0,X.jsxs)(By,{children:[(0,X.jsx)(`div`,{className:`mt-5xl inline-block text-center text-3xl font-bold tracking-[-2px] text-white-base`,children:w._(`We just sent {=m1} you an email!`,[w._implicitParam(`=m1`,(0,X.jsx)(`br`,{}))],{hk:`gBHDE`,project:`auth`})}),(0,X.jsx)(`div`,{children:(0,X.jsx)(`img`,{src:Vy,alt:``})})]}),children:[(0,X.jsx)(Gs,{text:T._(`Verify your account`,null,{hk:`34OJWT`,project:`auth`}),showSurferSuffix:!1}),(0,X.jsx)(Ys,{children:(0,X.jsxs)(`div`,{className:`flex grow flex-col items-center justify-center gap-lg`,children:[(0,X.jsx)(`div`,{className:`inline-block text-center text-lg font-semibold`,children:w._(`Check your e-mail`,null,{hk:`1LOMzb`,project:`auth`})}),(0,X.jsx)(`div`,{className:`inline-block text-center text-base`,children:w._(`We sent a temporary link to the email address, {=m2}. {=m4} Please check your Spam folder as well.`,[w._implicitParam(`=m2`,(0,X.jsx)(`span`,{className:`font-bold`,children:w._(`{email}`,[w._param(`email`,t)],{hk:`2qIZ7x`,project:`auth`})})),w._implicitParam(`=m4`,(0,X.jsx)(`br`,{}))],{hk:`2BAUHZ`,project:`auth`})}),(0,X.jsxs)(`div`,{className:`flex gap-base`,children:[(0,X.jsx)(o,{disabled:r,type:`submit`,color:`secondary`,onClick:n,children:w._(`Resend email`,null,{hk:`4dwBcI`,project:`auth`})}),(0,X.jsx)(o,{onClick:i,color:`secondary`,variant:`text`,children:w._(`Sign out`,null,{hk:`4nprBl`,project:`auth`})})]})]})})]}):(0,X.jsx)(a,{to:`/dashboard`,replace:!0,state:{fromAuth:!0}})},qy=()=>{let{shouldBlockApplication:e}=Gy(),t=S();return(0,Y.useLayoutEffect)(()=>{!t.pathname.startsWith(`/confirm_account`)&&e&&Fn(t.pathname+t.search)},[t,e]),e?(0,X.jsx)(a,{to:`/confirm_account`,replace:!0}):(0,X.jsx)(n,{})},Jy=()=>Lo()?(0,X.jsx)(n,{}):(0,X.jsx)(J,{to:`/`,replace:!0}),Yy=({children:e})=>K()?e?(0,X.jsx)(X.Fragment,{children:e}):(0,X.jsx)(n,{}):(0,X.jsx)(J,{to:`/`,replace:!0}),Xy=()=>{let{hasCheckoutSelfService:e,isFreemium:t}=G();return e&&!t?(0,X.jsx)(J,{to:`/settings/subscription`,replace:!0}):(0,X.jsx)(J,{to:`/settings/invoices`,replace:!0})},Zy=()=>{let{planId:e,isYearly:t,isFreemium:n}=G();return n||t?(0,X.jsx)(J,{to:`/billing/subscription/plans`,replace:!0}):(0,X.jsx)(J,{to:`/billing/subscription/checkout/${Un(e)}_yearly`,replace:!0})},Qy=()=>wa()?(0,X.jsx)(n,{}):(0,X.jsx)(J,{to:`/`,replace:!0}),$y=()=>{let{plan:e}=f(),{addOnQuotaSelection:t}=Lr(),{canUpgradeTo:r}=Tr(t),{planId:i,humanizedPlanId:a}=Xc(e),{checkoutId:o}=ya(),s=a&&eb[a];return s?(0,X.jsx)(J,{to:`/billing/subscription/checkout/${s}`,replace:!0}):!o&&(i===null||!r(i)||An(i))?(0,X.jsx)(J,{to:`/billing/subscription/plans`,replace:!0}):(0,X.jsx)(n,{})},eb={humanizer:`discovery`,humanizer_yearly:`discovery_yearly`,starter:`discovery`,starter_yearly:`discovery_yearly`,essential:`standard`,essential_yearly:`standard_yearly`,scale:`pro`,scale_yearly:`pro_yearly`},tb=[{path:`billing`,element:(0,X.jsx)(()=>(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Gs,{text:`Billing`}),(0,X.jsx)(Yy,{children:(0,X.jsx)(n,{})})]}),{}),children:[{index:!0,element:(0,X.jsx)(Xy,{})},{path:`subscription`,children:[{index:!0,element:(0,X.jsx)(Xy,{})},{element:(0,X.jsx)(Qy,{}),children:[{path:`upgrade_yearly`,element:(0,X.jsx)(Zy,{})},{path:`plans`,lazy:{Component:async()=>{let{SelectPlanPage:e}=await i(async()=>{let{SelectPlanPage:e}=await import(`./B1Q9h4AN2.js`);return{SelectPlanPage:e}},[]);return i(()=>import(`./6GoY7N8j2.js`),[]),i(()=>import(`./BoD3l6Jy2.js`),[]),e}}},{path:`checkout`,lazy:{Component:async()=>(await i(async()=>{let{CheckoutLayout:e}=await import(`./6GoY7N8j2.js`);return{CheckoutLayout:e}},[])).CheckoutLayout}
234,children:[{index:!0,element:(0,X.jsx)(J,{to:`/billing/subscription/plans`,replace:!0})},{path:`:plan/:future_plan`,element:(0,X.jsx)(()=>{let{plan:e,future_plan:t}=f(),{addOnQuotaSelection:r}=Lr(),{canUpgradeTo:i}=Tr(r),{isTrialFeatureFlagEnabled:a,canUseTrial:o,loading:s}=Pr(),{planId:c}=Xc(e),{planId:l}=Xc(t),{checkoutId:u}=ya();return s?(0,X.jsx)(C,{}):!u&&(c===null||l===null||!a||!Gn(c)||!o||!i(l))?(0,X.jsx)(J,{to:`/billing/subscription/plans`,replace:!0}):(0,X.jsx)(n,{})},{}),children:[{index:!0,lazy:{Component:async()=>(await i(async()=>{let{PlanCheckout:e}=await import(`./BoD3l6Jy2.js`);return{PlanCheckout:e}},[])).PlanCheckout}}]},{path:`:plan`,element:(0,X.jsx)($y,{}),children:[{index:!0,lazy:{Component:async()=>(await i(async()=>{let{PlanCheckout:e}=await import(`./BoD3l6Jy2.js`);return{PlanCheckout:e}},[])).PlanCheckout}}]}]}]},{path:`*`,element:(0,X.jsx)(J,{to:`/billing/subscription/plans`,replace:!0})}]},{path:`add_on`,children:[{index:!0,element:(0,X.jsx)(J,{to:`/`,replace:!0})},{path:`checkout`,element:(0,X.jsx)(J,{to:`/`,replace:!0})},{lazy:{Component:async()=>(await i(async()=>{let{CheckoutLayout:e}=await import(`./6GoY7N8j2.js`);return{CheckoutLayout:e}},[])).CheckoutLayout},children:[{path:`checkout/:addOnId/:quantity?`,lazy:{Component:async()=>(await i(async()=>{let{AddOnCheckout:e}=await import(`./BxT61SQw.js`);return{AddOnCheckout:e}},[])).AddOnCheckout}}]}]},{path:`ai`,children:[{element:(0,X.jsx)(Jy,{}),children:[{index:!0,element:(0,X.jsx)(J,{to:`/`,replace:!0})},{lazy:{Component:async()=>(await i(async()=>{let{CheckoutLayout:e}=await import(`./6GoY7N8j2.js`);return{CheckoutLayout:e}},[])).CheckoutLayout},children:[{path:`packages`,lazy:{Component:async()=>(await i(async()=>{let{AiPackagesPricingPage:e}=await import(`./CTLqUuOZ2.js`);return{AiPackagesPricingPage:e}},[])).AiPackagesPricingPage}},{path:`checkout`,children:[{index:!0,element:(0,X.jsx)(J,{to:`/`,replace:!0})},{path:`:packageId/:quantity?`,lazy:{Component:async()=>(await i(async()=>{let{AiCreditsCheckout:e}=await import(`./BLA-6vRP.js`);return{AiCreditsCheckout:e}},[])).AiCreditsCheckout}}]}]}]}]},{path:`migrate`,children:[{path:`essential`,lazy:{Component:async()=>(await i(async()=>{let{EssentialMigrationPage:e}=await import(`./5A8luyOA2.js`);return{EssentialMigrationPage:e}},[])).EssentialMigrationPage}}]}]}],nb=({children:e})=>{let{isDeprecated:t}=G(),r=S();return t&&!ib(r.pathname)?(0,X.jsx)(J,{to:`/deprecated_plan`,replace:!0}):e?(0,X.jsx)(X.Fragment,{children:e}):(0,X.jsx)(n,{})},rb=[`/workspace/:workspaceId/billing/subscription/plans/*`,`/workspace/:workspaceId/billing/subscription/checkout/*`,`/workspace/:workspaceId/deprecated_plan/*`,`/workspace/:workspaceId/past_due/*`,`/workspace/:workspaceId/settings/billing_details`],ib=e=>!!Sr(rb,e),ab=`peace-of-mind-2026`,ob=()=>{let e=rc(),{addToast:n}=gr(),r=Yn(),{refetch:i}=xa(),a=K(),{openSupport:s}=Fo({floatingMode:!1}),{isDeprecated:c,plan:l}=G(),u=Ar({target:`plan`}),d=Br(),f=Vn(d[0]===`enterprise-2021`?ab:d[0]??ab),[p,m]=(0,Y.useState)(!1),h=(0,Y.useCallback)(async()=>{m(!0);let t=await e.fetch(`billing:accept_deprecated_plan_swap`,{plan_id:_t(f.id)});if(m(!1),t.error){n({type:`danger`,title:T._(`Could not update plan`,null,{hk:`2AoFtP`,project:`billing`}),content:typeof t.error==`string`?t.error:T._(`Please try again or contact support.`,null,{hk:`1b0qD9`,project:`billing`}),group:`deprecated-plan-swap`});return}await i(),n({type:`success`,title:T._(`Plan updated`,null,{hk:`1HdIYq`,project:`billing`}),content:T._(`Your subscription is now on {planName}.`,[T._param(`planName`,f.display_name)],{hk:`YUYvt`,project:`billing`}),group:`deprecated-plan-swap`}),r(`/dashboard`,{replace:!0})},[n,e,r,f,i]);return c?(0,X.jsx)(`div`,{className:`flex h-full items-center justify-center bg-white-base`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-lg px-md py-lg text-center md:w-[620px]`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-md text-gray-100`,children:[(0,X.jsx)(`div`,{className:`text-xl font-bold text-gray-100`,children:w._(`Welcome back! We've got an upgrade for you. ð`,null,{hk:`3MuZc7`,project:`billing`})}),(0,X.jsx)(`div`,{className:`text-base`,children:w._(`A lot has changed since you were last here! We've retired your legacy {currentPlanName} plan to make room for new plans packed with way more value, expanded features, and higher limits.`,[w._param(`currentPlanName`,(0,X.jsx)(`span`,{className:`font-semibold`,children:l.display_name}))],{hk:`621rI`,project:`billing`})}),(0,X.jsx)(`div`,{className:`text-base`,children:w._(`We want you to experience the best of what's new, so we're offering you a sweet deal to pick up right where you left off: move to the {newPlanName} plan today, {=m5}`,[w._param(`newPlanName`,(0,X.jsx)(`span`,{className:`font-semibold`,children:f.display_name})),w._implicitParam(`=m5`,(0,X.jsx)(sb,{}))],{hk:`3WhhfZ`,project:`billing`})}),(0,X.jsx)(`div`,{className:`text-base`,children:w._(`Don't worryâyour workspaces, projects, and integrations are fully active and exactly how you left them.`,null,{hk:`4BTHv4`,project:`billing`})})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-md`,children:[f&&(0,X.jsx)(b,{content:u,children:(0,X.jsx)(o,{variant:`primary`,size:`base`,loading:p,disabled:p||!a,onClick:h,children:w._(`Continue to {planName} at my current price`,[w._param(`planName`,(0,X.jsx)(`span`,{className:`font-semibold`,children:f.display_name}))],{hk:`1qdDAn`,project:`billing`})})}),(0,X.jsx)(o,{variant:`text`,size:`base`,onClick:s,children:w._(`Contact support`,null,{hk:`26uNVZ`,project:`billing`})})]}),(0,X.jsxs)(`div`,{className:`flex w-full flex-col items-center justify-center gap-sm text-base text-gray-100 md:flex-row`,children:[w._(`Curious what's changed since you were last here?`,null,{hk:`19QwHt`,project:`billing`}),(0,X.jsx)(z,{to:`https://surferseo.com/updates/`,target:`_blank`,className:`text-base font-semibold`,children:w._(`{=m0}`,[w._implicitParam(`=m0`,(0,X.jsx)(`span`,{className:`inline-flex gap-3xs`,children:w._(`{=m1}{=m2}`,[w._implicitParam(`=m1`,(0,X.jsx)(`span`,{children:w._(`See what's new`,null,{hk:`2Br3CN`,project:`billing`})})),w._implicitParam(`=m2`,(0,X.jsx)(t,{Component:Or,size:`small`}))],{hk:`30rzJB`,project:`billing`})}))],{hk:`2tcFp2`,project:`billing`})})]})]})}):(0,X.jsx)(J,{to:`/dashboard`,replace:!0})},sb=()=>{let{subscriptionPeriod:e}=xa(),{isYearly:t}=G(),n=!!e.end&&(0,Z.default)(e.end).isBefore((0,Z.default)().add(6,`month`));return t?n?w._(`and we'll lock in your old price for the next year.`,null,{hk:`1DWMWk`,project:`billing`}):w._(`for no additional charge until the next renewal.`,null,{hk:`3Ffarc`,project:`billing`}):w._(`and we'll lock in your old price for the next 6 months.`,null,{hk:`4jONEy`,project:`billing`})},cb=({bottomSlot:e,children:n,title:r})=>(0,X.jsx)(`div`,{className:`flex min-h-[calc(100vh-32px)] items-center justify-center bg-white-base`,children:(0,X.jsxs)(`div`,{className:`mx-auto flex flex-col gap-4xl px-md py-lg md:w-[620px] md:px-lg md:py-xl`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-lg`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-sm text-xl font-bold`,children:[(0,X.jsx)(`div`,{children:r}),(0,X.jsx)(t,{Component:ns,size:`xlarge`})]}),n]}),e]})}),lb=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>
234(0,X.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M15.22 6.268a.75.75 0 0 1 .968-.431l5.942 2.28a.75.75 0 0 1 .431.97l-2.28 5.94a.75.75 0 1 1-1.4-.537l1.63-4.251l-1.086.484a11.2 11.2 0 0 0-5.45 5.173a.75.75 0 0 1-1.199.19L9 12.312l-6.22 6.22a.75.75 0 0 1-1.06-1.061l6.75-6.75a.75.75 0 0 1 1.06 0l3.606 3.606a12.7 12.7 0 0 1 5.68-4.974l1.086-.483l-4.251-1.632a.75.75 0 0 1-.432-.97`,clipRule:`evenodd`})]})),ub=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M12.963 2.286a.75.75 0 0 0-1.071-.136a9.74 9.74 0 0 0-3.539 6.176a7.6 7.6 0 0 1-1.705-1.715a.75.75 0 0 0-1.152-.082A9 9 0 1 0 15.68 4.534a7.46 7.46 0 0 1-2.717-2.248M15.75 14.25a3.75 3.75 0 1 1-7.313-1.172c.628.465 1.35.81 2.133 1a6 6 0 0 1 1.925-3.546a3.75 3.75 0 0 1 3.255 3.718`,clipRule:`evenodd`})]})),db=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:`1.2em`,height:`1.2em`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M12.0217 3.50266C12.0858 3.69489 12.2657 3.82455 12.4683 3.82455C12.671 3.82455 12.8509 3.69489 12.9149 3.50266L13.0015 3.24313C13.0483 3.10256 13.1586 2.99225 13.2992 2.94539L13.5587 2.85888C13.751 2.7948 13.8806 2.61491 13.8806 2.41228C13.8806 2.20965 13.751 2.02975 13.5587 1.96568L13.2992 1.87916C13.1586 1.83231 13.0483 1.722 13.0015 1.58143L12.9149 1.32189C12.8509 1.12966 12.671 1 12.4683 1C12.2657 1 12.0858 1.12966 12.0217 1.32189L11.9352 1.58143C11.8884 1.722 11.7781 1.83231 11.6375 1.87916L11.378 1.96568C11.1857 2.02975 11.0561 2.20965 11.0561 2.41228C11.0561 2.61491 11.1857 2.7948 11.378 2.85888L11.6375 2.94539C11.7781 2.99225 11.8884 3.10256 11.9352 3.24313L12.0217 3.50266Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M8.56302 1.92871C9.03884 1.92871 9.42456 2.31444 9.42456 2.79025C9.42456 3.26607 9.03884 3.65179 8.56302 3.65179H4.85255C3.69679 3.60872 2.71225 4.59949 2.71225 5.80565L2.70975 14.8506L2.711 14.8518L2.71225 14.8531C2.71293 16.0587 3.69719 17.0057 4.85255 17.0057H13.8847C14.6943 17.0057 15.4154 16.5536 15.7982 15.9017C16.017 15.5289 16.3717 15.2047 16.804 15.2047C17.3293 15.2047 17.7481 15.6643 17.5658 16.1571C17.0162 17.6432 15.5627 18.7288 13.8847 18.7288H4.85255C2.75505 18.7288 1 17.0057 1 14.8518L1.04499 5.80565C1.04499 3.69487 2.75505 1.92871 4.89536 1.92871H8.56302Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M18.0054 10.1784C16.7569 11.9898 14.5321 13.4385 10.7337 13.5687C10.6129 14.0102 10.5238 14.4203 10.4635 14.7816C10.3955 15.1902 10.009 15.4662 9.60046 15.3981C9.19188 15.33 8.91586 14.9436 8.98395 14.535C9.07915 13.9638 9.23401 13.3046 9.45423 12.6034C9.99253 10.8896 10.941 8.86387 12.4274 7.25348C13.9269 5.62889 15.9891 4.41577 18.6961 4.41577H19.4461V5.16577C19.4461 5.76958 19.3927 6.70439 19.1148 7.73741L16.387 8.46833C16.1203 8.5398 15.962 8.81397 16.0334 9.0807C16.1049 9.34744 16.3791 9.50573 16.6458 9.43426L18.7204 8.87837C18.5331 9.31452 18.2985 9.75308 18.0054 10.1784Z`,fill:`currentColor`}),(0,X.jsx)(`path`,{d:`M8.00244 9.91211C7.68578 9.91211 7.41314 9.6886 7.35104 9.37808L7.19259 8.58586C7.14 8.32289 6.93444 8.11733 6.67146 8.06473L5.87924 7.90629C5.56873 7.84419 5.34521 7.57155 5.34521 7.25488C5.34521 6.93822 5.56873 6.66558 5.87924 6.60348L6.67146 6.44503C6.93444 6.39244 7.13999 6.18688 7.19259 5.92391L7.35104 5.13168C7.41314 4.82117 7.68578 4.59766 8.00244 4.59766C8.3191 4.59766 8.59175 4.82117 8.65385 5.13168L8.81229 5.92391C8.86489 6.18688 9.07044 6.39244 9.33342 6.44503L10.1256 6.60348C10.4362 6.66558 10.6597 6.93822 10.6597 7.25488C10.6597 7.57155 10.4362 7.84419 10.1256 7.90629L9.33342 8.06473C9.07044 8.11733 8.86489 8.32289 8.81229 8.58586L8.65385 9.37808C8.59175 9.6886 8.3191 9.91211 8.00244 9.91211Z`,fill:`currentColor`})]})),fb=()=>{let{data:e,loading:t}=Bn({variables:{workspaceId:A()}});return{stats:{topicsCount:(e==null?void 0:e.aiTracker.projects.reduce((e,t)=>
234e+t.promptTopics.length,0))??0,promptsCount:(e==null?void 0:e.aiTracker.projects.reduce((e,t)=>e+t.promptsCount,0))??0},loading:t}};B` 235 query AiTrackerProjectsStats($workspaceId: ID!) { 236 aiTracker { 237 id 238 projects(workspaceId: $workspaceId) { 239 id 240 promptsCount 241 promptTopics { 242 id 243 } 244 } 245 } 246 } 247`;var pb=()=>{let e=M(),{data:t,loading:n,error:r}=ke({variables:{organizationId:e},skip:!e});return{count:t==null?void 0:t.contentEditors.count,loading:n,error:r}};B` 248 query ContentEditorCount($organizationId: ID!) { 249 contentEditors { 250 id 251 count(organizationId: $organizationId) 252 } 253 } 254`;var mb=()=>{let e=M(),{data:t,loading:n,error:r}=ft({variables:{organizationId:e},skip:!e});return{stats:t==null?void 0:t.sites,loading:n,error:r}};B` 255 query SitesStats($organizationId: ID!) { 256 sites { 257 id 258 projectsCount(organizationId: $organizationId) 259 mostRecentProjectGscSite(organizationId: $organizationId) { 260 displayUrl 261 } 262 recommendationsCount(organizationId: $organizationId) 263 } 264 } 265`;var hb=()=>{let{stats:e,loading:t}=fb(),n=!t&&e&&e.topicsCount>0&&e.promptsCount>0,{count:r,loading:i}=pb(),a=!i&&!!r,{stats:o,loading:s}=mb(),c=!s&&o&&o.projectsCount>0,l=(o==null?void 0:o.recommendationsCount)??0,u=!s&&!!l;return{anyStatsVisible:n||a||u||c,aiTrackerStats:e,aiTrackerStatsLoading:t,aiTrackerStatsVisible:n,contentEditorCount:r,contentEditorLoading:i,contentEditorCountVisible:a,recommendationsCount:l,recommendationsLoading:s,recommendationsCountVisible:u,sitesStats:o,sitesLoading:s,sitesStatsVisible:c}},gb=({title:e,loading:t,icon:n,value:r,children:i})=>(0,X.jsxs)(`div`,{className:`flex flex-col gap-base rounded-lg border border-gray-20 p-lg`,children:[(0,X.jsx)(`div`,{className:`text-md font-semibold`,children:e}),n?(0,X.jsxs)(`div`,{className:`flex items-center gap-sm`,children:[n,t?(0,X.jsx)(R,{className:`size-[32px]`}):(0,X.jsx)(`div`,{className:`text-xl font-bold`,children:r??0})]}):t?(0,X.jsx)(`div`,{className:`space-y-sm`,children:(0,X.jsx)(R,{className:`h-[28px] w-[128px]`})}):i]}),_b=({description:e})=>{var n,r,i;let{anyStatsVisible:a,aiTrackerStats:o,aiTrackerStatsVisible:s,contentEditorCount:c,contentEditorLoading:l,contentEditorCountVisible:u,recommendationsCount:d,recommendationsLoading:f,recommendationsCountVisible:p,sitesStats:m,sitesLoading:h,sitesStatsVisible:g}=hb();return a?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`text-base text-gray-100`,children:e}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-2xs`,children:[g&&(0,X.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-1`,children:(0,X.jsx)(gb,{title:T._(`Sites you were monitoring`,null,{hk:`4ic1jz`,project:`billing`}),children:(0,X.jsxs)(`div`,{className:`flex gap-sm`,children:[h?(0,X.jsx)(R,{className:`mt-3xs size-[24px]`}):m!=null&&m.mostRecentProjectGscSite?(0,X.jsx)(`div`,{className:`mt-3xs`,children:(0,X.jsx)(Ao,{url:m.mostRecentProjectGscSite.displayUrl})}):null,(0,X.jsx)(`div`,{className:`flex flex-wrap items-center`,children:h?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(R,{className:`size-[24px]`}),(0,X.jsx)(R,{className:`size-[24px]`})]}):m&&(0,X.jsxs)(`div`,{className:`flex max-w-[480px] flex-col`,children:[(0,X.jsx)(b,{content:m==null||(n=m.mostRecentProjectGscSite)==null?void 0:n.displayUrl,children:(0,X.jsx)(`span`,{className:O(`mr-xs overflow-hidden text-ellipsis text-nowrap text-lg font-bold`,!(m==null||(r=m.mostRecentProjectGscSite)==null)&&r.displayUrl?``:`text-xl`),children:m==null||(i=m.mostRecentProjectGscSite)==null?void 0:i.displayUrl})}),(0,X.jsx)(`div`,{className:`mt-2xs whitespace-nowrap text-sm`,children:(m==null?void 0:m.projectsCount)&&m.projectsCount>1&&w._({"*":{"*":`+ {count} more`,_1:`+ {count} more`}},[w._param(`count`,m.projectsCount-1,[0,m.projectsCount-1]),w._plural(m.projectsCount-1)],{hk:`1T5NPE`,project:`billing`})})]})})]})})}),s&&(0,X.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-1`,children:(0,X.jsx)(gb,{title:T._(`You tracked`,null,{hk:`3mI03f`,project:`billing`}),children:(0,X.jsxs)(`div`,{className:`flex gap-sm`,children:[(0,X.jsx)(t,{Component:lb,size:`large`,className:`text-gray-60`}),(0,X.jsx)(`div`,{className:`text-lg font-bold`,children:w._({"*":{"*":`{promptsCount} prompts in {topicsCount} topics`,_1:`{promptsCount} prompts in 1 topic`},_1:{"*":`1 prompt in {topicsCount} topics`,_1:`1 prompt in 1 topic`}},[w._plural(o.promptsCount,`promptsCount`),w._plural(o.topicsCount,`topicsCount`)],{hk:`3n34Vf`,project:`billing`})})]})})}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-2xs ${p&&u?`md:grid-cols-2`:`md:grid-cols-1`}`,children:[u&&(0,X.jsx)(gb,{title:T._(`Content you wrote and optimized`,null,{hk:`2LxcaF`,project:`billing`}),loading:l,icon:(0,X.jsx)(t,{Component:db,size:`large`,className:`text-gray-60`}),value:c}),p&&(0,X.jsx)(gb,{title:T._(`Recommendations you left`,null,{hk:`1RixkC`,project:`billing`}),loading:f,icon:(0,X.jsx)(t,{Component:ub,size:`large`,className:`text-red-60`}),value:d})]})]})]}):null},vb=`standard-2026`,yb=()=>{let{formatPrice:e}=co(),t=K(),n=Ue(vb),{previousPlan:r,loading:i}=Va(),{annual:a,setAnnual:s}=Ha(),c=r&&mn(r.id)&&!Rt(r.id)&&!An(r.id)?r:n,l=`${Yt(c.id)??c.id}${a?`_yearly`:``}`,u=N(),d=An(c.id),f=a?c.price.year:c.price.month;return i?(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-base rounded-lg bg-gray-5 px-lg py-base`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsx)(`div`,{className:`text-lg font-bold`,children:(0,X.jsx)(R,{className:`h-[24px] w-[196px]`})}
265),(0,X.jsx)(bb,{isAnnual:a,setIsAnnual:s,disabled:!0})]}),(0,X.jsx)(`div`,{className:`shrink-0`,children:(0,X.jsx)(o,{disabled:!0,children:(0,X.jsx)(R,{className:`h-[24px] w-[128px]`})})})]}):(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-between gap-base rounded-lg bg-gray-5 px-lg py-base sm:flex-row`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,X.jsxs)(`div`,{className:`text-lg font-bold`,children:[c.display_name,!d&&(0,X.jsxs)(X.Fragment,{children:[`â`,w._(`{price}/mo`,[w._param(`price`,e(f))],{hk:`3HrtlE`,project:`billing`})]})]}),!d&&(0,X.jsx)(bb,{isAnnual:a,setIsAnnual:s})]}),(0,X.jsx)(`div`,{className:`shrink-0`,children:(0,X.jsx)(b,{visible:!t,content:T._(`You cannot resubscribe due to your current organization role. Reach out to your organization owner to purchase this or ask to be promoted to admin.`,null,{hk:`4yP0bi`,project:`billing`}),children:(0,X.jsx)(L,{to:u(d?`/billing/subscription/plans`:`/billing/subscription/checkout/${l}`),disabled:!t,children:d?w._(`Reactivate plan`,null,{hk:`ajIw2`,project:`billing`}):w._(`Choose {planName}`,[w._param(`planName`,c.display_name)],{hk:`1aatJH`,project:`billing`})})})})]})},bb=({isAnnual:e,setIsAnnual:t,disabled:n=!1})=>(0,X.jsx)(`div`,{className:`flex gap-sm`,children:(0,X.jsx)(ri,{checked:e,onChange:()=>t(!e),disabled:n,children:(0,X.jsx)(`div`,{className:`text-sm font-normal text-gray-100`,children:w._(`Pay annually and save 17%`,null,{hk:`3imxWi`,project:`billing`})})})}),xb=()=>{let{isFreemium:e}=G();return e?(0,X.jsxs)(cb,{title:T._(`Your plan has expired`,null,{hk:`1RS3Wt`,project:`billing`}),bottomSlot:(0,X.jsx)(`div`,{className:`text-base text-gray-100`,children:w._(`We've been hard at work adding new features while you were gone. {=m1}{=m2}`,[w._implicitParam(`=m1`,(0,X.jsx)(`br`,{})),w._implicitParam(`=m2`,(0,X.jsx)(z,{to:`https://surferseo.com/updates/`,target:`_blank`,className:`text-base font-semibold`,children:w._(`{=m1}`,[w._implicitParam(`=m1`,(0,X.jsx)(`span`,{className:`inline-flex gap-3xs`,children:w._(`{=m1}{=m2}`,[w._implicitParam(`=m1`,(0,X.jsx)(`span`,{children:w._(`See what's new`,null,{hk:`1jMD1`,project:`billing`})})),w._implicitParam(`=m2`,(0,X.jsx)(t,{Component:Or,size:`small`}))],{hk:`3xShV4`,project:`billing`})}))],{hk:`inpl7`,project:`billing`})}))],{hk:`1GCKE2`,project:`billing`})}),children:[(0,X.jsx)(_b,{description:w._(`But all your hard work is still right here, waiting for you. {=m1} You've built up something great:`,[w._implicitParam(`=m1`,(0,X.jsx)(`br`,{}))],{hk:`GkVuY`,project:`billing`})}),(0,X.jsx)(yb,{})]}):(0,X.jsx)(J,{to:`/dashboard`})},Sb=()=>{let{subscriptionPastDue:e}=xa(),t=K(),n=N(),{openSupportNewMessage:r}=Fo();if(!e)return(0,X.jsx)(J,{to:`/dashboard`});let i=(0,X.jsx)(L,{to:n(`/settings/billing_details`),disabled:!t,children:w._(`Update payment method`,null,{hk:`4FTTPF`,project:`billing`})});return(0,X.jsxs)(cb,{title:T._(`Payment for your plan is past due`,null,{hk:`1Z5XdE`,project:`billing`}),children:[(0,X.jsx)(`div`,{className:`text-base text-gray-100`,children:t?w._(`Please update your billing method to restore access to Surfer and reactivate AI visibility tracking.`,null,{hk:`231WBr`,project:`billing`}):w._(`Please ask your organization owner or admin to update the billing method to restore access to Surfer and reactivate AI visibility tracking.`,null,{hk:`kpdpC`,project:`billing`})}),(0,X.jsx)(_b,{description:w._(`You've built up something great:`,null,{hk:`13iP6V`,project:`billing`})}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-xl`,children:[(0,X.jsx)(o,{onClick:r,variant:`text`,children:w._(`Contact support`,null,{hk:`2MIufW`,project:`billing`})}),t?i:(0,X.jsx)(b,{content:T._(`Contact organization owner or admin to check card details`,null,{hk:`1W1RcE`,project:`billing`}),children:i})]})]})},Cb=()=>(0,X.jsx)(ei,{app:`drafts`,children:(0,X.jsx)(_s,{tool:`content_editor`,children:(0,X.jsx)(n,{})})}),wb=async()=>{let{DraftsDashboard:e}=await i(async()=>{let{DraftsDashboard:e}=await import(`./DPucqnSf.js`);return{DraftsDashboard:e}},[]);return i(()=>import(`./BF22Cy6s2.js`),[]),e},Tb=[{path:`drafts`,element:(0,X.jsx)(Cb,{}),children:[{index:!0,lazy:{Component:wb}},{path:`new`,lazy:{Component:async()=>(await i(async()=>{let{NewContentPage:e}
265=await import(`./DB5I3oPM2.js`);return{NewContentPage:e}},[])).NewContentPage}},{path:`new/:draftId`,lazy:{Component:async()=>(await i(async()=>{let{NewContentPage:e}=await import(`./DB5I3oPM2.js`);return{NewContentPage:e}},[])).NewContentPage}},{path:`import`,lazy:{Component:async()=>(await i(async()=>{let{ImportContentPage:e}=await import(`./USg-4SJh2.js`);return{ImportContentPage:e}},[])).ImportContentPage}},{path:`import/:draftId`,lazy:{Component:async()=>(await i(async()=>{let{ImportContentPage:e}=await import(`./USg-4SJh2.js`);return{ImportContentPage:e}},[])).ImportContentPage}},{path:`:draftId`,lazy:{Component:async()=>(await i(async()=>{let{DraftPage:e}=await import(`./BF22Cy6s2.js`);return{DraftPage:e}},[])).DraftPage}},{path:`folder/:folderId`,element:(0,X.jsx)(Py,{app:`drafts`}),children:[{index:!0,lazy:{Component:wb}}]}]}];ue();var Eb=fe` 266 ${de` 267 .shepherd-element { 268 ${ni(`md`)}; 269 background-color: ${k(`purple-base`)}; 270 color: ${k(`white-base`)}; 271 ${Ce(`lg`)}; 272 box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); 273 max-width: 328px; 274 opacity: 0; 275 outline: none; 276 transition: 277 opacity 0.3s, 278 visibility 0.3s; 279 visibility: hidden; 280 width: 100%; 281 z-index: 9999; 282 pointer-events: auto; 283 284 &.shepherd-enabled { 285 opacity: 1; 286 visibility: visible; 287 } 288 289 &[data-popper-reference-hidden]:not(.shepherd-centered) { 290 opacity: 0; 291 pointer-events: none; 292 visibility: hidden; 293 } 294 295 &, 296 & *, 297 & ::after, 298 & ::before { 299 box-sizing: border-box; 300 } 301 302 &[data-popper-reference-hidden]:not(.shepherd-centered) { 303 opacity: 0; 304 pointer-events: none; 305 visibility: hidden; 306 } 307 308 &.shepherd-has-title[data-popper-placement^='bottom'] 309 > .shepherd-arrow::before { 310 background-color: ${k(`purple-base`)}; 311 } 312 } 313`} 314 ${de` 315 .shepherd-arrow { 316 &, 317 &::before { 318 height: 16px; 319 position: absolute; 320 width: 16px; 321 z-index: -1; 322 } 323 324 &::before { 325 background: ${k(`purple-base`)}; 326 content: ''; 327 transform: rotate(45deg); 328 } 329 } 330 331 .shepherd-element[data-popper-placement^='top'] > .shepherd-arrow { 332 bottom: -8px; 333 } 334 335 .shepherd-element[data-popper-placement^='bottom'] > .shepherd-arrow { 336 top: -8px; 337 left: -8px; 338 } 339 340 .shepherd-element[data-popper-placement^='left'] > .shepherd-arrow { 341 right: -8px; 342 } 343 344 .shepherd-element[data-popper-placement^='right'] > .shepherd-arrow { 345 left: -8px; 346 } 347 348 .shepherd-element[data-popper-placement^='top-start'] > .shepherd-arrow, 349 .shepherd-element[data-popper-placement^='bottom-start'] > .shepherd-arrow { 350 left: 28px !important; 351 } 352 353 .shepherd-element[data-popper-placement^='bottom-end'] > .shepherd-arrow { 354 left: auto !important; 355 right: 28px; 356 } 357 358 .shepherd-element.shepherd-centered > .shepherd-arrow { 359 opacity: 0; 360 } 361`} 362 ${de` 363 .shepherd-header { 364 display: flex; 365 align-items: center; 366 justify-content: space-between; 367 ${we(`sm`,`bottom`)}; 368 } 369 370 .shepherd-title { 371 ${Te({size:`md`,margin:[0],weight:`regular`})} 372 } 373 374 .shepherd-cancel-icon { 375 background: transparent; 376 border: none; 377 color: ${k(`white-100`)}; 378 cursor: pointer; 379 margin: 0; 380 padding: 0; 381 transition: color 0.5s ease; 382 383 &, 384 span { 385 display: block; 386 width: 20px; 387 height: 20px; 388 font-size: var(--font-lg); 389 line-height: 1; 390 } 391 392 &:hover { 393 color: ${k(`gray-80`)}; 394 } 395 } 396`} 397 ${de` 398 .shepherd-footer { 399 display: flex; 400 flex-direction: row-reverse; 401 justify-content: space-between; 402 ${we(`xl`,`top`)}; 403 } 404`} 405 ${de` 406 .shepherd-button { 407 background-color: ${k(`white-base`)}; 408 cursor: pointer; 409 ${ni(`sm`)}; 410 transition: all 0.5s ease; 411 ${Te({color:`gray-base`,padding:[`base`,`horizontal`,`xs`,`vertical`],size:`md`,weight:`semibold`})} 412 413 &:not(:disabled):hover { 414 background: ${k(`black`)}; 415 color: ${k(`white-base`)}; 416 } 417 418 &:hover { 419 background-color: ${k(`black`)}; 420 } 421 422 &.shepherd-button-tertiary { 423 background: transparent; 424 color: ${k(`white-100`)}; 425 font-weight: var(--font-semibold); 426 padding: 0; 427 margin-right: auto; 428 429 &:not(:disabled):hover { 430 background: transparent; 431 color: ${k(`white-base`)}; 432 ${ii(80)}; 433 } 434 } 435 436 &:disabled {
437 cursor: not-allowed; 438 } 439 } 440`} 441 ${de` 442 .shepherd-text { 443 ${Te({size:`md`,weight:`semibold`})} 444 445 &__title { 446 ${Te({size:`base`,weight:`bold`,margin:[`md`,`vertical`]})} 447 } 448 449 &__subtitle { 450 ${Te({size:`md`,weight:`regular`})} 451 } 452 453 p + p { 454 margin: ${we(`md`,`top`)}; 455 } 456 } 457`} 458 ${de` 459 .shepherd-modal-overlay-container { 460 height: 0; 461 left: 0; 462 opacity: 0; 463 overflow: hidden; 464 pointer-events: none; 465 position: fixed; 466 top: 0; 467 transition: 468 all 0.3s ease-out, 469 height 0ms 0.3s, 470 opacity 0.3s 0ms; 471 width: 100vw; 472 z-index: 9997; 473 } 474 475 .shepherd-modal-overlay-container.shepherd-modal-is-visible { 476 height: 100vh; 477 opacity: 0.5; 478 transform: translateZ(0); 479 transition: 480 all 0.3s ease-out, 481 height 0s 0s, 482 opacity 0.3s 0s; 483 } 484 485 .shepherd-modal-overlay-container.shepherd-modal-is-visible path { 486 pointer-events: all; 487 } 488`} 489 490 .shepherd-target-click-disabled.shepherd-enabled.shepherd-target, 491 .shepherd-target-click-disabled.shepherd-enabled.shepherd-target * { 492 pointer-events: none; 493 } 494`,Db=({children:e})=>(0,X.jsxs)(qa,{children:[(0,X.jsx)(Eb,{}),e]}),Ob=[{path:`rank_tracker`,element:(0,X.jsx)(()=>{let{isEurCurrency:e}=wr();return e?(0,X.jsx)(J,{to:`/dashboard`}):(0,X.jsx)(_s,{tool:`rank_tracker`,children:(0,X.jsx)(n,{})})},{}),children:[{index:!0,lazy:{Component:async()=>{let{RankTrackerPage:e}=await i(async()=>{let{RankTrackerPage:e}=await import(`./Cj2dD-0k2.js`);return{RankTrackerPage:e}},[]);return i(()=>import(`./BNxmh8Tg2.js`),[]),e}}},{path:`create`,lazy:{Component:async()=>(await i(async()=>{let{RankTrackerCreateProjectPage:e}=await import(`./Dy2bKEze2.js`);return{RankTrackerCreateProjectPage:e}},[])).RankTrackerCreateProjectPage}},{path:`projects/:projectId`,lazy:{Component:async()=>(await i(async()=>{let{RankTrackerProjectPage:e}=await import(`./BNxmh8Tg2.js`);return{RankTrackerProjectPage:e}},[])).RankTrackerProjectPage}}]}];function kb(){let e=A(),t=M(),[,{updateQuery:n}]=Ye({variables:{workspaceId:e},fetchPolicy:`cache-only`});At({skip:!e,variables:{workspaceId:e},onData:({data:e})=>{var t;let r=(t=e.data)==null?void 0:t.rankTrackerEvents,i=r==null?void 0:r.__typename;if(i==`RankTrackerProjectCreated`){let e=r==null?void 0:r.project;e&&n(t=>Oa(t,t=>{var n;(n=t.rankTracker)!=null&&n.projects&&t.rankTracker.projects.unshift(e)}))}if(i==`RankTrackerProjectDeleted`){let e=r==null?void 0:r.project;e&&n(t=>Oa(t,t=>{var n;if((n=t.rankTracker)!=null&&n.projects){let n=t.rankTracker.projects.findIndex(t=>t.id===e.id);n!==-1&&t.rankTracker.projects.splice(n,1)}}))}}}),xt({skip:!t,variables:{organizationId:t}})}B` 495 subscription RankTracker($workspaceId: ID!) { 496 rankTrackerEvents(workspaceId: $workspaceId) { 497 ... on RankTrackerProjectCreated { 498 project { 499 ...RankTrackerProjectCard 500 } 501 } 502 503 ... on RankTrackerProjectDeleted { 504 project { 505 ...RankTrackerProjectCard 506 } 507 } 508 509 ... on RankTrackerProjectRestored { 510 project { 511 ...RankTrackerProjectCard 512 } 513 } 514 515 ... on RankTrackerProjectKeywordsEdited { 516 project { 517 ...RankTrackerProject 518 } 519 } 520 } 521 } 522 523 subscription RankTrackerOrganization($organizationId: ID!) { 524 rankTrackerOrganizationEvents(organizationId: $organizationId) { 525 ... on RankTrackerQuotaUpdated { 526 quota { 527 ...RankTrackerQuota 528 } 529 } 530 } 531 } 532`;var Ab=(0,Y.createContext)(null);Ab.displayName=`RankTrackerUpdateContext`;var jb=({children:e})=>(0,X.jsx)(Ab,{value:kb(),children:e}),Mb=()=>{let[e]=ge(),t=M(),n=(0,Y.useRef)(!1),[,r]=Oo(`googleAuth`),[i]=ar(Wt,e=>e.finalizeGscCredentialsConnection),a=(0,Y.useCallback)((e,t,n)=>{let i={timestamp:new Date().toISOString(),success:e,...e?{gscCredentials:n}:{error:(t==null?void 0:t.toLowerCase())||`unknown_error`}};r(JSON.stringify(i)),window.close()},[r]),o=(0,Y.useCallback)(async e=>{try{var n,r;let o=await i({variables:{organizationId:t,code:e}});a(!!(o!=null&&o.success),o==null||(n=o.errors)==null||(n=n.custom)==null?void 0:n.type,o==null||(r=o.success)==null?void 0:r.gscCredentials)}catch{a(!1,`canceled`)}},[t,a,i]),s=e.get(`code`),c=e.get(`error`);return(0,Y.useEffect)(()=>{c?a(!1,`canceled`):s&&!n.current&&(n.current=!0,o(s))},[e,o,s,c,a]),(0,X.jsx)(C,{})};B` 533 mutation FinalizeGscCredentialsConnection( 534 $organizationId: ID! 535 $code: String! 536 ) { 537 finalizeGscCredentialsConnection( 538 organizationId: $organizationId 539 code: $code 540 ) { 541 success { 542 gscCredentials { 543 ...GscCredentials 544 } 545 } 546 error {
547 type 548 } 549 } 550 } 551`;var Nb=()=>(0,X.jsx)(ei,{app:`queries`,children:(0,X.jsx)(_s,{tool:`serp_analyzer`,children:(0,X.jsx)(n,{})})}),Pb=async()=>{let{SerpAnalyzersDashboard:e}=await i(async()=>{let{SerpAnalyzersDashboard:e}=await import(`./xnUDOQjY.js`);return{SerpAnalyzersDashboard:e}},[]);return i(()=>import(`./Ds5dWj8s.js`),[]),e},Fb=[{element:(0,X.jsx)(Nb,{}),path:`queries`,children:[{index:!0,lazy:{Component:Pb}},{path:`folder/:folderId`,element:(0,X.jsx)(Py,{app:`queries`}),children:[{index:!0,lazy:{Component:Pb}}]},{path:`:queryId`,children:[{index:!0,element:(0,X.jsx)(a,{to:`search_results`,replace:!0})},{path:`:tab`,lazy:{Component:async()=>(await i(async()=>{let{QueryPage:e}=await import(`./Ds5dWj8s.js`);return{QueryPage:e}},[])).QueryPage}}]}]}],Ib=({children:e})=>{let t=A(),{updateQuery:n}=ct({variables:{workspaceId:t},skip:!t,fetchPolicy:`cache-only`});return Mt({skip:!t,variables:{workspaceId:t},onData:({data:e})=>{var t;let r=e==null||(t=e.data)==null?void 0:t.brandEvents;if(r)switch(r.__typename){case`BrandCreated`:n(e=>Oa(e,e=>{e.workspaces.workspace&&(e.workspaces.workspace.brand=r.brand)}));break;case`BrandDeleted`:n(e=>Oa(e,e=>{e.workspaces.workspace&&(e.workspaces.workspace.brand=null)}));break;case`BrandKnowledgeGenerationFailed`:n(e=>Oa(e,e=>{e.workspaces.workspace&&(e.workspaces.workspace.brand=null)}));break}},onError:e=>{console.error(`Error subscribing to brand events`,e)}}),e};B` 552 subscription BrandEvents($workspaceId: ID!) { 553 brandEvents(workspaceId: $workspaceId) { 554 ... on BrandKnowledgeGenerated { 555 brand { 556 ...Brand 557 } 558 } 559 ... on BrandKnowledgeGenerationFailed { 560 error 561 } 562 ... on BrandCreated { 563 brand { 564 ...Brand 565 } 566 } 567 ... on BrandDeleted { 568 brandId 569 } 570 } 571 } 572`;var Lb=[{path:`settings`,element:(0,X.jsx)(()=>{let{setBreadcrumbs:e}=(0,Y.use)(po),t=N();return(0,Y.useEffect)(()=>{e([{label:T._(`Settings`,null,{hk:`2qNRsq`,project:`settings`}),url:t(`/settings`)}])},[e,t]),(0,X.jsx)($c,{children:(0,X.jsx)(n,{})})},{}),children:[{index:!0,element:(0,X.jsx)(()=>{let{subscriptionPastDue:e}=xa(),t=j(),n=t==null?void 0:t.status.owned;return e?(0,X.jsx)(a,{to:`billing_details`,replace:!0}):(0,X.jsx)(a,{to:n?`subscription`:`organization`,replace:!0})},{})},{element:(0,X.jsx)(Qc,{}),children:[{path:`organization`,lazy:{Component:async()=>(await i(async()=>{let{OrganizationPage:e}=await import(`./BPXDIAeL.js`);return{OrganizationPage:e}},[])).OrganizationPage}},{path:`members`,lazy:{Component:async()=>(await i(async()=>{let{MembersPage:e}=await import(`./Decjb9Fw.js`);return{MembersPage:e}},__vite__mapDeps([1,2]))).MembersPage}},{path:`workspace_members`,lazy:{Component:async()=>(await i(async()=>{let{WorkspaceMembers:e}=await import(`./BflFnPQX.js`);return{WorkspaceMembers:e}},[])).WorkspaceMembers}}]},{path:`general`,lazy:{Component:async()=>(await i(async()=>{let{WorkspaceSettings:e}=await import(`./CTtb6JqJ.js`);return{WorkspaceSettings:e}},[])).WorkspaceSettings}},{path:`brand_knowledge`,lazy:{Component:async()=>(await i(async()=>{let{BrandPage:e}=await import(`./BE2Ws6Ci.js`);return{BrandPage:e}},[])).BrandPage}},{path:`custom_voices`,lazy:{Component:async()=>(await i(async()=>{let{BrandCustomVoicePage:e}=await import(`./Brsw1hVr.js`);return{BrandCustomVoicePage:e}},__vite__mapDeps([1,2]))).BrandCustomVoicePage}},{path:`google_search_console`,children:[{index:!0,lazy:{element:async()=>{let{SearchConsoleSettings:e}=await i(async()=>{let{SearchConsoleSettings:e}=await import(`./kM-K5O3o.js`);return{SearchConsoleSettings:e}},[]);return(0,X.jsx)(Za,{children:(0,X.jsx)(e,{})})}}},{path:`auth/redirect`,element:(0,X.jsx)(Mb,{})}]},{path:`wordpress`,lazy:{Component:async()=>(await i(async()=>{let{WordPressSettings:e}=await import(`./C3F9ItvF.js`);return{WordPressSettings:e}},__vite__mapDeps([1,2]))).WordPressSettings}},{path:`api`,element:(0,X.jsx)(J,{to:`/mcp_api`,replace:!0})},{path:`webflow`,element:(0,X.jsx)(()=>{let[e]=I(`webflow_export`);return e?(0,X.jsx)(n,{}):(0,X.jsx)(a,{to:`..`,replace:!0})},{}),children:[{path:`*?`,lazy:{Component:async()=>(await i(async()=>{let{WebflowSettingsPage:e}=await import(`./Cg1_8PEM.js`);return{WebflowSettingsPage:e}},[])).WebflowSettingsPage}}]},{path:`current_usage`,lazy:{Component:async()=>(await i(async()=>{let{CurrentUsagePage:e}=await import(`./DTSxljvH.js`);return{CurrentUsagePage:e}},[])).CurrentUsagePage}},{path:`masterclass`,lazy:{Component:async()=>(await i(async()=>{let{MasterclassPage:e}=await import(`./DeCFdKqv.js`).then(e=>e.t);return{MasterclassPage:e}},[])).MasterclassPage}},{element:(0,X.jsx)(Yy,{}),children:[{path:`plan`,element:(0,X.jsx)(J,{to:`settings/subscription`,replace:!0})},{path:`subscription`,lazy:{Component:async()=>(await i(async()=>{let{OverviewSubscriptionPage:e}=await import(`./Djaw7Pj3.js`);return{OverviewSubscriptionPage:e}},[])).OverviewSubscriptionPage}},{path:`invoices`,lazy:{Component:async()=>(await i(async()=>{let{InvoicesPage:e}=await import(`./BVExswlN.js`);return{InvoicesPage:e}},[])).InvoicesPage}},{path:`billing_details`,lazy:{Component:async()=>(await i(async()=>{let{BillingDetailsPage:e}=await import(`./B5RruLne.js`);return{BillingDetailsPage:e}},[])).BillingDetailsPage}}]},{path:`notifications`,lazy:{Component:async()=>(await i(async()=>{let{NotificationsSettings:e}=await import(`./F8Zg6Lop.js`);return{NotificationsSettings:e}},[])).NotificationsSettings}},{element:(0,X.jsx)(()=>
572kt()?(0,X.jsx)(n,{}):(0,X.jsx)(a,{to:`..`,replace:!0}),{}),children:[{path:`consents`,lazy:{Component:async()=>(await i(async()=>{let{PrivacyConsentSettings:e}=await import(`./GW079Vzc.js`);return{PrivacyConsentSettings:e}},[])).PrivacyConsentSettings}}]},{path:`profile`,lazy:{Component:async()=>(await i(async()=>{let{UserProfile:e}=await import(`./DX94rpuo.js`);return{UserProfile:e}},[])).UserProfile}}]}],Rb=({children:e})=>{var t;let{workspace:n,loading:r}=ps(),i=n==null||(t=n.brandedWorkspaceSitesProject)==null?void 0:t.id,[a]=ge(),o=a.get(`intent`);return r?(0,X.jsx)(C,{}):i?(0,X.jsx)(J,{to:nl(i,o),replace:!0}):e},zb=[{path:`sites`,element:(0,X.jsx)(()=>(0,X.jsx)(Za,{children:(0,X.jsx)(n,{})}),{}),children:[{path:`connect`,lazy:{element:async()=>{let{ConnectGscPage:e}=await i(async()=>{let{ConnectGscPage:e}=await import(`./BGerWWmJ.js`);return{ConnectGscPage:e}},[]);return(0,X.jsx)(Rb,{children:(0,X.jsx)(e,{})})}}},{index:!0,lazy:{element:async()=>{let{SitesPage:e}=await i(async()=>{let{SitesPage:e}=await import(`./DtCOhWTE2.js`);return{SitesPage:e}},[]);return i(()=>import(`./Ci2soqQp2.js`),[]),i(()=>import(`./DvIwTXoU2.js`),__vite__mapDeps([0])),(0,X.jsx)(Rb,{children:(0,X.jsx)(e,{})})}}},{path:`configure`,lazy:{Component:async()=>(await i(async()=>{let{ConfigureSitePage:e}=await import(`./RcGkhjbR.js`);return{ConfigureSitePage:e}},[])).ConfigureSitePage}},{path:`:siteId`,lazy:{element:async()=>{let{SitePage:e}=await i(async()=>{let{SitePage:e}=await import(`./Ci2soqQp2.js`);return{SitePage:e}},[]);return(0,X.jsx)(Mv,{children:(0,X.jsx)(e,{})})}},children:[{index:!0,lazy:{element:async()=>{let{DashboardPage:e}=await i(async()=>{let{DashboardPage:e}=await import(`./DvIwTXoU2.js`);return{DashboardPage:e}},__vite__mapDeps([0]));return(0,X.jsx)(el,{children:(0,X.jsx)(e,{})})}}},{path:`content_audit/:projectId?/:pageId?`,lazy:{Component:async()=>(await i(async()=>{let{ContentAuditPage:e}=await import(`./C3kcng9v2.js`);return{ContentAuditPage:e}},[])).ContentAuditPage}},{path:`topical_map/:id?/:topicId?/:clusterId?`,lazy:{Component:async()=>(await i(async()=>{let{TopicalMapPage:e}=await import(`./CFHSGmD92.js`);return{TopicalMapPage:e}},[])).TopicalMapPage}},{path:`recommendations`,lazy:{Component:async()=>(await i(async()=>{let{RecommendationsPage:e}=await import(`./rJuIpCdt2.js`);return{RecommendationsPage:e}},[])).RecommendationsPage},children:[{index:!0,element:(0,X.jsx)(a,{to:`optimize`,replace:!0})},{path:`optimize/:pageId?`,lazy:{Component:async()=>(await i(async()=>{let{OptimizeView:e}=await import(`./nyducZFs2.js`);return{OptimizeView:e}},[])).OptimizeView}},{path:`content_ideas/:topicId?/:clusterId?`,lazy:{Component:async()=>(await i(async()=>{let{ContentIdeasView:e}=await import(`./CamkCmw62.js`);return{ContentIdeasView:e}},[])).ContentIdeasView}},{path:`mentions/:id?`,lazy:{Component:async()=>(await i(async()=>{let{MentionsView:e}=await import(`./L3MQ0Jmq2.js`);return{MentionsView:e}},[])).MentionsView}}]},{path:`activity_log`,element:(0,X.jsx)(()=>(0,X.jsx)(a,{to:N()(`/activity_log`),replace:!0}),{})}]}]}];function Bb(){let e=A(),t=jn(),{addToast:n}=gr();Hn({variables:{workspaceId:e},onData(e){var r,i;let a=(r=e.data)==null||(r=r.data)==null?void 0:r.sitesProjectsEvents,o=a==null||(i=a.project)==null?void 0:i.id;(a==null?void 0:a.__typename)===`SitesProjectGscCredentialsReconnected`&&t.refetchQueries({updateCache:e=>{e.modify({id:`SitesProject:${o}`,fields:{simplifiedChartData:(e,{INVALIDATE:t})=>t,performanceReport:(e,{INVALIDATE:t})=>t}})}}),(a==null?void 0:a.__typename)===`SitesProjectTopicalMapReloadFailed`&&n({title:T._(`Topical Map reload failed`,null,{hk:`2RaJr0`,project:`sites`}),type:`danger`,content:T._(`Something went wrong while reloading your Topical Map. Please try again later or contact Support.`,null,{hk:`2Hojjz`,project:`sites`}),group:`sites-topical-map-reload-failed`})}})}B` 573 subscription SitesProjectsUpdates($workspaceId: ID!) { 574 sitesProjectsEvents(workspaceId: $workspaceId) { 575 ... on SitesProjectGscCredentialsReconnected { 576 project { 577 ...SitesProjectGscCredentialsChange 578 } 579 } 580 ... on SitesProjectGscErrorReasonSet { 581 project {
582 ...SitesProjectGscCredentialsChange 583 } 584 } 585 ... on SitesProjectTopicalMapReloadFailed { 586 project { 587 id 588 topicalMap { 589 ...SiteProjectTopicalMap 590 } 591 } 592 } 593 } 594 } 595`;var Vb=(0,Y.createContext)(null);Vb.displayName=`SitesProjectsUpdateContext`;var Hb=({children:e})=>(0,X.jsx)(Vb,{value:Bb(),children:e}),Ub=[{path:`topic_research`,element:(0,X.jsx)(()=>(0,X.jsx)(Za,{children:(0,X.jsx)(Mv,{children:(0,X.jsx)(_s,{tool:`topical_map`,children:(0,X.jsx)(n,{})})})}),{}),children:[{index:!0,lazy:{Component:async()=>{let{TopicalMapPage:e}=await i(async()=>{let{TopicalMapPage:e}=await import(`./CGHSpuk4.js`);return{TopicalMapPage:e}},[]);return i(()=>import(`./D5jSAXU6.js`),[]),e}}},{path:`:id/:topicId?/:clusterId?`,lazy:{Component:async()=>(await i(async()=>{let{TopicalMapQueryPage:e}=await import(`./D5jSAXU6.js`);return{TopicalMapQueryPage:e}},[])).TopicalMapQueryPage}}]}],Wb=`TopicalMapV2ArticleIdeas`,Gb=100,Kb=e=>{var t;return e==null||(t=e.topicalMapV2)==null||(t=t.articleIdeas)==null?void 0:t.data.length},qb=()=>{let e=jn();return(0,Y.useCallback)(t=>e.refetchQueries({updateCache:e=>{e.evict({id:e.identify({__typename:`TopicalMapV2`,id:t})}),e.gc()},onQueryUpdated:(e,t,n)=>{if(e.queryName!==Wb)return!0;let r=Kb(n==null?void 0:n.result);return e.refetch(r?{first:Math.min(r,Gb)}:void 0)}}),[e])},Jb=(e,t)=>{var n;return t?(n=t.mainTopicIds)!=null&&n.length&&(!e.mainTopic||!t.mainTopicIds.includes(e.mainTopic.id))?!1:Yb(e,t.search):!0},Yb=(e,t)=>{let n=t==null?void 0:t.trim().toLowerCase();return n?e.title.toLowerCase().includes(n)||e.targetKeyword.toLowerCase().includes(n):!0},Xb=(e,t)=>({id:e.id,value:Zb(e,t).toLowerCase()}),Zb=(e,t)=>{switch(t){case un.PageType:return e.pageType.name;case un.Stage:return e.pageType.stage;case un.MainTopic:var n;return((n=e.mainTopic)==null?void 0:n.name)??``;default:return e.title}},Qb=(e,t,n)=>{let r=e.value.localeCompare(t.value,`en`)||Number(e.id)-Number(t.id);return n===Zt.Desc?-r:r},$b=(e,t,{filters:n,orderBy:r,sortOrder:i})=>{let a=new Set(e.data.map(e=>e.id)),o=t.filter(e=>a.has(e.id)?!1:(a.add(e.id),Jb(e,n)));if(o.length===0)return null;let s=[...e.data],c=s.map(e=>Xb(e,r)),l=e.cursor==null,u=0;for(let e of o){let t=Xb(e,r);if(!l&&c.length>0&&Qb(t,c[c.length-1],i)>0)continue;let n=c.findIndex(e=>Qb(t,e,i)<0),a=n===-1?c.length:n;s.splice(a,0,e),c.splice(a,0,t),u+=1}return u===0?null:{...e,data:s,totalCount:e.totalCount+u}},ex=e=>[e.pillarArticleIdea,...e.articleIdeas,...(e.subtopics??[]).flatMap(e=>[e.pillarArticleIdea,...e.articleIdeas])].filter(e=>e!==null),tx=({children:e})=>{let[t]=I(`topical_map_v2`),n=A(),r=qb(),[,{updateQuery:i}]=Nn({variables:{workspaceId:n},fetchPolicy:`cache-only`}),{filters:a,orderBy:o,sortOrder:s}=ia(),{data:c,updateQuery:l}=st({variables:{workspaceId:n,filters:a,orderBy:o,sortOrder:s},fetchPolicy:`cache-only`,skip:!n}),u=e=>{var t;!(c==null||(t=c.topicalMapV2)==null)&&t.articleIdeas&&l(t=>{let n=t==null?void 0:t.topicalMapV2;if(!(n!=null&&n.articleIdeas))return t;let r=$b(n.articleIdeas,e,{filters:a,orderBy:o,sortOrder:s});return r?{...t,topicalMapV2:{...n,articleIdeas:r}}:t})};return Jt({skip:!t||!n,variables:{workspaceId:n},onData:({data:{data:e}})=>{let t=e==null?void 0:e.topicalMapV2GenerationEvents;if(t){if(t.__typename===`TopicalMapV2TopicStateChanged`){u(ex(t.topic));return}if(t.__typename===`TopicalMapV2SemanticCenterStateChanged`){u(t.semanticCenter.mainTopics.flatMap(ex));return}t.__typename===`TopicalMapV2StateChanged`&&(i(()=>({topicalMapV2:t.topicalMap})),t.topicalMap.state===Sn.AllDone&&r(t.topicalMap.id))}}}),e};B` 596 fragment TopicalMapV2TableRowsTopicFields on TopicalMapV2Topic { 597 id 598 pillarArticleIdea { 599 ...TopicalMapV2ArticleIdeaRow 600 } 601 articleIdeas { 602 ...TopicalMapV2ArticleIdeaRow 603 } 604 } 605 606 fragment TopicalMapV2TableRowsTopic on TopicalMapV2Topic { 607 ...TopicalMapV2TableRowsTopicFields 608 subtopics { 609 ...TopicalMapV2TableRowsTopicFields 610 } 611 } 612 613 subscription TopicalMapV2GenerationEvents($workspaceId: ID!) { 614 topicalMapV2GenerationEvents(workspaceId: $workspaceId) { 615 __typename 616 ... on TopicalMapV2StateChanged { 617 topicalMap { 618 ...TopicalMapV2 619 } 620 } 621 ... on TopicalMapV2SemanticCenterStateChanged { 622 semanticCenter { 623 ...TopicalMapV2MapCenter 624 mainTopics { 625 ...TopicalMapV2TableRowsTopic 626 } 627 topicalMapV2 { 628 id 629 articleCount 630 } 631 } 632 } 633 ... on TopicalMapV2TopicStateChanged { 634 topic { 635 ...TopicalMapV2MapTopic 636 ...TopicalMapV2TableRowsTopic 637 topicalMapV2 { 638 id 639 articleCount 640 } 641 } 642 } 643 } 644 } 645`;var nx=({children:e})=>{let{topicalMap:t}=aa();return(0,X.jsx)(Pt,{context:(0,Y.useMemo)(()=>({topical_map_id:t==null?void 0:t.id,topical_map_state:t==null?void 0:t.state}),[t==null?void 0:t.id,t==null?void 0:t.state]),children:e})},rx=[{path:`topical_map`,element:(0,X.jsx)(()=>{let[e]=I(`topical_map_v2`),{isPlaygroundWorkspace:t}=q();return!e||t?(0,X.jsx)(J,{to:`/`,replace:!0}):(0,X.jsx)(nx,{children:(0,X.jsx)(n,{})})},{}),children:[{index:!0,lazy:{Component:async()=>(await i(async()=>{let{TopicalMapV2Page:e}=await import(`./QC4IEQr_.js`);return{TopicalMapV2Page:e}},[])).TopicalMapV2Page}}]}],ix=[{path:`wordpress`,element:(0,X.jsx)(()=>{let{canUse:e}=Vr();return e(`ce_wordpress_export`)?(0,X.jsx)(n,{}):(0,X.jsx)(zc,{tool:`ce_wordpress_export`})},{}),children:[{index:!0,lazy:{Component:async()=>(await i(async()=>{let{ConnectedSitesPage:e}=await import(`./N05CS--X.js`);return{ConnectedSitesPage:e}},[])).ConnectedSitesPage}},{path:`connect`,lazy:{Component:async()=>(await i(async()=>{let{ConnectPage:e}=await import(`./taUTrowG.js`);return{ConnectPage:e}},[])).ConnectPage}}]}],ax=()=>{var e,t;let{currentWorkspace:n}=q();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Vo,{className:`!size-3xl !text-lg`,src:n==null?void 0:n.logo,urlFavicon:(n==null||(e=n.gscSite)==null?void 0:e.displayUrl)??(n==null||(t=n.brand)==null?void 0:t.url)}),(0,X.jsx)(`div`,{className:`text-2xl leading-none text-black`,children:w._(`{=m0} workspace is paused`,[w._implicitParam(`=m0`,(0,X.jsx)(`span`,{className:`font-semibold`,children:w._(`{workspaceName}`,[w._param(`workspaceName`,n==null?void 0:n.name)],{hk:`49jTW4`,project:`workspaces`})}))],{hk:`4jjeaB`,project:`workspaces`})})]})},ox=({workspaceId:e})=>{let{enableBrandedWorkspace:t,loading:n}
645=bs(e),{availableWorkspaceSlots:r}=go();return(0,X.jsx)(Ca,{side:`bottom`,context:`workspace_limit`,haveAccess:r>0,children:(0,X.jsx)(o,{variant:`primary`,onClick:t,loading:n,children:w._(`Reactivate workspace`,null,{hk:`152Vcs`,project:`workspaces`})})})},sx=P({category:`workspaces`,name:`disabled_state_remove_workspace_button_clicked`}),cx=P({category:`workspaces`,name:`disabled_state_setup_new_workspace_button_clicked`}),lx=()=>{let e=A(),{send:t}=F(),n=K(),{availableWorkspaceSlots:r}=go(),i=ux({canAccessBilling:n,availableWorkspaceSlots:r});return(0,X.jsx)(`div`,{className:`flex h-full flex-1 grow`,children:(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-base text-center text-black`,children:[(0,X.jsx)(ax,{}),(0,X.jsx)(`div`,{className:`max-w-lg text-lg`,children:i}),n&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-base pt-base`,children:[(0,X.jsx)(ox,{workspaceId:e}),r>0&&(0,X.jsx)(L,{onClick:()=>t(cx),variant:`secondary`,to:`/setup`,children:w._(`Set up new workspace`,null,{hk:`23lRdz`,project:`workspaces`})}),(0,X.jsx)(ms,{workspaceId:e,children:(0,X.jsx)(o,{variant:`text`,onClick:()=>t(sx),className:`text-gray-80 hover:text-red-base`,children:w._(`Delete workspace permanently`,null,{hk:`1TLHUU`,project:`workspaces`})})})]})]})})},ux=({canAccessBilling:e,availableWorkspaceSlots:t})=>e?t>0?T._(`You've freed up a workspace slot. Reactivate this workspace or set up a new one to continue.`,null,{hk:`3zOQyx`,project:`workspaces`}):T._(`This workspace exceeds the available slots on the current plan.`,null,{hk:`3dgRKf`,project:`workspaces`}):T._(`This workspace exceeds the available slots on the current plan. Reach out to the workspace owner or an admin to upgrade and reactivate it.`,null,{hk:`1CRGVG`,project:`workspaces`}),dx=()=>{let{isWorkspaceActive:e}=q();return e?(0,X.jsx)(J,{to:`/dashboard`}):(0,X.jsx)(lx,{})},fx=()=>{var e;let{projectId:t}=f(),{search:n,hash:r}=S(),{data:i,loading:o}=en({variables:{id:`${t}`},skip:!t}),s=i==null||(e=i.aiTracker.project.workspace)==null?void 0:e.id,c=No(s??``);return o?(0,X.jsx)(C,{}):s?(0,X.jsx)(a,{to:`${c}/ai_tracker/${t}${n}${r}`,replace:!0}):(0,X.jsx)(a,{to:`/not_found`,replace:!0})},px=()=>{var e;let{id:t}=f(),{search:n,hash:r}=S(),{data:i,loading:o}=bt({variables:{id:t??``},skip:!t}),s=i==null||(e=i.audit.workspace)==null?void 0:e.id,c=No(s??``);return o?(0,X.jsx)(C,{}):s?(0,X.jsx)(a,{to:`${c}/audits/${t}${n}${r}`,replace:!0}):(0,X.jsx)(a,{to:`/not_found`,replace:!0})};B` 646 query AuditWorkspaceId($id: ID!) { 647 audit(id: $id) { 648 id 649 workspace { 650 id 651 } 652 } 653 } 654`;var mx=()=>{var e;let{draftId:t}=f(),{search:n,hash:r}=S(),{data:i,loading:o}=Ee({variables:{draftId:t??``},skip:!t}),s=i==null||(e=i.contentEditors.byId)==null||(e=e.workspace)==null?void 0:e.id,c=No(s??``);return o?(0,X.jsx)(C,{}):s?(0,X.jsx)(a,{to:`${c}/drafts/${t}${n}${r}`,replace:!0}):(0,X.jsx)(a,{to:`/not_found`,replace:!0})};B` 655 query DraftWorkspaceRedirect($draftId: ID!) { 656 contentEditors { 657 id 658 byId(input: { id: $draftId }) { 659 id 660 workspace { 661 id 662 } 663 } 664 } 665 } 666`;var hx=()=>{var e;let{id:t}=f(),{search:n,hash:r}=S(),{data:i,loading:o}=Ge({variables:{id:t??``},skip:!t}),s=i==null||(e=i.contentPlanner.workspace)==null?void 0:e.id,c=No(s??``);return o?(0,X.jsx)(C,{}):s?(0,X.jsx)(a,{to:`${c}/keyword_research/queries/${t}${n}${r}`,replace:!0}):(0,X.jsx)(a,{to:`/not_found`,replace:!0})};B` 667 query ContentPlannerWorkspaceId($id: ID!) { 668 contentPlanner(id: $id) { 669 id 670 workspace { 671 id 672 } 673 } 674 } 675`;var gx=()=>{var e;let{projectId:t}=f(),{search:n,hash:r}=S(),{data:i,loading:o}=Dt({variables:{id:t??``},skip:!t}),s=i==null||(e=i.rankTracker.project.workspace)==null?void 0:e.id,c=No(s??``);return o?(0,X.jsx)(C,{}):s?(0,X.jsx)(a,{to:`${c}/rank_tracker/projects/${t}${n}${r}`,replace:!0}):(0,X.jsx)(a,{to:`/not_found`,replace:!0})};B` 676 query RankTrackerWorkspaceId($id: ID!) { 677 rankTracker { 678 project(id: $id) { 679 id 680 workspace { 681 id 682 } 683 } 684 } 685 } 686`;var _x=()=>{var e;let{queryId:t}=f(),{search:n,hash:r}=S(),{data:i,loading:o}=jt({variables:{id:t??``},skip:!t}
686),s=i==null||(e=i.serpAnalyzer.workspace)==null?void 0:e.id,c=No(s??``);return o?(0,X.jsx)(C,{}):s?(0,X.jsx)(a,{to:`${c}/queries/${t}${n}${r}`,replace:!0}):(0,X.jsx)(a,{to:`/not_found`,replace:!0})};B` 687 query SerpAnalyzerWorkspaceId($id: ID!) { 688 serpAnalyzer(id: $id) { 689 id 690 workspace { 691 id 692 } 693 } 694 } 695`;var vx=()=>{var e;let{siteId:t}=f(),{search:n,hash:r}=S(),{data:i,loading:o}=Nt({variables:{id:t??``},skip:!t}),s=i==null||(e=i.sites.project.workspace)==null?void 0:e.id,c=No(s??``);return o?(0,X.jsx)(C,{}):s?(0,X.jsx)(a,{to:`${c}/sites/${t}${n}${r}`,replace:!0}):(0,X.jsx)(a,{to:`/not_found`,replace:!0})},yx=({app:e})=>{var t;let{folderId:n}=f(),{search:r,hash:i}=S(),{folder:o,loading:s}=cc(n),c=o==null||(t=o.workspace)==null?void 0:t.id,l=No(c??``);if(s)return(0,X.jsx)(C,{});if(!c)return(0,X.jsx)(a,{to:`/not_found`,replace:!0});let u=`${l}/${e}`;return(0,X.jsx)(a,{to:o&&$r(o)?`${u}${r}${i}`:`${u}/folder/${n}${r}${i}`,replace:!0})},bx=[{path:`drafts/:draftId`,element:(0,X.jsx)(mx,{})},{path:`ai_tracker/:projectId`,element:(0,X.jsx)(fx,{})},{path:`rank_tracker/projects/:projectId`,element:(0,X.jsx)(gx,{})},{path:`sites/:siteId`,element:(0,X.jsx)(vx,{})},{path:`topical_map/:id`,element:(0,X.jsx)(()=>{var e;let{id:t}=f(),{search:n,hash:r}=S(),{data:i,loading:o}=We({variables:{id:t??``},skip:!t}),s=i==null||(e=i.topicalMap.workspace)==null?void 0:e.id,c=No(s??``);return o?(0,X.jsx)(C,{}):s?(0,X.jsx)(a,{to:`${c}/topic_research/${t}${n}${r}`,replace:!0}):(0,X.jsx)(a,{to:`/not_found`,replace:!0})},{})},{path:`keyword_research/queries/:id`,element:(0,X.jsx)(hx,{})},{path:`audits/folder/:folderId`,element:(0,X.jsx)(yx,{app:`audits`})},{path:`queries/folder/:folderId`,element:(0,X.jsx)(yx,{app:`queries`})},{path:`drafts/folder/:folderId`,element:(0,X.jsx)(yx,{app:`drafts`})},{path:`queries/:queryId`,element:(0,X.jsx)(_x,{})},{path:`audits/:id`,element:(0,X.jsx)(px,{})}],xx=({children:e})=>{let t=wn(),n=hn();return t?e:(ae(`Incorrect workspace opened`,{error:`Incorrect workspace opened`,extra:{context:`WorkspaceGuard`,organizationId:n,currentUrl:window.location.href}}),(0,X.jsx)(`div`,{className:`h-screen bg-gray-160 p-sm`,children:(0,X.jsx)(`div`,{className:`flex h-full flex-col rounded-xl bg-white-base p-base pt-0`,children:(0,X.jsx)(jp,{})})}))},Sx=(0,Y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,X.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,X.jsx)(`title`,{id:t,children:e}):null,(0,X.jsx)(`path`,{d:`M2.68675 15.6451L4.59494 14.5435C4.6983 14.4839 4.8196 14.4631 4.9369 14.4851L8.6914 15.1878C8.99995 15.2455 9.28478 15.008 9.28338 14.6941L9.26876 11.4045C9.26836 11.3151 9.29193 11.2272 9.33701 11.15L11.2317 7.90621C11.3303 7.73739 11.3215 7.52658 11.2091 7.3666L8.01892 2.82568M19.0002 4.85905C13.5002 7.50004 16.5 11 17.5002 11.5C19.3773 12.4384 21.9876 12.5 21.9876 12.5C21.9958 12.3344 22 12.1677 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C12.1677 22 12.3344 21.9959 12.5 21.9877M16.7578 21.9398L13.591 13.591L21.9398 16.7578L18.2376 18.2376L16.7578 21.9398Z`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})]})),Cx=()=>(0,X.jsx)(`div`,{className:`flex h-full flex-1 grow`,children:(0,X.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-base text-center text-black`,children:[(0,X.jsx)(t,{Component:Sx,className:`size-3xl rounded-full bg-gray-10 p-sm text-gray-60`}),(0,X.jsx)(`div`,{className:`text-2xl font-semibold leading-none text-black`,children:w._(`This workspace is not set up`,null,{hk:`31BIkI`,project:`workspaces`})}),(0,X.jsx)(`div`,{className:`text-lg`,children:w._(`The owner or admin of this organization needs {=m1} to set up this workspace first.`,[w._implicitParam(`=m1`,(0,X.jsx)(`br`,{}))],{hk:`42dNhZ`,project:`workspaces`})})]})}),wx=[{path:`setup`,element:(0,X.jsx)(()=>{let{isWorkspaceActive:e,isWorkspaceProcessing:t,isWorkspaceReadyForActivation:r,isWorkspaceDisabled:i}
695=q(),a=K(),{haveAccessToCreateWorkspace:o,availableWorkspaceSlots:s}=go();return i&&!s?(0,X.jsx)(J,{to:`/reactivate`,replace:!0}):!a&&!e?(0,X.jsx)(Cx,{}):o||t||r?(0,X.jsx)(n,{}):(0,X.jsx)(J,{to:`/`,replace:!0})},{}),children:[{element:(0,X.jsx)(Qc,{}),children:[{index:!0,lazy:{element:async()=>{let{SetupWorkspacePage:e}=await i(async()=>{let{SetupWorkspacePage:e}=await import(`./C5f4_Yrs.js`);return{SetupWorkspacePage:e}},[]);return(0,X.jsx)(Za,{children:(0,X.jsx)(e,{})})}}},{path:`brand_kit`,lazy:{element:async()=>{let{SetupBrandKitPage:e}=await i(async()=>{let{SetupBrandKitPage:e}=await import(`./BYmMHIbu.js`);return{SetupBrandKitPage:e}},[]);return(0,X.jsx)(Za,{children:(0,X.jsx)(e,{})})}}},{path:`members`,lazy:{element:async()=>{let{SetupMembersPage:e}=await i(async()=>{let{SetupMembersPage:e}=await import(`./t4I_GVOb.js`);return{SetupMembersPage:e}},[]);return(0,X.jsx)(e,{})}}},{path:`*`,element:(0,X.jsx)(J,{to:`/setup`,replace:!0})}]}]}],Tx=[`/workspace/:workspaceId/onboarding/survey/*`,`/workspace/:workspaceId/survey/*`,`/workspace/:workspaceId/billing/*`,`/workspace/:workspaceId/setup/*`,`/workspace/:workspaceId/expired_plan/*`,`/workspace/:workspaceId/settings/*`,`/workspace/:workspaceId/reactivate`],Ex=()=>{let e=S(),{isWorkspaceProcessing:t,isWorkspaceReadyForActivation:r,isWorkspaceActive:i,isWorkspaceFailed:a,isWorkspaceDisabled:o}=q(),s=!!Sr(Tx,e.pathname);return!s&&o?(0,X.jsx)(J,{to:`/reactivate`,replace:!0}):!s&&(t||r||a)?(0,X.jsx)(J,{to:`/setup/brand_kit`,replace:!0}):!s&&!i?(0,X.jsx)(J,{to:`/setup`,replace:!0}):(0,X.jsx)(n,{})},Dx=({children:e})=>{let t=M();return Le({skip:!t,variables:{organizationId:t}}),e};B` 696 subscription WorkspaceMembersEvents($organizationId: ID!) { 697 workspaceOrganizationEvents(organizationId: $organizationId) { 698 ... on WorkspaceMembersChanged { 699 organization { 700 ...OrganizationWithWorkspaceMembersData 701 } 702 } 703 } 704 } 705 706 fragment OrganizationWithWorkspaceMembersData on Organization { 707 id 708 workspaces { 709 id 710 members { 711 id 712 } 713 } 714 members { 715 id 716 workspaces { 717 id 718 } 719 } 720 } 721`;var Ox=({options:e})=>{var t,n;let r=N(),i=S(),o=d(),s=(t=i.state)==null?void 0:t.fromAuth,c=(n=i.state)==null?void 0:n.fromNotFound,l=(e==null?void 0:e.state)??i.state;if(typeof l==`object`&&l){let e={...l};delete e.fromAuth,delete e.fromNotFound,l=Object.keys(e).length>0?e:void 0}let u=i.pathname.startsWith(`/workspace/`),f=`${i.pathname===`/`||i.pathname===`/workspace`?`/dashboard`:i.pathname}${i.search}${i.hash}`,p=r(f);return(0,Y.useEffect)(()=>{c||s||o===`POP`||u||me(`Workspace Redirect with old path`,{level:`info`,tags:{navigationType:o},extra:{fromPath:f,toPath:p}})},[o,i,p,u,s,f,c]),(0,X.jsx)(a,{to:p,replace:!0,...e,state:l})},kx=()=>(0,X.jsx)(bl,{serverOwnsConsent:u().some(e=>{var t;return(t=e.handle)==null?void 0:t.serverOwnsConsent})}),Ax=()=>{let e=sm();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ot,{children:(0,X.jsx)(dm,{children:(0,X.jsx)($t,{children:(0,X.jsxs)(mr,{children:[(0,X.jsx)($p,{}),(0,X.jsxs)(Wp,{reload:e,children:[(0,X.jsx)(kp,{}),(0,X.jsx)(n,{})]}),(0,X.jsx)(Up,{reload:e})]})})})}),(0,X.jsx)(Zp,{}),(0,X.jsx)(Kp,{filter:pg}),(0,X.jsx)(kx,{})]})},jx=()=>(0,X.jsxs)(it,{required:!0,children:[(0,X.jsx)(Qp,{}),(0,X.jsx)(Xt,{children:(0,X.jsxs)(ua,{queryParams:{version:`2`,app:`main`},children:[(0,X.jsx)(Pp,{}),(0,X.jsx)(fo,{children:(0,X.jsx)(Mx,{})})]})})]}),Mx=()=>{let e=M(),[t,{refetch:r}]=Qe({errorPolicy:`all`,variables:{organizationId:e}}),[i]=Ct({variables:{organizationId:e},errorPolicy:`all`}),[a,{refetch:o}]=Je({variables:{organizationId:e},errorPolicy:`all`}),[s]=On({variables:{organizationId:e},errorPolicy:`all`});return(0,X.jsx)(ga,{children:(0,X.jsx)(xs,{queryRef:t,queryRefetch:r,children:(0,X.jsx)(Ep,{children:(0,X.jsx)(ty,{children:(0,X.jsx)(xr,{queryRef:s,children:(0,X.jsx)(Zc,{children:(0,X.jsx)(cu,{children:(0,X.jsx)(fs,{children:(0,X.jsx)(ys,{queryRef:i,children:(0,X.jsx)(Do,{children:(0,X.jsx)(xx,{children:(0,X.jsx)(Ib,{children:(0,X.jsx)(zo,{children:(0,X.jsx)(iy,{children:(0,X.jsx)(Dx,{children:(0,X.jsx)(Ic,{children:(0,X.jsx)(js,{children:(0,X.jsx)(tx,{children:(0,X.jsx)(jb,{children:(0,X.jsx)(lc,{children:(0,X.jsx)(Hb,{children:(0,X.jsx)(tl,{children:(0,X.jsx)(My,{children:(0,X.jsx)(ky,{children:(0,X.jsx)(va,{queryRef:a,queryRefetch:o,children:(0,X.jsx)(Hr,{children:(0,X.jsx)(Jc,{children:(0,X.jsx)(Db,{children:(0,X.jsx)(Vc,{children:(0,X.jsx)(io,{children:(0,X.jsx)(Tp,{children:(0,X.jsx)(n,{})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})},Nx=he(ve)([{HydrateFallback:()=>(0,X.jsx)(oe,{id:`hydrate-fallback`}),element:(0,X.jsx)(Ax,{}),ErrorBoundary:Qv,children:[...Dy,...og,{path:`api/v1/docs`,lazy:{Component:async()=>(await i(async()=>{let{Docs:e}=await import(`./BxYidOko.js`);return{Docs:e}},[])).Docs}},{path:`api/v2/docs`,lazy:{Component:async()=>(await i(async()=>{let{Docs:e}=await import(`./BxYidOko.js`);return{Docs:e}},[])).Docs}},{path:`checkout/shared/:secret`,lazy:{Component:async()=>(await i(async()=>{let{SharedCheckoutApp:e}=await import(`./Cfctx2Ha.js`);return{SharedCheckoutApp:e}},[])).SharedCheckoutApp}},{path:`audits/s/*`,lazy:{Component:async()=>(await i(async()=>{let{SharedAuditApp:e}=await import(`./DzMugcF4.js`);return{SharedAuditApp:e}},[])).SharedAuditApp}},{path:`drafts/s/*`,lazy:{Component:async()=>(await i(async()=>{let{SharedDraftEditorApp:e}=await import(`./D4yV3mIz2.js`);return{SharedDraftEditorApp:e}},[])).SharedDraftEditorApp}},{path:Mr,lazy:{Component:async()=>(await i(async()=>{let{DraftsIframeApp:e}=await import(`./BQkq0eiv.js`);return{DraftsIframeApp:e}},__vite__mapDeps([1,2]))).DraftsIframeApp}},{path:`freemium_humanizer`,lazy:{Component:async()=>(await i(async()=>{let{FreemiumHumanizerApp:e}=await import(`./DU-E9_gi.js`).then(e=>e.t);return{FreemiumHumanizerApp:e}},[])).FreemiumHumanizerApp}},{path:`landing_page_writing_tools`,lazy:{Component:async()=>(await i(async()=>{let{LandingPageWritingTools:e}=await import(`./a67y_yGt2.js`);return{LandingPageWritingTools:e}},[])).LandingPageWritingTools}},{path:`freemium_paraphraser`,lazy:{Component:async()=>(await i(async()=>{let{FreemiumParaphraserApp:e}=await import(`./DDHrb7bI.js`).then(e=>e.t);return{FreemiumParaphraserApp:e}},[])).FreemiumParaphraserApp}},{path:`landing_page_humanizer`,lazy:{Component:async()=>(await i(async()=>{let{LandingPageHumanizer:e}=await import(`./e5dK3sXA.js`).then(e=>e.n);return{LandingPageHumanizer:e}},[])).LandingPageHumanizer}},{path:`landing_page_detector`,lazy:{Component:async()=>(await i(async()=>{let{LandingPageDetector:e}=await import(`./BiVd7SHJ.js`).then(e=>e.n);return{LandingPageDetector:e}},[])).LandingPageDetector}},{element:(0,X.jsx)(jx,{}),handle:{serverOwnsConsent:!0},children:[{path:`confirm_account`,element:(0,X.jsx)(Ky,{})},{path:`interaction/:uid`,lazy:{Component:async()=>(await i(async()=>{let{McpConsentPage:e}=await import(`./CQNqAApZ2.js`);return{McpConsentPage:e}},[])).McpConsentPage}},{element:(0,X.jsx)(qy,{}),children:[...bx,{path:`join/:hash`,element:(0,X.jsx)(Xv,{})},{path:`invite/:token`,element:(0,X.jsx)(qv,{})},{path:`google_search_console/auth/redirect`,element:(0,X.jsx)(Mb,{})},{path:`not_found`,element:(0,X.jsx)(jp,{})},{path:`not_completed`,element:(0,X.jsx)($v,{})},{path:`workspace/:workspaceId`,children:[{index:!0,element:(0,X.jsx)(a,{to:`dashboard`,replace:!0})},...Rv,{element:(0,X.jsx)(zv,{children:(0,X.jsx)(cg,{children:(0,X.jsx)(nb,{children:(0,X.jsx)(Ex,{})})})}),children:[...tb,...wx,...ix,{path:`reactivate`,element:(0,X.jsx)(dx,{})},{path:`expired_plan`,element:(0,X.jsx)(xb,{})},{path:`past_due`,element:(0,X.jsx)(Sb,{})},{path:`deprecated_plan`,element:(0,X.jsx)(ob,{})},{element:(0,X.jsx)(fg,{}),children:[...zb,...Lb,...Fb,...Tb,...Ub,...rx,...Nv,...Ob,...Cy,...Ly,{path:`dashboard`,element:(0,X.jsx)(jv,{})},{path:`ai_volatility`,lazy:{Component:async()=>(await i(async()=>{let{AiVolatilityScoreApp:e}=await import(`./M2mnRSj-.js`);return{AiVolatilityScoreApp:e}},[])).AiVolatilityScoreApp}},{path:`content`,lazy:{Component:async()=>(await i(async()=>{let{ContentInventoryApp:e}=await import(`./6i2NsApT2.js`);return{ContentInventoryApp:e}},[])).ContentInventoryApp}},{element:(0,X.jsx)(Qc,{}),children:[{path:`activity_log`,lazy:{Component:async()=>(await i(async()=>{let{ActivityLogApp:e}=await import(`./C0uR4Xhw.js`);return{ActivityLogApp:e}},__vite__mapDeps([0]))).ActivityLogApp}}]},{path:`humanizer`,lazy:{Component:async()=>(await i(async()=>{let{HumanizerApp:e}
721=await import(`./nJ-BmjXI2.js`);return{HumanizerApp:e}},[])).HumanizerApp}},{path:`mcp_api`,lazy:{Component:async()=>(await i(async()=>{let{McpApiApp:e}=await import(`./DYFScYbl2.js`);return{McpApiApp:e}},[])).McpApiApp}}]},{path:`*`,element:(0,X.jsx)(Ox,{})}]}]},{path:`*`,element:(0,X.jsx)(Ox,{})}]}]}]}]),Px=()=>(0,X.jsx)(s,{router:Nx}),Fx=()=>(cl(),(0,X.jsx)(sa,{fallback:ca,onError:e=>{var t;[`dev`,`staging`].includes((t=window.APP_ENV)==null?void 0:t.env)&&console.error(e)},beforeCapture:e=>{let t=document.documentElement;e.setContext(`htmlAttributes`,{htmlLangAttribute:t.getAttribute(`lang`),htmlClassList:t.getAttribute(`class`)})},children:(0,X.jsx)(Ix,{children:(0,X.jsx)(Px,{})})})),Ix=({children:e})=>(0,X.jsx)(Pt,{context:(0,Y.useMemo)(()=>{var e;return{frontend_version:(e=window.APP_ENV)==null?void 0:e.release,build_start_date:{SENTRY_RELEASE:`243f9fad78fd9d2010bdae2232d916ec6408033c`,BUILD_START_DATE:`2026-09-23T14:41:28.007Z`}.BUILD_START_DATE}},[]),children:e});export{Fx as MainApp}; 722//# sourceMappingURL=D3sP-nzf.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.