signetai 0.81.0 → 0.81.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dashboard/_app/immutable/chunks/{CDC18Sc2.js → -sWPDSmv.js} +1 -1
  2. package/dashboard/_app/immutable/chunks/{B3PM8ItS.js → 7A1xO0ux.js} +1 -1
  3. package/dashboard/_app/immutable/chunks/{DUZ2CEGz.js → B3sdAcmD.js} +1 -1
  4. package/dashboard/_app/immutable/chunks/{Ig_vH2EK.js → B5vxueJi.js} +1 -1
  5. package/dashboard/_app/immutable/chunks/{C9B8HEYP.js → BCPUO_f-.js} +1 -1
  6. package/dashboard/_app/immutable/chunks/{Bg4Jlndt.js → BChWdWX9.js} +1 -1
  7. package/dashboard/_app/immutable/chunks/{CXvno_tV.js → BE0nM1MU.js} +1 -1
  8. package/dashboard/_app/immutable/chunks/{8DNtgShM.js → BNHWSX16.js} +1 -1
  9. package/dashboard/_app/immutable/chunks/{CWJ31zmN.js → BNZWh9Iw.js} +1 -1
  10. package/dashboard/_app/immutable/chunks/{BLpO61Xj.js → BR1XJtIW.js} +1 -1
  11. package/dashboard/_app/immutable/chunks/{CXzHVhOQ.js → BRMwX93A.js} +1 -1
  12. package/dashboard/_app/immutable/chunks/{BjM1isdn.js → Bm-bfgMo.js} +1 -1
  13. package/dashboard/_app/immutable/chunks/{B64UchR8.js → BuGIxLDP.js} +1 -1
  14. package/dashboard/_app/immutable/chunks/{DR3CQXgM.js → ByyI7LVy.js} +1 -1
  15. package/dashboard/_app/immutable/chunks/{CnVP6T7y.js → C52bUQ9G.js} +1 -1
  16. package/dashboard/_app/immutable/chunks/{DmrmAYuW.js → C6YtH_TI.js} +3 -3
  17. package/dashboard/_app/immutable/chunks/{DYVNF124.js → C7aGrzmF.js} +1 -1
  18. package/dashboard/_app/immutable/chunks/{xYwvTfq_.js → CD7E4pdO.js} +1 -1
  19. package/dashboard/_app/immutable/chunks/{DFI5QM1D.js → CDwPF0gy.js} +1 -1
  20. package/dashboard/_app/immutable/chunks/{DoIFcESC.js → CE0iZqyY.js} +1 -1
  21. package/dashboard/_app/immutable/chunks/{GX9HnnM2.js → CP5JVnpk.js} +1 -1
  22. package/dashboard/_app/immutable/chunks/{D3Pzx-ww.js → CPeVzch4.js} +1 -1
  23. package/dashboard/_app/immutable/chunks/{D0RFbF9F.js → CSwWJqsO.js} +1 -1
  24. package/dashboard/_app/immutable/chunks/{CXfOFHm9.js → CVYH--lc.js} +1 -1
  25. package/dashboard/_app/immutable/chunks/{Q3djS-HE.js → C_UMaUN9.js} +1 -1
  26. package/dashboard/_app/immutable/chunks/{Tsj2IPBi.js → CfJyVkXH.js} +1 -1
  27. package/dashboard/_app/immutable/chunks/{BBC64pWO.js → Cg7lRL0V.js} +2 -2
  28. package/dashboard/_app/immutable/chunks/{BfSAIPOy.js → Cj6-8LuI.js} +1 -1
  29. package/dashboard/_app/immutable/chunks/{DJjiW6yU.js → Cm4vmpUP.js} +1 -1
  30. package/dashboard/_app/immutable/chunks/D-rg-Yg6.js +1 -0
  31. package/dashboard/_app/immutable/chunks/{DQlXTgZ5.js → D2UeePtJ.js} +2 -2
  32. package/dashboard/_app/immutable/chunks/{CFeV4-ek.js → DDe1mZYW.js} +1 -1
  33. package/dashboard/_app/immutable/chunks/{DT3s_98l.js → DGUvVIpt.js} +1 -1
  34. package/dashboard/_app/immutable/chunks/{DYZGHRwS.js → DPObZWpJ.js} +1 -1
  35. package/dashboard/_app/immutable/chunks/{DihsOZsi.js → DZxL88ya.js} +1 -1
  36. package/dashboard/_app/immutable/chunks/{BSSq--4b.js → D_Y41OtB.js} +1 -1
  37. package/dashboard/_app/immutable/chunks/{D12mM4dG.js → DgjDzn23.js} +1 -1
  38. package/dashboard/_app/immutable/chunks/{CYgZv1qS.js → DkT26Zuv.js} +1 -1
  39. package/dashboard/_app/immutable/chunks/{BNgOQymd.js → DmRXi0YL.js} +1 -1
  40. package/dashboard/_app/immutable/chunks/{CUgn7HAq.js → Dnfm-s6P.js} +1 -1
  41. package/dashboard/_app/immutable/chunks/{DrtZdwTr.js → DruGghdk.js} +1 -1
  42. package/dashboard/_app/immutable/chunks/{Dtq6LGjS.js → GfJs_Esn.js} +1 -1
  43. package/dashboard/_app/immutable/chunks/{lavOq3Ax.js → H4Ex01n0.js} +1 -1
  44. package/dashboard/_app/immutable/chunks/{C3PYIVWw.js → gisnJ160.js} +1 -1
  45. package/dashboard/_app/immutable/chunks/{DZt8vU51.js → hgH5oLrf.js} +1 -1
  46. package/dashboard/_app/immutable/chunks/{B0Og3oaV.js → iPoN7GzS.js} +1 -1
  47. package/dashboard/_app/immutable/chunks/{WPSwscml.js → xx_3s7jU.js} +1 -1
  48. package/dashboard/_app/immutable/entry/{app.BDrIGfr0.js → app.jvTy1bgw.js} +2 -2
  49. package/dashboard/_app/immutable/entry/start.BoG2ufHr.js +1 -0
  50. package/dashboard/_app/immutable/nodes/{1.BR8FTyuI.js → 1.-Jbq814c.js} +1 -1
  51. package/dashboard/_app/immutable/nodes/2.wffnww3A.js +1 -0
  52. package/dashboard/_app/version.json +1 -1
  53. package/dashboard/index.html +6 -6
  54. package/package.json +1 -1
  55. package/dashboard/_app/immutable/chunks/C3L6kxkz.js +0 -1
  56. package/dashboard/_app/immutable/entry/start.D-NvZ_U8.js +0 -1
  57. package/dashboard/_app/immutable/nodes/2.Bjf8wGDU.js +0 -1
