@ainyc/canonry 4.111.0 → 4.112.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/assets/assets/{BacklinksPage-Ccp5dJm2.js → BacklinksPage-B8Vtj78r.js} +1 -1
  2. package/assets/assets/{ChartPrimitives-DZI_FVyX.js → ChartPrimitives-DlR18JC8.js} +1 -1
  3. package/assets/assets/ProjectPage-YPn3c4hw.js +7 -0
  4. package/assets/assets/{RunRow-CPf7aV1o.js → RunRow-CSbZ7ZRo.js} +1 -1
  5. package/assets/assets/{RunsPage-CI8AcUal.js → RunsPage-CSo26DbG.js} +1 -1
  6. package/assets/assets/{SettingsPage-QI2X5EIb.js → SettingsPage-Dxdr95It.js} +1 -1
  7. package/assets/assets/{TrafficPage-CcELR6n1.js → TrafficPage-CbHemY4N.js} +1 -1
  8. package/assets/assets/{TrafficSourceDetailPage-C-9rc4ly.js → TrafficSourceDetailPage-BxMqtq8o.js} +1 -1
  9. package/assets/assets/{arrow-left-3WT6TImA.js → arrow-left-DXeXxwzj.js} +1 -1
  10. package/assets/assets/{extract-error-message-43ehRbIG.js → extract-error-message-nw2axb0s.js} +1 -1
  11. package/assets/assets/index-BERU9Kvl.css +1 -0
  12. package/assets/assets/{index-BpnaXO_X.js → index-Cg-EISGh.js} +2 -2
  13. package/assets/assets/{trash-2-Dk-RvBpF.js → trash-2-DhPiFFSU.js} +1 -1
  14. package/assets/index.html +2 -2
  15. package/dist/{chunk-Y26GYDS6.js → chunk-6M2ALGJA.js} +1 -1
  16. package/dist/{chunk-4TQOZJPF.js → chunk-KS2M7B5E.js} +8 -4
  17. package/dist/{chunk-CVXBE3ST.js → chunk-UOMNYP5T.js} +46 -6
  18. package/dist/{chunk-ZT7GVLS3.js → chunk-VICGMHY2.js} +1 -0
  19. package/dist/cli.js +6 -6
  20. package/dist/index.js +4 -4
  21. package/dist/{intelligence-service-4MQUT3OO.js → intelligence-service-RGOY43QR.js} +2 -2
  22. package/dist/mcp.js +2 -2
  23. package/package.json +8 -8
  24. package/assets/assets/ProjectPage-feeXXGgl.js +0 -7
  25. package/assets/assets/index-JD5rv_sY.css +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-feeXXGgl.js","./vendor-tanstack-Be8JdV5M.js","./RunRow-CPf7aV1o.js","./ChartPrimitives-DZI_FVyX.js","./extract-error-message-43ehRbIG.js","./vendor-recharts-C9EZkgbP.js","./trash-2-Dk-RvBpF.js","./vendor-radix-CQ77EO2y.js","./vendor-markdown-6dwjPOKK.js","./RunsPage-CI8AcUal.js","./SettingsPage-QI2X5EIb.js","./BacklinksPage-Ccp5dJm2.js","./TrafficPage-CcELR6n1.js","./arrow-left-3WT6TImA.js","./TrafficSourceDetailPage-C-9rc4ly.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-YPn3c4hw.js","./vendor-tanstack-Be8JdV5M.js","./RunRow-CSbZ7ZRo.js","./ChartPrimitives-DlR18JC8.js","./extract-error-message-nw2axb0s.js","./vendor-recharts-C9EZkgbP.js","./trash-2-DhPiFFSU.js","./vendor-radix-CQ77EO2y.js","./vendor-markdown-6dwjPOKK.js","./RunsPage-CSo26DbG.js","./SettingsPage-Dxdr95It.js","./BacklinksPage-B8Vtj78r.js","./TrafficPage-CbHemY4N.js","./arrow-left-DXeXxwzj.js","./TrafficSourceDetailPage-BxMqtq8o.js"])))=>i.map(i=>d[i]);
