@astralbeam/sdk 0.23.0 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{$ as e,$n as t,A as n,Ar as r,At as i,B as a,C as o,Ct as s,D as c,Dn as l,Dr as u,E as d,Er as f,Et as p,F as m,G as h,Gn as g,Gt as _,Ht as v,I as y,It as b,Jn as x,Jt as S,L as C,Ln as w,Lt as T,Mt as E,N as D,O,On as k,Or as A,P as j,Pn as M,Qt as N,R as P,T as F,Tn as I,Tr as L,Tt as R,U as ee,V as z,Vt as B,W as te,Xn as ne,Yn as re,Zn as V,Zt as ie,_ as H,_r as ae,_t as oe,a as se,ar as ce,at as le,b as ue,br as U,cn as de,cr as fe,ct as pe,d as me,dn as he,dr as ge,er as _e,et as ve,f as ye,fr as be,h as xe,ht as W,i as G,ir as Se,j as Ce,jn as we,jr as Te,jt as Ee,k as De,l as Oe,ln as ke,lr as K,lt as Ae,m as je,mt as Me,n as q,nt as Ne,o as Pe,or as Fe,ot as Ie,p as Le,pr as Re,q as ze,qn as Be,qt as Ve,r as He,rr as Ue,rt as We,s as Ge,sr as Ke,t as qe,u as Je,un as Ye,ur as Xe,ut as Ze,vn as Qe,vt as $e,w as et,x as tt,xr as nt,xt as rt,y as it,z as at}from"./styles.generated-CwyGUg6r.js";import"./constants-C-Yp0Vhg.js";import{t as ot}from"./debug-DLDY8CZb.js";import{$t as st,A as ct,At as lt,B as ut,Bt as dt,Cn as ft,Ct as pt,Dn as mt,Dt as ht,En as gt,Et as _t,F as vt,Fn as yt,Ft as bt,G as xt,Gt as St,H as Ct,Ht as wt,I as Tt,In as Et,It as Dt,J as Ot,Jt as kt,K as At,Kt as jt,L as Mt,Lt as Nt,M as Pt,Mn as Ft,Mt as It,N as Lt,Nn as Rt,Nt as zt,On as Bt,Ot as Vt,P as Ht,Pn as Ut,Pt as Wt,Qt as Gt,R as Kt,Rn as qt,Rt as Jt,Sn as Yt,St as Xt,T as Zt,Tn as Qt,Tt as $t,U as en,Ut as tn,V as nn,Vt as rn,W as an,Wt as on,X as sn,Xt as cn,Y as ln,Yt as un,Z as dn,Zt as fn,_ as pn,_n as mn,a as hn,an as gn,at as _n,b as vn,bn as yn,bt as bn,c as xn,cn as Sn,ct as Cn,d as wn,dn as Tn,dt as En,en as Dn,et as On,f as kn,fn as An,ft as jn,g as Mn,gn as Nn,h as Pn,hn as Fn,ht as In,i as Ln,in as Rn,it as zn,j as Bn,jn as Vn,jt as Hn,kn as Un,kt as Wn,l as Gn,ln as Kn,lt as qn,mn as Jn,mt as Yn,n as Xn,nn as Zn,o as Qn,on as $n,ot as er,p as tr,pn as nr,pt as rr,q as ir,qt as ar,r as or,rn as sr,s as cr,sn as lr,st as ur,t as dr,tn as fr,u as pr,un as mr,ut as hr,v as gr,vt as _r,w as vr,wn as yr,wt as br,x as xr,xn as Sr,xt as Cr,y as wr,yt as Tr,z as Er,zt as Dr}from"./threads-rrcqQzl8.js";import{a as Or,d as kr,f as Ar,g as jr,h as Mr,i as Nr,l as Pr,m as Fr,n as Ir,o as Lr,p as Rr,r as zr,s as Br,t as Vr,u as Hr}from"./item-Cv2zb7Kn.js";var J=/* @__PURE__ */ Te(A(),1);const Ur=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,112H56l72-72Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z`}))]]),Wr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z`}))]]),Gr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),Kr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),qr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M225.6,62.64l-88-48.17a19.91,19.91,0,0,0-19.2,0l-88,48.17A20,20,0,0,0,20,80.19v95.62a20,20,0,0,0,10.4,17.55l88,48.17a19.89,19.89,0,0,0,19.2,0l88-48.17A20,20,0,0,0,236,175.81V80.19A20,20,0,0,0,225.6,62.64ZM128,36.57,200,76,128,115.4,56,76ZM44,96.79l72,39.4v76.67L44,173.44Zm96,116.07V136.19l72-39.4v76.65Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M128,129.09V232a8,8,0,0,1-3.84-1l-88-48.16a8,8,0,0,1-4.16-7V80.2a8,8,0,0,1,.7-3.27Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32h0l80.34,44L128,120,47.66,76ZM40,90l80,43.78v85.79L40,175.82Zm96,129.57V133.82L216,90v85.78Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,120,47.65,76,128,32l80.35,44Zm8,99.64V133.83l80-43.78v85.76Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M222.72,67.9l-88-48.17a13.9,13.9,0,0,0-13.44,0l-88,48.18A14,14,0,0,0,26,80.18v95.64a14,14,0,0,0,7.28,12.27l88,48.18a13.92,13.92,0,0,0,13.44,0l88-48.18A14,14,0,0,0,230,175.82V80.18A14,14,0,0,0,222.72,67.9ZM127,30.25a2,2,0,0,1,1.92,0L212.51,76,128,122.24,43.49,76ZM39,177.57a2,2,0,0,1-1-1.75V86.66l84,46V223Zm177.92,0L134,223V132.64l84-46v89.16A2,2,0,0,1,217,177.57Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32h0l80.34,44L128,120,47.66,76ZM40,90l80,43.78v85.79L40,175.82Zm96,129.57V133.82L216,90v85.78Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M221.76,69.66l-88-48.18a12,12,0,0,0-11.52,0l-88,48.18A12,12,0,0,0,28,80.18v95.64a12,12,0,0,0,6.24,10.52l88,48.18a11.95,11.95,0,0,0,11.52,0l88-48.18A12,12,0,0,0,228,175.82V80.18A12,12,0,0,0,221.76,69.66ZM126.08,28.5a3.94,3.94,0,0,1,3.84,0L216.67,76,128,124.52,39.33,76Zm-88,150.83A4,4,0,0,1,36,175.82V83.29l88,48.16v94.91Zm179.84,0-85.92,47V131.45l88-48.16v92.53A4,4,0,0,1,217.92,179.32Z`}))]]),Jr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),Yr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z`}))]]),Xr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M251,123.13c-.37-.81-9.13-20.26-28.48-39.61C196.63,57.67,164,44,128,44S59.37,57.67,33.51,83.52C14.16,102.87,5.4,122.32,5,123.13a12.08,12.08,0,0,0,0,9.75c.37.82,9.13,20.26,28.49,39.61C59.37,198.34,92,212,128,212s68.63-13.66,94.48-39.51c19.36-19.35,28.12-38.79,28.49-39.61A12.08,12.08,0,0,0,251,123.13Zm-46.06,33C183.47,177.27,157.59,188,128,188s-55.47-10.73-76.91-31.88A130.36,130.36,0,0,1,29.52,128,130.45,130.45,0,0,1,51.09,99.89C72.54,78.73,98.41,68,128,68s55.46,10.73,76.91,31.89A130.36,130.36,0,0,1,226.48,128,130.45,130.45,0,0,1,204.91,156.12ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,148Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Zm0,112a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M245.48,125.57c-.34-.78-8.66-19.23-27.24-37.81C201,70.54,171.38,50,128,50S55,70.54,37.76,87.76c-18.58,18.58-26.9,37-27.24,37.81a6,6,0,0,0,0,4.88c.34.77,8.66,19.22,27.24,37.8C55,185.47,84.62,206,128,206s73-20.53,90.24-37.75c18.58-18.58,26.9-37,27.24-37.8A6,6,0,0,0,245.48,125.57ZM128,194c-31.38,0-58.78-11.42-81.45-33.93A134.77,134.77,0,0,1,22.69,128,134.56,134.56,0,0,1,46.55,95.94C69.22,73.42,96.62,62,128,62s58.78,11.42,81.45,33.94A134.56,134.56,0,0,1,233.31,128C226.94,140.21,195,194,128,194Zm0-112a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M243.66,126.38c-.34-.76-8.52-18.89-26.83-37.2C199.87,72.22,170.7,52,128,52S56.13,72.22,39.17,89.18c-18.31,18.31-26.49,36.44-26.83,37.2a4.08,4.08,0,0,0,0,3.25c.34.77,8.52,18.89,26.83,37.2,17,17,46.14,37.17,88.83,37.17s71.87-20.21,88.83-37.17c18.31-18.31,26.49-36.43,26.83-37.2A4.08,4.08,0,0,0,243.66,126.38Zm-32.7,35c-23.07,23-51,34.62-83,34.62s-59.89-11.65-83-34.62A135.71,135.71,0,0,1,20.44,128,135.69,135.69,0,0,1,45,94.62C68.11,71.65,96,60,128,60s59.89,11.65,83,34.62A135.79,135.79,0,0,1,235.56,128,135.71,135.71,0,0,1,211,161.38ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Z`}))]]),Zr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M180.49,143.51a12,12,0,0,1,0,17l-24,24a12,12,0,0,1-17-17L155,152l-15.52-15.51a12,12,0,1,1,17-17Zm-64-24a12,12,0,0,0-17,0l-24,24a12,12,0,0,0,0,17l24,24a12,12,0,0,0,17-17L101,152l15.52-15.51A12,12,0,0,0,116.49,119.51ZM220,88V216a20,20,0,0,1-20,20H56a20,20,0,0,1-20-20V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.52l56,56A12,12,0,0,1,220,88ZM160,57V80h23Zm36,155V104H148a12,12,0,0,1-12-12V44H60V212Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208,88H152V32Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M181.66,146.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32Zm-72-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L91.31,152l18.35-18.34A8,8,0,0,0,109.66,122.34ZM216,88V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm40,136V96H152a8,8,0,0,1-8-8V40H56V216H200Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34Zm-104,88a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L91.31,152Zm72-12.68-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32l24,24A8,8,0,0,1,181.66,157.66ZM152,88V44l44,44Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M180.24,147.76a6,6,0,0,1,0,8.48l-24,24a6,6,0,0,1-8.48-8.48L167.51,152l-19.75-19.76a6,6,0,1,1,8.48-8.48Zm-72-24a6,6,0,0,0-8.48,0l-24,24a6,6,0,0,0,0,8.48l24,24a6,6,0,1,0,8.48-8.48L88.49,152l19.75-19.76A6,6,0,0,0,108.24,123.76ZM214,88V216a14,14,0,0,1-14,14H56a14,14,0,0,1-14-14V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88Zm-56-6h35.52L158,46.48Zm44,134V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2V216a2,2,0,0,0,2,2H200A2,2,0,0,0,202,216Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M181.66,146.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32Zm-72-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L91.31,152l18.35-18.34A8,8,0,0,0,109.66,122.34ZM216,88V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm40,136V96H152a8,8,0,0,1-8-8V40H56V216H200Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M178.83,149.17a4,4,0,0,1,0,5.66l-24,24a4,4,0,0,1-5.66-5.66L170.34,152l-21.17-21.17a4,4,0,1,1,5.66-5.66Zm-72-24a4,4,0,0,0-5.66,0l-24,24a4,4,0,0,0,0,5.66l24,24a4,4,0,1,0,5.66-5.66L85.66,152l21.17-21.17A4,4,0,0,0,106.83,125.17ZM212,88V216a12,12,0,0,1-12,12H56a12,12,0,0,1-12-12V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-56-4h42.34L156,41.65Zm48,132V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H200A4,4,0,0,0,204,216Z`}))]]),Qr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M48,180c0,8.67,5.49,16,12,16a10.27,10.27,0,0,0,7.33-3.43,12,12,0,1,1,17.34,16.6A34,34,0,0,1,60,220C40.15,220,24,202,24,180s16.15-40,36-40a34,34,0,0,1,24.67,10.83,12,12,0,1,1-17.34,16.6A10.27,10.27,0,0,0,60,164C53.49,164,48,171.31,48,180Zm97.51-5.71c-5.13-3.45-11.33-5.24-16.8-6.82a79.5,79.5,0,0,1-7.91-2.59c2.45-1.18,9.71-1.3,16.07.33A12,12,0,0,0,143,142a69.24,69.24,0,0,0-12-1.86c-9.93-.66-18,1.08-24.1,5.17a24.45,24.45,0,0,0-10.69,17.76c-1.1,8.74,2.48,16.27,10.11,21.19,4.78,3.09,10.36,4.7,15.75,6.26,3,.89,7.94,2.3,9.88,3.53a2,2,0,0,1-.22.71c-1.36,1.55-9.57,1.79-16.39-.06a12,12,0,0,0-6.45,23.11A63.73,63.73,0,0,0,125.09,220c6.47,0,13.74-1.17,19.74-5.15a24.73,24.73,0,0,0,10.95-18C157,187.53,153.32,179.53,145.51,174.27ZM216,140.68A12,12,0,0,0,200.7,148L192,172.3,183.3,148A12,12,0,1,0,160.7,156l20,56a12,12,0,0,0,22.6,0l20-56A12,12,0,0,0,216,140.68ZM36,108V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.51l56,56A12,12,0,0,1,220,88v20a12,12,0,1,1-24,0v-4H148a12,12,0,0,1-12-12V44H60v64a12,12,0,1,1-24,0ZM160,80h23L160,57Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208,88H152V32Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,0,1,85.78,206.4,30.06,30.06,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30.06,30.06,0,0,1,21.78,9.6,8,8,0,0,1-11.56,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.57,4.57,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.83-.56A8,8,0,0,0,142,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36A8,8,0,0,0,109.94,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.49,174.17,127.6,171.31Zm83.09-26.84a8,8,0,0,0-10.23,4.84L188,184.21l-12.47-34.9a8,8,0,0,0-15.07,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,210.69,144.47ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H212a4,4,0,0,0,4-4V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44ZM48,180c0,11,7.18,20,16,20a14.18,14.18,0,0,0,10.06-4.5,8.21,8.21,0,0,1,10.9-.91,8,8,0,0,1,.82,11.81A30.06,30.06,0,0,1,64,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a30,30,0,0,1,21.39,9.19,8.26,8.26,0,0,1,.73,11.09,8,8,0,0,1-11.9.38A14.17,14.17,0,0,0,64,160C55.18,160,48,169,48,180Zm103.81,16.31a20.82,20.82,0,0,1-9.19,15.23C137.43,215,131,216,125.13,216A61.14,61.14,0,0,1,110,214a8,8,0,1,1,4.3-15.41c4.38,1.2,14.95,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C137.49,174.17,154.05,179,151.81,196.31ZM215.42,155l-19.89,55.68a8,8,0,0,1-15.06,0L160.58,155a8.21,8.21,0,0,1,4.5-10.45,8,8,0,0,1,10.45,4.76L188,184.21l12.47-34.9a8,8,0,0,1,10.45-4.76A8.23,8.23,0,0,1,215.42,155Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M46,180c0,12.13,8.07,22,18,22a16.24,16.24,0,0,0,11.67-5.28,6,6,0,0,1,8.66,8.3A28.06,28.06,0,0,1,64,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,64,158C54.07,158,46,167.86,46,180Zm81.05-6.77c-10.86-3.13-13.41-4.69-13-7.91a6.59,6.59,0,0,1,2.88-5.08c5.6-3.79,17.66-1.82,21.45-.84a6,6,0,0,0,3.06-11.6c-2-.53-20.1-5-31.21,2.48a18.61,18.61,0,0,0-8.08,13.54c-1.8,14.19,12.26,18.25,21.57,20.94,12.12,3.5,14.78,5.33,14.2,9.76a6.85,6.85,0,0,1-3,5.34c-5.61,3.73-17.48,1.64-21.19.62A6,6,0,0,0,110.48,212a59.41,59.41,0,0,0,14.68,2c5.49,0,11.54-.95,16.36-4.14a18.89,18.89,0,0,0,8.31-13.81C151.84,180.39,136.92,176.08,127.05,173.22Zm83-26.88a6,6,0,0,0-7.67,3.63L188,190.15,173.65,150a6,6,0,1,0-11.3,4l20,56a6,6,0,0,0,11.3,0l20-56A6,6,0,0,0,210,146.34ZM214,88v24a6,6,0,1,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,1,1-12,0V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.24,1.76l56,56A6,6,0,0,1,214,88Zm-20.49-6L158,46.48V82Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,0,1,85.78,206.4,30.06,30.06,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30.06,30.06,0,0,1,21.78,9.6,8,8,0,0,1-11.56,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.57,4.57,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56A8,8,0,0,0,142,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36A8,8,0,0,0,109.94,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.49,174.17,127.6,171.31Zm83.09-26.84a8,8,0,0,0-10.23,4.84L188,184.21l-12.47-34.9a8,8,0,0,0-15.07,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,210.69,144.47ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M44,180c0,13.23,9,24,20,24a18.15,18.15,0,0,0,13.11-5.9,4,4,0,1,1,5.78,5.54A26.11,26.11,0,0,1,64,212c-15.44,0-28-14.36-28-32s12.56-32,28-32a26.11,26.11,0,0,1,18.89,8.36,4,4,0,1,1-5.78,5.54A18.15,18.15,0,0,0,64,156C53,156,44,166.77,44,180Zm82.49-4.85c-10.53-3-15.08-4.91-14.42-10.08a8.51,8.51,0,0,1,3.75-6.49c6.25-4.23,18.77-2.24,23.06-1.11a4,4,0,0,0,2-7.74,61.11,61.11,0,0,0-10.47-1.61c-8.12-.54-14.54.75-19.1,3.82a16.66,16.66,0,0,0-7.22,12.13c-1.58,12.49,10.46,16,20.14,18.77,11.26,3.25,16.47,5.49,15.64,11.94a8.94,8.94,0,0,1-3.91,6.75c-6.27,4.17-18.61,2.05-22.83.88a4,4,0,1,0-2.15,7.7A57.89,57.89,0,0,0,125.19,212c5.18,0,10.83-.86,15.22-3.77a17,17,0,0,0,7.43-12.41C149.64,181.84,136.26,178,126.49,175.15Zm82.85-26.92a4,4,0,0,0-5.11,2.42L188,196.11l-16.23-45.46a4,4,0,1,0-7.54,2.7l20,56a4,4,0,0,0,7.54,0l20-56A4,4,0,0,0,209.34,148.23ZM212,88v24a4,4,0,0,1-8,0V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4v72a4,4,0,0,1-8,0V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-13.66-4L156,41.65V84Z`}))]]),$r=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M232.49,55.51l-32-32a12,12,0,0,0-17,0l-96,96A12,12,0,0,0,84,128v32a12,12,0,0,0,12,12h32a12,12,0,0,0,8.49-3.51l96-96A12,12,0,0,0,232.49,55.51ZM192,49l15,15L196,75,181,60Zm-69,99H108V133l56-56,15,15Zm105-7.43V208a20,20,0,0,1-20,20H48a20,20,0,0,1-20-20V48A20,20,0,0,1,48,28h67.43a12,12,0,0,1,0,24H52V204H204V140.57a12,12,0,0,1,24,0Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,88l-72,72H96V128l72-72Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M229.66,58.34l-32-32a8,8,0,0,0-11.32,0l-96,96A8,8,0,0,0,88,128v32a8,8,0,0,0,8,8h32a8,8,0,0,0,5.66-2.34l96-96A8,8,0,0,0,229.66,58.34ZM124.69,152H104V131.31l64-64L188.69,88ZM200,76.69,179.31,56,192,43.31,212.69,64ZM224,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h80a8,8,0,0,1,0,16H48V208H208V128a8,8,0,0,1,16,0Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h80a8,8,0,0,1,0,16H48V208H208V128a8,8,0,0,1,16,0Zm5.66-58.34-96,96A8,8,0,0,1,128,168H96a8,8,0,0,1-8-8V128a8,8,0,0,1,2.34-5.66l96-96a8,8,0,0,1,11.32,0l32,32A8,8,0,0,1,229.66,69.66Zm-17-5.66L192,43.31,179.31,56,200,76.69Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M228.24,59.76l-32-32a6,6,0,0,0-8.48,0l-96,96A6,6,0,0,0,90,128v32a6,6,0,0,0,6,6h32a6,6,0,0,0,4.24-1.76l96-96A6,6,0,0,0,228.24,59.76ZM125.51,154H102V130.49l66-66L191.51,88ZM200,79.51,176.49,56,192,40.49,215.51,64ZM222,128v80a14,14,0,0,1-14,14H48a14,14,0,0,1-14-14V48A14,14,0,0,1,48,34h80a6,6,0,0,1,0,12H48a2,2,0,0,0-2,2V208a2,2,0,0,0,2,2H208a2,2,0,0,0,2-2V128a6,6,0,0,1,12,0Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M229.66,58.34l-32-32a8,8,0,0,0-11.32,0l-96,96A8,8,0,0,0,88,128v32a8,8,0,0,0,8,8h32a8,8,0,0,0,5.66-2.34l96-96A8,8,0,0,0,229.66,58.34ZM124.69,152H104V131.31l64-64L188.69,88ZM200,76.69,179.31,56,192,43.31,212.69,64ZM224,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h80a8,8,0,0,1,0,16H48V208H208V128a8,8,0,0,1,16,0Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M226.83,61.17l-32-32a4,4,0,0,0-5.66,0l-96,96A4,4,0,0,0,92,128v32a4,4,0,0,0,4,4h32a4,4,0,0,0,2.83-1.17l96-96A4,4,0,0,0,226.83,61.17ZM126.34,156H100V129.66l68-68L194.34,88ZM200,82.34,173.66,56,192,37.66,218.34,64ZM220,128v80a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V48A12,12,0,0,1,48,36h80a4,4,0,0,1,0,8H48a4,4,0,0,0-4,4V208a4,4,0,0,0,4,4H208a4,4,0,0,0,4-4V128a4,4,0,0,1,8,0Z`}))]]),ei=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z`}))]]),ti=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),ni=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M244,128a12,12,0,0,1-12,12H207.42l-36.69,73.37A12,12,0,0,1,160,220h-.6a12,12,0,0,1-10.61-7.72L95,71.15,66.92,133A12,12,0,0,1,56,140H24a12,12,0,0,1,0-24H48.27L85.08,35a12,12,0,0,1,22.13.7l54.28,142.46,27.78-55.56A12,12,0,0,1,200,116h32A12,12,0,0,1,244,128Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M96,40l33.52,88H56Zm104,88H129.52L160,208Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M240,128a8,8,0,0,1-8,8H204.94l-37.78,75.58A8,8,0,0,1,160,216h-.4a8,8,0,0,1-7.08-5.14L95.35,60.76,63.28,131.31A8,8,0,0,1,56,136H24a8,8,0,0,1,0-16H50.85L88.72,36.69a8,8,0,0,1,14.76.46l57.51,151,31.85-63.71A8,8,0,0,1,200,120h32A8,8,0,0,1,240,128Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm-8,96H188.64L159,188a8,8,0,0,1-6.95,4h-.46a8,8,0,0,1-6.89-4.84L103,89.92,79,132a8,8,0,0,1-7,4H48a8,8,0,0,1,0-16H67.36L97.05,68a8,8,0,0,1,14.3.82L153,166.08l24-42.05a8,8,0,0,1,6.95-4h24a8,8,0,0,1,0,16Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M238,128a6,6,0,0,1-6,6H203.71l-38.34,76.68A6,6,0,0,1,160,214h-.3a6,6,0,0,1-5.31-3.85L95.51,55.57,61.46,130.48A6,6,0,0,1,56,134H24a6,6,0,0,1,0-12H52.14l38.4-84.48a6,6,0,0,1,11.07.34L160.74,193.1l33.89-67.78A6,6,0,0,1,200,122h32A6,6,0,0,1,238,128Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M240,128a8,8,0,0,1-8,8H204.94l-37.78,75.58A8,8,0,0,1,160,216h-.4a8,8,0,0,1-7.08-5.14L95.35,60.76,63.28,131.31A8,8,0,0,1,56,136H24a8,8,0,0,1,0-16H50.85L88.72,36.69a8,8,0,0,1,14.76.46l57.51,151,31.85-63.71A8,8,0,0,1,200,120h32A8,8,0,0,1,240,128Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M236,128a4,4,0,0,1-4,4H202.47l-38.89,77.79A4,4,0,0,1,160,212h-.2a4,4,0,0,1-3.54-2.58l-60.59-159-36,79.28A4,4,0,0,1,56,132H24a4,4,0,0,1,0-8H53.42L92.36,38.35a4,4,0,0,1,7.38.23L160.5,198.06l35.92-71.85A4,4,0,0,1,200,124h32A4,4,0,0,1,236,128Z`}))]]),ri=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M140,32V64a12,12,0,0,1-24,0V32a12,12,0,0,1,24,0Zm84,84H192a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24Zm-42.26,48.77a12,12,0,1,0-17,17l22.63,22.63a12,12,0,0,0,17-17ZM128,180a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V192A12,12,0,0,0,128,180ZM74.26,164.77,51.63,187.4a12,12,0,0,0,17,17l22.63-22.63a12,12,0,1,0-17-17ZM76,128a12,12,0,0,0-12-12H32a12,12,0,0,0,0,24H64A12,12,0,0,0,76,128ZM68.6,51.63a12,12,0,1,0-17,17L74.26,91.23a12,12,0,0,0,17-17Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm88,88H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM48,136a8,8,0,0,1,0-16H72a8,8,0,0,1,0,16Zm46.06,37.25-17,17a8,8,0,0,1-11.32-11.32l17-17a8,8,0,0,1,11.31,11.31Zm0-79.19a8,8,0,0,1-11.31,0l-17-17A8,8,0,0,1,77.09,65.77l17,17A8,8,0,0,1,94.06,94.06ZM136,208a8,8,0,0,1-16,0V184a8,8,0,0,1,16,0Zm0-136a8,8,0,0,1-16,0V48a8,8,0,0,1,16,0Zm54.23,118.23a8,8,0,0,1-11.32,0l-17-17a8,8,0,0,1,11.31-11.31l17,17A8,8,0,0,1,190.23,190.23ZM208,136H184a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M134,32V64a6,6,0,0,1-12,0V32a6,6,0,0,1,12,0Zm90,90H192a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12Zm-46.5,47A6,6,0,0,0,169,177.5l22.63,22.62a6,6,0,0,0,8.48-8.48ZM128,186a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V192A6,6,0,0,0,128,186ZM78.5,169,55.88,191.64a6,6,0,1,0,8.48,8.48L87,177.5A6,6,0,1,0,78.5,169ZM70,128a6,6,0,0,0-6-6H32a6,6,0,0,0,0,12H64A6,6,0,0,0,70,128ZM64.36,55.88a6,6,0,0,0-8.48,8.48L78.5,87A6,6,0,1,0,87,78.5Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm88,88H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M132,32V64a4,4,0,0,1-8,0V32a4,4,0,0,1,8,0Zm92,92H192a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8Zm-47.92,46.43a4,4,0,1,0-5.65,5.65l22.62,22.63a4,4,0,0,0,5.66-5.66ZM128,188a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V192A4,4,0,0,0,128,188ZM79.92,170.43,57.29,193.05A4,4,0,0,0,63,198.71l22.62-22.63a4,4,0,1,0-5.65-5.65ZM68,128a4,4,0,0,0-4-4H32a4,4,0,0,0,0,8H64A4,4,0,0,0,68,128ZM63,57.29A4,4,0,0,0,57.29,63L79.92,85.57a4,4,0,1,0,5.65-5.65Z`}))]]),ii=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),ai=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Ur}));ai.displayName=`ArrowUpIcon`;const oi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Wr}));oi.displayName=`ArrowsClockwiseIcon`;const si=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Gr}));si.displayName=`CaretUpIcon`;const ci=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Kr}));ci.displayName=`ClockCounterClockwiseIcon`;const li=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:qr}));li.displayName=`CubeIcon`;const ui=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Jr}));ui.displayName=`DotsThreeIcon`;const di=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Yr}));di.displayName=`DownloadSimpleIcon`;const fi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Xr}));fi.displayName=`EyeIcon`;const pi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Zr}));pi.displayName=`FileCodeIcon`;const mi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Qr}));mi.displayName=`FileCsvIcon`;const hi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:$r}));hi.displayName=`NotePencilIcon`;const gi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:ei}));gi.displayName=`PaperclipIcon`;const _i=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:ti}));_i.displayName=`PencilSimpleIcon`;const vi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:ni}));vi.displayName=`PulseIcon`;const yi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:ri}));yi.displayName=`SpinnerGapIcon`;const bi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:ii}));bi.displayName=`StopIcon`;var xi=f(),Y=Be();const Si={reading:`uploading`,ready:`done`,error:`error`};function Ci({attachments:e,onRemove:t}){let n=(0,J.useRef)(null),r=e.at(-1)?.id;(0,J.useEffect)(()=>{let e=n.current;e&&(e.scrollLeft=e.scrollWidth)},[r]);let i=e.filter(e=>e.status===`error`);return e.length===0?null:/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`w-full min-w-0`,children:[i.length>0&&/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-sm text-destructive`,children:[/* @__PURE__ */ (0,Y.jsxs)(`span`,{children:[i.length,` `,i.length===1?`file could`:`files could`,` not be attached.`]}),/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,tooltip:`Review files`,onClick:()=>{let e=n.current?.querySelector(`[role="alert"]`);e?.scrollIntoView({block:`nearest`,inline:`nearest`}),e?.querySelector(`button`)?.focus()},children:/* @__PURE__ */ (0,Y.jsx)(fi,{})})]}),/* @__PURE__ */ (0,Y.jsx)(cn,{ref:n,className:`w-full`,children:e.map(e=>/* @__PURE__ */ (0,Y.jsxs)(jt,{size:`sm`,state:Si[e.status],role:e.status===`error`?`alert`:void 0,children:[/* @__PURE__ */ (0,Y.jsx)(St,{id:e.fileId,title:e.name,kind:e.kind,mimeType:e.mimeType}),/* @__PURE__ */ (0,Y.jsxs)(kt,{children:[/* @__PURE__ */ (0,Y.jsx)(fn,{title:e.name,children:e.name}),/* @__PURE__ */ (0,Y.jsx)(un,{children:e.error??lr(e.size)})]}),/* @__PURE__ */ (0,Y.jsx)(ar,{children:/* @__PURE__ */ (0,Y.jsx)(q,{"data-slot":`attachment-action`,type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${e.name}`,tooltip:`Remove attachment`,onClick:()=>t(e.id),children:/* @__PURE__ */ (0,Y.jsx)(Vn,{})})})]},e.id))})]})}function wi({title:e,actionsSlot:t,draft:n,onDraftChange:r,onSend:i,onStop:a,onRetry:o,retryLabel:s,showError:c,error:l,streamBusy:u,isBusy:d,threadLoading:f,authPending:p,authError:m,onAuthRetry:h,attachments:g,attachmentLimits:_,onAddFiles:v,onRemoveAttachment:y}){let b=(0,J.useId)(),S=(0,J.useRef)(null),[C,w]=(0,J.useState)(!1),T=p||m!==void 0||f,E=g.some(e=>e.status===`reading`),D=g.some(e=>e.status===`ready`),O=g.filter(e=>e.status!==`error`).length>=_.maxFiles,k=_.enabled&&!T,A=d||T||E||n.trim().length===0&&!D,j=e=>{k&&e&&e.length!==0&&v([...e])},M=e=>k&&(e?.types.includes(`Files`)??!1);return/* @__PURE__ */ (0,Y.jsxs)(`form`,{className:`w-full`,onSubmit:e=>{e.preventDefault(),A||i()},onDragOver:e=>{M(e.dataTransfer)&&(e.preventDefault(),w(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||w(!1)},onDrop:e=>{M(e.dataTransfer)&&(e.preventDefault(),w(!1),j(e.dataTransfer.files))},children:[c&&/* @__PURE__ */ (0,Y.jsxs)(mt,{variant:`destructive`,className:`mb-1.5 flex items-center gap-2 border-destructive/30 bg-destructive/5 py-1 has-data-[slot=alert-action]:pe-2.5`,children:[/* @__PURE__ */ (0,Y.jsxs)(Un,{className:`min-w-0 flex-1 text-xs text-pretty wrap-anywhere`,children:[/* @__PURE__ */ (0,Y.jsx)(`div`,{children:Rn(l)}),Sr(l)&&l.body?.reference&&/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`mt-0.5 text-muted-foreground`,children:[`Support reference: `,l.body.reference]})]}),o&&/* @__PURE__ */ (0,Y.jsx)(Bt,{className:`static shrink-0`,children:/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,variant:`outline`,size:`icon-sm`,tooltip:s,onClick:o,children:/* @__PURE__ */ (0,Y.jsx)(qt,{})})})]}),m&&/* @__PURE__ */ (0,Y.jsxs)(mt,{variant:`destructive`,className:`mb-1.5 flex items-center gap-2 border-destructive/30 bg-destructive/5 py-1 has-data-[slot=alert-action]:pe-2.5`,children:[/* @__PURE__ */ (0,Y.jsx)(Un,{className:`min-w-0 flex-1 text-xs text-pretty wrap-anywhere`,children:Sr(m)&&m.status===401?`The assistant's connection was rejected. Contact this app's support team.`:`The assistant could not verify your session. Retry or contact this app's support team.`}),h&&/* @__PURE__ */ (0,Y.jsx)(Bt,{className:`static shrink-0`,children:/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,variant:`outline`,size:`icon-sm`,tooltip:`Retry`,onClick:h,children:/* @__PURE__ */ (0,Y.jsx)(qt,{})})})]}),_.enabled&&/* @__PURE__ */ (0,Y.jsx)(`input`,{ref:S,type:`file`,multiple:!0,className:`sr-only`,accept:st(_),onChange:e=>{j(e.currentTarget.files),e.currentTarget.value=``}}),/* @__PURE__ */ (0,Y.jsxs)(yr,{className:x(`cursor-text`,C&&`border-ring ring-3 ring-ring/50`),children:[g.length>0&&/* @__PURE__ */ (0,Y.jsx)(Qt,{align:`block-start`,className:`py-1`,children:/* @__PURE__ */ (0,Y.jsx)(Ci,{attachments:g,onRemove:y})}),/* @__PURE__ */ (0,Y.jsx)(gt,{"aria-label":`Message`,"aria-describedby":b,className:`max-h-24 min-h-8 py-1.5 any-pointer-coarse:text-base`,placeholder:p?`Verifying your session…`:f?`Loading conversation…`:C?`Drop files to attach…`:`Message ${e}…`,disabled:T,value:n,onChange:e=>r(e.currentTarget.value),onPaste:e=>{k&&e.clipboardData.files.length!==0&&(e.preventDefault(),j(e.clipboardData.files))},onKeyDown:e=>{e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),A||i())}}),/* @__PURE__ */ (0,Y.jsxs)(Qt,{align:`block-end`,className:`pt-0 pb-1`,children:[_.enabled&&/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Attach files`,tooltip:O?`Up to ${_.maxFiles} files per message`:`Attach files`,disabled:T||O,onClick:()=>S.current?.click(),children:/* @__PURE__ */ (0,Y.jsx)(gi,{})}),t&&/* @__PURE__ */ (0,Y.jsx)(`slot`,{name:t}),u?/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,variant:`default`,size:`icon`,className:`ml-auto`,tooltip:`Stop`,onClick:e=>{e.detail<2&&a()},children:/* @__PURE__ */ (0,Y.jsx)(bi,{})}):/* @__PURE__ */ (0,Y.jsx)(q,{type:`submit`,variant:`default`,size:`icon`,className:`ml-auto`,tooltip:`Send`,disabled:A,children:/* @__PURE__ */ (0,Y.jsx)(ai,{})})]})]}),/* @__PURE__ */ (0,Y.jsxs)(`p`,{className:`mt-1 text-center text-xs text-muted-foreground`,children:[/* @__PURE__ */ (0,Y.jsx)(`span`,{id:b,children:`Enter to send, Shift+Enter for a new line.`}),` AI can make mistakes.`]})]})}const Ti=/*#__PURE__*/ J.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return V(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function Ei({sizing:e,panelId:t}){return e.enabled?/* @__PURE__ */ (0,Y.jsx)(Ti,{orientation:`vertical`,tabIndex:0,"aria-label":`Resize chat`,"aria-controls":t,"aria-valuemin":e.minimum,"aria-valuemax":e.maximum,"aria-valuenow":e.width,"aria-valuetext":`${e.width} pixels`,className:`absolute inset-y-0 start-0 z-20 w-2 touch-none cursor-col-resize border-s border-transparent hover:border-primary/20 focus-visible:border-primary/30 focus-visible:outline-none any-pointer-coarse:inset-y-14 any-pointer-coarse:w-11`,onPointerDown:e.onPointerDown,onPointerMove:e.onPointerMove,onPointerUp:e.onPointerUp,onPointerCancel:e.cancelDrag,onLostPointerCapture:e.cancelDrag,onKeyDown:e.onKeyDown}):null}function Di(e){try{let t=JSON.parse(localStorage.getItem(e)??`null`);if(t&&typeof t==`object`&&`width`in t&&typeof t.width==`number`&&Number.isFinite(t.width)&&t.width>0)return t.width}catch{}return null}function Oi(e,t,n,r){e.style.setProperty(`width`,`${t}px`),e.setAttribute(`data-astralbeam-full-width`,String(t>=n)),r?.setAttribute(`aria-valuenow`,String(t)),r?.setAttribute(`aria-valuetext`,`${t} pixels`)}function ki(e,t){let n=`astralbeam:chat-size:v1${t.id?`:component:${encodeURIComponent(t.id)}`:``}${e.agentId?`:agent:${encodeURIComponent(e.agentId)}`:``}`,[r,i]=(0,J.useState)(()=>({key:n,value:Di(n)}));r.key!==n&&i({key:n,value:Di(n)});let a=r.key===n?r.value:null,[o,s]=(0,J.useState)({maximum:0,fallback:null,mobile:!1}),c=(0,J.useRef)(null),{resizeContainer:l,onClose:u,defaultWidth:d}=e,f=!!u;(0,J.useLayoutEffect)(()=>{let e=l?.()??t.parentElement;if(!e)return;let n=matchMedia(`(max-width: 900px)`),r=()=>{let r=getComputedStyle(e),i=f&&n.matches?window.innerWidth:e.clientWidth-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight),a=o.fallback??(t.getClientRects().length>0&&(t.offsetWidth>0||d!==void 0)?t.offsetWidth:null);i<=0||s(e=>{let t={maximum:i,fallback:e.fallback??a,mobile:f&&n.matches};return t.maximum===e.maximum&&t.fallback===e.fallback&&t.mobile===e.mobile?e:t})};r();let i=new ResizeObserver(r);return i.observe(e),o.fallback===null&&i.observe(t),n.addEventListener(`change`,r),()=>{i.disconnect(),n.removeEventListener(`change`,r)}},[t,l,f,d,o.fallback]);let p=Math.floor(o.maximum),m=Math.min(320,p),h=d===`100%`?p:d&&Number.isFinite(d)&&d>0?d:o.fallback??0,g=a??h,_=e=>Math.round(Math.min(p,Math.max(m,e))),v=o.mobile?p:_(g),y=e.resizable!==!1&&!o.mobile&&p>m,b=()=>{let e=c.current;e&&(c.current=null,Oi(t,v,p,e.element),e.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId))};(0,J.useLayoutEffect)(()=>{let e=t.style.getPropertyValue(`width`),n=t.style.getPropertyPriority(`width`),r=t.style.boxSizing,i=t.getAttribute(`data-astralbeam-full-width`);return t.style.setProperty(`box-sizing`,`border-box`),()=>{let a=c.current;c.current=null,a?.element.hasPointerCapture(a.pointerId)&&a.element.releasePointerCapture(a.pointerId),t.style.setProperty(`width`,e,n),t.style.setProperty(`box-sizing`,r),i===null?t.removeAttribute(`data-astralbeam-full-width`):t.setAttribute(`data-astralbeam-full-width`,i)}},[t]),(0,J.useLayoutEffect)(()=>{let e=c.current;e&&(!y||e.key!==n)&&(c.current=null,e.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId));let r=c.current?Math.round(Math.min(p,Math.max(m,c.current.next))):v;p>0&&o.fallback!==null&&Oi(t,r,p,e?.element)},[t,v,m,p,o.fallback,y,n]);let x=e=>{if(!y||!Number.isFinite(e))return;let t=_(e),r=t===_(h)?null:t;if(t!==v||r===null&&a!==null){i({key:n,value:r});try{r===null?localStorage.removeItem(n):localStorage.setItem(n,JSON.stringify({width:r}))}catch{}}};return{enabled:y,width:v,minimum:m,maximum:p,onPointerDown:e=>{y&&e.isPrimary&&e.button===0&&(e.preventDefault(),e.currentTarget.focus(),e.currentTarget.setPointerCapture(e.pointerId),c.current={element:e.currentTarget,key:n,pointerId:e.pointerId,x:e.clientX,width:v,next:v,direction:getComputedStyle(t).direction===`rtl`?1:-1,scale:t.getBoundingClientRect().width/t.offsetWidth})},onPointerMove:e=>{let n=c.current;n&&n.pointerId===e.pointerId&&(n.next=n.width+(e.clientX-n.x)*n.direction/n.scale,Oi(t,_(n.next),p,n.element))},onPointerUp:e=>{let t=c.current;t&&t.pointerId===e.pointerId&&(c.current=null,e.currentTarget.releasePointerCapture(e.pointerId),t.next!==t.width&&x(t.next))},cancelDrag:b,onKeyDown:e=>{let n=getComputedStyle(t).direction===`rtl`?1:-1,r=e.shiftKey?50:10;if(e.key===`ArrowLeft`)x(v-r*n);else if(e.key===`ArrowRight`)x(v+r*n);else if(e.key===`Home`)x(m);else if(e.key===`End`)x(p);else if(e.key===`Escape`&&c.current)b();else return;e.preventDefault()}}}function Ai({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[u,d]=J.useState(0),[f,p]=J.useState(0),m=u===0,h=j(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=k(t);if(m&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||l(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return ht(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(d(t),p(n))}),ge(()=>{!r&&!i&&(d(0),p(0))},[r,i]),ge(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(u+1,f+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,f,t]),O(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:f}),null}const ji=/*#__PURE__*/ J.createContext(void 0);function Mi(e){let t=J.useContext(ji);if(!e&&t===void 0)throw Error(K(27));return t}const Ni={...xe,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};var Pi=class extends H{constructor(e,t,n){let r=new it,i=Fi(e,r,t,n);super(i,Ii(r),Ni)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(F(this.state,e,t.trigger)))}};function Fi(e,t,n,r=!1){return{...je(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Ii(e){return{popupRef:/*#__PURE__*/ J.createRef(),backdropRef:/*#__PURE__*/ J.createRef(),internalBackdropRef:/*#__PURE__*/ J.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Li(e,t){let{children:r,open:i,defaultOpen:a=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:l=!1,modal:u=!0,actionsRef:f,handle:p,triggerId:m,defaultTriggerId:h=null}=t,g=e===`drawer`,_=e===`alert-dialog`,v=_?!0:u,y=_||l,b=_?`alertdialog`:`dialog`,x=Mi(!0),S={modal:v,disablePointerDismissal:y,nested:x!=null,role:b},C=De((e,t)=>new Pi({open:a,openProp:i,activeTriggerId:h,triggerIdProp:m,...S},e,t),!0);C.useControlledProp(`openProp`,i),C.useControlledProp(`triggerIdProp`,m),C.useSyncedValues(S),C.useContextCallback(`onOpenChange`,o),C.useContextCallback(`onOpenChangeComplete`,s);let w=C.useState(`open`),T=C.useState(`mounted`),E=C.useState(`payload`);n(C,w),d(C);let{forceUnmount:D}=c(w,C);J.useImperativeHandle(f,()=>({unmount:D,close:()=>C.setOpen(!1,R(Ae))}),[D,C]);let O=w||T||p!=null;return/*#__PURE__*/ (0,Y.jsxs)(ji.Provider,{value:C,children:[p&&/*#__PURE__*/ (0,Y.jsx)(tt,{handle:p,store:C}),O&&/*#__PURE__*/ (0,Y.jsx)(Ai,{store:C,parentContext:x?.context,isDrawer:g}),typeof r==`function`?r({payload:E}):r]})}function Ri(e){return Li(`alert-dialog`,e)}const zi=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Mi(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return V(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:ke,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Bi=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Mi(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Se({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,R(le,e.nativeEvent))}return V(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),Vi=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Mi(),c=w(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),V(`p`,e,{ref:t,props:[{id:c},o]})}),Hi=/*#__PURE__*/ J.createContext(void 0);function Ui(){let e=J.useContext(Hi);if(e===void 0)throw Error(K(26));return e}const Wi=`ArrowUp`,Gi=`ArrowDown`,Ki=`ArrowLeft`,qi=`ArrowRight`,Ji=/* @__PURE__ */ new Set([Wi,Gi,Ki,qi,`Home`,`End`]),Yi=[`Shift`,`Control`,`Alt`,`Meta`];function Xi(e){return U(e)&&e.tagName===`INPUT`}function Zi(e){return!!(Xi(e)&&e.selectionStart!=null||U(e)&&e.tagName===`TEXTAREA`)}function Qi(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=$i(e,t,`left`),a=ea(e),o=ea(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=$i(e,t,`top`),r=ea(e),i=ea(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function $i(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function ea(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const ta={...de,...Qe,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},na=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Mi(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Ui(),Ee({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?et(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=V(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...ue,hidden:!m,onKeyDown(e){Ji.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:ta});return/*#__PURE__*/ (0,Y.jsx)(tn,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),ra=/*#__PURE__*/ J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Mi(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?/*#__PURE__*/ (0,Y.jsx)(Hi.Provider,{value:n,children:/*#__PURE__*/ (0,Y.jsxs)(z,{ref:t,...r,children:[a&&o===!0&&/*#__PURE__*/ (0,Y.jsx)(_t,{ref:i.context.internalBackdropRef,inert:Dr(!s)}),e.children]})}):null}),ia=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Mi(),c=w(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),V(`h2`,e,{ref:t,props:[{id:c},o]})});function aa({...e}){return/* @__PURE__ */ (0,Y.jsx)(Ri,{"data-slot":`alert-dialog`,...e})}function oa({...e}){return/* @__PURE__ */ (0,Y.jsx)(ra,{"data-slot":`alert-dialog-portal`,...e})}function sa({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(zi,{"data-slot":`alert-dialog-overlay`,className:x(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function ca({className:e,size:t=`default`,container:n,...r}){return/* @__PURE__ */ (0,Y.jsxs)(oa,{container:n,children:[/* @__PURE__ */ (0,Y.jsx)(sa,{}),/* @__PURE__ */ (0,Y.jsx)(na,{"data-slot":`alert-dialog-content`,"data-size":t,className:x(`group/alert-dialog-content fixed top-1/2 start-1/2 z-50 grid w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] overflow-y-auto -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})]})}function la({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:x(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function ua({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(ia,{"data-slot":`alert-dialog-title`,className:x(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function da({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(Vi,{"data-slot":`alert-dialog-description`,className:x(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function fa({className:e,variant:t=`outline`,size:n=`default`,...r}){return/* @__PURE__ */ (0,Y.jsx)(Bi,{"data-slot":`alert-dialog-cancel`,className:x(e),render:/* @__PURE__ */ (0,Y.jsx)(g,{variant:t,size:n}),...r})}function pa({title:e,container:t,finalFocus:n,onDelete:r,onClose:i}){let[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!1);return/* @__PURE__ */ (0,Y.jsx)(aa,{open:!0,onOpenChange:e=>{!e&&!a&&i()},children:/* @__PURE__ */ (0,Y.jsxs)(ca,{container:t,finalFocus:n,className:`absolute max-h-[min(calc(100%-2rem),calc(100dvh-2rem))]`,children:[/* @__PURE__ */ (0,Y.jsx)(ua,{children:`Delete conversation?`}),/* @__PURE__ */ (0,Y.jsxs)(da,{className:`break-words`,children:[`Delete “`,e,`” and its messages? This cannot be undone.`]}),s&&/* @__PURE__ */ (0,Y.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:`Could not delete this conversation. Try again.`}),/* @__PURE__ */ (0,Y.jsxs)(la,{children:[/* @__PURE__ */ (0,Y.jsx)(fa,{className:`any-pointer-coarse:min-h-11 any-pointer-coarse:min-w-11`,disabled:a,children:`Cancel`}),/* @__PURE__ */ (0,Y.jsx)(g,{variant:`destructive`,className:`any-pointer-coarse:min-h-11 any-pointer-coarse:min-w-11`,disabled:a,onClick:()=>{o(!0),c(!1),r().then(e=>{o(!1),e?i():c(!0)})},children:a?`Deleting…`:`Delete conversation`})]})]})})}const ma=/*#__PURE__*/ J.createContext(void 0);function ha(e){let t=J.useContext(ma);if(t===void 0&&!e)throw Error(K(33));return t}const ga=/*#__PURE__*/ J.createContext(void 0);function _a(e){let t=J.useContext(ga);if(t===void 0&&!e)throw Error(K(36));return t}const va=/*#__PURE__*/ J.createContext(void 0);function ya(e=!0){let t=J.useContext(va);if(t===void 0&&!e)throw Error(K(25));return t}const ba=/*#__PURE__*/ J.createContext(null);function xa(e=`root`){let t=J.useContext(ba),n=J.useContext(ga);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}const Sa={visible:!0,ref:null};function Ca(){return Sa}function wa(e,t,n=`root`){let r=xa(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Ca)({label:e.label,children:e.children,render:e.render}),a=Ue(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Ta(e){e.preventDefault()}function Ea(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=_a(),u=ya(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return J.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Ta:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Me})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!M&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&ce(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}const Da={type:`regular-item`};function Oa(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=J.useRef(null),{getButtonProps:d,buttonRef:f}=Se({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Ea({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=J.useCallback(e=>Xe(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=Ue(u,f);return J.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}const ka=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=_a(),f=pt({guess:!0,label:a}),p=w(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=Oa({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Da});return V(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Aa=/*#__PURE__*/ J.forwardRef(function(e,t){let n=wa(e,t);return n.visible?/*#__PURE__*/ (0,Y.jsx)(ka,{...e,ref:n.ref}):null}),ja=/*#__PURE__*/ J.createContext(void 0);function Ma(e){let t=J.useContext(ja);if(t===void 0&&!e)throw Error(K(69));return t}const Na=/*#__PURE__*/ J.createContext(void 0);function Pa(){return J.useContext(Na)}function Fa(e,t){let n=ne(e.render);if(/*#__PURE__*/ J.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function Ia(e,t,n){let r=Fa(e,t),i=r===t?void 0:r;return[r,J.useCallback(e=>n?.(e?i:void 0),[i,n])]}function La(e,t,n){let r=ne(e.render),i=/*#__PURE__*/ J.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}const Ra=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=_a(),m=Pa(),{side:h,align:g}=ha(),_=Ma(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,I]=Ia(e,u,d),L=La(e,C,N),ee=w.type===`menu`?m:void 0,z=w.type===`context-menu`,B=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(B=()=>l.state.activeIndex===null&&P),Ee({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),J.useEffect(()=>{function e(e){l.setOpen(!1,R(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),me(D,{enabled:A&&!j&&!z&&w.type!==`menubar`,closeDelay:k});let te=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:ne,handleFocus:re}=(J.useContext(ba)?.useParentHandoff??Ba)(l,w,v,f),ie={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},H=V(`div`,e,{state:ie,ref:[t,l.context.popupRef,te,I],stateAttributesMapping:ke,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){ee?.onPopupKeyDown?.(e),_&&Ji.has(e.key)&&e.stopPropagation()},onFocus:re},se(y),c,{"data-rootownerid":E}]}),ae=w.type===void 0||z;(C||w.type===`menubar`&&T!==`outside-press`)&&(ae=!0);let oe=ee?.getReturnElement??ne;return/*#__PURE__*/ (0,Y.jsx)(tn,{context:D,openInteractionType:M,modal:z,disabled:!x,returnFocus:a??oe??ae,explicitReturnFocus:a===void 0&&oe?!1:void 0,initialFocus:B,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:H})}),za={parentVirtualFocusRef:void 0,handleFocus:void 0};function Ba(){return za}const Va=/*#__PURE__*/ J.forwardRef(function(e,t){let n=xa()?.Popup??Ra;return/*#__PURE__*/ (0,Y.jsx)(n,{...e,ref:t})}),Ha=/*#__PURE__*/ J.createContext(void 0);function Ua(){let e=J.useContext(Ha);if(e===void 0)throw Error(K(32));return e}const Wa=/*#__PURE__*/ J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=_a();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return/*#__PURE__*/ (0,Y.jsx)(Ha.Provider,{value:n,children:/*#__PURE__*/ (0,Y.jsx)(z,{ref:t,...r,portalOwnerRole:o})})});function Ga(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=J.useRef(null),o=J.useRef(null),s=E(r);ge(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),ge(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}const Ka=/*#__PURE__*/ J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=te,style:v,...y}=e,{store:b,virtualFocus:x,syncHighlightedItem:S}=_a(),C=Ua(),w=ya(!0),E=b.useState(`parent`),D=b.useState(`floatingRootContext`),O=b.useState(`floatingTreeRoot`),k=b.useState(`mounted`),A=b.useState(`open`),j=b.useState(`modal`),M=b.useState(`openMethod`),N=b.useState(`activeTriggerElement`),P=b.useState(`transitionStatus`),F=b.useState(`positionerElement`),I=b.useState(`instantType`),L=b.useState(`adaptiveOrigin`),ee=b.useState(`lastOpenChangeReason`),z=b.useState(`floatingNodeId`),B=b.useState(`floatingParentNodeId`),ne=D.useState(`domReferenceElement`),re=n,V=c,ie=l,H=s,ae=_;E.type===`context-menu`&&(re=n??E.context?.anchor,H??=`start`,!o&&H!==`center`&&(ie=e.alignOffset??2,V=e.sideOffset??-5));let oe=o,se=H;E.type===`menu`?(oe??=`inline-end`,se??=`start`,ae=e.collisionAvoidance??h):E.type===`menubar`&&(oe??=E.context.orientation===`vertical`?`inline-end`:`bottom`,se??=`start`);let ce=E.type===`context-menu`,le=Pe({anchor:re,floatingRootContext:D,positionMethod:w?`fixed`:r,mounted:k,side:oe,sideOffset:V,align:se,alignOffset:ie,arrowPadding:ce?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:z,keepMounted:C,disableAnchorTracking:g,collisionAvoidance:ae,shift:ce?{crossAxis:!(`side`in ae&&ae.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:O,adaptiveOrigin:L,lazyFlip:x?`placement`:!1});J.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===z&&b.set(`hoverEnabled`,!1),e.nodeId!==z&&e.parentNodeId===b.select(`floatingParentNodeId`)&&b.setOpen(!1,R(rt)))}return O.events.on(`menuopenchange`,e),()=>{O.events.off(`menuopenchange`,e)}},[b,O.events,z]),J.useEffect(()=>{if(b.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==b.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;b.setOpen(!1,R(t))}return O.events.on(`menuopenchange`,e),()=>{O.events.off(`menuopenchange`,e)}},[O.events,b]);let ue=T();J.useEffect(()=>{A||ue.clear()},[A,ue]),J.useEffect(()=>{function e(e){if(A&&e.nodeId===b.select(`floatingParentNodeId`)){if(e.target&&N&&N!==e.target){let e=b.select(`closeDelay`);e>0?ue.isStarted()||ue.start(e,()=>{b.setOpen(!1,R(rt))}):b.setOpen(!1,R(rt))}else ue.clear()}}return O.events.on(`itemhover`,e),()=>{O.events.off(`itemhover`,e)}},[O.events,A,N,b,ue]),J.useEffect(()=>{let e={open:A,nodeId:z,parentNodeId:B,reason:b.select(`lastOpenChangeReason`)};O.events.emit(`menuopenchange`,e)},[O.events,A,b,z,B]),Ga({store:b,domReference:ne,positionerElement:F,open:A});let U={open:A,side:le.side,align:le.align,anchorHidden:le.anchorHidden,nested:E.type===`menu`,instant:I},de=E.type===`menubar`&&E.context.modal;Cr(A&&(de||j&&ee!==`trigger-hover`),M===`touch`,F,N);let fe=G(e,U,{styles:le.positionerStyles,transitionStatus:P,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!k,inert:!A}),pe=k&&E.type!==`menu`&&(E.type!==`menubar`&&j&&ee!==`trigger-hover`||E.type===`menubar`&&E.context.modal),me=null;return E.type===`menubar`?me=E.context.contentElement:E.type===void 0&&(me=N),/*#__PURE__*/ (0,Y.jsxs)(ma.Provider,{value:le,children:[pe&&/*#__PURE__*/ (0,Y.jsx)(_t,{ref:E.type===`context-menu`||E.type===`nested-context-menu`?E.context.internalBackdropRef:null,inert:Dr(!A),cutout:me}),/*#__PURE__*/ (0,Y.jsx)(m,{id:z,children:/*#__PURE__*/ (0,Y.jsx)(Xt,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,onMapChange:S,children:fe})})]})}),qa=/*#__PURE__*/ J.createContext(null);function Ja(e){let t=J.useContext(qa);if(t===null&&!e)throw Error(K(5));return t}const Ya={...xe,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=xe.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>we&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!xe.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}};var Xa=class extends H{constructor(e,t,n=!1){let r=new it,i=Qa(r,t,n,e);super(i,Za(r),Ya),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Za(e){return{positionerRef:/*#__PURE__*/ J.createRef(),popupRef:/*#__PURE__*/ J.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:/*#__PURE__*/ J.createRef(),beforeTriggerFocusGuardRef:/*#__PURE__*/ J.createRef(),beforeContentFocusGuardRef:/*#__PURE__*/ J.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Qa(e,t,n=!1,r){return{...je(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:_e,inputProps:_e,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new a,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:_e,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}const $a=/*#__PURE__*/ J.createContext(null);function eo(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function to(e,t){return e===`list-navigation`||eo(e,t)}const no=e(function(e){let{children:n,open:r,onOpenChange:i,onOpenChangeComplete:a,onItemHighlighted:s,defaultOpen:l=!1,disabled:u=!1,modal:f,loopFocus:m=!0,orientation:h=`vertical`,actionsRef:g,closeParentOnEsc:_=!1,handle:v,triggerId:b,defaultTriggerId:x=null,highlightItemOnHover:S=!0,isSubmenu:k=!1,virtualFocus:A=!1,virtualFocusRef:M,allowEscape:N=!0,resetOnPointerLeave:I=!0}=e,L=ya(!0),ee=_a(!0),z=Ja(!0),B=ee?.store,te=ee?.virtualFocus??!1,ne=J.useMemo(()=>k&&B?{type:`menu`,store:B}:z?{type:`menubar`,context:z}:L&&!B?{type:`context-menu`,context:L}:{type:void 0},[L,B,z,k]),re=w(),V=w(),[ie,H]=J.useState(void 0),ae=(ie??V)||void 0,oe=P(),se=ne.type===`menu`?ne.store:void 0,ce=(r??l)&&se?.state.transitionStatus===`starting`,le=Re(()=>ce?se?.state.instantType:void 0).current,U=Re(()=>{let e=new Xa({open:l,openProp:r,activeTriggerId:x,triggerIdProp:b,parent:ne,disabled:u,highlightItemOnHover:S,modal:ne.type===void 0?f:void 0,rootId:re,instantType:le},ae,oe!=null);return e.context.virtualFocusRef=M,e}).current;U.useControlledProp(`openProp`,r),U.useControlledProp(`triggerIdProp`,b),U.useContextCallback(`onOpenChangeComplete`,a);let de=U.useState(`floatingTreeRoot`),fe=C(de),pe=U.useState(`open`),me=U.useState(`activeTriggerElement`),he=U.useState(`positionerElement`),ve=U.useState(`hoverEnabled`),ye=U.useState(`disabled`),xe=U.useState(`lastOpenChangeReason`),G=U.useState(`parent`),Se=U.useState(`activeIndex`),Ce=U.useState(`keyboardOpen`),we=U.useState(`payload`),Te=U.useState(`floatingParentNodeId`),Ee=J.useRef(null),De=J.useRef(G.type!==`context-menu`),Oe=T(),ke=J.useRef(!0),K=T(),je=Te!=null,{openMethod:Me,triggerProps:q}=br(pe);U.useSyncedValues({disabled:u,highlightItemOnHover:S,modal:G.type===void 0?f:void 0,openMethod:Me,rootId:re}),d(U);let{forceUnmount:Ne,transitionStatus:Pe}=c(pe,U,()=>{U.set(`allowMouseEnter`,!1)},ce),Fe=E(U.context.popupRef);J.useEffect(()=>{if(le===void 0)return;let e=()=>{U.state.instantType===le&&U.set(`instantType`,void 0)};if(!pe){e();return}if(Pe!==void 0)return;if(U.context.popupRef.current==null){e();return}let t=new AbortController;return Fe(e,t.signal),()=>{t.abort()}},[le,pe,Pe,Fe,U]),ge(()=>{L&&!ee?U.update({parent:{type:`context-menu`,context:L},floatingNodeId:fe,floatingParentNodeId:oe}):(ee||!U.select(`activeTriggerElement`))&&U.update({floatingNodeId:fe,floatingParentNodeId:oe})},[L,ee,fe,oe,me,U]),J.useEffect(()=>{pe||(Ee.current=null),G.type===`context-menu`&&(pe?Oe.start(500,()=>{De.current=!0}):(Oe.clear(),De.current=!1))},[Oe,pe,G.type]),ge(()=>{!pe&&!ve&&U.set(`hoverEnabled`,!0)},[pe,ve,U]);let Ie=be((e,t)=>{let n=t.reason;if(!e&&!U.select(`open`)||pe===e&&t.trigger===me&&xe===n)return;let r=o(t);if(!e&&t.trigger==null&&(t.trigger=me??void 0),i?.(e,t),t.isCanceled)return;U.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!ke.current)return;e&&n===`trigger-focus`?(ke.current=!1,K.start(300,()=>{ke.current=!0})):(ke.current=!0,K.clear());let s=!e&&(n===`escape-key`||n==null);Ee.current=t.event;let c=F(U.state,e,t.trigger,r());c.openChangeReason=n,c.keyboardOpen=e&&to(n,a),c.instantType=G.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:eo(n,a)?`click`:s?`dismiss`:void 0,U.update(c)}),Le=D({popupStore:U,floatingRootContext:U.state.floatingRootContext,floatingId:ae,nested:oe!=null,onOpenChange:Ie}),ze=Le.context.events;ge(()=>{let e=({open:e,eventDetails:t})=>Ie(e,t);return ze.on(`setOpen`,e),()=>{ze?.off(`setOpen`,e)}},[ze,Ie]),ge(()=>U.subscribeToParentMenu(),[U]);let Be=J.useCallback(()=>{U.setOpen(!1,R(Ae))},[U]);J.useImperativeHandle(g,()=>({unmount:Ne,close:Be}),[Ne,Be]);let Ve;G.type===`context-menu`&&(Ve=G.context),J.useImperativeHandle(Ve?.positionerRef,()=>he,[he]),J.useImperativeHandle(Ve?.actionsRef,()=>({setOpen:Ie}),[Ie]);let He=j(Le,{enabled:!ye,bubbles:{escapeKey:_&&G.type===`menu`},outsidePress(){return G.type!==`context-menu`||Ee.current?.type===`contextmenu`||De.current},externalTree:je?de:void 0}),Ue=Ge(),We=rn(Le,{enabled:!ye,listRef:U.context.itemDomElements,activeIndex:Se,virtual:A,nested:G.type===`menubar`||!A&&G.type!==void 0,parentOrientation:G.type===`menubar`?G.context.orientation:void 0,loopFocus:m,focusItemOnOpen:A?Ce:void 0,allowEscape:A&&m&&N,orientation:h,triggerOrientation:A?`vertical`:h,rtl:Ue===`rtl`,disabledIndices:t,onNavigate(e,t){U.setActiveIndex(e,bn(t),t?.nativeEvent)},openOnArrowKeyDown:G.type!==`context-menu`&&!(A&&k),externalTree:!A&&je?de:void 0,nestedReturnFocusRef:se?.context.virtualFocusRef,focusItemOnHover:S,resetOnPointerLeave:I}),Ke=J.useCallback(e=>{U.context.typingRef.current=e},[U]),qe=dt(Le,{enabled:!ye&&!A,listRef:U.context.itemLabels,elementsRef:U.context.itemDomElements,activeIndex:Se,resetMs:500,onMatch:(e,t)=>{pe&&e!==Se&&U.setActiveIndex(e,W,t.nativeEvent)},onTyping:Ke}),Je=be(s),Ye=J.useRef(-1),Ze=be(()=>{let e=U.state.activeIndex,t=e===null?void 0:U.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ye.current===n&&U.context.reportedItem===t)return;Ye.current=n,U.context.reportedItem=t,A&&U.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=U.context;U.context.highlightReason=$e,U.context.highlightEvent=void 0,s&&Je(t,p(r,i,{label:t===void 0?void 0:U.context.itemLabels.current[n]??void 0}))});ge(()=>{Ze()},[Se,Ze]);let Qe=J.useMemo(()=>{if(!A)return We.reference;if(!We.trigger)return _e;let{onFocus:e,...t}=We.trigger;return t},[A,We.reference,We.trigger]);U.useSyncedValue(`inputProps`,A?We.reference??_e:_e);let et=J.useMemo(()=>{let e=Xe(qe.reference,Qe,He.reference,{onMouseMove(){U.set(`allowMouseEnter`,!0)}},q);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=pe,e},[U,qe.reference,Qe,He.reference,q,pe]),nt=J.useMemo(()=>{let e=Xe(We.trigger,He.trigger,q);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[We.trigger,He.trigger,q]);Re(()=>(U.update({inactiveTriggerProps:nt}),null));let rt=J.useMemo(()=>Xe(ue,{onMouseMove(){U.set(`allowMouseEnter`,!0),G.type===`menu`&&U.set(`hoverEnabled`,!1)},onClick(){U.select(`hoverEnabled`)&&U.set(`hoverEnabled`,!1)},onKeyDown(e){let t=U.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},qe.floating,We.floating,He.floating),[G.type,U,qe.floating,We.floating,He.floating]),it=We.item??_e;O(U,{floatingRootContext:Le,activeTriggerProps:et,inactiveTriggerProps:nt,popupProps:rt,itemProps:it});let at=J.useMemo(()=>({store:U,parent:ne,orientation:h,loopFocus:m,allowEscape:N,defaultFloatingId:V,setRenderedFloatingId:H,virtualFocus:A,parentVirtualFocus:te,syncHighlightedItem:Ze}),[U,ne,h,m,N,V,A,te,Ze]),ot=typeof n==`function`?n({payload:we}):n,st=/*#__PURE__*/ (0,Y.jsxs)(ga.Provider,{value:at,children:[v&&/*#__PURE__*/ (0,Y.jsx)(tt,{handle:v,store:U}),ot]});return(G.type===void 0||G.type===`context-menu`)&&(st=/*#__PURE__*/ (0,Y.jsx)(y,{externalTree:de,children:st})),st});function ro(e){let t=J.useContext($a);if(t===null)return/*#__PURE__*/ (0,Y.jsx)(no,{...e});let n=t.Root;return/*#__PURE__*/ (0,Y.jsx)($a.Provider,{value:null,children:/*#__PURE__*/ (0,Y.jsx)(n,{...t.options,...e})})}function io(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=fe(),{ref:i,index:a}=pt(e),o=n===a,s=J.useRef(null),c=Ue(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function ao(e){let{render:n,className:r,style:i,state:a=_e,props:o=t,refs:s=t,metadata:c,stateAttributesMapping:l,tag:u=`div`,...d}=e,{compositeProps:f,compositeRef:p}=io({metadata:c});return V(u,e,{state:a,ref:[p,...s],props:[f,...o,d],stateAttributesMapping:l})}function oo(e){if(U(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!nt(e))return oo(ae(e))}var so=/* @__PURE__ */ Te(u(),1);function co(e,t){function n(n,r,i){let a=n.currentTarget;so.flushSync(()=>{e.setOpen(!1,R(pe,n.nativeEvent,a))}),B(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&v(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function lo(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=J.useRef(!1);return J.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Fe(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:_e,[t,n,r])}const uo=ve(function(e,t){let{render:n,className:r,style:i,disabled:o=!1,nativeButton:s=!0,id:c,openOnHover:u,delay:d=100,closeDelay:f=0,handle:p,payload:m,...h}=e,g=_a(!0),_=Le(p)??g?.store;if(!_)throw Error(K(85));let v=w(c),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`triggerControlsId`,v),E=J.useRef(null),D=po(),O=fe(!0),k=at(),A=J.useMemo(()=>k??new a,[k]),j=C(A),M=P(),{registerTrigger:N,isMountedByThisTrigger:F}=Ce(v,E,_,{payload:m,closeDelay:f,parent:D,floatingTreeRoot:A,floatingNodeId:j,floatingParentNodeId:M,keyboardEventRelay:O?.relayKeyboardEvent}),I=D.type===`menubar`,L=_.useState(`disabled`),R=o||L||I&&D.context.disabled,{getButtonProps:ee,buttonRef:z}=Se({disabled:R,native:s});J.useEffect(()=>{!x&&D.type===void 0&&(_.context.allowMouseUpTriggerRef.current=!1)},[_,x,D.type]);let B=J.useRef(null),te=T(),ne=be(e=>{if(!B.current)return;te.clear(),_.context.allowMouseUpTriggerRef.current=!1;let t=e.target;l(B.current,t)||l(_.select(`positionerElement`),t)||t===B.current||(t==null||oo(t)!==_.select(`rootId`))&&(Tr(e,B.current)||A.events.emit(`close`,{domEvent:e,reason:We}))});J.useEffect(()=>{let e=Fe(B.current);if(x&&_.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,ne,{once:!0}),()=>{e.removeEventListener(`mouseup`,ne)}},[x,ne,_]);let re=I&&D.context.hasSubmenuOpen,ie=Je(b,{enabled:(u??re)&&!R&&(!I||re&&!F),handleClose:Oe({blockPointerEvents:!I}),mouseOnly:!0,move:!1,restMs:D.type===void 0?d:void 0,delay:{close:f},triggerElementRef:E,externalTree:A,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`}),H=fo(x,_.select(`lastOpenChangeReason`)),ae=wt(b,{enabled:!R,event:x&&I?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0&&H}),oe=ye(b,{enabled:!R&&re}),se=lo({open:x,enabled:I,mouseDownAction:`open`}),ce=J.useMemo(()=>Xe(oe.reference,ae.reference),[oe.reference,ae.reference]),le=_.useState(`triggerProps`,F),ue=_.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:U,handleFocusTargetFocus:de}=co(_,E),pe={disabled:R,open:x},me=[B,t,z,N,E],he=[ce,ie??_e,le,{"aria-haspopup":`menu`,"aria-controls":S,id:v,onMouseDown:e=>{_.select(`open`)||(te.start(200,()=>{_.context.allowMouseUpTriggerRef.current=!0}),Fe(e.currentTarget).addEventListener(`mouseup`,ne,{once:!0}))}},ue,I?{role:`menuitem`}:{},se,h,ee],ge=V(`button`,e,{enabled:!I,stateAttributesMapping:Ye,state:pe,ref:me,props:he});return I?/*#__PURE__*/ (0,Y.jsx)(ao,{tag:`button`,render:n,className:r,style:i,state:pe,refs:me,props:he,stateAttributesMapping:Ye}):x?/*#__PURE__*/ (0,Y.jsxs)(J.Fragment,{children:[/*#__PURE__*/ (0,Y.jsx)(ze,{ref:_.context.beforeTriggerFocusGuardRef,onFocus:U},`${v}-pre-focus-guard`),/*#__PURE__*/ (0,Y.jsx)(J.Fragment,{children:ge},v),/*#__PURE__*/ (0,Y.jsx)(ze,{ref:_.context.triggerFocusTargetRef,onFocus:de},`${v}-post-focus-guard`)]}):/*#__PURE__*/ (0,Y.jsx)(J.Fragment,{children:ge},v)});function fo(e,t){let n=T(),[r,i]=J.useState(!1);return ge(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function po(){let e=Ja(!0);return J.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function mo(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function ho({...e}){return/* @__PURE__ */ (0,Y.jsx)(ro,{"data-slot":`dropdown-menu`,...e})}function go({...e}){return/* @__PURE__ */ (0,Y.jsx)(uo,{"data-slot":`dropdown-menu-trigger`,...e})}function _o({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,container:a,...o}){return/* @__PURE__ */ (0,Y.jsx)(Wa,{container:a,children:/* @__PURE__ */ (0,Y.jsx)(Ka,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:/* @__PURE__ */ (0,Y.jsx)(Va,{"data-slot":`dropdown-menu-content`,className:x(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...o})})})}function vo({className:e,inset:t,variant:n=`default`,...r}){return/* @__PURE__ */ (0,Y.jsx)(Aa,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:x(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function yo({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(Ti,{"data-slot":`dropdown-menu-separator`,className:x(`-mx-1 my-1 h-px bg-border`,e),...t})}function bo({chat:e,state:t,thread:n,onDelete:r}){let i=(0,J.useRef)(null),[a,o]=(0,J.useState)(!1),s=(0,J.useRef)(null),c=(0,J.useRef)(null),[l,u]=(0,J.useState)(!1),[d,f]=(0,J.useState)(``),[p,m]=(0,J.useState)(!1),[h,g]=(0,J.useState)(!1),_=n.title??``,v=n.role===`manager`&&t.status!==`submitted`&&t.status!==`streaming`;return(0,J.useEffect)(()=>{l&&requestAnimationFrame(()=>c.current?.select())},[l]),(0,J.useEffect)(()=>{if(!h)return;let e=setTimeout(()=>g(!1),2e3);return()=>clearTimeout(e)},[h]),/* @__PURE__ */ (0,Y.jsxs)(`div`,{ref:s,"data-slot":`conversation-title`,className:`shrink-0 border-b`,children:[a&&/* @__PURE__ */ (0,Y.jsx)(pa,{title:_||`Untitled`,container:s,finalFocus:i,onClose:()=>o(!1),onDelete:async()=>{let t=await e.deleteThread();return t&&r(n.id),t}}),/* @__PURE__ */ (0,Y.jsx)(`div`,{className:`flex h-10 items-center gap-1 px-4 any-pointer-coarse:min-h-11`,children:l?/* @__PURE__ */ (0,Y.jsxs)(`form`,{className:`flex min-w-0 flex-1 gap-1`,onSubmit:t=>{t.preventDefault(),d.trim()&&(m(!0),e.renameThread(d.trim()).then(e=>{m(!1),e&&(u(!1),requestAnimationFrame(()=>i.current?.focus()))}))},children:[/* @__PURE__ */ (0,Y.jsx)(Ne,{ref:c,"aria-label":`Conversation title`,className:`h-7 any-pointer-coarse:min-h-11`,value:d,maxLength:200,disabled:p,onChange:e=>f(e.currentTarget.value),onKeyDown:e=>{e.key===`Escape`&&(u(!1),requestAnimationFrame(()=>i.current?.focus()))}}),/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,size:`icon-sm`,variant:`ghost`,tooltip:`Cancel`,disabled:p,onClick:()=>{u(!1),requestAnimationFrame(()=>i.current?.focus())},children:/* @__PURE__ */ (0,Y.jsx)(Vn,{})}),/* @__PURE__ */ (0,Y.jsx)(q,{type:`submit`,size:`icon-sm`,tooltip:p?`Saving…`:`Save`,disabled:!d.trim()||p,children:p?/* @__PURE__ */ (0,Y.jsx)(bt,{}):/* @__PURE__ */ (0,Y.jsx)(Et,{})})]}):/* @__PURE__ */ (0,Y.jsxs)(Y.Fragment,{children:[/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,title:_,children:_}),h&&/* @__PURE__ */ (0,Y.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Copied`}),/* @__PURE__ */ (0,Y.jsxs)(ho,{children:[/* @__PURE__ */ (0,Y.jsx)(go,{ref:i,render:/* @__PURE__ */ (0,Y.jsx)(q,{tooltip:`Conversation actions`,variant:`ghost`,size:`icon-sm`}),children:/* @__PURE__ */ (0,Y.jsx)(ui,{})}),/* @__PURE__ */ (0,Y.jsxs)(_o,{container:s,align:`end`,className:`w-40`,children:[/* @__PURE__ */ (0,Y.jsxs)(vo,{className:`any-pointer-coarse:min-h-11`,disabled:!v,onClick:()=>{f(n.title??``),u(!0)},children:[/* @__PURE__ */ (0,Y.jsx)(_i,{}),`Rename`]}),/* @__PURE__ */ (0,Y.jsxs)(vo,{className:`any-pointer-coarse:min-h-11`,disabled:t.messages.length===0,onClick:()=>{navigator.clipboard.writeText(Tn(_,t.messages)).then(()=>g(!0))},children:[/* @__PURE__ */ (0,Y.jsx)(yt,{}),`Copy Markdown`]}),/* @__PURE__ */ (0,Y.jsx)(yo,{}),/* @__PURE__ */ (0,Y.jsxs)(vo,{className:`any-pointer-coarse:min-h-11`,variant:`destructive`,disabled:!v,onClick:()=>o(!0),children:[/* @__PURE__ */ (0,Y.jsx)(Mr,{}),`Delete`]})]})]})]})})]})}var xo=class extends En{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Yn(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&jn(t.mutationKey)!==jn(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??qn();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){hr.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function So(e,t){let n=_r(t),[r]=J.useState(()=>new xo(n,e));J.useEffect(()=>{r.setOptions(e)},[r,e]);let i=J.useSyncExternalStore(J.useCallback(e=>r.subscribe(hr.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=J.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(rr)},[r]);if(i.error&&In(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}const Co=/*#__PURE__*/ J.createContext(void 0);function wo(e){let t=J.useContext(Co);if(t===void 0&&!e)throw Error(K(47));return t}const To={...xe,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!xe.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&xe.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>xe.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};var Eo=class extends H{constructor(e,t,n){let r=new it;super(Do(e,r,t,n),Oo(r),To)}setOpen=(e,t)=>{let n=t.reason===s,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=o(t),c=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&c!=null&&(t.trigger=this.context.triggerElements.getById(c)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let l=()=>{let n=F(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),so.flushSync(l)):l();let u;r?u=`click`:i?u=`dismiss`:t.reason===`focus-out`&&(u=`focus`),this.set(`instantType`,u)}};function Do(e,t,n,r=!1){let i={...je(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function Oo(e){return{popupRef:/*#__PURE__*/ J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:/*#__PURE__*/ J.createRef(),beforeTriggerFocusGuardRef:/*#__PURE__*/ J.createRef(),beforeContentFocusGuardRef:/*#__PURE__*/ J.createRef(),stickIfOpenTimeout:new b,stickIfOpen:!0,triggerElements:e}}const ko=e(function({props:e}){let{children:t,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,modal:s=!1,handle:l,triggerId:u,defaultTriggerId:f=null}=e,p=jo(l,{modal:s,open:i,openProp:r,activeTriggerId:f,triggerIdProp:u});p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u);let m=p.useState(`open`),h=p.useState(`mounted`),g=p.useState(`payload`);p.useContextCallback(`onOpenChange`,a),p.useContextCallback(`onOpenChangeComplete`,o),n(p,m),d(p);let{forceUnmount:_}=c(m,p,()=>{p.context.stickIfOpen=!0,p.set(`openChangeReason`,null)});p.useSyncedValues({modal:s}),J.useEffect(()=>{m||p.context.stickIfOpenTimeout.clear()},[p,m]),J.useImperativeHandle(e.actionsRef,()=>({unmount:_,close:()=>p.setOpen(!1,R(Ae))}),[_,p]);let v=m||h||l!=null;return/*#__PURE__*/ (0,Y.jsxs)(Co.Provider,{value:p,children:[l&&/*#__PURE__*/ (0,Y.jsx)(tt,{handle:l,store:p}),v&&/*#__PURE__*/ (0,Y.jsx)(Mo,{store:p,modal:s}),typeof t==`function`?t({payload:g}):t]})});function Ao(e){return wo(!0)?/*#__PURE__*/ (0,Y.jsx)(ko,{props:e}):/*#__PURE__*/ (0,Y.jsx)(y,{children:/*#__PURE__*/ (0,Y.jsx)(ko,{props:e})})}function jo(e,t){let n=De((e,n)=>new Eo(t,e,n));return J.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function Mo({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=j(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference,a=r.floating;return O(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}const No=ve(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=wo(!0),h=Le(s)??m;if(!h)throw Error(K(74));let g=w(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=J.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=Ce(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=h.useState(`isPressOpenedByTrigger`,g),E=h.useState(`isTouchPressOpen`,l),D=h.useState(`hasTriggerFocusGuards`,g),O=Je(v,{enabled:!a&&l&&!E,mouseOnly:!0,move:!1,handleClose:Oe(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),k=be(()=>h.context.stickIfOpen),A=wt(v,{stickIfOpen:k}),j=$t(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,C),{getButtonProps:N,buttonRef:P}=Se({disabled:a,native:o}),F={open(e){return T?Ye.open(e):he.open(e)}},{handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=co(h,x),R=V(`button`,e,{state:{disabled:a,open:y},ref:[P,t,S,x],props:[A.reference,O,M,j,{[ee]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,N],stateAttributesMapping:F}),z=/*#__PURE__*/ (0,Y.jsx)(J.Fragment,{children:R},g);return D?/*#__PURE__*/ (0,Y.jsxs)(J.Fragment,{children:[/*#__PURE__*/ (0,Y.jsx)(ze,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:I}),z,/*#__PURE__*/ (0,Y.jsx)(ze,{ref:h.context.triggerFocusTargetRef,onFocus:L})]}):z}),Po=/*#__PURE__*/ J.createContext(void 0);function Fo(){let e=J.useContext(Po);if(e===void 0)throw Error(K(45));return e}const Io=/*#__PURE__*/ J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return wo().useState(`mounted`)||n?/*#__PURE__*/ (0,Y.jsx)(Po.Provider,{value:n,children:/*#__PURE__*/ (0,Y.jsx)(z,{ref:t,...r})}):null}),Lo=/*#__PURE__*/ J.createContext(void 0);function Ro(){let e=J.useContext(Lo);if(!e)throw Error(K(46));return e}const zo=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:g,disableAnchorTracking:_=!1,collisionAvoidance:v=h,...y}=e,b=wo(),x=Fo(),S=C(),w=b.useState(`floatingRootContext`),T=b.useState(`mounted`),E=b.useState(`open`),D=b.useState(`openChangeReason`),O=b.useState(`activeTriggerElement`),k=b.useState(`modal`),A=b.useState(`openMethod`),j=b.useState(`positionerElement`),M=b.useState(`instantType`),N=b.useState(`transitionStatus`),P=b.useState(`adaptiveOrigin`),F=Pe({anchor:a,floatingRootContext:w,positionMethod:o,mounted:T,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:g,disableAnchorTracking:_,keepMounted:x,nodeId:S,collisionAvoidance:v,adaptiveOrigin:P});Ga({store:b,domReference:w.useState(`domReferenceElement`),positionerElement:j,open:E});let I=k===!0&&D!==`trigger-hover`;Cr(E&&I,A===`touch`,j,O);let L=b.useStateSetter(`positionerElement`),R={open:E,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:M},ee=G(e,R,{styles:F.positionerStyles,transitionStatus:N,props:y,refs:[t,L],hidden:!T,inert:!E});return/*#__PURE__*/ (0,Y.jsxs)(Lo.Provider,{value:F,children:[T&&I&&/*#__PURE__*/ (0,Y.jsx)(_t,{inert:Dr(!E),cutout:O}),/*#__PURE__*/ (0,Y.jsx)(m,{id:S,children:ee})]})}),Bo=/*#__PURE__*/ J.createContext(void 0);function Vo(){let[e,t]=J.useState(0),n=be(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:J.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const Ho=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=wo(),l=Ro(),u=Ma(!0)!=null,{context:d,hasClosePart:f}=Vo(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);Ee({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),me(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?et(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M={open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},N=V(`div`,e,{state:M,ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...ue,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&Ji.has(e.key)&&e.stopPropagation()}},se(g),s],stateAttributesMapping:ke});return/*#__PURE__*/ (0,Y.jsx)(tn,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:U(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:/*#__PURE__*/ (0,Y.jsx)(Bo.Provider,{value:d,children:N})})});function Uo({...e}){return/* @__PURE__ */ (0,Y.jsx)(Ao,{"data-slot":`popover`,...e})}function Wo({...e}){return/* @__PURE__ */ (0,Y.jsx)(No,{"data-slot":`popover-trigger`,...e})}function Go({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,container:a,...o}){return/* @__PURE__ */ (0,Y.jsx)(Io,{container:a,children:/* @__PURE__ */ (0,Y.jsx)(zo,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:/* @__PURE__ */ (0,Y.jsx)(Ho,{"data-slot":`popover-content`,className:x(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}function Ko({chat:e,state:t}){let n=(0,J.useId)(),r=(0,J.useRef)(null),[i]=(0,J.useState)(()=>new Cn),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)(),d=t.auth.status===`ready`&&t.auth.currentUser.scope===`tenant`?t.auth.currentUser:null,f=ur({queryKey:[`mcp-connections`,d?.organization.id,d?.tenant.id,d?.user.id],enabled:a&&!!d,queryFn:()=>e.getMcpCatalog(),retry:!1},i),p=So({mutationFn:t=>t.action===`authorize`?e.authorizeMcpConnection(t):e.manageMcpConnection(t),onMutate:e=>{u(`mcpServerId`in e?e.mcpServerId:f.data?.connections.find(t=>t.id===e.id)?.mcp_server_id)},onSuccess:()=>c(null),onSettled:()=>f.refetch()},i);if(!d)return null;let m=p.isPending,h=f.isError?void 0:f.data?.servers,_=m?{authorize:`Waiting for sign-in…`,test:`Testing connection…`,disconnect:`Disconnecting…`,connect:`Enabling…`,headers:`Saving credentials…`}[p.variables.action]:null,v=p.isError?p.error.message:p.isSuccess?p.variables.action===`test`&&p.data&&`tool_count`in p.data?`${p.data.tool_count} tools available.`:p.variables.action===`disconnect`?`Disconnected locally.`:`Connection saved.`:null;return/* @__PURE__ */ (0,Y.jsx)(`div`,{ref:r,children:/* @__PURE__ */ (0,Y.jsxs)(Uo,{open:a,onOpenChange:o,children:[/* @__PURE__ */ (0,Y.jsx)(Wo,{render:/* @__PURE__ */ (0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,tooltip:`MCP connections`}),children:/* @__PURE__ */ (0,Y.jsx)(jr,{})}),/* @__PURE__ */ (0,Y.jsxs)(Go,{container:r,align:`end`,"aria-labelledby":`${n}-title`,className:`max-h-[75vh] w-[min(24rem,85vw)] gap-0 overflow-hidden p-0`,children:[/* @__PURE__ */ (0,Y.jsx)(`header`,{className:`shrink-0 border-b px-3 py-2`,children:/* @__PURE__ */ (0,Y.jsx)(`h2`,{id:`${n}-title`,className:`font-semibold`,children:`MCP connections`})}),/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`min-h-0 divide-y overflow-y-auto`,children:[f.isPending&&/* @__PURE__ */ (0,Y.jsx)(`p`,{role:`status`,className:`px-3 py-2 text-xs`,children:`Loading servers…`}),f.isError&&/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`px-3 py-2`,children:[/* @__PURE__ */ (0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:f.error.message}),/* @__PURE__ */ (0,Y.jsx)(g,{size:`sm`,className:`any-pointer-coarse:min-h-9`,onClick:()=>void f.refetch(),children:`Try again`})]}),h?.length===0&&/* @__PURE__ */ (0,Y.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:`No MCP servers are available.`}),h?.map(e=>{let r=f.data?.connections.find(t=>t.mcp_server_id===e.id),i=r?.auth_state===`connected`,a=e.auth_kind===`none`,o=l===e.id,u=m&&o?yi:jr,d=new URL(e.endpoint_url),h=a?`Disable`:r?.auth_state===`disconnected`?`Remove connection`:`Disconnect`,y=e.auth_kind?{none:[`Enable`,`Enable`],oauth:[`Connect`,`Reconnect`],static_headers:[`Connect`,`Replace credentials`]}[e.auth_kind]:null;return/* @__PURE__ */ (0,Y.jsxs)(Vr,{render:/* @__PURE__ */ (0,Y.jsx)(`article`,{}),size:`xs`,"data-slot":`mcp-connection`,className:`rounded-none border-0 py-1.5`,children:[/* @__PURE__ */ (0,Y.jsx)(Or,{variant:`icon`,className:`text-muted-foreground`,children:/* @__PURE__ */ (0,Y.jsx)(u,{"aria-hidden":`true`,className:m&&o?`animate-spin`:void 0})}),/* @__PURE__ */ (0,Y.jsxs)(zr,{className:`min-w-0`,title:e.endpoint_url,children:[/* @__PURE__ */ (0,Y.jsx)(`h3`,{className:`truncate text-sm font-medium`,children:d.hostname}),/* @__PURE__ */ (0,Y.jsxs)(Nr,{role:`status`,className:`line-clamp-none truncate`,children:[o&&_?_:o&&p.isError&&p.variables.action===`test`?`Connection failed`:i?a?`Enabled`:`Connected`:r?.auth_state===`reauthorization_required`?`Reconnect needed`:a?`Disabled`:`Not connected`,` · `,d.pathname,d.search]})]}),s!==e.id&&/* @__PURE__ */ (0,Y.jsxs)(Ir,{className:`shrink-0 gap-0.5`,children:[y&&!(a&&i)&&/* @__PURE__ */ (0,Y.jsx)(q,{size:i?`icon-sm`:`xs`,className:i?void 0:`any-pointer-coarse:min-h-9`,variant:i?`ghost`:`outline`,"aria-label":`${y[+!!i]}: ${d.hostname}`,tooltip:y[+!!i],disabled:m,onClick:()=>e.auth_kind===`oauth`?p.mutate({action:`authorize`,mcpServerId:e.id,...r?{id:r.id}:{}}):e.auth_kind===`static_headers`?c(e.id):p.mutate({action:`connect`,mcpServerId:e.id}),children:i?/* @__PURE__ */ (0,Y.jsx)(oi,{}):y[0]}),i&&r&&/* @__PURE__ */ (0,Y.jsx)(q,{size:`icon-sm`,variant:`ghost`,"aria-label":`Test connection: ${d.hostname}`,tooltip:`Test connection`,disabled:m,onClick:()=>p.mutate({action:`test`,id:r.id}),children:/* @__PURE__ */ (0,Y.jsx)(vi,{})}),r&&/* @__PURE__ */ (0,Y.jsx)(q,{size:`icon-sm`,variant:`ghost`,"aria-label":`${h}: ${d.hostname}`,tooltip:h,disabled:m,onClick:()=>p.mutate({action:`disconnect`,id:r.id}),children:/* @__PURE__ */ (0,Y.jsx)(Vn,{})})]}),!e.auth_kind&&/* @__PURE__ */ (0,Y.jsx)(`p`,{className:`basis-full text-xs text-destructive`,children:`Configuration unavailable. Contact your administrator.`}),s===e.id&&/* @__PURE__ */ (0,Y.jsx)(`form`,{className:`grid basis-full gap-2`,onSubmit:t=>{t.preventDefault();let n=new FormData(t.currentTarget);p.mutate({action:`headers`,mcpServerId:e.id,headers:Object.fromEntries(e.header_names.map(e=>[e,n.get(e)]))})},children:/* @__PURE__ */ (0,Y.jsxs)(`fieldset`,{disabled:m,className:`grid gap-2`,children:[e.header_names.map(t=>/* @__PURE__ */ (0,Y.jsxs)(Lr,{className:`gap-1`,children:[/* @__PURE__ */ (0,Y.jsxs)(Pr,{className:`text-xs`,htmlFor:`${n}-${e.id}-${t}`,children:[t,` value`]}),/* @__PURE__ */ (0,Y.jsx)(Ne,{className:`any-pointer-coarse:min-h-11 any-pointer-coarse:text-base`,id:`${n}-${e.id}-${t}`,name:t,type:`password`,autoComplete:`off`,required:!0,"aria-describedby":t.toLowerCase()===`authorization`?`${n}-authorization-help`:void 0}),t.toLowerCase()===`authorization`&&/* @__PURE__ */ (0,Y.jsx)(Br,{id:`${n}-authorization-help`,className:`text-xs`,children:`Enter the full value, including Bearer before the token when required.`})]},t)),/* @__PURE__ */ (0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Saved secrets are never shown. Enter every value to replace them.`}),/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,Y.jsx)(g,{type:`submit`,size:`sm`,className:`any-pointer-coarse:min-h-9`,children:`Save credentials`}),/* @__PURE__ */ (0,Y.jsx)(g,{type:`button`,size:`sm`,className:`any-pointer-coarse:min-h-9`,variant:`outline`,onClick:()=>c(null),children:`Cancel`})]})]})}),o&&v&&/* @__PURE__ */ (0,Y.jsx)(`p`,{"data-slot":`mcp-notice`,role:p.isError?`alert`:`status`,className:p.isError?`basis-full text-xs text-destructive`:`basis-full text-xs text-muted-foreground`,children:v}),i&&r&&t.unavailableMcpConnections?.includes(r.id)&&/* @__PURE__ */ (0,Y.jsx)(`p`,{className:`basis-full text-xs text-muted-foreground`,children:`Unavailable in the last chat. Test the connection or reconnect.`})]},e.id)})]})]})]})})}function qo(e){let{loopFocus:n=!0,orientation:r=`both`,grid:i,onLoop:a,direction:o,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:d,disabledIndices:f,modifierKeys:p=t}=e,[m,h]=J.useState(0),g=i!=null,v=J.useRef(null),y=Ue(v,l),b=J.useRef([]),x=J.useRef(!1),C=J.useRef(null),w=s??m,T=be((e,t=!1)=>{if(C.current=b.current[e]??null,(c??h)(e),t){let t=b.current[e];Qi(v.current,t,o,r)}}),E=be(e=>{if(e.size===0)return;if(x.current){let e=b.current,t=e.indexOf(C.current);if(t===-1){let t=e[w];!t||N(e,w,f)?T(Jo(e,f)):C.current=t}else t!==w&&T(t);return}x.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=n?e.get(n)?.index??-1:-1;if(i!==-1)T(i);else if(N(t,w,f)){let e=_(t,{disabledIndices:f});ie(t,e)||T(e)}Qi(v.current,n,o,r)});ge(()=>{if(f==null||s!=null||!x.current)return;let e=b.current;if(N(e,w,f)){let t=_(e,{disabledIndices:f});ie(e,t)||T(t)}},[f,s,w,b,T]);let D=be((e,t,n)=>a?a(e,t,n,b):n),O=be(e=>{let t=e.key===`Home`||e.key===`End`;if(!Ji.has(e.key)||!u&&t||Yo(e,p)||!v.current)return;let s=o===`rtl`,c=s?Ki:qi,l=s?qi:Ki,m=r===`vertical`?Gi:c,h=r===`vertical`?Wi:l,y=k(e.nativeEvent);if(y!=null&&Zi(y)&&!mo(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==h&&t<r.length||e.key!==m&&t>0)return}let x=w,C=S(b,f),E=Ve(b,f);i!=null&&(x=i({disabledIndices:f,elementsRef:b,event:e,highlightedIndex:w,loopFocus:n,maxIndex:E,minIndex:C,onLoop:D,orientation:r,rtl:s}));let O=r!==`vertical`&&e.key===c||r!==`horizontal`&&e.key===`ArrowDown`,A=r!==`vertical`&&e.key===l||r!==`horizontal`&&e.key===`ArrowUp`;u&&(e.key===`Home`?x=C:e.key===`End`&&(x=E)),x===w&&(O||A)&&(n&&x===E&&O?(x=C,a&&(x=a(e,w,x,b))):n&&x===C&&A?(x=E,a&&(x=a(e,w,x,b))):x=_(b.current,{startingIndex:x,decrement:A,disabledIndices:f})),x!==w&&!ie(b.current,x)&&(d&&e.stopPropagation(),(g||t||O||A)&&e.preventDefault(),T(x,!0),queueMicrotask(()=>{b.current[x]?.focus()}))});return{props:{ref:y,onFocus(e){let t=v.current,n=k(e.nativeEvent);t&&n!=null&&Zi(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:O},highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:b,onMapChange:E,relayKeyboardEvent:O}}function Jo(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!N(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function Yo(e,t){for(let n of Yi)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Xo(e){let{render:n,className:r,style:i,refs:a=t,props:o=t,state:s=_e,stateAttributesMapping:c,highlightedIndex:l,onHighlightedIndexChange:u,orientation:d,grid:f,loopFocus:p,onLoop:m,enableHomeAndEndKeys:h,onMapChange:g,stopEventPropagation:_=!0,rootRef:v,disabledIndices:y,modifierKeys:b,highlightItemOnHover:x=!1,tag:S=`div`,...C}=e,{props:w,highlightedIndex:T,onHighlightedIndexChange:E,elementsRef:D,onMapChange:O,relayKeyboardEvent:k}=qo({grid:f,loopFocus:p,onLoop:m,orientation:d,highlightedIndex:l,onHighlightedIndexChange:u,rootRef:v,stopEventPropagation:_,enableHomeAndEndKeys:h,direction:Ge(),disabledIndices:y,modifierKeys:b}),A=V(S,e,{state:s,ref:a,props:[w,...o,C],stateAttributesMapping:c}),j=J.useMemo(()=>({highlightedIndex:T,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:k}),[T,E,x,k]);return/*#__PURE__*/ (0,Y.jsx)(Ke.Provider,{value:j,children:/*#__PURE__*/ (0,Y.jsx)(Xt,{elementsRef:D,onMapChange:e=>{g?.(e),O(e)},children:A})})}const Zo=/*#__PURE__*/ J.createContext(void 0);function Qo(){let e=J.useContext(Zo);if(e===void 0)throw Error(K(64));return e}const $o={tabActivationDirection:e=>({"data-activation-direction":e})},es=/*#__PURE__*/ J.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=J.useRef([]),[f,p]=J.useState(()=>/* @__PURE__ */ new Map),[m,h]=Wt({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=J.useState(()=>/* @__PURE__ */ new Map),y=J.useRef(void 0),b=J.useCallback(e=>ts(_,e),[_]),[x,S]=J.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:C,tabActivationDirection:w}=x,T=w,E=!1;C!==m&&(T=ns(C,m,a,_),E=C!=null&&m!=null&&b(m)==null);let D=E?C:m,O=C!==D||w!==T;ge(()=>{O&&S({previousValue:D,tabActivationDirection:T})},[D,O,T]);let k=be((e,t)=>{t.activationDirection=ns(m,e,a,_),i?.(e,t),!t.isCanceled&&h(()=>e)}),A=be((e,t)=>{i?.(e,R(t,void 0,void 0,{activationDirection:`none`}))}),j=be((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),M=J.useCallback(e=>f.get(e),[f]),N=J.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),P=J.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:N,getTabPanelIdByValue:M,onValueChange:k,orientation:a,registerMountedTabPanel:j,setTabMap:v,tabActivationDirection:T,value:m}),[b,N,M,k,a,j,v,T,m]),F=J.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),I=J.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),L=J.useRef(!u),ee=J.useRef(r),z=J.useRef(u),B=J.useRef(!1);ge(()=>{if(g)return;function e(e,t){h(()=>e),S({previousValue:e,tabActivationDirection:`none`}),A(e,t),L.current=!1}if(_.size===0){B.current&&m!==null&&!y.current?.isConnected&&e(null,oe);return}B.current=!0,y.current=_.keys().next().value;let t=F?.disabled,n=F==null&&m!==null;if(!t&&m===ee.current&&(z.current=!1),z.current&&t&&m===ee.current)return;let r=L.current;if(t||n){let n=I??null;if(m===n){L.current=!1;return}let i=oe;r?i=Ze:t&&(i=Ie),e(n,i)}else r&&F!=null&&(A(m,Ze),L.current=!1)},[I,g,A,F,h,_,m]);let te=V(`div`,e,{state:{orientation:a,tabActivationDirection:T},ref:t,props:l,stateAttributesMapping:$o});return/*#__PURE__*/ (0,Y.jsx)(Zo.Provider,{value:P,children:/*#__PURE__*/ (0,Y.jsx)(Xt,{elementsRef:d,children:te})})});function ts(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function ns(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=ts(r,e),c=ts(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}const rs=/*#__PURE__*/ J.createContext(void 0);function is(){let e=J.useContext(rs);if(e===void 0)throw Error(K(65));return e}const as=/*#__PURE__*/ J.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...u}=e,{value:d,getTabPanelIdByValue:f,onValueChange:p,orientation:m,tabActivationDirection:h}=Qo(),{activateOnFocus:g,registerTabResizeObserverElement:_,tabsListElement:v}=is(),{highlightedIndex:y,onHighlightedIndexChange:b}=fe(),x=w(o),{compositeProps:S,compositeRef:C,index:T}=io({metadata:J.useMemo(()=>({disabled:r,id:x,value:a}),[r,x,a])}),E=a===d,D=J.useRef(!1),O=J.useRef(null),k=be(e=>{O.current?.(),O.current=e?_(e):null});ge(()=>{if(D.current){D.current=!1;return}if(!(E&&T>-1&&y!==T))return;let e=v;if(e!=null){let t=I(Fe(e));if(t&&l(e,t))return}r||b(T)},[E,T,y,b,r,v]);let{getButtonProps:A,buttonRef:j}=Se({disabled:r,native:s,focusableWhenDisabled:!0}),M=f(a),N=J.useRef(!1),P=J.useRef(!1);function F(e){p(a,R($e,e.nativeEvent,void 0,{activationDirection:`none`}))}function L(e){E||r||F(e)}function ee(e){E||r||g&&(!N.current||P.current)&&F(e)}function z(e){if(E||r)return;N.current=!0,P.current=e.button===0;let t=Fe(e.currentTarget);function n(){N.current=!1,P.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return V(`button`,e,{state:{disabled:r,active:E,orientation:m,tabActivationDirection:h},ref:[t,j,C,k],props:[S,{role:`tab`,"aria-controls":M,"aria-selected":E,id:x,onClick:L,onFocus:ee,onPointerDown:z,"data-composite-item-active":E?``:void 0,onKeyDownCapture(){D.current=!0}},u,A],stateAttributesMapping:$o})}),os={...$o,...Qe},ss=/*#__PURE__*/ J.forwardRef(function(e,t){let{className:n,value:r,render:a,keepMounted:o=!1,style:s,...c}=e,{value:l,getTabIdByPanelValue:u,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=Qo(),m=w(),{ref:h,index:g}=pt(),_=r===l,{mounted:v,transitionStatus:y,setMounted:b}=i(_),x=!v,S=u(r),C={hidden:x,orientation:d,tabActivationDirection:f,transitionStatus:y},T=J.useRef(null),E=V(`div`,e,{state:C,ref:[t,h,T],props:[{"aria-labelledby":S,hidden:x,id:m,role:`tabpanel`,tabIndex:_?0:-1,inert:Dr(!_),"data-index":g},c],stateAttributesMapping:os});return Ee({open:_,ref:T,onComplete(){_||b(!1)}}),ge(()=>{if(!(m==null||x&&!o))return p(r,m)},[x,o,r,m,p]),o||v?E:null}),cs=/*#__PURE__*/ J.forwardRef(function(e,n){let{activateOnFocus:r=!1,className:i,loopFocus:a=!0,render:o,style:s,...c}=e,{orientation:l,setTabMap:u,tabActivationDirection:d}=Qo(),[f,p]=J.useState(0),[m,h]=J.useState(null),g=J.useRef(/* @__PURE__ */ new Set),_=J.useRef(/* @__PURE__ */ new Set),v=J.useRef(null);ge(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{g.current.forEach(e=>{e()})});return v.current=e,m&&e.observe(m),_.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),v.current=null}},[m]);let y=be(e=>(g.current.add(e),()=>{g.current.delete(e)})),b=be(e=>(_.current.add(e),v.current?.observe(e),()=>{_.current.delete(e),v.current?.unobserve(e)})),x={orientation:l,tabActivationDirection:d},S={"aria-orientation":l===`vertical`?`vertical`:void 0,role:`tablist`},C=J.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:b,tabsListElement:m}),[r,y,b,m]);return/*#__PURE__*/ (0,Y.jsx)(rs.Provider,{value:C,children:/*#__PURE__*/ (0,Y.jsx)(Xo,{render:o,className:i,style:s,state:x,refs:[n,h],props:[S,c],stateAttributesMapping:$o,highlightedIndex:f,enableHomeAndEndKeys:!0,loopFocus:a,orientation:l,onHighlightedIndexChange:p,onMapChange:u,disabledIndices:t})})});function ls(e,t){let n=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),r=Math.round((n(t)-n(new Date(e)))/864e5);return r<=0?`Today`:r===1?`Yesterday`:r<7?`Previous 7 days`:r<30?`Previous 30 days`:`Older`}function us(e){let t=/* @__PURE__ */ new Date,n=[];for(let r of e){let e=ls(r.updatedAt,t),i=n.at(-1);i?.value===e?i.items.push(r):n.push({value:e,items:[r]})}return n}const ds=e=>e.title||`Untitled`,fs=e=>e.stopPropagation();function ps({chat:e,state:t,onSelect:n,onDelete:r}){let i=(0,J.useRef)(null),[a,o]=(0,J.useState)(null),s=(0,J.useRef)(null),c=(0,J.useRef)(null),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(!1),[p,m]=(0,J.useState)(!1),[h,g]=(0,J.useState)(),[_]=On(l.trim(),{wait:300}),[v]=(0,J.useState)(()=>new Cn);(0,J.useEffect)(()=>(v.mount(),()=>{v.unmount(),v.clear()}),[v]);let y=t.auth.status===`ready`,b=er({queryKey:[`thread-history`,_],enabled:d&&y&&!p,initialPageParam:void 0,queryFn:({signal:t,pageParam:n})=>e.searchThreads(_,n,t).catch(e=>{throw Sr(e)&&[401,403,404].includes(e.status)&&m(!0),e}),getNextPageParam:e=>e.page_after??void 0,retry:!1,staleTime:3e4,gcTime:3e5},v),S=t.thread?.id,C=t.thread?.version,w=t.status===`submitted`||t.status===`streaming`;(0,J.useEffect)(()=>{(t.auth.status===`error`||p)&&v.removeQueries({queryKey:[`thread-history`]})},[v,t.auth.status,p]),(0,J.useEffect)(()=>{w||v.invalidateQueries({queryKey:[`thread-history`]})},[v,S,C,w]);let T=!p&&(l.trim()!==_||b.isPending),E=p||!T&&b.isError,{hasNextPage:D,isFetching:O,isError:k,fetchNextPage:A}=b;(0,J.useEffect)(()=>{let e=c.current;if(!d||!e||T||!D||O||k)return;let t=()=>{e.scrollHeight-e.scrollTop-e.clientHeight<48&&A({cancelRefetch:!1})};return t(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)},[d,T,D,O,k,A,b.data]);let j=!y||p||T?[]:us(b.data?.pages.flatMap(e=>e.items)??[]);return/* @__PURE__ */ (0,Y.jsxs)(`div`,{ref:s,"data-slot":`thread-history`,children:[a&&/* @__PURE__ */ (0,Y.jsx)(pa,{title:ds(a),container:s,finalFocus:i,onClose:()=>o(null),onDelete:async()=>{let t=await e.deleteThread(a);return t&&(r(a.id),v.invalidateQueries({queryKey:[`thread-history`]})),t}}),/* @__PURE__ */ (0,Y.jsxs)(Ct,{open:d,items:j,filteredItems:j,value:null,onValueChange:t=>{t&&t.id!==S&&e.openThread(t.id).then(n)},itemToStringLabel:ds,itemToStringValue:e=>e.id,isItemEqualToValue:(e,t)=>e.id===t.id,onInputValueChange:(e,t)=>{u(t.reason===`input-change`?e:``)},onOpenChange:e=>{f(e),e?(m(!1),g(s.current?.closest(`[data-slot="chat"]`)??void 0)):u(``)},children:[/* @__PURE__ */ (0,Y.jsx)(_n,{ref:i,render:/* @__PURE__ */ (0,Y.jsx)(q,{tooltip:`Show older chats`,variant:`ghost`,size:`icon-sm`,disabled:!y}),children:/* @__PURE__ */ (0,Y.jsx)(ci,{})}),/* @__PURE__ */ (0,Y.jsxs)(an,{container:s,collisionBoundary:h,align:`end`,"aria-label":`Chat history`,"aria-busy":T||b.isFetching?!0:void 0,className:`w-80 min-w-0`,children:[/* @__PURE__ */ (0,Y.jsx)(ir,{"aria-label":`Search chats`,placeholder:`Search chats…`,maxLength:255,showTrigger:!1}),/* @__PURE__ */ (0,Y.jsx)(dn,{className:`text-center text-sm text-muted-foreground [&:not(:empty)]:py-2`,children:!E&&(T||b.isFetchingNextPage)?`Loading…`:null}),/* @__PURE__ */ (0,Y.jsx)(xt,{children:y&&!T&&!E?`No chats found.`:null}),/* @__PURE__ */ (0,Y.jsx)(sn,{ref:c,className:`max-h-[min(24rem,calc(var(--available-height)---spacing(9)))]`,children:e=>/* @__PURE__ */ (0,Y.jsxs)(At,{items:e.items,children:[/* @__PURE__ */ (0,Y.jsx)(ln,{children:e.value}),/* @__PURE__ */ (0,Y.jsx)(en,{children:e=>{let t=e.id===S;return/* @__PURE__ */ (0,Y.jsxs)(Ot,{value:e,"aria-label":ds(e),"aria-current":t?`true`:void 0,className:x(`group/thread ps-2 pe-1 any-pointer-coarse:min-h-11`,t&&`bg-muted font-semibold`),children:[/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:ds(e)}),e.role===`manager`&&/* @__PURE__ */ (0,Y.jsx)(q,{variant:`ghost`,size:`icon-xs`,"aria-label":`Delete ${ds(e)}`,tooltip:`Delete chat`,disabled:t&&w,className:`opacity-0 group-hover/thread:opacity-100 group-data-highlighted/thread:opacity-100 focus-visible:opacity-100 any-pointer-coarse:opacity-100`,onPointerDown:fs,onMouseDown:fs,onClick:t=>{t.stopPropagation(),f(!1),o(e)},children:/* @__PURE__ */ (0,Y.jsx)(Mr,{})})]},e.id)}})]},e.value)}),E&&/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`p-2 text-xs`,role:`alert`,children:[`Could not load chats.`,/* @__PURE__ */ (0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,tooltip:`Retry`,disabled:b.isFetching,onClick:()=>void(!p&&b.isFetchNextPageError?b.fetchNextPage():b.refetch()).then(e=>{e.isSuccess&&m(!1)}),children:/* @__PURE__ */ (0,Y.jsx)(qt,{})})]})]})]})]})}function ms({className:e,orientation:t=`horizontal`,...n}){return/* @__PURE__ */ (0,Y.jsx)(es,{"data-slot":`tabs`,"data-orientation":t,className:x(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}const hs=re(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function gs({className:e,variant:t=`default`,...n}){return/* @__PURE__ */ (0,Y.jsx)(cs,{"data-slot":`tabs-list`,"data-variant":t,className:x(hs({variant:t}),e),...n})}function _s({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(as,{"data-slot":`tabs-trigger`,className:x(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pe-1 has-data-[icon=inline-start]:ps-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-end-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function vs({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(ss,{"data-slot":`tabs-content`,className:x(`flex-1 text-sm outline-none`,e),...t})}const ys=/* @__PURE__ */ new Set([`c`,`cpp`,`css`,`go`,`html`,`js`,`json`,`jsx`,`mjs`,`py`,`rb`,`rs`,`sh`,`sql`,`toml`,`ts`,`tsx`,`yaml`,`yml`]);function bs(e){let t=e.slice(e.lastIndexOf(`.`)+1).toLowerCase();return ys.has(t)?/* @__PURE__ */ (0,Y.jsx)(pi,{}):t===`csv`||t===`tsv`?/* @__PURE__ */ (0,Y.jsx)(mi,{}):/* @__PURE__ */ (0,Y.jsx)(Ut,{})}function xs(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function Ss({file:e}){return/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`flex items-start gap-1`,children:[/* @__PURE__ */ (0,Y.jsx)(`div`,{className:`min-w-0 flex-1`,children:/* @__PURE__ */ (0,Y.jsx)(Wn,{icon:bs(e.path),label:/* @__PURE__ */ (0,Y.jsxs)(Y.Fragment,{children:[/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`font-mono wrap-anywhere`,children:e.label}),/* @__PURE__ */ (0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,e.lines===1?`1 line`:`${e.lines} lines`]})]}),children:/* @__PURE__ */ (0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col`,children:/* @__PURE__ */ (0,Y.jsx)(Hn,{emptyLabel:`Empty file`,caption:e.label===e.path?void 0:e.path,language:e.path.split(`.`).at(-1),children:e.content})})})}),/* @__PURE__ */ (0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":`Download ${e.label}`,tooltip:`Download file`,onClick:()=>$n(xs(e.path),e.content),children:/* @__PURE__ */ (0,Y.jsx)(di,{})})]})}function Cs({run:e}){let t=e.timedOut||e.exitCode!==void 0&&e.exitCode!==0;return/* @__PURE__ */ (0,Y.jsx)(Wn,{icon:/* @__PURE__ */ (0,Y.jsx)(Rt,{}),running:!e.finished,failed:t,label:/* @__PURE__ */ (0,Y.jsxs)(Y.Fragment,{children:[/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`font-mono wrap-anywhere`,children:e.command}),e.finished&&/* @__PURE__ */ (0,Y.jsx)(`span`,{className:x(`ms-1`,t?`text-destructive`:`text-muted-foreground`),children:zt(e)})]}),children:/* @__PURE__ */ (0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col`,children:/* @__PURE__ */ (0,Y.jsx)(lt,{run:e})})})}function ws({activity:e}){let t=(0,J.useRef)(null),n=e.files.length,r=e.commands.length;return/* @__PURE__ */ (0,Y.jsx)(`div`,{ref:t,className:`w-full`,children:/* @__PURE__ */ (0,Y.jsxs)(Uo,{children:[/* @__PURE__ */ (0,Y.jsxs)(Wo,{render:/* @__PURE__ */ (0,Y.jsx)(g,{variant:`outline`,size:`sm`,className:`group w-full justify-start rounded-full bg-muted/50 text-xs text-muted-foreground any-pointer-coarse:min-h-9`}),children:[/* @__PURE__ */ (0,Y.jsx)(li,{}),/* @__PURE__ */ (0,Y.jsxs)(`span`,{className:`flex-1 text-start`,children:[`Sandbox · `,n,` `,n===1?`file`:`files`,` · `,r,` `,r===1?`command`:`commands`]}),/* @__PURE__ */ (0,Y.jsx)(si,{className:`transition-transform group-aria-expanded:rotate-180`})]}),/* @__PURE__ */ (0,Y.jsx)(Go,{container:t,side:`top`,sideOffset:4,"aria-label":`Sandbox files and command history`,className:`max-h-[min(20rem,var(--available-height))] w-(--anchor-width) max-w-(--available-width) gap-0 overflow-hidden p-0`,children:/* @__PURE__ */ (0,Y.jsxs)(ms,{defaultValue:`files`,className:`flex min-h-0 flex-col gap-0`,children:[/* @__PURE__ */ (0,Y.jsxs)(gs,{variant:`line`,className:`w-full shrink-0 px-2 any-pointer-coarse:h-auto any-pointer-coarse:[&_[data-slot=tabs-trigger]]:min-h-9`,children:[/* @__PURE__ */ (0,Y.jsxs)(_s,{value:`files`,children:[/* @__PURE__ */ (0,Y.jsx)(Ut,{}),`Files`,n>0&&/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:n})]}),/* @__PURE__ */ (0,Y.jsxs)(_s,{value:`log`,children:[/* @__PURE__ */ (0,Y.jsx)(Rt,{}),`Log`,r>0&&/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:r})]})]}),/* @__PURE__ */ (0,Y.jsx)(vs,{value:`files`,className:`min-h-0 overflow-y-auto px-2 py-1`,children:n===0?/* @__PURE__ */ (0,Y.jsx)(Ts,{children:`The agent has not written any files yet.`}):e.files.map(e=>/* @__PURE__ */ (0,Y.jsx)(Ss,{file:e},e.toolCallId))}),/* @__PURE__ */ (0,Y.jsx)(vs,{value:`log`,className:`min-h-0 overflow-y-auto px-2 py-1`,children:r===0?/* @__PURE__ */ (0,Y.jsx)(Ts,{children:`The agent has not run any commands yet.`}):e.commands.map(e=>/* @__PURE__ */ (0,Y.jsx)(Cs,{run:e},e.toolCallId))})]})})]})})}function Ts({children:e}){return/* @__PURE__ */ (0,Y.jsx)(`p`,{className:`px-1 py-2 text-xs text-muted-foreground italic`,children:e})}function Es({status:e}){if(e===`ready`)return null;let t=e===`starting`;return/* @__PURE__ */ (0,Y.jsxs)(Dt,{role:`status`,className:`w-full rounded-full border bg-muted/50 px-3 py-1.5`,children:[/* @__PURE__ */ (0,Y.jsx)(Jt,{children:t?/* @__PURE__ */ (0,Y.jsx)(bt,{}):/* @__PURE__ */ (0,Y.jsx)(Ft,{})}),/* @__PURE__ */ (0,Y.jsx)(Nt,{className:t?`shimmer`:void 0,children:t?`Starting the sandbox…`:`The sandbox could not be started`})]})}function Ds(e){return Object.keys(e).length>0?e:void 0}function Os(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`promptTokens`in e}function ks(e,t){return Os(e)?e:As(Array.isArray(e)?e:void 0,t)}function As(e,t){let n=e?.reduce((e,t)=>{for(let n of[`inputTokens`,`outputTokens`,`totalTokens`,`cachedInputTokens`,`cacheWriteInputTokens`,`reasoningTokens`])t[n]!==void 0&&(e[n]=(e[n]??0)+t[n]);return e},{});if((e===void 0||e.length===0)&&t==null)return;let{promptTokensDetails:r,completionTokensDetails:i,...a}=t??{},o=Ds({...n?.cachedInputTokens===void 0?{}:{cachedTokens:n.cachedInputTokens},...n?.cacheWriteInputTokens===void 0?{}:{cacheWriteTokens:n.cacheWriteInputTokens},...r}),s=Ds({...n?.reasoningTokens===void 0?{}:{reasoningTokens:n.reasoningTokens},...i});return{promptTokens:n?.inputTokens??0,completionTokens:n?.outputTokens??0,totalTokens:n?.totalTokens??0,...a,...o===void 0?{}:{promptTokensDetails:o},...s===void 0?{}:{completionTokensDetails:s}}}function js(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ms(e,t){if(t==null)return e;if(e==null)return{...t};let n={...e,...t};return js(e.tanstack)&&js(t.tanstack)&&(n.tanstack={...e.tanstack,...t.tanstack}),n}function X(e){if(e==null)return;let t=`metadata`in e?e.metadata:void 0,n=(typeof t==`object`&&t&&!Array.isArray(t)?t:e).tanstack;if(typeof n==`object`&&n&&!Array.isArray(n))return n}function Ns(e,t){let n=e.metadata,r=X(e)??{};return{...e,metadata:{...n??{},tanstack:{...r,...t}}}}let Z=/* @__PURE__ */ function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e.SUBAGENT_STARTED=`SUBAGENT_STARTED`,e.SUBAGENT_FINISHED=`SUBAGENT_FINISHED`,e.SUBAGENT_ERROR=`SUBAGENT_ERROR`,e}({});function Ps(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>Ps(e,t[n]));if(e===null||t===null||typeof e!=`object`||typeof t!=`object`||Array.isArray(e)||Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&Ps(Reflect.get(e,n),Reflect.get(t,n)))}function Fs(e,t){let n=0,r=()=>{for(;e[n]===` `||e[n]===` `||e[n]===`\r`||e[n]===`
1
+ import{$ as e,$n as t,A as n,Ar as r,At as i,B as a,C as o,Ct as s,D as c,Dn as l,Dr as u,E as d,Er as f,Et as p,F as m,G as h,Gn as g,Gt as _,Ht as v,I as y,It as b,Jn as x,Jt as S,L as C,Ln as w,Lt as T,Mt as E,N as D,O,On as k,Or as A,P as j,Pn as M,Qt as N,R as P,T as F,Tn as I,Tr as L,Tt as R,U as ee,V as z,Vt as B,W as te,Xn as ne,Yn as re,Zn as V,Zt as ie,_ as H,_r as ae,_t as oe,a as se,ar as ce,at as le,b as ue,br as U,cn as de,cr as fe,ct as pe,d as me,dn as he,dr as ge,er as _e,et as ve,f as ye,fr as be,h as xe,ht as W,i as G,ir as Se,j as Ce,jn as we,jr as Te,jt as Ee,k as De,l as Oe,ln as ke,lr as K,lt as Ae,m as je,mt as Me,n as q,nt as Ne,o as Pe,or as Fe,ot as Ie,p as Le,pr as Re,q as ze,qn as Be,qt as Ve,r as He,rr as Ue,rt as We,s as Ge,sr as Ke,t as qe,u as Je,un as Ye,ur as Xe,ut as Ze,vn as Qe,vt as $e,w as et,x as tt,xr as nt,xt as rt,y as it,z as at}from"./styles.generated-CW6iaZWa.js";import"./constants-C-Yp0Vhg.js";import{t as ot}from"./debug-DLDY8CZb.js";import{$t as st,A as ct,At as lt,B as ut,Bt as dt,Cn as ft,Ct as pt,Dn as mt,Dt as ht,En as gt,Et as _t,F as vt,Fn as yt,Ft as bt,G as xt,Gt as St,H as Ct,Ht as wt,I as Tt,In as Et,It as Dt,J as Ot,Jt as kt,K as At,Kt as jt,L as Mt,Lt as Nt,M as Pt,Mn as Ft,Mt as It,N as Lt,Nn as Rt,Nt as zt,On as Bt,Ot as Vt,P as Ht,Pn as Ut,Pt as Wt,Qt as Gt,R as Kt,Rn as qt,Rt as Jt,Sn as Yt,St as Xt,T as Zt,Tn as Qt,Tt as $t,U as en,Ut as tn,V as nn,Vt as rn,W as an,Wt as on,X as sn,Xt as cn,Y as ln,Yt as un,Z as dn,Zt as fn,_ as pn,_n as mn,a as hn,an as gn,at as _n,b as vn,bn as yn,bt as bn,c as xn,cn as Sn,ct as Cn,d as wn,dn as Tn,dt as En,en as Dn,et as On,f as kn,fn as An,ft as jn,g as Mn,gn as Nn,h as Pn,hn as Fn,ht as In,i as Ln,in as Rn,it as zn,j as Bn,jn as Vn,jt as Hn,kn as Un,kt as Wn,l as Gn,ln as Kn,lt as qn,mn as Jn,mt as Yn,n as Xn,nn as Zn,o as Qn,on as $n,ot as er,p as tr,pn as nr,pt as rr,q as ir,qt as ar,r as or,rn as sr,s as cr,sn as lr,st as ur,t as dr,tn as fr,u as pr,un as mr,ut as hr,v as gr,vt as _r,w as vr,wn as yr,wt as br,x as xr,xn as Sr,xt as Cr,y as wr,yt as Tr,z as Er,zt as Dr}from"./threads-CZIvwSRC.js";import{a as Or,d as kr,f as Ar,g as jr,h as Mr,i as Nr,l as Pr,m as Fr,n as Ir,o as Lr,p as Rr,r as zr,s as Br,t as Vr,u as Hr}from"./item-Dl9F5Xpc.js";var J=/* @__PURE__ */ Te(A(),1);const Ur=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,112H56l72-72Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z`}))]]),Wr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z`}))]]),Gr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),Kr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),qr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M225.6,62.64l-88-48.17a19.91,19.91,0,0,0-19.2,0l-88,48.17A20,20,0,0,0,20,80.19v95.62a20,20,0,0,0,10.4,17.55l88,48.17a19.89,19.89,0,0,0,19.2,0l88-48.17A20,20,0,0,0,236,175.81V80.19A20,20,0,0,0,225.6,62.64ZM128,36.57,200,76,128,115.4,56,76ZM44,96.79l72,39.4v76.67L44,173.44Zm96,116.07V136.19l72-39.4v76.65Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M128,129.09V232a8,8,0,0,1-3.84-1l-88-48.16a8,8,0,0,1-4.16-7V80.2a8,8,0,0,1,.7-3.27Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32h0l80.34,44L128,120,47.66,76ZM40,90l80,43.78v85.79L40,175.82Zm96,129.57V133.82L216,90v85.78Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,120,47.65,76,128,32l80.35,44Zm8,99.64V133.83l80-43.78v85.76Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M222.72,67.9l-88-48.17a13.9,13.9,0,0,0-13.44,0l-88,48.18A14,14,0,0,0,26,80.18v95.64a14,14,0,0,0,7.28,12.27l88,48.18a13.92,13.92,0,0,0,13.44,0l88-48.18A14,14,0,0,0,230,175.82V80.18A14,14,0,0,0,222.72,67.9ZM127,30.25a2,2,0,0,1,1.92,0L212.51,76,128,122.24,43.49,76ZM39,177.57a2,2,0,0,1-1-1.75V86.66l84,46V223Zm177.92,0L134,223V132.64l84-46v89.16A2,2,0,0,1,217,177.57Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M223.68,66.15,135.68,18h0a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32h0l80.34,44L128,120,47.66,76ZM40,90l80,43.78v85.79L40,175.82Zm96,129.57V133.82L216,90v85.78Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M221.76,69.66l-88-48.18a12,12,0,0,0-11.52,0l-88,48.18A12,12,0,0,0,28,80.18v95.64a12,12,0,0,0,6.24,10.52l88,48.18a11.95,11.95,0,0,0,11.52,0l88-48.18A12,12,0,0,0,228,175.82V80.18A12,12,0,0,0,221.76,69.66ZM126.08,28.5a3.94,3.94,0,0,1,3.84,0L216.67,76,128,124.52,39.33,76Zm-88,150.83A4,4,0,0,1,36,175.82V83.29l88,48.16v94.91Zm179.84,0-85.92,47V131.45l88-48.16v92.53A4,4,0,0,1,217.92,179.32Z`}))]]),Jr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),Yr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z`}))]]),Xr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M251,123.13c-.37-.81-9.13-20.26-28.48-39.61C196.63,57.67,164,44,128,44S59.37,57.67,33.51,83.52C14.16,102.87,5.4,122.32,5,123.13a12.08,12.08,0,0,0,0,9.75c.37.82,9.13,20.26,28.49,39.61C59.37,198.34,92,212,128,212s68.63-13.66,94.48-39.51c19.36-19.35,28.12-38.79,28.49-39.61A12.08,12.08,0,0,0,251,123.13Zm-46.06,33C183.47,177.27,157.59,188,128,188s-55.47-10.73-76.91-31.88A130.36,130.36,0,0,1,29.52,128,130.45,130.45,0,0,1,51.09,99.89C72.54,78.73,98.41,68,128,68s55.46,10.73,76.91,31.89A130.36,130.36,0,0,1,226.48,128,130.45,130.45,0,0,1,204.91,156.12ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,148Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Zm0,112a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M245.48,125.57c-.34-.78-8.66-19.23-27.24-37.81C201,70.54,171.38,50,128,50S55,70.54,37.76,87.76c-18.58,18.58-26.9,37-27.24,37.81a6,6,0,0,0,0,4.88c.34.77,8.66,19.22,27.24,37.8C55,185.47,84.62,206,128,206s73-20.53,90.24-37.75c18.58-18.58,26.9-37,27.24-37.8A6,6,0,0,0,245.48,125.57ZM128,194c-31.38,0-58.78-11.42-81.45-33.93A134.77,134.77,0,0,1,22.69,128,134.56,134.56,0,0,1,46.55,95.94C69.22,73.42,96.62,62,128,62s58.78,11.42,81.45,33.94A134.56,134.56,0,0,1,233.31,128C226.94,140.21,195,194,128,194Zm0-112a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M243.66,126.38c-.34-.76-8.52-18.89-26.83-37.2C199.87,72.22,170.7,52,128,52S56.13,72.22,39.17,89.18c-18.31,18.31-26.49,36.44-26.83,37.2a4.08,4.08,0,0,0,0,3.25c.34.77,8.52,18.89,26.83,37.2,17,17,46.14,37.17,88.83,37.17s71.87-20.21,88.83-37.17c18.31-18.31,26.49-36.43,26.83-37.2A4.08,4.08,0,0,0,243.66,126.38Zm-32.7,35c-23.07,23-51,34.62-83,34.62s-59.89-11.65-83-34.62A135.71,135.71,0,0,1,20.44,128,135.69,135.69,0,0,1,45,94.62C68.11,71.65,96,60,128,60s59.89,11.65,83,34.62A135.79,135.79,0,0,1,235.56,128,135.71,135.71,0,0,1,211,161.38ZM128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,80a36,36,0,1,1,36-36A36,36,0,0,1,128,164Z`}))]]),Zr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M180.49,143.51a12,12,0,0,1,0,17l-24,24a12,12,0,0,1-17-17L155,152l-15.52-15.51a12,12,0,1,1,17-17Zm-64-24a12,12,0,0,0-17,0l-24,24a12,12,0,0,0,0,17l24,24a12,12,0,0,0,17-17L101,152l15.52-15.51A12,12,0,0,0,116.49,119.51ZM220,88V216a20,20,0,0,1-20,20H56a20,20,0,0,1-20-20V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.52l56,56A12,12,0,0,1,220,88ZM160,57V80h23Zm36,155V104H148a12,12,0,0,1-12-12V44H60V212Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208,88H152V32Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M181.66,146.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32Zm-72-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L91.31,152l18.35-18.34A8,8,0,0,0,109.66,122.34ZM216,88V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm40,136V96H152a8,8,0,0,1-8-8V40H56V216H200Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34Zm-104,88a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L91.31,152Zm72-12.68-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32l24,24A8,8,0,0,1,181.66,157.66ZM152,88V44l44,44Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M180.24,147.76a6,6,0,0,1,0,8.48l-24,24a6,6,0,0,1-8.48-8.48L167.51,152l-19.75-19.76a6,6,0,1,1,8.48-8.48Zm-72-24a6,6,0,0,0-8.48,0l-24,24a6,6,0,0,0,0,8.48l24,24a6,6,0,1,0,8.48-8.48L88.49,152l19.75-19.76A6,6,0,0,0,108.24,123.76ZM214,88V216a14,14,0,0,1-14,14H56a14,14,0,0,1-14-14V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88Zm-56-6h35.52L158,46.48Zm44,134V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2V216a2,2,0,0,0,2,2H200A2,2,0,0,0,202,216Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M181.66,146.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L164.69,152l-18.35-18.34a8,8,0,0,1,11.32-11.32Zm-72-24a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L91.31,152l18.35-18.34A8,8,0,0,0,109.66,122.34ZM216,88V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Zm40,136V96H152a8,8,0,0,1-8-8V40H56V216H200Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M178.83,149.17a4,4,0,0,1,0,5.66l-24,24a4,4,0,0,1-5.66-5.66L170.34,152l-21.17-21.17a4,4,0,1,1,5.66-5.66Zm-72-24a4,4,0,0,0-5.66,0l-24,24a4,4,0,0,0,0,5.66l24,24a4,4,0,1,0,5.66-5.66L85.66,152l21.17-21.17A4,4,0,0,0,106.83,125.17ZM212,88V216a12,12,0,0,1-12,12H56a12,12,0,0,1-12-12V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-56-4h42.34L156,41.65Zm48,132V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H200A4,4,0,0,0,204,216Z`}))]]),Qr=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M48,180c0,8.67,5.49,16,12,16a10.27,10.27,0,0,0,7.33-3.43,12,12,0,1,1,17.34,16.6A34,34,0,0,1,60,220C40.15,220,24,202,24,180s16.15-40,36-40a34,34,0,0,1,24.67,10.83,12,12,0,1,1-17.34,16.6A10.27,10.27,0,0,0,60,164C53.49,164,48,171.31,48,180Zm97.51-5.71c-5.13-3.45-11.33-5.24-16.8-6.82a79.5,79.5,0,0,1-7.91-2.59c2.45-1.18,9.71-1.3,16.07.33A12,12,0,0,0,143,142a69.24,69.24,0,0,0-12-1.86c-9.93-.66-18,1.08-24.1,5.17a24.45,24.45,0,0,0-10.69,17.76c-1.1,8.74,2.48,16.27,10.11,21.19,4.78,3.09,10.36,4.7,15.75,6.26,3,.89,7.94,2.3,9.88,3.53a2,2,0,0,1-.22.71c-1.36,1.55-9.57,1.79-16.39-.06a12,12,0,0,0-6.45,23.11A63.73,63.73,0,0,0,125.09,220c6.47,0,13.74-1.17,19.74-5.15a24.73,24.73,0,0,0,10.95-18C157,187.53,153.32,179.53,145.51,174.27ZM216,140.68A12,12,0,0,0,200.7,148L192,172.3,183.3,148A12,12,0,1,0,160.7,156l20,56a12,12,0,0,0,22.6,0l20-56A12,12,0,0,0,216,140.68ZM36,108V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.51l56,56A12,12,0,0,1,220,88v20a12,12,0,1,1-24,0v-4H148a12,12,0,0,1-12-12V44H60v64a12,12,0,1,1-24,0ZM160,80h23L160,57Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208,88H152V32Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,0,1,85.78,206.4,30.06,30.06,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30.06,30.06,0,0,1,21.78,9.6,8,8,0,0,1-11.56,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.57,4.57,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.83-.56A8,8,0,0,0,142,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36A8,8,0,0,0,109.94,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.49,174.17,127.6,171.31Zm83.09-26.84a8,8,0,0,0-10.23,4.84L188,184.21l-12.47-34.9a8,8,0,0,0-15.07,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,210.69,144.47ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76a4,4,0,0,0,4,4H212a4,4,0,0,0,4-4V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44ZM48,180c0,11,7.18,20,16,20a14.18,14.18,0,0,0,10.06-4.5,8.21,8.21,0,0,1,10.9-.91,8,8,0,0,1,.82,11.81A30.06,30.06,0,0,1,64,216c-17.64,0-32-16.15-32-36s14.36-36,32-36a30,30,0,0,1,21.39,9.19,8.26,8.26,0,0,1,.73,11.09,8,8,0,0,1-11.9.38A14.17,14.17,0,0,0,64,160C55.18,160,48,169,48,180Zm103.81,16.31a20.82,20.82,0,0,1-9.19,15.23C137.43,215,131,216,125.13,216A61.14,61.14,0,0,1,110,214a8,8,0,1,1,4.3-15.41c4.38,1.2,14.95,2.7,19.55-.36.88-.59,1.83-1.52,2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56,20.56,0,0,1,9-14.95c11.84-8,30.71-3.31,32.83-2.76a8,8,0,0,1-4.07,15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54,4.54,0,0,0-2,3.67c-.12.9-.14,1.09,1.11,1.9,2.31,1.49,6.45,2.68,10.45,3.84C137.49,174.17,154.05,179,151.81,196.31ZM215.42,155l-19.89,55.68a8,8,0,0,1-15.06,0L160.58,155a8.21,8.21,0,0,1,4.5-10.45,8,8,0,0,1,10.45,4.76L188,184.21l12.47-34.9a8,8,0,0,1,10.45-4.76A8.23,8.23,0,0,1,215.42,155Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M46,180c0,12.13,8.07,22,18,22a16.24,16.24,0,0,0,11.67-5.28,6,6,0,0,1,8.66,8.3A28.06,28.06,0,0,1,64,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,64,158C54.07,158,46,167.86,46,180Zm81.05-6.77c-10.86-3.13-13.41-4.69-13-7.91a6.59,6.59,0,0,1,2.88-5.08c5.6-3.79,17.66-1.82,21.45-.84a6,6,0,0,0,3.06-11.6c-2-.53-20.1-5-31.21,2.48a18.61,18.61,0,0,0-8.08,13.54c-1.8,14.19,12.26,18.25,21.57,20.94,12.12,3.5,14.78,5.33,14.2,9.76a6.85,6.85,0,0,1-3,5.34c-5.61,3.73-17.48,1.64-21.19.62A6,6,0,0,0,110.48,212a59.41,59.41,0,0,0,14.68,2c5.49,0,11.54-.95,16.36-4.14a18.89,18.89,0,0,0,8.31-13.81C151.84,180.39,136.92,176.08,127.05,173.22Zm83-26.88a6,6,0,0,0-7.67,3.63L188,190.15,173.65,150a6,6,0,1,0-11.3,4l20,56a6,6,0,0,0,11.3,0l20-56A6,6,0,0,0,210,146.34ZM214,88v24a6,6,0,1,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,1,1-12,0V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.24,1.76l56,56A6,6,0,0,1,214,88Zm-20.49-6L158,46.48V82Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,0,1,85.78,206.4,30.06,30.06,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30.06,30.06,0,0,1,21.78,9.6,8,8,0,0,1-11.56,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.57,4.57,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56A8,8,0,0,0,142,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36A8,8,0,0,0,109.94,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.49,174.17,127.6,171.31Zm83.09-26.84a8,8,0,0,0-10.23,4.84L188,184.21l-12.47-34.9a8,8,0,0,0-15.07,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,210.69,144.47ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M44,180c0,13.23,9,24,20,24a18.15,18.15,0,0,0,13.11-5.9,4,4,0,1,1,5.78,5.54A26.11,26.11,0,0,1,64,212c-15.44,0-28-14.36-28-32s12.56-32,28-32a26.11,26.11,0,0,1,18.89,8.36,4,4,0,1,1-5.78,5.54A18.15,18.15,0,0,0,64,156C53,156,44,166.77,44,180Zm82.49-4.85c-10.53-3-15.08-4.91-14.42-10.08a8.51,8.51,0,0,1,3.75-6.49c6.25-4.23,18.77-2.24,23.06-1.11a4,4,0,0,0,2-7.74,61.11,61.11,0,0,0-10.47-1.61c-8.12-.54-14.54.75-19.1,3.82a16.66,16.66,0,0,0-7.22,12.13c-1.58,12.49,10.46,16,20.14,18.77,11.26,3.25,16.47,5.49,15.64,11.94a8.94,8.94,0,0,1-3.91,6.75c-6.27,4.17-18.61,2.05-22.83.88a4,4,0,1,0-2.15,7.7A57.89,57.89,0,0,0,125.19,212c5.18,0,10.83-.86,15.22-3.77a17,17,0,0,0,7.43-12.41C149.64,181.84,136.26,178,126.49,175.15Zm82.85-26.92a4,4,0,0,0-5.11,2.42L188,196.11l-16.23-45.46a4,4,0,1,0-7.54,2.7l20,56a4,4,0,0,0,7.54,0l20-56A4,4,0,0,0,209.34,148.23ZM212,88v24a4,4,0,0,1-8,0V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4v72a4,4,0,0,1-8,0V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-13.66-4L156,41.65V84Z`}))]]),$r=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M232.49,55.51l-32-32a12,12,0,0,0-17,0l-96,96A12,12,0,0,0,84,128v32a12,12,0,0,0,12,12h32a12,12,0,0,0,8.49-3.51l96-96A12,12,0,0,0,232.49,55.51ZM192,49l15,15L196,75,181,60Zm-69,99H108V133l56-56,15,15Zm105-7.43V208a20,20,0,0,1-20,20H48a20,20,0,0,1-20-20V48A20,20,0,0,1,48,28h67.43a12,12,0,0,1,0,24H52V204H204V140.57a12,12,0,0,1,24,0Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,88l-72,72H96V128l72-72Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M229.66,58.34l-32-32a8,8,0,0,0-11.32,0l-96,96A8,8,0,0,0,88,128v32a8,8,0,0,0,8,8h32a8,8,0,0,0,5.66-2.34l96-96A8,8,0,0,0,229.66,58.34ZM124.69,152H104V131.31l64-64L188.69,88ZM200,76.69,179.31,56,192,43.31,212.69,64ZM224,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h80a8,8,0,0,1,0,16H48V208H208V128a8,8,0,0,1,16,0Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h80a8,8,0,0,1,0,16H48V208H208V128a8,8,0,0,1,16,0Zm5.66-58.34-96,96A8,8,0,0,1,128,168H96a8,8,0,0,1-8-8V128a8,8,0,0,1,2.34-5.66l96-96a8,8,0,0,1,11.32,0l32,32A8,8,0,0,1,229.66,69.66Zm-17-5.66L192,43.31,179.31,56,200,76.69Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M228.24,59.76l-32-32a6,6,0,0,0-8.48,0l-96,96A6,6,0,0,0,90,128v32a6,6,0,0,0,6,6h32a6,6,0,0,0,4.24-1.76l96-96A6,6,0,0,0,228.24,59.76ZM125.51,154H102V130.49l66-66L191.51,88ZM200,79.51,176.49,56,192,40.49,215.51,64ZM222,128v80a14,14,0,0,1-14,14H48a14,14,0,0,1-14-14V48A14,14,0,0,1,48,34h80a6,6,0,0,1,0,12H48a2,2,0,0,0-2,2V208a2,2,0,0,0,2,2H208a2,2,0,0,0,2-2V128a6,6,0,0,1,12,0Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M229.66,58.34l-32-32a8,8,0,0,0-11.32,0l-96,96A8,8,0,0,0,88,128v32a8,8,0,0,0,8,8h32a8,8,0,0,0,5.66-2.34l96-96A8,8,0,0,0,229.66,58.34ZM124.69,152H104V131.31l64-64L188.69,88ZM200,76.69,179.31,56,192,43.31,212.69,64ZM224,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h80a8,8,0,0,1,0,16H48V208H208V128a8,8,0,0,1,16,0Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M226.83,61.17l-32-32a4,4,0,0,0-5.66,0l-96,96A4,4,0,0,0,92,128v32a4,4,0,0,0,4,4h32a4,4,0,0,0,2.83-1.17l96-96A4,4,0,0,0,226.83,61.17ZM126.34,156H100V129.66l68-68L194.34,88ZM200,82.34,173.66,56,192,37.66,218.34,64ZM220,128v80a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V48A12,12,0,0,1,48,36h80a4,4,0,0,1,0,8H48a4,4,0,0,0-4,4V208a4,4,0,0,0,4,4H208a4,4,0,0,0,4-4V128a4,4,0,0,1,8,0Z`}))]]),ei=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z`}))]]),ti=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),ni=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M244,128a12,12,0,0,1-12,12H207.42l-36.69,73.37A12,12,0,0,1,160,220h-.6a12,12,0,0,1-10.61-7.72L95,71.15,66.92,133A12,12,0,0,1,56,140H24a12,12,0,0,1,0-24H48.27L85.08,35a12,12,0,0,1,22.13.7l54.28,142.46,27.78-55.56A12,12,0,0,1,200,116h32A12,12,0,0,1,244,128Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M96,40l33.52,88H56Zm104,88H129.52L160,208Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M240,128a8,8,0,0,1-8,8H204.94l-37.78,75.58A8,8,0,0,1,160,216h-.4a8,8,0,0,1-7.08-5.14L95.35,60.76,63.28,131.31A8,8,0,0,1,56,136H24a8,8,0,0,1,0-16H50.85L88.72,36.69a8,8,0,0,1,14.76.46l57.51,151,31.85-63.71A8,8,0,0,1,200,120h32A8,8,0,0,1,240,128Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm-8,96H188.64L159,188a8,8,0,0,1-6.95,4h-.46a8,8,0,0,1-6.89-4.84L103,89.92,79,132a8,8,0,0,1-7,4H48a8,8,0,0,1,0-16H67.36L97.05,68a8,8,0,0,1,14.3.82L153,166.08l24-42.05a8,8,0,0,1,6.95-4h24a8,8,0,0,1,0,16Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M238,128a6,6,0,0,1-6,6H203.71l-38.34,76.68A6,6,0,0,1,160,214h-.3a6,6,0,0,1-5.31-3.85L95.51,55.57,61.46,130.48A6,6,0,0,1,56,134H24a6,6,0,0,1,0-12H52.14l38.4-84.48a6,6,0,0,1,11.07.34L160.74,193.1l33.89-67.78A6,6,0,0,1,200,122h32A6,6,0,0,1,238,128Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M240,128a8,8,0,0,1-8,8H204.94l-37.78,75.58A8,8,0,0,1,160,216h-.4a8,8,0,0,1-7.08-5.14L95.35,60.76,63.28,131.31A8,8,0,0,1,56,136H24a8,8,0,0,1,0-16H50.85L88.72,36.69a8,8,0,0,1,14.76.46l57.51,151,31.85-63.71A8,8,0,0,1,200,120h32A8,8,0,0,1,240,128Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M236,128a4,4,0,0,1-4,4H202.47l-38.89,77.79A4,4,0,0,1,160,212h-.2a4,4,0,0,1-3.54-2.58l-60.59-159-36,79.28A4,4,0,0,1,56,132H24a4,4,0,0,1,0-8H53.42L92.36,38.35a4,4,0,0,1,7.38.23L160.5,198.06l35.92-71.85A4,4,0,0,1,200,124h32A4,4,0,0,1,236,128Z`}))]]),ri=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M140,32V64a12,12,0,0,1-24,0V32a12,12,0,0,1,24,0Zm84,84H192a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24Zm-42.26,48.77a12,12,0,1,0-17,17l22.63,22.63a12,12,0,0,0,17-17ZM128,180a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V192A12,12,0,0,0,128,180ZM74.26,164.77,51.63,187.4a12,12,0,0,0,17,17l22.63-22.63a12,12,0,1,0-17-17ZM76,128a12,12,0,0,0-12-12H32a12,12,0,0,0,0,24H64A12,12,0,0,0,76,128ZM68.6,51.63a12,12,0,1,0-17,17L74.26,91.23a12,12,0,0,0,17-17Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm88,88H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM48,136a8,8,0,0,1,0-16H72a8,8,0,0,1,0,16Zm46.06,37.25-17,17a8,8,0,0,1-11.32-11.32l17-17a8,8,0,0,1,11.31,11.31Zm0-79.19a8,8,0,0,1-11.31,0l-17-17A8,8,0,0,1,77.09,65.77l17,17A8,8,0,0,1,94.06,94.06ZM136,208a8,8,0,0,1-16,0V184a8,8,0,0,1,16,0Zm0-136a8,8,0,0,1-16,0V48a8,8,0,0,1,16,0Zm54.23,118.23a8,8,0,0,1-11.32,0l-17-17a8,8,0,0,1,11.31-11.31l17,17A8,8,0,0,1,190.23,190.23ZM208,136H184a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M134,32V64a6,6,0,0,1-12,0V32a6,6,0,0,1,12,0Zm90,90H192a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12Zm-46.5,47A6,6,0,0,0,169,177.5l22.63,22.62a6,6,0,0,0,8.48-8.48ZM128,186a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V192A6,6,0,0,0,128,186ZM78.5,169,55.88,191.64a6,6,0,1,0,8.48,8.48L87,177.5A6,6,0,1,0,78.5,169ZM70,128a6,6,0,0,0-6-6H32a6,6,0,0,0,0,12H64A6,6,0,0,0,70,128ZM64.36,55.88a6,6,0,0,0-8.48,8.48L78.5,87A6,6,0,1,0,87,78.5Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm88,88H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M132,32V64a4,4,0,0,1-8,0V32a4,4,0,0,1,8,0Zm92,92H192a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8Zm-47.92,46.43a4,4,0,1,0-5.65,5.65l22.62,22.63a4,4,0,0,0,5.66-5.66ZM128,188a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V192A4,4,0,0,0,128,188ZM79.92,170.43,57.29,193.05A4,4,0,0,0,63,198.71l22.62-22.63a4,4,0,1,0-5.65-5.65ZM68,128a4,4,0,0,0-4-4H32a4,4,0,0,0,0,8H64A4,4,0,0,0,68,128ZM63,57.29A4,4,0,0,0,57.29,63L79.92,85.57a4,4,0,1,0,5.65-5.65Z`}))]]),ii=/* @__PURE__ */ new Map([[`bold`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),/* @__PURE__ */ J.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,/* @__PURE__ */ J.createElement(J.Fragment,null,/* @__PURE__ */ J.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),ai=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Ur}));ai.displayName=`ArrowUpIcon`;const oi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Wr}));oi.displayName=`ArrowsClockwiseIcon`;const si=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Gr}));si.displayName=`CaretUpIcon`;const ci=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Kr}));ci.displayName=`ClockCounterClockwiseIcon`;const li=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:qr}));li.displayName=`CubeIcon`;const ui=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Jr}));ui.displayName=`DotsThreeIcon`;const di=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Yr}));di.displayName=`DownloadSimpleIcon`;const fi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Xr}));fi.displayName=`EyeIcon`;const pi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Zr}));pi.displayName=`FileCodeIcon`;const mi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:Qr}));mi.displayName=`FileCsvIcon`;const hi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:$r}));hi.displayName=`NotePencilIcon`;const gi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:ei}));gi.displayName=`PaperclipIcon`;const _i=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:ti}));_i.displayName=`PencilSimpleIcon`;const vi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:ni}));vi.displayName=`PulseIcon`;const yi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:ri}));yi.displayName=`SpinnerGapIcon`;const bi=J.forwardRef((e,t)=>/* @__PURE__ */ J.createElement(L,{ref:t,...e,weights:ii}));bi.displayName=`StopIcon`;var xi=f(),Y=Be();const Si={reading:`uploading`,ready:`done`,error:`error`};function Ci({attachments:e,onRemove:t}){let n=(0,J.useRef)(null),r=e.at(-1)?.id;(0,J.useEffect)(()=>{let e=n.current;e&&(e.scrollLeft=e.scrollWidth)},[r]);let i=e.filter(e=>e.status===`error`);return e.length===0?null:/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`w-full min-w-0`,children:[i.length>0&&/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-sm text-destructive`,children:[/* @__PURE__ */ (0,Y.jsxs)(`span`,{children:[i.length,` `,i.length===1?`file could`:`files could`,` not be attached.`]}),/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,tooltip:`Review files`,onClick:()=>{let e=n.current?.querySelector(`[role="alert"]`);e?.scrollIntoView({block:`nearest`,inline:`nearest`}),e?.querySelector(`button`)?.focus()},children:/* @__PURE__ */ (0,Y.jsx)(fi,{})})]}),/* @__PURE__ */ (0,Y.jsx)(cn,{ref:n,className:`w-full`,children:e.map(e=>/* @__PURE__ */ (0,Y.jsxs)(jt,{size:`sm`,state:Si[e.status],role:e.status===`error`?`alert`:void 0,children:[/* @__PURE__ */ (0,Y.jsx)(St,{id:e.fileId,title:e.name,kind:e.kind,mimeType:e.mimeType}),/* @__PURE__ */ (0,Y.jsxs)(kt,{children:[/* @__PURE__ */ (0,Y.jsx)(fn,{title:e.name,children:e.name}),/* @__PURE__ */ (0,Y.jsx)(un,{children:e.error??lr(e.size)})]}),/* @__PURE__ */ (0,Y.jsx)(ar,{children:/* @__PURE__ */ (0,Y.jsx)(q,{"data-slot":`attachment-action`,type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${e.name}`,tooltip:`Remove attachment`,onClick:()=>t(e.id),children:/* @__PURE__ */ (0,Y.jsx)(Vn,{})})})]},e.id))})]})}function wi({title:e,actionsSlot:t,draft:n,onDraftChange:r,onSend:i,onStop:a,onRetry:o,retryLabel:s,showError:c,error:l,streamBusy:u,isBusy:d,threadLoading:f,authPending:p,authError:m,onAuthRetry:h,attachments:g,attachmentLimits:_,onAddFiles:v,onRemoveAttachment:y}){let b=(0,J.useId)(),S=(0,J.useRef)(null),[C,w]=(0,J.useState)(!1),T=p||m!==void 0||f,E=g.some(e=>e.status===`reading`),D=g.some(e=>e.status===`ready`),O=g.filter(e=>e.status!==`error`).length>=_.maxFiles,k=_.enabled&&!T,A=d||T||E||n.trim().length===0&&!D,j=e=>{k&&e&&e.length!==0&&v([...e])},M=e=>k&&(e?.types.includes(`Files`)??!1);return/* @__PURE__ */ (0,Y.jsxs)(`form`,{className:`w-full`,onSubmit:e=>{e.preventDefault(),A||i()},onDragOver:e=>{M(e.dataTransfer)&&(e.preventDefault(),w(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||w(!1)},onDrop:e=>{M(e.dataTransfer)&&(e.preventDefault(),w(!1),j(e.dataTransfer.files))},children:[c&&/* @__PURE__ */ (0,Y.jsxs)(mt,{variant:`destructive`,className:`mb-1.5 flex items-center gap-2 border-destructive/30 bg-destructive/5 py-1 has-data-[slot=alert-action]:pe-2.5`,children:[/* @__PURE__ */ (0,Y.jsxs)(Un,{className:`min-w-0 flex-1 text-xs text-pretty wrap-anywhere`,children:[/* @__PURE__ */ (0,Y.jsx)(`div`,{children:Rn(l)}),Sr(l)&&l.body?.reference&&/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`mt-0.5 text-muted-foreground`,children:[`Support reference: `,l.body.reference]})]}),o&&/* @__PURE__ */ (0,Y.jsx)(Bt,{className:`static shrink-0`,children:/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,variant:`outline`,size:`icon-sm`,tooltip:s,onClick:o,children:/* @__PURE__ */ (0,Y.jsx)(qt,{})})})]}),m&&/* @__PURE__ */ (0,Y.jsxs)(mt,{variant:`destructive`,className:`mb-1.5 flex items-center gap-2 border-destructive/30 bg-destructive/5 py-1 has-data-[slot=alert-action]:pe-2.5`,children:[/* @__PURE__ */ (0,Y.jsx)(Un,{className:`min-w-0 flex-1 text-xs text-pretty wrap-anywhere`,children:Sr(m)&&m.status===401?`The assistant's connection was rejected. Contact this app's support team.`:`The assistant could not verify your session. Retry or contact this app's support team.`}),h&&/* @__PURE__ */ (0,Y.jsx)(Bt,{className:`static shrink-0`,children:/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,variant:`outline`,size:`icon-sm`,tooltip:`Retry`,onClick:h,children:/* @__PURE__ */ (0,Y.jsx)(qt,{})})})]}),_.enabled&&/* @__PURE__ */ (0,Y.jsx)(`input`,{ref:S,type:`file`,multiple:!0,className:`sr-only`,accept:st(_),onChange:e=>{j(e.currentTarget.files),e.currentTarget.value=``}}),/* @__PURE__ */ (0,Y.jsxs)(yr,{className:x(`cursor-text`,C&&`border-ring ring-3 ring-ring/50`),children:[g.length>0&&/* @__PURE__ */ (0,Y.jsx)(Qt,{align:`block-start`,className:`py-1`,children:/* @__PURE__ */ (0,Y.jsx)(Ci,{attachments:g,onRemove:y})}),/* @__PURE__ */ (0,Y.jsx)(gt,{"aria-label":`Message`,"aria-describedby":b,className:`max-h-24 min-h-8 py-1.5 any-pointer-coarse:text-base`,placeholder:p?`Verifying your session…`:f?`Loading conversation…`:C?`Drop files to attach…`:`Message ${e}…`,disabled:T,value:n,onChange:e=>r(e.currentTarget.value),onPaste:e=>{k&&e.clipboardData.files.length!==0&&(e.preventDefault(),j(e.clipboardData.files))},onKeyDown:e=>{e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),A||i())}}),/* @__PURE__ */ (0,Y.jsxs)(Qt,{align:`block-end`,className:`pt-0 pb-1`,children:[_.enabled&&/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Attach files`,tooltip:O?`Up to ${_.maxFiles} files per message`:`Attach files`,disabled:T||O,onClick:()=>S.current?.click(),children:/* @__PURE__ */ (0,Y.jsx)(gi,{})}),t&&/* @__PURE__ */ (0,Y.jsx)(`slot`,{name:t}),u?/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,variant:`default`,size:`icon`,className:`ml-auto`,tooltip:`Stop`,onClick:e=>{e.detail<2&&a()},children:/* @__PURE__ */ (0,Y.jsx)(bi,{})}):/* @__PURE__ */ (0,Y.jsx)(q,{type:`submit`,variant:`default`,size:`icon`,className:`ml-auto`,tooltip:`Send`,disabled:A,children:/* @__PURE__ */ (0,Y.jsx)(ai,{})})]})]}),/* @__PURE__ */ (0,Y.jsxs)(`p`,{className:`mt-1 text-center text-xs text-muted-foreground`,children:[/* @__PURE__ */ (0,Y.jsx)(`span`,{id:b,children:`Enter to send, Shift+Enter for a new line.`}),` AI can make mistakes.`]})]})}const Ti=/*#__PURE__*/ J.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return V(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function Ei({sizing:e,panelId:t}){return e.enabled?/* @__PURE__ */ (0,Y.jsx)(Ti,{orientation:`vertical`,tabIndex:0,"aria-label":`Resize chat`,"aria-controls":t,"aria-valuemin":e.minimum,"aria-valuemax":e.maximum,"aria-valuenow":e.width,"aria-valuetext":`${e.width} pixels`,className:`absolute inset-y-0 start-0 z-20 w-2 touch-none cursor-col-resize border-s border-transparent hover:border-primary/20 focus-visible:[outline:2px_solid_var(--ring)] focus-visible:-outline-offset-2 any-pointer-coarse:inset-y-14 any-pointer-coarse:w-11`,onPointerDown:e.onPointerDown,onPointerMove:e.onPointerMove,onPointerUp:e.onPointerUp,onPointerCancel:e.cancelDrag,onLostPointerCapture:e.cancelDrag,onKeyDown:e.onKeyDown}):null}function Di(e){try{let t=JSON.parse(localStorage.getItem(e)??`null`);if(t&&typeof t==`object`&&`width`in t&&typeof t.width==`number`&&Number.isFinite(t.width)&&t.width>0)return t.width}catch{}return null}function Oi(e,t,n,r){e.style.setProperty(`width`,`${t}px`),e.setAttribute(`data-astralbeam-full-width`,String(t>=n)),r?.setAttribute(`aria-valuenow`,String(t)),r?.setAttribute(`aria-valuetext`,`${t} pixels`)}function ki(e,t){let n=`astralbeam:chat-size:v1${t.id?`:component:${encodeURIComponent(t.id)}`:``}${e.agentId?`:agent:${encodeURIComponent(e.agentId)}`:``}`,[r,i]=(0,J.useState)(()=>({key:n,value:Di(n)}));r.key!==n&&i({key:n,value:Di(n)});let a=r.key===n?r.value:null,[o,s]=(0,J.useState)({maximum:0,fallback:null,mobile:!1}),c=(0,J.useRef)(null),{resizeContainer:l,onClose:u,defaultWidth:d}=e,f=!!u;(0,J.useLayoutEffect)(()=>{let e=l?.()??t.parentElement;if(!e)return;let n=matchMedia(`(max-width: 900px)`),r=()=>{let r=getComputedStyle(e),i=f&&n.matches?window.innerWidth:e.clientWidth-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight),a=o.fallback??(t.getClientRects().length>0&&(t.offsetWidth>0||d!==void 0)?t.offsetWidth:null);i<=0||s(e=>{let t={maximum:i,fallback:e.fallback??a,mobile:f&&n.matches};return t.maximum===e.maximum&&t.fallback===e.fallback&&t.mobile===e.mobile?e:t})};r();let i=new ResizeObserver(r);return i.observe(e),o.fallback===null&&i.observe(t),n.addEventListener(`change`,r),()=>{i.disconnect(),n.removeEventListener(`change`,r)}},[t,l,f,d,o.fallback]);let p=Math.floor(o.maximum),m=Math.min(320,p),h=d===`100%`?p:d&&Number.isFinite(d)&&d>0?d:o.fallback??0,g=a??h,_=e=>Math.round(Math.min(p,Math.max(m,e))),v=o.mobile?p:_(g),y=e.resizable!==!1&&!o.mobile&&p>m,b=()=>{let e=c.current;e&&(c.current=null,Oi(t,v,p,e.element),e.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId))};(0,J.useLayoutEffect)(()=>{let e=t.style.getPropertyValue(`width`),n=t.style.getPropertyPriority(`width`),r=t.style.boxSizing,i=t.getAttribute(`data-astralbeam-full-width`);return t.style.setProperty(`box-sizing`,`border-box`),()=>{let a=c.current;c.current=null,a?.element.hasPointerCapture(a.pointerId)&&a.element.releasePointerCapture(a.pointerId),t.style.setProperty(`width`,e,n),t.style.setProperty(`box-sizing`,r),i===null?t.removeAttribute(`data-astralbeam-full-width`):t.setAttribute(`data-astralbeam-full-width`,i)}},[t]),(0,J.useLayoutEffect)(()=>{let e=c.current;e&&(!y||e.key!==n)&&(c.current=null,e.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId));let r=c.current?Math.round(Math.min(p,Math.max(m,c.current.next))):v;p>0&&o.fallback!==null&&Oi(t,r,p,e?.element)},[t,v,m,p,o.fallback,y,n]);let x=e=>{if(!y||!Number.isFinite(e))return;let t=_(e),r=t===_(h)?null:t;if(t!==v||r===null&&a!==null){i({key:n,value:r});try{r===null?localStorage.removeItem(n):localStorage.setItem(n,JSON.stringify({width:r}))}catch{}}};return{enabled:y,width:v,minimum:m,maximum:p,onPointerDown:e=>{y&&e.isPrimary&&e.button===0&&(e.preventDefault(),e.currentTarget.focus(),e.currentTarget.setPointerCapture(e.pointerId),c.current={element:e.currentTarget,key:n,pointerId:e.pointerId,x:e.clientX,width:v,next:v,direction:getComputedStyle(t).direction===`rtl`?1:-1,scale:t.getBoundingClientRect().width/t.offsetWidth})},onPointerMove:e=>{let n=c.current;n&&n.pointerId===e.pointerId&&(n.next=n.width+(e.clientX-n.x)*n.direction/n.scale,Oi(t,_(n.next),p,n.element))},onPointerUp:e=>{let t=c.current;t&&t.pointerId===e.pointerId&&(c.current=null,e.currentTarget.releasePointerCapture(e.pointerId),t.next!==t.width&&x(t.next))},cancelDrag:b,onKeyDown:e=>{let n=getComputedStyle(t).direction===`rtl`?1:-1,r=e.shiftKey?50:10;if(e.key===`ArrowLeft`)x(v-r*n);else if(e.key===`ArrowRight`)x(v+r*n);else if(e.key===`Home`)x(m);else if(e.key===`End`)x(p);else if(e.key===`Escape`&&c.current)b();else return;e.preventDefault()}}}function Ai({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[u,d]=J.useState(0),[f,p]=J.useState(0),m=u===0,h=j(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=k(t);if(m&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||l(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return ht(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(d(t),p(n))}),ge(()=>{!r&&!i&&(d(0),p(0))},[r,i]),ge(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(u+1,f+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,f,t]),O(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:f}),null}const ji=/*#__PURE__*/ J.createContext(void 0);function Mi(e){let t=J.useContext(ji);if(!e&&t===void 0)throw Error(K(27));return t}const Ni={...xe,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};var Pi=class extends H{constructor(e,t,n){let r=new it,i=Fi(e,r,t,n);super(i,Ii(r),Ni)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(F(this.state,e,t.trigger)))}};function Fi(e,t,n,r=!1){return{...je(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Ii(e){return{popupRef:/*#__PURE__*/ J.createRef(),backdropRef:/*#__PURE__*/ J.createRef(),internalBackdropRef:/*#__PURE__*/ J.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Li(e,t){let{children:r,open:i,defaultOpen:a=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:l=!1,modal:u=!0,actionsRef:f,handle:p,triggerId:m,defaultTriggerId:h=null}=t,g=e===`drawer`,_=e===`alert-dialog`,v=_?!0:u,y=_||l,b=_?`alertdialog`:`dialog`,x=Mi(!0),S={modal:v,disablePointerDismissal:y,nested:x!=null,role:b},C=De((e,t)=>new Pi({open:a,openProp:i,activeTriggerId:h,triggerIdProp:m,...S},e,t),!0);C.useControlledProp(`openProp`,i),C.useControlledProp(`triggerIdProp`,m),C.useSyncedValues(S),C.useContextCallback(`onOpenChange`,o),C.useContextCallback(`onOpenChangeComplete`,s);let w=C.useState(`open`),T=C.useState(`mounted`),E=C.useState(`payload`);n(C,w),d(C);let{forceUnmount:D}=c(w,C);J.useImperativeHandle(f,()=>({unmount:D,close:()=>C.setOpen(!1,R(Ae))}),[D,C]);let O=w||T||p!=null;return/*#__PURE__*/ (0,Y.jsxs)(ji.Provider,{value:C,children:[p&&/*#__PURE__*/ (0,Y.jsx)(tt,{handle:p,store:C}),O&&/*#__PURE__*/ (0,Y.jsx)(Ai,{store:C,parentContext:x?.context,isDrawer:g}),typeof r==`function`?r({payload:E}):r]})}function Ri(e){return Li(`alert-dialog`,e)}const zi=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Mi(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return V(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:ke,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Bi=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Mi(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Se({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,R(le,e.nativeEvent))}return V(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),Vi=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Mi(),c=w(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),V(`p`,e,{ref:t,props:[{id:c},o]})}),Hi=/*#__PURE__*/ J.createContext(void 0);function Ui(){let e=J.useContext(Hi);if(e===void 0)throw Error(K(26));return e}const Wi=`ArrowUp`,Gi=`ArrowDown`,Ki=`ArrowLeft`,qi=`ArrowRight`,Ji=/* @__PURE__ */ new Set([Wi,Gi,Ki,qi,`Home`,`End`]),Yi=[`Shift`,`Control`,`Alt`,`Meta`];function Xi(e){return U(e)&&e.tagName===`INPUT`}function Zi(e){return!!(Xi(e)&&e.selectionStart!=null||U(e)&&e.tagName===`TEXTAREA`)}function Qi(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=$i(e,t,`left`),a=ea(e),o=ea(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=$i(e,t,`top`),r=ea(e),i=ea(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function $i(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function ea(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const ta={...de,...Qe,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},na=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Mi(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Ui(),Ee({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?et(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=V(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...ue,hidden:!m,onKeyDown(e){Ji.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:ta});return/*#__PURE__*/ (0,Y.jsx)(tn,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),ra=/*#__PURE__*/ J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Mi(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?/*#__PURE__*/ (0,Y.jsx)(Hi.Provider,{value:n,children:/*#__PURE__*/ (0,Y.jsxs)(z,{ref:t,...r,children:[a&&o===!0&&/*#__PURE__*/ (0,Y.jsx)(_t,{ref:i.context.internalBackdropRef,inert:Dr(!s)}),e.children]})}):null}),ia=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Mi(),c=w(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),V(`h2`,e,{ref:t,props:[{id:c},o]})});function aa({...e}){return/* @__PURE__ */ (0,Y.jsx)(Ri,{"data-slot":`alert-dialog`,...e})}function oa({...e}){return/* @__PURE__ */ (0,Y.jsx)(ra,{"data-slot":`alert-dialog-portal`,...e})}function sa({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(zi,{"data-slot":`alert-dialog-overlay`,className:x(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function ca({className:e,size:t=`default`,container:n,...r}){return/* @__PURE__ */ (0,Y.jsxs)(oa,{container:n,children:[/* @__PURE__ */ (0,Y.jsx)(sa,{}),/* @__PURE__ */ (0,Y.jsx)(na,{"data-slot":`alert-dialog-content`,"data-size":t,className:x(`group/alert-dialog-content fixed top-1/2 start-1/2 z-50 grid w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] overflow-y-auto -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})]})}function la({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:x(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function ua({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(ia,{"data-slot":`alert-dialog-title`,className:x(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function da({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(Vi,{"data-slot":`alert-dialog-description`,className:x(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function fa({className:e,variant:t=`outline`,size:n=`default`,...r}){return/* @__PURE__ */ (0,Y.jsx)(Bi,{"data-slot":`alert-dialog-cancel`,className:x(e),render:/* @__PURE__ */ (0,Y.jsx)(g,{variant:t,size:n}),...r})}function pa({title:e,container:t,finalFocus:n,onDelete:r,onClose:i}){let[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!1);return/* @__PURE__ */ (0,Y.jsx)(aa,{open:!0,onOpenChange:e=>{!e&&!a&&i()},children:/* @__PURE__ */ (0,Y.jsxs)(ca,{container:t,finalFocus:n,className:`absolute max-h-[min(calc(100%-2rem),calc(100dvh-2rem))]`,children:[/* @__PURE__ */ (0,Y.jsx)(ua,{children:`Delete conversation?`}),/* @__PURE__ */ (0,Y.jsxs)(da,{className:`break-words`,children:[`Delete “`,e,`” and its messages? This cannot be undone.`]}),s&&/* @__PURE__ */ (0,Y.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:`Could not delete this conversation. Try again.`}),/* @__PURE__ */ (0,Y.jsxs)(la,{children:[/* @__PURE__ */ (0,Y.jsx)(fa,{className:`any-pointer-coarse:min-h-11 any-pointer-coarse:min-w-11`,disabled:a,children:`Cancel`}),/* @__PURE__ */ (0,Y.jsx)(g,{variant:`destructive`,className:`any-pointer-coarse:min-h-11 any-pointer-coarse:min-w-11`,disabled:a,onClick:()=>{o(!0),c(!1),r().then(e=>{o(!1),e?i():c(!0)})},children:a?`Deleting…`:`Delete conversation`})]})]})})}const ma=/*#__PURE__*/ J.createContext(void 0);function ha(e){let t=J.useContext(ma);if(t===void 0&&!e)throw Error(K(33));return t}const ga=/*#__PURE__*/ J.createContext(void 0);function _a(e){let t=J.useContext(ga);if(t===void 0&&!e)throw Error(K(36));return t}const va=/*#__PURE__*/ J.createContext(void 0);function ya(e=!0){let t=J.useContext(va);if(t===void 0&&!e)throw Error(K(25));return t}const ba=/*#__PURE__*/ J.createContext(null);function xa(e=`root`){let t=J.useContext(ba),n=J.useContext(ga);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}const Sa={visible:!0,ref:null};function Ca(){return Sa}function wa(e,t,n=`root`){let r=xa(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Ca)({label:e.label,children:e.children,render:e.render}),a=Ue(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Ta(e){e.preventDefault()}function Ea(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=_a(),u=ya(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return J.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Ta:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Me})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!M&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&ce(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}const Da={type:`regular-item`};function Oa(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=J.useRef(null),{getButtonProps:d,buttonRef:f}=Se({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Ea({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=J.useCallback(e=>Xe(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=Ue(u,f);return J.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}const ka=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=_a(),f=pt({guess:!0,label:a}),p=w(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=Oa({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Da});return V(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Aa=/*#__PURE__*/ J.forwardRef(function(e,t){let n=wa(e,t);return n.visible?/*#__PURE__*/ (0,Y.jsx)(ka,{...e,ref:n.ref}):null}),ja=/*#__PURE__*/ J.createContext(void 0);function Ma(e){let t=J.useContext(ja);if(t===void 0&&!e)throw Error(K(69));return t}const Na=/*#__PURE__*/ J.createContext(void 0);function Pa(){return J.useContext(Na)}function Fa(e,t){let n=ne(e.render);if(/*#__PURE__*/ J.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function Ia(e,t,n){let r=Fa(e,t),i=r===t?void 0:r;return[r,J.useCallback(e=>n?.(e?i:void 0),[i,n])]}function La(e,t,n){let r=ne(e.render),i=/*#__PURE__*/ J.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}const Ra=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=_a(),m=Pa(),{side:h,align:g}=ha(),_=Ma(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,I]=Ia(e,u,d),L=La(e,C,N),ee=w.type===`menu`?m:void 0,z=w.type===`context-menu`,B=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(B=()=>l.state.activeIndex===null&&P),Ee({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),J.useEffect(()=>{function e(e){l.setOpen(!1,R(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),me(D,{enabled:A&&!j&&!z&&w.type!==`menubar`,closeDelay:k});let te=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:ne,handleFocus:re}=(J.useContext(ba)?.useParentHandoff??Ba)(l,w,v,f),ie={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},H=V(`div`,e,{state:ie,ref:[t,l.context.popupRef,te,I],stateAttributesMapping:ke,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){ee?.onPopupKeyDown?.(e),_&&Ji.has(e.key)&&e.stopPropagation()},onFocus:re},se(y),c,{"data-rootownerid":E}]}),ae=w.type===void 0||z;(C||w.type===`menubar`&&T!==`outside-press`)&&(ae=!0);let oe=ee?.getReturnElement??ne;return/*#__PURE__*/ (0,Y.jsx)(tn,{context:D,openInteractionType:M,modal:z,disabled:!x,returnFocus:a??oe??ae,explicitReturnFocus:a===void 0&&oe?!1:void 0,initialFocus:B,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:H})}),za={parentVirtualFocusRef:void 0,handleFocus:void 0};function Ba(){return za}const Va=/*#__PURE__*/ J.forwardRef(function(e,t){let n=xa()?.Popup??Ra;return/*#__PURE__*/ (0,Y.jsx)(n,{...e,ref:t})}),Ha=/*#__PURE__*/ J.createContext(void 0);function Ua(){let e=J.useContext(Ha);if(e===void 0)throw Error(K(32));return e}const Wa=/*#__PURE__*/ J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=_a();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return/*#__PURE__*/ (0,Y.jsx)(Ha.Provider,{value:n,children:/*#__PURE__*/ (0,Y.jsx)(z,{ref:t,...r,portalOwnerRole:o})})});function Ga(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=J.useRef(null),o=J.useRef(null),s=E(r);ge(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),ge(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}const Ka=/*#__PURE__*/ J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=te,style:v,...y}=e,{store:b,virtualFocus:x,syncHighlightedItem:S}=_a(),C=Ua(),w=ya(!0),E=b.useState(`parent`),D=b.useState(`floatingRootContext`),O=b.useState(`floatingTreeRoot`),k=b.useState(`mounted`),A=b.useState(`open`),j=b.useState(`modal`),M=b.useState(`openMethod`),N=b.useState(`activeTriggerElement`),P=b.useState(`transitionStatus`),F=b.useState(`positionerElement`),I=b.useState(`instantType`),L=b.useState(`adaptiveOrigin`),ee=b.useState(`lastOpenChangeReason`),z=b.useState(`floatingNodeId`),B=b.useState(`floatingParentNodeId`),ne=D.useState(`domReferenceElement`),re=n,V=c,ie=l,H=s,ae=_;E.type===`context-menu`&&(re=n??E.context?.anchor,H??=`start`,!o&&H!==`center`&&(ie=e.alignOffset??2,V=e.sideOffset??-5));let oe=o,se=H;E.type===`menu`?(oe??=`inline-end`,se??=`start`,ae=e.collisionAvoidance??h):E.type===`menubar`&&(oe??=E.context.orientation===`vertical`?`inline-end`:`bottom`,se??=`start`);let ce=E.type===`context-menu`,le=Pe({anchor:re,floatingRootContext:D,positionMethod:w?`fixed`:r,mounted:k,side:oe,sideOffset:V,align:se,alignOffset:ie,arrowPadding:ce?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:z,keepMounted:C,disableAnchorTracking:g,collisionAvoidance:ae,shift:ce?{crossAxis:!(`side`in ae&&ae.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:O,adaptiveOrigin:L,lazyFlip:x?`placement`:!1});J.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===z&&b.set(`hoverEnabled`,!1),e.nodeId!==z&&e.parentNodeId===b.select(`floatingParentNodeId`)&&b.setOpen(!1,R(rt)))}return O.events.on(`menuopenchange`,e),()=>{O.events.off(`menuopenchange`,e)}},[b,O.events,z]),J.useEffect(()=>{if(b.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==b.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;b.setOpen(!1,R(t))}return O.events.on(`menuopenchange`,e),()=>{O.events.off(`menuopenchange`,e)}},[O.events,b]);let ue=T();J.useEffect(()=>{A||ue.clear()},[A,ue]),J.useEffect(()=>{function e(e){if(A&&e.nodeId===b.select(`floatingParentNodeId`)){if(e.target&&N&&N!==e.target){let e=b.select(`closeDelay`);e>0?ue.isStarted()||ue.start(e,()=>{b.setOpen(!1,R(rt))}):b.setOpen(!1,R(rt))}else ue.clear()}}return O.events.on(`itemhover`,e),()=>{O.events.off(`itemhover`,e)}},[O.events,A,N,b,ue]),J.useEffect(()=>{let e={open:A,nodeId:z,parentNodeId:B,reason:b.select(`lastOpenChangeReason`)};O.events.emit(`menuopenchange`,e)},[O.events,A,b,z,B]),Ga({store:b,domReference:ne,positionerElement:F,open:A});let U={open:A,side:le.side,align:le.align,anchorHidden:le.anchorHidden,nested:E.type===`menu`,instant:I},de=E.type===`menubar`&&E.context.modal;Cr(A&&(de||j&&ee!==`trigger-hover`),M===`touch`,F,N);let fe=G(e,U,{styles:le.positionerStyles,transitionStatus:P,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!k,inert:!A}),pe=k&&E.type!==`menu`&&(E.type!==`menubar`&&j&&ee!==`trigger-hover`||E.type===`menubar`&&E.context.modal),me=null;return E.type===`menubar`?me=E.context.contentElement:E.type===void 0&&(me=N),/*#__PURE__*/ (0,Y.jsxs)(ma.Provider,{value:le,children:[pe&&/*#__PURE__*/ (0,Y.jsx)(_t,{ref:E.type===`context-menu`||E.type===`nested-context-menu`?E.context.internalBackdropRef:null,inert:Dr(!A),cutout:me}),/*#__PURE__*/ (0,Y.jsx)(m,{id:z,children:/*#__PURE__*/ (0,Y.jsx)(Xt,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,onMapChange:S,children:fe})})]})}),qa=/*#__PURE__*/ J.createContext(null);function Ja(e){let t=J.useContext(qa);if(t===null&&!e)throw Error(K(5));return t}const Ya={...xe,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=xe.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>we&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!xe.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}};var Xa=class extends H{constructor(e,t,n=!1){let r=new it,i=Qa(r,t,n,e);super(i,Za(r),Ya),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Za(e){return{positionerRef:/*#__PURE__*/ J.createRef(),popupRef:/*#__PURE__*/ J.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:/*#__PURE__*/ J.createRef(),beforeTriggerFocusGuardRef:/*#__PURE__*/ J.createRef(),beforeContentFocusGuardRef:/*#__PURE__*/ J.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Qa(e,t,n=!1,r){return{...je(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:_e,inputProps:_e,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new a,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:_e,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}const $a=/*#__PURE__*/ J.createContext(null);function eo(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function to(e,t){return e===`list-navigation`||eo(e,t)}const no=e(function(e){let{children:n,open:r,onOpenChange:i,onOpenChangeComplete:a,onItemHighlighted:s,defaultOpen:l=!1,disabled:u=!1,modal:f,loopFocus:m=!0,orientation:h=`vertical`,actionsRef:g,closeParentOnEsc:_=!1,handle:v,triggerId:b,defaultTriggerId:x=null,highlightItemOnHover:S=!0,isSubmenu:k=!1,virtualFocus:A=!1,virtualFocusRef:M,allowEscape:N=!0,resetOnPointerLeave:I=!0}=e,L=ya(!0),ee=_a(!0),z=Ja(!0),B=ee?.store,te=ee?.virtualFocus??!1,ne=J.useMemo(()=>k&&B?{type:`menu`,store:B}:z?{type:`menubar`,context:z}:L&&!B?{type:`context-menu`,context:L}:{type:void 0},[L,B,z,k]),re=w(),V=w(),[ie,H]=J.useState(void 0),ae=(ie??V)||void 0,oe=P(),se=ne.type===`menu`?ne.store:void 0,ce=(r??l)&&se?.state.transitionStatus===`starting`,le=Re(()=>ce?se?.state.instantType:void 0).current,U=Re(()=>{let e=new Xa({open:l,openProp:r,activeTriggerId:x,triggerIdProp:b,parent:ne,disabled:u,highlightItemOnHover:S,modal:ne.type===void 0?f:void 0,rootId:re,instantType:le},ae,oe!=null);return e.context.virtualFocusRef=M,e}).current;U.useControlledProp(`openProp`,r),U.useControlledProp(`triggerIdProp`,b),U.useContextCallback(`onOpenChangeComplete`,a);let de=U.useState(`floatingTreeRoot`),fe=C(de),pe=U.useState(`open`),me=U.useState(`activeTriggerElement`),he=U.useState(`positionerElement`),ve=U.useState(`hoverEnabled`),ye=U.useState(`disabled`),xe=U.useState(`lastOpenChangeReason`),G=U.useState(`parent`),Se=U.useState(`activeIndex`),Ce=U.useState(`keyboardOpen`),we=U.useState(`payload`),Te=U.useState(`floatingParentNodeId`),Ee=J.useRef(null),De=J.useRef(G.type!==`context-menu`),Oe=T(),ke=J.useRef(!0),K=T(),je=Te!=null,{openMethod:Me,triggerProps:q}=br(pe);U.useSyncedValues({disabled:u,highlightItemOnHover:S,modal:G.type===void 0?f:void 0,openMethod:Me,rootId:re}),d(U);let{forceUnmount:Ne,transitionStatus:Pe}=c(pe,U,()=>{U.set(`allowMouseEnter`,!1)},ce),Fe=E(U.context.popupRef);J.useEffect(()=>{if(le===void 0)return;let e=()=>{U.state.instantType===le&&U.set(`instantType`,void 0)};if(!pe){e();return}if(Pe!==void 0)return;if(U.context.popupRef.current==null){e();return}let t=new AbortController;return Fe(e,t.signal),()=>{t.abort()}},[le,pe,Pe,Fe,U]),ge(()=>{L&&!ee?U.update({parent:{type:`context-menu`,context:L},floatingNodeId:fe,floatingParentNodeId:oe}):(ee||!U.select(`activeTriggerElement`))&&U.update({floatingNodeId:fe,floatingParentNodeId:oe})},[L,ee,fe,oe,me,U]),J.useEffect(()=>{pe||(Ee.current=null),G.type===`context-menu`&&(pe?Oe.start(500,()=>{De.current=!0}):(Oe.clear(),De.current=!1))},[Oe,pe,G.type]),ge(()=>{!pe&&!ve&&U.set(`hoverEnabled`,!0)},[pe,ve,U]);let Ie=be((e,t)=>{let n=t.reason;if(!e&&!U.select(`open`)||pe===e&&t.trigger===me&&xe===n)return;let r=o(t);if(!e&&t.trigger==null&&(t.trigger=me??void 0),i?.(e,t),t.isCanceled)return;U.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!ke.current)return;e&&n===`trigger-focus`?(ke.current=!1,K.start(300,()=>{ke.current=!0})):(ke.current=!0,K.clear());let s=!e&&(n===`escape-key`||n==null);Ee.current=t.event;let c=F(U.state,e,t.trigger,r());c.openChangeReason=n,c.keyboardOpen=e&&to(n,a),c.instantType=G.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:eo(n,a)?`click`:s?`dismiss`:void 0,U.update(c)}),Le=D({popupStore:U,floatingRootContext:U.state.floatingRootContext,floatingId:ae,nested:oe!=null,onOpenChange:Ie}),ze=Le.context.events;ge(()=>{let e=({open:e,eventDetails:t})=>Ie(e,t);return ze.on(`setOpen`,e),()=>{ze?.off(`setOpen`,e)}},[ze,Ie]),ge(()=>U.subscribeToParentMenu(),[U]);let Be=J.useCallback(()=>{U.setOpen(!1,R(Ae))},[U]);J.useImperativeHandle(g,()=>({unmount:Ne,close:Be}),[Ne,Be]);let Ve;G.type===`context-menu`&&(Ve=G.context),J.useImperativeHandle(Ve?.positionerRef,()=>he,[he]),J.useImperativeHandle(Ve?.actionsRef,()=>({setOpen:Ie}),[Ie]);let He=j(Le,{enabled:!ye,bubbles:{escapeKey:_&&G.type===`menu`},outsidePress(){return G.type!==`context-menu`||Ee.current?.type===`contextmenu`||De.current},externalTree:je?de:void 0}),Ue=Ge(),We=rn(Le,{enabled:!ye,listRef:U.context.itemDomElements,activeIndex:Se,virtual:A,nested:G.type===`menubar`||!A&&G.type!==void 0,parentOrientation:G.type===`menubar`?G.context.orientation:void 0,loopFocus:m,focusItemOnOpen:A?Ce:void 0,allowEscape:A&&m&&N,orientation:h,triggerOrientation:A?`vertical`:h,rtl:Ue===`rtl`,disabledIndices:t,onNavigate(e,t){U.setActiveIndex(e,bn(t),t?.nativeEvent)},openOnArrowKeyDown:G.type!==`context-menu`&&!(A&&k),externalTree:!A&&je?de:void 0,nestedReturnFocusRef:se?.context.virtualFocusRef,focusItemOnHover:S,resetOnPointerLeave:I}),Ke=J.useCallback(e=>{U.context.typingRef.current=e},[U]),qe=dt(Le,{enabled:!ye&&!A,listRef:U.context.itemLabels,elementsRef:U.context.itemDomElements,activeIndex:Se,resetMs:500,onMatch:(e,t)=>{pe&&e!==Se&&U.setActiveIndex(e,W,t.nativeEvent)},onTyping:Ke}),Je=be(s),Ye=J.useRef(-1),Ze=be(()=>{let e=U.state.activeIndex,t=e===null?void 0:U.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ye.current===n&&U.context.reportedItem===t)return;Ye.current=n,U.context.reportedItem=t,A&&U.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=U.context;U.context.highlightReason=$e,U.context.highlightEvent=void 0,s&&Je(t,p(r,i,{label:t===void 0?void 0:U.context.itemLabels.current[n]??void 0}))});ge(()=>{Ze()},[Se,Ze]);let Qe=J.useMemo(()=>{if(!A)return We.reference;if(!We.trigger)return _e;let{onFocus:e,...t}=We.trigger;return t},[A,We.reference,We.trigger]);U.useSyncedValue(`inputProps`,A?We.reference??_e:_e);let et=J.useMemo(()=>{let e=Xe(qe.reference,Qe,He.reference,{onMouseMove(){U.set(`allowMouseEnter`,!0)}},q);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=pe,e},[U,qe.reference,Qe,He.reference,q,pe]),nt=J.useMemo(()=>{let e=Xe(We.trigger,He.trigger,q);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[We.trigger,He.trigger,q]);Re(()=>(U.update({inactiveTriggerProps:nt}),null));let rt=J.useMemo(()=>Xe(ue,{onMouseMove(){U.set(`allowMouseEnter`,!0),G.type===`menu`&&U.set(`hoverEnabled`,!1)},onClick(){U.select(`hoverEnabled`)&&U.set(`hoverEnabled`,!1)},onKeyDown(e){let t=U.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},qe.floating,We.floating,He.floating),[G.type,U,qe.floating,We.floating,He.floating]),it=We.item??_e;O(U,{floatingRootContext:Le,activeTriggerProps:et,inactiveTriggerProps:nt,popupProps:rt,itemProps:it});let at=J.useMemo(()=>({store:U,parent:ne,orientation:h,loopFocus:m,allowEscape:N,defaultFloatingId:V,setRenderedFloatingId:H,virtualFocus:A,parentVirtualFocus:te,syncHighlightedItem:Ze}),[U,ne,h,m,N,V,A,te,Ze]),ot=typeof n==`function`?n({payload:we}):n,st=/*#__PURE__*/ (0,Y.jsxs)(ga.Provider,{value:at,children:[v&&/*#__PURE__*/ (0,Y.jsx)(tt,{handle:v,store:U}),ot]});return(G.type===void 0||G.type===`context-menu`)&&(st=/*#__PURE__*/ (0,Y.jsx)(y,{externalTree:de,children:st})),st});function ro(e){let t=J.useContext($a);if(t===null)return/*#__PURE__*/ (0,Y.jsx)(no,{...e});let n=t.Root;return/*#__PURE__*/ (0,Y.jsx)($a.Provider,{value:null,children:/*#__PURE__*/ (0,Y.jsx)(n,{...t.options,...e})})}function io(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=fe(),{ref:i,index:a}=pt(e),o=n===a,s=J.useRef(null),c=Ue(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function ao(e){let{render:n,className:r,style:i,state:a=_e,props:o=t,refs:s=t,metadata:c,stateAttributesMapping:l,tag:u=`div`,...d}=e,{compositeProps:f,compositeRef:p}=io({metadata:c});return V(u,e,{state:a,ref:[p,...s],props:[f,...o,d],stateAttributesMapping:l})}function oo(e){if(U(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!nt(e))return oo(ae(e))}var so=/* @__PURE__ */ Te(u(),1);function co(e,t){function n(n,r,i){let a=n.currentTarget;so.flushSync(()=>{e.setOpen(!1,R(pe,n.nativeEvent,a))}),B(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&v(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function lo(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=J.useRef(!1);return J.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Fe(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:_e,[t,n,r])}const uo=ve(function(e,t){let{render:n,className:r,style:i,disabled:o=!1,nativeButton:s=!0,id:c,openOnHover:u,delay:d=100,closeDelay:f=0,handle:p,payload:m,...h}=e,g=_a(!0),_=Le(p)??g?.store;if(!_)throw Error(K(85));let v=w(c),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`triggerControlsId`,v),E=J.useRef(null),D=po(),O=fe(!0),k=at(),A=J.useMemo(()=>k??new a,[k]),j=C(A),M=P(),{registerTrigger:N,isMountedByThisTrigger:F}=Ce(v,E,_,{payload:m,closeDelay:f,parent:D,floatingTreeRoot:A,floatingNodeId:j,floatingParentNodeId:M,keyboardEventRelay:O?.relayKeyboardEvent}),I=D.type===`menubar`,L=_.useState(`disabled`),R=o||L||I&&D.context.disabled,{getButtonProps:ee,buttonRef:z}=Se({disabled:R,native:s});J.useEffect(()=>{!x&&D.type===void 0&&(_.context.allowMouseUpTriggerRef.current=!1)},[_,x,D.type]);let B=J.useRef(null),te=T(),ne=be(e=>{if(!B.current)return;te.clear(),_.context.allowMouseUpTriggerRef.current=!1;let t=e.target;l(B.current,t)||l(_.select(`positionerElement`),t)||t===B.current||(t==null||oo(t)!==_.select(`rootId`))&&(Tr(e,B.current)||A.events.emit(`close`,{domEvent:e,reason:We}))});J.useEffect(()=>{let e=Fe(B.current);if(x&&_.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,ne,{once:!0}),()=>{e.removeEventListener(`mouseup`,ne)}},[x,ne,_]);let re=I&&D.context.hasSubmenuOpen,ie=Je(b,{enabled:(u??re)&&!R&&(!I||re&&!F),handleClose:Oe({blockPointerEvents:!I}),mouseOnly:!0,move:!1,restMs:D.type===void 0?d:void 0,delay:{close:f},triggerElementRef:E,externalTree:A,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`}),H=fo(x,_.select(`lastOpenChangeReason`)),ae=wt(b,{enabled:!R,event:x&&I?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0&&H}),oe=ye(b,{enabled:!R&&re}),se=lo({open:x,enabled:I,mouseDownAction:`open`}),ce=J.useMemo(()=>Xe(oe.reference,ae.reference),[oe.reference,ae.reference]),le=_.useState(`triggerProps`,F),ue=_.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:U,handleFocusTargetFocus:de}=co(_,E),pe={disabled:R,open:x},me=[B,t,z,N,E],he=[ce,ie??_e,le,{"aria-haspopup":`menu`,"aria-controls":S,id:v,onMouseDown:e=>{_.select(`open`)||(te.start(200,()=>{_.context.allowMouseUpTriggerRef.current=!0}),Fe(e.currentTarget).addEventListener(`mouseup`,ne,{once:!0}))}},ue,I?{role:`menuitem`}:{},se,h,ee],ge=V(`button`,e,{enabled:!I,stateAttributesMapping:Ye,state:pe,ref:me,props:he});return I?/*#__PURE__*/ (0,Y.jsx)(ao,{tag:`button`,render:n,className:r,style:i,state:pe,refs:me,props:he,stateAttributesMapping:Ye}):x?/*#__PURE__*/ (0,Y.jsxs)(J.Fragment,{children:[/*#__PURE__*/ (0,Y.jsx)(ze,{ref:_.context.beforeTriggerFocusGuardRef,onFocus:U},`${v}-pre-focus-guard`),/*#__PURE__*/ (0,Y.jsx)(J.Fragment,{children:ge},v),/*#__PURE__*/ (0,Y.jsx)(ze,{ref:_.context.triggerFocusTargetRef,onFocus:de},`${v}-post-focus-guard`)]}):/*#__PURE__*/ (0,Y.jsx)(J.Fragment,{children:ge},v)});function fo(e,t){let n=T(),[r,i]=J.useState(!1);return ge(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function po(){let e=Ja(!0);return J.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function mo(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function ho({...e}){return/* @__PURE__ */ (0,Y.jsx)(ro,{"data-slot":`dropdown-menu`,...e})}function go({...e}){return/* @__PURE__ */ (0,Y.jsx)(uo,{"data-slot":`dropdown-menu-trigger`,...e})}function _o({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,container:a,...o}){return/* @__PURE__ */ (0,Y.jsx)(Wa,{container:a,children:/* @__PURE__ */ (0,Y.jsx)(Ka,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:/* @__PURE__ */ (0,Y.jsx)(Va,{"data-slot":`dropdown-menu-content`,className:x(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...o})})})}function vo({className:e,inset:t,variant:n=`default`,...r}){return/* @__PURE__ */ (0,Y.jsx)(Aa,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:x(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function yo({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(Ti,{"data-slot":`dropdown-menu-separator`,className:x(`-mx-1 my-1 h-px bg-border`,e),...t})}function bo({chat:e,state:t,thread:n,onDelete:r}){let i=(0,J.useRef)(null),[a,o]=(0,J.useState)(!1),s=(0,J.useRef)(null),c=(0,J.useRef)(null),[l,u]=(0,J.useState)(!1),[d,f]=(0,J.useState)(``),[p,m]=(0,J.useState)(!1),[h,g]=(0,J.useState)(!1),_=n.title??``,v=n.role===`manager`&&t.status!==`submitted`&&t.status!==`streaming`;return(0,J.useEffect)(()=>{l&&requestAnimationFrame(()=>c.current?.select())},[l]),(0,J.useEffect)(()=>{if(!h)return;let e=setTimeout(()=>g(!1),2e3);return()=>clearTimeout(e)},[h]),/* @__PURE__ */ (0,Y.jsxs)(`div`,{ref:s,"data-slot":`conversation-title`,className:`shrink-0 border-b`,children:[a&&/* @__PURE__ */ (0,Y.jsx)(pa,{title:_||`Untitled`,container:s,finalFocus:i,onClose:()=>o(!1),onDelete:async()=>{let t=await e.deleteThread();return t&&r(n.id),t}}),/* @__PURE__ */ (0,Y.jsx)(`div`,{className:`flex h-10 items-center gap-1 px-4 any-pointer-coarse:min-h-11`,children:l?/* @__PURE__ */ (0,Y.jsxs)(`form`,{className:`flex min-w-0 flex-1 gap-1`,onSubmit:t=>{t.preventDefault(),d.trim()&&(m(!0),e.renameThread(d.trim()).then(e=>{m(!1),e&&(u(!1),requestAnimationFrame(()=>i.current?.focus()))}))},children:[/* @__PURE__ */ (0,Y.jsx)(Ne,{ref:c,"aria-label":`Conversation title`,className:`h-7 any-pointer-coarse:min-h-11`,value:d,maxLength:200,disabled:p,onChange:e=>f(e.currentTarget.value),onKeyDown:e=>{e.key===`Escape`&&(u(!1),requestAnimationFrame(()=>i.current?.focus()))}}),/* @__PURE__ */ (0,Y.jsx)(q,{type:`button`,size:`icon-sm`,variant:`ghost`,tooltip:`Cancel`,disabled:p,onClick:()=>{u(!1),requestAnimationFrame(()=>i.current?.focus())},children:/* @__PURE__ */ (0,Y.jsx)(Vn,{})}),/* @__PURE__ */ (0,Y.jsx)(q,{type:`submit`,size:`icon-sm`,tooltip:p?`Saving…`:`Save`,disabled:!d.trim()||p,children:p?/* @__PURE__ */ (0,Y.jsx)(bt,{}):/* @__PURE__ */ (0,Y.jsx)(Et,{})})]}):/* @__PURE__ */ (0,Y.jsxs)(Y.Fragment,{children:[/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,title:_,children:_}),h&&/* @__PURE__ */ (0,Y.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Copied`}),/* @__PURE__ */ (0,Y.jsxs)(ho,{children:[/* @__PURE__ */ (0,Y.jsx)(go,{ref:i,render:/* @__PURE__ */ (0,Y.jsx)(q,{tooltip:`Conversation actions`,variant:`ghost`,size:`icon-sm`}),children:/* @__PURE__ */ (0,Y.jsx)(ui,{})}),/* @__PURE__ */ (0,Y.jsxs)(_o,{container:s,align:`end`,className:`w-40`,children:[/* @__PURE__ */ (0,Y.jsxs)(vo,{className:`any-pointer-coarse:min-h-11`,disabled:!v,onClick:()=>{f(n.title??``),u(!0)},children:[/* @__PURE__ */ (0,Y.jsx)(_i,{}),`Rename`]}),/* @__PURE__ */ (0,Y.jsxs)(vo,{className:`any-pointer-coarse:min-h-11`,disabled:t.messages.length===0,onClick:()=>{navigator.clipboard.writeText(Tn(_,t.messages)).then(()=>g(!0))},children:[/* @__PURE__ */ (0,Y.jsx)(yt,{}),`Copy Markdown`]}),/* @__PURE__ */ (0,Y.jsx)(yo,{}),/* @__PURE__ */ (0,Y.jsxs)(vo,{className:`any-pointer-coarse:min-h-11`,variant:`destructive`,disabled:!v,onClick:()=>o(!0),children:[/* @__PURE__ */ (0,Y.jsx)(Mr,{}),`Delete`]})]})]})]})})]})}var xo=class extends En{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Yn(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&jn(t.mutationKey)!==jn(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??qn();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){hr.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function So(e,t){let n=_r(t),[r]=J.useState(()=>new xo(n,e));J.useEffect(()=>{r.setOptions(e)},[r,e]);let i=J.useSyncExternalStore(J.useCallback(e=>r.subscribe(hr.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=J.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(rr)},[r]);if(i.error&&In(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}const Co=/*#__PURE__*/ J.createContext(void 0);function wo(e){let t=J.useContext(Co);if(t===void 0&&!e)throw Error(K(47));return t}const To={...xe,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!xe.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&xe.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>xe.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};var Eo=class extends H{constructor(e,t,n){let r=new it;super(Do(e,r,t,n),Oo(r),To)}setOpen=(e,t)=>{let n=t.reason===s,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=o(t),c=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&c!=null&&(t.trigger=this.context.triggerElements.getById(c)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let l=()=>{let n=F(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),so.flushSync(l)):l();let u;r?u=`click`:i?u=`dismiss`:t.reason===`focus-out`&&(u=`focus`),this.set(`instantType`,u)}};function Do(e,t,n,r=!1){let i={...je(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function Oo(e){return{popupRef:/*#__PURE__*/ J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:/*#__PURE__*/ J.createRef(),beforeTriggerFocusGuardRef:/*#__PURE__*/ J.createRef(),beforeContentFocusGuardRef:/*#__PURE__*/ J.createRef(),stickIfOpenTimeout:new b,stickIfOpen:!0,triggerElements:e}}const ko=e(function({props:e}){let{children:t,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,modal:s=!1,handle:l,triggerId:u,defaultTriggerId:f=null}=e,p=jo(l,{modal:s,open:i,openProp:r,activeTriggerId:f,triggerIdProp:u});p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u);let m=p.useState(`open`),h=p.useState(`mounted`),g=p.useState(`payload`);p.useContextCallback(`onOpenChange`,a),p.useContextCallback(`onOpenChangeComplete`,o),n(p,m),d(p);let{forceUnmount:_}=c(m,p,()=>{p.context.stickIfOpen=!0,p.set(`openChangeReason`,null)});p.useSyncedValues({modal:s}),J.useEffect(()=>{m||p.context.stickIfOpenTimeout.clear()},[p,m]),J.useImperativeHandle(e.actionsRef,()=>({unmount:_,close:()=>p.setOpen(!1,R(Ae))}),[_,p]);let v=m||h||l!=null;return/*#__PURE__*/ (0,Y.jsxs)(Co.Provider,{value:p,children:[l&&/*#__PURE__*/ (0,Y.jsx)(tt,{handle:l,store:p}),v&&/*#__PURE__*/ (0,Y.jsx)(Mo,{store:p,modal:s}),typeof t==`function`?t({payload:g}):t]})});function Ao(e){return wo(!0)?/*#__PURE__*/ (0,Y.jsx)(ko,{props:e}):/*#__PURE__*/ (0,Y.jsx)(y,{children:/*#__PURE__*/ (0,Y.jsx)(ko,{props:e})})}function jo(e,t){let n=De((e,n)=>new Eo(t,e,n));return J.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function Mo({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=j(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference,a=r.floating;return O(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}const No=ve(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=wo(!0),h=Le(s)??m;if(!h)throw Error(K(74));let g=w(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=J.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=Ce(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=h.useState(`isPressOpenedByTrigger`,g),E=h.useState(`isTouchPressOpen`,l),D=h.useState(`hasTriggerFocusGuards`,g),O=Je(v,{enabled:!a&&l&&!E,mouseOnly:!0,move:!1,handleClose:Oe(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),k=be(()=>h.context.stickIfOpen),A=wt(v,{stickIfOpen:k}),j=$t(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,C),{getButtonProps:N,buttonRef:P}=Se({disabled:a,native:o}),F={open(e){return T?Ye.open(e):he.open(e)}},{handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=co(h,x),R=V(`button`,e,{state:{disabled:a,open:y},ref:[P,t,S,x],props:[A.reference,O,M,j,{[ee]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,N],stateAttributesMapping:F}),z=/*#__PURE__*/ (0,Y.jsx)(J.Fragment,{children:R},g);return D?/*#__PURE__*/ (0,Y.jsxs)(J.Fragment,{children:[/*#__PURE__*/ (0,Y.jsx)(ze,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:I}),z,/*#__PURE__*/ (0,Y.jsx)(ze,{ref:h.context.triggerFocusTargetRef,onFocus:L})]}):z}),Po=/*#__PURE__*/ J.createContext(void 0);function Fo(){let e=J.useContext(Po);if(e===void 0)throw Error(K(45));return e}const Io=/*#__PURE__*/ J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return wo().useState(`mounted`)||n?/*#__PURE__*/ (0,Y.jsx)(Po.Provider,{value:n,children:/*#__PURE__*/ (0,Y.jsx)(z,{ref:t,...r})}):null}),Lo=/*#__PURE__*/ J.createContext(void 0);function Ro(){let e=J.useContext(Lo);if(!e)throw Error(K(46));return e}const zo=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:g,disableAnchorTracking:_=!1,collisionAvoidance:v=h,...y}=e,b=wo(),x=Fo(),S=C(),w=b.useState(`floatingRootContext`),T=b.useState(`mounted`),E=b.useState(`open`),D=b.useState(`openChangeReason`),O=b.useState(`activeTriggerElement`),k=b.useState(`modal`),A=b.useState(`openMethod`),j=b.useState(`positionerElement`),M=b.useState(`instantType`),N=b.useState(`transitionStatus`),P=b.useState(`adaptiveOrigin`),F=Pe({anchor:a,floatingRootContext:w,positionMethod:o,mounted:T,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:g,disableAnchorTracking:_,keepMounted:x,nodeId:S,collisionAvoidance:v,adaptiveOrigin:P});Ga({store:b,domReference:w.useState(`domReferenceElement`),positionerElement:j,open:E});let I=k===!0&&D!==`trigger-hover`;Cr(E&&I,A===`touch`,j,O);let L=b.useStateSetter(`positionerElement`),R={open:E,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:M},ee=G(e,R,{styles:F.positionerStyles,transitionStatus:N,props:y,refs:[t,L],hidden:!T,inert:!E});return/*#__PURE__*/ (0,Y.jsxs)(Lo.Provider,{value:F,children:[T&&I&&/*#__PURE__*/ (0,Y.jsx)(_t,{inert:Dr(!E),cutout:O}),/*#__PURE__*/ (0,Y.jsx)(m,{id:S,children:ee})]})}),Bo=/*#__PURE__*/ J.createContext(void 0);function Vo(){let[e,t]=J.useState(0),n=be(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:J.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const Ho=/*#__PURE__*/ J.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=wo(),l=Ro(),u=Ma(!0)!=null,{context:d,hasClosePart:f}=Vo(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);Ee({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),me(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?et(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M={open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},N=V(`div`,e,{state:M,ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...ue,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&Ji.has(e.key)&&e.stopPropagation()}},se(g),s],stateAttributesMapping:ke});return/*#__PURE__*/ (0,Y.jsx)(tn,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:U(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:/*#__PURE__*/ (0,Y.jsx)(Bo.Provider,{value:d,children:N})})});function Uo({...e}){return/* @__PURE__ */ (0,Y.jsx)(Ao,{"data-slot":`popover`,...e})}function Wo({...e}){return/* @__PURE__ */ (0,Y.jsx)(No,{"data-slot":`popover-trigger`,...e})}function Go({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,container:a,collisionBoundary:o,...s}){return/* @__PURE__ */ (0,Y.jsx)(Io,{container:a,children:/* @__PURE__ */ (0,Y.jsx)(zo,{align:t,alignOffset:n,side:r,sideOffset:i,collisionBoundary:o,className:`isolate z-50`,children:/* @__PURE__ */ (0,Y.jsx)(Ho,{"data-slot":`popover-content`,className:x(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s})})})}function Ko({chat:e,state:t}){let n=(0,J.useId)(),r=(0,J.useRef)(null),[i]=(0,J.useState)(()=>new Cn),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(),[l,u]=(0,J.useState)(null),[d,f]=(0,J.useState)(),p=t.auth.status===`ready`&&t.auth.currentUser.scope===`tenant`?t.auth.currentUser:null,m=ur({queryKey:[`mcp-connections`,p?.organization.id,p?.tenant.id,p?.user.id],enabled:a&&!!p,queryFn:()=>e.getMcpCatalog(),retry:!1},i),h=So({mutationFn:t=>t.action===`authorize`?e.authorizeMcpConnection(t):e.manageMcpConnection(t),onMutate:e=>{f(`mcpServerId`in e?e.mcpServerId:m.data?.connections.find(t=>t.id===e.id)?.mcp_server_id)},onSuccess:()=>u(null),onSettled:()=>m.refetch()},i);if(!p)return null;let _=h.isPending,v=m.isError?void 0:m.data?.servers,y=_?{authorize:`Waiting for sign-in…`,test:`Testing connection…`,disconnect:`Disconnecting…`,connect:`Enabling…`,headers:`Saving credentials…`}[h.variables.action]:null,b=h.isError?h.error.message:h.isSuccess?h.variables.action===`test`&&h.data&&`tool_count`in h.data?`${h.data.tool_count} tools available.`:h.variables.action===`disconnect`?`Disconnected locally.`:`Connection saved.`:null;return/* @__PURE__ */ (0,Y.jsx)(`div`,{ref:r,children:/* @__PURE__ */ (0,Y.jsxs)(Uo,{open:a,onOpenChange:e=>{o(e),e&&c(r.current?.closest(`[data-slot="chat"]`)??void 0)},children:[/* @__PURE__ */ (0,Y.jsx)(Wo,{render:/* @__PURE__ */ (0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,tooltip:`MCP connections`}),children:/* @__PURE__ */ (0,Y.jsx)(jr,{})}),/* @__PURE__ */ (0,Y.jsxs)(Go,{container:r,collisionBoundary:s,align:`end`,"aria-labelledby":`${n}-title`,className:`max-h-(--available-height) w-[min(24rem,85vw)] max-w-(--available-width) gap-0 overflow-hidden p-0`,children:[/* @__PURE__ */ (0,Y.jsx)(`header`,{className:`shrink-0 border-b px-3 py-2`,children:/* @__PURE__ */ (0,Y.jsx)(`h2`,{id:`${n}-title`,className:`font-semibold`,children:`MCP connections`})}),/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`max-h-[24rem] min-h-0 divide-y overflow-y-auto overscroll-contain`,children:[m.isPending&&/* @__PURE__ */ (0,Y.jsx)(`p`,{role:`status`,className:`px-3 py-2 text-xs`,children:`Loading servers…`}),m.isError&&/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`px-3 py-2`,children:[/* @__PURE__ */ (0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:m.error.message}),/* @__PURE__ */ (0,Y.jsx)(g,{size:`sm`,className:`any-pointer-coarse:min-h-11 any-pointer-coarse:min-w-11`,onClick:()=>void m.refetch(),children:`Try again`})]}),v?.length===0&&/* @__PURE__ */ (0,Y.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:`No MCP servers are available.`}),v?.map(e=>{let r=m.data?.connections.find(t=>t.mcp_server_id===e.id),i=r?.auth_state===`connected`,a=e.auth_kind===`none`,o=d===e.id,s=_&&o?yi:jr,c=new URL(e.endpoint_url),f=a?`Disable`:r?.auth_state===`disconnected`?`Remove connection`:`Disconnect`,p=e.auth_kind?{none:[`Enable`,`Enable`],oauth:[`Connect`,`Reconnect`],static_headers:[`Connect`,`Replace credentials`]}[e.auth_kind]:null;return/* @__PURE__ */ (0,Y.jsxs)(Vr,{render:/* @__PURE__ */ (0,Y.jsx)(`article`,{}),size:`xs`,"data-slot":`mcp-connection`,className:`rounded-none border-0 py-1.5`,children:[/* @__PURE__ */ (0,Y.jsx)(Or,{variant:`icon`,className:`text-muted-foreground`,children:/* @__PURE__ */ (0,Y.jsx)(s,{"aria-hidden":`true`,className:_&&o?`animate-spin`:void 0})}),/* @__PURE__ */ (0,Y.jsxs)(zr,{className:`min-w-0`,title:e.endpoint_url,children:[/* @__PURE__ */ (0,Y.jsx)(`h3`,{className:`truncate text-sm font-medium`,children:c.hostname}),/* @__PURE__ */ (0,Y.jsxs)(Nr,{role:`status`,className:`line-clamp-none truncate`,children:[o&&y?y:o&&h.isError&&h.variables.action===`test`?`Connection failed`:i?a?`Enabled`:`Connected`:r?.auth_state===`reauthorization_required`?`Reconnect needed`:a?`Disabled`:`Not connected`,` · `,c.pathname,c.search]})]}),l!==e.id&&/* @__PURE__ */ (0,Y.jsxs)(Ir,{className:`shrink-0 gap-0.5`,children:[p&&!(a&&i)&&/* @__PURE__ */ (0,Y.jsx)(q,{size:i?`icon-sm`:`xs`,variant:i?`ghost`:`outline`,"aria-label":`${p[+!!i]}: ${c.hostname}`,tooltip:p[+!!i],disabled:_,onClick:()=>e.auth_kind===`oauth`?h.mutate({action:`authorize`,mcpServerId:e.id,...r?{id:r.id}:{}}):e.auth_kind===`static_headers`?u(e.id):h.mutate({action:`connect`,mcpServerId:e.id}),children:i?/* @__PURE__ */ (0,Y.jsx)(oi,{}):p[0]}),i&&r&&/* @__PURE__ */ (0,Y.jsx)(q,{size:`icon-sm`,variant:`ghost`,"aria-label":`Test connection: ${c.hostname}`,tooltip:`Test connection`,disabled:_,onClick:()=>h.mutate({action:`test`,id:r.id}),children:/* @__PURE__ */ (0,Y.jsx)(vi,{})}),r&&/* @__PURE__ */ (0,Y.jsx)(q,{size:`icon-sm`,variant:`ghost`,"aria-label":`${f}: ${c.hostname}`,tooltip:f,disabled:_,onClick:()=>h.mutate({action:`disconnect`,id:r.id}),children:/* @__PURE__ */ (0,Y.jsx)(Vn,{})})]}),!e.auth_kind&&/* @__PURE__ */ (0,Y.jsx)(`p`,{className:`basis-full text-xs text-destructive`,children:`Configuration unavailable. Contact your administrator.`}),l===e.id&&/* @__PURE__ */ (0,Y.jsx)(`form`,{className:`grid basis-full gap-2`,onSubmit:t=>{t.preventDefault();let n=new FormData(t.currentTarget);h.mutate({action:`headers`,mcpServerId:e.id,headers:Object.fromEntries(e.header_names.map(e=>[e,n.get(e)]))})},children:/* @__PURE__ */ (0,Y.jsxs)(`fieldset`,{disabled:_,className:`grid gap-2`,children:[e.header_names.map(t=>/* @__PURE__ */ (0,Y.jsxs)(Lr,{className:`gap-1`,children:[/* @__PURE__ */ (0,Y.jsxs)(Pr,{className:`text-xs`,htmlFor:`${n}-${e.id}-${t}`,children:[t,` value`]}),/* @__PURE__ */ (0,Y.jsx)(Ne,{className:`any-pointer-coarse:min-h-11 any-pointer-coarse:text-base`,id:`${n}-${e.id}-${t}`,name:t,type:`password`,autoComplete:`off`,required:!0,"aria-describedby":t.toLowerCase()===`authorization`?`${n}-authorization-help`:void 0}),t.toLowerCase()===`authorization`&&/* @__PURE__ */ (0,Y.jsx)(Br,{id:`${n}-authorization-help`,className:`text-xs`,children:`Enter the full value, including Bearer before the token when required.`})]},t)),/* @__PURE__ */ (0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Saved secrets are never shown. Enter every value to replace them.`}),/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,Y.jsx)(g,{type:`submit`,size:`sm`,className:`any-pointer-coarse:min-h-11 any-pointer-coarse:min-w-11`,children:`Save credentials`}),/* @__PURE__ */ (0,Y.jsx)(g,{type:`button`,size:`sm`,className:`any-pointer-coarse:min-h-11 any-pointer-coarse:min-w-11`,variant:`outline`,onClick:()=>u(null),children:`Cancel`})]})]})}),o&&b&&/* @__PURE__ */ (0,Y.jsx)(`p`,{"data-slot":`mcp-notice`,role:h.isError?`alert`:`status`,className:h.isError?`basis-full text-xs text-destructive`:`basis-full text-xs text-muted-foreground`,children:b}),i&&r&&t.unavailableMcpConnections?.includes(r.id)&&/* @__PURE__ */ (0,Y.jsx)(`p`,{className:`basis-full text-xs text-muted-foreground`,children:`Unavailable in the last chat. Test the connection or reconnect.`})]},e.id)})]})]})]})})}function qo(e){let{loopFocus:n=!0,orientation:r=`both`,grid:i,onLoop:a,direction:o,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:d,disabledIndices:f,modifierKeys:p=t}=e,[m,h]=J.useState(0),g=i!=null,v=J.useRef(null),y=Ue(v,l),b=J.useRef([]),x=J.useRef(!1),C=J.useRef(null),w=s??m,T=be((e,t=!1)=>{if(C.current=b.current[e]??null,(c??h)(e),t){let t=b.current[e];Qi(v.current,t,o,r)}}),E=be(e=>{if(e.size===0)return;if(x.current){let e=b.current,t=e.indexOf(C.current);if(t===-1){let t=e[w];!t||N(e,w,f)?T(Jo(e,f)):C.current=t}else t!==w&&T(t);return}x.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=n?e.get(n)?.index??-1:-1;if(i!==-1)T(i);else if(N(t,w,f)){let e=_(t,{disabledIndices:f});ie(t,e)||T(e)}Qi(v.current,n,o,r)});ge(()=>{if(f==null||s!=null||!x.current)return;let e=b.current;if(N(e,w,f)){let t=_(e,{disabledIndices:f});ie(e,t)||T(t)}},[f,s,w,b,T]);let D=be((e,t,n)=>a?a(e,t,n,b):n),O=be(e=>{let t=e.key===`Home`||e.key===`End`;if(!Ji.has(e.key)||!u&&t||Yo(e,p)||!v.current)return;let s=o===`rtl`,c=s?Ki:qi,l=s?qi:Ki,m=r===`vertical`?Gi:c,h=r===`vertical`?Wi:l,y=k(e.nativeEvent);if(y!=null&&Zi(y)&&!mo(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==h&&t<r.length||e.key!==m&&t>0)return}let x=w,C=S(b,f),E=Ve(b,f);i!=null&&(x=i({disabledIndices:f,elementsRef:b,event:e,highlightedIndex:w,loopFocus:n,maxIndex:E,minIndex:C,onLoop:D,orientation:r,rtl:s}));let O=r!==`vertical`&&e.key===c||r!==`horizontal`&&e.key===`ArrowDown`,A=r!==`vertical`&&e.key===l||r!==`horizontal`&&e.key===`ArrowUp`;u&&(e.key===`Home`?x=C:e.key===`End`&&(x=E)),x===w&&(O||A)&&(n&&x===E&&O?(x=C,a&&(x=a(e,w,x,b))):n&&x===C&&A?(x=E,a&&(x=a(e,w,x,b))):x=_(b.current,{startingIndex:x,decrement:A,disabledIndices:f})),x!==w&&!ie(b.current,x)&&(d&&e.stopPropagation(),(g||t||O||A)&&e.preventDefault(),T(x,!0),queueMicrotask(()=>{b.current[x]?.focus()}))});return{props:{ref:y,onFocus(e){let t=v.current,n=k(e.nativeEvent);t&&n!=null&&Zi(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:O},highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:b,onMapChange:E,relayKeyboardEvent:O}}function Jo(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!N(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function Yo(e,t){for(let n of Yi)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Xo(e){let{render:n,className:r,style:i,refs:a=t,props:o=t,state:s=_e,stateAttributesMapping:c,highlightedIndex:l,onHighlightedIndexChange:u,orientation:d,grid:f,loopFocus:p,onLoop:m,enableHomeAndEndKeys:h,onMapChange:g,stopEventPropagation:_=!0,rootRef:v,disabledIndices:y,modifierKeys:b,highlightItemOnHover:x=!1,tag:S=`div`,...C}=e,{props:w,highlightedIndex:T,onHighlightedIndexChange:E,elementsRef:D,onMapChange:O,relayKeyboardEvent:k}=qo({grid:f,loopFocus:p,onLoop:m,orientation:d,highlightedIndex:l,onHighlightedIndexChange:u,rootRef:v,stopEventPropagation:_,enableHomeAndEndKeys:h,direction:Ge(),disabledIndices:y,modifierKeys:b}),A=V(S,e,{state:s,ref:a,props:[w,...o,C],stateAttributesMapping:c}),j=J.useMemo(()=>({highlightedIndex:T,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:k}),[T,E,x,k]);return/*#__PURE__*/ (0,Y.jsx)(Ke.Provider,{value:j,children:/*#__PURE__*/ (0,Y.jsx)(Xt,{elementsRef:D,onMapChange:e=>{g?.(e),O(e)},children:A})})}const Zo=/*#__PURE__*/ J.createContext(void 0);function Qo(){let e=J.useContext(Zo);if(e===void 0)throw Error(K(64));return e}const $o={tabActivationDirection:e=>({"data-activation-direction":e})},es=/*#__PURE__*/ J.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=J.useRef([]),[f,p]=J.useState(()=>/* @__PURE__ */ new Map),[m,h]=Wt({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=J.useState(()=>/* @__PURE__ */ new Map),y=J.useRef(void 0),b=J.useCallback(e=>ts(_,e),[_]),[x,S]=J.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:C,tabActivationDirection:w}=x,T=w,E=!1;C!==m&&(T=ns(C,m,a,_),E=C!=null&&m!=null&&b(m)==null);let D=E?C:m,O=C!==D||w!==T;ge(()=>{O&&S({previousValue:D,tabActivationDirection:T})},[D,O,T]);let k=be((e,t)=>{t.activationDirection=ns(m,e,a,_),i?.(e,t),!t.isCanceled&&h(()=>e)}),A=be((e,t)=>{i?.(e,R(t,void 0,void 0,{activationDirection:`none`}))}),j=be((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),M=J.useCallback(e=>f.get(e),[f]),N=J.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),P=J.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:N,getTabPanelIdByValue:M,onValueChange:k,orientation:a,registerMountedTabPanel:j,setTabMap:v,tabActivationDirection:T,value:m}),[b,N,M,k,a,j,v,T,m]),F=J.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),I=J.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),L=J.useRef(!u),ee=J.useRef(r),z=J.useRef(u),B=J.useRef(!1);ge(()=>{if(g)return;function e(e,t){h(()=>e),S({previousValue:e,tabActivationDirection:`none`}),A(e,t),L.current=!1}if(_.size===0){B.current&&m!==null&&!y.current?.isConnected&&e(null,oe);return}B.current=!0,y.current=_.keys().next().value;let t=F?.disabled,n=F==null&&m!==null;if(!t&&m===ee.current&&(z.current=!1),z.current&&t&&m===ee.current)return;let r=L.current;if(t||n){let n=I??null;if(m===n){L.current=!1;return}let i=oe;r?i=Ze:t&&(i=Ie),e(n,i)}else r&&F!=null&&(A(m,Ze),L.current=!1)},[I,g,A,F,h,_,m]);let te=V(`div`,e,{state:{orientation:a,tabActivationDirection:T},ref:t,props:l,stateAttributesMapping:$o});return/*#__PURE__*/ (0,Y.jsx)(Zo.Provider,{value:P,children:/*#__PURE__*/ (0,Y.jsx)(Xt,{elementsRef:d,children:te})})});function ts(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function ns(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=ts(r,e),c=ts(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}const rs=/*#__PURE__*/ J.createContext(void 0);function is(){let e=J.useContext(rs);if(e===void 0)throw Error(K(65));return e}const as=/*#__PURE__*/ J.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...u}=e,{value:d,getTabPanelIdByValue:f,onValueChange:p,orientation:m,tabActivationDirection:h}=Qo(),{activateOnFocus:g,registerTabResizeObserverElement:_,tabsListElement:v}=is(),{highlightedIndex:y,onHighlightedIndexChange:b}=fe(),x=w(o),{compositeProps:S,compositeRef:C,index:T}=io({metadata:J.useMemo(()=>({disabled:r,id:x,value:a}),[r,x,a])}),E=a===d,D=J.useRef(!1),O=J.useRef(null),k=be(e=>{O.current?.(),O.current=e?_(e):null});ge(()=>{if(D.current){D.current=!1;return}if(!(E&&T>-1&&y!==T))return;let e=v;if(e!=null){let t=I(Fe(e));if(t&&l(e,t))return}r||b(T)},[E,T,y,b,r,v]);let{getButtonProps:A,buttonRef:j}=Se({disabled:r,native:s,focusableWhenDisabled:!0}),M=f(a),N=J.useRef(!1),P=J.useRef(!1);function F(e){p(a,R($e,e.nativeEvent,void 0,{activationDirection:`none`}))}function L(e){E||r||F(e)}function ee(e){E||r||g&&(!N.current||P.current)&&F(e)}function z(e){if(E||r)return;N.current=!0,P.current=e.button===0;let t=Fe(e.currentTarget);function n(){N.current=!1,P.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return V(`button`,e,{state:{disabled:r,active:E,orientation:m,tabActivationDirection:h},ref:[t,j,C,k],props:[S,{role:`tab`,"aria-controls":M,"aria-selected":E,id:x,onClick:L,onFocus:ee,onPointerDown:z,"data-composite-item-active":E?``:void 0,onKeyDownCapture(){D.current=!0}},u,A],stateAttributesMapping:$o})}),os={...$o,...Qe},ss=/*#__PURE__*/ J.forwardRef(function(e,t){let{className:n,value:r,render:a,keepMounted:o=!1,style:s,...c}=e,{value:l,getTabIdByPanelValue:u,orientation:d,tabActivationDirection:f,registerMountedTabPanel:p}=Qo(),m=w(),{ref:h,index:g}=pt(),_=r===l,{mounted:v,transitionStatus:y,setMounted:b}=i(_),x=!v,S=u(r),C={hidden:x,orientation:d,tabActivationDirection:f,transitionStatus:y},T=J.useRef(null),E=V(`div`,e,{state:C,ref:[t,h,T],props:[{"aria-labelledby":S,hidden:x,id:m,role:`tabpanel`,tabIndex:_?0:-1,inert:Dr(!_),"data-index":g},c],stateAttributesMapping:os});return Ee({open:_,ref:T,onComplete(){_||b(!1)}}),ge(()=>{if(!(m==null||x&&!o))return p(r,m)},[x,o,r,m,p]),o||v?E:null}),cs=/*#__PURE__*/ J.forwardRef(function(e,n){let{activateOnFocus:r=!1,className:i,loopFocus:a=!0,render:o,style:s,...c}=e,{orientation:l,setTabMap:u,tabActivationDirection:d}=Qo(),[f,p]=J.useState(0),[m,h]=J.useState(null),g=J.useRef(/* @__PURE__ */ new Set),_=J.useRef(/* @__PURE__ */ new Set),v=J.useRef(null);ge(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{g.current.forEach(e=>{e()})});return v.current=e,m&&e.observe(m),_.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),v.current=null}},[m]);let y=be(e=>(g.current.add(e),()=>{g.current.delete(e)})),b=be(e=>(_.current.add(e),v.current?.observe(e),()=>{_.current.delete(e),v.current?.unobserve(e)})),x={orientation:l,tabActivationDirection:d},S={"aria-orientation":l===`vertical`?`vertical`:void 0,role:`tablist`},C=J.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:b,tabsListElement:m}),[r,y,b,m]);return/*#__PURE__*/ (0,Y.jsx)(rs.Provider,{value:C,children:/*#__PURE__*/ (0,Y.jsx)(Xo,{render:o,className:i,style:s,state:x,refs:[n,h],props:[S,c],stateAttributesMapping:$o,highlightedIndex:f,enableHomeAndEndKeys:!0,loopFocus:a,orientation:l,onHighlightedIndexChange:p,onMapChange:u,disabledIndices:t})})});function ls(e,t){let n=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),r=Math.round((n(t)-n(new Date(e)))/864e5);return r<=0?`Today`:r===1?`Yesterday`:r<7?`Previous 7 days`:r<30?`Previous 30 days`:`Older`}function us(e){let t=/* @__PURE__ */ new Date,n=[];for(let r of e){let e=ls(r.updatedAt,t),i=n.at(-1);i?.value===e?i.items.push(r):n.push({value:e,items:[r]})}return n}const ds=e=>e.title||`Untitled`,fs=e=>e.stopPropagation();function ps({chat:e,state:t,onSelect:n,onDelete:r}){let i=(0,J.useRef)(null),[a,o]=(0,J.useState)(null),s=(0,J.useRef)(null),c=(0,J.useRef)(null),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(!1),[p,m]=(0,J.useState)(!1),[h,g]=(0,J.useState)(),[_]=On(l.trim(),{wait:300}),[v]=(0,J.useState)(()=>new Cn);(0,J.useEffect)(()=>(v.mount(),()=>{v.unmount(),v.clear()}),[v]);let y=t.auth.status===`ready`,b=er({queryKey:[`thread-history`,_],enabled:d&&y&&!p,initialPageParam:void 0,queryFn:({signal:t,pageParam:n})=>e.searchThreads(_,n,t).catch(e=>{throw Sr(e)&&[401,403,404].includes(e.status)&&m(!0),e}),getNextPageParam:e=>e.page_after??void 0,retry:!1,staleTime:3e4,gcTime:3e5},v),S=t.thread?.id,C=t.thread?.version,w=t.status===`submitted`||t.status===`streaming`;(0,J.useEffect)(()=>{(t.auth.status===`error`||p)&&v.removeQueries({queryKey:[`thread-history`]})},[v,t.auth.status,p]),(0,J.useEffect)(()=>{w||v.invalidateQueries({queryKey:[`thread-history`]})},[v,S,C,w]);let T=!p&&(l.trim()!==_||b.isPending),E=p||!T&&b.isError,{hasNextPage:D,isFetching:O,isError:k,fetchNextPage:A}=b;(0,J.useEffect)(()=>{let e=c.current;if(!d||!e||T||!D||O||k)return;let t=()=>{e.scrollHeight-e.scrollTop-e.clientHeight<48&&A({cancelRefetch:!1})};return t(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)},[d,T,D,O,k,A,b.data]);let j=!y||p||T?[]:us(b.data?.pages.flatMap(e=>e.items)??[]);return/* @__PURE__ */ (0,Y.jsxs)(`div`,{ref:s,"data-slot":`thread-history`,children:[a&&/* @__PURE__ */ (0,Y.jsx)(pa,{title:ds(a),container:s,finalFocus:i,onClose:()=>o(null),onDelete:async()=>{let t=await e.deleteThread(a);return t&&(r(a.id),v.invalidateQueries({queryKey:[`thread-history`]})),t}}),/* @__PURE__ */ (0,Y.jsxs)(Ct,{open:d,items:j,filteredItems:j,value:null,onValueChange:t=>{t&&t.id!==S&&e.openThread(t.id).then(n)},itemToStringLabel:ds,itemToStringValue:e=>e.id,isItemEqualToValue:(e,t)=>e.id===t.id,onInputValueChange:(e,t)=>{u(t.reason===`input-change`?e:``)},onOpenChange:e=>{f(e),e?(m(!1),g(s.current?.closest(`[data-slot="chat"]`)??void 0)):u(``)},children:[/* @__PURE__ */ (0,Y.jsx)(_n,{ref:i,render:/* @__PURE__ */ (0,Y.jsx)(q,{tooltip:`Show older chats`,variant:`ghost`,size:`icon-sm`,disabled:!y}),children:/* @__PURE__ */ (0,Y.jsx)(ci,{})}),/* @__PURE__ */ (0,Y.jsxs)(an,{container:s,collisionBoundary:h,align:`end`,"aria-label":`Chat history`,"aria-busy":T||b.isFetching?!0:void 0,className:`w-80 min-w-0`,children:[/* @__PURE__ */ (0,Y.jsx)(ir,{"aria-label":`Search chats`,placeholder:`Search chats…`,maxLength:255,showTrigger:!1}),/* @__PURE__ */ (0,Y.jsx)(dn,{className:`text-center text-sm text-muted-foreground [&:not(:empty)]:py-2`,children:!E&&(T||b.isFetchingNextPage)?`Loading…`:null}),/* @__PURE__ */ (0,Y.jsx)(xt,{children:y&&!T&&!E?`No chats found.`:null}),/* @__PURE__ */ (0,Y.jsx)(sn,{ref:c,className:`max-h-[min(24rem,calc(var(--available-height)---spacing(9)))]`,children:e=>/* @__PURE__ */ (0,Y.jsxs)(At,{items:e.items,children:[/* @__PURE__ */ (0,Y.jsx)(ln,{children:e.value}),/* @__PURE__ */ (0,Y.jsx)(en,{children:e=>{let t=e.id===S;return/* @__PURE__ */ (0,Y.jsxs)(Ot,{value:e,"aria-label":ds(e),"aria-current":t?`true`:void 0,className:x(`group/thread ps-2 pe-1 any-pointer-coarse:min-h-11`,t&&`bg-muted font-semibold`),children:[/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:ds(e)}),e.role===`manager`&&/* @__PURE__ */ (0,Y.jsx)(q,{variant:`ghost`,size:`icon-xs`,"aria-label":`Delete ${ds(e)}`,tooltip:`Delete chat`,disabled:t&&w,className:`opacity-0 group-hover/thread:opacity-100 group-data-highlighted/thread:opacity-100 focus-visible:opacity-100 any-pointer-coarse:opacity-100`,onPointerDown:fs,onMouseDown:fs,onClick:t=>{t.stopPropagation(),f(!1),o(e)},children:/* @__PURE__ */ (0,Y.jsx)(Mr,{})})]},e.id)}})]},e.value)}),E&&/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`p-2 text-xs`,role:`alert`,children:[`Could not load chats.`,/* @__PURE__ */ (0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,tooltip:`Retry`,disabled:b.isFetching,onClick:()=>void(!p&&b.isFetchNextPageError?b.fetchNextPage():b.refetch()).then(e=>{e.isSuccess&&m(!1)}),children:/* @__PURE__ */ (0,Y.jsx)(qt,{})})]})]})]})]})}function ms({className:e,orientation:t=`horizontal`,...n}){return/* @__PURE__ */ (0,Y.jsx)(es,{"data-slot":`tabs`,"data-orientation":t,className:x(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}const hs=re(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function gs({className:e,variant:t=`default`,...n}){return/* @__PURE__ */ (0,Y.jsx)(cs,{"data-slot":`tabs-list`,"data-variant":t,className:x(hs({variant:t}),e),...n})}function _s({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(as,{"data-slot":`tabs-trigger`,className:x(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pe-1 has-data-[icon=inline-start]:ps-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-end-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function vs({className:e,...t}){return/* @__PURE__ */ (0,Y.jsx)(ss,{"data-slot":`tabs-content`,className:x(`flex-1 text-sm outline-none`,e),...t})}const ys=/* @__PURE__ */ new Set([`c`,`cpp`,`css`,`go`,`html`,`js`,`json`,`jsx`,`mjs`,`py`,`rb`,`rs`,`sh`,`sql`,`toml`,`ts`,`tsx`,`yaml`,`yml`]);function bs(e){let t=e.slice(e.lastIndexOf(`.`)+1).toLowerCase();return ys.has(t)?/* @__PURE__ */ (0,Y.jsx)(pi,{}):t===`csv`||t===`tsv`?/* @__PURE__ */ (0,Y.jsx)(mi,{}):/* @__PURE__ */ (0,Y.jsx)(Ut,{})}function xs(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function Ss({file:e}){return/* @__PURE__ */ (0,Y.jsxs)(`div`,{className:`flex items-start gap-1`,children:[/* @__PURE__ */ (0,Y.jsx)(`div`,{className:`min-w-0 flex-1`,children:/* @__PURE__ */ (0,Y.jsx)(Wn,{icon:bs(e.path),label:/* @__PURE__ */ (0,Y.jsxs)(Y.Fragment,{children:[/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`font-mono wrap-anywhere`,children:e.label}),/* @__PURE__ */ (0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,e.lines===1?`1 line`:`${e.lines} lines`]})]}),children:/* @__PURE__ */ (0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col`,children:/* @__PURE__ */ (0,Y.jsx)(Hn,{emptyLabel:`Empty file`,caption:e.label===e.path?void 0:e.path,language:e.path.split(`.`).at(-1),children:e.content})})})}),/* @__PURE__ */ (0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":`Download ${e.label}`,tooltip:`Download file`,onClick:()=>$n(xs(e.path),e.content),children:/* @__PURE__ */ (0,Y.jsx)(di,{})})]})}function Cs({run:e}){let t=e.timedOut||e.exitCode!==void 0&&e.exitCode!==0;return/* @__PURE__ */ (0,Y.jsx)(Wn,{icon:/* @__PURE__ */ (0,Y.jsx)(Rt,{}),running:!e.finished,failed:t,label:/* @__PURE__ */ (0,Y.jsxs)(Y.Fragment,{children:[/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`font-mono wrap-anywhere`,children:e.command}),e.finished&&/* @__PURE__ */ (0,Y.jsx)(`span`,{className:x(`ms-1`,t?`text-destructive`:`text-muted-foreground`),children:zt(e)})]}),children:/* @__PURE__ */ (0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col`,children:/* @__PURE__ */ (0,Y.jsx)(lt,{run:e})})})}function ws({activity:e}){let t=(0,J.useRef)(null),n=e.files.length,r=e.commands.length;return/* @__PURE__ */ (0,Y.jsx)(`div`,{ref:t,className:`w-full`,children:/* @__PURE__ */ (0,Y.jsxs)(Uo,{children:[/* @__PURE__ */ (0,Y.jsxs)(Wo,{render:/* @__PURE__ */ (0,Y.jsx)(g,{variant:`outline`,size:`sm`,className:`group w-full justify-start rounded-full bg-muted/50 text-xs text-muted-foreground any-pointer-coarse:min-h-11 any-pointer-coarse:min-w-11`}),children:[/* @__PURE__ */ (0,Y.jsx)(li,{}),/* @__PURE__ */ (0,Y.jsxs)(`span`,{className:`flex-1 text-start`,children:[`Sandbox · `,n,` `,n===1?`file`:`files`,` · `,r,` `,r===1?`command`:`commands`]}),/* @__PURE__ */ (0,Y.jsx)(si,{className:`transition-transform group-aria-expanded:rotate-180`})]}),/* @__PURE__ */ (0,Y.jsx)(Go,{container:t,side:`top`,sideOffset:4,"aria-label":`Sandbox files and command history`,className:`max-h-[min(20rem,var(--available-height))] w-(--anchor-width) max-w-(--available-width) gap-0 overflow-hidden p-0`,children:/* @__PURE__ */ (0,Y.jsxs)(ms,{defaultValue:`files`,className:`flex min-h-0 flex-col gap-0`,children:[/* @__PURE__ */ (0,Y.jsxs)(gs,{variant:`line`,className:`w-full shrink-0 px-2 any-pointer-coarse:h-auto any-pointer-coarse:[&_[data-slot=tabs-trigger]]:min-h-11 any-pointer-coarse:[&_[data-slot=tabs-trigger]]:min-w-11`,children:[/* @__PURE__ */ (0,Y.jsxs)(_s,{value:`files`,children:[/* @__PURE__ */ (0,Y.jsx)(Ut,{}),`Files`,n>0&&/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:n})]}),/* @__PURE__ */ (0,Y.jsxs)(_s,{value:`log`,children:[/* @__PURE__ */ (0,Y.jsx)(Rt,{}),`Log`,r>0&&/* @__PURE__ */ (0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:r})]})]}),/* @__PURE__ */ (0,Y.jsx)(vs,{value:`files`,className:`min-h-0 overflow-y-auto px-2 py-1`,children:n===0?/* @__PURE__ */ (0,Y.jsx)(Ts,{children:`The agent has not written any files yet.`}):e.files.map(e=>/* @__PURE__ */ (0,Y.jsx)(Ss,{file:e},e.toolCallId))}),/* @__PURE__ */ (0,Y.jsx)(vs,{value:`log`,className:`min-h-0 overflow-y-auto px-2 py-1`,children:r===0?/* @__PURE__ */ (0,Y.jsx)(Ts,{children:`The agent has not run any commands yet.`}):e.commands.map(e=>/* @__PURE__ */ (0,Y.jsx)(Cs,{run:e},e.toolCallId))})]})})]})})}function Ts({children:e}){return/* @__PURE__ */ (0,Y.jsx)(`p`,{className:`px-1 py-2 text-xs text-muted-foreground italic`,children:e})}function Es({status:e}){if(e===`ready`)return null;let t=e===`starting`;return/* @__PURE__ */ (0,Y.jsxs)(Dt,{role:`status`,className:`w-full rounded-full border bg-muted/50 px-3 py-1.5`,children:[/* @__PURE__ */ (0,Y.jsx)(Jt,{children:t?/* @__PURE__ */ (0,Y.jsx)(bt,{}):/* @__PURE__ */ (0,Y.jsx)(Ft,{})}),/* @__PURE__ */ (0,Y.jsx)(Nt,{className:t?`shimmer`:void 0,children:t?`Starting the sandbox…`:`The sandbox could not be started`})]})}function Ds(e){return Object.keys(e).length>0?e:void 0}function Os(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`promptTokens`in e}function ks(e,t){return Os(e)?e:As(Array.isArray(e)?e:void 0,t)}function As(e,t){let n=e?.reduce((e,t)=>{for(let n of[`inputTokens`,`outputTokens`,`totalTokens`,`cachedInputTokens`,`cacheWriteInputTokens`,`reasoningTokens`])t[n]!==void 0&&(e[n]=(e[n]??0)+t[n]);return e},{});if((e===void 0||e.length===0)&&t==null)return;let{promptTokensDetails:r,completionTokensDetails:i,...a}=t??{},o=Ds({...n?.cachedInputTokens===void 0?{}:{cachedTokens:n.cachedInputTokens},...n?.cacheWriteInputTokens===void 0?{}:{cacheWriteTokens:n.cacheWriteInputTokens},...r}),s=Ds({...n?.reasoningTokens===void 0?{}:{reasoningTokens:n.reasoningTokens},...i});return{promptTokens:n?.inputTokens??0,completionTokens:n?.outputTokens??0,totalTokens:n?.totalTokens??0,...a,...o===void 0?{}:{promptTokensDetails:o},...s===void 0?{}:{completionTokensDetails:s}}}function js(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ms(e,t){if(t==null)return e;if(e==null)return{...t};let n={...e,...t};return js(e.tanstack)&&js(t.tanstack)&&(n.tanstack={...e.tanstack,...t.tanstack}),n}function X(e){if(e==null)return;let t=`metadata`in e?e.metadata:void 0,n=(typeof t==`object`&&t&&!Array.isArray(t)?t:e).tanstack;if(typeof n==`object`&&n&&!Array.isArray(n))return n}function Ns(e,t){let n=e.metadata,r=X(e)??{};return{...e,metadata:{...n??{},tanstack:{...r,...t}}}}let Z=/* @__PURE__ */ function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e.SUBAGENT_STARTED=`SUBAGENT_STARTED`,e.SUBAGENT_FINISHED=`SUBAGENT_FINISHED`,e.SUBAGENT_ERROR=`SUBAGENT_ERROR`,e}({});function Ps(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>Ps(e,t[n]));if(e===null||t===null||typeof e!=`object`||typeof t!=`object`||Array.isArray(e)||Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&Ps(Reflect.get(e,n),Reflect.get(t,n)))}function Fs(e,t){let n=0,r=()=>{for(;e[n]===` `||e[n]===` `||e[n]===`\r`||e[n]===`
2
2
  `;)n++},i=()=>{let t=n++;for(;n<e.length;)if(e[n]===`\\`)n+=2;else if(e[n++]===`"`)break;return e.slice(t,n)},a=t=>{r();let o=n;if(e[n]===`{`){n++,r();let s=/* @__PURE__ */ new Map;for(;e[n]!==`}`;){let o=i(),c=JSON.parse(o);r(),n++;let l=typeof t==`object`&&t&&typeof c==`string`?Reflect.get(t,c):void 0,u=a(l);if(typeof c==`string`&&s.set(c,{...u,keyToken:o}),r(),e[n]!==`,`)break;n++,r()}return n++,{start:o,end:n,value:t,properties:s}}if(e[n]===`[`){n++,r();let i=[];for(;e[n]!==`]`&&(i.push(a(Array.isArray(t)?t[i.length]:void 0)),r(),e[n]===`,`);)n++;return n++,{start:o,end:n,value:t,items:i}}if(e[n]===`"`)i();else for(;n<e.length&&!/[\s,}\]]/.test(e[n]??``);)n++;return{start:o,end:n,value:t}};return a(t)}function Is(e,t,n,r){if(n&&Ps(n.value,e))return t.slice(n.start,n.end);if(typeof e==`number`)return Object.is(e,-0)?`-0`:e===1/0?`1e999`:e===-1/0?`-1e999`:JSON.stringify(e);if(typeof e!=`object`||!e)return JSON.stringify(e);if(r.has(e))throw TypeError(`Cannot serialize circular tool input`);r.add(e);try{if(Array.isArray(e))return`[`+Array.from(e,(e,i)=>Is(e,t,n?.items?.[i],r)??`null`).join(`,`)+`]`;let i=[];for(let a of Object.keys(e)){let o=Is(Reflect.get(e,a),t,n?.properties?.get(a),r);o!==void 0&&i.push((n?.properties?.get(a)?.keyToken??JSON.stringify(a))+`:`+o)}return`{`+i.join(`,`)+`}`}finally{r.delete(e)}}function Ls(e,t){if(t===void 0)return e??``;if(e===void 0)return Is(t,``,void 0,/* @__PURE__ */ new Set)??``;let n;try{n=JSON.parse(e)}catch{return e.trim()===``?Is(t,``,void 0,/* @__PURE__ */ new Set)??e:e}return Ps(n,t)?e:Is(t,e,Fs(e,n),/* @__PURE__ */ new Set)??e}function Rs(e){if(e.trim()===``)return{};try{return JSON.parse(e)??void 0}catch{return}}function zs(e,t){let n=X(t),r=t.args??n?.args,i=typeof r==`string`?r:void 0,a=t.input??n?.input,o=typeof a==`object`&&a?a:void 0,s=i??e;if(i===void 0&&o!==void 0)try{JSON.parse(s)}catch{s=void 0}let c;try{c=Ls(s,o)}catch{c=s??e}return{args:c,input:Rs(c)}}var Bs=`redacted_thinking-`;function Vs(e){return typeof e==`string`&&e.startsWith(`redacted_thinking-`)}var Hs=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function Us(e,t){return e>>>t|e<<32-t}function Ws(e){let t=new TextEncoder().encode(e),n=t.length*8,r=t.length+1,i=r+(56-r%64+64)%64+8,a=new Uint8Array(i);a.set(t),a[t.length]=128;let o=new DataView(a.buffer);o.setUint32(i-8,Math.floor(n/4294967296)),o.setUint32(i-4,n>>>0);let s=1779033703,c=3144134277,l=1013904242,u=2773480762,d=1359893119,f=2600822924,p=528734635,m=1541459225,h=/* @__PURE__ */ new Uint32Array(64);for(let e=0;e<i;e+=64){for(let t=0;t<16;t++)h[t]=o.getUint32(e+t*4);for(let e=16;e<64;e++){let t=h[e-15]??0,n=h[e-2]??0,r=Us(t,7)^Us(t,18)^t>>>3,i=Us(n,17)^Us(n,19)^n>>>10;h[e]=(h[e-16]??0)+r+(h[e-7]??0)+i>>>0}let t=s,n=c,r=l,i=u,a=d,g=f,_=p,v=m;for(let e=0;e<64;e++){let o=Us(a,6)^Us(a,11)^Us(a,25),s=a&g^~a&_,c=v+o+s+(Hs[e]??0)+(h[e]??0)>>>0,l=(Us(t,2)^Us(t,13)^Us(t,22))+(t&n^t&r^n&r)>>>0;v=_,_=g,g=a,a=i+c>>>0,i=r,r=n,n=t,t=c+l>>>0}s=s+t>>>0,c=c+n>>>0,l=l+r>>>0,u=u+i>>>0,d=d+a>>>0,f=f+g>>>0,p=p+_>>>0,m=m+v>>>0}let g=e=>(e>>>0).toString(16).padStart(8,`0`);return g(s)+g(c)+g(l)+g(u)+g(d)+g(f)+g(p)+g(m)}function Gs(e){return`sha256:${Ws(e)}`}function Ks(e,t){if(e===null)return`null`;if(typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e))return JSON.stringify(e);if(typeof e!=`object`)throw TypeError(`Interrupt values must be JSON-compatible.`);if(t.has(e))throw TypeError(`Interrupt values must not cycle.`);if(!Array.isArray(e)&&Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Interrupt values must use plain JSON objects.`);t.add(e);let n;if(Array.isArray(e)){let r=[];for(let n=0;n<e.length;n++)r.push(Ks(e[n],t));n=`[${r.join(`,`)}]`}else{let r=e;n=`{${Object.keys(r).sort().map(e=>`${JSON.stringify(e)}:${Ks(r[e],t)}`).join(`,`)}}`}return t.delete(e),n}function qs(e){return Ks(e,/* @__PURE__ */ new WeakSet)}function Js(e,t=Gs){if(typeof e!=`string`)throw TypeError(`Interrupt digests require canonical JSON text.`);return t(e)}function Ys(e){typeof e==`object`&&e&&!Object.isFrozen(e)&&(Object.values(e).forEach(Ys),Object.freeze(e))}function Q(e){let t=JSON.parse(qs(e));return Ys(t),t}function Xs(e){let t=Q([...e].sort((e,t)=>e.interruptId.localeCompare(t.interruptId))),n=qs(t);return Object.freeze({resolutions:t,canonicalResolutions:n,fingerprint:Js(n)})}function Zs(e){let t={};for(let[n,r]of Object.entries(e))n!==`$schema`&&(t[n]=r);return t}function Qs(e){return(typeof e==`object`||typeof e==`function`)&&e!==null}function $s(e){if(!Qs(e)||!(`~standard`in e))return!1;let t=e[`~standard`];return typeof t!=`object`||!t||!(`version`in t)||t.version!==1||!(`jsonSchema`in t)||typeof t.jsonSchema!=`object`||t.jsonSchema===null||!(`input`in t.jsonSchema)?!1:typeof t.jsonSchema.input==`function`}function ec(e){return Qs(e)&&`~standard`in e&&typeof e[`~standard`]==`object`&&e[`~standard`]!==null&&`version`in e[`~standard`]&&e[`~standard`].version===1&&`validate`in e[`~standard`]&&typeof e[`~standard`].validate==`function`}function tc(e){return Object.keys(e).length>0?e:void 0}function nc(e){if(Array.isArray(e)){let t=e.map(e=>rc(e,e.required||[])),n=t.map(e=>e.nullWidening??{});return{schema:t.map(e=>e.schema),itemMap:n.some(e=>Object.keys(e).length>0)?n:void 0}}let t=rc(e,e.required||[]);return{schema:t.schema,itemMap:t.nullWidening}}function rc(e,t=[]){let n={...e},r={};if(n.type===`object`&&n.properties){let e={...n.properties},i=Object.keys(e),a={};for(let n of i){let r=e[n];if(!r)continue;let i=!t.includes(n),o=!1,s;if(r.type===`object`&&r.properties){let t=rc(r,r.required||[]);e[n]=i?{...t.schema,type:[`object`,`null`]}:t.schema,o=i,s=t.nullWidening}else if(r.type===`array`&&r.items){let t=nc(r.items);e[n]={...r,items:t.schema,...i?{type:[`array`,`null`]}:{}},o=i,s=t.itemMap?{items:t.itemMap}:void 0}else i&&(r.type&&!Array.isArray(r.type)?(e[n]={...r,type:[r.type,`null`]},o=!0):Array.isArray(r.type)&&!r.type.includes(`null`)&&(e[n]={...r,type:[...r.type,`null`]},o=!0));(o||s)&&(a[n]={...s??{},...o?{widened:!0}:{}})}n.properties=e,n.required=i,n.additionalProperties=!1,Object.keys(a).length>0&&(r.properties=a)}if(n.type===`array`&&n.items){let e=nc(n.items);n.items=e.schema,e.itemMap&&(r.items=e.itemMap)}return{schema:n,nullWidening:tc(r)}}function ic(e,t=`input`){if($s(e)){let n=Zs(e[`~standard`].jsonSchema[t]({target:`draft-07`}));return`properties`in n&&!n.type&&(n.type=`object`),n.type===`object`&&!(`properties`in n)&&(n.properties={}),n.type===`object`&&!(`required`in n)&&(n.required=[]),n}if(ec(e))throw Error("Schema is a Standard Schema validator but does not expose a JSON Schema converter on `~standard.jsonSchema`. Use Zod v4.2+, ArkType v2.1.28+, or wrap a Valibot schema with `toStandardJsonSchema()` from `@valibot/to-json-schema` before passing it as `outputSchema`.");return typeof e==`object`?Zs(e):e}function ac(e,t={}){if(!e)return;let{forStructuredOutput:n=!1,io:r}=t;if(!n&&!$s(e)&&!ec(e))return e;let i=ic(e,r);return!i||typeof i!=`object`||!n?i:rc(i,i.required||[]).schema}async function oc(e,t){if(!ec(e))return{success:!0,data:t};let n=await e[`~standard`].validate(t);return n.issues?{success:!1,issues:n.issues.map(e=>({message:e.message||`Validation failed`,path:e.path?.map(String)}))}:{success:!0,data:n.value}}var sc=/* @__PURE__ */ new Set([`$schema`,`$id`,`$ref`,`$defs`,`type`,`properties`,`required`,`additionalProperties`,`items`,`oneOf`,`anyOf`,`allOf`,`enum`,`const`,`format`,`minimum`,`maximum`,`minLength`,`maxLength`,`pattern`]);function cc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function lc(e){return cc(e)&&Object.keys(e).some(e=>sc.has(e))}function uc(e){return ec(e)||$s(e)||lc(e)}function dc(e){if(!cc(e))return!1;let t=Object.keys(e);return t.length>0&&t.every(e=>e===`approve`||e===`reject`)&&t.every(t=>uc(e[t]))}function fc(e){let t={};for(let[n,r]of Object.entries(e))t[n]=r;return t}function pc(e){if(ec(e)){let t=$s(e)?fc(e[`~standard`].jsonSchema.input({target:`draft-2020-12`})):void 0;return{source:e,validator:e,...t!==void 0&&{jsonSchema:t}}}if(lc(e))return{source:e,jsonSchema:e};throw TypeError(`Expected a supported SchemaInput.`)}function mc(e){let t={approved:{const:e.approved}},n=[`approved`];return e.approved&&e.inputSchema&&(t.editedArgs=e.inputSchema.jsonSchema??{}),e.payload&&(t.payload=e.payload.jsonSchema??{},n.push(`payload`)),{type:`object`,properties:t,required:n,additionalProperties:!1}}function hc(e,t){let n=t===void 0?null:pc(t),r=null,i=null;if(e!==void 0){if(ec(e)||lc(e))r=pc(e),i=r;else if(dc(e))r=e.approve===void 0?null:pc(e.approve),i=e.reject===void 0?null:pc(e.reject);else throw TypeError(`approvalSchema must be a SchemaInput or a nonempty map containing approve or reject.`)}let a={oneOf:[mc({approved:!0,payload:r,inputSchema:n}),mc({approved:!1,payload:i,inputSchema:null})]},o=qs(a),s=qs({approve:r?.jsonSchema??null,reject:i?.jsonSchema??null});return{branches:{approve:r,reject:i},responseSchema:a,responseSchemaHash:Js(o),approvalSchemaHash:Js(s)}}function gc(e){return Js(e===void 0?`undefined`:qs(pc(e).jsonSchema??{standardValidator:`unserialized`}))}var _c=`tanstack:interruptBinding`,vc=_c;function yc(e){return e&&typeof e==`object`?e:null}function bc(e,t){return typeof e[t]==`string`?e[t]:void 0}function xc(e){let t=e.v;return t===void 0||t===1}function Sc(e){let t=yc(e.metadata),n=t?yc(t[vc]):null;if(!n||bc(n,`interruptId`)!==e.id||!xc(n))return;let r=bc(n,`kind`),i=bc(n,`interruptId`),a=bc(n,`responseSchemaHash`),o=bc(n,`expiresAt`);if(!i||a===``||o!==void 0&&!Number.isFinite(Date.parse(o)))return;if(r===`generic`){let e=bc(n,`definitionId`),t=bc(n,`key`),s=n.batchIndex,c=bc(n,`payloadSchemaHash`);return(e!==void 0||t!==void 0||s!==void 0||c!==void 0)&&(!e||!t||typeof s!=`number`||!Number.isInteger(s)||s<0)?void 0:{v:1,kind:r,interruptId:i,...a?{responseSchemaHash:a}:{},...o?{expiresAt:o}:{},...e?{definitionId:e}:{},...t?{key:t}:{},...typeof s==`number`?{batchIndex:s}:{},...c?{payloadSchemaHash:c}:{}}}if(!a)return;let s=bc(n,`toolName`),c=bc(n,`toolCallId`);if(s&&c){if(r===`client-tool-execution`){let e=bc(n,`outputSchemaHash`);return e?{v:1,kind:r,interruptId:i,toolName:s,toolCallId:c,outputSchemaHash:e,responseSchemaHash:a,...o?{expiresAt:o}:{}}:void 0}if(r===`tool-approval`){let e=bc(n,`inputSchemaHash`),t=bc(n,`approvalSchemaHash`);return!e||!t?void 0:{v:1,kind:r,interruptId:i,toolName:s,toolCallId:c,originalArgs:n.originalArgs,inputSchemaHash:e,approvalSchemaHash:t,responseSchemaHash:a,...o?{expiresAt:o}:{}}}}}function Cc(e){let t=Sc(e);if(!t)return;let n=yc(e.metadata),r=n?yc(n[vc]):null;if(!r)return;let i=bc(r,`interruptedRunId`),a=r.generation;if(!(!i||typeof a!=`number`||!Number.isInteger(a)||a<0))return{...t,interruptedRunId:i,generation:a}}var wc=`tanstack:interruptPayload`;function Tc(e,t){if(!$s(e))throw TypeError(`${t} must be a Standard Schema with a JSON Schema converter.`);try{let t=e[`~standard`].jsonSchema.input({target:`draft-07`});if(t===void 0)throw TypeError(`The exported schema is undefined.`);if(typeof t==`function`)throw TypeError(`The exported schema must not be a function.`);if(Array.isArray(t)||!t||typeof t!=`object`||![Object.prototype,null].includes(Object.getPrototypeOf(t)))throw TypeError(`The exported schema must be a plain JSON object.`);let n={};for(let[e,r]of Object.entries(t))e!==`$schema`&&(n[e]=r);return{json:n,canonicalJson:qs(n)}}catch(e){throw TypeError(`${t} could not export compatible JSON Schema: ${e instanceof Error?e.message:String(e)}`)}}function Ec(e){return Js(Tc(e,`Interrupt schema`).canonicalJson)}var Dc=`tanstack:interruptContinuation`;function Oc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function kc(e){return{[Dc]:e}}function Ac(e){let t=Sc(e);if(t?.kind!==`generic`||t.definitionId===void 0||t.key===void 0||t.batchIndex===void 0)return;let n=Oc(e.metadata)?e.metadata:void 0,r=n!==void 0&&Object.prototype.hasOwnProperty.call(n,`tanstack:interruptPayload`);return{v:1,definitionId:t.definitionId,key:t.key,batchIndex:t.batchIndex,reason:e.reason,message:e.message??``,...e.expiresAt===void 0?{}:{expiresAt:e.expiresAt},...t.responseSchemaHash===void 0?{}:{responseSchemaHash:t.responseSchemaHash},...t.payloadSchemaHash===void 0?{}:{payloadSchemaHash:t.payloadSchemaHash},...r?{payload:n[wc]}:{}}}function jc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Mc=`subagentInput`;function Nc(e){if(jc(e)&&jc(e.tanstack))return e.tanstack[Mc]}function Pc(e){if(!jc(e)||`parts`in e)return;let t=e.subagentRunId;return typeof t==`string`&&t!==``?t:void 0}function Fc(e){if(!jc(e)||!jc(e.metadata))return;let t=e.metadata.tanstack;if(!jc(t)||!jc(t.subagent))return;let{name:n,status:r,error:i,interruptIds:a}=t.subagent;if(typeof n!=`string`||!Ic(r))return;let{description:o,parentSubagentRunId:s,parentToolCallId:c,metadata:l,placeholder:u}=t.subagent;return{name:n,status:r,...typeof o==`string`&&{description:o},...jc(i)&&typeof i.message==`string`&&{error:{message:i.message,...typeof i.code==`string`&&{code:i.code}}},...Array.isArray(a)&&{interruptIds:a.filter(e=>typeof e==`string`)},...typeof s==`string`&&{parentSubagentRunId:s},...typeof c==`string`&&{parentToolCallId:c},...jc(l)&&{metadata:l},...u===!0&&{placeholder:!0}}}function Ic(e){return e===`running`||e===`finished`||e===`error`||e===`suspended`}function Lc(e){if(!jc(e))return e;let{subagentRunId:t,...n}=e,r=jc(n.metadata)?n.metadata:void 0,i=jc(r?.tanstack)?r.tanstack:void 0;if(!r||!i||!(`subagent`in i))return n;let{subagent:a,...o}=i;return{...n,metadata:{...r,tanstack:o}}}function Rc(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=Pc(n);e!==void 0&&!t.has(e)&&t.set(e,Fc(n)?.parentSubagentRunId)}let n=e=>{let n=e;for(let e=0;e<64;e++){let e=t.get(n);if(e===void 0||!t.has(e))return n;n=e}return n},r=[],i=/* @__PURE__ */ new Map;for(let t of e){let e=Pc(t);if(e===void 0){r.push(t);continue}let a=n(e),o=i.get(a);if(o||(o={id:a,info:{name:`subagent`,status:`finished`},messages:[],hostIndex:r.length-1},i.set(a,o)),e!==a){o.messages.push(t);continue}let s=Fc(t);s&&(o.info=s),s?.placeholder||o.messages.push(Lc(t))}return{top:r,groups:[...i.values()]}}function zc(e){let t=e?.metadata;return typeof t==`object`&&t&&t.providerExecuted===!0?t:null}function Bc(e){return zc(e)!==null}function Vc(e,t){return e?.startsWith(`${t}-segment-`)===!0}var Hc=/* @__PURE__ */ new Set([`text`,`image`,`audio`,`video`,`document`]);function Uc(e){return e===`cancelled`||e===`denied`}function Wc(e){if(typeof e!=`object`||!e)return!1;let t=e;if(typeof t.type!=`string`||!Hc.has(t.type))return!1;if(t.type===`text`)return typeof t.content==`string`;let n=t.source;if(typeof n!=`object`||!n)return!1;let r=n;return typeof r.value==`string`?r.type===`file`?r.value.length>0&&(r.provider===void 0||typeof r.provider==`string`):r.type===`data`?typeof r.mimeType==`string`:r.type===`url`:!1}function Gc(e){return Array.isArray(e)&&e.length>0&&e.every(Wc)}function Kc(e){return e&&typeof e==`object`&&`error`in e&&typeof e.error==`string`?e.error:typeof e==`string`?e:`Tool execution failed`}function qc(e){return typeof e==`string`||Gc(e)?e:JSON.stringify(e)}function Jc(e){let t=[],n=0,r=!0;for(let i of e){let e=t.at(-1);if(i.type===`thinking`)e!==void 0&&e.type!==`thinking`&&(r=!1),t.push({type:`thinking`,index:n++});else if(i.type===`text`){if(i.text===``)continue;if(e?.type===`text`){e.length+=i.text.length;continue}e?.type===`tool-call`&&(r=!1),t.push({type:`text`,length:i.text.length})}else t.push({type:`tool-call`,id:i.id})}return r?void 0:t}function Yc(e){let t=e.blockOrder;if(!Array.isArray(t)||t.length===0)return;let n=e.content??``;if(typeof n!=`string`)return;let r=e.thinking??[],i=e.toolCalls??[],a=/* @__PURE__ */ new Set,o=/* @__PURE__ */ new Set,s=[],c=0;for(let e of t){if(typeof e!=`object`||!e)return;if(e.type===`thinking`){let t=Number.isInteger(e.index)?r[e.index]:void 0;if(t===void 0||a.has(e.index))return;a.add(e.index),s.push({type:`thinking`,thinking:t})}else if(e.type===`text`){let t=c+e.length;if(!Number.isInteger(e.length)||e.length<=0||t>n.length)return;s.push({type:`text`,text:n.slice(c,t)}),c=t}else if(e.type===`tool-call`){let t=i.find(t=>t.id===e.id);if(t===void 0||o.has(e.id))return;o.add(e.id),s.push({type:`tool-call`,toolCall:t})}else return}if(c===n.length&&a.size===r.length&&o.size===i.length)return s}function Xc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Zc(e){return e.type===`text`||e.type===`image`||e.type===`audio`||e.type===`video`||e.type===`document`}function Qc(e){try{return JSON.stringify(e)??``}catch{return``}}function $c(e){return typeof e==`string`&&e!==``?e:void 0}function el(e){if(`encryptedValue`in e){let t=$c(e.encryptedValue);if(t!==void 0)return t}return $c(X(e)?.signature)}function tl(e){return`id`in e&&Vs(e.id)?{redacted:!0}:{}}function nl(e){return e.length===0?null:e.every(e=>e.type===`text`)?e.map(e=>e.content).join(``)||null:e}function rl(e){return e==null?``:typeof e==`string`?e:e.filter(e=>e.type===`text`).map(e=>e.content).join(``)}function il(e){let t=[];for(let n of e)if(n.type===`text`&&n.content!==``)t.push(n.content);else if(n.type===`structured-output`&&n.status===`complete`&&n.raw!==``)t.push(n.raw);else if(n.type===`subagent`){let e=al(n);e!==``&&t.push(e)}return t.join(`
3
3
 
4
4
  `)}function al(e){let t=[];for(let n of e.subagent.messages){if(!(`parts`in n))continue;let e=il(n.parts).trim();e!==``&&t.push(e)}return t.length===0?``:`${e.subagent.name}:\n${t.join(`