signetai 0.86.1 → 0.86.2

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 (59) hide show
  1. package/dashboard/_app/immutable/chunks/{CQhnUEMS.js → 1RNQaijR.js} +1 -1
  2. package/dashboard/_app/immutable/chunks/{BfE8esRs.js → 1VZPH5Su.js} +1 -1
  3. package/dashboard/_app/immutable/chunks/{C1YW3XLo.js → B-VASDKO.js} +1 -1
  4. package/dashboard/_app/immutable/chunks/{UKNfqwCS.js → B08XBCTe.js} +1 -1
  5. package/dashboard/_app/immutable/chunks/{D6yz3aR2.js → BT7pcgxa.js} +1 -1
  6. package/dashboard/_app/immutable/chunks/{Yy59jTlt.js → BV9ynRA3.js} +2 -2
  7. package/dashboard/_app/immutable/chunks/{UGONRT_X.js → BWAfmkOJ.js} +1 -1
  8. package/dashboard/_app/immutable/chunks/{BzXbimkX.js → Bj2p26Rw.js} +1 -1
  9. package/dashboard/_app/immutable/chunks/{BFhviDgB.js → BphIGb-I.js} +1 -1
  10. package/dashboard/_app/immutable/chunks/{BEyjx4ZM.js → BrLmDlXn.js} +1 -1
  11. package/dashboard/_app/immutable/chunks/{YaSgVxqq.js → Bsd-LBwT.js} +1 -1
  12. package/dashboard/_app/immutable/chunks/{DERRcs3d.js → Bsjc4PMT.js} +1 -1
  13. package/dashboard/_app/immutable/chunks/{DRPrjjHV.js → BtdIzLwF.js} +1 -1
  14. package/dashboard/_app/immutable/chunks/{CQpf6RJN.js → C83dMPYt.js} +2 -2
  15. package/dashboard/_app/immutable/chunks/{Flcqczsi.js → CA568H0n.js} +1 -1
  16. package/dashboard/_app/immutable/chunks/{5pZXz3Gm.js → CAqqP6Qf.js} +1 -1
  17. package/dashboard/_app/immutable/chunks/{CxgsnjSN.js → CAutOEr0.js} +1 -1
  18. package/dashboard/_app/immutable/chunks/{Bp4eV294.js → CBqMHFtI.js} +1 -1
  19. package/dashboard/_app/immutable/chunks/{CAwmAaD7.js → CCfdK6KD.js} +1 -1
  20. package/dashboard/_app/immutable/chunks/{dMl0-GIm.js → CHuKpWcd.js} +1 -1
  21. package/dashboard/_app/immutable/chunks/{xCOG0CvI.js → CIHstG2y.js} +1 -1
  22. package/dashboard/_app/immutable/chunks/{DDXwoyYk.js → CV4skcSN.js} +1 -1
  23. package/dashboard/_app/immutable/chunks/{CTk7g6kE.js → C_LhDkuT.js} +1 -1
  24. package/dashboard/_app/immutable/chunks/{BrnIoKGE.js → Cg0OytHL.js} +1 -1
  25. package/dashboard/_app/immutable/chunks/{B9xjqkNY.js → CsF9itlV.js} +1 -1
  26. package/dashboard/_app/immutable/chunks/{DZqsIsUZ.js → D-uXzM2S.js} +1 -1
  27. package/dashboard/_app/immutable/chunks/{Beqv-RRr.js → D2ArAHv1.js} +1 -1
  28. package/dashboard/_app/immutable/chunks/{DXS2O2j7.js → DEVlNwCa.js} +1 -1
  29. package/dashboard/_app/immutable/chunks/{B_ug92Oo.js → DJ6y7jyH.js} +1 -1
  30. package/dashboard/_app/immutable/chunks/{BWGH6yWu.js → DJAvkyFV.js} +1 -1
  31. package/dashboard/_app/immutable/chunks/{Lxi7AX4n.js → DMWDZKxz.js} +1 -1
  32. package/dashboard/_app/immutable/chunks/{Y_NrSAKB.js → DNp4OCHt.js} +1 -1
  33. package/dashboard/_app/immutable/chunks/{z-A0hI9E.js → DSDCLz8Y.js} +1 -1
  34. package/dashboard/_app/immutable/chunks/{LeiVX29k.js → DXiox7JG.js} +1 -1
  35. package/dashboard/_app/immutable/chunks/{tjtK_67M.js → DbQdiTbg.js} +1 -1
  36. package/dashboard/_app/immutable/chunks/{D988SpEB.js → DhU4E5XX.js} +1 -1
  37. package/dashboard/_app/immutable/chunks/{Dp66emBm.js → DmY3Nzbb.js} +1 -1
  38. package/dashboard/_app/immutable/chunks/{DdQKnaVE.js → DvMvtG0k.js} +1 -1
  39. package/dashboard/_app/immutable/chunks/{WTmJ2kxu.js → DySpBuOv.js} +3 -3
  40. package/dashboard/_app/immutable/chunks/{D_5eC20c.js → H0qvLlbz.js} +1 -1
  41. package/dashboard/_app/immutable/chunks/{BmTo86rh.js → JgPpY3N-.js} +1 -1
  42. package/dashboard/_app/immutable/chunks/{17DJUZua.js → N9f-e8Vn.js} +1 -1
  43. package/dashboard/_app/immutable/chunks/{xCZ1totC.js → NbPQChx7.js} +1 -1
  44. package/dashboard/_app/immutable/chunks/{BUr6TUtR.js → QZNAm7JC.js} +1 -1
  45. package/dashboard/_app/immutable/chunks/{B5_qL5eG.js → Sib4VNW_.js} +1 -1
  46. package/dashboard/_app/immutable/chunks/{B1B_-bIV.js → T8w_ChYR.js} +1 -1
  47. package/dashboard/_app/immutable/chunks/{KRYOSB9l.js → ljB_gB1M.js} +1 -1
  48. package/dashboard/_app/immutable/chunks/{DETIKIiJ.js → zQY3sXa2.js} +1 -1
  49. package/dashboard/_app/immutable/entry/{app.EgplNfSJ.js → app.B4NtzScM.js} +2 -2
  50. package/dashboard/_app/immutable/entry/start.gacwe9It.js +1 -0
  51. package/dashboard/_app/immutable/nodes/{1.n72R0gD6.js → 1.DS5GJpwg.js} +1 -1
  52. package/dashboard/_app/immutable/nodes/2.Cpjl4_8B.js +1 -0
  53. package/dashboard/_app/version.json +1 -1
  54. package/dashboard/index.html +6 -6
  55. package/dist/daemon.js +3024 -2845
  56. package/dist/mcp-stdio.js +6 -4
  57. package/package.json +1 -1
  58. package/dashboard/_app/immutable/entry/start.CK2zfAXo.js +0 -1
  59. package/dashboard/_app/immutable/nodes/2.Dq_2G2E6.js +0 -1
