PageSourceSearch

https://adpeak.ai/_astro/ChatDemo.astro_astro_type_script_index_0_lang.Da1IUX4Z.js

js adpeak.ai collected 2026-10-05 13:49:47 UTC 9,187 bytes, 1 lines download raw bytes

1const m=[{label:"Account Assessment",surface:"mcp",messages:[{role:"user",text:"What's going on with my Google Ads account?"},{role:"agent",text:"I've analysed your account. Here's what I found:"},{role:"agent",html:'<div class="space-y-1.5"><div><span class="font-semibold text-red-600 dark:text-red-400">3 campaigns</span> overspending on low-converting product groups. Estimated waste: <span class="font-semibold">£1,240/mo</span>.</div><div><span class="font-semibold text-amber-600 dark:text-amber-400">142 products</span> missing from Shopping due to feed disapprovals. Here’s the full list to fix.</div><div><span class="font-semibold text-emerald-600 dark:text-emerald-400">Brand campaign</span> CPA dropped 22% — your new strategy is working well.</div></div>'},{role:"agent",text:"Want the prioritised fix list for the disapprovals, plus where I’d rebalance spend across the catalogue?"}]},{label:"Budget Rebalancing",messages:[{role:"user",text:"My ROAS dropped 15% this month. What happened?"},{role:"agent",text:"Your top 3 campaigns shifted budget into low-performing product groups after a Google auto-apply recommendation was accepted."},{role:"agent",html:'<div class="rounded-lg border border-gray-200 dark:border-slate-700 overflow-hidden text-xs mt-1"><div class="px-3 py-2 bg-gray-50 dark:bg-slate-800 font-semibold text-gray-600 dark:text-gray-300 border-b border-gray-200 dark:border-slate-700">Recommended Changes · 4 steps</div><div class="px-3 py-2 flex justify-between border-b border-gray-100 dark:border-slate-800"><span>1. Reduce “Seasonal” budget</span><span class="text-red-600 dark:text-red-400 font-medium">£210 → £140/day</span></div><div class="px-3 py-2 flex justify-between border-b border-gray-100 dark:border-slate-800"><span>2. Increase “All Products” budget</span><span class="text-emerald-600 dark:text-emerald-400 font-medium">£400 → £450/day</span></div><div class="px-3 py-2 flex justify-between border-b border-gray-100 dark:border-slate-800"><span>3. Adjust 12 product group bids</span><span class="text-gray-500">Tier 1–4</span></div><div class="px-3 py-2 flex justify-between"><span>4. Relabel 340 products</span><span class="text-gray-500">5 tiers</span></div></div>'},{role:"user",text:"Walk me through it."},{role:"agent",text:"These are recommendations: trim ‘Seasonal’, lift ‘All Products’, retier the bids. I’ll relabel the 340 products in your feed; apply the budget and bid moves in Google Ads when you’re ready, and I’ll track ROAS and flag back in 48 hours."}]},{label:"Custom Strategy",messages:[{role:"user",text:"I want to push high-margin products that haven't had much ad spend yet."},{role:"agent",text:"I've written a custom strategy: Margin-Weighted Opportunity Score. It ranks products by margin-to-spend ratio, boosting high-margin items with low historical spend into Tier 1."},{role:"agent",html:'<div class="rounded-lg border border-gray-200 dark:border-slate-700 overflow-hidden text-xs mt-1"><div class="px-3 py-2 bg-gray-50 dark:bg-slate-800 font-semibold text-gray-600 dark:text-gray-300 border-b border-gray-200 dark:border-slate-700">Strategy Results</div><div class="px-3 py-2 flex justify-between border-b border-gray-100 dark:border-slate-800"><span>Products analyzed</span><span class="font-semibold">2,847</span></div><div class="px-3 py-2 flex justify-between border-b border-gray-100 dark:border-slate-800"><span>Labels assigned</span><span class="font-semibold">5 tiers</span></div><div class="px-3 py-2 flex justify-between border-b border-gray-100 dark:border-slate-800"><span>Est. revenue impact</span><span class="font-semibold text-emerald-600 dark:text-emerald-400">+£4,100/mo</span></div><div class="px-3 py-2 flex justify-between"><span>Execution</span><span class="font-semibold">Sandboxed</span></div></div>'},{role:"agent",text:"Want to review the code and the label distribution first?"}]},{label:"Stock Alert",surface:"slack",messages:[{role:"agent",html:'<div><span class="font-semibold text-amber-600 dark:text-amber-400">⚠️ Stock alert:</span> 34 products in your “Outdoor Furniture” range just went out of stock in your Merchant Center feed.</div>'},{role:"agent",html:'<div class="rounded-lg border border-gray-200 dark:border-slate-700 overflow-hidden text-xs mt-1"><div class="px-3 py-2 bg-gray-50 dark:bg-slate-800 font-semibold text-gray-600 dark:text-gray-300 border-b border-gray-200 dark:border-slate-700">Impact Assessment</div><div class="px-3 py-2 flex justify-between border-b border-gray-100 dark:border-slate-800"><span>Products affected</span><span class="font-semibold">34 of 2,847</span></div><div class="px-3 py-2 flex justify-between border-b border-gray-100 dark:border-slate-800"><span>Daily spend on these products</span><span class="font-semibold text-red-600 dark:text-red-400">£186/day wasted</span></div><div class="px-3 py-2 flex justify-between border-b border-gray-100 dark:border-slate-800"><span>Campaigns affected</span><span class="font-semibold">Shopping — All Products</span></div><div class="px-3 py-2 flex justify-between"><span>Recommended action</span><span class="font-semibold">Pause &amp;
1 redistribute</span></div></div>'},{role:"agent",text:"That’s £186/day going to out-of-stock items. I’d pause those and shift the budget to your top in-stock products. Want the breakdown?"},{role:"user",text:"Show me the breakdown."},{role:"agent",text:"Here’s the £186/day spread across your 12 top in-stock products. Apply it in Google Ads when you’re ready, and I’ll flag when these items are back in stock."}]}];let d=0;function i(s,e){return new Promise((t,a)=>{setTimeout(()=>{e!==d?a(new Error("cancelled")):t()},s)})}function c(s,e,t=!1){const a=document.createElement("div");a.className="flex gap-2.5 items-start mt-3 first:mt-0"+(s==="user"?" flex-row-reverse":""),a.style.animation="msg-in 0.3s ease-out";const r=document.createElement("div");r.className="w-7 h-7 rounded-full flex-shrink-0 flex items-center justify-center text-[10px] font-bold text-white "+(s==="user"?"bg-indigo-500":"bg-blue-500"),r.textContent=s==="user"?"You":"AI";const l=document.createElement("div");return l.className="text-sm leading-relaxed max-w-[85%] px-3.5 py-2.5 "+(s==="user"?"bg-blue-500 text-white rounded-2xl rounded-tr-sm":"bg-gray-100 dark:bg-slate-800 text-gray-800 dark:text-gray-200 rounded-2xl rounded-tl-sm"),t?l.innerHTML=e:l.textContent=e,a.appendChild(r),a.appendChild(l),a}function g(){const s=document.createElement("div");s.className="flex gap-2.5 items-start mt-3 first:mt-0";const e=document.createElement("div");e.className="w-7 h-7 rounded-full flex-shrink-0 flex items-center justify-center text-[10px] font-bold text-white bg-blue-500",e.textContent="AI";const t=document.createElement("div");return t.className="text-sm leading-relaxed max-w-[85%] px-3.5 py-2.5 bg-gray-100 dark:bg-slate-800 rounded-2xl rounded-tl-sm",t.innerHTML='<div class="flex gap-1 py-1 px-1"><span class="w-1.5 h-1.5 rounded-full bg-gray-400 dark:bg-gray-500 animate-bounce" style="animation-duration:0.6s"></span><span class="w-1.5 h-1.5 rounded-full bg-gray-400 dark:bg-gray-500 animate-bounce" style="animation-delay:0.15s;animation-duration:0.6s"></span><span class="w-1.5 h-1.5 rounded-full bg-gray-400 dark:bg-gray-500 animate-bounce" style="animation-delay:0.3s;animation-duration:0.6s"></span></div>',s.appendChild(e),s.appendChild(t),s}async function b(s,e,t){for(let a=0;a<=e.length;a++){if(t!==d)return;s.textContent=e.slice(0,a),await i(25,t)}}async function p(s){d++;const e=d,t=document.getElementById("chat-messages"),a=document.getElementById("chat-input-text");if(!t||!a)return;document.querySelectorAll(".scenario-btn").forEach((o,n)=>{o.classList.toggle("active",n===s)}),t.innerHTML="",a.textContent="";const r=m[s];r.surface&&(["chrome-mcp","chrome-browser","chrome-slack","chrome-whatsapp"].forEach(n=>{const u=document.getElementById(n);u&&u.classList.toggle("hidden",n!=="chrome-"+r.surface)}),document.querySelectorAll(".surface-tab").forEach(n=>{n.classList.toggle("active",n.dataset.surface===r.surface)}));const l=r.messages;try{for(const o of l){if(e!==d)return;if(o.role==="user")await b(a,o.text||"",e),await i(400,e),a.textContent="",t.appendChild(c("user",o.text||"")),t.scrollTop=t.scrollHeight,await i(600,e);
1else{const n=g();if(t.appendChild(n),t.scrollTop=t.scrollHeight,await i(1200,e),e!==d)return;n.remove(),o.html?t.appendChild(c("agent",o.html,!0)):t.appendChild(c("agent",o.text||"")),t.scrollTop=t.scrollHeight,await i(800,e)}}await i(5e3,e),e===d&&p((s+1)%m.length)}catch{}}function f(){const s=["chrome-mcp","chrome-browser","chrome-slack","chrome-whatsapp"];document.querySelectorAll(".surface-tab").forEach(e=>{e.addEventListener("click",()=>{const t=e.dataset.surface;document.querySelectorAll(".surface-tab").forEach(a=>a.classList.toggle("active",a===e)),s.forEach(a=>{const r=document.getElementById(a);r&&r.classList.toggle("hidden",a!=="chrome-"+t)})})}),document.querySelectorAll(".scenario-btn").forEach(e=>{e.addEventListener("click",()=>{const t=parseInt(e.dataset.index||"0");p(t)})}),p(0)}document.addEventListener("astro:page-load",f);

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.