2
2
  import{c as Nw,d as kw,Q as Aw,M as _w,r as q,q as Te,j as f,L as st,a as Cw,e as ks,u as fn,f as Tw,h as fc,k as Ew,l as zw,m as dv,O as xf,n as Wa,o as Ti,p as Ow,s as Et,t as Hf,v as Ps,x as Dw,y as Rw,z as Mw}from"./vendor-tanstack-Be8JdV5M.js";import{S as Bw,O as Qf,P as fv,C as Kf,a as pv,T as Zf,D as mv,R as hv}from"./vendor-radix-CQ77EO2y.js";import{c as gv}from"./vendor-recharts-C9EZkgbP.js";import{M as Lw}from"./vendor-markdown-6dwjPOKK.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var tf={exports:{}},Kr={},nf={exports:{}},af={};var Uy;function qw(){return Uy||(Uy=1,(function(e){function n($,W){var fe=$.length;$.push(W);e:for(;0<fe;){var je=fe-1>>>1,se=$[je];if(0<l(se,W))$[je]=W,$[fe]=se,fe=je;else break e}}function i($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var W=$[0],fe=$.pop();if(fe!==W){$[0]=fe;e:for(var je=0,se=$.length,Ye=se>>>1;je<Ye;){var J=2*(je+1)-1,ue=$[J],ee=J+1,de=$[ee];if(0>l(ue,fe))ee<se&&0>l(de,ue)?($[je]=de,$[ee]=fe,je=ee):($[je]=ue,$[J]=fe,je=J);else if(ee<se&&0>l(de,fe))$[je]=de,$[ee]=fe,je=ee;else break e}}return W}function l($,W){var fe=$.sortIndex-W.sortIndex;return fe!==0?fe:$.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();e.unstable_now=function(){return d.now()-h}}var g=[],v=[],S=1,x=null,N=3,_=!1,T=!1,k=!1,z=!1,R=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function Z($){for(var W=i(v);W!==null;){if(W.callback===null)r(v);else if(W.startTime<=$)r(v),W.sortIndex=W.expirationTime,n(g,W);else break;W=i(v)}}function X($){if(k=!1,Z($),!T)if(i(g)!==null)T=!0,F||(F=!0,Se());else{var W=i(v);W!==null&&pe(X,W.startTime-$)}}var F=!1,O=-1,M=5,oe=-1;function ke(){return z?!0:!(e.unstable_now()-oe<M)}function Oe(){if(z=!1,F){var $=e.unstable_now();oe=$;var W=!0;try{e:{T=!1,k&&(k=!1,I(O),O=-1),_=!0;var fe=N;try{t:{for(Z($),x=i(g);x!==null&&!(x.expirationTime>$&&ke());){var je=x.callback;if(typeof je=="function"){x.callback=null,N=x.priorityLevel;var se=je(x.expirationTime<=$);if($=e.unstable_now(),typeof se=="function"){x.callback=se,Z($),W=!0;break t}x===i(g)&&r(g),Z($)}else r(g);x=i(g)}if(x!==null)W=!0;else{var Ye=i(v);Ye!==null&&pe(X,Ye.startTime-$),W=!1}}break e}finally{x=null,N=fe,_=!1}W=void 0}}finally{W?Se():F=!1}}}var Se;if(typeof P=="function")Se=function(){P(Oe)};else if(typeof MessageChannel<"u"){var He=new MessageChannel,le=He.port2;He.port1.onmessage=Oe,Se=function(){le.postMessage(null)}}else Se=function(){R(Oe,0)};function pe($,W){O=R(function(){$(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return N},e.unstable_next=function($){switch(N){case 1:case 2:case 3:var W=3;break;default:W=N}var fe=N;N=W;try{return $()}finally{N=fe}},e.unstable_requestPaint=function(){z=!0},e.unstable_runWithPriority=function($,W){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var fe=N;N=$;try{return W()}finally{N=fe}},e.unstable_scheduleCallback=function($,W,fe){var je=e.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?je+fe:je):fe=je,$){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=fe+se,$={id:S++,callback:W,priorityLevel:$,startTime:fe,expirationTime:se,sortIndex:-1},fe>je?($.sortIndex=fe,n(v,$),i(g)===null&&$===i(v)&&(k?(I(O),O=-1):k=!0,pe(X,fe-je))):($.sortIndex=se,n(g,$),T||_||(T=!0,F||(F=!0,Se()))),$},e.unstable_shouldYield=ke,e.unstable_wrapCallback=function($){var W=N;return function(){var fe=N;N=W;try{return $.apply(this,arguments)}finally{N=fe}}}})(af)),af}var $y;function Uw(){return $y||($y=1,nf.exports=qw()),nf.exports}var Vy;function $w(){if(Vy)return Kr;Vy=1;var e=Uw(),n=Nw(),i=kw();function r(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var a=t,s=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(s=a.return),t=a.return;while(t)}return a.tag===3?s:null}function d(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function h(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function v(t){var a=t.alternate;if(!a){if(a=c(t),a===null)throw Error(r(188));return a!==t?null:t}for(var s=t,o=a;;){var u=s.return;if(u===null)break;var m=u.alternate;if(m===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===m.child){for(m=u.child;m;){if(m===s)return g(u),t;if(m===o)return g(u),a;m=m.sibling}throw Error(r(188))}if(s.return!==o.return)s=u,o=m;else{for(var b=!1,j=u.child;j;){if(j===s){b=!0,s=u,o=m;break}if(j===o){b=!0,o=u,s=m;break}j=j.sibling}if(!b){for(j=m.child;j;){if(j===s){b=!0,s=m,o=u;break}if(j===o){b=!0,o=m,s=u;break}j=j.sibling}if(!b)throw Error(r(189))}}if(s.alternate!==o)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:a}function S(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=S(t),a!==null)return a;t=t.sibling}return null}var x=Object.assign,N=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),P=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),ke=Symbol.for("react.memo_cache_sentinel"),Oe=Symbol.iterator;function Se(t){return t===null||typeof t!="object"?null:(t=Oe&&t[Oe]||t["@@iterator"],typeof t=="function"?t:null)}var He=Symbol.for("react.client.reference");function le(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===He?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case R:return"Profiler";case z:return"StrictMode";case X:return"Suspense";case F:return"SuspenseList";case oe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case P:return t.displayName||"Context";case I:return(t._context.displayName||"Context")+".Consumer";case Z:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return a=t.displayName||null,a!==null?a:le(t.type)||"Memo";case M:a=t._payload,t=t._init;try{return le(t(a))}catch{}}return null}var pe=Array.isArray,$=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},je=[],se=-1;function Ye(t){return{current:t}}function J(t){0>se||(t.current=je[se],je[se]=null,se--)}function ue(t,a){se++,je[se]=t.current,t.current=a}var ee=Ye(null),de=Ye(null),ae=Ye(null),Ne=Ye(null);function tt(t,a){switch(ue(ae,a),ue(de,t),ue(ee,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?ly(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=ly(a),t=cy(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}J(ee),ue(ee,t)}function xe(){J(ee),J(de),J(ae)}function $e(t){t.memoizedState!==null&&ue(Ne,t);var a=ee.current,s=cy(a,t.type);a!==s&&(ue(de,t),ue(ee,s))}function Qe(t){de.current===t&&(J(ee),J(de)),Ne.current===t&&(J(Ne),Pr._currentValue=fe)}var Dt,Un;function Rt(t){if(Dt===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Dt=a&&a[1]||"",Un=-1<s.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+Dt+t+Un}var er=!1;function Ri(t,a){if(!t||er)return"";er=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(a){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(V){var U=V}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(V){U=V}t.call(Y.prototype)}}else{try{throw Error()}catch(V){U=V}(Y=t())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(V){if(V&&U&&typeof V.stack=="string")return[V.stack,U.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=o.DetermineComponentFrameRoot(),b=m[0],j=m[1];if(b&&j){var C=b.split(`
@@ -207,4 +207,4 @@ spec:
207
207
  `);$(ot)}}catch(ie){Qe(ie instanceof Error?ie.message:"Failed to generate queries")}finally{xe(!1)}}},Ui=async()=>{if(!oe)return;const ie=_t;if(ie.length!==0){Mi(!0),go(null);try{await Ak(oe,ie),er(!0),await r(),N(4)}catch(ot){go(ot instanceof Error?ot.message:"Failed to save competitors")}finally{Mi(!1)}}},$i=async()=>{const ie=va.trim();if(ie){wo(!0),Sa(null);try{await Ek("gemini",{apiKey:ie}),tn({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),xo(""),await r()}catch(ot){Sa(ot instanceof Error?ot.message:"Failed to save Gemini key")}finally{wo(!1)}}},Zn=async()=>{if(oe){bo(!0);try{const ie=await vo.mutateAsync({projectName:oe,projectLabel:k||_||oe,sourceAction:"setup-launch"});Uc(ie.id),nr(!0),await r()}catch{}finally{bo(!1)}}},pn=()=>N(ie=>Math.max(0,ie-1)),ai=(()=>{switch(x){case 0:return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsx("div",{className:"section-head",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),f.jsx("h2",{children:"System ready"})]})}),f.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),f.jsx("div",{className:"compact-stack",children:v.healthChecks.map(ie=>f.jsxs("div",{className:"health-check-row",children:[f.jsxs("div",{children:[f.jsx("p",{className:"run-row-title",children:ie.label}),f.jsx("p",{className:"supporting-copy",children:ie.detail}),ie.id==="provider"&&ie.state!=="ready"&&f.jsxs("div",{className:"mt-3 rounded-md border border-zinc-800/60 bg-zinc-900/40 p-3 space-y-2",children:[f.jsxs("p",{className:"text-xs text-zinc-400",children:["Paste a Gemini key to enable visibility checks (free at"," ",f.jsx("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noreferrer",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"aistudio.google.com"}),")."]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{type:"password",value:va,onChange:ot=>xo(ot.target.value),placeholder:"AI... (paste here)",className:"flex-1 rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-sm text-zinc-100 placeholder:text-zinc-600 focus:border-zinc-600 focus:outline-none font-mono",disabled:Li}),f.jsx(Ue,{type:"button",size:"sm",disabled:Li||!va.trim(),onClick:Nn($i),children:Li?"Saving...":"Save"})]}),jo&&f.jsx("p",{className:"text-xs text-rose-400",children:jo}),f.jsxs("p",{className:"text-[11px] text-zinc-600",children:["Other providers (OpenAI, Claude, Perplexity) configurable later via"," ",f.jsx(st,{to:"/settings",className:"text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"/settings"}),"."]})]})]}),f.jsx(Bn,{tone:ie.state==="ready"?"positive":"caution",title:ie.id==="api"?$s(g.apiStatus):ie.id==="worker"?$s(g.workerStatus):ie.detail,children:ie.state==="ready"?"Ready":"Attention"})]},ie.id))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",disabled:!$c,onClick:()=>N(1),children:"Continue"})]})]});case 1:return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),f.jsx("h2",{children:"Create project"})]}),oe?f.jsx(Bn,{tone:"positive",children:"Created"}):null]}),oe?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Project ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe})," created successfully."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>N(2),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),f.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:_,onChange:ie=>T(ie.target.value)}),ht&&ht!==_?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",ht]}):null]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),f.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:k,onChange:ie=>z(ie.target.value)})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),f.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:R,onChange:ie=>I(ie.target.value)})]}),f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),f.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:P,onChange:ie=>Z(ie.target.value.toUpperCase())})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),f.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:X,onChange:ie=>F(ie.target.value.toLowerCase())})]})]}),f.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 cursor-pointer hover:border-zinc-700",children:[f.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:O,onChange:ie=>M(ie.target.checked)}),f.jsxs("span",{className:"flex-1",children:[f.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),f.jsxs("span",{className:"block text-xs text-zinc-500 mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",f.jsx(st,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),Oe?f.jsx("p",{className:"text-rose-400 text-sm",children:Oe}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:!ht||!R||He,onClick:Nn(Vc),children:He?"Creating...":"Create project"})]})]})]});case 2:return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),f.jsx("h2",{children:"Add queries"})]}),W?f.jsxs(Bn,{tone:"positive",children:[Mt.length," saved"]}):f.jsxs(Bn,{tone:"neutral",children:[Mt.length," quer",Mt.length!==1?"ies":"y"]})]}),f.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),W?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:Mt.map(ie=>f.jsx("li",{children:ie},ie))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>N(3),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[ue.length>0?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"flex items-end gap-2",children:[f.jsxs("div",{className:"setup-field flex-1",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),f.jsx("select",{id:"gen-provider",className:"setup-input",value:ee,onChange:ie=>de(ie.target.value),children:ue.map(ie=>f.jsxs("option",{value:ie.name,children:[ie.displayName??ie.name,ie.model?` (${ie.model})`:""]},ie.name))})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),f.jsx("select",{id:"gen-count",className:"setup-input",value:ae,onChange:ie=>Ne(Number(ie.target.value)),children:[3,5,10,15,20].map(ie=>f.jsx("option",{value:ie,children:ie},ie))})]}),f.jsx(Ue,{type:"button",variant:"outline",disabled:tt||!ee,onClick:Nn(qi),children:tt?"Analyzing site...":"Generate"})]}),$e?f.jsx("p",{className:"text-rose-400 text-sm",children:$e}):null]}):null,f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),f.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
208
208
  best invisalign downtown brooklyn
209
209
  pediatric dentist brooklyn heights`,value:pe,onChange:ie=>$(ie.target.value)})]}),je?f.jsx("p",{className:"text-rose-400 text-sm",children:je}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:Mt.length===0||Ye,onClick:Nn(Ic),children:Ye?"Saving...":`Save ${Mt.length} quer${Mt.length!==1?"ies":"y"}`})]})]})]});case 3:return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),f.jsx("h2",{children:"Add competitors"})]}),Rt?f.jsx(Bn,{tone:"positive",children:"Saved"}):null]}),f.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Rt?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:_t.map(ie=>f.jsx("li",{children:ie},ie))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>N(4),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),f.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
