PageSourceSearch

https://ontariocanna.ca/assets/SEOCopilot-C-DFvhDa.js

js ontariocanna.ca collected 2026-10-08 06:16:48 UTC 11,092 bytes, 5 lines download raw bytes

1import{r as o,f as y,j as e,W as E,S as j,M as O,C as A}from"./index-BseVR5nP.js";import{N as R}from"./NoIndexMeta-DMqfc6g_.js";import{B as S}from"./bot-CwbZuWas.js";import{C as I}from"./chart-no-axes-column-BgTTkoGi.js";import{F as M}from"./file-text-DZFnf9HT.js";import{T as $}from"./tag-QfDYLsO6.js";import{R as m}from"./refresh-cw-DwSYYJjK.js";import{Z as D}from"./zap-DhDUJ4so.js";import{S as F}from"./send-DwPZCAYw.js";import{M as q}from"./index-D_Yre4D4.js";const T=[{label:"Full Site Audit",prompt:"Run a full SEO audit on all public pages. Score every page type and list all HIGH priority issues first.",icon:j},{label:"SEO Dashboard",prompt:"Show me the SEO dashboard: overall score, issues by type, pages affected, and top 10 fixes ranked by impact.",icon:I},{label:"City Pages Audit",prompt:"Audit all city pages. Show me which ones are missing meta fields, intro text, or FAQs. Prioritize by impact.",icon:O},{label:"Blog Post Audit",prompt:"Audit all blog posts. Check meta titles, meta descriptions, body length, and internal linking. Show HIGH issues first.",icon:M},{label:"Dispensary Listings Audit",prompt:"Audit all dispensary listings for thin content, missing meta fields, and index flags. Show the worst offenders first.",icon:$},{label:"Weekly SEO Report",prompt:"Give me a weekly SEO report: what was fixed, what still needs attention, new content published, and top 3 remaining priorities.",icon:m},{label:"Schema Opportunities",prompt:"What schema markup opportunities exist across the site? List each page type with the recommended schema and why it helps rankings.",icon:D},{label:"Internal Links Audit",prompt:"Scan all city pages and blog posts for internal linking opportunities. Which pages have zero internal links?",icon:A}];function P({toolCall:a}){const n=a.status==="running"||a.status==="in_progress",i=a.status==="failed"||a.status==="error",l=a.name?.replace(/_/g," ")||"tool";return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-[#0d1117] border border-[#1a2332] rounded-sm text-xs text-[#6b7280]",children:[e.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${i?"bg-[#f43f5e]":n?"bg-[#ff9500] animate-pulse":"bg-[#00ff99]"}`}),e.jsx("span",{className:"text-[#9ca3af]",children:l}),n&&e.jsx(m,{className:"w-3 h-3 animate-spin ml-auto text-[#ff9500]"})]})}function B({message:a}){const n=a.role==="user";return e.jsxs("div",{className:`flex gap-3 ${n?"justify-end":"justify-start"}`,children:[!n&&e.jsx("div",{className:"w-8 h-8 rounded-sm bg-[#00ff99]/10 border border-[#00ff99]/30 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx(S,{className:"w-4 h-4 text-[#00ff99]"})}),e.jsxs("div",{className:`max-w-[85%] ${n?"flex flex-col items-end":""}`,children:[a.content&&e.jsx("div",{className:`rounded-sm px-4 py-3 text-sm ${n?"bg-[#00d4ff]/15 border border-[#00d4ff]/30 text-[#e2e8f0]":"bg-[#0d1117] border border-[#1a2332] text-[#e2e8f0]"}`,children:n?e.jsx("p",{className:"leading-relaxed",children:a.content}):e.jsx(q,{className:"prose prose-invert prose-sm max-w-none [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_h1]:text-[#00ff99] [&_h1]:font-bold [&_h1]:text-base [&_h1]:mt-4 [&_h1]:mb-2 [&_h2]:text-[#00d4ff] [&_h2]:font-bold [&_h2]:text-sm [&_h2]:mt-4 [&_h2]:mb-2 [&_h3]:text-[#ff9500] [&_h3]:font-semibold [&_h3]:text-sm [&_h3]:mt-3 [&_h3]:mb-1.5 [&_strong]:text-white [&_strong]:font-semibold [&_code]:bg-[#1a2332] [&_code]:text-[#00ff99] [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:rounded-sm [&_code]:text-xs [&_pre]:bg-[#0a0e17] [&_pre]:border [&_pre]:border-[#1a2332] [&_pre]:rounded-sm [&_pre]:p-3 [&_pre]:overflow-x-auto [&_ul]:ml-4 [&_ul]:my-2 [&_li]:my-0.5 [&_ol]:ml-4 [&_ol]:my-2 [&_p]:my-1.5 [&_p]:leading-relaxed [&_blockquote]:border-l-2 [&_blockquote]:border-[#00ff99] [&_blockquote]:pl-3 [&_blockquote]:text-[#9ca3af] [&_blockquote]:my-2 [&_table]:w-full [&_table]:text-xs [&_th]:bg-[#1a2332] [&_th]:text-[#9ca3af] [&_th]:px-3 [&_th]:py-2 [&_th]:text-left [&_th]:font-semibold [&_td]:border-b [&_td]:border-[#1a2332] [&_td]:px-3 [&_td]:py-2 [&_a]:text-[#00d4ff] [&_a]:no-underline",children:a.content})}),a.tool_calls?.length>0&&e.jsx("div",{className:"mt-1.5 space-y-1",children:a.tool_calls.map((i,l)=>e.jsx(P,{toolCall:i},l))})]})]})}function J(){const[a,n]=o.useState(null),[i,l]=o.useState([]),[f,w]=o.useState(""),[c,v]=o.useState(!1),[k,x]=o.use
1State(!0),[d,p]=o.useState(null),_=o.useRef(null),N=o.useRef(null),h=o.useRef(null);o.useEffect(()=>{let s=!0;return(async()=>{const t=[];try{t.push("Creating conversation...");const r=await y.agents.createConversation({agent_name:"seo_copilot",metadata:{name:`SEO Session ${new Date().toLocaleDateString("en-CA")}`}});if(t.push(`✓ Conversation created: ${r?.id}`),!s){t.push("Component unmounted, aborting");return}if(n(r),l([]),!r?.id){t.push("✗ No conversation ID returned"),p({status:"error",logs:t,error:"No conversation ID"}),x(!1);return}t.push(`Subscribing to conversation ${r.id}...`);const b=y.agents.subscribeToConversation(r.id,g=>{s&&(t.push(`✓ Message update received: ${g?.messages?.length||0} messages`),g?.messages&&l(g.messages))});h.current=b,t.push("✓ Subscription active"),x(!1),p({status:"ready",logs:t})}catch(r){t.push(`✗ Error: ${r?.message}`),console.error("SEO Copilot init error:",r,t),s&&(n(null),l([{role:"assistant",content:`SEO Copilot failed to initialize.
2
3**Error:** ${r?.message}
4
5Try refreshing the page. If the issue persists, check that the 'seo_copilot' agent is properly configured.`}]),x(!1),p({status:"error",logs:t,error:r?.message}))}})(),()=>{s=!1,h.current&&h.current()}},[]),o.useEffect(()=>{_.current?.scrollIntoView({behavior:"smooth"})},[i]);const u=async s=>{const t=(s||f).trim();if(!(!t||!a||c)){w(""),v(!0);try{if(!a.id)throw new Error("Invalid conversation object");await y.agents.addMessage(a,{role:"user",content:t})}catch(r){console.error("Message send error:",r),l(b=>[...b,{role:"assistant",content:`Error sending message: ${r?.message}`}])}finally{v(!1),N.current?.focus()}}},C=s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),u())};return e.jsxs(e.Fragment,{children:[e.jsx(E,{children:e.jsx("title",{children:"SEO Copilot - OntarioCanna Admin"})}),e.jsx(R,{}),e.jsxs("div",{className:"flex flex-col h-full bg-[#0a0e17]",style:{minHeight:0},children:[e.jsx("div",{className:"flex-shrink-0 px-6 py-4 border-b-2 border-[#00ff99] bg-[#0d1117]",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-sm bg-[#00ff99]/10 border border-[#00ff99]/40 flex items-center justify-center",children:e.jsx(S,{className:"w-5 h-5 text-[#00ff99]"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-[#00ff99] uppercase tracking-widest",children:"SEO Copilot"}),e.jsx("p",{className:"text-[10px] text-[#4b5563] tracking-wide",children:"OntarioCanna.ca — Page audits, meta fixes, schema & internal links"})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#00ff99] animate-pulse"}),e.jsx("span",{className:"text-[10px] text-[#4b5563] uppercase tracking-widest",children:"Online"})]})]})}),e.jsx("div",{className:"flex-shrink-0 px-6 py-3 border-b border-[#1a2332] overflow-x-auto",children:e.jsx("div",{className:"flex gap-2 min-w-max",children:T.map(({label:s,prompt:t,icon:r})=>e.jsxs("button",{onClick:()=>u(t),disabled:!a||c,className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#0d1117] border border-[#1a2332] hover:border-[#00ff99]/40 hover:bg-[#00ff99]/5 text-[#9ca3af] hover:text-[#00ff99] text-xs font-medium rounded-sm transition-all whitespace-nowrap disabled:opacity-40",children:[e.jsx(r,{className:"w-3 h-3"}),s]},s))})}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-6 space-y-5",children:[k?e.jsxs("div",{className:"flex items-center justify-center h-32 gap-3",children:[e.jsx(m,{className:"w-4 h-4 text-[#00ff99] animate-spin"}),e.jsx("span",{className:"text-[#6b7280] text-sm",children:"Starting SEO Copilot..."}),d?.logs&&e.jsx("div",{className:"absolute bottom-4 right-4 text-xs text-[#4b5563] max-w-xs bg-[#0d1117] border border-[#1a2332] rounded px-3 py-2 max-h-32 overflow-y-auto",children:d.logs.slice(-3).map((s,t)=>e.jsx("div",{children:s},t))})]}):d?.status==="error"&&i.length===1?e.jsxs("div",{className:"max-w-xl mx-auto text-center py-12",children:[e.jsx("div",{className:"w-16 h-16 rounded-sm bg-[#f43f5e]/10 border border-[#f43f5e]/30 flex items-center justify-center mx-auto mb-5",children:e.jsx(j,{className:"w-8 h-8 text-[#f43f5e]"})}),e.jsx("h2",{className:"text-white font-bold text-base mb-2",children:"Connection Failed"}),e.jsx("p",{className:"text-[#6b7280] text-sm leading-relaxed mb-4",children:d?.error}),d?.logs&&e.jsx("div",{className:"bg-[#0d1117] border border-[#1a2332] rounded text-left text-xs text-[#9ca3af] p-3 mb-4 max-h-40 overflow-y-auto font-mono",children:d.logs.map((s,t)=>e.jsx("div",{children:s},t))}),e.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-[#00ff99]/15 hover:bg-[#00ff99]/25 border border-[#00ff99]/40 text-[#00ff99] rounded-sm text-sm font-medium transition-all",children:"Refresh Page"})]}):i.length===0?e.jsxs("div",{className:"max-w-xl mx-auto text-center py-12",children:[e.jsx("div",{className:"w-16 h-16 rounded-sm bg-[#00ff99]/10 border border-[#00ff99]/30 flex items-center justify-center mx-auto mb-5",children:e.jsx(j,{className:"w-8 h-8 text-[#00ff99]"})}),e.jsx("h2",{className:"text-white font-bold text-base mb-2",children:"SEO 
5Copilot Ready"}),e.jsx("p",{className:"text-[#6b7280] text-sm leading-relaxed mb-6",children:"I can audit every public page, score your SEO, find missing meta fields, flag thin content, suggest schema markup, and fix issues with AI — without touching your design."}),e.jsx("p",{className:"text-[#4b5563] text-xs",children:"Use a quick action above or type your question below."})]}):i.map((s,t)=>e.jsx(B,{message:s},t)),e.jsx("div",{ref:_})]}),e.jsxs("div",{className:"flex-shrink-0 px-6 py-4 border-t border-[#1a2332] bg-[#0d1117]",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("textarea",{ref:N,value:f,onChange:s=>w(s.target.value),onKeyDown:C,placeholder:"Ask anything — audit a page, fix meta tags, add FAQs, check schema...",rows:1,disabled:!a||c,className:"flex-1 bg-[#111827] border border-[#1a2332] focus:border-[#00ff99]/40 text-[#e2e8f0] placeholder-[#4b5563] text-sm px-4 py-3 rounded-sm resize-none outline-none transition-colors leading-relaxed disabled:opacity-40"}),e.jsx("button",{onClick:()=>u(),disabled:!f.trim()||!a||c,className:"flex-shrink-0 w-11 h-11 bg-[#00ff99]/15 hover:bg-[#00ff99]/25 border border-[#00ff99]/40 text-[#00ff99] rounded-sm flex items-center justify-center transition-all disabled:opacity-30 disabled:cursor-not-allowed",children:c?e.jsx(m,{className:"w-4 h-4 animate-spin"}):e.jsx(F,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-[10px] text-[#4b5563] mt-2 text-center",children:"Enter to send · Shift+Enter for new line · Agent has read/write access to all page entities"})]})]})]})}export{J as default};

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.