1import{E as e}from"./BS4iJHfL.js";import{En as t,Ht as n,J as r,fn as i,g as a,gt as o,vn as s,xn as c}from"./C0vO9RK9.js";import{p as l}from"./V-rHKifs.js";import"./CKjpBP6i.js";import{t as u}from"./J13-NuaF.js";import{c as d,n as f,r as p,t as m}from"./DjMDjrz1.js";var h=[...d];function g(e,t){let n=e;if(typeof n.hooks?.callHookWith!=`function`){n.callHook?.(`pro:feature`,t);return}let r=typeof n.runWithContext==`function`?n.runWithContext.bind(n):e=>e();n.hooks.callHookWith(e=>{for(let n of e)r(()=>n(t))},`pro:feature`,t)}var _=new WeakMap;function v(e){let t={},n={},r=new Map,a={add(e){if(t[e.id]){console.warn(`[pro:feature] duplicate id "${e.id}" â ignored`);return}e.group&&!h.includes(e.id)&&console.error(`[pro:feature] "${e.id}" has group "${e.group}" but is not in topNavOrder â it will NOT appear in the sidebar. Add "${e.id}" to topNavOrder in layers/pro-features/modules/pro-features.ts.`);let{stateResolver:n,...i}=e;n&&r.set(e.id,n),t[e.id]={...i}},addChrome(e){let t=i(e.component);for(let r of e.forFeatures){if(n[r]){console.warn(`[pro:feature] duplicate chrome for "${r}", ignored`);continue}n[r]={component:t,replacesBodyFor:[...e.replacesBodyFor??[]]}}}};try{g(e,a)}catch(e){console.warn(`[pro:feature:registry] contributor threw during fan-out`,e)}return{resolved:{features:t,chromeByFeature:n,topNavOrder:h},resolvers:r}}function y(e){let t=_.get(e);return t||(t=v(e),_.set(e,t)),t}function b(){let{resolved:t,resolvers:n}=y(e());return{features:t.features,chromeByFeature:t.chromeByFeature,topNavOrder:t.topNavOrder,getFeature(e){let r=t.features[e];if(!r)return;let i=n.get(e);return i?{...r,stateResolver:i}:r},getChrome(e){return t.chromeByFeature[e]}}}function x(){return u(`pro-gate`,()=>({blocked:!1}))}function S(e,t){return e.blocked?{reason:e.reason,cta:e.cta}:t.status===`locked`?{reason:t.reason,cta:t.cta}:null}function C(e){if(!e)return!1;if(!e.hidden)return p(e.id)===`private-preview`;try{return e.hidden()}catch(e){return console.error("[pro:feature] `hidden` predicate threw â concealing the feature",e),!0}}function w(e,t){let{getFeature:r}=b(),i=typeof e==`string`?s(e):e,o=a(()=>r(i.value)?.stateResolver),l=c(null);return n(o,e=>{l.value=e?e(t):null},{immediate:!0}),a(()=>l.value?.value??{status:`ready`})}var T=280;function E(){let e=u(`pro:chat-panel:open`,()=>!1),t=u(`pro:chat-panel:prefill`,()=>``),n=u(`pro:chat-panel:context-id`,()=>null),r=u(`pro:chat-panel:nonce`,()=>0);function i(i,a={}){let o=(i??``).slice(0,T);if(t.value=o,a.contextId!==void 0)n.value=a.contextId;else try{n.value=new URL(window.location.href).pathname||null}catch{n.value=null}r.value++,e.value=!0}function a(){e.value=!1}return{isOpen:e,prefill:t,contextId:n,nonce:r,open:i,close:a}}var D=Symbol(`pro-feature-content-enabled`);function O(e){o(D,e)}function k(){return r(D,a(()=>!0))}function A(e){return e.requested?!e.annotated||!e.resolverAvailable||!e.discover||!e.retained?{requested:!0,status:`pending`,active:!1,allowLiveQueries:!1}:!e.discover.discoverable&&e.retained.kind===`retained`?{requested:!0,status:`retained`,active:!0,allowLiveQueries:!1}:e.discover.discoverable?{requested:!0,status:`live`,active:!1,allowLiveQueries:!0}:{requested:!0,status:`unavailable`,active:!1,allowLiveQueries:!1}:{requested:!1,status:`not_requested`,active:!1,allowLiveQueries:!0}}function j(e){let n=l(),{getFeature:i}=b(),o=r(`proSiteMonitoringDecision`,null),s=a(()=>{let r=n.query.retained===`1`,a=t(e),s=i(a)?.monitoring,c=s&&o?o(a,s,`discover`):null,l=s&&o?o(a,s,`read_retained`):null;return A({requested:r,annotated:!!s,resolverAvailable:!!o,discover:c,retained:l})});return{policy:s,requested:a(()=>s.value.requested),pending:a(()=>s.value.status===`pending`),active:a(()=>s.value.active),allowLiveQueries:a(()=>s.value.allowLiveQueries)}}function M(e){let{getChrome:t}=b();return t(e)}var N=/:id\(\)|\[id\]|:siteId\(\)|\[siteId\]/g;function P(e){return`/pro/dashboard/sites/${e}`}function F(e,t){return(e.route??`/pro/dashboard/sites/:id()/${e.id}`).replace(N,()=>t)}function I(e,t,n){let r=F(e,t);return n?n.discoverable?{available:!0,to:r,basis:`monitoring`}:{available:!1,featureTo:r,fallbackTo:P(t),decision:n,reason:n.reason}:{available:!0,to:r,basis:`compatibility`}}function L(e,t){let n={available:[],unavailable:[]};for(let r of e){let e=t.decisionFor?.(r,r.monitoring),i=I(r,t.siteId,e);i.available?n.available.push({feature:r,navigation:i}):n.unavailable.push({feature:r,navigation:i})}return n}var R=[{id:`worklist`,label:`Worklist`,pinned:!0},{id:`tools`,label:`Tools`,pinned:!0},{id:`traffic`,label:`Traffic`},{id:`technical`,label:`Technical SEO`},{id:`research`,label:`Research`},{id:`offsite`,label:`Off-site`},{id:`footer`,label:`Settings`,footer:!0}],z=new Set([`link-report`,`search-console`,`database`]);function B(e,n={}){let{features:r,topNavOrder:i}=b(),o=a(()=>{let n=`/pro/dashboard/sites/${t(e)}`;return{id:`overview`,label:`Overview`,icon:`i-lucide-app-window`,to:n,active:e=>e===n}}),s=a(()=>{let a=new Map,o=t(e);if(!o)return{linksByGroup:a,unavailableFeatures:[]};let s=[];for(let e of i){let t=r[e];t?.group&&(C(t)||s.push(t))}let c=L(s,{siteId:o,decisionFor:(e,t)=>
1n.monitoringDecision?.(e.id,t)});for(let{feature:e,navigation:t}of c.available){let r=t.to,i=e.group;if(!i)continue;let o=e.requires===`crawl`?`crawl-ready`:e.requiresIntegration,s=o?n.pending?.(o):null,c={id:e.id,label:e.label,icon:e.icon,to:r,active:e=>e===r||e.startsWith(`${r}/`),stability:e.stability??null,pending:!!s,pendingTooltip:s?s.tooltip:void 0,...z.has(e.id)?{prefetch:!1}:{}},l=a.get(i);l?l.push(c):a.set(i,[c])}return{linksByGroup:a,unavailableFeatures:c.unavailable.map(({feature:e,navigation:t})=>({id:e.id,label:e.label,featureTo:t.featureTo,fallbackTo:t.fallbackTo,decision:t.decision,reason:t.reason}))}}),c=a(()=>s.value.linksByGroup),l=a(()=>s.value.unavailableFeatures);return{pinnedLinks:a(()=>{if(!t(e))return[];let r=n.overviewLink===!1?[]:[o.value];for(let e of R)e.pinned&&r.push(...c.value.get(e.id)??[]);return r}),sections:a(()=>R.filter(e=>!e.pinned&&!e.footer).map(e=>({...e,links:c.value.get(e.id)??[]})).filter(e=>e.links.length>0)),footerLinks:a(()=>{let n=t(e);if(!n)return[];let r=[];for(let e of R)e.footer&&r.push(...c.value.get(e.id)??[]);let i=`${`/pro/dashboard/sites/${n}`}/settings`;return r.push({id:`settings`,label:`Site Settings`,icon:`i-lucide-settings`,to:i,active:e=>e===i}),r}),unavailableFeatures:l}}function V(e,t={}){let n=t.operation??`discover`,i=r(`proSiteMonitoringDecision`,null),o=t.resolver??i,s=a(()=>{let t=f(e);return!t||!o?null:o(e,t,n)});return{decision:s,available:a(()=>s.value?.kind===`available`)}}function H(e){if(typeof e!=`function`)throw TypeError(`proFeatureSetup() takes a thunk: proFeatureSetup(() => ({ features: [...] })). A plain object is built at module scope, which runs gate factories before a Nuxt instance exists.`);return t=>{let n=e(),r=t.hook;r(`pro:feature`,e=>{for(let t of n.features){let{id:n,...r}=t;e.add({...m(n),...r})}for(let t of n.chrome??[])e.addChrome({...t,forFeatures:[...t.forFeatures]})})}}function U(){let e=u(`pro:header-menu`,()=>[]);function t(t){e.value=t}function n(){e.value=[]}return{groups:e,setHeaderMenu:t,clearHeaderMenu:n}}export{R as a,j as c,E as d,w as f,b as g,x as h,B as i,O as l,S as m,H as n,F as o,C as p,V as r,M as s,U as t,k as u};
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.