210
- competitor2.com`,value:Dt,onChange:ie=>Un(ie.target.value)})]}),Ri?f.jsx("p",{className:"text-rose-400 text-sm",children:Ri}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>N(4),children:"Skip"}),f.jsx(Ue,{type:"button",disabled:_t.length===0||tr,onClick:Nn(Ui),children:tr?"Saving...":`Save ${_t.length} competitor${_t.length!==1?"s":""}`})]})]})]})]});case 4:{const ie=So.data,ot=ie?.status==="completed"||ie?.status==="partial"||ie?.status==="failed"||ie?.status==="cancelled",Yn=ie?.snapshots??[],ii=Yn.filter($n=>$n.citationState==="cited").length,Pc=Yn.filter($n=>$n.answerMentioned===!0).length,ar=new Set(Yn.map($n=>$n.query).filter($n=>!!$n)).size,No=Bi?ot&&(ie?.status==="completed"||ie?.status==="partial")?f.jsx(Bn,{tone:"positive",children:"Complete"}):ot?f.jsx(Bn,{tone:"negative",children:"Failed"}):f.jsx(Bn,{tone:"caution",children:"Running"}):null;return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),f.jsx("h2",{children:"Launch first run"})]}),No]}),Bi?ot?ie?.status==="failed"?f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-rose-400",children:"Sweep failed. Inspect the run on the project page for the provider error and retry from there."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Open project"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Sweep complete. Your first answer-visibility snapshot for"," ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),":"]}),f.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Mentioned"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[Pc,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ar]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with brand in answer"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Cited"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[ii,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ar]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with domain in sources"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Snapshots"}),f.jsx("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:Yn.length}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"total (query × provider)"})]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-1",children:"Full evidence, per-provider breakdown, and suggested next queries on the project dashboard."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Open project dashboard →"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-zinc-300",children:"Sweep running — typically 30-60s. Polling every 2s…"}),f.jsx("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 text-xs text-zinc-500",children:f.jsxs("p",{children:["Status: ",f.jsx("span",{className:"text-zinc-300",children:ie?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Watch on project page"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),"."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:yo,onClick:Nn(Zn),children:yo?"Launching...":"Launch visibility sweep"})]})]})]})}default:return null}})();return f.jsxs("div",{className:"page-container",children:[f.jsx("div",{className:"page-header",children:f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Setup"}),f.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),f.jsx($B,{current:x,labels:UB}),f.jsx("section",{className:"setup-wizard",children:ai})]})}function IB(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(kn,{className:"surface-card empty-card",children:[f.jsx("h1",{children:"Route not found"}),f.jsx("p",{children:"The current path does not map to a dashboard view."}),f.jsx(Ue,{asChild:!0,children:f.jsx(st,{to:"/",children:"Return to overview"})})]})})})}const ba=Ps(()=>Gs(()=>import("./ProjectPage-feeXXGgl.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),PB=Ps(()=>Gs(()=>import("./RunsPage-CI8AcUal.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),GB=Ps(()=>Gs(()=>import("./SettingsPage-QI2X5EIb.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),HB=Ps(()=>Gs(()=>import("./BacklinksPage-Ccp5dJm2.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),QB=Ps(()=>Gs(()=>import("./TrafficPage-CcELR6n1.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),KB=Ps(()=>Gs(()=>import("./TrafficSourceDetailPage-C-9rc4ly.js"),__vite__mapDeps([14,1,4,3,5,13,7,8]),import.meta.url),"TrafficSourceDetailPage");function ZB(){return f.jsx(vM,{children:f.jsx(bM,{})})}const nn=Ow()({component:ZB,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),YB=Et({getParentRoute:()=>nn,path:"/",component:wM,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(zi({client:te}));if(n&&n.length===0)throw Hf({to:"/setup"})}}),XB=Et({getParentRoute:()=>nn,path:"/projects",component:RB}),JB=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Kn=Et({getParentRoute:()=>nn,path:"/projects/$projectName",component:()=>f.jsx(xf,{}),beforeLoad:async({context:e,params:n,location:i})=>{const r=n.projectName;if(!JB.test(r))return;let l=e.queryClient.getQueryData(zi({client:te}));if(!l)try{l=await e.queryClient.ensureQueryData(wc({client:te}))}catch{return}const c=l.find(d=>d.id===r);if(c)throw Hf({to:i.pathname.replace(`/projects/${r}`,`/projects/${encodeURIComponent(c.name)}`),replace:!0})}}),FB=Et({getParentRoute:()=>Kn,path:"/",component:()=>f.jsx(ba,{tab:"overview"})}),WB=Et({getParentRoute:()=>Kn,path:"/search-console",component:()=>f.jsx(ba,{tab:"search-console"})}),eL=Et({getParentRoute:()=>Kn,path:"/local",component:()=>f.jsx(ba,{tab:"local"})}),tL=Et({getParentRoute:()=>Kn,path:"/discovery",component:()=>f.jsx(ba,{tab:"discovery"})}),nL=Et({getParentRoute:()=>Kn,path:"/report",component:()=>f.jsx(ba,{tab:"report"})}),aL=Et({getParentRoute:()=>Kn,path:"/activity",component:()=>f.jsx(ba,{tab:"activity"})}),iL=Et({getParentRoute:()=>Kn,path:"/backlinks",component:()=>f.jsx(ba,{tab:"backlinks"})}),sL=Et({getParentRoute:()=>Kn,path:"/technical-aeo",component:()=>f.jsx(ba,{tab:"technical-aeo"})}),rL=Et({getParentRoute:()=>Kn,path:"/settings",component:()=>f.jsx(ba,{tab:"settings"})}),oL=Et({getParentRoute:()=>nn,path:"/runs",component:PB}),lL=Et({getParentRoute:()=>nn,path:"/settings",component:GB,beforeLoad:({context:e})=>{}}),cL=Et({getParentRoute:()=>nn,path:"/setup",component:VB,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(zi({client:te}));if(n&&n.length>0)throw Hf({to:"/"})}}),uL=Et({getParentRoute:()=>nn,path:"/backlinks",component:HB}),dL=Et({getParentRoute:()=>nn,path:"/traffic",component:QB}),fL=Et({getParentRoute:()=>nn,path:"/traffic/$projectName/$sourceId",component:KB}),pL=Et({getParentRoute:()=>nn,path:"*",component:IB}),mL=nn.addChildren([YB,XB,Kn.addChildren([FB,WB,eL,tL,nL,aL,iL,sL,rL]),oL,lL,cL,uL,dL,fL,pL]);function hL(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const uv=hL(),gL=uv==="/"?"":uv.replace(/\/$/,"");function yL(e,n){return Dw({routeTree:mL,basepath:gL||"/",context:{queryClient:e},...n?.initialEntries})}const bL=6e4;function vL(){const[e,n]=q.useState(rf()?"ready":"checking"),[i,r]=q.useState(""),[l,c]=q.useState(""),[d,h]=q.useState(null),[g,v]=q.useState(!1),[S,x]=q.useState(!1),N=q.useRef(null),_=q.useRef(null),T=()=>{if(!N.current){const R=Fk();_.current=R,N.current=yL(R)}return{queryClient:_.current,router:N.current}};q.useEffect(()=>{if(rf())return;let R=!1;return Qy().then(I=>{R||(I.authenticated?n("ready"):n(I.setupRequired?"setup":"login"))}).catch(I=>{R||(h(I instanceof Error?I.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),q.useEffect(()=>{if(e!=="ready"||rf())return;const R=setInterval(()=>{Qy().then(I=>{I.authenticated||(x(!0),n(I.setupRequired?"setup":"login"))}).catch(()=>{})},bL);return Hy(()=>{x(!0),n("login")}),()=>{clearInterval(R),Hy(null)}},[e]);const k=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){h("Password must be at least 8 characters");return}if(i!==l){h("Passwords do not match");return}v(!0),h(null);try{if(!(await Ck(i.trim())).authenticated){h("Setup failed");return}r(""),c(""),x(!1),n("ready")}catch(I){h(I instanceof Hn||I instanceof Error?I.message:"Setup failed")}finally{v(!1)}},z=async R=>{if(R.preventDefault(),!!i.trim()){v(!0),h(null);try{if(!(await Tk(i.trim())).authenticated){h("Incorrect password");return}r(""),x(!1),n("ready")}catch(I){h(I instanceof Hn||I instanceof Error?I.message:"Authentication failed")}finally{v(!1)}}};if(e==="ready"){const{queryClient:R,router:I}=T();return f.jsx(Rw,{client:R,children:f.jsx(Mw,{router:I})})}return f.jsx("div",{className:"min-h-screen bg-bg px-4 py-8",children:f.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:f.jsx(kn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Yl,{className:"py-8",children:f.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?f.jsxs(f.Fragment,{children:[f.jsxs(Bf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(Lf,{children:"Create a dashboard password"}),f.jsx(qf,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Yl,{children:f.jsxs("form",{className:"space-y-4",onSubmit:Nn(k),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"At least 8 characters"})]}),f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-secondary",children:"Confirm password"}),f.jsx("input",{className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:l,onChange:R=>c(R.target.value),placeholder:"Re-enter password"})]}),d?f.jsx("p",{className:"text-sm text-negative-400",children:d}):null,f.jsx(Ue,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(Bf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(Lf,{children:"Sign in to Canonry"}),f.jsx(qf,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Yl,{children:[S?f.jsx("p",{className:"mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution",children:"Your session expired — please sign in again."}):null,f.jsxs("form",{className:"space-y-4",onSubmit:Nn(z),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"Dashboard password"})]}),d?f.jsx("p",{className:"text-sm text-negative-400",children:d}):null,f.jsx(Ue,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const f1=document.getElementById("root");if(!f1)throw new Error("Expected #root element for web app bootstrap.");Iw.createRoot(f1).render(f.jsx(q.StrictMode,{children:f.jsx(vL,{})}));export{v6 as $,J5 as A,Ue as B,sc as C,ML as D,a6 as E,s6 as F,R5 as G,r6 as H,Xr as I,HL as J,GL as K,KL as L,tn as M,n5 as N,c6 as O,X3 as P,u6 as Q,YL as R,PD as S,Bn as T,o6 as U,l6 as V,i6 as W,QL as X,XL as Y,d6 as Z,f6 as _,I6 as a,LL as a$,h6 as a0,y6 as a1,g6 as a2,b6 as a3,$k as a4,F0 as a5,Ae as a6,m6 as a7,J4 as a8,_i as a9,FL as aA,zi as aB,WL as aC,wp as aD,U6 as aE,V6 as aF,$6 as aG,JL as aH,mA as aI,Bv as aJ,q4 as aK,$4 as aL,U4 as aM,U5 as aN,E6 as aO,q5 as aP,u5 as aQ,X6 as aR,I5 as aS,$5 as aT,P5 as aU,G5 as aV,L5 as aW,V5 as aX,OL as aY,zL as aZ,EL as a_,p6 as aa,fz as ab,pz as ac,B5 as ad,M5 as ae,E5 as af,x5 as ag,_5 as ah,C5 as ai,Hn as aj,T5 as ak,NL as al,TA as am,Y5 as an,_A as ao,LA as ap,e3 as aq,Wl as ar,O5 as as,z5 as at,Af as au,z6 as av,ZL as aw,B6 as ax,L6 as ay,q6 as az,Wf as b,J3 as b$,e6 as b0,Tb as b1,W5 as b2,qL as b3,UL as b4,F5 as b5,$L as b6,VL as b7,PL as b8,IL as b9,o5 as bA,r5 as bB,N6 as bC,x6 as bD,Z5 as bE,a5 as bF,i5 as bG,s5 as bH,l5 as bI,Ac as bJ,H6 as bK,kp as bL,Ek as bM,BL as bN,e5 as bO,t5 as bP,_p as bQ,c5 as bR,$s as bS,Eb as bT,v5 as bU,w5 as bV,N5 as bW,k5 as bX,S5 as bY,j5 as bZ,A5 as b_,uo as ba,wc as bb,$R as bc,pk as bd,n6 as be,qB as bf,Qt as bg,wk as bh,ZD as bi,DL as bj,_L as bk,CL as bl,RL as bm,G6 as bn,xk as bo,Ak as bp,AL as bq,kL as br,Nk as bs,TL as bt,Y6 as bu,i4 as bv,S6 as bw,w6 as bx,Rk as by,j6 as bz,et as c,gS as c0,nR as c1,yS as c2,bS as c3,jA as c4,b5 as c5,Jy as c6,R6 as c7,H5 as c8,Q5 as c9,xp as ca,t6 as cb,Hs as cc,O6 as cd,M6 as ce,y5 as cf,h5 as cg,g5 as ch,m5 as ci,D6 as cj,$E as d,P6 as e,X5 as f,kn as g,Vb as h,Nn as i,D5 as j,k6 as k,te as l,A6 as m,_6 as n,T6 as o,C6 as p,d5 as q,p5 as r,f5 as s,HD as t,Cp as u,Q6 as v,K6 as w,Z6 as x,Mf as y,K5 as z};
210
+ competitor2.com`,value:Dt,onChange:ie=>Un(ie.target.value)})]}),Ri?f.jsx("p",{className:"text-rose-400 text-sm",children:Ri}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>N(4),children:"Skip"}),f.jsx(Ue,{type:"button",disabled:_t.length===0||tr,onClick:Nn(Ui),children:tr?"Saving...":`Save ${_t.length} competitor${_t.length!==1?"s":""}`})]})]})]})]});case 4:{const ie=So.data,ot=ie?.status==="completed"||ie?.status==="partial"||ie?.status==="failed"||ie?.status==="cancelled",Yn=ie?.snapshots??[],ii=Yn.filter($n=>$n.citationState==="cited").length,Pc=Yn.filter($n=>$n.answerMentioned===!0).length,ar=new Set(Yn.map($n=>$n.query).filter($n=>!!$n)).size,No=Bi?ot&&(ie?.status==="completed"||ie?.status==="partial")?f.jsx(Bn,{tone:"positive",children:"Complete"}):ot?f.jsx(Bn,{tone:"negative",children:"Failed"}):f.jsx(Bn,{tone:"caution",children:"Running"}):null;return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),f.jsx("h2",{children:"Launch first run"})]}),No]}),Bi?ot?ie?.status==="failed"?f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-rose-400",children:"Sweep failed. Inspect the run on the project page for the provider error and retry from there."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Open project"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Sweep complete. Your first answer-visibility snapshot for"," ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),":"]}),f.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Mentioned"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[Pc,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ar]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with brand in answer"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Cited"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[ii,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ar]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with domain in sources"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Snapshots"}),f.jsx("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:Yn.length}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"total (query × provider)"})]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-1",children:"Full evidence, per-provider breakdown, and suggested next queries on the project dashboard."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Open project dashboard →"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-zinc-300",children:"Sweep running — typically 30-60s. Polling every 2s…"}),f.jsx("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 text-xs text-zinc-500",children:f.jsxs("p",{children:["Status: ",f.jsx("span",{className:"text-zinc-300",children:ie?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Watch on project page"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),"."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:yo,onClick:Nn(Zn),children:yo?"Launching...":"Launch visibility sweep"})]})]})]})}default:return null}})();return f.jsxs("div",{className:"page-container",children:[f.jsx("div",{className:"page-header",children:f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Setup"}),f.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),f.jsx($B,{current:x,labels:UB}),f.jsx("section",{className:"setup-wizard",children:ai})]})}function IB(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(kn,{className:"surface-card empty-card",children:[f.jsx("h1",{children:"Route not found"}),f.jsx("p",{children:"The current path does not map to a dashboard view."}),f.jsx(Ue,{asChild:!0,children:f.jsx(st,{to:"/",children:"Return to overview"})})]})})})}const ba=Ps(()=>Gs(()=>import("./ProjectPage-YPn3c4hw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),PB=Ps(()=>Gs(()=>import("./RunsPage-CSo26DbG.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),GB=Ps(()=>Gs(()=>import("./SettingsPage-Dxdr95It.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),HB=Ps(()=>Gs(()=>import("./BacklinksPage-B8Vtj78r.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),QB=Ps(()=>Gs(()=>import("./TrafficPage-CbHemY4N.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),KB=Ps(()=>Gs(()=>import("./TrafficSourceDetailPage-BxMqtq8o.js"),__vite__mapDeps([14,1,4,3,5,13,7,8]),import.meta.url),"TrafficSourceDetailPage");function ZB(){return f.jsx(vM,{children:f.jsx(bM,{})})}const nn=Ow()({component:ZB,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),YB=Et({getParentRoute:()=>nn,path:"/",component:wM,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(zi({client:te}));if(n&&n.length===0)throw Hf({to:"/setup"})}}),XB=Et({getParentRoute:()=>nn,path:"/projects",component:RB}),JB=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Kn=Et({getParentRoute:()=>nn,path:"/projects/$projectName",component:()=>f.jsx(xf,{}),beforeLoad:async({context:e,params:n,location:i})=>{const r=n.projectName;if(!JB.test(r))return;let l=e.queryClient.getQueryData(zi({client:te}));if(!l)try{l=await e.queryClient.ensureQueryData(wc({client:te}))}catch{return}const c=l.find(d=>d.id===r);if(c)throw Hf({to:i.pathname.replace(`/projects/${r}`,`/projects/${encodeURIComponent(c.name)}`),replace:!0})}}),FB=Et({getParentRoute:()=>Kn,path:"/",component:()=>f.jsx(ba,{tab:"overview"})}),WB=Et({getParentRoute:()=>Kn,path:"/search-console",component:()=>f.jsx(ba,{tab:"search-console"})}),eL=Et({getParentRoute:()=>Kn,path:"/local",component:()=>f.jsx(ba,{tab:"local"})}),tL=Et({getParentRoute:()=>Kn,path:"/discovery",component:()=>f.jsx(ba,{tab:"discovery"})}),nL=Et({getParentRoute:()=>Kn,path:"/report",component:()=>f.jsx(ba,{tab:"report"})}),aL=Et({getParentRoute:()=>Kn,path:"/activity",component:()=>f.jsx(ba,{tab:"activity"})}),iL=Et({getParentRoute:()=>Kn,path:"/backlinks",component:()=>f.jsx(ba,{tab:"backlinks"})}),sL=Et({getParentRoute:()=>Kn,path:"/technical-aeo",component:()=>f.jsx(ba,{tab:"technical-aeo"})}),rL=Et({getParentRoute:()=>Kn,path:"/settings",component:()=>f.jsx(ba,{tab:"settings"})}),oL=Et({getParentRoute:()=>nn,path:"/runs",component:PB}),lL=Et({getParentRoute:()=>nn,path:"/settings",component:GB,beforeLoad:({context:e})=>{}}),cL=Et({getParentRoute:()=>nn,path:"/setup",component:VB,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(zi({client:te}));if(n&&n.length>0)throw Hf({to:"/"})}}),uL=Et({getParentRoute:()=>nn,path:"/backlinks",component:HB}),dL=Et({getParentRoute:()=>nn,path:"/traffic",component:QB}),fL=Et({getParentRoute:()=>nn,path:"/traffic/$projectName/$sourceId",component:KB}),pL=Et({getParentRoute:()=>nn,path:"*",component:IB}),mL=nn.addChildren([YB,XB,Kn.addChildren([FB,WB,eL,tL,nL,aL,iL,sL,rL]),oL,lL,cL,uL,dL,fL,pL]);function hL(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const uv=hL(),gL=uv==="/"?"":uv.replace(/\/$/,"");function yL(e,n){return Dw({routeTree:mL,basepath:gL||"/",context:{queryClient:e},...n?.initialEntries})}const bL=6e4;function vL(){const[e,n]=q.useState(rf()?"ready":"checking"),[i,r]=q.useState(""),[l,c]=q.useState(""),[d,h]=q.useState(null),[g,v]=q.useState(!1),[S,x]=q.useState(!1),N=q.useRef(null),_=q.useRef(null),T=()=>{if(!N.current){const R=Fk();_.current=R,N.current=yL(R)}return{queryClient:_.current,router:N.current}};q.useEffect(()=>{if(rf())return;let R=!1;return Qy().then(I=>{R||(I.authenticated?n("ready"):n(I.setupRequired?"setup":"login"))}).catch(I=>{R||(h(I instanceof Error?I.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),q.useEffect(()=>{if(e!=="ready"||rf())return;const R=setInterval(()=>{Qy().then(I=>{I.authenticated||(x(!0),n(I.setupRequired?"setup":"login"))}).catch(()=>{})},bL);return Hy(()=>{x(!0),n("login")}),()=>{clearInterval(R),Hy(null)}},[e]);const k=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){h("Password must be at least 8 characters");return}if(i!==l){h("Passwords do not match");return}v(!0),h(null);try{if(!(await Ck(i.trim())).authenticated){h("Setup failed");return}r(""),c(""),x(!1),n("ready")}catch(I){h(I instanceof Hn||I instanceof Error?I.message:"Setup failed")}finally{v(!1)}},z=async R=>{if(R.preventDefault(),!!i.trim()){v(!0),h(null);try{if(!(await Tk(i.trim())).authenticated){h("Incorrect password");return}r(""),x(!1),n("ready")}catch(I){h(I instanceof Hn||I instanceof Error?I.message:"Authentication failed")}finally{v(!1)}}};if(e==="ready"){const{queryClient:R,router:I}=T();return f.jsx(Rw,{client:R,children:f.jsx(Mw,{router:I})})}return f.jsx("div",{className:"min-h-screen bg-bg px-4 py-8",children:f.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:f.jsx(kn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Yl,{className:"py-8",children:f.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?f.jsxs(f.Fragment,{children:[f.jsxs(Bf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(Lf,{children:"Create a dashboard password"}),f.jsx(qf,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Yl,{children:f.jsxs("form",{className:"space-y-4",onSubmit:Nn(k),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"At least 8 characters"})]}),f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-secondary",children:"Confirm password"}),f.jsx("input",{className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:l,onChange:R=>c(R.target.value),placeholder:"Re-enter password"})]}),d?f.jsx("p",{className:"text-sm text-negative-400",children:d}):null,f.jsx(Ue,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(Bf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(Lf,{children:"Sign in to Canonry"}),f.jsx(qf,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Yl,{children:[S?f.jsx("p",{className:"mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution",children:"Your session expired — please sign in again."}):null,f.jsxs("form",{className:"space-y-4",onSubmit:Nn(z),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"Dashboard password"})]}),d?f.jsx("p",{className:"text-sm text-negative-400",children:d}):null,f.jsx(Ue,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const f1=document.getElementById("root");if(!f1)throw new Error("Expected #root element for web app bootstrap.");Iw.createRoot(f1).render(f.jsx(q.StrictMode,{children:f.jsx(vL,{})}));export{v6 as $,J5 as A,Ue as B,sc as C,ML as D,a6 as E,s6 as F,R5 as G,r6 as H,Xr as I,HL as J,GL as K,KL as L,tn as M,n5 as N,c6 as O,X3 as P,u6 as Q,YL as R,PD as S,Bn as T,o6 as U,l6 as V,i6 as W,QL as X,XL as Y,d6 as Z,f6 as _,I6 as a,LL as a$,h6 as a0,y6 as a1,g6 as a2,b6 as a3,$k as a4,F0 as a5,Ae as a6,m6 as a7,J4 as a8,_i as a9,FL as aA,zi as aB,WL as aC,wp as aD,U6 as aE,V6 as aF,$6 as aG,JL as aH,mA as aI,Bv as aJ,q4 as aK,$4 as aL,U4 as aM,U5 as aN,E6 as aO,q5 as aP,u5 as aQ,X6 as aR,I5 as aS,$5 as aT,P5 as aU,G5 as aV,L5 as aW,V5 as aX,OL as aY,zL as aZ,EL as a_,p6 as aa,fz as ab,pz as ac,B5 as ad,M5 as ae,E5 as af,x5 as ag,_5 as ah,C5 as ai,Hn as aj,T5 as ak,NL as al,TA as am,Y5 as an,_A as ao,LA as ap,e3 as aq,Wl as ar,O5 as as,z5 as at,Af as au,z6 as av,ZL as aw,B6 as ax,L6 as ay,q6 as az,Wf as b,J3 as b$,e6 as b0,Tb as b1,W5 as b2,qL as b3,UL as b4,F5 as b5,$L as b6,VL as b7,PL as b8,IL as b9,o5 as bA,r5 as bB,N6 as bC,x6 as bD,Z5 as bE,a5 as bF,i5 as bG,s5 as bH,l5 as bI,Ac as bJ,H6 as bK,kp as bL,Ek as bM,BL as bN,e5 as bO,t5 as bP,_p as bQ,c5 as bR,$s as bS,Eb as bT,v5 as bU,w5 as bV,N5 as bW,k5 as bX,S5 as bY,j5 as bZ,A5 as b_,uo as ba,wc as bb,$R as bc,pk as bd,n6 as be,qB as bf,Qt as bg,wk as bh,ZD as bi,DL as bj,_L as bk,CL as bl,RL as bm,G6 as bn,xk as bo,Ak as bp,AL as bq,kL as br,Nk as bs,TL as bt,Y6 as bu,i4 as bv,S6 as bw,w6 as bx,Rk as by,j6 as bz,et as c,gS as c0,nR as c1,yS as c2,bS as c3,jA as c4,b5 as c5,Jy as c6,R6 as c7,H5 as c8,Q5 as c9,xp as ca,t6 as cb,Hs as cc,O6 as cd,M6 as ce,y5 as cf,h5 as cg,g5 as ch,m5 as ci,D6 as cj,$E as d,P6 as e,X5 as f,kn as g,Vb as h,Nn as i,D5 as j,k6 as k,te as l,A6 as m,_6 as n,T6 as o,C6 as p,d5 as q,p5 as r,f5 as s,HD as t,Cp as u,Q6 as v,K6 as w,Z6 as x,Mf as y,K5 as z};
@@ -1 +1 @@
1
- import{c}from"./index-BpnaXO_X.js";const a=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],h=c("circle-check",a);const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],n=c("circle-question-mark",e);const o=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],s=c("download",o);const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],r=c("trash-2",t);export{h as C,s as D,r as T,n as a};
1
+ import{c}from"./index-Cg-EISGh.js";const a=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],h=c("circle-check",a);const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],n=c("circle-question-mark",e);const o=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],s=c("download",o);const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],r=c("trash-2",t);export{h as C,s as D,r as T,n as a};
package/assets/index.html CHANGED
@@ -12,12 +12,12 @@
12
12
  <link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
13
13
  <link rel="apple-touch-icon" href="./apple-touch-icon.png" />
14
14
  <title>Canonry</title>
15
- <script type="module" crossorigin src="./assets/index-BpnaXO_X.js"></script>
15
+ <script type="module" crossorigin src="./assets/index-Cg-EISGh.js"></script>
16
16
  <link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-Be8JdV5M.js">
17
17
  <link rel="modulepreload" crossorigin href="./assets/vendor-radix-CQ77EO2y.js">
18
18
  <link rel="modulepreload" crossorigin href="./assets/vendor-recharts-C9EZkgbP.js">
19
19
  <link rel="modulepreload" crossorigin href="./assets/vendor-markdown-6dwjPOKK.js">
20
- <link rel="stylesheet" crossorigin href="./assets/index-JD5rv_sY.css">
20
+ <link rel="stylesheet" crossorigin href="./assets/index-BERU9Kvl.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>
@@ -25,7 +25,7 @@ import {
25
25
  trafficConnectVercelRequestSchema,
26
26
  trafficConnectWordpressRequestSchema,
27
27
  trafficEventKindSchema
28
- } from "./chunk-ZT7GVLS3.js";
28
+ } from "./chunk-VICGMHY2.js";
29
29
 
30
30
  // src/config.ts
31
31
  import fs from "fs";
@@ -10,7 +10,7 @@ import {
10
10
  loadConfig,
11
11
  loadConfigRaw,
12
12
  saveConfigPatch
13
- } from "./chunk-Y26GYDS6.js";
13
+ } from "./chunk-6M2ALGJA.js";
14
14
  import {
15
15
  CC_CACHE_DIR,
16
16
  DUCKDB_SPEC,
@@ -115,7 +115,7 @@ import {
115
115
  siteAuditPages,
116
116
  siteAuditSnapshots,
117
117
  usageCounters
118
- } from "./chunk-CVXBE3ST.js";
118
+ } from "./chunk-UOMNYP5T.js";
119
119
  import {
120
120
  AGENT_MEMORY_VALUE_MAX_BYTES,
121
121
  AGENT_PROVIDER_IDS,
@@ -178,7 +178,7 @@ import {
178
178
  validationError,
179
179
  winnabilityClassLabel,
180
180
  withRetry
181
- } from "./chunk-ZT7GVLS3.js";
181
+ } from "./chunk-VICGMHY2.js";
182
182
 
183
183
  // src/telemetry.ts
184
184
  import crypto from "crypto";
@@ -5643,11 +5643,15 @@ function buildDefaultDeps(registry) {
5643
5643
  return { name, fromAnswer, fromGrounding };
5644
5644
  }));
5645
5645
  const candidates = perProvider.flatMap((r) => [...r.fromAnswer, ...r.fromGrounding]);
5646
+ const candidateProviders = perProvider.flatMap(
5647
+ (r) => [...r.fromAnswer, ...r.fromGrounding].map(() => r.name)
5648
+ );
5646
5649
  const providerCounts = Object.fromEntries(
5647
5650
  perProvider.map((r) => [r.name, r.fromAnswer.length + r.fromGrounding.length])
5648
5651
  );
5649
5652
  return {
5650
5653
  candidates,
5654
+ candidateProviders,
5651
5655
  provider: providerNames.join("+"),
5652
5656
  // Session diagnostics: the raw-candidate splits, persisted on
5653
5657
  // discovery_sessions so seed-quality calibration is measurable.
@@ -6504,7 +6508,7 @@ function readStoredGroundingSources(rawResponse) {
6504
6508
  return result;
6505
6509
  }
6506
6510
  async function backfillInsightsCommand(project, opts) {
6507
- const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-4MQUT3OO.js");
6511
+ const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-RGOY43QR.js");
6508
6512
  const config = loadConfig();
6509
6513
  const db = createClient(config.database);
6510
6514
  migrate(db);
@@ -102,6 +102,7 @@ import {
102
102
  contentTargetDismissalDtoSchema,
103
103
  contentTargetDismissalsResponseDtoSchema,
104
104
  contentTargetsResponseDtoSchema,
105
+ cosineSimilarity,
105
106
  createApiKeyRequestSchema,
106
107
  createdApiKeyDtoSchema,
107
108
  dedupeReportActions,
@@ -270,7 +271,7 @@ import {
270
271
  wordpressSchemaDeployResultDtoSchema,
271
272
  wordpressSchemaStatusResultDtoSchema,
272
273
  wordpressStatusDtoSchema
273
- } from "./chunk-ZT7GVLS3.js";
274
+ } from "./chunk-VICGMHY2.js";
274
275
 
275
276
  // src/intelligence-service.ts
276
277
  import { eq as eq38, desc as desc18, asc as asc6, and as and28, ne as ne5, or as or6, inArray as inArray14, gte as gte7, lte as lte4 } from "drizzle-orm";
@@ -34278,14 +34279,41 @@ async function classifyCompetitorDomains(deps, project, icpDescription, domains)
34278
34279
  return {};
34279
34280
  }
34280
34281
  }
34281
- async function pickCanonicalsWithStats(candidates, deps, dedupThreshold) {
34282
+ async function pickCanonicalsWithStats(candidates, deps, dedupThreshold, primaryMask) {
34282
34283
  const emptyStats = { perClusterMinSimilarity: [], bandPairFraction: null, pairsTotal: 0 };
34283
34284
  if (candidates.length === 0) return { canonicals: [], stats: emptyStats };
34284
34285
  if (candidates.length === 1) return { canonicals: candidates, stats: emptyStats };
34285
34286
  const vectors = await deps.embed(candidates);
34286
- const indexClusters = clusterByCosine(candidates.map((_, i) => i), vectors, dedupThreshold);
34287
- const canonicals = indexClusters.map((cluster) => pickClusterRepresentative(cluster.map((i) => candidates[i])));
34288
- return { canonicals, stats: computeDedupSimilarityStats(vectors, indexClusters) };
34287
+ const indices = candidates.map((_, i) => i);
34288
+ const hasBothRoles = primaryMask !== void 0 && primaryMask.length === candidates.length && primaryMask.some((p) => p) && primaryMask.some((p) => !p);
34289
+ if (!hasBothRoles) {
34290
+ const indexClusters = clusterByCosine(indices, vectors, dedupThreshold);
34291
+ const canonicals = indexClusters.map((cluster) => pickClusterRepresentative(cluster.map((i) => candidates[i])));
34292
+ return { canonicals, stats: computeDedupSimilarityStats(vectors, indexClusters) };
34293
+ }
34294
+ const primaryIdx = indices.filter((i) => primaryMask[i]);
34295
+ const primaryClusters = clusterByCosine(
34296
+ primaryIdx,
34297
+ primaryIdx.map((i) => vectors[i]),
34298
+ dedupThreshold
34299
+ );
34300
+ const repIndexOf = (cluster) => {
34301
+ const rep = pickClusterRepresentative(cluster.map((i) => candidates[i]));
34302
+ return cluster.find((i) => candidates[i] === rep);
34303
+ };
34304
+ const keptIdx = primaryClusters.map(repIndexOf);
34305
+ for (const s of indices.filter((i) => !primaryMask[i])) {
34306
+ const novel = keptIdx.every((k) => cosineSimilarity(vectors[s], vectors[k]) < dedupThreshold);
34307
+ if (novel) keptIdx.push(s);
34308
+ }
34309
+ return {
34310
+ canonicals: keptIdx.map((i) => candidates[i]),
34311
+ // Band fraction describes the candidate SPACE (not the clustering), so it is
34312
+ // computed over all vectors as before; per-cluster cohesion reports the
34313
+ // primary clusters.
34314
+ stats: computeDedupSimilarityStats(vectors, primaryClusters),
34315
+ primaryCanonicalCount: primaryClusters.length
34316
+ };
34289
34317
  }
34290
34318
  async function executeDiscovery(opts) {
34291
34319
  const dedupThreshold = opts.dedupThreshold ?? DISCOVERY_DEFAULT_DEDUP_THRESHOLD;
@@ -34315,10 +34343,22 @@ async function executeDiscovery(opts) {
34315
34343
  });
34316
34344
  const rawCandidates = dedupeStrings(unbrandedCandidates);
34317
34345
  const seedCountRaw = rawCandidates.length;
34346
+ const primaryProvider = opts.seedProviders?.[0];
34347
+ const multiProvider = (opts.seedProviders?.length ?? 0) >= 2 && seedResult.candidateProviders != null;
34348
+ let primaryMask;
34349
+ if (multiProvider && primaryProvider) {
34350
+ const providerOf = /* @__PURE__ */ new Map();
34351
+ seedResult.candidates.forEach((candidate, i) => {
34352
+ const key = candidate.trim().toLowerCase();
34353
+ if (!providerOf.has(key)) providerOf.set(key, seedResult.candidateProviders[i]);
34354
+ });
34355
+ primaryMask = rawCandidates.map((c) => providerOf.get(c.trim().toLowerCase()) === primaryProvider);
34356
+ }
34318
34357
  const { canonicals, stats: dedupStats } = await pickCanonicalsWithStats(
34319
34358
  rawCandidates,
34320
34359
  { embed: opts.deps.embed },
34321
- dedupThreshold
34360
+ dedupThreshold,
34361
+ primaryMask
34322
34362
  );
34323
34363
  const warning = seedCollapseWarning({
34324
34364
  seedCountRaw,
@@ -5763,6 +5763,7 @@ export {
5763
5763
  categorizeSource,
5764
5764
  categorizeSourceWithCompetitors,
5765
5765
  categoryLabel,
5766
+ cosineSimilarity,
5766
5767
  clusterByCosine,
5767
5768
  pickClusterRepresentative,
5768
5769
  computeDedupSimilarityStats,
package/dist/cli.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  setTelemetrySource,
30
30
  showFirstRunNotice,
31
31
  trackEvent
32
- } from "./chunk-4TQOZJPF.js";
32
+ } from "./chunk-KS2M7B5E.js";
33
33
  import {
34
34
  CliError,
35
35
  EXIT_SYSTEM_ERROR,
@@ -46,7 +46,7 @@ import {
46
46
  saveConfig,
47
47
  saveConfigPatch,
48
48
  usageError
49
- } from "./chunk-Y26GYDS6.js";
49
+ } from "./chunk-6M2ALGJA.js";
50
50
  import {
51
51
  apiKeys,
52
52
  createClient,
@@ -54,7 +54,7 @@ import {
54
54
  projects,
55
55
  queries,
56
56
  renderReportHtml
57
- } from "./chunk-CVXBE3ST.js";
57
+ } from "./chunk-UOMNYP5T.js";
58
58
  import {
59
59
  BacklinkSources,
60
60
  CcReleaseSyncStatuses,
@@ -80,7 +80,7 @@ import {
80
80
  providerQuotaPolicySchema,
81
81
  resolveProviderInput,
82
82
  winnabilityClassSchema
83
- } from "./chunk-ZT7GVLS3.js";
83
+ } from "./chunk-VICGMHY2.js";
84
84
 
85
85
  // src/cli.ts
86
86
  import { pathToFileURL } from "url";
@@ -2076,9 +2076,9 @@ function compareToBaseline(scorecards, baseline) {
2076
2076
  `${base.shape}: canonicalCount ${current.canonicalCount} vs baseline ${base.canonicalCount} (band: >= ${EVAL_BANDS.canonicalCountFactor}x)`
2077
2077
  );
2078
2078
  }
2079
- if (current.retention < base.retention - EVAL_BANDS.retentionDrop) {
2079
+ if (current.canonicalCount < base.canonicalCount && current.retention < base.retention - EVAL_BANDS.retentionDrop) {
2080
2080
  regressions.push(
2081
- `${base.shape}: retention ${current.retention.toFixed(2)} vs baseline ${base.retention.toFixed(2)} (band: -${EVAL_BANDS.retentionDrop})`
2081
+ `${base.shape}: retention ${current.retention.toFixed(2)} vs baseline ${base.retention.toFixed(2)} (band: -${EVAL_BANDS.retentionDrop}), with canonicals also down (${current.canonicalCount} < ${base.canonicalCount})`
2082
2082
  );
2083
2083
  }
2084
2084
  const brandCeiling = Math.min(base.brandShare + EVAL_BANDS.brandShareSlack, EVAL_BANDS.brandShareCeiling);
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-4TQOZJPF.js";
3
+ } from "./chunk-KS2M7B5E.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-Y26GYDS6.js";
7
- import "./chunk-CVXBE3ST.js";
8
- import "./chunk-ZT7GVLS3.js";
6
+ } from "./chunk-6M2ALGJA.js";
7
+ import "./chunk-UOMNYP5T.js";
8
+ import "./chunk-VICGMHY2.js";
9
9
  export {
10
10
  createServer,
11
11
  loadConfig
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-CVXBE3ST.js";
4
- import "./chunk-ZT7GVLS3.js";
3
+ } from "./chunk-UOMNYP5T.js";
4
+ import "./chunk-VICGMHY2.js";
5
5
  export {
6
6
  IntelligenceService
7
7
  };
package/dist/mcp.js CHANGED
@@ -3,10 +3,10 @@ import {
3
3
  PACKAGE_VERSION,
4
4
  canonryMcpTools,
5
5
  createApiClient
6
- } from "./chunk-Y26GYDS6.js";
6
+ } from "./chunk-6M2ALGJA.js";
7
7
  import {
8
8
  isReadOnlyKey
9
- } from "./chunk-ZT7GVLS3.js";
9
+ } from "./chunk-VICGMHY2.js";
10
10
 
11
11
  // src/mcp/cli.ts
12
12
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainyc/canonry",
3
- "version": "4.111.0",
3
+ "version": "4.112.1",
4
4
  "type": "module",
5
5
  "description": "Agent-first open-source AEO operating platform - track how answer engines cite your domain",
6
6
  "license": "FSL-1.1-ALv2",
@@ -65,25 +65,25 @@
65
65
  "@types/node-cron": "^3.0.11",
66
66
  "tsup": "^8.5.1",
67
67
  "tsx": "^4.19.0",
68
- "@ainyc/canonry-api-client": "0.0.0",
69
68
  "@ainyc/canonry-api-routes": "0.0.0",
69
+ "@ainyc/canonry-api-client": "0.0.0",
70
70
  "@ainyc/canonry-config": "0.0.0",
71
71
  "@ainyc/canonry-contracts": "0.0.0",
72
72
  "@ainyc/canonry-db": "0.0.0",
73
73
  "@ainyc/canonry-integration-bing": "0.0.0",
74
- "@ainyc/canonry-integration-openai-ads": "0.0.0",
75
74
  "@ainyc/canonry-integration-cloud-run": "0.0.0",
75
+ "@ainyc/canonry-integration-openai-ads": "0.0.0",
76
+ "@ainyc/canonry-integration-commoncrawl": "0.0.0",
76
77
  "@ainyc/canonry-integration-google": "0.0.0",
77
- "@ainyc/canonry-integration-google-places": "0.0.0",
78
78
  "@ainyc/canonry-integration-google-business-profile": "0.0.0",
79
- "@ainyc/canonry-integration-commoncrawl": "0.0.0",
79
+ "@ainyc/canonry-integration-google-places": "0.0.0",
80
80
  "@ainyc/canonry-integration-traffic": "0.0.0",
81
- "@ainyc/canonry-intelligence": "0.0.0",
82
81
  "@ainyc/canonry-integration-wordpress": "0.0.0",
83
82
  "@ainyc/canonry-provider-cdp": "0.0.0",
84
- "@ainyc/canonry-provider-gemini": "0.0.0",
85
- "@ainyc/canonry-provider-local": "0.0.0",
86
83
  "@ainyc/canonry-provider-claude": "0.0.0",
84
+ "@ainyc/canonry-provider-local": "0.0.0",
85
+ "@ainyc/canonry-intelligence": "0.0.0",
86
+ "@ainyc/canonry-provider-gemini": "0.0.0",
87
87
  "@ainyc/canonry-provider-openai": "0.0.0",
88
88
  "@ainyc/canonry-provider-perplexity": "0.0.0"
89
89
  },