progon-agent 1.5.2 → 1.5.3

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/dist/supervisor/cli.js +75 -75
  2. package/extension-bundle.json +3 -3
  3. package/extension-dist/background/background.js +101 -95
  4. package/extension-dist/card/card.html +10 -9
  5. package/extension-dist/card/card.js +3 -3
  6. package/extension-dist/chunks/shared-B3glEBMw.js +1 -0
  7. package/extension-dist/chunks/shared-B9oC2P3-.js +8 -0
  8. package/extension-dist/chunks/shared-BByPq6Kh.js +1 -0
  9. package/extension-dist/chunks/shared-BMIAtDPv.js +45 -0
  10. package/extension-dist/chunks/shared-BTOXSk0k.js +118 -0
  11. package/extension-dist/chunks/{shared-VvEftNwZ.js → shared-C-Q9DKcM.js} +1 -1
  12. package/extension-dist/chunks/shared-C4rk8dhz.js +1 -0
  13. package/extension-dist/chunks/shared-CHDbyhV4.js +1 -0
  14. package/extension-dist/chunks/shared-CmGCWsjS.js +15 -0
  15. package/extension-dist/chunks/shared-D7P2v9Mb.js +372 -0
  16. package/extension-dist/chunks/shared-DKBOqKL2.css +1 -0
  17. package/extension-dist/chunks/shared-Dnq0mR_F.css +1 -0
  18. package/extension-dist/chunks/shared-Dor6Qf-t.js +1 -0
  19. package/extension-dist/chunks/shared-DwL_iWMx.js +1 -0
  20. package/extension-dist/chunks/shared-GBy7ssZb.js +1 -0
  21. package/extension-dist/chunks/shared-gmwevruS.js +159 -0
  22. package/extension-dist/chunks/shared-iMtAwxmT.js +351 -0
  23. package/extension-dist/chunks/shared-mCuRTIv8.js +129 -0
  24. package/extension-dist/chunks/shared-rQyAr3p-.js +1 -0
  25. package/extension-dist/chunks/shared-yvJVPBBs.css +1 -0
  26. package/extension-dist/content/content.js +205 -205
  27. package/extension-dist/content/frame.js +80 -80
  28. package/extension-dist/manifest.json +32 -29
  29. package/extension-dist/offscreen/offscreen.html +3 -2
  30. package/extension-dist/offscreen/offscreen.js +1 -1
  31. package/extension-dist/popup/popup.css +1 -1
  32. package/extension-dist/popup/popup.html +9 -8
  33. package/extension-dist/popup/popup.js +9 -3
  34. package/extension-dist/sidepanel/sidepanel.css +1 -1
  35. package/extension-dist/sidepanel/sidepanel.html +12 -11
  36. package/extension-dist/sidepanel/sidepanel.js +1 -1
  37. package/extension-dist/workspace/workspace.html +13 -11
  38. package/extension-dist/workspace/workspace.js +48 -54
  39. package/npm-shrinkwrap.json +2 -2
  40. package/package.json +2 -2
  41. package/extension-dist/chunks/shared--PKAvBPy.js +0 -1
  42. package/extension-dist/chunks/shared-0jT00uC5.js +0 -317
  43. package/extension-dist/chunks/shared-8TdX8bnw.js +0 -1
  44. package/extension-dist/chunks/shared-BBwL-FWr.js +0 -8
  45. package/extension-dist/chunks/shared-BECVQaqd.js +0 -1
  46. package/extension-dist/chunks/shared-BYkDbcM2.js +0 -372
  47. package/extension-dist/chunks/shared-BdaUsVif.css +0 -1
  48. package/extension-dist/chunks/shared-CDlAJRnF.js +0 -117
  49. package/extension-dist/chunks/shared-CQ5Ygj2p.js +0 -1
  50. package/extension-dist/chunks/shared-CnMBv8Ku.js +0 -1
  51. package/extension-dist/chunks/shared-CyNKhHOY.js +0 -1
  52. package/extension-dist/chunks/shared-D3X5MuUz.js +0 -1
  53. package/extension-dist/chunks/shared-D7GfVHk0.js +0 -129
  54. package/extension-dist/chunks/shared-U9lBnzuH.js +0 -33
  55. package/extension-dist/chunks/shared-fJPHxpB5.css +0 -1
  56. package/extension-dist/chunks/shared-o0-3vI--.js +0 -193
  57. package/extension-dist/chunks/shared-uKTblxo0.js +0 -15
