opencami 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +48 -31
  2. package/dist/client/assets/{CSPContext-Bq8j4nl9.js → CSPContext-CCZJblsW.js} +1 -1
  3. package/dist/client/assets/{DirectionContext-BdX86BHP.js → DirectionContext-CAS2SgNN.js} +1 -1
  4. package/dist/client/assets/{_sessionKey-DsjnpErt.js → _sessionKey-f5UgmhlK.js} +4 -4
  5. package/dist/client/assets/agents-DBx41wBT.js +2 -0
  6. package/dist/client/assets/{agents-screen-DwIY8hze.js → agents-screen-CjqM2uOb.js} +1 -1
  7. package/dist/client/assets/bots-BqD0EQcs.js +2 -0
  8. package/dist/client/assets/{bots-screen-c78I920d.js → bots-screen-ivWEgfTv.js} +1 -1
  9. package/dist/client/assets/{button-Dg7VFQQn.js → button-DzGUU5Tc.js} +1 -1
  10. package/dist/client/assets/{composite-DBl8R3ae.js → composite-afaLtloO.js} +1 -1
  11. package/dist/client/assets/{connect-NYvOqiBJ.js → connect-9Vns9nqk.js} +1 -1
  12. package/dist/client/assets/{file-explorer-screen-BSMbs0vi.js → file-explorer-screen-Di0232pk.js} +1 -1
  13. package/dist/client/assets/files-BlMyTMb7.js +2 -0
  14. package/dist/client/assets/{index-CMATW8VA.js → index-BvN0Cj0s.js} +1 -1
  15. package/dist/client/assets/{index-rOIRO-8E.js → index-CRgPm0pb.js} +1 -1
  16. package/dist/client/assets/{keyboard-shortcuts-dialog-BTGWdJMl.js → keyboard-shortcuts-dialog-C5kjcplH.js} +1 -1
  17. package/dist/client/assets/{main-B_dlfHME.js → main-ZPHfbCuz.js} +3 -3
  18. package/dist/client/assets/{markdown-BVzT7z4x.js → markdown-1-xJ1B1H.js} +1 -1
  19. package/dist/client/assets/memory-rR6pG57i.js +2 -0
  20. package/dist/client/assets/{memory-screen-C-Z9o31m.js → memory-screen-BV4YRKim.js} +1 -1
  21. package/dist/client/assets/{menu-DHNgWk_8.js → menu-9GT8MQlt.js} +1 -1
  22. package/dist/client/assets/{opencami-logo-BQQETnJG.js → opencami-logo-CxC-KcS9.js} +1 -1
  23. package/dist/client/assets/{owner-CpRnf1fI.js → owner-Bm20thei.js} +1 -1
  24. package/dist/client/assets/{popupStateMapping-BRPDXnjv.js → popupStateMapping-C797EAip.js} +1 -1
  25. package/dist/client/assets/{proxy-BcUh9kMA.js → proxy-aJlrsYWj.js} +1 -1
  26. package/dist/client/assets/{react-irH8OzhB.js → react-DuiuJSA1.js} +1 -1
  27. package/dist/client/assets/{search-dialog-B96zx_ng.js → search-dialog-DD_ESAph.js} +1 -1
  28. package/dist/client/assets/{session-export-dialog-DPuHnhgv.js → session-export-dialog-5X5WKL4z.js} +1 -1
  29. package/dist/client/assets/{settings-dialog-DZcRCaPj.js → settings-dialog-Bd0RXSk3.js} +1 -1
  30. package/dist/client/assets/skills-DAKbQw5l.js +2 -0
  31. package/dist/client/assets/{skills-panel-WDUfIwnI.js → skills-panel-oNmWCyiv.js} +1 -1
  32. package/dist/client/assets/styles-Ecf_rLDJ.css +1 -0
  33. package/dist/client/assets/{switch-DPocNFRG.js → switch-BJY4FNiL.js} +1 -1
  34. package/dist/client/assets/{tabs-B0cro1hL.js → tabs-DBIBgGyG.js} +1 -1
  35. package/dist/client/assets/{tooltip-Dg9fy-vT.js → tooltip-BoKzJ7ag.js} +1 -1
  36. package/dist/client/assets/{use-file-explorer-state-DzT0bksg.js → use-file-explorer-state-EK2HTABk.js} +1 -1
  37. package/dist/client/assets/{useButton-Cbl_9oFG.js → useButton-Bh6gEhdL.js} +1 -1
  38. package/dist/client/assets/{useCompositeItem-BDAzTxVe.js → useCompositeItem-BR34_3gK.js} +1 -1
  39. package/dist/client/assets/{useControlled-Dscz_s4f.js → useControlled-byIifl1i.js} +1 -1
  40. package/dist/client/assets/{useMutation-B1FlDsNN.js → useMutation-D5JCmjGc.js} +1 -1
  41. package/dist/client/assets/{visuallyHidden-ONmQ-0U2.js → visuallyHidden-ChUPUs-q.js} +1 -1
  42. package/dist/server/assets/{_sessionKey-B0ZlLAjH.js → _sessionKey-BCdHKOq7.js} +3 -3
  43. package/dist/server/assets/{_tanstack-start-manifest_v-D5UVTs1o.js → _tanstack-start-manifest_v-XVyva8_b.js} +1 -1
  44. package/dist/server/assets/{index-CiUjUD0t.js → index-r4KOEzK3.js} +1 -1
  45. package/dist/server/assets/{router-Uuagl6O7.js → router-CkcOXH0V.js} +5 -5
  46. package/dist/server/assets/{search-dialog-DZTS5SEi.js → search-dialog-CuuZvlyq.js} +2 -2
  47. package/dist/server/assets/{settings-dialog-CSYDj2qm.js → settings-dialog-S2HICL7l.js} +2 -2
  48. package/dist/server/server.js +2 -2
  49. package/package.json +1 -1
  50. package/dist/client/assets/agents-DwxKcpP6.js +0 -2
  51. package/dist/client/assets/bots-CRlm-3-d.js +0 -2
  52. package/dist/client/assets/files-BJbMx0_w.js +0 -2
  53. package/dist/client/assets/memory-S3Yws6a5.js +0 -2
  54. package/dist/client/assets/skills-YZe3I63y.js +0 -2
  55. package/dist/client/assets/styles-Bwo-K6Y4.css +0 -1