@@ -1 +1 @@
1
- import{p,s as d,c as i,f as c,a as l,n as m,b as f,d as h,r as u}from"./V_JjZsJi.js";import{I as $}from"./WTmJ2kxu.js";function P(e,a){p(a,!0);let o=u(a,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"M12 17v5"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z"}]];$(e,d({name:"pin"},()=>o,{get iconNode(){return t},children:(n,v)=>{var s=i(),r=c(s);l(r,()=>a.children??m),f(n,s)},$$slots:{default:!0}})),h()}export{P};
1
+ import{p,s as d,c as i,f as c,a as l,n as m,b as f,d as h,r as u}from"./V_JjZsJi.js";import{I as $}from"./DySpBuOv.js";function P(e,a){p(a,!0);let o=u(a,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"M12 17v5"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z"}]];$(e,d({name:"pin"},()=>o,{get iconNode(){return t},children:(n,v)=>{var s=i(),r=c(s);l(r,()=>a.children??m),f(n,s)},$$slots:{default:!0}})),h()}export{P};
@@ -1,4 +1,4 @@
1
- import{e as We,p as re,s as he,c as ge,f as se,a as fe,n as ve,b as w,d as ie,r as we,j as c,k as J,t as x,l as s,y as ee,z as ae,D as ue,A as Te,i as t,m as N,v as p,o as Y,g as ft,Q as Ze,q as ze,aU as Ve,F as Je,B as xe,u as pe,O as U,P as Se,aa as et,N as Ee,ac as Ie,w as ke,I as Me,x as vt,K as wt,U as yt}from"./V_JjZsJi.js";import{o as me,I as ye,aG as bt,be as xt,bf as _t,H as Et}from"./WTmJ2kxu.js";import{W as at,L as Tt}from"./DERRcs3d.js";import{R as st}from"./5pZXz3Gm.js";import{P as qe}from"./D_5eC20c.js";import{P as kt}from"./CQhnUEMS.js";import{T as St}from"./tjtK_67M.js";import{U as Ct}from"./Lxi7AX4n.js";const k=We({entries:[],loading:!1,error:null,groups:[],activeGroup:null,draggingId:null,focusedId:null,widgetCacheVersion:0}),be=new Map,He=new Set;function Nt(){return k.entries.filter(n=>n.state==="tray")}function It(){const n=k.entries.filter(e=>e.state==="grid");if(k.activeGroup){const e=k.groups.find(r=>r.id===k.activeGroup);if(e)return n.filter(r=>e.items.includes(r.id))}return n}function Mt(){return k.entries.filter(n=>n.state==="dock")}const tt=12;function Qe(n,e,r){const a=r?.x??0,u=r?.y??0;function g(R,P,D,H){for(const A of n)if(R<A.x+A.w&&R+D>A.x&&P<A.y+A.h&&P+H>A.y)return!0;return!1}const o=Math.max(0,Math.min(tt-e.w,a)),_=Math.max(0,u);if(!g(o,_,e.w,e.h))return{x:o,y:_,w:e.w,h:e.h};for(let R=1;R<=20;R++)for(let P=-R;P<=R;P++)for(let D=-R;D<=R;D++){if(Math.abs(D)!==R&&Math.abs(P)!==R)continue;const H=Math.max(0,Math.min(tt-e.w,a+D)),A=Math.max(0,u+P);if(!g(H,A,e.w,e.h))return{x:H,y:A,w:e.w,h:e.h}}return{x:0,y:n.reduce((R,P)=>Math.max(R,P.y+P.h),0),w:e.w,h:e.h}}async function Oe(){k.loading=!0,k.error=null;try{const n=await fetch(`${me}/api/os/tray`);if(!n.ok)throw new Error(`HTTP ${n.status}`);const e=await n.json();k.entries=e.entries??[]}catch(n){k.error=n instanceof Error?n.message:String(n)}finally{k.loading=!1}}async function Ae(n,e,r){try{const a={state:e};r&&(a.gridPosition=r);const u=await fetch(`${me}/api/os/tray/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!u.ok)return!1;const g=await u.json();if(g.success&&g.entry){const o=k.entries.findIndex(_=>_.id===n);o>=0&&(k.entries[o]=g.entry)}return!0}catch{return!1}}async function nt(n,e){return Ae(n,"grid",e)}async function Xe(n,e){const r=k.entries.find(o=>o.id===n);if(!r)return!1;if(e)return Ae(n,"grid",e);const a=r.manifest?.defaultSize??{w:4,h:3},u=k.entries.flatMap(o=>o.id!==n&&o.state==="grid"&&o.gridPosition?[o.gridPosition]:[]),g=Qe(u,a);return Ae(n,"grid",g)}async function At(n){return Ae(n,"dock")}async function lt(n){return Ae(n,"tray")}const ct="signet-os-sidebar-groups";function Dt(){try{const n=localStorage.getItem(ct);n&&(k.groups=JSON.parse(n))}catch{k.groups=[]}}function Fe(){localStorage.setItem(ct,JSON.stringify(k.groups))}function Lt(n){const e={id:`group_${Date.now()}`,name:n,items:[]};return k.groups=[...k.groups,e],Fe(),e}function Rt(n){k.groups=k.groups.filter(e=>e.id!==n),k.activeGroup===n&&(k.activeGroup=null),Fe()}function Ht(n,e){k.groups=k.groups.map(r=>r.id===n?{...r,name:e}:r),Fe()}function Pt(n,e){k.groups=k.groups.map(r=>r.id!==n||r.items.includes(e)?r:{...r,items:[...r.items,e]}),Fe()}function Ue(n){k.activeGroup=n}let Pe=We(new Map),rt=0;function it(n,e,r){Pe.set(n,{action:e,data:r,_seq:++rt}),setTimeout(()=>{const a=Pe.get(n);a&&a._seq===rt&&Pe.delete(n)},500)}function Ot(n){return Pe.get(n)}function $t(n){k.focusedId=n}function Le(){k.focusedId=null}async function $e(n){if(be.has(n))return be.get(n)??null;try{const e=await fetch(`${me}/api/os/widget/${encodeURIComponent(n)}`);if(!e.ok)return null;const r=await e.json();return r.html?(be.set(n,r.html),k.widgetCacheVersion++,r.html):null}catch{return null}}async function dt(n){if(!He.has(n)){He.add(n),k.widgetCacheVersion++;try{const r=await(await fetch(`${me}/api/os/widget/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:n,force:!1})})).json();r.status==="cached"&&r.html&&be.set(n,r.html)}catch{}finally{be.has(n)&&He.delete(n),k.widgetCacheVersion++}}}const Ke=new Map;function Wt(n,e){Ke.set(n,e)}function zt(n){Ke.delete(n)}function Re(n){return Ke.get(n)}const Vt=We({current:null});function _e(n){Vt.current=n}function Ye(n,e){re(e,!0);let r=we(e,["$$slots","$$events","$$legacy"]);const a=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]];ye(n,he({name:"box"},()=>r,{get iconNode(){return a},children:(u,g)=>{var o=ge(),_=se(o);fe(_,()=>e.children??ve),w(u,o)},$$slots:{default:!0}})),ie()}var Ft=N('<img class="auto-card-icon svelte-1y09vim" referrerpolicy="no-referrer"/>'),jt=N('<div class="auto-card-icon-placeholder svelte-1y09vim"><!></div>'),Bt=N('<button class="auto-card-tool-btn sig-switch svelte-1y09vim" disabled=""><!> <span class="truncate"> </span></button>'),Ut=N('<div class="auto-card-tools svelte-1y09vim"></div>'),Gt=N('<div class="auto-card-empty svelte-1y09vim"><span class="sig-label">No tools exposed</span></div>'),qt=N('<div class="auto-card svelte-1y09vim"><div class="auto-card-header svelte-1y09vim"><!> <span class="auto-card-name svelte-1y09vim"> </span> <span class="sig-meta ml-auto"> </span></div> <!></div>');function Xt(n,e){re(e,!0);var r=qt(),a=c(r),u=c(a);{var g=O=>{var S=Ft();ee(()=>{ue(S,"src",e.icon),ue(S,"alt",e.name)}),w(O,S)},o=O=>{var S=jt(),$=c(S);Ye($,{class:"size-4"}),s(S),w(O,S)};J(u,O=>{e.icon?O(g):O(o,-1)})}var _=x(u,2),G=c(_,!0);s(_);var R=x(_,2),P=c(R);s(R),s(a);var D=x(a,2);{var H=O=>{var S=Ut();Te(S,21,()=>e.autoCard.tools,$=>$.name,($,W)=>{var j=Bt(),F=c(j);at(F,{class:"size-3 shrink-0 opacity-50"});var te=x(F,2),I=c(te,!0);s(te),s(j),ee(()=>{ue(j,"title",t(W).description||t(W).name),ae(I,t(W).name)}),w($,j)}),s(S),w(O,S)},A=O=>{var S=Gt();w(O,S)};J(D,O=>{e.autoCard.tools.length>0?O(H):O(A,-1)})}s(r),ee(()=>{ae(G,e.name),ae(P,`${e.autoCard.tools.length??""} tools`)}),w(n,r),ie()}const Yt='// Signet Page Agent bundle - PageController + lightweight cursor mask\n// Auto-generated from @page-agent/page-controller v1.6.0\n\n\n(function(){\n // Lightweight SimulatorMask - cursor + overlay, no ai-motion dependency\n var CSS_TEXT = \'.__pa_mask{position:fixed;inset:0;z-index:2147483641;cursor:wait;overflow:hidden;display:none;background:rgba(0,0,0,0.02)}.__pa_mask.__pa_vis{display:block}.__pa_cur{position:absolute;width:40px;height:40px;pointer-events:none;z-index:10000;transition:none}.__pa_cur_fill{position:absolute;width:100%;height:100%;background:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' fill=\\\'%23ffffff\\\' stroke=\\\'%23333\\\' stroke-width=\\\'4\\\'/%3e%3c/svg%3e");background-size:100% 100%;transform-origin:center;transform:rotate(-135deg) scale(1.1);margin-left:-8px;margin-top:-14px}.__pa_cur_border{position:absolute;width:100%;height:100%;background:linear-gradient(45deg,rgb(57,182,255),rgb(189,69,251));mask-image:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\' fill=\\\'none\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' stroke=\\\'%23000\\\' stroke-width=\\\'6\\\'/%3e%3c/svg%3e");mask-size:100% 100%;mask-repeat:no-repeat;transform-origin:center;transform:rotate(-135deg) scale(1.2);margin-left:-10px;margin-top:-18px}.__pa_ripple{position:absolute;width:100%;height:100%;pointer-events:none;margin-left:-50%;margin-top:-50%}.__pa_ripple::after{content:\\\'\\\';opacity:0;position:absolute;inset:0;border:3px solid rgba(57,182,255,1);border-radius:50%}.__pa_cur.__pa_click .__pa_ripple::after{animation:__pa_rip 300ms ease-out forwards}@keyframes __pa_rip{0%{transform:scale(0);opacity:1}100%{transform:scale(2);opacity:0}}\';\n \n try{\n var s=document.createElement(\'style\');\n s.appendChild(document.createTextNode(CSS_TEXT));\n document.head.appendChild(s);\n }catch(e){}\n\n function LiteMask(){\n this.shown=false;\n this.wrapper=document.createElement(\'div\');\n this.wrapper.className=\'__pa_mask\';\n this.wrapper.setAttribute(\'data-page-agent-ignore\',\'true\');\n \n this._cursor=document.createElement(\'div\');\n this._cursor.className=\'__pa_cur\';\n var ripple=document.createElement(\'div\');ripple.className=\'__pa_ripple\';this._cursor.appendChild(ripple);\n var fill=document.createElement(\'div\');fill.className=\'__pa_cur_fill\';this._cursor.appendChild(fill);\n var border=document.createElement(\'div\');border.className=\'__pa_cur_border\';this._cursor.appendChild(border);\n this.wrapper.appendChild(this._cursor);\n \n this._cx=0;this._cy=0;this._tx=0;this._ty=0;\n \n // Block interactions on mask\n [\'click\',\'mousedown\',\'mouseup\',\'mousemove\',\'wheel\',\'keydown\',\'keyup\'].forEach(function(evt){\n this.wrapper.addEventListener(evt,function(e){e.stopPropagation();e.preventDefault();});\n }.bind(this));\n \n document.body.appendChild(this.wrapper);\n this._animate();\n \n var self=this;\n window.addEventListener(\'PageAgent::MovePointerTo\',function(e){\n var d=e.detail;self._tx=d.x;self._ty=d.y;\n });\n window.addEventListener(\'PageAgent::ClickPointer\',function(){\n self._cursor.classList.remove(\'__pa_click\');\n void self._cursor.offsetHeight;\n self._cursor.classList.add(\'__pa_click\');\n });\n }\n \n LiteMask.prototype._animate=function(){\n var nx=this._cx+(this._tx-this._cx)*0.2;\n var ny=this._cy+(this._ty-this._cy)*0.2;\n if(Math.abs(nx-this._tx)>0){this._cx=Math.abs(nx-this._tx)<2?this._tx:nx;this._cursor.style.left=this._cx+\'px\';}\n if(Math.abs(ny-this._ty)>0){this._cy=Math.abs(ny-this._ty)<2?this._ty:ny;this._cursor.style.top=this._cy+\'px\';}\n requestAnimationFrame(this._animate.bind(this));\n };\n \n LiteMask.prototype.show=function(){\n if(this.shown)return;this.shown=true;\n this.wrapper.classList.add(\'__pa_vis\');\n this._cx=window.innerWidth/2;this._cy=window.innerHeight/2;\n this._tx=this._cx;this._ty=this._cy;\n this._cursor.style.left=this._cx+\'px\';this._cursor.style.top=this._cy+\'px\';\n };\n \n LiteMask.prototype.hide=function(){\n if(!this.shown)return;this.shown=false;\n this._cursor.classList.remove(\'__pa_click\');\n var w=this.wrapper;\n setTimeout(function(){w.classList.remove(\'__pa_vis\');},300);\n };\n \n LiteMask.prototype.dispose=function(){this.wrapper.remove();};\n \n window.__LiteMask=LiteMask;\n})();\n\n// --- PageController (modified: SimulatorMask replaced with LiteMask) ---\n(function(){\n(function(){var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function isHTMLElement(el){return!!el&&el.nodeType===1}__name(isHTMLElement,"isHTMLElement");function isInputElement(el){return el?.nodeType===1&&el.tagName==="INPUT"}__name(isInputElement,"isInputElement");function isTextAreaElement(el){return el?.nodeType===1&&el.tagName==="TEXTAREA"}__name(isTextAreaElement,"isTextAreaElement");function isSelectElement(el){return el?.nodeType===1&&el.tagName==="SELECT"}__name(isSelectElement,"isSelectElement");function isAnchorElement(el){return el?.nodeType===1&&el.tagName==="A"}__name(isAnchorElement,"isAnchorElement");function getIframeOffset(element){const frame=element.ownerDocument.defaultView?.frameElement;if(!frame)return{x:0,y:0};const rect=frame.getBoundingClientRect();return{x:rect.left,y:rect.top}}__name(getIframeOffset,"getIframeOffset");function getNativeValueSetter(element){return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element),"value").set}__name(getNativeValueSetter,"getNativeValueSetter");async function waitFor(seconds){await new Promise((resolve)=>setTimeout(resolve,seconds*1000))}__name(waitFor,"waitFor");async function movePointerToElement(element){const rect=element.getBoundingClientRect();const offset=getIframeOffset(element);const x=rect.left+rect.width/2+offset.x;const y=rect.top+rect.height/2+offset.y;window.dispatchEvent(new CustomEvent("PageAgent::MovePointerTo",{detail:{x,y}}));await waitFor(0.3)}__name(movePointerToElement,"movePointerToElement");function getElementByIndex(selectorMap,index){const interactiveNode=selectorMap.get(index);if(!interactiveNode){throw new Error(`No interactive element found at index ${index}`)}const element=interactiveNode.ref;if(!element){throw new Error(`Element at index ${index} does not have a reference`)}if(!isHTMLElement(element)){throw new Error(`Element at index ${index} is not an HTMLElement`)}return element}__name(getElementByIndex,"getElementByIndex");let lastClickedElement=null;function blurLastClickedElement(){if(lastClickedElement){lastClickedElement.blur();lastClickedElement.dispatchEvent(new MouseEvent("mouseout",{bubbles:true,cancelable:true}));lastClickedElement.dispatchEvent(new MouseEvent("mouseleave",{bubbles:false,cancelable:true}));lastClickedElement=null}}__name(blurLastClickedElement,"blurLastClickedElement");async function clickElement(element){blurLastClickedElement();lastClickedElement=element;await scrollIntoViewIfNeeded(element);const frame=element.ownerDocument.defaultView?.frameElement;if(frame)await scrollIntoViewIfNeeded(frame);await movePointerToElement(element);window.dispatchEvent(new CustomEvent("PageAgent::ClickPointer"));await waitFor(0.1);element.dispatchEvent(new MouseEvent("mouseenter",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mouseover",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mousedown",{bubbles:true,cancelable:true}));element.focus();element.dispatchEvent(new MouseEvent("mouseup",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("click",{bubbles:true,cancelable:true}));await waitFor(0.2)}__name(clickElement,"clickElement");async function inputTextElement(element,text){const isContentEditable=element.isContentEditable;if(!isInputElement(element)&&!isTextAreaElement(element)&&!isContentEditable){throw new Error("Element is not an input, textarea, or contenteditable")}await clickElement(element);if(isContentEditable){if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"deleteContent"}))){element.innerText="";element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"deleteContent"}))}if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"insertText",data:text}))){element.innerText=text;element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:text}))}const planASucceeded=element.innerText.trim()===text.trim();if(!planASucceeded){element.focus();const doc=element.ownerDocument;const selection=(doc.defaultView||window).getSelection();const range=doc.createRange();range.selectNodeContents(element);selection?.removeAllRanges();selection?.addRange(range);doc.execCommand("delete",false);doc.execCommand("insertText",false,text)}element.dispatchEvent(new Event("change",{bubbles:true}));element.blur()}else{getNativeValueSetter(element).call(element,text)}if(!isContentEditable){element.dispatchEvent(new Event("input",{bubbles:true}))}await waitFor(0.1);blurLastClickedElement()}__name(inputTextElement,"inputTextElement");async function selectOptionElement(selectElement,optionText){if(!isSelectElement(selectElement)){throw new Error("Element is not a select element")}const options=Array.from(selectElement.options);const option=options.find((opt)=>opt.textContent?.trim()===optionText.trim());if(!option){throw new Error(`Option with text "${optionText}" not found in select element`)}selectElement.value=option.value;selectElement.dispatchEvent(new Event("change",{bubbles:true}));await waitFor(0.1)}__name(selectOptionElement,"selectOptionElement");async function scrollIntoViewIfNeeded(element){const el=element;if(typeof el.scrollIntoViewIfNeeded==="function"){el.scrollIntoViewIfNeeded()}else{element.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})}}__name(scrollIntoViewIfNeeded,"scrollIntoViewIfNeeded");async function scrollVertically(down,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dy2=scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableY=/(auto|scroll|overlay)/.test(computedStyle.overflowY);const canScrollVertically=currentElement.scrollHeight>currentElement.clientHeight;if(hasScrollableY&&canScrollVertically){const beforeScroll=currentElement.scrollTop;const maxScroll=currentElement.scrollHeight-currentElement.clientHeight;let scrollAmount=dy2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollTop=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollTop;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) by ${scrollDelta}px`}else{return`No scrollable container found for element (${targetElement.tagName})`}}const dy=scroll_amount;const bigEnough=__name((el2)=>el2.clientHeight>=window.innerHeight*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowY)&&el2.scrollHeight>el2.clientHeight&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollY;const scrollMax=document.documentElement.scrollHeight-window.innerHeight;window.scrollBy(0,dy);const scrollAfter=window.scrollY;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of the page, cannot scroll down further.`:`⚠️ Already at the top of the page, cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled page by ${scrolled}px. Reached the bottom of the page.`;if(reachedTop)return`✅ Scrolled page by ${scrolled}px. Reached the top of the page.`;return`✅ Scrolled page by ${scrolled}px.`}else{const scrollBefore=el.scrollTop;const scrollMax=el.scrollHeight-el.clientHeight;el.scrollBy({top:dy,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollTop;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of container (${el.tagName}), cannot scroll down further.`:`⚠️ Already at the top of container (${el.tagName}), cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the bottom.`;if(reachedTop)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the top.`;return`✅ Scrolled container (${el.tagName}) by ${scrolled}px.`}}__name(scrollVertically,"scrollVertically");async function scrollHorizontally(right,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dx2=right?scroll_amount:-scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableX=/(auto|scroll|overlay)/.test(computedStyle.overflowX);const canScrollHorizontally=currentElement.scrollWidth>currentElement.clientWidth;if(hasScrollableX&&canScrollHorizontally){const beforeScroll=currentElement.scrollLeft;const maxScroll=currentElement.scrollWidth-currentElement.clientWidth;let scrollAmount=dx2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollLeft=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollLeft;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) horizontally by ${scrollDelta}px`}else{return`No horizontally scrollable container found for element (${targetElement.tagName})`}}const dx=right?scroll_amount:-scroll_amount;const bigEnough=__name((el2)=>el2.clientWidth>=window.innerWidth*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowX)&&el2.scrollWidth>el2.clientWidth&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollX;const scrollMax=document.documentElement.scrollWidth-window.innerWidth;window.scrollBy(dx,0);const scrollAfter=window.scrollX;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of the page, cannot scroll right further.`:`⚠️ Already at the left edge of the page, cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled page by ${scrolled}px. Reached the right edge of the page.`;if(reachedLeft)return`✅ Scrolled page by ${scrolled}px. Reached the left edge of the page.`;return`✅ Scrolled page horizontally by ${scrolled}px.`}else{const scrollBefore=el.scrollLeft;const scrollMax=el.scrollWidth-el.clientWidth;el.scrollBy({left:dx,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollLeft;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of container (${el.tagName}), cannot scroll right further.`:`⚠️ Already at the left edge of container (${el.tagName}), cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the right edge.`;if(reachedLeft)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the left edge.`;return`✅ Scrolled container (${el.tagName}) horizontally by ${scrolled}px.`}}__name(scrollHorizontally,"scrollHorizontally");const domTree=__name((args={doHighlightElements:true,focusHighlightIndex:-1,viewportExpansion:0,debugMode:false,interactiveBlacklist:[],interactiveWhitelist:[],highlightOpacity:0.1,highlightLabelOpacity:0.5})=>{const{interactiveBlacklist,interactiveWhitelist,highlightOpacity,highlightLabelOpacity}=args;const{doHighlightElements,focusHighlightIndex,viewportExpansion,debugMode}=args;let highlightIndex=0;const extraData=new WeakMap;function addExtraData(element,data){if(!element||element.nodeType!==Node.ELEMENT_NODE)return;extraData.set(element,{...extraData.get(element),...data})}__name(addExtraData,"addExtraData");const DOM_CACHE={boundingRects:new WeakMap,clientRects:new WeakMap,computedStyles:new WeakMap,clearCache:__name(()=>{DOM_CACHE.boundingRects=new WeakMap;DOM_CACHE.clientRects=new WeakMap;DOM_CACHE.computedStyles=new WeakMap},"clearCache")};function getCachedBoundingRect(element){if(!element)return null;if(DOM_CACHE.boundingRects.has(element)){return DOM_CACHE.boundingRects.get(element)}const rect=element.getBoundingClientRect();if(rect){DOM_CACHE.boundingRects.set(element,rect)}return rect}__name(getCachedBoundingRect,"getCachedBoundingRect");function getCachedComputedStyle(element){if(!element)return null;if(DOM_CACHE.computedStyles.has(element)){return DOM_CACHE.computedStyles.get(element)}const style=window.getComputedStyle(element);if(style){DOM_CACHE.computedStyles.set(element,style)}return style}__name(getCachedComputedStyle,"getCachedComputedStyle");function getCachedClientRects(element){if(!element)return null;if(DOM_CACHE.clientRects.has(element)){return DOM_CACHE.clientRects.get(element)}const rects=element.getClientRects();if(rects){DOM_CACHE.clientRects.set(element,rects)}return rects}__name(getCachedClientRects,"getCachedClientRects");const DOM_HASH_MAP={};const ID={current:0};const HIGHLIGHT_CONTAINER_ID="playwright-highlight-container";function highlightElement(element,index,parentIframe=null){if(!element)return index;const overlays=[];let label=null;let labelWidth=20;let labelHeight=16;let cleanupFn=null;try{let container=document.getElementById(HIGHLIGHT_CONTAINER_ID);if(!container){container=document.createElement("div");container.id=HIGHLIGHT_CONTAINER_ID;container.style.position="fixed";container.style.pointerEvents="none";container.style.top="0";container.style.left="0";container.style.width="100%";container.style.height="100%";container.style.zIndex="2147483640";container.style.backgroundColor="transparent";document.body.appendChild(container)}const rects=element.getClientRects();if(!rects||rects.length===0)return index;const colors=["#FF0000","#00FF00","#0000FF","#FFA500","#800080","#008080","#FF69B4","#4B0082","#FF4500","#2E8B57","#DC143C","#4682B4"];const colorIndex=index%colors.length;let baseColor=colors[colorIndex];const backgroundColor=baseColor+Math.floor(highlightOpacity*255).toString(16).padStart(2,"0");baseColor=baseColor+Math.floor(highlightLabelOpacity*255).toString(16).padStart(2,"0");let iframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();iframeOffset.x=iframeRect.left;iframeOffset.y=iframeRect.top}const fragment=document.createDocumentFragment();for(const rect of rects){if(rect.width===0||rect.height===0)continue;const overlay=document.createElement("div");overlay.style.position="fixed";overlay.style.border=`2px solid ${baseColor}`;overlay.style.backgroundColor=backgroundColor;overlay.style.pointerEvents="none";overlay.style.boxSizing="border-box";const top=rect.top+iframeOffset.y;const left=rect.left+iframeOffset.x;overlay.style.top=`${top}px`;overlay.style.left=`${left}px`;overlay.style.width=`${rect.width}px`;overlay.style.height=`${rect.height}px`;fragment.appendChild(overlay);overlays.push({element:overlay,initialRect:rect})}const firstRect=rects[0];label=document.createElement("div");label.className="playwright-highlight-label";label.style.position="fixed";label.style.background=baseColor;label.style.color="white";label.style.padding="1px 4px";label.style.borderRadius="4px";label.style.fontSize=`${Math.min(12,Math.max(8,firstRect.height/2))}px`;label.textContent=index.toString();labelWidth=label.offsetWidth>0?label.offsetWidth:labelWidth;labelHeight=label.offsetHeight>0?label.offsetHeight:labelHeight;const firstRectTop=firstRect.top+iframeOffset.y;const firstRectLeft=firstRect.left+iframeOffset.x;let labelTop=firstRectTop+2;let labelLeft=firstRectLeft+firstRect.width-labelWidth-2;if(firstRect.width<labelWidth+4||firstRect.height<labelHeight+4){labelTop=firstRectTop-labelHeight-2;labelLeft=firstRectLeft+firstRect.width-labelWidth;if(labelLeft<iframeOffset.x)labelLeft=firstRectLeft}labelTop=Math.max(0,Math.min(labelTop,window.innerHeight-labelHeight));labelLeft=Math.max(0,Math.min(labelLeft,window.innerWidth-labelWidth));label.style.top=`${labelTop}px`;label.style.left=`${labelLeft}px`;fragment.appendChild(label);const updatePositions=__name(()=>{const newRects=element.getClientRects();let newIframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();newIframeOffset.x=iframeRect.left;newIframeOffset.y=iframeRect.top}overlays.forEach((overlayData,i)=>{if(i<newRects.length){const newRect=newRects[i];const newTop=newRect.top+newIframeOffset.y;const newLeft=newRect.left+newIframeOffset.x;overlayData.element.style.top=`${newTop}px`;overlayData.element.style.left=`${newLeft}px`;overlayData.element.style.width=`${newRect.width}px`;overlayData.element.style.height=`${newRect.height}px`;overlayData.element.style.display=newRect.width===0||newRect.height===0?"none":"block"}else{overlayData.element.style.display="none"}});if(newRects.length<overlays.length){for(let i=newRects.length;i<overlays.length;i++){overlays[i].element.style.display="none"}}if(label&&newRects.length>0){const firstNewRect=newRects[0];const firstNewRectTop=firstNewRect.top+newIframeOffset.y;const firstNewRectLeft=firstNewRect.left+newIframeOffset.x;let newLabelTop=firstNewRectTop+2;let newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth-2;if(firstNewRect.width<labelWidth+4||firstNewRect.height<labelHeight+4){newLabelTop=firstNewRectTop-labelHeight-2;newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth;if(newLabelLeft<newIframeOffset.x)newLabelLeft=firstNewRectLeft}newLabelTop=Math.max(0,Math.min(newLabelTop,window.innerHeight-labelHeight));newLabelLeft=Math.max(0,Math.min(newLabelLeft,window.innerWidth-labelWidth));label.style.top=`${newLabelTop}px`;label.style.left=`${newLabelLeft}px`;label.style.display="block"}else if(label){label.style.display="none"}},"updatePositions");const throttleFunction=__name((func,delay)=>{let lastCall=0;return(...args2)=>{const now=performance.now();if(now-lastCall<delay)return;lastCall=now;return func(...args2)}},"throttleFunction");const throttledUpdatePositions=throttleFunction(updatePositions,16);window.addEventListener("scroll",throttledUpdatePositions,true);window.addEventListener("resize",throttledUpdatePositions);cleanupFn=__name(()=>{window.removeEventListener("scroll",throttledUpdatePositions,true);window.removeEventListener("resize",throttledUpdatePositions);overlays.forEach((overlay)=>overlay.element.remove());if(label)label.remove()},"cleanupFn");container.appendChild(fragment);return index+1}finally{if(cleanupFn){(window._highlightCleanupFunctions=window._highlightCleanupFunctions||[]).push(cleanupFn)}}}__name(highlightElement,"highlightElement");function isScrollableElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return null}const style=getCachedComputedStyle(element);if(!style)return null;const display=style.display;if(display==="inline"||display==="inline-block"){return null}const overflowX=style.overflowX;const overflowY=style.overflowY;const scrollableX=overflowX==="auto"||overflowX==="scroll";const scrollableY=overflowY==="auto"||overflowY==="scroll";if(!scrollableX&&!scrollableY){return null}const scrollWidth=element.scrollWidth-element.clientWidth;const scrollHeight=element.scrollHeight-element.clientHeight;const threshold=4;if(scrollWidth<threshold&&scrollHeight<threshold){return null}if(!scrollableY&&scrollWidth<threshold){return null}if(!scrollableX&&scrollHeight<threshold){return null}const distanceToTop=element.scrollTop;const distanceToLeft=element.scrollLeft;const distanceToRight=element.scrollWidth-element.clientWidth-element.scrollLeft;const distanceToBottom=element.scrollHeight-element.clientHeight-element.scrollTop;const scrollData={top:distanceToTop,right:distanceToRight,bottom:distanceToBottom,left:distanceToLeft};addExtraData(element,{scrollable:true,scrollData});return scrollData}__name(isScrollableElement,"isScrollableElement");function isTextNodeVisible(textNode){try{if(viewportExpansion===-1){const parentElement2=textNode.parentElement;if(!parentElement2)return false;try{return parentElement2.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement2);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}const range=document.createRange();range.selectNodeContents(textNode);const rects=range.getClientRects();if(!rects||rects.length===0){return false}let isAnyRectVisible=false;let isAnyRectInViewport=false;for(const rect of rects){if(rect.width>0&&rect.height>0){isAnyRectVisible=true;if(!(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}}if(!isAnyRectVisible||!isAnyRectInViewport){return false}const parentElement=textNode.parentElement;if(!parentElement)return false;try{return parentElement.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}catch(e){console.warn("Error checking text node visibility:",e);return false}}__name(isTextNodeVisible,"isTextNodeVisible");function isElementAccepted(element){if(!element||!element.tagName)return false;const alwaysAccept=new Set(["body","div","main","article","section","nav","header","footer"]);const tagName=element.tagName.toLowerCase();if(alwaysAccept.has(tagName))return true;const leafElementDenyList=new Set(["svg","script","style","link","meta","noscript","template"]);return!leafElementDenyList.has(tagName)}__name(isElementAccepted,"isElementAccepted");function isElementVisible(element){const style=getCachedComputedStyle(element);return element.offsetWidth>0&&element.offsetHeight>0&&style?.visibility!=="hidden"&&style?.display!=="none"}__name(isElementVisible,"isElementVisible");function isInteractiveElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}if(interactiveBlacklist.includes(element)){return false}if(interactiveWhitelist.includes(element)){return true}const tagName=element.tagName.toLowerCase();const style=getCachedComputedStyle(element);const interactiveCursors=new Set(["pointer","move","text","grab","grabbing","cell","copy","alias","all-scroll","col-resize","context-menu","crosshair","e-resize","ew-resize","help","n-resize","ne-resize","nesw-resize","ns-resize","nw-resize","nwse-resize","row-resize","s-resize","se-resize","sw-resize","vertical-text","w-resize","zoom-in","zoom-out"]);const nonInteractiveCursors=new Set(["not-allowed","no-drop","wait","progress","initial","inherit"]);function doesElementHaveInteractivePointer(element2){if(element2.tagName.toLowerCase()==="html")return false;if(style?.cursor&&interactiveCursors.has(style.cursor))return true;return false}__name(doesElementHaveInteractivePointer,"doesElementHaveInteractivePointer");let isInteractiveCursor=doesElementHaveInteractivePointer(element);if(isInteractiveCursor){return true}const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label","option","optgroup","fieldset","legend"]);const explicitDisableTags=new Set(["disabled","readonly"]);if(interactiveElements.has(tagName)){if(style?.cursor&&nonInteractiveCursors.has(style.cursor)){return false}for(const disableTag of explicitDisableTags){if(element.hasAttribute(disableTag)||element.getAttribute(disableTag)==="true"||element.getAttribute(disableTag)===""){return false}}if(element.disabled){return false}if(element.readOnly){return false}if(element.inert){return false}return true}const role=element.getAttribute("role");const ariaRole=element.getAttribute("aria-role");if(element.getAttribute("contenteditable")==="true"||element.isContentEditable){return true}if(element.classList&&(element.classList.contains("button")||element.classList.contains("dropdown-toggle")||element.getAttribute("data-index")||element.getAttribute("data-toggle")==="dropdown"||element.getAttribute("aria-haspopup")==="true")){return true}const interactiveRoles=new Set(["button","menu","menubar","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);const hasInteractiveRole=interactiveElements.has(tagName)||role&&interactiveRoles.has(role)||ariaRole&&interactiveRoles.has(ariaRole);if(hasInteractiveRole)return true;try{if(typeof getEventListeners==="function"){const listeners=getEventListeners(element);const mouseEvents=["click","mousedown","mouseup","dblclick"];for(const eventType of mouseEvents){if(listeners[eventType]&&listeners[eventType].length>0){return true}}}const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonMouseAttrs=["onclick","onmousedown","onmouseup","ondblclick"];for(const attr of commonMouseAttrs){if(element.hasAttribute(attr)||typeof element[attr]==="function"){return true}}}catch(e){}if(isScrollableElement(element)){return true}return false}__name(isInteractiveElement,"isInteractiveElement");function isTopElement(element){if(viewportExpansion===-1){return true}const rects=getCachedClientRects(element);if(!rects||rects.length===0){return false}let isAnyRectInViewport=false;for(const rect2 of rects){if(rect2.width>0&&rect2.height>0&&!(rect2.bottom<-viewportExpansion||rect2.top>window.innerHeight+viewportExpansion||rect2.right<-viewportExpansion||rect2.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}if(!isAnyRectInViewport){return false}let doc=element.ownerDocument;if(doc!==window.document){return true}let rect=Array.from(rects).find((r)=>r.width>0&&r.height>0);if(!rect){return false}const shadowRoot=element.getRootNode();if(shadowRoot instanceof ShadowRoot){const centerX=rect.left+rect.width/2;const centerY=rect.top+rect.height/2;try{const topEl=shadowRoot.elementFromPoint(centerX,centerY);if(!topEl)return false;let current=topEl;while(current&&current!==shadowRoot){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}}const margin=5;const checkPoints=[{x:rect.left+rect.width/2,y:rect.top+rect.height/2},{x:rect.left+margin,y:rect.top+margin},{x:rect.right-margin,y:rect.bottom-margin}];return checkPoints.some(({x,y})=>{try{const topEl=document.elementFromPoint(x,y);if(!topEl)return false;let current=topEl;while(current&&current!==document.documentElement){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}})}__name(isTopElement,"isTopElement");function isInExpandedViewport(element,viewportExpansion2){if(viewportExpansion2===-1){return true}const rects=element.getClientRects();if(!rects||rects.length===0){const boundingRect=getCachedBoundingRect(element);if(!boundingRect||boundingRect.width===0||boundingRect.height===0){return false}return!(boundingRect.bottom<-viewportExpansion2||boundingRect.top>window.innerHeight+viewportExpansion2||boundingRect.right<-viewportExpansion2||boundingRect.left>window.innerWidth+viewportExpansion2)}for(const rect of rects){if(rect.width===0||rect.height===0)continue;if(!(rect.bottom<-viewportExpansion2||rect.top>window.innerHeight+viewportExpansion2||rect.right<-viewportExpansion2||rect.left>window.innerWidth+viewportExpansion2)){return true}}return false}__name(isInExpandedViewport,"isInExpandedViewport");function isInteractiveCandidate(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;const tagName=element.tagName.toLowerCase();const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label"]);if(interactiveElements.has(tagName))return true;const hasQuickInteractiveAttr=element.hasAttribute("onclick")||element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("aria-")||element.hasAttribute("data-action")||element.getAttribute("contenteditable")==="true";return hasQuickInteractiveAttr}__name(isInteractiveCandidate,"isInteractiveCandidate");const DISTINCT_INTERACTIVE_TAGS=new Set(["a","button","input","select","textarea","summary","details","label","option"]);const INTERACTIVE_ROLES=new Set(["button","link","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);function isHeuristicallyInteractive(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;if(!isElementVisible(element))return false;const hasInteractiveAttributes=element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("onclick")||typeof element.onclick==="function";const hasInteractiveClass=/\\b(btn|clickable|menu|item|entry|link)\\b/i.test(element.className||"");const isInKnownContainer=Boolean(element.closest(\'button,a,[role="button"],.menu,.dropdown,.list,.toolbar\'));const hasVisibleChildren=[...element.children].some(isElementVisible);const isParentBody=element.parentElement&&element.parentElement.isSameNode(document.body);return(isInteractiveElement(element)||hasInteractiveAttributes||hasInteractiveClass)&&hasVisibleChildren&&isInKnownContainer&&!isParentBody}__name(isHeuristicallyInteractive,"isHeuristicallyInteractive");function isElementDistinctInteraction(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}const tagName=element.tagName.toLowerCase();const role=element.getAttribute("role");if(tagName==="iframe"){return true}if(DISTINCT_INTERACTIVE_TAGS.has(tagName)){return true}if(role&&INTERACTIVE_ROLES.has(role)){return true}if(element.isContentEditable||element.getAttribute("contenteditable")==="true"){return true}if(element.hasAttribute("data-testid")||element.hasAttribute("data-cy")||element.hasAttribute("data-test")){return true}if(element.hasAttribute("onclick")||typeof element.onclick==="function"){return true}try{const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonEventAttrs=["onmousedown","onmouseup","onkeydown","onkeyup","onsubmit","onchange","oninput","onfocus","onblur"];if(commonEventAttrs.some((attr)=>element.hasAttribute(attr))){return true}}catch(e){}if(isHeuristicallyInteractive(element)){return true}return false}__name(isElementDistinctInteraction,"isElementDistinctInteraction");function handleHighlighting(nodeData,node,parentIframe,isParentHighlighted){if(!nodeData.isInteractive)return false;let shouldHighlight=false;if(!isParentHighlighted){shouldHighlight=true}else{if(isElementDistinctInteraction(node)){shouldHighlight=true}else{shouldHighlight=false}}if(shouldHighlight){nodeData.isInViewport=isInExpandedViewport(node,viewportExpansion);if(nodeData.isInViewport||viewportExpansion===-1){nodeData.highlightIndex=highlightIndex++;if(doHighlightElements){if(focusHighlightIndex>=0){if(focusHighlightIndex===nodeData.highlightIndex){highlightElement(node,nodeData.highlightIndex,parentIframe)}}else{highlightElement(node,nodeData.highlightIndex,parentIframe)}return true}}}return false}__name(handleHighlighting,"handleHighlighting");function buildDomTree(node,parentIframe=null,isParentHighlighted=false){if(!node||node.id===HIGHLIGHT_CONTAINER_ID||node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(!node||node.id===HIGHLIGHT_CONTAINER_ID){return null}if(node.dataset?.browserUseIgnore==="true"||node.dataset?.pageAgentIgnore==="true"){return null}if(node.getAttribute&&node.getAttribute("aria-hidden")==="true"){return null}if(node===document.body){const nodeData2={tagName:"body",attributes:{},xpath:"/body",children:[]};for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,false);if(domElement)nodeData2.children.push(domElement)}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]=nodeData2;return id2}if(node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(node.nodeType===Node.TEXT_NODE){const textContent=node.textContent?.trim();if(!textContent){return null}const parentElement=node.parentElement;if(!parentElement||parentElement.tagName.toLowerCase()==="script"){return null}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]={type:"TEXT_NODE",text:textContent,isVisible:isTextNodeVisible(node)};return id2}if(node.nodeType===Node.ELEMENT_NODE&&!isElementAccepted(node)){return null}if(viewportExpansion!==-1&&!node.shadowRoot){const rect=getCachedBoundingRect(node);const style=getCachedComputedStyle(node);const isFixedOrSticky=style&&(style.position==="fixed"||style.position==="sticky");const hasSize=node.offsetWidth>0||node.offsetHeight>0;if(!rect||!isFixedOrSticky&&!hasSize&&(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){return null}}const nodeData={tagName:node.tagName.toLowerCase(),attributes:{},children:[]};if(isInteractiveCandidate(node)||node.tagName.toLowerCase()==="iframe"||node.tagName.toLowerCase()==="body"){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}if(node.tagName.toLowerCase()==="input"&&(node.type==="checkbox"||node.type==="radio")){nodeData.attributes.checked=node.checked?"true":"false"}}let nodeWasHighlighted=false;if(node.nodeType===Node.ELEMENT_NODE){nodeData.isVisible=isElementVisible(node);if(nodeData.isVisible){nodeData.isTopElement=isTopElement(node);const role=node.getAttribute("role");const isMenuContainer=role==="menu"||role==="menubar"||role==="listbox";if(nodeData.isTopElement||isMenuContainer){nodeData.isInteractive=isInteractiveElement(node);nodeWasHighlighted=handleHighlighting(nodeData,node,parentIframe,isParentHighlighted);nodeData.ref=node;if(nodeData.isInteractive&&Object.keys(nodeData.attributes).length===0){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}}}}}if(node.tagName){const tagName=node.tagName.toLowerCase();if(tagName==="iframe"){try{const iframeDoc=node.contentDocument||node.contentWindow?.document;if(iframeDoc){for(const child of iframeDoc.childNodes){const domElement=buildDomTree(child,node,false);if(domElement)nodeData.children.push(domElement)}}}catch(e){console.warn("Unable to access iframe:",e)}}else if(node.isContentEditable||node.getAttribute("contenteditable")==="true"||node.id==="tinymce"||node.classList.contains("mce-content-body")||tagName==="body"&&node.getAttribute("data-id")?.startsWith("mce_")){for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}else{if(node.shadowRoot){nodeData.shadowRoot=true;for(const child of node.shadowRoot.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}for(const child of node.childNodes){const passHighlightStatusToChild=nodeWasHighlighted||isParentHighlighted;const domElement=buildDomTree(child,parentIframe,passHighlightStatusToChild);if(domElement)nodeData.children.push(domElement)}}}if(nodeData.tagName==="a"&&nodeData.children.length===0&&!nodeData.attributes.href){const rect=getCachedBoundingRect(node);const hasSize=rect&&rect.width>0&&rect.height>0||node.offsetWidth>0||node.offsetHeight>0;if(!hasSize){return null}}nodeData.extra=extraData.get(node)||null;const id=`${ID.current++}`;DOM_HASH_MAP[id]=nodeData;return id}__name(buildDomTree,"buildDomTree");const rootId=buildDomTree(document.body);DOM_CACHE.clearCache();return{rootId,map:DOM_HASH_MAP}},"domTree");const DEFAULT_VIEWPORT_EXPANSION=-1;function resolveViewportExpansion(viewportExpansion){return viewportExpansion??DEFAULT_VIEWPORT_EXPANSION}__name(resolveViewportExpansion,"resolveViewportExpansion");const newElementsCache=new WeakMap;function getFlatTree(config){const viewportExpansion=resolveViewportExpansion(config.viewportExpansion);const interactiveBlacklist=[];for(const item of config.interactiveBlacklist||[]){if(typeof item==="function"){interactiveBlacklist.push(item())}else{interactiveBlacklist.push(item)}}const interactiveWhitelist=[];for(const item of config.interactiveWhitelist||[]){if(typeof item==="function"){interactiveWhitelist.push(item())}else{interactiveWhitelist.push(item)}}const elements=domTree({doHighlightElements:true,debugMode:true,focusHighlightIndex:-1,viewportExpansion,interactiveBlacklist,interactiveWhitelist,highlightOpacity:config.highlightOpacity??0,highlightLabelOpacity:config.highlightLabelOpacity??0.1});const currentUrl=window.location.href;for(const nodeId in elements.map){const node=elements.map[nodeId];if(node.isInteractive&&node.ref){const ref=node.ref;if(!newElementsCache.has(ref)){newElementsCache.set(ref,currentUrl);node.isNew=true}}}return elements}__name(getFlatTree,"getFlatTree");const globRegexCache=new Map;function globToRegex(pattern){let regex=globRegexCache.get(pattern);if(!regex){const escaped=pattern.replace(/[.+^${}()|[\\]\\\\]/g,"\\\\$&");regex=new RegExp(`^${escaped.replace(/\\*/g,".*")}$`);globRegexCache.set(pattern,regex)}return regex}__name(globToRegex,"globToRegex");function matchAttributes(attrs,patterns){const result2={};for(const pattern of patterns){if(pattern.includes("*")){const regex=globToRegex(pattern);for(const key of Object.keys(attrs)){if(regex.test(key)&&attrs[key].trim()){result2[key]=attrs[key].trim()}}}else{const value=attrs[pattern];if(value&&value.trim()){result2[pattern]=value.trim()}}}return result2}__name(matchAttributes,"matchAttributes");function flatTreeToString(flatTree,includeAttributes){const DEFAULT_INCLUDE_ATTRIBUTES=["title","type","checked","name","role","value","placeholder","data-date-format","alt","aria-label","aria-expanded","data-state","aria-checked","id","for","target","aria-haspopup","aria-controls","aria-owns","contenteditable"];const includeAttrs=[...includeAttributes||[],...DEFAULT_INCLUDE_ATTRIBUTES];const capTextLength=__name((text,maxLength)=>{if(text.length>maxLength){return text.substring(0,maxLength)+"..."}return text},"capTextLength");const buildTreeNode=__name((nodeId)=>{const node=flatTree.map[nodeId];if(!node)return null;if(node.type==="TEXT_NODE"){const textNode=node;return{type:"text",text:textNode.text,isVisible:textNode.isVisible,parent:null,children:[]}}else{const elementNode=node;const children=[];if(elementNode.children){for(const childId of elementNode.children){const child=buildTreeNode(childId);if(child){child.parent=null;children.push(child)}}}return{type:"element",tagName:elementNode.tagName,attributes:elementNode.attributes??{},isVisible:elementNode.isVisible??false,isInteractive:elementNode.isInteractive??false,isTopElement:elementNode.isTopElement??false,isNew:elementNode.isNew??false,highlightIndex:elementNode.highlightIndex,parent:null,children,extra:elementNode.extra??{}}}},"buildTreeNode");const setParentReferences=__name((node,parent=null)=>{node.parent=parent;for(const child of node.children){setParentReferences(child,node)}},"setParentReferences");const rootNode=buildTreeNode(flatTree.rootId);if(!rootNode)return"";setParentReferences(rootNode);const hasParentWithHighlightIndex=__name((node)=>{let current=node.parent;while(current){if(current.type==="element"&&current.highlightIndex!==undefined){return true}current=current.parent}return false},"hasParentWithHighlightIndex");const processNode=__name((node,depth,result22)=>{let nextDepth=depth;const depthStr="\\t".repeat(depth);if(node.type==="element"){if(node.highlightIndex!==undefined){nextDepth+=1;const text=getAllTextTillNextClickableElement(node);let attributesHtmlStr="";if(includeAttrs.length>0&&node.attributes){const attributesToInclude=matchAttributes(node.attributes,includeAttrs);const keys=Object.keys(attributesToInclude);if(keys.length>1){const keysToRemove=new Set;const seenValues={};for(const key of keys){const value=attributesToInclude[key];if(value.length>5){if(value in seenValues){keysToRemove.add(key)}else{seenValues[value]=key}}}for(const key of keysToRemove){delete attributesToInclude[key]}}if(attributesToInclude.role===node.tagName){delete attributesToInclude.role}const attrsToRemoveIfTextMatches=["aria-label","placeholder","title"];for(const attr of attrsToRemoveIfTextMatches){if(attributesToInclude[attr]&&attributesToInclude[attr].toLowerCase().trim()===text.toLowerCase().trim()){delete attributesToInclude[attr]}}if(Object.keys(attributesToInclude).length>0){attributesHtmlStr=Object.entries(attributesToInclude).map(([key,value])=>`${key}=${capTextLength(value,20)}`).join(" ")}}const highlightIndicator=node.isNew?`*[${node.highlightIndex}]`:`[${node.highlightIndex}]`;let line=`${depthStr}${highlightIndicator}<${node.tagName??""}`;if(attributesHtmlStr){line+=` ${attributesHtmlStr}`}if(node.extra){if(node.extra.scrollable){let scrollDataText="";if(node.extra.scrollData?.left)scrollDataText+=`left=${node.extra.scrollData.left}, `;if(node.extra.scrollData?.top)scrollDataText+=`top=${node.extra.scrollData.top}, `;if(node.extra.scrollData?.right)scrollDataText+=`right=${node.extra.scrollData.right}, `;if(node.extra.scrollData?.bottom)scrollDataText+=`bottom=${node.extra.scrollData.bottom}`;line+=` data-scrollable="${scrollDataText}"`}}if(text){const trimmedText=text.trim();if(!attributesHtmlStr){line+=" "}line+=`>${trimmedText}`}else if(!attributesHtmlStr){line+=" "}line+=" />";result22.push(line)}for(const child of node.children){processNode(child,nextDepth,result22)}}else if(node.type==="text"){if(hasParentWithHighlightIndex(node)){return}if(node.parent&&node.parent.type==="element"&&node.parent.isVisible&&node.parent.isTopElement){result22.push(`${depthStr}${node.text??""}`)}}},"processNode");const result2=[];processNode(rootNode,0,result2);return result2.join(`\n`)}__name(flatTreeToString,"flatTreeToString");const getAllTextTillNextClickableElement=__name((node,maxDepth=-1)=>{const textParts=[];const collectText=__name((currentNode,currentDepth)=>{if(maxDepth!==-1&&currentDepth>maxDepth){return}if(currentNode.type==="element"&&currentNode!==node&&currentNode.highlightIndex!==undefined){return}if(currentNode.type==="text"&&currentNode.text){textParts.push(currentNode.text)}else if(currentNode.type==="element"){for(const child of currentNode.children){collectText(child,currentDepth+1)}}},"collectText");collectText(node,0);return textParts.join(`\n`).trim()},"getAllTextTillNextClickableElement");function getSelectorMap(flatTree){const selectorMap=new Map;const keys=Object.keys(flatTree.map);for(const key of keys){const node=flatTree.map[key];if(node.isInteractive&&typeof node.highlightIndex==="number"){selectorMap.set(node.highlightIndex,node)}}return selectorMap}__name(getSelectorMap,"getSelectorMap");function getElementTextMap(simplifiedHTML){const lines=simplifiedHTML.split(`\n`).map((line)=>line.trim()).filter((line)=>line.length>0);const elementTextMap=new Map;for(const line of lines){const regex=/^\\[(\\d+)\\]<[^>]+>([^<]*)/;const match=regex.exec(line);if(match){const index=parseInt(match[1],10);elementTextMap.set(index,line)}}return elementTextMap}__name(getElementTextMap,"getElementTextMap");function cleanUpHighlights(){const cleanupFunctions=window._highlightCleanupFunctions||[];for(const cleanup of cleanupFunctions){if(typeof cleanup==="function"){cleanup()}}window._highlightCleanupFunctions=[]}__name(cleanUpHighlights,"cleanUpHighlights");window.addEventListener("popstate",()=>{cleanUpHighlights()});window.addEventListener("hashchange",()=>{cleanUpHighlights()});window.addEventListener("beforeunload",()=>{cleanUpHighlights()});const navigation=window.navigation;if(navigation&&typeof navigation.addEventListener==="function"){navigation.addEventListener("navigate",()=>{cleanUpHighlights()})}else{let currentUrl=window.location.href;setInterval(()=>{if(window.location.href!==currentUrl){currentUrl=window.location.href;cleanUpHighlights()}},500)}function getPageInfo(){const viewport_width=window.innerWidth;const viewport_height=window.innerHeight;const page_width=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth||0);const page_height=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight||0);const scroll_x=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0;const scroll_y=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;const pixels_below=Math.max(0,page_height-(window.innerHeight+scroll_y));const pixels_right=Math.max(0,page_width-(window.innerWidth+scroll_x));return{viewport_width,viewport_height,page_width,page_height,scroll_x,scroll_y,pixels_above:scroll_y,pixels_below,pages_above:viewport_height>0?scroll_y/viewport_height:0,pages_below:viewport_height>0?pixels_below/viewport_height:0,total_pages:viewport_height>0?page_height/viewport_height:0,current_page_position:scroll_y/Math.max(1,page_height-viewport_height),pixels_left:scroll_x,pixels_right}}__name(getPageInfo,"getPageInfo");function patchReact(pageController){const reactRootElements=document.querySelectorAll(\'[data-reactroot], [data-reactid], [data-react-checksum], #root, #app, [id^="root-"], [id^="app-"], #adex-wrapper, #adex-root\');for(const element of reactRootElements){element.setAttribute("data-page-agent-not-interactive","true")}}__name(patchReact,"patchReact");const _PageController=class _PageController extends EventTarget{config;flatTree=null;selectorMap=new Map;elementTextMap=new Map;simplifiedHTML="<EMPTY>";lastTimeUpdate=0;isIndexed=false;mask=null;maskReady=null;constructor(config={}){super();this.config=config;patchReact();if(config.enableMask)this.initMask()}initMask(){if(this.maskReady!==null)return;this.maskReady=(async()=>{var SimulatorMask = window.__LiteMask;this.mask=new SimulatorMask})()}async getCurrentUrl(){return window.location.href}async getLastUpdateTime(){return this.lastTimeUpdate}async getBrowserState(){const url=window.location.href;const title=document.title;const pi=getPageInfo();const viewportExpansion=resolveViewportExpansion(this.config.viewportExpansion);await this.updateTree();const content=this.simplifiedHTML;const titleLine=`Current Page: [${title}](${url})`;const pageInfoLine=`Page info: ${pi.viewport_width}x${pi.viewport_height}px viewport, ${pi.page_width}x${pi.page_height}px total page size, ${pi.pages_above.toFixed(1)} pages above, ${pi.pages_below.toFixed(1)} pages below, ${pi.total_pages.toFixed(1)} total pages, at ${(pi.current_page_position*100).toFixed(0)}% of page`;const elementsLabel=viewportExpansion===-1?"Interactive elements from top layer of the current page (full page):":"Interactive elements from top layer of the current page inside the viewport:";const hasContentAbove=pi.pixels_above>4;const scrollHintAbove=hasContentAbove&&viewportExpansion!==-1?`... ${pi.pixels_above} pixels above (${pi.pages_above.toFixed(1)} pages) - scroll to see more ...`:"[Start of page]";const header=`${titleLine}\n${pageInfoLine}\n\n${elementsLabel}\n\n${scrollHintAbove}`;const hasContentBelow=pi.pixels_below>4;const footer=hasContentBelow&&viewportExpansion!==-1?`... ${pi.pixels_below} pixels below (${pi.pages_below.toFixed(1)} pages) - scroll to see more ...`:"[End of page]";return{url,title,header,content,footer}}async updateTree(){this.dispatchEvent(new Event("beforeUpdate"));this.lastTimeUpdate=Date.now();if(this.mask){this.mask.wrapper.style.pointerEvents="none"}cleanUpHighlights();const blacklist=[...this.config.interactiveBlacklist||[],...document.querySelectorAll("[data-page-agent-not-interactive]").values()];this.flatTree=getFlatTree({...this.config,interactiveBlacklist:blacklist});this.simplifiedHTML=flatTreeToString(this.flatTree,this.config.includeAttributes);this.selectorMap.clear();this.selectorMap=getSelectorMap(this.flatTree);this.elementTextMap.clear();this.elementTextMap=getElementTextMap(this.simplifiedHTML);this.isIndexed=true;if(this.mask){this.mask.wrapper.style.pointerEvents="auto"}this.dispatchEvent(new Event("afterUpdate"));return this.simplifiedHTML}async cleanUpHighlights(){cleanUpHighlights()}assertIndexed(){if(!this.isIndexed){throw new Error("DOM tree not indexed yet. Can not perform actions on elements.")}}async clickElement(index){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await clickElement(element);if(isAnchorElement(element)&&element.target==="_blank"){return{success:true,message:`✅ Clicked element (${elemText??index}). ⚠️ Link opened in a new tab.`}}return{success:true,message:`✅ Clicked element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to click element: ${error}`}}}async inputText(index,text){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await inputTextElement(element,text);return{success:true,message:`✅ Input text (${text}) into element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to input text: ${error}`}}}async selectOption(index,optionText){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await selectOptionElement(element,optionText);return{success:true,message:`✅ Selected option (${optionText}) in element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to select option: ${error}`}}}async scroll(options){try{const{down,numPages,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels??numPages*(down?1:-1)*window.innerHeight;const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollVertically(down,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll: ${error}`}}}async scrollHorizontally(options){try{const{right,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels*(right?1:-1);const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollHorizontally(right,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll horizontally: ${error}`}}}async executeJavascript(script){try{const asyncFunction=eval(`(async () => { ${script} })`);const result=await asyncFunction();return{success:true,message:`✅ Executed JavaScript. Result: ${result}`}}catch(error){return{success:false,message:`❌ Error executing JavaScript: ${error}`}}}async showMask(){await this.maskReady;this.mask?.show()}async hideMask(){await this.maskReady;this.mask?.hide()}dispose(){cleanUpHighlights();this.flatTree=null;this.selectorMap.clear();this.elementTextMap.clear();this.simplifiedHTML="<EMPTY>";this.isIndexed=false;this.mask?.dispose();this.mask=null}};__name(_PageController,"PageController");let PageController=_PageController;window.__PageController=PageController})();\n})();\n\n// --- Signet Page Agent API ---\n(function(){\n var pc = new window.__PageController({ enableMask: false, highlightOpacity: 0, highlightLabelOpacity: 0 });\n \n window.signet = window.signet || {};\n window.signet.pageController = pc;\n \n window.signet.getDomState = async function(){\n try {\n var state = await pc.getBrowserState();\n return { success: true, state: state };\n } catch(e) {\n return { success: false, error: e.message || String(e) };\n }\n };\n \n window.signet.executeAction = async function(action){\n try {\n var result;\n switch(action.type){\n case \'click_element\':\n result = await pc.clickElement(action.index);\n break;\n case \'input_text\':\n result = await pc.inputText(action.index, action.text);\n break;\n case \'select_option\':\n result = await pc.selectOption(action.index, action.text);\n break;\n case \'scroll\':\n result = await pc.scroll({ down: action.direction === \'down\', numPages: action.amount || 1 });\n break;\n default:\n result = { success: false, message: \'Unknown action type: \' + action.type };\n }\n return result;\n } catch(e) {\n return { success: false, message: e.message || String(e) };\n }\n };\n \n window.signet.agentStart = async function(){\n pc.initMask();\n await pc.showMask();\n };\n \n window.signet.agentStop = async function(){\n await pc.hideMask();\n };\n})();',Jt=`
1
+ import{e as We,p as re,s as he,c as ge,f as se,a as fe,n as ve,b as w,d as ie,r as we,j as c,k as J,t as x,l as s,y as ee,z as ae,D as ue,A as Te,i as t,m as N,v as p,o as Y,g as ft,Q as Ze,q as ze,aU as Ve,F as Je,B as xe,u as pe,O as U,P as Se,aa as et,N as Ee,ac as Ie,w as ke,I as Me,x as vt,K as wt,U as yt}from"./V_JjZsJi.js";import{o as me,I as ye,aG as bt,be as xt,bf as _t,H as Et}from"./DySpBuOv.js";import{W as at,L as Tt}from"./Bsjc4PMT.js";import{R as st}from"./CAqqP6Qf.js";import{P as qe}from"./H0qvLlbz.js";import{P as kt}from"./1RNQaijR.js";import{T as St}from"./DbQdiTbg.js";import{U as Ct}from"./DMWDZKxz.js";const k=We({entries:[],loading:!1,error:null,groups:[],activeGroup:null,draggingId:null,focusedId:null,widgetCacheVersion:0}),be=new Map,He=new Set;function Nt(){return k.entries.filter(n=>n.state==="tray")}function It(){const n=k.entries.filter(e=>e.state==="grid");if(k.activeGroup){const e=k.groups.find(r=>r.id===k.activeGroup);if(e)return n.filter(r=>e.items.includes(r.id))}return n}function Mt(){return k.entries.filter(n=>n.state==="dock")}const tt=12;function Qe(n,e,r){const a=r?.x??0,u=r?.y??0;function g(R,P,D,H){for(const A of n)if(R<A.x+A.w&&R+D>A.x&&P<A.y+A.h&&P+H>A.y)return!0;return!1}const o=Math.max(0,Math.min(tt-e.w,a)),_=Math.max(0,u);if(!g(o,_,e.w,e.h))return{x:o,y:_,w:e.w,h:e.h};for(let R=1;R<=20;R++)for(let P=-R;P<=R;P++)for(let D=-R;D<=R;D++){if(Math.abs(D)!==R&&Math.abs(P)!==R)continue;const H=Math.max(0,Math.min(tt-e.w,a+D)),A=Math.max(0,u+P);if(!g(H,A,e.w,e.h))return{x:H,y:A,w:e.w,h:e.h}}return{x:0,y:n.reduce((R,P)=>Math.max(R,P.y+P.h),0),w:e.w,h:e.h}}async function Oe(){k.loading=!0,k.error=null;try{const n=await fetch(`${me}/api/os/tray`);if(!n.ok)throw new Error(`HTTP ${n.status}`);const e=await n.json();k.entries=e.entries??[]}catch(n){k.error=n instanceof Error?n.message:String(n)}finally{k.loading=!1}}async function Ae(n,e,r){try{const a={state:e};r&&(a.gridPosition=r);const u=await fetch(`${me}/api/os/tray/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!u.ok)return!1;const g=await u.json();if(g.success&&g.entry){const o=k.entries.findIndex(_=>_.id===n);o>=0&&(k.entries[o]=g.entry)}return!0}catch{return!1}}async function nt(n,e){return Ae(n,"grid",e)}async function Xe(n,e){const r=k.entries.find(o=>o.id===n);if(!r)return!1;if(e)return Ae(n,"grid",e);const a=r.manifest?.defaultSize??{w:4,h:3},u=k.entries.flatMap(o=>o.id!==n&&o.state==="grid"&&o.gridPosition?[o.gridPosition]:[]),g=Qe(u,a);return Ae(n,"grid",g)}async function At(n){return Ae(n,"dock")}async function lt(n){return Ae(n,"tray")}const ct="signet-os-sidebar-groups";function Dt(){try{const n=localStorage.getItem(ct);n&&(k.groups=JSON.parse(n))}catch{k.groups=[]}}function Fe(){localStorage.setItem(ct,JSON.stringify(k.groups))}function Lt(n){const e={id:`group_${Date.now()}`,name:n,items:[]};return k.groups=[...k.groups,e],Fe(),e}function Rt(n){k.groups=k.groups.filter(e=>e.id!==n),k.activeGroup===n&&(k.activeGroup=null),Fe()}function Ht(n,e){k.groups=k.groups.map(r=>r.id===n?{...r,name:e}:r),Fe()}function Pt(n,e){k.groups=k.groups.map(r=>r.id!==n||r.items.includes(e)?r:{...r,items:[...r.items,e]}),Fe()}function Ue(n){k.activeGroup=n}let Pe=We(new Map),rt=0;function it(n,e,r){Pe.set(n,{action:e,data:r,_seq:++rt}),setTimeout(()=>{const a=Pe.get(n);a&&a._seq===rt&&Pe.delete(n)},500)}function Ot(n){return Pe.get(n)}function $t(n){k.focusedId=n}function Le(){k.focusedId=null}async function $e(n){if(be.has(n))return be.get(n)??null;try{const e=await fetch(`${me}/api/os/widget/${encodeURIComponent(n)}`);if(!e.ok)return null;const r=await e.json();return r.html?(be.set(n,r.html),k.widgetCacheVersion++,r.html):null}catch{return null}}async function dt(n){if(!He.has(n)){He.add(n),k.widgetCacheVersion++;try{const r=await(await fetch(`${me}/api/os/widget/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:n,force:!1})})).json();r.status==="cached"&&r.html&&be.set(n,r.html)}catch{}finally{be.has(n)&&He.delete(n),k.widgetCacheVersion++}}}const Ke=new Map;function Wt(n,e){Ke.set(n,e)}function zt(n){Ke.delete(n)}function Re(n){return Ke.get(n)}const Vt=We({current:null});function _e(n){Vt.current=n}function Ye(n,e){re(e,!0);let r=we(e,["$$slots","$$events","$$legacy"]);const a=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]];ye(n,he({name:"box"},()=>r,{get iconNode(){return a},children:(u,g)=>{var o=ge(),_=se(o);fe(_,()=>e.children??ve),w(u,o)},$$slots:{default:!0}})),ie()}var Ft=N('<img class="auto-card-icon svelte-1y09vim" referrerpolicy="no-referrer"/>'),jt=N('<div class="auto-card-icon-placeholder svelte-1y09vim"><!></div>'),Bt=N('<button class="auto-card-tool-btn sig-switch svelte-1y09vim" disabled=""><!> <span class="truncate"> </span></button>'),Ut=N('<div class="auto-card-tools svelte-1y09vim"></div>'),Gt=N('<div class="auto-card-empty svelte-1y09vim"><span class="sig-label">No tools exposed</span></div>'),qt=N('<div class="auto-card svelte-1y09vim"><div class="auto-card-header svelte-1y09vim"><!> <span class="auto-card-name svelte-1y09vim"> </span> <span class="sig-meta ml-auto"> </span></div> <!></div>');function Xt(n,e){re(e,!0);var r=qt(),a=c(r),u=c(a);{var g=O=>{var S=Ft();ee(()=>{ue(S,"src",e.icon),ue(S,"alt",e.name)}),w(O,S)},o=O=>{var S=jt(),$=c(S);Ye($,{class:"size-4"}),s(S),w(O,S)};J(u,O=>{e.icon?O(g):O(o,-1)})}var _=x(u,2),G=c(_,!0);s(_);var R=x(_,2),P=c(R);s(R),s(a);var D=x(a,2);{var H=O=>{var S=Ut();Te(S,21,()=>e.autoCard.tools,$=>$.name,($,W)=>{var j=Bt(),F=c(j);at(F,{class:"size-3 shrink-0 opacity-50"});var te=x(F,2),I=c(te,!0);s(te),s(j),ee(()=>{ue(j,"title",t(W).description||t(W).name),ae(I,t(W).name)}),w($,j)}),s(S),w(O,S)},A=O=>{var S=Gt();w(O,S)};J(D,O=>{e.autoCard.tools.length>0?O(H):O(A,-1)})}s(r),ee(()=>{ae(G,e.name),ae(P,`${e.autoCard.tools.length??""} tools`)}),w(n,r),ie()}const Yt='// Signet Page Agent bundle - PageController + lightweight cursor mask\n// Auto-generated from @page-agent/page-controller v1.6.0\n\n\n(function(){\n // Lightweight SimulatorMask - cursor + overlay, no ai-motion dependency\n var CSS_TEXT = \'.__pa_mask{position:fixed;inset:0;z-index:2147483641;cursor:wait;overflow:hidden;display:none;background:rgba(0,0,0,0.02)}.__pa_mask.__pa_vis{display:block}.__pa_cur{position:absolute;width:40px;height:40px;pointer-events:none;z-index:10000;transition:none}.__pa_cur_fill{position:absolute;width:100%;height:100%;background:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' fill=\\\'%23ffffff\\\' stroke=\\\'%23333\\\' stroke-width=\\\'4\\\'/%3e%3c/svg%3e");background-size:100% 100%;transform-origin:center;transform:rotate(-135deg) scale(1.1);margin-left:-8px;margin-top:-14px}.__pa_cur_border{position:absolute;width:100%;height:100%;background:linear-gradient(45deg,rgb(57,182,255),rgb(189,69,251));mask-image:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\' fill=\\\'none\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' stroke=\\\'%23000\\\' stroke-width=\\\'6\\\'/%3e%3c/svg%3e");mask-size:100% 100%;mask-repeat:no-repeat;transform-origin:center;transform:rotate(-135deg) scale(1.2);margin-left:-10px;margin-top:-18px}.__pa_ripple{position:absolute;width:100%;height:100%;pointer-events:none;margin-left:-50%;margin-top:-50%}.__pa_ripple::after{content:\\\'\\\';opacity:0;position:absolute;inset:0;border:3px solid rgba(57,182,255,1);border-radius:50%}.__pa_cur.__pa_click .__pa_ripple::after{animation:__pa_rip 300ms ease-out forwards}@keyframes __pa_rip{0%{transform:scale(0);opacity:1}100%{transform:scale(2);opacity:0}}\';\n \n try{\n var s=document.createElement(\'style\');\n s.appendChild(document.createTextNode(CSS_TEXT));\n document.head.appendChild(s);\n }catch(e){}\n\n function LiteMask(){\n this.shown=false;\n this.wrapper=document.createElement(\'div\');\n this.wrapper.className=\'__pa_mask\';\n this.wrapper.setAttribute(\'data-page-agent-ignore\',\'true\');\n \n this._cursor=document.createElement(\'div\');\n this._cursor.className=\'__pa_cur\';\n var ripple=document.createElement(\'div\');ripple.className=\'__pa_ripple\';this._cursor.appendChild(ripple);\n var fill=document.createElement(\'div\');fill.className=\'__pa_cur_fill\';this._cursor.appendChild(fill);\n var border=document.createElement(\'div\');border.className=\'__pa_cur_border\';this._cursor.appendChild(border);\n this.wrapper.appendChild(this._cursor);\n \n this._cx=0;this._cy=0;this._tx=0;this._ty=0;\n \n // Block interactions on mask\n [\'click\',\'mousedown\',\'mouseup\',\'mousemove\',\'wheel\',\'keydown\',\'keyup\'].forEach(function(evt){\n this.wrapper.addEventListener(evt,function(e){e.stopPropagation();e.preventDefault();});\n }.bind(this));\n \n document.body.appendChild(this.wrapper);\n this._animate();\n \n var self=this;\n window.addEventListener(\'PageAgent::MovePointerTo\',function(e){\n var d=e.detail;self._tx=d.x;self._ty=d.y;\n });\n window.addEventListener(\'PageAgent::ClickPointer\',function(){\n self._cursor.classList.remove(\'__pa_click\');\n void self._cursor.offsetHeight;\n self._cursor.classList.add(\'__pa_click\');\n });\n }\n \n LiteMask.prototype._animate=function(){\n var nx=this._cx+(this._tx-this._cx)*0.2;\n var ny=this._cy+(this._ty-this._cy)*0.2;\n if(Math.abs(nx-this._tx)>0){this._cx=Math.abs(nx-this._tx)<2?this._tx:nx;this._cursor.style.left=this._cx+\'px\';}\n if(Math.abs(ny-this._ty)>0){this._cy=Math.abs(ny-this._ty)<2?this._ty:ny;this._cursor.style.top=this._cy+\'px\';}\n requestAnimationFrame(this._animate.bind(this));\n };\n \n LiteMask.prototype.show=function(){\n if(this.shown)return;this.shown=true;\n this.wrapper.classList.add(\'__pa_vis\');\n this._cx=window.innerWidth/2;this._cy=window.innerHeight/2;\n this._tx=this._cx;this._ty=this._cy;\n this._cursor.style.left=this._cx+\'px\';this._cursor.style.top=this._cy+\'px\';\n };\n \n LiteMask.prototype.hide=function(){\n if(!this.shown)return;this.shown=false;\n this._cursor.classList.remove(\'__pa_click\');\n var w=this.wrapper;\n setTimeout(function(){w.classList.remove(\'__pa_vis\');},300);\n };\n \n LiteMask.prototype.dispose=function(){this.wrapper.remove();};\n \n window.__LiteMask=LiteMask;\n})();\n\n// --- PageController (modified: SimulatorMask replaced with LiteMask) ---\n(function(){\n(function(){var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function isHTMLElement(el){return!!el&&el.nodeType===1}__name(isHTMLElement,"isHTMLElement");function isInputElement(el){return el?.nodeType===1&&el.tagName==="INPUT"}__name(isInputElement,"isInputElement");function isTextAreaElement(el){return el?.nodeType===1&&el.tagName==="TEXTAREA"}__name(isTextAreaElement,"isTextAreaElement");function isSelectElement(el){return el?.nodeType===1&&el.tagName==="SELECT"}__name(isSelectElement,"isSelectElement");function isAnchorElement(el){return el?.nodeType===1&&el.tagName==="A"}__name(isAnchorElement,"isAnchorElement");function getIframeOffset(element){const frame=element.ownerDocument.defaultView?.frameElement;if(!frame)return{x:0,y:0};const rect=frame.getBoundingClientRect();return{x:rect.left,y:rect.top}}__name(getIframeOffset,"getIframeOffset");function getNativeValueSetter(element){return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element),"value").set}__name(getNativeValueSetter,"getNativeValueSetter");async function waitFor(seconds){await new Promise((resolve)=>setTimeout(resolve,seconds*1000))}__name(waitFor,"waitFor");async function movePointerToElement(element){const rect=element.getBoundingClientRect();const offset=getIframeOffset(element);const x=rect.left+rect.width/2+offset.x;const y=rect.top+rect.height/2+offset.y;window.dispatchEvent(new CustomEvent("PageAgent::MovePointerTo",{detail:{x,y}}));await waitFor(0.3)}__name(movePointerToElement,"movePointerToElement");function getElementByIndex(selectorMap,index){const interactiveNode=selectorMap.get(index);if(!interactiveNode){throw new Error(`No interactive element found at index ${index}`)}const element=interactiveNode.ref;if(!element){throw new Error(`Element at index ${index} does not have a reference`)}if(!isHTMLElement(element)){throw new Error(`Element at index ${index} is not an HTMLElement`)}return element}__name(getElementByIndex,"getElementByIndex");let lastClickedElement=null;function blurLastClickedElement(){if(lastClickedElement){lastClickedElement.blur();lastClickedElement.dispatchEvent(new MouseEvent("mouseout",{bubbles:true,cancelable:true}));lastClickedElement.dispatchEvent(new MouseEvent("mouseleave",{bubbles:false,cancelable:true}));lastClickedElement=null}}__name(blurLastClickedElement,"blurLastClickedElement");async function clickElement(element){blurLastClickedElement();lastClickedElement=element;await scrollIntoViewIfNeeded(element);const frame=element.ownerDocument.defaultView?.frameElement;if(frame)await scrollIntoViewIfNeeded(frame);await movePointerToElement(element);window.dispatchEvent(new CustomEvent("PageAgent::ClickPointer"));await waitFor(0.1);element.dispatchEvent(new MouseEvent("mouseenter",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mouseover",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mousedown",{bubbles:true,cancelable:true}));element.focus();element.dispatchEvent(new MouseEvent("mouseup",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("click",{bubbles:true,cancelable:true}));await waitFor(0.2)}__name(clickElement,"clickElement");async function inputTextElement(element,text){const isContentEditable=element.isContentEditable;if(!isInputElement(element)&&!isTextAreaElement(element)&&!isContentEditable){throw new Error("Element is not an input, textarea, or contenteditable")}await clickElement(element);if(isContentEditable){if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"deleteContent"}))){element.innerText="";element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"deleteContent"}))}if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"insertText",data:text}))){element.innerText=text;element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:text}))}const planASucceeded=element.innerText.trim()===text.trim();if(!planASucceeded){element.focus();const doc=element.ownerDocument;const selection=(doc.defaultView||window).getSelection();const range=doc.createRange();range.selectNodeContents(element);selection?.removeAllRanges();selection?.addRange(range);doc.execCommand("delete",false);doc.execCommand("insertText",false,text)}element.dispatchEvent(new Event("change",{bubbles:true}));element.blur()}else{getNativeValueSetter(element).call(element,text)}if(!isContentEditable){element.dispatchEvent(new Event("input",{bubbles:true}))}await waitFor(0.1);blurLastClickedElement()}__name(inputTextElement,"inputTextElement");async function selectOptionElement(selectElement,optionText){if(!isSelectElement(selectElement)){throw new Error("Element is not a select element")}const options=Array.from(selectElement.options);const option=options.find((opt)=>opt.textContent?.trim()===optionText.trim());if(!option){throw new Error(`Option with text "${optionText}" not found in select element`)}selectElement.value=option.value;selectElement.dispatchEvent(new Event("change",{bubbles:true}));await waitFor(0.1)}__name(selectOptionElement,"selectOptionElement");async function scrollIntoViewIfNeeded(element){const el=element;if(typeof el.scrollIntoViewIfNeeded==="function"){el.scrollIntoViewIfNeeded()}else{element.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})}}__name(scrollIntoViewIfNeeded,"scrollIntoViewIfNeeded");async function scrollVertically(down,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dy2=scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableY=/(auto|scroll|overlay)/.test(computedStyle.overflowY);const canScrollVertically=currentElement.scrollHeight>currentElement.clientHeight;if(hasScrollableY&&canScrollVertically){const beforeScroll=currentElement.scrollTop;const maxScroll=currentElement.scrollHeight-currentElement.clientHeight;let scrollAmount=dy2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollTop=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollTop;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) by ${scrollDelta}px`}else{return`No scrollable container found for element (${targetElement.tagName})`}}const dy=scroll_amount;const bigEnough=__name((el2)=>el2.clientHeight>=window.innerHeight*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowY)&&el2.scrollHeight>el2.clientHeight&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollY;const scrollMax=document.documentElement.scrollHeight-window.innerHeight;window.scrollBy(0,dy);const scrollAfter=window.scrollY;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of the page, cannot scroll down further.`:`⚠️ Already at the top of the page, cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled page by ${scrolled}px. Reached the bottom of the page.`;if(reachedTop)return`✅ Scrolled page by ${scrolled}px. Reached the top of the page.`;return`✅ Scrolled page by ${scrolled}px.`}else{const scrollBefore=el.scrollTop;const scrollMax=el.scrollHeight-el.clientHeight;el.scrollBy({top:dy,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollTop;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of container (${el.tagName}), cannot scroll down further.`:`⚠️ Already at the top of container (${el.tagName}), cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the bottom.`;if(reachedTop)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the top.`;return`✅ Scrolled container (${el.tagName}) by ${scrolled}px.`}}__name(scrollVertically,"scrollVertically");async function scrollHorizontally(right,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dx2=right?scroll_amount:-scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableX=/(auto|scroll|overlay)/.test(computedStyle.overflowX);const canScrollHorizontally=currentElement.scrollWidth>currentElement.clientWidth;if(hasScrollableX&&canScrollHorizontally){const beforeScroll=currentElement.scrollLeft;const maxScroll=currentElement.scrollWidth-currentElement.clientWidth;let scrollAmount=dx2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollLeft=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollLeft;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) horizontally by ${scrollDelta}px`}else{return`No horizontally scrollable container found for element (${targetElement.tagName})`}}const dx=right?scroll_amount:-scroll_amount;const bigEnough=__name((el2)=>el2.clientWidth>=window.innerWidth*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowX)&&el2.scrollWidth>el2.clientWidth&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollX;const scrollMax=document.documentElement.scrollWidth-window.innerWidth;window.scrollBy(dx,0);const scrollAfter=window.scrollX;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of the page, cannot scroll right further.`:`⚠️ Already at the left edge of the page, cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled page by ${scrolled}px. Reached the right edge of the page.`;if(reachedLeft)return`✅ Scrolled page by ${scrolled}px. Reached the left edge of the page.`;return`✅ Scrolled page horizontally by ${scrolled}px.`}else{const scrollBefore=el.scrollLeft;const scrollMax=el.scrollWidth-el.clientWidth;el.scrollBy({left:dx,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollLeft;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of container (${el.tagName}), cannot scroll right further.`:`⚠️ Already at the left edge of container (${el.tagName}), cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the right edge.`;if(reachedLeft)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the left edge.`;return`✅ Scrolled container (${el.tagName}) horizontally by ${scrolled}px.`}}__name(scrollHorizontally,"scrollHorizontally");const domTree=__name((args={doHighlightElements:true,focusHighlightIndex:-1,viewportExpansion:0,debugMode:false,interactiveBlacklist:[],interactiveWhitelist:[],highlightOpacity:0.1,highlightLabelOpacity:0.5})=>{const{interactiveBlacklist,interactiveWhitelist,highlightOpacity,highlightLabelOpacity}=args;const{doHighlightElements,focusHighlightIndex,viewportExpansion,debugMode}=args;let highlightIndex=0;const extraData=new WeakMap;function addExtraData(element,data){if(!element||element.nodeType!==Node.ELEMENT_NODE)return;extraData.set(element,{...extraData.get(element),...data})}__name(addExtraData,"addExtraData");const DOM_CACHE={boundingRects:new WeakMap,clientRects:new WeakMap,computedStyles:new WeakMap,clearCache:__name(()=>{DOM_CACHE.boundingRects=new WeakMap;DOM_CACHE.clientRects=new WeakMap;DOM_CACHE.computedStyles=new WeakMap},"clearCache")};function getCachedBoundingRect(element){if(!element)return null;if(DOM_CACHE.boundingRects.has(element)){return DOM_CACHE.boundingRects.get(element)}const rect=element.getBoundingClientRect();if(rect){DOM_CACHE.boundingRects.set(element,rect)}return rect}__name(getCachedBoundingRect,"getCachedBoundingRect");function getCachedComputedStyle(element){if(!element)return null;if(DOM_CACHE.computedStyles.has(element)){return DOM_CACHE.computedStyles.get(element)}const style=window.getComputedStyle(element);if(style){DOM_CACHE.computedStyles.set(element,style)}return style}__name(getCachedComputedStyle,"getCachedComputedStyle");function getCachedClientRects(element){if(!element)return null;if(DOM_CACHE.clientRects.has(element)){return DOM_CACHE.clientRects.get(element)}const rects=element.getClientRects();if(rects){DOM_CACHE.clientRects.set(element,rects)}return rects}__name(getCachedClientRects,"getCachedClientRects");const DOM_HASH_MAP={};const ID={current:0};const HIGHLIGHT_CONTAINER_ID="playwright-highlight-container";function highlightElement(element,index,parentIframe=null){if(!element)return index;const overlays=[];let label=null;let labelWidth=20;let labelHeight=16;let cleanupFn=null;try{let container=document.getElementById(HIGHLIGHT_CONTAINER_ID);if(!container){container=document.createElement("div");container.id=HIGHLIGHT_CONTAINER_ID;container.style.position="fixed";container.style.pointerEvents="none";container.style.top="0";container.style.left="0";container.style.width="100%";container.style.height="100%";container.style.zIndex="2147483640";container.style.backgroundColor="transparent";document.body.appendChild(container)}const rects=element.getClientRects();if(!rects||rects.length===0)return index;const colors=["#FF0000","#00FF00","#0000FF","#FFA500","#800080","#008080","#FF69B4","#4B0082","#FF4500","#2E8B57","#DC143C","#4682B4"];const colorIndex=index%colors.length;let baseColor=colors[colorIndex];const backgroundColor=baseColor+Math.floor(highlightOpacity*255).toString(16).padStart(2,"0");baseColor=baseColor+Math.floor(highlightLabelOpacity*255).toString(16).padStart(2,"0");let iframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();iframeOffset.x=iframeRect.left;iframeOffset.y=iframeRect.top}const fragment=document.createDocumentFragment();for(const rect of rects){if(rect.width===0||rect.height===0)continue;const overlay=document.createElement("div");overlay.style.position="fixed";overlay.style.border=`2px solid ${baseColor}`;overlay.style.backgroundColor=backgroundColor;overlay.style.pointerEvents="none";overlay.style.boxSizing="border-box";const top=rect.top+iframeOffset.y;const left=rect.left+iframeOffset.x;overlay.style.top=`${top}px`;overlay.style.left=`${left}px`;overlay.style.width=`${rect.width}px`;overlay.style.height=`${rect.height}px`;fragment.appendChild(overlay);overlays.push({element:overlay,initialRect:rect})}const firstRect=rects[0];label=document.createElement("div");label.className="playwright-highlight-label";label.style.position="fixed";label.style.background=baseColor;label.style.color="white";label.style.padding="1px 4px";label.style.borderRadius="4px";label.style.fontSize=`${Math.min(12,Math.max(8,firstRect.height/2))}px`;label.textContent=index.toString();labelWidth=label.offsetWidth>0?label.offsetWidth:labelWidth;labelHeight=label.offsetHeight>0?label.offsetHeight:labelHeight;const firstRectTop=firstRect.top+iframeOffset.y;const firstRectLeft=firstRect.left+iframeOffset.x;let labelTop=firstRectTop+2;let labelLeft=firstRectLeft+firstRect.width-labelWidth-2;if(firstRect.width<labelWidth+4||firstRect.height<labelHeight+4){labelTop=firstRectTop-labelHeight-2;labelLeft=firstRectLeft+firstRect.width-labelWidth;if(labelLeft<iframeOffset.x)labelLeft=firstRectLeft}labelTop=Math.max(0,Math.min(labelTop,window.innerHeight-labelHeight));labelLeft=Math.max(0,Math.min(labelLeft,window.innerWidth-labelWidth));label.style.top=`${labelTop}px`;label.style.left=`${labelLeft}px`;fragment.appendChild(label);const updatePositions=__name(()=>{const newRects=element.getClientRects();let newIframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();newIframeOffset.x=iframeRect.left;newIframeOffset.y=iframeRect.top}overlays.forEach((overlayData,i)=>{if(i<newRects.length){const newRect=newRects[i];const newTop=newRect.top+newIframeOffset.y;const newLeft=newRect.left+newIframeOffset.x;overlayData.element.style.top=`${newTop}px`;overlayData.element.style.left=`${newLeft}px`;overlayData.element.style.width=`${newRect.width}px`;overlayData.element.style.height=`${newRect.height}px`;overlayData.element.style.display=newRect.width===0||newRect.height===0?"none":"block"}else{overlayData.element.style.display="none"}});if(newRects.length<overlays.length){for(let i=newRects.length;i<overlays.length;i++){overlays[i].element.style.display="none"}}if(label&&newRects.length>0){const firstNewRect=newRects[0];const firstNewRectTop=firstNewRect.top+newIframeOffset.y;const firstNewRectLeft=firstNewRect.left+newIframeOffset.x;let newLabelTop=firstNewRectTop+2;let newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth-2;if(firstNewRect.width<labelWidth+4||firstNewRect.height<labelHeight+4){newLabelTop=firstNewRectTop-labelHeight-2;newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth;if(newLabelLeft<newIframeOffset.x)newLabelLeft=firstNewRectLeft}newLabelTop=Math.max(0,Math.min(newLabelTop,window.innerHeight-labelHeight));newLabelLeft=Math.max(0,Math.min(newLabelLeft,window.innerWidth-labelWidth));label.style.top=`${newLabelTop}px`;label.style.left=`${newLabelLeft}px`;label.style.display="block"}else if(label){label.style.display="none"}},"updatePositions");const throttleFunction=__name((func,delay)=>{let lastCall=0;return(...args2)=>{const now=performance.now();if(now-lastCall<delay)return;lastCall=now;return func(...args2)}},"throttleFunction");const throttledUpdatePositions=throttleFunction(updatePositions,16);window.addEventListener("scroll",throttledUpdatePositions,true);window.addEventListener("resize",throttledUpdatePositions);cleanupFn=__name(()=>{window.removeEventListener("scroll",throttledUpdatePositions,true);window.removeEventListener("resize",throttledUpdatePositions);overlays.forEach((overlay)=>overlay.element.remove());if(label)label.remove()},"cleanupFn");container.appendChild(fragment);return index+1}finally{if(cleanupFn){(window._highlightCleanupFunctions=window._highlightCleanupFunctions||[]).push(cleanupFn)}}}__name(highlightElement,"highlightElement");function isScrollableElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return null}const style=getCachedComputedStyle(element);if(!style)return null;const display=style.display;if(display==="inline"||display==="inline-block"){return null}const overflowX=style.overflowX;const overflowY=style.overflowY;const scrollableX=overflowX==="auto"||overflowX==="scroll";const scrollableY=overflowY==="auto"||overflowY==="scroll";if(!scrollableX&&!scrollableY){return null}const scrollWidth=element.scrollWidth-element.clientWidth;const scrollHeight=element.scrollHeight-element.clientHeight;const threshold=4;if(scrollWidth<threshold&&scrollHeight<threshold){return null}if(!scrollableY&&scrollWidth<threshold){return null}if(!scrollableX&&scrollHeight<threshold){return null}const distanceToTop=element.scrollTop;const distanceToLeft=element.scrollLeft;const distanceToRight=element.scrollWidth-element.clientWidth-element.scrollLeft;const distanceToBottom=element.scrollHeight-element.clientHeight-element.scrollTop;const scrollData={top:distanceToTop,right:distanceToRight,bottom:distanceToBottom,left:distanceToLeft};addExtraData(element,{scrollable:true,scrollData});return scrollData}__name(isScrollableElement,"isScrollableElement");function isTextNodeVisible(textNode){try{if(viewportExpansion===-1){const parentElement2=textNode.parentElement;if(!parentElement2)return false;try{return parentElement2.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement2);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}const range=document.createRange();range.selectNodeContents(textNode);const rects=range.getClientRects();if(!rects||rects.length===0){return false}let isAnyRectVisible=false;let isAnyRectInViewport=false;for(const rect of rects){if(rect.width>0&&rect.height>0){isAnyRectVisible=true;if(!(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}}if(!isAnyRectVisible||!isAnyRectInViewport){return false}const parentElement=textNode.parentElement;if(!parentElement)return false;try{return parentElement.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}catch(e){console.warn("Error checking text node visibility:",e);return false}}__name(isTextNodeVisible,"isTextNodeVisible");function isElementAccepted(element){if(!element||!element.tagName)return false;const alwaysAccept=new Set(["body","div","main","article","section","nav","header","footer"]);const tagName=element.tagName.toLowerCase();if(alwaysAccept.has(tagName))return true;const leafElementDenyList=new Set(["svg","script","style","link","meta","noscript","template"]);return!leafElementDenyList.has(tagName)}__name(isElementAccepted,"isElementAccepted");function isElementVisible(element){const style=getCachedComputedStyle(element);return element.offsetWidth>0&&element.offsetHeight>0&&style?.visibility!=="hidden"&&style?.display!=="none"}__name(isElementVisible,"isElementVisible");function isInteractiveElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}if(interactiveBlacklist.includes(element)){return false}if(interactiveWhitelist.includes(element)){return true}const tagName=element.tagName.toLowerCase();const style=getCachedComputedStyle(element);const interactiveCursors=new Set(["pointer","move","text","grab","grabbing","cell","copy","alias","all-scroll","col-resize","context-menu","crosshair","e-resize","ew-resize","help","n-resize","ne-resize","nesw-resize","ns-resize","nw-resize","nwse-resize","row-resize","s-resize","se-resize","sw-resize","vertical-text","w-resize","zoom-in","zoom-out"]);const nonInteractiveCursors=new Set(["not-allowed","no-drop","wait","progress","initial","inherit"]);function doesElementHaveInteractivePointer(element2){if(element2.tagName.toLowerCase()==="html")return false;if(style?.cursor&&interactiveCursors.has(style.cursor))return true;return false}__name(doesElementHaveInteractivePointer,"doesElementHaveInteractivePointer");let isInteractiveCursor=doesElementHaveInteractivePointer(element);if(isInteractiveCursor){return true}const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label","option","optgroup","fieldset","legend"]);const explicitDisableTags=new Set(["disabled","readonly"]);if(interactiveElements.has(tagName)){if(style?.cursor&&nonInteractiveCursors.has(style.cursor)){return false}for(const disableTag of explicitDisableTags){if(element.hasAttribute(disableTag)||element.getAttribute(disableTag)==="true"||element.getAttribute(disableTag)===""){return false}}if(element.disabled){return false}if(element.readOnly){return false}if(element.inert){return false}return true}const role=element.getAttribute("role");const ariaRole=element.getAttribute("aria-role");if(element.getAttribute("contenteditable")==="true"||element.isContentEditable){return true}if(element.classList&&(element.classList.contains("button")||element.classList.contains("dropdown-toggle")||element.getAttribute("data-index")||element.getAttribute("data-toggle")==="dropdown"||element.getAttribute("aria-haspopup")==="true")){return true}const interactiveRoles=new Set(["button","menu","menubar","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);const hasInteractiveRole=interactiveElements.has(tagName)||role&&interactiveRoles.has(role)||ariaRole&&interactiveRoles.has(ariaRole);if(hasInteractiveRole)return true;try{if(typeof getEventListeners==="function"){const listeners=getEventListeners(element);const mouseEvents=["click","mousedown","mouseup","dblclick"];for(const eventType of mouseEvents){if(listeners[eventType]&&listeners[eventType].length>0){return true}}}const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonMouseAttrs=["onclick","onmousedown","onmouseup","ondblclick"];for(const attr of commonMouseAttrs){if(element.hasAttribute(attr)||typeof element[attr]==="function"){return true}}}catch(e){}if(isScrollableElement(element)){return true}return false}__name(isInteractiveElement,"isInteractiveElement");function isTopElement(element){if(viewportExpansion===-1){return true}const rects=getCachedClientRects(element);if(!rects||rects.length===0){return false}let isAnyRectInViewport=false;for(const rect2 of rects){if(rect2.width>0&&rect2.height>0&&!(rect2.bottom<-viewportExpansion||rect2.top>window.innerHeight+viewportExpansion||rect2.right<-viewportExpansion||rect2.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}if(!isAnyRectInViewport){return false}let doc=element.ownerDocument;if(doc!==window.document){return true}let rect=Array.from(rects).find((r)=>r.width>0&&r.height>0);if(!rect){return false}const shadowRoot=element.getRootNode();if(shadowRoot instanceof ShadowRoot){const centerX=rect.left+rect.width/2;const centerY=rect.top+rect.height/2;try{const topEl=shadowRoot.elementFromPoint(centerX,centerY);if(!topEl)return false;let current=topEl;while(current&&current!==shadowRoot){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}}const margin=5;const checkPoints=[{x:rect.left+rect.width/2,y:rect.top+rect.height/2},{x:rect.left+margin,y:rect.top+margin},{x:rect.right-margin,y:rect.bottom-margin}];return checkPoints.some(({x,y})=>{try{const topEl=document.elementFromPoint(x,y);if(!topEl)return false;let current=topEl;while(current&&current!==document.documentElement){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}})}__name(isTopElement,"isTopElement");function isInExpandedViewport(element,viewportExpansion2){if(viewportExpansion2===-1){return true}const rects=element.getClientRects();if(!rects||rects.length===0){const boundingRect=getCachedBoundingRect(element);if(!boundingRect||boundingRect.width===0||boundingRect.height===0){return false}return!(boundingRect.bottom<-viewportExpansion2||boundingRect.top>window.innerHeight+viewportExpansion2||boundingRect.right<-viewportExpansion2||boundingRect.left>window.innerWidth+viewportExpansion2)}for(const rect of rects){if(rect.width===0||rect.height===0)continue;if(!(rect.bottom<-viewportExpansion2||rect.top>window.innerHeight+viewportExpansion2||rect.right<-viewportExpansion2||rect.left>window.innerWidth+viewportExpansion2)){return true}}return false}__name(isInExpandedViewport,"isInExpandedViewport");function isInteractiveCandidate(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;const tagName=element.tagName.toLowerCase();const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label"]);if(interactiveElements.has(tagName))return true;const hasQuickInteractiveAttr=element.hasAttribute("onclick")||element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("aria-")||element.hasAttribute("data-action")||element.getAttribute("contenteditable")==="true";return hasQuickInteractiveAttr}__name(isInteractiveCandidate,"isInteractiveCandidate");const DISTINCT_INTERACTIVE_TAGS=new Set(["a","button","input","select","textarea","summary","details","label","option"]);const INTERACTIVE_ROLES=new Set(["button","link","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);function isHeuristicallyInteractive(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;if(!isElementVisible(element))return false;const hasInteractiveAttributes=element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("onclick")||typeof element.onclick==="function";const hasInteractiveClass=/\\b(btn|clickable|menu|item|entry|link)\\b/i.test(element.className||"");const isInKnownContainer=Boolean(element.closest(\'button,a,[role="button"],.menu,.dropdown,.list,.toolbar\'));const hasVisibleChildren=[...element.children].some(isElementVisible);const isParentBody=element.parentElement&&element.parentElement.isSameNode(document.body);return(isInteractiveElement(element)||hasInteractiveAttributes||hasInteractiveClass)&&hasVisibleChildren&&isInKnownContainer&&!isParentBody}__name(isHeuristicallyInteractive,"isHeuristicallyInteractive");function isElementDistinctInteraction(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}const tagName=element.tagName.toLowerCase();const role=element.getAttribute("role");if(tagName==="iframe"){return true}if(DISTINCT_INTERACTIVE_TAGS.has(tagName)){return true}if(role&&INTERACTIVE_ROLES.has(role)){return true}if(element.isContentEditable||element.getAttribute("contenteditable")==="true"){return true}if(element.hasAttribute("data-testid")||element.hasAttribute("data-cy")||element.hasAttribute("data-test")){return true}if(element.hasAttribute("onclick")||typeof element.onclick==="function"){return true}try{const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonEventAttrs=["onmousedown","onmouseup","onkeydown","onkeyup","onsubmit","onchange","oninput","onfocus","onblur"];if(commonEventAttrs.some((attr)=>element.hasAttribute(attr))){return true}}catch(e){}if(isHeuristicallyInteractive(element)){return true}return false}__name(isElementDistinctInteraction,"isElementDistinctInteraction");function handleHighlighting(nodeData,node,parentIframe,isParentHighlighted){if(!nodeData.isInteractive)return false;let shouldHighlight=false;if(!isParentHighlighted){shouldHighlight=true}else{if(isElementDistinctInteraction(node)){shouldHighlight=true}else{shouldHighlight=false}}if(shouldHighlight){nodeData.isInViewport=isInExpandedViewport(node,viewportExpansion);if(nodeData.isInViewport||viewportExpansion===-1){nodeData.highlightIndex=highlightIndex++;if(doHighlightElements){if(focusHighlightIndex>=0){if(focusHighlightIndex===nodeData.highlightIndex){highlightElement(node,nodeData.highlightIndex,parentIframe)}}else{highlightElement(node,nodeData.highlightIndex,parentIframe)}return true}}}return false}__name(handleHighlighting,"handleHighlighting");function buildDomTree(node,parentIframe=null,isParentHighlighted=false){if(!node||node.id===HIGHLIGHT_CONTAINER_ID||node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(!node||node.id===HIGHLIGHT_CONTAINER_ID){return null}if(node.dataset?.browserUseIgnore==="true"||node.dataset?.pageAgentIgnore==="true"){return null}if(node.getAttribute&&node.getAttribute("aria-hidden")==="true"){return null}if(node===document.body){const nodeData2={tagName:"body",attributes:{},xpath:"/body",children:[]};for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,false);if(domElement)nodeData2.children.push(domElement)}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]=nodeData2;return id2}if(node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(node.nodeType===Node.TEXT_NODE){const textContent=node.textContent?.trim();if(!textContent){return null}const parentElement=node.parentElement;if(!parentElement||parentElement.tagName.toLowerCase()==="script"){return null}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]={type:"TEXT_NODE",text:textContent,isVisible:isTextNodeVisible(node)};return id2}if(node.nodeType===Node.ELEMENT_NODE&&!isElementAccepted(node)){return null}if(viewportExpansion!==-1&&!node.shadowRoot){const rect=getCachedBoundingRect(node);const style=getCachedComputedStyle(node);const isFixedOrSticky=style&&(style.position==="fixed"||style.position==="sticky");const hasSize=node.offsetWidth>0||node.offsetHeight>0;if(!rect||!isFixedOrSticky&&!hasSize&&(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){return null}}const nodeData={tagName:node.tagName.toLowerCase(),attributes:{},children:[]};if(isInteractiveCandidate(node)||node.tagName.toLowerCase()==="iframe"||node.tagName.toLowerCase()==="body"){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}if(node.tagName.toLowerCase()==="input"&&(node.type==="checkbox"||node.type==="radio")){nodeData.attributes.checked=node.checked?"true":"false"}}let nodeWasHighlighted=false;if(node.nodeType===Node.ELEMENT_NODE){nodeData.isVisible=isElementVisible(node);if(nodeData.isVisible){nodeData.isTopElement=isTopElement(node);const role=node.getAttribute("role");const isMenuContainer=role==="menu"||role==="menubar"||role==="listbox";if(nodeData.isTopElement||isMenuContainer){nodeData.isInteractive=isInteractiveElement(node);nodeWasHighlighted=handleHighlighting(nodeData,node,parentIframe,isParentHighlighted);nodeData.ref=node;if(nodeData.isInteractive&&Object.keys(nodeData.attributes).length===0){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}}}}}if(node.tagName){const tagName=node.tagName.toLowerCase();if(tagName==="iframe"){try{const iframeDoc=node.contentDocument||node.contentWindow?.document;if(iframeDoc){for(const child of iframeDoc.childNodes){const domElement=buildDomTree(child,node,false);if(domElement)nodeData.children.push(domElement)}}}catch(e){console.warn("Unable to access iframe:",e)}}else if(node.isContentEditable||node.getAttribute("contenteditable")==="true"||node.id==="tinymce"||node.classList.contains("mce-content-body")||tagName==="body"&&node.getAttribute("data-id")?.startsWith("mce_")){for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}else{if(node.shadowRoot){nodeData.shadowRoot=true;for(const child of node.shadowRoot.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}for(const child of node.childNodes){const passHighlightStatusToChild=nodeWasHighlighted||isParentHighlighted;const domElement=buildDomTree(child,parentIframe,passHighlightStatusToChild);if(domElement)nodeData.children.push(domElement)}}}if(nodeData.tagName==="a"&&nodeData.children.length===0&&!nodeData.attributes.href){const rect=getCachedBoundingRect(node);const hasSize=rect&&rect.width>0&&rect.height>0||node.offsetWidth>0||node.offsetHeight>0;if(!hasSize){return null}}nodeData.extra=extraData.get(node)||null;const id=`${ID.current++}`;DOM_HASH_MAP[id]=nodeData;return id}__name(buildDomTree,"buildDomTree");const rootId=buildDomTree(document.body);DOM_CACHE.clearCache();return{rootId,map:DOM_HASH_MAP}},"domTree");const DEFAULT_VIEWPORT_EXPANSION=-1;function resolveViewportExpansion(viewportExpansion){return viewportExpansion??DEFAULT_VIEWPORT_EXPANSION}__name(resolveViewportExpansion,"resolveViewportExpansion");const newElementsCache=new WeakMap;function getFlatTree(config){const viewportExpansion=resolveViewportExpansion(config.viewportExpansion);const interactiveBlacklist=[];for(const item of config.interactiveBlacklist||[]){if(typeof item==="function"){interactiveBlacklist.push(item())}else{interactiveBlacklist.push(item)}}const interactiveWhitelist=[];for(const item of config.interactiveWhitelist||[]){if(typeof item==="function"){interactiveWhitelist.push(item())}else{interactiveWhitelist.push(item)}}const elements=domTree({doHighlightElements:true,debugMode:true,focusHighlightIndex:-1,viewportExpansion,interactiveBlacklist,interactiveWhitelist,highlightOpacity:config.highlightOpacity??0,highlightLabelOpacity:config.highlightLabelOpacity??0.1});const currentUrl=window.location.href;for(const nodeId in elements.map){const node=elements.map[nodeId];if(node.isInteractive&&node.ref){const ref=node.ref;if(!newElementsCache.has(ref)){newElementsCache.set(ref,currentUrl);node.isNew=true}}}return elements}__name(getFlatTree,"getFlatTree");const globRegexCache=new Map;function globToRegex(pattern){let regex=globRegexCache.get(pattern);if(!regex){const escaped=pattern.replace(/[.+^${}()|[\\]\\\\]/g,"\\\\$&");regex=new RegExp(`^${escaped.replace(/\\*/g,".*")}$`);globRegexCache.set(pattern,regex)}return regex}__name(globToRegex,"globToRegex");function matchAttributes(attrs,patterns){const result2={};for(const pattern of patterns){if(pattern.includes("*")){const regex=globToRegex(pattern);for(const key of Object.keys(attrs)){if(regex.test(key)&&attrs[key].trim()){result2[key]=attrs[key].trim()}}}else{const value=attrs[pattern];if(value&&value.trim()){result2[pattern]=value.trim()}}}return result2}__name(matchAttributes,"matchAttributes");function flatTreeToString(flatTree,includeAttributes){const DEFAULT_INCLUDE_ATTRIBUTES=["title","type","checked","name","role","value","placeholder","data-date-format","alt","aria-label","aria-expanded","data-state","aria-checked","id","for","target","aria-haspopup","aria-controls","aria-owns","contenteditable"];const includeAttrs=[...includeAttributes||[],...DEFAULT_INCLUDE_ATTRIBUTES];const capTextLength=__name((text,maxLength)=>{if(text.length>maxLength){return text.substring(0,maxLength)+"..."}return text},"capTextLength");const buildTreeNode=__name((nodeId)=>{const node=flatTree.map[nodeId];if(!node)return null;if(node.type==="TEXT_NODE"){const textNode=node;return{type:"text",text:textNode.text,isVisible:textNode.isVisible,parent:null,children:[]}}else{const elementNode=node;const children=[];if(elementNode.children){for(const childId of elementNode.children){const child=buildTreeNode(childId);if(child){child.parent=null;children.push(child)}}}return{type:"element",tagName:elementNode.tagName,attributes:elementNode.attributes??{},isVisible:elementNode.isVisible??false,isInteractive:elementNode.isInteractive??false,isTopElement:elementNode.isTopElement??false,isNew:elementNode.isNew??false,highlightIndex:elementNode.highlightIndex,parent:null,children,extra:elementNode.extra??{}}}},"buildTreeNode");const setParentReferences=__name((node,parent=null)=>{node.parent=parent;for(const child of node.children){setParentReferences(child,node)}},"setParentReferences");const rootNode=buildTreeNode(flatTree.rootId);if(!rootNode)return"";setParentReferences(rootNode);const hasParentWithHighlightIndex=__name((node)=>{let current=node.parent;while(current){if(current.type==="element"&&current.highlightIndex!==undefined){return true}current=current.parent}return false},"hasParentWithHighlightIndex");const processNode=__name((node,depth,result22)=>{let nextDepth=depth;const depthStr="\\t".repeat(depth);if(node.type==="element"){if(node.highlightIndex!==undefined){nextDepth+=1;const text=getAllTextTillNextClickableElement(node);let attributesHtmlStr="";if(includeAttrs.length>0&&node.attributes){const attributesToInclude=matchAttributes(node.attributes,includeAttrs);const keys=Object.keys(attributesToInclude);if(keys.length>1){const keysToRemove=new Set;const seenValues={};for(const key of keys){const value=attributesToInclude[key];if(value.length>5){if(value in seenValues){keysToRemove.add(key)}else{seenValues[value]=key}}}for(const key of keysToRemove){delete attributesToInclude[key]}}if(attributesToInclude.role===node.tagName){delete attributesToInclude.role}const attrsToRemoveIfTextMatches=["aria-label","placeholder","title"];for(const attr of attrsToRemoveIfTextMatches){if(attributesToInclude[attr]&&attributesToInclude[attr].toLowerCase().trim()===text.toLowerCase().trim()){delete attributesToInclude[attr]}}if(Object.keys(attributesToInclude).length>0){attributesHtmlStr=Object.entries(attributesToInclude).map(([key,value])=>`${key}=${capTextLength(value,20)}`).join(" ")}}const highlightIndicator=node.isNew?`*[${node.highlightIndex}]`:`[${node.highlightIndex}]`;let line=`${depthStr}${highlightIndicator}<${node.tagName??""}`;if(attributesHtmlStr){line+=` ${attributesHtmlStr}`}if(node.extra){if(node.extra.scrollable){let scrollDataText="";if(node.extra.scrollData?.left)scrollDataText+=`left=${node.extra.scrollData.left}, `;if(node.extra.scrollData?.top)scrollDataText+=`top=${node.extra.scrollData.top}, `;if(node.extra.scrollData?.right)scrollDataText+=`right=${node.extra.scrollData.right}, `;if(node.extra.scrollData?.bottom)scrollDataText+=`bottom=${node.extra.scrollData.bottom}`;line+=` data-scrollable="${scrollDataText}"`}}if(text){const trimmedText=text.trim();if(!attributesHtmlStr){line+=" "}line+=`>${trimmedText}`}else if(!attributesHtmlStr){line+=" "}line+=" />";result22.push(line)}for(const child of node.children){processNode(child,nextDepth,result22)}}else if(node.type==="text"){if(hasParentWithHighlightIndex(node)){return}if(node.parent&&node.parent.type==="element"&&node.parent.isVisible&&node.parent.isTopElement){result22.push(`${depthStr}${node.text??""}`)}}},"processNode");const result2=[];processNode(rootNode,0,result2);return result2.join(`\n`)}__name(flatTreeToString,"flatTreeToString");const getAllTextTillNextClickableElement=__name((node,maxDepth=-1)=>{const textParts=[];const collectText=__name((currentNode,currentDepth)=>{if(maxDepth!==-1&&currentDepth>maxDepth){return}if(currentNode.type==="element"&&currentNode!==node&&currentNode.highlightIndex!==undefined){return}if(currentNode.type==="text"&&currentNode.text){textParts.push(currentNode.text)}else if(currentNode.type==="element"){for(const child of currentNode.children){collectText(child,currentDepth+1)}}},"collectText");collectText(node,0);return textParts.join(`\n`).trim()},"getAllTextTillNextClickableElement");function getSelectorMap(flatTree){const selectorMap=new Map;const keys=Object.keys(flatTree.map);for(const key of keys){const node=flatTree.map[key];if(node.isInteractive&&typeof node.highlightIndex==="number"){selectorMap.set(node.highlightIndex,node)}}return selectorMap}__name(getSelectorMap,"getSelectorMap");function getElementTextMap(simplifiedHTML){const lines=simplifiedHTML.split(`\n`).map((line)=>line.trim()).filter((line)=>line.length>0);const elementTextMap=new Map;for(const line of lines){const regex=/^\\[(\\d+)\\]<[^>]+>([^<]*)/;const match=regex.exec(line);if(match){const index=parseInt(match[1],10);elementTextMap.set(index,line)}}return elementTextMap}__name(getElementTextMap,"getElementTextMap");function cleanUpHighlights(){const cleanupFunctions=window._highlightCleanupFunctions||[];for(const cleanup of cleanupFunctions){if(typeof cleanup==="function"){cleanup()}}window._highlightCleanupFunctions=[]}__name(cleanUpHighlights,"cleanUpHighlights");window.addEventListener("popstate",()=>{cleanUpHighlights()});window.addEventListener("hashchange",()=>{cleanUpHighlights()});window.addEventListener("beforeunload",()=>{cleanUpHighlights()});const navigation=window.navigation;if(navigation&&typeof navigation.addEventListener==="function"){navigation.addEventListener("navigate",()=>{cleanUpHighlights()})}else{let currentUrl=window.location.href;setInterval(()=>{if(window.location.href!==currentUrl){currentUrl=window.location.href;cleanUpHighlights()}},500)}function getPageInfo(){const viewport_width=window.innerWidth;const viewport_height=window.innerHeight;const page_width=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth||0);const page_height=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight||0);const scroll_x=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0;const scroll_y=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;const pixels_below=Math.max(0,page_height-(window.innerHeight+scroll_y));const pixels_right=Math.max(0,page_width-(window.innerWidth+scroll_x));return{viewport_width,viewport_height,page_width,page_height,scroll_x,scroll_y,pixels_above:scroll_y,pixels_below,pages_above:viewport_height>0?scroll_y/viewport_height:0,pages_below:viewport_height>0?pixels_below/viewport_height:0,total_pages:viewport_height>0?page_height/viewport_height:0,current_page_position:scroll_y/Math.max(1,page_height-viewport_height),pixels_left:scroll_x,pixels_right}}__name(getPageInfo,"getPageInfo");function patchReact(pageController){const reactRootElements=document.querySelectorAll(\'[data-reactroot], [data-reactid], [data-react-checksum], #root, #app, [id^="root-"], [id^="app-"], #adex-wrapper, #adex-root\');for(const element of reactRootElements){element.setAttribute("data-page-agent-not-interactive","true")}}__name(patchReact,"patchReact");const _PageController=class _PageController extends EventTarget{config;flatTree=null;selectorMap=new Map;elementTextMap=new Map;simplifiedHTML="<EMPTY>";lastTimeUpdate=0;isIndexed=false;mask=null;maskReady=null;constructor(config={}){super();this.config=config;patchReact();if(config.enableMask)this.initMask()}initMask(){if(this.maskReady!==null)return;this.maskReady=(async()=>{var SimulatorMask = window.__LiteMask;this.mask=new SimulatorMask})()}async getCurrentUrl(){return window.location.href}async getLastUpdateTime(){return this.lastTimeUpdate}async getBrowserState(){const url=window.location.href;const title=document.title;const pi=getPageInfo();const viewportExpansion=resolveViewportExpansion(this.config.viewportExpansion);await this.updateTree();const content=this.simplifiedHTML;const titleLine=`Current Page: [${title}](${url})`;const pageInfoLine=`Page info: ${pi.viewport_width}x${pi.viewport_height}px viewport, ${pi.page_width}x${pi.page_height}px total page size, ${pi.pages_above.toFixed(1)} pages above, ${pi.pages_below.toFixed(1)} pages below, ${pi.total_pages.toFixed(1)} total pages, at ${(pi.current_page_position*100).toFixed(0)}% of page`;const elementsLabel=viewportExpansion===-1?"Interactive elements from top layer of the current page (full page):":"Interactive elements from top layer of the current page inside the viewport:";const hasContentAbove=pi.pixels_above>4;const scrollHintAbove=hasContentAbove&&viewportExpansion!==-1?`... ${pi.pixels_above} pixels above (${pi.pages_above.toFixed(1)} pages) - scroll to see more ...`:"[Start of page]";const header=`${titleLine}\n${pageInfoLine}\n\n${elementsLabel}\n\n${scrollHintAbove}`;const hasContentBelow=pi.pixels_below>4;const footer=hasContentBelow&&viewportExpansion!==-1?`... ${pi.pixels_below} pixels below (${pi.pages_below.toFixed(1)} pages) - scroll to see more ...`:"[End of page]";return{url,title,header,content,footer}}async updateTree(){this.dispatchEvent(new Event("beforeUpdate"));this.lastTimeUpdate=Date.now();if(this.mask){this.mask.wrapper.style.pointerEvents="none"}cleanUpHighlights();const blacklist=[...this.config.interactiveBlacklist||[],...document.querySelectorAll("[data-page-agent-not-interactive]").values()];this.flatTree=getFlatTree({...this.config,interactiveBlacklist:blacklist});this.simplifiedHTML=flatTreeToString(this.flatTree,this.config.includeAttributes);this.selectorMap.clear();this.selectorMap=getSelectorMap(this.flatTree);this.elementTextMap.clear();this.elementTextMap=getElementTextMap(this.simplifiedHTML);this.isIndexed=true;if(this.mask){this.mask.wrapper.style.pointerEvents="auto"}this.dispatchEvent(new Event("afterUpdate"));return this.simplifiedHTML}async cleanUpHighlights(){cleanUpHighlights()}assertIndexed(){if(!this.isIndexed){throw new Error("DOM tree not indexed yet. Can not perform actions on elements.")}}async clickElement(index){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await clickElement(element);if(isAnchorElement(element)&&element.target==="_blank"){return{success:true,message:`✅ Clicked element (${elemText??index}). ⚠️ Link opened in a new tab.`}}return{success:true,message:`✅ Clicked element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to click element: ${error}`}}}async inputText(index,text){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await inputTextElement(element,text);return{success:true,message:`✅ Input text (${text}) into element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to input text: ${error}`}}}async selectOption(index,optionText){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await selectOptionElement(element,optionText);return{success:true,message:`✅ Selected option (${optionText}) in element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to select option: ${error}`}}}async scroll(options){try{const{down,numPages,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels??numPages*(down?1:-1)*window.innerHeight;const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollVertically(down,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll: ${error}`}}}async scrollHorizontally(options){try{const{right,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels*(right?1:-1);const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollHorizontally(right,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll horizontally: ${error}`}}}async executeJavascript(script){try{const asyncFunction=eval(`(async () => { ${script} })`);const result=await asyncFunction();return{success:true,message:`✅ Executed JavaScript. Result: ${result}`}}catch(error){return{success:false,message:`❌ Error executing JavaScript: ${error}`}}}async showMask(){await this.maskReady;this.mask?.show()}async hideMask(){await this.maskReady;this.mask?.hide()}dispose(){cleanUpHighlights();this.flatTree=null;this.selectorMap.clear();this.elementTextMap.clear();this.simplifiedHTML="<EMPTY>";this.isIndexed=false;this.mask?.dispose();this.mask=null}};__name(_PageController,"PageController");let PageController=_PageController;window.__PageController=PageController})();\n})();\n\n// --- Signet Page Agent API ---\n(function(){\n var pc = new window.__PageController({ enableMask: false, highlightOpacity: 0, highlightLabelOpacity: 0 });\n \n window.signet = window.signet || {};\n window.signet.pageController = pc;\n \n window.signet.getDomState = async function(){\n try {\n var state = await pc.getBrowserState();\n return { success: true, state: state };\n } catch(e) {\n return { success: false, error: e.message || String(e) };\n }\n };\n \n window.signet.executeAction = async function(action){\n try {\n var result;\n switch(action.type){\n case \'click_element\':\n result = await pc.clickElement(action.index);\n break;\n case \'input_text\':\n result = await pc.inputText(action.index, action.text);\n break;\n case \'select_option\':\n result = await pc.selectOption(action.index, action.text);\n break;\n case \'scroll\':\n result = await pc.scroll({ down: action.direction === \'down\', numPages: action.amount || 1 });\n break;\n default:\n result = { success: false, message: \'Unknown action type: \' + action.type };\n }\n return result;\n } catch(e) {\n return { success: false, message: e.message || String(e) };\n }\n };\n \n window.signet.agentStart = async function(){\n pc.initMask();\n await pc.showMask();\n };\n \n window.signet.agentStop = async function(){\n await pc.hideMask();\n };\n})();',Jt=`
2
2
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
3
3
  html { font-family: 'Geist Mono', 'IBM Plex Mono', monospace; font-size: 13px; line-height: 1.5; color: var(--sig-text); background: var(--sig-bg); -webkit-font-smoothing: antialiased; }
4
4
  body { margin: 0; padding: 8px; min-height: 100%; }
@@ -1,4 +1,4 @@
1
- import{p as se,s as be,c as C,f as w,a as fe,n as ge,b as c,d as re,r as ke,e as pe,o as me,j as u,A as Y,h as R,i as s,t as y,l as p,k as A,w as ue,x as Z,y as z,z as H,u as ee,aa as Je,O as he,ab as Ke,a3 as We,K as Be,m as T,v as te,U as Fe,P as Ue}from"./V_JjZsJi.js";import{I as ye,K as Ve,o as ae}from"./WTmJ2kxu.js";import{S as Qe,a as Xe,b as Ye,c as Ze}from"./DETIKIiJ.js";import{W as et,L as ve}from"./DERRcs3d.js";import{T as tt}from"./tjtK_67M.js";function at(P,f){se(f,!0);let x=ke(f,["$$slots","$$events","$$legacy"]);const g=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}]];ye(P,be({name:"activity"},()=>x,{get iconNode(){return g},children:(h,O)=>{var _=C(),E=w(_);fe(E,()=>f.children??ge),c(h,_)},$$slots:{default:!0}})),re()}function st(P,f){se(f,!0);let x=ke(f,["$$slots","$$events","$$legacy"]);const g=[["path",{d:"M12 19h8"}],["path",{d:"m4 17 6-6-6-6"}]];ye(P,be({name:"terminal"},()=>x,{get iconNode(){return g},children:(h,O)=>{var _=C(),E=w(_);fe(E,()=>f.children??ge),c(h,_)},$$slots:{default:!0}})),re()}var rt=T('<span class="ts-panel-count svelte-c36e65"> </span>'),it=T("<!> <!>",1),nt=T('<div class="ts-control svelte-c36e65"><div class="ts-control-head svelte-c36e65"><div class="ts-control-title-wrap svelte-c36e65"><!> <span class="ts-control-title svelte-c36e65"> </span> <!></div> <!></div> <div class="ts-action-bar svelte-c36e65"><!> <button class="ts-run svelte-c36e65"><!></button></div></div>'),lt=T('<button class="ts-clear svelte-c36e65" title="Clear output"><!></button>'),ot=T('<div class="ts-empty svelte-c36e65">no output yet</div>'),ct=T('<div class="ts-line svelte-c36e65"></div>'),dt=T('<div class="ts-root svelte-c36e65"><div class="ts-controls svelte-c36e65"></div> <div class="ts-terminal-wrap svelte-c36e65"><div class="ts-terminal-head svelte-c36e65"><span class="ts-control-title svelte-c36e65">Terminal</span> <!></div> <div class="ts-term svelte-c36e65" role="log"><!></div></div></div>');function gt(P,f){se(f,!0);const x=[{id:"cli",title:"CLI",icon:st,color:"var(--sig-highlight)",commands:[{label:"Status",kind:"cli",key:"status"},{label:"Daemon Status",kind:"cli",key:"daemon-status"},{label:"Daemon Logs",kind:"cli",key:"daemon-logs"},{label:"Sync",kind:"cli",key:"sync"},{label:"Embed Audit",kind:"cli",key:"embed-audit"},{label:"Skill List",kind:"cli",key:"skill-list"},{label:"Secret List",kind:"cli",key:"secret-list"},{label:"Recall Test",kind:"cli",key:"recall-test"}]},{id:"status",title:"Status",icon:at,color:"var(--sig-highlight)",commands:[{label:"Health",kind:"api",method:"GET",path:"/health"},{label:"Diagnostics",kind:"api",method:"GET",path:"/api/diagnostics"},{label:"Pipeline",kind:"api",method:"GET",path:"/api/pipeline/status"},{label:"Predictor",kind:"api",method:"GET",path:"/api/predictor/status"},{label:"Git",kind:"api",method:"GET",path:"/api/git/status"},{label:"Embeddings",kind:"api",method:"GET",path:"/api/embeddings/health"}]},{id:"info",title:"Info",icon:Ve,color:"var(--sig-highlight)",commands:[{label:"Embed Gaps",kind:"api",method:"GET",path:"/api/repair/embedding-gaps"},{label:"Dedup Stats",kind:"api",method:"GET",path:"/api/repair/dedup-stats"},{label:"Cold Stats",kind:"api",method:"GET",path:"/api/repair/cold-stats"}]},{id:"repair",title:"Repair",icon:et,color:"var(--sig-highlight)",commands:[{label:"Check FTS",kind:"api",method:"POST",path:"/api/repair/check-fts"},{label:"Re-embed",kind:"api",method:"POST",path:"/api/repair/re-embed"},{label:"Resync Vec",kind:"api",method:"POST",path:"/api/repair/resync-vec"},{label:"Clean Orphans",kind:"api",method:"POST",path:"/api/repair/clean-orphans"},{label:"Deduplicate",kind:"api",method:"POST",path:"/api/repair/deduplicate"},{label:"Retention",kind:"api",method:"POST",path:"/api/repair/retention-sweep"},{label:"Requeue Dead",kind:"api",method:"POST",path:"/api/repair/requeue-dead"},{label:"Release Leases",kind:"api",method:"POST",path:"/api/repair/release-leases"},{label:"Backfill Skipped",kind:"api",method:"POST",path:"/api/repair/backfill-skipped"},{label:"Reclassify",kind:"api",method:"POST",path:"/api/repair/reclassify-entities"},{label:"Prune Chunks",kind:"api",method:"POST",path:"/api/repair/prune-chunk-groups"},{label:"Prune Singletons",kind:"api",method:"POST",path:"/api/repair/prune-singleton-entities"},{label:"Stop Daemon",kind:"cli",key:"daemon-stop"},{label:"Restart Daemon",kind:"cli",key:"daemon-restart"},{label:"Update Signet",kind:"cli",key:"update"}]}];let g=pe(Object.fromEntries(x.map(e=>[e.id,{lines:[],running:!1,selected:0}]))),h=me(pe([])),O=me(void 0);const _=Object.fromEntries(x.map(e=>[e.id,e]));function E(e){te(O,e,!0)}async function v(e){await Fe(),s(O)?.scrollTo({top:s(O).scrollHeight,behavior:"smooth"})}function o(e,t){const a=g[e];if(!a)return;a.lines=[...a.lines,t];const n=_[e]?.title??e;te(h,[...s(h),t?`[${n}] ${t}`:""],!0)}function xe(){te(h,[],!0);for(const e of x)g[e.id].lines=[]}async function _e(e,t){const a=g[e];if(!a||a.running||!t.key)return;a.running=!0,o(e,`\x1B[32m$\x1B[0m signet ${t.key.replace(/-/g," ")}`),await v();const n=new AbortController;let r=!1;try{const i=await fetch(`${ae}/api/troubleshoot/exec`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:t.key}),signal:n.signal});if(!i.ok){const D=await i.json().catch(()=>({error:"request failed"}));o(e,`\x1B[31merror:\x1B[0m ${D.error??i.statusText}`),a.running=!1,await v(e);return}const d=i.body?.getReader();if(!d){o(e,"\x1B[31merror:\x1B[0m no stream"),a.running=!1;return}t.key==="daemon-restart"&&(r=!0);const b=new TextDecoder;let $="";try{for(;;){const{done:D,value:B}=await d.read();if(D)break;$+=b.decode(B,{stream:!0});const N=$.split(`
1
+ import{p as se,s as be,c as C,f as w,a as fe,n as ge,b as c,d as re,r as ke,e as pe,o as me,j as u,A as Y,h as R,i as s,t as y,l as p,k as A,w as ue,x as Z,y as z,z as H,u as ee,aa as Je,O as he,ab as Ke,a3 as We,K as Be,m as T,v as te,U as Fe,P as Ue}from"./V_JjZsJi.js";import{I as ye,K as Ve,o as ae}from"./DySpBuOv.js";import{S as Qe,a as Xe,b as Ye,c as Ze}from"./zQY3sXa2.js";import{W as et,L as ve}from"./Bsjc4PMT.js";import{T as tt}from"./DbQdiTbg.js";function at(P,f){se(f,!0);let x=ke(f,["$$slots","$$events","$$legacy"]);const g=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}]];ye(P,be({name:"activity"},()=>x,{get iconNode(){return g},children:(h,O)=>{var _=C(),E=w(_);fe(E,()=>f.children??ge),c(h,_)},$$slots:{default:!0}})),re()}function st(P,f){se(f,!0);let x=ke(f,["$$slots","$$events","$$legacy"]);const g=[["path",{d:"M12 19h8"}],["path",{d:"m4 17 6-6-6-6"}]];ye(P,be({name:"terminal"},()=>x,{get iconNode(){return g},children:(h,O)=>{var _=C(),E=w(_);fe(E,()=>f.children??ge),c(h,_)},$$slots:{default:!0}})),re()}var rt=T('<span class="ts-panel-count svelte-c36e65"> </span>'),it=T("<!> <!>",1),nt=T('<div class="ts-control svelte-c36e65"><div class="ts-control-head svelte-c36e65"><div class="ts-control-title-wrap svelte-c36e65"><!> <span class="ts-control-title svelte-c36e65"> </span> <!></div> <!></div> <div class="ts-action-bar svelte-c36e65"><!> <button class="ts-run svelte-c36e65"><!></button></div></div>'),lt=T('<button class="ts-clear svelte-c36e65" title="Clear output"><!></button>'),ot=T('<div class="ts-empty svelte-c36e65">no output yet</div>'),ct=T('<div class="ts-line svelte-c36e65"></div>'),dt=T('<div class="ts-root svelte-c36e65"><div class="ts-controls svelte-c36e65"></div> <div class="ts-terminal-wrap svelte-c36e65"><div class="ts-terminal-head svelte-c36e65"><span class="ts-control-title svelte-c36e65">Terminal</span> <!></div> <div class="ts-term svelte-c36e65" role="log"><!></div></div></div>');function gt(P,f){se(f,!0);const x=[{id:"cli",title:"CLI",icon:st,color:"var(--sig-highlight)",commands:[{label:"Status",kind:"cli",key:"status"},{label:"Daemon Status",kind:"cli",key:"daemon-status"},{label:"Daemon Logs",kind:"cli",key:"daemon-logs"},{label:"Sync",kind:"cli",key:"sync"},{label:"Embed Audit",kind:"cli",key:"embed-audit"},{label:"Skill List",kind:"cli",key:"skill-list"},{label:"Secret List",kind:"cli",key:"secret-list"},{label:"Recall Test",kind:"cli",key:"recall-test"}]},{id:"status",title:"Status",icon:at,color:"var(--sig-highlight)",commands:[{label:"Health",kind:"api",method:"GET",path:"/health"},{label:"Diagnostics",kind:"api",method:"GET",path:"/api/diagnostics"},{label:"Pipeline",kind:"api",method:"GET",path:"/api/pipeline/status"},{label:"Predictor",kind:"api",method:"GET",path:"/api/predictor/status"},{label:"Git",kind:"api",method:"GET",path:"/api/git/status"},{label:"Embeddings",kind:"api",method:"GET",path:"/api/embeddings/health"}]},{id:"info",title:"Info",icon:Ve,color:"var(--sig-highlight)",commands:[{label:"Embed Gaps",kind:"api",method:"GET",path:"/api/repair/embedding-gaps"},{label:"Dedup Stats",kind:"api",method:"GET",path:"/api/repair/dedup-stats"},{label:"Cold Stats",kind:"api",method:"GET",path:"/api/repair/cold-stats"}]},{id:"repair",title:"Repair",icon:et,color:"var(--sig-highlight)",commands:[{label:"Check FTS",kind:"api",method:"POST",path:"/api/repair/check-fts"},{label:"Re-embed",kind:"api",method:"POST",path:"/api/repair/re-embed"},{label:"Resync Vec",kind:"api",method:"POST",path:"/api/repair/resync-vec"},{label:"Clean Orphans",kind:"api",method:"POST",path:"/api/repair/clean-orphans"},{label:"Deduplicate",kind:"api",method:"POST",path:"/api/repair/deduplicate"},{label:"Retention",kind:"api",method:"POST",path:"/api/repair/retention-sweep"},{label:"Requeue Dead",kind:"api",method:"POST",path:"/api/repair/requeue-dead"},{label:"Release Leases",kind:"api",method:"POST",path:"/api/repair/release-leases"},{label:"Backfill Skipped",kind:"api",method:"POST",path:"/api/repair/backfill-skipped"},{label:"Reclassify",kind:"api",method:"POST",path:"/api/repair/reclassify-entities"},{label:"Prune Chunks",kind:"api",method:"POST",path:"/api/repair/prune-chunk-groups"},{label:"Prune Singletons",kind:"api",method:"POST",path:"/api/repair/prune-singleton-entities"},{label:"Stop Daemon",kind:"cli",key:"daemon-stop"},{label:"Restart Daemon",kind:"cli",key:"daemon-restart"},{label:"Update Signet",kind:"cli",key:"update"}]}];let g=pe(Object.fromEntries(x.map(e=>[e.id,{lines:[],running:!1,selected:0}]))),h=me(pe([])),O=me(void 0);const _=Object.fromEntries(x.map(e=>[e.id,e]));function E(e){te(O,e,!0)}async function v(e){await Fe(),s(O)?.scrollTo({top:s(O).scrollHeight,behavior:"smooth"})}function o(e,t){const a=g[e];if(!a)return;a.lines=[...a.lines,t];const n=_[e]?.title??e;te(h,[...s(h),t?`[${n}] ${t}`:""],!0)}function xe(){te(h,[],!0);for(const e of x)g[e.id].lines=[]}async function _e(e,t){const a=g[e];if(!a||a.running||!t.key)return;a.running=!0,o(e,`\x1B[32m$\x1B[0m signet ${t.key.replace(/-/g," ")}`),await v();const n=new AbortController;let r=!1;try{const i=await fetch(`${ae}/api/troubleshoot/exec`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:t.key}),signal:n.signal});if(!i.ok){const D=await i.json().catch(()=>({error:"request failed"}));o(e,`\x1B[31merror:\x1B[0m ${D.error??i.statusText}`),a.running=!1,await v(e);return}const d=i.body?.getReader();if(!d){o(e,"\x1B[31merror:\x1B[0m no stream"),a.running=!1;return}t.key==="daemon-restart"&&(r=!0);const b=new TextDecoder;let $="";try{for(;;){const{done:D,value:B}=await d.read();if(D)break;$+=b.decode(B,{stream:!0});const N=$.split(`
2
2
 
3
3
  `);$=N.pop()??"";for(const F of N){const G=F.match(/^data:\s*(.+)$/m);if(G)try{const m=JSON.parse(G[1]);if(m.type==="started"&&(r=!0),m.type==="stdout"||m.type==="stderr"){const S=String(m.data).replace(/\n$/,"");if(S){for(const j of S.split(`
4
4
  `))o(e,m.type==="stderr"?`\x1B[33m${j}\x1B[0m`:j);await v(e)}}else m.type==="exit"?(o(e,m.code===0?"\x1B[32m✓ exit 0\x1B[0m":`\x1B[31m✗ exit ${m.code}\x1B[0m`),await v(e)):m.type==="error"&&(o(e,`\x1B[31merror:\x1B[0m ${m.message}`),await v(e))}catch{}}}}finally{d.releaseLock()}}catch(i){n.signal.aborted||(t.key==="daemon-stop"||t.key==="daemon-restart"?o(e,"\x1B[33mDaemon process ended\x1B[0m"):o(e,`\x1B[31merror:\x1B[0m ${i instanceof Error?i.message:"fetch failed"}`))}if(t.key==="daemon-restart"&&r){o(e,"\x1B[90mWaiting for daemon to restart...\x1B[0m"),await v();let i=!1;for(let d=0;d<15;d++){await new Promise(b=>setTimeout(b,1e3));try{if((await fetch(`${ae}/health`)).ok){i=!0;break}}catch{}}o(e,i?"\x1B[32m✓ Daemon restarted\x1B[0m":"\x1B[31m✗ Daemon did not restart within 15s\x1B[0m"),await v()}o(e,""),a.running=!1,await v()}async function $e(e,t){const a=g[e];if(!a||a.running||!t.path||!t.method)return;a.running=!0;const n=performance.now();o(e,`\x1B[32m$\x1B[0m ${t.method} ${t.path}`),await v();try{const r=await fetch(`${ae}${t.path}`,{method:t.method}),i=Math.round(performance.now()-n),b=(r.headers.get("content-type")??"").includes("json")?JSON.stringify(await r.json(),null,2):await r.text();o(e,r.ok?`\x1B[32m${r.status} OK\x1B[0m \x1B[90m${i}ms\x1B[0m`:`\x1B[31m${r.status} FAILED\x1B[0m \x1B[90m${i}ms\x1B[0m`);for(const $ of b.split(`
@@ -1 +1 @@
1
- import{p,s as c,c as d,f as i,a as l,n as m,b as f,d as h,r as u}from"./V_JjZsJi.js";import{I as $}from"./WTmJ2kxu.js";function w(a,s){p(s,!0);let e=u(s,["$$slots","$$events","$$legacy"]);const o=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]];$(a,c({name:"rotate-ccw"},()=>e,{get iconNode(){return o},children:(r,_)=>{var t=d(),n=i(t);l(n,()=>s.children??m),f(r,t)},$$slots:{default:!0}})),h()}export{w as R};
1
+ import{p,s as c,c as d,f as i,a as l,n as m,b as f,d as h,r as u}from"./V_JjZsJi.js";import{I as $}from"./DySpBuOv.js";function w(a,s){p(s,!0);let e=u(s,["$$slots","$$events","$$legacy"]);const o=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]];$(a,c({name:"rotate-ccw"},()=>e,{get iconNode(){return o},children:(r,_)=>{var t=d(),n=i(t);l(n,()=>s.children??m),f(r,t)},$$slots:{default:!0}})),h()}export{w as R};
@@ -1 +1 @@
1
- import{p as _,g as o,c as w,f as k,k as I,b as s,d as E,E as c,F as f,J as F,I as v,m as g,r as J}from"./V_JjZsJi.js";import{c as b}from"./WTmJ2kxu.js";var P=g("<input/>"),S=g("<input/>");function z(p,i){_(i,!0);let a=o(i,"ref",15,null),d=o(i,"value",15),m=o(i,"files",15),n=o(i,"data-slot",3,"input"),l=J(i,["$$slots","$$events","$$legacy","ref","value","type","files","class","data-slot"]);var u=w(),x=k(u);{var y=t=>{var e=P();c(e,r=>({"data-slot":n(),class:r,type:"file",...l}),[()=>b("selection:bg-primary dark:bg-input/30 selection:text-primary-foreground border-input ring-offset-background placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i.class)],void 0,void 0,void 0,!0),f(e,r=>a(r),()=>a()),F(e,m),v(e,d),s(t,e)},h=t=>{var e=S();c(e,r=>({"data-slot":n(),class:r,type:i.type,...l}),[()=>b("border-input bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i.class)],void 0,void 0,void 0,!0),f(e,r=>a(r),()=>a()),v(e,d),s(t,e)};I(x,t=>{i.type==="file"?t(y):t(h,-1)})}s(p,u),E()}export{z as I};
1
+ import{p as _,g as o,c as w,f as k,k as I,b as s,d as E,E as c,F as f,J as F,I as v,m as g,r as J}from"./V_JjZsJi.js";import{c as b}from"./DySpBuOv.js";var P=g("<input/>"),S=g("<input/>");function z(p,i){_(i,!0);let a=o(i,"ref",15,null),d=o(i,"value",15),m=o(i,"files",15),n=o(i,"data-slot",3,"input"),l=J(i,["$$slots","$$events","$$legacy","ref","value","type","files","class","data-slot"]);var u=w(),x=k(u);{var y=t=>{var e=P();c(e,r=>({"data-slot":n(),class:r,type:"file",...l}),[()=>b("selection:bg-primary dark:bg-input/30 selection:text-primary-foreground border-input ring-offset-background placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i.class)],void 0,void 0,void 0,!0),f(e,r=>a(r),()=>a()),F(e,m),v(e,d),s(t,e)},h=t=>{var e=S();c(e,r=>({"data-slot":n(),class:r,type:i.type,...l}),[()=>b("border-input bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i.class)],void 0,void 0,void 0,!0),f(e,r=>a(r),()=>a()),v(e,d),s(t,e)};I(x,t=>{i.type==="file"?t(y):t(h,-1)})}s(p,u),E()}export{z as I};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./C1YW3XLo.js","./V_JjZsJi.js","../assets/vendor-ui.BHIBfuhK.css","./WTmJ2kxu.js","./Cik1Y8bQ.js","./PPVm8Dsz.js","../assets/2.BqUJ-YIW.css","./DETIKIiJ.js","./B5_qL5eG.js","./DDXwoyYk.js","./DERRcs3d.js","./tjtK_67M.js","../assets/TroubleshooterPanel.Bj27xjMc.css","./Beqv-RRr.js","./CCx9trWZ.js","../assets/PageBanner.BodUOjhn.css","./Bzw_3peg.js","./UGONRT_X.js","./DdQKnaVE.js","../assets/LogsTab.DpPjv4Ww.css"])))=>i.map(i=>d[i]);
2
- import{_ as $}from"./PPVm8Dsz.js";import{p as N,o as Q,e as q,Q as A,i as o,v as x,j as v,t as w,l,k as J,y as E,B as I,R as P,O as B,b as n,d as K,c as u,f as c,T as D,z as H,h as U,m as f,P as M}from"./V_JjZsJi.js";var W=f('<div class="audit-error svelte-1xfrv6f"> </div>'),X=f('<div class="audit-loading svelte-1xfrv6f">Loading troubleshooter...</div>'),Y=f('<div class="audit-error svelte-1xfrv6f"> </div>'),Z=f('<div class="audit-loading svelte-1xfrv6f">Loading logs...</div>'),ee=f('<div class="audit-tab svelte-1xfrv6f"><header class="tab-header svelte-1xfrv6f"><div class="tab-header-left svelte-1xfrv6f"><span class="tab-header-title svelte-1xfrv6f">AUDIT</span> <span class="tab-header-sep svelte-1xfrv6f" aria-hidden="true"></span> <span class="tab-header-count svelte-1xfrv6f">TROUBLESHOOTER + LOGS</span></div> <div class="sub-group svelte-1xfrv6f"><button>TROUBLESHOOTER</button> <button>LOGS</button></div></header> <div class="audit-content audit-embed svelte-1xfrv6f"><!></div></div>');function ae(F,G){N(G,!0);const V=new Set(["troubleshooter","logs"]);function O(){if(typeof window>"u")return"troubleshooter";const t=window.location.hash.replace("#","").split("/");return t[0]!=="audit"?"troubleshooter":t[1]&&V.has(t[1])?t[1]:"troubleshooter"}let i=Q(q(O()));A(()=>{if(typeof window>"u")return;const e=o(i)==="troubleshooter"?"audit":`audit/${o(i)}`;window.location.hash!==`#${e}`&&window.history.replaceState(null,"",`#${e}`)}),A(()=>{if(typeof window>"u")return;const e=()=>{const t=O();t!==o(i)&&x(i,t,!0)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)});const T="px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.06em] rounded-md transition-colors duration-150 border-none cursor-pointer whitespace-nowrap",L=`${T} text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)] border border-[color-mix(in_srgb,var(--sig-highlight),transparent_85%)]`,k=`${T} bg-transparent text-[var(--sig-text-muted)] hover:text-[var(--sig-highlight)] hover:bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_94%)]`;var h=ee(),g=v(h),S=w(v(g),2),_=v(S),y=w(_,2);l(S),l(g);var R=w(g,2),j=v(R);{var z=e=>{var t=u(),p=c(t);D(p,()=>$(()=>import("./C1YW3XLo.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url),a=>{var s=X();n(a,s)},(a,s)=>{var r=u(),d=c(r);U(d,()=>o(s).default,(b,m)=>{m(b,{})}),n(a,r)},(a,s)=>{var r=W(),d=v(r);l(r),E(()=>H(d,`Failed to load: ${o(s)?.message??"unknown"??""}`)),n(a,r)}),n(e,t)},C=e=>{var t=u(),p=c(t);D(p,()=>$(()=>import("./Beqv-RRr.js"),__vite__mapDeps([13,1,2,3,4,5,6,14,15,16,17,8,18,7,9,19]),import.meta.url),a=>{var s=Z();n(a,s)},(a,s)=>{var r=u(),d=c(r);U(d,()=>o(s).default,(b,m)=>{m(b,{})}),n(a,r)},(a,s)=>{var r=Y(),d=v(r);l(r),E(()=>H(d,`Failed to load: ${o(s)?.message??"unknown"??""}`)),n(a,r)}),n(e,t)};J(j,e=>{o(i)==="troubleshooter"?e(z):e(C,-1)})}l(R),l(h),E(()=>{I(_,1,P(o(i)==="troubleshooter"?L:k),"svelte-1xfrv6f"),I(y,1,P(o(i)==="logs"?L:k),"svelte-1xfrv6f")}),B("click",_,()=>x(i,"troubleshooter")),B("click",y,()=>x(i,"logs")),n(F,h),K()}M(["click"]);export{ae as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./B-VASDKO.js","./V_JjZsJi.js","../assets/vendor-ui.BHIBfuhK.css","./DySpBuOv.js","./Cik1Y8bQ.js","./PPVm8Dsz.js","../assets/2.BqUJ-YIW.css","./zQY3sXa2.js","./Sib4VNW_.js","./CV4skcSN.js","./Bsjc4PMT.js","./DbQdiTbg.js","../assets/TroubleshooterPanel.Bj27xjMc.css","./D2ArAHv1.js","./CCx9trWZ.js","../assets/PageBanner.BodUOjhn.css","./Bzw_3peg.js","./BWAfmkOJ.js","./DvMvtG0k.js","../assets/LogsTab.DpPjv4Ww.css"])))=>i.map(i=>d[i]);
2
+ import{_ as $}from"./PPVm8Dsz.js";import{p as N,o as Q,e as q,Q as A,i as o,v as x,j as v,t as w,l,k as J,y as E,B as I,R as P,O as B,b as n,d as K,c as u,f as c,T as D,z as H,h as U,m as f,P as M}from"./V_JjZsJi.js";var W=f('<div class="audit-error svelte-1xfrv6f"> </div>'),X=f('<div class="audit-loading svelte-1xfrv6f">Loading troubleshooter...</div>'),Y=f('<div class="audit-error svelte-1xfrv6f"> </div>'),Z=f('<div class="audit-loading svelte-1xfrv6f">Loading logs...</div>'),ee=f('<div class="audit-tab svelte-1xfrv6f"><header class="tab-header svelte-1xfrv6f"><div class="tab-header-left svelte-1xfrv6f"><span class="tab-header-title svelte-1xfrv6f">AUDIT</span> <span class="tab-header-sep svelte-1xfrv6f" aria-hidden="true"></span> <span class="tab-header-count svelte-1xfrv6f">TROUBLESHOOTER + LOGS</span></div> <div class="sub-group svelte-1xfrv6f"><button>TROUBLESHOOTER</button> <button>LOGS</button></div></header> <div class="audit-content audit-embed svelte-1xfrv6f"><!></div></div>');function ae(F,G){N(G,!0);const V=new Set(["troubleshooter","logs"]);function O(){if(typeof window>"u")return"troubleshooter";const t=window.location.hash.replace("#","").split("/");return t[0]!=="audit"?"troubleshooter":t[1]&&V.has(t[1])?t[1]:"troubleshooter"}let i=Q(q(O()));A(()=>{if(typeof window>"u")return;const e=o(i)==="troubleshooter"?"audit":`audit/${o(i)}`;window.location.hash!==`#${e}`&&window.history.replaceState(null,"",`#${e}`)}),A(()=>{if(typeof window>"u")return;const e=()=>{const t=O();t!==o(i)&&x(i,t,!0)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)});const T="px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.06em] rounded-md transition-colors duration-150 border-none cursor-pointer whitespace-nowrap",L=`${T} text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)] border border-[color-mix(in_srgb,var(--sig-highlight),transparent_85%)]`,k=`${T} bg-transparent text-[var(--sig-text-muted)] hover:text-[var(--sig-highlight)] hover:bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_94%)]`;var h=ee(),g=v(h),S=w(v(g),2),_=v(S),y=w(_,2);l(S),l(g);var R=w(g,2),j=v(R);{var z=e=>{var t=u(),p=c(t);D(p,()=>$(()=>import("./B-VASDKO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url),a=>{var s=X();n(a,s)},(a,s)=>{var r=u(),d=c(r);U(d,()=>o(s).default,(b,m)=>{m(b,{})}),n(a,r)},(a,s)=>{var r=W(),d=v(r);l(r),E(()=>H(d,`Failed to load: ${o(s)?.message??"unknown"??""}`)),n(a,r)}),n(e,t)},C=e=>{var t=u(),p=c(t);D(p,()=>$(()=>import("./D2ArAHv1.js"),__vite__mapDeps([13,1,2,3,4,5,6,14,15,16,17,8,18,7,9,19]),import.meta.url),a=>{var s=Z();n(a,s)},(a,s)=>{var r=u(),d=c(r);U(d,()=>o(s).default,(b,m)=>{m(b,{})}),n(a,r)},(a,s)=>{var r=Y(),d=v(r);l(r),E(()=>H(d,`Failed to load: ${o(s)?.message??"unknown"??""}`)),n(a,r)}),n(e,t)};J(j,e=>{o(i)==="troubleshooter"?e(z):e(C,-1)})}l(R),l(h),E(()=>{I(_,1,P(o(i)==="troubleshooter"?L:k),"svelte-1xfrv6f"),I(y,1,P(o(i)==="logs"?L:k),"svelte-1xfrv6f")}),B("click",_,()=>x(i,"troubleshooter")),B("click",y,()=>x(i,"logs")),n(F,h),K()}M(["click"]);export{ae as default};
@@ -1 +1 @@
1
- import{p as _,g as d,c as y,f as C,h as w,s as z,i as j,C as M,b as u,d as P,r as q,j as A,k as B,l as D,u as E,m as F}from"./V_JjZsJi.js";import{c as G,M as H}from"./WTmJ2kxu.js";import{C as I}from"./B5_qL5eG.js";var J=F('<div data-slot="checkbox-indicator" class="text-current transition-none"><!></div>');function O(f,t){_(t,!0);let n=d(t,"ref",15,null),c=d(t,"checked",15,!1),o=d(t,"indeterminate",15,!1),h=q(t,["$$slots","$$events","$$legacy","ref","checked","indeterminate","class"]);var l=y(),m=C(l);{const k=(s,a)=>{let e=()=>a?.().checked,b=()=>a?.().indeterminate;var i=J(),p=A(i);{var g=r=>{I(r,{class:"size-3.5"})},x=r=>{H(r,{class:"size-3.5"})};B(p,r=>{e()?r(g):b()&&r(x,1)})}D(i),u(s,i)};let v=E(()=>G("border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t.class));w(m,()=>M,(s,a)=>{a(s,z({"data-slot":"checkbox",get class(){return j(v)}},()=>h,{get ref(){return n()},set ref(e){n(e)},get checked(){return c()},set checked(e){c(e)},get indeterminate(){return o()},set indeterminate(e){o(e)},children:k,$$slots:{default:!0}}))})}u(f,l),P()}export{O as C};
1
+ import{p as _,g as d,c as y,f as C,h as w,s as z,i as j,C as M,b as u,d as P,r as q,j as A,k as B,l as D,u as E,m as F}from"./V_JjZsJi.js";import{c as G,M as H}from"./DySpBuOv.js";import{C as I}from"./Sib4VNW_.js";var J=F('<div data-slot="checkbox-indicator" class="text-current transition-none"><!></div>');function O(f,t){_(t,!0);let n=d(t,"ref",15,null),c=d(t,"checked",15,!1),o=d(t,"indeterminate",15,!1),h=q(t,["$$slots","$$events","$$legacy","ref","checked","indeterminate","class"]);var l=y(),m=C(l);{const k=(s,a)=>{let e=()=>a?.().checked,b=()=>a?.().indeterminate;var i=J(),p=A(i);{var g=r=>{I(r,{class:"size-3.5"})},x=r=>{H(r,{class:"size-3.5"})};B(p,r=>{e()?r(g):b()&&r(x,1)})}D(i),u(s,i)};let v=E(()=>G("border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t.class));w(m,()=>M,(s,a)=>{a(s,z({"data-slot":"checkbox",get class(){return j(v)}},()=>h,{get ref(){return n()},set ref(e){n(e)},get checked(){return c()},set checked(e){c(e)},get indeterminate(){return o()},set indeterminate(e){o(e)},children:k,$$slots:{default:!0}}))})}u(f,l),P()}export{O as C};
@@ -1 +1 @@
1
- import{p as i,g as c,E as n,j as l,a as p,n as f,l as h,F as m,b as u,d as v,r as _,m as b}from"./V_JjZsJi.js";import{c as g}from"./WTmJ2kxu.js";var w=b("<div><!></div>");function j(e,a){i(a,!0);let t=c(a,"ref",15,null),o=_(a,["$$slots","$$events","$$legacy","ref","class","children"]);var r=w();n(r,s=>({"data-slot":"card-header",class:s,...o}),[()=>g("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",a.class)]);var d=l(r);p(d,()=>a.children??f),h(r),m(r,s=>t(s),()=>t()),u(e,r),v()}export{j as C};
1
+ import{p as i,g as c,E as n,j as l,a as p,n as f,l as h,F as m,b as u,d as v,r as _,m as b}from"./V_JjZsJi.js";import{c as g}from"./DySpBuOv.js";var w=b("<div><!></div>");function j(e,a){i(a,!0);let t=c(a,"ref",15,null),o=_(a,["$$slots","$$events","$$legacy","ref","class","children"]);var r=w();n(r,s=>({"data-slot":"card-header",class:s,...o}),[()=>g("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",a.class)]);var d=l(r);p(d,()=>a.children??f),h(r),m(r,s=>t(s),()=>t()),u(e,r),v()}export{j as C};
@@ -1 +1 @@
1
- import{p as n,g as r,H as u,E as c,F as b,I as v,b as f,d as x,r as m,m as g}from"./V_JjZsJi.js";import{c as p}from"./WTmJ2kxu.js";var h=g("<textarea></textarea>");function y(i,a){n(a,!0);let s=r(a,"ref",15,null),o=r(a,"value",15),d=r(a,"data-slot",3,"textarea"),l=m(a,["$$slots","$$events","$$legacy","ref","value","class","data-slot"]);var e=h();u(e),c(e,t=>({"data-slot":d(),class:t,...l}),[()=>p("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a.class)]),b(e,t=>s(t),()=>s()),v(e,o),f(i,e),x()}export{y as T};
1
+ import{p as n,g as r,H as u,E as c,F as b,I as v,b as f,d as x,r as m,m as g}from"./V_JjZsJi.js";import{c as p}from"./DySpBuOv.js";var h=g("<textarea></textarea>");function y(i,a){n(a,!0);let s=r(a,"ref",15,null),o=r(a,"value",15),d=r(a,"data-slot",3,"textarea"),l=m(a,["$$slots","$$events","$$legacy","ref","value","class","data-slot"]);var e=h();u(e),c(e,t=>({"data-slot":d(),class:t,...l}),[()=>p("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a.class)]),b(e,t=>s(t),()=>s()),v(e,o),f(i,e),x()}export{y as T};
@@ -1,4 +1,4 @@
1
- import{p as nt,g as At,t as r,j as s,l as e,w as Ct,A as gt,y as H,z as h,i as t,aa as at,b as u,K as Rt,d as it,u as _,m as y,c as Ht,f as qt,h as xt,as as Zt,s as Ft,r as Vt,o as K,e as bt,Q as Yt,v as q,k as rt,O as ft,x as Kt,E as Ut,D as kt,F as te,P as It,a as ee,n as se,q as Dt,at as ae,N as re,au as ne}from"./V_JjZsJi.js";import{B as ie,aR as Bt,t as pt,R as le,aS as Wt,I as oe,o as ve,n as ce,aT as de,aU as ue,aB as pe,a as fe}from"./WTmJ2kxu.js";import{P as ge,a as me,b as he}from"./DRPrjjHV.js";import{T as _e}from"./BFhviDgB.js";import{R as ye}from"./5pZXz3Gm.js";import{f as xe,a as be,s as Se,m as Ee,g as we,b as Me,c as Te,d as je}from"./17DJUZua.js";var Ae=y('<div class="data-row svelte-1j3peig"><span class="data-idx svelte-1j3peig"> </span> <span class="data-label svelte-1j3peig"> </span> <span class="data-fill svelte-1j3peig"></span> <span class="data-value svelte-1j3peig"> </span></div>'),Ce=y('<div class="data-row svelte-1j3peig"><span class="data-idx svelte-1j3peig"> </span> <span class="data-label svelte-1j3peig"> </span> <span class="data-fill svelte-1j3peig"></span> <span class="data-value svelte-1j3peig"> </span></div>'),Ie=y('<div class="readout sig-panel svelte-1j3peig"><div class="readout-texture svelte-1j3peig" aria-hidden="true"></div> <div class="readout-content svelte-1j3peig"><div class="readout-eyebrow svelte-1j3peig"><span class="eyebrow-left svelte-1j3peig">SIGNET AGENT READOUT</span> <span class="eyebrow-right svelte-1j3peig"> </span></div> <div class="readout-hero svelte-1j3peig"><h1 class="agent-name svelte-1j3peig"> </h1> <div class="hero-stat svelte-1j3peig"><span class="hero-number svelte-1j3peig"> </span> <span class="hero-unit svelte-1j3peig">MEMORIES<br/>STORED</span></div></div> <div class="readout-divider sig-groove svelte-1j3peig" aria-hidden="true"></div> <div class="readout-grid svelte-1j3peig"><div class="readout-col svelte-1j3peig"></div> <div class="readout-col svelte-1j3peig"></div></div></div></div>');function Ne(F,o){nt(o,!0);const p=At(o,"diagnostics",3,null),x=At(o,"pipelineStatus",3,null),b=At(o,"memoryStats",3,null),j=_(()=>{const m=o.daemonStatus?.agentCreatedAt;if(!m)return null;const f=new Date(m).getTime();return Number.isNaN(f)?null:Math.max(0,Math.floor((Date.now()-f)/864e5))}),L=_(()=>t(j)===null?"--":t(j)===0?"TODAY":t(j)===1?"1 DAY":`${t(j)} DAYS`),A=_(()=>o.daemonStatus?.activeSessions??0),R=_(()=>o.daemonStatus?.version??"--"),I=_(()=>o.continuity.length===0?null:[...o.continuity].sort((f,M)=>new Date(M.created_at).getTime()-new Date(f.created_at).getTime())[0]);function J(m){const f=Date.now()-new Date(m).getTime(),M=Math.floor(f/6e4);if(M<1)return"JUST NOW";if(M<60)return`${M}M AGO`;const T=Math.floor(M/60);return T<24?`${T}H AGO`:`${Math.floor(T/24)}D AGO`}const V=_(()=>t(I)?.project?.replace(/\/$/,"").split("/").pop()??"--"),Q=_(()=>t(I)?J(t(I).created_at):"--"),Y=_(()=>o.identity.name&&o.identity.name.trim()||"SIGNET AGENT"),W=_(()=>p()?.composite?.score??null),G=_(()=>p()?.composite?.status??"UNKNOWN"),U=_(()=>p()?.index?.embeddingCoverage!==void 0?Math.round(p().index.embeddingCoverage*100):!b()||b().total===0?null:Math.round(b().withEmbeddings/b().total*100)),tt=_(()=>x()?typeof x().mode=="string"?x().mode.toUpperCase():"ACTIVE":"UNKNOWN"),i=_(()=>{if(!p())return 0;let m=0;const f=["queue","storage","index","provider","connector","predictor"];for(const M of f){const T=p()[M];if(T&&typeof T=="object"&&"status"in T){const O=T.status;(O==="degraded"||O==="unhealthy")&&m++}}return m});function E(m){return m===null?"var(--sig-text-muted)":m>=.8?"var(--sig-success)":m>=.5?"var(--sig-warning)":"var(--sig-danger)"}const n=_(()=>[{idx:"01",label:"UPTIME",value:t(L)},{idx:"02",label:"PROJECT",value:t(V)},{idx:"03",label:"LAST SEEN",value:t(Q)},{idx:"04",label:"CONNECTORS",value:String(o.connectorCount)},{idx:"05",label:"SESSIONS",value:String(t(A))}]),w=_(()=>[{idx:"06",label:"HEALTH",value:t(W)!==null?`${t(W).toFixed(2)} ${t(G).toUpperCase()}`:"--",color:E(t(W))},{idx:"07",label:"EMBEDDED",value:t(U)!==null?`${t(U)}%`:"--"},{idx:"08",label:"PIPELINE",value:t(tt)},{idx:"09",label:"WARNINGS",value:String(t(i)),color:t(i)>0?"var(--sig-danger)":void 0}]);var S=Ie(),k=r(s(S),2),$=s(k),Z=r(s($),2),v=s(Z);e(Z),e($);var g=r($,2),N=s(g),a=s(N,!0);e(N);var l=r(N,2),c=s(l),d=s(c,!0);e(c),Ct(2),e(l),e(g);var D=r(g,4),P=s(D);gt(P,21,()=>t(n),Rt,(m,f)=>{var M=Ae(),T=s(M),O=s(T,!0);e(T);var C=r(T,2),z=s(C,!0);e(C);var X=r(C,4),et=s(X,!0);e(X),e(M),H(()=>{h(O,t(f).idx),h(z,t(f).label),at(X,t(f).color?`color: ${t(f).color}`:""),h(et,t(f).value)}),u(m,M)}),e(P);var B=r(P,2);gt(B,21,()=>t(w),Rt,(m,f)=>{var M=Ce(),T=s(M),O=s(T,!0);e(T);var C=r(T,2),z=s(C,!0);e(C);var X=r(C,4),et=s(X,!0);e(X),e(M),H(()=>{h(O,t(f).idx),h(z,t(f).label),at(X,t(f).color?`color: ${t(f).color}`:""),h(et,t(f).value)}),u(m,M)}),e(B),e(D),e(k),e(S),H(m=>{h(v,`v${t(R)??""}`),h(a,t(Y)),h(d,m)},[()=>o.memoryCount.toLocaleString()]),u(F,S),it()}function Oe(F,o){nt(o,!0);let p=At(o,"ref",15,null),x=Vt(o,["$$slots","$$events","$$legacy","ref"]);var b=Ht(),j=qt(b);xt(j,()=>Zt,(L,A)=>{A(L,Ft({"data-slot":"popover-close"},()=>x,{get ref(){return p()},set ref(R){p(R)}}))}),u(F,b),it()}var Re=y('<div class="empty-state svelte-7r7fq6"><span>NO INSIGHTS TO CURATE</span></div>'),ke=y('<span class="entry-tag svelte-7r7fq6"> </span>'),qe=y('<div class="entry-tags svelte-7r7fq6"></div>'),De=y("<button>EDIT</button>"),Pe=y("<button>Cancel</button>"),$e=y('<div class="edit-popover svelte-7r7fq6"><span class="sig-eyebrow">Correct memory</span> <!> <div class="flex justify-end gap-1 mt-1"><!> <!></div></div>'),Le=y("<!> <!>",1),Ge=y('<div class="insight-entry svelte-7r7fq6"><div class="entry-top svelte-7r7fq6"><div class="entry-top-left svelte-7r7fq6"><span class="entry-idx svelte-7r7fq6"> </span> <span class="entry-dot svelte-7r7fq6"></span> <span class="entry-date svelte-7r7fq6"> </span></div> <!></div> <p class="entry-content svelte-7r7fq6"> </p> <div class="entry-actions svelte-7r7fq6"><button class="action-btn accept sig-switch svelte-7r7fq6">PIN</button> <button class="action-btn reject sig-switch svelte-7r7fq6">DISMISS</button> <!></div></div>'),Ue=y('<div class="insights-list svelte-7r7fq6"></div>'),Be=y('<div class="insights-panel sig-panel svelte-7r7fq6"><div class="insights-header sig-panel-header svelte-7r7fq6"><span class="insights-title svelte-7r7fq6">SUGGESTED INSIGHTS</span> <div class="insights-header-right svelte-7r7fq6"><span class="insights-count svelte-7r7fq6"> </span> <button class="refresh-btn sig-switch svelte-7r7fq6" title="Refresh suggestions"><!> <span>REFRESH</span></button></div></div> <!></div>');function He(F,o){nt(o,!0);let p=K(bt(new Set)),x=K(0),b=K(void 0),j=K(3);const L=90;function A(a){const c=Date.now()-new Date(a.created_at).getTime(),d=864e5,D=c<7*d?1:c<30*d?.5:.2,P=R(a.tags),B=P.length===0?1:P.length<3?.6:.2,m=a.importance??.5,f=m>=.3&&m<=.7?1:.3;return D+B+f}function R(a){return a?Array.isArray(a)?a.filter(Boolean):a.split(",").map(l=>l.trim()).filter(Boolean):[]}const I=_(()=>o.memories.filter(a=>!(t(p).has(a.id)||a.pinned||R(a.tags).includes("rejected-insight"))).map(a=>({memory:a,score:A(a)})).sort((a,l)=>l.score-a.score)),J=_(()=>{if(t(I).length===0)return[];const a=Math.min(t(j),t(I).length),l=t(x)%t(I).length;return Array.from({length:a},(c,d)=>t(I)[(l+d)%t(I).length].memory)});Yt(()=>{if(!t(b))return;const a=new ResizeObserver(l=>{const c=l[0]?.contentRect.height??0;q(j,Math.max(1,Math.floor(c/L)),!0)});return a.observe(t(b)),()=>a.disconnect()});function V(a){return a>=.8?"var(--sig-danger)":a>=.5?"var(--sig-warning)":"var(--sig-success)"}function Q(a){const l=new Date(a),c=l.toLocaleDateString("en-US",{month:"short"}).toUpperCase(),d=String(l.getDate()).padStart(2,"0");return`${c} ${d}`}async function Y(a){const l=await le(a.id,!0);l.success?(q(p,new Set([...t(p),a.id]),!0),pt("Memory pinned","success")):pt(l.error??"Failed to pin","error")}async function W(a){const l=R(a.tags);l.push("rejected-insight");const c=await Bt(a.id,{tags:l.join(",")},"dashboard: rejected insight");c.success?(q(p,new Set([...t(p),a.id]),!0),pt("Memory dismissed","success")):pt(c.error??"Failed to dismiss","error")}let G=bt({});function U(a){G[a.id]=a.content}async function tt(a){const l=G[a.id];if(!l||l===a.content)return;const c=await Bt(a.id,{content:l},"dashboard: corrected insight");c.success?(q(p,new Set([...t(p),a.id]),!0),pt("Memory corrected","success")):pt(c.error??"Failed to save","error")}function i(){q(x,(t(x)+t(j))%Math.max(1,t(I).length))}var E=Be(),n=s(E),w=r(s(n),2),S=s(w),k=s(S);e(S);var $=r(S,2),Z=s($);ye(Z,{class:"refresh-icon"}),Ct(2),e($),e(w),e(n);var v=r(n,2);{var g=a=>{var l=Re();u(a,l)},N=a=>{var l=Ue();gt(l,23,()=>t(J),c=>c.id,(c,d,D)=>{var P=Ge(),B=s(P),m=s(B),f=s(m),M=s(f,!0);e(f);var T=r(f,2),O=r(T,2),C=s(O,!0);e(O),e(m);var z=r(m,2);{var X=lt=>{var ot=qe();gt(ot,21,()=>R(t(d).tags).slice(0,3),Rt,(mt,Mt)=>{var ct=ke(),Tt=s(ct,!0);e(ct),H(()=>h(Tt,t(Mt))),u(mt,ct)}),e(ot),u(lt,ot)},et=_(()=>R(t(d).tags).length>0);rt(z,lt=>{t(et)&&lt(X)})}e(B);var vt=r(B,2),Nt=s(vt,!0);e(vt);var St=r(vt,2),Et=s(St),wt=r(Et,2),zt=r(wt,2);xt(zt,()=>he,(lt,ot)=>{ot(lt,{children:(mt,Mt)=>{var ct=Le(),Tt=qt(ct);{const Ot=(ht,_t)=>{let Pt=()=>_t?.().props;var dt=De(),jt=()=>U(t(d));Ut(dt,()=>({...Pt(),class:"action-btn edit sig-switch",onclick:jt}),void 0,void 0,void 0,"svelte-7r7fq6"),u(ht,dt)};xt(Tt,()=>ge,(ht,_t)=>{_t(ht,{child:Ot,$$slots:{child:!0}})})}var Jt=r(Tt,2);xt(Jt,()=>me,(Ot,ht)=>{ht(Ot,{class:"w-72 !bg-[var(--sig-surface-raised)] !border-[var(--sig-border-strong)]",side:"bottom",align:"start",children:(_t,Pt)=>{var dt=$e(),jt=r(s(dt),2);{let yt=_(()=>G[t(d).id]??t(d).content);_e(jt,{class:`mt-2 min-h-[60px] text-[11px] font-[family-name:var(--font-mono)]
1
+ import{p as nt,g as At,t as r,j as s,l as e,w as Ct,A as gt,y as H,z as h,i as t,aa as at,b as u,K as Rt,d as it,u as _,m as y,c as Ht,f as qt,h as xt,as as Zt,s as Ft,r as Vt,o as K,e as bt,Q as Yt,v as q,k as rt,O as ft,x as Kt,E as Ut,D as kt,F as te,P as It,a as ee,n as se,q as Dt,at as ae,N as re,au as ne}from"./V_JjZsJi.js";import{B as ie,aR as Bt,t as pt,R as le,aS as Wt,I as oe,o as ve,n as ce,aT as de,aU as ue,aB as pe,a as fe}from"./DySpBuOv.js";import{P as ge,a as me,b as he}from"./BtdIzLwF.js";import{T as _e}from"./BphIGb-I.js";import{R as ye}from"./CAqqP6Qf.js";import{f as xe,a as be,s as Se,m as Ee,g as we,b as Me,c as Te,d as je}from"./N9f-e8Vn.js";var Ae=y('<div class="data-row svelte-1j3peig"><span class="data-idx svelte-1j3peig"> </span> <span class="data-label svelte-1j3peig"> </span> <span class="data-fill svelte-1j3peig"></span> <span class="data-value svelte-1j3peig"> </span></div>'),Ce=y('<div class="data-row svelte-1j3peig"><span class="data-idx svelte-1j3peig"> </span> <span class="data-label svelte-1j3peig"> </span> <span class="data-fill svelte-1j3peig"></span> <span class="data-value svelte-1j3peig"> </span></div>'),Ie=y('<div class="readout sig-panel svelte-1j3peig"><div class="readout-texture svelte-1j3peig" aria-hidden="true"></div> <div class="readout-content svelte-1j3peig"><div class="readout-eyebrow svelte-1j3peig"><span class="eyebrow-left svelte-1j3peig">SIGNET AGENT READOUT</span> <span class="eyebrow-right svelte-1j3peig"> </span></div> <div class="readout-hero svelte-1j3peig"><h1 class="agent-name svelte-1j3peig"> </h1> <div class="hero-stat svelte-1j3peig"><span class="hero-number svelte-1j3peig"> </span> <span class="hero-unit svelte-1j3peig">MEMORIES<br/>STORED</span></div></div> <div class="readout-divider sig-groove svelte-1j3peig" aria-hidden="true"></div> <div class="readout-grid svelte-1j3peig"><div class="readout-col svelte-1j3peig"></div> <div class="readout-col svelte-1j3peig"></div></div></div></div>');function Ne(F,o){nt(o,!0);const p=At(o,"diagnostics",3,null),x=At(o,"pipelineStatus",3,null),b=At(o,"memoryStats",3,null),j=_(()=>{const m=o.daemonStatus?.agentCreatedAt;if(!m)return null;const f=new Date(m).getTime();return Number.isNaN(f)?null:Math.max(0,Math.floor((Date.now()-f)/864e5))}),L=_(()=>t(j)===null?"--":t(j)===0?"TODAY":t(j)===1?"1 DAY":`${t(j)} DAYS`),A=_(()=>o.daemonStatus?.activeSessions??0),R=_(()=>o.daemonStatus?.version??"--"),I=_(()=>o.continuity.length===0?null:[...o.continuity].sort((f,M)=>new Date(M.created_at).getTime()-new Date(f.created_at).getTime())[0]);function J(m){const f=Date.now()-new Date(m).getTime(),M=Math.floor(f/6e4);if(M<1)return"JUST NOW";if(M<60)return`${M}M AGO`;const T=Math.floor(M/60);return T<24?`${T}H AGO`:`${Math.floor(T/24)}D AGO`}const V=_(()=>t(I)?.project?.replace(/\/$/,"").split("/").pop()??"--"),Q=_(()=>t(I)?J(t(I).created_at):"--"),Y=_(()=>o.identity.name&&o.identity.name.trim()||"SIGNET AGENT"),W=_(()=>p()?.composite?.score??null),G=_(()=>p()?.composite?.status??"UNKNOWN"),U=_(()=>p()?.index?.embeddingCoverage!==void 0?Math.round(p().index.embeddingCoverage*100):!b()||b().total===0?null:Math.round(b().withEmbeddings/b().total*100)),tt=_(()=>x()?typeof x().mode=="string"?x().mode.toUpperCase():"ACTIVE":"UNKNOWN"),i=_(()=>{if(!p())return 0;let m=0;const f=["queue","storage","index","provider","connector","predictor"];for(const M of f){const T=p()[M];if(T&&typeof T=="object"&&"status"in T){const O=T.status;(O==="degraded"||O==="unhealthy")&&m++}}return m});function E(m){return m===null?"var(--sig-text-muted)":m>=.8?"var(--sig-success)":m>=.5?"var(--sig-warning)":"var(--sig-danger)"}const n=_(()=>[{idx:"01",label:"UPTIME",value:t(L)},{idx:"02",label:"PROJECT",value:t(V)},{idx:"03",label:"LAST SEEN",value:t(Q)},{idx:"04",label:"CONNECTORS",value:String(o.connectorCount)},{idx:"05",label:"SESSIONS",value:String(t(A))}]),w=_(()=>[{idx:"06",label:"HEALTH",value:t(W)!==null?`${t(W).toFixed(2)} ${t(G).toUpperCase()}`:"--",color:E(t(W))},{idx:"07",label:"EMBEDDED",value:t(U)!==null?`${t(U)}%`:"--"},{idx:"08",label:"PIPELINE",value:t(tt)},{idx:"09",label:"WARNINGS",value:String(t(i)),color:t(i)>0?"var(--sig-danger)":void 0}]);var S=Ie(),k=r(s(S),2),$=s(k),Z=r(s($),2),v=s(Z);e(Z),e($);var g=r($,2),N=s(g),a=s(N,!0);e(N);var l=r(N,2),c=s(l),d=s(c,!0);e(c),Ct(2),e(l),e(g);var D=r(g,4),P=s(D);gt(P,21,()=>t(n),Rt,(m,f)=>{var M=Ae(),T=s(M),O=s(T,!0);e(T);var C=r(T,2),z=s(C,!0);e(C);var X=r(C,4),et=s(X,!0);e(X),e(M),H(()=>{h(O,t(f).idx),h(z,t(f).label),at(X,t(f).color?`color: ${t(f).color}`:""),h(et,t(f).value)}),u(m,M)}),e(P);var B=r(P,2);gt(B,21,()=>t(w),Rt,(m,f)=>{var M=Ce(),T=s(M),O=s(T,!0);e(T);var C=r(T,2),z=s(C,!0);e(C);var X=r(C,4),et=s(X,!0);e(X),e(M),H(()=>{h(O,t(f).idx),h(z,t(f).label),at(X,t(f).color?`color: ${t(f).color}`:""),h(et,t(f).value)}),u(m,M)}),e(B),e(D),e(k),e(S),H(m=>{h(v,`v${t(R)??""}`),h(a,t(Y)),h(d,m)},[()=>o.memoryCount.toLocaleString()]),u(F,S),it()}function Oe(F,o){nt(o,!0);let p=At(o,"ref",15,null),x=Vt(o,["$$slots","$$events","$$legacy","ref"]);var b=Ht(),j=qt(b);xt(j,()=>Zt,(L,A)=>{A(L,Ft({"data-slot":"popover-close"},()=>x,{get ref(){return p()},set ref(R){p(R)}}))}),u(F,b),it()}var Re=y('<div class="empty-state svelte-7r7fq6"><span>NO INSIGHTS TO CURATE</span></div>'),ke=y('<span class="entry-tag svelte-7r7fq6"> </span>'),qe=y('<div class="entry-tags svelte-7r7fq6"></div>'),De=y("<button>EDIT</button>"),Pe=y("<button>Cancel</button>"),$e=y('<div class="edit-popover svelte-7r7fq6"><span class="sig-eyebrow">Correct memory</span> <!> <div class="flex justify-end gap-1 mt-1"><!> <!></div></div>'),Le=y("<!> <!>",1),Ge=y('<div class="insight-entry svelte-7r7fq6"><div class="entry-top svelte-7r7fq6"><div class="entry-top-left svelte-7r7fq6"><span class="entry-idx svelte-7r7fq6"> </span> <span class="entry-dot svelte-7r7fq6"></span> <span class="entry-date svelte-7r7fq6"> </span></div> <!></div> <p class="entry-content svelte-7r7fq6"> </p> <div class="entry-actions svelte-7r7fq6"><button class="action-btn accept sig-switch svelte-7r7fq6">PIN</button> <button class="action-btn reject sig-switch svelte-7r7fq6">DISMISS</button> <!></div></div>'),Ue=y('<div class="insights-list svelte-7r7fq6"></div>'),Be=y('<div class="insights-panel sig-panel svelte-7r7fq6"><div class="insights-header sig-panel-header svelte-7r7fq6"><span class="insights-title svelte-7r7fq6">SUGGESTED INSIGHTS</span> <div class="insights-header-right svelte-7r7fq6"><span class="insights-count svelte-7r7fq6"> </span> <button class="refresh-btn sig-switch svelte-7r7fq6" title="Refresh suggestions"><!> <span>REFRESH</span></button></div></div> <!></div>');function He(F,o){nt(o,!0);let p=K(bt(new Set)),x=K(0),b=K(void 0),j=K(3);const L=90;function A(a){const c=Date.now()-new Date(a.created_at).getTime(),d=864e5,D=c<7*d?1:c<30*d?.5:.2,P=R(a.tags),B=P.length===0?1:P.length<3?.6:.2,m=a.importance??.5,f=m>=.3&&m<=.7?1:.3;return D+B+f}function R(a){return a?Array.isArray(a)?a.filter(Boolean):a.split(",").map(l=>l.trim()).filter(Boolean):[]}const I=_(()=>o.memories.filter(a=>!(t(p).has(a.id)||a.pinned||R(a.tags).includes("rejected-insight"))).map(a=>({memory:a,score:A(a)})).sort((a,l)=>l.score-a.score)),J=_(()=>{if(t(I).length===0)return[];const a=Math.min(t(j),t(I).length),l=t(x)%t(I).length;return Array.from({length:a},(c,d)=>t(I)[(l+d)%t(I).length].memory)});Yt(()=>{if(!t(b))return;const a=new ResizeObserver(l=>{const c=l[0]?.contentRect.height??0;q(j,Math.max(1,Math.floor(c/L)),!0)});return a.observe(t(b)),()=>a.disconnect()});function V(a){return a>=.8?"var(--sig-danger)":a>=.5?"var(--sig-warning)":"var(--sig-success)"}function Q(a){const l=new Date(a),c=l.toLocaleDateString("en-US",{month:"short"}).toUpperCase(),d=String(l.getDate()).padStart(2,"0");return`${c} ${d}`}async function Y(a){const l=await le(a.id,!0);l.success?(q(p,new Set([...t(p),a.id]),!0),pt("Memory pinned","success")):pt(l.error??"Failed to pin","error")}async function W(a){const l=R(a.tags);l.push("rejected-insight");const c=await Bt(a.id,{tags:l.join(",")},"dashboard: rejected insight");c.success?(q(p,new Set([...t(p),a.id]),!0),pt("Memory dismissed","success")):pt(c.error??"Failed to dismiss","error")}let G=bt({});function U(a){G[a.id]=a.content}async function tt(a){const l=G[a.id];if(!l||l===a.content)return;const c=await Bt(a.id,{content:l},"dashboard: corrected insight");c.success?(q(p,new Set([...t(p),a.id]),!0),pt("Memory corrected","success")):pt(c.error??"Failed to save","error")}function i(){q(x,(t(x)+t(j))%Math.max(1,t(I).length))}var E=Be(),n=s(E),w=r(s(n),2),S=s(w),k=s(S);e(S);var $=r(S,2),Z=s($);ye(Z,{class:"refresh-icon"}),Ct(2),e($),e(w),e(n);var v=r(n,2);{var g=a=>{var l=Re();u(a,l)},N=a=>{var l=Ue();gt(l,23,()=>t(J),c=>c.id,(c,d,D)=>{var P=Ge(),B=s(P),m=s(B),f=s(m),M=s(f,!0);e(f);var T=r(f,2),O=r(T,2),C=s(O,!0);e(O),e(m);var z=r(m,2);{var X=lt=>{var ot=qe();gt(ot,21,()=>R(t(d).tags).slice(0,3),Rt,(mt,Mt)=>{var ct=ke(),Tt=s(ct,!0);e(ct),H(()=>h(Tt,t(Mt))),u(mt,ct)}),e(ot),u(lt,ot)},et=_(()=>R(t(d).tags).length>0);rt(z,lt=>{t(et)&&lt(X)})}e(B);var vt=r(B,2),Nt=s(vt,!0);e(vt);var St=r(vt,2),Et=s(St),wt=r(Et,2),zt=r(wt,2);xt(zt,()=>he,(lt,ot)=>{ot(lt,{children:(mt,Mt)=>{var ct=Le(),Tt=qt(ct);{const Ot=(ht,_t)=>{let Pt=()=>_t?.().props;var dt=De(),jt=()=>U(t(d));Ut(dt,()=>({...Pt(),class:"action-btn edit sig-switch",onclick:jt}),void 0,void 0,void 0,"svelte-7r7fq6"),u(ht,dt)};xt(Tt,()=>ge,(ht,_t)=>{_t(ht,{child:Ot,$$slots:{child:!0}})})}var Jt=r(Tt,2);xt(Jt,()=>me,(Ot,ht)=>{ht(Ot,{class:"w-72 !bg-[var(--sig-surface-raised)] !border-[var(--sig-border-strong)]",side:"bottom",align:"start",children:(_t,Pt)=>{var dt=$e(),jt=r(s(dt),2);{let yt=_(()=>G[t(d).id]??t(d).content);_e(jt,{class:`mt-2 min-h-[60px] text-[11px] font-[family-name:var(--font-mono)]
2
2
  bg-[var(--sig-bg)] border-[var(--sig-border)]
3
3
  text-[var(--sig-text)]`,get value(){return t(yt)},oninput:ut=>{const st=ut.currentTarget;st instanceof HTMLTextAreaElement&&(G[t(d).id]=st.value)}})}var $t=r(jt,2),Lt=s($t);{const yt=(ut,st)=>{let Xt=()=>st?.().props;var Gt=Pe();Ut(Gt,()=>({...Xt(),class:"text-[10px] px-2 py-1 text-[var(--sig-text-muted)] hover:text-[var(--sig-text)]"}),void 0,void 0,void 0,"svelte-7r7fq6"),u(ut,Gt)};xt(Lt,()=>Oe,(ut,st)=>{st(ut,{child:yt,$$slots:{child:!0}})})}var Qt=r(Lt,2);ie(Qt,{variant:"default",size:"sm",class:"text-[10px] h-6",onclick:()=>tt(t(d)),children:(yt,ut)=>{Ct();var st=Kt("Save");u(yt,st)},$$slots:{default:!0}}),e($t),e(dt),u(_t,dt)},$$slots:{default:!0}})}),u(mt,ct)},$$slots:{default:!0}})}),e(St),e(P),H((lt,ot,mt,Mt)=>{h(M,lt),at(T,`background: ${ot??""}`),kt(T,"title",`importance: ${mt??""}`),h(C,Mt),h(Nt,t(d).content)},[()=>String(t(D)+1).padStart(2,"0"),()=>V(t(d).importance??.5),()=>(t(d).importance??.5).toFixed(2),()=>Q(t(d).created_at)]),ft("click",Et,()=>Y(t(d))),ft("click",wt,()=>W(t(d))),u(c,P)}),e(l),te(l,c=>q(b,c),()=>t(b)),u(a,l)};rt(v,a=>{t(J).length===0?a(g):a(N,-1)})}e(E),H(()=>h(k,`${t(J).length??""} OF ${t(I).length??""}`)),ft("click",$,i),u(F,E),it()}It(["click"]);var Fe=y('<span class="status-indicator svelte-ym2fyr"> </span>'),Ve=y('<div class="empty-state svelte-ym2fyr">LOADING</div>'),Ye=y('<div class="scoring-data svelte-ym2fyr"><div class="split-bar-container svelte-ym2fyr"><div class="split-bar sig-track svelte-ym2fyr"><div class="split-segment baseline svelte-ym2fyr"></div> <div class="split-segment predictor svelte-ym2fyr"></div></div> <div class="split-labels svelte-ym2fyr"><span class="split-label svelte-ym2fyr"> </span> <span class="split-label accent svelte-ym2fyr"> </span></div></div> <div class="stat-rows svelte-ym2fyr"><div class="stat-row svelte-ym2fyr"><span class="stat-label svelte-ym2fyr">SUCCESS RATE</span> <span class="stat-fill svelte-ym2fyr"></span> <span class="stat-value svelte-ym2fyr"> </span></div> <div class="stat-row svelte-ym2fyr"><span class="stat-label svelte-ym2fyr">MODEL VERSION</span> <span class="stat-fill svelte-ym2fyr"></span> <span class="stat-value svelte-ym2fyr"> </span></div> <div class="stat-row svelte-ym2fyr"><span class="stat-label svelte-ym2fyr">TRAINING SESSIONS</span> <span class="stat-fill svelte-ym2fyr"></span> <span class="stat-value svelte-ym2fyr"> </span></div></div></div>'),Ke=y('<div class="stat-rows svelte-ym2fyr"><div class="stat-row svelte-ym2fyr"><span class="stat-label svelte-ym2fyr">EMBEDDING COVERAGE</span> <span class="stat-fill svelte-ym2fyr"></span> <span class="stat-value svelte-ym2fyr"> </span></div> <div class="stat-row svelte-ym2fyr"><span class="stat-label svelte-ym2fyr">TOTAL MEMORIES</span> <span class="stat-fill svelte-ym2fyr"></span> <span class="stat-value svelte-ym2fyr"> </span></div> <div class="stat-row svelte-ym2fyr"><span class="stat-label svelte-ym2fyr">HEALTH SCORE</span> <span class="stat-fill svelte-ym2fyr"></span> <span class="stat-value svelte-ym2fyr"> </span></div></div>'),We=y('<div class="panel sig-panel svelte-ym2fyr"><div class="panel-header sig-panel-header svelte-ym2fyr"><span class="panel-title svelte-ym2fyr">MEMORY SCORING</span> <!></div> <div class="panel-body svelte-ym2fyr"><!></div> <div class="panel-footer sig-panel-footer svelte-ym2fyr"><button class="panel-link svelte-ym2fyr">VIEW PREDICTOR</button></div></div>');function ze(F,o){nt(o,!0);const p="";let x=K(null),b=K(null),j=K(!1);const L=_(()=>t(x)!==null&&t(x).sidecarAlive),A=_(()=>t(x)?.alpha??.6),R=_(()=>t(x)?.successRate??0),I=_(()=>{if(t(b)?.composite){const v=t(b).composite.score;return v>=.7?"healthy":v>=.4?"degraded":"unhealthy"}return t(x)?.status??"unknown"}),J=_(()=>t(b)?.index?.embeddingCoverage??0),V=_(()=>t(b)?.storage?.totalMemories??0),Q=_(()=>t(b)?.composite?.score??0);function Y(v){return v==="healthy"?"var(--sig-success)":v==="degraded"||v==="cold_start"?"var(--sig-warning)":v==="unhealthy"?"var(--sig-danger)":"var(--sig-text-muted)"}async function W(){try{const[v,g]=await Promise.allSettled([fetch(`${p}/api/diagnostics/predictor`),fetch(`${p}/api/diagnostics`)]);v.status==="fulfilled"&&v.value.ok&&q(x,await v.value.json(),!0),g.status==="fulfilled"&&g.value.ok&&q(b,await g.value.json(),!0)}catch{}q(j,!0)}Yt(()=>{o.daemonStatus?W():q(j,!0)});var G=We(),U=s(G),tt=r(s(U),2);{var i=v=>{var g=Fe(),N=s(g,!0);e(g),H((a,l)=>{at(g,`color: ${a??""}`),h(N,l)},[()=>Y(t(I)),()=>t(I).toUpperCase()]),u(v,g)};rt(tt,v=>{t(j)&&v(i)})}e(U);var E=r(U,2),n=s(E);{var w=v=>{var g=Ve();u(v,g)},S=v=>{var g=Ye(),N=s(g),a=s(N),l=s(a),c=r(l,2);e(a);var d=r(a,2),D=s(d),P=s(D);e(D);var B=r(D,2),m=s(B);e(B),e(d),e(N);var f=r(N,2),M=s(f),T=r(s(M),4),O=s(T);e(T),e(M);var C=r(M,2),z=r(s(C),4),X=s(z);e(z),e(C);var et=r(C,2),vt=r(s(et),4),Nt=s(vt,!0);e(vt),e(et),e(f),e(g),H((St,Et,wt)=>{at(l,`width: ${t(A)*100}%`),at(c,`width: ${(1-t(A))*100}%`),h(P,`BASELINE ${St??""}%`),h(m,`PREDICTOR ${Et??""}%`),h(O,`${wt??""}%`),h(X,`v${t(x)?.modelVersion??"--"??""}`),h(Nt,t(x)?.trainingSessions??"--")},[()=>Math.round(t(A)*100),()=>Math.round((1-t(A))*100),()=>Math.round(t(R)*100)]),u(v,g)},k=v=>{var g=Ke(),N=s(g),a=r(s(N),4),l=s(a);e(a),e(N);var c=r(N,2),d=r(s(c),4),D=s(d,!0);e(d),e(c);var P=r(c,2),B=r(s(P),4),m=s(B);e(B),e(P),e(g),H((f,M,T)=>{h(l,`${f??""}%`),h(D,M),h(m,`${T??""}%`)},[()=>Math.round(t(J)*100),()=>t(V).toLocaleString(),()=>Math.round(t(Q)*100)]),u(v,g)};rt(n,v=>{t(j)?t(L)?v(S,1):v(k,-1):v(w)})}e(E);var $=r(E,2),Z=s($);e($),e(G),ft("click",Z,()=>Wt("predictor")),u(F,G),it()}It(["click"]);function Je(F,o){nt(o,!0);let p=Vt(o,["$$slots","$$events","$$legacy"]);const x=[["path",{d:"M12 18V5"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77"}]];oe(F,Ft({name:"brain"},()=>p,{get iconNode(){return x},children:(b,j)=>{var L=Ht(),A=qt(L);ee(A,()=>o.children??se),u(b,L)},$$slots:{default:!0}})),it()}var Qe=y('<div class="empty-state svelte-1qexx7n">LOADING</div>'),Xe=y('<div class="empty-state svelte-1qexx7n"><!> <span>NO MEMORIES YET</span></div>'),Ze=y('<span class="entity-count svelte-1qexx7n" title="times recalled"> </span>'),ts=y('<div class="entity-row svelte-1qexx7n"><span class="entity-idx svelte-1qexx7n"> </span> <span class="entity-dot svelte-1qexx7n"></span> <span class="entity-name svelte-1qexx7n"> </span> <!></div>'),es=y('<div class="entity-list svelte-1qexx7n"></div>'),ss=y('<div class="panel sig-panel svelte-1qexx7n"><div class="panel-header sig-panel-header svelte-1qexx7n"><span class="panel-title svelte-1qexx7n">SPOTLIGHT</span> <span class="panel-count svelte-1qexx7n"> </span></div> <div class="panel-body svelte-1qexx7n"><!></div> <div class="panel-footer sig-panel-footer svelte-1qexx7n"><button class="panel-link svelte-1qexx7n">VIEW IN MEMORY</button></div></div>');function as(F,o){nt(o,!0);let p=K(bt([])),x=K(!1);async function b(){try{const i=await fetch(`${ve}/api/memories/most-used?limit=50`);if(i.ok){const w=((await i.json()).memories??[]).filter(S=>typeof S.id=="string"&&S.id.length>0&&typeof S.content=="string").map(S=>({id:S.id,content:S.content??"",access_count:S.access_count??0,importance:S.importance??.5}));if(w.length>0){q(p,w,!0),q(x,!0);return}}}catch{}q(p,o.memories.map(i=>({id:i.id,content:i.content,access_count:0,importance:i.importance??.5})).sort((i,E)=>E.importance-i.importance).slice(0,50),!0),q(x,!0)}Dt(()=>{b()});function j(i){const E=i.content.trim(),n=E.split(`
4
4
  `)[0]??E;return n.length>60?`${n.slice(0,57)}...`:n}function L(i){return i>=.8?"var(--sig-danger)":i>=.5?"var(--sig-warning)":"var(--sig-success)"}var A=ss(),R=s(A),I=r(s(R),2),J=s(I);e(I),e(R);var V=r(R,2),Q=s(V);{var Y=i=>{var E=Qe();u(i,E)},W=i=>{var E=Xe(),n=s(E);Je(n,{class:"empty-icon"}),Ct(2),e(E),u(i,E)},G=i=>{var E=es();gt(E,23,()=>t(p),n=>n.id,(n,w,S)=>{var k=ts(),$=s(k),Z=s($,!0);e($);var v=r($,2),g=r(v,2),N=s(g,!0);e(g);var a=r(g,2);{var l=c=>{var d=Ze(),D=s(d,!0);e(d),H(()=>h(D,t(w).access_count)),u(c,d)};rt(a,c=>{t(w).access_count>0&&c(l)})}e(k),H((c,d,D)=>{h(Z,c),at(v,`background: ${d??""}`),h(N,D)},[()=>String(t(S)+1).padStart(2,"0"),()=>L(t(w).importance),()=>j(t(w))]),u(n,k)}),e(E),u(i,E)};rt(Q,i=>{t(x)?t(p).length===0?i(W,1):i(G,-1):i(Y)})}e(V);var U=r(V,2),tt=s(U);e(U),e(A),H(()=>h(J,`${t(p).length??""} RECALLED`)),ft("click",tt,()=>Wt("cortex-memory")),u(F,A),it()}It(["click"]);var rs=y('<div class="empty-state svelte-6whpsi">LOADING CATALOG...</div>'),ns=y('<div class="empty-state svelte-6whpsi">NO CATALOG DATA</div>'),is=y('<img class="spotlight-avatar svelte-6whpsi"/>'),ls=y('<button type="button" class="spotlight-card svelte-6whpsi"><div class="spotlight-top svelte-6whpsi"><div class="spotlight-icon svelte-6whpsi"><!></div> <div class="spotlight-meta svelte-6whpsi"><span class="spotlight-name svelte-6whpsi"> </span> <span class="spotlight-badge svelte-6whpsi"> </span></div></div> <p class="spotlight-desc svelte-6whpsi"> </p></button>'),os=y('<div class="spotlights-grid svelte-6whpsi"></div>'),vs=y('<div class="spotlights-panel sig-panel svelte-6whpsi"><div class="spotlights-header sig-panel-header svelte-6whpsi"><span class="spotlights-title svelte-6whpsi">MOST USED SKILLS & SERVERS</span> <span class="spotlights-count svelte-6whpsi"> </span></div> <!></div>');function cs(F,o){nt(o,!0);const p=6;let x=K(!1);const b=new ae;Dt(async()=>{await Promise.allSettled([xe(),be(5)]),q(x,!0)});const j=_(()=>{const n=Se.catalog.slice(0,3).map(S=>({kind:"skill",item:S})),w=Ee.catalog.slice(0,3).map(S=>({kind:"mcp",item:S}));return[...n,...w].slice(0,p)});function L(n){return n.kind==="skill"?`sk:${n.item.name}`:`mcp:${n.item.id}`}function A(n){return n.item.name}function R(n){return n.item.description}function I(n){return n.kind==="skill"?"SKILL":"MCP"}function J(n){if(n.kind==="mcp")return Te(n.item.source,n.item.catalogId)??je(n.item.sourceUrl);const w=n.item.maintainer;return w?`https://github.com/${w.split("/")[0]}.png?size=40`:null}function V(n){ce.activeTab="skills"}var Q=vs(),Y=s(Q),W=r(s(Y),2),G=s(W);e(W),e(Y);var U=r(Y,2);{var tt=n=>{var w=rs();u(n,w)},i=n=>{var w=ns();u(n,w)},E=n=>{var w=os();gt(w,21,()=>t(j),S=>L(S),(S,k)=>{const $=_(()=>J(t(k))),Z=_(()=>L(t(k)));var v=ls(),g=s(v),N=s(g),a=s(N);{var l=O=>{var C=is();H(z=>{kt(C,"src",t($)),kt(C,"alt",z)},[()=>A(t(k))]),re("error",C,()=>{b.add(t(Z))}),ne(C),u(O,C)},c=_(()=>t($)&&!b.has(t(Z))),d=O=>{var C=Kt();H(z=>h(C,z),[()=>Me(A(t(k)))]),u(O,C)};rt(a,O=>{t(c)?O(l):O(d,-1)})}e(N);var D=r(N,2),P=s(D),B=s(P,!0);e(P);var m=r(P,2),f=s(m,!0);e(m),e(D),e(g);var M=r(g,2),T=s(M,!0);e(M),e(v),H((O,C,z,X)=>{at(N,`background: ${O??""};`),h(B,C),h(f,z),h(T,X)},[()=>t($)&&!b.has(t(Z))?"transparent":we(A(t(k))),()=>A(t(k)),()=>I(t(k)),()=>R(t(k))]),ft("click",v,()=>V(t(k))),u(S,v)}),e(w),u(n,w)};rt(U,n=>{!t(x)&&t(j).length===0?n(tt):t(j).length===0?n(i,1):n(E,-1)})}e(Q),H(()=>h(G,`${t(j).length??""} TOP PICKS`)),u(F,Q),it()}It(["click"]);var ds=y('<div class="flex flex-col flex-1 min-h-0 overflow-hidden"><div class="home-grid svelte-12c0jaj"><div class="area-banner svelte-12c0jaj"><!></div> <div class="area-spotlights svelte-12c0jaj"><!></div> <div class="area-insights svelte-12c0jaj"><!></div> <div class="area-sidebar svelte-12c0jaj"><!> <!></div></div></div>');function _s(F,o){nt(o,!0);let p=K(null),x=K(bt([])),b=K(null),j=K(bt([])),L=K(!1);Dt(async()=>{const i=await Promise.allSettled([de(),ue(),pe(),fe()]);i[0].status==="fulfilled"&&i[0].value&&q(p,i[0].value,!0),i[1].status==="fulfilled"&&q(x,i[1].value,!0),i[2].status==="fulfilled"&&q(b,i[2].value,!0),i[3].status==="fulfilled"&&q(j,i[3].value,!0),q(L,!0)});var A=ds(),R=s(A),I=s(R),J=s(I);{let i=_(()=>o.memoryStats?.total??0);Ne(J,{get identity(){return o.identity},get daemonStatus(){return o.daemonStatus},get connectorCount(){return t(j).length},get continuity(){return t(x)},get memoryCount(){return t(i)},get diagnostics(){return t(p)},get pipelineStatus(){return t(b)},get memoryStats(){return o.memoryStats}})}e(I);var V=r(I,2),Q=s(V);cs(Q,{}),e(V);var Y=r(V,2),W=s(Y);He(W,{get memories(){return o.memories}}),e(Y);var G=r(Y,2),U=s(G);as(U,{get memories(){return o.memories}});var tt=r(U,2);ze(tt,{get daemonStatus(){return o.daemonStatus}}),e(G),e(R),e(A),u(F,A),it()}export{_s as default};