local-operator-ui 0.35.2 → 0.36.0
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.
- package/out/main/index.js +8112 -154
- package/out/preload/index.js +16 -0
- package/out/renderer/assets/{_basePickBy-NBZVf3x_.js → _basePickBy-SGLOphwb.js} +1 -1
- package/out/renderer/assets/{_baseUniq-BpOXfy9b.js → _baseUniq-BEXNc7x-.js} +1 -1
- package/out/renderer/assets/{agent-details-page-CI5V0mco.js → agent-details-page-DV2yIuv2.js} +1 -1
- package/out/renderer/assets/{agent-hub-page-C7UV5Z02.js → agent-hub-page-CUbsvyOV.js} +1 -1
- package/out/renderer/assets/{agents-page-BHUCzpZE.js → agents-page-HlZ3bxUE.js} +3 -3
- package/out/renderer/assets/{arc-DTlm2-sN.js → arc-C8xiXz_s.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-uA5hYBWO.js → architectureDiagram-IEHRJDOE-DPp-Txy7.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-Awo08lrR.js → blockDiagram-JOT3LUYC-D_d0BHII.js} +1 -1
- package/out/renderer/assets/{book-open-DBUibLWP.js → book-open-DTOZBzFE.js} +1 -1
- package/out/renderer/assets/browser-page-CeOP0TxL.js +1 -0
- package/out/renderer/assets/{browser-webauthn-prompt-egKdqzbk.js → browser-webauthn-prompt-BK-iloiA.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-DAHoIxNf.js → c4Diagram-VJAJSXHY-C6MJyQ4X.js} +1 -1
- package/out/renderer/assets/channel-FnsvGBvN.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-QvFtu74J.js → chunk-4BMEZGHF-DaoR7E6u.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-EcRDJZN6.js → chunk-A2AXSNBT-kSoJEGtH.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-CKf_yBAg.js → chunk-AEK57VVT-CbuETRiF.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-CoixV4aq.js → chunk-D6G4REZN-VgQyUEwk.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-CtEEDTp-.js → chunk-RZ5BOZE2-CC9D19Ws.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-BOgT03N8.js → chunk-XZIHB7SX-rHyhcY1z.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-B1qeThzW.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-B1qeThzW.js +1 -0
- package/out/renderer/assets/clone-CEyxkG_K.js +1 -0
- package/out/renderer/assets/{console-mirror-D7dfGxrD.js → console-mirror-C_vErGtg.js} +1 -1
- package/out/renderer/assets/{consoleCapture-DczATgZh.js → consoleCapture-BSMsAadm.js} +1 -1
- package/out/renderer/assets/{conversation-input-sync-GlFEQKuo.js → conversation-input-sync-D8m_0i2P.js} +4 -4
- package/out/renderer/assets/{dagre-OKDRZEBW-CijtV3o0.js → dagre-OKDRZEBW-dnMavWL5.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-Dxx1RpmY.js → diagram-SSKATNLV-CbEqpT5c.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-DZg2hjvO.js → diagram-VNBRO52H-CVFcaRWG.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-CjvMMGLo.js → erDiagram-Q7BY3M3F-c4T4ZMVa.js} +1 -1
- package/out/renderer/assets/{error-boundary-CLT6U8jT.js → error-boundary-5hn9OWCr.js} +1 -1
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-EjagIE01.js → flowDiagram-4HSFHLVR-DONfRBhn.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-OfsWfUyW.js → ganttDiagram-APWFNJXF-Cp9mKyj3.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-nYTyKs0s.js → gitGraphDiagram-7IBYFJ6S-qDIZQ2Xn.js} +1 -1
- package/out/renderer/assets/{graph-BnL8m22f.js → graph-DxzSxuLT.js} +1 -1
- package/out/renderer/assets/{index-C866kR_k.js → index-BUDP0pmc.js} +1 -1
- package/out/renderer/assets/index-By5U6kgU.js +824 -0
- package/out/renderer/assets/{index-CO7sxKWb.js → index-CSR2j15s.js} +1 -1
- package/out/renderer/assets/index-DlJQQpdf.css +1 -0
- package/out/renderer/assets/index-Dom8jp4B.js +57 -0
- package/out/renderer/assets/{infoDiagram-PH2N3AL5-LE2dCnxc.js → infoDiagram-PH2N3AL5-DMwjGTFV.js} +1 -1
- package/out/renderer/assets/{installer-Wpfa8xHM.js → installer-C6aKiv4n.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-BhpegMd0.js → journeyDiagram-U35MCT3I-D1rmFkrM.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-OoMW68Bt.js → kanban-definition-NDS4AKOZ-CqK-A_YR.js} +1 -1
- package/out/renderer/assets/{layout-BdaXfJXz.js → layout-D4krH14D.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-lVj0d18U.js → legacy-agents-page-kqMeTGcp.js} +1 -1
- package/out/renderer/assets/{mermaid.core-DmdT5IgP.js → mermaid.core-CrL8DoR1.js} +5 -5
- package/out/renderer/assets/{mesh-page-D0-4HVNk.js → mesh-page-CM48PCe9.js} +1 -1
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-BCXX8n68.js → mindmap-definition-ALO5MXBD-C-gUOB1I.js} +1 -1
- package/out/renderer/assets/{mini-DsJCW_H3.js → mini-onfDilHt.js} +1 -1
- package/out/renderer/assets/{notebook-pen-CAZF-xgd.js → notebook-pen-Btzx7ygD.js} +1 -1
- package/out/renderer/assets/{org-access-DCQGHh2Y.js → org-access-BEUGBi3r.js} +1 -1
- package/out/renderer/assets/{org-surface-gate-Cq3kOR7u.js → org-surface-gate-D09m9wPe.js} +1 -1
- package/out/renderer/assets/{page-header-CQ6qN4O4.js → page-header-CKQX5mld.js} +1 -1
- package/out/renderer/assets/{pieDiagram-IB7DONF6-BRK1MBQO.js → pieDiagram-IB7DONF6-Drlcy994.js} +1 -1
- package/out/renderer/assets/{projects-page-DpAhuoA7.js → projects-page-B6hrFCYu.js} +1 -1
- package/out/renderer/assets/{publication-validation-CZn6wbD0.js → publication-validation-CcRMJVIV.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-CtQwUI4m.js → quadrantDiagram-7GDLP6J5-BiVOkk5-.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-o9_lRR0v.js → radar-MK3ICKWK-DJQQ5bto.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-BWhD8ldO.js → radient-auth-buttons-BXlyZYxA.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-aEEiUjHx.js → requirementDiagram-KVF5MWMF-BuTsJfL4.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-CtjAQQYG.js → sankeyDiagram-QLVOVGJD-D-tl8j-V.js} +1 -1
- package/out/renderer/assets/{schedules-page-C4-FWwsb.js → schedules-page-DrwIsOtA.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-QOpgwrwA.js → sequenceDiagram-X6HHIX6F-NqOQh-1X.js} +1 -1
- package/out/renderer/assets/{settings-page-BJZ7ozTY.js → settings-page-D35Ls2IS.js} +1 -1
- package/out/renderer/assets/{stateDiagram-DGXRK772-D99A_n2H.js → stateDiagram-DGXRK772-CbnDiKHd.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-CAGVkdpP.js +1 -0
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-C_Op_i7D.js → timeline-definition-BDJGKUSR-C8_-K0jE.js} +1 -1
- package/out/renderer/assets/ui-preferences-store-Dz1d9H9b.js +1 -0
- package/out/renderer/assets/{use-download-agent-mutation-PP3ZbZ7V.js → use-download-agent-mutation-C2YV-ZqZ.js} +1 -1
- package/out/renderer/assets/{use-memberships-query-TOFQHH-q.js → use-memberships-query-CE1RS6l9.js} +1 -1
- package/out/renderer/assets/{use-session-snapshot-BOMni_bJ.js → use-session-snapshot-tK5pFJpN.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-Bq2H6JYU.js → xychartDiagram-VJFVF3MP-DxygsIwk.js} +1 -1
- package/out/renderer/console-capture.html +5 -5
- package/out/renderer/index.html +7 -7
- package/out/renderer/installer.html +4 -4
- package/out/renderer/mini.html +7 -7
- package/package.json +2 -2
- package/out/renderer/assets/browser-page-DuKCLrh5.js +0 -1
- package/out/renderer/assets/channel-BZ9uCAQo.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-D6kkk-4_.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-D6kkk-4_.js +0 -1
- package/out/renderer/assets/clone-BgCd73kI.js +0 -1
- package/out/renderer/assets/index-CGcU9-Py.css +0 -1
- package/out/renderer/assets/index-Cj2bZws8.js +0 -57
- package/out/renderer/assets/index-p3NO0LL-.js +0 -824
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-D0CTAsLQ.js +0 -1
- package/out/renderer/assets/ui-preferences-store-Dz1Kg_SA.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r,t as n,j as t,c as ue,e as xs,L as ys}from"./index-
|
|
1
|
+
import{r,t as n,j as t,c as ue,e as xs,L as ys}from"./index-Dom8jp4B.js";import{cw as It,cx as ks,cy as sn,cz as Ce,bQ as bs,C as be,ah as Rn,ai as Bt,a4 as En,u as Ht,aK as vs,aL as js,cA as ws,cB as Ns,cC as Ss,cD as Cs,cE as Tn,cF as Vt,af as Ln,cG as Ms,cH as As,aP as it,cI as an,cJ as Fe,a as Gt,c as Rt,cK as Is,cL as ot,cM as Rs,bm as Es,cN as Ts,cO as Ls,cP as Os,cQ as Fs,d as de,cR as Et,bE as On,cS as qt,cT as rt,bq as Ds,cU as Fn,ad as zs,cV as Ps,cW as $s,cX as Ks,cY as Us,Z as Yt,cZ as Bs,c_ as Hs,a3 as Dn,aR as Tt,aS as Lt,c$ as Vs,aW as Gs,cb as Ot,ar as lt,d0 as qs,d1 as Ys,d2 as Qs,d3 as Ft,d4 as Ws,d5 as Zs,d6 as Js,aN as Xs,d7 as zn,d8 as ea,d9 as ta,da as na,B as sa,db as Pn,aQ as $n,dc as Kn,dd as aa,de as ia,df as oa,dg as ra,dh as la,di as ca,dj as da,dk as ua,D as ma,bL as Un,aX as ga,bl as _a,dl as He,dm as Dt,dn as on,dp as pa,dq as ha,dr as fa,ds as xa,by as ya,dt as ka,bT as ba,du as va,bS as ja,dv as wa,dw as Na,dx as rn,dy as Sa,dz as Ca,dA as Ma,dB as Aa}from"./conversation-input-sync-D8m_0i2P.js";import{K as Ia,u as Me,n as Ra,o as Ea,q as Ta,T as La,r as Bn}from"./ui-preferences-store-Dz1d9H9b.js";import{bh as Hn,bi as Oa,bj as Fa,bk as ce,b1 as ht,b2 as _e,bl as Da,bg as za,bm as Pa,aH as ln,bn as $a,bo as Ka,bp as Xe,S as Ua,b0 as Ba,bq as Ha,br as Va,bs as Ga,bt as qa,bu as Ya,bv as Qa,aS as cn,bw as Wa,aN as Za,aZ as dn,bx as Ja,a_ as Xa,a$ as ei,by as ti,bz as ni}from"./index-By5U6kgU.js";import{P as si}from"./page-header-CKQX5mld.js";import{c as M,u as ee,B as G,S as he,M as ai,l as Ke,Y as gt,Z as _t,_ as $e,F as ii,G as oi,H as ri,J as li,K as ci,a0 as pt,N as di,A as oe,m as ui,n as et,k as Oe,z as qe,I as Ae,C as zt,ab as mi,g as Vn,L as we,ac as un,T as Gn,q as gi,r as _i,s as pi,v as hi,w as mn,p as fi,E as xi,ad as yi,a4 as ki}from"./error-boundary-5hn9OWCr.js";import{R as bi}from"./radient-auth-buttons-BXlyZYxA.js";import{N as vi}from"./notebook-pen-Btzx7ygD.js";import{B as ji}from"./book-open-DTOZBzFE.js";import{a as wi,p as jt}from"./parseISO-BHJWTxrA.js";import{i as Ni,a as Le,f as Si}from"./format-esAOn2VS.js";import{t as Ci}from"./en-US-CHJkXXr4.js";import"./console-mirror-C_vErGtg.js";/**
|
|
2
2
|
* @license lucide-react v0.507.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/out/renderer/assets/{stateDiagram-DGXRK772-D99A_n2H.js → stateDiagram-DGXRK772-CbnDiKHd.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as W,a as P,S as N}from"./chunk-AEK57VVT-CKf_yBAg.js";import{_ as u,c as t,d as z,l as S,e as C,k as T,u as U}from"./mermaid.core-DmdT5IgP.js";import{G as F}from"./graph-BnL8m22f.js";import{l as O}from"./layout-BdaXfJXz.js";import{y as J,z as X}from"./conversation-input-sync-GlFEQKuo.js";import"./chunk-RZ5BOZE2-CtEEDTp-.js";import"./index-Cj2bZws8.js";import"./_baseUniq-BpOXfy9b.js";import"./_basePickBy-NBZVf3x_.js";import"./ui-preferences-store-Dz1Kg_SA.js";import"./error-boundary-CLT6U8jT.js";var L={},D=u((e,i)=>{L[e]=i},"set"),Y=u(e=>L[e],"get"),G=u(()=>Object.keys(L),"keys"),I=u(()=>G().length,"size"),$={get:Y,set:D,keys:G,size:I},j=u(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),q=u(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Z=u((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),o=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o.width+2*t().state.padding).attr("height",o.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),K=u((e,i)=>{const d=u(function(l,B,m){const k=l.append("tspan").attr("x",2*t().state.padding).text(B);m||k.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),g=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",g+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(l){a||(d(x,l,s),s=!1),a=!1});const y=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+g+t().state.dividerMargin/2).attr("y2",t().state.padding+g+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),c=Math.max(p.width,n.width);return y.attr("x2",c+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c+2*t().state.padding).attr("height",p.height+g+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),Q=u((e,i,d)=>{const o=t().state.padding,n=2*t().state.padding,g=e.node().getBBox(),x=g.width,a=g.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let c=Math.max(p,x);c===x&&(c=c+n);let l;const B=e.node().getBBox();i.doc,l=a-o,p>x&&(l=(x-c)/2+o),Math.abs(a-B.x)<o&&p>x&&(l=a-(p-x)/2);const m=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",l).attr("y",m).attr("class",d?"alt-composit":"composit").attr("width",c).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",l+o),p<=x&&s.attr("x",a+(c-n)/2-p/2+o),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),V=u(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),tt=u((e,i)=>{let d=t().state.forkWidth,o=t().state.forkHeight;if(i.parentId){let n=d;d=o,o=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",o).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),et=u((e,i,d,o)=>{let n=0;const g=o.append("text");g.style("text-anchor","start"),g.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");const a=x.split(T.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const y of a){const p=y.trim();if(p.length>0){const c=g.append("tspan");if(c.text(p),s===0){const l=c.node().getBBox();s+=l.height}n+=s,c.attr("x",i+t().state.noteMargin),c.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:g.node().getBBox().width,textHeight:n}},"_drawLongText"),at=u((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),o=i.append("g"),{textWidth:n,textHeight:g}=et(e,0,0,o);return d.attr("height",g+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),_=u(function(e,i){const d=i.id,o={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&j(n),i.type==="end"&&V(n),(i.type==="fork"||i.type==="join")&&tt(n,i),i.type==="note"&&at(i.note.text,n),i.type==="divider"&&q(n),i.type==="default"&&i.descriptions.length===0&&Z(n,i),i.type==="default"&&i.descriptions.length>0&&K(n,i);const g=n.node().getBBox();return o.width=g.width+2*t().state.padding,o.height=g.height+2*t().state.padding,$.set(d,o),o},"drawState"),A=0,it=u(function(e,i,d){const o=u(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,g=J().x(function(s){return s.x}).y(function(s){return s.y}).curve(X),x=e.append("path").attr("d",g(n)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),x.attr("marker-end","url("+a+"#"+o(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:y,y:p}=U.calcLabelPosition(i.points),c=T.getRows(d.title);let l=0;const B=[];let m=0,k=0;for(let f=0;f<=c.length;f++){const h=s.append("text").attr("text-anchor","middle").text(c[f]).attr("x",y).attr("y",p+l),w=h.node().getBBox();m=Math.max(m,w.width),k=Math.min(k,w.x),S.info(w.x,y,p+l),l===0&&(l=h.node().getBBox().height,S.info("Title height",l,p)),B.push(h)}let E=l*c.length;if(c.length>1){const f=(c.length-1)*l*.5;B.forEach((h,w)=>h.attr("y",p+w*l-f)),E=l*c.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",y-m/2-t().state.padding/2).attr("y",p-E/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",E+t().state.padding),S.info(r)}A++},"drawEdge"),b,H={},rt=u(function(){},"setConf"),nt=u(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),st=u(function(e,i,d,o){b=t().state;const n=t().securityLevel;let g;n==="sandbox"&&(g=z("#i"+i));const x=n==="sandbox"?z(g.nodes()[0].contentDocument.body):z("body"),a=n==="sandbox"?g.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);nt(s);const y=o.db.getRootDoc();R(y,s,void 0,!1,x,a,o);const p=b.padding,c=s.node().getBBox(),l=c.width+p*2,B=c.height+p*2,m=l*1.75;C(s,B,m,b.useMaxWidth),s.attr("viewBox",`${c.x-b.padding} ${c.y-b.padding} `+l+" "+B)},"draw"),dt=u(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),R=u((e,i,d,o,n,g,x)=>{const a=new F({compound:!0,multigraph:!0});let s,y=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){y=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const p=x.db.getStates(),c=x.db.getRelations(),l=Object.keys(p);for(const r of l){const f=p[r];d&&(f.parentId=d);let h;if(f.doc){let w=i.append("g").attr("id",f.id).attr("class","stateGroup");h=R(f.doc,w,f.id,!o,n,g,x);{w=Q(w,f,o);let v=w.node().getBBox();h.width=v.width,h.height=v.height+b.padding/2,H[f.id]={y:b.compositTitleSize}}}else h=_(i,f,a);if(f.note){const w={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},v=_(i,w,a);f.note.position==="left of"?(a.setNode(h.id+"-note",v),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",v)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;c.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:dt(r.title),height:b.labelHeight*T.getRows(r.title).length,labelpos:"c"},"id"+B)}),O(a),S.debug("Graph after layout",a.nodes());const m=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+m.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(H[r]?H[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+m.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),g.querySelectorAll("#"+m.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let v=0,M=0;w&&(w.parentElement&&(v=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let k=m.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),it(i,a.edge(r),a.edge(r).relation))}),k=m.getBBox();const E={id:d||"root",label:d||"root",width:0,height:0};return E.width=k.width+2*b.padding,E.height=k.height+2*b.padding,S.debug("Doc rendered",E,a),E},"renderDoc"),ot={setConf:rt,draw:st},Bt={parser:P,get db(){return new N(1)},renderer:ot,styles:W,init:u(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{Bt as diagram};
|
|
1
|
+
import{s as W,a as P,S as N}from"./chunk-AEK57VVT-CbuETRiF.js";import{_ as u,c as t,d as z,l as S,e as C,k as T,u as U}from"./mermaid.core-CrL8DoR1.js";import{G as F}from"./graph-DxzSxuLT.js";import{l as O}from"./layout-D4krH14D.js";import{y as J,z as X}from"./conversation-input-sync-D8m_0i2P.js";import"./chunk-RZ5BOZE2-CC9D19Ws.js";import"./index-Dom8jp4B.js";import"./_baseUniq-BEXNc7x-.js";import"./_basePickBy-SGLOphwb.js";import"./ui-preferences-store-Dz1d9H9b.js";import"./error-boundary-5hn9OWCr.js";var L={},D=u((e,i)=>{L[e]=i},"set"),Y=u(e=>L[e],"get"),G=u(()=>Object.keys(L),"keys"),I=u(()=>G().length,"size"),$={get:Y,set:D,keys:G,size:I},j=u(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),q=u(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Z=u((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),o=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o.width+2*t().state.padding).attr("height",o.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),K=u((e,i)=>{const d=u(function(l,B,m){const k=l.append("tspan").attr("x",2*t().state.padding).text(B);m||k.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),g=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",g+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(l){a||(d(x,l,s),s=!1),a=!1});const y=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+g+t().state.dividerMargin/2).attr("y2",t().state.padding+g+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),c=Math.max(p.width,n.width);return y.attr("x2",c+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c+2*t().state.padding).attr("height",p.height+g+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),Q=u((e,i,d)=>{const o=t().state.padding,n=2*t().state.padding,g=e.node().getBBox(),x=g.width,a=g.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let c=Math.max(p,x);c===x&&(c=c+n);let l;const B=e.node().getBBox();i.doc,l=a-o,p>x&&(l=(x-c)/2+o),Math.abs(a-B.x)<o&&p>x&&(l=a-(p-x)/2);const m=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",l).attr("y",m).attr("class",d?"alt-composit":"composit").attr("width",c).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",l+o),p<=x&&s.attr("x",a+(c-n)/2-p/2+o),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),V=u(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),tt=u((e,i)=>{let d=t().state.forkWidth,o=t().state.forkHeight;if(i.parentId){let n=d;d=o,o=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",o).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),et=u((e,i,d,o)=>{let n=0;const g=o.append("text");g.style("text-anchor","start"),g.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");const a=x.split(T.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const y of a){const p=y.trim();if(p.length>0){const c=g.append("tspan");if(c.text(p),s===0){const l=c.node().getBBox();s+=l.height}n+=s,c.attr("x",i+t().state.noteMargin),c.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:g.node().getBBox().width,textHeight:n}},"_drawLongText"),at=u((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),o=i.append("g"),{textWidth:n,textHeight:g}=et(e,0,0,o);return d.attr("height",g+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),_=u(function(e,i){const d=i.id,o={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&j(n),i.type==="end"&&V(n),(i.type==="fork"||i.type==="join")&&tt(n,i),i.type==="note"&&at(i.note.text,n),i.type==="divider"&&q(n),i.type==="default"&&i.descriptions.length===0&&Z(n,i),i.type==="default"&&i.descriptions.length>0&&K(n,i);const g=n.node().getBBox();return o.width=g.width+2*t().state.padding,o.height=g.height+2*t().state.padding,$.set(d,o),o},"drawState"),A=0,it=u(function(e,i,d){const o=u(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,g=J().x(function(s){return s.x}).y(function(s){return s.y}).curve(X),x=e.append("path").attr("d",g(n)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),x.attr("marker-end","url("+a+"#"+o(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:y,y:p}=U.calcLabelPosition(i.points),c=T.getRows(d.title);let l=0;const B=[];let m=0,k=0;for(let f=0;f<=c.length;f++){const h=s.append("text").attr("text-anchor","middle").text(c[f]).attr("x",y).attr("y",p+l),w=h.node().getBBox();m=Math.max(m,w.width),k=Math.min(k,w.x),S.info(w.x,y,p+l),l===0&&(l=h.node().getBBox().height,S.info("Title height",l,p)),B.push(h)}let E=l*c.length;if(c.length>1){const f=(c.length-1)*l*.5;B.forEach((h,w)=>h.attr("y",p+w*l-f)),E=l*c.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",y-m/2-t().state.padding/2).attr("y",p-E/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",E+t().state.padding),S.info(r)}A++},"drawEdge"),b,H={},rt=u(function(){},"setConf"),nt=u(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),st=u(function(e,i,d,o){b=t().state;const n=t().securityLevel;let g;n==="sandbox"&&(g=z("#i"+i));const x=n==="sandbox"?z(g.nodes()[0].contentDocument.body):z("body"),a=n==="sandbox"?g.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);nt(s);const y=o.db.getRootDoc();R(y,s,void 0,!1,x,a,o);const p=b.padding,c=s.node().getBBox(),l=c.width+p*2,B=c.height+p*2,m=l*1.75;C(s,B,m,b.useMaxWidth),s.attr("viewBox",`${c.x-b.padding} ${c.y-b.padding} `+l+" "+B)},"draw"),dt=u(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),R=u((e,i,d,o,n,g,x)=>{const a=new F({compound:!0,multigraph:!0});let s,y=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){y=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const p=x.db.getStates(),c=x.db.getRelations(),l=Object.keys(p);for(const r of l){const f=p[r];d&&(f.parentId=d);let h;if(f.doc){let w=i.append("g").attr("id",f.id).attr("class","stateGroup");h=R(f.doc,w,f.id,!o,n,g,x);{w=Q(w,f,o);let v=w.node().getBBox();h.width=v.width,h.height=v.height+b.padding/2,H[f.id]={y:b.compositTitleSize}}}else h=_(i,f,a);if(f.note){const w={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},v=_(i,w,a);f.note.position==="left of"?(a.setNode(h.id+"-note",v),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",v)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;c.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:dt(r.title),height:b.labelHeight*T.getRows(r.title).length,labelpos:"c"},"id"+B)}),O(a),S.debug("Graph after layout",a.nodes());const m=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+m.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(H[r]?H[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+m.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),g.querySelectorAll("#"+m.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let v=0,M=0;w&&(w.parentElement&&(v=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let k=m.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),it(i,a.edge(r),a.edge(r).relation))}),k=m.getBBox();const E={id:d||"root",label:d||"root",width:0,height:0};return E.width=k.width+2*b.padding,E.height=k.height+2*b.padding,S.debug("Doc rendered",E,a),E},"renderDoc"),ot={setConf:rt,draw:st},Bt={parser:P,get db(){return new N(1)},renderer:ot,styles:W,init:u(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{Bt as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as r,b as e,a,S as s}from"./chunk-AEK57VVT-CbuETRiF.js";import{_ as i}from"./mermaid.core-CrL8DoR1.js";import"./chunk-RZ5BOZE2-CC9D19Ws.js";import"./conversation-input-sync-D8m_0i2P.js";import"./index-Dom8jp4B.js";import"./ui-preferences-store-Dz1d9H9b.js";import"./error-boundary-5hn9OWCr.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as s,c as xt,l as E,d as j,V as kt,W as vt,X as _t,Y as bt,D as wt,$ as St,z as Et}from"./mermaid.core-
|
|
1
|
+
import{_ as s,c as xt,l as E,d as j,V as kt,W as vt,X as _t,Y as bt,D as wt,$ as St,z as Et}from"./mermaid.core-CrL8DoR1.js";import{d as nt}from"./arc-C8xiXz_s.js";import"./conversation-input-sync-D8m_0i2P.js";import"./index-Dom8jp4B.js";import"./ui-preferences-store-Dz1d9H9b.js";import"./error-boundary-5hn9OWCr.js";var Q=function(){var n=s(function(x,i,a,c){for(a=a||{},c=x.length;c--;a[x[c]]=i);return a},"o"),t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],l=[1,10],r=[1,11],d=[1,12],h=[1,13],f=[1,16],m=[1,17],u={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:s(function(i,a,c,p,y,o,w){var v=o.length-1;switch(y){case 1:return o[v-1];case 2:this.$=[];break;case 3:o[v-1].push(o[v]),this.$=o[v-1];break;case 4:case 5:this.$=o[v];break;case 6:case 7:this.$=[];break;case 8:p.getCommonDb().setDiagramTitle(o[v].substr(6)),this.$=o[v].substr(6);break;case 9:this.$=o[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=o[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 12:p.addSection(o[v].substr(8)),this.$=o[v].substr(8);break;case 15:p.addTask(o[v],0,""),this.$=o[v];break;case 16:p.addEvent(o[v].substr(2)),this.$=o[v];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},n(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:l,14:r,16:d,17:h,18:14,19:15,20:f,21:m},n(t,[2,7],{1:[2,1]}),n(t,[2,3]),{9:18,11:e,12:l,14:r,16:d,17:h,18:14,19:15,20:f,21:m},n(t,[2,5]),n(t,[2,6]),n(t,[2,8]),{13:[1,19]},{15:[1,20]},n(t,[2,11]),n(t,[2,12]),n(t,[2,13]),n(t,[2,14]),n(t,[2,15]),n(t,[2,16]),n(t,[2,4]),n(t,[2,9]),n(t,[2,10])],defaultActions:{},parseError:s(function(i,a){if(a.recoverable)this.trace(i);else{var c=new Error(i);throw c.hash=a,c}},"parseError"),parse:s(function(i){var a=this,c=[0],p=[],y=[null],o=[],w=this.table,v="",N=0,A=0,V=2,U=1,M=o.slice.call(arguments,1),g=Object.create(this.lexer),b={yy:{}};for(var L in this.yy)Object.prototype.hasOwnProperty.call(this.yy,L)&&(b.yy[L]=this.yy[L]);g.setInput(i,b.yy),b.yy.lexer=g,b.yy.parser=this,typeof g.yylloc>"u"&&(g.yylloc={});var P=g.yylloc;o.push(P);var W=g.options&&g.options.ranges;typeof b.yy.parseError=="function"?this.parseError=b.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Z(T){c.length=c.length-2*T,y.length=y.length-T,o.length=o.length-T}s(Z,"popStack");function tt(){var T;return T=p.pop()||g.lex()||U,typeof T!="number"&&(T instanceof Array&&(p=T,T=p.pop()),T=a.symbols_[T]||T),T}s(tt,"lex");for(var S,C,I,J,R={},B,$,et,O;;){if(C=c[c.length-1],this.defaultActions[C]?I=this.defaultActions[C]:((S===null||typeof S>"u")&&(S=tt()),I=w[C]&&w[C][S]),typeof I>"u"||!I.length||!I[0]){var K="";O=[];for(B in w[C])this.terminals_[B]&&B>V&&O.push("'"+this.terminals_[B]+"'");g.showPosition?K="Parse error on line "+(N+1)+`:
|
|
2
2
|
`+g.showPosition()+`
|
|
3
3
|
Expecting `+O.join(", ")+", got '"+(this.terminals_[S]||S)+"'":K="Parse error on line "+(N+1)+": Unexpected "+(S==U?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(K,{text:g.match,token:this.terminals_[S]||S,line:g.yylineno,loc:P,expected:O})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+C+", token: "+S);switch(I[0]){case 1:c.push(S),y.push(g.yytext),o.push(g.yylloc),c.push(I[1]),S=null,A=g.yyleng,v=g.yytext,N=g.yylineno,P=g.yylloc;break;case 2:if($=this.productions_[I[1]][1],R.$=y[y.length-$],R._$={first_line:o[o.length-($||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-($||1)].first_column,last_column:o[o.length-1].last_column},W&&(R._$.range=[o[o.length-($||1)].range[0],o[o.length-1].range[1]]),J=this.performAction.apply(R,[v,A,N,b.yy,I[1],y,o].concat(M)),typeof J<"u")return J;$&&(c=c.slice(0,-1*$*2),y=y.slice(0,-1*$),o=o.slice(0,-1*$)),c.push(this.productions_[I[1]][0]),y.push(R.$),o.push(R._$),et=w[c[c.length-2]][c[c.length-1]],c.push(et);break;case 3:return!0}}return!0},"parse")},k=function(){var x={EOF:1,parseError:s(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:s(function(i,a){return this.yy=a||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:s(function(i){var a=i.length,c=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===p.length?this.yylloc.first_column:0)+p[p.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(i){this.unput(this.match.slice(i))},"less"),pastInput:s(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Nt,D as as}from"./index-Dom8jp4B.js";var I;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function s(a){throw new Error}e.assertNever=s,e.arrayToEnum=a=>{const o={};for(const r of a)o[r]=r;return o},e.getValidEnumValues=a=>{const o=e.objectKeys(a).filter(c=>typeof a[a[c]]!="number"),r={};for(const c of o)r[c]=a[c];return e.objectValues(r)},e.objectValues=a=>e.objectKeys(a).map(function(o){return a[o]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const o=[];for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&o.push(r);return o},e.find=(a,o)=>{for(const r of a)if(o(r))return r},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function i(a,o=" | "){return a.map(r=>typeof r=="string"?`'${r}'`:r).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(I||(I={}));var ft;(function(e){e.mergeShapes=(t,s)=>({...t,...s})})(ft||(ft={}));const h=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),G=e=>{switch(typeof e){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(e)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(e)?h.array:e===null?h.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?h.promise:typeof Map<"u"&&e instanceof Map?h.map:typeof Set<"u"&&e instanceof Set?h.set:typeof Date<"u"&&e instanceof Date?h.date:h.object;default:return h.unknown}},u=I.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),os=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class j extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=t}format(t){const s=t||function(o){return o.message},i={_errors:[]},a=o=>{for(const r of o.issues)if(r.code==="invalid_union")r.unionErrors.map(a);else if(r.code==="invalid_return_type")a(r.returnTypeError);else if(r.code==="invalid_arguments")a(r.argumentsError);else if(r.path.length===0)i._errors.push(s(r));else{let c=i,d=0;for(;d<r.path.length;){const l=r.path[d];d===r.path.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(s(r))):c[l]=c[l]||{_errors:[]},c=c[l],d++}}};return a(this),i}static assert(t){if(!(t instanceof j))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=s=>s.message){const s={},i=[];for(const a of this.issues)a.path.length>0?(s[a.path[0]]=s[a.path[0]]||[],s[a.path[0]].push(t(a))):i.push(t(a));return{formErrors:i,fieldErrors:s}}get formErrors(){return this.flatten()}}j.create=e=>new j(e);const ce=(e,t)=>{let s;switch(e.code){case u.invalid_type:e.received===h.undefined?s="Required":s=`Expected ${e.expected}, received ${e.received}`;break;case u.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,I.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:s=`Unrecognized key(s) in object: ${I.joinValues(e.keys,", ")}`;break;case u.invalid_union:s="Invalid input";break;case u.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${I.joinValues(e.options)}`;break;case u.invalid_enum_value:s=`Invalid enum value. Expected ${I.joinValues(e.options)}, received '${e.received}'`;break;case u.invalid_arguments:s="Invalid function arguments";break;case u.invalid_return_type:s="Invalid function return type";break;case u.invalid_date:s="Invalid date";break;case u.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:I.assertNever(e.validation):e.validation!=="regex"?s=`Invalid ${e.validation}`:s="Invalid";break;case u.too_small:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:s="Invalid input";break;case u.too_big:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?s=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:s="Invalid input";break;case u.custom:s="Invalid input";break;case u.invalid_intersection_types:s="Intersection results could not be merged";break;case u.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case u.not_finite:s="Number must be finite";break;default:s=t.defaultError,I.assertNever(e)}return{message:s}};let In=ce;function rs(e){In=e}function He(){return In}const Ve=e=>{const{data:t,path:s,errorMaps:i,issueData:a}=e,o=[...s,...a.path||[]],r={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.message};let c="";const d=i.filter(l=>!!l).slice().reverse();for(const l of d)c=l(r,{data:t,defaultError:c}).message;return{...a,path:o,message:c}},cs=[];function m(e,t){const s=He(),i=Ve({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===ce?void 0:ce].filter(a=>!!a)});e.common.issues.push(i)}class O{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,s){const i=[];for(const a of s){if(a.status==="aborted")return _;a.status==="dirty"&&t.dirty(),i.push(a.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,s){const i=[];for(const a of s){const o=await a.key,r=await a.value;i.push({key:o,value:r})}return O.mergeObjectSync(t,i)}static mergeObjectSync(t,s){const i={};for(const a of s){const{key:o,value:r}=a;if(o.status==="aborted"||r.status==="aborted")return _;o.status==="dirty"&&t.dirty(),r.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof r.value<"u"||a.alwaysSet)&&(i[o.value]=r.value)}return{status:t.value,value:i}}}const _=Object.freeze({status:"aborted"}),ae=e=>({status:"dirty",value:e}),C=e=>({status:"valid",value:e}),gt=e=>e.status==="aborted",vt=e=>e.status==="dirty",q=e=>e.status==="valid",be=e=>typeof Promise<"u"&&e instanceof Promise;function We(e,t,s,i){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function xn(e,t,s,i,a){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var f;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(f||(f={}));var fe,ge;class L{constructor(t,s,i,a){this._cachedPath=[],this.parent=t,this.data=s,this._path=i,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Dt=(e,t)=>{if(q(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new j(e.common.issues);return this._error=s,this._error}}};function k(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:i,description:a}=e;if(t&&(s||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(r,c)=>{var d,l;const{message:p}=e;return r.code==="invalid_enum_value"?{message:p??c.defaultError}:typeof c.data>"u"?{message:(d=p??i)!==null&&d!==void 0?d:c.defaultError}:r.code!=="invalid_type"?{message:c.defaultError}:{message:(l=p??s)!==null&&l!==void 0?l:c.defaultError}},description:a}}class S{get description(){return this._def.description}_getType(t){return G(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:G(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new O,ctx:{common:t.parent.common,data:t.data,parsedType:G(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const s=this._parse(t);if(be(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(t){const s=this._parse(t);return Promise.resolve(s)}parse(t,s){const i=this.safeParse(t,s);if(i.success)return i.data;throw i.error}safeParse(t,s){var i;const a={common:{issues:[],async:(i=s?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:G(t)},o=this._parseSync({data:t,path:a.path,parent:a});return Dt(a,o)}"~validate"(t){var s,i;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:G(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:a});return q(o)?{value:o.value}:{issues:a.common.issues}}catch(o){!((i=(s=o?.message)===null||s===void 0?void 0:s.toLowerCase())===null||i===void 0)&&i.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:a}).then(o=>q(o)?{value:o.value}:{issues:a.common.issues})}async parseAsync(t,s){const i=await this.safeParseAsync(t,s);if(i.success)return i.data;throw i.error}async safeParseAsync(t,s){const i={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:G(t)},a=this._parse({data:t,path:i.path,parent:i}),o=await(be(a)?a:Promise.resolve(a));return Dt(i,o)}refine(t,s){const i=a=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(a):s;return this._refinement((a,o)=>{const r=t(a),c=()=>o.addIssue({code:u.custom,...i(a)});return typeof Promise<"u"&&r instanceof Promise?r.then(d=>d?!0:(c(),!1)):r?!0:(c(),!1)})}refinement(t,s){return this._refinement((i,a)=>t(i)?!0:(a.addIssue(typeof s=="function"?s(i,a):s),!1))}_refinement(t){return new D({schema:this,typeName:b.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return $.create(this,this._def)}nullable(){return Y.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return de.create(this,this._def)}or(t){return Se.create([this,t],this._def)}and(t){return we.create(this,t,this._def)}transform(t){return new D({...k(this._def),schema:this,typeName:b.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const s=typeof t=="function"?t:()=>t;return new Re({...k(this._def),innerType:this,defaultValue:s,typeName:b.ZodDefault})}brand(){return new Et({typeName:b.ZodBranded,type:this,...k(this._def)})}catch(t){const s=typeof t=="function"?t:()=>t;return new Oe({...k(this._def),innerType:this,catchValue:s,typeName:b.ZodCatch})}describe(t){const s=this.constructor;return new s({...this._def,description:t})}pipe(t){return Ae.create(this,t)}readonly(){return Pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ls=/^c[^\s-]{8,}$/i,ds=/^[0-9a-z]+$/,us=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ps=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ms=/^[a-z0-9_-]{21}$/i,hs=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fs=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,gs=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let at;const bs=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_s=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ys=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ks=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ss=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ws=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Tn="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Is=new RegExp(`^${Tn}$`);function En(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function xs(e){return new RegExp(`^${En(e)}$`)}function Rn(e){let t=`${Tn}T${En(e)}`;const s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function Ts(e,t){return!!((t==="v4"||!t)&&bs.test(e)||(t==="v6"||!t)&&ys.test(e))}function Es(e,t){if(!hs.test(e))return!1;try{const[s]=e.split("."),i=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),a=JSON.parse(atob(i));return!(typeof a!="object"||a===null||!a.typ||!a.alg||t&&a.alg!==t)}catch{return!1}}function Rs(e,t){return!!((t==="v4"||!t)&&_s.test(e)||(t==="v6"||!t)&&ks.test(e))}class M extends S{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==h.string){const o=this._getOrReturnCtx(t);return m(o,{code:u.invalid_type,expected:h.string,received:o.parsedType}),_}const i=new O;let a;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:u.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:u.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){const r=t.data.length>o.value,c=t.data.length<o.value;(r||c)&&(a=this._getOrReturnCtx(t,a),r?m(a,{code:u.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&m(a,{code:u.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")gs.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"email",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")at||(at=new RegExp(vs,"u")),at.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"emoji",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")ps.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"uuid",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")ms.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"nanoid",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")ls.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cuid",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")ds.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cuid2",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")us.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"ulid",code:u.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),m(a,{validation:"url",code:u.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"regex",code:u.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?Rn(o).test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?Is.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?xs(o).test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:u.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?fs.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"duration",code:u.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?Ts(t.data,o.version)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"ip",code:u.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?Es(t.data,o.alg)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"jwt",code:u.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?Rs(t.data,o.version)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cidr",code:u.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?Ss.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"base64",code:u.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?ws.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"base64url",code:u.invalid_string,message:o.message}),i.dirty()):I.assertNever(o);return{status:i.value,value:t.data}}_regex(t,s,i){return this.refinement(a=>t.test(a),{validation:s,code:u.invalid_string,...f.errToObj(i)})}_addCheck(t){return new M({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...f.errToObj(t)})}url(t){return this._addCheck({kind:"url",...f.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...f.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...f.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...f.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...f.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...f.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...f.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...f.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...f.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...f.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...f.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...f.errToObj(t)})}datetime(t){var s,i;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(s=t?.offset)!==null&&s!==void 0?s:!1,local:(i=t?.local)!==null&&i!==void 0?i:!1,...f.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...f.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...f.errToObj(t)})}regex(t,s){return this._addCheck({kind:"regex",regex:t,...f.errToObj(s)})}includes(t,s){return this._addCheck({kind:"includes",value:t,position:s?.position,...f.errToObj(s?.message)})}startsWith(t,s){return this._addCheck({kind:"startsWith",value:t,...f.errToObj(s)})}endsWith(t,s){return this._addCheck({kind:"endsWith",value:t,...f.errToObj(s)})}min(t,s){return this._addCheck({kind:"min",value:t,...f.errToObj(s)})}max(t,s){return this._addCheck({kind:"max",value:t,...f.errToObj(s)})}length(t,s){return this._addCheck({kind:"length",value:t,...f.errToObj(s)})}nonempty(t){return this.min(1,f.errToObj(t))}trim(){return new M({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new M({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new M({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxLength(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}M.create=e=>{var t;return new M({checks:[],typeName:b.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...k(e)})};function Os(e,t){const s=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,a=s>i?s:i,o=parseInt(e.toFixed(a).replace(".","")),r=parseInt(t.toFixed(a).replace(".",""));return o%r/Math.pow(10,a)}class V extends S{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==h.number){const o=this._getOrReturnCtx(t);return m(o,{code:u.invalid_type,expected:h.number,received:o.parsedType}),_}let i;const a=new O;for(const o of this._def.checks)o.kind==="int"?I.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{code:u.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?Os(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),m(i,{code:u.not_finite,message:o.message}),a.dirty()):I.assertNever(o);return{status:a.value,value:t.data}}gte(t,s){return this.setLimit("min",t,!0,f.toString(s))}gt(t,s){return this.setLimit("min",t,!1,f.toString(s))}lte(t,s){return this.setLimit("max",t,!0,f.toString(s))}lt(t,s){return this.setLimit("max",t,!1,f.toString(s))}setLimit(t,s,i,a){return new V({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:i,message:f.toString(a)}]})}_addCheck(t){return new V({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:f.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:f.toString(s)})}finite(t){return this._addCheck({kind:"finite",message:f.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f.toString(t)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&I.isInteger(t.value))}get isFinite(){let t=null,s=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(s===null||i.value>s)&&(s=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(s)&&Number.isFinite(t)}}V.create=e=>new V({checks:[],typeName:b.ZodNumber,coerce:e?.coerce||!1,...k(e)});class W extends S{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==h.bigint)return this._getInvalidInput(t);let i;const a=new O;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),m(i,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):I.assertNever(o);return{status:a.value,value:t.data}}_getInvalidInput(t){const s=this._getOrReturnCtx(t);return m(s,{code:u.invalid_type,expected:h.bigint,received:s.parsedType}),_}gte(t,s){return this.setLimit("min",t,!0,f.toString(s))}gt(t,s){return this.setLimit("min",t,!1,f.toString(s))}lte(t,s){return this.setLimit("max",t,!0,f.toString(s))}lt(t,s){return this.setLimit("max",t,!1,f.toString(s))}setLimit(t,s,i,a){return new W({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:i,message:f.toString(a)}]})}_addCheck(t){return new W({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:f.toString(s)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}W.create=e=>{var t;return new W({checks:[],typeName:b.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...k(e)})};class _e extends S{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==h.boolean){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.boolean,received:i.parsedType}),_}return C(t.data)}}_e.create=e=>new _e({typeName:b.ZodBoolean,coerce:e?.coerce||!1,...k(e)});class ee extends S{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==h.date){const o=this._getOrReturnCtx(t);return m(o,{code:u.invalid_type,expected:h.date,received:o.parsedType}),_}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return m(o,{code:u.invalid_date}),_}const i=new O;let a;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:u.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:u.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):I.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ee({...this._def,checks:[...this._def.checks,t]})}min(t,s){return this._addCheck({kind:"min",value:t.getTime(),message:f.toString(s)})}max(t,s){return this._addCheck({kind:"max",value:t.getTime(),message:f.toString(s)})}get minDate(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t!=null?new Date(t):null}}ee.create=e=>new ee({checks:[],coerce:e?.coerce||!1,typeName:b.ZodDate,...k(e)});class Ke extends S{_parse(t){if(this._getType(t)!==h.symbol){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.symbol,received:i.parsedType}),_}return C(t.data)}}Ke.create=e=>new Ke({typeName:b.ZodSymbol,...k(e)});class ye extends S{_parse(t){if(this._getType(t)!==h.undefined){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.undefined,received:i.parsedType}),_}return C(t.data)}}ye.create=e=>new ye({typeName:b.ZodUndefined,...k(e)});class ke extends S{_parse(t){if(this._getType(t)!==h.null){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.null,received:i.parsedType}),_}return C(t.data)}}ke.create=e=>new ke({typeName:b.ZodNull,...k(e)});class le extends S{constructor(){super(...arguments),this._any=!0}_parse(t){return C(t.data)}}le.create=e=>new le({typeName:b.ZodAny,...k(e)});class Q extends S{constructor(){super(...arguments),this._unknown=!0}_parse(t){return C(t.data)}}Q.create=e=>new Q({typeName:b.ZodUnknown,...k(e)});class F extends S{_parse(t){const s=this._getOrReturnCtx(t);return m(s,{code:u.invalid_type,expected:h.never,received:s.parsedType}),_}}F.create=e=>new F({typeName:b.ZodNever,...k(e)});class Ye extends S{_parse(t){if(this._getType(t)!==h.undefined){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.void,received:i.parsedType}),_}return C(t.data)}}Ye.create=e=>new Ye({typeName:b.ZodVoid,...k(e)});class N extends S{_parse(t){const{ctx:s,status:i}=this._processInputParams(t),a=this._def;if(s.parsedType!==h.array)return m(s,{code:u.invalid_type,expected:h.array,received:s.parsedType}),_;if(a.exactLength!==null){const r=s.data.length>a.exactLength.value,c=s.data.length<a.exactLength.value;(r||c)&&(m(s,{code:r?u.too_big:u.too_small,minimum:c?a.exactLength.value:void 0,maximum:r?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),i.dirty())}if(a.minLength!==null&&s.data.length<a.minLength.value&&(m(s,{code:u.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),i.dirty()),a.maxLength!==null&&s.data.length>a.maxLength.value&&(m(s,{code:u.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),i.dirty()),s.common.async)return Promise.all([...s.data].map((r,c)=>a.type._parseAsync(new L(s,r,s.path,c)))).then(r=>O.mergeArray(i,r));const o=[...s.data].map((r,c)=>a.type._parseSync(new L(s,r,s.path,c)));return O.mergeArray(i,o)}get element(){return this._def.type}min(t,s){return new N({...this._def,minLength:{value:t,message:f.toString(s)}})}max(t,s){return new N({...this._def,maxLength:{value:t,message:f.toString(s)}})}length(t,s){return new N({...this._def,exactLength:{value:t,message:f.toString(s)}})}nonempty(t){return this.min(1,t)}}N.create=(e,t)=>new N({type:e,minLength:null,maxLength:null,exactLength:null,typeName:b.ZodArray,...k(t)});function ie(e){if(e instanceof E){const t={};for(const s in e.shape){const i=e.shape[s];t[s]=$.create(ie(i))}return new E({...e._def,shape:()=>t})}else return e instanceof N?new N({...e._def,type:ie(e.element)}):e instanceof $?$.create(ie(e.unwrap())):e instanceof Y?Y.create(ie(e.unwrap())):e instanceof U?U.create(e.items.map(t=>ie(t))):e}class E extends S{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),s=I.objectKeys(t);return this._cached={shape:t,keys:s}}_parse(t){if(this._getType(t)!==h.object){const l=this._getOrReturnCtx(t);return m(l,{code:u.invalid_type,expected:h.object,received:l.parsedType}),_}const{status:i,ctx:a}=this._processInputParams(t),{shape:o,keys:r}=this._getCached(),c=[];if(!(this._def.catchall instanceof F&&this._def.unknownKeys==="strip"))for(const l in a.data)r.includes(l)||c.push(l);const d=[];for(const l of r){const p=o[l],w=a.data[l];d.push({key:{status:"valid",value:l},value:p._parse(new L(a,w,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof F){const l=this._def.unknownKeys;if(l==="passthrough")for(const p of c)d.push({key:{status:"valid",value:p},value:{status:"valid",value:a.data[p]}});else if(l==="strict")c.length>0&&(m(a,{code:u.unrecognized_keys,keys:c}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const p of c){const w=a.data[p];d.push({key:{status:"valid",value:p},value:l._parse(new L(a,w,a.path,p)),alwaysSet:p in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const p of d){const w=await p.key,y=await p.value;l.push({key:w,value:y,alwaysSet:p.alwaysSet})}return l}).then(l=>O.mergeObjectSync(i,l)):O.mergeObjectSync(i,d)}get shape(){return this._def.shape()}strict(t){return f.errToObj,new E({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(s,i)=>{var a,o,r,c;const d=(r=(o=(a=this._def).errorMap)===null||o===void 0?void 0:o.call(a,s,i).message)!==null&&r!==void 0?r:i.defaultError;return s.code==="unrecognized_keys"?{message:(c=f.errToObj(t).message)!==null&&c!==void 0?c:d}:{message:d}}}:{}})}strip(){return new E({...this._def,unknownKeys:"strip"})}passthrough(){return new E({...this._def,unknownKeys:"passthrough"})}extend(t){return new E({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new E({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:b.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new E({...this._def,catchall:t})}pick(t){const s={};return I.objectKeys(t).forEach(i=>{t[i]&&this.shape[i]&&(s[i]=this.shape[i])}),new E({...this._def,shape:()=>s})}omit(t){const s={};return I.objectKeys(this.shape).forEach(i=>{t[i]||(s[i]=this.shape[i])}),new E({...this._def,shape:()=>s})}deepPartial(){return ie(this)}partial(t){const s={};return I.objectKeys(this.shape).forEach(i=>{const a=this.shape[i];t&&!t[i]?s[i]=a:s[i]=a.optional()}),new E({...this._def,shape:()=>s})}required(t){const s={};return I.objectKeys(this.shape).forEach(i=>{if(t&&!t[i])s[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof $;)o=o._def.innerType;s[i]=o}}),new E({...this._def,shape:()=>s})}keyof(){return On(I.objectKeys(this.shape))}}E.create=(e,t)=>new E({shape:()=>e,unknownKeys:"strip",catchall:F.create(),typeName:b.ZodObject,...k(t)});E.strictCreate=(e,t)=>new E({shape:()=>e,unknownKeys:"strict",catchall:F.create(),typeName:b.ZodObject,...k(t)});E.lazycreate=(e,t)=>new E({shape:e,unknownKeys:"strip",catchall:F.create(),typeName:b.ZodObject,...k(t)});class Se extends S{_parse(t){const{ctx:s}=this._processInputParams(t),i=this._def.options;function a(o){for(const c of o)if(c.result.status==="valid")return c.result;for(const c of o)if(c.result.status==="dirty")return s.common.issues.push(...c.ctx.common.issues),c.result;const r=o.map(c=>new j(c.ctx.common.issues));return m(s,{code:u.invalid_union,unionErrors:r}),_}if(s.common.async)return Promise.all(i.map(async o=>{const r={...s,common:{...s.common,issues:[]},parent:null};return{result:await o._parseAsync({data:s.data,path:s.path,parent:r}),ctx:r}})).then(a);{let o;const r=[];for(const d of i){const l={...s,common:{...s.common,issues:[]},parent:null},p=d._parseSync({data:s.data,path:s.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:l}),l.common.issues.length&&r.push(l.common.issues)}if(o)return s.common.issues.push(...o.ctx.common.issues),o.result;const c=r.map(d=>new j(d));return m(s,{code:u.invalid_union,unionErrors:c}),_}}get options(){return this._def.options}}Se.create=(e,t)=>new Se({options:e,typeName:b.ZodUnion,...k(t)});const B=e=>e instanceof xe?B(e.schema):e instanceof D?B(e.innerType()):e instanceof Te?[e.value]:e instanceof K?e.options:e instanceof Ee?I.objectValues(e.enum):e instanceof Re?B(e._def.innerType):e instanceof ye?[void 0]:e instanceof ke?[null]:e instanceof $?[void 0,...B(e.unwrap())]:e instanceof Y?[null,...B(e.unwrap())]:e instanceof Et||e instanceof Pe?B(e.unwrap()):e instanceof Oe?B(e._def.innerType):[];class Qe extends S{_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==h.object)return m(s,{code:u.invalid_type,expected:h.object,received:s.parsedType}),_;const i=this.discriminator,a=s.data[i],o=this.optionsMap.get(a);return o?s.common.async?o._parseAsync({data:s.data,path:s.path,parent:s}):o._parseSync({data:s.data,path:s.path,parent:s}):(m(s,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,s,i){const a=new Map;for(const o of s){const r=B(o.shape[t]);if(!r.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of r){if(a.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);a.set(c,o)}}return new Qe({typeName:b.ZodDiscriminatedUnion,discriminator:t,options:s,optionsMap:a,...k(i)})}}function bt(e,t){const s=G(e),i=G(t);if(e===t)return{valid:!0,data:e};if(s===h.object&&i===h.object){const a=I.objectKeys(t),o=I.objectKeys(e).filter(c=>a.indexOf(c)!==-1),r={...e,...t};for(const c of o){const d=bt(e[c],t[c]);if(!d.valid)return{valid:!1};r[c]=d.data}return{valid:!0,data:r}}else if(s===h.array&&i===h.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let o=0;o<e.length;o++){const r=e[o],c=t[o],d=bt(r,c);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return s===h.date&&i===h.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class we extends S{_parse(t){const{status:s,ctx:i}=this._processInputParams(t),a=(o,r)=>{if(gt(o)||gt(r))return _;const c=bt(o.value,r.value);return c.valid?((vt(o)||vt(r))&&s.dirty(),{status:s.value,value:c.data}):(m(i,{code:u.invalid_intersection_types}),_)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,r])=>a(o,r)):a(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}we.create=(e,t,s)=>new we({left:e,right:t,typeName:b.ZodIntersection,...k(s)});class U extends S{_parse(t){const{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==h.array)return m(i,{code:u.invalid_type,expected:h.array,received:i.parsedType}),_;if(i.data.length<this._def.items.length)return m(i,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&i.data.length>this._def.items.length&&(m(i,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const o=[...i.data].map((r,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new L(i,r,i.path,c)):null}).filter(r=>!!r);return i.common.async?Promise.all(o).then(r=>O.mergeArray(s,r)):O.mergeArray(s,o)}get items(){return this._def.items}rest(t){return new U({...this._def,rest:t})}}U.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new U({items:e,typeName:b.ZodTuple,rest:null,...k(t)})};class Ie extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==h.object)return m(i,{code:u.invalid_type,expected:h.object,received:i.parsedType}),_;const a=[],o=this._def.keyType,r=this._def.valueType;for(const c in i.data)a.push({key:o._parse(new L(i,c,i.path,c)),value:r._parse(new L(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?O.mergeObjectAsync(s,a):O.mergeObjectSync(s,a)}get element(){return this._def.valueType}static create(t,s,i){return s instanceof S?new Ie({keyType:t,valueType:s,typeName:b.ZodRecord,...k(i)}):new Ie({keyType:M.create(),valueType:t,typeName:b.ZodRecord,...k(s)})}}class Xe extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==h.map)return m(i,{code:u.invalid_type,expected:h.map,received:i.parsedType}),_;const a=this._def.keyType,o=this._def.valueType,r=[...i.data.entries()].map(([c,d],l)=>({key:a._parse(new L(i,c,i.path,[l,"key"])),value:o._parse(new L(i,d,i.path,[l,"value"]))}));if(i.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of r){const l=await d.key,p=await d.value;if(l.status==="aborted"||p.status==="aborted")return _;(l.status==="dirty"||p.status==="dirty")&&s.dirty(),c.set(l.value,p.value)}return{status:s.value,value:c}})}else{const c=new Map;for(const d of r){const l=d.key,p=d.value;if(l.status==="aborted"||p.status==="aborted")return _;(l.status==="dirty"||p.status==="dirty")&&s.dirty(),c.set(l.value,p.value)}return{status:s.value,value:c}}}}Xe.create=(e,t,s)=>new Xe({valueType:t,keyType:e,typeName:b.ZodMap,...k(s)});class te extends S{_parse(t){const{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==h.set)return m(i,{code:u.invalid_type,expected:h.set,received:i.parsedType}),_;const a=this._def;a.minSize!==null&&i.data.size<a.minSize.value&&(m(i,{code:u.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),s.dirty()),a.maxSize!==null&&i.data.size>a.maxSize.value&&(m(i,{code:u.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),s.dirty());const o=this._def.valueType;function r(d){const l=new Set;for(const p of d){if(p.status==="aborted")return _;p.status==="dirty"&&s.dirty(),l.add(p.value)}return{status:s.value,value:l}}const c=[...i.data.values()].map((d,l)=>o._parse(new L(i,d,i.path,l)));return i.common.async?Promise.all(c).then(d=>r(d)):r(c)}min(t,s){return new te({...this._def,minSize:{value:t,message:f.toString(s)}})}max(t,s){return new te({...this._def,maxSize:{value:t,message:f.toString(s)}})}size(t,s){return this.min(t,s).max(t,s)}nonempty(t){return this.min(1,t)}}te.create=(e,t)=>new te({valueType:e,minSize:null,maxSize:null,typeName:b.ZodSet,...k(t)});class oe extends S{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==h.function)return m(s,{code:u.invalid_type,expected:h.function,received:s.parsedType}),_;function i(c,d){return Ve({data:c,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,He(),ce].filter(l=>!!l),issueData:{code:u.invalid_arguments,argumentsError:d}})}function a(c,d){return Ve({data:c,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,He(),ce].filter(l=>!!l),issueData:{code:u.invalid_return_type,returnTypeError:d}})}const o={errorMap:s.common.contextualErrorMap},r=s.data;if(this._def.returns instanceof de){const c=this;return C(async function(...d){const l=new j([]),p=await c._def.args.parseAsync(d,o).catch(P=>{throw l.addIssue(i(d,P)),l}),w=await Reflect.apply(r,this,p);return await c._def.returns._def.type.parseAsync(w,o).catch(P=>{throw l.addIssue(a(w,P)),l})})}else{const c=this;return C(function(...d){const l=c._def.args.safeParse(d,o);if(!l.success)throw new j([i(d,l.error)]);const p=Reflect.apply(r,this,l.data),w=c._def.returns.safeParse(p,o);if(!w.success)throw new j([a(p,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new oe({...this._def,args:U.create(t).rest(Q.create())})}returns(t){return new oe({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,s,i){return new oe({args:t||U.create([]).rest(Q.create()),returns:s||Q.create(),typeName:b.ZodFunction,...k(i)})}}class xe extends S{get schema(){return this._def.getter()}_parse(t){const{ctx:s}=this._processInputParams(t);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}xe.create=(e,t)=>new xe({getter:e,typeName:b.ZodLazy,...k(t)});class Te extends S{_parse(t){if(t.data!==this._def.value){const s=this._getOrReturnCtx(t);return m(s,{received:s.data,code:u.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:t.data}}get value(){return this._def.value}}Te.create=(e,t)=>new Te({value:e,typeName:b.ZodLiteral,...k(t)});function On(e,t){return new K({values:e,typeName:b.ZodEnum,...k(t)})}class K extends S{constructor(){super(...arguments),fe.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const s=this._getOrReturnCtx(t),i=this._def.values;return m(s,{expected:I.joinValues(i),received:s.parsedType,code:u.invalid_type}),_}if(We(this,fe)||xn(this,fe,new Set(this._def.values)),!We(this,fe).has(t.data)){const s=this._getOrReturnCtx(t),i=this._def.values;return m(s,{received:s.data,code:u.invalid_enum_value,options:i}),_}return C(t.data)}get options(){return this._def.values}get enum(){const t={};for(const s of this._def.values)t[s]=s;return t}get Values(){const t={};for(const s of this._def.values)t[s]=s;return t}get Enum(){const t={};for(const s of this._def.values)t[s]=s;return t}extract(t,s=this._def){return K.create(t,{...this._def,...s})}exclude(t,s=this._def){return K.create(this.options.filter(i=>!t.includes(i)),{...this._def,...s})}}fe=new WeakMap;K.create=On;class Ee extends S{constructor(){super(...arguments),ge.set(this,void 0)}_parse(t){const s=I.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==h.string&&i.parsedType!==h.number){const a=I.objectValues(s);return m(i,{expected:I.joinValues(a),received:i.parsedType,code:u.invalid_type}),_}if(We(this,ge)||xn(this,ge,new Set(I.getValidEnumValues(this._def.values))),!We(this,ge).has(t.data)){const a=I.objectValues(s);return m(i,{received:i.data,code:u.invalid_enum_value,options:a}),_}return C(t.data)}get enum(){return this._def.values}}ge=new WeakMap;Ee.create=(e,t)=>new Ee({values:e,typeName:b.ZodNativeEnum,...k(t)});class de extends S{unwrap(){return this._def.type}_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==h.promise&&s.common.async===!1)return m(s,{code:u.invalid_type,expected:h.promise,received:s.parsedType}),_;const i=s.parsedType===h.promise?s.data:Promise.resolve(s.data);return C(i.then(a=>this._def.type.parseAsync(a,{path:s.path,errorMap:s.common.contextualErrorMap})))}}de.create=(e,t)=>new de({type:e,typeName:b.ZodPromise,...k(t)});class D extends S{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===b.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:s,ctx:i}=this._processInputParams(t),a=this._def.effect||null,o={addIssue:r=>{m(i,r),r.fatal?s.abort():s.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){const r=a.transform(i.data,o);if(i.common.async)return Promise.resolve(r).then(async c=>{if(s.value==="aborted")return _;const d=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return d.status==="aborted"?_:d.status==="dirty"||s.value==="dirty"?ae(d.value):d});{if(s.value==="aborted")return _;const c=this._def.schema._parseSync({data:r,path:i.path,parent:i});return c.status==="aborted"?_:c.status==="dirty"||s.value==="dirty"?ae(c.value):c}}if(a.type==="refinement"){const r=c=>{const d=a.refinement(c,o);if(i.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?_:(c.status==="dirty"&&s.dirty(),r(c.value),{status:s.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?_:(c.status==="dirty"&&s.dirty(),r(c.value).then(()=>({status:s.value,value:c.value}))))}if(a.type==="transform")if(i.common.async===!1){const r=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!q(r))return r;const c=a.transform(r.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(r=>q(r)?Promise.resolve(a.transform(r.value,o)).then(c=>({status:s.value,value:c})):r);I.assertNever(a)}}D.create=(e,t,s)=>new D({schema:e,typeName:b.ZodEffects,effect:t,...k(s)});D.createWithPreprocess=(e,t,s)=>new D({schema:t,effect:{type:"preprocess",transform:e},typeName:b.ZodEffects,...k(s)});class $ extends S{_parse(t){return this._getType(t)===h.undefined?C(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$.create=(e,t)=>new $({innerType:e,typeName:b.ZodOptional,...k(t)});class Y extends S{_parse(t){return this._getType(t)===h.null?C(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Y.create=(e,t)=>new Y({innerType:e,typeName:b.ZodNullable,...k(t)});class Re extends S{_parse(t){const{ctx:s}=this._processInputParams(t);let i=s.data;return s.parsedType===h.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}Re.create=(e,t)=>new Re({innerType:e,typeName:b.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...k(t)});class Oe extends S{_parse(t){const{ctx:s}=this._processInputParams(t),i={...s,common:{...s.common,issues:[]}},a=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return be(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new j(i.common.issues)},input:i.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new j(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Oe.create=(e,t)=>new Oe({innerType:e,typeName:b.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...k(t)});class Je extends S{_parse(t){if(this._getType(t)!==h.nan){const i=this._getOrReturnCtx(t);return m(i,{code:u.invalid_type,expected:h.nan,received:i.parsedType}),_}return{status:"valid",value:t.data}}}Je.create=e=>new Je({typeName:b.ZodNaN,...k(e)});const Ps=Symbol("zod_brand");class Et extends S{_parse(t){const{ctx:s}=this._processInputParams(t),i=s.data;return this._def.type._parse({data:i,path:s.path,parent:s})}unwrap(){return this._def.type}}class Ae extends S{_parse(t){const{status:s,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?_:o.status==="dirty"?(s.dirty(),ae(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{const a=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?_:a.status==="dirty"?(s.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:i.path,parent:i})}}static create(t,s){return new Ae({in:t,out:s,typeName:b.ZodPipeline})}}class Pe extends S{_parse(t){const s=this._def.innerType._parse(t),i=a=>(q(a)&&(a.value=Object.freeze(a.value)),a);return be(s)?s.then(a=>i(a)):i(s)}unwrap(){return this._def.innerType}}Pe.create=(e,t)=>new Pe({innerType:e,typeName:b.ZodReadonly,...k(t)});function $t(e,t){const s=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof s=="string"?{message:s}:s}function Pn(e,t={},s){return e?le.create().superRefine((i,a)=>{var o,r;const c=e(i);if(c instanceof Promise)return c.then(d=>{var l,p;if(!d){const w=$t(t,i),y=(p=(l=w.fatal)!==null&&l!==void 0?l:s)!==null&&p!==void 0?p:!0;a.addIssue({code:"custom",...w,fatal:y})}});if(!c){const d=$t(t,i),l=(r=(o=d.fatal)!==null&&o!==void 0?o:s)!==null&&r!==void 0?r:!0;a.addIssue({code:"custom",...d,fatal:l})}}):le.create()}const Cs={object:E.lazycreate};var b;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(b||(b={}));const As=(e,t={message:`Input not instance of ${e.name}`})=>Pn(s=>s instanceof e,t),Cn=M.create,An=V.create,js=Je.create,Ms=W.create,jn=_e.create,Ns=ee.create,Ds=Ke.create,$s=ye.create,Ls=ke.create,Us=le.create,Zs=Q.create,Bs=F.create,Gs=Ye.create,Fs=N.create,zs=E.create,Hs=E.strictCreate,Vs=Se.create,Ws=Qe.create,Ks=we.create,Ys=U.create,Xs=Ie.create,Js=Xe.create,Qs=te.create,qs=oe.create,ei=xe.create,ti=Te.create,ni=K.create,si=Ee.create,ii=de.create,Lt=D.create,ai=$.create,oi=Y.create,ri=D.createWithPreprocess,ci=Ae.create,li=()=>Cn().optional(),di=()=>An().optional(),ui=()=>jn().optional(),pi={string:e=>M.create({...e,coerce:!0}),number:e=>V.create({...e,coerce:!0}),boolean:e=>_e.create({...e,coerce:!0}),bigint:e=>W.create({...e,coerce:!0}),date:e=>ee.create({...e,coerce:!0})},mi=_;var n=Object.freeze({__proto__:null,defaultErrorMap:ce,setErrorMap:rs,getErrorMap:He,makeIssue:Ve,EMPTY_PATH:cs,addIssueToContext:m,ParseStatus:O,INVALID:_,DIRTY:ae,OK:C,isAborted:gt,isDirty:vt,isValid:q,isAsync:be,get util(){return I},get objectUtil(){return ft},ZodParsedType:h,getParsedType:G,ZodType:S,datetimeRegex:Rn,ZodString:M,ZodNumber:V,ZodBigInt:W,ZodBoolean:_e,ZodDate:ee,ZodSymbol:Ke,ZodUndefined:ye,ZodNull:ke,ZodAny:le,ZodUnknown:Q,ZodNever:F,ZodVoid:Ye,ZodArray:N,ZodObject:E,ZodUnion:Se,ZodDiscriminatedUnion:Qe,ZodIntersection:we,ZodTuple:U,ZodRecord:Ie,ZodMap:Xe,ZodSet:te,ZodFunction:oe,ZodLazy:xe,ZodLiteral:Te,ZodEnum:K,ZodNativeEnum:Ee,ZodPromise:de,ZodEffects:D,ZodTransformer:D,ZodOptional:$,ZodNullable:Y,ZodDefault:Re,ZodCatch:Oe,ZodNaN:Je,BRAND:Ps,ZodBranded:Et,ZodPipeline:Ae,ZodReadonly:Pe,custom:Pn,Schema:S,ZodSchema:S,late:Cs,get ZodFirstPartyTypeKind(){return b},coerce:pi,any:Us,array:Fs,bigint:Ms,boolean:jn,date:Ns,discriminatedUnion:Ws,effect:Lt,enum:ni,function:qs,instanceof:As,intersection:Ks,lazy:ei,literal:ti,map:Js,nan:js,nativeEnum:si,never:Bs,null:Ls,nullable:oi,number:An,object:zs,oboolean:ui,onumber:di,optional:ai,ostring:li,pipeline:ci,preprocess:ri,promise:ii,record:Xs,set:Qs,strictObject:Hs,string:Cn,symbol:Ds,transformer:Lt,tuple:Ys,undefined:$s,union:Vs,unknown:Zs,void:Gs,NEVER:mi,ZodIssueCode:u,quotelessJson:os,ZodError:j});const hi=n.enum(["app_start","sign_in","window_focus","surface_open"]),Mn=n.object({id:n.string().min(1),state:n.enum(["active","paused","disabled"])}).passthrough(),fi=n.object({tenant_id:n.string().min(1),tenant_name:n.string().optional(),eligible:n.boolean(),endpoint:Mn.nullable()}).passthrough(),gi=n.object({code:n.string(),message:n.string(),details:n.record(n.unknown()).optional(),retry_after_seconds:n.number().optional()}).passthrough(),lr=n.object({capability:n.number(),consent_account_guard:n.boolean().optional(),state:n.enum(["ready","signed_out","unavailable","update_required"]),account_id:n.string().nullable(),tenant_id:n.string().nullable(),surface_state:n.enum(["A","B","C","D","E","F","G"]).nullable(),visibility:n.object({settings:n.boolean(),inbox:n.boolean(),account_door:n.boolean(),onboarding:n.boolean()}),update_required:n.boolean(),local:n.object({enabled:n.boolean(),onboarding:n.string(),session:n.string()}),status:n.object({tenants:n.array(fi)}).passthrough().nullable(),consent:n.object({version:n.string().min(1).max(128),text:n.string().min(1).refine(e=>new TextEncoder().encode(e).length<=2048,"Consent exceeds the served-text contract"),source:n.enum(["served","cached","embedded"])}).nullable(),error:gi.nullable()}).passthrough(),dr=n.object({endpoint:Mn.extend({account_id:n.string().min(1),tenant_id:n.string().min(1)})}).passthrough();function ur(e,t){if(!e||!t||e.account_id!==t||e.capability<1||e.state!=="ready"||e.update_required||e.surface_state!=="B"||!e.visibility.onboarding||!e.tenant_id)return null;const s=e.status?.tenants.filter(i=>i.tenant_id===e.tenant_id);return s?.length!==1||s[0].eligible!==!0||s[0].endpoint!==null?null:{accountId:t,tenantId:e.tenant_id}}function pr(e){const t=e?.consent;return t&&(t.source==="served"||t.source==="cached")?t:null}const vi=6*1024,bi=512;function _t(e,t,s){let i=new TextEncoder().encode(`${t}${e.size?`?${e}`:""}`).length;const a=[];for(const o of s){if(a.length===bi)break;const c=new URLSearchParams({order_ids:o}).toString().length+1;if(i+c>vi)break;e.append("order_ids",o),a.push(o),i+=c}return a}function mr(e,t,s){return _t(new URLSearchParams(s),t,e)}const v=n.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),$e=n.string().min(1).max(256).regex(/^[a-zA-Z0-9_][a-zA-Z0-9_.-]*$/),Le=n.string().min(1).max(32768),_i=/^[a-f0-9]{12}$/,g=n.string().regex(_i),ot=n.string().regex(/^[a-f0-9]{12}$/),rt=n.string().min(1).max(128),yi=n.string().min(1).max(4096),ct=n.string().regex(/^[A-Za-z0-9_.:-]{1,100}$/),Ue=n.string().regex(/^\$\{[A-Za-z_][A-Za-z0-9_]*\}$/),Ut=n.string().regex(/^[a-f0-9]{32}$/),ki=/^(\/|[A-Za-z]:[\\/])/,lt=n.string().min(1).max(4096).regex(ki),Zt=/^[a-f0-9]{32}$/,x=n.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/),Bt=n.string().min(1).max(512).nullish(),se=n.string().regex(/^[A-Za-z0-9_-]{1,128}$/),Gt=n.string().regex(/^ap_[0-9a-hjkmnp-tv-z]{1,64}$/),Ft=n.object({data_b64:n.string().min(1).max(1e6),mime_type:n.enum(["image/png","image/jpeg","image/gif","image/webp"])}).strict(),zt=2e5,Ht=8,Si=256,wi=100,Vt=16,Ii=256,xi=100,Ti=200,Ei=1e6,Ri=n.enum(["auto","none","minimal","low","medium","high","xhigh","max"]),R=n.string().min(1).max(128).refine(e=>e!=="."&&e!==".."&&!e.includes("/")&&!e.includes("\\")&&[...e].every(t=>t.charCodeAt(0)>=32&&t.charCodeAt(0)!==127)),Ze=n.object({kind:n.enum(["agent","team"]),name:R}).strict(),Nn=n.enum(["claude","codex","omp"]),Oi=n.record(n.string(),n.array(n.string().min(1).max(512)).max(5e3)),Wt={sources:n.array(Nn).max(3).optional(),sessionIds:Oi.optional(),all:n.boolean().optional(),includeSubagents:n.boolean().optional(),includeClearedSegments:n.boolean().optional(),includeMemory:n.boolean().optional(),includeInstructions:n.boolean().optional(),maxSessions:n.number().int().min(1).max(5e3).optional()},dt=n.object({provider:n.string().min(1).max(128),model_id:n.string().min(1).max(512),reasoning_effort:n.string().min(1).max(64).nullable()}).strict(),Kt=n.object({kind:n.enum(["role","specialist"]).optional(),description:n.string().max(8e3).optional(),instructions:n.string().max(8e3).optional(),tools:n.array(n.string().min(1).max(128)).max(256).optional(),effort:n.string().max(64).optional(),delegate:n.boolean().optional(),action_class:n.enum(["reactive","proactive"]).optional()}).strict(),Yt=n.object({name:n.string().min(1).max(64).optional(),description:n.string().max(8e3).optional(),manager:R.optional(),members:n.array(n.object({role:R,count:n.number().int().min(1).max(16),kind:n.enum(["agent","team"]),tier:n.enum(["lo","med","hi"]).nullable().optional(),effort:Ri.nullable().optional()}).strict()).max(128).optional(),instructions:n.string().max(8e3).optional(),project:n.string().max(8e3).optional()}).strict(),Pi=n.record(n.array(n.string().max(1024)).max(100)),Xt=n.enum(["minutes","hours","days"]);function Ci(e){return!/^\.+$/.test(e)}const hr=e=>ze.safeParse(e).success,ze=n.string().min(1).max(128).refine(e=>[...e].every(t=>t.charCodeAt(0)>=32&&t.charCodeAt(0)!==127&&t!=="/"&&t!=="\\")).refine(Ci),Jt=n.enum(["str","int","float","bool","list","dict"]),Qt=n.string().max(16384),Ai=2e3,qt=n.string().min(1).max(Ai),en=n.string().min(1).max(64),ji=n.string().min(1).max(64),Mi=n.string().min(1).max(64),tn=n.object({is_active:n.boolean().nullish(),one_time:n.boolean().nullish(),start_time_utc:n.string().max(64).nullish(),end_time_utc:n.string().max(64).nullish()}).strict(),Ni=n.object({conversation_length:n.number().int().optional(),detail_length:n.number().int().optional(),max_learnings_history:n.number().int().optional(),hosting:n.string().max(256).optional(),model_name:n.string().max(1024).optional(),auto_save_conversation:n.boolean().optional()}).strict(),yt=128,nn=2e3,sn=8e3,an=64,on=64,qe=e=>[...e].length,kt=e=>e>=9&&e<=13||e>=28&&e<=32||e===133||e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288,Di=e=>e===9||e===10||e===11||e===12||e===13||e===133,$i=e=>e<=31||e>=127&&e<=159,Li=e=>new RegExp("\\p{Cf}","u").test(String.fromCodePoint(e)),Ui=e=>e>=8234&&e<=8238||e>=8294&&e<=8297,Be=(e,t)=>{for(const s of e)if(t(s.codePointAt(0)??0))return!0;return!1},Dn=e=>{const t=[...e];let s=0,i=t.length;for(;s<i&&kt(t[s].codePointAt(0)??0);)s++;for(;i>s&&kt(t[i-1].codePointAt(0)??0);)i--;return t.slice(s,i).join("")},Zi=e=>{let t="",s=!1;for(const i of e){if(kt(i.codePointAt(0)??0)){s=t.length>0;continue}s&&(t+=" ",s=!1),t+=i}return t};function Bi(e){const t=Dn(e);if(!t)return"must not be empty";if(qe(t)>yt)return`must be at most ${yt} characters`;if(/[/\\:]/.test(t))return'must not contain "/", "\\" or ":"';if(Be(t,Ui))return"must not contain Unicode bidirectional override characters";if(Be(t,Di))return"must not contain whitespace";if(Be(t,$i))return"must not contain control characters";if(Be(t,Li))return"must not contain invisible Unicode formatting characters";const s=[...t];return"-.".includes(s[0])||"-.".includes(s[s.length-1])?'must not begin or end with "-" or "."':null}function fr(e){return Zi(Dn(e).normalize("NFKC").toLowerCase())}function Gi(e){return e.trim()?qe(e)>nn?`must be at most ${nn} characters`:null:"must not be empty"}function Fi(e){return e.trim()?qe(e)>sn?`must be at most ${sn} characters`:null:"must not be empty"}function zi(e){if(e.length>on)return`must hold at most ${on} items`;for(const t of e)if(!t.trim()||qe(t)>an)return`must hold items of 1 to ${an} characters`;return null}const Hi=e=>Bi(e)===null,Vi=n.string().refine(Hi,{message:"That is not a name the hub can publish."}),Wi=n.string().refine(e=>Fi(e)===null,{message:"That instruction body cannot be published."}),Ki=n.string().refine(e=>Gi(e)===null,{message:"That description cannot be published."}),Yi=n.array(n.string()).refine(e=>zi(e)===null,{message:"That tool list cannot be published."}),ut={requestId:x.optional(),subscribe:n.boolean().optional(),autoPush:n.boolean().optional(),confirmPublicEgress:n.boolean().optional()},rn=n.object({name:Vi,description:Ki,instructions:Wi,kind:n.enum(["role","specialist"]),when_to_use:n.string(),tools:Yi,effort:n.string(),delegate:n.boolean(),version:n.string(),categories:n.array(n.string()),tags:n.array(n.string())}).partial().strict(),Xi=n.enum(["team","agent"]),Ji=n.string().min(1).max(64),Qi=n.string().min(1).max(256),$n=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,pt=n.string().regex($n,{message:"Letters, digits, dot, underscore and dash; no spaces."}),qi=["planning","active","qa","validation","done","paused","archived"],cn=n.enum(qi),Ge=n.string().regex(/^$|^\d{4}-\d{2}-\d{2}$/,"Dates are YYYY-MM-DD, or empty to clear."),ln=n.array(n.string().min(1).max(24)).max(8),z=n.string().min(1).max(64),ea=1e3,dn=240,un=80,ta=256,na=100,sa=200,ia=/^[a-z0-9][a-z0-9_-]{0,23}$/;function gr(e){return e?$n.test(e)?null:"Names start with a letter or digit and may use letters, digits, dot, underscore or dash.":"Give the project a name."}function vr(e){return ia.test(e)?null:"Tags are 1-24 characters of lowercase letters, digits, underscore or dash."}const Fe=n.enum(["agent","team"]),aa=n.discriminatedUnion("op",[n.object({op:n.literal("capabilities")}).strict(),n.object({op:n.literal("runtimes.list")}).strict(),n.object({op:n.literal("profiles.list")}).strict(),n.object({op:n.literal("profiles.get"),name:R}).strict(),n.object({op:n.literal("imports.sources")}).strict(),n.object({op:n.literal("imports.sessions"),source:Nn,includeSubagents:n.boolean().optional()}).strict(),n.object({op:n.literal("imports.preview"),...Wt}).strict(),n.object({op:n.literal("imports.start"),...Wt}).strict(),n.object({op:n.literal("imports.status"),jobId:n.string().min(1).max(128)}).strict(),n.object({op:n.literal("imports.cancel"),jobId:n.string().min(1).max(128)}).strict(),n.object({op:n.literal("profiles.update"),name:R,requestId:x,fields:Kt,expectedDefinitionRevision:Bt.optional()}).strict(),n.object({op:n.literal("profiles.install"),name:R,requestId:x}).strict(),n.object({op:n.literal("profiles.create"),name:R,requestId:x,fields:Kt.extend({description:n.string().max(8e3),instructions:n.string().min(1).max(8e3)})}).strict(),n.object({op:n.literal("hub.updates")}).strict(),n.object({op:n.literal("hub.skillPull"),requestId:x,hubId:v,hubSource:n.string().min(1).max(2048),visibility:n.enum(["public","org"]),tenantId:v.nullable(),localAlias:R,subscribe:n.boolean().optional(),autoPush:n.boolean().optional(),confirmPublicEgress:n.boolean().optional()}).strict(),n.object({op:n.literal("hub.skillPublish"),requestId:x,dryRun:n.boolean(),sourceSkill:R,localAlias:R,visibility:n.enum(["public","org"]),tenantId:v.nullable(),subscribe:n.boolean(),autoPush:n.boolean(),confirmPublicEgress:n.boolean(),previewReceipt:n.string().min(1).max(4096).optional(),confirmPublish:n.literal(!0).optional()}).strict(),n.object({op:n.literal("hub.links"),kind:n.enum(["agent","team","skill"]).optional()}).strict(),n.object({op:n.literal("hub.policy"),requestId:x,linkId:n.string().min(1).max(256),expectedPolicyRevision:n.string().min(1).max(256),subscribe:n.boolean().optional(),autoPush:n.boolean().optional(),confirmPublicEgress:n.boolean().optional()}).strict(),n.object({op:n.literal("hub.check"),requestId:x,linkId:n.string().min(1).max(256).optional(),direction:n.enum(["pull","push"]).optional(),kind:Fe.optional(),name:R.optional()}).strict(),n.object({op:n.literal("hub.apply"),requestId:x,previewReceipt:n.string().min(1).max(4096).optional(),confirmApply:n.literal(!0).optional(),linkId:n.string().min(1).max(256).optional(),direction:n.literal("pull").optional(),kind:Fe.optional(),name:R.optional(),prefer:n.enum(["local","remote"]).optional(),acknowledgeUnknownBaseline:n.boolean().optional(),dryRun:n.boolean().optional(),resolveSource:n.literal(!0).optional(),hubSource:n.string().min(1).max(2048).optional(),visibility:n.enum(["public","org"]).optional(),tenantId:n.string().min(1).max(128).nullable().optional()}).strict(),n.object({op:n.literal("hub.applyAll"),requestId:x,kind:Fe.optional()}).strict(),n.object({op:n.literal("hub.retry"),requestId:x,linkId:n.string().min(1).max(256).optional(),direction:n.enum(["pull","push"]).optional(),kind:Fe.optional(),name:R.optional()}).strict(),n.object({op:n.literal("hub.push"),requestId:x,linkId:n.string().min(1).max(256),direction:n.literal("push"),dryRun:n.boolean(),previewReceipt:n.string().min(1).max(4096).optional(),confirmPublish:n.literal(!0).optional()}).strict(),n.object({op:n.literal("teams.list")}).strict(),n.object({op:n.literal("teams.get"),name:R}).strict(),n.object({op:n.literal("teams.effective"),name:R}).strict(),n.object({op:n.literal("teams.update"),name:R,requestId:x,fields:Yt,expectedDefinitionRevision:Bt.optional()}).strict(),n.object({op:n.literal("teams.create"),requestId:x,fields:Yt.extend({name:n.string().min(1).max(64)})}).strict(),n.object({op:n.literal("sessions.list"),limit:n.number().int().min(1).max(500).optional(),include_archived:n.boolean().optional(),include_peers:n.boolean().optional(),scope_kind:Xi.optional(),scope_name:Ji.optional(),cursor:Qi.optional(),with_counts:n.boolean().optional(),sort:n.literal("activity").optional()}).strict(),n.object({op:n.literal("delegated_cleanup_notice.ack")}).strict(),n.object({op:n.literal("sessions.search"),q:n.string().min(1).max(Si),limit:n.number().int().min(1).max(500).optional(),include_archived:n.boolean().optional()}).strict(),n.object({op:n.literal("sessions.archive"),sessionId:g,archived:n.boolean()}).strict(),n.object({op:n.literal("sessions.delete"),sessionId:g,confirmed:n.literal(!0)}).strict(),n.object({op:n.literal("sessions.create"),requestId:x,cwd:n.string().min(1).max(4096).optional(),target:Ze.optional(),purpose:n.literal("agents-config").optional(),model:dt.optional(),draftId:g.optional(),peer:se.optional()}).strict(),n.object({op:n.literal("sessions.preview"),requestId:x,cwd:n.string().min(1).max(4096),target:Ze.optional(),model:dt.optional()}).strict(),n.object({op:n.literal("sessions.draft"),requestId:x,cwd:n.string().min(1).max(4096),target:Ze.optional(),model:dt.optional()}).strict(),n.object({op:n.literal("sessions.get"),sessionId:g,journalOrder:n.boolean().optional(),orderIds:n.array(n.string().min(1).max(128)).max(512).optional(),peerJournalSource:n.boolean().optional()}).strict(),n.object({op:n.literal("sessions.files"),sessionId:g,scope:n.enum(["family","self"]).optional(),kind:n.string().max(256).optional(),q:n.string().max(256).optional(),sort:n.enum(["recent","name","kind","modified","created","size"]).optional(),order:n.enum(["asc","desc"]).optional(),limit:n.number().int().min(1).max(200).optional(),cursor:n.string().max(8192).optional()}).strict(),n.object({op:n.literal("sessions.files.materialise"),sessionId:g,fileId:n.string().regex(/^[a-f0-9]{16}$/)}).strict(),n.object({op:n.literal("sessions.history"),sessionId:g,beforeId:v.optional(),limit:n.number().int().min(1).max(500).optional(),openFrame:n.boolean().optional(),journalOrder:n.boolean().optional(),orderIds:n.array(n.string().min(1).max(128)).max(512).optional(),peerJournalSource:n.boolean().optional(),sourceRead:n.enum(["metadata","payload"]).optional(),expectedJournalGeneration:n.string().min(1).max(128).optional()}).strict(),n.object({op:n.literal("sessions.checkpoints"),sessionId:g}).strict(),n.object({op:n.literal("sessions.checkpoints.warm"),sessionId:g,ids:n.array(v).max(Vt).optional(),limit:n.number().int().min(1).max(Vt).optional()}).strict(),n.object({op:n.literal("sessions.find"),sessionId:g,q:n.string().min(1).max(Ii),limit:n.number().int().min(1).max(Ti).optional()}).strict(),n.object({op:n.literal("subagents.transcript"),sessionId:g,childId:g,beforeId:v.optional(),limit:n.number().int().min(1).max(500).optional()}).strict(),n.object({op:n.literal("sessions.message"),sessionId:g,requestId:x,text:n.string().max(zt),images:n.array(Ft).max(Ht).optional(),mode:n.enum(["prompt","steer"]).optional(),inputMode:n.enum(["typed","dictated","mixed"]).optional(),inputPath:n.string().max(1024).optional()}).strict(),n.object({op:n.literal("sessions.command"),sessionId:g,requestId:x,command:n.string().regex(/^\/?[A-Za-z]+$/).max(64),args:n.string().max(zt).optional(),images:n.array(Ft).max(Ht).optional()}).strict(),n.object({op:n.literal("sessions.move"),sessionId:g,requestId:x,cwd:n.string().min(1).max(4096)}).strict(),n.object({op:n.literal("sessions.answer"),sessionId:g,epoch:v.optional(),requestId:v.optional(),value:n.string().max(32768).optional(),approved:n.boolean().optional(),questionIndex:n.number().int().min(0).optional(),askId:v.optional(),answers:n.record(n.string(),n.array(n.string().max(32768))).optional(),decline:n.boolean().optional(),revise:n.boolean().optional()}).strict(),n.object({op:n.literal("sessions.seen"),sessionId:g,completionToken:n.string().uuid()}).strict(),n.object({op:n.literal("attention.seen"),items:n.array(n.object({sessionId:g,completionToken:n.string().uuid()}).strict()).min(1).max(500)}).strict(),n.object({op:n.literal("sessions.notified"),sessionId:g,completionToken:n.string().uuid()}).strict(),n.object({op:n.literal("tags.list")}).strict(),n.object({op:n.literal("tags.replace"),tags:n.array(n.object({id:n.string().optional(),name:n.string()}).strict())}).strict(),n.object({op:n.literal("sessions.tags"),sessionId:g,tags:n.array(n.string()),primary:n.string().nullable()}).strict(),n.object({op:n.literal("sessions.pin"),sessionId:g,pinned:n.boolean()}).strict(),n.object({op:n.literal("sessions.watch"),sessionId:g,subscriptionId:n.string().regex(Zt),visible:n.boolean(),canNotify:n.boolean()}).strict(),n.object({op:n.literal("sessions.warm"),sessionId:g}).strict(),n.object({op:n.literal("sessions.interrupt"),sessionId:g,requestId:x}).strict(),n.object({op:n.literal("supplements.cancel"),sessionId:g,job:ot,anchor:rt}).strict(),n.object({op:n.literal("supplements.restart"),sessionId:g,job:ot,anchor:rt}).strict(),n.object({op:n.literal("supplements.steer"),sessionId:g,job:ot,anchor:rt,text:n.string().min(1).max(500)}).strict(),n.object({op:n.literal("sessions.variables.list"),sessionId:g}).strict(),n.object({op:n.literal("sessions.variables.create"),sessionId:g,key:ze,value:Qt,type:Jt}).strict(),n.object({op:n.literal("sessions.variables.update"),sessionId:g,key:ze,value:Qt,type:Jt}).strict(),n.object({op:n.literal("sessions.variables.delete"),sessionId:g,key:ze}).strict(),n.object({op:n.literal("sessions.presence"),subscriptionId:n.string().regex(/^[a-f0-9]{1,64}$/),canNotify:n.boolean(),canNotifyKinds:n.array(n.enum(["complete","error"])).max(4),sessionId:n.string().regex(/^([a-f0-9]{12})?$/),window:n.object({exists:n.boolean(),focused:n.boolean(),visible:n.boolean(),minimized:n.boolean()}).strict()}).strict(),n.object({op:n.literal("legacy.models"),provider:n.string().max(128).optional(),sort:n.enum(["id","name","provider","recommended"]).optional(),direction:n.enum(["ascending","descending"]).optional()}).strict(),n.object({op:n.literal("legacy.models.providers")}).strict(),n.object({op:n.literal("auth.probe"),provider:v}).strict(),n.object({op:n.literal("legacy.agent.upload"),agentId:v}).strict(),n.object({op:n.literal("agent.publish"),agentId:v,document:rn.optional(),...ut,visibility:n.literal("org").optional(),tenantId:v.optional()}).strict(),n.object({op:n.literal("agent.republish"),agentId:v,hubAgentId:v,expectedRemoteRevision:n.string().min(1).max(512).optional(),document:rn.optional(),...ut,visibility:n.literal("org").optional(),tenantId:v.optional()}).strict(),n.object({op:n.literal("team.publish"),teamId:v,...ut,visibility:n.literal("org").optional(),tenantId:v.optional()}).strict(),n.object({op:n.literal("team.pull"),teamId:v,tenantId:v.optional()}).strict(),n.object({op:n.literal("agent.nameAvailability"),name:n.string().min(1).max(yt)}).strict(),n.object({op:n.literal("legacy.agents.list"),page:n.number().int().min(1).optional(),perPage:n.number().int().min(1).max(500).optional(),name:n.string().max(256).optional(),sort:n.string().max(64).optional(),direction:n.enum(["asc","desc"]).optional()}).strict(),n.object({op:n.literal("legacy.agent.get"),agentId:v}).strict(),n.object({op:n.literal("legacy.agent.history"),agentId:v,page:n.number().int().min(1).optional(),perPage:n.number().int().min(1).max(500).optional()}).strict(),n.object({op:n.literal("legacy.jobs.list"),agentId:v.optional(),status:n.string().max(64).optional()}).strict(),n.object({op:n.literal("legacy.job.get"),jobId:v}).strict(),n.object({op:n.literal("legacy.schedules.list"),page:n.number().int().min(1).optional(),perPage:n.number().int().min(1).max(100).optional()}).strict(),n.object({op:n.literal("legacy.agent.schedules.list"),agentId:v,page:n.number().int().min(1).optional(),perPage:n.number().int().min(1).max(100).optional()}).strict(),n.object({op:n.literal("legacy.agent.schedule.create"),agentId:v,schedule:tn.extend({prompt:n.string().max(64e3),interval:n.number().int().min(1),unit:Xt})}).strict(),n.object({op:n.literal("legacy.schedule.get"),scheduleId:v}).strict(),n.object({op:n.literal("legacy.schedule.edit"),scheduleId:v,schedule:tn.extend({prompt:n.string().max(64e3).nullish(),interval:n.number().int().min(1).nullish(),unit:Xt.nullish()})}).strict(),n.object({op:n.literal("legacy.schedule.remove"),scheduleId:v}).strict(),n.object({op:n.literal("legacy.agent.create"),agent:n.record(n.unknown())}).strict(),n.object({op:n.literal("legacy.agent.update"),agentId:v,update:n.record(n.unknown())}).strict(),n.object({op:n.literal("legacy.agent.delete"),agentId:v}).strict(),n.object({op:n.literal("legacy.agent.conversation.clear"),agentId:v}).strict(),n.object({op:n.literal("legacy.agent.systemPrompt.get"),agentId:v}).strict(),n.object({op:n.literal("legacy.agent.systemPrompt.update"),agentId:v,systemPrompt:n.string().max(Ei)}).strict(),n.object({op:n.literal("legacy.agent.download"),agentId:v}).strict(),n.object({op:n.literal("legacy.job.cancel"),jobId:v}).strict(),n.object({op:n.literal("commands.list")}).strict(),n.object({op:n.literal("commands.entities"),sessionId:g,command:v,name:n.string().max(128).optional()}).strict(),n.object({op:n.literal("models.catalogue"),live:n.boolean().optional(),scope:n.enum(["usable","all"]).optional()}).strict(),n.object({op:n.literal("usage.get"),provider:v.optional(),live:n.boolean().optional(),refresh:n.boolean().optional()}).strict(),n.object({op:n.literal("quota.notice"),provider:v.optional(),model:n.string().min(1).max(200).optional(),refresh:n.boolean().optional()}).strict(),n.object({op:n.literal("analytics.get"),sessionId:g.optional(),sinceMs:n.number().int().nonnegative().optional(),untilMs:n.number().int().nonnegative().optional(),days:n.number().int().min(1).max(366).optional()}).strict(),n.object({op:n.literal("analytics.models"),sessionId:g.optional(),sinceMs:n.number().int().nonnegative().optional(),untilMs:n.number().int().nonnegative().optional(),days:n.number().int().min(1).max(366).optional()}).strict(),n.object({op:n.literal("info.get")}).strict(),n.object({op:n.literal("sessions.report"),sessionId:g,recentLimit:n.number().int().min(0).max(50).optional()}).strict(),n.object({op:n.literal("skills.list"),sessionId:g.optional(),cwd:yi.optional(),name:v.optional()}).strict(),n.object({op:n.literal("sessions.failovers"),sessionId:g}).strict(),n.object({op:n.literal("sessions.credential"),sessionId:g,action:n.enum(["list","store","forget"]),key:$e.optional(),value:Le.optional(),confirmed:n.boolean().optional()}).strict(),n.object({op:n.literal("sessions.fork"),sessionId:g,requestId:x,message:n.string().max(2e5).optional(),boundary:n.enum(["next_safe","at_entry"]).optional(),entryId:n.string().max(128).optional()}).strict(),n.object({op:n.literal("sessions.stop"),requestId:x,targets:n.array(g).min(1).max(100),confirmed:n.literal(!0)}).strict(),n.object({op:n.literal("sessions.aside"),sessionId:g,requestId:x,text:n.string().min(1).max(32768),asideId:x.optional(),subscriptionId:n.string().regex(Zt).optional()}).strict(),n.object({op:n.literal("sessions.adopt"),sessionId:g,requestId:x,asideId:x,confirmed:n.literal(!0)}).strict(),n.object({op:n.literal("sessions.aside.get"),sessionId:g,asideId:x}).strict(),n.object({op:n.literal("sessions.aside.close"),sessionId:g,asideId:x}).strict(),n.object({op:n.literal("wakes.list"),limit:n.number().int().min(1).max(500).optional(),includeDormant:n.boolean().optional()}).strict(),n.object({op:n.literal("wakes.create"),requestId:x,sessionId:g.optional(),cwd:n.string().min(1).max(4096).optional(),target:Ze.optional(),message:qt,in:n.string().min(1).max(64).optional(),at:n.string().min(1).max(64).optional(),every:n.string().min(1).max(64).optional(),until:n.string().min(1).max(64).optional(),limit:n.number().int().min(1).optional(),title:n.string().min(1).max(200).optional()}).strict(),n.object({op:n.literal("wakes.edit"),sessionId:g,wakeId:en,message:qt.optional(),in:n.string().min(1).max(64).optional(),at:n.string().min(1).max(64).optional(),every:n.string().min(1).max(64).optional(),until:n.string().min(1).max(64).optional(),limit:n.number().int().min(1).optional()}).strict(),n.object({op:n.literal("wakes.remove"),sessionId:g,wakeId:en}).strict(),n.object({op:n.literal("monitors.cancel"),sessionId:g,monitorId:ji}).strict(),n.object({op:n.literal("jobs.cancel"),sessionId:g,jobId:Mi}).strict(),n.object({op:n.literal("mcp.list"),sessionId:g}).strict(),n.object({op:n.literal("mcp.credentials.store"),sessionId:g,name:n.string().min(1).max(256),values:n.record(n.string().min(1).max(128),n.string().min(1).max(32768)).refine(e=>Object.keys(e).length<=32&&Object.values(e).reduce((t,s)=>t+s.length,0)<=65536,{message:"Too many secret values, or too much secret text, for one MCP credential write."}),confirmedReplace:n.array(n.string().min(1).max(128)).max(32)}).strict(),n.object({op:n.literal("mcp.control"),sessionId:g,control:n.object({action:n.enum(["list","add","remove","reload","connect","probe","disconnect","login","logout","reauth","status","cancel"]),name:ct.optional(),scope:n.enum(["global","project"]).optional(),command:n.string().min(1).max(4096).optional(),args:n.array(n.string().max(8192)).max(128).optional(),env:n.record(Ue).optional(),url:n.string().max(4096).optional(),headers:n.record(Ue).optional(),oauth:n.boolean().optional(),confirmed:n.boolean().optional(),operation_id:Ut.optional()}).strict()}).strict(),n.object({op:n.literal("mcp.catalog"),cwd:lt.optional(),sessionId:g.optional()}).strict(),n.object({op:n.literal("mcp.catalog.control"),cwd:lt.optional(),control:n.object({action:n.enum(["add","remove","test","login","reauth","logout","status","cancel"]),name:ct.optional(),scope:n.enum(["global","project"]).optional(),command:n.string().min(1).max(4096).optional(),args:n.array(n.string().max(8192)).max(128).optional(),env:n.record(Ue).optional(),url:n.string().max(4096).optional(),headers:n.record(Ue).optional(),confirmed:n.boolean().optional(),operation_id:Ut.optional()}).strict()}).strict(),n.object({op:n.literal("mcp.catalog.credentials"),header:n.string().min(1).max(128).optional(),cwd:lt.optional(),name:ct,values:n.record(n.string().min(1).max(128),n.string().min(1).max(32768)).refine(e=>Object.keys(e).length<=32&&Object.values(e).reduce((t,s)=>t+s.length,0)<=65536,{message:"Too many secret values, or too much secret text, for one MCP credential write."}),confirmedReplace:n.array(n.string().min(1).max(128)).max(32)}).strict(),n.object({op:n.literal("radient.request"),control:n.object({operation:n.enum(["account","prices","credits","usage","provision","application.create","agents.list","agents.get","agents.create","agents.update","agents.delete","agents.like","agents.unlike","agents.liked","agents.like_count","agents.favourite","agents.unfavourite","agents.favourited","agents.favourite_count","agents.download_count","agents.statuses","comments.list","comments.create","comments.update","comments.delete","account.agents","memberships.list","org_agents.list","org_team.get","org_teams.list","org_skills.list","org_skill.get","signup.resend"]),request_id:x.optional(),tenant_id:v.optional(),account_id:v.optional(),agent_id:v.optional(),comment_id:v.optional(),team_id:v.optional(),skill_id:v.optional(),query:n.record(n.union([n.string().max(1024),n.number().int()])).optional(),payload:n.record(n.unknown()).optional(),confirmed:n.boolean().optional()}).strict()}).strict(),n.object({op:n.literal("providers.list")}).strict(),n.object({op:n.literal("accounts.list")}).strict(),n.object({op:n.literal("accounts.remove"),accountId:n.number().int().positive(),confirmed:n.literal(!0)}).strict(),n.object({op:n.literal("tunnel.setup.read"),credentialId:n.number().int().positive().optional()}).strict(),n.object({op:n.literal("tunnel.setup.plan"),credentialId:n.number().int().positive().optional()}).strict(),n.object({op:n.literal("tunnel.setup.run"),credentialId:n.number().int().positive(),acceptMonthlyPrice:n.string().min(1).max(64).optional()}).strict(),n.object({op:n.literal("auth.start"),provider:v}).strict(),n.object({op:n.literal("auth.status"),id:v}).strict(),n.object({op:n.literal("auth.input"),id:v,promptId:v,value:Le}).strict(),n.object({op:n.literal("auth.cancel"),id:v}).strict(),n.object({op:n.literal("auth.key"),provider:v,value:Le}).strict(),n.object({op:n.literal("auth.logout"),provider:v}).strict(),n.object({op:n.literal("agent_messages.status"),boundary:hi}).strict(),n.object({op:n.literal("agent_messages.enable"),expected_account_id:v,tenant_id:v,state:n.literal("active"),consent_version:n.string().min(1).max(128),consented_via:n.literal("dialog")}).strict(),n.object({op:n.literal("settings.list")}).strict(),n.object({op:n.literal("settings.edit"),key:$e,value:n.unknown().refine(e=>e!==void 0,"A setting value is required."),base:Pi.optional()}).strict(),n.object({op:n.literal("settings.reset"),key:$e}).strict(),n.object({op:n.literal("tts.paths")}).strict(),n.object({op:n.literal("config.get")}).strict(),n.object({op:n.literal("config.update"),value:Ni}).strict(),n.object({op:n.literal("instructions.get")}).strict(),n.object({op:n.literal("instructions.update"),content:n.string().max(64e3)}).strict(),n.object({op:n.literal("credentials.list")}).strict(),n.object({op:n.literal("credentials.update"),key:$e,value:Le}).strict(),n.object({op:n.literal("peers.list")}).strict(),n.object({op:n.literal("networks.list")}).strict(),n.object({op:n.literal("networks.invite"),networkId:se,role:n.enum(["read","drive","admin"]),deviceId:se.optional()}).strict(),n.object({op:n.literal("networks.member.remove"),networkId:se,deviceId:se,confirm:n.string().min(1).max(256)}).strict(),n.object({op:n.literal("sessions.transfer"),sessionId:g,to:n.union([n.literal("local"),se]),keep:n.boolean().optional(),waitS:n.number().min(0).max(300).optional(),requestId:x.optional()}).strict(),n.object({op:n.literal("approvals.list")}).strict(),n.object({op:n.literal("approvals.approve"),approvalId:Gt}).strict(),n.object({op:n.literal("approvals.deny"),approvalId:Gt}).strict(),n.object({op:n.literal("asks.list")}).strict(),n.object({op:n.literal("projects.list")}).strict(),n.object({op:n.literal("projects.get"),key:z}).strict(),n.object({op:n.literal("projects.create"),name:pt,description:n.string().max(dn).optional(),status:cn.optional(),tags:ln.optional()}).strict(),n.object({op:n.literal("projects.update"),key:z,fields:n.object({name:pt.optional(),title:n.string().max(80).optional(),owner:n.string().max(80).optional(),team:n.string().max(80).optional(),description:n.string().max(dn).optional(),status:cn.optional(),progress:n.string().max(ea).optional(),tags:ln.optional(),start_date:Ge.optional(),target_date:Ge.optional(),completed_at:Ge.optional(),estimate:n.number().positive().max(1e3).optional(),estimate_unit:n.enum(["points","days"]).optional()}).strict(),force_done:n.boolean().optional()}).strict(),n.object({op:n.literal("projects.delete"),key:z,confirmed_name:pt}).strict(),n.object({op:n.literal("projects.link"),key:z,sessionId:g}).strict(),n.object({op:n.literal("projects.unlink"),key:z,sessionId:g}).strict(),n.object({op:n.literal("projects.milestone"),key:z,name:n.string().min(1).max(un),targetDate:Ge.optional(),completed:n.boolean().optional()}).strict(),n.object({op:n.literal("projects.milestone.remove"),key:z,name:n.string().min(1).max(un)}).strict(),n.object({op:n.literal("projects.request_update"),key:z}).strict(),n.object({op:n.literal("projects.search"),q:n.string().min(1).max(ta),limit:n.number().int().min(1).max(sa).optional()}).strict(),n.object({op:n.literal("aida.status")}).strict(),n.object({op:n.literal("aida.control"),action:n.enum(["open","pause","resume","greet","status"])}).strict(),n.object({op:n.literal("code_requests.list"),sessionId:g}).strict(),n.object({op:n.literal("code_requests.refresh"),sessionId:g,keys:n.array(n.string().min(1).max(512)).max(256).optional(),force:n.boolean().optional()}).strict(),n.object({op:n.literal("static.sign"),route:n.enum(["images","videos","audio","html"]),path:n.string().min(1),ttlS:n.number().int().min(1).max(3600).optional()}).strict()]);aa.superRefine((e,t)=>{if(e.op==="hub.skillPull"||e.op==="hub.skillPublish"){if(e.visibility==="public"&&e.tenantId!==null||e.visibility==="org"&&!e.tenantId){t.addIssue({code:n.ZodIssueCode.custom,message:"A skill destination requires explicit paired scope",path:["tenantId"]});return}if(e.op==="hub.skillPublish"&&(e.dryRun?e.previewReceipt!==void 0||e.confirmPublish!==void 0:!e.previewReceipt||e.confirmPublish!==!0)){t.addIssue({code:n.ZodIssueCode.custom,message:"An initial skill publication requires its reviewed draft receipt",path:["previewReceipt"]});return}}if(e.op==="hub.check"||e.op==="hub.apply"||e.op==="hub.retry"){const s=e.linkId!==void 0,i=e.kind!==void 0||e.name!==void 0;if(s&&i||e.op!=="hub.check"&&!s&&(!e.kind||!e.name)||e.op==="hub.retry"&&s&&!e.direction||e.direction==="push"&&!s){t.addIssue({code:n.ZodIssueCode.custom,message:"A hub action requires one unambiguous selector and an explicit retry direction",path:["linkId"]});return}}if(e.op==="hub.apply"&&(e.previewReceipt!==void 0||e.confirmApply!==void 0)&&(!e.linkId||e.dryRun||!e.previewReceipt||e.confirmApply!==!0)){t.addIssue({code:n.ZodIssueCode.custom,message:"A viewed incoming application requires its scoped preview receipt and confirmation",path:["previewReceipt"]});return}if(e.op==="hub.apply"&&e.resolveSource===!0){const s=e.visibility==="public"&&e.tenantId===null||e.visibility==="org"&&typeof e.tenantId=="string"&&e.tenantId.length>0;if(!e.hubSource||!s||e.acknowledgeUnknownBaseline!==!0||e.linkId!==void 0||e.previewReceipt!==void 0||e.confirmApply!==void 0||e.prefer!==void 0){t.addIssue({code:n.ZodIssueCode.custom,message:"Confirming a source requires its exact stated destination and the unknown-baseline acknowledgement, with no link, preview or preference",path:["hubSource"]});return}}if(e.op==="hub.push"&&(e.dryRun?e.previewReceipt!==void 0||e.confirmPublish!==void 0:!e.previewReceipt||e.confirmPublish!==!0)){t.addIssue({code:n.ZodIssueCode.custom,message:"A confirmed publication requires its reviewed preview receipt",path:["previewReceipt"]});return}if(e.op==="hub.policy"&&e.subscribe===void 0&&e.autoPush===void 0){t.addIssue({code:n.ZodIssueCode.custom,message:"A hub policy change must name subscribe or autoPush",path:["subscribe"]});return}if(e.op==="sessions.answer"){if(e.askId!==void 0){e.askId||t.addIssue({code:n.ZodIssueCode.custom,message:"ask_id must be a non-empty string",path:["askId"]}),e.decline!==!0&&!e.answers?t.addIssue({code:n.ZodIssueCode.custom,message:"A queued-ask answer needs answers or decline",path:["answers"]}):e.decline===!0&&e.answers!==void 0?t.addIssue({code:n.ZodIssueCode.custom,message:"Supply either answers or decline",path:["decline"]}):e.revise===!0&&e.decline===!0?t.addIssue({code:n.ZodIssueCode.custom,message:"Supply either decline or revise",path:["revise"]}):e.answers!==void 0&&Object.keys(e.answers).length===0&&t.addIssue({code:n.ZodIssueCode.custom,message:"answers must name at least one question",path:["answers"]});return}e.epoch||t.addIssue({code:n.ZodIssueCode.custom,message:"An epoch is required to answer a gate",path:["epoch"]}),e.requestId||t.addIssue({code:n.ZodIssueCode.custom,message:"A request id is required to answer a gate",path:["requestId"]}),e.revise===!0&&t.addIssue({code:n.ZodIssueCode.custom,message:"revise applies to a queued ask",path:["revise"]});return}if(e.op==="sessions.create"&&e.purpose===void 0){e.cwd===void 0&&t.addIssue({code:n.ZodIssueCode.custom,message:"A conversation needs a working directory: only a configuration run (`purpose`) may omit `cwd`.",path:["cwd"]});return}if(e.op==="sessions.create"&&e.purpose!==void 0){for(const s of["cwd","target","model","draftId"])e[s]!==void 0&&t.addIssue({code:n.ZodIssueCode.custom,message:`A configuration run resolves its own \`${s}\`: send \`purpose\` alone.`,path:[s]});return}if(!(e.op!=="agent.publish"&&e.op!=="agent.republish"&&e.op!=="team.publish")){if((e.subscribe!==void 0||e.autoPush!==void 0||e.confirmPublicEgress!==void 0)&&!e.requestId){t.addIssue({code:n.ZodIssueCode.custom,message:"Initial link policy needs a durable publication request ID",path:["requestId"]});return}e.visibility==="org"!=!!e.tenantId&&t.addIssue({code:n.ZodIssueCode.custom,message:'A publication target needs both `visibility: "org"` and `tenantId`, or neither: one half would publish to the public hub.'})}});const J={noCredential:"pairing.no-credential",refused:"pairing.refused",planeClosed:"pairing.plane-closed",transportFailed:"transport.failed"},br={runtimeUnreachable:"runtime_unreachable"},_r="runtime_busy",yr="runtime_retiring";n.object({data:n.object({aside_id:n.string().optional(),status:n.union([n.enum(["adopted","queued"]),n.string()]).optional()}).passthrough()}).passthrough();const kr="aside_adopt_refused",oa=["session_closed","open_tool_batch","turn_running"];function Sr(e){if(typeof e!="object"||e===null)return;const t=e.reason;return oa.find(s=>s===t)}const wr={[J.noCredential]:"This app is not paired with the running Local Operator server, so this control is unavailable.",[J.refused]:"This app's credential for the running Local Operator server was refused, so this control is unavailable.",[J.planeClosed]:"The running Local Operator server does not accept this app's desktop controls.",[J.transportFailed]:"The Local Operator server did not answer this request."},Ir={noCredential:"Restart with a desktop-managed backend to use these controls.",transportFailed:"The backend could not complete this request. Check its connection and try again."};function xr(e){return e!==void 0&&Object.values(J).includes(e)}function Tr(e,t){if(e.startsWith("/v1/desktop/")){if(t===401||t===403)return J.refused;if(t===503)return J.planeClosed}}const Er=n.object({step:n.string(),blocked_on:n.string(),configured:n.boolean(),ready:n.boolean(),verified:n.boolean(),url:n.string().nullable(),credential_id:n.number().int().positive().nullable(),identity_label:n.string().nullable(),credential_choices:n.array(n.object({id:n.number().int().positive(),identity_label:n.string().nullable().optional()}).passthrough()).default([]),quote:n.object({monthly_price_usd:n.string().nullable(),positive_balance:n.boolean(),eligible:n.boolean(),account_valid:n.boolean()}).passthrough().nullable(),receipts:n.array(n.object({step:n.string(),ok:n.boolean(),text:n.string()})).default([]),remedy:n.object({kind:n.string(),text:n.string(),command:n.string().nullable().optional(),url:n.string().nullable().optional()}).nullable(),source:n.string(),in_progress:n.boolean().default(!1),progress:n.array(n.string()).default([]),active_credential_id:n.number().int().positive().nullable().default(null),billing_outcome:n.string().optional(),reservation_outcome:n.string().optional(),failure_stage:n.string().optional()}).passthrough(),Rr=new Set(["setup_in_progress","setup_deadline","setup_unavailable","setup_intent_corrupt"]),ra=88e4,ca=11e5,la=2e4,da=9e4,ua=new Set(["analytics.get","analytics.models","sessions.report"]),pa=new Set(["usage.get"]),ma=new Set(["networks.list","peers.list"]),ha=new Set([...ua,...pa,...ma]),fa=90,ga=30,va=300,ba=10,Ln=15,_a=1e4;function ya(e){const s=e.to==="local"||e.keep?va:ga,i=Math.max(0,e.waitS??0);return(fa+s+ba+Ln)*1e3+i*1e3}const ka=18e4,Sa=ka+15e3,wa=120,Ia=135e3,xa=93e4,Un=(wa+30+Ln)*1e3,Ta=6e4,Ea=5*Un,Ra=new Set(["hub.apply","hub.retry","hub.push","hub.skillPublish","hub.skillPull","hub.check","hub.applyAll"]);function Oa(e){switch(e){case"hub.apply":case"hub.retry":case"hub.push":case"hub.skillPublish":case"hub.skillPull":return Un;case"hub.check":return Ta;case"hub.applyAll":return Ea;default:return null}}function Pa(e){if(typeof e!="string"&&e.op==="sessions.transfer")return ya(e)+_a;const t=typeof e=="string"?e:e.op;if(t==="approvals.approve")return Sa;if(t==="tunnel.setup.run")return xa;if(t==="tunnel.setup.plan")return Ia;const s=Oa(t);return s!==null?s:ha.has(t)?da:la}const Ca=5e3;function Or(e){return Pa(e)+Ca}const Aa="deadline_exceeded",Pr="foreground_required",Cr="View these completions in the foreground before marking them read.",ja=new Set(["capabilities","agent_messages.status","accounts.list","analytics.get","analytics.models","approvals.list","commands.entities","commands.list","config.get","credentials.list","hub.updates","hub.links","info.get","instructions.get","legacy.agent.get","legacy.agent.history","legacy.agent.schedules.list","legacy.agents.list","legacy.job.get","legacy.jobs.list","legacy.models","legacy.models.providers","legacy.schedule.get","legacy.schedules.list","mcp.catalog","mcp.list","models.catalogue","networks.list","peers.list","profiles.get","profiles.list","projects.search","providers.list","quota.notice","runtimes.list","sessions.aside.get","sessions.checkpoints","sessions.failovers","sessions.find","sessions.get","sessions.history","sessions.files","sessions.list","sessions.preview","sessions.report","sessions.search","sessions.variables.list","skills.list","subagents.transcript","teams.effective","teams.get","teams.list","tunnel.setup.plan","tunnel.setup.read","usage.get"]),Ma=new Set(["analytics.get","analytics.models","networks.list","peers.list","usage.get","sessions.report","info.get","sessions.failovers"]);function Ar(e,t){const s=Math.round(t/1e3),i=Aa;return e==="sessions.transfer"?{code:i,message:`The app waits up to ${s} seconds for a move, and it was still running when the app stopped waiting. The move was asked for, so its outcome is unknown from here: read the session again before moving it anywhere else.`}:e==="approvals.approve"?{code:i,message:`The app waits up to ${s} seconds for an approval, and the signing prompt was still open when it stopped waiting. The request was sent, so the decision may or may not have landed: read the approvals again — if the record still waits, answering it again is safe, because the store keeps the first decision and refuses a second.`}:Ra.has(e)?{code:i,message:"This is taking longer than expected. It may still finish; the mark will update."}:ja.has(e)?{code:i,message:Ma.has(e)?`The app waits up to ${s} seconds for this panel's data, and the read was still running when the app stopped waiting. Nothing was read; reopen the panel to ask again.`:`The app waits up to ${s} seconds for this read, and it was still running when the app stopped waiting. Nothing was read; ask again.`}:{code:i,message:`The app waits up to ${s} seconds for this request, and it was still running when the app stopped waiting. It may or may not have reached the server; check the result before repeating it.`}}const jr=ra,Mr=ca;n.object({state:n.enum(["ok","depleted","limit_reached","unverified","unknown","not_applicable"]),provider:n.string(),kind:n.enum(["balance","subscription","radient","none"]),model_free:n.boolean(),title:n.string(),body:n.string(),actions:n.array(n.object({id:n.enum(["open_url","resend_verification","refresh"]),label:n.string(),url:n.string().nullable().optional()})),resets_at_ms:n.number().int().nullable().optional(),checked_at_ms:n.number().int(),age_ms:n.number().int().nullable().optional(),source:n.enum(["cached","live"])});function Na(e){return e.sessionId?{session_id:e.sessionId}:{...e.cwd?{cwd:e.cwd}:{},...e.target?{target:e.target}:{}}}function pn(e){return{...e.in!==void 0?{in:e.in}:{},...e.at!==void 0?{at:e.at}:{},...e.every!==void 0?{every:e.every}:{},...e.until!==void 0?{until:e.until}:{},...e.limit!==void 0?{limit:e.limit}:{}}}function mt(e){return{...e.requestId?{request_id:e.requestId}:{},...e.subscribe!==void 0?{subscribe:e.subscribe}:{},...e.autoPush!==void 0?{auto_push:e.autoPush}:{},...e.confirmPublicEgress!==void 0?{confirm_public_egress:e.confirmPublicEgress}:{}}}function ht(e){if(e.visibility==="org"!=!!e.tenantId)throw new Error('A publication target needs both `visibility: "org"` and `tenantId`, or neither: one half would publish to the public hub.')}function mn(e){return{sources:e.sources??null,session_ids:e.sessionIds??{},all:e.all??!1,include_subagents:e.includeSubagents??!1,include_cleared_segments:e.includeClearedSegments??!1,include_memory:e.includeMemory??!0,include_instructions:e.includeInstructions??!0,...e.maxSessions===void 0?{}:{max_sessions:e.maxSessions}}}function Nr(e){switch(e.op){case"capabilities":return{path:"/v1/capabilities",method:"GET"};case"runtimes.list":return{path:"/v1/desktop/runtimes?probe=false",method:"GET"};case"peers.list":return{path:"/v1/desktop/peers",method:"GET"};case"networks.list":return{path:"/v1/desktop/networks",method:"GET"};case"asks.list":return{path:"/v1/desktop/asks",method:"GET"};case"networks.invite":return{path:`/v1/desktop/networks/${encodeURIComponent(e.networkId)}/invite`,method:"POST",body:{role:e.role,device:e.deviceId??null}};case"networks.member.remove":return{path:`/v1/desktop/networks/${encodeURIComponent(e.networkId)}/members/${encodeURIComponent(e.deviceId)}`,method:"DELETE",body:{confirm:e.confirm}};case"sessions.transfer":return{path:`/v1/desktop/sessions/${encodeURIComponent(e.sessionId)}/transfer`,method:"POST",body:{to:e.to,keep:e.keep??!1,wait_s:e.waitS??0,...e.requestId?{request_id:e.requestId}:{}}};case"approvals.list":return{path:"/v1/desktop/approvals",method:"GET"};case"approvals.approve":return{path:`/v1/desktop/approvals/${encodeURIComponent(e.approvalId)}/approve`,method:"POST"};case"approvals.deny":return{path:`/v1/desktop/approvals/${encodeURIComponent(e.approvalId)}/deny`,method:"POST"};case"profiles.list":return{path:"/v1/desktop/profiles",method:"GET"};case"profiles.get":return{path:`/v1/desktop/profiles/${encodeURIComponent(e.name)}`,method:"GET"};case"profiles.install":return{path:"/v1/desktop/profiles/install",method:"POST",body:{request_id:e.requestId,name:e.name}};case"imports.sources":return{path:"/v1/desktop/imports/sources",method:"GET"};case"imports.sessions":{const t=new URLSearchParams({source:e.source});return e.includeSubagents&&t.set("include_subagents","true"),{path:`/v1/desktop/imports/sessions?${t.toString()}`,method:"GET"}}case"imports.preview":return{path:"/v1/desktop/imports/preview",method:"POST",body:mn(e)};case"imports.start":return{path:"/v1/desktop/imports/jobs",method:"POST",body:mn(e)};case"imports.status":return{path:`/v1/desktop/imports/jobs/${encodeURIComponent(e.jobId)}`,method:"GET"};case"imports.cancel":return{path:`/v1/desktop/imports/jobs/${encodeURIComponent(e.jobId)}`,method:"DELETE"};case"profiles.create":return{path:"/v1/desktop/profiles",method:"POST",body:{request_id:e.requestId,name:e.name,...e.fields}};case"profiles.update":return{path:`/v1/desktop/profiles/${encodeURIComponent(e.name)}`,method:"PATCH",body:{request_id:e.requestId,...e.fields,...e.expectedDefinitionRevision!==void 0&&e.expectedDefinitionRevision!==null?{expected_definition_revision:e.expectedDefinitionRevision}:{}}};case"hub.updates":return{path:"/v1/desktop/hub/updates",method:"GET"};case"hub.skillPull":return{path:"/v1/desktop/hub/skills/pull",method:"POST",body:{request_id:e.requestId,hub_id:e.hubId,hub_source:e.hubSource,visibility:e.visibility,tenant_id:e.tenantId,local_alias:e.localAlias,...e.subscribe!==void 0?{subscribe:e.subscribe}:{},...e.autoPush!==void 0?{auto_push:e.autoPush}:{},...e.confirmPublicEgress!==void 0?{confirm_public_egress:e.confirmPublicEgress}:{}}};case"hub.skillPublish":return{path:"/v1/desktop/hub/skills/publish",method:"POST",body:{request_id:e.requestId,dry_run:e.dryRun,source_skill:e.sourceSkill,local_alias:e.localAlias,visibility:e.visibility,tenant_id:e.tenantId,subscribe:e.subscribe,auto_push:e.autoPush,confirm_public_egress:e.confirmPublicEgress,...e.previewReceipt?{preview_receipt:e.previewReceipt}:{},...e.confirmPublish?{confirm_publish:!0}:{}}};case"hub.links":return{path:`/v1/desktop/hub/links${e.kind?`?kind=${e.kind}`:""}`,method:"GET"};case"hub.policy":return{path:`/v1/desktop/hub/links/${encodeURIComponent(e.linkId)}`,method:"PATCH",body:{request_id:e.requestId,expected_policy_revision:e.expectedPolicyRevision,...e.subscribe!==void 0?{subscribe:e.subscribe}:{},...e.autoPush!==void 0?{auto_push:e.autoPush}:{},...e.confirmPublicEgress!==void 0?{confirm_public_egress:e.confirmPublicEgress}:{}}};case"hub.check":return{path:"/v1/desktop/hub/updates/check",method:"POST",body:{request_id:e.requestId,...e.linkId?{link_id:e.linkId}:{},...e.direction?{direction:e.direction}:{},...e.kind?{kind:e.kind}:{},...e.name?{name:e.name}:{}}};case"hub.apply":return{path:"/v1/desktop/hub/updates/apply",method:"POST",body:{request_id:e.requestId,...e.previewReceipt?{preview_receipt:e.previewReceipt}:{},...e.confirmApply?{confirm_apply:!0}:{},...e.linkId?{link_id:e.linkId}:{},...e.direction?{direction:e.direction}:{},...e.kind?{kind:e.kind}:{},...e.name?{name:e.name}:{},...e.prefer?{prefer:e.prefer}:{},...e.acknowledgeUnknownBaseline!==void 0?{acknowledge_unknown_baseline:e.acknowledgeUnknownBaseline}:{},...e.dryRun!==void 0?{dry_run:e.dryRun}:{},...e.resolveSource===!0?{resolve_source:!0,hub_source:e.hubSource,visibility:e.visibility,tenant_id:e.tenantId??null}:{}}};case"hub.applyAll":return{path:"/v1/desktop/hub/updates/apply-all",method:"POST",body:{request_id:e.requestId,...e.kind?{kind:e.kind}:{}}};case"hub.retry":return{path:"/v1/desktop/hub/updates/retry",method:"POST",body:{request_id:e.requestId,...e.linkId?{link_id:e.linkId}:{},...e.direction?{direction:e.direction}:{},...e.kind?{kind:e.kind}:{},...e.name?{name:e.name}:{}}};case"hub.push":return{path:"/v1/desktop/hub/updates/push",method:"POST",body:{request_id:e.requestId,link_id:e.linkId,direction:e.direction,dry_run:e.dryRun,...e.previewReceipt?{preview_receipt:e.previewReceipt}:{},...e.confirmPublish?{confirm_publish:!0}:{}}};case"teams.list":return{path:"/v1/desktop/teams",method:"GET"};case"teams.get":return{path:`/v1/desktop/teams/${encodeURIComponent(e.name)}`,method:"GET"};case"teams.effective":return{path:`/v1/desktop/teams/${encodeURIComponent(e.name)}/effective`,method:"GET"};case"teams.create":return{path:"/v1/desktop/teams",method:"POST",body:{request_id:e.requestId,...e.fields}};case"teams.update":return{path:`/v1/desktop/teams/${encodeURIComponent(e.name)}`,method:"PATCH",body:{request_id:e.requestId,...e.fields,...e.expectedDefinitionRevision!==void 0&&e.expectedDefinitionRevision!==null?{expected_definition_revision:e.expectedDefinitionRevision}:{}}};case"sessions.list":{const t=new URLSearchParams;return t.set("limit",String(e.limit??100)),e.include_archived&&t.set("include_archived","true"),e.scope_kind&&t.set("scope_kind",e.scope_kind),e.scope_name&&t.set("scope_name",e.scope_name),e.cursor&&t.set("cursor",e.cursor),e.with_counts&&t.set("with_counts","true"),e.include_peers&&t.set("include_peers","true"),e.sort&&t.set("sort",e.sort),{path:`/v1/desktop/sessions?${t}`,method:"GET"}}case"delegated_cleanup_notice.ack":return{path:"/v1/desktop/delegated-cleanup-notice/ack",method:"POST"};case"sessions.search":{const t=new URLSearchParams({q:e.q,limit:String(e.limit??wi)});return e.include_archived&&t.set("include_archived","true"),{path:`/v1/desktop/sessions/search?${t}`,method:"GET"}}case"sessions.archive":return{path:`/v1/desktop/sessions/${e.sessionId}/archive`,method:"POST",body:{archived:e.archived}};case"sessions.delete":return{path:`/v1/desktop/sessions/${e.sessionId}`,method:"DELETE",body:{confirmed:!0}};case"sessions.create":return{path:"/v1/desktop/sessions",method:"POST",body:{request_id:e.requestId,...e.cwd!==void 0?{cwd:e.cwd}:{},...e.peer?{peer:e.peer}:{},...e.target?{target:e.target}:{},...e.model?{model:e.model}:{},...e.draftId?{draft_id:e.draftId}:{},...e.purpose?{purpose:e.purpose}:{}}};case"sessions.preview":return{path:"/v1/desktop/sessions/preview",method:"POST",body:{request_id:e.requestId,cwd:e.cwd,...e.target?{target:e.target}:{},...e.model?{model:e.model}:{}}};case"sessions.draft":return{path:"/v1/desktop/sessions/draft",method:"POST",body:{request_id:e.requestId,cwd:e.cwd,...e.target?{target:e.target}:{},...e.model?{model:e.model}:{}}};case"sessions.get":{const t=new URLSearchParams;return e.journalOrder&&(t.set("journal_order","1"),e.peerJournalSource&&t.set("peer_journal_source","1"),_t(t,`/v1/desktop/sessions/${e.sessionId}`,e.orderIds??[])),{path:`/v1/desktop/sessions/${e.sessionId}${t.size?`?${t}`:""}`,method:"GET"}}case"sessions.files":{const t=new URLSearchParams({limit:String(e.limit??200)});for(const s of["scope","kind","q","sort","order","cursor"]){const i=e[s];i!==void 0&&t.set(s,i)}return{path:`/v1/desktop/sessions/${encodeURIComponent(e.sessionId)}/files?${t}`,method:"GET"}}case"sessions.files.materialise":return{path:`/v1/desktop/sessions/${encodeURIComponent(e.sessionId)}/files/${encodeURIComponent(e.fileId)}/materialise`,method:"POST"};case"sessions.history":{const t=new URLSearchParams({limit:String(e.limit??100)});return e.beforeId&&t.set("before_id",e.beforeId),e.openFrame&&(t.set("open_frame","1"),t.set("supplements","1")),e.journalOrder&&(t.set("journal_order","1"),e.peerJournalSource&&t.set("peer_journal_source","1"),e.sourceRead==="metadata"?t.set("source_read","metadata"):e.sourceRead==="payload"&&e.expectedJournalGeneration&&t.set("source_read","payload"),e.expectedJournalGeneration&&t.set("expected_journal_generation",e.expectedJournalGeneration),_t(t,`/v1/desktop/sessions/${e.sessionId}/history`,e.orderIds??[])),{path:`/v1/desktop/sessions/${e.sessionId}/history?${t}`,method:"GET"}}case"sessions.checkpoints":return{path:`/v1/desktop/sessions/${e.sessionId}/checkpoints`,method:"GET"};case"sessions.checkpoints.warm":return{path:`/v1/desktop/sessions/${e.sessionId}/checkpoints/warm`,method:"POST",body:{...e.ids?{ids:e.ids}:{},...e.limit!==void 0?{limit:e.limit}:{}}};case"sessions.find":{const t=new URLSearchParams({q:e.q,limit:String(e.limit??xi)});return{path:`/v1/desktop/sessions/${e.sessionId}/find?${t}`,method:"GET"}}case"subagents.transcript":{const t=new URLSearchParams({limit:String(e.limit??100)});return e.beforeId&&t.set("before_id",e.beforeId),{path:`/v1/desktop/sessions/${e.sessionId}/children/${e.childId}/transcript?${t}`,method:"GET"}}case"sessions.message":return{path:`/v1/desktop/sessions/${e.sessionId}/messages`,method:"POST",body:{request_id:e.requestId,text:e.text,images:e.images??[],mode:e.mode??"prompt",...e.inputMode?{input_mode:e.inputMode}:{},...e.inputPath?{input_path:e.inputPath}:{}}};case"sessions.command":return{path:`/v1/desktop/sessions/${e.sessionId}/commands`,method:"POST",body:{request_id:e.requestId,command:e.command,args:e.args??"",images:e.images??[]}};case"sessions.answer":return e.askId!==void 0?{path:`/v1/desktop/sessions/${e.sessionId}/answers`,method:"POST",body:{ask_id:e.askId,answers:e.answers,decline:e.decline,...e.revise===!0?{revise:!0}:{}}}:{path:`/v1/desktop/sessions/${e.sessionId}/answers`,method:"POST",body:{epoch:e.epoch,request_id:e.requestId,value:e.value,approved:e.approved,question_index:e.questionIndex}};case"sessions.seen":return{path:`/v1/desktop/sessions/${e.sessionId}/seen`,method:"POST",body:{completion_token:e.completionToken}};case"attention.seen":return{path:"/v1/desktop/attention/seen",method:"POST",body:{items:e.items.map(t=>({session_id:t.sessionId,completion_token:t.completionToken}))}};case"sessions.notified":return{path:`/v1/desktop/sessions/${e.sessionId}/notified`,method:"POST",body:{completion_token:e.completionToken}};case"tags.list":return{path:"/v1/desktop/tags",method:"GET"};case"tags.replace":return{path:"/v1/desktop/tags",method:"PUT",body:{tags:e.tags}};case"sessions.tags":return{path:`/v1/desktop/sessions/${e.sessionId}/tags`,method:"PUT",body:{tags:e.tags,primary:e.primary}};case"sessions.pin":return{path:`/v1/desktop/sessions/${e.sessionId}/pin`,method:"POST",body:{pinned:e.pinned}};case"sessions.watch":return{path:`/v1/desktop/sessions/${e.sessionId}/watch`,method:"POST",body:{subscription_id:e.subscriptionId,visible:e.visible,can_notify:e.canNotify}};case"sessions.presence":return{path:"/v1/desktop/presence",method:"POST",body:{subscription_id:e.subscriptionId,can_notify_kinds:e.canNotifyKinds,session_id:e.sessionId,window:e.window,can_notify:e.canNotify}};case"sessions.move":return{path:`/v1/desktop/sessions/${e.sessionId}/working-directory`,method:"POST",body:{request_id:e.requestId,cwd:e.cwd}};case"sessions.warm":return{path:`/v1/desktop/sessions/${e.sessionId}/warm`,method:"POST",body:{}};case"sessions.interrupt":return{path:`/v1/desktop/sessions/${e.sessionId}/interrupt`,method:"POST",body:{request_id:e.requestId}};case"supplements.cancel":return{path:`/v1/desktop/sessions/${e.sessionId}/supplements/${e.job}/cancel`,method:"POST",body:{anchor:e.anchor}};case"supplements.restart":return{path:`/v1/desktop/sessions/${e.sessionId}/supplements/${e.job}/restart`,method:"POST",body:{anchor:e.anchor}};case"supplements.steer":return{path:`/v1/desktop/sessions/${e.sessionId}/supplements/${e.job}/steer`,method:"POST",body:{anchor:e.anchor,text:e.text}};case"sessions.variables.list":return{path:`/v1/desktop/sessions/${e.sessionId}/variables`,method:"GET"};case"sessions.variables.create":return{path:`/v1/desktop/sessions/${e.sessionId}/variables`,method:"POST",body:{key:e.key,value:e.value,type:e.type}};case"sessions.variables.update":return{path:`/v1/desktop/sessions/${e.sessionId}/variables/${encodeURIComponent(e.key)}`,method:"PATCH",body:{value:e.value,type:e.type}};case"sessions.variables.delete":return{path:`/v1/desktop/sessions/${e.sessionId}/variables/${encodeURIComponent(e.key)}`,method:"DELETE"};case"legacy.models":{const t=new URLSearchParams;return e.provider&&t.set("provider",e.provider),e.sort&&t.set("sort",e.sort),e.direction&&t.set("direction",e.direction),{path:t.size>0?`/v1/models?${t}`:"/v1/models",method:"GET"}}case"legacy.models.providers":return{path:"/v1/models/providers",method:"GET"};case"auth.probe":return{path:`/v1/auth/providers/${e.provider}/probe`,method:"POST"};case"legacy.agent.upload":return{path:`/v1/agents/${e.agentId}/upload`,method:"POST"};case"agent.publish":{ht(e);const t=new URLSearchParams;e.visibility==="org"&&e.tenantId&&(t.set("visibility","org"),t.set("tenant_id",e.tenantId));const s=t.toString();return{path:`/v1/agents/${e.agentId}/publish${s?`?${s}`:""}`,method:"POST",body:{document:e.document??{},...mt(e)}}}case"agent.republish":{ht(e);const t=new URLSearchParams;e.visibility==="org"&&e.tenantId&&(t.set("visibility","org"),t.set("tenant_id",e.tenantId));const s=t.toString();return{path:`/v1/agents/${e.agentId}/publish${s?`?${s}`:""}`,method:"PUT",body:{hub_agent_id:e.hubAgentId,document:e.document??{},...mt(e),...e.expectedRemoteRevision?{expected_remote_revision:e.expectedRemoteRevision}:{}}}}case"team.publish":{ht(e);const t=new URLSearchParams;return e.visibility==="org"&&e.tenantId&&(t.set("visibility","org"),t.set("tenant_id",e.tenantId)),{path:`/v1/teams/${e.teamId}/publish${t.size?`?${t}`:""}`,method:"POST",body:mt(e)}}case"team.pull":{const t=new URLSearchParams;e.tenantId&&t.set("tenant_id",e.tenantId);const s=t.toString();return{path:`/v1/teams/pull/${e.teamId}${s?`?${s}`:""}`,method:"GET"}}case"agent.nameAvailability":return{path:`/v1/agent-name-availability?${new URLSearchParams({name:e.name})}`,method:"GET"};case"legacy.agents.list":{const t=new URLSearchParams({page:String(e.page??1),per_page:String(e.perPage??10)});return e.name&&t.set("name",e.name),e.sort&&t.set("sort",e.sort),e.direction&&t.set("direction",e.direction),{path:`/v1/agents?${t}`,method:"GET"}}case"legacy.agent.get":return{path:`/v1/agents/${e.agentId}`,method:"GET"};case"legacy.agent.history":{const t=new URLSearchParams({page:String(e.page??1),per_page:String(e.perPage??10)});return{path:`/v1/agents/${e.agentId}/history?${t}`,method:"GET"}}case"wakes.list":{const t=new URLSearchParams;return e.limit!==void 0&&t.set("limit",String(e.limit)),e.includeDormant!==void 0&&t.set("include_dormant",String(e.includeDormant)),{path:t.size>0?`/v1/desktop/wakes?${t}`:"/v1/desktop/wakes",method:"GET"}}case"wakes.create":return{path:"/v1/desktop/wakes",method:"POST",body:{request_id:e.requestId,...Na(e),message:e.message,...pn(e)}};case"wakes.edit":return{path:`/v1/desktop/wakes/${e.sessionId}/${e.wakeId}`,method:"PATCH",body:{...e.message!==void 0?{message:e.message}:{},...pn(e)}};case"wakes.remove":return{path:`/v1/desktop/wakes/${e.sessionId}/${e.wakeId}`,method:"DELETE"};case"monitors.cancel":return{path:`/v1/desktop/monitors/${encodeURIComponent(e.sessionId)}/${encodeURIComponent(e.monitorId)}`,method:"DELETE"};case"jobs.cancel":return{path:`/v1/desktop/sessions/${encodeURIComponent(e.sessionId)}/jobs/${encodeURIComponent(e.jobId)}/cancel`,method:"POST"};case"legacy.jobs.list":{const t=new URLSearchParams;return e.agentId&&t.set("agent_id",e.agentId),e.status&&t.set("status",e.status),{path:t.size>0?`/v1/jobs?${t}`:"/v1/jobs",method:"GET"}}case"legacy.job.get":return{path:`/v1/jobs/${e.jobId}`,method:"GET"};case"legacy.schedules.list":return{path:`/v1/schedules?${new URLSearchParams({page:String(e.page??1),per_page:String(e.perPage??10)})}`,method:"GET"};case"legacy.agent.schedules.list":{const t=new URLSearchParams({page:String(e.page??1),per_page:String(e.perPage??10)});return{path:`/v1/agents/${e.agentId}/schedules?${t}`,method:"GET"}}case"legacy.agent.schedule.create":return{path:`/v1/agents/${e.agentId}/schedules`,method:"POST",body:e.schedule};case"legacy.schedule.get":return{path:`/v1/schedules/${e.scheduleId}`,method:"GET"};case"legacy.schedule.edit":return{path:`/v1/schedules/${e.scheduleId}`,method:"PATCH",body:e.schedule};case"legacy.schedule.remove":return{path:`/v1/schedules/${e.scheduleId}`,method:"DELETE"};case"legacy.agent.create":return{path:"/v1/agents",method:"POST",body:e.agent};case"legacy.agent.update":return{path:`/v1/agents/${e.agentId}`,method:"PATCH",body:e.update};case"legacy.agent.delete":return{path:`/v1/agents/${e.agentId}`,method:"DELETE"};case"legacy.agent.conversation.clear":return{path:`/v1/agents/${e.agentId}/conversation`,method:"DELETE"};case"legacy.agent.systemPrompt.get":return{path:`/v1/agents/${e.agentId}/system-prompt`,method:"GET"};case"legacy.agent.systemPrompt.update":return{path:`/v1/agents/${e.agentId}/system-prompt`,method:"PUT",body:{system_prompt:e.systemPrompt}};case"legacy.agent.download":return{path:`/v1/agents/${e.agentId}/download`,method:"GET"};case"legacy.job.cancel":return{path:`/v1/jobs/${e.jobId}`,method:"DELETE"};case"commands.list":return{path:"/v1/desktop/commands",method:"GET"};case"commands.entities":return{path:`/v1/desktop/sessions/${e.sessionId}/command-entities?command=${encodeURIComponent(e.command)}${e.name?`&name=${encodeURIComponent(e.name)}`:""}`,method:"GET"};case"models.catalogue":{const t=e.scope?`&scope=${e.scope}`:"";return{path:`/v1/desktop/models?live=${e.live??!1}${t}`,method:"GET"}}case"usage.get":{const t=new URLSearchParams({live:String(e.live??!1),refresh:String(e.refresh??!1)});return e.provider&&t.set("provider",e.provider),{path:`/v1/desktop/usage?${t}`,method:"GET"}}case"quota.notice":{const t=new URLSearchParams({refresh:String(e.refresh??!1)});return e.provider&&t.set("provider",e.provider),e.model&&t.set("model",e.model),{path:`/v1/desktop/quota-notice?${t}`,method:"GET"}}case"analytics.get":{const t=new URLSearchParams({days:String(e.days??30)});return e.sessionId&&t.set("session_id",e.sessionId),e.sinceMs!==void 0&&t.set("since_ms",String(e.sinceMs)),e.untilMs!==void 0&&t.set("until_ms",String(e.untilMs)),{path:`/v1/desktop/analytics?${t}`,method:"GET"}}case"analytics.models":{const t=new URLSearchParams({days:String(e.days??30)});return e.sessionId&&t.set("session_id",e.sessionId),e.sinceMs!==void 0&&t.set("since_ms",String(e.sinceMs)),e.untilMs!==void 0&&t.set("until_ms",String(e.untilMs)),{path:`/v1/desktop/analytics/models?${t}`,method:"GET"}}case"info.get":return{path:"/v1/desktop/info",method:"GET"};case"sessions.report":{const t=new URLSearchParams({recent_limit:String(e.recentLimit??12)});return{path:`/v1/desktop/sessions/${e.sessionId}/report?${t}`,method:"GET"}}case"skills.list":{const t=new URLSearchParams;e.sessionId&&t.set("session_id",e.sessionId),e.cwd&&t.set("cwd",e.cwd),e.name&&t.set("name",e.name);const s=t.toString();return{path:`/v1/desktop/skills${s?`?${s}`:""}`,method:"GET"}}case"sessions.failovers":return{path:`/v1/desktop/sessions/${e.sessionId}/failovers`,method:"GET"};case"sessions.credential":return{path:`/v1/desktop/sessions/${e.sessionId}/credentials`,method:"POST",body:{action:e.action,key:e.key,value:e.value,confirmed:e.confirmed}};case"sessions.fork":return{path:`/v1/desktop/sessions/${e.sessionId}/fork`,method:"POST",body:{request_id:e.requestId,message:e.message,boundary:e.boundary,entry_id:e.entryId}};case"sessions.stop":return{path:"/v1/desktop/stop",method:"POST",body:{request_id:e.requestId,targets:e.targets,confirmed:e.confirmed}};case"sessions.aside":return{path:`/v1/desktop/sessions/${e.sessionId}/asides`,method:"POST",body:{request_id:e.requestId,text:e.text,aside_id:e.asideId,subscription_id:e.subscriptionId}};case"sessions.adopt":return{path:`/v1/desktop/sessions/${e.sessionId}/asides/${e.asideId}/adopt`,method:"POST",body:{request_id:e.requestId,confirmed:e.confirmed}};case"sessions.aside.get":case"sessions.aside.close":return{path:`/v1/desktop/sessions/${e.sessionId}/asides/${e.asideId}`,method:e.op==="sessions.aside.get"?"GET":"DELETE"};case"mcp.list":return{path:`/v1/desktop/sessions/${e.sessionId}/mcp`,method:"GET"};case"mcp.credentials.store":return{path:`/v1/desktop/sessions/${e.sessionId}/mcp/credentials`,method:"POST",body:{name:e.name,values:e.values,confirmed_replace:e.confirmedReplace}};case"mcp.control":return{path:`/v1/desktop/sessions/${e.sessionId}/mcp`,method:"POST",body:e.control};case"mcp.catalog":{const t=new URLSearchParams;e.cwd&&t.set("cwd",e.cwd),e.sessionId&&t.set("session_id",e.sessionId);const s=t.toString();return{path:s?`/v1/desktop/mcp?${s}`:"/v1/desktop/mcp",method:"GET"}}case"mcp.catalog.control":return{path:"/v1/desktop/mcp",method:"POST",body:{...e.control,...e.cwd?{cwd:e.cwd}:{}}};case"mcp.catalog.credentials":return{path:"/v1/desktop/mcp/credentials",method:"POST",body:{name:e.name,values:e.values,...e.header?{header:e.header}:{},confirmed_replace:e.confirmedReplace,...e.cwd?{cwd:e.cwd}:{}}};case"radient.request":return{path:"/v1/desktop/radient",method:"POST",body:e.control};case"providers.list":return{path:"/v1/auth/providers",method:"GET"};case"accounts.list":return{path:"/v1/auth/status",method:"GET"};case"accounts.remove":return{path:`/v1/auth/accounts/${e.accountId}`,method:"DELETE"};case"tunnel.setup.read":return{path:e.credentialId===void 0?"/v1/desktop/tunnel/setup":`/v1/desktop/tunnel/setup?credential_id=${e.credentialId}`,method:"GET"};case"tunnel.setup.plan":return{path:"/v1/desktop/tunnel/setup",method:"POST",body:{action:"plan",...e.credentialId!==void 0?{credential_id:e.credentialId}:{}}};case"tunnel.setup.run":return{path:"/v1/desktop/tunnel/setup",method:"POST",body:{action:"run",credential_id:e.credentialId,...e.acceptMonthlyPrice!==void 0?{accept_monthly_price:e.acceptMonthlyPrice}:{}}};case"auth.start":return{path:"/v1/auth/login",method:"POST",body:{provider:e.provider}};case"auth.status":return{path:`/v1/auth/operations/${e.id}`,method:"GET"};case"auth.input":return{path:`/v1/auth/operations/${e.id}/input`,method:"POST",body:{prompt_id:e.promptId,value:e.value}};case"auth.cancel":return{path:`/v1/auth/operations/${e.id}`,method:"DELETE"};case"auth.key":return{path:`/v1/auth/providers/${e.provider}/key`,method:"PUT",body:{value:e.value}};case"auth.logout":return{path:`/v1/auth/providers/${e.provider}/credentials`,method:"DELETE"};case"agent_messages.status":return{path:`/v1/desktop/team-bridge/status?boundary=${e.boundary}`,method:"GET"};case"agent_messages.enable":return{path:"/v1/desktop/team-bridge/settings",method:"PUT",body:{expected_account_id:e.expected_account_id,tenant_id:e.tenant_id,state:e.state,consent_version:e.consent_version,consented_via:e.consented_via}};case"settings.list":return{path:"/v1/settings",method:"GET"};case"settings.edit":return{path:`/v1/settings/${e.key}`,method:"PATCH",body:{value:e.value,base:e.base}};case"settings.reset":return{path:`/v1/settings/${e.key}/reset`,method:"POST"};case"tts.paths":return{path:"/v1/tts/paths",method:"GET"};case"config.get":return{path:"/v1/config",method:"GET"};case"config.update":return{path:"/v1/config",method:"PATCH",body:e.value};case"instructions.get":return{path:"/v1/config/system-prompt",method:"GET"};case"instructions.update":return{path:"/v1/config/system-prompt",method:"PATCH",body:{content:e.content}};case"credentials.list":return{path:"/v1/credentials",method:"GET"};case"credentials.update":return{path:"/v1/credentials",method:"PATCH",body:{key:e.key,value:e.value}};case"projects.list":return{path:"/v1/desktop/projects",method:"GET"};case"projects.get":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}`,method:"GET"};case"projects.create":return{path:"/v1/desktop/projects",method:"POST",body:{name:e.name,...e.description!==void 0?{description:e.description}:{},...e.status!==void 0?{status:e.status}:{},...e.tags!==void 0?{tags:e.tags}:{}}};case"projects.update":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}`,method:"PATCH",body:{...e.fields,...e.force_done===!0?{force_done:!0}:{}}};case"projects.delete":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}`,method:"DELETE",body:{confirm:e.confirmed_name}};case"projects.link":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}/links`,method:"POST",body:{session_id:e.sessionId}};case"projects.unlink":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}/links/${encodeURIComponent(e.sessionId)}`,method:"DELETE"};case"projects.milestone":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}/milestones`,method:"POST",body:{name:e.name,...e.targetDate!==void 0?{target_date:e.targetDate}:{},...e.completed!==void 0?{completed:e.completed}:{}}};case"projects.milestone.remove":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}/milestones/${encodeURIComponent(e.name)}`,method:"DELETE"};case"projects.request_update":return{path:`/v1/desktop/projects/${encodeURIComponent(e.key)}/request-update`,method:"POST"};case"projects.search":return{path:`/v1/desktop/projects/search?${new URLSearchParams({q:e.q,limit:String(e.limit??na)})}`,method:"GET"};case"aida.status":return{path:"/v1/desktop/aida",method:"GET"};case"aida.control":return{path:"/v1/desktop/aida",method:"POST",body:{op:e.action}};case"code_requests.list":return{path:`/v1/desktop/sessions/${e.sessionId}/code-requests`,method:"GET"};case"code_requests.refresh":return{path:`/v1/desktop/sessions/${e.sessionId}/code-requests/refresh`,method:"POST",body:{...e.keys!==void 0?{keys:e.keys}:{},...e.force!==void 0?{force:e.force}:{}}};case"static.sign":return{path:"/v1/static/sign",method:"POST",body:{route:e.route,path:e.path,ttl_s:e.ttlS}}}}const Dr=64,$r=64*1024*1024,hn=e=>{let t;const s=new Set,i=(l,p)=>{const w=typeof l=="function"?l(t):l;if(!Object.is(w,t)){const y=t;t=p??(typeof w!="object"||w===null)?w:Object.assign({},t,w),s.forEach(P=>P(t,y))}},a=()=>t,c={setState:i,getState:a,getInitialState:()=>d,subscribe:l=>(s.add(l),()=>s.delete(l))},d=t=e(i,a,c);return c},Da=e=>e?hn(e):hn,$a=e=>e;function La(e,t=$a){const s=Nt.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return Nt.useDebugValue(s),s}const fn=e=>{const t=Da(e),s=i=>La(t,i);return Object.assign(s,t),s},Zn=e=>e?fn(e):fn;function Bn(e,t){let s;try{s=e()}catch{return}return{getItem:a=>{var o;const r=d=>d===null?null:JSON.parse(d,void 0),c=(o=s.getItem(a))!=null?o:null;return c instanceof Promise?c.then(r):r(c)},setItem:(a,o)=>s.setItem(a,JSON.stringify(o,void 0)),removeItem:a=>s.removeItem(a)}}const St=e=>t=>{try{const s=e(t);return s instanceof Promise?s:{then(i){return St(i)(s)},catch(i){return this}}}catch(s){return{then(i){return this},catch(i){return St(i)(s)}}}},Ua=(e,t)=>(s,i,a)=>{let o={storage:Bn(()=>localStorage),partialize:T=>T,version:0,merge:(T,ne)=>({...ne,...T}),...t},r=!1;const c=new Set,d=new Set;let l=o.storage;if(!l)return e((...T)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),s(...T)},i,a);const p=()=>{const T=o.partialize({...i()});return l.setItem(o.name,{state:T,version:o.version})},w=a.setState;a.setState=(T,ne)=>{w(T,ne),p()};const y=e((...T)=>{s(...T),p()},i,a);a.getInitialState=()=>y;let P;const ue=()=>{var T,ne;if(!l)return;r=!1,c.forEach(A=>{var Z;return A((Z=i())!=null?Z:y)});const De=((ne=o.onRehydrateStorage)==null?void 0:ne.call(o,(T=i())!=null?T:y))||void 0;return St(l.getItem.bind(l))(o.name).then(A=>{if(A)if(typeof A.version=="number"&&A.version!==o.version){if(o.migrate){const Z=o.migrate(A.state,A.version);return Z instanceof Promise?Z.then(it=>[!0,it]):[!0,Z]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,A.state];return[!1,void 0]}).then(A=>{var Z;const[it,is]=A;if(P=o.merge(is,(Z=i())!=null?Z:y),s(P,!0),it)return p()}).then(()=>{De?.(P,void 0),P=i(),r=!0,d.forEach(A=>A(P))}).catch(A=>{De?.(void 0,A)})};return a.persist={setOptions:T=>{o={...o,...T},T.storage&&(l=T.storage)},clearStorage:()=>{l?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>ue(),hasHydrated:()=>r,onHydrate:T=>(c.add(T),()=>{c.delete(T)}),onFinishHydration:T=>(d.add(T),()=>{d.delete(T)})},o.skipHydration||ue(),P||y},Gn=Ua,Za=(e,t)=>e!==null&&e.message===t.message&&e.removed===t.removed&&e.max_age_hours===t.max_age_hours&&e.in_progress===t.in_progress&&e.first_removal_at===t.first_removal_at&&e.freed_bytes_estimate===t.freed_bytes_estimate&&e.record===t.record;function Lr(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.message!="string"||t.message.trim()==="")return null;const s=(i,a)=>typeof i=="number"&&Number.isFinite(i)?i:a;return{message:t.message,removed:s(t.removed,0),max_age_hours:s(t.max_age_hours,48),in_progress:t.in_progress===!0,first_removal_at:typeof t.first_removal_at=="string"?t.first_removal_at:"",freed_bytes_estimate:typeof t.freed_bytes_estimate=="number"&&Number.isFinite(t.freed_bytes_estimate)?t.freed_bytes_estimate:null,record:typeof t.record=="string"?t.record:""}}const Ur=Zn()(Gn(e=>({notice:null,receive:t=>e(s=>Za(s.notice,t)?s:{notice:t}),dismiss:()=>e(t=>t.notice===null?t:{notice:null})}),{name:"delegated-cleanup-notice",storage:Bn(()=>{if(typeof localStorage>"u"||localStorage===null)throw new Error("no localStorage in this environment");return localStorage}),partialize:e=>({notice:e.notice})})),je=260,Fn=220,zn=320,wt=56,Ba=je,Ga=1024,Hn=480,Vn=44,Wn=400,Fa=560;function Kn(e){return Math.max(0,Math.min(Fa,e-Hn))}function gn(e){return Kn(e)>=Wn?"docked":"overlay"}function Zr({capacity:e,min:t,max:s,drawn:i}){const a=e>=t;return a?{resizable:a,value:Math.min(Math.max(i,t),e),minWidth:t,maxWidth:Math.min(s,e)}:{resizable:a,value:i,minWidth:i,maxWidth:i}}function za(e,t=je,s=Vn){return gn(e-Yn(t)-s)==="overlay"&&gn(e-wt-s)==="docked"}function Yn(e){return Number.isNaN(e)?je:Math.min(zn,Math.max(Fn,e))}function Br(e,t,s,i=je,a=!1,o=Vn){if(e>=Ga){const c=!t&&a&&za(e,i,o);return{mode:t||c?"strip":"docked",width:t||c?wt:Yn(i),collapsed:t||c,sheetOpen:!1,resizable:!t&&!c}}return{mode:s?"overlay":"strip",width:s?Ba:wt,collapsed:!0,sheetOpen:s,resizable:!1}}function Gr(e){return e.shiftKey||e.altKey||!(e.metaKey||e.ctrlKey)?!1:e.key.toLowerCase()==="b"}const Fr=e=>e?"⌘B":"Ctrl+B",Ha=["active","created"],zr={running:"Running",today:"Today",week:"This week",older:"Older"},Va=new Set(["busy","delegating","approval","answer","wedged"]);function et(e){return Va.has(e.status?.code??"")}const Wa=new Set(["approval","answer"]);function Ka(e){return Wa.has(e.status?.code??"")}const Ya=24*60*60*1e3,Xa=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()};function Rt(e,t){const s=t==="created"?e.created_at:e.updated_at;return typeof s!="number"||!Number.isFinite(s)||s<=0?null:s*1e3}const Ja="last_user_at";function Qa(e){const t=e[Ja],s=typeof t=="number"&&Number.isFinite(t)&&t>0?t:e.created_at;return typeof s!="number"||!Number.isFinite(s)||s<=0?null:s*1e3}function qa(e,t,s){if(et(e))return"running";const i=Rt(e,s);if(i===null)return"older";const a=Xa(t);return i>=a?"today":i>=a-6*Ya?"week":"older"}function Hr(e,t,s){const i={running:[],today:[],week:[],older:[]};for(const a of e)i[qa(a,t,s)].push(a);return i}function eo(e,t,s){const i=Rt(e,s);if(i===null)return"";const a=Math.floor(Math.max(0,t-i)/6e4);if(a<1)return"now";if(a<60)return`${a}m`;const o=Math.floor(a/60);if(o<24)return`${o}h`;const r=Math.floor(o/24);if(r<7)return`${r}d`;const c=Math.floor(r/7);return r<365?`${c}w`:`${Math.floor(r/365)}y`}function Vr(e,t,s){const i=eo(e,t,s);if(!i)return"";const a=s==="created"?"created":"last active";if(i==="now")return`${a} just now`;const o={m:"minute",h:"hour",d:"day",w:"week",y:"year"},r=Number.parseInt(i,10),c=o[i.slice(-1)];return`${a} ${r} ${c}${r===1?"":"s"} ago`}const It=["pinned","running","today","week","older","agents","teams"];function Wr(e){return e==="agents"||e==="teams"}const Ce=8;function to(e,t){if(!(t in e))return e;const s={...e};return delete s[t],s}function Kr(e,t){return{...e,[t]:(e[t]??Ce)+Ce}}function Yr(e,t,s,i,a){const o=!(e[s]??i);return{expanded:{...e,[s]:o},caps:!o&&!a?to(t,s):t}}function Xr(e,t,s,i){return(e||t!=="")&&(i>Ce||s.trim()!=="")}const Jr="Collapse, then reopen, to restore the compact list";function Qr(e){return(e??Ce)>Ce}const qr=e=>`section-grown-hint-${e}`,no=e=>e===1?"Show 1 more":`Show ${e} more`;function ec(e,t){return`${no(e)} ${t}`}const ve={hidden:[],order:[...It],pins:[],groupBy:"section",tagsEnabled:!1,basis:"active",orderBy:"active-first",loads:0,pinnedAgents:[]},so=10,pe=[25,50],io=50,ao=500,oo=64;function re(e){const t=Math.max(0,Math.floor(e));return t===0?so:t<=pe.length?pe[t-1]:pe[pe.length-1]+(t-pe.length)*io}function tc(e,t){const s=re(e+1)-re(e),i=Math.max(0,Math.min(s,t));return i===1?"Show 1 more chat":`Show ${i} more chats`}function nc(e,t,s){const i=re(t+1)-re(t),a=re(t),o=Math.min(a+i,e.length);let r=0;for(let d=a;d<o;d+=1)Ot(e[d])&&(r+=1);const c=Math.max(0,o-a-r);return c>0?c:Math.max(0,Math.min(i,s))}function Ot(e){return et(e)}function ro(e){return Ka(e)?0:et(e)?1:2}function co(e,t){return et(e)?Qa(e):Rt(e,t)}function lo(e,t){return e===null&&t===null?0:e===null?1:t===null?-1:t-e}function sc(e,t,s){const i=e.map((a,o)=>({row:a,index:o,lane:t==="active-first"?ro(a):0,at:co(a,s)}));return i.sort((a,o)=>a.lane-o.lane||lo(a.at,o.at)||a.index-o.index),i.map(a=>a.row)}function ic(e,t){const{limit:s,currentId:i,searching:a=!1}=t;if(a)return{rows:[...e],lifted:!1,remaining:0};const o=[];let r=Math.max(0,s);for(const l of e){if(r>0){o.push(l),r-=1;continue}Ot(l)&&o.push(l)}const c=Math.max(0,e.length-o.length);if(!i)return{rows:o,lifted:!1,remaining:c};const d=e.find(l=>l.session_id===i)??null;return d===null||o.includes(d)?{rows:o,lifted:!1,remaining:c}:{rows:[d,...o],lifted:!0,remaining:c}}function ac(e,t){if(t.searching)return{rows:[...e],lifted:!1,hidden:0,held:e.length};const s=re(t.loads),i=[];let a=s;for(const d of e){if(Ot(d)){i.push(d);continue}a>0&&(i.push(d),a-=1)}const o=t.currentId,r=o==null?null:e.find(d=>d.session_id===o)??null,c=r!==null&&!i.includes(r);return{rows:c&&r!==null?[r,...i]:i,lifted:c,hidden:e.length-i.length-(c?1:0),held:e.length}}function oc(e){if(e.add<=0)return null;const t=e.add===1?"Show 1 more chat":`Show ${e.add} more chats`;if(e.drawn>=e.total)return{label:t,aria:t};const s=`${e.drawn} of ${e.total}`;return{label:`${t} · ${s}`,aria:`${t} · ${s} shown`}}const uo="mt-4",po="mt-2";function rc(e){return e?uo:po}function cc(e,t,s,i){return s?e.toLocaleLowerCase().includes(s.toLocaleLowerCase())||(i??"").toLocaleLowerCase().includes(s.toLocaleLowerCase())||t>0:!0}function lc(e,t){if(t==="section")return null;if(t==="flat")return[{key:"all",label:"",rows:[...e]}];const s=new Map;for(const o of e){const r=o.binding?.team||o.binding?.agent||"",c=r||"ungrouped",d=s.get(c)??{key:c,label:r||"Ungrouped",rows:[]};d.rows.push(o),s.set(c,d)}const i=[...s.values()],a=i.findIndex(o=>o.key==="ungrouped");return a>0&&i.push(...i.splice(a,1)),i}function mo(e,t){return!e.hidden.includes(t)}function Xn(e){return e.order.filter(t=>mo(e,t))}function dc(e,t){const s=e.hidden.includes(t)?e.hidden.filter(i=>i!==t):[...e.hidden,t];return{...e,hidden:s}}function uc(e,t,s){const i=Xn(e),a=i.indexOf(t),o=i[a+s];if(a<0||o===void 0)return e;const r=e.order.indexOf(t),c=e.order.indexOf(o),d=[...e.order];return d[r]=o,d[c]=t,{...e,order:d}}const ho=["running","today","week","older"];function vn(e){return ho.includes(e)}function pc(e,t,s,i){if(!vn(t)||i&&!i(t))return!1;const a=Xn(e),o=a.indexOf(t);if(o<0)return!1;const r=a[o+s];return r===void 0||!vn(r)?!1:i?i(r):!0}const fo=["section","agent","flat"],go=["active-first","recent"];function mc(e){if(typeof e!="object"||e===null)return ve;const t=e,s=new Set(It),i=[];if(Array.isArray(t.order))for(const y of t.order)typeof y=="string"&&s.has(y)&&(i.includes(y)||i.push(y));for(const y of It)i.includes(y)||i.push(y);const a=[];if(Array.isArray(t.hidden))for(const y of t.hidden)typeof y=="string"&&s.has(y)&&(a.includes(y)||a.push(y));const o=fo.includes(t.groupBy)?t.groupBy:ve.groupBy,r=Ha.includes(t.basis)?t.basis:ve.basis,c=go.includes(t.orderBy)?t.orderBy:ve.orderBy,d=typeof t.loads=="number"&&Number.isFinite(t.loads)&&t.loads>0?Math.min(ao,Math.floor(t.loads)):0,l=[];if(Array.isArray(t.pinnedAgents)){for(const y of t.pinnedAgents)if(typeof y=="string"&&y!==""&&!l.includes(y)){if(l.length>=oo)break;l.push(y)}}const p=[],w=new Set;if(Array.isArray(t.pins))for(const y of t.pins)typeof y=="string"&&y.length!==0&&(w.has(y)||(w.add(y),p.push(y)));return{hidden:a,order:i,groupBy:o,tagsEnabled:typeof t.tagsEnabled=="boolean"?t.tagsEnabled:!1,basis:r,orderBy:c,loads:d,pins:p,pinnedAgents:l}}const Jn={sort:"recent",order:"asc",group:!0,workingOpen:!1,closedSections:[],kinds:[]},vo=["recent","name","kind","modified","created","size"],bo=["images","video","audio","documents","spreadsheets","presentations","code","archives","other"];function Pt(e){const t=e&&typeof e=="object"?e:{};return{sort:vo.includes(t.sort??"")?t.sort:Jn.sort,order:t.order==="desc"?"desc":"asc",group:typeof t.group=="boolean"?t.group:!0,workingOpen:t.workingOpen===!0,closedSections:Array.isArray(t.closedSections)?[...new Set(t.closedSections.filter(s=>["Highlights","Images","Videos","Sounds","Documents","Spreadsheets","Other"].includes(s)))]:[],kinds:Array.isArray(t.kinds)?[...new Set(t.kinds.filter(s=>bo.includes(s)))]:[]}}function hc(e,t){const s=i=>{switch(t.sort){case"name":return i.row.name;case"kind":return`${i.row.kind}\0${i.row.name}`;case"modified":return i.modified;case"created":return i.created;case"size":return i.row.document.sizeBytes??null;default:return i.mentioned}};return[...e].sort((i,a)=>{const o=s(i),r=s(a);if(o===null||r===null)return o===r?0:o===null?1:-1;const c=typeof o=="string"&&typeof r=="string"?o.localeCompare(r,void 0,{numeric:!0}):Number(o)-Number(r);return(t.order==="asc"?c:-c)||i.mentioned-a.mentioned})}const _o=e=>{switch(e.row.kind){case"images":return"Images";case"video":return"Videos";case"audio":return"Sounds";case"spreadsheets":return"Spreadsheets";case"documents":case"presentations":case"code":return"Documents";default:return"Other"}};function fc(e,t,s,i){const a=e.filter(c=>c.highlighted),o=e.filter(c=>!c.highlighted),r=[];if(a.length&&r.push({id:"Highlights",label:"Highlights",items:a,open:s||!i.has("Highlights"),highlights:!0}),a.length&&o.length&&(r.push({id:"Working files",label:"Working files",items:[],open:t.workingOpen||s,highlights:!1}),!t.workingOpen&&!s))return r;if(!t.group)o.length&&r.push({id:"Files",label:"Files",items:o,open:!0,highlights:!1});else for(const c of["Images","Videos","Sounds","Documents","Spreadsheets","Other"]){const d=o.filter(l=>_o(l)===c);d.length&&r.push({id:c,label:c,items:d,open:s||!i.has(c),highlights:!1})}return r}function gc(e,t,s){const i=[],a=new Map,o=Math.max(136,t-16),r=Math.max(1,Math.floor((o+4)/140));let c=0;const d=(l,p,w,y,P=1)=>{y.forEach((ue,T)=>a.set(ue.row.document.id,{band:i.length,column:T})),i.push({section:l,kind:p,height:w,top:c,items:y,cols:P}),c+=w};for(const l of e)if(d(l,"header",32,[]),!!l.open)if(l.highlights)for(const p of l.items)d(l,"highlight",p.why?68:44,[p]);else if(s&&l.id==="Images"){const p=(o-4*(r-1))/r,w=Math.round((p-8)*3/4)+32;for(let y=0;y<l.items.length;y+=r)d(l,"tiles",w,l.items.slice(y,y+r),r)}else if(s&&l.id==="Videos")for(const p of l.items)d(l,"video",Math.min(Math.round((o-8)*9/16),280)+32,[p]);else if(s&&l.id==="Sounds")for(const p of l.items)d(l,"audio",80,[p]);else for(const p of l.items)d(l,"compact",36,[p]);return{bands:i,height:c,columns:r,positions:a}}function vc(e,t,s,i){const a=Math.max(600,s*.75);let o=0,r=e.bands.length;for(;o<r;){const l=o+r>>>1,p=e.bands[l];p.top+p.height<t-a?o=l+1:r=l}const c=new Set;for(let l=o;l<e.bands.length&&e.bands[l].top<=t+s+a;l++)c.add(l);const d=i?e.positions.get(i):null;return d&&c.add(d.band),[...c].sort((l,p)=>l-p)}function bc(e,t,s,i){const a=e.positions.get(t);if(!a)return null;const o=e.bands[a.band],r=e.bands.filter(p=>p.section.id===o.section.id&&p.items.length);if(s==="Home")return r[0]?.items[0]?.row.document.id??null;if(s==="End")return r.at(-1)?.items.at(-1)?.row.document.id??null;if(s==="ArrowLeft"||s==="ArrowRight")return o.items[a.column+(s==="ArrowLeft"?-1:1)]?.row.document.id??null;const c=s==="ArrowUp"||s==="PageUp"?-1:1,d=o.top+(s.startsWith("Page")?i*c:c);let l=a.band+c;for(;l>=0&&l<e.bands.length;l+=c){const p=e.bands[l];if(p.items.length&&!(s.startsWith("Page")&&(c>0?p.top<d:p.top>d)))return p.items[Math.min(a.column,p.items.length-1)].row.document.id}if(s.startsWith("Page")){const p=e.bands.filter(y=>y.items.length),w=c<0?p[0]:p.at(-1);return w?.items[c<0?0:w.items.length-1]?.row.document.id??null}return null}const yo="both",Qn="by-turn",xt=[{value:"by-turn",label:"By turn"},{value:"by-response",label:"By response"}];function _c(e){for(const t of xt)if(e===t.value)return t.value;return Qn}function yc(e){return xt.find(t=>t.value===e)?.label??xt[0].label}const kc="primary+alt+shift+space",ko=/^f([1-9]|1[0-9]|2[0-4])$/;function So(e){return ko.test(e)}function wo(e,t){const s=Io(e,t);return t==="mac"?s.join(""):s.join("+")}function Io(e,t){const i=t==="mac"?{primary:"⌘",meta:"⌘",ctrl:"⌃",alt:"⌥",shift:"⇧"}:{primary:"Ctrl",meta:t==="win"?"Win":"Super",ctrl:"Ctrl",alt:"Alt",shift:"Shift"},a={space:"Space",backspace:"Backspace",delete:"Delete",insert:"Insert",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",up:"Up",down:"Down",left:"Left",right:"Right"};return e.split("+").map(o=>o.trim().toLowerCase()).filter(o=>o.length>0).map(o=>o in i?i[o]:o in a?a[o]:So(o)||o.length===1?o.toUpperCase():o)}const tt=[{id:"panel.console",label:"Open console",category:"Panels",defaultChord:"primary+j",scope:"app"},{id:"panel.canvas",label:"Open canvas",category:"Panels",defaultChord:"primary+shift+c",scope:"app"},{id:"panel.run",label:"Open run details",category:"Panels",defaultChord:null,scope:"app"},{id:"panel.ask",label:"Open asks",category:"Panels",defaultChord:null,scope:"app"},{id:"panel.browser",label:"Open browser",category:"Panels",defaultChord:null,scope:"app"},{id:"panel.code",label:"Open code review",category:"Panels",defaultChord:null,scope:"app"}],xo=new Map(tt.map(e=>[e.id,e])),To=e=>xo.get(e),Eo=new Set(["primary+0","primary+r","primary+shift+r","primary+t","primary+shift+t","primary+l",...[1,2,3,4,5,6,7,8,9].map(e=>`primary+${e}`)]),Ct=new Map([["primary+p","Reserved: opens the command palette from anywhere."],["primary+shift+p","Reserved: opens the command palette on commands."],["primary+shift+s","Reserved: starts speech to text."],["primary+k","Reserved: opens the command palette on chats."],["primary+n","Reserved: starts a new chat."],["primary+b","Reserved: toggles the sidebar."],["primary+[","Reserved: goes back in the browser, or between chats outside it."],["primary+]","Reserved: goes forward in the browser, or between chats outside it."],["primary+f","Reserved: finds in the browser page, or searches the transcript outside it."],["primary+alt+up","Reserved: walks up the chat regions."],["primary+alt+down","Reserved: walks down the chat regions."],["primary+shift+a","Reserved: archives the focused conversation."],["primary+s","Reserved: saves the canvas document."],["primary+o","Reserved: opens a file in the canvas."],["primary+shift+up","Reserved: moves the focused chat up the pinned order."],["primary+shift+down","Reserved: moves the focused chat down the pinned order."],["primary+c","Reserved: copy."],["primary+x","Reserved: cut."],["primary+v","Reserved: paste."],["primary+a","Reserved: select all."],["primary+z","Reserved: undo."],["primary+shift+z","Reserved: redo."],["primary+y","Reserved: redo on Windows and Linux."],["primary+r","Reserved: reloads the browser page."],["primary+shift+r","Reserved: reloads the browser page, ignoring the cache."],["primary+t","Reserved: opens a new browser tab."],["primary+shift+t","Reserved: reopens the last closed browser tab."],["primary+l","Reserved: focuses the browser address bar."],...[1,2,3,4,5,6,7,8,9].map(e=>[`primary+${e}`,e===9?"Reserved: switches to the last browser tab.":`Reserved: switches to browser tab ${e}.`]),["primary+0","Reserved: resets browser page zoom, or app zoom outside it."],["primary+plus","Reserved: zooms the browser page or app in."],["primary+=","Reserved: zooms the browser page or app in."],["primary+-","Reserved: zooms the browser page or app out."],["primary+q","Reserved: quits the app."],["primary+w","Reserved: closes the browser tab, or the window outside it."],["primary+m","Reserved: minimises the window."]]),Ro=["primary","alt","shift"],Oo={primary:"primary",meta:"primary",cmd:"primary",command:"primary",super:"primary",ctrl:"primary",control:"primary",alt:"alt",option:"alt",shift:"shift"},Po=new Set(["space","backspace","delete","insert","home","end","pageup","pagedown","up","down","left","right"]),Co=e=>Po.has(e)||/^[a-z0-9]$/.test(e);function At(e){if(typeof e!="string")return null;const t=e.toLowerCase().split("+").map(o=>o.trim()).filter(o=>o.length>0);if(t.length===0)return null;const s=t[t.length-1];if(!Co(s))return null;const i=new Set;for(const o of t.slice(0,-1)){const r=Oo[o];if(r===void 0)return null;i.add(r)}return[...Ro.filter(o=>i.has(o)),s].join("+")}const qn=e=>e.split("+").includes("primary");function nt(e,t){const s=t?.[e];return s===null?null:typeof s=="string"&&!Ct.has(s)?s:To(e)?.defaultChord??null}function Sc(e){const t=new Map;for(const s of tt){const i=nt(s.id,e);i!==null&&!t.has(i)&&t.set(i,s.id)}return t}const Ao=e=>e==="mac"?"A shortcut needs ⌘ or Ctrl.":"A shortcut needs Ctrl.";function jo(e,t,s,i="linux"){const a=e===null?null:At(e);if(a===null)return"That key cannot be bound.";if(!qn(a))return Ao(i);const o=Ct.get(a);if(o!==void 0)return o;for(const r of tt)if(r.id!==t&&nt(r.id,s)===a)return`Already assigned to ${r.label}.`;return null}function Mo(e){if(e===null||typeof e!="object"||Array.isArray(e))return{};const t=e,s=new Set,i={};for(const a of tt){const o=t[a.id];if(o===null){i[a.id]=null;continue}const r=typeof o=="string"?At(o):null,c=r!==null&&Eo.has(r),d=r!==null&&qn(r)&&(c||!Ct.has(r)&&!s.has(r))?r:null;d!==null&&(i[a.id]=d);const l=nt(a.id,i);l!==null&&s.add(l)}return i}function wc(e,t,s){const i=nt(e,t);return i===null?null:es(i,s)}function es(e,t){return wo(e,t)}function Ic(e,t){const s=e.split("+"),i=s[s.length-1],a=s.slice(0,-1).map(o=>o==="primary"?t==="mac"?"Meta":"Control":o==="shift"?"Shift":o==="alt"?"Alt":o);return{glyph:es(e,t),aria:[...a,i.length===1?i.toUpperCase():i].join("+")}}const bn=64,Tt=["canvas","run","browser","console","code"],No={canvas:"isCanvasOpen",run:"isRunPanelOpen",browser:"isBrowserPaneOpen",console:"isConsolePaneOpen",code:"isCodeReviewPaneOpen"};function ts(e){return typeof e=="string"&&Tt.includes(e)}function jt(e){return e.startsWith("draft:")}function Me(e,t){for(let s=e.length-1;s>=0;s-=1){const i=e[s];if(i[0]===t)return i[1]}}function Mt(e){return e.length>bn?e.slice(e.length-bn):e}function ns(e,t,s){return Mt([...e.filter(([i])=>i!==t),[t,s]])}function Do(e,t,s){return Me(e,t)!==s?e:e.filter(([i])=>i!==t)}function $o(e,t){return Me(e,t)===void 0?e:e.filter(([s])=>s!==t)}function Lo(e,t,s){const i=Me(e,t);return i===void 0?e:Mt([...e.filter(([a])=>a!==t&&a!==s),[s,i]])}const _n=Object.freeze({isCanvasOpen:!1,isRunPanelOpen:!1,isBrowserPaneOpen:!1,isConsolePaneOpen:!1,isCodeReviewPaneOpen:!1});function yn(e,t,s){if(s||typeof t!="string")return _n;const i=Me(e,t);return i===void 0?_n:{isCanvasOpen:i==="canvas",isRunPanelOpen:i==="run",isBrowserPaneOpen:i==="browser",isConsolePaneOpen:i==="console",isCodeReviewPaneOpen:i==="code"}}function Uo(e){if(!Array.isArray(e))return[];const t=new Map;for(const s of e){if(!Array.isArray(s)||s.length!==2)continue;const[i,a]=s;typeof i!="string"||i===""||jt(i)||ts(a)&&(t.delete(i),t.set(i,a))}return Mt([...t.entries()])}function xc(e){const t=new Set(Object.keys(e.forgotten));for(const[s,i]of Object.entries(e.archiveFacts))i?.archived===!0&&i.answered===!0&&t.add(s);return t}function kn(e){return No[e]}const Zo={canvas:"isCanvasOpen",run:"isRunPanelOpen",browser:"isBrowserPaneOpen",console:"isConsolePaneOpen",code:"isCodeReviewPaneOpen"},Ne=e=>e.isCanvasOpen?"canvas":e.isRunPanelOpen?"run":e.isBrowserPaneOpen?"browser":e.isConsolePaneOpen?"console":e.isCodeReviewPaneOpen?"code":e.isAskDrawerOpen?"ask":null,st=(e,t)=>e==="ask"?t.askDrawerScope==="fleet"||t.rightSlotRoute.mounted&&t.rightSlotRoute.session:t.rightSlotRoute.mounted,Bo=e=>{const t=Ne(e);return t===null||t==="ask"?null:Zo[t]},H=e=>({isRunPanelOpen:e==="isRunPanelOpen",isCanvasOpen:e==="isCanvasOpen",isBrowserPaneOpen:e==="isBrowserPaneOpen",isConsolePaneOpen:e==="isConsolePaneOpen",isCodeReviewPaneOpen:e==="isCodeReviewPaneOpen",isAskDrawerOpen:e==="isAskDrawerOpen",askDrawerEvictedPane:null}),X=(e,t)=>{const s=e.rightSlotKey;return typeof s!="string"?{}:{rightSlotMemory:ns(e.rightSlotMemory,s,t)}},me=(e,t)=>{const s=e.rightSlotKey;if(typeof s!="string")return{};const i=Do(e.rightSlotMemory,s,t);return i===e.rightSlotMemory?{}:{rightSlotMemory:i}},Go=e=>{const t=e.rightSlotKey;if(typeof t!="string")return{};const s=$o(e.rightSlotMemory,t);return s===e.rightSlotMemory?{}:{rightSlotMemory:s}},Fo=Object.freeze({mounted:!1,session:!1}),ss=Object.freeze([]);function Tc(e,t){const s=Ne(t);if(s===null||!st(s,t))return 0;let i;switch(s){case"canvas":case"ask":i=Math.max(Wn,t.rightSlotWidth||he);break;case"run":i=Math.max(wn,t.rightSlotWidth||he);break;case"browser":i=Math.max(Wo,t.rightSlotWidth||he);break;case"console":i=Math.max(Ko,t.rightSlotWidth||he);break;case"code":i=Math.max(wn,t.rightSlotWidth||he);break}return e<=0?i:s==="canvas"||s==="ask"?Math.min(i,Kn(e)):Math.min(i,Math.max(0,e-Hn))}function Ec(e){const t=Ne(e);return t!==null&&st(t,e)}function Rc(e){const t=Ne(e);return t!==null&&st(t,e)?t:null}function Oc(e){const t=Ne(e);return(t==="canvas"||t==="ask")&&st(t,e)}const he=640,Sn=je,zo=20,Ho=4,Vo=20,wn=320,Wo=480,Ko=480,Yo=5e3,Pc=(e,t)=>e.some(s=>s.surface===t),Cc=(e,t=Date.now())=>e.some(s=>t-s.at<Yo),Xo=[],Jo=4,Qo=["chatMeasureWidth"],Ac=Zn()(Gn((e,t)=>({finderFiles:Jn,setFinderFiles:s=>e({finderFiles:Pt({...t().finderFiles,...s})}),isCommandPaletteOpen:!1,commandPaletteQuery:"",isSidebarCollapsed:!1,showAgentReasoning:!1,transcriptDisplayMode:Qn,themeName:as,rightSlotWidth:0,chatSidebarWidth:Sn,chatSidebarRegions:yo,chatSidebarView:ve,chatSidebarListHeight:null,chatSidebarOrder:"entities-first",dismissedBuiltinOfferSignature:"",isCanvasOpen:!1,isRunPanelOpen:!1,isBrowserPaneOpen:!1,isConsolePaneOpen:!1,isCodeReviewPaneOpen:!1,rightSlotKey:void 0,rightSlotMemory:ss,rightSlotLegacySeed:null,isAskDrawerOpen:!1,askDrawerScope:"session",askDrawerEvictedPane:null,askOpenIntent:null,rightSlotRoute:Fo,consoleOpenIntent:null,runPanelReveal:null,codeReviewReveal:null,browserPaneScope:"conversation",consoleActiveSurface:null,consoleUnseen:Xo,isCreateAgentDialogOpen:!1,mentionRecents:null,profileRecents:{agent:[],team:[]},conversationRecents:[],shortcutBindings:{},openCreateAgentDialog:()=>{e({isCreateAgentDialogOpen:!0})},closeCreateAgentDialog:()=>{e({isCreateAgentDialogOpen:!1})},openCommandPalette:()=>{e({isCommandPaletteOpen:!0})},closeCommandPalette:()=>{e({isCommandPaletteOpen:!1,commandPaletteQuery:""})},toggleCommandPalette:(s="")=>{e(i=>({isCommandPaletteOpen:!i.isCommandPaletteOpen,commandPaletteQuery:i.isCommandPaletteOpen?i.commandPaletteQuery:s}))},setCommandPaletteQuery:s=>{e({commandPaletteQuery:s})},toggleSidebar:()=>{e(s=>({isSidebarCollapsed:!s.isSidebarCollapsed}))},setSidebarCollapsed:s=>{e({isSidebarCollapsed:s})},setShowAgentReasoning:s=>{e({showAgentReasoning:s})},setTranscriptDisplayMode:s=>{e({transcriptDisplayMode:s})},setTheme:s=>{e({themeName:s})},setCanvasOpen:s=>{e(i=>s?{...H("isCanvasOpen"),...X(i,"canvas")}:{isCanvasOpen:!1,...me(i,"canvas")})},setRunPanelOpen:s=>{e(i=>s?{...H("isRunPanelOpen"),...X(i,"run")}:{isRunPanelOpen:!1,...me(i,"run")})},setBrowserPaneOpen:s=>{e(i=>s?{...H("isBrowserPaneOpen"),...X(i,"browser")}:{isBrowserPaneOpen:!1,...me(i,"browser")})},setConsolePaneOpen:s=>{e(i=>s?{...H("isConsolePaneOpen"),...X(i,"console")}:{isConsolePaneOpen:!1,...me(i,"console")})},setCodeReviewPaneOpen:s=>{e(i=>s?{...H("isCodeReviewPaneOpen"),...X(i,"code")}:{isCodeReviewPaneOpen:!1,...me(i,"code")})},clearCodeReviewReveal:s=>{e(i=>i.codeReviewReveal?.nonce===s?{codeReviewReveal:null}:{})},revealCodeReviewPane:()=>{e(s=>({...H("isCodeReviewPaneOpen"),...X(s,"code"),codeReviewReveal:{nonce:(s.codeReviewReveal?.nonce??0)+1}}))},setAskDrawerOpen:(s,i,a)=>{e(o=>{const r=typeof o.rightSlotKey=="string";if(s)return{...H("isAskDrawerOpen"),askDrawerScope:i,askDrawerEvictedPane:r?null:Bo(o),askOpenIntent:null};const c={isAskDrawerOpen:!1,askDrawerEvictedPane:null,askOpenIntent:null};return r?a?.dismissSlot?{...c,...Go(o)}:{...c,...yn(o.rightSlotMemory,o.rightSlotKey,!1)}:o.rightSlotKey===null?a?.dismissSlot?{...c,rightSlotLegacySeed:null}:c:a?.dismissSlot?{...c,rightSlotLegacySeed:null}:{...c,...o.askDrawerEvictedPane===null?null:{[o.askDrawerEvictedPane]:!0}}})},requestAskOpen:(s,i="menu")=>{e({askOpenIntent:{scope:s,via:i}})},clearAskOpenIntent:s=>{e(i=>i.askOpenIntent?.scope===s?{askOpenIntent:null}:{})},setConsoleActiveSurface:s=>{e({consoleActiveSurface:s})},requestConsoleOpen:s=>{e({consoleOpenIntent:s})},clearConsoleOpenIntent:s=>{e(i=>i.consoleOpenIntent===s?{consoleOpenIntent:null}:{})},markConsoleUnseen:(s,i)=>{e(a=>a.consoleUnseen.some(o=>o.surface===i)?{}:{consoleUnseen:[...a.consoleUnseen,{sessionId:s,surface:i,at:Date.now()}]})},clearConsoleUnseen:s=>{const i=Array.isArray(s)?s:[s];e(a=>{const o=a.consoleUnseen.filter(r=>!i.includes(r.surface));return o.length===a.consoleUnseen.length?{}:{consoleUnseen:o}})},setRightSlotWidth:s=>{e({rightSlotWidth:s})},restoreDefaultRightSlotWidth:()=>{e({rightSlotWidth:0})},bindRightSlotKey:(s,i)=>{e(a=>{let o=a.rightSlotMemory,r=a.rightSlotLegacySeed;const c=i?.admittedFrom;return typeof c=="string"&&typeof s=="string"&&(o=Lo(o,c,s)),s===null||(jt(s)?r=null:r!==null&&Me(o,s)===void 0&&(o=ns(o,s,r),r=null)),{rightSlotKey:s,rightSlotMemory:o,rightSlotLegacySeed:r,...yn(o,s,a.isAskDrawerOpen)}})},setRightSlotRoute:s=>{const i=t().rightSlotRoute;i.mounted===s.mounted&&i.session===s.session||e({rightSlotRoute:{...s}})},setShortcutBinding:(s,i)=>{if(i===null){e(o=>{const r={...o.shortcutBindings};return delete r[s],{shortcutBindings:r}});return}const a=At(i);a!==null&&jo(a,s,t().shortcutBindings)===null&&e(o=>({shortcutBindings:{...o.shortcutBindings,[s]:a}}))},clearShortcutBinding:s=>{e(i=>({shortcutBindings:{...i.shortcutBindings,[s]:null}}))},setBrowserPaneScope:s=>{e({browserPaneScope:s})},revealRunPanelSection:s=>{e(i=>({...H("isRunPanelOpen"),...X(i,"run"),runPanelReveal:{section:s,nonce:(i.runPanelReveal?.nonce??0)+1}}))},clearRunPanelReveal:s=>{e(i=>i.runPanelReveal?.nonce===s?{runPanelReveal:null}:{})},setChatSidebarWidth:s=>{e({chatSidebarWidth:Math.min(zn,Math.max(Fn,s))})},setChatSidebarRegions:s=>{e({chatSidebarRegions:s})},setChatSidebarListHeight:s=>{e({chatSidebarListHeight:s})},restoreDefaultChatSidebarListHeight:()=>{e({chatSidebarListHeight:null})},setChatSidebarOrder:s=>{e({chatSidebarOrder:s})},setChatSidebarView:s=>{e({chatSidebarView:s})},dismissBuiltinOffer:s=>{e({dismissedBuiltinOfferSignature:s})},restoreDefaultChatSidebarWidth:()=>{e({chatSidebarWidth:Sn})},rememberMention:(s,i)=>{e(a=>{const o=a.mentionRecents,r=o?.cwd===s?o.paths:[],c=[i,...r.filter(d=>d!==i)].slice(0,zo);return{mentionRecents:{cwd:s,paths:c}}})},rememberProfile:(s,i)=>{e(a=>({profileRecents:{...a.profileRecents,[s]:qo(a.profileRecents[s]??[],i)}}))},rememberConversation:s=>{e(i=>{const a=nr(i.conversationRecents),o=er(a,s);return o.length===a.length&&o.every((r,c)=>r===a[c])?i:{conversationRecents:o}})}}),{name:"ui-preferences-storage",version:Jo,migrate:or,partialize:sr,merge:ar}));function qo(e,t){return[t,...e.filter(s=>s!==t)].slice(0,Ho)}function er(e,t){return[t,...e.filter(s=>s!==t)].slice(0,Vo)}const tr=[];function nr(e){return Array.isArray(e)?e:tr}function sr(e){const{runPanelReveal:t,codeReviewReveal:s,consoleOpenIntent:i,askOpenIntent:a,isAskDrawerOpen:o,askDrawerScope:r,askDrawerEvictedPane:c,rightSlotRoute:d,isCanvasOpen:l,isRunPanelOpen:p,isBrowserPaneOpen:w,isConsolePaneOpen:y,isCodeReviewPaneOpen:P,rightSlotKey:ue,...T}=e;return{...T,rightSlotMemory:ir(e.rightSlotMemory)}}function ir(e){return(e??ss).filter(([t])=>!jt(t))}function ar(e,t){const s=e??{},{isCanvasOpen:i,isRunPanelOpen:a,isBrowserPaneOpen:o,isConsolePaneOpen:r,isCodeReviewPaneOpen:c,...d}=s;return{...t,...d,finderFiles:Pt(s.finderFiles),rightSlotKey:t.rightSlotKey,rightSlotMemory:Uo(s.rightSlotMemory),rightSlotLegacySeed:ts(s.rightSlotLegacySeed)?s.rightSlotLegacySeed:null,shortcutBindings:Mo(s.shortcutBindings)}}function or(e,t){const s={...e??{}};if(t<1&&rr(s),t<2)for(const i of Qo)delete s[i];if(t<3){let i=null;for(const a of Tt)if(s[kn(a)]===!0){i=a;break}i!==null&&(s.rightSlotLegacySeed=i);for(const a of Tt)delete s[kn(a)]}return t<4&&(s.finderFiles=Pt(s.finderFiles)),s}function rr(e){const t=[["canvasWidth",800],["runPanelWidth",420],["browserPanelWidth",640],["consolePanelWidth",796]];let s=0;for(const[i,a]of t){const o=e[i];if(typeof o=="number"&&o>0&&o!==a){s=o;break}}for(const[i]of t)delete e[i];e.rightSlotWidth=s}export{ic as $,J as A,Aa as B,br as C,kc as D,yr as E,Ic as F,Cc as G,Yo as H,Pc as I,Ur as J,tt as K,Si as L,Dr as M,wi as N,Rt as O,sn as P,mo as Q,_r as R,Zt as S,xt as T,vn as U,Wr as V,dc as W,uc as X,pc as Y,mc as Z,sc as _,Bi as a,mr as a$,re as a0,ve as a1,Hr as a2,Xn as a3,Xr as a4,cc as a5,Ce as a6,rc as a7,lc as a8,tc as a9,Kn as aA,wn as aB,he as aC,Wo as aD,Ko as aE,gn as aF,Hn as aG,nr as aH,Er as aI,Rr as aJ,Sc as aK,Fr as aL,Yn as aM,wo as aN,jt as aO,xc as aP,xr as aQ,wr as aR,Cr as aS,Pr as aT,Ir as aU,Tr as aV,Nr as aW,Lr as aX,Or as aY,Ar as aZ,_t as a_,nc as aa,Qr as ab,Jr as ac,qr as ad,no as ae,ec as af,Kr as ag,ac as ah,oc as ai,eo as aj,et as ak,Vr as al,zr as am,Yr as an,hc as ao,fc as ap,gc as aq,vc as ar,bc as as,hr as at,yc as au,Ec as av,Fo as aw,Tc as ax,Zr as ay,Wn as az,Gi as b,n as b0,j as b1,Bn as b2,Oc as b3,Br as b4,Gr as b5,Ga as b6,wt as b7,Vn as b8,zn as b9,Fn as ba,jr as bb,zt as bc,Mr as bd,Ei as be,kr as bf,Sr as bg,Qn as bh,$r as bi,Ii as bj,xi as bk,Ti as bl,Vt as bm,At as bn,So as bo,Ai as bp,ki as bq,Ht as br,Fi as c,zi as d,Zn as e,Io as f,Gn as g,ta as h,Hi as i,na as j,dn as k,vr as l,gr as m,nt as n,es as o,fr as p,jo as q,_c as r,dr as s,lr as t,Ac as u,ur as v,pr as w,_i as x,Rc as y,wc as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as d,u as O,z as F}from"./error-boundary-
|
|
1
|
+
import{c as d,u as O,z as F}from"./error-boundary-5hn9OWCr.js";import{t as N,c as U,n as Q,b as z,g as B,e as V,h as S,i as C,j as D,a as v}from"./en-US-CHJkXXr4.js";import{j as i,c as p,t as c,r as P}from"./index-Dom8jp4B.js";import{bN as $,bD as T,bO as Y,B as w,C as Z,u as M,aK as A,aN as G,aL as I,bI as W,ar as J,ai as q,bJ as X}from"./conversation-input-sync-D8m_0i2P.js";import{aN as ee,aO as te,aP as E}from"./index-By5U6kgU.js";import{B as ae}from"./book-open-DTOZBzFE.js";import{k as ne,m as se,n as oe,o as re,q as ie}from"./use-memberships-query-CE1RS6l9.js";import{b as ce,l as ue}from"./publication-validation-CcRMJVIV.js";/**
|
|
2
2
|
* @license lucide-react v0.507.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|