@@ -1 +1 @@
1
- import{r as p,j as K,w as _e}from"./main-B_dlfHME.js";import{ac as Ue,u as qt,ag as lt,ab as Bn,c as Gt}from"./button-Dg7VFQQn.js";import{a as $e,U as Kt,c as Qt,W as $n,g as Jt,d as at,I as Zt,b as Re,L as Wn,R as jn,h as Yn,o as Nn,k as Xn,i as me,m as _n,n as Un,q as zn,r as qn,v as Gn,X as Kn,Y as Qn,Z as Jn,P as Zn,p as en,e as eo,t as to}from"./popupStateMapping-BRPDXnjv.js";import{u as z,g as G,n as tn,a as Z,A as le,E as st,e as j,F as ge,G as kt,h as ue,i as fe,H as nn,I as ut,x as Pe,w as We,J as no,K as on,L as oo,z as ft,D as dt,M as ze,p as ro,q as Fe,t as rn,r as sn,m as ce,N as so,v as io,d as co}from"./useButton-Cbl_9oFG.js";import{i as Oe,l as qe,e as ee,d as Ft,g as lo,r as ao,k as Ae,t as uo,v as fo,T as go,o as cn}from"./owner-CpRnf1fI.js";import{e as de,g as te,a as re,b as mo,c as po,d as ho,h as yo,i as be,m as Me,j as J,s as xo,k as ln,l as an,n as je,o as un,p as it,q as fn,t as ae,f as ke,r as Ye,u as vo}from"./DirectionContext-BdX86BHP.js";const Ne={isSidebarCollapsed:!1},dn=["chat","ui"];function Gr(t){const e=t.getQueryData(dn);return e&&typeof e=="object"?{...Ne,...e}:Ne}function Kr(t,e){t.setQueryData(dn,function(o){const r=o&&typeof o=="object"?{...Ne,...o}:Ne;return e(r)})}const gn=p.createContext(void 0);function Ge(t){const e=p.useContext(gn);if(e===void 0&&!t)throw new Error(Ue(72));return e}function He(t,e,n){if(n&&!Oe(n))return 0;if(typeof t=="number")return t;if(typeof t=="function"){const o=t();return typeof o=="number"?o:o?.[e]}return t?.[e]}const mn=p.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Kt,currentIdRef:{current:null},currentContextRef:{current:null}});function Ro(t){const{children:e,delay:n,timeoutMs:o=0}=t,r=p.useRef(n),s=p.useRef(n),i=p.useRef(null),c=p.useRef(null),a=$e();return K.jsx(mn.Provider,{value:p.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:s,currentIdRef:i,timeoutMs:o,currentContextRef:c,timeout:a}),[o,a]),children:e})}function wo(t,e={open:!1}){const n="rootStore"in t?t.rootStore:t,o=n.useState("floatingId"),{enabled:r=!0,open:s}=e,i=p.useContext(mn),{currentIdRef:c,delayRef:a,timeoutMs:d,initialDelayRef:u,currentContextRef:f,hasProvider:m,timeout:l}=i,[g,h]=p.useState(!1);return z(()=>{function R(){h(!1),f.current?.setIsInstantPhase(!1),c.current=null,f.current=null,a.current=u.current}if(r&&c.current&&!s&&c.current===o){if(h(!1),d){const x=o;return l.start(d,()=>{n.select("open")||c.current&&c.current!==x||R()}),()=>{l.clear()}}R()}},[r,s,o,c,a,d,u,f,l,n]),z(()=>{if(!r||!s)return;const R=f.current,x=c.current;l.clear(),f.current={onOpenChange:n.setOpen,setIsInstantPhase:h},c.current=o,a.current={open:0,close:He(u.current,"close")},x!==null&&x!==o?(h(!0),R?.setIsInstantPhase(!0),R?.onOpenChange(!1,G(tn))):(h(!1),R?.setIsInstantPhase(!1))},[r,s,o,n,c,a,d,u,f,l]),z(()=>()=>{f.current=null},[f]),p.useMemo(()=>({hasProvider:m,delayRef:a,isInstantPhase:g}),[m,a,g])}function bo(t,e){let n=null,o=null,r=!1;return{contextElement:t||void 0,getBoundingClientRect(){const s=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=e.axis==="x"||e.axis==="both",c=e.axis==="y"||e.axis==="both",a=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let d=s.width,u=s.height,f=s.x,m=s.y;return n==null&&e.x&&i&&(n=s.x-e.x),o==null&&e.y&&c&&(o=s.y-e.y),f-=n||0,m-=o||0,d=0,u=0,!r||a?(d=e.axis==="y"?s.width:0,u=e.axis==="x"?s.height:0,f=i&&e.x!=null?e.x:f,m=c&&e.y!=null?e.y:m):r&&!a&&(u=e.axis==="x"?s.height:u,d=e.axis==="y"?s.width:d),r=!0,{width:d,height:u,x:f,y:m,top:m,right:f+d,bottom:m+u,left:f}}}}function Ht(t){return t!=null&&t.clientX!=null}function Eo(t,e={}){const n="rootStore"in t?t.rootStore:t,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{enabled:c=!0,axis:a="both",x:d=null,y:u=null}=e,f=p.useRef(!1),m=p.useRef(null),[l,g]=p.useState(),[h,R]=p.useState([]),x=Z((S,b,O)=>{f.current||i.current.openEvent&&!Ht(i.current.openEvent)||n.set("positionReference",bo(O??s,{x:S,y:b,axis:a,dataRef:i,pointerType:l}))}),v=Z(S=>{d!=null||u!=null||(o?m.current||R([]):x(S.clientX,S.clientY,S.currentTarget))}),E=Oe(l)?r:o,C=p.useCallback(()=>{if(!E||!c||d!=null||u!=null)return;const S=le(r);function b(O){const F=qe(O);ee(r,F)?(S.removeEventListener("mousemove",b),m.current=null):x(O.clientX,O.clientY)}if(!i.current.openEvent||Ht(i.current.openEvent)){S.addEventListener("mousemove",b);const O=()=>{S.removeEventListener("mousemove",b),m.current=null};return m.current=O,O}n.set("positionReference",s)},[E,c,d,u,r,i,s,n,x]);p.useEffect(()=>C(),[C,h]),p.useEffect(()=>{c&&!r&&(f.current=!1)},[c,r]),p.useEffect(()=>{!c&&o&&(f.current=!0)},[c,o]),z(()=>{c&&(d!=null||u!=null)&&(f.current=!1,x(d,u))},[c,d,u,x]);const P=p.useMemo(()=>{function S(b){g(b.pointerType)}return{onPointerDown:S,onPointerEnter:S,onMouseMove:v,onMouseEnter:v}},[v]);return p.useMemo(()=>c?{reference:P,trigger:P}:{},[c,P])}function Vt(t,e,n){let{reference:o,floating:r}=t;const s=re(e),i=ln(e),c=un(i),a=te(e),d=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let l;switch(a){case"top":l={x:u,y:o.y-r.height};break;case"bottom":l={x:u,y:o.y+o.height};break;case"right":l={x:o.x+o.width,y:f};break;case"left":l={x:o.x-r.width,y:f};break;default:l={x:o.x,y:o.y}}switch(be(e)){case"start":l[i]-=m*(n&&d?-1:1);break;case"end":l[i]+=m*(n&&d?-1:1);break}return l}async function Co(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:a}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:m=!1,padding:l=0}=de(e,t),g=an(l),R=c[m?f==="floating"?"reference":"floating":f],x=je(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(R)))==null||n?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:u,strategy:a})),v=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),C=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},P=je(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:E,strategy:a}):v);return{top:(x.top-P.top+g.top)/C.y,bottom:(P.bottom-x.bottom+g.bottom)/C.y,left:(x.left-P.left+g.left)/C.x,right:(P.right-x.right+g.right)/C.x}}const So=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=s.filter(Boolean),a=await(i.isRTL==null?void 0:i.isRTL(e));let d=await i.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=Vt(d,o,a),m=o,l={},g=0;for(let R=0;R<c.length;R++){var h;const{name:x,fn:v}=c[R],{x:E,y:C,data:P,reset:S}=await v({x:u,y:f,initialPlacement:o,placement:m,strategy:r,middlewareData:l,rects:d,platform:{...i,detectOverflow:(h=i.detectOverflow)!=null?h:Co},elements:{reference:t,floating:e}});u=E??u,f=C??f,l={...l,[x]:{...l[x],...P}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(d=S.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:r}):S.rects),{x:u,y:f}=Vt(d,m,a)),R=-1)}return{x:u,y:f,placement:m,strategy:r,middlewareData:l}},To=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:l="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...R}=de(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=te(r),v=re(c),E=te(c)===c,C=await(a.isRTL==null?void 0:a.isRTL(d.floating)),P=m||(E||!h?[mo(c)]:po(c)),S=g!=="none";!m&&S&&P.push(...ho(c,h,g,C));const b=[c,...P],O=await a.detectOverflow(e,R),F=[];let M=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&F.push(O[x]),f){const D=yo(r,i,C);F.push(O[D[0]],O[D[1]])}if(M=[...M,{placement:r,overflows:F}],!F.every(D=>D<=0)){var k,T;const D=(((k=s.flip)==null?void 0:k.index)||0)+1,I=b[D];if(I&&(!(f==="alignment"?v!==re(I):!1)||M.every(w=>re(w.placement)===v?w.overflows[0]>0:!0)))return{data:{index:D,overflows:M},reset:{placement:I}};let H=(T=M.filter(A=>A.overflows[0]<=0).sort((A,w)=>A.overflows[1]-w.overflows[1])[0])==null?void 0:T.placement;if(!H)switch(l){case"bestFit":{var y;const A=(y=M.filter(w=>{if(S){const L=re(w.placement);return L===v||L==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(L=>L>0).reduce((L,W)=>L+W,0)]).sort((w,L)=>w[1]-L[1])[0])==null?void 0:y[0];A&&(H=A);break}case"initialPlacement":H=c;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function Bt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function $t(t){return xo.some(e=>t[e]>=0)}const Po=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:r="referenceHidden",...s}=de(t,e);switch(r){case"referenceHidden":{const i=await o.detectOverflow(e,{...s,elementContext:"reference"}),c=Bt(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:$t(c)}}}case"escaped":{const i=await o.detectOverflow(e,{...s,altBoundary:!0}),c=Bt(i,n.floating);return{data:{escapedOffsets:c,escaped:$t(c)}}}default:return{}}}}},pn=new Set(["left","top"]);async function Oo(t,e){const{placement:n,platform:o,elements:r}=t,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=te(n),c=be(n),a=re(n)==="y",d=pn.has(i)?-1:1,u=s&&a?-1:1,f=de(e,t);let{mainAxis:m,crossAxis:l,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(l=c==="end"?g*-1:g),a?{x:l*u,y:m*d}:{x:m*d,y:l*u}}const Ao=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=e,a=await Oo(e,t);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:s+a.y,data:{...a,placement:i}}}}},Mo=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:s}=e,{mainAxis:i=!0,crossAxis:c=!1,limiter:a={fn:x=>{let{x:v,y:E}=x;return{x:v,y:E}}},...d}=de(t,e),u={x:n,y:o},f=await s.detectOverflow(e,d),m=re(te(r)),l=fn(m);let g=u[l],h=u[m];if(i){const x=l==="y"?"top":"left",v=l==="y"?"bottom":"right",E=g+f[x],C=g-f[v];g=it(E,g,C)}if(c){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",E=h+f[x],C=h-f[v];h=it(E,h,C)}const R=a.fn({...e,[l]:g,[m]:h});return{...R,data:{x:R.x-n,y:R.y-o,enabled:{[l]:i,[m]:c}}}}}},Lo=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=e,{offset:c=0,mainAxis:a=!0,crossAxis:d=!0}=de(t,e),u={x:n,y:o},f=re(r),m=fn(f);let l=u[m],g=u[f];const h=de(c,e),R=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(a){const E=m==="y"?"height":"width",C=s.reference[m]-s.floating[E]+R.mainAxis,P=s.reference[m]+s.reference[E]-R.mainAxis;l<C?l=C:l>P&&(l=P)}if(d){var x,v;const E=m==="y"?"width":"height",C=pn.has(te(r)),P=s.reference[f]-s.floating[E]+(C&&((x=i.offset)==null?void 0:x[f])||0)+(C?0:R.crossAxis),S=s.reference[f]+s.reference[E]+(C?0:((v=i.offset)==null?void 0:v[f])||0)-(C?R.crossAxis:0);g<P?g=P:g>S&&(g=S)}return{[m]:l,[f]:g}}}},Do=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:s,platform:i,elements:c}=e,{apply:a=()=>{},...d}=de(t,e),u=await i.detectOverflow(e,d),f=te(r),m=be(r),l=re(r)==="y",{width:g,height:h}=s.floating;let R,x;f==="top"||f==="bottom"?(R=f,x=m===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(x=f,R=m==="end"?"top":"bottom");const v=h-u.top-u.bottom,E=g-u.left-u.right,C=Me(h-u[R],v),P=Me(g-u[x],E),S=!e.middlewareData.shift;let b=C,O=P;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(O=E),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(b=v),S&&!m){const M=J(u.left,0),k=J(u.right,0),T=J(u.top,0),y=J(u.bottom,0);l?O=g-2*(M!==0||k!==0?M+k:J(u.left,u.right)):b=h-2*(T!==0||y!==0?T+y:J(u.top,u.bottom))}await a({...e,availableWidth:O,availableHeight:b});const F=await i.getDimensions(c.floating);return g!==F.width||h!==F.height?{reset:{rects:!0}}:{}}}};function hn(t){const e=ue(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=fe(t),s=r?t.offsetWidth:n,i=r?t.offsetHeight:o,c=Ye(n)!==s||Ye(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function gt(t){return j(t)?t:t.contextElement}function we(t){const e=gt(t);if(!fe(e))return ae(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:s}=hn(e);let i=(s?Ye(n.width):n.width)/o,c=(s?Ye(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Io=ae(0);function yn(t){const e=le(t);return!nn()||!e.visualViewport?Io:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ko(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==le(t)?!1:e}function pe(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=gt(t);let i=ae(1);e&&(o?j(o)&&(i=we(o)):i=we(t));const c=ko(s,n,o)?yn(s):ae(0);let a=(r.left+c.x)/i.x,d=(r.top+c.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const m=le(s),l=o&&j(o)?le(o):o;let g=m,h=kt(g);for(;h&&o&&l!==g;){const R=we(h),x=h.getBoundingClientRect(),v=ue(h),E=x.left+(h.clientLeft+parseFloat(v.paddingLeft))*R.x,C=x.top+(h.clientTop+parseFloat(v.paddingTop))*R.y;a*=R.x,d*=R.y,u*=R.x,f*=R.y,a+=E,d+=C,g=le(h),h=kt(g)}}return je({width:u,height:f,x:a,y:d})}function Ke(t,e){const n=ze(t).scrollLeft;return e?e.left+n:pe(ge(t)).left+n}function xn(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-Ke(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function Fo(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const s=r==="fixed",i=ge(o),c=e?ut(e.floating):!1;if(o===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},d=ae(1);const u=ae(0),f=fe(o);if((f||!f&&!s)&&((ft(o)!=="body"||dt(i))&&(a=ze(o)),fe(o))){const l=pe(o);d=we(o),u.x=l.x+o.clientLeft,u.y=l.y+o.clientTop}const m=i&&!f&&!s?xn(i,a):ae(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+u.x+m.x,y:n.y*d.y-a.scrollTop*d.y+u.y+m.y}}function Ho(t){return Array.from(t.getClientRects())}function Vo(t){const e=ge(t),n=ze(t),o=t.ownerDocument.body,r=J(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=J(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Ke(t);const c=-n.scrollTop;return ue(o).direction==="rtl"&&(i+=J(e.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const Wt=25;function Bo(t,e){const n=le(t),o=ge(t),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,a=0;if(r){s=r.width,i=r.height;const u=nn();(!u||u&&e==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}const d=Ke(o);if(d<=0){const u=o.ownerDocument,f=u.body,m=getComputedStyle(f),l=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(o.clientWidth-f.clientWidth-l);g<=Wt&&(s-=g)}else d<=Wt&&(s+=d);return{width:s,height:i,x:c,y:a}}const $o=new Set(["absolute","fixed"]);function Wo(t,e){const n=pe(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,s=fe(t)?we(t):ae(1),i=t.clientWidth*s.x,c=t.clientHeight*s.y,a=r*s.x,d=o*s.y;return{width:i,height:c,x:a,y:d}}function jt(t,e,n){let o;if(e==="viewport")o=Bo(t,n);else if(e==="document")o=Vo(ge(t));else if(j(e))o=Wo(e,n);else{const r=yn(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return je(o)}function vn(t,e){const n=Pe(t);return n===e||!j(n)||We(n)?!1:ue(n).position==="fixed"||vn(n,e)}function jo(t,e){const n=e.get(t);if(n)return n;let o=st(t,[],!1).filter(c=>j(c)&&ft(c)!=="body"),r=null;const s=ue(t).position==="fixed";let i=s?Pe(t):t;for(;j(i)&&!We(i);){const c=ue(i),a=on(i);!a&&c.position==="fixed"&&(r=null),(s?!a&&!r:!a&&c.position==="static"&&!!r&&$o.has(r.position)||dt(i)&&!a&&vn(t,i))?o=o.filter(u=>u!==i):r=c,i=Pe(i)}return e.set(t,o),o}function Yo(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[...n==="clippingAncestors"?ut(e)?[]:jo(e,this._c):[].concat(n),o],c=i[0],a=i.reduce((d,u)=>{const f=jt(e,u,r);return d.top=J(f.top,d.top),d.right=Me(f.right,d.right),d.bottom=Me(f.bottom,d.bottom),d.left=J(f.left,d.left),d},jt(e,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function No(t){const{width:e,height:n}=hn(t);return{width:e,height:n}}function Xo(t,e,n){const o=fe(e),r=ge(e),s=n==="fixed",i=pe(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const a=ae(0);function d(){a.x=Ke(r)}if(o||!o&&!s)if((ft(e)!=="body"||dt(r))&&(c=ze(e)),o){const l=pe(e,!0,s,e);a.x=l.x+e.clientLeft,a.y=l.y+e.clientTop}else r&&d();s&&!o&&r&&d();const u=r&&!o&&!s?xn(r,c):ae(0),f=i.left+c.scrollLeft-a.x-u.x,m=i.top+c.scrollTop-a.y-u.y;return{x:f,y:m,width:i.width,height:i.height}}function tt(t){return ue(t).position==="static"}function Yt(t,e){if(!fe(t)||ue(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ge(t)===n&&(n=n.ownerDocument.body),n}function Rn(t,e){const n=le(t);if(ut(t))return n;if(!fe(t)){let r=Pe(t);for(;r&&!We(r);){if(j(r)&&!tt(r))return r;r=Pe(r)}return n}let o=Yt(t,e);for(;o&&no(o)&&tt(o);)o=Yt(o,e);return o&&We(o)&&tt(o)&&!on(o)?n:o||oo(t)||n}const _o=async function(t){const e=this.getOffsetParent||Rn,n=this.getDimensions,o=await n(t.floating);return{reference:Xo(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Uo(t){return ue(t).direction==="rtl"}const zo={convertOffsetParentRelativeRectToViewportRelativeRect:Fo,getDocumentElement:ge,getClippingRect:Yo,getOffsetParent:Rn,getElementRects:_o,getClientRects:Ho,getDimensions:No,getScale:we,isElement:j,isRTL:Uo};function wn(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qo(t,e){let n=null,o;const r=ge(t);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const d=t.getBoundingClientRect(),{left:u,top:f,width:m,height:l}=d;if(c||e(),!m||!l)return;const g=ke(f),h=ke(r.clientWidth-(u+m)),R=ke(r.clientHeight-(f+l)),x=ke(u),E={rootMargin:-g+"px "+-h+"px "+-R+"px "+-x+"px",threshold:J(0,Me(1,a))||1};let C=!0;function P(S){const b=S[0].intersectionRatio;if(b!==a){if(!C)return i();b?i(!1,b):o=setTimeout(()=>{i(!1,1e-7)},1e3)}b===1&&!wn(d,t.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(P,{...E,root:r.ownerDocument})}catch{n=new IntersectionObserver(P,E)}n.observe(t)}return i(!0),s}function Nt(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,d=gt(t),u=r||s?[...d?st(d):[],...st(e)]:[];u.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=d&&c?qo(d,n):null;let m=-1,l=null;i&&(l=new ResizeObserver(x=>{let[v]=x;v&&v.target===d&&l&&(l.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=l)==null||E.observe(e)})),n()}),d&&!a&&l.observe(d),l.observe(e));let g,h=a?pe(t):null;a&&R();function R(){const x=pe(t);h&&!wn(h,x)&&n(),h=x,g=requestAnimationFrame(R)}return n(),()=>{var x;u.forEach(v=>{r&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),f?.(),(x=l)==null||x.disconnect(),l=null,a&&cancelAnimationFrame(g)}}const Go=Ao,Ko=Mo,Qo=To,Jo=Do,Zo=Po,er=Lo,tr=(t,e,n)=>{const o=new Map,r={platform:zo,...n},s={...r.platform,_c:o};return So(t,e,{...r,platform:s})};var nr=typeof document<"u",or=function(){},Ve=nr?p.useLayoutEffect:or;function Xe(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!Xe(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&t.$$typeof)&&!Xe(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function bn(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Xt(t,e){const n=bn(t);return Math.round(e*n)/n}function nt(t){const e=p.useRef(t);return Ve(()=>{e.current=t}),e}function rr(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:d}=t,[u,f]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,l]=p.useState(o);Xe(m,o)||l(o);const[g,h]=p.useState(null),[R,x]=p.useState(null),v=p.useCallback(w=>{w!==S.current&&(S.current=w,h(w))},[]),E=p.useCallback(w=>{w!==b.current&&(b.current=w,x(w))},[]),C=s||g,P=i||R,S=p.useRef(null),b=p.useRef(null),O=p.useRef(u),F=a!=null,M=nt(a),k=nt(r),T=nt(d),y=p.useCallback(()=>{if(!S.current||!b.current)return;const w={placement:e,strategy:n,middleware:m};k.current&&(w.platform=k.current),tr(S.current,b.current,w).then(L=>{const W={...L,isPositioned:T.current!==!1};D.current&&!Xe(O.current,W)&&(O.current=W,_e.flushSync(()=>{f(W)}))})},[m,e,n,k,T]);Ve(()=>{d===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(w=>({...w,isPositioned:!1})))},[d]);const D=p.useRef(!1);Ve(()=>(D.current=!0,()=>{D.current=!1}),[]),Ve(()=>{if(C&&(S.current=C),P&&(b.current=P),C&&P){if(M.current)return M.current(C,P,y);y()}},[C,P,y,M,F]);const I=p.useMemo(()=>({reference:S,floating:b,setReference:v,setFloating:E}),[v,E]),H=p.useMemo(()=>({reference:C,floating:P}),[C,P]),A=p.useMemo(()=>{const w={position:n,left:0,top:0};if(!H.floating)return w;const L=Xt(H.floating,u.x),W=Xt(H.floating,u.y);return c?{...w,transform:"translate("+L+"px, "+W+"px)",...bn(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:W}},[n,c,H.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:y,refs:I,elements:H,floatingStyles:A}),[u,y,I,H,A])}const sr=(t,e)=>({...Go(t),options:[t,e]}),ir=(t,e)=>({...Ko(t),options:[t,e]}),cr=(t,e)=>({...er(t),options:[t,e]}),lr=(t,e)=>({...Qo(t),options:[t,e]}),ar=(t,e)=>({...Jo(t),options:[t,e]}),ur=(t,e)=>({...Zo(t),options:[t,e]});function fr(t){const{open:e=!1,onOpenChange:n,elements:o={}}=t,r=ro(),s=Qt()!=null,i=qt(()=>new $n({open:e,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new Jt,floatingId:r,nested:s,noEmit:t.noEmit||!1})).current;return z(()=>{const c={open:e,floatingId:r};o.reference!==void 0&&(c.referenceElement=o.reference,c.domReferenceElement=j(o.reference)?o.reference:null),o.floating!==void 0&&(c.floatingElement=o.floating),i.update(c)},[e,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=t.noEmit||!1,i}function dr(t={}){const{nodeId:e,externalTree:n}=t,o=fr(t),r=t.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,c]=p.useState(null),a=p.useRef(null),d=at(n);z(()=>{s.domReference&&(a.current=s.domReference)},[s.domReference]);const u=rr({...t,elements:{...s,...i&&{reference:i}}}),f=p.useCallback(b=>{const O=j(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),getClientRects:()=>b.getClientRects(),contextElement:b}:b;c(O),u.refs.setReference(O)},[u.refs]),[m,l]=p.useState(null),[g,h]=p.useState(null);r.useSyncedValue("referenceElement",m),r.useSyncedValue("domReferenceElement",j(m)?m:null),r.useSyncedValue("floatingElement",g);const R=p.useCallback(b=>{(j(b)||b===null)&&(a.current=b,l(b)),(j(u.refs.reference.current)||u.refs.reference.current===null||b!==null&&!j(b))&&u.refs.setReference(b)},[u.refs,l]),x=p.useCallback(b=>{h(b),u.refs.setFloating(b)},[u.refs]),v=p.useMemo(()=>({...u.refs,setReference:R,setFloating:x,setPositionReference:f,domReference:a}),[u.refs,R,x,f]),E=p.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),C=r.useState("open"),P=r.useState("floatingId"),S=p.useMemo(()=>({...u,dataRef:r.context.dataRef,open:C,onOpenChange:r.setOpen,events:r.context.events,floatingId:P,refs:v,elements:E,nodeId:e,rootStore:r}),[u,v,E,e,r,C,P]);return z(()=>{r.context.dataRef.current.floatingContext=S;const b=d?.nodesRef.current.find(O=>O.id===e);b&&(b.context=S)}),p.useMemo(()=>({...u,context:S,refs:v,elements:E,rootStore:r}),[u,v,E,S,r])}const ot=uo&&fo;function gr(t,e={}){const n="rootStore"in t?t.rootStore:t,{events:o,dataRef:r}=n.context,{enabled:s=!0,visibleOnly:i=!0,delay:c}=e,a=p.useRef(!1),d=p.useRef(null),u=$e(),f=p.useRef(!0);p.useEffect(()=>{const l=n.select("domReferenceElement");if(!s)return;const g=le(l);function h(){const v=n.select("domReferenceElement");!n.select("open")&&fe(v)&&v===Ft(Ae(v))&&(a.current=!0)}function R(){f.current=!0}function x(){f.current=!1}return g.addEventListener("blur",h),ot&&(g.addEventListener("keydown",R,!0),g.addEventListener("pointerdown",x,!0)),()=>{g.removeEventListener("blur",h),ot&&(g.removeEventListener("keydown",R,!0),g.removeEventListener("pointerdown",x,!0))}},[n,s]),p.useEffect(()=>{if(!s)return;function l(g){if(g.reason===rn||g.reason===sn){const h=n.select("domReferenceElement");j(h)&&(d.current=h,a.current=!0)}}return o.on("openchange",l),()=>{o.off("openchange",l)}},[o,s,n]);const m=p.useMemo(()=>({onMouseLeave(){a.current=!1,d.current=null},onFocus(l){const g=l.currentTarget;if(a.current){if(d.current===g)return;a.current=!1,d.current=null}const h=qe(l.nativeEvent);if(i&&j(h)){if(ot&&!l.relatedTarget){if(!f.current&&!lo(h))return}else if(!ao(h))return}const R=l.relatedTarget&&n.context.triggerElements.hasElement(l.relatedTarget),{nativeEvent:x,currentTarget:v}=l,E=typeof c=="function"?c():c;if(n.select("open")&&R||E===0||E===void 0){n.setOpen(!0,G(Fe,x,v));return}u.start(E,()=>{a.current||n.setOpen(!0,G(Fe,x,v))})},onBlur(l){a.current=!1,d.current=null;const g=l.relatedTarget,h=l.nativeEvent,R=j(g)&&g.hasAttribute(Zt("focus-guard"))&&g.getAttribute("data-type")==="outside";u.start(0,()=>{const x=n.select("domReferenceElement"),v=Ft(x?x.ownerDocument:document);if(!g&&v===x||ee(r.current.floatingContext?.refs.floating.current,v)||ee(x,v)||R)return;const E=g??v;if(j(E)){const C=n.context.triggerElements;if(C.hasElement(E)||C.hasMatchingElement(P=>ee(P,E)))return}n.setOpen(!1,G(Fe,h))})}}),[r,n,i,u,c]);return p.useMemo(()=>s?{reference:m,trigger:m}:{},[s,m])}const ct=Zt("safe-polygon"),mr=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${go}`;function pr(t){return t?!!t.closest(mr):!1}function En(t){const e=p.useRef(void 0),n=p.useRef(!1),o=p.useRef(void 0),r=p.useRef(!0),s=p.useRef(!1),i=p.useRef(()=>{}),c=p.useRef(!1),a=$e(),d=$e(),u=p.useRef(void 0);return p.useMemo(()=>{const f=t.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:e,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:r,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:c,openChangeTimeout:a,restTimeout:d,handleCloseOptionsRef:u}),f.hoverInteractionState},[t,e,n,o,r,s,i,c,a,d,u])}const hr=new Set(["click","mousedown"]);function yr(t,e={}){const n="rootStore"in t?t.rootStore:t,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:c=!0,closeDelay:a=0,externalTree:d}=e,{pointerTypeRef:u,interactedInsideRef:f,handlerRef:m,performedPointerEventsMutationRef:l,unbindMouseMoveRef:g,restTimeoutPendingRef:h,openChangeTimeout:R,handleCloseOptionsRef:x}=En(n),v=at(d),E=Qt(),C=Z(()=>f.current?!0:i.current.openEvent?hr.has(i.current.openEvent.type):!1),P=Z(()=>{const M=i.current.openEvent?.type;return M?.includes("mouse")&&M!=="mousedown"}),S=p.useCallback((M,k=!0)=>{const T=xr(a,u.current);T&&!m.current?R.start(T,()=>n.setOpen(!1,G(ce,M))):k&&(R.clear(),n.setOpen(!1,G(ce,M)))},[a,m,n,u,R]),b=Z(()=>{g.current(),m.current=void 0}),O=Z(()=>{if(l.current){const M=Ae(r).body;M.style.pointerEvents="",M.removeAttribute(ct),l.current=!1}}),F=Z(M=>{const k=qe(M);if(!pr(k)){f.current=!1;return}f.current=!0});z(()=>{o||(u.current=void 0,h.current=!1,f.current=!1,b(),O())},[o,u,h,f,b,O]),p.useEffect(()=>()=>{b()},[b]),p.useEffect(()=>O,[O]),z(()=>{if(c&&o&&x.current?.blockPointerEvents&&P()&&j(s)&&r){l.current=!0;const M=Ae(r).body;M.setAttribute(ct,"");const k=s,T=r,y=v?.nodesRef.current.find(D=>D.id===E)?.context?.elements.floating;return y&&(y.style.pointerEvents=""),M.style.pointerEvents="none",k.style.pointerEvents="auto",T.style.pointerEvents="auto",()=>{M.style.pointerEvents="",k.style.pointerEvents="",T.style.pointerEvents=""}}},[c,o,s,r,x,P,v,E,l]),p.useEffect(()=>{if(!c)return;function M(D){if(C()||!i.current.floatingContext||!n.select("open"))return;const I=n.context.triggerElements;D.relatedTarget&&I.hasElement(D.relatedTarget)||(O(),b(),C()||S(D))}function k(D){R.clear(),O(),m.current?.(D),b()}function T(D){C()||S(D,!1)}const y=r;return y&&(y.addEventListener("mouseleave",M),y.addEventListener("mouseenter",k),y.addEventListener("mouseleave",T),y.addEventListener("pointerdown",F,!0)),()=>{y&&(y.removeEventListener("mouseleave",M),y.removeEventListener("mouseenter",k),y.removeEventListener("mouseleave",T),y.removeEventListener("pointerdown",F,!0))}})}function xr(t,e){return e&&!Oe(e)?0:typeof t=="function"?t():t}function rt(t){return typeof t=="function"?t():t}const vr={current:null};function Rr(t,e={}){const n="rootStore"in t?t.rootStore:t,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:c=null,mouseOnly:a=!1,restMs:d=0,move:u=!0,triggerElementRef:f=vr,externalTree:m,isActiveTrigger:l=!0}=e,g=at(m),{pointerTypeRef:h,interactedInsideRef:R,handlerRef:x,blockMouseMoveRef:v,performedPointerEventsMutationRef:E,unbindMouseMoveRef:C,restTimeoutPendingRef:P,openChangeTimeout:S,restTimeout:b,handleCloseOptionsRef:O}=En(n),F=Re(c),M=Re(i),k=Re(d);l&&(O.current=F.current?.__options);const T=Z(()=>R.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),y=p.useCallback((A,w=!0)=>{const L=He(M.current,"close",h.current);L&&!x.current?S.start(L,()=>n.setOpen(!1,G(ce,A))):w&&(S.clear(),n.setOpen(!1,G(ce,A)))},[M,x,n,h,S]),D=Z(()=>{C.current(),x.current=void 0}),I=Z(()=>{if(E.current){const A=Ae(n.select("domReferenceElement")).body;A.style.pointerEvents="",A.removeAttribute(ct),E.current=!1}});p.useEffect(()=>{if(!s)return;function A(w){w.open||(S.clear(),b.clear(),v.current=!0,P.current=!1)}return r.on("openchange",A),()=>{r.off("openchange",A)}},[s,r,S,b,v,P]);const H=Z(A=>{if(T()||!o.current.floatingContext)return;const w=n.context.triggerElements;if(A.relatedTarget&&w.hasElement(A.relatedTarget))return;const L=f.current;F.current?.({...o.current.floatingContext,tree:g,x:A.clientX,y:A.clientY,onClose(){I(),D(),!T()&&L===n.select("domReferenceElement")&&y(A)}})(A)});return p.useEffect(()=>{if(!s)return;const A=f.current??(l?n.select("domReferenceElement"):null);if(!j(A))return;function w(B){if(S.clear(),v.current=!1,a&&!Oe(h.current)||rt(k.current)>0&&!He(M.current,"open"))return;const U=He(M.current,"open",h.current),X=n.select("domReferenceElement"),Y=n.context.triggerElements,_=(Y.hasElement(B.target)||Y.hasMatchingElement(se=>ee(se,B.target)))&&(!X||!ee(X,B.target)),V=B.currentTarget??null,$=n.select("open"),ne=!$||_;_&&$?n.setOpen(!0,G(ce,B,V)):U?S.start(U,()=>{ne&&n.setOpen(!0,G(ce,B,V))}):ne&&n.setOpen(!0,G(ce,B,V))}function L(B){if(T()){I();return}C.current();const U=n.select("domReferenceElement"),X=Ae(U);b.clear(),P.current=!1;const Y=n.context.triggerElements;if(B.relatedTarget&&Y.hasElement(B.relatedTarget))return;if(F.current&&o.current.floatingContext){n.select("open")||S.clear();const V=f.current;x.current=F.current({...o.current.floatingContext,tree:g,x:B.clientX,y:B.clientY,onClose(){I(),D(),!T()&&V===n.select("domReferenceElement")&&y(B,!0)}});const $=x.current;$(B),X.addEventListener("mousemove",$),C.current=()=>{X.removeEventListener("mousemove",$)};return}(h.current!=="touch"||!ee(n.select("floatingElement"),B.relatedTarget))&&y(B)}function W(B){H(B)}return n.select("open")&&A.addEventListener("mouseleave",W),u&&A.addEventListener("mousemove",w,{once:!0}),A.addEventListener("mouseenter",w),A.addEventListener("mouseleave",L),()=>{A.removeEventListener("mouseleave",W),u&&A.removeEventListener("mousemove",w),A.removeEventListener("mouseenter",w),A.removeEventListener("mouseleave",L)}},[D,I,v,o,M,y,n,s,F,H,l,T,a,u,h,k,b,P,S,f,g,C,x]),p.useMemo(()=>{function A(w){h.current=w.pointerType}return{onPointerDown:A,onPointerEnter:A,onMouseMove(w){const{nativeEvent:L}=w,W=w.currentTarget,B=n.select("domReferenceElement"),U=n.context.triggerElements,X=n.select("open"),Y=(U.hasElement(w.target)||U.hasMatchingElement(V=>ee(V,w.target)))&&(!B||!ee(B,w.target));if(a&&!Oe(h.current)||X&&!Y||rt(k.current)===0||!Y&&P.current&&w.movementX**2+w.movementY**2<2)return;b.clear();function _(){if(P.current=!1,T())return;const V=n.select("open");!v.current&&(!V||Y)&&n.setOpen(!0,G(ce,L,W))}h.current==="touch"?_e.flushSync(()=>{_()}):Y&&X?_():(P.current=!0,b.start(rt(k.current),_))}}},[v,T,a,n,h,k,b,P])}function _t(t,e){const[n,o]=t;let r=!1;const s=e.length;for(let i=0,c=s-1;i<s;c=i++){const[a,d]=e[i]||[0,0],[u,f]=e[c]||[0,0];d>=o!=f>=o&&n<=(u-a)*(o-d)/(f-d)+a&&(r=!r)}return r}function wr(t,e){return t[0]>=e.x&&t[0]<=e.x+e.width&&t[1]>=e.y&&t[1]<=e.y+e.height}function br(t={}){const{buffer:e=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=t,r=new Kt;let s=!1,i=null,c=null,a=typeof performance<"u"?performance.now():0;function d(f,m){const l=performance.now(),g=l-a;if(i===null||c===null||g===0)return i=f,c=m,a=l,null;const h=f-i,R=m-c,v=Math.sqrt(h*h+R*R)/g;return i=f,c=m,a=l,v}const u=({x:f,y:m,placement:l,elements:g,onClose:h,nodeId:R,tree:x})=>function(E){function C(){r.clear(),h()}if(r.clear(),!g.domReference||!g.floating||l==null||f==null||m==null)return;const{clientX:P,clientY:S}=E,b=[P,S],O=qe(E),F=E.type==="mouseleave",M=ee(g.floating,O),k=ee(g.domReference,O),T=g.domReference.getBoundingClientRect(),y=g.floating.getBoundingClientRect(),D=l.split("-")[0],I=f>y.right-y.width/2,H=m>y.bottom-y.height/2,A=wr(b,T),w=y.width>T.width,L=y.height>T.height,W=(w?T:y).left,B=(w?T:y).right,U=(L?T:y).top,X=(L?T:y).bottom;if(M&&(s=!0,!F))return;if(k&&(s=!1),k&&!F){s=!0;return}if(F&&j(E.relatedTarget)&&ee(g.floating,E.relatedTarget)||x&&Wn(x.nodesRef.current,R).some(({context:V})=>V?.open))return;if(D==="top"&&m>=T.bottom-1||D==="bottom"&&m<=T.top+1||D==="left"&&f>=T.right-1||D==="right"&&f<=T.left+1)return C();let Y=[];switch(D){case"top":Y=[[W,T.top+1],[W,y.bottom-1],[B,y.bottom-1],[B,T.top+1]];break;case"bottom":Y=[[W,y.top+1],[W,T.bottom-1],[B,T.bottom-1],[B,y.top+1]];break;case"left":Y=[[y.right-1,X],[y.right-1,U],[T.left+1,U],[T.left+1,X]];break;case"right":Y=[[T.right-1,X],[T.right-1,U],[y.left+1,U],[y.left+1,X]];break}function _([V,$]){switch(D){case"top":{const ne=[w?V+e/2:I?V+e*4:V-e*4,$+e+1],se=[w?V-e/2:I?V+e*4:V-e*4,$+e+1],oe=[[y.left,I||w?y.bottom-e:y.top],[y.right,I?w?y.bottom-e:y.top:y.bottom-e]];return[ne,se,...oe]}case"bottom":{const ne=[w?V+e/2:I?V+e*4:V-e*4,$-e],se=[w?V-e/2:I?V+e*4:V-e*4,$-e],oe=[[y.left,I||w?y.top+e:y.bottom],[y.right,I?w?y.top+e:y.bottom:y.top+e]];return[ne,se,...oe]}case"left":{const ne=[V+e+1,L?$+e/2:H?$+e*4:$-e*4],se=[V+e+1,L?$-e/2:H?$+e*4:$-e*4];return[...[[H||L?y.right-e:y.left,y.top],[H?L?y.right-e:y.left:y.right-e,y.bottom]],ne,se]}case"right":{const ne=[V-e,L?$+e/2:H?$+e*4:$-e*4],se=[V-e,L?$-e/2:H?$+e*4:$-e*4],oe=[[H||L?y.left+e:y.right,y.top],[H?L?y.left+e:y.right:y.left+e,y.bottom]];return[ne,se,...oe]}default:return[]}}if(!_t([P,S],Y)){if(s&&!A)return C();if(!F&&o){const V=d(E.clientX,E.clientY);if(V!==null&&V<.1)return C()}_t([P,S],_([f,m]))?!s&&o&&r.start(40,C):C()}};return u.__options={blockPointerEvents:n},u}const Er={...Yn,disabled:me(t=>t.disabled),instantType:me(t=>t.instantType),isInstantPhase:me(t=>t.isInstantPhase),trackCursorAxis:me(t=>t.trackCursorAxis),disableHoverablePopup:me(t=>t.disableHoverablePopup),lastOpenChangeReason:me(t=>t.openChangeReason),closeDelay:me(t=>t.closeDelay),hasViewport:me(t=>t.hasViewport)};class mt extends jn{constructor(e){super({...Cr(),...e},{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Jt},Er)}setOpen=(e,n)=>{const o=n.reason,r=o===ce,s=e&&o===Fe,i=!e&&(o===rn||o===sn);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,n),n.isCanceled)return;const c=()=>{const a={open:e,openChangeReason:o};s?a.instantType="focus":i?a.instantType="dismiss":o===ce&&(a.instantType=void 0);const d=n.trigger?.id??null;(d||e)&&(a.activeTriggerId=d,a.activeTriggerElement=n.trigger??null),this.update(a)};r?_e.flushSync(c):c()};static useStore(e,n){const o=qt(()=>new mt(n)).current,r=e??o,s=Nn({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=s,r}}function Cr(){return{...Xn(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}function Sr(t){const{disabled:e=!1,defaultOpen:n=!1,open:o,disableHoverablePopup:r=!1,trackCursorAxis:s="none",actionsRef:i,onOpenChange:c,onOpenChangeComplete:a,handle:d,triggerId:u,defaultTriggerId:f=null,children:m}=t,l=mt.useStore(d?.store,{open:o??n,activeTriggerId:u!==void 0?u:f});l.useControlledProp("open",o,n),l.useControlledProp("activeTriggerId",u,f),l.useContextCallback("onOpenChange",c),l.useContextCallback("onOpenChangeComplete",a);const g=l.useState("open"),h=!e&&g,R=l.useState("activeTriggerId"),x=l.useState("payload");l.useSyncedValues({trackCursorAxis:s,disableHoverablePopup:r}),z(()=>{g&&e&&l.setOpen(!1,G(so))},[g,e,l]),l.useSyncedValue("disabled",e),_n(l);const{forceUnmount:v,transitionStatus:E}=Un(h,l),C=l.useState("isInstantPhase"),P=l.useState("instantType"),S=l.useState("lastOpenChangeReason"),b=p.useRef(null);z(()=>{E==="ending"&&S===tn||E!=="ending"&&C?(P!=="delay"&&(b.current=P),l.set("instantType","delay")):b.current!==null&&(l.set("instantType",b.current),b.current=null)},[E,C,S,P,l]),z(()=>{h&&R==null&&l.set("payload",void 0)},[l,R,h]);const O=p.useCallback(()=>{l.setOpen(!1,Tr(l,io))},[l]);p.useImperativeHandle(i,()=>({unmount:v,close:O}),[v,O]);const F=l.useState("floatingRootContext"),M=gr(F,{enabled:!e}),k=zn(F,{enabled:!e,referencePress:!0}),T=Eo(F,{enabled:!e&&s!=="none",axis:s==="none"?void 0:s}),{getReferenceProps:y,getFloatingProps:D,getTriggerProps:I}=qn([M,k,T]),H=p.useMemo(()=>y(),[y]),A=p.useMemo(()=>I(),[I]),w=p.useMemo(()=>D(),[D]);return l.useSyncedValues({activeTriggerProps:H,inactiveTriggerProps:A,popupProps:w}),K.jsx(gn.Provider,{value:l,children:typeof m=="function"?m({payload:x}):m})}function Tr(t,e){const n=G(e);return n.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},n}const Cn=p.createContext(void 0);function Pr(){return p.useContext(Cn)}const Or=600,Ar=p.forwardRef(function(e,n){const{className:o,render:r,handle:s,payload:i,disabled:c,delay:a,closeDelay:d,id:u,...f}=e,m=Ge(!0),l=s?.store??m;if(!l)throw new Error(Ue(82));const g=co(u),h=l.useState("isTriggerActive",g),R=l.useState("isOpenedByTrigger",g),x=l.useState("floatingRootContext"),v=p.useRef(null),E=a??Or,C=d??0,{registerTrigger:P,isMountedByThisTrigger:S}=Gn(g,v,l,{payload:i,closeDelay:C}),b=Pr(),{delayRef:O,isInstantPhase:F,hasProvider:M}=wo(x,{open:R});l.useSyncedValue("isInstantPhase",F);const k=l.useState("disabled"),T=c??k,y=l.useState("trackCursorAxis"),D=l.useState("disableHoverablePopup"),I=Rr(x,{enabled:!T,mouseOnly:!0,move:!1,handleClose:!D&&y!=="both"?br():null,restMs(){const L=b?.delay,W=typeof O.current=="object"?O.current.open:void 0;let B=E;return M&&(W!==0?B=a??L??E:B=0),B},delay(){const L=typeof O.current=="object"?O.current.close:void 0;let W=C;return d==null&&M&&(W=L),{close:W}},triggerElementRef:v,isActiveTrigger:h}),H=p.useMemo(()=>({open:R}),[R]),A=l.useState("triggerProps",S);return lt("button",e,{state:H,ref:[n,P,v],props:[I,A,{id:g},f],stateAttributesMapping:Kn})}),Sn=p.createContext(void 0);function Mr(){const t=p.useContext(Sn);if(t===void 0)throw new Error(Ue(70));return t}const Lr=p.forwardRef(function(e,n){const{children:o,container:r,className:s,render:i,...c}=e,{portalNode:a,portalSubtree:d}=Qn({container:r,ref:n,componentProps:e,elementProps:c});return!d&&!a?null:K.jsxs(p.Fragment,{children:[d,a&&_e.createPortal(o,a)]})}),Dr=p.forwardRef(function(e,n){const{keepMounted:o=!1,...r}=e;return Ge().useState("mounted")||o?K.jsx(Sn.Provider,{value:o,children:K.jsx(Lr,{ref:n,...r})}):null}),Tn=p.createContext(void 0);function Ir(){const t=p.useContext(Tn);if(t===void 0)throw new Error(Ue(71));return t}const kr=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:a}=e,{element:d,padding:u=0,offsetParent:f="real"}=de(t,e)||{};if(d==null)return{};const m=an(u),l={x:n,y:o},g=ln(r),h=un(g),R=await i.getDimensions(d),x=g==="y",v=x?"top":"left",E=x?"bottom":"right",C=x?"clientHeight":"clientWidth",P=s.reference[h]+s.reference[g]-l[g]-s.floating[h],S=l[g]-s.reference[g],b=f==="real"?await i.getOffsetParent?.(d):c.floating;let O=c.floating[C]||s.floating[h];(!O||!await i.isElement?.(b))&&(O=c.floating[C]||s.floating[h]);const F=P/2-S/2,M=O/2-R[h]/2-1,k=Math.min(m[v],M),T=Math.min(m[E],M),y=k,D=O-R[h]-T,I=O/2-R[h]/2+F,H=it(y,I,D),A=!a.arrow&&be(r)!=null&&I!==H&&s.reference[h]/2-(I<y?k:T)-R[h]/2<0,w=A?I<y?I-y:I-D:0;return{[g]:l[g]+w,data:{[g]:H,centerOffset:I-H-w,...A&&{alignmentOffset:w}},reset:A}}}),Fr=(t,e)=>({...kr(t),options:[t,e]}),Hr={name:"hide",async fn(t){const{width:e,height:n,x:o,y:r}=t.rects.reference,s=e===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await ur().fn(t)).data?.referenceHidden||s}}}},Be={sideX:"left",sideY:"top"},Vr={name:"adaptiveOrigin",async fn(t){const{x:e,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:c}=t,a=le(r),d=a.getComputedStyle(r);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:e,y:n,data:Be};const f=await s.getOffsetParent?.(r);let m={width:0,height:0};if(i==="fixed"&&a?.visualViewport)m={width:a.visualViewport.width,height:a.visualViewport.height};else if(f===a){const v=cn(r);m={width:v.documentElement.clientWidth,height:v.documentElement.clientHeight}}else await s.isElement?.(f)&&(m=await s.getDimensions(f));const l=te(c);let g=e,h=n;l==="left"&&(g=m.width-(e+o.width)),l==="top"&&(h=m.height-(n+o.height));const R=l==="left"?"right":Be.sideX,x=l==="top"?"bottom":Be.sideY;return{x:g,y:h,data:{sideX:R,sideY:x}}}};function Pn(t,e,n){const o=t==="inline-start"||t==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[e]}function Ut(t,e,n){const{rects:o,placement:r}=t;return{side:Pn(e,te(r),n),align:be(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Br(t){const{anchor:e,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:a=5,sticky:d=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:m=!1,floatingRootContext:l,mounted:g,collisionAvoidance:h,shiftCrossAxis:R=!1,nodeId:x,adaptiveOrigin:v,lazyFlip:E=!1,externalTree:C}=t,[P,S]=p.useState(null);!g&&P!==null&&S(null);const b=h.side||"flip",O=h.align||"flip",F=h.fallbackAxisSide||"end",M=typeof e=="function"?e:void 0,k=Z(M),T=M?k:e,y=Re(e),I=vo()==="rtl",H=P||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[o],A=s==="center"?H:`${H}-${s}`;let w=a;const L=1,W=o==="bottom"?L:0,B=o==="top"?L:0,U=o==="right"?L:0,X=o==="left"?L:0;typeof w=="number"?w={top:w+W,right:w+X,bottom:w+B,left:w+U}:w&&(w={top:(w.top||0)+W,right:(w.right||0)+X,bottom:(w.bottom||0)+B,left:(w.left||0)+U});const Y={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:w},_=p.useRef(null),V=Re(r),$=Re(i),oe=[sr(N=>{const q=Ut(N,o,I),ie=typeof V.current=="function"?V.current(q):V.current,Q=typeof $.current=="function"?$.current(q):$.current;return{mainAxis:ie,crossAxis:Q,alignmentAxis:Q}},[typeof r!="function"?r:0,typeof i!="function"?i:0,I,o])],pt=O==="none"&&b!=="shift",ht=!pt&&(d||R||b==="shift"),yt=b==="none"?null:lr({...Y,padding:{top:w.top+L,right:w.right+L,bottom:w.bottom+L,left:w.left+L},mainAxis:!R&&b==="flip",crossAxis:O==="flip"?"alignment":!1,fallbackAxisSideDirection:F}),xt=pt?null:ir(N=>{const q=cn(N.elements.floating).documentElement;return{...Y,rootBoundary:R?{x:0,y:0,width:q.clientWidth,height:q.clientHeight}:void 0,mainAxis:O!=="none",crossAxis:ht,limiter:d||R?void 0:cr(ie=>{if(!_.current)return{};const{width:Q,height:xe}=_.current.getBoundingClientRect(),ve=re(te(ie.placement)),Ie=ve==="y"?Q:xe,Ze=ve==="y"?w.left+w.right:w.top+w.bottom;return{offset:Ie/2+Ze/2}})}},[Y,d,R,w,O]);b==="shift"||O==="shift"||s==="center"?oe.push(xt,yt):oe.push(yt,xt),oe.push(ar({...Y,apply({elements:{floating:N},rects:{reference:q},availableWidth:ie,availableHeight:Q}){Object.entries({"--available-width":`${ie}px`,"--available-height":`${Q}px`,"--anchor-width":`${q.width}px`,"--anchor-height":`${q.height}px`}).forEach(([xe,ve])=>{N.style.setProperty(xe,ve)})}}),Fr(()=>({element:_.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(N){const{elements:q,middlewareData:ie,placement:Q,rects:xe,y:ve}=N,Ie=te(Q),Ze=re(Ie),Dt=_.current,An=ie.arrow?.x||0,Mn=ie.arrow?.y||0,Ln=Dt?.clientWidth||0,Dn=Dt?.clientHeight||0,et=An+Ln/2,It=Mn+Dn/2,In=Math.abs(ie.shift?.y||0),kn=xe.reference.height/2,Te=typeof r=="function"?r(Ut(N,o,I)):r,Fn=In>Te,Hn={top:`${et}px calc(100% + ${Te}px)`,bottom:`${et}px ${-Te}px`,left:`calc(100% + ${Te}px) ${It}px`,right:`${-Te}px ${It}px`}[Ie],Vn=`${et}px ${xe.reference.y+kn-ve}px`;return q.floating.style.setProperty("--transform-origin",ht&&Ze==="y"&&Fn?Vn:Hn),{}}},Hr,v),z(()=>{!g&&l&&l.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,l]);const Qe=p.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:he,elements:Ee,x:vt,y:Rt,middlewareData:ye,update:Le,placement:wt,context:bt,isPositioned:Ce,floatingStyles:Et}=dr({rootContext:l,placement:A,middleware:oe,strategy:n,whileElementsMounted:m?void 0:(...N)=>Nt(...N,Qe),nodeId:x,externalTree:C}),{sideX:Ct,sideY:St}=ye.adaptiveOrigin||Be,Je=Ce?n:"fixed",Tt=p.useMemo(()=>v?{position:Je,[Ct]:vt,[St]:Rt}:{position:Je,...Et},[v,Je,Ct,vt,St,Rt,Et]),De=p.useRef(null);z(()=>{if(!g)return;const N=y.current,q=typeof N=="function"?N():N,Q=(zt(q)?q.current:q)||null||null;Q!==De.current&&(he.setPositionReference(Q),De.current=Q)},[g,he,T,y]),p.useEffect(()=>{if(!g)return;const N=y.current;typeof N!="function"&&zt(N)&&N.current!==De.current&&(he.setPositionReference(N.current),De.current=N.current)},[g,he,T,y]),p.useEffect(()=>{if(m&&g&&Ee.domReference&&Ee.floating)return Nt(Ee.domReference,Ee.floating,Le,Qe)},[m,g,Ee,Le,Qe]);const Se=te(wt),Pt=Pn(o,Se,I),Ot=be(wt)||"center",At=!!ye.hide?.referenceHidden;z(()=>{E&&g&&Ce&&S(Se)},[E,g,Ce,Se]);const Mt=p.useMemo(()=>({position:"absolute",top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Lt=ye.arrow?.centerOffset!==0;return p.useMemo(()=>({positionerStyles:Tt,arrowStyles:Mt,arrowRef:_,arrowUncentered:Lt,side:Pt,align:Ot,physicalSide:Se,anchorHidden:At,refs:he,context:bt,isPositioned:Ce,update:Le}),[Tt,Mt,_,Lt,Pt,Ot,Se,At,he,bt,Ce,Le])}function zt(t){return t!=null&&"current"in t}function On(t){return t==="starting"?Jn:Bn}const $r=p.forwardRef(function(e,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:c="top",align:a="center",sideOffset:d=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:m=5,arrowPadding:l=5,sticky:g=!1,disableAnchorTracking:h=!1,collisionAvoidance:R=Zn,...x}=e,v=Ge(),E=Mr(),C=v.useState("open"),P=v.useState("mounted"),S=v.useState("trackCursorAxis"),b=v.useState("disableHoverablePopup"),O=v.useState("floatingRootContext"),F=v.useState("instantType"),M=v.useState("transitionStatus"),k=v.useState("hasViewport"),T=Br({anchor:s,positionMethod:i,floatingRootContext:O,mounted:P,side:c,sideOffset:d,align:a,alignOffset:u,collisionBoundary:f,collisionPadding:m,sticky:g,arrowPadding:l,disableAnchorTracking:h,keepMounted:E,collisionAvoidance:R,adaptiveOrigin:k?Vr:void 0}),y=p.useMemo(()=>{const A={};return(!C||S==="both"||b)&&(A.pointerEvents="none"),{role:"presentation",hidden:!P,style:{...T.positionerStyles,...A}}},[C,S,b,P,T.positionerStyles]),D=p.useMemo(()=>({open:C,side:T.side,align:T.align,anchorHidden:T.anchorHidden,instant:S!=="none"?"tracking-cursor":F}),[C,T.side,T.align,T.anchorHidden,S,F]),I=p.useMemo(()=>({...D,arrowRef:T.arrowRef,arrowStyles:T.arrowStyles,arrowUncentered:T.arrowUncentered}),[D,T.arrowRef,T.arrowStyles,T.arrowUncentered]),H=lt("div",e,{state:D,props:[y,On(M),x],ref:[n,v.useStateSetter("positionerElement")],stateAttributesMapping:en});return K.jsx(Tn.Provider,{value:I,children:H})}),Wr={...en,...to},jr=p.forwardRef(function(e,n){const{className:o,render:r,...s}=e,i=Ge(),{side:c,align:a}=Ir(),d=i.useState("open"),u=i.useState("instantType"),f=i.useState("transitionStatus"),m=i.useState("popupProps"),l=i.useState("floatingRootContext");eo({open:d,ref:i.context.popupRef,onComplete(){d&&i.context.onOpenChangeComplete?.(!0)}});const g=i.useState("disabled"),h=i.useState("closeDelay");yr(l,{enabled:!g,closeDelay:h});const R=p.useMemo(()=>({open:d,side:c,align:a,instant:u,transitionStatus:f}),[d,c,a,u,f]);return lt("div",e,{state:R,ref:[n,i.context.popupRef,i.useStateSetter("popupElement")],props:[m,On(f),s],stateAttributesMapping:Wr})}),Yr=function(e){const{delay:n,closeDelay:o,timeout:r=400}=e,s=p.useMemo(()=>({delay:n,closeDelay:o}),[n,o]),i=p.useMemo(()=>({open:n,close:o}),[n,o]);return K.jsx(Cn.Provider,{value:s,children:K.jsx(Ro,{delay:i,timeoutMs:r,children:e.children})})};function Qr({children:t}){return K.jsx(Yr,{delay:0,closeDelay:0,timeout:0,children:t})}function Jr({children:t,...e}){return K.jsx(Sr,{...e,children:t})}function Zr({className:t,...e}){return K.jsx(Ar,{className:Gt(t),...e})}function es({className:t,side:e="top",children:n}){return K.jsx(Dr,{children:K.jsx($r,{side:e,children:K.jsx(jr,{className:Gt("rounded-md border border-primary-900 bg-primary-950 px-2 py-1 text-xs text-primary-50 shadow-sm",t),children:n})})})}export{Qr as T,Jr as a,Zr as b,es as c,dn as d,On as e,Br as f,Gr as g,Rr as h,br as i,gr as j,Kr as s,yr as u};
1
+ import{r as p,j as K,w as _e}from"./main-ZPHfbCuz.js";import{ac as Ue,u as qt,ag as lt,ab as Bn,c as Gt}from"./button-DzGUU5Tc.js";import{a as $e,U as Kt,c as Qt,W as $n,g as Jt,d as at,I as Zt,b as Re,L as Wn,R as jn,h as Yn,o as Nn,k as Xn,i as me,m as _n,n as Un,q as zn,r as qn,v as Gn,X as Kn,Y as Qn,Z as Jn,P as Zn,p as en,e as eo,t as to}from"./popupStateMapping-C797EAip.js";import{u as z,g as G,n as tn,a as Z,A as le,E as st,e as j,F as ge,G as kt,h as ue,i as fe,H as nn,I as ut,x as Pe,w as We,J as no,K as on,L as oo,z as ft,D as dt,M as ze,p as ro,q as Fe,t as rn,r as sn,m as ce,N as so,v as io,d as co}from"./useButton-Bh6gEhdL.js";import{i as Oe,l as qe,e as ee,d as Ft,g as lo,r as ao,k as Ae,t as uo,v as fo,T as go,o as cn}from"./owner-Bm20thei.js";import{e as de,g as te,a as re,b as mo,c as po,d as ho,h as yo,i as be,m as Me,j as J,s as xo,k as ln,l as an,n as je,o as un,p as it,q as fn,t as ae,f as ke,r as Ye,u as vo}from"./DirectionContext-CAS2SgNN.js";const Ne={isSidebarCollapsed:!1},dn=["chat","ui"];function Gr(t){const e=t.getQueryData(dn);return e&&typeof e=="object"?{...Ne,...e}:Ne}function Kr(t,e){t.setQueryData(dn,function(o){const r=o&&typeof o=="object"?{...Ne,...o}:Ne;return e(r)})}const gn=p.createContext(void 0);function Ge(t){const e=p.useContext(gn);if(e===void 0&&!t)throw new Error(Ue(72));return e}function He(t,e,n){if(n&&!Oe(n))return 0;if(typeof t=="number")return t;if(typeof t=="function"){const o=t();return typeof o=="number"?o:o?.[e]}return t?.[e]}const mn=p.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Kt,currentIdRef:{current:null},currentContextRef:{current:null}});function Ro(t){const{children:e,delay:n,timeoutMs:o=0}=t,r=p.useRef(n),s=p.useRef(n),i=p.useRef(null),c=p.useRef(null),a=$e();return K.jsx(mn.Provider,{value:p.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:s,currentIdRef:i,timeoutMs:o,currentContextRef:c,timeout:a}),[o,a]),children:e})}function wo(t,e={open:!1}){const n="rootStore"in t?t.rootStore:t,o=n.useState("floatingId"),{enabled:r=!0,open:s}=e,i=p.useContext(mn),{currentIdRef:c,delayRef:a,timeoutMs:d,initialDelayRef:u,currentContextRef:f,hasProvider:m,timeout:l}=i,[g,h]=p.useState(!1);return z(()=>{function R(){h(!1),f.current?.setIsInstantPhase(!1),c.current=null,f.current=null,a.current=u.current}if(r&&c.current&&!s&&c.current===o){if(h(!1),d){const x=o;return l.start(d,()=>{n.select("open")||c.current&&c.current!==x||R()}),()=>{l.clear()}}R()}},[r,s,o,c,a,d,u,f,l,n]),z(()=>{if(!r||!s)return;const R=f.current,x=c.current;l.clear(),f.current={onOpenChange:n.setOpen,setIsInstantPhase:h},c.current=o,a.current={open:0,close:He(u.current,"close")},x!==null&&x!==o?(h(!0),R?.setIsInstantPhase(!0),R?.onOpenChange(!1,G(tn))):(h(!1),R?.setIsInstantPhase(!1))},[r,s,o,n,c,a,d,u,f,l]),z(()=>()=>{f.current=null},[f]),p.useMemo(()=>({hasProvider:m,delayRef:a,isInstantPhase:g}),[m,a,g])}function bo(t,e){let n=null,o=null,r=!1;return{contextElement:t||void 0,getBoundingClientRect(){const s=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=e.axis==="x"||e.axis==="both",c=e.axis==="y"||e.axis==="both",a=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let d=s.width,u=s.height,f=s.x,m=s.y;return n==null&&e.x&&i&&(n=s.x-e.x),o==null&&e.y&&c&&(o=s.y-e.y),f-=n||0,m-=o||0,d=0,u=0,!r||a?(d=e.axis==="y"?s.width:0,u=e.axis==="x"?s.height:0,f=i&&e.x!=null?e.x:f,m=c&&e.y!=null?e.y:m):r&&!a&&(u=e.axis==="x"?s.height:u,d=e.axis==="y"?s.width:d),r=!0,{width:d,height:u,x:f,y:m,top:m,right:f+d,bottom:m+u,left:f}}}}function Ht(t){return t!=null&&t.clientX!=null}function Eo(t,e={}){const n="rootStore"in t?t.rootStore:t,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{enabled:c=!0,axis:a="both",x:d=null,y:u=null}=e,f=p.useRef(!1),m=p.useRef(null),[l,g]=p.useState(),[h,R]=p.useState([]),x=Z((S,b,O)=>{f.current||i.current.openEvent&&!Ht(i.current.openEvent)||n.set("positionReference",bo(O??s,{x:S,y:b,axis:a,dataRef:i,pointerType:l}))}),v=Z(S=>{d!=null||u!=null||(o?m.current||R([]):x(S.clientX,S.clientY,S.currentTarget))}),E=Oe(l)?r:o,C=p.useCallback(()=>{if(!E||!c||d!=null||u!=null)return;const S=le(r);function b(O){const F=qe(O);ee(r,F)?(S.removeEventListener("mousemove",b),m.current=null):x(O.clientX,O.clientY)}if(!i.current.openEvent||Ht(i.current.openEvent)){S.addEventListener("mousemove",b);const O=()=>{S.removeEventListener("mousemove",b),m.current=null};return m.current=O,O}n.set("positionReference",s)},[E,c,d,u,r,i,s,n,x]);p.useEffect(()=>C(),[C,h]),p.useEffect(()=>{c&&!r&&(f.current=!1)},[c,r]),p.useEffect(()=>{!c&&o&&(f.current=!0)},[c,o]),z(()=>{c&&(d!=null||u!=null)&&(f.current=!1,x(d,u))},[c,d,u,x]);const P=p.useMemo(()=>{function S(b){g(b.pointerType)}return{onPointerDown:S,onPointerEnter:S,onMouseMove:v,onMouseEnter:v}},[v]);return p.useMemo(()=>c?{reference:P,trigger:P}:{},[c,P])}function Vt(t,e,n){let{reference:o,floating:r}=t;const s=re(e),i=ln(e),c=un(i),a=te(e),d=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let l;switch(a){case"top":l={x:u,y:o.y-r.height};break;case"bottom":l={x:u,y:o.y+o.height};break;case"right":l={x:o.x+o.width,y:f};break;case"left":l={x:o.x-r.width,y:f};break;default:l={x:o.x,y:o.y}}switch(be(e)){case"start":l[i]-=m*(n&&d?-1:1);break;case"end":l[i]+=m*(n&&d?-1:1);break}return l}async function Co(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:a}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:m=!1,padding:l=0}=de(e,t),g=an(l),R=c[m?f==="floating"?"reference":"floating":f],x=je(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(R)))==null||n?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:u,strategy:a})),v=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),C=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},P=je(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:E,strategy:a}):v);return{top:(x.top-P.top+g.top)/C.y,bottom:(P.bottom-x.bottom+g.bottom)/C.y,left:(x.left-P.left+g.left)/C.x,right:(P.right-x.right+g.right)/C.x}}const So=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=s.filter(Boolean),a=await(i.isRTL==null?void 0:i.isRTL(e));let d=await i.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=Vt(d,o,a),m=o,l={},g=0;for(let R=0;R<c.length;R++){var h;const{name:x,fn:v}=c[R],{x:E,y:C,data:P,reset:S}=await v({x:u,y:f,initialPlacement:o,placement:m,strategy:r,middlewareData:l,rects:d,platform:{...i,detectOverflow:(h=i.detectOverflow)!=null?h:Co},elements:{reference:t,floating:e}});u=E??u,f=C??f,l={...l,[x]:{...l[x],...P}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(d=S.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:r}):S.rects),{x:u,y:f}=Vt(d,m,a)),R=-1)}return{x:u,y:f,placement:m,strategy:r,middlewareData:l}},To=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:l="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...R}=de(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=te(r),v=re(c),E=te(c)===c,C=await(a.isRTL==null?void 0:a.isRTL(d.floating)),P=m||(E||!h?[mo(c)]:po(c)),S=g!=="none";!m&&S&&P.push(...ho(c,h,g,C));const b=[c,...P],O=await a.detectOverflow(e,R),F=[];let M=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&F.push(O[x]),f){const D=yo(r,i,C);F.push(O[D[0]],O[D[1]])}if(M=[...M,{placement:r,overflows:F}],!F.every(D=>D<=0)){var k,T;const D=(((k=s.flip)==null?void 0:k.index)||0)+1,I=b[D];if(I&&(!(f==="alignment"?v!==re(I):!1)||M.every(w=>re(w.placement)===v?w.overflows[0]>0:!0)))return{data:{index:D,overflows:M},reset:{placement:I}};let H=(T=M.filter(A=>A.overflows[0]<=0).sort((A,w)=>A.overflows[1]-w.overflows[1])[0])==null?void 0:T.placement;if(!H)switch(l){case"bestFit":{var y;const A=(y=M.filter(w=>{if(S){const L=re(w.placement);return L===v||L==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(L=>L>0).reduce((L,W)=>L+W,0)]).sort((w,L)=>w[1]-L[1])[0])==null?void 0:y[0];A&&(H=A);break}case"initialPlacement":H=c;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function Bt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function $t(t){return xo.some(e=>t[e]>=0)}const Po=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:r="referenceHidden",...s}=de(t,e);switch(r){case"referenceHidden":{const i=await o.detectOverflow(e,{...s,elementContext:"reference"}),c=Bt(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:$t(c)}}}case"escaped":{const i=await o.detectOverflow(e,{...s,altBoundary:!0}),c=Bt(i,n.floating);return{data:{escapedOffsets:c,escaped:$t(c)}}}default:return{}}}}},pn=new Set(["left","top"]);async function Oo(t,e){const{placement:n,platform:o,elements:r}=t,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=te(n),c=be(n),a=re(n)==="y",d=pn.has(i)?-1:1,u=s&&a?-1:1,f=de(e,t);let{mainAxis:m,crossAxis:l,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(l=c==="end"?g*-1:g),a?{x:l*u,y:m*d}:{x:m*d,y:l*u}}const Ao=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=e,a=await Oo(e,t);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:s+a.y,data:{...a,placement:i}}}}},Mo=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:s}=e,{mainAxis:i=!0,crossAxis:c=!1,limiter:a={fn:x=>{let{x:v,y:E}=x;return{x:v,y:E}}},...d}=de(t,e),u={x:n,y:o},f=await s.detectOverflow(e,d),m=re(te(r)),l=fn(m);let g=u[l],h=u[m];if(i){const x=l==="y"?"top":"left",v=l==="y"?"bottom":"right",E=g+f[x],C=g-f[v];g=it(E,g,C)}if(c){const x=m==="y"?"top":"left",v=m==="y"?"bottom":"right",E=h+f[x],C=h-f[v];h=it(E,h,C)}const R=a.fn({...e,[l]:g,[m]:h});return{...R,data:{x:R.x-n,y:R.y-o,enabled:{[l]:i,[m]:c}}}}}},Lo=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=e,{offset:c=0,mainAxis:a=!0,crossAxis:d=!0}=de(t,e),u={x:n,y:o},f=re(r),m=fn(f);let l=u[m],g=u[f];const h=de(c,e),R=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(a){const E=m==="y"?"height":"width",C=s.reference[m]-s.floating[E]+R.mainAxis,P=s.reference[m]+s.reference[E]-R.mainAxis;l<C?l=C:l>P&&(l=P)}if(d){var x,v;const E=m==="y"?"width":"height",C=pn.has(te(r)),P=s.reference[f]-s.floating[E]+(C&&((x=i.offset)==null?void 0:x[f])||0)+(C?0:R.crossAxis),S=s.reference[f]+s.reference[E]+(C?0:((v=i.offset)==null?void 0:v[f])||0)-(C?R.crossAxis:0);g<P?g=P:g>S&&(g=S)}return{[m]:l,[f]:g}}}},Do=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:s,platform:i,elements:c}=e,{apply:a=()=>{},...d}=de(t,e),u=await i.detectOverflow(e,d),f=te(r),m=be(r),l=re(r)==="y",{width:g,height:h}=s.floating;let R,x;f==="top"||f==="bottom"?(R=f,x=m===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(x=f,R=m==="end"?"top":"bottom");const v=h-u.top-u.bottom,E=g-u.left-u.right,C=Me(h-u[R],v),P=Me(g-u[x],E),S=!e.middlewareData.shift;let b=C,O=P;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(O=E),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(b=v),S&&!m){const M=J(u.left,0),k=J(u.right,0),T=J(u.top,0),y=J(u.bottom,0);l?O=g-2*(M!==0||k!==0?M+k:J(u.left,u.right)):b=h-2*(T!==0||y!==0?T+y:J(u.top,u.bottom))}await a({...e,availableWidth:O,availableHeight:b});const F=await i.getDimensions(c.floating);return g!==F.width||h!==F.height?{reset:{rects:!0}}:{}}}};function hn(t){const e=ue(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=fe(t),s=r?t.offsetWidth:n,i=r?t.offsetHeight:o,c=Ye(n)!==s||Ye(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function gt(t){return j(t)?t:t.contextElement}function we(t){const e=gt(t);if(!fe(e))return ae(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:s}=hn(e);let i=(s?Ye(n.width):n.width)/o,c=(s?Ye(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Io=ae(0);function yn(t){const e=le(t);return!nn()||!e.visualViewport?Io:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ko(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==le(t)?!1:e}function pe(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=gt(t);let i=ae(1);e&&(o?j(o)&&(i=we(o)):i=we(t));const c=ko(s,n,o)?yn(s):ae(0);let a=(r.left+c.x)/i.x,d=(r.top+c.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const m=le(s),l=o&&j(o)?le(o):o;let g=m,h=kt(g);for(;h&&o&&l!==g;){const R=we(h),x=h.getBoundingClientRect(),v=ue(h),E=x.left+(h.clientLeft+parseFloat(v.paddingLeft))*R.x,C=x.top+(h.clientTop+parseFloat(v.paddingTop))*R.y;a*=R.x,d*=R.y,u*=R.x,f*=R.y,a+=E,d+=C,g=le(h),h=kt(g)}}return je({width:u,height:f,x:a,y:d})}function Ke(t,e){const n=ze(t).scrollLeft;return e?e.left+n:pe(ge(t)).left+n}function xn(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-Ke(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function Fo(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const s=r==="fixed",i=ge(o),c=e?ut(e.floating):!1;if(o===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},d=ae(1);const u=ae(0),f=fe(o);if((f||!f&&!s)&&((ft(o)!=="body"||dt(i))&&(a=ze(o)),fe(o))){const l=pe(o);d=we(o),u.x=l.x+o.clientLeft,u.y=l.y+o.clientTop}const m=i&&!f&&!s?xn(i,a):ae(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+u.x+m.x,y:n.y*d.y-a.scrollTop*d.y+u.y+m.y}}function Ho(t){return Array.from(t.getClientRects())}function Vo(t){const e=ge(t),n=ze(t),o=t.ownerDocument.body,r=J(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=J(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Ke(t);const c=-n.scrollTop;return ue(o).direction==="rtl"&&(i+=J(e.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const Wt=25;function Bo(t,e){const n=le(t),o=ge(t),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,a=0;if(r){s=r.width,i=r.height;const u=nn();(!u||u&&e==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}const d=Ke(o);if(d<=0){const u=o.ownerDocument,f=u.body,m=getComputedStyle(f),l=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(o.clientWidth-f.clientWidth-l);g<=Wt&&(s-=g)}else d<=Wt&&(s+=d);return{width:s,height:i,x:c,y:a}}const $o=new Set(["absolute","fixed"]);function Wo(t,e){const n=pe(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,s=fe(t)?we(t):ae(1),i=t.clientWidth*s.x,c=t.clientHeight*s.y,a=r*s.x,d=o*s.y;return{width:i,height:c,x:a,y:d}}function jt(t,e,n){let o;if(e==="viewport")o=Bo(t,n);else if(e==="document")o=Vo(ge(t));else if(j(e))o=Wo(e,n);else{const r=yn(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return je(o)}function vn(t,e){const n=Pe(t);return n===e||!j(n)||We(n)?!1:ue(n).position==="fixed"||vn(n,e)}function jo(t,e){const n=e.get(t);if(n)return n;let o=st(t,[],!1).filter(c=>j(c)&&ft(c)!=="body"),r=null;const s=ue(t).position==="fixed";let i=s?Pe(t):t;for(;j(i)&&!We(i);){const c=ue(i),a=on(i);!a&&c.position==="fixed"&&(r=null),(s?!a&&!r:!a&&c.position==="static"&&!!r&&$o.has(r.position)||dt(i)&&!a&&vn(t,i))?o=o.filter(u=>u!==i):r=c,i=Pe(i)}return e.set(t,o),o}function Yo(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[...n==="clippingAncestors"?ut(e)?[]:jo(e,this._c):[].concat(n),o],c=i[0],a=i.reduce((d,u)=>{const f=jt(e,u,r);return d.top=J(f.top,d.top),d.right=Me(f.right,d.right),d.bottom=Me(f.bottom,d.bottom),d.left=J(f.left,d.left),d},jt(e,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function No(t){const{width:e,height:n}=hn(t);return{width:e,height:n}}function Xo(t,e,n){const o=fe(e),r=ge(e),s=n==="fixed",i=pe(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const a=ae(0);function d(){a.x=Ke(r)}if(o||!o&&!s)if((ft(e)!=="body"||dt(r))&&(c=ze(e)),o){const l=pe(e,!0,s,e);a.x=l.x+e.clientLeft,a.y=l.y+e.clientTop}else r&&d();s&&!o&&r&&d();const u=r&&!o&&!s?xn(r,c):ae(0),f=i.left+c.scrollLeft-a.x-u.x,m=i.top+c.scrollTop-a.y-u.y;return{x:f,y:m,width:i.width,height:i.height}}function tt(t){return ue(t).position==="static"}function Yt(t,e){if(!fe(t)||ue(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ge(t)===n&&(n=n.ownerDocument.body),n}function Rn(t,e){const n=le(t);if(ut(t))return n;if(!fe(t)){let r=Pe(t);for(;r&&!We(r);){if(j(r)&&!tt(r))return r;r=Pe(r)}return n}let o=Yt(t,e);for(;o&&no(o)&&tt(o);)o=Yt(o,e);return o&&We(o)&&tt(o)&&!on(o)?n:o||oo(t)||n}const _o=async function(t){const e=this.getOffsetParent||Rn,n=this.getDimensions,o=await n(t.floating);return{reference:Xo(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Uo(t){return ue(t).direction==="rtl"}const zo={convertOffsetParentRelativeRectToViewportRelativeRect:Fo,getDocumentElement:ge,getClippingRect:Yo,getOffsetParent:Rn,getElementRects:_o,getClientRects:Ho,getDimensions:No,getScale:we,isElement:j,isRTL:Uo};function wn(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qo(t,e){let n=null,o;const r=ge(t);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const d=t.getBoundingClientRect(),{left:u,top:f,width:m,height:l}=d;if(c||e(),!m||!l)return;const g=ke(f),h=ke(r.clientWidth-(u+m)),R=ke(r.clientHeight-(f+l)),x=ke(u),E={rootMargin:-g+"px "+-h+"px "+-R+"px "+-x+"px",threshold:J(0,Me(1,a))||1};let C=!0;function P(S){const b=S[0].intersectionRatio;if(b!==a){if(!C)return i();b?i(!1,b):o=setTimeout(()=>{i(!1,1e-7)},1e3)}b===1&&!wn(d,t.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(P,{...E,root:r.ownerDocument})}catch{n=new IntersectionObserver(P,E)}n.observe(t)}return i(!0),s}function Nt(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,d=gt(t),u=r||s?[...d?st(d):[],...st(e)]:[];u.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=d&&c?qo(d,n):null;let m=-1,l=null;i&&(l=new ResizeObserver(x=>{let[v]=x;v&&v.target===d&&l&&(l.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=l)==null||E.observe(e)})),n()}),d&&!a&&l.observe(d),l.observe(e));let g,h=a?pe(t):null;a&&R();function R(){const x=pe(t);h&&!wn(h,x)&&n(),h=x,g=requestAnimationFrame(R)}return n(),()=>{var x;u.forEach(v=>{r&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),f?.(),(x=l)==null||x.disconnect(),l=null,a&&cancelAnimationFrame(g)}}const Go=Ao,Ko=Mo,Qo=To,Jo=Do,Zo=Po,er=Lo,tr=(t,e,n)=>{const o=new Map,r={platform:zo,...n},s={...r.platform,_c:o};return So(t,e,{...r,platform:s})};var nr=typeof document<"u",or=function(){},Ve=nr?p.useLayoutEffect:or;function Xe(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!Xe(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&t.$$typeof)&&!Xe(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function bn(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Xt(t,e){const n=bn(t);return Math.round(e*n)/n}function nt(t){const e=p.useRef(t);return Ve(()=>{e.current=t}),e}function rr(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:d}=t,[u,f]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,l]=p.useState(o);Xe(m,o)||l(o);const[g,h]=p.useState(null),[R,x]=p.useState(null),v=p.useCallback(w=>{w!==S.current&&(S.current=w,h(w))},[]),E=p.useCallback(w=>{w!==b.current&&(b.current=w,x(w))},[]),C=s||g,P=i||R,S=p.useRef(null),b=p.useRef(null),O=p.useRef(u),F=a!=null,M=nt(a),k=nt(r),T=nt(d),y=p.useCallback(()=>{if(!S.current||!b.current)return;const w={placement:e,strategy:n,middleware:m};k.current&&(w.platform=k.current),tr(S.current,b.current,w).then(L=>{const W={...L,isPositioned:T.current!==!1};D.current&&!Xe(O.current,W)&&(O.current=W,_e.flushSync(()=>{f(W)}))})},[m,e,n,k,T]);Ve(()=>{d===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(w=>({...w,isPositioned:!1})))},[d]);const D=p.useRef(!1);Ve(()=>(D.current=!0,()=>{D.current=!1}),[]),Ve(()=>{if(C&&(S.current=C),P&&(b.current=P),C&&P){if(M.current)return M.current(C,P,y);y()}},[C,P,y,M,F]);const I=p.useMemo(()=>({reference:S,floating:b,setReference:v,setFloating:E}),[v,E]),H=p.useMemo(()=>({reference:C,floating:P}),[C,P]),A=p.useMemo(()=>{const w={position:n,left:0,top:0};if(!H.floating)return w;const L=Xt(H.floating,u.x),W=Xt(H.floating,u.y);return c?{...w,transform:"translate("+L+"px, "+W+"px)",...bn(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:W}},[n,c,H.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:y,refs:I,elements:H,floatingStyles:A}),[u,y,I,H,A])}const sr=(t,e)=>({...Go(t),options:[t,e]}),ir=(t,e)=>({...Ko(t),options:[t,e]}),cr=(t,e)=>({...er(t),options:[t,e]}),lr=(t,e)=>({...Qo(t),options:[t,e]}),ar=(t,e)=>({...Jo(t),options:[t,e]}),ur=(t,e)=>({...Zo(t),options:[t,e]});function fr(t){const{open:e=!1,onOpenChange:n,elements:o={}}=t,r=ro(),s=Qt()!=null,i=qt(()=>new $n({open:e,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new Jt,floatingId:r,nested:s,noEmit:t.noEmit||!1})).current;return z(()=>{const c={open:e,floatingId:r};o.reference!==void 0&&(c.referenceElement=o.reference,c.domReferenceElement=j(o.reference)?o.reference:null),o.floating!==void 0&&(c.floatingElement=o.floating),i.update(c)},[e,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=t.noEmit||!1,i}function dr(t={}){const{nodeId:e,externalTree:n}=t,o=fr(t),r=t.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,c]=p.useState(null),a=p.useRef(null),d=at(n);z(()=>{s.domReference&&(a.current=s.domReference)},[s.domReference]);const u=rr({...t,elements:{...s,...i&&{reference:i}}}),f=p.useCallback(b=>{const O=j(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),getClientRects:()=>b.getClientRects(),contextElement:b}:b;c(O),u.refs.setReference(O)},[u.refs]),[m,l]=p.useState(null),[g,h]=p.useState(null);r.useSyncedValue("referenceElement",m),r.useSyncedValue("domReferenceElement",j(m)?m:null),r.useSyncedValue("floatingElement",g);const R=p.useCallback(b=>{(j(b)||b===null)&&(a.current=b,l(b)),(j(u.refs.reference.current)||u.refs.reference.current===null||b!==null&&!j(b))&&u.refs.setReference(b)},[u.refs,l]),x=p.useCallback(b=>{h(b),u.refs.setFloating(b)},[u.refs]),v=p.useMemo(()=>({...u.refs,setReference:R,setFloating:x,setPositionReference:f,domReference:a}),[u.refs,R,x,f]),E=p.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),C=r.useState("open"),P=r.useState("floatingId"),S=p.useMemo(()=>({...u,dataRef:r.context.dataRef,open:C,onOpenChange:r.setOpen,events:r.context.events,floatingId:P,refs:v,elements:E,nodeId:e,rootStore:r}),[u,v,E,e,r,C,P]);return z(()=>{r.context.dataRef.current.floatingContext=S;const b=d?.nodesRef.current.find(O=>O.id===e);b&&(b.context=S)}),p.useMemo(()=>({...u,context:S,refs:v,elements:E,rootStore:r}),[u,v,E,S,r])}const ot=uo&&fo;function gr(t,e={}){const n="rootStore"in t?t.rootStore:t,{events:o,dataRef:r}=n.context,{enabled:s=!0,visibleOnly:i=!0,delay:c}=e,a=p.useRef(!1),d=p.useRef(null),u=$e(),f=p.useRef(!0);p.useEffect(()=>{const l=n.select("domReferenceElement");if(!s)return;const g=le(l);function h(){const v=n.select("domReferenceElement");!n.select("open")&&fe(v)&&v===Ft(Ae(v))&&(a.current=!0)}function R(){f.current=!0}function x(){f.current=!1}return g.addEventListener("blur",h),ot&&(g.addEventListener("keydown",R,!0),g.addEventListener("pointerdown",x,!0)),()=>{g.removeEventListener("blur",h),ot&&(g.removeEventListener("keydown",R,!0),g.removeEventListener("pointerdown",x,!0))}},[n,s]),p.useEffect(()=>{if(!s)return;function l(g){if(g.reason===rn||g.reason===sn){const h=n.select("domReferenceElement");j(h)&&(d.current=h,a.current=!0)}}return o.on("openchange",l),()=>{o.off("openchange",l)}},[o,s,n]);const m=p.useMemo(()=>({onMouseLeave(){a.current=!1,d.current=null},onFocus(l){const g=l.currentTarget;if(a.current){if(d.current===g)return;a.current=!1,d.current=null}const h=qe(l.nativeEvent);if(i&&j(h)){if(ot&&!l.relatedTarget){if(!f.current&&!lo(h))return}else if(!ao(h))return}const R=l.relatedTarget&&n.context.triggerElements.hasElement(l.relatedTarget),{nativeEvent:x,currentTarget:v}=l,E=typeof c=="function"?c():c;if(n.select("open")&&R||E===0||E===void 0){n.setOpen(!0,G(Fe,x,v));return}u.start(E,()=>{a.current||n.setOpen(!0,G(Fe,x,v))})},onBlur(l){a.current=!1,d.current=null;const g=l.relatedTarget,h=l.nativeEvent,R=j(g)&&g.hasAttribute(Zt("focus-guard"))&&g.getAttribute("data-type")==="outside";u.start(0,()=>{const x=n.select("domReferenceElement"),v=Ft(x?x.ownerDocument:document);if(!g&&v===x||ee(r.current.floatingContext?.refs.floating.current,v)||ee(x,v)||R)return;const E=g??v;if(j(E)){const C=n.context.triggerElements;if(C.hasElement(E)||C.hasMatchingElement(P=>ee(P,E)))return}n.setOpen(!1,G(Fe,h))})}}),[r,n,i,u,c]);return p.useMemo(()=>s?{reference:m,trigger:m}:{},[s,m])}const ct=Zt("safe-polygon"),mr=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${go}`;function pr(t){return t?!!t.closest(mr):!1}function En(t){const e=p.useRef(void 0),n=p.useRef(!1),o=p.useRef(void 0),r=p.useRef(!0),s=p.useRef(!1),i=p.useRef(()=>{}),c=p.useRef(!1),a=$e(),d=$e(),u=p.useRef(void 0);return p.useMemo(()=>{const f=t.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:e,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:r,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:c,openChangeTimeout:a,restTimeout:d,handleCloseOptionsRef:u}),f.hoverInteractionState},[t,e,n,o,r,s,i,c,a,d,u])}const hr=new Set(["click","mousedown"]);function yr(t,e={}){const n="rootStore"in t?t.rootStore:t,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:c=!0,closeDelay:a=0,externalTree:d}=e,{pointerTypeRef:u,interactedInsideRef:f,handlerRef:m,performedPointerEventsMutationRef:l,unbindMouseMoveRef:g,restTimeoutPendingRef:h,openChangeTimeout:R,handleCloseOptionsRef:x}=En(n),v=at(d),E=Qt(),C=Z(()=>f.current?!0:i.current.openEvent?hr.has(i.current.openEvent.type):!1),P=Z(()=>{const M=i.current.openEvent?.type;return M?.includes("mouse")&&M!=="mousedown"}),S=p.useCallback((M,k=!0)=>{const T=xr(a,u.current);T&&!m.current?R.start(T,()=>n.setOpen(!1,G(ce,M))):k&&(R.clear(),n.setOpen(!1,G(ce,M)))},[a,m,n,u,R]),b=Z(()=>{g.current(),m.current=void 0}),O=Z(()=>{if(l.current){const M=Ae(r).body;M.style.pointerEvents="",M.removeAttribute(ct),l.current=!1}}),F=Z(M=>{const k=qe(M);if(!pr(k)){f.current=!1;return}f.current=!0});z(()=>{o||(u.current=void 0,h.current=!1,f.current=!1,b(),O())},[o,u,h,f,b,O]),p.useEffect(()=>()=>{b()},[b]),p.useEffect(()=>O,[O]),z(()=>{if(c&&o&&x.current?.blockPointerEvents&&P()&&j(s)&&r){l.current=!0;const M=Ae(r).body;M.setAttribute(ct,"");const k=s,T=r,y=v?.nodesRef.current.find(D=>D.id===E)?.context?.elements.floating;return y&&(y.style.pointerEvents=""),M.style.pointerEvents="none",k.style.pointerEvents="auto",T.style.pointerEvents="auto",()=>{M.style.pointerEvents="",k.style.pointerEvents="",T.style.pointerEvents=""}}},[c,o,s,r,x,P,v,E,l]),p.useEffect(()=>{if(!c)return;function M(D){if(C()||!i.current.floatingContext||!n.select("open"))return;const I=n.context.triggerElements;D.relatedTarget&&I.hasElement(D.relatedTarget)||(O(),b(),C()||S(D))}function k(D){R.clear(),O(),m.current?.(D),b()}function T(D){C()||S(D,!1)}const y=r;return y&&(y.addEventListener("mouseleave",M),y.addEventListener("mouseenter",k),y.addEventListener("mouseleave",T),y.addEventListener("pointerdown",F,!0)),()=>{y&&(y.removeEventListener("mouseleave",M),y.removeEventListener("mouseenter",k),y.removeEventListener("mouseleave",T),y.removeEventListener("pointerdown",F,!0))}})}function xr(t,e){return e&&!Oe(e)?0:typeof t=="function"?t():t}function rt(t){return typeof t=="function"?t():t}const vr={current:null};function Rr(t,e={}){const n="rootStore"in t?t.rootStore:t,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:c=null,mouseOnly:a=!1,restMs:d=0,move:u=!0,triggerElementRef:f=vr,externalTree:m,isActiveTrigger:l=!0}=e,g=at(m),{pointerTypeRef:h,interactedInsideRef:R,handlerRef:x,blockMouseMoveRef:v,performedPointerEventsMutationRef:E,unbindMouseMoveRef:C,restTimeoutPendingRef:P,openChangeTimeout:S,restTimeout:b,handleCloseOptionsRef:O}=En(n),F=Re(c),M=Re(i),k=Re(d);l&&(O.current=F.current?.__options);const T=Z(()=>R.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),y=p.useCallback((A,w=!0)=>{const L=He(M.current,"close",h.current);L&&!x.current?S.start(L,()=>n.setOpen(!1,G(ce,A))):w&&(S.clear(),n.setOpen(!1,G(ce,A)))},[M,x,n,h,S]),D=Z(()=>{C.current(),x.current=void 0}),I=Z(()=>{if(E.current){const A=Ae(n.select("domReferenceElement")).body;A.style.pointerEvents="",A.removeAttribute(ct),E.current=!1}});p.useEffect(()=>{if(!s)return;function A(w){w.open||(S.clear(),b.clear(),v.current=!0,P.current=!1)}return r.on("openchange",A),()=>{r.off("openchange",A)}},[s,r,S,b,v,P]);const H=Z(A=>{if(T()||!o.current.floatingContext)return;const w=n.context.triggerElements;if(A.relatedTarget&&w.hasElement(A.relatedTarget))return;const L=f.current;F.current?.({...o.current.floatingContext,tree:g,x:A.clientX,y:A.clientY,onClose(){I(),D(),!T()&&L===n.select("domReferenceElement")&&y(A)}})(A)});return p.useEffect(()=>{if(!s)return;const A=f.current??(l?n.select("domReferenceElement"):null);if(!j(A))return;function w(B){if(S.clear(),v.current=!1,a&&!Oe(h.current)||rt(k.current)>0&&!He(M.current,"open"))return;const U=He(M.current,"open",h.current),X=n.select("domReferenceElement"),Y=n.context.triggerElements,_=(Y.hasElement(B.target)||Y.hasMatchingElement(se=>ee(se,B.target)))&&(!X||!ee(X,B.target)),V=B.currentTarget??null,$=n.select("open"),ne=!$||_;_&&$?n.setOpen(!0,G(ce,B,V)):U?S.start(U,()=>{ne&&n.setOpen(!0,G(ce,B,V))}):ne&&n.setOpen(!0,G(ce,B,V))}function L(B){if(T()){I();return}C.current();const U=n.select("domReferenceElement"),X=Ae(U);b.clear(),P.current=!1;const Y=n.context.triggerElements;if(B.relatedTarget&&Y.hasElement(B.relatedTarget))return;if(F.current&&o.current.floatingContext){n.select("open")||S.clear();const V=f.current;x.current=F.current({...o.current.floatingContext,tree:g,x:B.clientX,y:B.clientY,onClose(){I(),D(),!T()&&V===n.select("domReferenceElement")&&y(B,!0)}});const $=x.current;$(B),X.addEventListener("mousemove",$),C.current=()=>{X.removeEventListener("mousemove",$)};return}(h.current!=="touch"||!ee(n.select("floatingElement"),B.relatedTarget))&&y(B)}function W(B){H(B)}return n.select("open")&&A.addEventListener("mouseleave",W),u&&A.addEventListener("mousemove",w,{once:!0}),A.addEventListener("mouseenter",w),A.addEventListener("mouseleave",L),()=>{A.removeEventListener("mouseleave",W),u&&A.removeEventListener("mousemove",w),A.removeEventListener("mouseenter",w),A.removeEventListener("mouseleave",L)}},[D,I,v,o,M,y,n,s,F,H,l,T,a,u,h,k,b,P,S,f,g,C,x]),p.useMemo(()=>{function A(w){h.current=w.pointerType}return{onPointerDown:A,onPointerEnter:A,onMouseMove(w){const{nativeEvent:L}=w,W=w.currentTarget,B=n.select("domReferenceElement"),U=n.context.triggerElements,X=n.select("open"),Y=(U.hasElement(w.target)||U.hasMatchingElement(V=>ee(V,w.target)))&&(!B||!ee(B,w.target));if(a&&!Oe(h.current)||X&&!Y||rt(k.current)===0||!Y&&P.current&&w.movementX**2+w.movementY**2<2)return;b.clear();function _(){if(P.current=!1,T())return;const V=n.select("open");!v.current&&(!V||Y)&&n.setOpen(!0,G(ce,L,W))}h.current==="touch"?_e.flushSync(()=>{_()}):Y&&X?_():(P.current=!0,b.start(rt(k.current),_))}}},[v,T,a,n,h,k,b,P])}function _t(t,e){const[n,o]=t;let r=!1;const s=e.length;for(let i=0,c=s-1;i<s;c=i++){const[a,d]=e[i]||[0,0],[u,f]=e[c]||[0,0];d>=o!=f>=o&&n<=(u-a)*(o-d)/(f-d)+a&&(r=!r)}return r}function wr(t,e){return t[0]>=e.x&&t[0]<=e.x+e.width&&t[1]>=e.y&&t[1]<=e.y+e.height}function br(t={}){const{buffer:e=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=t,r=new Kt;let s=!1,i=null,c=null,a=typeof performance<"u"?performance.now():0;function d(f,m){const l=performance.now(),g=l-a;if(i===null||c===null||g===0)return i=f,c=m,a=l,null;const h=f-i,R=m-c,v=Math.sqrt(h*h+R*R)/g;return i=f,c=m,a=l,v}const u=({x:f,y:m,placement:l,elements:g,onClose:h,nodeId:R,tree:x})=>function(E){function C(){r.clear(),h()}if(r.clear(),!g.domReference||!g.floating||l==null||f==null||m==null)return;const{clientX:P,clientY:S}=E,b=[P,S],O=qe(E),F=E.type==="mouseleave",M=ee(g.floating,O),k=ee(g.domReference,O),T=g.domReference.getBoundingClientRect(),y=g.floating.getBoundingClientRect(),D=l.split("-")[0],I=f>y.right-y.width/2,H=m>y.bottom-y.height/2,A=wr(b,T),w=y.width>T.width,L=y.height>T.height,W=(w?T:y).left,B=(w?T:y).right,U=(L?T:y).top,X=(L?T:y).bottom;if(M&&(s=!0,!F))return;if(k&&(s=!1),k&&!F){s=!0;return}if(F&&j(E.relatedTarget)&&ee(g.floating,E.relatedTarget)||x&&Wn(x.nodesRef.current,R).some(({context:V})=>V?.open))return;if(D==="top"&&m>=T.bottom-1||D==="bottom"&&m<=T.top+1||D==="left"&&f>=T.right-1||D==="right"&&f<=T.left+1)return C();let Y=[];switch(D){case"top":Y=[[W,T.top+1],[W,y.bottom-1],[B,y.bottom-1],[B,T.top+1]];break;case"bottom":Y=[[W,y.top+1],[W,T.bottom-1],[B,T.bottom-1],[B,y.top+1]];break;case"left":Y=[[y.right-1,X],[y.right-1,U],[T.left+1,U],[T.left+1,X]];break;case"right":Y=[[T.right-1,X],[T.right-1,U],[y.left+1,U],[y.left+1,X]];break}function _([V,$]){switch(D){case"top":{const ne=[w?V+e/2:I?V+e*4:V-e*4,$+e+1],se=[w?V-e/2:I?V+e*4:V-e*4,$+e+1],oe=[[y.left,I||w?y.bottom-e:y.top],[y.right,I?w?y.bottom-e:y.top:y.bottom-e]];return[ne,se,...oe]}case"bottom":{const ne=[w?V+e/2:I?V+e*4:V-e*4,$-e],se=[w?V-e/2:I?V+e*4:V-e*4,$-e],oe=[[y.left,I||w?y.top+e:y.bottom],[y.right,I?w?y.top+e:y.bottom:y.top+e]];return[ne,se,...oe]}case"left":{const ne=[V+e+1,L?$+e/2:H?$+e*4:$-e*4],se=[V+e+1,L?$-e/2:H?$+e*4:$-e*4];return[...[[H||L?y.right-e:y.left,y.top],[H?L?y.right-e:y.left:y.right-e,y.bottom]],ne,se]}case"right":{const ne=[V-e,L?$+e/2:H?$+e*4:$-e*4],se=[V-e,L?$-e/2:H?$+e*4:$-e*4],oe=[[H||L?y.left+e:y.right,y.top],[H?L?y.left+e:y.right:y.left+e,y.bottom]];return[ne,se,...oe]}default:return[]}}if(!_t([P,S],Y)){if(s&&!A)return C();if(!F&&o){const V=d(E.clientX,E.clientY);if(V!==null&&V<.1)return C()}_t([P,S],_([f,m]))?!s&&o&&r.start(40,C):C()}};return u.__options={blockPointerEvents:n},u}const Er={...Yn,disabled:me(t=>t.disabled),instantType:me(t=>t.instantType),isInstantPhase:me(t=>t.isInstantPhase),trackCursorAxis:me(t=>t.trackCursorAxis),disableHoverablePopup:me(t=>t.disableHoverablePopup),lastOpenChangeReason:me(t=>t.openChangeReason),closeDelay:me(t=>t.closeDelay),hasViewport:me(t=>t.hasViewport)};class mt extends jn{constructor(e){super({...Cr(),...e},{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Jt},Er)}setOpen=(e,n)=>{const o=n.reason,r=o===ce,s=e&&o===Fe,i=!e&&(o===rn||o===sn);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,n),n.isCanceled)return;const c=()=>{const a={open:e,openChangeReason:o};s?a.instantType="focus":i?a.instantType="dismiss":o===ce&&(a.instantType=void 0);const d=n.trigger?.id??null;(d||e)&&(a.activeTriggerId=d,a.activeTriggerElement=n.trigger??null),this.update(a)};r?_e.flushSync(c):c()};static useStore(e,n){const o=qt(()=>new mt(n)).current,r=e??o,s=Nn({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=s,r}}function Cr(){return{...Xn(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}function Sr(t){const{disabled:e=!1,defaultOpen:n=!1,open:o,disableHoverablePopup:r=!1,trackCursorAxis:s="none",actionsRef:i,onOpenChange:c,onOpenChangeComplete:a,handle:d,triggerId:u,defaultTriggerId:f=null,children:m}=t,l=mt.useStore(d?.store,{open:o??n,activeTriggerId:u!==void 0?u:f});l.useControlledProp("open",o,n),l.useControlledProp("activeTriggerId",u,f),l.useContextCallback("onOpenChange",c),l.useContextCallback("onOpenChangeComplete",a);const g=l.useState("open"),h=!e&&g,R=l.useState("activeTriggerId"),x=l.useState("payload");l.useSyncedValues({trackCursorAxis:s,disableHoverablePopup:r}),z(()=>{g&&e&&l.setOpen(!1,G(so))},[g,e,l]),l.useSyncedValue("disabled",e),_n(l);const{forceUnmount:v,transitionStatus:E}=Un(h,l),C=l.useState("isInstantPhase"),P=l.useState("instantType"),S=l.useState("lastOpenChangeReason"),b=p.useRef(null);z(()=>{E==="ending"&&S===tn||E!=="ending"&&C?(P!=="delay"&&(b.current=P),l.set("instantType","delay")):b.current!==null&&(l.set("instantType",b.current),b.current=null)},[E,C,S,P,l]),z(()=>{h&&R==null&&l.set("payload",void 0)},[l,R,h]);const O=p.useCallback(()=>{l.setOpen(!1,Tr(l,io))},[l]);p.useImperativeHandle(i,()=>({unmount:v,close:O}),[v,O]);const F=l.useState("floatingRootContext"),M=gr(F,{enabled:!e}),k=zn(F,{enabled:!e,referencePress:!0}),T=Eo(F,{enabled:!e&&s!=="none",axis:s==="none"?void 0:s}),{getReferenceProps:y,getFloatingProps:D,getTriggerProps:I}=qn([M,k,T]),H=p.useMemo(()=>y(),[y]),A=p.useMemo(()=>I(),[I]),w=p.useMemo(()=>D(),[D]);return l.useSyncedValues({activeTriggerProps:H,inactiveTriggerProps:A,popupProps:w}),K.jsx(gn.Provider,{value:l,children:typeof m=="function"?m({payload:x}):m})}function Tr(t,e){const n=G(e);return n.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},n}const Cn=p.createContext(void 0);function Pr(){return p.useContext(Cn)}const Or=600,Ar=p.forwardRef(function(e,n){const{className:o,render:r,handle:s,payload:i,disabled:c,delay:a,closeDelay:d,id:u,...f}=e,m=Ge(!0),l=s?.store??m;if(!l)throw new Error(Ue(82));const g=co(u),h=l.useState("isTriggerActive",g),R=l.useState("isOpenedByTrigger",g),x=l.useState("floatingRootContext"),v=p.useRef(null),E=a??Or,C=d??0,{registerTrigger:P,isMountedByThisTrigger:S}=Gn(g,v,l,{payload:i,closeDelay:C}),b=Pr(),{delayRef:O,isInstantPhase:F,hasProvider:M}=wo(x,{open:R});l.useSyncedValue("isInstantPhase",F);const k=l.useState("disabled"),T=c??k,y=l.useState("trackCursorAxis"),D=l.useState("disableHoverablePopup"),I=Rr(x,{enabled:!T,mouseOnly:!0,move:!1,handleClose:!D&&y!=="both"?br():null,restMs(){const L=b?.delay,W=typeof O.current=="object"?O.current.open:void 0;let B=E;return M&&(W!==0?B=a??L??E:B=0),B},delay(){const L=typeof O.current=="object"?O.current.close:void 0;let W=C;return d==null&&M&&(W=L),{close:W}},triggerElementRef:v,isActiveTrigger:h}),H=p.useMemo(()=>({open:R}),[R]),A=l.useState("triggerProps",S);return lt("button",e,{state:H,ref:[n,P,v],props:[I,A,{id:g},f],stateAttributesMapping:Kn})}),Sn=p.createContext(void 0);function Mr(){const t=p.useContext(Sn);if(t===void 0)throw new Error(Ue(70));return t}const Lr=p.forwardRef(function(e,n){const{children:o,container:r,className:s,render:i,...c}=e,{portalNode:a,portalSubtree:d}=Qn({container:r,ref:n,componentProps:e,elementProps:c});return!d&&!a?null:K.jsxs(p.Fragment,{children:[d,a&&_e.createPortal(o,a)]})}),Dr=p.forwardRef(function(e,n){const{keepMounted:o=!1,...r}=e;return Ge().useState("mounted")||o?K.jsx(Sn.Provider,{value:o,children:K.jsx(Lr,{ref:n,...r})}):null}),Tn=p.createContext(void 0);function Ir(){const t=p.useContext(Tn);if(t===void 0)throw new Error(Ue(71));return t}const kr=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:a}=e,{element:d,padding:u=0,offsetParent:f="real"}=de(t,e)||{};if(d==null)return{};const m=an(u),l={x:n,y:o},g=ln(r),h=un(g),R=await i.getDimensions(d),x=g==="y",v=x?"top":"left",E=x?"bottom":"right",C=x?"clientHeight":"clientWidth",P=s.reference[h]+s.reference[g]-l[g]-s.floating[h],S=l[g]-s.reference[g],b=f==="real"?await i.getOffsetParent?.(d):c.floating;let O=c.floating[C]||s.floating[h];(!O||!await i.isElement?.(b))&&(O=c.floating[C]||s.floating[h]);const F=P/2-S/2,M=O/2-R[h]/2-1,k=Math.min(m[v],M),T=Math.min(m[E],M),y=k,D=O-R[h]-T,I=O/2-R[h]/2+F,H=it(y,I,D),A=!a.arrow&&be(r)!=null&&I!==H&&s.reference[h]/2-(I<y?k:T)-R[h]/2<0,w=A?I<y?I-y:I-D:0;return{[g]:l[g]+w,data:{[g]:H,centerOffset:I-H-w,...A&&{alignmentOffset:w}},reset:A}}}),Fr=(t,e)=>({...kr(t),options:[t,e]}),Hr={name:"hide",async fn(t){const{width:e,height:n,x:o,y:r}=t.rects.reference,s=e===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await ur().fn(t)).data?.referenceHidden||s}}}},Be={sideX:"left",sideY:"top"},Vr={name:"adaptiveOrigin",async fn(t){const{x:e,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:c}=t,a=le(r),d=a.getComputedStyle(r);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:e,y:n,data:Be};const f=await s.getOffsetParent?.(r);let m={width:0,height:0};if(i==="fixed"&&a?.visualViewport)m={width:a.visualViewport.width,height:a.visualViewport.height};else if(f===a){const v=cn(r);m={width:v.documentElement.clientWidth,height:v.documentElement.clientHeight}}else await s.isElement?.(f)&&(m=await s.getDimensions(f));const l=te(c);let g=e,h=n;l==="left"&&(g=m.width-(e+o.width)),l==="top"&&(h=m.height-(n+o.height));const R=l==="left"?"right":Be.sideX,x=l==="top"?"bottom":Be.sideY;return{x:g,y:h,data:{sideX:R,sideY:x}}}};function Pn(t,e,n){const o=t==="inline-start"||t==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[e]}function Ut(t,e,n){const{rects:o,placement:r}=t;return{side:Pn(e,te(r),n),align:be(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Br(t){const{anchor:e,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:a=5,sticky:d=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:m=!1,floatingRootContext:l,mounted:g,collisionAvoidance:h,shiftCrossAxis:R=!1,nodeId:x,adaptiveOrigin:v,lazyFlip:E=!1,externalTree:C}=t,[P,S]=p.useState(null);!g&&P!==null&&S(null);const b=h.side||"flip",O=h.align||"flip",F=h.fallbackAxisSide||"end",M=typeof e=="function"?e:void 0,k=Z(M),T=M?k:e,y=Re(e),I=vo()==="rtl",H=P||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[o],A=s==="center"?H:`${H}-${s}`;let w=a;const L=1,W=o==="bottom"?L:0,B=o==="top"?L:0,U=o==="right"?L:0,X=o==="left"?L:0;typeof w=="number"?w={top:w+W,right:w+X,bottom:w+B,left:w+U}:w&&(w={top:(w.top||0)+W,right:(w.right||0)+X,bottom:(w.bottom||0)+B,left:(w.left||0)+U});const Y={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:w},_=p.useRef(null),V=Re(r),$=Re(i),oe=[sr(N=>{const q=Ut(N,o,I),ie=typeof V.current=="function"?V.current(q):V.current,Q=typeof $.current=="function"?$.current(q):$.current;return{mainAxis:ie,crossAxis:Q,alignmentAxis:Q}},[typeof r!="function"?r:0,typeof i!="function"?i:0,I,o])],pt=O==="none"&&b!=="shift",ht=!pt&&(d||R||b==="shift"),yt=b==="none"?null:lr({...Y,padding:{top:w.top+L,right:w.right+L,bottom:w.bottom+L,left:w.left+L},mainAxis:!R&&b==="flip",crossAxis:O==="flip"?"alignment":!1,fallbackAxisSideDirection:F}),xt=pt?null:ir(N=>{const q=cn(N.elements.floating).documentElement;return{...Y,rootBoundary:R?{x:0,y:0,width:q.clientWidth,height:q.clientHeight}:void 0,mainAxis:O!=="none",crossAxis:ht,limiter:d||R?void 0:cr(ie=>{if(!_.current)return{};const{width:Q,height:xe}=_.current.getBoundingClientRect(),ve=re(te(ie.placement)),Ie=ve==="y"?Q:xe,Ze=ve==="y"?w.left+w.right:w.top+w.bottom;return{offset:Ie/2+Ze/2}})}},[Y,d,R,w,O]);b==="shift"||O==="shift"||s==="center"?oe.push(xt,yt):oe.push(yt,xt),oe.push(ar({...Y,apply({elements:{floating:N},rects:{reference:q},availableWidth:ie,availableHeight:Q}){Object.entries({"--available-width":`${ie}px`,"--available-height":`${Q}px`,"--anchor-width":`${q.width}px`,"--anchor-height":`${q.height}px`}).forEach(([xe,ve])=>{N.style.setProperty(xe,ve)})}}),Fr(()=>({element:_.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(N){const{elements:q,middlewareData:ie,placement:Q,rects:xe,y:ve}=N,Ie=te(Q),Ze=re(Ie),Dt=_.current,An=ie.arrow?.x||0,Mn=ie.arrow?.y||0,Ln=Dt?.clientWidth||0,Dn=Dt?.clientHeight||0,et=An+Ln/2,It=Mn+Dn/2,In=Math.abs(ie.shift?.y||0),kn=xe.reference.height/2,Te=typeof r=="function"?r(Ut(N,o,I)):r,Fn=In>Te,Hn={top:`${et}px calc(100% + ${Te}px)`,bottom:`${et}px ${-Te}px`,left:`calc(100% + ${Te}px) ${It}px`,right:`${-Te}px ${It}px`}[Ie],Vn=`${et}px ${xe.reference.y+kn-ve}px`;return q.floating.style.setProperty("--transform-origin",ht&&Ze==="y"&&Fn?Vn:Hn),{}}},Hr,v),z(()=>{!g&&l&&l.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,l]);const Qe=p.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:he,elements:Ee,x:vt,y:Rt,middlewareData:ye,update:Le,placement:wt,context:bt,isPositioned:Ce,floatingStyles:Et}=dr({rootContext:l,placement:A,middleware:oe,strategy:n,whileElementsMounted:m?void 0:(...N)=>Nt(...N,Qe),nodeId:x,externalTree:C}),{sideX:Ct,sideY:St}=ye.adaptiveOrigin||Be,Je=Ce?n:"fixed",Tt=p.useMemo(()=>v?{position:Je,[Ct]:vt,[St]:Rt}:{position:Je,...Et},[v,Je,Ct,vt,St,Rt,Et]),De=p.useRef(null);z(()=>{if(!g)return;const N=y.current,q=typeof N=="function"?N():N,Q=(zt(q)?q.current:q)||null||null;Q!==De.current&&(he.setPositionReference(Q),De.current=Q)},[g,he,T,y]),p.useEffect(()=>{if(!g)return;const N=y.current;typeof N!="function"&&zt(N)&&N.current!==De.current&&(he.setPositionReference(N.current),De.current=N.current)},[g,he,T,y]),p.useEffect(()=>{if(m&&g&&Ee.domReference&&Ee.floating)return Nt(Ee.domReference,Ee.floating,Le,Qe)},[m,g,Ee,Le,Qe]);const Se=te(wt),Pt=Pn(o,Se,I),Ot=be(wt)||"center",At=!!ye.hide?.referenceHidden;z(()=>{E&&g&&Ce&&S(Se)},[E,g,Ce,Se]);const Mt=p.useMemo(()=>({position:"absolute",top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Lt=ye.arrow?.centerOffset!==0;return p.useMemo(()=>({positionerStyles:Tt,arrowStyles:Mt,arrowRef:_,arrowUncentered:Lt,side:Pt,align:Ot,physicalSide:Se,anchorHidden:At,refs:he,context:bt,isPositioned:Ce,update:Le}),[Tt,Mt,_,Lt,Pt,Ot,Se,At,he,bt,Ce,Le])}function zt(t){return t!=null&&"current"in t}function On(t){return t==="starting"?Jn:Bn}const $r=p.forwardRef(function(e,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:c="top",align:a="center",sideOffset:d=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:m=5,arrowPadding:l=5,sticky:g=!1,disableAnchorTracking:h=!1,collisionAvoidance:R=Zn,...x}=e,v=Ge(),E=Mr(),C=v.useState("open"),P=v.useState("mounted"),S=v.useState("trackCursorAxis"),b=v.useState("disableHoverablePopup"),O=v.useState("floatingRootContext"),F=v.useState("instantType"),M=v.useState("transitionStatus"),k=v.useState("hasViewport"),T=Br({anchor:s,positionMethod:i,floatingRootContext:O,mounted:P,side:c,sideOffset:d,align:a,alignOffset:u,collisionBoundary:f,collisionPadding:m,sticky:g,arrowPadding:l,disableAnchorTracking:h,keepMounted:E,collisionAvoidance:R,adaptiveOrigin:k?Vr:void 0}),y=p.useMemo(()=>{const A={};return(!C||S==="both"||b)&&(A.pointerEvents="none"),{role:"presentation",hidden:!P,style:{...T.positionerStyles,...A}}},[C,S,b,P,T.positionerStyles]),D=p.useMemo(()=>({open:C,side:T.side,align:T.align,anchorHidden:T.anchorHidden,instant:S!=="none"?"tracking-cursor":F}),[C,T.side,T.align,T.anchorHidden,S,F]),I=p.useMemo(()=>({...D,arrowRef:T.arrowRef,arrowStyles:T.arrowStyles,arrowUncentered:T.arrowUncentered}),[D,T.arrowRef,T.arrowStyles,T.arrowUncentered]),H=lt("div",e,{state:D,props:[y,On(M),x],ref:[n,v.useStateSetter("positionerElement")],stateAttributesMapping:en});return K.jsx(Tn.Provider,{value:I,children:H})}),Wr={...en,...to},jr=p.forwardRef(function(e,n){const{className:o,render:r,...s}=e,i=Ge(),{side:c,align:a}=Ir(),d=i.useState("open"),u=i.useState("instantType"),f=i.useState("transitionStatus"),m=i.useState("popupProps"),l=i.useState("floatingRootContext");eo({open:d,ref:i.context.popupRef,onComplete(){d&&i.context.onOpenChangeComplete?.(!0)}});const g=i.useState("disabled"),h=i.useState("closeDelay");yr(l,{enabled:!g,closeDelay:h});const R=p.useMemo(()=>({open:d,side:c,align:a,instant:u,transitionStatus:f}),[d,c,a,u,f]);return lt("div",e,{state:R,ref:[n,i.context.popupRef,i.useStateSetter("popupElement")],props:[m,On(f),s],stateAttributesMapping:Wr})}),Yr=function(e){const{delay:n,closeDelay:o,timeout:r=400}=e,s=p.useMemo(()=>({delay:n,closeDelay:o}),[n,o]),i=p.useMemo(()=>({open:n,close:o}),[n,o]);return K.jsx(Cn.Provider,{value:s,children:K.jsx(Ro,{delay:i,timeoutMs:r,children:e.children})})};function Qr({children:t}){return K.jsx(Yr,{delay:0,closeDelay:0,timeout:0,children:t})}function Jr({children:t,...e}){return K.jsx(Sr,{...e,children:t})}function Zr({className:t,...e}){return K.jsx(Ar,{className:Gt(t),...e})}function es({className:t,side:e="top",children:n}){return K.jsx(Dr,{children:K.jsx($r,{side:e,children:K.jsx(jr,{className:Gt("rounded-md border border-primary-900 bg-primary-950 px-2 py-1 text-xs text-primary-50 shadow-sm",t),children:n})})})}export{Qr as T,Jr as a,Zr as b,es as c,dn as d,On as e,Br as f,Gr as g,Rr as h,br as i,gr as j,Kr as s,yr as u};
@@ -1,4 +1,4 @@
1
- import{r as a,j as M}from"./main-B_dlfHME.js";import{t as Be,ab as ht,ai as yt,ac as Ze,ag as re,af as vt,u as St,c as pe,B as Et}from"./button-Dg7VFQQn.js";import{z as et,a as Q,i as te,u as oe,m as xt,o as Ct,g as we,j as Rt,A as ge,h as wt,p as kt,f as Tt,B as It,d as tt,D as nt,v as Ft}from"./useButton-Cbl_9oFG.js";import{k as U,j as je,h as Re,d as ne,e as L,m as Ot,n as Pt,s as Mt,l as se,o as ie,p as ot,q as Dt}from"./owner-CpRnf1fI.js";import{b as ce,d as Lt,E as At,a as Ve,u as Nt,G as st,H as ke,I as We,J as Ge,K as X,L as $e,B as Ye,x as qe,z as Bt,M as jt,N as rt,O as Vt,Q as Wt,c as Gt,p as it,t as at,S as ue,e as $t,F as Yt,U as He,V as qt,m as Ht,n as Ut,o as Xt,q as Kt,r as zt,R as _t,g as Jt,h as Qt,k as Zt,i as H}from"./popupStateMapping-BRPDXnjv.js";import{C as en}from"./composite-DBl8R3ae.js";import{a as tn}from"./visuallyHidden-ONmQ-0U2.js";import{c as nn}from"./react-irH8OzhB.js";let Ue=0;function Ee(e,n={}){const{preventScroll:t=!1,cancelPrevious:o=!0,sync:s=!1}=n;o&&cancelAnimationFrame(Ue);const i=()=>e?.focus({preventScroll:t});s?i():Ue=requestAnimationFrame(i)}const Z={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Xe(e){return e==="inert"?Z.inert:e==="aria-hidden"?Z["aria-hidden"]:Z.none}let de=new WeakSet,fe={},xe=0;const lt=e=>e&&(e.host||lt(e.parentNode)),on=(e,n)=>n.map(t=>{if(e.contains(t))return t;const o=lt(t);return e.contains(o)?o:null}).filter(t=>t!=null);function sn(e,n,t,o){const s="data-base-ui-inert",i=o?"inert":t?"aria-hidden":null,l=on(n,e),u=new Set,r=new Set(l),C=[];fe[s]||(fe[s]=new WeakMap);const R=fe[s];l.forEach(x),f(n),u.clear();function x(c){!c||u.has(c)||(u.add(c),c.parentNode&&x(c.parentNode))}function f(c){!c||r.has(c)||[].forEach.call(c.children,d=>{if(et(d)!=="script")if(u.has(d))f(d);else{const T=i?d.getAttribute(i):null,v=T!==null&&T!=="false",S=Xe(i),b=(S.get(d)||0)+1,m=(R.get(d)||0)+1;S.set(d,b),R.set(d,m),C.push(d),b===1&&v&&de.add(d),m===1&&d.setAttribute(s,""),!v&&i&&d.setAttribute(i,i==="inert"?"":"true")}})}return xe+=1,()=>{C.forEach(c=>{const d=Xe(i),v=(d.get(c)||0)-1,S=(R.get(c)||0)-1;d.set(c,v),R.set(c,S),v||(!de.has(c)&&i&&c.removeAttribute(i),de.delete(c)),S||c.removeAttribute(s)}),xe-=1,xe||(Z.inert=new WeakMap,Z["aria-hidden"]=new WeakMap,Z.none=new WeakMap,de=new WeakSet,fe={})}}function rn(e,n=!1,t=!1){const o=U(e[0]).body;return sn(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,n,t)}function an(e,n){const t=ge(e.target);return e instanceof t.KeyboardEvent?"keyboard":e instanceof t.FocusEvent?n||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof t.MouseEvent?n||(e.detail===0?"keyboard":"mouse"):""}const Ke=20;let K=[];function Te(){K=K.filter(e=>e.isConnected)}function ln(e){Te(),e&&et(e)!=="body"&&(K.push(e),K.length>Ke&&(K=K.slice(-Ke)))}function Ce(){return Te(),K[K.length-1]}function cn(e){if(!e)return null;const n=ke();return rt(e,n)?e:st(e,n)[0]||e}function un(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():wt(e).display!=="none"}function ze(e,n){if(!n.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const t=ke(),s=Wt(e,t).filter(l=>{const u=l.getAttribute("data-tabindex")||"";return rt(l,t)||l.hasAttribute("data-tabindex")&&!u.startsWith("-")}),i=e.getAttribute("tabindex");n.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function dn(e){const{context:n,children:t,disabled:o=!1,order:s=["content"],initialFocus:i=!0,returnFocus:l=!0,restoreFocus:u=!1,modal:r=!0,closeOnFocusOut:C=!0,openInteractionType:R="",getInsideElements:x=()=>[],nextFocusableElement:f,previousFocusableElement:c,beforeContentFocusGuardRef:d,externalTree:T}=e,v="rootStore"in n?n.rootStore:n,S=v.useState("open"),b=v.useState("domReferenceElement"),m=v.useState("floatingElement"),{events:N,dataRef:P}=v.context,A=Q(()=>P.current.floatingContext?.nodeId),Y=Q(x),V=i===!1,D=je(b)&&V,O=ce(s),B=ce(i),q=ce(l),Ie=ce(R),W=Lt(T),w=At(),dt=a.useRef(null),ft=a.useRef(null),G=a.useRef(!1),ae=a.useRef(!1),me=a.useRef(!1),Fe=a.useRef(-1),Oe=a.useRef(""),be=a.useRef(""),he=a.useRef(null),ye=a.useRef(null),pt=Be(he,d,w?.beforeInsideRef),gt=Be(ye,w?.afterInsideRef),Pe=Ve(),Me=Ve(),De=Nt(),ve=w!=null,h=Re(m),z=Q((g=h)=>g?st(g,ke()):[]),ee=Q(g=>{const E=z(g);return O.current.map(()=>E).filter(Boolean).flat()});a.useEffect(()=>{if(o||!r)return;function g(I){I.key==="Tab"&&L(h,ne(U(h)))&&z().length===0&&!D&&Mt(I)}const E=U(h);return E.addEventListener("keydown",g),()=>{E.removeEventListener("keydown",g)}},[o,b,h,r,O,D,z,ee]),a.useEffect(()=>{if(o||!m)return;function g(E){const I=se(E),F=z().indexOf(I);F!==-1&&(Fe.current=F)}return m.addEventListener("focusin",g),()=>{m.removeEventListener("focusin",g)}},[o,m,z]),a.useEffect(()=>{if(o||!S)return;const g=U(h);function E(){me.current=!1}function I(F){const p=se(F),y=L(m,p)||L(b,p)||L(w?.portalNode,p);me.current=!y,be.current=F.pointerType||"keyboard"}function k(){be.current="keyboard"}return g.addEventListener("pointerdown",I,!0),g.addEventListener("pointerup",E,!0),g.addEventListener("pointercancel",E,!0),g.addEventListener("keydown",k,!0),()=>{g.removeEventListener("pointerdown",I,!0),g.removeEventListener("pointerup",E,!0),g.removeEventListener("pointercancel",E,!0),g.removeEventListener("keydown",k,!0)}},[o,m,b,h,S,w]),a.useEffect(()=>{if(o||!C)return;function g(){ae.current=!0,Me.start(0,()=>{ae.current=!1})}function E(p){const y=p.relatedTarget,J=p.currentTarget,j=se(p);queueMicrotask(()=>{const le=A(),Ae=v.context.triggerElements,mt=y?.hasAttribute(We("focus-guard"))&&[he.current,ye.current,w?.beforeInsideRef.current,w?.afterInsideRef.current,w?.beforeOutsideRef.current,w?.afterOutsideRef.current,X(c),X(f)].includes(y),bt=!(L(b,y)||L(m,y)||L(y,m)||L(w?.portalNode,y)||y!=null&&Ae.hasElement(y)||Ae.hasMatchingElement($=>L($,y))||mt||W&&($e(W.nodesRef.current,le).find($=>L($.context?.elements.floating,y)||L($.context?.elements.domReference,y))||Ge(W.nodesRef.current,le).find($=>[$.context?.elements.floating,Re($.context?.elements.floating)].includes(y)||$.context?.elements.domReference===y)));if(J===b&&h&&ze(h,O),u&&J!==b&&!un(j)&&ne(U(h))===U(h).body){if(te(h)&&(h.focus(),u==="popup")){De.request(()=>{h.focus()});return}const $=Fe.current,Se=z(),Ne=Se[$]||Se[Se.length-1]||h;te(Ne)&&Ne.focus()}if(P.current.insideReactTree){P.current.insideReactTree=!1;return}(D||!r)&&y&&bt&&!ae.current&&(D||y!==Ce())&&(G.current=!0,v.setOpen(!1,we(Rt,p)))})}function I(){me.current||(P.current.insideReactTree=!0,Pe.start(0,()=>{P.current.insideReactTree=!1}))}const k=te(b)?b:null,F=[];if(!(!m&&!k))return k&&(k.addEventListener("focusout",E),k.addEventListener("pointerdown",g),F.push(()=>{k.removeEventListener("focusout",E),k.removeEventListener("pointerdown",g)})),m&&(m.addEventListener("focusout",E),w&&(m.addEventListener("focusout",I,!0),F.push(()=>{m.removeEventListener("focusout",I,!0)})),F.push(()=>{m.removeEventListener("focusout",E)})),()=>{F.forEach(p=>{p()})}},[o,b,m,h,r,W,w,v,C,u,z,D,A,O,P,Pe,Me,De,f,c]),a.useEffect(()=>{if(o||!m||!S)return;const g=Array.from(w?.portalNode?.querySelectorAll(`[${We("portal")}]`)||[]),I=(W?Ge(W.nodesRef.current,A()):[]).find(p=>je(p.context?.elements.domReference||null))?.context?.elements.domReference,k=[m,I,...g,...Y(),dt.current,ft.current,he.current,ye.current,w?.beforeOutsideRef.current,w?.afterOutsideRef.current,X(c),X(f),D?b:null].filter(p=>p!=null),F=rn(k,r||D);return()=>{F()}},[S,o,b,m,r,O,w,D,W,A,Y,f,c]),oe(()=>{if(!S||o||!te(h))return;const g=U(h),E=ne(g);queueMicrotask(()=>{const I=ee(h),k=B.current,F=typeof k=="function"?k(Ie.current||""):k;if(F===void 0||F===!1)return;let p;F===!0||F===null?p=I[0]||h:p=X(F),p=p||I[0]||h,!L(h,E)&&Ee(p,{preventScroll:p===h})})},[o,S,h,V,ee,B,Ie]),oe(()=>{if(o||!h)return;const g=U(h),E=ne(g);ln(E);function I(p){if(p.open||(Oe.current=an(p.nativeEvent,be.current)),p.reason===xt&&p.nativeEvent.type==="mouseleave"&&(G.current=!0),p.reason===Ct)if(p.nested)G.current=!1;else if(Ot(p.nativeEvent)||Pt(p.nativeEvent))G.current=!1;else{let y=!1;document.createElement("div").focus({get preventScroll(){return y=!0,!1}}),y?G.current=!1:G.current=!0}}N.on("openchange",I);const k=g.createElement("span");k.setAttribute("tabindex","-1"),k.setAttribute("aria-hidden","true"),Object.assign(k.style,tn),ve&&b&&b.insertAdjacentElement("afterend",k);function F(){const p=q.current;let y=typeof p=="function"?p(Oe.current):p;if(y===void 0||y===!1)return null;if(y===null&&(y=!0),typeof y=="boolean"){const j=b||Ce();return j&&j.isConnected?j:k}const J=b||Ce()||k;return X(y)||J}return()=>{N.off("openchange",I);const p=ne(g),y=L(m,p)||W&&$e(W.nodesRef.current,A(),!1).some(j=>L(j.context?.elements.floating,p)),J=F();queueMicrotask(()=>{const j=cn(J),le=typeof q.current!="boolean";q.current&&!G.current&&te(j)&&(!(!le&&j!==p&&p!==g.body)||y)&&j.focus({preventScroll:!0}),k.remove()})}},[o,m,h,q,P,N,W,ve,b,A]),a.useEffect(()=>{queueMicrotask(()=>{G.current=!1})},[o]),a.useEffect(()=>{if(o||!S)return;function g(I){se(I)?.closest(`[${Vt}]`)&&(ae.current=!0)}const E=U(h);return E.addEventListener("pointerdown",g,!0),()=>{E.removeEventListener("pointerdown",g,!0)}},[o,S,h]),oe(()=>{if(!o&&w)return w.setFocusManagerState({modal:r,closeOnFocusOut:C,open:S,onOpenChange:v.setOpen,domReference:b}),()=>{w.setFocusManagerState(null)}},[o,w,r,S,v,C,b]),oe(()=>{if(!(o||!h))return ze(h,O),()=>{queueMicrotask(Te)}},[o,h,O]);const Le=!o&&(r?!D:!0)&&(ve||r);return M.jsxs(a.Fragment,{children:[Le&&M.jsx(Ye,{"data-type":"inside",ref:pt,onFocus:g=>{if(r){const E=ee();Ee(E[E.length-1])}else w?.portalNode&&(G.current=!1,qe(g,w.portalNode)?Bt(b)?.focus():X(c??w.beforeOutsideRef)?.focus())}}),t,Le&&M.jsx(Ye,{"data-type":"inside",ref:gt,onFocus:g=>{r?Ee(ee()[0]):w?.portalNode&&(C&&(G.current=!0),qe(g,w.portalNode)?jt(b)?.focus():X(f??w.afterOutsideRef)?.focus())}})]})}const fn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function pn(e,n={}){const t="rootStore"in e?e.rootStore:e,o=t.useState("open"),s=t.useState("floatingId"),i=t.useState("domReferenceElement"),l=t.useState("floatingElement"),{enabled:u=!0,role:r="dialog"}=n,C=kt(),R=i?.id||C,x=a.useMemo(()=>Re(l)?.id||s,[l,s]),f=fn.get(r)??r,d=Gt()!=null,T=a.useMemo(()=>f==="tooltip"||r==="label"?ht:{"aria-haspopup":f==="alertdialog"?"dialog":f,"aria-expanded":"false",...f==="listbox"&&{role:"combobox"},...f==="menu"&&d&&{role:"menuitem"},...r==="select"&&{"aria-autocomplete":"none"},...r==="combobox"&&{"aria-autocomplete":"list"}},[f,d,r]),v=a.useMemo(()=>f==="tooltip"||r==="label"?{[`aria-${r==="label"?"labelledby":"describedby"}`]:o?x:void 0}:{...T,"aria-expanded":o?"true":"false","aria-controls":o?x:void 0,...f==="menu"&&{id:R}},[f,x,o,R,r,T]),S=a.useMemo(()=>{const m={id:x,...f&&{role:f}};return f==="tooltip"||r==="label"?m:{...m,...f==="menu"&&{"aria-labelledby":R}}},[f,x,R,r]),b=a.useCallback(({active:m,selected:N})=>{const P={role:"option",...m&&{id:`${x}-fui-option`}};switch(r){case"select":case"combobox":return{...P,"aria-selected":N}}return{}},[x,r]);return a.useMemo(()=>u?{reference:v,floating:S,item:b,trigger:T}:{},[u,v,S,T,b])}function gn(e){return yt(19)?e:e?"true":void 0}const ct=a.createContext(void 0);function _(e){const n=a.useContext(ct);if(e===!1&&n===void 0)throw new Error(Ze(27));return n}const mn={...it,...at},bn=a.forwardRef(function(n,t){const{render:o,className:s,forceRender:i=!1,...l}=n,{store:u}=_(),r=u.useState("open"),C=u.useState("nested"),R=u.useState("mounted"),x=u.useState("transitionStatus"),f=a.useMemo(()=>({open:r,transitionStatus:x}),[r,x]);return re("div",n,{state:f,ref:[u.context.backdropRef,t],stateAttributesMapping:mn,props:[{role:"presentation",hidden:!R,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:i||!C})}),hn=a.forwardRef(function(n,t){const{render:o,className:s,disabled:i=!1,nativeButton:l=!0,...u}=n,{store:r}=_(),C=r.useState("open");function R(d){C&&r.setOpen(!1,we(It,d.nativeEvent))}const{getButtonProps:x,buttonRef:f}=Tt({disabled:i,native:l}),c=a.useMemo(()=>({disabled:i}),[i]);return re("button",n,{state:c,ref:[t,f],props:[{onClick:R},u,x]})}),yn=a.forwardRef(function(n,t){const{render:o,className:s,id:i,...l}=n,{store:u}=_(),r=tt(i);return u.useSyncedValueWithCleanup("descriptionElementId",r),re("p",n,{ref:t,props:[{id:r},l]})});let vn=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),Sn=(function(e){return e[e.open=ue.open]="open",e[e.closed=ue.closed]="closed",e[e.startingStyle=ue.startingStyle]="startingStyle",e[e.endingStyle=ue.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const ut=a.createContext(void 0);function En(){const e=a.useContext(ut);if(e===void 0)throw new Error(Ze(26));return e}const xn={...it,...at,nestedDialogOpen(e){return e?{[Sn.nestedDialogOpen]:""}:null}},Cn=a.forwardRef(function(n,t){const{className:o,finalFocus:s,initialFocus:i,render:l,...u}=n,{store:r}=_(),C=r.useState("descriptionElementId"),R=r.useState("disablePointerDismissal"),x=r.useState("floatingRootContext"),f=r.useState("popupProps"),c=r.useState("modal"),d=r.useState("mounted"),T=r.useState("nested"),v=r.useState("nestedOpenDialogCount"),S=r.useState("open"),b=r.useState("openMethod"),m=r.useState("titleElementId"),N=r.useState("transitionStatus"),P=r.useState("role");En(),$t({open:S,ref:r.context.popupRef,onComplete(){S&&r.context.onOpenChangeComplete?.(!0)}});function A(B){return B==="touch"?r.context.popupRef.current:!0}const Y=i===void 0?A:i,V=v>0,D=a.useMemo(()=>({open:S,nested:T,transitionStatus:N,nestedDialogOpen:V}),[S,T,N,V]),O=re("div",n,{state:D,props:[f,{"aria-labelledby":m??void 0,"aria-describedby":C??void 0,role:P,tabIndex:-1,hidden:!d,onKeyDown(B){en.has(B.key)&&B.stopPropagation()},style:{[vn.nestedDialogs]:v}},u],ref:[t,r.context.popupRef,r.useStateSetter("popupElement")],stateAttributesMapping:xn});return M.jsx(dn,{context:x,openInteractionType:b,disabled:!d,closeOnFocusOut:!R,initialFocus:Y,returnFocus:s,modal:c!==!1,restoreFocus:"popup",children:O})}),Rn=a.forwardRef(function(n,t){const{cutout:o,...s}=n;let i;if(o){const l=o?.getBoundingClientRect();i=`polygon(
1
+ import{r as a,j as M}from"./main-ZPHfbCuz.js";import{t as Be,ab as ht,ai as yt,ac as Ze,ag as re,af as vt,u as St,c as pe,B as Et}from"./button-DzGUU5Tc.js";import{z as et,a as Q,i as te,u as oe,m as xt,o as Ct,g as we,j as Rt,A as ge,h as wt,p as kt,f as Tt,B as It,d as tt,D as nt,v as Ft}from"./useButton-Bh6gEhdL.js";import{k as U,j as je,h as Re,d as ne,e as L,m as Ot,n as Pt,s as Mt,l as se,o as ie,p as ot,q as Dt}from"./owner-Bm20thei.js";import{b as ce,d as Lt,E as At,a as Ve,u as Nt,G as st,H as ke,I as We,J as Ge,K as X,L as $e,B as Ye,x as qe,z as Bt,M as jt,N as rt,O as Vt,Q as Wt,c as Gt,p as it,t as at,S as ue,e as $t,F as Yt,U as He,V as qt,m as Ht,n as Ut,o as Xt,q as Kt,r as zt,R as _t,g as Jt,h as Qt,k as Zt,i as H}from"./popupStateMapping-C797EAip.js";import{C as en}from"./composite-afaLtloO.js";import{a as tn}from"./visuallyHidden-ChUPUs-q.js";import{c as nn}from"./react-DuiuJSA1.js";let Ue=0;function Ee(e,n={}){const{preventScroll:t=!1,cancelPrevious:o=!0,sync:s=!1}=n;o&&cancelAnimationFrame(Ue);const i=()=>e?.focus({preventScroll:t});s?i():Ue=requestAnimationFrame(i)}const Z={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Xe(e){return e==="inert"?Z.inert:e==="aria-hidden"?Z["aria-hidden"]:Z.none}let de=new WeakSet,fe={},xe=0;const lt=e=>e&&(e.host||lt(e.parentNode)),on=(e,n)=>n.map(t=>{if(e.contains(t))return t;const o=lt(t);return e.contains(o)?o:null}).filter(t=>t!=null);function sn(e,n,t,o){const s="data-base-ui-inert",i=o?"inert":t?"aria-hidden":null,l=on(n,e),u=new Set,r=new Set(l),C=[];fe[s]||(fe[s]=new WeakMap);const R=fe[s];l.forEach(x),f(n),u.clear();function x(c){!c||u.has(c)||(u.add(c),c.parentNode&&x(c.parentNode))}function f(c){!c||r.has(c)||[].forEach.call(c.children,d=>{if(et(d)!=="script")if(u.has(d))f(d);else{const T=i?d.getAttribute(i):null,v=T!==null&&T!=="false",S=Xe(i),b=(S.get(d)||0)+1,m=(R.get(d)||0)+1;S.set(d,b),R.set(d,m),C.push(d),b===1&&v&&de.add(d),m===1&&d.setAttribute(s,""),!v&&i&&d.setAttribute(i,i==="inert"?"":"true")}})}return xe+=1,()=>{C.forEach(c=>{const d=Xe(i),v=(d.get(c)||0)-1,S=(R.get(c)||0)-1;d.set(c,v),R.set(c,S),v||(!de.has(c)&&i&&c.removeAttribute(i),de.delete(c)),S||c.removeAttribute(s)}),xe-=1,xe||(Z.inert=new WeakMap,Z["aria-hidden"]=new WeakMap,Z.none=new WeakMap,de=new WeakSet,fe={})}}function rn(e,n=!1,t=!1){const o=U(e[0]).body;return sn(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,n,t)}function an(e,n){const t=ge(e.target);return e instanceof t.KeyboardEvent?"keyboard":e instanceof t.FocusEvent?n||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof t.MouseEvent?n||(e.detail===0?"keyboard":"mouse"):""}const Ke=20;let K=[];function Te(){K=K.filter(e=>e.isConnected)}function ln(e){Te(),e&&et(e)!=="body"&&(K.push(e),K.length>Ke&&(K=K.slice(-Ke)))}function Ce(){return Te(),K[K.length-1]}function cn(e){if(!e)return null;const n=ke();return rt(e,n)?e:st(e,n)[0]||e}function un(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():wt(e).display!=="none"}function ze(e,n){if(!n.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const t=ke(),s=Wt(e,t).filter(l=>{const u=l.getAttribute("data-tabindex")||"";return rt(l,t)||l.hasAttribute("data-tabindex")&&!u.startsWith("-")}),i=e.getAttribute("tabindex");n.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function dn(e){const{context:n,children:t,disabled:o=!1,order:s=["content"],initialFocus:i=!0,returnFocus:l=!0,restoreFocus:u=!1,modal:r=!0,closeOnFocusOut:C=!0,openInteractionType:R="",getInsideElements:x=()=>[],nextFocusableElement:f,previousFocusableElement:c,beforeContentFocusGuardRef:d,externalTree:T}=e,v="rootStore"in n?n.rootStore:n,S=v.useState("open"),b=v.useState("domReferenceElement"),m=v.useState("floatingElement"),{events:N,dataRef:P}=v.context,A=Q(()=>P.current.floatingContext?.nodeId),Y=Q(x),V=i===!1,D=je(b)&&V,O=ce(s),B=ce(i),q=ce(l),Ie=ce(R),W=Lt(T),w=At(),dt=a.useRef(null),ft=a.useRef(null),G=a.useRef(!1),ae=a.useRef(!1),me=a.useRef(!1),Fe=a.useRef(-1),Oe=a.useRef(""),be=a.useRef(""),he=a.useRef(null),ye=a.useRef(null),pt=Be(he,d,w?.beforeInsideRef),gt=Be(ye,w?.afterInsideRef),Pe=Ve(),Me=Ve(),De=Nt(),ve=w!=null,h=Re(m),z=Q((g=h)=>g?st(g,ke()):[]),ee=Q(g=>{const E=z(g);return O.current.map(()=>E).filter(Boolean).flat()});a.useEffect(()=>{if(o||!r)return;function g(I){I.key==="Tab"&&L(h,ne(U(h)))&&z().length===0&&!D&&Mt(I)}const E=U(h);return E.addEventListener("keydown",g),()=>{E.removeEventListener("keydown",g)}},[o,b,h,r,O,D,z,ee]),a.useEffect(()=>{if(o||!m)return;function g(E){const I=se(E),F=z().indexOf(I);F!==-1&&(Fe.current=F)}return m.addEventListener("focusin",g),()=>{m.removeEventListener("focusin",g)}},[o,m,z]),a.useEffect(()=>{if(o||!S)return;const g=U(h);function E(){me.current=!1}function I(F){const p=se(F),y=L(m,p)||L(b,p)||L(w?.portalNode,p);me.current=!y,be.current=F.pointerType||"keyboard"}function k(){be.current="keyboard"}return g.addEventListener("pointerdown",I,!0),g.addEventListener("pointerup",E,!0),g.addEventListener("pointercancel",E,!0),g.addEventListener("keydown",k,!0),()=>{g.removeEventListener("pointerdown",I,!0),g.removeEventListener("pointerup",E,!0),g.removeEventListener("pointercancel",E,!0),g.removeEventListener("keydown",k,!0)}},[o,m,b,h,S,w]),a.useEffect(()=>{if(o||!C)return;function g(){ae.current=!0,Me.start(0,()=>{ae.current=!1})}function E(p){const y=p.relatedTarget,J=p.currentTarget,j=se(p);queueMicrotask(()=>{const le=A(),Ae=v.context.triggerElements,mt=y?.hasAttribute(We("focus-guard"))&&[he.current,ye.current,w?.beforeInsideRef.current,w?.afterInsideRef.current,w?.beforeOutsideRef.current,w?.afterOutsideRef.current,X(c),X(f)].includes(y),bt=!(L(b,y)||L(m,y)||L(y,m)||L(w?.portalNode,y)||y!=null&&Ae.hasElement(y)||Ae.hasMatchingElement($=>L($,y))||mt||W&&($e(W.nodesRef.current,le).find($=>L($.context?.elements.floating,y)||L($.context?.elements.domReference,y))||Ge(W.nodesRef.current,le).find($=>[$.context?.elements.floating,Re($.context?.elements.floating)].includes(y)||$.context?.elements.domReference===y)));if(J===b&&h&&ze(h,O),u&&J!==b&&!un(j)&&ne(U(h))===U(h).body){if(te(h)&&(h.focus(),u==="popup")){De.request(()=>{h.focus()});return}const $=Fe.current,Se=z(),Ne=Se[$]||Se[Se.length-1]||h;te(Ne)&&Ne.focus()}if(P.current.insideReactTree){P.current.insideReactTree=!1;return}(D||!r)&&y&&bt&&!ae.current&&(D||y!==Ce())&&(G.current=!0,v.setOpen(!1,we(Rt,p)))})}function I(){me.current||(P.current.insideReactTree=!0,Pe.start(0,()=>{P.current.insideReactTree=!1}))}const k=te(b)?b:null,F=[];if(!(!m&&!k))return k&&(k.addEventListener("focusout",E),k.addEventListener("pointerdown",g),F.push(()=>{k.removeEventListener("focusout",E),k.removeEventListener("pointerdown",g)})),m&&(m.addEventListener("focusout",E),w&&(m.addEventListener("focusout",I,!0),F.push(()=>{m.removeEventListener("focusout",I,!0)})),F.push(()=>{m.removeEventListener("focusout",E)})),()=>{F.forEach(p=>{p()})}},[o,b,m,h,r,W,w,v,C,u,z,D,A,O,P,Pe,Me,De,f,c]),a.useEffect(()=>{if(o||!m||!S)return;const g=Array.from(w?.portalNode?.querySelectorAll(`[${We("portal")}]`)||[]),I=(W?Ge(W.nodesRef.current,A()):[]).find(p=>je(p.context?.elements.domReference||null))?.context?.elements.domReference,k=[m,I,...g,...Y(),dt.current,ft.current,he.current,ye.current,w?.beforeOutsideRef.current,w?.afterOutsideRef.current,X(c),X(f),D?b:null].filter(p=>p!=null),F=rn(k,r||D);return()=>{F()}},[S,o,b,m,r,O,w,D,W,A,Y,f,c]),oe(()=>{if(!S||o||!te(h))return;const g=U(h),E=ne(g);queueMicrotask(()=>{const I=ee(h),k=B.current,F=typeof k=="function"?k(Ie.current||""):k;if(F===void 0||F===!1)return;let p;F===!0||F===null?p=I[0]||h:p=X(F),p=p||I[0]||h,!L(h,E)&&Ee(p,{preventScroll:p===h})})},[o,S,h,V,ee,B,Ie]),oe(()=>{if(o||!h)return;const g=U(h),E=ne(g);ln(E);function I(p){if(p.open||(Oe.current=an(p.nativeEvent,be.current)),p.reason===xt&&p.nativeEvent.type==="mouseleave"&&(G.current=!0),p.reason===Ct)if(p.nested)G.current=!1;else if(Ot(p.nativeEvent)||Pt(p.nativeEvent))G.current=!1;else{let y=!1;document.createElement("div").focus({get preventScroll(){return y=!0,!1}}),y?G.current=!1:G.current=!0}}N.on("openchange",I);const k=g.createElement("span");k.setAttribute("tabindex","-1"),k.setAttribute("aria-hidden","true"),Object.assign(k.style,tn),ve&&b&&b.insertAdjacentElement("afterend",k);function F(){const p=q.current;let y=typeof p=="function"?p(Oe.current):p;if(y===void 0||y===!1)return null;if(y===null&&(y=!0),typeof y=="boolean"){const j=b||Ce();return j&&j.isConnected?j:k}const J=b||Ce()||k;return X(y)||J}return()=>{N.off("openchange",I);const p=ne(g),y=L(m,p)||W&&$e(W.nodesRef.current,A(),!1).some(j=>L(j.context?.elements.floating,p)),J=F();queueMicrotask(()=>{const j=cn(J),le=typeof q.current!="boolean";q.current&&!G.current&&te(j)&&(!(!le&&j!==p&&p!==g.body)||y)&&j.focus({preventScroll:!0}),k.remove()})}},[o,m,h,q,P,N,W,ve,b,A]),a.useEffect(()=>{queueMicrotask(()=>{G.current=!1})},[o]),a.useEffect(()=>{if(o||!S)return;function g(I){se(I)?.closest(`[${Vt}]`)&&(ae.current=!0)}const E=U(h);return E.addEventListener("pointerdown",g,!0),()=>{E.removeEventListener("pointerdown",g,!0)}},[o,S,h]),oe(()=>{if(!o&&w)return w.setFocusManagerState({modal:r,closeOnFocusOut:C,open:S,onOpenChange:v.setOpen,domReference:b}),()=>{w.setFocusManagerState(null)}},[o,w,r,S,v,C,b]),oe(()=>{if(!(o||!h))return ze(h,O),()=>{queueMicrotask(Te)}},[o,h,O]);const Le=!o&&(r?!D:!0)&&(ve||r);return M.jsxs(a.Fragment,{children:[Le&&M.jsx(Ye,{"data-type":"inside",ref:pt,onFocus:g=>{if(r){const E=ee();Ee(E[E.length-1])}else w?.portalNode&&(G.current=!1,qe(g,w.portalNode)?Bt(b)?.focus():X(c??w.beforeOutsideRef)?.focus())}}),t,Le&&M.jsx(Ye,{"data-type":"inside",ref:gt,onFocus:g=>{r?Ee(ee()[0]):w?.portalNode&&(C&&(G.current=!0),qe(g,w.portalNode)?jt(b)?.focus():X(f??w.afterOutsideRef)?.focus())}})]})}const fn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function pn(e,n={}){const t="rootStore"in e?e.rootStore:e,o=t.useState("open"),s=t.useState("floatingId"),i=t.useState("domReferenceElement"),l=t.useState("floatingElement"),{enabled:u=!0,role:r="dialog"}=n,C=kt(),R=i?.id||C,x=a.useMemo(()=>Re(l)?.id||s,[l,s]),f=fn.get(r)??r,d=Gt()!=null,T=a.useMemo(()=>f==="tooltip"||r==="label"?ht:{"aria-haspopup":f==="alertdialog"?"dialog":f,"aria-expanded":"false",...f==="listbox"&&{role:"combobox"},...f==="menu"&&d&&{role:"menuitem"},...r==="select"&&{"aria-autocomplete":"none"},...r==="combobox"&&{"aria-autocomplete":"list"}},[f,d,r]),v=a.useMemo(()=>f==="tooltip"||r==="label"?{[`aria-${r==="label"?"labelledby":"describedby"}`]:o?x:void 0}:{...T,"aria-expanded":o?"true":"false","aria-controls":o?x:void 0,...f==="menu"&&{id:R}},[f,x,o,R,r,T]),S=a.useMemo(()=>{const m={id:x,...f&&{role:f}};return f==="tooltip"||r==="label"?m:{...m,...f==="menu"&&{"aria-labelledby":R}}},[f,x,R,r]),b=a.useCallback(({active:m,selected:N})=>{const P={role:"option",...m&&{id:`${x}-fui-option`}};switch(r){case"select":case"combobox":return{...P,"aria-selected":N}}return{}},[x,r]);return a.useMemo(()=>u?{reference:v,floating:S,item:b,trigger:T}:{},[u,v,S,T,b])}function gn(e){return yt(19)?e:e?"true":void 0}const ct=a.createContext(void 0);function _(e){const n=a.useContext(ct);if(e===!1&&n===void 0)throw new Error(Ze(27));return n}const mn={...it,...at},bn=a.forwardRef(function(n,t){const{render:o,className:s,forceRender:i=!1,...l}=n,{store:u}=_(),r=u.useState("open"),C=u.useState("nested"),R=u.useState("mounted"),x=u.useState("transitionStatus"),f=a.useMemo(()=>({open:r,transitionStatus:x}),[r,x]);return re("div",n,{state:f,ref:[u.context.backdropRef,t],stateAttributesMapping:mn,props:[{role:"presentation",hidden:!R,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:i||!C})}),hn=a.forwardRef(function(n,t){const{render:o,className:s,disabled:i=!1,nativeButton:l=!0,...u}=n,{store:r}=_(),C=r.useState("open");function R(d){C&&r.setOpen(!1,we(It,d.nativeEvent))}const{getButtonProps:x,buttonRef:f}=Tt({disabled:i,native:l}),c=a.useMemo(()=>({disabled:i}),[i]);return re("button",n,{state:c,ref:[t,f],props:[{onClick:R},u,x]})}),yn=a.forwardRef(function(n,t){const{render:o,className:s,id:i,...l}=n,{store:u}=_(),r=tt(i);return u.useSyncedValueWithCleanup("descriptionElementId",r),re("p",n,{ref:t,props:[{id:r},l]})});let vn=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),Sn=(function(e){return e[e.open=ue.open]="open",e[e.closed=ue.closed]="closed",e[e.startingStyle=ue.startingStyle]="startingStyle",e[e.endingStyle=ue.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const ut=a.createContext(void 0);function En(){const e=a.useContext(ut);if(e===void 0)throw new Error(Ze(26));return e}const xn={...it,...at,nestedDialogOpen(e){return e?{[Sn.nestedDialogOpen]:""}:null}},Cn=a.forwardRef(function(n,t){const{className:o,finalFocus:s,initialFocus:i,render:l,...u}=n,{store:r}=_(),C=r.useState("descriptionElementId"),R=r.useState("disablePointerDismissal"),x=r.useState("floatingRootContext"),f=r.useState("popupProps"),c=r.useState("modal"),d=r.useState("mounted"),T=r.useState("nested"),v=r.useState("nestedOpenDialogCount"),S=r.useState("open"),b=r.useState("openMethod"),m=r.useState("titleElementId"),N=r.useState("transitionStatus"),P=r.useState("role");En(),$t({open:S,ref:r.context.popupRef,onComplete(){S&&r.context.onOpenChangeComplete?.(!0)}});function A(B){return B==="touch"?r.context.popupRef.current:!0}const Y=i===void 0?A:i,V=v>0,D=a.useMemo(()=>({open:S,nested:T,transitionStatus:N,nestedDialogOpen:V}),[S,T,N,V]),O=re("div",n,{state:D,props:[f,{"aria-labelledby":m??void 0,"aria-describedby":C??void 0,role:P,tabIndex:-1,hidden:!d,onKeyDown(B){en.has(B.key)&&B.stopPropagation()},style:{[vn.nestedDialogs]:v}},u],ref:[t,r.context.popupRef,r.useStateSetter("popupElement")],stateAttributesMapping:xn});return M.jsx(dn,{context:x,openInteractionType:b,disabled:!d,closeOnFocusOut:!R,initialFocus:Y,returnFocus:s,modal:c!==!1,restoreFocus:"popup",children:O})}),Rn=a.forwardRef(function(n,t){const{cutout:o,...s}=n;let i;if(o){const l=o?.getBoundingClientRect();i=`polygon(
2
2
  0% 0%,
3
3
  100% 0%,
4
4
  100% 100%,
@@ -1 +1 @@
1
- import{u as V,ab as _,ac as Y,ad as j,ae as C}from"./button-Dg7VFQQn.js";import{r as l,v as x}from"./main-B_dlfHME.js";const G=()=>{},J=typeof document<"u"?l.useLayoutEffect:G;function m(){return typeof window<"u"}function E(e){return I(e)?(e.nodeName||"").toLowerCase():"#document"}function d(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function X(e){var t;return(t=(I(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function I(e){return m()?e instanceof Node||e instanceof d(e).Node:!1}function T(e){return m()?e instanceof Element||e instanceof d(e).Element:!1}function h(e){return m()?e instanceof HTMLElement||e instanceof d(e).HTMLElement:!1}function k(e){return!m()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof d(e).ShadowRoot}const q=new Set(["inline","contents"]);function L(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=O(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!q.has(s)}const z=new Set(["table","td","th"]);function he(e){return z.has(E(e))}const Q=[":popover-open",":modal"];function Z(e){return Q.some(t=>{try{return e.matches(t)}catch{return!1}})}const ee=["transform","translate","scale","rotate","perspective"],te=["transform","translate","scale","rotate","perspective","filter"],ne=["paint","layout","strict","content"];function oe(e){const t=se(),n=T(e)?O(e):e;return ee.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||te.some(r=>(n.willChange||"").includes(r))||ne.some(r=>(n.contain||"").includes(r))}function De(e){let t=y(e);for(;h(t)&&!B(t);){if(oe(t))return t;if(Z(t))return null;t=y(t)}return null}function se(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const re=new Set(["html","body","#document"]);function B(e){return re.has(E(e))}function O(e){return d(e).getComputedStyle(e)}function Ce(e){return T(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function y(e){if(E(e)==="html")return e;const t=e.assignedSlot||e.parentNode||k(e)&&e.host||X(e);return k(t)?t.host:t}function R(e){const t=y(e);return B(t)?e.ownerDocument?e.ownerDocument.body:e.body:h(t)&&L(t)?t:R(t)}function N(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=R(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),i=d(s);if(a){const u=ae(i);return t.concat(i,i.visualViewport||[],L(s)?s:[],u&&n?N(u):[])}return t.concat(s,N(s,[],n))}function ae(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const g=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ie=g&&g!==l.useLayoutEffect?g:e=>e();function S(e){const t=V(ce).current;return t.next=e,ie(t.effect),t.trampoline}function ce(){const e={next:void 0,callback:le,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function le(){}const ue={...x};let P=0;function fe(e,t="mui"){const[n,r]=l.useState(e),s=e||n;return l.useEffect(()=>{n==null&&(P+=1,r(`${t}-${P}`))},[n,t]),s}const v=ue.useId;function de(e,t){if(v!==void 0){const n=v();return e??(t?`${t}-${n}`:n)}return fe(e,t)}const ke="none",Ne="trigger-press",Se="trigger-hover",Pe="trigger-focus",ve="outside-press",xe="item-press",Ie="close-press",Te="focus-out",Le="escape-key",Be="list-navigation",Oe="cancel-open",Re="sibling-open",Ke="disabled",Me="imperative-action";function Fe(e,t,n,r){let s=!1,a=!1;const i=r??_;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){a=!0},get isCanceled(){return s},get isPropagationAllowed(){return a},trigger:n,...i}}function Ue(e){return de(e,"base-ui")}const pe=l.createContext(void 0);function be(e=!1){const t=l.useContext(pe);if(t===void 0&&!e)throw new Error(Y(16));return t}function me(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:a}=e,i=r&&t!==!1,u=r&&t===!1;return{props:l.useMemo(()=>{const f={onKeyDown(b){n&&t&&b.key!=="Tab"&&b.preventDefault()}};return r||(f.tabIndex=s,!a&&n&&(f.tabIndex=t?s:-1)),(a&&(t||i)||!a&&n)&&(f["aria-disabled"]=n),a&&(!t||u)&&(f.disabled=n),f},[r,n,t,i,u,a,s])}}function We(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0}=e,a=l.useRef(null),i=be(!0)!==void 0,u=S(()=>{const c=a.current;return!!(c?.tagName==="A"&&c?.href)}),{props:p}=me({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:s}),f=l.useCallback(()=>{const c=a.current;we(c)&&i&&t&&p.disabled===void 0&&c.disabled&&(c.disabled=!1)},[t,p.disabled,i]);J(f,[f]);const b=l.useCallback((c={})=>{const{onClick:w,onMouseDown:M,onKeyUp:F,onKeyDown:U,onPointerDown:W,...A}=c;return j({type:s?"button":void 0,onClick(o){if(t){o.preventDefault();return}w?.(o)},onMouseDown(o){t||M?.(o)},onKeyDown(o){if(t||(C(o),U?.(o)),o.baseUIHandlerPrevented)return;const H=o.target===o.currentTarget&&!s&&!u()&&!t,D=o.key==="Enter",$=o.key===" ";H&&(($||D)&&o.preventDefault(),D&&w?.(o))},onKeyUp(o){t||(C(o),F?.(o)),!o.baseUIHandlerPrevented&&o.target===o.currentTarget&&!s&&!t&&o.key===" "&&w?.(o)},onPointerDown(o){if(t){o.preventDefault();return}W?.(o)}},s?void 0:{role:"button"},p,A)},[t,p,s,u]),K=S(c=>{a.current=c,f()});return{getButtonProps:b,buttonRef:K}}function we(e){return h(e)&&e.tagName==="BUTTON"}export{d as A,Ie as B,pe as C,L as D,N as E,X as F,ae as G,se as H,Z as I,he as J,oe as K,De as L,Ce as M,Ke as N,I as O,S as a,be as b,k as c,Ue as d,T as e,We as f,Fe as g,O as h,h as i,Te as j,xe as k,Be as l,Se as m,ke as n,ve as o,de as p,Pe as q,Le as r,Re as s,Ne as t,J as u,Me as v,B as w,y as x,Oe as y,E as z};
1
+ import{u as V,ab as _,ac as Y,ad as j,ae as C}from"./button-DzGUU5Tc.js";import{r as l,v as x}from"./main-ZPHfbCuz.js";const G=()=>{},J=typeof document<"u"?l.useLayoutEffect:G;function m(){return typeof window<"u"}function E(e){return I(e)?(e.nodeName||"").toLowerCase():"#document"}function d(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function X(e){var t;return(t=(I(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function I(e){return m()?e instanceof Node||e instanceof d(e).Node:!1}function T(e){return m()?e instanceof Element||e instanceof d(e).Element:!1}function h(e){return m()?e instanceof HTMLElement||e instanceof d(e).HTMLElement:!1}function k(e){return!m()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof d(e).ShadowRoot}const q=new Set(["inline","contents"]);function L(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=O(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!q.has(s)}const z=new Set(["table","td","th"]);function he(e){return z.has(E(e))}const Q=[":popover-open",":modal"];function Z(e){return Q.some(t=>{try{return e.matches(t)}catch{return!1}})}const ee=["transform","translate","scale","rotate","perspective"],te=["transform","translate","scale","rotate","perspective","filter"],ne=["paint","layout","strict","content"];function oe(e){const t=se(),n=T(e)?O(e):e;return ee.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||te.some(r=>(n.willChange||"").includes(r))||ne.some(r=>(n.contain||"").includes(r))}function De(e){let t=y(e);for(;h(t)&&!B(t);){if(oe(t))return t;if(Z(t))return null;t=y(t)}return null}function se(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const re=new Set(["html","body","#document"]);function B(e){return re.has(E(e))}function O(e){return d(e).getComputedStyle(e)}function Ce(e){return T(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function y(e){if(E(e)==="html")return e;const t=e.assignedSlot||e.parentNode||k(e)&&e.host||X(e);return k(t)?t.host:t}function R(e){const t=y(e);return B(t)?e.ownerDocument?e.ownerDocument.body:e.body:h(t)&&L(t)?t:R(t)}function N(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=R(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),i=d(s);if(a){const u=ae(i);return t.concat(i,i.visualViewport||[],L(s)?s:[],u&&n?N(u):[])}return t.concat(s,N(s,[],n))}function ae(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const g=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ie=g&&g!==l.useLayoutEffect?g:e=>e();function S(e){const t=V(ce).current;return t.next=e,ie(t.effect),t.trampoline}function ce(){const e={next:void 0,callback:le,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function le(){}const ue={...x};let P=0;function fe(e,t="mui"){const[n,r]=l.useState(e),s=e||n;return l.useEffect(()=>{n==null&&(P+=1,r(`${t}-${P}`))},[n,t]),s}const v=ue.useId;function de(e,t){if(v!==void 0){const n=v();return e??(t?`${t}-${n}`:n)}return fe(e,t)}const ke="none",Ne="trigger-press",Se="trigger-hover",Pe="trigger-focus",ve="outside-press",xe="item-press",Ie="close-press",Te="focus-out",Le="escape-key",Be="list-navigation",Oe="cancel-open",Re="sibling-open",Ke="disabled",Me="imperative-action";function Fe(e,t,n,r){let s=!1,a=!1;const i=r??_;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){a=!0},get isCanceled(){return s},get isPropagationAllowed(){return a},trigger:n,...i}}function Ue(e){return de(e,"base-ui")}const pe=l.createContext(void 0);function be(e=!1){const t=l.useContext(pe);if(t===void 0&&!e)throw new Error(Y(16));return t}function me(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:a}=e,i=r&&t!==!1,u=r&&t===!1;return{props:l.useMemo(()=>{const f={onKeyDown(b){n&&t&&b.key!=="Tab"&&b.preventDefault()}};return r||(f.tabIndex=s,!a&&n&&(f.tabIndex=t?s:-1)),(a&&(t||i)||!a&&n)&&(f["aria-disabled"]=n),a&&(!t||u)&&(f.disabled=n),f},[r,n,t,i,u,a,s])}}function We(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0}=e,a=l.useRef(null),i=be(!0)!==void 0,u=S(()=>{const c=a.current;return!!(c?.tagName==="A"&&c?.href)}),{props:p}=me({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:s}),f=l.useCallback(()=>{const c=a.current;we(c)&&i&&t&&p.disabled===void 0&&c.disabled&&(c.disabled=!1)},[t,p.disabled,i]);J(f,[f]);const b=l.useCallback((c={})=>{const{onClick:w,onMouseDown:M,onKeyUp:F,onKeyDown:U,onPointerDown:W,...A}=c;return j({type:s?"button":void 0,onClick(o){if(t){o.preventDefault();return}w?.(o)},onMouseDown(o){t||M?.(o)},onKeyDown(o){if(t||(C(o),U?.(o)),o.baseUIHandlerPrevented)return;const H=o.target===o.currentTarget&&!s&&!u()&&!t,D=o.key==="Enter",$=o.key===" ";H&&(($||D)&&o.preventDefault(),D&&w?.(o))},onKeyUp(o){t||(C(o),F?.(o)),!o.baseUIHandlerPrevented&&o.target===o.currentTarget&&!s&&!t&&o.key===" "&&w?.(o)},onPointerDown(o){if(t){o.preventDefault();return}W?.(o)}},s?void 0:{role:"button"},p,A)},[t,p,s,u]),K=S(c=>{a.current=c,f()});return{getButtonProps:b,buttonRef:K}}function we(e){return h(e)&&e.tagName==="BUTTON"}export{d as A,Ie as B,pe as C,L as D,N as E,X as F,ae as G,se as H,Z as I,he as J,oe as K,De as L,Ce as M,Ke as N,I as O,S as a,be as b,k as c,Ue as d,T as e,We as f,Fe as g,O as h,h as i,Te as j,xe as k,Be as l,Se as m,ke as n,ve as o,de as p,Pe as q,Le as r,Re as s,Ne as t,J as u,Me as v,B as w,y as x,Oe as y,E as z};
@@ -1 +1 @@
1
- import{f as S}from"./DirectionContext-BdX86BHP.js";import{A as j,s as D,a as H,b as y,c as k}from"./owner-CpRnf1fI.js";import{r as R,j as B}from"./main-B_dlfHME.js";import{u as G,t as V}from"./button-Dg7VFQQn.js";import{u as L,a as T,b as I}from"./useButton-Cbl_9oFG.js";function p(e,u,o){return Math.floor(e/u)!==o}function x(e,u){return u<0||u>=e.current.length}function et(e,u){return N(e,{disabledIndices:u})}function nt(e,u){return N(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:u})}function N(e,{startingIndex:u=-1,decrement:o=!1,disabledIndices:s,amount:m=1}={}){let t=u;do t+=o?-m:m;while(t>=0&&t<=e.current.length-1&&z(e,t,s));return t}function rt(e,{event:u,orientation:o,loopFocus:s,rtl:m,cols:t,disabledIndices:a,minIndex:O,maxIndex:g,prevIndex:i,stopEvent:c=!1}){let r=i;const d=[],w={};let C=!1;{let n=null,l=-1;e.current.forEach((h,f)=>{if(h==null)return;const M=h.closest('[role="row"]');M&&(C=!0),(M!==n||l===-1)&&(n=M,l+=1,d[l]=[]),d[l].push(f),w[f]=l})}const E=C&&d.length>0&&d.some(n=>n.length!==t);function b(n){if(!E||i===-1)return;const l=w[i];if(l==null)return;const h=d[l].indexOf(i);let f=n==="up"?l-1:l+1;s&&(f<0?f=d.length-1:f>=d.length&&(f=0));const M=new Set;for(;f>=0&&f<d.length&&!M.has(f);){M.add(f);const _=d[f];if(_.length===0){f=n==="up"?f-1:f+1;continue}const W=Math.min(h,_.length-1);for(let P=W;P>=0;P-=1){const A=_[P];if(!z(e,A,a))return A}f=n==="up"?f-1:f+1,s&&(f<0?f=d.length-1:f>=d.length&&(f=0))}}if(u.key===j){const n=b("up");if(n!==void 0)c&&D(u),r=n;else{if(c&&D(u),i===-1)r=g;else if(r=N(e,{startingIndex:r,amount:t,decrement:!0,disabledIndices:a}),s&&(i-t<O||r<0)){const l=i%t,h=g%t,f=g-(h-l);h===l?r=g:r=h>l?f:f-t}x(e,r)&&(r=i)}}if(u.key===H){const n=b("down");n!==void 0?(c&&D(u),r=n):(c&&D(u),i===-1?r=O:(r=N(e,{startingIndex:i,amount:t,disabledIndices:a}),s&&i+t>g&&(r=N(e,{startingIndex:i%t-t,amount:t,disabledIndices:a}))),x(e,r)&&(r=i))}if(o==="both"){const n=S(i/t);u.key===(m?y:k)&&(c&&D(u),i%t!==t-1?(r=N(e,{startingIndex:i,disabledIndices:a}),s&&p(r,t,n)&&(r=N(e,{startingIndex:i-i%t-1,disabledIndices:a}))):s&&(r=N(e,{startingIndex:i-i%t-1,disabledIndices:a})),p(r,t,n)&&(r=i)),u.key===(m?k:y)&&(c&&D(u),i%t!==0?(r=N(e,{startingIndex:i,decrement:!0,disabledIndices:a}),s&&p(r,t,n)&&(r=N(e,{startingIndex:i+(t-i%t),decrement:!0,disabledIndices:a}))):s&&(r=N(e,{startingIndex:i+(t-i%t),decrement:!0,disabledIndices:a})),p(r,t,n)&&(r=i));const l=S(g/t)===n;x(e,r)&&(s&&l?r=u.key===(m?k:y)?g:N(e,{startingIndex:i-i%t-1,disabledIndices:a}):r=i)}return r}function ut(e,u,o){const s=[];let m=0;return e.forEach(({width:t,height:a},O)=>{let g=!1;for(o&&(m=0);!g;){const i=[];for(let c=0;c<t;c+=1)for(let r=0;r<a;r+=1)i.push(m+c+r*u);m%u+t<=u&&i.every(c=>s[c]==null)?(i.forEach(c=>{s[c]=O}),g=!0):m+=1}}),[...s]}function it(e,u,o,s,m){if(e===-1)return-1;const t=o.indexOf(e),a=u[e];switch(m){case"tl":return t;case"tr":return a?t+a.width-1:t;case"bl":return a?t+(a.height-1)*s:t;case"br":return o.lastIndexOf(e);default:return-1}}function st(e,u){return u.flatMap((o,s)=>e.includes(o)?[s]:[])}function z(e,u,o){if(typeof o=="function")return o(u);if(o)return o.includes(u);const s=e.current[u];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}const U=R.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Y(){return R.useContext(U)}let q=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function J(e={}){const{label:u,metadata:o,textRef:s,indexGuessBehavior:m,index:t}=e,{register:a,unregister:O,subscribeMapChange:g,elementsRef:i,labelsRef:c,nextIndexRef:r}=Y(),d=R.useRef(-1),[w,C]=R.useState(t??(m===q.GuessFromOrder?()=>{if(d.current===-1){const n=r.current;r.current+=1,d.current=n}return d.current}:-1)),E=R.useRef(null),b=R.useCallback(n=>{if(E.current=n,w!==-1&&n!==null&&(i.current[w]=n,c)){const l=u!==void 0;c.current[w]=l?u:s?.current?.textContent??n.textContent}},[w,i,c,u,s]);return L(()=>{if(t!=null)return;const n=E.current;if(n)return a(n,o),()=>{O(n)}},[t,a,O,o]),L(()=>{if(t==null)return g(n=>{const l=E.current?n.get(E.current)?.index:null;l!=null&&C(l)})},[t,g,C]),R.useMemo(()=>({ref:b,index:w}),[w,b])}function ot(e){const{children:u,elementsRef:o,labelsRef:s,onMapChange:m}=e,t=T(m),a=R.useRef(0),O=G(Q).current,g=G(K).current,[i,c]=R.useState(0),r=R.useRef(i),d=T((n,l)=>{g.set(n,l??null),r.current+=1,c(r.current)}),w=T(n=>{g.delete(n),r.current+=1,c(r.current)}),C=R.useMemo(()=>{const n=new Map;return Array.from(g.keys()).filter(h=>h.isConnected).sort(X).forEach((h,f)=>{const M=g.get(h)??{};n.set(h,{...M,index:f})}),n},[g,i]);L(()=>{if(typeof MutationObserver!="function"||C.size===0)return;const n=new MutationObserver(l=>{const h=new Set,f=M=>h.has(M)?h.delete(M):h.add(M);l.forEach(M=>{M.removedNodes.forEach(f),M.addedNodes.forEach(f)}),h.size===0&&(r.current+=1,c(r.current))});return C.forEach((l,h)=>{h.parentElement&&n.observe(h.parentElement,{childList:!0})}),()=>{n.disconnect()}},[C]),L(()=>{r.current===i&&(o.current.length!==C.size&&(o.current.length=C.size),s&&s.current.length!==C.size&&(s.current.length=C.size),a.current=C.size),t(C)},[t,C,o,s,i]),L(()=>()=>{o.current=[]},[o]),L(()=>()=>{s&&(s.current=[])},[s]);const E=T(n=>(O.add(n),()=>{O.delete(n)}));L(()=>{O.forEach(n=>n(C))},[O,C]);const b=R.useMemo(()=>({register:d,unregister:w,subscribeMapChange:E,elementsRef:o,labelsRef:s,nextIndexRef:a}),[d,w,E,o,s,a]);return B.jsx(U.Provider,{value:b,children:u})}function K(){return new Map}function Q(){return new Set}function X(e,u){const o=e.compareDocumentPosition(u);return o&Node.DOCUMENT_POSITION_FOLLOWING||o&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:o&Node.DOCUMENT_POSITION_PRECEDING||o&Node.DOCUMENT_POSITION_CONTAINS?1:0}function ft(e={}){const{highlightItemOnHover:u,highlightedIndex:o,onHighlightedIndexChange:s}=I(),{ref:m,index:t}=J(e),a=o===t,O=R.useRef(null),g=V(m,O);return{compositeProps:R.useMemo(()=>({tabIndex:a?0:-1,onFocus(){s(t)},onMouseMove(){const c=O.current;if(!u||!c)return;const r=c.hasAttribute("disabled")||c.ariaDisabled==="true";!a&&!r&&c.focus()}}),[a,s,t,u]),compositeRef:g,index:t}}export{ot as C,nt as a,rt as b,ut as c,it as d,st as e,N as f,et as g,x as h,z as i,J as j,ft as u};
1
+ import{f as S}from"./DirectionContext-CAS2SgNN.js";import{A as j,s as D,a as H,b as y,c as k}from"./owner-Bm20thei.js";import{r as R,j as B}from"./main-ZPHfbCuz.js";import{u as G,t as V}from"./button-DzGUU5Tc.js";import{u as L,a as T,b as I}from"./useButton-Bh6gEhdL.js";function p(e,u,o){return Math.floor(e/u)!==o}function x(e,u){return u<0||u>=e.current.length}function et(e,u){return N(e,{disabledIndices:u})}function nt(e,u){return N(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:u})}function N(e,{startingIndex:u=-1,decrement:o=!1,disabledIndices:s,amount:m=1}={}){let t=u;do t+=o?-m:m;while(t>=0&&t<=e.current.length-1&&z(e,t,s));return t}function rt(e,{event:u,orientation:o,loopFocus:s,rtl:m,cols:t,disabledIndices:a,minIndex:O,maxIndex:g,prevIndex:i,stopEvent:c=!1}){let r=i;const d=[],w={};let C=!1;{let n=null,l=-1;e.current.forEach((h,f)=>{if(h==null)return;const M=h.closest('[role="row"]');M&&(C=!0),(M!==n||l===-1)&&(n=M,l+=1,d[l]=[]),d[l].push(f),w[f]=l})}const E=C&&d.length>0&&d.some(n=>n.length!==t);function b(n){if(!E||i===-1)return;const l=w[i];if(l==null)return;const h=d[l].indexOf(i);let f=n==="up"?l-1:l+1;s&&(f<0?f=d.length-1:f>=d.length&&(f=0));const M=new Set;for(;f>=0&&f<d.length&&!M.has(f);){M.add(f);const _=d[f];if(_.length===0){f=n==="up"?f-1:f+1;continue}const W=Math.min(h,_.length-1);for(let P=W;P>=0;P-=1){const A=_[P];if(!z(e,A,a))return A}f=n==="up"?f-1:f+1,s&&(f<0?f=d.length-1:f>=d.length&&(f=0))}}if(u.key===j){const n=b("up");if(n!==void 0)c&&D(u),r=n;else{if(c&&D(u),i===-1)r=g;else if(r=N(e,{startingIndex:r,amount:t,decrement:!0,disabledIndices:a}),s&&(i-t<O||r<0)){const l=i%t,h=g%t,f=g-(h-l);h===l?r=g:r=h>l?f:f-t}x(e,r)&&(r=i)}}if(u.key===H){const n=b("down");n!==void 0?(c&&D(u),r=n):(c&&D(u),i===-1?r=O:(r=N(e,{startingIndex:i,amount:t,disabledIndices:a}),s&&i+t>g&&(r=N(e,{startingIndex:i%t-t,amount:t,disabledIndices:a}))),x(e,r)&&(r=i))}if(o==="both"){const n=S(i/t);u.key===(m?y:k)&&(c&&D(u),i%t!==t-1?(r=N(e,{startingIndex:i,disabledIndices:a}),s&&p(r,t,n)&&(r=N(e,{startingIndex:i-i%t-1,disabledIndices:a}))):s&&(r=N(e,{startingIndex:i-i%t-1,disabledIndices:a})),p(r,t,n)&&(r=i)),u.key===(m?k:y)&&(c&&D(u),i%t!==0?(r=N(e,{startingIndex:i,decrement:!0,disabledIndices:a}),s&&p(r,t,n)&&(r=N(e,{startingIndex:i+(t-i%t),decrement:!0,disabledIndices:a}))):s&&(r=N(e,{startingIndex:i+(t-i%t),decrement:!0,disabledIndices:a})),p(r,t,n)&&(r=i));const l=S(g/t)===n;x(e,r)&&(s&&l?r=u.key===(m?k:y)?g:N(e,{startingIndex:i-i%t-1,disabledIndices:a}):r=i)}return r}function ut(e,u,o){const s=[];let m=0;return e.forEach(({width:t,height:a},O)=>{let g=!1;for(o&&(m=0);!g;){const i=[];for(let c=0;c<t;c+=1)for(let r=0;r<a;r+=1)i.push(m+c+r*u);m%u+t<=u&&i.every(c=>s[c]==null)?(i.forEach(c=>{s[c]=O}),g=!0):m+=1}}),[...s]}function it(e,u,o,s,m){if(e===-1)return-1;const t=o.indexOf(e),a=u[e];switch(m){case"tl":return t;case"tr":return a?t+a.width-1:t;case"bl":return a?t+(a.height-1)*s:t;case"br":return o.lastIndexOf(e);default:return-1}}function st(e,u){return u.flatMap((o,s)=>e.includes(o)?[s]:[])}function z(e,u,o){if(typeof o=="function")return o(u);if(o)return o.includes(u);const s=e.current[u];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}const U=R.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Y(){return R.useContext(U)}let q=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function J(e={}){const{label:u,metadata:o,textRef:s,indexGuessBehavior:m,index:t}=e,{register:a,unregister:O,subscribeMapChange:g,elementsRef:i,labelsRef:c,nextIndexRef:r}=Y(),d=R.useRef(-1),[w,C]=R.useState(t??(m===q.GuessFromOrder?()=>{if(d.current===-1){const n=r.current;r.current+=1,d.current=n}return d.current}:-1)),E=R.useRef(null),b=R.useCallback(n=>{if(E.current=n,w!==-1&&n!==null&&(i.current[w]=n,c)){const l=u!==void 0;c.current[w]=l?u:s?.current?.textContent??n.textContent}},[w,i,c,u,s]);return L(()=>{if(t!=null)return;const n=E.current;if(n)return a(n,o),()=>{O(n)}},[t,a,O,o]),L(()=>{if(t==null)return g(n=>{const l=E.current?n.get(E.current)?.index:null;l!=null&&C(l)})},[t,g,C]),R.useMemo(()=>({ref:b,index:w}),[w,b])}function ot(e){const{children:u,elementsRef:o,labelsRef:s,onMapChange:m}=e,t=T(m),a=R.useRef(0),O=G(Q).current,g=G(K).current,[i,c]=R.useState(0),r=R.useRef(i),d=T((n,l)=>{g.set(n,l??null),r.current+=1,c(r.current)}),w=T(n=>{g.delete(n),r.current+=1,c(r.current)}),C=R.useMemo(()=>{const n=new Map;return Array.from(g.keys()).filter(h=>h.isConnected).sort(X).forEach((h,f)=>{const M=g.get(h)??{};n.set(h,{...M,index:f})}),n},[g,i]);L(()=>{if(typeof MutationObserver!="function"||C.size===0)return;const n=new MutationObserver(l=>{const h=new Set,f=M=>h.has(M)?h.delete(M):h.add(M);l.forEach(M=>{M.removedNodes.forEach(f),M.addedNodes.forEach(f)}),h.size===0&&(r.current+=1,c(r.current))});return C.forEach((l,h)=>{h.parentElement&&n.observe(h.parentElement,{childList:!0})}),()=>{n.disconnect()}},[C]),L(()=>{r.current===i&&(o.current.length!==C.size&&(o.current.length=C.size),s&&s.current.length!==C.size&&(s.current.length=C.size),a.current=C.size),t(C)},[t,C,o,s,i]),L(()=>()=>{o.current=[]},[o]),L(()=>()=>{s&&(s.current=[])},[s]);const E=T(n=>(O.add(n),()=>{O.delete(n)}));L(()=>{O.forEach(n=>n(C))},[O,C]);const b=R.useMemo(()=>({register:d,unregister:w,subscribeMapChange:E,elementsRef:o,labelsRef:s,nextIndexRef:a}),[d,w,E,o,s,a]);return B.jsx(U.Provider,{value:b,children:u})}function K(){return new Map}function Q(){return new Set}function X(e,u){const o=e.compareDocumentPosition(u);return o&Node.DOCUMENT_POSITION_FOLLOWING||o&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:o&Node.DOCUMENT_POSITION_PRECEDING||o&Node.DOCUMENT_POSITION_CONTAINS?1:0}function ft(e={}){const{highlightItemOnHover:u,highlightedIndex:o,onHighlightedIndexChange:s}=I(),{ref:m,index:t}=J(e),a=o===t,O=R.useRef(null),g=V(m,O);return{compositeProps:R.useMemo(()=>({tabIndex:a?0:-1,onFocus(){s(t)},onMouseMove(){const c=O.current;if(!u||!c)return;const r=c.hasAttribute("disabled")||c.ariaDisabled==="true";!a&&!r&&c.focus()}}),[a,s,t,u]),compositeRef:g,index:t}}export{ot as C,nt as a,rt as b,ut as c,it as d,st as e,N as f,et as g,x as h,z as i,J as j,ft as u};
@@ -1 +1 @@
1
- import{r as e}from"./main-B_dlfHME.js";function d({controlled:t,default:s,name:c,state:f="value"}){const{current:a}=e.useRef(t!==void 0),[o,u]=e.useState(s),l=a?t:o,n=e.useCallback(r=>{a||u(r)},[]);return[l,n]}export{d as u};
1
+ import{r as e}from"./main-ZPHfbCuz.js";function d({controlled:t,default:s,name:c,state:f="value"}){const{current:a}=e.useRef(t!==void 0),[o,u]=e.useState(s),l=a?t:o,n=e.useCallback(r=>{a||u(r)},[]);return[l,n]}export{d as u};
@@ -1 +1 @@
1
- import{S as l,s as d,h as a,g as p,n as h,u as b,r as o,b as m,c as v}from"./main-B_dlfHME.js";var y=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),d(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&a(s.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??p();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,r=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#e.onSuccess?.(t.data,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(t.data,null,s,r,e)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#e.onError?.(t.error,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(void 0,t.error,s,r,e)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const r=b(),[e]=o.useState(()=>new y(r,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const i=o.useSyncExternalStore(o.useCallback(n=>e.subscribe(h.batchCalls(n)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((n,c)=>{e.mutate(n,c).catch(m)},[e]);if(i.error&&v(e.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}export{O as u};
1
+ import{S as l,s as d,h as a,g as p,n as h,u as b,r as o,b as m,c as v}from"./main-ZPHfbCuz.js";var y=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),d(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&a(s.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??p();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,r=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#e.onSuccess?.(t.data,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(t.data,null,s,r,e)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#e.onError?.(t.error,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(void 0,t.error,s,r,e)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const r=b(),[e]=o.useState(()=>new y(r,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const i=o.useSyncExternalStore(o.useCallback(n=>e.subscribe(h.batchCalls(n)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((n,c)=>{e.mutate(n,c).catch(m)},[e]);if(i.error&&v(e.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}export{O as u};
@@ -1 +1 @@
1
- import{S as J,p as N,e as l,s as Q,f as g,b as x,i as M,k as B,t as X,l as C,m as Y,o as Z,q as H,n as z,r as d,c as V,u as $}from"./main-B_dlfHME.js";var q=class extends J{constructor(t,e){super(),this.options=e,this.#s=t,this.#r=null,this.#i=N(),this.bindMethods(),this.setOptions(e)}#s;#t=void 0;#p=void 0;#e=void 0;#a;#u;#i;#r;#b;#l;#d;#o;#h;#n;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),A(this.#t,this.options)?this.#c():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#s.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof l(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#t.setOptions(this.options),e._defaulted&&!Q(this.options,e)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&j(this.#t,s,this.options,e)&&this.#c(),this.updateResult(),i&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(e.staleTime,this.#t))&&this.#v();const r=this.#R();i&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||r!==this.#n)&&this.#m(r)}getOptimisticResult(t){const e=this.#s.getQueryCache().build(this.#s,t),s=this.createResult(e,t);return et(this,s)&&(this.#e=s,this.#u=this.options,this.#a=this.#t.state),s}getCurrentResult(){return this.#e}trackResult(t,e){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),e?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,i))})}trackProp(t){this.#f.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#s.defaultQueryOptions(t),s=this.#s.getQueryCache().build(this.#s,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#c({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#c(t){this.#O();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(x)),e}#v(){this.#y();const t=g(this.options.staleTime,this.#t);if(M||this.#e.isStale||!B(t))return;const s=X(this.#e.dataUpdatedAt,t)+1;this.#o=C.setTimeout(()=>{this.#e.isStale||this.updateResult()},s)}#R(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#m(t){this.#S(),this.#n=t,!(M||l(this.options.enabled,this.#t)===!1||!B(this.#n)||this.#n===0)&&(this.#h=C.setInterval(()=>{(this.options.refetchIntervalInBackground||Y.isFocused())&&this.#c()},this.#n))}#g(){this.#v(),this.#m(this.#R())}#y(){this.#o&&(C.clearTimeout(this.#o),this.#o=void 0)}#S(){this.#h&&(C.clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const s=this.#t,i=this.options,r=this.#e,u=this.#a,a=this.#u,v=t!==s?t.state:this.#p,{state:h}=t;let n={...h},R=!1,o;if(e._optimisticResults){const c=this.hasListeners(),m=!c&&A(t,e),S=c&&j(t,s,e,i);(m||S)&&(n={...n,...Z(h.data,t.options)}),e._optimisticResults==="isRestoring"&&(n.fetchStatus="idle")}let{error:y,errorUpdatedAt:U,status:b}=n;o=n.data;let D=!1;if(e.placeholderData!==void 0&&o===void 0&&b==="pending"){let c;r?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(c=r.data,D=!0):c=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,c!==void 0&&(b="success",o=H(r?.data,c,e),R=!0)}if(e.select&&o!==void 0&&!D)if(r&&o===u?.data&&e.select===this.#b)o=this.#l;else try{this.#b=e.select,o=e.select(o),o=H(r?.data,o,e),this.#l=o,this.#r=null}catch(c){this.#r=c}this.#r&&(y=this.#r,o=this.#l,U=Date.now(),b="error");const I=n.fetchStatus==="fetching",w=b==="pending",T=b==="error",F=w&&I,k=o!==void 0,p={status:b,fetchStatus:n.fetchStatus,isPending:w,isSuccess:b==="success",isError:T,isInitialLoading:F,isLoading:F,data:o,dataUpdatedAt:n.dataUpdatedAt,error:y,errorUpdatedAt:U,failureCount:n.fetchFailureCount,failureReason:n.fetchFailureReason,errorUpdateCount:n.errorUpdateCount,isFetched:n.dataUpdateCount>0||n.errorUpdateCount>0,isFetchedAfterMount:n.dataUpdateCount>v.dataUpdateCount||n.errorUpdateCount>v.errorUpdateCount,isFetching:I,isRefetching:I&&!w,isLoadingError:T&&!k,isPaused:n.fetchStatus==="paused",isPlaceholderData:R,isRefetchError:T&&k,isStale:P(t,e),refetch:this.refetch,promise:this.#i,isEnabled:l(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const c=p.data!==void 0,m=p.status==="error"&&!c,S=E=>{m?E.reject(p.error):c&&E.resolve(p.data)},L=()=>{const E=this.#i=p.promise=N();S(E)},O=this.#i;switch(O.status){case"pending":t.queryHash===s.queryHash&&S(O);break;case"fulfilled":(m||p.data!==O.value)&&L();break;case"rejected":(!m||p.error!==O.reason)&&L();break}}return p}updateResult(){const t=this.#e,e=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#u=this.options,this.#a.data!==void 0&&(this.#d=this.#t),Q(e,t))return;this.#e=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,r=typeof i=="function"?i():i;if(r==="all"||!r&&!this.#f.size)return!0;const u=new Set(r??this.#f);return this.options.throwOnError&&u.add("error"),Object.keys(this.#e).some(a=>{const f=a;return this.#e[f]!==t[f]&&u.has(f)})};this.#E({listeners:s()})}#O(){const t=this.#s.getQueryCache().build(this.#s,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#p=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#E(t){z.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#s.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function tt(t,e){return l(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function A(t,e){return tt(t,e)||t.state.data!==void 0&&_(t,e,e.refetchOnMount)}function _(t,e,s){if(l(e.enabled,t)!==!1&&g(e.staleTime,t)!=="static"){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&P(t,e)}return!1}function j(t,e,s,i){return(t!==e||l(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&P(t,s)}function P(t,e){return l(e.enabled,t)!==!1&&t.isStaleByTime(g(e.staleTime,t))}function et(t,e){return!Q(t.getCurrentResult(),e)}var K=d.createContext(!1),st=()=>d.useContext(K);K.Provider;function it(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var rt=d.createContext(it()),nt=()=>d.useContext(rt),at=(t,e,s)=>{const i=s?.state.error&&typeof t.throwOnError=="function"?V(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||i)&&(e.isReset()||(t.retryOnMount=!1))},ot=t=>{d.useEffect(()=>{t.clearReset()},[t])},ht=({result:t,errorResetBoundary:e,throwOnError:s,query:i,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(r&&t.data===void 0||V(s,[t.error,i])),ct=t=>{if(t.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...r)=>s(i(...r)):s(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},ut=(t,e)=>t.isLoading&&t.isFetching&&!e,lt=(t,e)=>t?.suspense&&e.isPending,W=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function dt(t,e,s){const i=st(),r=nt(),u=$(),a=u.defaultQueryOptions(t);u.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const f=u.getQueryCache().get(a.queryHash);a._optimisticResults=i?"isRestoring":"optimistic",ct(a),at(a,r,f),ot(r);const v=!u.getQueryCache().get(a.queryHash),[h]=d.useState(()=>new e(u,a)),n=h.getOptimisticResult(a),R=!i&&t.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(o=>{const y=R?h.subscribe(z.batchCalls(o)):x;return h.updateResult(),y},[h,R]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),d.useEffect(()=>{h.setOptions(a)},[a,h]),lt(a,n))throw W(a,h,r);if(ht({result:n,errorResetBoundary:r,throwOnError:a.throwOnError,query:f,suspense:a.suspense}))throw n.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(a,n),a.experimental_prefetchInRender&&!M&&ut(n,i)&&(v?W(a,h,r):f?.promise)?.catch(x).finally(()=>{h.updateResult()}),a.notifyOnChangeProps?n:h.trackResult(n)}function bt(t,e){return dt(t,q)}const G={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},vt={...G,position:"fixed",top:0,left:0},Rt={...G,position:"absolute"};export{vt as a,bt as u,Rt as v};
1
+ import{S as J,p as N,e as l,s as Q,f as g,b as x,i as M,k as B,t as X,l as C,m as Y,o as Z,q as H,n as z,r as d,c as V,u as $}from"./main-ZPHfbCuz.js";var q=class extends J{constructor(t,e){super(),this.options=e,this.#s=t,this.#r=null,this.#i=N(),this.bindMethods(),this.setOptions(e)}#s;#t=void 0;#p=void 0;#e=void 0;#a;#u;#i;#r;#b;#l;#d;#o;#h;#n;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),A(this.#t,this.options)?this.#c():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#s.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof l(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#t.setOptions(this.options),e._defaulted&&!Q(this.options,e)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&j(this.#t,s,this.options,e)&&this.#c(),this.updateResult(),i&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(e.staleTime,this.#t))&&this.#v();const r=this.#R();i&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||r!==this.#n)&&this.#m(r)}getOptimisticResult(t){const e=this.#s.getQueryCache().build(this.#s,t),s=this.createResult(e,t);return et(this,s)&&(this.#e=s,this.#u=this.options,this.#a=this.#t.state),s}getCurrentResult(){return this.#e}trackResult(t,e){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),e?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,i))})}trackProp(t){this.#f.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#s.defaultQueryOptions(t),s=this.#s.getQueryCache().build(this.#s,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#c({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#c(t){this.#O();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(x)),e}#v(){this.#y();const t=g(this.options.staleTime,this.#t);if(M||this.#e.isStale||!B(t))return;const s=X(this.#e.dataUpdatedAt,t)+1;this.#o=C.setTimeout(()=>{this.#e.isStale||this.updateResult()},s)}#R(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#m(t){this.#S(),this.#n=t,!(M||l(this.options.enabled,this.#t)===!1||!B(this.#n)||this.#n===0)&&(this.#h=C.setInterval(()=>{(this.options.refetchIntervalInBackground||Y.isFocused())&&this.#c()},this.#n))}#g(){this.#v(),this.#m(this.#R())}#y(){this.#o&&(C.clearTimeout(this.#o),this.#o=void 0)}#S(){this.#h&&(C.clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const s=this.#t,i=this.options,r=this.#e,u=this.#a,a=this.#u,v=t!==s?t.state:this.#p,{state:h}=t;let n={...h},R=!1,o;if(e._optimisticResults){const c=this.hasListeners(),m=!c&&A(t,e),S=c&&j(t,s,e,i);(m||S)&&(n={...n,...Z(h.data,t.options)}),e._optimisticResults==="isRestoring"&&(n.fetchStatus="idle")}let{error:y,errorUpdatedAt:U,status:b}=n;o=n.data;let D=!1;if(e.placeholderData!==void 0&&o===void 0&&b==="pending"){let c;r?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(c=r.data,D=!0):c=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,c!==void 0&&(b="success",o=H(r?.data,c,e),R=!0)}if(e.select&&o!==void 0&&!D)if(r&&o===u?.data&&e.select===this.#b)o=this.#l;else try{this.#b=e.select,o=e.select(o),o=H(r?.data,o,e),this.#l=o,this.#r=null}catch(c){this.#r=c}this.#r&&(y=this.#r,o=this.#l,U=Date.now(),b="error");const I=n.fetchStatus==="fetching",w=b==="pending",T=b==="error",F=w&&I,k=o!==void 0,p={status:b,fetchStatus:n.fetchStatus,isPending:w,isSuccess:b==="success",isError:T,isInitialLoading:F,isLoading:F,data:o,dataUpdatedAt:n.dataUpdatedAt,error:y,errorUpdatedAt:U,failureCount:n.fetchFailureCount,failureReason:n.fetchFailureReason,errorUpdateCount:n.errorUpdateCount,isFetched:n.dataUpdateCount>0||n.errorUpdateCount>0,isFetchedAfterMount:n.dataUpdateCount>v.dataUpdateCount||n.errorUpdateCount>v.errorUpdateCount,isFetching:I,isRefetching:I&&!w,isLoadingError:T&&!k,isPaused:n.fetchStatus==="paused",isPlaceholderData:R,isRefetchError:T&&k,isStale:P(t,e),refetch:this.refetch,promise:this.#i,isEnabled:l(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const c=p.data!==void 0,m=p.status==="error"&&!c,S=E=>{m?E.reject(p.error):c&&E.resolve(p.data)},L=()=>{const E=this.#i=p.promise=N();S(E)},O=this.#i;switch(O.status){case"pending":t.queryHash===s.queryHash&&S(O);break;case"fulfilled":(m||p.data!==O.value)&&L();break;case"rejected":(!m||p.error!==O.reason)&&L();break}}return p}updateResult(){const t=this.#e,e=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#u=this.options,this.#a.data!==void 0&&(this.#d=this.#t),Q(e,t))return;this.#e=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,r=typeof i=="function"?i():i;if(r==="all"||!r&&!this.#f.size)return!0;const u=new Set(r??this.#f);return this.options.throwOnError&&u.add("error"),Object.keys(this.#e).some(a=>{const f=a;return this.#e[f]!==t[f]&&u.has(f)})};this.#E({listeners:s()})}#O(){const t=this.#s.getQueryCache().build(this.#s,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#p=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#E(t){z.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#s.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function tt(t,e){return l(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function A(t,e){return tt(t,e)||t.state.data!==void 0&&_(t,e,e.refetchOnMount)}function _(t,e,s){if(l(e.enabled,t)!==!1&&g(e.staleTime,t)!=="static"){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&P(t,e)}return!1}function j(t,e,s,i){return(t!==e||l(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&P(t,s)}function P(t,e){return l(e.enabled,t)!==!1&&t.isStaleByTime(g(e.staleTime,t))}function et(t,e){return!Q(t.getCurrentResult(),e)}var K=d.createContext(!1),st=()=>d.useContext(K);K.Provider;function it(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var rt=d.createContext(it()),nt=()=>d.useContext(rt),at=(t,e,s)=>{const i=s?.state.error&&typeof t.throwOnError=="function"?V(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||i)&&(e.isReset()||(t.retryOnMount=!1))},ot=t=>{d.useEffect(()=>{t.clearReset()},[t])},ht=({result:t,errorResetBoundary:e,throwOnError:s,query:i,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(r&&t.data===void 0||V(s,[t.error,i])),ct=t=>{if(t.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...r)=>s(i(...r)):s(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},ut=(t,e)=>t.isLoading&&t.isFetching&&!e,lt=(t,e)=>t?.suspense&&e.isPending,W=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function dt(t,e,s){const i=st(),r=nt(),u=$(),a=u.defaultQueryOptions(t);u.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const f=u.getQueryCache().get(a.queryHash);a._optimisticResults=i?"isRestoring":"optimistic",ct(a),at(a,r,f),ot(r);const v=!u.getQueryCache().get(a.queryHash),[h]=d.useState(()=>new e(u,a)),n=h.getOptimisticResult(a),R=!i&&t.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(o=>{const y=R?h.subscribe(z.batchCalls(o)):x;return h.updateResult(),y},[h,R]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),d.useEffect(()=>{h.setOptions(a)},[a,h]),lt(a,n))throw W(a,h,r);if(ht({result:n,errorResetBoundary:r,throwOnError:a.throwOnError,query:f,suspense:a.suspense}))throw n.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(a,n),a.experimental_prefetchInRender&&!M&&ut(n,i)&&(v?W(a,h,r):f?.promise)?.catch(x).finally(()=>{h.updateResult()}),a.notifyOnChangeProps?n:h.trackResult(n)}function bt(t,e){return dt(t,q)}const G={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},vt={...G,position:"fixed",top:0,left:0},Rt={...G,position:"absolute"};export{vt as a,bt as u,Rt as v};
@@ -19,7 +19,7 @@ import { u as useChatSettings$1 } from "./index-Dl2BOKP7.js";
19
19
  import { create } from "zustand";
20
20
  import { persist } from "zustand/middleware";
21
21
  import { createPortal } from "react-dom";
22
- import { a as Route } from "./router-Uuagl6O7.js";
22
+ import { a as Route } from "./router-CkcOXH0V.js";
23
23
  function deriveFriendlyIdFromKey(key) {
24
24
  if (!key) return "main";
25
25
  const trimmed = key.trim();
@@ -1662,7 +1662,7 @@ function useRenameSession() {
1662
1662
  return { renameSession, renaming, error };
1663
1663
  }
1664
1664
  const SettingsDialog = lazy(
1665
- () => import("./settings-dialog-CSYDj2qm.js").then((m) => ({ default: m.SettingsDialog }))
1665
+ () => import("./settings-dialog-S2HICL7l.js").then((m) => ({ default: m.SettingsDialog }))
1666
1666
  );
1667
1667
  const SessionExportDialog = lazy(
1668
1668
  () => import("./session-export-dialog-C53RRAah.js").then((m) => ({
@@ -6223,7 +6223,7 @@ const KeyboardShortcutsDialog = lazy(
6223
6223
  }))
6224
6224
  );
6225
6225
  const SearchDialog = lazy(
6226
- () => import("./search-dialog-DZTS5SEi.js").then((m) => ({
6226
+ () => import("./search-dialog-CuuZvlyq.js").then((m) => ({
6227
6227
  default: m.SearchDialog
6228
6228
  }))
6229
6229
  );
@@ -1,4 +1,4 @@
1
- const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "/home/runner/work/opencami/opencami/src/routes/__root.tsx", "children": ["/", "/agents", "/bots", "/connect", "/files", "/memory", "/new", "/skills", "/api/agents", "/api/cron", "/api/follow-ups", "/api/history", "/api/llm-features", "/api/models", "/api/paths", "/api/personas", "/api/ping", "/api/send", "/api/sessions", "/api/skills", "/api/stream", "/api/stt", "/api/tts", "/chat/$sessionKey", "/api/files/delete", "/api/files/download", "/api/files/info", "/api/files/list", "/api/files/mkdir", "/api/files/read", "/api/files/rename", "/api/files/save", "/api/files/upload"], "preloads": ["/assets/main-B_dlfHME.js"], "assets": [] }, "/": { "filePath": "/home/runner/work/opencami/opencami/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-rOIRO-8E.js"] }, "/agents": { "filePath": "/home/runner/work/opencami/opencami/src/routes/agents.tsx", "assets": [], "preloads": ["/assets/agents-DwxKcpP6.js"] }, "/bots": { "filePath": "/home/runner/work/opencami/opencami/src/routes/bots.tsx", "assets": [], "preloads": ["/assets/bots-CRlm-3-d.js"] }, "/connect": { "filePath": "/home/runner/work/opencami/opencami/src/routes/connect.tsx", "assets": [], "preloads": ["/assets/connect-NYvOqiBJ.js", "/assets/index-CMATW8VA.js", "/assets/button-Dg7VFQQn.js", "/assets/react-irH8OzhB.js"] }, "/files": { "filePath": "/home/runner/work/opencami/opencami/src/routes/files.tsx", "assets": [], "preloads": ["/assets/files-BJbMx0_w.js"] }, "/memory": { "filePath": "/home/runner/work/opencami/opencami/src/routes/memory.tsx", "assets": [], "preloads": ["/assets/memory-S3Yws6a5.js"] }, "/new": { "filePath": "/home/runner/work/opencami/opencami/src/routes/new.tsx", "assets": [], "preloads": ["/assets/new-DLlBm66g.js"] }, "/skills": { "filePath": "/home/runner/work/opencami/opencami/src/routes/skills.tsx", "assets": [], "preloads": ["/assets/skills-YZe3I63y.js"] }, "/api/agents": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/agents.ts" }, "/api/cron": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/cron.ts" }, "/api/follow-ups": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/follow-ups.ts" }, "/api/history": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/history.ts" }, "/api/llm-features": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/llm-features.ts" }, "/api/models": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/models.ts" }, "/api/paths": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/paths.ts" }, "/api/personas": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/personas.ts" }, "/api/ping": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/ping.ts" }, "/api/send": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/send.ts" }, "/api/sessions": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/sessions.ts" }, "/api/skills": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/skills.ts" }, "/api/stream": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/stream.ts" }, "/api/stt": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/stt.ts" }, "/api/tts": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/tts.ts" }, "/chat/$sessionKey": { "filePath": "/home/runner/work/opencami/opencami/src/routes/chat/$sessionKey.tsx", "assets": [], "preloads": ["/assets/_sessionKey-DsjnpErt.js", "/assets/visuallyHidden-ONmQ-0U2.js", "/assets/tooltip-Dg9fy-vT.js", "/assets/button-Dg7VFQQn.js", "/assets/use-file-explorer-state-DzT0bksg.js", "/assets/useButton-Cbl_9oFG.js", "/assets/useControlled-Dscz_s4f.js", "/assets/popupStateMapping-BRPDXnjv.js", "/assets/owner-CpRnf1fI.js", "/assets/CSPContext-Bq8j4nl9.js", "/assets/DirectionContext-BdX86BHP.js", "/assets/menu-DHNgWk_8.js", "/assets/useMutation-B1FlDsNN.js", "/assets/opencami-logo-BQQETnJG.js", "/assets/proxy-BcUh9kMA.js", "/assets/markdown-BVzT7z4x.js", "/assets/index-CMATW8VA.js", "/assets/react-irH8OzhB.js"] }, "/api/files/delete": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/delete.ts" }, "/api/files/download": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/download.ts" }, "/api/files/info": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/info.ts" }, "/api/files/list": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/list.ts" }, "/api/files/mkdir": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/mkdir.ts" }, "/api/files/read": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/read.ts" }, "/api/files/rename": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/rename.ts" }, "/api/files/save": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/save.ts" }, "/api/files/upload": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/upload.ts" } }, "clientEntry": "/assets/main-B_dlfHME.js" });
1
+ const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "/home/runner/work/opencami/opencami/src/routes/__root.tsx", "children": ["/", "/agents", "/bots", "/connect", "/files", "/memory", "/new", "/skills", "/api/agents", "/api/cron", "/api/follow-ups", "/api/history", "/api/llm-features", "/api/models", "/api/paths", "/api/personas", "/api/ping", "/api/send", "/api/sessions", "/api/skills", "/api/stream", "/api/stt", "/api/tts", "/chat/$sessionKey", "/api/files/delete", "/api/files/download", "/api/files/info", "/api/files/list", "/api/files/mkdir", "/api/files/read", "/api/files/rename", "/api/files/save", "/api/files/upload"], "preloads": ["/assets/main-ZPHfbCuz.js"], "assets": [] }, "/": { "filePath": "/home/runner/work/opencami/opencami/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-CRgPm0pb.js"] }, "/agents": { "filePath": "/home/runner/work/opencami/opencami/src/routes/agents.tsx", "assets": [], "preloads": ["/assets/agents-DBx41wBT.js"] }, "/bots": { "filePath": "/home/runner/work/opencami/opencami/src/routes/bots.tsx", "assets": [], "preloads": ["/assets/bots-BqD0EQcs.js"] }, "/connect": { "filePath": "/home/runner/work/opencami/opencami/src/routes/connect.tsx", "assets": [], "preloads": ["/assets/connect-9Vns9nqk.js", "/assets/index-BvN0Cj0s.js", "/assets/button-DzGUU5Tc.js", "/assets/react-DuiuJSA1.js"] }, "/files": { "filePath": "/home/runner/work/opencami/opencami/src/routes/files.tsx", "assets": [], "preloads": ["/assets/files-BlMyTMb7.js"] }, "/memory": { "filePath": "/home/runner/work/opencami/opencami/src/routes/memory.tsx", "assets": [], "preloads": ["/assets/memory-rR6pG57i.js"] }, "/new": { "filePath": "/home/runner/work/opencami/opencami/src/routes/new.tsx", "assets": [], "preloads": ["/assets/new-DLlBm66g.js"] }, "/skills": { "filePath": "/home/runner/work/opencami/opencami/src/routes/skills.tsx", "assets": [], "preloads": ["/assets/skills-DAKbQw5l.js"] }, "/api/agents": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/agents.ts" }, "/api/cron": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/cron.ts" }, "/api/follow-ups": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/follow-ups.ts" }, "/api/history": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/history.ts" }, "/api/llm-features": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/llm-features.ts" }, "/api/models": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/models.ts" }, "/api/paths": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/paths.ts" }, "/api/personas": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/personas.ts" }, "/api/ping": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/ping.ts" }, "/api/send": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/send.ts" }, "/api/sessions": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/sessions.ts" }, "/api/skills": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/skills.ts" }, "/api/stream": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/stream.ts" }, "/api/stt": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/stt.ts" }, "/api/tts": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/tts.ts" }, "/chat/$sessionKey": { "filePath": "/home/runner/work/opencami/opencami/src/routes/chat/$sessionKey.tsx", "assets": [], "preloads": ["/assets/_sessionKey-f5UgmhlK.js", "/assets/visuallyHidden-ChUPUs-q.js", "/assets/tooltip-BoKzJ7ag.js", "/assets/button-DzGUU5Tc.js", "/assets/use-file-explorer-state-EK2HTABk.js", "/assets/useButton-Bh6gEhdL.js", "/assets/useControlled-byIifl1i.js", "/assets/popupStateMapping-C797EAip.js", "/assets/owner-Bm20thei.js", "/assets/CSPContext-CCZJblsW.js", "/assets/DirectionContext-CAS2SgNN.js", "/assets/menu-9GT8MQlt.js", "/assets/useMutation-D5JCmjGc.js", "/assets/opencami-logo-CxC-KcS9.js", "/assets/proxy-aJlrsYWj.js", "/assets/markdown-1-xJ1B1H.js", "/assets/index-BvN0Cj0s.js", "/assets/react-DuiuJSA1.js"] }, "/api/files/delete": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/delete.ts" }, "/api/files/download": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/download.ts" }, "/api/files/info": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/info.ts" }, "/api/files/list": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/list.ts" }, "/api/files/mkdir": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/mkdir.ts" }, "/api/files/read": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/read.ts" }, "/api/files/rename": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/rename.ts" }, "/api/files/save": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/save.ts" }, "/api/files/upload": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/upload.ts" } }, "clientEntry": "/assets/main-ZPHfbCuz.js" });
2
2
  export {
3
3
  tsrStartManifest
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useEffect } from "react";
3
- import { R as Route } from "./router-Uuagl6O7.js";
3
+ import { R as Route } from "./router-CkcOXH0V.js";
4
4
  import "@tanstack/react-router";
5
5
  import "@tanstack/react-query";
6
6
  import "node:crypto";