@@ -0,0 +1,159 @@
1
+ import{r as e}from"./shared-XKyaHtl9.js";import{$t as t,A as n,Ao as r,As as i,Bo as a,Br as o,Bt as s,C as c,Cc as l,Cn as u,Cu as d,Dd as f,Do as p,Dr as m,E as h,Ed as g,Eo as _,Er as v,Eu as y,F as b,Fo as x,Fr as S,Fs as C,Gc as w,Gt as T,Hd as E,Ht as D,Il as O,In as k,Io as A,Ir as j,Is as M,It as N,Jd as P,Jo as F,Ko as ee,Kt as I,Ll as te,Lo as ne,Ls as re,Lt as ie,M as ae,Mo as oe,Nr as se,Ns as ce,Oi as le,On as ue,P as de,Pr as fe,Pt as pe,Qt as me,Ra as he,Rn as ge,Ro as _e,Rr as ve,Rt as ye,Sn as be,So as xe,T as Se,Tc as Ce,Td as we,Tn as Te,To as Ee,Tu as De,Ua as Oe,Un as ke,Ut as Ae,Vn as je,Vo as Me,Wd as Ne,Wr as Pe,Wt as Fe,Xn as Ie,Xo as L,Xt as Le,Yn as Re,Yt as ze,Zo as Be,Zr as Ve,_ as R,_n as He,_r as Ue,_t as We,_u as Ge,aa as Ke,an as qe,ao as Je,bn as Ye,cn as Xe,ct as Ze,dn as Qe,ds as $e,dt as et,en as tt,fn as nt,fo as rt,fr as it,ft as at,fu as ot,gn as st,gr as ct,gt as lt,hi as z,hn as ut,hr as dt,ht as ft,hu as pt,id as B,in as mt,io as ht,j as gt,jo as _t,jr as vt,jt as yt,k as bt,la as xt,lc as St,ln as Ct,lo as wt,ls as Tt,mn as Et,mu as Dt,nn as Ot,no as kt,nr as At,on as jt,ot as Mt,pa as V,pn as Nt,po as Pt,pt as Ft,qc as It,qn as Lt,qo as Rt,rn as zt,sn as Bt,so as Vt,st as Ht,tn as Ut,to as Wt,un as Gt,us as H,ut as Kt,uu as qt,v as Jt,vn as Yt,vs as Xt,vt as Zt,wo as U,ws as Qt,xi as $t,xn as en,xr as tn,yd as nn,yn as rn,yo as an,za as on,zd as sn,zl as cn,zn as ln,zr as un}from"./shared-iMtAwxmT.js";import{At as W,Bt as dn,Et as fn,Lt as pn,Pt as G,St as mn,bt as hn,c as gn,ft as _n,g as vn,gt as K,h as yn,it as bn,kt as q,m as xn,p as Sn,vt as Cn}from"./shared-BTOXSk0k.js";var wn=`://`,Tn=`https://`,En=/[:/?#@\s]/,Dn=/^[\x00-\x7f]*$/,On=`.invalid`;function kn(e){let t=e.trim();if(t===``)return{ok:!1,reason:`empty`};if(t.includes(`*`))return{ok:!1,reason:`host_invalid`};let n=jn(t);return n===null?{ok:!1,reason:`not_parsable`}:Mn(n)}function An(e){let t=e.trim(),n=(t.endsWith(`.`)?t.slice(0,-1):t).toLowerCase();if(n===``)return{ok:!1,reason:`empty`};if(En.test(n))return{ok:!1,reason:`pattern_invalid`};let r=n.split(`.`);if(r.some(e=>e===``))return{ok:!1,reason:`pattern_invalid`};let i=[];for(let e of r){let t=Nn(e)?e:Pn(e);if(t===null)return{ok:!1,reason:`pattern_invalid`};i.push(t)}return In(i)?{ok:!1,reason:`pattern_too_broad`}:{ok:!0,hostPattern:i.join(`.`)}}function jn(e){try{return new URL(e.includes(wn)?e:`${Tn}${e}`)}catch{return null}}function Mn(e){if(!te(e.protocol))return{ok:!1,reason:`scheme_not_navigable`};if(e.username!==``||e.password!==``)return{ok:!1,reason:`carries_credentials`};if(e.pathname!==`/`||e.search!==``||e.hash!==``)return{ok:!1,reason:`not_bare_origin`};let t=cn(e.hostname),n=O(t)&&t.includes(`:`)?`[${t}]`:t,r=e.port===``?``:`:${e.port}`;return{ok:!0,baseUrl:`${e.protocol}//${n}${r}`}}function Nn(e){return e.includes(`*`)}function Pn(e){return Dn.test(e)?e:Fn(e)}function Fn(e){let t;try{t=new URL(`http://${e}${On}`).hostname}catch{return null}return t.slice(0,-8)}function In(e){return e.slice(-2).some(Nn)}function Ln(e){return e.mine?e.lifecycle===`active`?e.online?null:`offline`:`notEnrolled`:`notOwner`}function Rn(e){return e.activeRun!==null||e.activeJob!=null}async function zn(e,t,{pageSize:n,route:r}){let i=[],a=0,o=null;for(;o===null||a<o;){t.throwIfAborted();let s=await e({limit:n,offset:a},t);if(s.offset!==a||s.total<0||!Number.isInteger(s.total))throw Error(`${r} returned invalid pagination metadata`);if(s.items.length===0&&a<s.total)throw Error(`${r} returned an empty page before total was satisfied`);i.push(...s.items),a+=s.items.length,o=s.total}return i}async function Bn(e,t){return zn(e,t,{pageSize:100,route:`GET /agents`})}
2
+ /**
3
+ * @license lucide-react v0.574.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ var Vn=L(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Hn=L(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),Un=L(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Wn=L(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Gn=L(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Kn=L(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),qn=L(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),Jn=L(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Yn=L(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Xn=L(`frame`,[[`line`,{x1:`22`,x2:`2`,y1:`6`,y2:`6`,key:`15w7dq`}],[`line`,{x1:`22`,x2:`2`,y1:`18`,y2:`18`,key:`1ip48p`}],[`line`,{x1:`6`,x2:`6`,y1:`2`,y2:`22`,key:`a2lnyx`}],[`line`,{x1:`18`,x2:`18`,y1:`2`,y2:`22`,key:`8vb6jd`}]]),Zn=L(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Qn=L(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),$n=L(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),er=L(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),tr=L(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),nr=L(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),rr=L(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ir=L(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),ar=L(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),or=L(`play`,[[`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`,key:`10ikf1`}]]),sr=L(`repeat`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]),cr=L(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),lr=L(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),ur=L(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),dr=L(`variable`,[[`path`,{d:`M8 21s-4-3-4-9 4-9 4-9`,key:`uto9ud`}],[`path`,{d:`M16 3s4 3 4 9-4 9-4 9`,key:`4w2vsq`}],[`line`,{x1:`15`,x2:`9`,y1:`9`,y2:`15`,key:`f7djnv`}],[`line`,{x1:`9`,x2:`15`,y1:`9`,y2:`15`,key:`1shsy8`}]]),fr=L(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),pr=/* @__PURE__ */ new Map([[`button`,`button`],[`link`,`link`],[`textbox`,`field`],[`searchbox`,`field`],[`spinbutton`,`field`],[`checkbox`,`checkbox`],[`switch`,`checkbox`],[`menuitemcheckbox`,`checkbox`],[`combobox`,`select`],[`listbox`,`select`],[`heading`,`text`],[`paragraph`,`text`]]),mr=/* @__PURE__ */ new Map([[`button`,`button`],[`textarea`,`field`],[`select`,`select`],[`h1`,`text`],[`h2`,`text`],[`h3`,`text`],[`h4`,`text`],[`h5`,`text`],[`h6`,`text`],[`p`,`text`],[`label`,`text`]]),hr={button:`action`,link:`action`,field:`input`,checkbox:`input`,select:`input`,text:`static`,other:`static`}
9
+ /**
10
+ * @license lucide-react v0.574.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ /**
16
+ * @license lucide-react v0.574.0 - ISC
17
+ *
18
+ * This source code is licensed under the ISC license.
19
+ * See the LICENSE file in the root directory of this source tree.
20
+ */
21
+ /**
22
+ * @license lucide-react v0.574.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */
27
+ /**
28
+ * @license lucide-react v0.574.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */
33
+ /**
34
+ * @license lucide-react v0.574.0 - ISC
35
+ *
36
+ * This source code is licensed under the ISC license.
37
+ * See the LICENSE file in the root directory of this source tree.
38
+ */
39
+ /**
40
+ * @license lucide-react v0.574.0 - ISC
41
+ *
42
+ * This source code is licensed under the ISC license.
43
+ * See the LICENSE file in the root directory of this source tree.
44
+ */
45
+ /**
46
+ * @license lucide-react v0.574.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */
51
+ /**
52
+ * @license lucide-react v0.574.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */
57
+ /**
58
+ * @license lucide-react v0.574.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */
63
+ /**
64
+ * @license lucide-react v0.574.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */
69
+ /**
70
+ * @license lucide-react v0.574.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */
75
+ /**
76
+ * @license lucide-react v0.574.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */
81
+ /**
82
+ * @license lucide-react v0.574.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */
87
+ /**
88
+ * @license lucide-react v0.574.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */
93
+ /**
94
+ * @license lucide-react v0.574.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */
99
+ /**
100
+ * @license lucide-react v0.574.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */
105
+ /**
106
+ * @license lucide-react v0.574.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */
111
+ /**
112
+ * @license lucide-react v0.574.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */
117
+ /**
118
+ * @license lucide-react v0.574.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */
123
+ /**
124
+ * @license lucide-react v0.574.0 - ISC
125
+ *
126
+ * This source code is licensed under the ISC license.
127
+ * See the LICENSE file in the root directory of this source tree.
128
+ */
129
+ /**
130
+ * @license lucide-react v0.574.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */
135
+ /**
136
+ * @license lucide-react v0.574.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */
141
+ /**
142
+ * @license lucide-react v0.574.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */
147
+ /**
148
+ * @license lucide-react v0.574.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */
153
+ /**
154
+ * @license lucide-react v0.574.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */
159
+ ;function gr(e){if(e===null)return`other`;let t=br(e.role);if(t!==null)return yr(t);let n=br(e.tagName);return n===null?`other`:mr.get(n.toLowerCase())??`other`}function _r(e){return hr[e]}function vr(e){return`elementKinds.${e}`}function yr(e){let t=e.search(/\s/),n=(t===-1?e:e.slice(0,t)).toLowerCase();return pr.get(n)??`other`}function br(e){if(e==null)return null;let t=e.trim();return t===``?null:t}var xr={text_contains:{labelKey:`checkTypes.text_contains`,icon:[[`path`,{d:`M17 6.1H3`}],[`path`,{d:`M21 12.1H3`}],[`path`,{d:`M15.1 18H3`}]]},text_equals:{labelKey:`checkTypes.text_equals`,icon:[[`path`,{d:`M5 9h14`}],[`path`,{d:`M5 15h14`}]]},text_free:{labelKey:`checkTypes.text_free`,icon:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`}],[`path`,{d:`M20 2v4`}],[`path`,{d:`M22 4h-4`}],[`circle`,{cx:`4`,cy:`20`,r:`2`}]]},element_visible:{labelKey:`checkTypes.element_visible`,icon:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]]},element_exists:{labelKey:`checkTypes.element_exists`,icon:[[`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`}]]},element_not_exists:{labelKey:`checkTypes.element_not_exists`,icon:[[`path`,{d:`M5 3a2 2 0 0 0-2 2`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`}],[`path`,{d:`M9 3h1`}],[`path`,{d:`M9 21h1`}],[`path`,{d:`M14 3h1`}],[`path`,{d:`M14 21h1`}],[`path`,{d:`M3 9v1`}],[`path`,{d:`M21 9v1`}],[`path`,{d:`M3 14v1`}],[`path`,{d:`M21 14v1`}]]},input_value:{labelKey:`checkTypes.input_value`,icon:[[`path`,{d:`M12 4v16`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`}],[`path`,{d:`M9 20h6`}]]},url_contains:{labelKey:`checkTypes.url_contains`,icon:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`}],[`path`,{d:`M2 12h20`}]]}},Sr=`checkTypes.assert_text`;function Cr(e){return!f(e)}function wr(e){if(!Cr(e))throw Error(`Check type "${e}" is legacy and read-only: it has no catalog entry`);let t=xr[e];if(t===void 0)throw Error(`Unknown check type: ${String(e)}`);return t}function Tr(e){return Cr(e)?wr(e).labelKey:Sr}function Er(e){return wr(e).icon}function Dr(e){return wr(e),nn[g(e)].filter(t=>t===e||we(e,t))}var J={selectable:!1,actionEditable:!1,showInputValue:!1,showMaskPassword:!1,showKeypress:!1,showTargetUrl:!1},Y={...J,selectable:!0,actionEditable:!0},Or={...J,actionEditable:!0},kr={click:Y,input:{...Y,showInputValue:!0,showMaskPassword:!0},select:{...Y,showInputValue:!0},check:Y,uncheck:Y,keypress:{...Y,showKeypress:!0},submit:Y,navigate:{...Y,showTargetUrl:!0},checkbox:Or,keyboard:Or,focus:Or,blur:Or,hover:Or,scroll:J,assert:J,canvas_click:J,canvas_dblclick:J,canvas_drag:J,canvas_zoom:J,canvas_pan:J,shared_step:J,api_call:J,extract_variable:J,text_step:J};function Ar(e){return kr[e]}var jr=[`click`,`input`,`select`,`check`,`uncheck`,`keypress`,`submit`,`navigate`];function Mr(e){return`stepEditor.actionTypes.${e}`}var Nr={text_contains:B.text_contains,text_equals:B.text_equals,input_value:B.input_value,element_visible:B.element_visible,element_exists:B.element_exists,element_not_exists:B.element_not_exists,url_contains:B.url_contains,assert_text:null};function Pr(e){return Nr[e]!==null}function Fr(e,t){let n=Nr[e];if(n===null)return null;let r=t[n];if(typeof r!=`string`)throw TypeError(`Typed check "${e}" has no string "${n}" in its configuration`);return r}function Ir(e,t,n){let r=Nr[e];if(r===null)throw TypeError(`Typed check "${e}" has no editable value`);return{...t,[r]:n}}function Lr(e){let t=Nr[e];return t===null?{}:{[t]:``}}function Rr(e,t,n){if(!Dr(e).includes(t))throw TypeError(`Typed check "${e}" cannot be swapped to "${t}"`);let r={};`targetName`in n&&(r.targetName=n.targetName);let i=Nr[e],a=Nr[t];return a!==null&&(r[a]=i!==null&&i===a?n[i]:``),t===`element_not_exists`&&e===`element_not_exists`&&`targetText`in n&&(r.targetText=n.targetText),r}function zr(e){if(e.assertionType===`text_free`)throw TypeError(`Expected result ${e.id} is a text check, not a typed one`);return{key:e.id,id:e.id,assertionType:e.assertionType,assertionConfig:e.assertionConfig,base:e,pickedTarget:null}}function Br(e,t){return{key:e,id:null,assertionType:t,assertionConfig:Lr(t),base:null,target:null}}function Vr(e,t){return{key:e,id:null,assertionType:t.assertionType,assertionConfig:t.assertionConfig,base:null,target:{elementId:t.targetElement===null?null:t.targetElement.id,targetSelector:t.targetSelector,targetXpath:t.targetXpath,scope:t.scope}}}function Hr(e,t){return e===`element_not_exists`?t.scope:{scopeElementId:null,scopeSelector:null,scopeXpath:null,scopeLabel:null}}function Ur(e,t){return{targetSelector:t.targetSelector,targetXpath:t.targetXpath,targetElementId:t.elementId,...Hr(e,t)}}function Wr(e){let t=e.base;if(t===null){let t=e.target;return{assertionType:e.assertionType,text:null,assertionConfig:e.assertionConfig,...t===null?{targetSelector:null,targetXpath:null,targetElementId:null}:Ur(e.assertionType,t),source:`manual`}}return{id:e.id,assertionType:e.assertionType,text:null,assertionConfig:e.assertionConfig,...e.pickedTarget===null?{targetSelector:t.targetSelector,targetXpath:t.targetXpath,targetElementId:t.targetElementId}:{targetSelector:e.pickedTarget.targetSelector,targetXpath:e.pickedTarget.targetXpath,targetElementId:e.pickedTarget.elementId},source:t.source,...t.targetHint===null?{targetHint:null}:{},scopeElementId:t.scopeElementId,scopeSelector:t.scopeSelector,scopeXpath:t.scopeXpath,scopeLabel:t.scopeLabel}}function Gr(e,t){return e.base!==null&&e.pickedTarget!==null||e.assertionType!==t.assertionType||!Kr(e.assertionConfig,t.assertionConfig)}function Kr(e,t){let n=/* @__PURE__ */ new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n)if(e[r]!==t[r])return!1;return!0}var qr=`inline-flex items-center gap-1.5 font-medium leading-none whitespace-nowrap [&_svg]:size-3 [&_svg]:shrink-0`,Jr=`bg-surface-hover-layer`,Yr={primary:`bg-surface-primary-tint-15 text-fg-on-primary-tint`,success:`${Jr} text-fg-success-strong`,warning:`bg-surface-warning text-(--color-warning-text-strong) shadow-ring-warning`,error:`bg-surface-error text-(--color-error-text) shadow-ring-error`,info:`${Jr} text-fg-info-strong`,neutral:`${Jr} text-fg-secondary`,muted:`${Jr} text-fg-muted`,watch:`${Jr} text-fg-primary`,priorityHigh:`bg-[color-mix(in_srgb,var(--color-priority-high)_12%,transparent)] text-fg-priority-high shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--color-priority-high)_45%,transparent)]`},X=M(),Xr={live:`bg-(--color-live) shadow-(--glow-status-live)`,warning:`bg-warning`,muted:`bg-fg-muted`},Zr={md:`h-5.5 px-2.25 text-(length:--text-caption)`,sm:`h-4.5 px-1.5 text-(length:--text-caption)`},Qr={pill:`rounded-full`,square:`rounded-xs`};function $r({children:e,colorScheme:t=`neutral`,size:n=`md`,shape:r=`pill`,icon:i,iconTone:a,dot:o,className:s,"data-testid":c,...l}){let u=V(qr,Zr[n],Qr[r],Yr[t],a===`primary`&&`[&_svg]:text-(--color-primary-text)`,s);return/* @__PURE__ */ (0,X.jsxs)(`span`,{...l,className:u,"data-color-scheme":t,"data-testid":c,children:[o===void 0?null:/* @__PURE__ */ (0,X.jsx)(`i`,{className:`size-1.5 shrink-0 rounded-full ${Xr[o]}`,"aria-hidden":`true`}),i,e]})}var ei=`group/badge-trigger h-5.5 cursor-pointer rounded-full border-0 pr-1.5 pl-2.25 font-sans text-(length:--text-caption) [transition:background-image_var(--motion-short)_var(--ease-out),box-shadow_var(--motion-short)_var(--ease-out),transform_var(--motion-short)_var(--ease-out)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-stroke-focus`,ti={warning:`hover:[background-image:linear-gradient(var(--color-bg-warning-tint),var(--color-bg-warning-tint))] hover:shadow-[inset_0_0_0_1px_var(--color-ring-warning-40)] active:[background-image:linear-gradient(var(--color-bg-warning-tint-hover),var(--color-bg-warning-tint-hover))] active:shadow-[inset_0_0_0_1px_var(--color-ring-warning-40)] aria-expanded:[background-image:linear-gradient(var(--color-bg-warning-tint-hover),var(--color-bg-warning-tint-hover))] aria-expanded:shadow-[inset_0_0_0_1px_var(--color-ring-warning-40)]`};function ni({children:e,colorScheme:t,icon:n,"data-testid":r,...i}){return/* @__PURE__ */ (0,X.jsxs)(`button`,{...i,type:`button`,"data-color-scheme":t,"data-testid":r,className:V(qr,Yr[t],ei,ti[t]),children:[n,e,/* @__PURE__ */ (0,X.jsx)(Rt,{"aria-hidden":`true`,className:`[transition:transform_var(--motion-medium)_var(--ease-out)] group-aria-expanded/badge-trigger:rotate-180`})]})}var ri={passed:`bg-(--color-bg-success-tint) text-fg-success`,failed:`bg-(--color-bg-error-tint) text-fg-error`,next:`bg-(--color-bg-primary-tint-10) text-(--color-primary-text)`,notstarted:`bg-surface-hover-layer text-fg-secondary`,skipped:`bg-surface-hover-layer text-fg-secondary`},ii={passed:F,failed:xe,next:null,notstarted:null,skipped:null};function ai({outcome:e,children:t,className:n,"data-testid":r}){let i=ii[e];return/* @__PURE__ */ (0,X.jsxs)(`span`,{className:V(`inline-flex h-6 items-center gap-1.25 rounded-full text-xs font-medium whitespace-nowrap`,i===null?`px-2.25`:`pr-2.25 pl-1.75`,ri[e],n),"data-outcome":e,"data-testid":r,children:[i===null?null:/* @__PURE__ */ (0,X.jsx)(i,{className:`size-3 shrink-0`,strokeWidth:2.4,"aria-hidden":`true`}),t]})}var oi={passed:`bg-success shadow-(--glow-status-success)`,failed:`bg-error shadow-(--glow-status-error)`,skipped:`bg-warning shadow-(--glow-status-warning)`,running:`bg-info shadow-(--glow-status-info) animate-(--animation-pulse-dot)`,queued:`border-2 border-info`,cancelled:`bg-fg-muted`,never:`shadow-[inset_0_0_0_1.5px_var(--color-text-muted)]`},si={passed:`text-fg-success-strong`,failed:`text-(--color-error-text-strong)`,skipped:`text-(--color-warning-text-strong)`,running:`text-fg-info-strong`,queued:`text-fg-info-strong`,cancelled:`text-fg-secondary`,never:`text-fg-secondary`},ci={passed:`border-stroke-success bg-surface-success text-fg-success`,failed:`border-stroke-error bg-surface-error text-fg-error`,running:`border-primary/30 bg-(--color-bg-primary-tint-10) text-fg-link`,cached:`border-stroke-info bg-surface-info text-fg-info`,skipped:`border-stroke-light bg-surface-tertiary text-fg-muted`,pending:`border-stroke-light bg-surface-tertiary text-fg-muted`,notstarted:`border-stroke-light bg-surface-tertiary text-fg-muted`,stopped:`border-stroke bg-(--color-bg-cancelled-tint) text-fg-secondary`,interrupted:`border-stroke bg-(--color-bg-cancelled-tint) text-fg-secondary`,warn:`border-stroke-warning bg-surface-warning text-fg-warning`,neutral:`border-stroke bg-surface-tertiary text-fg-secondary`};function li(e){if(e.outcome!==void 0)return/* @__PURE__ */ (0,X.jsx)(ai,{...e});let{children:t,size:n=`md`,className:r,"data-testid":i}=e;if(e.tone!==void 0){let a=e.tone,o=a===`skipped`||a===`pending`||a===`notstarted`;return/* @__PURE__ */ (0,X.jsxs)(`span`,{className:V(`inline-flex h-5.5 items-center gap-1.5 rounded-full border px-2 text-caption font-medium whitespace-nowrap`,ci[a],n===`sm`&&`h-5 px-1.5 text-[length:var(--text-micro)]`,r),"data-testid":i,children:[/* @__PURE__ */ (0,X.jsx)(`i`,{className:V(`size-1.5 shrink-0 rounded-full`,o?`border border-current bg-transparent`:`bg-current`,a===`running`&&`animate-(--animation-pulse-dot)`,(a===`stopped`||a===`interrupted`)&&`rounded-xs`),"aria-hidden":`true`}),t]})}let{status:a,hideLabel:o=!1}=e,s=n===`md`&&!o;return/* @__PURE__ */ (0,X.jsxs)(`span`,{className:V(`inline-flex items-center`,s?`h-5.5 gap-1.5 rounded-full bg-surface-hover-layer px-2.25 text-(length:--text-caption) font-medium whitespace-nowrap ${si[a]}`:V(`text-fg-secondary`,n===`sm`?`gap-1.5 text-xs`:`gap-1.75 text-(length:--text-body-sm)`),r),"data-status":a,"data-testid":i,children:[/* @__PURE__ */ (0,X.jsx)(`i`,{className:V(`shrink-0 rounded-full`,s?`size-1.5`:`size-1.75`,oi[a]),"aria-hidden":`true`}),o?/* @__PURE__ */ (0,X.jsx)(`span`,{className:`sr-only`,children:t}):t]})}var ui=`\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022`,di=`ui-secret-dots`;function fi({label:e,size:t=`md`,className:n,"data-testid":r}){return/* @__PURE__ */ (0,X.jsxs)(`span`,{role:`img`,"aria-label":e,"data-testid":r,className:V(`inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-md border border-stroke-light bg-surface-hover-layer text-(length:--text-body-sm)`,t===`sm`?`h-6 px-1.5`:`h-8 px-2.5`,n),children:[/* @__PURE__ */ (0,X.jsx)(oe,{size:14,className:`shrink-0 text-fg-muted`,"aria-hidden":`true`}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:V(di,`tracking-[2px] text-fg-secondary`),"aria-hidden":`true`,children:ui})]})}var Z=/* @__PURE__ */ e(re(),1),pi=/* @__PURE__ */ e(ce(),1),mi=[`isUnassigned`,`hasUnboundElementSteps`,`hasUnlockedTextSteps`],hi={ru:{needsBinding:(e,t)=>`\u0421\u0446\u0435\u043D\u0430\u0440\u0438\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043F\u0440\u0438\u0432\u044F\u0437\u043A\u0438: ${e}. \u0421\u043D\u0430\u0447\u0430\u043B\u0430 ${t}, \u043F\u043E\u0442\u043E\u043C \u0437\u0430\u043F\u0443\u0441\u043A.`,causesSentence:e=>`${e}.`,causes:{isUnassigned:`\u043D\u0435 \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430`,hasUnboundElementSteps:`\u0435\u0441\u0442\u044C \u0448\u0430\u0433\u0438 \u0431\u0435\u0437 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430`,hasUnlockedTextSteps:`\u0435\u0441\u0442\u044C \u043D\u0435\u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u044B\u0435 \u0448\u0430\u0433\u0438`},actions:{make_auto:`\u00AB\u0421\u0434\u0435\u043B\u0430\u0442\u044C \u0430\u0432\u0442\u043E\u00BB`,bind_elements:{hub:`\u00AB\u041F\u0440\u0438\u0432\u044F\u0437\u0430\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B\u00BB`,web:`\u00AB\u041F\u0440\u0438\u0432\u044F\u0437\u0430\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B\u00BB \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0438 Progon`}},needsDeviceExecutor:(e,t)=>`\u041D\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044F \u0434\u043B\u044F \u0448\u0430\u0433\u043E\u0432 \u043D\u0430 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435: ${t?`\u0448\u0430\u0433\u0438`:`\u0448\u0430\u0433`} ${e}.`,noSteps:`\u0412 \u0441\u0446\u0435\u043D\u0430\u0440\u0438\u0438 \u043D\u0435\u0442 \u0448\u0430\u0433\u043E\u0432.`,aiUnavailableForTextSteps:`\u0418\u0418 \u043D\u0435\u0442, \u0430 \u0432 \u0441\u0446\u0435\u043D\u0430\u0440\u0438\u0438 \u0435\u0441\u0442\u044C \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u044B\u0435 \u0448\u0430\u0433\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u043C \u043E\u043D \u043D\u0443\u0436\u0435\u043D.`,unread:`\u0421\u0446\u0435\u043D\u0430\u0440\u0438\u0439 \u043F\u043E\u043A\u0430 \u043D\u0435\u043B\u044C\u0437\u044F \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438.`,noReadyScenarios:`\u0421\u0440\u0435\u0434\u0438 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0445 \u0441\u0446\u0435\u043D\u0430\u0440\u0438\u0435\u0432 \u043D\u0435\u0442 \u0433\u043E\u0442\u043E\u0432\u044B\u0445 \u043A \u0437\u0430\u043F\u0443\u0441\u043A\u0443 \u0432 \u00AB\u0410\u0432\u0442\u043E\u00BB.`},en:{needsBinding:(e,t)=>`This scenario needs binding: ${e}. First use ${t}, then run it.`,causesSentence:e=>`${e}.`,causes:{isUnassigned:`no page is assigned`,hasUnboundElementSteps:`some steps have no element`,hasUnlockedTextSteps:`some text steps are not locked`},actions:{make_auto:`"Make Auto"`,bind_elements:{hub:`"Bind elements"`,web:`"Bind elements" in the Progon extension`}},needsDeviceExecutor:(e,t)=>`No executor for the steps on the device: ${t?`steps`:`step`} ${e}.`,noSteps:`This scenario has no steps.`,aiUnavailableForTextSteps:`AI is unavailable, and this scenario has text steps that need it.`,unread:`This scenario cannot run automatically.`,noReadyScenarios:`None of the selected scenarios is ready to run in Auto.`}};function gi(e,t,n){let r=hi[n];switch(e.status){case`needs_device_executor`:{let{stepNumbers:t}=e.details;return r.needsDeviceExecutor(t.join(`, `),t.length>1)}case`needs_binding`:return r.needsBinding(bi(e.causes,n),Si(e.offeredActions.map(e=>xi(r,e,t)),n,`disjunction`,`a needs_binding refusal offers no action, but offeredActions is .min(1) on both schemas`));case`no_steps`:return r.noSteps;case`ai_unavailable_for_text_steps`:return r.aiUnavailableForTextSteps}}function _i(e,t){return hi[t].causesSentence(Ci(bi(e,t)))}function vi(e){return hi[e].unread}function yi(e){return hi[e].noReadyScenarios}function bi(e,t){let n=hi[t];return Si(mi.filter(t=>e[t]).map(e=>n.causes[e]),t,`conjunction`,`a needs_binding refusal has no true cause, but needsMapping is the OR of exactly these three`)}function xi(e,t,n){let r=e.actions[t];return typeof r==`string`?r:r[n]}function Si(e,t,n,r){if(e.length===0)throw Error(`scenario-launch-refusal-text: ${r}`);return new Intl.ListFormat(t,{style:`long`,type:n}).format(e)}function Ci(e){return e.charAt(0).toUpperCase()+e.slice(1)}function wi(){let{t:e,i18n:t}=H(),n=t.resolvedLanguage;return(0,Z.useMemo)(()=>{let r=e,i=It.find(e=>e===n);if(i===void 0)throw Error(`i18n resolved an unsupported UI locale: ${String(n)}`);return{t:r,has:e=>t.exists(e),locale:i}},[t,n,e])}var Ti=`scenarios.not_auto_runnable`;function Ei(e,t,n){if(t!==Ti)return null;let r=d.safeParse(n==null?void 0:n.decision);return r.success?gi(r.data,`web`,e):vi(e)}function Di(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:null}function Oi(e,t){if(!(t instanceof E)||t.errorCode!==`remote_runs.text_steps_unsupported`)return null;let n=t.params;if(!n)return null;let r=Di(n.unconvertedTextStepCount),i=Di(n.lockedTextStepCount);return r===null||i===null?null:r>0?e(`apiErrors.remote_runs.text_steps_unsupported.unconverted`):i>0?e(`apiErrors.remote_runs.text_steps_unsupported.locked`):null}function ki(e,t,n,r){if(t instanceof E){let n=Oi(e.t,t);if(n!==null)return n;let r=Ei(e.locale,t.errorCode,t.params);if(r!==null)return r}return sn(e,t,n,r)}V(v,m,`flex h-7.5 min-w-0 flex-1 justify-center gap-1.5 rounded-full px-1.5 text-body-sm [&_svg]:size-3.5`);var Ai=/*#__PURE__*/ Z.createContext(void 0);function Q(e){let t=Z.useContext(Ai);if(t===void 0&&!e)throw Error(le(47));return t}var ji={...tt,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Mi=class extends Nt{constructor(e,t,n){let r=new Ut;super(Ni(e,r,t,n),Pi(r),ji),St(this,`setOpen`,(e,t)=>{var n,r;let i=t.reason===it,a=t.reason===`trigger-press`&&t.event.detail===0,o=!e&&(t.reason===`escape-key`||t.reason==null),s=mt(t),c=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&c!=null&&(t.trigger=this.context.triggerElements.getById(c)??this.select(`activeTriggerElement`)??void 0),(n=(r=this.context).onOpenChange)==null||n.call(r,e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let l=()=>{let n=jt(this.state,e,t.trigger,s());n.openChangeReason=t.reason,this.update(n)};i?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),pi.flushSync(l)):l();let u;a?u=`click`:o?u=`dismiss`:t.reason===`focus-out`&&(u=`focus`),this.set(`instantType`,u)})}};function Ni(e,n,r,i=!1){let a={...t(n,r,i),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return a.open&&(e==null?void 0:e.mounted)===void 0&&(a.mounted=!0),a}function Pi(e){return{popupRef:/*#__PURE__*/ Z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:/*#__PURE__*/ Z.createRef(),beforeContentFocusGuardRef:/*#__PURE__*/ Z.createRef(),stickIfOpenTimeout:new k,triggerElements:e}}var Fi=Et(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=Li(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Qe(u,d),Bt(u);let{forceUnmount:m}=Xe(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),Z.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),Z.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,je(At))}),[m,u]);let h=d||f;return/*#__PURE__*/ (0,X.jsxs)(Ai.Provider,{value:u,children:[s&&/*#__PURE__*/ (0,X.jsx)(zt,{handle:s,store:u}),h&&/*#__PURE__*/ (0,X.jsx)(Ri,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function Ii(e){return Q(!0)?/*#__PURE__*/ (0,X.jsx)(Fi,{props:e}):/*#__PURE__*/ (0,X.jsx)(Ye,{children:/*#__PURE__*/ (0,X.jsx)(Fi,{props:e})})}function Li(e,t){let n=Gt((e,n)=>new Mi(t,e,n));return Z.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function Ri({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=st(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference,a=r.floating;return Ct(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}var zi=ut(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:d=300,closeDelay:f=0,id:p,...m}=e,h=Q(!0),g=me(s)??h;if(!g)throw Error(le(74));let _=ke(p),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),x=g.useState(`triggerPopupId`,_),S=Z.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=nt(_,S,g,{payload:c,disabled:a,openOnHover:l,closeDelay:f}),T=g.useState(`openChangeReason`),E=g.useState(`stickIfOpen`),D=g.useState(`openMethod`),O=g.useState(`focusManagerModal`),k=ze(y,{enabled:!a&&l&&(D!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:I(),restMs:d,delay:{close:f},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`}),A=He(y,{stickIfOpen:E}),j=pe(()=>g.select(`open`),e=>{g.set(`openMethod`,e)}),M=g.useState(`triggerProps`,w),{getButtonProps:N,buttonRef:P}=Lt({disabled:a,native:o}),F={open(e){return e&&T===`trigger-press`?ct.open(e):Ue.open(e)}},{preFocusGuardRef:ee,handlePreFocusGuardFocus:te,handleFocusTargetFocus:ne}=yt(g,S),re=$t(`button`,e,{state:{disabled:a,open:b},ref:[P,t,C,S],props:[A.reference,k,M,j,{[u]:``,id:_,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},m,N],stateAttributesMapping:F}),ie=/*#__PURE__*/ (0,X.jsx)(Z.Fragment,{children:re},_);return w&&!O?/*#__PURE__*/ (0,X.jsxs)(Z.Fragment,{children:[/*#__PURE__*/ (0,X.jsx)(ue,{ref:ee,onFocus:te}),ie,/*#__PURE__*/ (0,X.jsx)(ue,{ref:g.context.triggerFocusTargetRef,onFocus:ne})]}):ie}),Bi=/*#__PURE__*/ Z.createContext(void 0);function Vi(){let e=Z.useContext(Bi);if(e===void 0)throw Error(le(45));return e}var Hi=/*#__PURE__*/ Z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Q().useState(`mounted`)||n?/*#__PURE__*/ (0,X.jsx)(Bi.Provider,{value:n,children:/*#__PURE__*/ (0,X.jsx)(be,{ref:t,...r})}):null}),Ui=/*#__PURE__*/ Z.createContext(void 0);function Wi(){let e=Z.useContext(Ui);if(!e)throw Error(le(46));return e}var Gi=/*#__PURE__*/ Z.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:c,align:l,sideOffset:u,alignOffset:d,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p,arrowPadding:m,sticky:h,disableAnchorTracking:g=!1,collisionAvoidance:_=Te,...v}=e,y=Q(),b=Vi(),x=en(),S=y.useState(`floatingRootContext`),C=y.useState(`mounted`),w=y.useState(`open`),T=y.useState(`openChangeReason`),E=y.useState(`activeTriggerElement`),O=y.useState(`modal`),k=y.useState(`openMethod`),A=y.useState(`positionerElement`),j=y.useState(`instantType`),M=y.useState(`transitionStatus`),P=y.useState(`adaptiveOrigin`),F=Z.useRef(null),ee=ln(A),I=s({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:c,sideOffset:u,align:l,alignOffset:d,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:h,disableAnchorTracking:g,keepMounted:b,nodeId:x,collisionAvoidance:_,adaptiveOrigin:P}),te=S.useState(`domReferenceElement`);Re(()=>{let e=te,t=F.current;if(e&&(F.current=e),t&&e&&e!==t){y.set(`instantType`,void 0);let e=new AbortController;return ee(()=>{y.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[te,ee,y]);let ne=O===!0&&T!==`trigger-hover`;N(w&&ne,k===`touch`,A,E);let re=y.useStateSetter(`positionerElement`),ae={open:w,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:j},oe=ie(e,ae,{styles:I.positionerStyles,transitionStatus:M,props:v,refs:[t,re],hidden:!C,inert:!w});return/*#__PURE__*/ (0,X.jsxs)(Ui.Provider,{value:I,children:[C&&ne&&/*#__PURE__*/ (0,X.jsx)(ye,{inert:D(!w),cutout:E}),/*#__PURE__*/ (0,X.jsx)(rn,{id:x,children:oe})]})}),Ki=/*#__PURE__*/ Z.createContext(void 0);function qi(){let[e,t]=Z.useState(0),n=Ie(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:Z.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function Ji(){let e=Z.useContext(Ki);Re(()=>e==null?void 0:e.register(),[e])}var Yi=/*#__PURE__*/ Z.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Q(),l=Wi(),u=T(!0)!=null,{context:d,hasClosePart:f}=qi(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),E=w.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);ge({open:p,ref:c.context.popupRef,onComplete(){if(p){var e,t;(e=(t=c.context).onOpenChangeComplete)==null||e.call(t,!0)}}}),Le(w,{enabled:O&&!D,closeDelay:k});let A=a===void 0?qe(c.context.popupRef):a,j=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N={open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},P=$t(`div`,e,{state:N,ref:[t,c.context.popupRef,M],props:[_,{id:E,role:`dialog`,...Ot,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&Fe.has(e.key)&&e.stopPropagation()}},Ae(g),s],stateAttributesMapping:dt});return/*#__PURE__*/ (0,X.jsx)(Yt,{context:w,openInteractionType:m,modal:j,disabled:!x||S===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:Tt(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:/*#__PURE__*/ (0,X.jsx)(Ki.Provider,{value:d,children:P})})}),Xi=/*#__PURE__*/ Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Q(),s=ke(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),$t(`h2`,e,{ref:t,props:[{id:s},a]})}),Zi=/*#__PURE__*/ Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Q(),s=ke(a.id);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),$t(`p`,e,{ref:t,props:[{id:s},a]})}),$={fallbackAxisSide:`none`},Qi=8,$i={compact:{surface:`p-3`,title:`m-0 text-[length:var(--text-body-sm)] leading-normal font-semibold text-fg-primary`,description:`m-0 text-xs leading-normal text-fg-muted`,body:`grid gap-2 mt-2.5`,footer:`mt-3 border-t border-stroke-light pt-2.5`},form:{surface:`p-4`,title:`m-0 text-[length:var(--text-sm)] leading-(--leading-block-title) font-semibold tracking-(--tracking-snug) text-fg-primary`,description:`m-0 text-xs leading-(--leading-caption) text-fg-muted`,body:`grid gap-3 mt-3`,footer:`mt-3 border-t border-(--color-border-hairline) pt-3`}};function ea(e){switch(e){case`escape-key`:return`escape`;case`outside-press`:return`outside`;case`trigger-press`:return`trigger`;case`focus-out`:return`focus-out`;default:return`other`}}function ta({title:e,description:t,footerStart:n,footerEnd:r,side:a=`bottom`,align:o=`start`,collisionAvoidance:s,collisionBoundary:c,titleVisible:l=!0,density:u=`compact`,className:d,initialFocusRef:f,trapFocus:p=!1,"data-testid":m,children:h,trigger:g,triggerTooltip:_,positionAnchor:v,anchor:y,open:b,onOpenChange:x}){let S=i(),C=We(),w=$i[u],T=`flex max-h-(--available-height) flex-col overflow-y-auto overscroll-contain ${w.surface} ${Zt}`;return/* @__PURE__ */ (0,X.jsxs)(Ii,{open:b,modal:p?`trap-focus`:!1,onOpenChange:(e,t)=>{!e&&t.reason===`escape-key`&&t.event.preventDefault(),!e&&ft(y,t.reason,t.event)||x==null||x(e,ea(t.reason))},children:[g===void 0?null:_===void 0?/* @__PURE__ */ (0,X.jsx)(zi,{render:g}):/* @__PURE__ */ (0,X.jsx)(Be,{relationship:_.relationship,content:_.content,children:/* @__PURE__ */ (0,X.jsx)(zi,{render:g})}),/* @__PURE__ */ (0,X.jsx)(Hi,{container:S,children:/* @__PURE__ */ (0,X.jsx)(Gi,{anchor:v??C??y,side:a,align:o,collisionAvoidance:s,collisionBoundary:c,sideOffset:Qi,collisionPadding:8,positionMethod:`fixed`,className:`z-popover`,children:/* @__PURE__ */ (0,X.jsxs)(Yi,{initialFocus:f,finalFocus:y===void 0?void 0:()=>y,"data-floating-dismiss-layer":``,"data-testid":m,className:d===void 0?`w-[280px] ${T}`:`${T} ${d}`,children:[/* @__PURE__ */ (0,X.jsxs)(`div`,{className:l?`grid gap-0.5`:`sr-only`,children:[/* @__PURE__ */ (0,X.jsx)(Xi,{className:w.title,children:e}),t===void 0?null:/* @__PURE__ */ (0,X.jsx)(Zi,{className:w.description,children:t})]}),/* @__PURE__ */ (0,X.jsx)(`div`,{className:l?w.body:`grid gap-2`,children:h}),n!==void 0||r!==void 0?/* @__PURE__ */ (0,X.jsxs)(`div`,{className:V(`flex items-center justify-between gap-2`,w.footer),children:[/* @__PURE__ */ (0,X.jsx)(`div`,{className:`flex items-center gap-2`,children:n}),/* @__PURE__ */ (0,X.jsx)(`div`,{className:`flex items-center gap-2`,children:r})]}):null]})})})]})}var na=`gap-0! rounded-lg! border-solid! border-(--color-border-strong)! bg-(--color-bg-modal)! p-1.5! shadow-(--shadow-menu)!`,ra=`w-[320px] max-w-[calc(100vw-16px)] ${na}`,ia=`w-(--anchor-width) ${na}`,aa=`my-1 h-px shrink-0 bg-stroke-light`;function oa(e,t){return e.block===null?e.occupied?t.runnerBusy:t.runnerFree:t.runnerBlocked[e.block]}function sa(e,t,n){switch(e.kind){case`opening`:return t.status===`failed`?n.fleetFailed:t.status===`ready`?n.pick:n.fleetLoading;case`this_browser`:return n.thisBrowser;case`none`:return n.none;case`runner`:return n.runner(e.runner.name);case`runner-unread`:return n.runnerUnread;case`runner-gone`:return n.runnerGone}}function ca(e,t){switch(e.kind){case`opening`:return t.status===`failed`?U:_;case`this_browser`:return _e;case`none`:return Kn;case`runner`:case`runner-unread`:return _;case`runner-gone`:return U}}function la({place:e,view:t,fleet:r,onChoose:i,onOpen:a,copy:o,heading:s,thisBrowserReach:c,look:l,disabled:u=!1}){let[d,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(!1),v=(0,Z.useId)(),y=(0,Z.useRef)(null),x=(0,Z.useId)(),S=n(),C=d&&!u,w=t.kind===`runner-gone`,T=w||t.kind===`opening`&&r.status===`failed`,E=sa(t,r,o),D=ca(t,r),O=r.status===`ready`?r.runners:[],k=e=>({key:`runner-${e.id}`,place:{kind:`runner`,agentId:e.id},icon:_,title:o.runner(e.name),detail:oa(e,o),withheld:e.block!==null}),A={key:`this_browser`,place:{kind:`this_browser`},icon:_e,title:o.thisBrowser,detail:c===`opens_windows`?o.thisBrowserRowOpensWindows:o.thisBrowserRowTasksOnly,withheld:!1},j={key:`none`,place:{kind:`none`},icon:Kn,title:o.none,detail:o.noneRow,withheld:!1},M=O.filter(e=>e.mine).map(k),N=O.filter(e=>!e.mine).map(k),P=t=>e!==null&&Dt(e,t.place),I=h||N.some(P),te=p===null?void 0:[A,...M,...N,j].find(e=>e.key===p),ne=e=>{e.withheld||(i(e.place),m(e.key),f(!1))},re=e=>{let t=[...e.currentTarget.querySelectorAll(`[role="radio"]`)].filter(e=>e.getAttribute(`aria-disabled`)!==`true`),n=t.findIndex(e=>e===document.activeElement),r=n=>{let r=t[n];r!==void 0&&(e.preventDefault(),r.focus())};switch(e.key){case`ArrowDown`:case`ArrowRight`:r((n+1)%t.length);break;case`ArrowUp`:case`ArrowLeft`:r((n-1+t.length)%t.length);break;case`Home`:r(0);break;case`End`:r(t.length-1)}},ie=r.status===`loading`||r.status===`idle`,ae=t=>{let n=P(t),r=n||e===null&&t.key===`this_browser`,i=t.icon;return/* @__PURE__ */ (0,X.jsxs)(`button`,{ref:r?y:void 0,type:`button`,role:`radio`,"aria-checked":n,"aria-disabled":t.withheld||void 0,tabIndex:r?0:-1,"data-testid":`ai-chat-place-${t.key}`,onClick:()=>ne(t),className:V(`grid w-full grid-cols-[16px_minmax(0,1fr)_16px] items-center gap-2.5 rounded-md border-0 bg-transparent px-2 py-[7px] text-left text-fg-secondary`,`focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--color-border-focus)`,t.withheld?`cursor-not-allowed text-fg-muted opacity-55`:`hover:bg-(--color-bg-elevated-hover) focus-visible:bg-(--color-bg-elevated-hover)`),children:[/* @__PURE__ */ (0,X.jsx)(i,{"aria-hidden":`true`,className:`size-3.5 text-fg-secondary`}),/* @__PURE__ */ (0,X.jsxs)(`span`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,X.jsx)(`b`,{className:`block truncate text-body-sm font-medium text-fg-primary`,children:t.title}),/* @__PURE__ */ (0,X.jsx)(`small`,{className:`block text-caption leading-[1.4] text-fg-muted`,children:t.detail})]}),/* @__PURE__ */ (0,X.jsx)(F,{"aria-hidden":`true`,className:V(`size-3.5 text-(--color-primary-text)`,!n&&`invisible`)})]},t.key)},oe=l===`setting`?/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,className:V(`qa-ai-chat-set qa-ai-chat-set--place`,T&&`qa-ai-chat-set--gone`),"aria-describedby":w?x:void 0,disabled:u,"data-place":t.kind,"data-testid":`ai-chat-place-chip`,children:[/* @__PURE__ */ (0,X.jsx)(D,{"aria-hidden":`true`}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`qa-ai-chat-set-value`,children:E})]}):/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,className:`${b(T?`error`:null)} whitespace-nowrap`,"aria-label":o.chipLabel(E),"aria-describedby":w?x:void 0,disabled:u,"data-place":t.kind,"data-testid":`ai-chat-place-chip`,children:[/* @__PURE__ */ (0,X.jsx)(D,{"aria-hidden":`true`}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`truncate`,children:E}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:de,"aria-hidden":`true`,children:/* @__PURE__ */ (0,X.jsx)(Rt,{})})]});return/* @__PURE__ */ (0,X.jsxs)(X.Fragment,{children:[/* @__PURE__ */ (0,X.jsx)(ta,{title:o.name,titleVisible:!1,trigger:oe,triggerTooltip:l===`setting`?{content:o.chipLabel(E),relationship:`label`}:{content:o.title,relationship:`description`},open:C,onOpenChange:e=>{e&&!d&&a(),f(e&&!u)},side:`top`,collisionAvoidance:$,...S===null?{}:{positionAnchor:S,collisionBoundary:bt(S)},initialFocusRef:y,className:S===null?ra:ia,"data-testid":`ai-chat-place-popover`,children:/* @__PURE__ */ (0,X.jsxs)(`div`,{className:`flex flex-col`,children:[s&&/* @__PURE__ */ (0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`flex items-baseline justify-between gap-2 px-2 py-1.5`,children:[/* @__PURE__ */ (0,X.jsx)(`b`,{className:`text-xs font-semibold tracking-[-0.1px] text-fg-primary`,children:o.name}),/* @__PURE__ */ (0,X.jsx)(`small`,{className:`text-caption text-fg-muted`,children:o.note})]}),/* @__PURE__ */ (0,X.jsxs)(`div`,{role:`radiogroup`,"aria-label":o.name,className:`flex flex-col gap-px`,onKeyDown:re,children:[ae(A),/* @__PURE__ */ (0,X.jsx)(`div`,{"aria-hidden":`true`,className:aa}),/* @__PURE__ */ (0,X.jsxs)(`div`,{className:`flex max-h-60 flex-col gap-px overflow-y-auto`,"data-testid":`ai-chat-place-runners`,children:[M.map(ae),ie&&/* @__PURE__ */ (0,X.jsx)(`div`,{className:`flex items-center gap-2 px-2 py-[7px] pl-[34px] text-caption text-fg-muted`,"data-testid":`ai-chat-place-fleet-state`,children:/* @__PURE__ */ (0,X.jsx)(`span`,{children:o.fleetLoading})}),r.status===`failed`&&/* @__PURE__ */ (0,X.jsx)(z,{tone:`error`,error:r.error,title:o.fleetFailed,onRetry:a,retrying:r.retrying,line:!0,"data-testid":`ai-chat-place-fleet-state`}),r.status===`ready`&&r.runners.length===0&&/* @__PURE__ */ (0,X.jsx)(z,{tone:`empty`,icon:/* @__PURE__ */ (0,X.jsx)(_,{"aria-hidden":`true`}),title:o.fleetEmpty,line:!0,"data-testid":`ai-chat-place-fleet-state`}),N.length>0&&/* @__PURE__ */ (0,X.jsxs)(X.Fragment,{children:[/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,"aria-expanded":I,"aria-controls":v,onClick:()=>g(!I),"data-testid":`ai-chat-place-others`,className:`grid w-full cursor-pointer grid-cols-[16px_minmax(0,1fr)] items-center gap-2.5 rounded-md border-0 bg-transparent px-2 py-[7px] text-left text-caption font-medium text-fg-muted hover:bg-(--color-bg-elevated-hover) hover:text-fg-secondary focus-visible:bg-(--color-bg-elevated-hover) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--color-border-focus)`,children:[/* @__PURE__ */ (0,X.jsx)(ee,{"aria-hidden":`true`,className:V(`size-3.5 transition-transform duration-(--motion-short) ease-(--ease-out)`,I&&`rotate-90`)}),/* @__PURE__ */ (0,X.jsx)(`span`,{children:o.othersGroup(N.length)})]}),/* @__PURE__ */ (0,X.jsx)(`div`,{id:v,className:`flex flex-col gap-px`,hidden:!I,children:I&&N.map(ae)})]})]}),/* @__PURE__ */ (0,X.jsx)(`div`,{"aria-hidden":`true`,className:aa}),ae(j)]})]})}),w&&/* @__PURE__ */ (0,X.jsx)(`p`,{id:x,role:`status`,className:l===`setting`?`qa-ai-chat-sets-note`:`qa-ai-chat-place-gone m-0 flex items-start gap-1.5 text-caption leading-[1.45] text-(--color-error-text)`,"data-testid":`ai-chat-place-gone`,children:o.runnerGoneHint}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:te===void 0?``:o.chipLabel(te.title)})]})}var ua={completed:{order:0,progressTone:`success`,runStatus:`passed`,labelKey:`makeAutoQueue.itemStatus.completed`,legendKey:`makeAutoQueue.legend.completed`},failed:{order:1,progressTone:`error`,runStatus:`failed`,labelKey:`makeAutoQueue.itemStatus.failed`,legendKey:`makeAutoQueue.legend.failed`},skipped:{order:2,progressTone:`warning`,runStatus:`skipped`,labelKey:`makeAutoQueue.itemStatus.skipped`,legendKey:`makeAutoQueue.legend.skipped`},cancelled:{order:3,progressTone:`muted`,runStatus:`cancelled`,labelKey:`makeAutoQueue.itemStatus.cancelled`,legendKey:`makeAutoQueue.legend.cancelled`},running:{order:4,progressTone:`running`,runStatus:`running`,labelKey:`makeAutoQueue.itemStatus.running`,legendKey:`makeAutoQueue.legend.running`},awaiting_answer:{order:5,progressTone:`warning`,runStatus:`queued`,labelKey:`makeAutoQueue.itemStatus.awaiting_answer`,legendKey:`makeAutoQueue.legend.awaiting_answer`},queued:{order:6,progressTone:`info`,runStatus:`queued`,labelKey:`makeAutoQueue.itemStatus.queued`,legendKey:`makeAutoQueue.legend.queued`}};[...Ge].sort((e,t)=>ua[e].order-ua[t].order);var da={already_queued:`makeAutoQueue.itemReason.already_queued`,no_steps:`makeAutoQueue.itemReason.no_steps`,binding_not_needed:`makeAutoQueue.itemReason.binding_not_needed`,ai_unavailable:`makeAutoQueue.itemReason.ai_unavailable`,test_run_open:`makeAutoQueue.itemReason.test_run_open`,scenario_busy:`makeAutoQueue.itemReason.scenario_busy`,scenario_not_found:`makeAutoQueue.itemReason.scenario_not_found`,needs_device_executor:`makeAutoQueue.itemReason.needs_device_executor`,run_failed:`makeAutoQueue.itemReason.run_failed`,launch_refused:`makeAutoQueue.itemReason.launch_refused`,executor_lost:`makeAutoQueue.itemReason.executor_lost`,server_error:`makeAutoQueue.itemReason.server_error`,cancelled_by_user:`makeAutoQueue.itemReason.cancelled_by_user`},fa={admin_disabled:`makeAutoQueue.aiUnavailableCause.admin_disabled`,credits_exhausted:`makeAutoQueue.aiUnavailableCause.credits_exhausted`,personal_limit_reached:`makeAutoQueue.aiUnavailableCause.personal_limit_reached`,model_unavailable:`makeAutoQueue.aiUnavailableCause.model_unavailable`};function pa(e,t){let n=e(da[t.reason]);return t.reason===`ai_unavailable`?e(`makeAutoQueue.reasonWithCause`,{reason:n,cause:e(fa[t.aiUnavailableCause])}):n}var ma={success:`text-(--color-success-text)`,muted:`text-fg-muted`,error:`text-(--color-error-text)`};function ha({admissions:e,className:t,"data-testid":n}){let{t:r}=H(),{rows:i,error:a,retrying:o,reload:s}=e;if(a!==null&&i===null)return/* @__PURE__ */ (0,X.jsx)(z,{tone:`error`,headingLevel:4,error:a,title:r(`makeAutoQueue.admission.failedTitle`),onRetry:s,retrying:o,className:t,"data-testid":n});if(i===null)return/* @__PURE__ */ (0,X.jsx)(`p`,{role:`status`,className:V(`m-0 text-caption text-fg-muted`,t),"data-testid":n,children:r(`makeAutoQueue.admission.loading`)});let c=i.filter(e=>e.admission.outcome===`admitted`),l=i.filter(e=>e.admission.outcome===`skipped`),u=i.filter(e=>e.admission.outcome===`rejected`);return/* @__PURE__ */ (0,X.jsxs)(`div`,{className:V(`flex flex-col gap-3`,t),"data-testid":n,children:[/* @__PURE__ */ (0,X.jsx)(ga,{tone:`success`,icon:/* @__PURE__ */ (0,X.jsx)(F,{"aria-hidden":`true`}),title:r(`makeAutoQueue.admission.admittedTitle`,{count:c.length}),rows:c,empty:r(`makeAutoQueue.admission.admittedEmpty`),group:`admitted`}),/* @__PURE__ */ (0,X.jsx)(ga,{tone:`muted`,icon:/* @__PURE__ */ (0,X.jsx)(ne,{"aria-hidden":`true`}),title:r(`makeAutoQueue.admission.skippedTitle`,{count:l.length}),rows:l,empty:null,group:`skipped`}),/* @__PURE__ */ (0,X.jsx)(ga,{tone:`error`,icon:/* @__PURE__ */ (0,X.jsx)(U,{"aria-hidden":`true`}),title:r(`makeAutoQueue.admission.rejectedTitle`,{count:u.length}),rows:u,empty:null,group:`rejected`})]})}function ga({tone:e,icon:t,title:n,rows:r,empty:i,group:a}){let o=r.length>0?/* @__PURE__ */ (0,X.jsx)(`ul`,{className:`m-0 flex max-h-40 list-none flex-col gap-1 overflow-y-auto p-0 [scrollbar-width:thin]`,children:r.map(e=>/* @__PURE__ */ (0,X.jsx)(_a,{row:e},e.admission.position))}):i===null?null:/* @__PURE__ */ (0,X.jsx)(z,{tone:`empty`,headingLevel:4,icon:/* @__PURE__ */ (0,X.jsx)($n,{"aria-hidden":`true`}),title:i});return o===null?null:/* @__PURE__ */ (0,X.jsxs)(`section`,{className:`flex flex-col gap-1.5`,"data-admission-group":a,children:[/* @__PURE__ */ (0,X.jsxs)(`h3`,{className:V(`m-0 flex items-center gap-1.5 text-caption font-semibold [&_svg]:size-[13px] [&_svg]:shrink-0`,ma[e]),children:[t,n]}),o]})}function _a({row:e}){let{t}=H(),{admission:n}=e,r=n.outcome===`skipped`?pa(t,n):n.outcome===`rejected`&&e.name!==null?t(`makeAutoQueue.admission.rejected`):null;return/* @__PURE__ */ (0,X.jsxs)(`li`,{"data-scenario-id":e.scenarioId,className:`flex flex-col gap-0.5 rounded-md bg-surface-hover-layer px-3 py-1.5`,children:[/* @__PURE__ */ (0,X.jsx)(`span`,{className:`text-xs text-fg-primary`,children:e.name===null?t(`makeAutoQueue.admission.rejected`):e.name}),r!==null&&/* @__PURE__ */ (0,X.jsx)(`span`,{className:`text-caption text-fg-muted`,children:r})]})}var va={normal:1,thinking:2,max:3},ya=[`h-[5px]`,`h-2`,`h-[11px]`],ba=[``,`[animation-delay:40ms]`,`[animation-delay:80ms]`];function xa({level:e,look:t,rise:n=!1,className:r}){return/* @__PURE__ */ (0,X.jsx)(`span`,{"aria-hidden":`true`,className:V(`inline-flex flex-none items-end`,t===`line`?`h-3 gap-[1.5px]`:`h-[11px] gap-0.5`,r),children:ya.map((r,i)=>{let a=i<e;return/* @__PURE__ */ (0,X.jsx)(`i`,{className:V(`w-[3px] origin-bottom rounded-[1px]`,r,!a&&t!==`line`&&`bg-current opacity-25`,!a&&t===`line`&&`bg-(--color-text-disabled)`,a&&t===`line`&&`bg-(--color-primary-text)`,a&&t===`quiet`&&`bg-current opacity-70`,a&&t===`lit`&&`bg-primary`,a&&t===`lit`&&n&&`[animation:var(--animation-effort-rise)]`,a&&t===`lit`&&n&&ba[i])},r)})})}var Sa=[`normal`,`thinking`,`max`];function Ca({effort:e,onChoose:t,copy:r,look:i,disabled:a=!1}){let[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(null),u=(0,Z.useRef)(null),d=n(),f=o&&!a,p=r.chipLabel(r.levels[e]),m=c===e?p:``,h=e=>{t(e),l(e)},g=e=>{let t=[...e.currentTarget.querySelectorAll(`[role="radio"]`)],n=t.findIndex(e=>e===document.activeElement),r=n=>{let r=t[n];if(r===void 0)return;e.preventDefault(),r.focus();let i=r.dataset.value,a=Sa.find(e=>e===i);a!==void 0&&h(a)};switch(e.key){case`ArrowDown`:case`ArrowRight`:r((n+1)%t.length);break;case`ArrowUp`:case`ArrowLeft`:r((n-1+t.length)%t.length);break;case`Home`:r(0);break;case`End`:r(t.length-1)}},_=i===`setting`?/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,className:`qa-ai-chat-set`,"aria-label":p,disabled:a,"data-effort":e,"data-testid":`ai-chat-effort-chip`,children:[/* @__PURE__ */ (0,X.jsx)(xa,{level:va[e],look:`line`}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`qa-ai-chat-set-value`,children:r.levels[e]})]}):/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,className:`${b(null)} whitespace-nowrap`,"aria-label":p,disabled:a,"data-effort":e,"data-testid":`ai-chat-effort-chip`,children:[/* @__PURE__ */ (0,X.jsx)(xa,{level:va[e],look:`lit`,className:`w-3.5 justify-center`}),/* @__PURE__ */ (0,X.jsx)(`span`,{children:r.levels[e]}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:de,"aria-hidden":`true`,children:/* @__PURE__ */ (0,X.jsx)(Rt,{})})]});return/* @__PURE__ */ (0,X.jsxs)(X.Fragment,{children:[/* @__PURE__ */ (0,X.jsx)(ta,{title:r.name,titleVisible:!1,trigger:_,open:f,onOpenChange:e=>s(e&&!a),side:`top`,collisionAvoidance:$,...d===null?{}:{positionAnchor:d,collisionBoundary:bt(d)},initialFocusRef:u,className:d===null?ra:ia,"data-testid":`ai-chat-effort-popover`,children:/* @__PURE__ */ (0,X.jsxs)(`div`,{className:`flex flex-col`,children:[/* @__PURE__ */ (0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`flex items-baseline justify-between gap-2 px-2 py-1.5`,children:[/* @__PURE__ */ (0,X.jsx)(`b`,{className:`text-xs font-semibold tracking-[-0.1px] text-fg-primary`,children:r.name}),r.note!==null&&/* @__PURE__ */ (0,X.jsx)(`small`,{className:`text-caption text-fg-muted`,children:r.note})]}),/* @__PURE__ */ (0,X.jsx)(`div`,{role:`radiogroup`,"aria-label":r.name,className:`flex flex-col gap-px`,onKeyDown:g,children:Sa.map(t=>{let n=e===t;return/* @__PURE__ */ (0,X.jsxs)(`button`,{ref:n?u:void 0,type:`button`,role:`radio`,"aria-checked":n,tabIndex:n?0:-1,"data-value":t,"data-testid":`ai-chat-effort-${t}`,onClick:()=>h(t),className:V(`grid w-full grid-cols-[16px_minmax(0,1fr)_16px] items-center gap-2.5 rounded-md border-0 bg-transparent px-2 py-[7px] text-left text-fg-secondary`,`focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--color-border-focus)`,`hover:bg-(--color-bg-elevated-hover) focus-visible:bg-(--color-bg-elevated-hover)`),children:[/* @__PURE__ */ (0,X.jsx)(xa,{level:va[t],look:n?`lit`:`quiet`}),/* @__PURE__ */ (0,X.jsxs)(`span`,{children:[/* @__PURE__ */ (0,X.jsx)(`b`,{className:`block text-body-sm font-medium text-fg-primary`,children:r.levels[t]}),/* @__PURE__ */ (0,X.jsx)(`small`,{className:`block text-caption leading-[1.4] text-fg-muted`,children:r.rows[t]})]}),/* @__PURE__ */ (0,X.jsx)(F,{"aria-hidden":`true`,className:V(`size-3.5 text-(--color-primary-text)`,!n&&`invisible`)})]},t)})}),r.footer!==null&&/* @__PURE__ */ (0,X.jsx)(`div`,{className:`mt-1 border-0 border-t border-solid border-(--color-border-light) px-2 pt-2 pb-1 text-caption text-fg-muted`,children:r.footer})]})}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:m})]})}function wa(){let{t:e}=H();return{name:e(`launchEffort.label`),note:null,levels:{normal:e(`launchEffort.levels.normal`),thinking:e(`launchEffort.levels.thinking`),max:e(`launchEffort.levels.max`)},rows:{normal:e(`launchEffort.lines.normal`),thinking:e(`launchEffort.lines.thinking`),max:e(`launchEffort.lines.max`)},footer:null,chipLabel:t=>e(`launchEffort.chipLabel`,{level:t})}}var Ta={explore_app:nr,find_bugs:Un,create_tests:$n,automate_scenarios:fr,run_scenarios:or};function Ea(e,t,n){return{type:`text`,inputMode:`url`,autoComplete:`off`,spellCheck:!1,value:e,onValueChange:t,disabled:n,"data-testid":`launch-address-input`}}function Da({state:e,disabled:t}){let{t:n}=wi(),r=e.scope===void 0;return/* @__PURE__ */ (0,X.jsx)(vt,{...Ea(e.value,e.setValue,t||r),label:n(`launchAddress.crawl.label`),placeholder:n(`launchAddress.crawl.placeholder`),...r?{hint:n(`launchAddress.crawl.loadingHint`)}:{}})}function Oa(e,t,n,r){let i=P(t);return n.kind===`create`?e.targets.create(i,{applicationId:Ne(n.pair.applicationId),environmentId:n.pair.environmentId,baseUrl:r}):e.targets.update(i,n.target.id,{baseUrl:r,expectedUpdatedAt:n.target.updatedAt})}function ka(e,t){return e(`launchAddress.pair`,{application:t.applicationName===null?e(`launchAddress.applicationGone`):t.applicationName,environment:t.environmentName===null?e(`launchAddress.environmentGone`):t.environmentName})}var Aa=`peer m-0 size-3.75 shrink-0 cursor-pointer appearance-none rounded-xs border-(length:--checkbox-border-width) border-solid border-stroke-strong bg-transparent [transition:background-color_var(--motion-short)_var(--ease-out),border-color_var(--motion-short)_var(--ease-out)] hover:not-checked:not-indeterminate:border-primary-400 group-hover/check:not-checked:not-indeterminate:border-primary-400 checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-stroke-focus disabled:cursor-not-allowed disabled:opacity-disabled`,ja=`pointer-events-none absolute size-2.75 scale-[.6] text-fg-on-accent opacity-0 [transition:opacity_var(--motion-short)_var(--ease-out),scale_var(--motion-medium)_var(--ease-out)]`;function Ma({checked:e,onChange:t,indeterminate:n=!1,disabled:r=!1,label:i,id:a,describedBy:o,...s}){let c=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{c.current!==null&&(c.current.indeterminate=n)});let l=/* @__PURE__ */ (0,X.jsxs)(`span`,{className:`relative inline-grid size-3.75 shrink-0 place-items-center`,children:[/* @__PURE__ */ (0,X.jsx)(`input`,{ref:c,type:`checkbox`,id:a,checked:e,disabled:r,"aria-checked":n?`mixed`:void 0,"aria-label":s[`aria-label`],"aria-describedby":o,"data-testid":s[`data-testid`],onChange:e=>t(e.target.checked),className:Aa}),n?/* @__PURE__ */ (0,X.jsx)(rr,{"aria-hidden":`true`,strokeWidth:3,className:V(ja,`peer-indeterminate:scale-100 peer-indeterminate:opacity-100`)}):/* @__PURE__ */ (0,X.jsx)(F,{"aria-hidden":`true`,strokeWidth:3,className:V(ja,`peer-checked:scale-100 peer-checked:opacity-100`)})]});return i===void 0?l:/* @__PURE__ */ (0,X.jsxs)(`label`,{className:V(`group/check inline-flex select-none items-center gap-2.5 text-body-sm text-fg-primary`,r?`cursor-not-allowed`:`cursor-pointer`),children:[l,i]})}function Na({checked:e,onChange:t,pairLabel:n,plan:r,disabled:i}){let{t:a}=H(),o=(0,Z.useId)(),s=e&&r.state===`ok`;return/* @__PURE__ */ (0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,"data-testid":`launch-address-save`,children:[/* @__PURE__ */ (0,X.jsx)(Ma,{checked:e,onChange:t,disabled:i,label:a(`launchAddress.saveAs`,{pair:n}),describedBy:s?o:void 0}),s&&/* @__PURE__ */ (0,X.jsxs)(`p`,{id:o,className:`flex items-center gap-1.5 pl-6 text-[length:var(--text-xs)] text-fg-secondary`,children:[/* @__PURE__ */ (0,X.jsx)(F,{size:12,className:`shrink-0 text-fg-success`,"aria-hidden":`true`}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:/* @__PURE__ */ (0,X.jsx)($e,{i18nKey:`launchAddress.willSaveAs`,values:{baseUrl:r.baseUrl},components:{mono:/* @__PURE__ */ (0,X.jsx)(`span`,{className:`font-mono text-fg-primary`})}})})]})]})}function Pa({projectId:e,cell:t,children:n,testId:r}){return/* @__PURE__ */ (0,X.jsx)(Xt,{target:{kind:`environment-addresses`,projectRef:P(e),...t===void 0?{}:{cell:{applicationId:t.applicationId,environmentId:t.environmentId}}},placement:`same-tab`,className:`rounded-(--radius-sm) font-medium text-fg-link underline-offset-2 hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/40`,"data-testid":r,children:n})}function Fa(e){let t=P(e),n=Wt({projectId:t},{previousErrorWhileRetrying:!0}),r=Oe({projectId:t},{previousErrorWhileRetrying:!0}),i=n.data,a=r.data,o=(0,Z.useMemo)(()=>i===void 0||a===void 0?void 0:{applications:i,targets:a},[i,a]),s=n.error===null?r.error:n.error,c=n.reload,l=r.reload,u=n.error!==null,d=r.error!==null;return{data:o,loading:o===void 0&&s===null&&(n.loading||r.loading),error:s,retrying:n.retrying||r.retrying,reload:()=>{let e=!u&&!d;(e||u)&&c(),(e||d)&&l()}}}function Ia(e,t,n,r){let i=e.applications.find(e=>e.id===n),a=t.find(e=>e.id===r);return{applicationId:n,environmentId:r,applicationName:i===void 0?null:i.name,environmentName:a===void 0?null:a.name}}function La(e,t,n){if(n.kind===`cell_missing`)return{kind:`create`,pair:Ia(e,t,n.applicationId,n.environmentId)};if(n.kind===`address_required`){let r=e.targets.find(e=>e.id===n.targetId);return r===void 0?null:{kind:`patch`,pair:Ia(e,t,r.applicationId,r.environmentId),target:r}}return null}function Ra({state:e,projectId:t,catalog:n,namesLoading:r,environments:i,disabled:a}){let o=wi(),{t:s}=o,c=Ea(e.value,e.setValue,a);if(e.refusal!==null&&e.refusal.kind===`not_configured`)return/* @__PURE__ */ (0,X.jsx)(z,{tone:`empty`,headingLevel:4,icon:/* @__PURE__ */ (0,X.jsx)(_e,{"aria-hidden":`true`}),title:s(`launchAddress.notConfigured.title`),description:s(`launchAddress.notConfigured.body`),primary:{label:s(`launchAddress.openAddresses`),render:/* @__PURE__ */ (0,X.jsx)(Xt,{target:{kind:`environment-addresses`,projectRef:P(t)},placement:`same-tab`,"data-testid":`launch-address-not-configured-link`})},"data-testid":`launch-address-not-configured`});if(e.isLoading||r)return/* @__PURE__ */ (0,X.jsx)(Ve,{className:`h-10 w-full`,label:s(`common.loading`)});let l=e.refusedCell;if(l!==null){let n=ka(s,l.pair);return/* @__PURE__ */ (0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-testid":`run-entry-url-missing`,children:[/* @__PURE__ */ (0,X.jsx)(vt,{...c,label:s(`runEntryUrl.labelFor`,{pair:n}),placeholder:s(`runEntryUrl.placeholder`),error:Ua(o,e),hint:Ha(s,l)}),/* @__PURE__ */ (0,X.jsx)(Na,{checked:e.saveChecked,onChange:e.setSaveChecked,pairLabel:n,plan:e.savePlan,disabled:a}),/* @__PURE__ */ (0,X.jsx)(`p`,{className:`text-[length:var(--text-xs)] text-fg-muted`,children:/* @__PURE__ */ (0,X.jsx)(Pa,{projectId:t,cell:{applicationId:l.pair.applicationId,environmentId:l.pair.environmentId},testId:`run-entry-url-open-cell`,children:s(`launchAddress.openCell`,{pair:n})})})]})}let u=e.defaultApplicationNote;if(u!==null)return/* @__PURE__ */ (0,X.jsx)(`div`,{className:`flex flex-col gap-2`,"data-testid":`run-entry-url-default-missing`,children:/* @__PURE__ */ (0,X.jsx)(vt,{...c,label:s(`runEntryUrl.labelFor`,{pair:ka(s,u.pair)}),placeholder:s(`runEntryUrl.placeholder`),hint:Va(s,u)})});let d=Ba(e,n,i);return/* @__PURE__ */ (0,X.jsx)(vt,{...c,label:d===null?s(`runEntryUrl.label`):s(`runEntryUrl.labelFor`,{pair:ka(s,d)}),placeholder:s(`runEntryUrl.placeholder`),error:e.read.status===`error`?ki(o,e.read.error,`runEntryUrl.errors.load`):void 0,hint:za(s,e,d)})}function za(e,t,n){return t.source===`scenario`&&t.read.status===`resolved`?e(`runEntryUrl.hintScenario`):n===null?t.refusal===null?e(`runEntryUrl.hintUnnamed`):e(t.refusal.kind===`cell_missing`?`apiErrors.targets.cell_missing`:`apiErrors.targets.address_required`):e(`runEntryUrl.hintBatch`,{application:n.applicationName===null?e(`launchAddress.applicationGone`):n.applicationName})}function Ba(e,t,n){if(e.read.status!==`resolved`||t===void 0||n===null)return null;let{applicationId:r,environmentId:i}=e.read.address;return Ia(t,n,r,i)}function Va(e,t){let n=t.pair.applicationName===null?e(`launchAddress.applicationGone`):t.pair.applicationName,r=t.pair.environmentName===null?e(`launchAddress.environmentGone`):t.pair.environmentName;return t.kind===`patch`&&t.target.hostPattern!==null?e(`launchAddress.defaultPatternOnly`,{application:n,environment:r,pattern:t.target.hostPattern}):e(`launchAddress.defaultMissing`,{application:n,environment:r})}function Ha(e,t){let n=t.pair.applicationName===null?e(`launchAddress.applicationGone`):t.pair.applicationName,r=t.pair.environmentName===null?e(`launchAddress.environmentGone`):t.pair.environmentName;return t.kind===`create`||t.target.hostPattern===null?e(`launchAddress.cellMissing`,{application:n,environment:r}):e(`launchAddress.addressRequired`,{application:n,environment:r,pattern:t.target.hostPattern})}function Ua(e,t){let{t:n}=e;if(t.saveError!==null)return ki(e,t.saveError,`launchAddress.errors.save`);if(t.saveChecked&&t.savePlan.state===`invalid`)return n(`environments.addresses.errors.baseUrl.${t.savePlan.reason}`)}var Wa={projectDefault:`agentRunDispatch.environmentHint`,concrete:`launchAddress.environment.variablesHint`},Ga={projectDefault:`agentRunDispatch.errors.environmentsLoad`,concrete:`launchAddress.environment.loadError`};function Ka({state:e,disabled:t,onAddressEdit:n}){let{t:r}=wi(),{environment:i,catalog:a,address:o,projectId:s}=e,c=e=>{o.setValue(e),n!==void 0&&n()},l=o.kind===`entryUrl`&&o.refusal!==null&&o.refusal.kind===`not_configured`,u=i.loadError!==null;return/* @__PURE__ */ (0,X.jsxs)(X.Fragment,{children:[/* @__PURE__ */ (0,X.jsx)(qa,{environment:i,disabled:t,loadErrorTitle:r(Ga[i.mode])}),/* @__PURE__ */ (0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a.error!==null&&!l&&/* @__PURE__ */ (0,X.jsx)(z,{tone:`error`,headingLevel:4,error:a.error,title:r(`launchAddress.errors.catalogLoad`),onRetry:a.reload,retrying:a.retrying}),o.kind===`crawlStart`&&o.scopeError!==null&&/* @__PURE__ */ (0,X.jsx)(z,{tone:`error`,headingLevel:4,error:o.scopeError,title:r(`launchAddress.crawl.scopeLoad`),onRetry:o.reloadScope,retrying:o.scopeRetrying}),o.kind===`crawlStart`?/* @__PURE__ */ (0,X.jsx)(Da,{state:{...o,setValue:c},disabled:t}):/* @__PURE__ */ (0,X.jsx)(Ra,{state:{...o,setValue:c},projectId:s,catalog:a.data,namesLoading:a.data===void 0&&a.error===null||i.environments===void 0&&!u,environments:i.environments===void 0?null:i.environments,disabled:t})]})]})}function qa({environment:e,disabled:t,loadErrorTitle:n}){let{t:r}=wi();return/* @__PURE__ */ (0,X.jsxs)(X.Fragment,{children:[e.loadError!==null&&/* @__PURE__ */ (0,X.jsx)(z,{tone:`error`,headingLevel:4,error:e.loadError,title:n,onRetry:e.reload,retrying:e.loadRetrying}),e.missingHint!==null&&/* @__PURE__ */ (0,X.jsx)(Pe,{tone:`warning`,title:e.missingHint}),e.shown&&/* @__PURE__ */ (0,X.jsx)(ae,{label:r(`agentRunDispatch.environmentLabel`),options:e.options,value:e.value,onValueChange:e.setValue,disabled:t,hint:r(Wa[e.mode]),"data-testid":`launch-environment`})]})}function Ja(){return/* @__PURE__ */ (0,X.jsx)(`span`,{className:de,"aria-hidden":`true`,children:/* @__PURE__ */ (0,X.jsx)(Rt,{})})}function Ya({icon:e,title:t,hint:n,checked:r,disabled:i=!1,onSelect:a,testId:o}){let s=(0,Z.useId)();return/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"aria-disabled":i||void 0,"aria-describedby":n===void 0?void 0:s,onClick:i?void 0:a,"data-testid":o,className:V(`flex w-full items-center gap-3 rounded-md border-0 bg-transparent px-3 py-2 text-left text-xs text-fg-primary`,`focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-stroke-focus`,i?`cursor-not-allowed opacity-(--opacity-inert)`:`cursor-pointer hover:bg-surface-hover-layer focus-visible:bg-surface-hover-layer`,r&&`bg-(--color-bg-primary-tint)`),children:[/* @__PURE__ */ (0,X.jsx)(e,{"aria-hidden":`true`,className:`size-4 shrink-0 text-fg-muted`}),/* @__PURE__ */ (0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,X.jsx)(`span`,{className:`block truncate`,children:t}),n!==void 0&&/* @__PURE__ */ (0,X.jsx)(`small`,{id:s,className:`block text-caption text-fg-muted`,children:n})]}),r&&/* @__PURE__ */ (0,X.jsx)(F,{"aria-hidden":`true`,className:`size-4 shrink-0 text-(--color-primary-text)`})]})}function Xa({children:e}){return/* @__PURE__ */ (0,X.jsx)(`div`,{className:`px-3 pt-2 pb-1 text-caption text-fg-muted`,children:e})}function Za(){return/* @__PURE__ */ (0,X.jsx)(`div`,{"aria-hidden":`true`,className:`my-1 h-px bg-stroke-light`})}function Qa({children:e}){return/* @__PURE__ */ (0,X.jsx)(`div`,{className:`px-3 py-2 text-xs text-fg-muted`,children:e})}function $a(e){try{return new URL(e).host}catch{return e}}function eo(e,t){try{return new URL(e).href===new URL(t).href}catch{return!1}}function to(e,t){if(t===null)return null;let n=e.find(e=>e.value===t);if(n===void 0)throw Error(`Environment ${t} is not among the picker's options`);return n.label}function no(e,t,n){let r=[];for(let i of e.applications)for(let a of t){let o=e.targets.find(e=>e.applicationId===i.id&&e.environmentId===a.id);if(o===void 0||o.baseUrl===null)continue;let s=Ia(e,t,i.id,a.id);r.push({targetId:o.id,environmentId:a.id,application:s.applicationName===null?n:s.applicationName,environment:a.name,url:o.baseUrl})}return r}function ro({state:e}){let{t}=H(),[n,i]=(0,Z.useState)(`closed`),{environment:a,address:o,catalog:s}=e.address,c=to(a.options,a.value),l=o.value.trim()===``,u=s.data===void 0||a.environments===void 0?null:no(s.data,a.environments,t(`launchAddress.applicationGone`)),d=u===null||l?void 0:u.find(e=>e.environmentId===a.value&&eo(e.url,o.value)),f=a.missingHint===null?a.loadError!==null||o.scopeError!==null?t(`launchAddress.environment.loadError`):a.environments===void 0||o.block===`unread`?t(`taskForm.address.loading`):d===void 0?c===null?$a(o.value):l?t(`taskForm.address.missing`,{environment:c}):t(`taskForm.address.pair`,{environment:c,host:$a(o.value)}):t(`taskForm.address.cell`,{application:d.application,environment:d.environment}):a.missingHint,p=e=>{a.setValue(e.environmentId),o.setValueFor(e.environmentId,e.url),i(`closed`)};return/* @__PURE__ */ (0,X.jsx)(ta,{side:`top`,collisionAvoidance:$,title:t(n===`custom`?`taskForm.address.panelLabel`:`taskForm.address.menuLabel`),open:n!==`closed`,onOpenChange:e=>i(e?`menu`:`closed`),trapFocus:!0,className:n===`custom`?`w-[420px] max-w-[calc(100vw-32px)] gap-3`:`w-[340px] max-w-[calc(100vw-32px)] p-1`,"data-testid":n===`custom`?`task-form-address-panel`:`task-form-address-menu`,trigger:/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,className:b(null),"aria-label":t(`taskForm.address.label`,{address:f}),disabled:e.held||e.locked===!0,"data-testid":`task-form-address`,children:[/* @__PURE__ */ (0,X.jsx)(_e,{"aria-hidden":`true`}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`truncate`,children:f}),/* @__PURE__ */ (0,X.jsx)(Ja,{})]}),children:n===`custom`?/* @__PURE__ */ (0,X.jsx)(`div`,{className:`flex flex-col gap-3`,children:/* @__PURE__ */ (0,X.jsx)(Ka,{state:e.address,disabled:e.held})}):/* @__PURE__ */ (0,X.jsxs)(`div`,{role:`radiogroup`,"aria-label":t(`taskForm.address.menuLabel`),className:`flex flex-col`,children:[a.loadError!==null||s.error!==null?/* @__PURE__ */ (0,X.jsx)(z,{tone:`error`,line:!0,...a.loadError===null?{error:s.error,title:t(`launchAddress.errors.catalogLoad`)}:{error:a.loadError,title:t(`launchAddress.environment.loadError`)},retrying:a.loadRetrying||s.retrying,onRetry:()=>{s.error!==null&&s.reload(),a.loadError!==null&&a.reload()}}):u===null?/* @__PURE__ */ (0,X.jsx)(Qa,{children:t(`taskForm.address.loading`)}):u.map(e=>/* @__PURE__ */ (0,X.jsx)(Ya,{icon:_e,title:t(`taskForm.address.cell`,{application:e.application,environment:e.environment}),hint:$a(e.url),checked:(d==null?void 0:d.targetId)===e.targetId,onSelect:()=>p(e),testId:`task-form-address-cell-${e.targetId}`},e.targetId)),/* @__PURE__ */ (0,X.jsx)(Za,{}),/* @__PURE__ */ (0,X.jsx)(Ya,{icon:r,title:t(`taskForm.address.custom`),checked:!1,onSelect:()=>i(`custom`),testId:`task-form-address-custom`})]})})}var io=`font-mono!`,ao=`bg-(--color-warning-bg)! text-fg-primary! shadow-[inset_0_0_0_1px_var(--color-border-warning)]! [&_svg]:text-(--color-warning-text)`;function oo({login:e,disabled:t}){let{t:n}=H(),{variables:r,chosen:i}=e,a=r.kind===`ready`?r.variables:[],o=new Set(a.map(e=>e.name)),s=r.kind===`ready`?i.filter(e=>!o.has(e)):[];return/* @__PURE__ */ (0,X.jsxs)(`div`,{role:`group`,"aria-label":n(`taskForm.login.label`),className:`flex flex-wrap items-center gap-1.5 text-caption text-fg-muted`,"data-testid":`task-form-login`,children:[/* @__PURE__ */ (0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 pr-1`,children:[/* @__PURE__ */ (0,X.jsx)(A,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),n(`taskForm.login.lead`)]}),r.kind===`no_environment`&&/* @__PURE__ */ (0,X.jsx)(z,{tone:`empty`,line:!0,icon:/* @__PURE__ */ (0,X.jsx)(_e,{"aria-hidden":`true`}),title:n(`taskForm.login.noEnvironment`)}),r.kind===`reading`&&/* @__PURE__ */ (0,X.jsx)(`span`,{children:n(`taskForm.login.reading`)}),r.kind===`failed`&&/* @__PURE__ */ (0,X.jsx)(z,{tone:`error`,headingLevel:4,className:`basis-full`,error:r.error,title:n(`taskForm.login.failed`),onRetry:r.retry,retrying:r.retrying}),r.kind===`ready`&&a.length===0&&s.length===0&&/* @__PURE__ */ (0,X.jsx)(z,{tone:`empty`,line:!0,icon:/* @__PURE__ */ (0,X.jsx)(dr,{"aria-hidden":`true`}),title:n(`taskForm.login.empty`)}),a.map(r=>{let a=i.includes(r.name);return/* @__PURE__ */ (0,X.jsxs)(gt,{pressed:a,disabled:t,onClick:()=>e.toggle(r.name,!a),"data-testid":`task-form-login-${r.name}`,className:io,children:[r.isSecret&&/* @__PURE__ */ (0,X.jsx)(oe,{"aria-label":n(`taskForm.login.secret`)}),r.name]},r.name)}),s.map(r=>/* @__PURE__ */ (0,X.jsxs)(gt,{pressed:!0,disabled:t,onClick:()=>e.toggle(r,!1),"data-testid":`task-form-login-gone-${r}`,icon:/* @__PURE__ */ (0,X.jsx)(U,{}),className:V(io,ao),children:[r,/* @__PURE__ */ (0,X.jsx)(`span`,{className:`sr-only`,children:n(`taskForm.login.gone`)})]},r))]})}var so={text:a,auto:fr};function co({value:e,onChange:t,disabled:n}){let{t:r}=H(),[i,o]=(0,Z.useState)(!1),s=r(e===null?`taskForm.scenarioKind.unset`:`taskForm.scenarioKind.short.${e}`),c=e===null?a:so[e];return/* @__PURE__ */ (0,X.jsx)(ta,{side:`top`,collisionAvoidance:$,title:r(`taskForm.scenarioKind.menuLabel`),open:i,onOpenChange:o,className:`w-[340px] max-w-[calc(100vw-32px)] p-1`,"data-testid":`task-form-scenario-kind-menu`,trigger:/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,className:b(e===null?`warning`:null),"aria-label":r(`taskForm.scenarioKind.label`,{kind:s}),disabled:n,"data-testid":`task-form-scenario-kind`,"data-unset":e===null||void 0,children:[/* @__PURE__ */ (0,X.jsx)(c,{"aria-hidden":`true`}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`truncate`,children:r(`taskForm.scenarioKind.chip`,{kind:s})}),/* @__PURE__ */ (0,X.jsx)(Ja,{})]}),children:/* @__PURE__ */ (0,X.jsx)(`div`,{role:`radiogroup`,"aria-label":r(`taskForm.scenarioKind.menuLabel`),className:`flex flex-col`,children:vn.map(n=>/* @__PURE__ */ (0,X.jsx)(Ya,{icon:so[n],title:r(`taskForm.scenarioKind.items.${n}`),hint:r(`taskForm.scenarioKind.hints.${n}`),checked:e===n,onSelect:()=>{t(n),o(!1)},testId:`task-form-scenario-kind-${n}`},n))})})}function lo({mode:e,className:t}){switch(e){case`observe`:return/* @__PURE__ */ (0,X.jsx)(Me,{"aria-hidden":`true`,className:t});case`main`:return/* @__PURE__ */ (0,X.jsx)(ir,{"aria-hidden":`true`,className:t});case`dangerous`:return/* @__PURE__ */ (0,X.jsx)(U,{"aria-hidden":`true`,className:t})}}function uo({allowed:e,onToggle:t,disabled:n,captureApi:r,site:i}){let{t:a}=H(),o=e.map(e=>a(`taskForm.allow.short.${e}`)).join(`, `),s=i===null?e.length===0?a(`taskForm.allow.projectOnlyNone`):a(`taskForm.allow.projectOnly`,{list:o}):a(`taskForm.allow.chip`,{site:i.value===null?a(`taskForm.site.unset`):a(`taskForm.site.chip.${i.value}`),project:e.length===0?a(`taskForm.allow.projectNone`):a(`taskForm.allow.project`,{list:o})}),c=i!==null&&i.value===`dangerous`,l=i!==null&&i.value===null||r!==null&&r.checked===null;return/* @__PURE__ */ (0,X.jsxs)(Mt,{label:a(`taskForm.allow.menuName`),side:`top`,className:`w-[360px] max-w-[calc(100vw-16px)]`,matchTriggerWidth:!1,trigger:/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,disabled:n,"data-testid":`task-form-allow`,"data-site":i===null||i.value===null?void 0:i.value,"data-unset":l||void 0,className:`${b(c?`error`:l?`warning`:null)} whitespace-nowrap`,children:[c?/* @__PURE__ */ (0,X.jsx)(U,{"aria-hidden":`true`}):/* @__PURE__ */ (0,X.jsx)(oe,{"aria-hidden":`true`}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`truncate`,children:s}),/* @__PURE__ */ (0,X.jsx)(Ja,{})]}),children:[i!==null&&/* @__PURE__ */ (0,X.jsxs)(X.Fragment,{children:[/* @__PURE__ */ (0,X.jsx)(Ze,{label:a(`taskForm.site.menuLabel`),children:/* @__PURE__ */ (0,X.jsx)(et,{value:i.value,onValueChange:i.onChange,children:yn.map(e=>/* @__PURE__ */ (0,X.jsx)(at,{value:e,label:a(`taskForm.site.menu.${e}`),hint:a(`taskForm.site.hints.${e}`),icon:/* @__PURE__ */ (0,X.jsx)(lo,{mode:e}),...e===`dangerous`?{tone:`danger`}:{},keepOpen:!0,"data-testid":`task-form-site-${e}`},e))})}),c&&/* @__PURE__ */ (0,X.jsx)(fo,{lead:a(`taskForm.site.warnMenuLead`),className:`mx-1 mt-1 mb-2`,children:a(`taskForm.site.warnMenu`)}),/* @__PURE__ */ (0,X.jsx)(Ft,{})]}),/* @__PURE__ */ (0,X.jsx)(Ze,{label:a(`taskForm.allow.menuLabel`),children:xn.map(n=>/* @__PURE__ */ (0,X.jsx)(Ht,{label:a(`taskForm.allow.items.${n}`),hint:a(`taskForm.allow.hints.${n}`),checked:e.includes(n),onCheckedChange:e=>t(n,e),"data-testid":`task-form-allow-${n}`},n))}),r!==null&&/* @__PURE__ */ (0,X.jsxs)(X.Fragment,{children:[/* @__PURE__ */ (0,X.jsx)(Ft,{}),r.checked===null?/* @__PURE__ */ (0,X.jsx)(Ze,{label:a(`taskForm.allow.captureApiAsk`),children:/* @__PURE__ */ (0,X.jsxs)(et,{value:null,onValueChange:e=>r.onCheckedChange(e===`record`),children:[/* @__PURE__ */ (0,X.jsx)(at,{value:`record`,label:a(`taskForm.allow.captureApiRecord`),hint:a(`taskForm.allow.captureApiHint`),keepOpen:!0,"data-testid":`task-form-capture-api-record`}),/* @__PURE__ */ (0,X.jsx)(at,{value:`skip`,label:a(`taskForm.allow.captureApiSkip`),keepOpen:!0,"data-testid":`task-form-capture-api-skip`})]})}):/* @__PURE__ */ (0,X.jsx)(Ht,{label:a(`taskForm.allow.captureApi`),hint:a(`taskForm.allow.captureApiHint`),checked:r.checked,onCheckedChange:r.onCheckedChange,"data-testid":`task-form-capture-api`})]}),/* @__PURE__ */ (0,X.jsx)(Kt,{icon:/* @__PURE__ */ (0,X.jsx)(ur,{}),children:a(`taskForm.allow.deleteAlwaysAsks`)})]})}function fo({lead:e,children:t,className:n,"data-testid":r}){return/* @__PURE__ */ (0,X.jsxs)(`p`,{role:`note`,className:V(`m-0 flex items-center gap-2 rounded-md border border-solid border-(--color-border-error-soft) bg-(--color-bg-error-tint-subtle) px-3 py-2 text-xs text-fg-primary animate-(--animation-alert-in) motion-reduce:animate-none`,n),"data-testid":r,children:[/* @__PURE__ */ (0,X.jsx)(U,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-(--color-error-text)`}),/* @__PURE__ */ (0,X.jsxs)(`span`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,X.jsx)(`b`,{className:`font-semibold text-(--color-error-text)`,children:e}),` `,t]})]})}var po=[`ask`,`bypass`],mo={ask:_t,bypass:F};function ho({value:e,onChange:t,disabled:n,failed:r=!1,onRetry:i}){let{t:a}=H();if(e===null)return/* @__PURE__ */ (0,X.jsx)(`button`,{type:`button`,className:b(null),disabled:!r,onClick:r?i:void 0,children:a(r?`taskForm.mode.readFailed`:`taskForm.mode.reading`)});let o=mo[e];return/* @__PURE__ */ (0,X.jsx)(Mt,{label:a(`taskForm.mode.menuLabel`),side:`top`,className:`w-[300px]`,matchTriggerWidth:!1,trigger:/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,disabled:n,"aria-label":a(`taskForm.mode.chipLabel`,{mode:a(`taskForm.mode.${e}`)}),"data-testid":`task-form-mode`,"data-mode":e,className:`${b(null)} whitespace-nowrap`,children:[/* @__PURE__ */ (0,X.jsx)(o,{"aria-hidden":`true`}),a(`taskForm.mode.${e}`),/* @__PURE__ */ (0,X.jsx)(Ja,{})]}),children:/* @__PURE__ */ (0,X.jsx)(et,{value:e,onValueChange:t,children:po.map(e=>{let t=mo[e];return/* @__PURE__ */ (0,X.jsx)(at,{value:e,label:a(`taskForm.mode.${e}`),hint:a(`taskForm.mode.hints.${e}`),icon:/* @__PURE__ */ (0,X.jsx)(t,{}),"data-testid":`task-form-mode-${e}`},e)})})})}function go({value:e,onValueChange:t,clearLabel:n,count:r,size:i=`md`,trailing:a,className:s,ref:c,...l}){let u=(0,Z.useRef)(null),d=Ke();(0,Z.useEffect)(()=>{let e=u.current;if(d!==null&&e!==null)return d.registerSearch(e)},[d]);let f=e!==``,m=()=>{var e;t(``),(e=u.current)==null||e.focus()};return/* @__PURE__ */ (0,X.jsxs)(`div`,{className:V(un,o[i],s),children:[/* @__PURE__ */ (0,X.jsx)(`span`,{className:se,children:/* @__PURE__ */ (0,X.jsx)(p,{"aria-hidden":`true`})}),/* @__PURE__ */ (0,X.jsx)(`input`,{ref:e=>{u.current=e,typeof c==`function`?c(e):c&&(c.current=e)},type:`search`,value:e,onChange:e=>t(e.target.value),className:V(fe,`[&::-webkit-search-cancel-button]:appearance-none`),...l}),f&&r!==void 0&&/* @__PURE__ */ (0,X.jsx)(`span`,{className:`shrink-0 text-xs tabular-nums text-fg-muted`,children:r}),f&&/* @__PURE__ */ (0,X.jsx)(Be,{relationship:`label`,content:n,children:/* @__PURE__ */ (0,X.jsx)(`button`,{type:`button`,className:_o,onClick:m,children:/* @__PURE__ */ (0,X.jsx)(xe,{"aria-hidden":`true`})})}),a]})}var _o=`grid size-5.5 shrink-0 cursor-pointer place-items-center rounded-full border-0 bg-transparent p-0 -mr-1.5 text-fg-muted [transition:background-color_var(--motion-instant)_var(--ease-out),color_var(--motion-instant)_var(--ease-out)] hover:bg-surface-hover-layer hover:text-fg-primary focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-stroke-focus [&_svg]:size-3`,vo={kind:`project`};function yo(e){switch(e.kind){case`project`:return{kind:`project`};case`scenarios`:return{kind:`scenarios`,scenarioIds:[...e.scenarioIds]};case`test_run`:return{kind:`test_run`,testRunId:e.testRunId};case`test_plan`:return{kind:`test_plan`,testPlanId:e.testPlanId}}}function bo(e){let[t,...n]=e;return t===void 0?null:{kind:`scenarios`,scenarioIds:[t.id,...n.map(e=>e.id)],firstName:t.name,names:new Map(e.map(e=>[e.id,e.name]))}}function xo(e){return{kind:`scenarios`,scenarioIds:e,firstName:null,names:/* @__PURE__ */ new Map}}function So(e,t){if(t===null||t.kind!==e.kind)throw Error(`Task scope: scope label ${t===null?`null`:t.kind} does not name scope ${e.kind}`);switch(e.kind){case`project`:return{kind:`project`};case`scenarios`:{let[t,...n]=e.scenarioIds;if(t===void 0)throw Error(`Task scope: a scenarios scope without scenarios`);return xo([t,...n])}case`test_run`:if(t.kind!==`test_run`)throw Error(`unreachable: label kind checked above`);return{kind:`test_run`,testRunId:e.testRunId,run:{number:t.number,name:t.name}};case`test_plan`:if(t.kind!==`test_plan`)throw Error(`unreachable: label kind checked above`);return{kind:`test_plan`,testPlanId:e.testPlanId,planName:t.name}}}function Co(e,t){let n=e.resultsWriter;return n===null?{kind:`nobody`}:n.userId===t?{kind:`mine`,relation:e.testPlanId===null?`free`:`plan`}:{kind:`other`,writer:n.userDisplayName===null?n.userEmail:n.userDisplayName}}function wo(e){return e.data===void 0?e.error===null?{status:`loading`}:{status:`failed`,error:e.error,retry:()=>void e.reload(),retrying:e.retrying}:{status:`ready`,items:e.data.items,total:e.data.total}}function To(e,t,n){let r=C(),i=(0,Z.useDeferredValue)(t.trim()),a={kind:`project`,projectId:P(e)},o=he({projectId:a.projectId,query:{launchKind:`test_run`,status:`in_progress`,limit:50,offset:0,...i===``?{}:{search:i}}},{enabled:n,previousDataWhileLoading:!0,previousErrorWhileRetrying:!0}),s=o.data,c={data:(0,Z.useMemo)(()=>s===void 0?void 0:{items:s.items.filter(e=>e.kind===`run`),total:s.total},[s]),error:o.error,retrying:o.retrying,reload:o.reload},l=wt({key:rt(a,`assigned-plans`,{state:`unfinished`,pages:`all`}),read:async t=>{let n=await zn(t=>r.assignedPlans.list(e,{state:`unfinished`,...t}),t,{pageSize:500,route:`GET /test-plans/project/:id/assigned-to-me`});return{items:n,total:n.length}},freshness:`screen`,enabled:n,previousErrorWhileRetrying:!0});return{runs:wo(c),plans:wo(l)}}async function Eo(e,t,n){let[r]=(await e.testRuns.listUnified({projectId:t,launchKind:`test_run`,status:`in_progress`,resultsWriter:`me`,limit:1},{signal:n})).items;if(r===void 0)return null;if(r.kind!==`run`)throw Error(`W10 in_progress test runs answered a row of kind ${r.kind}`);return r}var Do={project:x,scenarios:er,test_run:Gn,test_plan:$n};function Oo({state:e,viewerId:t,scenarioPicker:n}){let{t:r}=H(),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(null),{scope:u,scopeRequest:d}=e,f=d===`scenarios`&&n!==null,p=i||d!==null&&!f,m=o||f,h=()=>{a(!1),e.clearScopeRequest()},g=()=>{s(!1),e.clearScopeRequest()},_=No(u,r),v=Do[u.kind];return/* @__PURE__ */ (0,X.jsxs)(X.Fragment,{children:[/* @__PURE__ */ (0,X.jsx)(ta,{side:`top`,collisionAvoidance:$,title:r(`taskForm.scope.menuLabel`),description:d===null?void 0:r(`taskForm.scope.suggested`),open:p,onOpenChange:e=>{e?(m&&g(),a(!0)):h()},className:`w-[380px] max-w-[calc(100vw-32px)] p-1`,"data-testid":`task-form-scope-menu`,trigger:/* @__PURE__ */ (0,X.jsxs)(`button`,{ref:l,type:`button`,className:e.scopeSuggested?`${b(`primary`)} animate-(--animation-scope-suggest) motion-reduce:animate-none`:b(null),"aria-label":r(`taskForm.scope.label`,{scope:_.text}),disabled:e.held||e.locked===!0,"data-testid":`task-form-scope`,children:[/* @__PURE__ */ (0,X.jsx)(v,{"aria-hidden":`true`}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`truncate`,children:_.text}),_.detail!==null&&/* @__PURE__ */ (0,X.jsx)(`em`,{className:`truncate text-fg-muted not-italic`,children:_.detail}),/* @__PURE__ */ (0,X.jsx)(Ja,{})]}),children:p&&/* @__PURE__ */ (0,X.jsx)(ko,{state:e,viewerId:t,offerScenarios:n!==null,onPicked:h,onScenarios:()=>{h(),s(!0)}})}),n!==null&&c!==null&&/* @__PURE__ */ (0,X.jsx)(ta,{anchor:c,open:m,onOpenChange:e=>{e||g()},side:`top`,collisionAvoidance:$,title:r(`taskForm.scope.scenariosListLabel`),titleVisible:!1,className:`w-[400px] max-w-[calc(100vw-32px)] p-1`,"data-testid":`task-form-scenario-list`,children:m&&n({onPick:t=>{let n=bo(t);n!==null&&e.setScope(n),g()}})})]})}function ko({state:e,viewerId:t,offerScenarios:n,onPicked:r,onScenarios:i}){let{t:a}=H(),[o,s]=(0,Z.useState)(``),c=(0,Z.useRef)(null),l=To(e.projectId,o,!0),{scope:u}=e,d=t=>{e.setScope(t),r()};return/* @__PURE__ */ (0,X.jsxs)(`div`,{role:`radiogroup`,"aria-label":a(`taskForm.scope.menuLabel`),className:`flex flex-col`,children:[/* @__PURE__ */ (0,X.jsx)(Ya,{icon:x,title:a(`taskForm.scope.project`),checked:u.kind===`project`,onSelect:()=>d({kind:`project`}),testId:`task-form-scope-project`}),n&&/* @__PURE__ */ (0,X.jsx)(Ya,{icon:er,title:a(`taskForm.scope.scenariosPick`),hint:a(`taskForm.scope.scenariosPickHint`),checked:u.kind===`scenarios`,onSelect:i,testId:`task-form-scope-scenarios`}),/* @__PURE__ */ (0,X.jsx)(Za,{}),/* @__PURE__ */ (0,X.jsx)(Xa,{children:a(`taskForm.scope.runsHeader`)}),/* @__PURE__ */ (0,X.jsx)(`div`,{className:`px-2 pb-1`,children:/* @__PURE__ */ (0,X.jsx)(go,{ref:c,value:o,onValueChange:s,"aria-label":a(`taskForm.scope.runsSearch`),placeholder:a(`taskForm.scope.runsSearch`),clearLabel:a(`taskForm.scope.runsSearchClear`),size:`sm`})}),/* @__PURE__ */ (0,X.jsx)(Ao,{list:l.runs,failedTitle:a(`taskForm.scope.runsLoadError`),empty:{icon:Gn,title:a(`taskForm.scope.runsEmpty`)},nothing:o.trim()===``?null:{title:a(`taskForm.scope.runsNoMatch`),onReset:()=>{var e;s(``),(e=c.current)==null||e.focus()}},render:e=>{let n=Co(e,t),r=jo(e);return/* @__PURE__ */ (0,X.jsx)(Ya,{icon:n.kind===`mine`?Gn:oe,title:Mo(r,a),hint:n.kind===`mine`?n.relation===`free`?a(`taskForm.scope.runMine`):a(`taskForm.scope.runAssigned`):n.kind===`other`?a(`taskForm.scope.runForbidden`,{name:n.writer}):a(`taskForm.scope.runForbiddenNobody`),disabled:n.kind!==`mine`,checked:u.kind===`test_run`&&u.testRunId===e.id,onSelect:()=>d({kind:`test_run`,testRunId:e.id,run:r}),testId:`task-form-scope-run-${e.id}`},e.id)}}),/* @__PURE__ */ (0,X.jsx)(Za,{}),/* @__PURE__ */ (0,X.jsx)(Xa,{children:a(`taskForm.scope.plansHeader`)}),/* @__PURE__ */ (0,X.jsx)(Ao,{list:l.plans,failedTitle:a(`taskForm.scope.plansLoadError`),empty:{icon:$n,title:a(`taskForm.scope.plansEmpty`)},nothing:null,render:e=>/* @__PURE__ */ (0,X.jsx)(Ya,{icon:$n,title:e.planName,hint:a(`taskForm.scope.planHint`),checked:u.kind===`test_plan`&&u.testPlanId===e.planId,onSelect:()=>d({kind:`test_plan`,testPlanId:e.planId,planName:e.planName}),testId:`task-form-scope-plan-${e.planId}`},e.planId)})]})}function Ao({list:e,failedTitle:t,empty:n,nothing:r,render:i}){let{t:a}=H();if(e.status===`loading`)return/* @__PURE__ */ (0,X.jsx)(Qa,{children:a(`taskForm.scope.loading`)});if(e.status===`failed`)return/* @__PURE__ */ (0,X.jsx)(z,{tone:`error`,line:!0,error:e.error,title:t,onRetry:e.retry,retrying:e.retrying});if(e.items.length===0){if(r!==null)return/* @__PURE__ */ (0,X.jsx)(z,{tone:`nothing`,line:!0,title:r.title,reset:{onReset:r.onReset}});let e=n.icon;return/* @__PURE__ */ (0,X.jsx)(z,{tone:`empty`,line:!0,icon:/* @__PURE__ */ (0,X.jsx)(e,{"aria-hidden":`true`}),title:n.title})}let o=e.total-e.items.length;return/* @__PURE__ */ (0,X.jsxs)(`div`,{className:`flex max-h-56 flex-col overflow-y-auto`,children:[e.items.map(i),o>0&&/* @__PURE__ */ (0,X.jsx)(Qa,{children:a(`taskForm.scope.more`,{count:o})})]})}function jo(e){return{number:e.number,name:e.name}}function Mo(e,t){return`${t(`taskForm.scope.runNumber`,{number:String(e.number).padStart(3,`0`)})} \u00B7 ${e.name===null?t(`taskForm.scope.runUntitled`):e.name}`}function No(e,t){switch(e.kind){case`project`:return{text:t(`taskForm.scope.project`),detail:null};case`scenarios`:{let n=e.scenarioIds.length;return{text:t(`taskForm.scope.scenarios`,{count:n}),detail:e.firstName===null?null:n===1?t(`taskForm.scope.scenariosFirst`,{name:e.firstName}):t(`taskForm.scope.scenariosMore`,{name:e.firstName,count:n-1})}}case`test_run`:return{text:t(`taskForm.scope.testRun`,{name:Mo(e.run,t)}),detail:null};case`test_plan`:return{text:t(`taskForm.scope.testPlan`,{name:e.planName}),detail:null}}}function Po({state:e,variant:t,viewerId:n,scenarioPicker:r,launchSlot:i,notice:a,launchLabel:o,launchBlockedReason:s,"data-testid":l}){let{t:u}=H(),{navigation:d}=Qt(),{locale:f}=e,p=Jt[f].shell.composer,m={...wa(),rows:{normal:u(`taskForm.effortRows.normal`),thinking:u(`taskForm.effortRows.thinking`),max:u(`taskForm.effortRows.max`)}},h=(0,Z.useId)(),g=(0,Z.useRef)(null),_=(0,Z.useCallback)(()=>{let e=g.current;e!==null&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight+2}px`)},[]);(0,Z.useLayoutEffect)(_,[_,e.draft.brief]),(0,Z.useEffect)(()=>(window.addEventListener(`resize`,_),()=>window.removeEventListener(`resize`,_)),[_]);let v=t===`inline`,y=t!==`dialog`,b=e.submitting,x=e.draft.allowedChanges.includes(`write_tests`),{questions:C}=e,w=e.held,T=e.locked===!0,E=w||T,D=t=>{T||t.key===`Enter`&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e.launch())},O=s===void 0?null:s,k=O===null?e.blocked===null?null:e.blocked===`environment`?e.address.environment.missingHint:u(`taskForm.blocked.${e.blocked}`):O;return/* @__PURE__ */ (0,X.jsxs)(`div`,{className:V(`relative flex flex-col`,t===`card`&&`min-h-0 flex-1`,v&&`rounded-2xl border border-solid border-stroke-hover bg-surface-card shadow-(--shadow-lg)`),...v?{role:`region`,"aria-label":u(`taskForm.title`)}:{},"aria-busy":b||void 0,"data-testid":l,children:[/* @__PURE__ */ (0,X.jsxs)(`div`,{className:V(`relative flex flex-col`,y?`px-4 pt-4 pb-3`:`px-6 pt-4 pb-5`,t===`card`&&`min-h-0 flex-1 overflow-y-auto [scrollbar-width:thin]`),inert:b,children:[/* @__PURE__ */ (0,X.jsxs)(`div`,{className:V(S,`flex-col`,T?ve:j),children:[/* @__PURE__ */ (0,X.jsx)(`label`,{htmlFor:h,className:`sr-only`,children:u(`taskForm.briefLabel`)}),/* @__PURE__ */ (0,X.jsx)(`textarea`,{ref:g,id:h,value:e.draft.brief,onChange:t=>e.setBrief(t.target.value),onBlur:e.commitBrief,onKeyDown:D,placeholder:u(`taskForm.placeholder`),disabled:w,readOnly:T,className:V(`block w-full resize-none border-0 bg-transparent px-4 pt-4 pb-0 font-sans text-[length:var(--text-body-md)] leading-[1.6] tracking-control whitespace-pre-wrap text-fg-primary outline-none placeholder:text-fg-muted`,v?`min-h-[72px]`:`min-h-24`),"data-testid":`task-form-brief`}),/* @__PURE__ */ (0,X.jsx)(`div`,{role:`group`,"aria-label":u(`taskForm.chipsLabel`),className:`flex flex-wrap gap-1.5 px-3 pb-3`,children:c.filter(t=>!T||e.draft.presetId===t).map(t=>/* @__PURE__ */ (0,X.jsx)(Io,{id:t,locale:f,pressed:e.draft.presetId===t,disabled:E,onPress:()=>e.pressChip(t)},t))})]}),C.brief!==void 0&&/* @__PURE__ */ (0,X.jsx)(Fo,{field:`brief`,text:C.brief}),/* @__PURE__ */ (0,X.jsxs)(lt,{className:`mt-3 flex flex-wrap gap-2`,children:[/* @__PURE__ */ (0,X.jsx)(Oo,{state:e,viewerId:n,scenarioPicker:r}),e.withBrowser&&/* @__PURE__ */ (0,X.jsx)(ro,{state:e}),x&&/* @__PURE__ */ (0,X.jsx)(co,{value:e.draft.newScenarioKind,onChange:e.setScenarioKind,disabled:w})]}),e.login!==null&&e.login.variables.kind!==`environment_unknown`&&/* @__PURE__ */ (0,X.jsx)(`div`,{className:`mt-2`,children:/* @__PURE__ */ (0,X.jsx)(oo,{login:e.login,disabled:E})}),e.headful!==null&&/* @__PURE__ */ (0,X.jsx)(tn,{className:`mt-3 self-start`,checked:e.headful.value,onChange:e.headful.set,disabled:E,label:u(`taskForm.headful.label`),hint:u(`taskForm.headful.hint`),"data-testid":`task-form-headful`}),C.entryUrl!==void 0&&e.withBrowser&&/* @__PURE__ */ (0,X.jsx)(Fo,{field:`entryUrl`,text:C.entryUrl}),C.newScenarioKind!==void 0&&x&&/* @__PURE__ */ (0,X.jsx)(Fo,{field:`newScenarioKind`,text:C.newScenarioKind}),e.scopeSuggested&&/* @__PURE__ */ (0,X.jsxs)(`p`,{role:`status`,className:`mt-2 mb-0 flex items-center gap-1.5 text-caption text-fg-muted`,"data-testid":`task-form-scope-suggested`,children:[/* @__PURE__ */ (0,X.jsx)(Ee,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-(--color-primary-text)`}),u(`taskForm.scope.suggestedByChip`)]}),e.admissions!==null&&/* @__PURE__ */ (0,X.jsx)(ha,{admissions:e.admissions,className:`mt-4`,"data-testid":`task-form-admissions`}),e.draft.standMode===`dangerous`&&/* @__PURE__ */ (0,X.jsx)(fo,{lead:u(`taskForm.site.warnFieldLead`),className:`mt-4`,"data-testid":`task-form-site-warning`,children:u(`taskForm.site.warnField`)}),!e.withBrowser&&/* @__PURE__ */ (0,X.jsxs)(`p`,{className:`mt-4 mb-0 flex items-center gap-2 rounded-md bg-surface-hover-layer px-3 py-2 text-xs text-fg-secondary`,"data-testid":`task-form-no-browser`,children:[/* @__PURE__ */ (0,X.jsx)(Kn,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-fg-muted`}),u(`taskForm.noBrowser`)]}),C.standMode!==void 0&&/* @__PURE__ */ (0,X.jsx)(Fo,{field:`standMode`,text:C.standMode}),C.captureApi!==void 0&&e.withBrowser&&/* @__PURE__ */ (0,X.jsx)(Fo,{field:`captureApi`,text:C.captureApi}),e.error!==null&&/* @__PURE__ */ (0,X.jsx)(Ro,{error:e.error,locale:f,onAction:t=>t===`addresses`?d.openInWeb({kind:`environment-addresses`,projectRef:P(e.projectId)},`new-tab`):d.openInWeb({kind:`ai-settings`},`new-tab`)}),a!==void 0&&/* @__PURE__ */ (0,X.jsx)(`div`,{className:`mt-4`,children:a})]}),/* @__PURE__ */ (0,X.jsxs)(lt,{className:V(`relative flex flex-none flex-wrap items-center gap-2 border-t border-solid border-stroke-light py-3 pr-4`,t===`card`||y?`pl-4`:`pl-6`),children:[/* @__PURE__ */ (0,X.jsx)(la,{place:e.place.place,view:e.place.view,fleet:e.place.fleet,onChoose:e.choosePlace,onOpen:e.place.reloadFleet,copy:p.place,heading:!1,thisBrowserReach:`opens_windows`,look:`tile`,disabled:E}),/* @__PURE__ */ (0,X.jsx)(Ca,{effort:e.effort.value,onChoose:e.effort.choose,copy:m,look:`tile`,disabled:E||e.effort.locked}),e.mode!==null&&/* @__PURE__ */ (0,X.jsx)(ho,{value:e.mode.value,onChange:e.mode.set,disabled:E,failed:e.mode.failed,onRetry:e.mode.retry}),/* @__PURE__ */ (0,X.jsx)(uo,{allowed:e.draft.allowedChanges,onToggle:e.setAllowed,disabled:E,captureApi:e.withBrowser?{checked:e.draft.captureApi,onCheckedChange:e.setCaptureApi}:null,site:{value:e.draft.standMode,onChange:e.setStandMode}}),/* @__PURE__ */ (0,X.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[i,/* @__PURE__ */ (0,X.jsx)(an,{disabled:k!==null,reason:k===null?``:k,children:/* @__PURE__ */ (0,X.jsx)(xt,{type:`button`,variant:`primary`,size:`md`,className:`h-10! rounded-lg! px-5! text-body-sm!`,icon:/* @__PURE__ */ (0,X.jsx)(or,{"aria-hidden":`true`}),loading:b,loadingLabel:u(`taskForm.launching`),onClick:()=>{O===null&&e.launch()},onKeyDown:e=>{T&&e.key===`Enter`&&e.preventDefault()},"data-testid":`task-form-launch`,children:o===void 0?u(`taskForm.launch`):o})})]})]})]})}function Fo({field:e,text:t}){return/* @__PURE__ */ (0,X.jsxs)(`p`,{className:`mt-2 mb-0 flex items-start gap-1.5 text-caption text-fg-secondary`,"data-testid":`task-form-question-${e}`,children:[/* @__PURE__ */ (0,X.jsx)(Wn,{"aria-hidden":`true`,className:`mt-px size-[13px] shrink-0 text-(--color-warning-text)`}),t]})}function Io({id:e,locale:t,pressed:n,disabled:r,onPress:i}){let a=Ta[e],o=h(e);return/* @__PURE__ */ (0,X.jsx)(gt,{pressed:n,disabled:r,onClick:i,icon:/* @__PURE__ */ (0,X.jsx)(a,{}),"data-testid":`task-form-chip-${e}`,children:o.title[t]})}function Lo(e,t){let[n,r]=Array.from(e);if(n===void 0||r===void 0)return e;let i=n.toLocaleLowerCase(t),a=r!==r.toLocaleUpperCase(t);return i!==n&&a?`${i}${e.slice(n.length)}`:e}function Ro({error:e,locale:t,onAction:n}){let{t:r}=H(),i=e.kind===`unknown`?null:e.action;return/* @__PURE__ */ (0,X.jsxs)(`p`,{role:`alert`,className:`mt-4 mb-0 flex items-center gap-3 rounded-md border border-solid border-(--color-border-error-soft) bg-(--color-bg-error-tint-subtle) p-3 text-xs text-fg-primary animate-(--animation-alert-in) motion-reduce:animate-none`,"data-testid":`task-form-error`,children:[/* @__PURE__ */ (0,X.jsx)(U,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-(--color-error-text)`}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:e.kind===`refused`?r(`taskForm.errors.notStarted`,{reason:Lo(e.reason,t)}):e.kind===`host_not_recorded`?/* @__PURE__ */ (0,X.jsx)($e,{i18nKey:`taskForm.errors.hostNotRecorded`,values:{host:e.host,environment:e.environmentName},components:{mono:/* @__PURE__ */ (0,X.jsx)(`span`,{className:`font-mono`})}}):e.text}),i!==null&&/* @__PURE__ */ (0,X.jsx)(xt,{type:`button`,variant:`secondary`,size:`sm`,className:`ml-auto shrink-0`,onClick:()=>n(i),"data-testid":`task-form-error-action`,children:r(`taskForm.errors.action.${i}`)})]})}var zo={brief:``,presetId:`custom`,allowedChanges:[],newScenarioKind:null,captureApi:!1,standMode:Sn},Bo={scope:null,placeToOpening:!1};function Vo(e){return e.trim()===``||Se(e)}function Ho(e,t){let{chip:n}=h(e);if(n===null)throw Error(`Preset ${e} is in PRESET_CHIP_ORDER but has no chip`);return n.briefTemplate[t]}function Uo(e){let t=h(e).defaultAllowedChanges;if(t===null)throw Error(`Preset ${e} is a chip but has no \u00AB\u041C\u043E\u0436\u043D\u043E\u00BB defaults`);return xn.filter(e=>t.includes(e))}function Wo(e,t,n){if(e.presetId===t)return{draft:{...e,presetId:`custom`},effects:Bo};let r=h(t),i=Vo(e.brief)?Ho(t,n.locale):e.brief,a=Uo(t);return{draft:{brief:i,presetId:t,allowedChanges:a,newScenarioKind:Ko(a,e.newScenarioKind),captureApi:r.defaultCaptureApi,standMode:e.standMode},effects:{scope:n.scopeKind===`project`?Go(r.suggestedScopeKinds):null,placeToOpening:n.placeIsNone&&r.browserSuggested}}}function Go(e){let[t]=e;return t===`project`||e.includes(`project`)?null:t===`test_run`?{kind:`latest_test_run`}:{kind:`open`,on:t}}function Ko(e,t){return e.includes(`write_tests`)?t:null}function qo(e,t){return e.standMode===null||t&&e.captureApi===null}function Jo(e){return e.environment.missing?`environment`:e.environment.body===null||e.address.block===`unread`?`loading`:null}function Yo(e,t,n){let r=new Set(e.allowedChanges);n?r.add(t):r.delete(t);let i=xn.filter(e=>r.has(e));return{...e,allowedChanges:i,newScenarioKind:Ko(i,e.newScenarioKind)}}function Xo(e,t,n){return Wo(zo,e,{locale:t,scopeKind:n,placeIsNone:!1}).draft}var Zo=[`swarm`,`scenario_launch`],Qo=[`pending_enroll`,`active`,`revoked`],$o=[`not_owner`,`pending_enroll`,`offline`,`capability_missing`,`queue_full`,`ready`],es=[`not_enrolled`,`none_ready`,`one_ready`,`many_ready`],ts=[`agents.no_dispatch_target`,`agents.offline`,`agents.runner_ambiguous`],ns=K(Zo),rs=W({queued:q().int().min(0),limit:q().int().min(0),remaining:q().int().min(0)}),is=W({lifecycle:K(Qo),lastSeenAt:_n().nullable(),online:hn(),declaredCapabilities:Cn(G()).nullable(),queue:W({runs:rs,jobs:rs}),activeRun:W({id:G(),scenarioId:G(),scenarioName:G(),status:y}).nullable(),activeJob:W({id:G(),kind:K([`make_auto`,`atlas_crawl`,`swarm`,`scenario_launch`,`conversation`]),scenariosTotal:q().int().min(0).nullable()}).nullable()}),as=W({agentId:G(),name:G(),hostname:G().nullable(),platform:De.nullable(),agentVersion:G().nullable(),state:K($o),blocker:W({errorCode:K([`agents.not_owner`,`agents.offline`,`agents.capability_missing`,`agents.queue_full`]),httpStatus:pn([fn(403),fn(409)])}).nullable(),facts:is}),os=W({resultKind:fn(`runner_readiness`),readinessFor:ns,capability:G(),evaluatedAt:_n(),presenceWindowMs:q().int().min(0),resolution:mn(`kind`,[W({kind:fn(`resolved`),agentId:G(),name:G()}),W({kind:fn(`refused`),errorCode:K(ts)})]),fleetState:K(es),runners:Cn(as),total:q().int().min(0)}),ss=W({resultKind:fn(`runner_enrollment_instructions`),readinessFor:ns,instructions:W({packageName:G(),installCommand:G(),enrollCommand:G(),startCommand:G(),approvalUrlPattern:G(),requestTtlSec:q().int().min(0),pollIntervalSec:q().int().min(0),steps:Cn(G())}),expiresAt:_n()}),cs=W({id:dn(),name:G().min(1),ownerName:G().min(1),mine:hn(),lifecycle:K(Qo),online:hn(),activeRun:W({}).loose().nullable(),activeJob:W({}).loose().nullable().optional()}),ls=W({items:Cn(cs),total:q().int(),offset:q().int()});async function us(e,t){return(await Bn(t=>e.request({method:R.agentList.method,path:R.agentList.path(t),schema:ls}),t)).map(e=>({id:e.id,name:e.name,ownerName:e.ownerName,mine:e.mine,block:Ln(e),occupied:Rn(e)}))}function ds({http:e,ready:t}){let[n,r]=(0,Z.useState)({status:`idle`}),[i,a]=(0,Z.useState)(0),o=(0,Z.useCallback)(()=>a(e=>e+1),[]);return(0,Z.useEffect)(()=>{if(!t)return;let n=new AbortController;return r(e=>e.status===`ready`?e:e.status===`failed`?{...e,retrying:!0}:{status:`loading`}),us(e,n.signal).then(e=>{n.signal.aborted||r({status:`ready`,runners:e})},e=>{n.signal.aborted||r(t=>t.status===`ready`?t:{status:`failed`,error:e,retrying:!1})}),()=>n.abort()},[t,e,i]),(0,Z.useEffect)(()=>{if(!t)return;let e=()=>{document.visibilityState===`visible`&&o()};return window.addEventListener(`focus`,o),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,o),document.removeEventListener(`visibilitychange`,e)}},[t,o]),{fleet:n,reloadFleet:o}}function fs(e){let t=e.find(e=>e.block===null);return t===void 0?{kind:`this_browser`}:{kind:`runner`,agentId:t.id}}function ps(e,t){if(e.kind!==`runner`)return e;if(t.status!==`ready`)return{kind:`runner-unread`,agentId:e.agentId};let n=t.runners.find(t=>t.id===e.agentId);return n===void 0?{kind:`runner-gone`,agentId:e.agentId}:{kind:`runner`,runner:n}}function ms({http:e,ready:t}){let[n,r]=(0,Z.useState)(ot),{fleet:i,reloadFleet:a}=ds({http:e,ready:t});return{place:n,view:(0,Z.useMemo)(()=>ps(n,i),[n,i]),fleet:i,choose:r,reloadFleet:a}}function hs(e){let[t,n]=(0,Z.useState)({key:e,value:null,save:null}),[r,i]=(0,Z.useState)(null),a=t.key===e?t:{key:e,value:null,save:null},o=t=>{i(null),n(n=>({...n.key===e?n:{key:e,value:null,save:null},...t}))};return{value:a.value,save:a.save,setValue:e=>o({value:e}),setValueFor:(e,t)=>{i(null),n({key:e,value:t,save:null})},setSave:e=>o({save:e}),reset:()=>n({key:e,value:null,save:null}),saveError:r,setSaveError:i}}function gs(e){return Pt(e,`crawl-scope`)}function _s({projectId:e,environment:t,active:n,opening:r}){let i=C(),a=t===null?null:t.environmentId,o=a===null?``:a,s=wt({key:rt({kind:`project`,projectId:P(e)},`crawl-scope`,a),read:t=>i.projects.crawlScope(P(e),a===null?{}:{environmentId:a},{signal:t}),freshness:`screen`,enabled:n&&t!==null,previousErrorWhileRetrying:!0}),c=s.data,l=s.error,u=s.reload,d=()=>{u()},f=hs(o),[p,m]=(0,Z.useState)(r);p!==null&&n&&t!==null&&(m(null),f.value===null&&(p.environmentId===null||p.environmentId===a)&&f.setValue(p.value));let h=f.value===null?vs(c):f.value;return{scope:c,scopeError:l,scopeRetrying:s.retrying,reloadScope:d,value:h,setValue:f.setValue,setValueFor:(e,t)=>f.setValueFor(e===null?``:e,t),block:c===void 0?`unread`:null}}function vs(e){return e===void 0?``:e.startUrl.state===`resolved`?e.startUrl.url:``}function ys(e){let t=e.trim();if(t===``)return{state:`empty`};let n=t.includes(`://`)?t:`https://${t}`,r=w(n);if(!r.ok)return{state:`invalid`,reason:r.reason};let i=kn(r.url.origin);if(!i.ok)return{state:`invalid`,reason:i.reason};let a=r.url.href,o=a===`${r.url.origin}/`;return{state:`ok`,baseUrl:i.baseUrl,launchUrl:o?void 0:a,href:a}}var bs=`targets.not_configured`,xs=`targets.cell_missing`,Ss=`targets.address_required`;function Cs(e){return e===bs||e===xs||e===Ss}function ws(e,t,n){if(t===bs)return{kind:`not_configured`};if(t===xs){let t=n==null?void 0:n.applicationId,r=n==null?void 0:n.environmentId;return typeof t==`string`&&typeof r==`string`?{kind:`cell_missing`,applicationId:t,environmentId:r}:(e.error(`targets.cell_missing arrived without its application \u00D7 environment pair`,{params:n}),null)}if(t===Ss){let t=n==null?void 0:n.targetId;return typeof t==`string`?{kind:`address_required`,targetId:t}:(e.error(`targets.address_required arrived without its targetId`,{params:n}),null)}return null}function Ts(e,t){return t instanceof E?ws(e,t.errorCode,t.params):null}function Es(e){return Pt(e,`entry-url`)}function Ds({projectId:e,environment:t,source:n,catalog:r,environments:i}){let a=C(),o=Vt(),{logger:s}=Qt(),c=n!==null&&n.kind===`scenario`?n.scenarioId:null,l=n!==null&&(n.kind===`scenario`||n.kind===`launchCell`),u=t===null?null:t.environmentId,d=`${u===null?``:u}|${c===null?``:c}`,f={kind:`project`,projectId:P(e)},p=wt({key:rt(f,`entry-url`,u,c),read:async t=>{let n={...u===null?{}:{environmentId:u},...c===null?{}:{scenarioId:c}};try{return{status:`resolved`,address:await a.projects.entryUrl(P(e),n,{signal:t})}}catch(e){if(e instanceof E&&Cs(e.errorCode)){let t=ws(s,e.errorCode,e.params);if(t!==null)return{status:`refused`,refusal:t}}throw e}},freshness:`screen`,enabled:n!==null&&t!==null}),m=p.error===null?p.data===void 0?{status:`loading`}:p.data:{status:`error`,error:p.error},h=hs(d),[g,_]=(0,Z.useState)(null),v=m.status===`refused`?m.refusal:null,y=g!==null&&g.key===d?g.refusal:v!==null&&(l||v.kind===`not_configured`)?v:null,b=y===null&&!l?v:null,x=e=>e===null||r===void 0||i===void 0?null:La(r,i,e),S=x(y),w=m.status===`resolved`?m.address.entryUrl:null,T=y===null?w:null,D=h.value===null?T===null?``:T:h.value,O=D.trim(),k=y!==null&&y.kind!==`not_configured`,A=h.save===null?k&&y.kind===`cell_missing`:h.save,j=ys(D),M=k&&A&&j.state!==`empty`,N=(()=>{if(O!==``&&(w===null||O!==w&&`${O}/`!==w))return O})(),F=M&&j.state===`invalid`?`saveInvalid`:null;return{value:D,setValue:h.setValue,isLoading:m.status===`loading`,read:m,refusal:y,refusedCell:S,defaultApplicationNote:x(b),saveChecked:A,setSaveChecked:h.setSave,savePlan:j,saveError:h.saveError,block:F,override:N,adoptDispatchRefusal:e=>{let t=Ts(s,e);return t!==null&&(_({key:d,refusal:t}),!0)},prepareDispatch:async()=>{if(!M||S===null||j.state!==`ok`)return{ok:!0,entryUrl:N,saved:!1};h.setSaveError(null);try{let t=await Oa(a,e,S,j.baseUrl);s.info(`Launch address saved into its cell`,{projectId:e,targetId:t.id,applicationId:t.applicationId,environmentId:t.environmentId,mode:S.kind})}catch(t){return s.error(`Failed to save the launch address into its cell`,{error:t instanceof Error?t:Error(String(t)),projectId:e,mode:S.kind}),h.setSaveError(t),{ok:!1}}return _(null),h.reset(),Promise.all([o.invalidateAfterChange(Es(f)),o.invalidateAfterChange(gs(f)),o.invalidateAfterChange(on(f))]),{ok:!0,entryUrl:j.launchUrl,saved:!0}}}}var Os=`project-default`;function ks(e){return e===`project-default`?null:e}function As(e,t){if(t!==null&&e.some(e=>e.id===t))return t;let n=e.find(e=>e.isDefault);if(n!==void 0)return n.id;let r=e[0];return r===void 0?null:r.id}function js(e,t){let{t:n}=H(),[r,i]=(0,Z.useState)(null),a=kt({projectId:P(e)},{previousErrorWhileRetrying:!0}),o=a.data,s=a.error,c=a.reload,l=()=>{c()},u=(0,Z.useMemo)(()=>o===void 0?[]:o.map(e=>({value:e.id,label:e.name})),[o]),d=n(`agentRunDispatch.environment.asUsual`),f=(0,Z.useMemo)(()=>t.kind===`concrete`?u:[{value:Os,label:d},...u],[t.kind,u,d]),p={mode:t.kind,environments:o,loadError:s,loadRetrying:a.retrying,reload:l,options:f,setValue:i};if(t.kind===`concrete`){let e=o===void 0?null:As(o,t.preferredEnvironmentId),i=t.preservePreferred===!0?t.preferredEnvironmentId:null,a=r===null?i===null?e:i:r,s=o!==void 0&&a!==null&&!o.some(e=>e.id===a);return{...p,missing:s,missingHint:s?n(o.length===0?`launchAddress.environment.noneLeft`:`launchAddress.environment.missing`):null,value:o===void 0||s?null:a,shown:o!==void 0&&o.length>0,body:o===void 0||s?null:{environmentId:a}}}let m=r===null?Os:r;return{...p,missing:!1,missingHint:null,value:m,shown:!0,body:{environmentId:ks(m)}}}function Ms({projectId:e,environment:t,address:n}){let r=js(e,t),i=Fa(e),a={data:i.data,error:i.error,retrying:i.retrying,reload:i.reload},o=r.environments,s=Ds({projectId:e,environment:r.body,source:n.kind===`crawlStart`?null:n,catalog:a.data,environments:o}),c=_s({projectId:e,environment:r.body,active:n.kind===`crawlStart`,opening:n.kind===`crawlStart`&&n.opening!==void 0?n.opening:null});return{projectId:e,environment:r,catalog:a,address:n.kind===`crawlStart`?{kind:`crawlStart`,...c}:{kind:`entryUrl`,source:n.kind,...s}}}function Ns(){let{t:e}=H(),t=wi();return{generic:e=>ki(t,e,`taskForm.errors.launch`),addressMissing:t=>t===null?e(`taskForm.errors.addressMissingNoEnvironment`):e(`taskForm.errors.addressMissing`,{environment:t}),missingFields:t=>e(`taskForm.errors.incomplete`,{fields:t.map(t=>e(`taskForm.errors.missingField.${t}`)).join(`; `)})}}function Ps(e=gn){let[t,n]=(0,Z.useState)(e),[r,i]=(0,Z.useState)(!1);return{value:t,choose:e=>{r||n(e)},input:{effort:t},locked:r,lock:()=>i(!0),releaseLock:()=>i(!1),reset:()=>{n(e)}}}var Fs=`host_not_recorded`,Is=/* @__PURE__ */ new Set([`targets.not_configured`,`agents.entry_url_out_of_scope`,`agents.entry_url_override_invalid`]);function Ls(e){return e.typed.trim()===``}function Rs(e,t,n){let r=Ce.parse(e.params).missing,i=t!==null&&Ls(t)&&r.includes(`entryUrl`),[a,...o]=l.filter(e=>r.includes(e)&&!(i&&e===`entryUrl`));return{kind:`refused`,reason:[...i?[n.addressMissing(t.environmentName)]:[],...a===void 0?[]:[n.missingFields([a,...o])]].join(`; `),action:i?`addresses`:null}}function zs(e,t){var n;if(e.errorCode!==`agents.entry_url_out_of_scope`||((n=e.params)==null?void 0:n.reason)!==Fs||t===null||Ls(t)||t.environmentName===null)return null;let r=w(t.typed.trim());return r.ok?{kind:`host_not_recorded`,host:r.url.host,environmentName:t.environmentName,action:`addresses`}:null}function Bs(e,t,n){if(!(e instanceof E)||e.errorCode===void 0)return{kind:`refused`,reason:n.generic(e),action:null};if(e.errorCode===`launch_drafts.incomplete`)return Rs(e,t,n);let r=zs(e,t);if(r!==null)return r;let i=Is.has(e.errorCode)?`addresses`:e.errorCode.startsWith(`ai_models.`)?`ai_settings`:null;return{kind:`refused`,reason:n.generic(e),action:i}}async function Vs(e,t,n){let r=await e.makeAutoQueues.admissions({projectId:t.projectId,scenarioIds:[...t.scenarioIds],queueId:t.queueId},{signal:n});if(r.items.length!==t.scenarioIds.length)throw Error(`Make-auto admissions answered ${r.items.length} positions for ${t.scenarioIds.length} scenarios`);let i=new Set(r.items.filter(e=>e.outcome!==`rejected`&&!t.names.has(e.scenarioId)).map(e=>e.scenarioId)),a=new Map(t.names);if(i.size>0){let r=await e.projectData.scenariosTree(P(t.projectId),{signal:n}),o=e=>{for(let t of e)i.has(t.id)&&a.set(t.id,t.name)};o(r.uncategorized);let s=[...r.tree];for(let e of s)o(e.scenarios),s.push(...e.children)}return r.items.map(e=>{let t=a.get(e.scenarioId);if(t===void 0&&e.outcome!==`rejected`)throw Error(`Make-auto admissions: scenario ${e.scenarioId} has no name`);return{scenarioId:e.scenarioId,name:t===void 0?null:t,admission:e}})}function Hs(e){let t=C(),{logger:n}=Qt(),r=rt(Je(),`make-auto-admissions`,e===null?null:e.projectId,e===null?null:e.queueId,e===null?null:[...e.scenarioIds]),i=wt({key:r,read:n=>{if(e===null)throw Error(`useMakeAutoAdmissions: read without scenarios`);return Vs(t,e,n)},freshness:`screen`,enabled:e!==null,previousErrorWhileRetrying:!0}),a=i.error;(0,Z.useEffect)(()=>{a!==null&&n.error(`Failed to read make-auto admissions`,{error:a})},[a,n]);let o=i.reload;return{rows:i.data===void 0?null:i.data,error:a,retrying:i.retrying,reload:()=>void o()}}function Us(e,t,n){let r=t===`automate_scenarios`&&n.kind===`scenarios`,i=Hs(r?{projectId:e,queueId:null,scenarioIds:n.scenarioIds,names:n.names}:null);return r?i:null}var Ws=new Set(qt);function Gs(e,t){let n=t.value,r=ht({projectId:P(e),query:n===null?{}:{environmentId:n}},{enabled:n!==null,previousErrorWhileRetrying:!0}),i=r.data===void 0?void 0:r.data.resolved,a=(0,Z.useMemo)(()=>i===void 0?void 0:i.filter(e=>Ws.has(e.scope)&&bn.test(e.name)).map(e=>({name:e.name,isSecret:e.isSecret})).sort((e,t)=>e.name.localeCompare(t.name)),[i]),o=r.reload;return n===null?t.loadError!==null||t.missing?{kind:`environment_unknown`}:t.environments===void 0?{kind:`reading`}:{kind:`no_environment`}:r.error===null?a===void 0?{kind:`reading`}:{kind:`ready`,variables:a}:{kind:`failed`,error:r.error,retry:()=>void o(),retrying:r.retrying}}function Ks(e){return e.length===0?null:{variableNames:[...e],role:null}}function qs(e,t,n){let r=e.filter(e=>e!==t);return n?[...r,t]:r}function Js(e){let[t,n]=(0,Z.useState)({environmentId:e,names:[]});return{chosen:t.environmentId===e?t.names:[],toggle:(0,Z.useCallback)((t,r)=>n(n=>({environmentId:e,names:qs(n.environmentId===e?n.names:[],t,r)})),[e]),reset:(0,Z.useCallback)(()=>n({environmentId:null,names:[]}),[])}}function Ys({children:e}){return/* @__PURE__ */ (0,X.jsx)(`mark`,{className:`rounded-2xs bg-(--color-bg-search-mark) text-inherit`,children:e})}var Xs=/[\\^$.*+?()[\]{}|]/g;function Zs({text:e,query:t}){let n=t.trim();if(n===``)return/* @__PURE__ */ (0,X.jsx)(X.Fragment,{children:e});let r=new RegExp(n.replace(Xs,`\\$&`),`giu`),i=[],a=0;for(let t of e.matchAll(r))t.index>a&&i.push(e.slice(a,t.index)),i.push(/* @__PURE__ */ (0,X.jsx)(Ys,{children:t[0]},t.index)),a=t.index+t[0].length;return i.length===0?/* @__PURE__ */ (0,X.jsx)(X.Fragment,{children:e}):(a<e.length&&i.push(e.slice(a)),/* @__PURE__ */ (0,X.jsx)(X.Fragment,{children:i}))}var Qs=K(pt),$s=W({permissionMode:Qs,permissionModeVersion:q().int().positive()}),ec=W({permissionMode:Qs});function tc(e){let{http:t}=e;return{async setConversationMode(e,n){let r=await t.request({method:R.conversationPermissionMode.method,path:R.conversationPermissionMode.path(e),body:{permissionMode:n},schema:$s});return{permissionMode:r.permissionMode,permissionModeVersion:r.permissionModeVersion}},async readLastChoice(){return(await t.request({method:R.lastPermissionModeRead.method,path:R.lastPermissionModeRead.path(),schema:ec})).permissionMode},async writeLastChoice(e){return(await t.request({method:R.lastPermissionModeWrite.method,path:R.lastPermissionModeWrite.path(),body:{permissionMode:e},schema:ec})).permissionMode}}}export{ki as $,Bn as $t,yo as A,fr as At,xa as B,nr as Bt,qo as C,Er as Ct,Eo as D,_r as Dt,Po as E,Cr as Et,Ka as F,sr as Ft,Xi as G,Xn as Gt,ia as H,$n as Ht,Ma as I,or as It,Gi as J,qn as Jt,Yi as K,Yn as Kt,Ta as L,ar as Lt,go as M,ur as Mt,uo as N,lr as Nt,vo as O,vr as Ot,co as P,cr as Pt,Q,Vn as Qt,Ca as R,ir as Rt,Wo as S,Mr as St,Yo as T,Dr as Tt,$ as U,Qn as Ut,la as V,tr as Vt,ta as W,Zn as Wt,zi as X,Un as Xt,Hi as Y,Wn as Yt,Ii as Z,Hn as Zt,os as _,Fr as _t,Gs as a,fi as at,Xo as b,jr as bt,Bs as c,$r as ct,Ms as d,Vr as dt,zn as en,wi as et,ps as f,Rr as ft,ss as g,Pr as gt,ds as h,zr as ht,qs as i,kn as in,vi as it,bo as j,dr as jt,So as k,gr as kt,Ps as l,Br as lt,fs as m,Gr as mt,Zs as n,Rn as nn,gi as nt,Js as o,li as ot,ms as p,Kr as pt,Ji as q,Jn as qt,Ks as r,An as rn,yi as rt,Us as s,ni as st,tc as t,Ln as tn,_i as tt,Ns as u,Ur as ut,zo as v,Wr as vt,Jo as w,Tr as wt,Ko as x,Ar as xt,Ho as y,Ir as yt,va as z,rr as zt};