@@ -1 +1 @@
1
- import{p as i,e as c,E as d,i as l,a as p,n as f,k as m,F as u,b as h,d as _,r as v,l as b}from"./Ddm7yfuh.js";import{c as x}from"./DmrmAYuW.js";var g=b("<p><!></p>");function y(r,s){i(s,!0);let t=c(s,"ref",15,null),o=v(s,["$$slots","$$events","$$legacy","ref","class","children"]);var a=g();d(a,e=>({"data-slot":"card-description",class:e,...o}),[()=>x("text-muted-foreground text-sm",s.class)]);var n=l(a);p(n,()=>s.children??f),m(a),u(a,e=>t(e),()=>t()),h(r,a),_()}export{y as C};
1
+ import{p as i,e as c,E as d,i as l,a as p,n as f,k as m,F as u,b as h,d as _,r as v,l as b}from"./Ddm7yfuh.js";import{c as x}from"./C6YtH_TI.js";var g=b("<p><!></p>");function y(r,s){i(s,!0);let t=c(s,"ref",15,null),o=v(s,["$$slots","$$events","$$legacy","ref","class","children"]);var a=g();d(a,e=>({"data-slot":"card-description",class:e,...o}),[()=>x("text-muted-foreground text-sm",s.class)]);var n=l(a);p(n,()=>s.children??f),m(a),u(a,e=>t(e),()=>t()),h(r,a),_()}export{y as C};
@@ -1 +1 @@
1
- import{p as i,e as c,E as n,i as l,a as p,n as f,k as h,F as u,b as m,d as v,r as _,l as b}from"./Ddm7yfuh.js";import{c as g}from"./DmrmAYuW.js";var w=b("<div><!></div>");function k(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),u(r,s=>t(s),()=>t()),m(e,r),v()}export{k as C};
1
+ import{p as i,e as c,E as n,i as l,a as p,n as f,k as h,F as u,b as m,d as v,r as _,l as b}from"./Ddm7yfuh.js";import{c as g}from"./C6YtH_TI.js";var w=b("<div><!></div>");function k(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),u(r,s=>t(s),()=>t()),m(e,r),v()}export{k as C};
@@ -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"./Ddm7yfuh.js";import{I as $}from"./DmrmAYuW.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"./Ddm7yfuh.js";import{I as $}from"./C6YtH_TI.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{p as et,s as Ht,c as ue,f as h,a as Ft,n as Wt,b as a,d as tt,r as Ut,e as kt,i as l,k as s,t as r,j as A,h as e,y as k,B as Dt,D as yt,z as f,O as We,u as B,l as i,P as ft,A as Me,aa as Et,m as oe,o as qt,Q as $t,v,g as p,w as m,x as I,N as Vt,U as Gt,F as Qt,a0 as wt,K as Pt,q as Zt}from"./Ddm7yfuh.js";import{I as Jt,l as Xt,$ as It,a0 as Nt,a1 as Lt,a2 as Ot,B as ot,aG as Yt,a6 as ea,a3 as Mt,aH as zt,aI as ta,aJ as Ct,o as aa,aK as St,aL as sa,aM as xe,aN as ra,aO as jt,aP as Tt,aQ as na}from"./DmrmAYuW.js";import{S as la}from"./CYgZv1qS.js";import{I as bt}from"./WPSwscml.js";import{L as Ye}from"./DrtZdwTr.js";import{T as oa}from"./DZt8vU51.js";import{c as ct,S as ut,a as gt,b as Oe}from"./DT3s_98l.js";import{B as _t}from"./DoIFcESC.js";import{S as ia,a as da}from"./C3PYIVWw.js";import{C as va,a as ca}from"./GX9HnnM2.js";import{P as ua}from"./DR3CQXgM.js";import{T as ga}from"./CXzHVhOQ.js";import{P as _a}from"./lavOq3Ax.js";import{Z as fa}from"./8DNtgShM.js";function At(ke,t){et(t,!0);let N=Ut(t,["$$slots","$$events","$$legacy"]);const y=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"}]];Jt(ke,Ht({name:"play"},()=>N,{get iconNode(){return y},children:(H,D)=>{var T=ue(),L=h(T);Ft(L,()=>t.children??Wt),a(H,T)},$$slots:{default:!0}})),tt()}var xa=i("<span> </span>"),ma=i('<span class="task-status-running svelte-1lta2hw">running</span>'),pa=i("<span> </span>"),ha=i('<span class="task-status-failed svelte-1lta2hw"> </span>'),ba=i('<div tabindex="0" role="button"><div class="task-top svelte-1lta2hw"><span class="task-name svelte-1lta2hw"> </span> <span class="task-harness svelte-1lta2hw"> </span></div> <div class="task-meta svelte-1lta2hw"><span> </span> <!></div> <div class="task-actions svelte-1lta2hw"><div><!></div> <button class="trigger-btn svelte-1lta2hw"><!></button></div></div>');function Rt(ke,t){et(t,!0);let N=kt(t,"isSelected",3,!1);function y(n){if(!n)return"--";const o=new Date(n).getTime()-Date.now(),C=Math.abs(o);if(C<6e4)return o>0?"< 1m":"just now";if(C<36e5){const he=Math.round(C/6e4);return o>0?`${he}m`:`${he}m ago`}if(C<864e5){const he=Math.round(C/36e5);return o>0?`${he}h`:`${he}h ago`}const pe=Math.round(C/864e5);return o>0?`${pe}d`:`${pe}d ago`}let H=B(()=>t.task.harness==="claude-code"?"claude":t.task.harness==="codex"?"codex":"opencode"),D=B(()=>y(t.task.next_run_at)),T=B(()=>y(t.task.last_run_at));var L=ba();let R;var ae=l(L),E=l(ae),se=l(E,!0);s(E);var ie=r(E,2),ge=l(ie,!0);s(ie),s(ae);var O=r(ae,2),M=l(O),c=l(M,!0);s(M);var $=r(M,2);{var re=n=>{var o=xa(),C=l(o);s(o),k(()=>f(C,`next: ${e(D)??""}`)),a(n,o)},_e=n=>{var o=ma();a(n,o)},me=n=>{var o=pa(),C=l(o);s(o),k(()=>f(C,`exit 0 · ${e(T)??""}`)),a(n,o)},Z=n=>{var o=ha(),C=l(o);s(o),k(()=>f(C,`exit ${t.task.last_run_exit_code??"?"??""} · ${e(T)??""}`)),a(n,o)};A($,n=>{t.columnKey==="scheduled"?n(re):t.columnKey==="running"?n(_e,1):t.columnKey==="completed"?n(me,2):t.columnKey==="failed"&&n(Z,3)})}s(O);var b=r(O,2),w=l(b),J=l(w);{let n=B(()=>!!t.task.enabled);la(J,{get checked(){return e(n)},onCheckedChange:o=>t.ontoggle(o===!0),class:"scale-75 origin-left"})}s(w);var F=r(w,2),u=l(F);At(u,{class:"size-3"}),s(F),s(b),s(L),k(()=>{R=Dt(L,1,"task-card svelte-1lta2hw",null,R,{"task-card--selected":N(),"task-card--disabled":!t.task.enabled}),yt(L,"data-task-id",t.task.id),yt(L,"data-column",t.columnKey),f(se,t.task.name),f(ge,e(H)),f(c,t.task.cron_expression)}),We("click",L,function(...n){t.onclick?.apply(this,n)}),We("keydown",L,n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t.onclick())}),We("click",w,n=>n.stopPropagation()),We("click",F,n=>{n.stopPropagation(),t.ontrigger()}),a(ke,L),tt()}ft(["click","keydown"]);var ka=i('<div class="empty-state svelte-10pk3oi">LOADING</div>'),ya=i('<div class="empty-state svelte-10pk3oi"><span>NO SCHEDULED TASKS</span> <span class="empty-hint svelte-10pk3oi">PRESS N TO CREATE ONE</span></div>'),wa=i('<div class="column-empty svelte-10pk3oi">NO TASKS</div>'),Pa=i('<div class="column svelte-10pk3oi"><div class="column-header svelte-10pk3oi"><span class="column-pip svelte-10pk3oi"></span> <span class="column-label svelte-10pk3oi"> </span> <span class="column-count svelte-10pk3oi"> </span></div> <div class="column-body svelte-10pk3oi"><!> <!></div></div>'),Ca=i('<div class="disabled-section svelte-10pk3oi"><div class="column svelte-10pk3oi"><div class="column-header svelte-10pk3oi"><span class="column-pip svelte-10pk3oi" style="background: var(--sig-text-muted)"></span> <span class="column-label svelte-10pk3oi">Disabled</span> <span class="column-count svelte-10pk3oi"> </span></div> <div class="disabled-cards svelte-10pk3oi"></div></div></div>'),Sa=i('<div class="board-grid svelte-10pk3oi"></div> <!>',1);function ja(ke,t){et(t,!0);let N=kt(t,"selectedColumn",3,0),y=kt(t,"selectedTaskInColumn",3,0),H=B(()=>t.tasks.filter(c=>c.enabled&&c.last_run_status!=="running")),D=B(()=>t.tasks.filter(c=>c.last_run_status==="running")),T=B(()=>t.tasks.filter(c=>c.last_run_status==="completed"&&!e(D).some($=>$.id===c.id))),L=B(()=>t.tasks.filter(c=>c.last_run_status==="failed"&&!e(D).some($=>$.id===c.id))),R=B(()=>t.tasks.filter(c=>!c.enabled));const ae=[{key:"scheduled",label:"Scheduled",color:"var(--sig-highlight)"},{key:"running",label:"Running",color:"var(--sig-warning)"},{key:"completed",label:"Completed",color:"var(--sig-success)"},{key:"failed",label:"Failed",color:"var(--sig-danger)"}];function E(c){switch(c){case"scheduled":return e(H);case"running":return e(D);case"completed":return e(T);case"failed":return e(L);default:return[]}}var se=ue(),ie=h(se);{var ge=c=>{var $=ka();a(c,$)},O=c=>{var $=ya();a(c,$)},M=c=>{var $=Sa(),re=h($);Me(re,23,()=>ae,Z=>Z.key,(Z,b,w)=>{const J=B(()=>E(e(b).key));var F=Pa(),u=l(F),n=l(u),o=r(n,2),C=l(o,!0);s(o);var pe=r(o,2),he=l(pe,!0);s(pe),s(u);var Ie=r(u,2),Ne=l(Ie);Me(Ne,19,()=>e(J),fe=>fe.id,(fe,ye,K)=>{{let X=B(()=>e(w)===N()&&e(K)===y());Rt(fe,{get task(){return e(ye)},get columnKey(){return e(b).key},get isSelected(){return e(X)},onclick:()=>t.onopendetail(e(ye).id,e(w),e(K)),ontrigger:()=>t.ontrigger(e(ye).id),ontoggle:be=>t.ontoggle(e(ye).id,be)})}});var ze=r(Ne,2);{var Ae=fe=>{var ye=wa();a(fe,ye)};A(ze,fe=>{e(J).length===0&&fe(Ae)})}s(Ie),s(F),k(()=>{yt(F,"data-column-idx",e(w)),Et(n,`background: ${e(b).color??""}`),f(C,e(b).label),f(he,e(J).length)}),a(Z,F)}),s(re);var _e=r(re,2);{var me=Z=>{var b=Ca(),w=l(b),J=l(w),F=r(l(J),4),u=l(F,!0);s(F),s(J);var n=r(J,2);Me(n,21,()=>e(R),o=>o.id,(o,C)=>{Rt(o,{get task(){return e(C)},columnKey:"disabled",isSelected:!1,onclick:()=>t.onopendetail(e(C).id,-1,-1),ontrigger:()=>t.ontrigger(e(C).id),ontoggle:pe=>t.ontoggle(e(C).id,pe)})}),s(n),s(w),s(b),k(()=>f(u,e(R).length)),a(Z,b)};A(_e,Z=>{e(R).length>0&&Z(me)})}a(c,$)};A(ie,c=>{t.loading&&t.tasks.length===0?c(ge):t.tasks.length===0?c(O,1):c(M,-1)})}a(ke,se),tt()}const Ta=[{label:"PR Review",description:"Review open pull requests daily",name:"Review open PRs",prompt:"Review all open pull requests. Summarize changes, flag potential issues, and note any that need urgent attention.",harness:"claude-code",cronExpression:"0 9 * * *"},{label:"Test Suite",description:"Run tests and report failures",name:"Run test suite",prompt:"Run the full test suite. Report any failures with context about what broke and likely causes.",harness:"claude-code",cronExpression:"0 * * * *"},{label:"Memory Maintenance",description:"Clean up and deduplicate memories",name:"Memory maintenance",prompt:"Review recent memories for duplicates, outdated information, and low-quality entries. Suggest cleanup actions.",harness:"claude-code",cronExpression:"0 9 * * 0",skillName:"memory-debug",skillMode:"inject"},{label:"Code Review",description:"Review recent commits for issues",name:"Review recent commits",prompt:"Review commits from the last 24 hours. Look for bugs, style issues, missing tests, and security concerns.",harness:"claude-code",cronExpression:"0 17 * * *"},{label:"Docs Audit",description:"Check documentation is up to date",name:"Documentation audit",prompt:"Audit the project documentation. Check for outdated references, missing docs for new features, and broken links.",harness:"claude-code",cronExpression:"0 9 * * 1"}];var Ra=i("<!> <!>",1),Da=i(`<button class="flex flex-col gap-0.5 p-2 rounded text-left
1
+ import{p as et,s as Ht,c as ue,f as h,a as Ft,n as Wt,b as a,d as tt,r as Ut,e as kt,i as l,k as s,t as r,j as A,h as e,y as k,B as Dt,D as yt,z as f,O as We,u as B,l as i,P as ft,A as Me,aa as Et,m as oe,o as qt,Q as $t,v,g as p,w as m,x as I,N as Vt,U as Gt,F as Qt,a0 as wt,K as Pt,q as Zt}from"./Ddm7yfuh.js";import{I as Jt,l as Xt,$ as It,a0 as Nt,a1 as Lt,a2 as Ot,B as ot,aG as Yt,a6 as ea,a3 as Mt,aH as zt,aI as ta,aJ as Ct,o as aa,aK as St,aL as sa,aM as xe,aN as ra,aO as jt,aP as Tt,aQ as na}from"./C6YtH_TI.js";import{S as la}from"./DkT26Zuv.js";import{I as bt}from"./xx_3s7jU.js";import{L as Ye}from"./DruGghdk.js";import{T as oa}from"./hgH5oLrf.js";import{c as ct,S as ut,a as gt,b as Oe}from"./DGUvVIpt.js";import{B as _t}from"./CE0iZqyY.js";import{S as ia,a as da}from"./gisnJ160.js";import{C as va,a as ca}from"./CP5JVnpk.js";import{P as ua}from"./ByyI7LVy.js";import{T as ga}from"./BRMwX93A.js";import{P as _a}from"./H4Ex01n0.js";import{Z as fa}from"./BNHWSX16.js";function At(ke,t){et(t,!0);let N=Ut(t,["$$slots","$$events","$$legacy"]);const y=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"}]];Jt(ke,Ht({name:"play"},()=>N,{get iconNode(){return y},children:(H,D)=>{var T=ue(),L=h(T);Ft(L,()=>t.children??Wt),a(H,T)},$$slots:{default:!0}})),tt()}var xa=i("<span> </span>"),ma=i('<span class="task-status-running svelte-1lta2hw">running</span>'),pa=i("<span> </span>"),ha=i('<span class="task-status-failed svelte-1lta2hw"> </span>'),ba=i('<div tabindex="0" role="button"><div class="task-top svelte-1lta2hw"><span class="task-name svelte-1lta2hw"> </span> <span class="task-harness svelte-1lta2hw"> </span></div> <div class="task-meta svelte-1lta2hw"><span> </span> <!></div> <div class="task-actions svelte-1lta2hw"><div><!></div> <button class="trigger-btn svelte-1lta2hw"><!></button></div></div>');function Rt(ke,t){et(t,!0);let N=kt(t,"isSelected",3,!1);function y(n){if(!n)return"--";const o=new Date(n).getTime()-Date.now(),C=Math.abs(o);if(C<6e4)return o>0?"< 1m":"just now";if(C<36e5){const he=Math.round(C/6e4);return o>0?`${he}m`:`${he}m ago`}if(C<864e5){const he=Math.round(C/36e5);return o>0?`${he}h`:`${he}h ago`}const pe=Math.round(C/864e5);return o>0?`${pe}d`:`${pe}d ago`}let H=B(()=>t.task.harness==="claude-code"?"claude":t.task.harness==="codex"?"codex":"opencode"),D=B(()=>y(t.task.next_run_at)),T=B(()=>y(t.task.last_run_at));var L=ba();let R;var ae=l(L),E=l(ae),se=l(E,!0);s(E);var ie=r(E,2),ge=l(ie,!0);s(ie),s(ae);var O=r(ae,2),M=l(O),c=l(M,!0);s(M);var $=r(M,2);{var re=n=>{var o=xa(),C=l(o);s(o),k(()=>f(C,`next: ${e(D)??""}`)),a(n,o)},_e=n=>{var o=ma();a(n,o)},me=n=>{var o=pa(),C=l(o);s(o),k(()=>f(C,`exit 0 · ${e(T)??""}`)),a(n,o)},Z=n=>{var o=ha(),C=l(o);s(o),k(()=>f(C,`exit ${t.task.last_run_exit_code??"?"??""} · ${e(T)??""}`)),a(n,o)};A($,n=>{t.columnKey==="scheduled"?n(re):t.columnKey==="running"?n(_e,1):t.columnKey==="completed"?n(me,2):t.columnKey==="failed"&&n(Z,3)})}s(O);var b=r(O,2),w=l(b),J=l(w);{let n=B(()=>!!t.task.enabled);la(J,{get checked(){return e(n)},onCheckedChange:o=>t.ontoggle(o===!0),class:"scale-75 origin-left"})}s(w);var F=r(w,2),u=l(F);At(u,{class:"size-3"}),s(F),s(b),s(L),k(()=>{R=Dt(L,1,"task-card svelte-1lta2hw",null,R,{"task-card--selected":N(),"task-card--disabled":!t.task.enabled}),yt(L,"data-task-id",t.task.id),yt(L,"data-column",t.columnKey),f(se,t.task.name),f(ge,e(H)),f(c,t.task.cron_expression)}),We("click",L,function(...n){t.onclick?.apply(this,n)}),We("keydown",L,n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t.onclick())}),We("click",w,n=>n.stopPropagation()),We("click",F,n=>{n.stopPropagation(),t.ontrigger()}),a(ke,L),tt()}ft(["click","keydown"]);var ka=i('<div class="empty-state svelte-10pk3oi">LOADING</div>'),ya=i('<div class="empty-state svelte-10pk3oi"><span>NO SCHEDULED TASKS</span> <span class="empty-hint svelte-10pk3oi">PRESS N TO CREATE ONE</span></div>'),wa=i('<div class="column-empty svelte-10pk3oi">NO TASKS</div>'),Pa=i('<div class="column svelte-10pk3oi"><div class="column-header svelte-10pk3oi"><span class="column-pip svelte-10pk3oi"></span> <span class="column-label svelte-10pk3oi"> </span> <span class="column-count svelte-10pk3oi"> </span></div> <div class="column-body svelte-10pk3oi"><!> <!></div></div>'),Ca=i('<div class="disabled-section svelte-10pk3oi"><div class="column svelte-10pk3oi"><div class="column-header svelte-10pk3oi"><span class="column-pip svelte-10pk3oi" style="background: var(--sig-text-muted)"></span> <span class="column-label svelte-10pk3oi">Disabled</span> <span class="column-count svelte-10pk3oi"> </span></div> <div class="disabled-cards svelte-10pk3oi"></div></div></div>'),Sa=i('<div class="board-grid svelte-10pk3oi"></div> <!>',1);function ja(ke,t){et(t,!0);let N=kt(t,"selectedColumn",3,0),y=kt(t,"selectedTaskInColumn",3,0),H=B(()=>t.tasks.filter(c=>c.enabled&&c.last_run_status!=="running")),D=B(()=>t.tasks.filter(c=>c.last_run_status==="running")),T=B(()=>t.tasks.filter(c=>c.last_run_status==="completed"&&!e(D).some($=>$.id===c.id))),L=B(()=>t.tasks.filter(c=>c.last_run_status==="failed"&&!e(D).some($=>$.id===c.id))),R=B(()=>t.tasks.filter(c=>!c.enabled));const ae=[{key:"scheduled",label:"Scheduled",color:"var(--sig-highlight)"},{key:"running",label:"Running",color:"var(--sig-warning)"},{key:"completed",label:"Completed",color:"var(--sig-success)"},{key:"failed",label:"Failed",color:"var(--sig-danger)"}];function E(c){switch(c){case"scheduled":return e(H);case"running":return e(D);case"completed":return e(T);case"failed":return e(L);default:return[]}}var se=ue(),ie=h(se);{var ge=c=>{var $=ka();a(c,$)},O=c=>{var $=ya();a(c,$)},M=c=>{var $=Sa(),re=h($);Me(re,23,()=>ae,Z=>Z.key,(Z,b,w)=>{const J=B(()=>E(e(b).key));var F=Pa(),u=l(F),n=l(u),o=r(n,2),C=l(o,!0);s(o);var pe=r(o,2),he=l(pe,!0);s(pe),s(u);var Ie=r(u,2),Ne=l(Ie);Me(Ne,19,()=>e(J),fe=>fe.id,(fe,ye,K)=>{{let X=B(()=>e(w)===N()&&e(K)===y());Rt(fe,{get task(){return e(ye)},get columnKey(){return e(b).key},get isSelected(){return e(X)},onclick:()=>t.onopendetail(e(ye).id,e(w),e(K)),ontrigger:()=>t.ontrigger(e(ye).id),ontoggle:be=>t.ontoggle(e(ye).id,be)})}});var ze=r(Ne,2);{var Ae=fe=>{var ye=wa();a(fe,ye)};A(ze,fe=>{e(J).length===0&&fe(Ae)})}s(Ie),s(F),k(()=>{yt(F,"data-column-idx",e(w)),Et(n,`background: ${e(b).color??""}`),f(C,e(b).label),f(he,e(J).length)}),a(Z,F)}),s(re);var _e=r(re,2);{var me=Z=>{var b=Ca(),w=l(b),J=l(w),F=r(l(J),4),u=l(F,!0);s(F),s(J);var n=r(J,2);Me(n,21,()=>e(R),o=>o.id,(o,C)=>{Rt(o,{get task(){return e(C)},columnKey:"disabled",isSelected:!1,onclick:()=>t.onopendetail(e(C).id,-1,-1),ontrigger:()=>t.ontrigger(e(C).id),ontoggle:pe=>t.ontoggle(e(C).id,pe)})}),s(n),s(w),s(b),k(()=>f(u,e(R).length)),a(Z,b)};A(_e,Z=>{e(R).length>0&&Z(me)})}a(c,$)};A(ie,c=>{t.loading&&t.tasks.length===0?c(ge):t.tasks.length===0?c(O,1):c(M,-1)})}a(ke,se),tt()}const Ta=[{label:"PR Review",description:"Review open pull requests daily",name:"Review open PRs",prompt:"Review all open pull requests. Summarize changes, flag potential issues, and note any that need urgent attention.",harness:"claude-code",cronExpression:"0 9 * * *"},{label:"Test Suite",description:"Run tests and report failures",name:"Run test suite",prompt:"Run the full test suite. Report any failures with context about what broke and likely causes.",harness:"claude-code",cronExpression:"0 * * * *"},{label:"Memory Maintenance",description:"Clean up and deduplicate memories",name:"Memory maintenance",prompt:"Review recent memories for duplicates, outdated information, and low-quality entries. Suggest cleanup actions.",harness:"claude-code",cronExpression:"0 9 * * 0",skillName:"memory-debug",skillMode:"inject"},{label:"Code Review",description:"Review recent commits for issues",name:"Review recent commits",prompt:"Review commits from the last 24 hours. Look for bugs, style issues, missing tests, and security concerns.",harness:"claude-code",cronExpression:"0 17 * * *"},{label:"Docs Audit",description:"Check documentation is up to date",name:"Documentation audit",prompt:"Audit the project documentation. Check for outdated references, missing docs for new features, and broken links.",harness:"claude-code",cronExpression:"0 9 * * 1"}];var Ra=i("<!> <!>",1),Da=i(`<button class="flex flex-col gap-0.5 p-2 rounded text-left
2
2
  bg-[var(--sig-surface-raised)] border border-[var(--sig-border)]
3
3
  hover:border-[var(--sig-text-muted)] transition-colors cursor-pointer"><span class="text-[11px] text-[var(--sig-text-bright)]"> </span> <span class="text-[9px] text-[var(--sig-text-muted)] leading-[1.4]"> </span></button>`),Ea=i(`<div class="flex flex-col gap-2 px-4 pb-3"><div class="flex items-center justify-between"><span class="text-[10px] font-bold uppercase tracking-[0.1em]
4
4
  text-[var(--sig-text-muted)] font-[family-name:var(--font-display)]">Start from a template</span> <button class="text-[var(--sig-text-muted)] hover:text-[var(--sig-text)]
@@ -1 +1 @@
1
- import{p as P,e as l,c as p,f as g,g as c,a6 as x,s as i,b as u,d as $,r as v,a7 as j,a8 as k,h as _,u as b,a9 as q}from"./Ddm7yfuh.js";import{c as h}from"./DmrmAYuW.js";function D(r,e){P(e,!0);let t=l(e,"open",15,!1),o=v(e,["$$slots","$$events","$$legacy","open"]);var a=p(),s=g(a);c(s,()=>x,(n,f)=>{f(n,i(()=>o,{get open(){return t()},set open(d){t(d)}}))}),u(r,a),$()}function A(r,e){let t=v(e,["$$slots","$$events","$$legacy"]);var o=p(),a=g(o);c(a,()=>j,(s,n)=>{n(s,i(()=>t))}),u(r,o)}function E(r,e){P(e,!0);let t=l(e,"ref",15,null),o=l(e,"sideOffset",3,4),a=l(e,"align",3,"center"),s=v(e,["$$slots","$$events","$$legacy","ref","class","sideOffset","align","portalProps"]);A(r,i(()=>e.portalProps,{children:(n,f)=>{var d=p(),m=g(d);{let y=b(()=>h("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--bits-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e.class));c(m,()=>k,(O,z)=>{z(O,i({"data-slot":"popover-content",get sideOffset(){return o()},get align(){return a()},get class(){return _(y)}},()=>s,{get ref(){return t()},set ref(w){t(w)}}))})}u(n,d)},$$slots:{default:!0}})),$()}function F(r,e){P(e,!0);let t=l(e,"ref",15,null),o=v(e,["$$slots","$$events","$$legacy","ref","class"]);var a=p(),s=g(a);{let n=b(()=>h("",e.class));c(s,()=>q,(f,d)=>{d(f,i({"data-slot":"popover-trigger",get class(){return _(n)}},()=>o,{get ref(){return t()},set ref(m){t(m)}}))})}u(r,a),$()}export{F as P,E as a,D as b};
1
+ import{p as P,e as l,c as p,f as g,g as c,a6 as x,s as i,b as u,d as $,r as v,a7 as j,a8 as k,h as _,u as b,a9 as q}from"./Ddm7yfuh.js";import{c as h}from"./C6YtH_TI.js";function D(r,e){P(e,!0);let t=l(e,"open",15,!1),o=v(e,["$$slots","$$events","$$legacy","open"]);var a=p(),s=g(a);c(s,()=>x,(n,f)=>{f(n,i(()=>o,{get open(){return t()},set open(d){t(d)}}))}),u(r,a),$()}function A(r,e){let t=v(e,["$$slots","$$events","$$legacy"]);var o=p(),a=g(o);c(a,()=>j,(s,n)=>{n(s,i(()=>t))}),u(r,o)}function E(r,e){P(e,!0);let t=l(e,"ref",15,null),o=l(e,"sideOffset",3,4),a=l(e,"align",3,"center"),s=v(e,["$$slots","$$events","$$legacy","ref","class","sideOffset","align","portalProps"]);A(r,i(()=>e.portalProps,{children:(n,f)=>{var d=p(),m=g(d);{let y=b(()=>h("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--bits-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e.class));c(m,()=>k,(O,z)=>{z(O,i({"data-slot":"popover-content",get sideOffset(){return o()},get align(){return a()},get class(){return _(y)}},()=>s,{get ref(){return t()},set ref(w){t(w)}}))})}u(n,d)},$$slots:{default:!0}})),$()}function F(r,e){P(e,!0);let t=l(e,"ref",15,null),o=v(e,["$$slots","$$events","$$legacy","ref","class"]);var a=p(),s=g(a);{let n=b(()=>h("",e.class));c(s,()=>q,(f,d)=>{d(f,i({"data-slot":"popover-trigger",get class(){return _(n)}},()=>o,{get ref(){return t()},set ref(m){t(m)}}))})}u(r,a),$()}export{F as P,E as a,D as b};
@@ -1,4 +1,4 @@
1
- import{o as We,p as re,s as he,c as de,f as se,a as fe,n as ve,b as w,d as ie,r as we,i as c,j as J,t as _,k as s,y as ee,z as ae,D as ge,A as Te,h as t,l as N,v as m,m as Y,e 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"./Ddm7yfuh.js";import{o as me,I as ye,aG as bt,bc as xt,bd as _t,H as Et}from"./DmrmAYuW.js";import{W as at,L as Tt}from"./CFeV4-ek.js";import{R as st}from"./Q3djS-HE.js";import{P as qe}from"./lavOq3Ax.js";import{P as kt}from"./DUZ2CEGz.js";import{T as St}from"./CXzHVhOQ.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 Ct(){return k.entries.filter(n=>n.state==="tray")}function Nt(){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 It(){return k.entries.filter(n=>n.state==="dock")}const tt=12;function Qe(n,e,r){const a=r?.x??0,d=r?.y??0;function p(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)),y=Math.max(0,d);if(!p(o,y,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,d+P);if(!p(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 d=await fetch(`${me}/api/os/tray/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!d.ok)return!1;const p=await d.json();if(p.success&&p.entry){const o=k.entries.findIndex(y=>y.id===n);o>=0&&(k.entries[o]=p.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},d=k.entries.flatMap(o=>o.id!==n&&o.state==="grid"&&o.gridPosition?[o.gridPosition]:[]),p=Qe(d,a);return Ae(n,"grid",p)}async function Mt(n){return Ae(n,"dock")}async function lt(n){return Ae(n,"tray")}const ct="signet-os-sidebar-groups";function At(){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 Dt(n){const e={id:`group_${Date.now()}`,name:n,items:[]};return k.groups=[...k.groups,e],Fe(),e}function Lt(n){k.groups=k.groups.filter(e=>e.id!==n),k.activeGroup===n&&(k.activeGroup=null),Fe()}function Rt(n,e){k.groups=k.groups.map(r=>r.id===n?{...r,name:e}:r),Fe()}function Ht(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 Pt(n){return Pe.get(n)}function Ot(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 $t(n,e){Ke.set(n,e)}function Wt(n){Ke.delete(n)}function Re(n){return Ke.get(n)}const zt=We({current:null});function _e(n){zt.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:(d,p)=>{var o=de(),y=se(o);fe(y,()=>e.children??ve),w(d,o)},$$slots:{default:!0}})),ie()}var Vt=N('<img class="auto-card-icon svelte-1y09vim" referrerpolicy="no-referrer"/>'),Ft=N('<div class="auto-card-icon-placeholder svelte-1y09vim"><!></div>'),jt=N('<button class="auto-card-tool-btn sig-switch svelte-1y09vim" disabled=""><!> <span class="truncate"> </span></button>'),Bt=N('<div class="auto-card-tools svelte-1y09vim"></div>'),Ut=N('<div class="auto-card-empty svelte-1y09vim"><span class="sig-label">No tools exposed</span></div>'),Gt=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 qt(n,e){re(e,!0);var r=Gt(),a=c(r),d=c(a);{var p=O=>{var S=Vt();ee(()=>{ge(S,"src",e.icon),ge(S,"alt",e.name)}),w(O,S)},o=O=>{var S=Ft(),$=c(S);Ye($,{class:"size-4"}),s(S),w(O,S)};J(d,O=>{e.icon?O(p):O(o,-1)})}var y=_(d,2),G=c(y,!0);s(y);var R=_(y,2),P=c(R);s(R),s(a);var D=_(a,2);{var H=O=>{var S=Bt();Te(S,21,()=>e.autoCard.tools,$=>$.name,($,W)=>{var j=jt(),F=c(j);at(F,{class:"size-3 shrink-0 opacity-50"});var te=_(F,2),I=c(te,!0);s(te),s(j),ee(()=>{ge(j,"title",t(W).description||t(W).name),ae(I,t(W).name)}),w($,j)}),s(S),w(O,S)},A=O=>{var S=Ut();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 Xt='// 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})();',Yt=`
1
+ import{o as We,p as re,s as he,c as de,f as se,a as fe,n as ve,b as w,d as ie,r as we,i as c,j as J,t as _,k as s,y as ee,z as ae,D as ge,A as Te,h as t,l as N,v as m,m as Y,e 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"./Ddm7yfuh.js";import{o as me,I as ye,aG as bt,bc as xt,bd as _t,H as Et}from"./C6YtH_TI.js";import{W as at,L as Tt}from"./DDe1mZYW.js";import{R as st}from"./C_UMaUN9.js";import{P as qe}from"./H4Ex01n0.js";import{P as kt}from"./B3sdAcmD.js";import{T as St}from"./BRMwX93A.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 Ct(){return k.entries.filter(n=>n.state==="tray")}function Nt(){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 It(){return k.entries.filter(n=>n.state==="dock")}const tt=12;function Qe(n,e,r){const a=r?.x??0,d=r?.y??0;function p(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)),y=Math.max(0,d);if(!p(o,y,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,d+P);if(!p(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 d=await fetch(`${me}/api/os/tray/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!d.ok)return!1;const p=await d.json();if(p.success&&p.entry){const o=k.entries.findIndex(y=>y.id===n);o>=0&&(k.entries[o]=p.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},d=k.entries.flatMap(o=>o.id!==n&&o.state==="grid"&&o.gridPosition?[o.gridPosition]:[]),p=Qe(d,a);return Ae(n,"grid",p)}async function Mt(n){return Ae(n,"dock")}async function lt(n){return Ae(n,"tray")}const ct="signet-os-sidebar-groups";function At(){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 Dt(n){const e={id:`group_${Date.now()}`,name:n,items:[]};return k.groups=[...k.groups,e],Fe(),e}function Lt(n){k.groups=k.groups.filter(e=>e.id!==n),k.activeGroup===n&&(k.activeGroup=null),Fe()}function Rt(n,e){k.groups=k.groups.map(r=>r.id===n?{...r,name:e}:r),Fe()}function Ht(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 Pt(n){return Pe.get(n)}function Ot(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 $t(n,e){Ke.set(n,e)}function Wt(n){Ke.delete(n)}function Re(n){return Ke.get(n)}const zt=We({current:null});function _e(n){zt.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:(d,p)=>{var o=de(),y=se(o);fe(y,()=>e.children??ve),w(d,o)},$$slots:{default:!0}})),ie()}var Vt=N('<img class="auto-card-icon svelte-1y09vim" referrerpolicy="no-referrer"/>'),Ft=N('<div class="auto-card-icon-placeholder svelte-1y09vim"><!></div>'),jt=N('<button class="auto-card-tool-btn sig-switch svelte-1y09vim" disabled=""><!> <span class="truncate"> </span></button>'),Bt=N('<div class="auto-card-tools svelte-1y09vim"></div>'),Ut=N('<div class="auto-card-empty svelte-1y09vim"><span class="sig-label">No tools exposed</span></div>'),Gt=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 qt(n,e){re(e,!0);var r=Gt(),a=c(r),d=c(a);{var p=O=>{var S=Vt();ee(()=>{ge(S,"src",e.icon),ge(S,"alt",e.name)}),w(O,S)},o=O=>{var S=Ft(),$=c(S);Ye($,{class:"size-4"}),s(S),w(O,S)};J(d,O=>{e.icon?O(p):O(o,-1)})}var y=_(d,2),G=c(y,!0);s(y);var R=_(y,2),P=c(R);s(R),s(a);var D=_(a,2);{var H=O=>{var S=Bt();Te(S,21,()=>e.autoCard.tools,$=>$.name,($,W)=>{var j=jt(),F=c(j);at(F,{class:"size-3 shrink-0 opacity-50"});var te=_(F,2),I=c(te,!0);s(te),s(j),ee(()=>{ge(j,"title",t(W).description||t(W).name),ae(I,t(W).name)}),w($,j)}),s(S),w(O,S)},A=O=>{var S=Ut();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 Xt='// 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})();',Yt=`
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 +1 @@
1
- import{p,s as c,c as i,f as d,a as h,n as l,b as m,d as f,r as u}from"./Ddm7yfuh.js";import{I as $}from"./DmrmAYuW.js";function C(o,s){p(s,!0);let r=u(s,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"m9 18 6-6-6-6"}]];$(o,c({name:"chevron-right"},()=>r,{get iconNode(){return t},children:(a,g)=>{var e=i(),n=d(e);h(n,()=>s.children??l),m(a,e)},$$slots:{default:!0}})),f()}export{C};
1
+ import{p,s as c,c as i,f as d,a as h,n as l,b as m,d as f,r as u}from"./Ddm7yfuh.js";import{I as $}from"./C6YtH_TI.js";function C(o,s){p(s,!0);let r=u(s,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"m9 18 6-6-6-6"}]];$(o,c({name:"chevron-right"},()=>r,{get iconNode(){return t},children:(a,g)=>{var e=i(),n=d(e);h(n,()=>s.children??l),m(a,e)},$$slots:{default:!0}})),f()}export{C};
@@ -1 +1 @@
1
- import{p as n,s as l,c,f as d,a as i,n as m,b as f,d as h,r as u}from"./Ddm7yfuh.js";import{I as $}from"./DmrmAYuW.js";function z(e,a){n(a,!0);let o=u(a,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];$(e,l({name:"zap"},()=>o,{get iconNode(){return t},children:(r,_)=>{var s=c(),p=d(s);i(p,()=>a.children??m),f(r,s)},$$slots:{default:!0}})),h()}export{z as Z};
1
+ import{p as n,s as l,c,f as d,a as i,n as m,b as f,d as h,r as u}from"./Ddm7yfuh.js";import{I as $}from"./C6YtH_TI.js";function z(e,a){n(a,!0);let o=u(a,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];$(e,l({name:"zap"},()=>o,{get iconNode(){return t},children:(r,_)=>{var s=c(),p=d(s);i(p,()=>a.children??m),f(r,s)},$$slots:{default:!0}})),h()}export{z as Z};
@@ -1,4 +1,4 @@
1
- import{p as Wt,e as $t,m as L,o as ia,Q as Xt,v as s,c as dt,f as $,g as u,i as l,k as r,t,j as S,y as g,z as c,b as a,h as e,w as O,x as M,B as At,O as Qe,d as Yt,u as f,D as Gt,A as Ft,l as v,P as la,aL as Ka,aM as Ha,K as ua,aN as vr,s as Ea,r as Na,aO as dr,aP as cr,at as Ga,q as Da,ac as ga,ad as za,aa as Sa,N as pa,au as Pa,a0 as ur,$ as Za,aQ as fr,I as gr,ak as xa}from"./Ddm7yfuh.js";import{i as mr,m as R,e as Ca,a as Ia,r as Ra,h as pr,j as ka,g as Ma,d as _r,b as La,k as yr,c as hr,s as d,l as Xa,n as Ja,o as er,p as br,q as Ta,f as va,t as ma,u as xr,v as Wa,w as wr,x as kr,y as $r,z as Sr,A as Pr,B as Cr}from"./D12mM4dG.js";import{aW as ja,$ as Ba,B as vt,a3 as Fa,t as Bt,aX as tr,aY as Ir,af as Rr,aZ as Mr,c as qa,a_ as Lr,a$ as Tr,b0 as Ar,n as Er,ai as $a}from"./DmrmAYuW.js";import{b as _a,C as ya,a as ha}from"./DVXNr7Gr.js";import{I as Ht}from"./WPSwscml.js";import{c as ta,S as aa,a as ra,b as Oe}from"./DT3s_98l.js";import{T as Ua}from"./DZt8vU51.js";import{C as ba}from"./BjM1isdn.js";import{L as sa}from"./DrtZdwTr.js";import{g as Nr}from"./Cik1Y8bQ.js";import{B as fa}from"./DoIFcESC.js";var Dr=v('<span class="detail-badge detail-badge-official svelte-4mjdk4">official</span>'),zr=v('<span class="detail-rank svelte-4mjdk4"> </span>'),jr=v('<div class="detail-badges svelte-4mjdk4"><span class="detail-badge svelte-4mjdk4"> </span> <span class="detail-badge svelte-4mjdk4"> </span> <!> <!></div>'),Br=v('<div class="detail-action svelte-4mjdk4"><!></div>'),Fr=v('<a class="detail-link svelte-4mjdk4" target="_blank" rel="noopener">View source</a>'),qr=v("<span>Signet Reviews</span> <!>",1),Ur=v("<!> <!> <!> <!> <!>",1),Or=v("<!> <!>",1),Vr=v('<p class="review-muted svelte-4mjdk4">Loading reviews...</p>'),Kr=v('<p class="review-muted svelte-4mjdk4">No reviews yet for this app.</p>'),Hr=v('<article class="review-item svelte-4mjdk4"><div class="review-title svelte-4mjdk4"> </div> <div class="review-meta svelte-4mjdk4"> </div> <p class="review-body svelte-4mjdk4"> </p></article>'),Gr=v('<div class="review-list svelte-4mjdk4"></div>'),Wr=v('<div class="reviews-content svelte-4mjdk4"><div class="review-form svelte-4mjdk4"><!> <div class="review-row svelte-4mjdk4"><!> <!></div> <!> <div class="review-actions svelte-4mjdk4"><span class="review-gate svelte-4mjdk4">Install or use this app before leaving a review.</span> <!></div></div> <div class="reviews-filters svelte-4mjdk4"><button>Top comments</button> <button>Good</button> <button>Bad</button> <button>All</button></div> <!></div>'),Yr=v("<!> <!>",1),Qr=v('<p class="detail-description svelte-4mjdk4"> </p> <!> <!>',1),Zr=v('<p class="review-muted svelte-4mjdk4">Select a server to view details.</p>'),Xr=v('<div class="detail-header svelte-4mjdk4"><div class="detail-title-wrap svelte-4mjdk4"><h2 class="detail-title svelte-4mjdk4"> </h2> <!></div> <!></div> <div class="detail-body svelte-4mjdk4"><!></div>',1);function Jr(h,i){Wt(i,!0);const w="signet:marketplace:reviews:display-name",te=$t(i,"canInstall",3,!0),X=$t(i,"installBusy",3,!1),ae=$t(i,"removeBusy",3,!1);let V=L("top"),W=L(!1),le=L(ia([])),ze=L(!0),he=L(ia(Ae())),de=L(5),ke=L(""),$e=L(""),Y=L(!1);const oe=f(()=>`${e(de)}/5`),Ze=f(()=>{const T=[...e(le)];return e(V)==="top"?T.sort((j,Ee)=>Ee.rating===j.rating?Ee.updatedAt.localeCompare(j.updatedAt):Ee.rating-j.rating):e(V)==="good"?T.filter(j=>j.rating>=4).sort((j,Ee)=>Ee.updatedAt.localeCompare(j.updatedAt)):e(V)==="bad"?T.filter(j=>j.rating<=2).sort((j,Ee)=>Ee.updatedAt.localeCompare(j.updatedAt)):T.sort((j,Ee)=>Ee.updatedAt.localeCompare(j.updatedAt))});Xt(()=>{if(!i.open||!i.item?.targetId){s(le,[],!0);return}s(V,"top"),Re(i.item.targetId)});function Ae(){try{return localStorage.getItem(w)??""}catch{return""}}function ie(T){try{localStorage.setItem(w,T)}catch{}}function se(T){return T==="1"?1:T==="2"?2:T==="3"?3:T==="4"?4:5}async function Re(T){s(W,!0);try{const j=await ja({targetType:"mcp",targetId:T,limit:100});s(le,j.reviews,!0)}finally{s(W,!1)}}async function Ke(){if(!i.item?.targetId)return;if(!i.canReview){Bt("Install or use this app before leaving a review.","error");return}const T=e(he).trim(),j=e(ke).trim(),Ee=e($e).trim();if(!T||!j||!Ee){Bt("Display name, title, and review are required","error");return}s(Y,!0);try{const St=await tr({targetType:"mcp",targetId:i.item.targetId,displayName:T,rating:e(de),title:j,body:Ee});if(!St.success){Bt(St.error??"Failed to submit review","error");return}ie(T),s(ke,""),s($e,""),Bt("Review posted","success"),await Re(i.item.targetId)}finally{s(Y,!1)}}var it=dt(),Xe=$(it);u(Xe,()=>Fa,(T,j)=>{j(T,{get open(){return i.open},onOpenChange:Ee=>{Ee||i.onclose()},children:(Ee,St)=>{var Pt=dt(),Ct=$(Pt);u(Ct,()=>Ba,(E,ve)=>{ve(E,{side:"right",showClose:!1,class:`!w-[520px] !max-w-[90vw] !bg-[var(--sig-surface)]
1
+ import{p as Wt,e as $t,m as L,o as ia,Q as Xt,v as s,c as dt,f as $,g as u,i as l,k as r,t,j as S,y as g,z as c,b as a,h as e,w as O,x as M,B as At,O as Qe,d as Yt,u as f,D as Gt,A as Ft,l as v,P as la,aL as Ka,aM as Ha,K as ua,aN as vr,s as Ea,r as Na,aO as dr,aP as cr,at as Ga,q as Da,ac as ga,ad as za,aa as Sa,N as pa,au as Pa,a0 as ur,$ as Za,aQ as fr,I as gr,ak as xa}from"./Ddm7yfuh.js";import{i as mr,m as R,e as Ca,a as Ia,r as Ra,h as pr,j as ka,g as Ma,d as _r,b as La,k as yr,c as hr,s as d,l as Xa,n as Ja,o as er,p as br,q as Ta,f as va,t as ma,u as xr,v as Wa,w as wr,x as kr,y as $r,z as Sr,A as Pr,B as Cr}from"./DgjDzn23.js";import{aW as ja,$ as Ba,B as vt,a3 as Fa,t as Bt,aX as tr,aY as Ir,af as Rr,aZ as Mr,c as qa,a_ as Lr,a$ as Tr,b0 as Ar,n as Er,ai as $a}from"./C6YtH_TI.js";import{b as _a,C as ya,a as ha}from"./DVXNr7Gr.js";import{I as Ht}from"./xx_3s7jU.js";import{c as ta,S as aa,a as ra,b as Oe}from"./DGUvVIpt.js";import{T as Ua}from"./hgH5oLrf.js";import{C as ba}from"./Bm-bfgMo.js";import{L as sa}from"./DruGghdk.js";import{g as Nr}from"./Cik1Y8bQ.js";import{B as fa}from"./CE0iZqyY.js";var Dr=v('<span class="detail-badge detail-badge-official svelte-4mjdk4">official</span>'),zr=v('<span class="detail-rank svelte-4mjdk4"> </span>'),jr=v('<div class="detail-badges svelte-4mjdk4"><span class="detail-badge svelte-4mjdk4"> </span> <span class="detail-badge svelte-4mjdk4"> </span> <!> <!></div>'),Br=v('<div class="detail-action svelte-4mjdk4"><!></div>'),Fr=v('<a class="detail-link svelte-4mjdk4" target="_blank" rel="noopener">View source</a>'),qr=v("<span>Signet Reviews</span> <!>",1),Ur=v("<!> <!> <!> <!> <!>",1),Or=v("<!> <!>",1),Vr=v('<p class="review-muted svelte-4mjdk4">Loading reviews...</p>'),Kr=v('<p class="review-muted svelte-4mjdk4">No reviews yet for this app.</p>'),Hr=v('<article class="review-item svelte-4mjdk4"><div class="review-title svelte-4mjdk4"> </div> <div class="review-meta svelte-4mjdk4"> </div> <p class="review-body svelte-4mjdk4"> </p></article>'),Gr=v('<div class="review-list svelte-4mjdk4"></div>'),Wr=v('<div class="reviews-content svelte-4mjdk4"><div class="review-form svelte-4mjdk4"><!> <div class="review-row svelte-4mjdk4"><!> <!></div> <!> <div class="review-actions svelte-4mjdk4"><span class="review-gate svelte-4mjdk4">Install or use this app before leaving a review.</span> <!></div></div> <div class="reviews-filters svelte-4mjdk4"><button>Top comments</button> <button>Good</button> <button>Bad</button> <button>All</button></div> <!></div>'),Yr=v("<!> <!>",1),Qr=v('<p class="detail-description svelte-4mjdk4"> </p> <!> <!>',1),Zr=v('<p class="review-muted svelte-4mjdk4">Select a server to view details.</p>'),Xr=v('<div class="detail-header svelte-4mjdk4"><div class="detail-title-wrap svelte-4mjdk4"><h2 class="detail-title svelte-4mjdk4"> </h2> <!></div> <!></div> <div class="detail-body svelte-4mjdk4"><!></div>',1);function Jr(h,i){Wt(i,!0);const w="signet:marketplace:reviews:display-name",te=$t(i,"canInstall",3,!0),X=$t(i,"installBusy",3,!1),ae=$t(i,"removeBusy",3,!1);let V=L("top"),W=L(!1),le=L(ia([])),ze=L(!0),he=L(ia(Ae())),de=L(5),ke=L(""),$e=L(""),Y=L(!1);const oe=f(()=>`${e(de)}/5`),Ze=f(()=>{const T=[...e(le)];return e(V)==="top"?T.sort((j,Ee)=>Ee.rating===j.rating?Ee.updatedAt.localeCompare(j.updatedAt):Ee.rating-j.rating):e(V)==="good"?T.filter(j=>j.rating>=4).sort((j,Ee)=>Ee.updatedAt.localeCompare(j.updatedAt)):e(V)==="bad"?T.filter(j=>j.rating<=2).sort((j,Ee)=>Ee.updatedAt.localeCompare(j.updatedAt)):T.sort((j,Ee)=>Ee.updatedAt.localeCompare(j.updatedAt))});Xt(()=>{if(!i.open||!i.item?.targetId){s(le,[],!0);return}s(V,"top"),Re(i.item.targetId)});function Ae(){try{return localStorage.getItem(w)??""}catch{return""}}function ie(T){try{localStorage.setItem(w,T)}catch{}}function se(T){return T==="1"?1:T==="2"?2:T==="3"?3:T==="4"?4:5}async function Re(T){s(W,!0);try{const j=await ja({targetType:"mcp",targetId:T,limit:100});s(le,j.reviews,!0)}finally{s(W,!1)}}async function Ke(){if(!i.item?.targetId)return;if(!i.canReview){Bt("Install or use this app before leaving a review.","error");return}const T=e(he).trim(),j=e(ke).trim(),Ee=e($e).trim();if(!T||!j||!Ee){Bt("Display name, title, and review are required","error");return}s(Y,!0);try{const St=await tr({targetType:"mcp",targetId:i.item.targetId,displayName:T,rating:e(de),title:j,body:Ee});if(!St.success){Bt(St.error??"Failed to submit review","error");return}ie(T),s(ke,""),s($e,""),Bt("Review posted","success"),await Re(i.item.targetId)}finally{s(Y,!1)}}var it=dt(),Xe=$(it);u(Xe,()=>Fa,(T,j)=>{j(T,{get open(){return i.open},onOpenChange:Ee=>{Ee||i.onclose()},children:(Ee,St)=>{var Pt=dt(),Ct=$(Pt);u(Ct,()=>Ba,(E,ve)=>{ve(E,{side:"right",showClose:!1,class:`!w-[520px] !max-w-[90vw] !bg-[var(--sig-surface)]
2
2
  !border-l !border-l-[var(--sig-border)] !p-0 flex flex-col`,children:(I,ce)=>{var je=Xr(),It=$(je),Lt=l(It),Je=l(Lt),Se=l(Je,!0);r(Je);var _t=t(Je,2);{var Et=K=>{var me=jr(),ge=l(me),yt=l(ge,!0);r(ge);var rt=t(ge,2),tt=l(rt,!0);r(rt);var He=t(rt,2);{var Ve=P=>{var J=Dr();a(P,J)};S(He,P=>{i.item.official&&P(Ve)})}var lt=t(He,2);{var m=P=>{var J=zr(),Ye=l(J);r(J),g(()=>c(Ye,`#${i.item.popularityRank??""}`)),a(P,J)};S(lt,P=>{i.item.popularityRank!==null&&P(m)})}r(me),g(()=>{c(yt,i.item.sourceLabel),c(tt,i.item.category)}),a(K,me)};S(_t,K=>{i.item&&K(Et)})}r(Lt);var xt=t(Lt,2);{var ht=K=>{var me=Br(),ge=l(me);{var yt=He=>{vt(He,{variant:"outline",size:"sm",class:"rounded-lg font-[family-name:var(--font-mono)] text-[10px] uppercase tracking-[0.08em] border-[var(--sig-danger)] text-[var(--sig-danger)] hover:bg-[var(--sig-danger)] hover:text-[var(--sig-text-bright)]",onclick:()=>i.item.serverId&&i.onuninstall?.(i.item.serverId),get disabled(){return ae()},children:(Ve,lt)=>{O();var m=M();g(()=>c(m,ae()?"...":"Remove")),a(Ve,m)},$$slots:{default:!0}})},rt=He=>{vt(He,{variant:"outline",size:"sm",class:"rounded-lg font-[family-name:var(--font-mono)] text-[10px] uppercase tracking-[0.08em] border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] hover:bg-[var(--sig-text-bright)] hover:text-[var(--sig-bg)]",onclick:()=>i.item.catalogEntry&&i.oninstall?.(i.item.catalogEntry),get disabled(){return X()},children:(Ve,lt)=>{O();var m=M();g(()=>c(m,X()?"...":"Install")),a(Ve,m)},$$slots:{default:!0}})},tt=He=>{vt(He,{variant:"outline",size:"sm",class:"rounded-lg font-[family-name:var(--font-mono)] text-[10px] uppercase tracking-[0.08em] border-[var(--sig-border-strong)] text-[var(--sig-text-muted)]",disabled:!0,title:"MCP installs are temporarily disabled",children:(Ve,lt)=>{O();var m=M("Install disabled");a(Ve,m)},$$slots:{default:!0}})};S(ge,He=>{i.item.serverId?He(yt):i.item.catalogEntry&&te()?He(rt,1):i.item.catalogEntry&&He(tt,2)})}r(me),a(K,me)};S(xt,K=>{i.item&&K(ht)})}r(It);var et=t(It,2),Nt=l(et);{var k=K=>{var me=Qr(),ge=$(me),yt=l(ge,!0);r(ge);var rt=t(ge,2);{var tt=Ve=>{var lt=Fr();g(()=>Gt(lt,"href",i.item.sourceUrl)),a(Ve,lt)};S(rt,Ve=>{i.item.sourceUrl&&Ve(tt)})}var He=t(rt,2);u(He,()=>_a,(Ve,lt)=>{lt(Ve,{class:"reviews-section",get open(){return e(ze)},set open(m){s(ze,m,!0)},children:(m,P)=>{var J=Yr(),Ye=$(J);u(Ye,()=>ya,(C,N)=>{N(C,{class:"reviews-trigger",children:(_e,Me)=>{var F=qr(),q=t($(F),2);{let Ge=f(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(ze)?"rotate-180":""}`);ba(q,{get class(){return e(Ge)}})}a(_e,F)},$$slots:{default:!0}})});var o=t(Ye,2);u(o,()=>ha,(C,N)=>{N(C,{children:(_e,Me)=>{var F=Wr(),q=l(F),Ge=l(q);Ht(Ge,{class:"review-input",placeholder:"Display name",get value(){return e(he)},oninput:y=>{s(he,y.currentTarget.value,!0)}});var pe=t(Ge,2),ct=l(pe);{let y=f(()=>String(e(de)));u(ct,()=>ta,(re,ye)=>{ye(re,{type:"single",get value(){return e(y)},onValueChange:Pe=>{s(de,se(Pe??"5"),!0)},children:(Pe,Ne)=>{var ft=Or(),B=$(ft);u(B,()=>aa,(De,qe)=>{qe(De,{class:"review-rating",children:(Le,We)=>{O();var x=M();g(()=>c(x,e(oe))),a(Le,x)},$$slots:{default:!0}})});var G=t(B,2);u(G,()=>ra,(De,qe)=>{qe(De,{class:"review-rating-content",children:(Le,We)=>{var x=Ur(),Te=$(x);u(Te,()=>Oe,(ot,z)=>{z(ot,{value:"5",label:"5/5",class:"review-rating-item"})});var Ce=t(Te,2);u(Ce,()=>Oe,(ot,z)=>{z(ot,{value:"4",label:"4/5",class:"review-rating-item"})});var Tt=t(Ce,2);u(Tt,()=>Oe,(ot,z)=>{z(ot,{value:"3",label:"3/5",class:"review-rating-item"})});var qt=t(Tt,2);u(qt,()=>Oe,(ot,z)=>{z(ot,{value:"2",label:"2/5",class:"review-rating-item"})});var wt=t(qt,2);u(wt,()=>Oe,(ot,z)=>{z(ot,{value:"1",label:"1/5",class:"review-rating-item"})}),a(Le,x)},$$slots:{default:!0}})}),a(Pe,ft)},$$slots:{default:!0}})})}var ut=t(ct,2);Ht(ut,{class:"review-input",placeholder:"Review title",get value(){return e(ke)},oninput:y=>{s(ke,y.currentTarget.value,!0)}}),r(pe);var mt=t(pe,2);Ua(mt,{class:"review-textarea",rows:3,placeholder:"What worked? What should improve?",get value(){return e($e)},oninput:y=>{s($e,y.currentTarget.value,!0)}});var fe=t(mt,2),n=t(l(fe),2);{let y=f(()=>e(Y)||!i.canReview);vt(n,{variant:"outline",size:"sm",class:"review-submit",onclick:()=>{Ke()},get disabled(){return e(y)},children:(re,ye)=>{O();var Pe=M();g(()=>c(Pe,e(Y)?"Posting...":"Post review")),a(re,Pe)},$$slots:{default:!0}})}r(fe),r(q);var Z=t(q,2),U=l(Z);let _;var p=t(U,2);let b;var D=t(p,2);let A;var be=t(D,2);let Fe;r(Z);var st=t(Z,2);{var ne=y=>{var re=Vr();a(y,re)},xe=y=>{var re=Kr();a(y,re)},H=y=>{var re=Gr();Ft(re,21,()=>e(Ze),ye=>ye.id,(ye,Pe)=>{var Ne=Hr(),ft=l(Ne),B=l(ft,!0);r(ft);var G=t(ft,2),De=l(G);r(G);var qe=t(G,2),Le=l(qe,!0);r(qe),r(Ne),g(()=>{c(B,e(Pe).title),c(De,`${e(Pe).displayName??""} · ${e(Pe).rating??""}/5`),c(Le,e(Pe).body)}),a(ye,Ne)}),r(re),a(y,re)};S(st,y=>{e(W)?y(ne):e(Ze).length===0?y(xe,1):y(H,-1)})}r(F),g(()=>{_=At(U,1,"review-filter svelte-4mjdk4",null,_,{active:e(V)==="top"}),b=At(p,1,"review-filter svelte-4mjdk4",null,b,{active:e(V)==="good"}),A=At(D,1,"review-filter svelte-4mjdk4",null,A,{active:e(V)==="bad"}),Fe=At(be,1,"review-filter svelte-4mjdk4",null,Fe,{active:e(V)==="all"})}),Qe("click",U,()=>s(V,"top")),Qe("click",p,()=>s(V,"good")),Qe("click",D,()=>s(V,"bad")),Qe("click",be,()=>s(V,"all")),a(_e,F)},$$slots:{default:!0}})}),a(m,J)},$$slots:{default:!0}})}),g(()=>c(yt,i.item.description||"No description available.")),a(K,me)},Q=K=>{var me=Zr();a(K,me)};S(Nt,K=>{i.item?K(k):K(Q,-1)})}r(et),g(()=>c(Se,i.item?.name??"Tool Server")),a(I,je)},$$slots:{default:!0}})}),a(Ee,Pt)},$$slots:{default:!0}})}),a(h,it),Yt()}la(["click"]);var el=v('<p class="sheet-subtitle svelte-1n2gzyy"> </p>'),tl=v('<p class="muted svelte-1n2gzyy">Select a server to configure.</p>'),al=v('<p class="muted svelte-1n2gzyy">Loading recommended configuration...</p>'),rl=v('<a class="source-link svelte-1n2gzyy" target="_blank" rel="noopener">View source README</a>'),ll=v('<div class="inline-alert svelte-1n2gzyy"> </div>'),sl=v("<!> <!>",1),il=v("<!> <!>",1),nl=v("<option> </option>"),ol=v('<div class="row-item svelte-1n2gzyy"><!> <!> <select class="field-select row-secret"><option>Plain value</option><!></select> <!></div>'),vl=v('<div class="inline-hint svelte-1n2gzyy">No secrets found. Add secrets in the Secrets tab to map sensitive values.</div>'),dl=v('<div class="field-group svelte-1n2gzyy"><!> <!></div> <div class="field-group svelte-1n2gzyy"><!> <!></div> <div class="field-group svelte-1n2gzyy"><!> <!></div> <div class="field-group svelte-1n2gzyy"><div class="row-head svelte-1n2gzyy"><!> <!></div> <div class="row-list svelte-1n2gzyy"></div> <!></div>',1),cl=v("<option> </option>"),ul=v('<div class="row-item svelte-1n2gzyy"><!> <!> <select class="field-select row-secret"><option>Plain value</option><!></select> <!></div>'),fl=v('<div class="field-group svelte-1n2gzyy"><!> <!></div> <div class="field-group svelte-1n2gzyy"><div class="row-head svelte-1n2gzyy"><!> <!></div> <div class="row-list svelte-1n2gzyy"></div></div>',1),gl=v('<div class="inline-alert svelte-1n2gzyy"> </div>'),ml=v('<div class="test-tools svelte-1n2gzyy"> </div>'),pl=v('<p class="server-description svelte-1n2gzyy"> </p> <!> <!> <div class="config-card svelte-1n2gzyy"><div class="field-group svelte-1n2gzyy"><!> <!></div> <div class="field-row two-col svelte-1n2gzyy"><div class="field-group svelte-1n2gzyy"><!> <!></div> <div class="field-group svelte-1n2gzyy"><!> <!></div></div> <!></div> <!> <div class="test-panel svelte-1n2gzyy"><div class="test-head svelte-1n2gzyy">Connection test</div> <p class="test-message svelte-1n2gzyy"> </p> <!></div>',1),_l=v('<div class="sheet-header svelte-1n2gzyy"><div><h2 class="sheet-title svelte-1n2gzyy">Install Tool Server</h2> <!></div></div> <div class="sheet-body svelte-1n2gzyy"><!></div> <div class="sheet-footer svelte-1n2gzyy"><div class="footer-hint svelte-1n2gzyy"><!></div> <div class="footer-actions svelte-1n2gzyy"><!> <!></div></div>',1);function yl(h,i){Wt(i,!0);const w="secret://";let te=L(!1),X=L(null),ae=L(""),V=L(""),W=L(""),le=L(!1),ze=L(""),he=L("stdio"),de=L("20000"),ke=L(""),$e=L(""),Y=L(""),oe=L(ia([])),Ze=L(""),Ae=L(ia([])),ie=L(ia([])),se=L(!1),Re=L("idle"),Ke=L(""),it=L(ia([])),Xe=L(!1),T=L(null);const j=f(()=>e(he)==="http"?"http":"stdio"),Ee=f(()=>i.entry?i.entry.source==="modelcontextprotocol/servers"?"MCP GitHub":"MCP Registry":"");Xt(()=>{!i.open||!i.entry||e(ae)!==i.entry.id&&(s(ae,i.entry.id,!0),I(i.entry))}),Xt(()=>{i.open||(s(ae,""),s(te,!1),s(X,null),s(Re,"idle"),s(Ke,""),s(it,[],!0),s(T,null))});function St(k){return k.startsWith(w)?k.slice(w.length).trim():""}function Pt(k,Q){const K=St(Q);return K?{key:k,value:"",secretName:K}:{key:k,value:Q,secretName:""}}function Ct(k){return k.secretName.trim().length>0?`${w}${k.secretName.trim()}`:k.value}function E(k){const Q=Object.entries(k).map(([K,me])=>Pt(K,me));return Q.length>0?Q:[{key:"",value:"",secretName:""}]}function ve(k){if(s(he,k.transport,!0),s(de,String(k.timeoutMs),!0),k.transport==="stdio"){s(ke,k.command,!0),s($e,k.args.join(`
3
3
  `),!0),s(Y,k.cwd??"",!0),s(oe,E(k.env),!0),s(Ze,""),s(Ae,[{key:"",value:"",secretName:""}],!0);return}s(Ze,k.url,!0),s(Ae,E(k.headers),!0),s(ke,""),s($e,""),s(Y,""),s(oe,[{key:"",value:"",secretName:""}],!0)}async function I(k){s(te,!0),s(X,null),s(T,null),s(Re,"idle"),s(Ke,""),s(it,[],!0),s(ze,k.name,!0),s(V,k.description,!0),s(W,""),s(le,!1),s(he,"stdio"),s(de,"20000"),s(ke,""),s($e,""),s(Y,""),s(oe,[{key:"",value:"",secretName:""}],!0),s(Ze,""),s(Ae,[{key:"",value:"",secretName:""}],!0),s(se,!0);const[Q,K]=await Promise.all([Ir(k.catalogId,k.source),Rr()]);if(s(ie,K,!0),s(se,!1),!Q){s(X,"Failed to load recommended config for this server."),s(te,!1);return}s(V,Q.description||k.description,!0),s(W,Q.githubUrl??"",!0),Q.defaultConfig?(s(le,!0),ve(Q.defaultConfig)):s(X,"No standard config was found. You can still set one manually below."),s(te,!1)}function ce(k){const Q={};for(const K of k){const me=K.key.trim();if(me.length===0)continue;const ge=Ct(K).trim();ge.length!==0&&(Q[me]=ge)}return Q}function je(){const k=Number(e(de));if(!Number.isFinite(k)||k<=0)return{config:null,error:"Timeout must be a positive number."};if(e(he)==="stdio"){const K=e(ke).trim();if(K.length===0)return{config:null,error:"Command is required for stdio transport."};const me=e($e).split(`
4
4
  `).map(ge=>ge.trim()).filter(ge=>ge.length>0);return{config:{transport:"stdio",command:K,args:me,env:ce(e(oe)),cwd:e(Y).trim()||void 0,timeoutMs:k}}}const Q=e(Ze).trim();if(Q.length===0)return{config:null,error:"URL is required for HTTP transport."};try{new URL(Q)}catch{return{config:null,error:"URL must be a valid absolute URL."}}return{config:{transport:"http",url:Q,headers:ce(e(Ae)),timeoutMs:k}}}function It(k){return k==="http"?"http":"stdio"}function Lt(k,Q,K){const me=k[Q];me&&(me.value=K,K.trim().length>0&&(me.secretName=""))}function Je(){s(oe,[...e(oe),{key:"",value:"",secretName:""}],!0)}function Se(k){s(oe,e(oe).filter((Q,K)=>K!==k),!0),e(oe).length===0&&s(oe,[{key:"",value:"",secretName:""}],!0)}function _t(){s(Ae,[...e(Ae),{key:"",value:"",secretName:""}],!0)}function Et(k){s(Ae,e(Ae).filter((Q,K)=>K!==k),!0),e(Ae).length===0&&s(Ae,[{key:"",value:"",secretName:""}],!0)}async function xt(){s(T,null),s(Re,"running"),s(Ke,"Testing MCP server connection..."),s(it,[],!0);const k=je();if(!k.config){s(Re,"error"),s(Ke,k.error??"Invalid config.",!0),s(T,k.error??"Invalid config.",!0);return}const Q=await Mr({config:k.config});if(Q.success){s(Re,"success"),s(it,Q.tools??[],!0),s(Ke,`Connection succeeded${typeof Q.toolCount=="number"?` (${Q.toolCount} tools)`:""}.`);return}s(Re,"error"),s(Ke,Q.error??"Connection test failed.",!0)}async function ht(){if(!i.entry)return;s(T,null);const k=je();if(!k.config){s(T,k.error??"Invalid config.",!0);return}s(Xe,!0);const Q=await mr(i.entry,{alias:e(ze).trim()||void 0,config:k.config});s(Xe,!1),Q&&i.onclose()}var et=dt(),Nt=$(et);u(Nt,()=>Fa,(k,Q)=>{Q(k,{get open(){return i.open},onOpenChange:K=>{K||i.onclose()},children:(K,me)=>{var ge=dt(),yt=$(ge);u(yt,()=>Ba,(rt,tt)=>{tt(rt,{side:"right",class:`!w-[560px] !max-w-[96vw] !bg-[var(--sig-surface)]