@nextclaw/ui 0.10.0 → 0.10.2

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 (75) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/dist/assets/{ChannelsList-VSRZzxx2.js → ChannelsList-DSMuOmMG.js} +4 -4
  3. package/dist/assets/ChatPage-do9TwNxj.js +38 -0
  4. package/dist/assets/{DocBrowser-C65Hbvnb.js → DocBrowser-BjoTblYl.js} +1 -1
  5. package/dist/assets/{LogoBadge-4qtguXEJ.js → LogoBadge-2yDaYdxw.js} +1 -1
  6. package/dist/assets/MarketplacePage-DVVk4dlH.js +49 -0
  7. package/dist/assets/{McpMarketplacePage-CHLkD8yX.js → McpMarketplacePage-B4WUzuLw.js} +1 -1
  8. package/dist/assets/{ModelConfig-CjsGdmZa.js → ModelConfig-Dr0eI9nN.js} +1 -1
  9. package/dist/assets/ProvidersList-C7A-mIbe.js +1 -0
  10. package/dist/assets/{RemoteAccessPage-rOZCnH1x.js → RemoteAccessPage-CI3Am3w1.js} +1 -1
  11. package/dist/assets/{RuntimeConfig-CmJh6g0R.js → RuntimeConfig-DvSNVSs8.js} +1 -1
  12. package/dist/assets/{SearchConfig-C_hUuzR4.js → SearchConfig-B6TGIZow.js} +1 -1
  13. package/dist/assets/{SecretsConfig-Bu_zIRlQ.js → SecretsConfig-CpxaKU1j.js} +1 -1
  14. package/dist/assets/{SessionsConfig-DA_nqkM_.js → SessionsConfig-B-VHnv4G.js} +1 -1
  15. package/dist/assets/{chat-message-BOdA4h43.js → chat-message-BMqngrjp.js} +1 -1
  16. package/dist/assets/index-C6MeoecJ.js +8 -0
  17. package/dist/assets/index-DdXzLuNG.css +1 -0
  18. package/dist/assets/{label-BYZ62ajO.js → label-s2ILtQeP.js} +1 -1
  19. package/dist/assets/{page-layout-UC-h92sU.js → page-layout-BX5Ro4Sj.js} +1 -1
  20. package/dist/assets/{popover-DASCEr3G.js → popover-qmNpQSIy.js} +1 -1
  21. package/dist/assets/{security-config-Cvujq4fH.js → security-config--F-f-nDl.js} +1 -1
  22. package/dist/assets/skeleton-DthPOKSc.js +1 -0
  23. package/dist/assets/{status-dot-C1AvPwDD.js → status-dot-DWj7aUy8.js} +1 -1
  24. package/dist/assets/{switch-D3wVuCSh.js → switch-62r7L4Lj.js} +1 -1
  25. package/dist/assets/tabs-custom-DEmoGMsc.js +1 -0
  26. package/dist/assets/useConfirmDialog-DzT94nC_.js +1 -0
  27. package/dist/assets/{vendor-DJt0Azq5.js → vendor-CNhxtHCf.js} +1 -1
  28. package/dist/index.html +3 -3
  29. package/package.json +5 -5
  30. package/src/App.test.tsx +41 -0
  31. package/src/App.tsx +37 -0
  32. package/src/api/client.test.ts +12 -0
  33. package/src/api/client.ts +4 -2
  34. package/src/api/config.ts +1 -1
  35. package/src/components/chat/ChatSidebar.tsx +41 -69
  36. package/src/components/chat/adapters/chat-input-bar.adapter.test.ts +32 -1
  37. package/src/components/chat/adapters/chat-input-bar.adapter.ts +6 -3
  38. package/src/components/chat/adapters/chat-message.adapter.test.ts +141 -163
  39. package/src/components/chat/adapters/chat-message.adapter.ts +35 -0
  40. package/src/components/chat/chat-composer-state.ts +38 -0
  41. package/src/components/chat/chat-stream/types.ts +2 -0
  42. package/src/components/chat/containers/chat-input-bar.container.tsx +116 -55
  43. package/src/components/chat/containers/chat-message-list.container.tsx +2 -0
  44. package/src/components/chat/managers/chat-session-list.manager.test.ts +16 -1
  45. package/src/components/chat/managers/chat-session-list.manager.ts +0 -2
  46. package/src/components/chat/managers/chat-thread.manager.ts +0 -1
  47. package/src/components/chat/ncp/NcpChatPage.tsx +18 -18
  48. package/src/components/chat/ncp/ncp-app-client-fetch.test.ts +50 -33
  49. package/src/components/chat/ncp/ncp-app-client-fetch.ts +5 -123
  50. package/src/components/chat/ncp/ncp-chat-input.manager.ts +56 -1
  51. package/src/components/chat/ncp/ncp-chat-page-data.test.ts +8 -0
  52. package/src/components/chat/ncp/ncp-chat-thread.manager.ts +0 -1
  53. package/src/components/chat/presenter/chat-presenter-context.tsx +6 -0
  54. package/src/components/chat/stores/chat-input.store.ts +3 -0
  55. package/src/components/config/ChannelsList.test.tsx +2 -1
  56. package/src/components/config/weixin-channel-auth-section.test.tsx +2 -1
  57. package/src/components/layout/Sidebar.tsx +62 -102
  58. package/src/components/layout/sidebar-items.tsx +172 -0
  59. package/src/components/layout/sidebar.layout.test.tsx +11 -4
  60. package/src/hooks/use-auth.ts +1 -2
  61. package/src/lib/i18n.chat.ts +117 -0
  62. package/src/lib/i18n.remote.ts +1 -1
  63. package/src/lib/i18n.ts +2 -112
  64. package/src/transport/local.transport.ts +28 -7
  65. package/src/transport/remote.transport.test.ts +135 -0
  66. package/src/transport/remote.transport.ts +14 -1
  67. package/src/transport/transport.types.ts +1 -0
  68. package/dist/assets/ChatPage-CX0ZKE5i.js +0 -41
  69. package/dist/assets/MarketplacePage-DPCYptfD.js +0 -49
  70. package/dist/assets/ProvidersList-aXp_mo4J.js +0 -1
  71. package/dist/assets/index-C63mHRbE.css +0 -1
  72. package/dist/assets/index-DS7D1-KS.js +0 -8
  73. package/dist/assets/skeleton-DlYEKkkj.js +0 -1
  74. package/dist/assets/tabs-custom-CbgS7tu0.js +0 -1
  75. package/dist/assets/useConfirmDialog-BYbFEIbQ.js +0 -1
@@ -1 +1 @@
1
- import{r as l,aK as L,j as c,aL as z,aM as G,aN as A,aO as O,aP as P,aQ as _,aR as w,aS as b,aT as H,aU as K,aV as U,aW as V,aX as W,aY as Z,aZ as Q,a_ as X,a$ as Y,b0 as q}from"./vendor-DJt0Azq5.js";import{c as B}from"./index-DS7D1-KS.js";var m="Popover",[E]=K(m,[w]),g=w(),[J,d]=E(m),j=e=>{const{__scopePopover:n,children:t,open:a,defaultOpen:o,onOpenChange:r,modal:s=!1}=e,i=g(n),p=l.useRef(null),[u,h]=l.useState(!1),[C,f]=L({prop:a,defaultProp:o??!1,onChange:r,caller:m});return c.jsx(z,{...i,children:c.jsx(J,{scope:n,contentId:G(),triggerRef:p,open:C,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(x=>!x),[f]),hasCustomAnchor:u,onCustomAnchorAdd:l.useCallback(()=>h(!0),[]),onCustomAnchorRemove:l.useCallback(()=>h(!1),[]),modal:s,children:t})})};j.displayName=m;var N="PopoverAnchor",y=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(N,t),r=g(t),{onCustomAnchorAdd:s,onCustomAnchorRemove:i}=o;return l.useEffect(()=>(s(),()=>i()),[s,i]),c.jsx(_,{...r,...a,ref:n})});y.displayName=N;var F="PopoverTrigger",S=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(F,t),r=g(t),s=A(n,o.triggerRef),i=c.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":I(o.open),...a,ref:s,onClick:P(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:c.jsx(_,{asChild:!0,...r,children:i})});S.displayName=F;var R="PopoverPortal",[ee,oe]=E(R,{forceMount:void 0}),M=e=>{const{__scopePopover:n,forceMount:t,children:a,container:o}=e,r=d(R,n);return c.jsx(ee,{scope:n,forceMount:t,children:c.jsx(b,{present:t||r.open,children:c.jsx(H,{asChild:!0,container:o,children:a})})})};M.displayName=R;var v="PopoverContent",T=l.forwardRef((e,n)=>{const t=oe(v,e.__scopePopover),{forceMount:a=t.forceMount,...o}=e,r=d(v,e.__scopePopover);return c.jsx(b,{present:a||r.open,children:r.modal?c.jsx(re,{...o,ref:n}):c.jsx(ne,{...o,ref:n})})});T.displayName=v;var te=W("PopoverContent.RemoveScroll"),re=l.forwardRef((e,n)=>{const t=d(v,e.__scopePopover),a=l.useRef(null),o=A(n,a),r=l.useRef(!1);return l.useEffect(()=>{const s=a.current;if(s)return U(s)},[]),c.jsx(V,{as:te,allowPinchZoom:!0,children:c.jsx(D,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),r.current||(i=t.triggerRef.current)==null||i.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;r.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=l.forwardRef((e,n)=>{const t=d(v,e.__scopePopover),a=l.useRef(!1),o=l.useRef(!1);return c.jsx(D,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,r),r.defaultPrevented||(a.current||(i=t.triggerRef.current)==null||i.focus(),r.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:r=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=r.target;((u=t.triggerRef.current)==null?void 0:u.contains(s))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&o.current&&r.preventDefault()}})}),D=l.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:r,disableOutsidePointerEvents:s,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:h,...C}=e,f=d(v,t),x=g(t);return Z(),c.jsx(Q,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:r,children:c.jsx(X,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Y,{"data-state":I(f.open),role:"dialog",id:f.contentId,...x,...C,ref:n,style:{...C.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),k="PopoverClose",ae=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(k,t);return c.jsx(O.button,{type:"button",...a,ref:n,onClick:P(e.onClick,()=>o.onOpenChange(!1))})});ae.displayName=k;var se="PopoverArrow",ce=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=g(t);return c.jsx(q,{...o,...a,ref:n})});ce.displayName=se;function I(e){return e?"open":"closed"}var ie=j,ve=y,le=S,pe=M,$=T;const Pe=ie,ge=le,ue=l.forwardRef(({className:e,sideOffset:n=8,align:t="start",...a},o)=>c.jsx(pe,{children:c.jsx($,{ref:o,sideOffset:n,align:t,className:B("z-[var(--z-popover,50)] w-72 overflow-hidden rounded-2xl border border-gray-200/50 bg-white p-4 shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));ue.displayName=$.displayName;export{ve as A,$ as C,pe as P,ie as R,le as T,Pe as a,ge as b,ue as c};
1
+ import{r as l,aK as L,j as c,aL as z,aM as G,aN as A,aO as O,aP as P,aQ as _,aR as w,aS as b,aT as H,aU as K,aV as U,aW as V,aX as W,aY as Z,aZ as Q,a_ as X,a$ as Y,b0 as q}from"./vendor-CNhxtHCf.js";import{c as B}from"./index-C6MeoecJ.js";var m="Popover",[E]=K(m,[w]),g=w(),[J,d]=E(m),j=e=>{const{__scopePopover:n,children:t,open:a,defaultOpen:o,onOpenChange:r,modal:s=!1}=e,i=g(n),p=l.useRef(null),[u,h]=l.useState(!1),[C,f]=L({prop:a,defaultProp:o??!1,onChange:r,caller:m});return c.jsx(z,{...i,children:c.jsx(J,{scope:n,contentId:G(),triggerRef:p,open:C,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(x=>!x),[f]),hasCustomAnchor:u,onCustomAnchorAdd:l.useCallback(()=>h(!0),[]),onCustomAnchorRemove:l.useCallback(()=>h(!1),[]),modal:s,children:t})})};j.displayName=m;var N="PopoverAnchor",y=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(N,t),r=g(t),{onCustomAnchorAdd:s,onCustomAnchorRemove:i}=o;return l.useEffect(()=>(s(),()=>i()),[s,i]),c.jsx(_,{...r,...a,ref:n})});y.displayName=N;var F="PopoverTrigger",S=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(F,t),r=g(t),s=A(n,o.triggerRef),i=c.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":I(o.open),...a,ref:s,onClick:P(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:c.jsx(_,{asChild:!0,...r,children:i})});S.displayName=F;var R="PopoverPortal",[ee,oe]=E(R,{forceMount:void 0}),M=e=>{const{__scopePopover:n,forceMount:t,children:a,container:o}=e,r=d(R,n);return c.jsx(ee,{scope:n,forceMount:t,children:c.jsx(b,{present:t||r.open,children:c.jsx(H,{asChild:!0,container:o,children:a})})})};M.displayName=R;var v="PopoverContent",T=l.forwardRef((e,n)=>{const t=oe(v,e.__scopePopover),{forceMount:a=t.forceMount,...o}=e,r=d(v,e.__scopePopover);return c.jsx(b,{present:a||r.open,children:r.modal?c.jsx(re,{...o,ref:n}):c.jsx(ne,{...o,ref:n})})});T.displayName=v;var te=W("PopoverContent.RemoveScroll"),re=l.forwardRef((e,n)=>{const t=d(v,e.__scopePopover),a=l.useRef(null),o=A(n,a),r=l.useRef(!1);return l.useEffect(()=>{const s=a.current;if(s)return U(s)},[]),c.jsx(V,{as:te,allowPinchZoom:!0,children:c.jsx(D,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),r.current||(i=t.triggerRef.current)==null||i.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;r.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=l.forwardRef((e,n)=>{const t=d(v,e.__scopePopover),a=l.useRef(!1),o=l.useRef(!1);return c.jsx(D,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,r),r.defaultPrevented||(a.current||(i=t.triggerRef.current)==null||i.focus(),r.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:r=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=r.target;((u=t.triggerRef.current)==null?void 0:u.contains(s))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&o.current&&r.preventDefault()}})}),D=l.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:r,disableOutsidePointerEvents:s,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:h,...C}=e,f=d(v,t),x=g(t);return Z(),c.jsx(Q,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:r,children:c.jsx(X,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Y,{"data-state":I(f.open),role:"dialog",id:f.contentId,...x,...C,ref:n,style:{...C.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),k="PopoverClose",ae=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(k,t);return c.jsx(O.button,{type:"button",...a,ref:n,onClick:P(e.onClick,()=>o.onOpenChange(!1))})});ae.displayName=k;var se="PopoverArrow",ce=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=g(t);return c.jsx(q,{...o,...a,ref:n})});ce.displayName=se;function I(e){return e?"open":"closed"}var ie=j,ve=y,le=S,pe=M,$=T;const Pe=ie,ge=le,ue=l.forwardRef(({className:e,sideOffset:n=8,align:t="start",...a},o)=>c.jsx(pe,{children:c.jsx($,{ref:o,sideOffset:n,align:t,className:B("z-[var(--z-popover,50)] w-72 overflow-hidden rounded-2xl border border-gray-200/50 bg-white p-4 shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));ue.displayName=$.displayName;export{ve as A,$ as C,pe as P,ie as R,le as T,Pe as a,ge as b,ue as c};
@@ -1 +1 @@
1
- import{r as c,j as e,e as M}from"./vendor-DJt0Azq5.js";import{a6 as O,a7 as R,a8 as I,a9 as B,aa as _,C as u,a3 as h,a4 as x,t as s,a5 as m,E as p,B as j,I as l}from"./index-DS7D1-KS.js";import{L as o}from"./label-BYZ62ajO.js";import{S as G}from"./switch-D3wVuCSh.js";import{P as V,a as W}from"./page-layout-UC-h92sU.js";const q=8;function A(r){return r.trim().length>=q}function L(r,n){return r!==n?(M.error(s("authPasswordMismatch")),!1):!0}function z(){const r=O(),n=R(),S=I(),g=B(),y=_(),[f,U]=c.useState(""),[i,N]=c.useState(""),[w,b]=c.useState(""),[d,v]=c.useState(""),[P,C]=c.useState(""),t=r.data,E=f.trim().length>0&&A(i)&&i===w&&!n.isPending,D=A(d)&&d===P&&!g.isPending,T=async()=>{if(L(i,w))try{await n.mutateAsync({username:f.trim(),password:i}),N(""),b("")}catch{}},F=async()=>{if(L(d,P))try{await g.mutateAsync({password:d}),v(""),C("")}catch{}},H=async a=>{try{await S.mutateAsync({enabled:a})}catch{}},k=async()=>{try{await y.mutateAsync()}catch{}};return r.isLoading&&!t?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsx(p,{className:"text-sm text-gray-500",children:s("loading")})]}):r.isError||!t?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-gray-500",children:s("authStatusLoadFailed")}),e.jsx(j,{variant:"outline",onClick:()=>{r.refetch()},children:s("authRetryStatus")})]})]}):t.configured?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-xl border border-gray-200 p-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authStatusLabel")}),e.jsx("p",{className:"text-sm text-gray-600",children:s("authStatusConfiguredUser").replace("{username}",t.username??"")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authUsernameFixedHelp")})]}),e.jsx("span",{className:"inline-flex items-center rounded-full bg-gray-100 px-3 py-1 text-xs font-medium text-gray-700",children:t.enabled?s("enabled"):s("disabled")})]}),e.jsxs("div",{className:"mt-4 flex flex-col gap-4 border-t border-gray-200 pt-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authEnableLabel")}),e.jsx("p",{className:"text-xs text-gray-500",children:t.enabled?s("authEnableOnHelp"):s("authEnableOffHelp")})]}),e.jsx(G,{checked:t.enabled,disabled:S.isPending,onCheckedChange:a=>{H(a)}})]})]}),e.jsxs("div",{className:"rounded-xl border border-gray-200 p-4 space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authPasswordSectionTitle")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authPasswordSectionDescription")})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-password-next",children:s("authPassword")}),e.jsx(l,{id:"auth-password-next",type:"password",value:d,onChange:a=>v(a.target.value),placeholder:s("authPasswordPlaceholder")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-password-confirm",children:s("authConfirmPassword")}),e.jsx(l,{id:"auth-password-confirm",type:"password",value:P,onChange:a=>C(a.target.value),placeholder:s("authConfirmPasswordPlaceholder")})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx(j,{type:"button",disabled:!D,onClick:()=>void F(),children:g.isPending?s("authPasswordUpdating"):s("authPasswordAction")}),t.enabled&&t.authenticated?e.jsx(j,{type:"button",variant:"outline",disabled:y.isPending,onClick:()=>void k(),children:y.isPending?s("authLoggingOut"):s("authLogoutAction")}):null]}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authSessionMemoryNotice")})]})]})]}):e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-5",children:[e.jsxs("div",{className:"rounded-xl border border-dashed border-gray-200 bg-gray-50/70 p-4",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authSetupTitle")}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s("authSetupDescription")})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-username",children:s("authUsername")}),e.jsx(l,{id:"auth-setup-username",value:f,onChange:a=>U(a.target.value),placeholder:s("authUsernamePlaceholder")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-password",children:s("authPassword")}),e.jsx(l,{id:"auth-setup-password",type:"password",value:i,onChange:a=>N(a.target.value),placeholder:s("authPasswordPlaceholder")})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-confirm",children:s("authConfirmPassword")}),e.jsx(l,{id:"auth-setup-confirm",type:"password",value:w,onChange:a=>b(a.target.value),placeholder:s("authConfirmPasswordPlaceholder")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authPasswordMinLengthHint")})]}),e.jsx(j,{type:"button",disabled:!E,onClick:()=>void T(),children:n.isPending?s("authSettingUp"):s("authSetupAction")})]})]})}function Z(){return e.jsxs(V,{className:"space-y-6",children:[e.jsx(W,{title:s("authSecurityTitle"),description:s("authSecurityDescription")}),e.jsx(z,{})]})}export{Z as SecurityConfig};
1
+ import{r as c,j as e,e as M}from"./vendor-CNhxtHCf.js";import{a9 as O,aa as R,ab as I,ac as B,ad as _,C as u,a6 as h,a7 as x,t as s,a8 as m,H as p,B as j,I as l}from"./index-C6MeoecJ.js";import{L as o}from"./label-s2ILtQeP.js";import{S as G}from"./switch-62r7L4Lj.js";import{P as V,a as W}from"./page-layout-BX5Ro4Sj.js";const q=8;function A(r){return r.trim().length>=q}function L(r,n){return r!==n?(M.error(s("authPasswordMismatch")),!1):!0}function z(){const r=O(),n=R(),S=I(),g=B(),y=_(),[f,U]=c.useState(""),[i,N]=c.useState(""),[w,b]=c.useState(""),[d,v]=c.useState(""),[P,C]=c.useState(""),t=r.data,E=f.trim().length>0&&A(i)&&i===w&&!n.isPending,D=A(d)&&d===P&&!g.isPending,T=async()=>{if(L(i,w))try{await n.mutateAsync({username:f.trim(),password:i}),N(""),b("")}catch{}},H=async()=>{if(L(d,P))try{await g.mutateAsync({password:d}),v(""),C("")}catch{}},F=async a=>{try{await S.mutateAsync({enabled:a})}catch{}},k=async()=>{try{await y.mutateAsync()}catch{}};return r.isLoading&&!t?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsx(p,{className:"text-sm text-gray-500",children:s("loading")})]}):r.isError||!t?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-gray-500",children:s("authStatusLoadFailed")}),e.jsx(j,{variant:"outline",onClick:()=>{r.refetch()},children:s("authRetryStatus")})]})]}):t.configured?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-xl border border-gray-200 p-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authStatusLabel")}),e.jsx("p",{className:"text-sm text-gray-600",children:s("authStatusConfiguredUser").replace("{username}",t.username??"")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authUsernameFixedHelp")})]}),e.jsx("span",{className:"inline-flex items-center rounded-full bg-gray-100 px-3 py-1 text-xs font-medium text-gray-700",children:t.enabled?s("enabled"):s("disabled")})]}),e.jsxs("div",{className:"mt-4 flex flex-col gap-4 border-t border-gray-200 pt-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authEnableLabel")}),e.jsx("p",{className:"text-xs text-gray-500",children:t.enabled?s("authEnableOnHelp"):s("authEnableOffHelp")})]}),e.jsx(G,{checked:t.enabled,disabled:S.isPending,onCheckedChange:a=>{F(a)}})]})]}),e.jsxs("div",{className:"rounded-xl border border-gray-200 p-4 space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authPasswordSectionTitle")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authPasswordSectionDescription")})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-password-next",children:s("authPassword")}),e.jsx(l,{id:"auth-password-next",type:"password",value:d,onChange:a=>v(a.target.value),placeholder:s("authPasswordPlaceholder")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-password-confirm",children:s("authConfirmPassword")}),e.jsx(l,{id:"auth-password-confirm",type:"password",value:P,onChange:a=>C(a.target.value),placeholder:s("authConfirmPasswordPlaceholder")})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx(j,{type:"button",disabled:!D,onClick:()=>void H(),children:g.isPending?s("authPasswordUpdating"):s("authPasswordAction")}),t.enabled&&t.authenticated?e.jsx(j,{type:"button",variant:"outline",disabled:y.isPending,onClick:()=>void k(),children:y.isPending?s("authLoggingOut"):s("authLogoutAction")}):null]}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authSessionMemoryNotice")})]})]})]}):e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-5",children:[e.jsxs("div",{className:"rounded-xl border border-dashed border-gray-200 bg-gray-50/70 p-4",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authSetupTitle")}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s("authSetupDescription")})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-username",children:s("authUsername")}),e.jsx(l,{id:"auth-setup-username",value:f,onChange:a=>U(a.target.value),placeholder:s("authUsernamePlaceholder")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-password",children:s("authPassword")}),e.jsx(l,{id:"auth-setup-password",type:"password",value:i,onChange:a=>N(a.target.value),placeholder:s("authPasswordPlaceholder")})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-confirm",children:s("authConfirmPassword")}),e.jsx(l,{id:"auth-setup-confirm",type:"password",value:w,onChange:a=>b(a.target.value),placeholder:s("authConfirmPasswordPlaceholder")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authPasswordMinLengthHint")})]}),e.jsx(j,{type:"button",disabled:!E,onClick:()=>void T(),children:n.isPending?s("authSettingUp"):s("authSetupAction")})]})]})}function Z(){return e.jsxs(V,{className:"space-y-6",children:[e.jsx(W,{title:s("authSecurityTitle"),description:s("authSecurityDescription")}),e.jsx(z,{})]})}export{Z as SecurityConfig};
@@ -0,0 +1 @@
1
+ import{j as t}from"./vendor-CNhxtHCf.js";import{c as o}from"./index-C6MeoecJ.js";function m({className:e,...s}){return t.jsx("div",{className:o("animate-pulse rounded-md bg-slate-200",e),...s})}export{m as S};
@@ -1 +1 @@
1
- import{j as e}from"./vendor-DJt0Azq5.js";import{c as a}from"./index-DS7D1-KS.js";const n={active:{dot:"bg-emerald-500",text:"text-emerald-600",bg:"bg-emerald-50"},ready:{dot:"bg-emerald-500",text:"text-emerald-600",bg:"bg-emerald-50"},inactive:{dot:"bg-gray-300",text:"text-gray-400",bg:"bg-gray-100/80"},setup:{dot:"bg-gray-300",text:"text-gray-400",bg:"bg-gray-100/80"},warning:{dot:"bg-amber-400",text:"text-amber-600",bg:"bg-amber-50"}};function m({status:r,label:s,className:g}){const t=n[r];return e.jsxs("div",{className:a("inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5",t.bg,g),children:[e.jsx("span",{className:a("h-1.5 w-1.5 rounded-full",t.dot)}),e.jsx("span",{className:a("text-[11px] font-medium",t.text),children:s})]})}export{m as S};
1
+ import{j as e}from"./vendor-CNhxtHCf.js";import{c as a}from"./index-C6MeoecJ.js";const n={active:{dot:"bg-emerald-500",text:"text-emerald-600",bg:"bg-emerald-50"},ready:{dot:"bg-emerald-500",text:"text-emerald-600",bg:"bg-emerald-50"},inactive:{dot:"bg-gray-300",text:"text-gray-400",bg:"bg-gray-100/80"},setup:{dot:"bg-gray-300",text:"text-gray-400",bg:"bg-gray-100/80"},warning:{dot:"bg-amber-400",text:"text-amber-600",bg:"bg-amber-50"}};function m({status:r,label:s,className:g}){const t=n[r];return e.jsxs("div",{className:a("inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5",t.bg,g),children:[e.jsx("span",{className:a("h-1.5 w-1.5 rounded-full",t.dot)}),e.jsx("span",{className:a("text-[11px] font-medium",t.text),children:s})]})}export{m as S};
@@ -1 +1 @@
1
- import{r as e,j as i}from"./vendor-DJt0Azq5.js";import{c as t}from"./index-DS7D1-KS.js";const l=e.forwardRef(({className:o,checked:r=!1,onCheckedChange:s,...a},n)=>i.jsx("button",{type:"button",role:"switch","aria-checked":r,ref:n,className:t("peer inline-flex h-[22px] w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",r?"bg-primary":"bg-gray-200/80 hover:bg-gray-300/80",o),onClick:()=>s==null?void 0:s(!r),...a,children:i.jsx("span",{className:t("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-md ring-0 transition-transform duration-fast",r?"translate-x-5":"translate-x-0")})}));l.displayName="Switch";export{l as S};
1
+ import{r as e,j as i}from"./vendor-CNhxtHCf.js";import{c as t}from"./index-C6MeoecJ.js";const l=e.forwardRef(({className:o,checked:r=!1,onCheckedChange:s,...a},n)=>i.jsx("button",{type:"button",role:"switch","aria-checked":r,ref:n,className:t("peer inline-flex h-[22px] w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",r?"bg-primary":"bg-gray-200/80 hover:bg-gray-300/80",o),onClick:()=>s==null?void 0:s(!r),...a,children:i.jsx("span",{className:t("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-md ring-0 transition-transform duration-fast",r?"translate-x-5":"translate-x-0")})}));l.displayName="Switch";export{l as S};
@@ -0,0 +1 @@
1
+ import{j as e}from"./vendor-CNhxtHCf.js";import{as as m,c as s}from"./index-C6MeoecJ.js";function c({tabs:a,activeTab:i,onChange:o,className:n}){return e.jsx("div",{className:s("flex items-center gap-6 border-b border-gray-200/60 mb-6",n),children:a.map(t=>{const r=i===t.id;return e.jsxs("button",{onClick:()=>o(t.id),className:s("relative pb-3 text-[14px] font-medium transition-all duration-fast flex items-center gap-1.5",r?"text-gray-900":"text-gray-600 hover:text-gray-900"),children:[t.label,t.count!==void 0&&e.jsx("span",{className:s("text-[11px] font-medium","text-gray-500"),children:m(t.count)}),r&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary rounded-full"})]},t.id)})})}export{c as T};
@@ -0,0 +1 @@
1
+ import{j as a,r as t}from"./vendor-CNhxtHCf.js";import{am as p,an as C,ao as h,ap as x,aq as g,ar as D,B as d,t as i}from"./index-C6MeoecJ.js";const j=({open:l,onOpenChange:r,title:c,description:o,confirmLabel:s=i("confirm"),cancelLabel:e=i("cancel"),variant:n="default",onConfirm:u,onCancel:f})=>{const m=()=>{u(),r(!1)},v=()=>{f(),r(!1)};return a.jsx(p,{open:l,onOpenChange:r,children:a.jsxs(C,{className:"[&>:last-child]:hidden",onCloseAutoFocus:b=>b.preventDefault(),children:[a.jsxs(h,{children:[a.jsx(x,{children:c}),o?a.jsx(g,{children:o}):null]}),a.jsxs(D,{className:"gap-2 sm:gap-0",children:[a.jsx(d,{type:"button",variant:"outline",onClick:v,children:e}),a.jsx(d,{type:"button",variant:n==="destructive"?"destructive":"default",onClick:m,children:s})]})]})})},L={open:!1,title:"",description:"",confirmLabel:i("confirm"),cancelLabel:i("cancel"),variant:"default",resolve:null};function y(){const[l,r]=t.useState(L),c=t.useCallback(e=>new Promise(n=>{r({open:!0,title:e.title,description:e.description??"",confirmLabel:e.confirmLabel??i("confirm"),cancelLabel:e.cancelLabel??i("cancel"),variant:e.variant??"default",resolve:u=>{n(u),r(f=>({...f,open:!1,resolve:null}))}})}),[]),o=t.useCallback(e=>{r(n=>(!e&&n.resolve&&n.resolve(!1),{...n,open:e,resolve:e?n.resolve:null}))},[]),s=t.useCallback(()=>a.jsx(j,{open:l.open,onOpenChange:o,title:l.title,description:l.description||void 0,confirmLabel:l.confirmLabel,cancelLabel:l.cancelLabel,variant:l.variant,onConfirm:()=>{var e;return(e=l.resolve)==null?void 0:e.call(l,!0)},onCancel:()=>{var e;return(e=l.resolve)==null?void 0:e.call(l,!1)}}),[l,o]);return{confirm:c,ConfirmDialog:s}}export{y as u};
@@ -448,4 +448,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${r.do
448
448
  * This source code is licensed under the ISC license.
449
449
  * See the LICENSE file in the root directory of this source tree.
450
450
  */const hb=ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var sS=n=>{switch(n){case"success":return uS;case"info":return dS;case"warning":return cS;case"error":return fS;default:return null}},aS=Array(12).fill(0),lS=({visible:n,className:r})=>X.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":n},X.createElement("div",{className:"sonner-spinner"},aS.map((i,s)=>X.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),uS=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),cS=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),dS=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),fS=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),pS=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},X.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),X.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),hS=()=>{let[n,r]=X.useState(document.hidden);return X.useEffect(()=>{let i=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",i),()=>window.removeEventListener("visibilitychange",i)},[]),n},Vc=1,mS=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let r=this.subscribers.indexOf(n);this.subscribers.splice(r,1)}),this.publish=n=>{this.subscribers.forEach(r=>r(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var r;let{message:i,...s}=n,l=typeof(n==null?void 0:n.id)=="number"||((r=n.id)==null?void 0:r.length)>0?n.id:Vc++,c=this.toasts.find(p=>p.id===l),f=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),c?this.toasts=this.toasts.map(p=>p.id===l?(this.publish({...p,...n,id:l,title:i}),{...p,...n,id:l,dismissible:f,title:i}):p):this.addToast({title:i,...s,dismissible:f,id:l}),l},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),this.subscribers.forEach(r=>r({id:n,dismiss:!0})),n),this.message=(n,r)=>this.create({...r,message:n}),this.error=(n,r)=>this.create({...r,message:n,type:"error"}),this.success=(n,r)=>this.create({...r,type:"success",message:n}),this.info=(n,r)=>this.create({...r,type:"info",message:n}),this.warning=(n,r)=>this.create({...r,type:"warning",message:n}),this.loading=(n,r)=>this.create({...r,type:"loading",message:n}),this.promise=(n,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:n,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));let s=n instanceof Promise?n:n(),l=i!==void 0,c,f=s.then(async h=>{if(c=["resolve",h],X.isValidElement(h))l=!1,this.create({id:i,type:"default",message:h});else if(yS(h)&&!h.ok){l=!1;let m=typeof r.error=="function"?await r.error(`HTTP error! status: ${h.status}`):r.error,w=typeof r.description=="function"?await r.description(`HTTP error! status: ${h.status}`):r.description;this.create({id:i,type:"error",message:m,description:w})}else if(r.success!==void 0){l=!1;let m=typeof r.success=="function"?await r.success(h):r.success,w=typeof r.description=="function"?await r.description(h):r.description;this.create({id:i,type:"success",message:m,description:w})}}).catch(async h=>{if(c=["reject",h],r.error!==void 0){l=!1;let m=typeof r.error=="function"?await r.error(h):r.error,w=typeof r.description=="function"?await r.description(h):r.description;this.create({id:i,type:"error",message:m,description:w})}}).finally(()=>{var h;l&&(this.dismiss(i),i=void 0),(h=r.finally)==null||h.call(r)}),p=()=>new Promise((h,m)=>f.then(()=>c[0]==="reject"?m(c[1]):h(c[1])).catch(m));return typeof i!="string"&&typeof i!="number"?{unwrap:p}:Object.assign(i,{unwrap:p})},this.custom=(n,r)=>{let i=(r==null?void 0:r.id)||Vc++;return this.create({jsx:n(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},At=new mS,vS=(n,r)=>{let i=(r==null?void 0:r.id)||Vc++;return At.addToast({title:n,...r,id:i}),i},yS=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",gS=vS,wS=()=>At.toasts,xS=()=>At.getActiveToasts(),mb=Object.assign(gS,{success:At.success,info:At.info,warning:At.warning,error:At.error,custom:At.custom,message:At.message,promise:At.promise,dismiss:At.dismiss,loading:At.loading},{getHistory:wS,getToasts:xS});function SS(n,{insertAt:r}={}){if(typeof document>"u")return;let i=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",r==="top"&&i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s),s.styleSheet?s.styleSheet.cssText=n:s.appendChild(document.createTextNode(n))}SS(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
451
- `);function qa(n){return n.label!==void 0}var CS=3,kS="32px",ES="16px",Jh=4e3,bS=356,RS=14,PS=20,MS=200;function un(...n){return n.filter(Boolean).join(" ")}function TS(n){let[r,i]=n.split("-"),s=[];return r&&s.push(r),i&&s.push(i),s}var OS=n=>{var r,i,s,l,c,f,p,h,m,w,x;let{invert:k,toast:g,unstyled:O,interacting:S,setHeights:C,visibleToasts:P,heights:T,index:R,toasts:L,expanded:z,removeToast:U,defaultRichColors:H,closeButton:G,style:J,cancelButtonStyle:te,actionButtonStyle:he,className:Z="",descriptionClassName:ye="",duration:de,position:xe,gap:ue,loadingIcon:se,expandByDefault:j,classNames:B,icons:Q,closeButtonAriaLabel:N="Close toast",pauseWhenPageIsHidden:F}=n,[ne,re]=X.useState(null),[ve,Se]=X.useState(null),[q,pe]=X.useState(!1),[Ce,be]=X.useState(!1),[Me,Oe]=X.useState(!1),[Ye,dt]=X.useState(!1),[gn,Xt]=X.useState(!1),[Zt,ir]=X.useState(0),[wn,sr]=X.useState(0),Ht=X.useRef(g.duration||de||Jh),Eo=X.useRef(null),xn=X.useRef(null),Rs=R===0,Ps=R+1<=P,gt=g.type,Sn=g.dismissible!==!1,bo=g.className||"",Ms=g.descriptionClassName||"",Cn=X.useMemo(()=>T.findIndex(Ee=>Ee.toastId===g.id)||0,[T,g.id]),Qr=X.useMemo(()=>{var Ee;return(Ee=g.closeButton)!=null?Ee:G},[g.closeButton,G]),Ts=X.useMemo(()=>g.duration||de||Jh,[g.duration,de]),Ro=X.useRef(0),jn=X.useRef(0),Os=X.useRef(0),kn=X.useRef(null),[bi,Ri]=xe.split("-"),Po=X.useMemo(()=>T.reduce((Ee,Ae,Fe)=>Fe>=Cn?Ee:Ee+Ae.height,0),[T,Cn]),Mo=hS(),ar=g.invert||k,En=gt==="loading";jn.current=X.useMemo(()=>Cn*ue+Po,[Cn,Po]),X.useEffect(()=>{Ht.current=Ts},[Ts]),X.useEffect(()=>{pe(!0)},[]),X.useEffect(()=>{let Ee=xn.current;if(Ee){let Ae=Ee.getBoundingClientRect().height;return sr(Ae),C(Fe=>[{toastId:g.id,height:Ae,position:g.position},...Fe]),()=>C(Fe=>Fe.filter(wt=>wt.toastId!==g.id))}},[C,g.id]),X.useLayoutEffect(()=>{if(!q)return;let Ee=xn.current,Ae=Ee.style.height;Ee.style.height="auto";let Fe=Ee.getBoundingClientRect().height;Ee.style.height=Ae,sr(Fe),C(wt=>wt.find(Et=>Et.toastId===g.id)?wt.map(Et=>Et.toastId===g.id?{...Et,height:Fe}:Et):[{toastId:g.id,height:Fe,position:g.position},...wt])},[q,g.title,g.description,C,g.id]);let Jt=X.useCallback(()=>{be(!0),ir(jn.current),C(Ee=>Ee.filter(Ae=>Ae.toastId!==g.id)),setTimeout(()=>{U(g)},MS)},[g,U,C,jn]);X.useEffect(()=>{if(g.promise&&gt==="loading"||g.duration===1/0||g.type==="loading")return;let Ee;return z||S||F&&Mo?(()=>{if(Os.current<Ro.current){let Ae=new Date().getTime()-Ro.current;Ht.current=Ht.current-Ae}Os.current=new Date().getTime()})():Ht.current!==1/0&&(Ro.current=new Date().getTime(),Ee=setTimeout(()=>{var Ae;(Ae=g.onAutoClose)==null||Ae.call(g,g),Jt()},Ht.current)),()=>clearTimeout(Ee)},[z,S,g,gt,F,Mo,Jt]),X.useEffect(()=>{g.delete&&Jt()},[Jt,g.delete]);function Ns(){var Ee,Ae,Fe;return Q!=null&&Q.loading?X.createElement("div",{className:un(B==null?void 0:B.loader,(Ee=g==null?void 0:g.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":gt==="loading"},Q.loading):se?X.createElement("div",{className:un(B==null?void 0:B.loader,(Ae=g==null?void 0:g.classNames)==null?void 0:Ae.loader,"sonner-loader"),"data-visible":gt==="loading"},se):X.createElement(lS,{className:un(B==null?void 0:B.loader,(Fe=g==null?void 0:g.classNames)==null?void 0:Fe.loader),visible:gt==="loading"})}return X.createElement("li",{tabIndex:0,ref:xn,className:un(Z,bo,B==null?void 0:B.toast,(r=g==null?void 0:g.classNames)==null?void 0:r.toast,B==null?void 0:B.default,B==null?void 0:B[gt],(i=g==null?void 0:g.classNames)==null?void 0:i[gt]),"data-sonner-toast":"","data-rich-colors":(s=g.richColors)!=null?s:H,"data-styled":!(g.jsx||g.unstyled||O),"data-mounted":q,"data-promise":!!g.promise,"data-swiped":gn,"data-removed":Ce,"data-visible":Ps,"data-y-position":bi,"data-x-position":Ri,"data-index":R,"data-front":Rs,"data-swiping":Me,"data-dismissible":Sn,"data-type":gt,"data-invert":ar,"data-swipe-out":Ye,"data-swipe-direction":ve,"data-expanded":!!(z||j&&q),style:{"--index":R,"--toasts-before":R,"--z-index":L.length-R,"--offset":`${Ce?Zt:jn.current}px`,"--initial-height":j?"auto":`${wn}px`,...J,...g.style},onDragEnd:()=>{Oe(!1),re(null),kn.current=null},onPointerDown:Ee=>{En||!Sn||(Eo.current=new Date,ir(jn.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(Oe(!0),kn.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,Ae,Fe,wt;if(Ye||!Sn)return;kn.current=null;let Et=Number(((Ee=xn.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),bt=Number(((Ae=xn.current)==null?void 0:Ae.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),en=new Date().getTime()-((Fe=Eo.current)==null?void 0:Fe.getTime()),lt=ne==="x"?Et:bt,bn=Math.abs(lt)/en;if(Math.abs(lt)>=PS||bn>.11){ir(jn.current),(wt=g.onDismiss)==null||wt.call(g,g),Se(ne==="x"?Et>0?"right":"left":bt>0?"down":"up"),Jt(),dt(!0),Xt(!1);return}Oe(!1),re(null)},onPointerMove:Ee=>{var Ae,Fe,wt,Et;if(!kn.current||!Sn||((Ae=window.getSelection())==null?void 0:Ae.toString().length)>0)return;let bt=Ee.clientY-kn.current.y,en=Ee.clientX-kn.current.x,lt=(Fe=n.swipeDirections)!=null?Fe:TS(xe);!ne&&(Math.abs(en)>1||Math.abs(bt)>1)&&re(Math.abs(en)>Math.abs(bt)?"x":"y");let bn={x:0,y:0};ne==="y"?(lt.includes("top")||lt.includes("bottom"))&&(lt.includes("top")&&bt<0||lt.includes("bottom")&&bt>0)&&(bn.y=bt):ne==="x"&&(lt.includes("left")||lt.includes("right"))&&(lt.includes("left")&&en<0||lt.includes("right")&&en>0)&&(bn.x=en),(Math.abs(bn.x)>0||Math.abs(bn.y)>0)&&Xt(!0),(wt=xn.current)==null||wt.style.setProperty("--swipe-amount-x",`${bn.x}px`),(Et=xn.current)==null||Et.style.setProperty("--swipe-amount-y",`${bn.y}px`)}},Qr&&!g.jsx?X.createElement("button",{"aria-label":N,"data-disabled":En,"data-close-button":!0,onClick:En||!Sn?()=>{}:()=>{var Ee;Jt(),(Ee=g.onDismiss)==null||Ee.call(g,g)},className:un(B==null?void 0:B.closeButton,(l=g==null?void 0:g.classNames)==null?void 0:l.closeButton)},(c=Q==null?void 0:Q.close)!=null?c:pS):null,g.jsx||y.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:X.createElement(X.Fragment,null,gt||g.icon||g.promise?X.createElement("div",{"data-icon":"",className:un(B==null?void 0:B.icon,(f=g==null?void 0:g.classNames)==null?void 0:f.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Ns():null,g.type!=="loading"?g.icon||(Q==null?void 0:Q[gt])||sS(gt):null):null,X.createElement("div",{"data-content":"",className:un(B==null?void 0:B.content,(p=g==null?void 0:g.classNames)==null?void 0:p.content)},X.createElement("div",{"data-title":"",className:un(B==null?void 0:B.title,(h=g==null?void 0:g.classNames)==null?void 0:h.title)},typeof g.title=="function"?g.title():g.title),g.description?X.createElement("div",{"data-description":"",className:un(ye,Ms,B==null?void 0:B.description,(m=g==null?void 0:g.classNames)==null?void 0:m.description)},typeof g.description=="function"?g.description():g.description):null),y.isValidElement(g.cancel)?g.cancel:g.cancel&&qa(g.cancel)?X.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||te,onClick:Ee=>{var Ae,Fe;qa(g.cancel)&&Sn&&((Fe=(Ae=g.cancel).onClick)==null||Fe.call(Ae,Ee),Jt())},className:un(B==null?void 0:B.cancelButton,(w=g==null?void 0:g.classNames)==null?void 0:w.cancelButton)},g.cancel.label):null,y.isValidElement(g.action)?g.action:g.action&&qa(g.action)?X.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||he,onClick:Ee=>{var Ae,Fe;qa(g.action)&&((Fe=(Ae=g.action).onClick)==null||Fe.call(Ae,Ee),!Ee.defaultPrevented&&Jt())},className:un(B==null?void 0:B.actionButton,(x=g==null?void 0:g.classNames)==null?void 0:x.actionButton)},g.action.label):null))};function em(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function NS(n,r){let i={};return[n,r].forEach((s,l)=>{let c=l===1,f=c?"--mobile-offset":"--offset",p=c?ES:kS;function h(m){["top","right","bottom","left"].forEach(w=>{i[`${f}-${w}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?h(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?i[`${f}-${m}`]=p:i[`${f}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):h(p)}),i}var vb=y.forwardRef(function(n,r){let{invert:i,position:s="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:p,offset:h,mobileOffset:m,theme:w="light",richColors:x,duration:k,style:g,visibleToasts:O=CS,toastOptions:S,dir:C=em(),gap:P=RS,loadingIcon:T,icons:R,containerAriaLabel:L="Notifications",pauseWhenPageIsHidden:z}=n,[U,H]=X.useState([]),G=X.useMemo(()=>Array.from(new Set([s].concat(U.filter(F=>F.position).map(F=>F.position)))),[U,s]),[J,te]=X.useState([]),[he,Z]=X.useState(!1),[ye,de]=X.useState(!1),[xe,ue]=X.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),se=X.useRef(null),j=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=X.useRef(null),Q=X.useRef(!1),N=X.useCallback(F=>{H(ne=>{var re;return(re=ne.find(ve=>ve.id===F.id))!=null&&re.delete||At.dismiss(F.id),ne.filter(({id:ve})=>ve!==F.id)})},[]);return X.useEffect(()=>At.subscribe(F=>{if(F.dismiss){H(ne=>ne.map(re=>re.id===F.id?{...re,delete:!0}:re));return}setTimeout(()=>{qm.flushSync(()=>{H(ne=>{let re=ne.findIndex(ve=>ve.id===F.id);return re!==-1?[...ne.slice(0,re),{...ne[re],...F},...ne.slice(re+1)]:[F,...ne]})})})}),[]),X.useEffect(()=>{if(w!=="system"){ue(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ue("dark"):ue("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:ne})=>{ue(ne?"dark":"light")})}catch{F.addListener(({matches:re})=>{try{ue(re?"dark":"light")}catch(ve){console.error(ve)}})}},[w]),X.useEffect(()=>{U.length<=1&&Z(!1)},[U]),X.useEffect(()=>{let F=ne=>{var re,ve;l.every(Se=>ne[Se]||ne.code===Se)&&(Z(!0),(re=se.current)==null||re.focus()),ne.code==="Escape"&&(document.activeElement===se.current||(ve=se.current)!=null&&ve.contains(document.activeElement))&&Z(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[l]),X.useEffect(()=>{if(se.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,Q.current=!1)}},[se.current]),X.createElement("section",{ref:r,"aria-label":`${L} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},G.map((F,ne)=>{var re;let[ve,Se]=F.split("-");return U.length?X.createElement("ol",{key:F,dir:C==="auto"?em():C,tabIndex:-1,ref:se,className:p,"data-sonner-toaster":!0,"data-theme":xe,"data-y-position":ve,"data-lifted":he&&U.length>1&&!c,"data-x-position":Se,style:{"--front-toast-height":`${((re=J[0])==null?void 0:re.height)||0}px`,"--width":`${bS}px`,"--gap":`${P}px`,...g,...NS(h,m)},onBlur:q=>{Q.current&&!q.currentTarget.contains(q.relatedTarget)&&(Q.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,B.current=q.relatedTarget)},onMouseEnter:()=>Z(!0),onMouseMove:()=>Z(!0),onMouseLeave:()=>{ye||Z(!1)},onDragEnd:()=>Z(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||de(!0)},onPointerUp:()=>de(!1)},U.filter(q=>!q.position&&ne===0||q.position===F).map((q,pe)=>{var Ce,be;return X.createElement(OS,{key:q.id,icons:R,index:pe,toast:q,defaultRichColors:x,duration:(Ce=S==null?void 0:S.duration)!=null?Ce:k,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:i,visibleToasts:O,closeButton:(be=S==null?void 0:S.closeButton)!=null?be:f,interacting:ye,position:F,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,removeToast:N,toasts:U.filter(Me=>Me.position==q.position),heights:J.filter(Me=>Me.position==q.position),setHeights:te,expandByDefault:c,gap:P,loadingIcon:T,expanded:he,pauseWhenPageIsHidden:z,swipeDirections:n.swipeDirections})})):null}))});const tm=n=>{let r;const i=new Set,s=(m,w)=>{const x=typeof m=="function"?m(r):m;if(!Object.is(x,r)){const k=r;r=w??(typeof x!="object"||x===null)?x:Object.assign({},r,x),i.forEach(g=>g(r,k))}},l=()=>r,p={setState:s,getState:l,getInitialState:()=>h,subscribe:m=>(i.add(m),()=>i.delete(m))},h=r=n(s,l,p);return p},_S=(n=>n?tm(n):tm),LS=n=>n;function AS(n,r=LS){const i=X.useSyncExternalStore(n.subscribe,X.useCallback(()=>r(n.getState()),[n,r]),X.useCallback(()=>r(n.getInitialState()),[n,r]));return X.useDebugValue(i),i}const nm=n=>{const r=_S(n),i=s=>AS(r,s);return Object.assign(i,r),i},yb=(n=>n?nm(n):nm);function rm(n,[r,i]){return Math.min(i,Math.max(r,n))}function IS(n){const r=n+"CollectionProvider",[i,s]=pl(r),[l,c]=i(r,{collectionRef:{current:null},itemMap:new Map}),f=S=>{const{scope:C,children:P}=S,T=X.useRef(null),R=X.useRef(new Map).current;return V.jsx(l,{scope:C,itemMap:R,collectionRef:T,children:P})};f.displayName=r;const p=n+"CollectionSlot",h=ms(p),m=X.forwardRef((S,C)=>{const{scope:P,children:T}=S,R=c(p,P),L=Je(C,R.collectionRef);return V.jsx(h,{ref:L,children:T})});m.displayName=p;const w=n+"CollectionItemSlot",x="data-radix-collection-item",k=ms(w),g=X.forwardRef((S,C)=>{const{scope:P,children:T,...R}=S,L=X.useRef(null),z=Je(C,L),U=c(w,P);return X.useEffect(()=>(U.itemMap.set(L,{ref:L,...R}),()=>void U.itemMap.delete(L))),V.jsx(k,{[x]:"",ref:z,children:T})});g.displayName=w;function O(S){const C=c(n+"CollectionConsumer",S);return X.useCallback(()=>{const T=C.collectionRef.current;if(!T)return[];const R=Array.from(T.querySelectorAll(`[${x}]`));return Array.from(C.itemMap.values()).sort((U,H)=>R.indexOf(U.ref.current)-R.indexOf(H.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:f,Slot:m,ItemSlot:g},O,s]}var DS=y.createContext(void 0);function FS(n){const r=y.useContext(DS);return n||r||"ltr"}const zS=["top","right","bottom","left"],Ur=Math.min,jt=Math.max,sl=Math.round,Ga=Math.floor,Dn=n=>({x:n,y:n}),jS={left:"right",right:"left",bottom:"top",top:"bottom"},BS={start:"end",end:"start"};function Qc(n,r,i){return jt(n,Ur(r,i))}function rr(n,r){return typeof n=="function"?n(r):n}function or(n){return n.split("-")[0]}function Ci(n){return n.split("-")[1]}function Cd(n){return n==="x"?"y":"x"}function kd(n){return n==="y"?"height":"width"}const US=new Set(["top","bottom"]);function In(n){return US.has(or(n))?"y":"x"}function Ed(n){return Cd(In(n))}function HS(n,r,i){i===void 0&&(i=!1);const s=Ci(n),l=Ed(n),c=kd(l);let f=l==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return r.reference[c]>r.floating[c]&&(f=al(f)),[f,al(f)]}function $S(n){const r=al(n);return[Kc(n),r,Kc(r)]}function Kc(n){return n.replace(/start|end/g,r=>BS[r])}const om=["left","right"],im=["right","left"],WS=["top","bottom"],VS=["bottom","top"];function QS(n,r,i){switch(n){case"top":case"bottom":return i?r?im:om:r?om:im;case"left":case"right":return r?WS:VS;default:return[]}}function KS(n,r,i,s){const l=Ci(n);let c=QS(or(n),i==="start",s);return l&&(c=c.map(f=>f+"-"+l),r&&(c=c.concat(c.map(Kc)))),c}function al(n){return n.replace(/left|right|bottom|top/g,r=>jS[r])}function qS(n){return{top:0,right:0,bottom:0,left:0,...n}}function Wv(n){return typeof n!="number"?qS(n):{top:n,right:n,bottom:n,left:n}}function ll(n){const{x:r,y:i,width:s,height:l}=n;return{width:s,height:l,top:i,left:r,right:r+s,bottom:i+l,x:r,y:i}}function sm(n,r,i){let{reference:s,floating:l}=n;const c=In(r),f=Ed(r),p=kd(f),h=or(r),m=c==="y",w=s.x+s.width/2-l.width/2,x=s.y+s.height/2-l.height/2,k=s[p]/2-l[p]/2;let g;switch(h){case"top":g={x:w,y:s.y-l.height};break;case"bottom":g={x:w,y:s.y+s.height};break;case"right":g={x:s.x+s.width,y:x};break;case"left":g={x:s.x-l.width,y:x};break;default:g={x:s.x,y:s.y}}switch(Ci(r)){case"start":g[f]-=k*(i&&m?-1:1);break;case"end":g[f]+=k*(i&&m?-1:1);break}return g}async function GS(n,r){var i;r===void 0&&(r={});const{x:s,y:l,platform:c,rects:f,elements:p,strategy:h}=n,{boundary:m="clippingAncestors",rootBoundary:w="viewport",elementContext:x="floating",altBoundary:k=!1,padding:g=0}=rr(r,n),O=Wv(g),C=p[k?x==="floating"?"reference":"floating":x],P=ll(await c.getClippingRect({element:(i=await(c.isElement==null?void 0:c.isElement(C)))==null||i?C:C.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(p.floating)),boundary:m,rootBoundary:w,strategy:h})),T=x==="floating"?{x:s,y:l,width:f.floating.width,height:f.floating.height}:f.reference,R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p.floating)),L=await(c.isElement==null?void 0:c.isElement(R))?await(c.getScale==null?void 0:c.getScale(R))||{x:1,y:1}:{x:1,y:1},z=ll(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:T,offsetParent:R,strategy:h}):T);return{top:(P.top-z.top+O.top)/L.y,bottom:(z.bottom-P.bottom+O.bottom)/L.y,left:(P.left-z.left+O.left)/L.x,right:(z.right-P.right+O.right)/L.x}}const YS=async(n,r,i)=>{const{placement:s="bottom",strategy:l="absolute",middleware:c=[],platform:f}=i,p=c.filter(Boolean),h=await(f.isRTL==null?void 0:f.isRTL(r));let m=await f.getElementRects({reference:n,floating:r,strategy:l}),{x:w,y:x}=sm(m,s,h),k=s,g={},O=0;for(let C=0;C<p.length;C++){var S;const{name:P,fn:T}=p[C],{x:R,y:L,data:z,reset:U}=await T({x:w,y:x,initialPlacement:s,placement:k,strategy:l,middlewareData:g,rects:m,platform:{...f,detectOverflow:(S=f.detectOverflow)!=null?S:GS},elements:{reference:n,floating:r}});w=R??w,x=L??x,g={...g,[P]:{...g[P],...z}},U&&O<=50&&(O++,typeof U=="object"&&(U.placement&&(k=U.placement),U.rects&&(m=U.rects===!0?await f.getElementRects({reference:n,floating:r,strategy:l}):U.rects),{x:w,y:x}=sm(m,k,h)),C=-1)}return{x:w,y:x,placement:k,strategy:l,middlewareData:g}},XS=n=>({name:"arrow",options:n,async fn(r){const{x:i,y:s,placement:l,rects:c,platform:f,elements:p,middlewareData:h}=r,{element:m,padding:w=0}=rr(n,r)||{};if(m==null)return{};const x=Wv(w),k={x:i,y:s},g=Ed(l),O=kd(g),S=await f.getDimensions(m),C=g==="y",P=C?"top":"left",T=C?"bottom":"right",R=C?"clientHeight":"clientWidth",L=c.reference[O]+c.reference[g]-k[g]-c.floating[O],z=k[g]-c.reference[g],U=await(f.getOffsetParent==null?void 0:f.getOffsetParent(m));let H=U?U[R]:0;(!H||!await(f.isElement==null?void 0:f.isElement(U)))&&(H=p.floating[R]||c.floating[O]);const G=L/2-z/2,J=H/2-S[O]/2-1,te=Ur(x[P],J),he=Ur(x[T],J),Z=te,ye=H-S[O]-he,de=H/2-S[O]/2+G,xe=Qc(Z,de,ye),ue=!h.arrow&&Ci(l)!=null&&de!==xe&&c.reference[O]/2-(de<Z?te:he)-S[O]/2<0,se=ue?de<Z?de-Z:de-ye:0;return{[g]:k[g]+se,data:{[g]:xe,centerOffset:de-xe-se,...ue&&{alignmentOffset:se}},reset:ue}}}),ZS=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(r){var i,s;const{placement:l,middlewareData:c,rects:f,initialPlacement:p,platform:h,elements:m}=r,{mainAxis:w=!0,crossAxis:x=!0,fallbackPlacements:k,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:S=!0,...C}=rr(n,r);if((i=c.arrow)!=null&&i.alignmentOffset)return{};const P=or(l),T=In(p),R=or(p)===p,L=await(h.isRTL==null?void 0:h.isRTL(m.floating)),z=k||(R||!S?[al(p)]:$S(p)),U=O!=="none";!k&&U&&z.push(...KS(p,S,O,L));const H=[p,...z],G=await h.detectOverflow(r,C),J=[];let te=((s=c.flip)==null?void 0:s.overflows)||[];if(w&&J.push(G[P]),x){const de=HS(l,f,L);J.push(G[de[0]],G[de[1]])}if(te=[...te,{placement:l,overflows:J}],!J.every(de=>de<=0)){var he,Z;const de=(((he=c.flip)==null?void 0:he.index)||0)+1,xe=H[de];if(xe&&(!(x==="alignment"?T!==In(xe):!1)||te.every(j=>In(j.placement)===T?j.overflows[0]>0:!0)))return{data:{index:de,overflows:te},reset:{placement:xe}};let ue=(Z=te.filter(se=>se.overflows[0]<=0).sort((se,j)=>se.overflows[1]-j.overflows[1])[0])==null?void 0:Z.placement;if(!ue)switch(g){case"bestFit":{var ye;const se=(ye=te.filter(j=>{if(U){const B=In(j.placement);return B===T||B==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(B=>B>0).reduce((B,Q)=>B+Q,0)]).sort((j,B)=>j[1]-B[1])[0])==null?void 0:ye[0];se&&(ue=se);break}case"initialPlacement":ue=p;break}if(l!==ue)return{reset:{placement:ue}}}return{}}}};function am(n,r){return{top:n.top-r.height,right:n.right-r.width,bottom:n.bottom-r.height,left:n.left-r.width}}function lm(n){return zS.some(r=>n[r]>=0)}const JS=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(r){const{rects:i,platform:s}=r,{strategy:l="referenceHidden",...c}=rr(n,r);switch(l){case"referenceHidden":{const f=await s.detectOverflow(r,{...c,elementContext:"reference"}),p=am(f,i.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:lm(p)}}}case"escaped":{const f=await s.detectOverflow(r,{...c,altBoundary:!0}),p=am(f,i.floating);return{data:{escapedOffsets:p,escaped:lm(p)}}}default:return{}}}}},Vv=new Set(["left","top"]);async function eC(n,r){const{placement:i,platform:s,elements:l}=n,c=await(s.isRTL==null?void 0:s.isRTL(l.floating)),f=or(i),p=Ci(i),h=In(i)==="y",m=Vv.has(f)?-1:1,w=c&&h?-1:1,x=rr(r,n);let{mainAxis:k,crossAxis:g,alignmentAxis:O}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return p&&typeof O=="number"&&(g=p==="end"?O*-1:O),h?{x:g*w,y:k*m}:{x:k*m,y:g*w}}const tC=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var i,s;const{x:l,y:c,placement:f,middlewareData:p}=r,h=await eC(r,n);return f===((i=p.offset)==null?void 0:i.placement)&&(s=p.arrow)!=null&&s.alignmentOffset?{}:{x:l+h.x,y:c+h.y,data:{...h,placement:f}}}}},nC=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(r){const{x:i,y:s,placement:l,platform:c}=r,{mainAxis:f=!0,crossAxis:p=!1,limiter:h={fn:P=>{let{x:T,y:R}=P;return{x:T,y:R}}},...m}=rr(n,r),w={x:i,y:s},x=await c.detectOverflow(r,m),k=In(or(l)),g=Cd(k);let O=w[g],S=w[k];if(f){const P=g==="y"?"top":"left",T=g==="y"?"bottom":"right",R=O+x[P],L=O-x[T];O=Qc(R,O,L)}if(p){const P=k==="y"?"top":"left",T=k==="y"?"bottom":"right",R=S+x[P],L=S-x[T];S=Qc(R,S,L)}const C=h.fn({...r,[g]:O,[k]:S});return{...C,data:{x:C.x-i,y:C.y-s,enabled:{[g]:f,[k]:p}}}}}},rC=function(n){return n===void 0&&(n={}),{options:n,fn(r){const{x:i,y:s,placement:l,rects:c,middlewareData:f}=r,{offset:p=0,mainAxis:h=!0,crossAxis:m=!0}=rr(n,r),w={x:i,y:s},x=In(l),k=Cd(x);let g=w[k],O=w[x];const S=rr(p,r),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const R=k==="y"?"height":"width",L=c.reference[k]-c.floating[R]+C.mainAxis,z=c.reference[k]+c.reference[R]-C.mainAxis;g<L?g=L:g>z&&(g=z)}if(m){var P,T;const R=k==="y"?"width":"height",L=Vv.has(or(l)),z=c.reference[x]-c.floating[R]+(L&&((P=f.offset)==null?void 0:P[x])||0)+(L?0:C.crossAxis),U=c.reference[x]+c.reference[R]+(L?0:((T=f.offset)==null?void 0:T[x])||0)-(L?C.crossAxis:0);O<z?O=z:O>U&&(O=U)}return{[k]:g,[x]:O}}}},oC=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(r){var i,s;const{placement:l,rects:c,platform:f,elements:p}=r,{apply:h=()=>{},...m}=rr(n,r),w=await f.detectOverflow(r,m),x=or(l),k=Ci(l),g=In(l)==="y",{width:O,height:S}=c.floating;let C,P;x==="top"||x==="bottom"?(C=x,P=k===(await(f.isRTL==null?void 0:f.isRTL(p.floating))?"start":"end")?"left":"right"):(P=x,C=k==="end"?"top":"bottom");const T=S-w.top-w.bottom,R=O-w.left-w.right,L=Ur(S-w[C],T),z=Ur(O-w[P],R),U=!r.middlewareData.shift;let H=L,G=z;if((i=r.middlewareData.shift)!=null&&i.enabled.x&&(G=R),(s=r.middlewareData.shift)!=null&&s.enabled.y&&(H=T),U&&!k){const te=jt(w.left,0),he=jt(w.right,0),Z=jt(w.top,0),ye=jt(w.bottom,0);g?G=O-2*(te!==0||he!==0?te+he:jt(w.left,w.right)):H=S-2*(Z!==0||ye!==0?Z+ye:jt(w.top,w.bottom))}await h({...r,availableWidth:G,availableHeight:H});const J=await f.getDimensions(p.floating);return O!==J.width||S!==J.height?{reset:{rects:!0}}:{}}}};function yl(){return typeof window<"u"}function ki(n){return Qv(n)?(n.nodeName||"").toLowerCase():"#document"}function Bt(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function zn(n){var r;return(r=(Qv(n)?n.ownerDocument:n.document)||window.document)==null?void 0:r.documentElement}function Qv(n){return yl()?n instanceof Node||n instanceof Bt(n).Node:!1}function hn(n){return yl()?n instanceof Element||n instanceof Bt(n).Element:!1}function Fn(n){return yl()?n instanceof HTMLElement||n instanceof Bt(n).HTMLElement:!1}function um(n){return!yl()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Bt(n).ShadowRoot}const iC=new Set(["inline","contents"]);function bs(n){const{overflow:r,overflowX:i,overflowY:s,display:l}=mn(n);return/auto|scroll|overlay|hidden|clip/.test(r+s+i)&&!iC.has(l)}const sC=new Set(["table","td","th"]);function aC(n){return sC.has(ki(n))}const lC=[":popover-open",":modal"];function gl(n){return lC.some(r=>{try{return n.matches(r)}catch{return!1}})}const uC=["transform","translate","scale","rotate","perspective"],cC=["transform","translate","scale","rotate","perspective","filter"],dC=["paint","layout","strict","content"];function bd(n){const r=Rd(),i=hn(n)?mn(n):n;return uC.some(s=>i[s]?i[s]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!r&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!r&&(i.filter?i.filter!=="none":!1)||cC.some(s=>(i.willChange||"").includes(s))||dC.some(s=>(i.contain||"").includes(s))}function fC(n){let r=Hr(n);for(;Fn(r)&&!vi(r);){if(bd(r))return r;if(gl(r))return null;r=Hr(r)}return null}function Rd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const pC=new Set(["html","body","#document"]);function vi(n){return pC.has(ki(n))}function mn(n){return Bt(n).getComputedStyle(n)}function wl(n){return hn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Hr(n){if(ki(n)==="html")return n;const r=n.assignedSlot||n.parentNode||um(n)&&n.host||zn(n);return um(r)?r.host:r}function Kv(n){const r=Hr(n);return vi(r)?n.ownerDocument?n.ownerDocument.body:n.body:Fn(r)&&bs(r)?r:Kv(r)}function vs(n,r,i){var s;r===void 0&&(r=[]),i===void 0&&(i=!0);const l=Kv(n),c=l===((s=n.ownerDocument)==null?void 0:s.body),f=Bt(l);if(c){const p=qc(f);return r.concat(f,f.visualViewport||[],bs(l)?l:[],p&&i?vs(p):[])}return r.concat(l,vs(l,[],i))}function qc(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function qv(n){const r=mn(n);let i=parseFloat(r.width)||0,s=parseFloat(r.height)||0;const l=Fn(n),c=l?n.offsetWidth:i,f=l?n.offsetHeight:s,p=sl(i)!==c||sl(s)!==f;return p&&(i=c,s=f),{width:i,height:s,$:p}}function Pd(n){return hn(n)?n:n.contextElement}function ri(n){const r=Pd(n);if(!Fn(r))return Dn(1);const i=r.getBoundingClientRect(),{width:s,height:l,$:c}=qv(r);let f=(c?sl(i.width):i.width)/s,p=(c?sl(i.height):i.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const hC=Dn(0);function Gv(n){const r=Bt(n);return!Rd()||!r.visualViewport?hC:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function mC(n,r,i){return r===void 0&&(r=!1),!i||r&&i!==Bt(n)?!1:r}function So(n,r,i,s){r===void 0&&(r=!1),i===void 0&&(i=!1);const l=n.getBoundingClientRect(),c=Pd(n);let f=Dn(1);r&&(s?hn(s)&&(f=ri(s)):f=ri(n));const p=mC(c,i,s)?Gv(c):Dn(0);let h=(l.left+p.x)/f.x,m=(l.top+p.y)/f.y,w=l.width/f.x,x=l.height/f.y;if(c){const k=Bt(c),g=s&&hn(s)?Bt(s):s;let O=k,S=qc(O);for(;S&&s&&g!==O;){const C=ri(S),P=S.getBoundingClientRect(),T=mn(S),R=P.left+(S.clientLeft+parseFloat(T.paddingLeft))*C.x,L=P.top+(S.clientTop+parseFloat(T.paddingTop))*C.y;h*=C.x,m*=C.y,w*=C.x,x*=C.y,h+=R,m+=L,O=Bt(S),S=qc(O)}}return ll({width:w,height:x,x:h,y:m})}function xl(n,r){const i=wl(n).scrollLeft;return r?r.left+i:So(zn(n)).left+i}function Yv(n,r){const i=n.getBoundingClientRect(),s=i.left+r.scrollLeft-xl(n,i),l=i.top+r.scrollTop;return{x:s,y:l}}function vC(n){let{elements:r,rect:i,offsetParent:s,strategy:l}=n;const c=l==="fixed",f=zn(s),p=r?gl(r.floating):!1;if(s===f||p&&c)return i;let h={scrollLeft:0,scrollTop:0},m=Dn(1);const w=Dn(0),x=Fn(s);if((x||!x&&!c)&&((ki(s)!=="body"||bs(f))&&(h=wl(s)),Fn(s))){const g=So(s);m=ri(s),w.x=g.x+s.clientLeft,w.y=g.y+s.clientTop}const k=f&&!x&&!c?Yv(f,h):Dn(0);return{width:i.width*m.x,height:i.height*m.y,x:i.x*m.x-h.scrollLeft*m.x+w.x+k.x,y:i.y*m.y-h.scrollTop*m.y+w.y+k.y}}function yC(n){return Array.from(n.getClientRects())}function gC(n){const r=zn(n),i=wl(n),s=n.ownerDocument.body,l=jt(r.scrollWidth,r.clientWidth,s.scrollWidth,s.clientWidth),c=jt(r.scrollHeight,r.clientHeight,s.scrollHeight,s.clientHeight);let f=-i.scrollLeft+xl(n);const p=-i.scrollTop;return mn(s).direction==="rtl"&&(f+=jt(r.clientWidth,s.clientWidth)-l),{width:l,height:c,x:f,y:p}}const cm=25;function wC(n,r){const i=Bt(n),s=zn(n),l=i.visualViewport;let c=s.clientWidth,f=s.clientHeight,p=0,h=0;if(l){c=l.width,f=l.height;const w=Rd();(!w||w&&r==="fixed")&&(p=l.offsetLeft,h=l.offsetTop)}const m=xl(s);if(m<=0){const w=s.ownerDocument,x=w.body,k=getComputedStyle(x),g=w.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,O=Math.abs(s.clientWidth-x.clientWidth-g);O<=cm&&(c-=O)}else m<=cm&&(c+=m);return{width:c,height:f,x:p,y:h}}const xC=new Set(["absolute","fixed"]);function SC(n,r){const i=So(n,!0,r==="fixed"),s=i.top+n.clientTop,l=i.left+n.clientLeft,c=Fn(n)?ri(n):Dn(1),f=n.clientWidth*c.x,p=n.clientHeight*c.y,h=l*c.x,m=s*c.y;return{width:f,height:p,x:h,y:m}}function dm(n,r,i){let s;if(r==="viewport")s=wC(n,i);else if(r==="document")s=gC(zn(n));else if(hn(r))s=SC(r,i);else{const l=Gv(n);s={x:r.x-l.x,y:r.y-l.y,width:r.width,height:r.height}}return ll(s)}function Xv(n,r){const i=Hr(n);return i===r||!hn(i)||vi(i)?!1:mn(i).position==="fixed"||Xv(i,r)}function CC(n,r){const i=r.get(n);if(i)return i;let s=vs(n,[],!1).filter(p=>hn(p)&&ki(p)!=="body"),l=null;const c=mn(n).position==="fixed";let f=c?Hr(n):n;for(;hn(f)&&!vi(f);){const p=mn(f),h=bd(f);!h&&p.position==="fixed"&&(l=null),(c?!h&&!l:!h&&p.position==="static"&&!!l&&xC.has(l.position)||bs(f)&&!h&&Xv(n,f))?s=s.filter(w=>w!==f):l=p,f=Hr(f)}return r.set(n,s),s}function kC(n){let{element:r,boundary:i,rootBoundary:s,strategy:l}=n;const f=[...i==="clippingAncestors"?gl(r)?[]:CC(r,this._c):[].concat(i),s],p=f[0],h=f.reduce((m,w)=>{const x=dm(r,w,l);return m.top=jt(x.top,m.top),m.right=Ur(x.right,m.right),m.bottom=Ur(x.bottom,m.bottom),m.left=jt(x.left,m.left),m},dm(r,p,l));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function EC(n){const{width:r,height:i}=qv(n);return{width:r,height:i}}function bC(n,r,i){const s=Fn(r),l=zn(r),c=i==="fixed",f=So(n,!0,c,r);let p={scrollLeft:0,scrollTop:0};const h=Dn(0);function m(){h.x=xl(l)}if(s||!s&&!c)if((ki(r)!=="body"||bs(l))&&(p=wl(r)),s){const g=So(r,!0,c,r);h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}else l&&m();c&&!s&&l&&m();const w=l&&!s&&!c?Yv(l,p):Dn(0),x=f.left+p.scrollLeft-h.x-w.x,k=f.top+p.scrollTop-h.y-w.y;return{x,y:k,width:f.width,height:f.height}}function Cc(n){return mn(n).position==="static"}function fm(n,r){if(!Fn(n)||mn(n).position==="fixed")return null;if(r)return r(n);let i=n.offsetParent;return zn(n)===i&&(i=i.ownerDocument.body),i}function Zv(n,r){const i=Bt(n);if(gl(n))return i;if(!Fn(n)){let l=Hr(n);for(;l&&!vi(l);){if(hn(l)&&!Cc(l))return l;l=Hr(l)}return i}let s=fm(n,r);for(;s&&aC(s)&&Cc(s);)s=fm(s,r);return s&&vi(s)&&Cc(s)&&!bd(s)?i:s||fC(n)||i}const RC=async function(n){const r=this.getOffsetParent||Zv,i=this.getDimensions,s=await i(n.floating);return{reference:bC(n.reference,await r(n.floating),n.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function PC(n){return mn(n).direction==="rtl"}const MC={convertOffsetParentRelativeRectToViewportRelativeRect:vC,getDocumentElement:zn,getClippingRect:kC,getOffsetParent:Zv,getElementRects:RC,getClientRects:yC,getDimensions:EC,getScale:ri,isElement:hn,isRTL:PC};function Jv(n,r){return n.x===r.x&&n.y===r.y&&n.width===r.width&&n.height===r.height}function TC(n,r){let i=null,s;const l=zn(n);function c(){var p;clearTimeout(s),(p=i)==null||p.disconnect(),i=null}function f(p,h){p===void 0&&(p=!1),h===void 0&&(h=1),c();const m=n.getBoundingClientRect(),{left:w,top:x,width:k,height:g}=m;if(p||r(),!k||!g)return;const O=Ga(x),S=Ga(l.clientWidth-(w+k)),C=Ga(l.clientHeight-(x+g)),P=Ga(w),R={rootMargin:-O+"px "+-S+"px "+-C+"px "+-P+"px",threshold:jt(0,Ur(1,h))||1};let L=!0;function z(U){const H=U[0].intersectionRatio;if(H!==h){if(!L)return f();H?f(!1,H):s=setTimeout(()=>{f(!1,1e-7)},1e3)}H===1&&!Jv(m,n.getBoundingClientRect())&&f(),L=!1}try{i=new IntersectionObserver(z,{...R,root:l.ownerDocument})}catch{i=new IntersectionObserver(z,R)}i.observe(n)}return f(!0),c}function OC(n,r,i,s){s===void 0&&(s={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:h=!1}=s,m=Pd(n),w=l||c?[...m?vs(m):[],...vs(r)]:[];w.forEach(P=>{l&&P.addEventListener("scroll",i,{passive:!0}),c&&P.addEventListener("resize",i)});const x=m&&p?TC(m,i):null;let k=-1,g=null;f&&(g=new ResizeObserver(P=>{let[T]=P;T&&T.target===m&&g&&(g.unobserve(r),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var R;(R=g)==null||R.observe(r)})),i()}),m&&!h&&g.observe(m),g.observe(r));let O,S=h?So(n):null;h&&C();function C(){const P=So(n);S&&!Jv(S,P)&&i(),S=P,O=requestAnimationFrame(C)}return i(),()=>{var P;w.forEach(T=>{l&&T.removeEventListener("scroll",i),c&&T.removeEventListener("resize",i)}),x==null||x(),(P=g)==null||P.disconnect(),g=null,h&&cancelAnimationFrame(O)}}const NC=tC,_C=nC,LC=ZS,AC=oC,IC=JS,pm=XS,DC=rC,FC=(n,r,i)=>{const s=new Map,l={platform:MC,...i},c={...l.platform,_c:s};return YS(n,r,{...l,platform:c})};var zC=typeof document<"u",jC=function(){},tl=zC?y.useLayoutEffect:jC;function ul(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let i,s,l;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(i=n.length,i!==r.length)return!1;for(s=i;s--!==0;)if(!ul(n[s],r[s]))return!1;return!0}if(l=Object.keys(n),i=l.length,i!==Object.keys(r).length)return!1;for(s=i;s--!==0;)if(!{}.hasOwnProperty.call(r,l[s]))return!1;for(s=i;s--!==0;){const c=l[s];if(!(c==="_owner"&&n.$$typeof)&&!ul(n[c],r[c]))return!1}return!0}return n!==n&&r!==r}function ey(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function hm(n,r){const i=ey(n);return Math.round(r*i)/i}function kc(n){const r=y.useRef(n);return tl(()=>{r.current=n}),r}function BC(n){n===void 0&&(n={});const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:l,elements:{reference:c,floating:f}={},transform:p=!0,whileElementsMounted:h,open:m}=n,[w,x]=y.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[k,g]=y.useState(s);ul(k,s)||g(s);const[O,S]=y.useState(null),[C,P]=y.useState(null),T=y.useCallback(j=>{j!==U.current&&(U.current=j,S(j))},[]),R=y.useCallback(j=>{j!==H.current&&(H.current=j,P(j))},[]),L=c||O,z=f||C,U=y.useRef(null),H=y.useRef(null),G=y.useRef(w),J=h!=null,te=kc(h),he=kc(l),Z=kc(m),ye=y.useCallback(()=>{if(!U.current||!H.current)return;const j={placement:r,strategy:i,middleware:k};he.current&&(j.platform=he.current),FC(U.current,H.current,j).then(B=>{const Q={...B,isPositioned:Z.current!==!1};de.current&&!ul(G.current,Q)&&(G.current=Q,Es.flushSync(()=>{x(Q)}))})},[k,r,i,he,Z]);tl(()=>{m===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,x(j=>({...j,isPositioned:!1})))},[m]);const de=y.useRef(!1);tl(()=>(de.current=!0,()=>{de.current=!1}),[]),tl(()=>{if(L&&(U.current=L),z&&(H.current=z),L&&z){if(te.current)return te.current(L,z,ye);ye()}},[L,z,ye,te,J]);const xe=y.useMemo(()=>({reference:U,floating:H,setReference:T,setFloating:R}),[T,R]),ue=y.useMemo(()=>({reference:L,floating:z}),[L,z]),se=y.useMemo(()=>{const j={position:i,left:0,top:0};if(!ue.floating)return j;const B=hm(ue.floating,w.x),Q=hm(ue.floating,w.y);return p?{...j,transform:"translate("+B+"px, "+Q+"px)",...ey(ue.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:B,top:Q}},[i,p,ue.floating,w.x,w.y]);return y.useMemo(()=>({...w,update:ye,refs:xe,elements:ue,floatingStyles:se}),[w,ye,xe,ue,se])}const UC=n=>{function r(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:n,fn(i){const{element:s,padding:l}=typeof n=="function"?n(i):n;return s&&r(s)?s.current!=null?pm({element:s.current,padding:l}).fn(i):{}:s?pm({element:s,padding:l}).fn(i):{}}}},HC=(n,r)=>({...NC(n),options:[n,r]}),$C=(n,r)=>({..._C(n),options:[n,r]}),WC=(n,r)=>({...DC(n),options:[n,r]}),VC=(n,r)=>({...LC(n),options:[n,r]}),QC=(n,r)=>({...AC(n),options:[n,r]}),KC=(n,r)=>({...IC(n),options:[n,r]}),qC=(n,r)=>({...UC(n),options:[n,r]});var GC="Arrow",ty=y.forwardRef((n,r)=>{const{children:i,width:s=10,height:l=5,...c}=n;return V.jsx(je.svg,{...c,ref:r,width:s,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?i:V.jsx("polygon",{points:"0,0 30,0 15,10"})})});ty.displayName=GC;var YC=ty;function XC(n){const[r,i]=y.useState(void 0);return yt(()=>{if(n){i({width:n.offsetWidth,height:n.offsetHeight});const s=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const c=l[0];let f,p;if("borderBoxSize"in c){const h=c.borderBoxSize,m=Array.isArray(h)?h[0]:h;f=m.inlineSize,p=m.blockSize}else f=n.offsetWidth,p=n.offsetHeight;i({width:f,height:p})});return s.observe(n,{box:"border-box"}),()=>s.unobserve(n)}else i(void 0)},[n]),r}var Md="Popper",[ny,ry]=pl(Md),[ZC,oy]=ny(Md),iy=n=>{const{__scopePopper:r,children:i}=n,[s,l]=y.useState(null);return V.jsx(ZC,{scope:r,anchor:s,onAnchorChange:l,children:i})};iy.displayName=Md;var sy="PopperAnchor",ay=y.forwardRef((n,r)=>{const{__scopePopper:i,virtualRef:s,...l}=n,c=oy(sy,i),f=y.useRef(null),p=Je(r,f),h=y.useRef(null);return y.useEffect(()=>{const m=h.current;h.current=(s==null?void 0:s.current)||f.current,m!==h.current&&c.onAnchorChange(h.current)}),s?null:V.jsx(je.div,{...l,ref:p})});ay.displayName=sy;var Td="PopperContent",[JC,ek]=ny(Td),ly=y.forwardRef((n,r)=>{var q,pe,Ce,be,Me,Oe;const{__scopePopper:i,side:s="bottom",sideOffset:l=0,align:c="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:h=!0,collisionBoundary:m=[],collisionPadding:w=0,sticky:x="partial",hideWhenDetached:k=!1,updatePositionStrategy:g="optimized",onPlaced:O,...S}=n,C=oy(Td,i),[P,T]=y.useState(null),R=Je(r,Ye=>T(Ye)),[L,z]=y.useState(null),U=XC(L),H=(U==null?void 0:U.width)??0,G=(U==null?void 0:U.height)??0,J=s+(c!=="center"?"-"+c:""),te=typeof w=="number"?w:{top:0,right:0,bottom:0,left:0,...w},he=Array.isArray(m)?m:[m],Z=he.length>0,ye={padding:te,boundary:he.filter(nk),altBoundary:Z},{refs:de,floatingStyles:xe,placement:ue,isPositioned:se,middlewareData:j}=BC({strategy:"fixed",placement:J,whileElementsMounted:(...Ye)=>OC(...Ye,{animationFrame:g==="always"}),elements:{reference:C.anchor},middleware:[HC({mainAxis:l+G,alignmentAxis:f}),h&&$C({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?WC():void 0,...ye}),h&&VC({...ye}),QC({...ye,apply:({elements:Ye,rects:dt,availableWidth:gn,availableHeight:Xt})=>{const{width:Zt,height:ir}=dt.reference,wn=Ye.floating.style;wn.setProperty("--radix-popper-available-width",`${gn}px`),wn.setProperty("--radix-popper-available-height",`${Xt}px`),wn.setProperty("--radix-popper-anchor-width",`${Zt}px`),wn.setProperty("--radix-popper-anchor-height",`${ir}px`)}}),L&&qC({element:L,padding:p}),rk({arrowWidth:H,arrowHeight:G}),k&&KC({strategy:"referenceHidden",...ye})]}),[B,Q]=dy(ue),N=wo(O);yt(()=>{se&&(N==null||N())},[se,N]);const F=(q=j.arrow)==null?void 0:q.x,ne=(pe=j.arrow)==null?void 0:pe.y,re=((Ce=j.arrow)==null?void 0:Ce.centerOffset)!==0,[ve,Se]=y.useState();return yt(()=>{P&&Se(window.getComputedStyle(P).zIndex)},[P]),V.jsx("div",{ref:de.setFloating,"data-radix-popper-content-wrapper":"",style:{...xe,transform:se?xe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(be=j.transformOrigin)==null?void 0:be.x,(Me=j.transformOrigin)==null?void 0:Me.y].join(" "),...((Oe=j.hide)==null?void 0:Oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:V.jsx(JC,{scope:i,placedSide:B,onArrowChange:z,arrowX:F,arrowY:ne,shouldHideArrow:re,children:V.jsx(je.div,{"data-side":B,"data-align":Q,...S,ref:R,style:{...S.style,animation:se?void 0:"none"}})})})});ly.displayName=Td;var uy="PopperArrow",tk={top:"bottom",right:"left",bottom:"top",left:"right"},cy=y.forwardRef(function(r,i){const{__scopePopper:s,...l}=r,c=ek(uy,s),f=tk[c.placedSide];return V.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:V.jsx(YC,{...l,ref:i,style:{...l.style,display:"block"}})})});cy.displayName=uy;function nk(n){return n!==null}var rk=n=>({name:"transformOrigin",options:n,fn(r){var C,P,T;const{placement:i,rects:s,middlewareData:l}=r,f=((C=l.arrow)==null?void 0:C.centerOffset)!==0,p=f?0:n.arrowWidth,h=f?0:n.arrowHeight,[m,w]=dy(i),x={start:"0%",center:"50%",end:"100%"}[w],k=(((P=l.arrow)==null?void 0:P.x)??0)+p/2,g=(((T=l.arrow)==null?void 0:T.y)??0)+h/2;let O="",S="";return m==="bottom"?(O=f?x:`${k}px`,S=`${-h}px`):m==="top"?(O=f?x:`${k}px`,S=`${s.floating.height+h}px`):m==="right"?(O=`${-h}px`,S=f?x:`${g}px`):m==="left"&&(O=`${s.floating.width+h}px`,S=f?x:`${g}px`),{data:{x:O,y:S}}}});function dy(n){const[r,i="center"]=n.split("-");return[r,i]}var ok=iy,ik=ay,sk=ly,ak=cy;function lk(n){const r=y.useRef({value:n,previous:n});return y.useMemo(()=>(r.current.value!==n&&(r.current.previous=r.current.value,r.current.value=n),r.current.previous),[n])}var fy=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uk="VisuallyHidden",py=y.forwardRef((n,r)=>V.jsx(je.span,{...n,ref:r,style:{...fy,...n.style}}));py.displayName=uk;var gb=py,ck=[" ","Enter","ArrowUp","ArrowDown"],dk=[" ","Enter"],Co="Select",[Sl,Cl,fk]=IS(Co),[Ei]=pl(Co,[fk,ry]),kl=ry(),[pk,Wr]=Ei(Co),[hk,mk]=Ei(Co),hy=n=>{const{__scopeSelect:r,children:i,open:s,defaultOpen:l,onOpenChange:c,value:f,defaultValue:p,onValueChange:h,dir:m,name:w,autoComplete:x,disabled:k,required:g,form:O}=n,S=kl(r),[C,P]=y.useState(null),[T,R]=y.useState(null),[L,z]=y.useState(!1),U=FS(m),[H,G]=Uc({prop:s,defaultProp:l??!1,onChange:c,caller:Co}),[J,te]=Uc({prop:f,defaultProp:p,onChange:h,caller:Co}),he=y.useRef(null),Z=C?O||!!C.closest("form"):!0,[ye,de]=y.useState(new Set),xe=Array.from(ye).map(ue=>ue.props.value).join(";");return V.jsx(ok,{...S,children:V.jsxs(pk,{required:g,scope:r,trigger:C,onTriggerChange:P,valueNode:T,onValueNodeChange:R,valueNodeHasChildren:L,onValueNodeHasChildrenChange:z,contentId:ti(),value:J,onValueChange:te,open:H,onOpenChange:G,dir:U,triggerPointerDownPosRef:he,disabled:k,children:[V.jsx(Sl.Provider,{scope:r,children:V.jsx(hk,{scope:n.__scopeSelect,onNativeOptionAdd:y.useCallback(ue=>{de(se=>new Set(se).add(ue))},[]),onNativeOptionRemove:y.useCallback(ue=>{de(se=>{const j=new Set(se);return j.delete(ue),j})},[]),children:i})}),Z?V.jsxs(zy,{"aria-hidden":!0,required:g,tabIndex:-1,name:w,autoComplete:x,value:J,onChange:ue=>te(ue.target.value),disabled:k,form:O,children:[J===void 0?V.jsx("option",{value:""}):null,Array.from(ye)]},xe):null]})})};hy.displayName=Co;var my="SelectTrigger",vy=y.forwardRef((n,r)=>{const{__scopeSelect:i,disabled:s=!1,...l}=n,c=kl(i),f=Wr(my,i),p=f.disabled||s,h=Je(r,f.onTriggerChange),m=Cl(i),w=y.useRef("touch"),[x,k,g]=By(S=>{const C=m().filter(R=>!R.disabled),P=C.find(R=>R.value===f.value),T=Uy(C,S,P);T!==void 0&&f.onValueChange(T.value)}),O=S=>{p||(f.onOpenChange(!0),g()),S&&(f.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return V.jsx(ik,{asChild:!0,...c,children:V.jsx(je.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:p,"data-disabled":p?"":void 0,"data-placeholder":jy(f.value)?"":void 0,...l,ref:h,onClick:$e(l.onClick,S=>{S.currentTarget.focus(),w.current!=="mouse"&&O(S)}),onPointerDown:$e(l.onPointerDown,S=>{w.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(O(S),S.preventDefault())}),onKeyDown:$e(l.onKeyDown,S=>{const C=x.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&k(S.key),!(C&&S.key===" ")&&ck.includes(S.key)&&(O(),S.preventDefault())})})})});vy.displayName=my;var yy="SelectValue",gy=y.forwardRef((n,r)=>{const{__scopeSelect:i,className:s,style:l,children:c,placeholder:f="",...p}=n,h=Wr(yy,i),{onValueNodeHasChildrenChange:m}=h,w=c!==void 0,x=Je(r,h.onValueNodeChange);return yt(()=>{m(w)},[m,w]),V.jsx(je.span,{...p,ref:x,style:{pointerEvents:"none"},children:jy(h.value)?V.jsx(V.Fragment,{children:f}):c})});gy.displayName=yy;var vk="SelectIcon",wy=y.forwardRef((n,r)=>{const{__scopeSelect:i,children:s,...l}=n;return V.jsx(je.span,{"aria-hidden":!0,...l,ref:r,children:s||"▼"})});wy.displayName=vk;var yk="SelectPortal",xy=n=>V.jsx(yd,{asChild:!0,...n});xy.displayName=yk;var ko="SelectContent",Sy=y.forwardRef((n,r)=>{const i=Wr(ko,n.__scopeSelect),[s,l]=y.useState();if(yt(()=>{l(new DocumentFragment)},[]),!i.open){const c=s;return c?Es.createPortal(V.jsx(Cy,{scope:n.__scopeSelect,children:V.jsx(Sl.Slot,{scope:n.__scopeSelect,children:V.jsx("div",{children:n.children})})}),c):null}return V.jsx(ky,{...n,ref:r})});Sy.displayName=ko;var cn=10,[Cy,Vr]=Ei(ko),gk="SelectContentImpl",wk=ms("SelectContent.RemoveScroll"),ky=y.forwardRef((n,r)=>{const{__scopeSelect:i,position:s="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:c,onPointerDownOutside:f,side:p,sideOffset:h,align:m,alignOffset:w,arrowPadding:x,collisionBoundary:k,collisionPadding:g,sticky:O,hideWhenDetached:S,avoidCollisions:C,...P}=n,T=Wr(ko,i),[R,L]=y.useState(null),[z,U]=y.useState(null),H=Je(r,q=>L(q)),[G,J]=y.useState(null),[te,he]=y.useState(null),Z=Cl(i),[ye,de]=y.useState(!1),xe=y.useRef(!1);y.useEffect(()=>{if(R)return Pv(R)},[R]),gv();const ue=y.useCallback(q=>{const[pe,...Ce]=Z().map(Oe=>Oe.ref.current),[be]=Ce.slice(-1),Me=document.activeElement;for(const Oe of q)if(Oe===Me||(Oe==null||Oe.scrollIntoView({block:"nearest"}),Oe===pe&&z&&(z.scrollTop=0),Oe===be&&z&&(z.scrollTop=z.scrollHeight),Oe==null||Oe.focus(),document.activeElement!==Me))return},[Z,z]),se=y.useCallback(()=>ue([G,R]),[ue,G,R]);y.useEffect(()=>{ye&&se()},[ye,se]);const{onOpenChange:j,triggerPointerDownPosRef:B}=T;y.useEffect(()=>{if(R){let q={x:0,y:0};const pe=be=>{var Me,Oe;q={x:Math.abs(Math.round(be.pageX)-(((Me=B.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(be.pageY)-(((Oe=B.current)==null?void 0:Oe.y)??0))}},Ce=be=>{q.x<=10&&q.y<=10?be.preventDefault():R.contains(be.target)||j(!1),document.removeEventListener("pointermove",pe),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[R,j,B]),y.useEffect(()=>{const q=()=>j(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[j]);const[Q,N]=By(q=>{const pe=Z().filter(Me=>!Me.disabled),Ce=pe.find(Me=>Me.ref.current===document.activeElement),be=Uy(pe,q,Ce);be&&setTimeout(()=>be.ref.current.focus())}),F=y.useCallback((q,pe,Ce)=>{const be=!xe.current&&!Ce;(T.value!==void 0&&T.value===pe||be)&&(J(q),be&&(xe.current=!0))},[T.value]),ne=y.useCallback(()=>R==null?void 0:R.focus(),[R]),re=y.useCallback((q,pe,Ce)=>{const be=!xe.current&&!Ce;(T.value!==void 0&&T.value===pe||be)&&he(q)},[T.value]),ve=s==="popper"?Gc:Ey,Se=ve===Gc?{side:p,sideOffset:h,align:m,alignOffset:w,arrowPadding:x,collisionBoundary:k,collisionPadding:g,sticky:O,hideWhenDetached:S,avoidCollisions:C}:{};return V.jsx(Cy,{scope:i,content:R,viewport:z,onViewportChange:U,itemRefCallback:F,selectedItem:G,onItemLeave:ne,itemTextRefCallback:re,focusSelectedItem:se,selectedItemText:te,position:s,isPositioned:ye,searchRef:Q,children:V.jsx(gd,{as:wk,allowPinchZoom:!0,children:V.jsx(vd,{asChild:!0,trapped:T.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:$e(l,q=>{var pe;(pe=T.trigger)==null||pe.focus({preventScroll:!0}),q.preventDefault()}),children:V.jsx(md,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:V.jsx(ve,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:q=>q.preventDefault(),...P,...Se,onPlaced:()=>de(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...P.style},onKeyDown:$e(P.onKeyDown,q=>{const pe=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!pe&&q.key.length===1&&N(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let be=Z().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(q.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const Me=q.target,Oe=be.indexOf(Me);be=be.slice(Oe+1)}setTimeout(()=>ue(be)),q.preventDefault()}})})})})})})});ky.displayName=gk;var xk="SelectItemAlignedPosition",Ey=y.forwardRef((n,r)=>{const{__scopeSelect:i,onPlaced:s,...l}=n,c=Wr(ko,i),f=Vr(ko,i),[p,h]=y.useState(null),[m,w]=y.useState(null),x=Je(r,H=>w(H)),k=Cl(i),g=y.useRef(!1),O=y.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:P,focusSelectedItem:T}=f,R=y.useCallback(()=>{if(c.trigger&&c.valueNode&&p&&m&&S&&C&&P){const H=c.trigger.getBoundingClientRect(),G=m.getBoundingClientRect(),J=c.valueNode.getBoundingClientRect(),te=P.getBoundingClientRect();if(c.dir!=="rtl"){const Me=te.left-G.left,Oe=J.left-Me,Ye=H.left-Oe,dt=H.width+Ye,gn=Math.max(dt,G.width),Xt=window.innerWidth-cn,Zt=rm(Oe,[cn,Math.max(cn,Xt-gn)]);p.style.minWidth=dt+"px",p.style.left=Zt+"px"}else{const Me=G.right-te.right,Oe=window.innerWidth-J.right-Me,Ye=window.innerWidth-H.right-Oe,dt=H.width+Ye,gn=Math.max(dt,G.width),Xt=window.innerWidth-cn,Zt=rm(Oe,[cn,Math.max(cn,Xt-gn)]);p.style.minWidth=dt+"px",p.style.right=Zt+"px"}const he=k(),Z=window.innerHeight-cn*2,ye=S.scrollHeight,de=window.getComputedStyle(m),xe=parseInt(de.borderTopWidth,10),ue=parseInt(de.paddingTop,10),se=parseInt(de.borderBottomWidth,10),j=parseInt(de.paddingBottom,10),B=xe+ue+ye+j+se,Q=Math.min(C.offsetHeight*5,B),N=window.getComputedStyle(S),F=parseInt(N.paddingTop,10),ne=parseInt(N.paddingBottom,10),re=H.top+H.height/2-cn,ve=Z-re,Se=C.offsetHeight/2,q=C.offsetTop+Se,pe=xe+ue+q,Ce=B-pe;if(pe<=re){const Me=he.length>0&&C===he[he.length-1].ref.current;p.style.bottom="0px";const Oe=m.clientHeight-S.offsetTop-S.offsetHeight,Ye=Math.max(ve,Se+(Me?ne:0)+Oe+se),dt=pe+Ye;p.style.height=dt+"px"}else{const Me=he.length>0&&C===he[0].ref.current;p.style.top="0px";const Ye=Math.max(re,xe+S.offsetTop+(Me?F:0)+Se)+Ce;p.style.height=Ye+"px",S.scrollTop=pe-re+S.offsetTop}p.style.margin=`${cn}px 0`,p.style.minHeight=Q+"px",p.style.maxHeight=Z+"px",s==null||s(),requestAnimationFrame(()=>g.current=!0)}},[k,c.trigger,c.valueNode,p,m,S,C,P,c.dir,s]);yt(()=>R(),[R]);const[L,z]=y.useState();yt(()=>{m&&z(window.getComputedStyle(m).zIndex)},[m]);const U=y.useCallback(H=>{H&&O.current===!0&&(R(),T==null||T(),O.current=!1)},[R,T]);return V.jsx(Ck,{scope:i,contentWrapper:p,shouldExpandOnScrollRef:g,onScrollButtonChange:U,children:V.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:V.jsx(je.div,{...l,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});Ey.displayName=xk;var Sk="SelectPopperPosition",Gc=y.forwardRef((n,r)=>{const{__scopeSelect:i,align:s="start",collisionPadding:l=cn,...c}=n,f=kl(i);return V.jsx(sk,{...f,...c,ref:r,align:s,collisionPadding:l,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Gc.displayName=Sk;var[Ck,Od]=Ei(ko,{}),Yc="SelectViewport",by=y.forwardRef((n,r)=>{const{__scopeSelect:i,nonce:s,...l}=n,c=Vr(Yc,i),f=Od(Yc,i),p=Je(r,c.onViewportChange),h=y.useRef(0);return V.jsxs(V.Fragment,{children:[V.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),V.jsx(Sl.Slot,{scope:i,children:V.jsx(je.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:p,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:$e(l.onScroll,m=>{const w=m.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:k}=f;if(k!=null&&k.current&&x){const g=Math.abs(h.current-w.scrollTop);if(g>0){const O=window.innerHeight-cn*2,S=parseFloat(x.style.minHeight),C=parseFloat(x.style.height),P=Math.max(S,C);if(P<O){const T=P+g,R=Math.min(O,T),L=T-R;x.style.height=R+"px",x.style.bottom==="0px"&&(w.scrollTop=L>0?L:0,x.style.justifyContent="flex-end")}}}h.current=w.scrollTop})})})]})});by.displayName=Yc;var Ry="SelectGroup",[kk,Ek]=Ei(Ry),bk=y.forwardRef((n,r)=>{const{__scopeSelect:i,...s}=n,l=ti();return V.jsx(kk,{scope:i,id:l,children:V.jsx(je.div,{role:"group","aria-labelledby":l,...s,ref:r})})});bk.displayName=Ry;var Py="SelectLabel",My=y.forwardRef((n,r)=>{const{__scopeSelect:i,...s}=n,l=Ek(Py,i);return V.jsx(je.div,{id:l.id,...s,ref:r})});My.displayName=Py;var cl="SelectItem",[Rk,Ty]=Ei(cl),Oy=y.forwardRef((n,r)=>{const{__scopeSelect:i,value:s,disabled:l=!1,textValue:c,...f}=n,p=Wr(cl,i),h=Vr(cl,i),m=p.value===s,[w,x]=y.useState(c??""),[k,g]=y.useState(!1),O=Je(r,T=>{var R;return(R=h.itemRefCallback)==null?void 0:R.call(h,T,s,l)}),S=ti(),C=y.useRef("touch"),P=()=>{l||(p.onValueChange(s),p.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return V.jsx(Rk,{scope:i,value:s,disabled:l,textId:S,isSelected:m,onItemTextChange:y.useCallback(T=>{x(R=>R||((T==null?void 0:T.textContent)??"").trim())},[]),children:V.jsx(Sl.ItemSlot,{scope:i,value:s,disabled:l,textValue:w,children:V.jsx(je.div,{role:"option","aria-labelledby":S,"data-highlighted":k?"":void 0,"aria-selected":m&&k,"data-state":m?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...f,ref:O,onFocus:$e(f.onFocus,()=>g(!0)),onBlur:$e(f.onBlur,()=>g(!1)),onClick:$e(f.onClick,()=>{C.current!=="mouse"&&P()}),onPointerUp:$e(f.onPointerUp,()=>{C.current==="mouse"&&P()}),onPointerDown:$e(f.onPointerDown,T=>{C.current=T.pointerType}),onPointerMove:$e(f.onPointerMove,T=>{var R;C.current=T.pointerType,l?(R=h.onItemLeave)==null||R.call(h):C.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$e(f.onPointerLeave,T=>{var R;T.currentTarget===document.activeElement&&((R=h.onItemLeave)==null||R.call(h))}),onKeyDown:$e(f.onKeyDown,T=>{var L;((L=h.searchRef)==null?void 0:L.current)!==""&&T.key===" "||(dk.includes(T.key)&&P(),T.key===" "&&T.preventDefault())})})})})});Oy.displayName=cl;var fs="SelectItemText",Ny=y.forwardRef((n,r)=>{const{__scopeSelect:i,className:s,style:l,...c}=n,f=Wr(fs,i),p=Vr(fs,i),h=Ty(fs,i),m=mk(fs,i),[w,x]=y.useState(null),k=Je(r,P=>x(P),h.onItemTextChange,P=>{var T;return(T=p.itemTextRefCallback)==null?void 0:T.call(p,P,h.value,h.disabled)}),g=w==null?void 0:w.textContent,O=y.useMemo(()=>V.jsx("option",{value:h.value,disabled:h.disabled,children:g},h.value),[h.disabled,h.value,g]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=m;return yt(()=>(S(O),()=>C(O)),[S,C,O]),V.jsxs(V.Fragment,{children:[V.jsx(je.span,{id:h.textId,...c,ref:k}),h.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Es.createPortal(c.children,f.valueNode):null]})});Ny.displayName=fs;var _y="SelectItemIndicator",Ly=y.forwardRef((n,r)=>{const{__scopeSelect:i,...s}=n;return Ty(_y,i).isSelected?V.jsx(je.span,{"aria-hidden":!0,...s,ref:r}):null});Ly.displayName=_y;var Xc="SelectScrollUpButton",Ay=y.forwardRef((n,r)=>{const i=Vr(Xc,n.__scopeSelect),s=Od(Xc,n.__scopeSelect),[l,c]=y.useState(!1),f=Je(r,s.onScrollButtonChange);return yt(()=>{if(i.viewport&&i.isPositioned){let p=function(){const m=h.scrollTop>0;c(m)};const h=i.viewport;return p(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,i.isPositioned]),l?V.jsx(Dy,{...n,ref:f,onAutoScroll:()=>{const{viewport:p,selectedItem:h}=i;p&&h&&(p.scrollTop=p.scrollTop-h.offsetHeight)}}):null});Ay.displayName=Xc;var Zc="SelectScrollDownButton",Iy=y.forwardRef((n,r)=>{const i=Vr(Zc,n.__scopeSelect),s=Od(Zc,n.__scopeSelect),[l,c]=y.useState(!1),f=Je(r,s.onScrollButtonChange);return yt(()=>{if(i.viewport&&i.isPositioned){let p=function(){const m=h.scrollHeight-h.clientHeight,w=Math.ceil(h.scrollTop)<m;c(w)};const h=i.viewport;return p(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,i.isPositioned]),l?V.jsx(Dy,{...n,ref:f,onAutoScroll:()=>{const{viewport:p,selectedItem:h}=i;p&&h&&(p.scrollTop=p.scrollTop+h.offsetHeight)}}):null});Iy.displayName=Zc;var Dy=y.forwardRef((n,r)=>{const{__scopeSelect:i,onAutoScroll:s,...l}=n,c=Vr("SelectScrollButton",i),f=y.useRef(null),p=Cl(i),h=y.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return y.useEffect(()=>()=>h(),[h]),yt(()=>{var w;const m=p().find(x=>x.ref.current===document.activeElement);(w=m==null?void 0:m.ref.current)==null||w.scrollIntoView({block:"nearest"})},[p]),V.jsx(je.div,{"aria-hidden":!0,...l,ref:r,style:{flexShrink:0,...l.style},onPointerDown:$e(l.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(s,50))}),onPointerMove:$e(l.onPointerMove,()=>{var m;(m=c.onItemLeave)==null||m.call(c),f.current===null&&(f.current=window.setInterval(s,50))}),onPointerLeave:$e(l.onPointerLeave,()=>{h()})})}),Pk="SelectSeparator",Fy=y.forwardRef((n,r)=>{const{__scopeSelect:i,...s}=n;return V.jsx(je.div,{"aria-hidden":!0,...s,ref:r})});Fy.displayName=Pk;var Jc="SelectArrow",Mk=y.forwardRef((n,r)=>{const{__scopeSelect:i,...s}=n,l=kl(i),c=Wr(Jc,i),f=Vr(Jc,i);return c.open&&f.position==="popper"?V.jsx(ak,{...l,...s,ref:r}):null});Mk.displayName=Jc;var Tk="SelectBubbleInput",zy=y.forwardRef(({__scopeSelect:n,value:r,...i},s)=>{const l=y.useRef(null),c=Je(s,l),f=lk(r);return y.useEffect(()=>{const p=l.current;if(!p)return;const h=window.HTMLSelectElement.prototype,w=Object.getOwnPropertyDescriptor(h,"value").set;if(f!==r&&w){const x=new Event("change",{bubbles:!0});w.call(p,r),p.dispatchEvent(x)}},[f,r]),V.jsx(je.select,{...i,style:{...fy,...i.style},ref:c,defaultValue:r})});zy.displayName=Tk;function jy(n){return n===""||n===void 0}function By(n){const r=wo(n),i=y.useRef(""),s=y.useRef(0),l=y.useCallback(f=>{const p=i.current+f;r(p),(function h(m){i.current=m,window.clearTimeout(s.current),m!==""&&(s.current=window.setTimeout(()=>h(""),1e3))})(p)},[r]),c=y.useCallback(()=>{i.current="",window.clearTimeout(s.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(s.current),[]),[i,l,c]}function Uy(n,r,i){const l=r.length>1&&Array.from(r).every(m=>m===r[0])?r[0]:r,c=i?n.indexOf(i):-1;let f=Ok(n,Math.max(c,0));l.length===1&&(f=f.filter(m=>m!==i));const h=f.find(m=>m.textValue.toLowerCase().startsWith(l.toLowerCase()));return h!==i?h:void 0}function Ok(n,r){return n.map((i,s)=>n[(r+s)%n.length])}var wb=hy,xb=vy,Sb=gy,Cb=wy,kb=xy,Eb=Sy,bb=by,Rb=My,Pb=Oy,Mb=Ny,Tb=Ly,Ob=Ay,Nb=Iy,_b=Fy;export{rE as $,nE as A,lE as B,Zk as C,eE as D,gE as E,sb as F,tb as G,BE as H,Cb as I,EE as J,OE as K,AE as L,zE as M,ib as N,Xk as O,Yk as P,zk as Q,Gk as R,ab as S,Jk as T,ME as U,bb as V,fb as W,hb as X,KE as Y,pb as Z,uw as _,Hk as a,sk as a$,ob as a0,HE as a1,NE as a2,sE as a3,$r as a4,jk as a5,vb as a6,Ik as a7,z1 as a8,Ak as a9,cb as aA,JE as aB,QE as aC,GE as aD,jm as aE,Lk as aF,xE as aG,SE as aH,rb as aI,hE as aJ,Uc as aK,ok as aL,ti as aM,Je as aN,je as aO,$e as aP,ik as aQ,ry as aR,hl as aS,yd as aT,pl as aU,Pv as aV,gd as aW,ms as aX,gv as aY,vd as aZ,md as a_,_k as aa,Dk as ab,pE as ac,kE as ad,LE as ae,VE as af,iE as ag,YE as ah,wE as ai,WE as aj,uE as ak,db as al,aE as am,Rm as an,yE as ao,lb as ap,bE as aq,CE as ar,nb as as,mE as at,qE as au,jE as av,Qk as aw,l2 as ax,Kk as ay,Vk as az,tE as b,ak as b0,IE as b1,PE as b2,ub as b3,XE as b4,FE as b5,eb as b6,TE as b7,vE as b8,ZE as b9,_E as ba,gb as bb,Wk as bc,UE as bd,DE as be,$E as bf,oE as bg,RE as bh,Zw as c,yb as d,mb as e,iv as f,Uk as g,xb as h,dE as i,V as j,Ob as k,fE as l,Nb as m,kb as n,Eb as o,Rb as p,Pb as q,y as r,Tb as s,$k as t,Bk as u,cE as v,Mb as w,_b as x,wb as y,Sb as z};
451
+ `);function qa(n){return n.label!==void 0}var CS=3,kS="32px",ES="16px",Jh=4e3,bS=356,RS=14,PS=20,MS=200;function un(...n){return n.filter(Boolean).join(" ")}function TS(n){let[r,i]=n.split("-"),s=[];return r&&s.push(r),i&&s.push(i),s}var OS=n=>{var r,i,s,l,c,f,p,h,m,w,x;let{invert:k,toast:g,unstyled:O,interacting:S,setHeights:C,visibleToasts:P,heights:T,index:R,toasts:L,expanded:z,removeToast:U,defaultRichColors:H,closeButton:G,style:J,cancelButtonStyle:te,actionButtonStyle:he,className:Z="",descriptionClassName:ye="",duration:de,position:xe,gap:ue,loadingIcon:se,expandByDefault:j,classNames:B,icons:Q,closeButtonAriaLabel:N="Close toast",pauseWhenPageIsHidden:F}=n,[ne,re]=X.useState(null),[ve,Se]=X.useState(null),[q,pe]=X.useState(!1),[Ce,be]=X.useState(!1),[Me,Oe]=X.useState(!1),[Ye,dt]=X.useState(!1),[gn,Xt]=X.useState(!1),[Zt,ir]=X.useState(0),[wn,sr]=X.useState(0),Ht=X.useRef(g.duration||de||Jh),Eo=X.useRef(null),xn=X.useRef(null),Rs=R===0,Ps=R+1<=P,gt=g.type,Sn=g.dismissible!==!1,bo=g.className||"",Ms=g.descriptionClassName||"",Cn=X.useMemo(()=>T.findIndex(Ee=>Ee.toastId===g.id)||0,[T,g.id]),Qr=X.useMemo(()=>{var Ee;return(Ee=g.closeButton)!=null?Ee:G},[g.closeButton,G]),Ts=X.useMemo(()=>g.duration||de||Jh,[g.duration,de]),Ro=X.useRef(0),jn=X.useRef(0),Os=X.useRef(0),kn=X.useRef(null),[bi,Ri]=xe.split("-"),Po=X.useMemo(()=>T.reduce((Ee,Ae,Fe)=>Fe>=Cn?Ee:Ee+Ae.height,0),[T,Cn]),Mo=hS(),ar=g.invert||k,En=gt==="loading";jn.current=X.useMemo(()=>Cn*ue+Po,[Cn,Po]),X.useEffect(()=>{Ht.current=Ts},[Ts]),X.useEffect(()=>{pe(!0)},[]),X.useEffect(()=>{let Ee=xn.current;if(Ee){let Ae=Ee.getBoundingClientRect().height;return sr(Ae),C(Fe=>[{toastId:g.id,height:Ae,position:g.position},...Fe]),()=>C(Fe=>Fe.filter(wt=>wt.toastId!==g.id))}},[C,g.id]),X.useLayoutEffect(()=>{if(!q)return;let Ee=xn.current,Ae=Ee.style.height;Ee.style.height="auto";let Fe=Ee.getBoundingClientRect().height;Ee.style.height=Ae,sr(Fe),C(wt=>wt.find(Et=>Et.toastId===g.id)?wt.map(Et=>Et.toastId===g.id?{...Et,height:Fe}:Et):[{toastId:g.id,height:Fe,position:g.position},...wt])},[q,g.title,g.description,C,g.id]);let Jt=X.useCallback(()=>{be(!0),ir(jn.current),C(Ee=>Ee.filter(Ae=>Ae.toastId!==g.id)),setTimeout(()=>{U(g)},MS)},[g,U,C,jn]);X.useEffect(()=>{if(g.promise&&gt==="loading"||g.duration===1/0||g.type==="loading")return;let Ee;return z||S||F&&Mo?(()=>{if(Os.current<Ro.current){let Ae=new Date().getTime()-Ro.current;Ht.current=Ht.current-Ae}Os.current=new Date().getTime()})():Ht.current!==1/0&&(Ro.current=new Date().getTime(),Ee=setTimeout(()=>{var Ae;(Ae=g.onAutoClose)==null||Ae.call(g,g),Jt()},Ht.current)),()=>clearTimeout(Ee)},[z,S,g,gt,F,Mo,Jt]),X.useEffect(()=>{g.delete&&Jt()},[Jt,g.delete]);function Ns(){var Ee,Ae,Fe;return Q!=null&&Q.loading?X.createElement("div",{className:un(B==null?void 0:B.loader,(Ee=g==null?void 0:g.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":gt==="loading"},Q.loading):se?X.createElement("div",{className:un(B==null?void 0:B.loader,(Ae=g==null?void 0:g.classNames)==null?void 0:Ae.loader,"sonner-loader"),"data-visible":gt==="loading"},se):X.createElement(lS,{className:un(B==null?void 0:B.loader,(Fe=g==null?void 0:g.classNames)==null?void 0:Fe.loader),visible:gt==="loading"})}return X.createElement("li",{tabIndex:0,ref:xn,className:un(Z,bo,B==null?void 0:B.toast,(r=g==null?void 0:g.classNames)==null?void 0:r.toast,B==null?void 0:B.default,B==null?void 0:B[gt],(i=g==null?void 0:g.classNames)==null?void 0:i[gt]),"data-sonner-toast":"","data-rich-colors":(s=g.richColors)!=null?s:H,"data-styled":!(g.jsx||g.unstyled||O),"data-mounted":q,"data-promise":!!g.promise,"data-swiped":gn,"data-removed":Ce,"data-visible":Ps,"data-y-position":bi,"data-x-position":Ri,"data-index":R,"data-front":Rs,"data-swiping":Me,"data-dismissible":Sn,"data-type":gt,"data-invert":ar,"data-swipe-out":Ye,"data-swipe-direction":ve,"data-expanded":!!(z||j&&q),style:{"--index":R,"--toasts-before":R,"--z-index":L.length-R,"--offset":`${Ce?Zt:jn.current}px`,"--initial-height":j?"auto":`${wn}px`,...J,...g.style},onDragEnd:()=>{Oe(!1),re(null),kn.current=null},onPointerDown:Ee=>{En||!Sn||(Eo.current=new Date,ir(jn.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(Oe(!0),kn.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,Ae,Fe,wt;if(Ye||!Sn)return;kn.current=null;let Et=Number(((Ee=xn.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),bt=Number(((Ae=xn.current)==null?void 0:Ae.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),en=new Date().getTime()-((Fe=Eo.current)==null?void 0:Fe.getTime()),lt=ne==="x"?Et:bt,bn=Math.abs(lt)/en;if(Math.abs(lt)>=PS||bn>.11){ir(jn.current),(wt=g.onDismiss)==null||wt.call(g,g),Se(ne==="x"?Et>0?"right":"left":bt>0?"down":"up"),Jt(),dt(!0),Xt(!1);return}Oe(!1),re(null)},onPointerMove:Ee=>{var Ae,Fe,wt,Et;if(!kn.current||!Sn||((Ae=window.getSelection())==null?void 0:Ae.toString().length)>0)return;let bt=Ee.clientY-kn.current.y,en=Ee.clientX-kn.current.x,lt=(Fe=n.swipeDirections)!=null?Fe:TS(xe);!ne&&(Math.abs(en)>1||Math.abs(bt)>1)&&re(Math.abs(en)>Math.abs(bt)?"x":"y");let bn={x:0,y:0};ne==="y"?(lt.includes("top")||lt.includes("bottom"))&&(lt.includes("top")&&bt<0||lt.includes("bottom")&&bt>0)&&(bn.y=bt):ne==="x"&&(lt.includes("left")||lt.includes("right"))&&(lt.includes("left")&&en<0||lt.includes("right")&&en>0)&&(bn.x=en),(Math.abs(bn.x)>0||Math.abs(bn.y)>0)&&Xt(!0),(wt=xn.current)==null||wt.style.setProperty("--swipe-amount-x",`${bn.x}px`),(Et=xn.current)==null||Et.style.setProperty("--swipe-amount-y",`${bn.y}px`)}},Qr&&!g.jsx?X.createElement("button",{"aria-label":N,"data-disabled":En,"data-close-button":!0,onClick:En||!Sn?()=>{}:()=>{var Ee;Jt(),(Ee=g.onDismiss)==null||Ee.call(g,g)},className:un(B==null?void 0:B.closeButton,(l=g==null?void 0:g.classNames)==null?void 0:l.closeButton)},(c=Q==null?void 0:Q.close)!=null?c:pS):null,g.jsx||y.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:X.createElement(X.Fragment,null,gt||g.icon||g.promise?X.createElement("div",{"data-icon":"",className:un(B==null?void 0:B.icon,(f=g==null?void 0:g.classNames)==null?void 0:f.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Ns():null,g.type!=="loading"?g.icon||(Q==null?void 0:Q[gt])||sS(gt):null):null,X.createElement("div",{"data-content":"",className:un(B==null?void 0:B.content,(p=g==null?void 0:g.classNames)==null?void 0:p.content)},X.createElement("div",{"data-title":"",className:un(B==null?void 0:B.title,(h=g==null?void 0:g.classNames)==null?void 0:h.title)},typeof g.title=="function"?g.title():g.title),g.description?X.createElement("div",{"data-description":"",className:un(ye,Ms,B==null?void 0:B.description,(m=g==null?void 0:g.classNames)==null?void 0:m.description)},typeof g.description=="function"?g.description():g.description):null),y.isValidElement(g.cancel)?g.cancel:g.cancel&&qa(g.cancel)?X.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||te,onClick:Ee=>{var Ae,Fe;qa(g.cancel)&&Sn&&((Fe=(Ae=g.cancel).onClick)==null||Fe.call(Ae,Ee),Jt())},className:un(B==null?void 0:B.cancelButton,(w=g==null?void 0:g.classNames)==null?void 0:w.cancelButton)},g.cancel.label):null,y.isValidElement(g.action)?g.action:g.action&&qa(g.action)?X.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||he,onClick:Ee=>{var Ae,Fe;qa(g.action)&&((Fe=(Ae=g.action).onClick)==null||Fe.call(Ae,Ee),!Ee.defaultPrevented&&Jt())},className:un(B==null?void 0:B.actionButton,(x=g==null?void 0:g.classNames)==null?void 0:x.actionButton)},g.action.label):null))};function em(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function NS(n,r){let i={};return[n,r].forEach((s,l)=>{let c=l===1,f=c?"--mobile-offset":"--offset",p=c?ES:kS;function h(m){["top","right","bottom","left"].forEach(w=>{i[`${f}-${w}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?h(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?i[`${f}-${m}`]=p:i[`${f}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):h(p)}),i}var vb=y.forwardRef(function(n,r){let{invert:i,position:s="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:p,offset:h,mobileOffset:m,theme:w="light",richColors:x,duration:k,style:g,visibleToasts:O=CS,toastOptions:S,dir:C=em(),gap:P=RS,loadingIcon:T,icons:R,containerAriaLabel:L="Notifications",pauseWhenPageIsHidden:z}=n,[U,H]=X.useState([]),G=X.useMemo(()=>Array.from(new Set([s].concat(U.filter(F=>F.position).map(F=>F.position)))),[U,s]),[J,te]=X.useState([]),[he,Z]=X.useState(!1),[ye,de]=X.useState(!1),[xe,ue]=X.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),se=X.useRef(null),j=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=X.useRef(null),Q=X.useRef(!1),N=X.useCallback(F=>{H(ne=>{var re;return(re=ne.find(ve=>ve.id===F.id))!=null&&re.delete||At.dismiss(F.id),ne.filter(({id:ve})=>ve!==F.id)})},[]);return X.useEffect(()=>At.subscribe(F=>{if(F.dismiss){H(ne=>ne.map(re=>re.id===F.id?{...re,delete:!0}:re));return}setTimeout(()=>{qm.flushSync(()=>{H(ne=>{let re=ne.findIndex(ve=>ve.id===F.id);return re!==-1?[...ne.slice(0,re),{...ne[re],...F},...ne.slice(re+1)]:[F,...ne]})})})}),[]),X.useEffect(()=>{if(w!=="system"){ue(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ue("dark"):ue("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:ne})=>{ue(ne?"dark":"light")})}catch{F.addListener(({matches:re})=>{try{ue(re?"dark":"light")}catch(ve){console.error(ve)}})}},[w]),X.useEffect(()=>{U.length<=1&&Z(!1)},[U]),X.useEffect(()=>{let F=ne=>{var re,ve;l.every(Se=>ne[Se]||ne.code===Se)&&(Z(!0),(re=se.current)==null||re.focus()),ne.code==="Escape"&&(document.activeElement===se.current||(ve=se.current)!=null&&ve.contains(document.activeElement))&&Z(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[l]),X.useEffect(()=>{if(se.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,Q.current=!1)}},[se.current]),X.createElement("section",{ref:r,"aria-label":`${L} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},G.map((F,ne)=>{var re;let[ve,Se]=F.split("-");return U.length?X.createElement("ol",{key:F,dir:C==="auto"?em():C,tabIndex:-1,ref:se,className:p,"data-sonner-toaster":!0,"data-theme":xe,"data-y-position":ve,"data-lifted":he&&U.length>1&&!c,"data-x-position":Se,style:{"--front-toast-height":`${((re=J[0])==null?void 0:re.height)||0}px`,"--width":`${bS}px`,"--gap":`${P}px`,...g,...NS(h,m)},onBlur:q=>{Q.current&&!q.currentTarget.contains(q.relatedTarget)&&(Q.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,B.current=q.relatedTarget)},onMouseEnter:()=>Z(!0),onMouseMove:()=>Z(!0),onMouseLeave:()=>{ye||Z(!1)},onDragEnd:()=>Z(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||de(!0)},onPointerUp:()=>de(!1)},U.filter(q=>!q.position&&ne===0||q.position===F).map((q,pe)=>{var Ce,be;return X.createElement(OS,{key:q.id,icons:R,index:pe,toast:q,defaultRichColors:x,duration:(Ce=S==null?void 0:S.duration)!=null?Ce:k,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:i,visibleToasts:O,closeButton:(be=S==null?void 0:S.closeButton)!=null?be:f,interacting:ye,position:F,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,removeToast:N,toasts:U.filter(Me=>Me.position==q.position),heights:J.filter(Me=>Me.position==q.position),setHeights:te,expandByDefault:c,gap:P,loadingIcon:T,expanded:he,pauseWhenPageIsHidden:z,swipeDirections:n.swipeDirections})})):null}))});const tm=n=>{let r;const i=new Set,s=(m,w)=>{const x=typeof m=="function"?m(r):m;if(!Object.is(x,r)){const k=r;r=w??(typeof x!="object"||x===null)?x:Object.assign({},r,x),i.forEach(g=>g(r,k))}},l=()=>r,p={setState:s,getState:l,getInitialState:()=>h,subscribe:m=>(i.add(m),()=>i.delete(m))},h=r=n(s,l,p);return p},_S=(n=>n?tm(n):tm),LS=n=>n;function AS(n,r=LS){const i=X.useSyncExternalStore(n.subscribe,X.useCallback(()=>r(n.getState()),[n,r]),X.useCallback(()=>r(n.getInitialState()),[n,r]));return X.useDebugValue(i),i}const nm=n=>{const r=_S(n),i=s=>AS(r,s);return Object.assign(i,r),i},yb=(n=>n?nm(n):nm);function rm(n,[r,i]){return Math.min(i,Math.max(r,n))}function IS(n){const r=n+"CollectionProvider",[i,s]=pl(r),[l,c]=i(r,{collectionRef:{current:null},itemMap:new Map}),f=S=>{const{scope:C,children:P}=S,T=X.useRef(null),R=X.useRef(new Map).current;return V.jsx(l,{scope:C,itemMap:R,collectionRef:T,children:P})};f.displayName=r;const p=n+"CollectionSlot",h=ms(p),m=X.forwardRef((S,C)=>{const{scope:P,children:T}=S,R=c(p,P),L=Je(C,R.collectionRef);return V.jsx(h,{ref:L,children:T})});m.displayName=p;const w=n+"CollectionItemSlot",x="data-radix-collection-item",k=ms(w),g=X.forwardRef((S,C)=>{const{scope:P,children:T,...R}=S,L=X.useRef(null),z=Je(C,L),U=c(w,P);return X.useEffect(()=>(U.itemMap.set(L,{ref:L,...R}),()=>void U.itemMap.delete(L))),V.jsx(k,{[x]:"",ref:z,children:T})});g.displayName=w;function O(S){const C=c(n+"CollectionConsumer",S);return X.useCallback(()=>{const T=C.collectionRef.current;if(!T)return[];const R=Array.from(T.querySelectorAll(`[${x}]`));return Array.from(C.itemMap.values()).sort((U,H)=>R.indexOf(U.ref.current)-R.indexOf(H.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:f,Slot:m,ItemSlot:g},O,s]}var DS=y.createContext(void 0);function FS(n){const r=y.useContext(DS);return n||r||"ltr"}const zS=["top","right","bottom","left"],Ur=Math.min,jt=Math.max,sl=Math.round,Ga=Math.floor,Dn=n=>({x:n,y:n}),jS={left:"right",right:"left",bottom:"top",top:"bottom"},BS={start:"end",end:"start"};function Qc(n,r,i){return jt(n,Ur(r,i))}function rr(n,r){return typeof n=="function"?n(r):n}function or(n){return n.split("-")[0]}function Ci(n){return n.split("-")[1]}function Cd(n){return n==="x"?"y":"x"}function kd(n){return n==="y"?"height":"width"}const US=new Set(["top","bottom"]);function In(n){return US.has(or(n))?"y":"x"}function Ed(n){return Cd(In(n))}function HS(n,r,i){i===void 0&&(i=!1);const s=Ci(n),l=Ed(n),c=kd(l);let f=l==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return r.reference[c]>r.floating[c]&&(f=al(f)),[f,al(f)]}function $S(n){const r=al(n);return[Kc(n),r,Kc(r)]}function Kc(n){return n.replace(/start|end/g,r=>BS[r])}const om=["left","right"],im=["right","left"],WS=["top","bottom"],VS=["bottom","top"];function QS(n,r,i){switch(n){case"top":case"bottom":return i?r?im:om:r?om:im;case"left":case"right":return r?WS:VS;default:return[]}}function KS(n,r,i,s){const l=Ci(n);let c=QS(or(n),i==="start",s);return l&&(c=c.map(f=>f+"-"+l),r&&(c=c.concat(c.map(Kc)))),c}function al(n){return n.replace(/left|right|bottom|top/g,r=>jS[r])}function qS(n){return{top:0,right:0,bottom:0,left:0,...n}}function Wv(n){return typeof n!="number"?qS(n):{top:n,right:n,bottom:n,left:n}}function ll(n){const{x:r,y:i,width:s,height:l}=n;return{width:s,height:l,top:i,left:r,right:r+s,bottom:i+l,x:r,y:i}}function sm(n,r,i){let{reference:s,floating:l}=n;const c=In(r),f=Ed(r),p=kd(f),h=or(r),m=c==="y",w=s.x+s.width/2-l.width/2,x=s.y+s.height/2-l.height/2,k=s[p]/2-l[p]/2;let g;switch(h){case"top":g={x:w,y:s.y-l.height};break;case"bottom":g={x:w,y:s.y+s.height};break;case"right":g={x:s.x+s.width,y:x};break;case"left":g={x:s.x-l.width,y:x};break;default:g={x:s.x,y:s.y}}switch(Ci(r)){case"start":g[f]-=k*(i&&m?-1:1);break;case"end":g[f]+=k*(i&&m?-1:1);break}return g}async function GS(n,r){var i;r===void 0&&(r={});const{x:s,y:l,platform:c,rects:f,elements:p,strategy:h}=n,{boundary:m="clippingAncestors",rootBoundary:w="viewport",elementContext:x="floating",altBoundary:k=!1,padding:g=0}=rr(r,n),O=Wv(g),C=p[k?x==="floating"?"reference":"floating":x],P=ll(await c.getClippingRect({element:(i=await(c.isElement==null?void 0:c.isElement(C)))==null||i?C:C.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(p.floating)),boundary:m,rootBoundary:w,strategy:h})),T=x==="floating"?{x:s,y:l,width:f.floating.width,height:f.floating.height}:f.reference,R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p.floating)),L=await(c.isElement==null?void 0:c.isElement(R))?await(c.getScale==null?void 0:c.getScale(R))||{x:1,y:1}:{x:1,y:1},z=ll(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:T,offsetParent:R,strategy:h}):T);return{top:(P.top-z.top+O.top)/L.y,bottom:(z.bottom-P.bottom+O.bottom)/L.y,left:(P.left-z.left+O.left)/L.x,right:(z.right-P.right+O.right)/L.x}}const YS=async(n,r,i)=>{const{placement:s="bottom",strategy:l="absolute",middleware:c=[],platform:f}=i,p=c.filter(Boolean),h=await(f.isRTL==null?void 0:f.isRTL(r));let m=await f.getElementRects({reference:n,floating:r,strategy:l}),{x:w,y:x}=sm(m,s,h),k=s,g={},O=0;for(let C=0;C<p.length;C++){var S;const{name:P,fn:T}=p[C],{x:R,y:L,data:z,reset:U}=await T({x:w,y:x,initialPlacement:s,placement:k,strategy:l,middlewareData:g,rects:m,platform:{...f,detectOverflow:(S=f.detectOverflow)!=null?S:GS},elements:{reference:n,floating:r}});w=R??w,x=L??x,g={...g,[P]:{...g[P],...z}},U&&O<=50&&(O++,typeof U=="object"&&(U.placement&&(k=U.placement),U.rects&&(m=U.rects===!0?await f.getElementRects({reference:n,floating:r,strategy:l}):U.rects),{x:w,y:x}=sm(m,k,h)),C=-1)}return{x:w,y:x,placement:k,strategy:l,middlewareData:g}},XS=n=>({name:"arrow",options:n,async fn(r){const{x:i,y:s,placement:l,rects:c,platform:f,elements:p,middlewareData:h}=r,{element:m,padding:w=0}=rr(n,r)||{};if(m==null)return{};const x=Wv(w),k={x:i,y:s},g=Ed(l),O=kd(g),S=await f.getDimensions(m),C=g==="y",P=C?"top":"left",T=C?"bottom":"right",R=C?"clientHeight":"clientWidth",L=c.reference[O]+c.reference[g]-k[g]-c.floating[O],z=k[g]-c.reference[g],U=await(f.getOffsetParent==null?void 0:f.getOffsetParent(m));let H=U?U[R]:0;(!H||!await(f.isElement==null?void 0:f.isElement(U)))&&(H=p.floating[R]||c.floating[O]);const G=L/2-z/2,J=H/2-S[O]/2-1,te=Ur(x[P],J),he=Ur(x[T],J),Z=te,ye=H-S[O]-he,de=H/2-S[O]/2+G,xe=Qc(Z,de,ye),ue=!h.arrow&&Ci(l)!=null&&de!==xe&&c.reference[O]/2-(de<Z?te:he)-S[O]/2<0,se=ue?de<Z?de-Z:de-ye:0;return{[g]:k[g]+se,data:{[g]:xe,centerOffset:de-xe-se,...ue&&{alignmentOffset:se}},reset:ue}}}),ZS=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(r){var i,s;const{placement:l,middlewareData:c,rects:f,initialPlacement:p,platform:h,elements:m}=r,{mainAxis:w=!0,crossAxis:x=!0,fallbackPlacements:k,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:S=!0,...C}=rr(n,r);if((i=c.arrow)!=null&&i.alignmentOffset)return{};const P=or(l),T=In(p),R=or(p)===p,L=await(h.isRTL==null?void 0:h.isRTL(m.floating)),z=k||(R||!S?[al(p)]:$S(p)),U=O!=="none";!k&&U&&z.push(...KS(p,S,O,L));const H=[p,...z],G=await h.detectOverflow(r,C),J=[];let te=((s=c.flip)==null?void 0:s.overflows)||[];if(w&&J.push(G[P]),x){const de=HS(l,f,L);J.push(G[de[0]],G[de[1]])}if(te=[...te,{placement:l,overflows:J}],!J.every(de=>de<=0)){var he,Z;const de=(((he=c.flip)==null?void 0:he.index)||0)+1,xe=H[de];if(xe&&(!(x==="alignment"?T!==In(xe):!1)||te.every(j=>In(j.placement)===T?j.overflows[0]>0:!0)))return{data:{index:de,overflows:te},reset:{placement:xe}};let ue=(Z=te.filter(se=>se.overflows[0]<=0).sort((se,j)=>se.overflows[1]-j.overflows[1])[0])==null?void 0:Z.placement;if(!ue)switch(g){case"bestFit":{var ye;const se=(ye=te.filter(j=>{if(U){const B=In(j.placement);return B===T||B==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(B=>B>0).reduce((B,Q)=>B+Q,0)]).sort((j,B)=>j[1]-B[1])[0])==null?void 0:ye[0];se&&(ue=se);break}case"initialPlacement":ue=p;break}if(l!==ue)return{reset:{placement:ue}}}return{}}}};function am(n,r){return{top:n.top-r.height,right:n.right-r.width,bottom:n.bottom-r.height,left:n.left-r.width}}function lm(n){return zS.some(r=>n[r]>=0)}const JS=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(r){const{rects:i,platform:s}=r,{strategy:l="referenceHidden",...c}=rr(n,r);switch(l){case"referenceHidden":{const f=await s.detectOverflow(r,{...c,elementContext:"reference"}),p=am(f,i.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:lm(p)}}}case"escaped":{const f=await s.detectOverflow(r,{...c,altBoundary:!0}),p=am(f,i.floating);return{data:{escapedOffsets:p,escaped:lm(p)}}}default:return{}}}}},Vv=new Set(["left","top"]);async function eC(n,r){const{placement:i,platform:s,elements:l}=n,c=await(s.isRTL==null?void 0:s.isRTL(l.floating)),f=or(i),p=Ci(i),h=In(i)==="y",m=Vv.has(f)?-1:1,w=c&&h?-1:1,x=rr(r,n);let{mainAxis:k,crossAxis:g,alignmentAxis:O}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return p&&typeof O=="number"&&(g=p==="end"?O*-1:O),h?{x:g*w,y:k*m}:{x:k*m,y:g*w}}const tC=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var i,s;const{x:l,y:c,placement:f,middlewareData:p}=r,h=await eC(r,n);return f===((i=p.offset)==null?void 0:i.placement)&&(s=p.arrow)!=null&&s.alignmentOffset?{}:{x:l+h.x,y:c+h.y,data:{...h,placement:f}}}}},nC=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(r){const{x:i,y:s,placement:l,platform:c}=r,{mainAxis:f=!0,crossAxis:p=!1,limiter:h={fn:P=>{let{x:T,y:R}=P;return{x:T,y:R}}},...m}=rr(n,r),w={x:i,y:s},x=await c.detectOverflow(r,m),k=In(or(l)),g=Cd(k);let O=w[g],S=w[k];if(f){const P=g==="y"?"top":"left",T=g==="y"?"bottom":"right",R=O+x[P],L=O-x[T];O=Qc(R,O,L)}if(p){const P=k==="y"?"top":"left",T=k==="y"?"bottom":"right",R=S+x[P],L=S-x[T];S=Qc(R,S,L)}const C=h.fn({...r,[g]:O,[k]:S});return{...C,data:{x:C.x-i,y:C.y-s,enabled:{[g]:f,[k]:p}}}}}},rC=function(n){return n===void 0&&(n={}),{options:n,fn(r){const{x:i,y:s,placement:l,rects:c,middlewareData:f}=r,{offset:p=0,mainAxis:h=!0,crossAxis:m=!0}=rr(n,r),w={x:i,y:s},x=In(l),k=Cd(x);let g=w[k],O=w[x];const S=rr(p,r),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const R=k==="y"?"height":"width",L=c.reference[k]-c.floating[R]+C.mainAxis,z=c.reference[k]+c.reference[R]-C.mainAxis;g<L?g=L:g>z&&(g=z)}if(m){var P,T;const R=k==="y"?"width":"height",L=Vv.has(or(l)),z=c.reference[x]-c.floating[R]+(L&&((P=f.offset)==null?void 0:P[x])||0)+(L?0:C.crossAxis),U=c.reference[x]+c.reference[R]+(L?0:((T=f.offset)==null?void 0:T[x])||0)-(L?C.crossAxis:0);O<z?O=z:O>U&&(O=U)}return{[k]:g,[x]:O}}}},oC=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(r){var i,s;const{placement:l,rects:c,platform:f,elements:p}=r,{apply:h=()=>{},...m}=rr(n,r),w=await f.detectOverflow(r,m),x=or(l),k=Ci(l),g=In(l)==="y",{width:O,height:S}=c.floating;let C,P;x==="top"||x==="bottom"?(C=x,P=k===(await(f.isRTL==null?void 0:f.isRTL(p.floating))?"start":"end")?"left":"right"):(P=x,C=k==="end"?"top":"bottom");const T=S-w.top-w.bottom,R=O-w.left-w.right,L=Ur(S-w[C],T),z=Ur(O-w[P],R),U=!r.middlewareData.shift;let H=L,G=z;if((i=r.middlewareData.shift)!=null&&i.enabled.x&&(G=R),(s=r.middlewareData.shift)!=null&&s.enabled.y&&(H=T),U&&!k){const te=jt(w.left,0),he=jt(w.right,0),Z=jt(w.top,0),ye=jt(w.bottom,0);g?G=O-2*(te!==0||he!==0?te+he:jt(w.left,w.right)):H=S-2*(Z!==0||ye!==0?Z+ye:jt(w.top,w.bottom))}await h({...r,availableWidth:G,availableHeight:H});const J=await f.getDimensions(p.floating);return O!==J.width||S!==J.height?{reset:{rects:!0}}:{}}}};function yl(){return typeof window<"u"}function ki(n){return Qv(n)?(n.nodeName||"").toLowerCase():"#document"}function Bt(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function zn(n){var r;return(r=(Qv(n)?n.ownerDocument:n.document)||window.document)==null?void 0:r.documentElement}function Qv(n){return yl()?n instanceof Node||n instanceof Bt(n).Node:!1}function hn(n){return yl()?n instanceof Element||n instanceof Bt(n).Element:!1}function Fn(n){return yl()?n instanceof HTMLElement||n instanceof Bt(n).HTMLElement:!1}function um(n){return!yl()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Bt(n).ShadowRoot}const iC=new Set(["inline","contents"]);function bs(n){const{overflow:r,overflowX:i,overflowY:s,display:l}=mn(n);return/auto|scroll|overlay|hidden|clip/.test(r+s+i)&&!iC.has(l)}const sC=new Set(["table","td","th"]);function aC(n){return sC.has(ki(n))}const lC=[":popover-open",":modal"];function gl(n){return lC.some(r=>{try{return n.matches(r)}catch{return!1}})}const uC=["transform","translate","scale","rotate","perspective"],cC=["transform","translate","scale","rotate","perspective","filter"],dC=["paint","layout","strict","content"];function bd(n){const r=Rd(),i=hn(n)?mn(n):n;return uC.some(s=>i[s]?i[s]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!r&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!r&&(i.filter?i.filter!=="none":!1)||cC.some(s=>(i.willChange||"").includes(s))||dC.some(s=>(i.contain||"").includes(s))}function fC(n){let r=Hr(n);for(;Fn(r)&&!vi(r);){if(bd(r))return r;if(gl(r))return null;r=Hr(r)}return null}function Rd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const pC=new Set(["html","body","#document"]);function vi(n){return pC.has(ki(n))}function mn(n){return Bt(n).getComputedStyle(n)}function wl(n){return hn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Hr(n){if(ki(n)==="html")return n;const r=n.assignedSlot||n.parentNode||um(n)&&n.host||zn(n);return um(r)?r.host:r}function Kv(n){const r=Hr(n);return vi(r)?n.ownerDocument?n.ownerDocument.body:n.body:Fn(r)&&bs(r)?r:Kv(r)}function vs(n,r,i){var s;r===void 0&&(r=[]),i===void 0&&(i=!0);const l=Kv(n),c=l===((s=n.ownerDocument)==null?void 0:s.body),f=Bt(l);if(c){const p=qc(f);return r.concat(f,f.visualViewport||[],bs(l)?l:[],p&&i?vs(p):[])}return r.concat(l,vs(l,[],i))}function qc(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function qv(n){const r=mn(n);let i=parseFloat(r.width)||0,s=parseFloat(r.height)||0;const l=Fn(n),c=l?n.offsetWidth:i,f=l?n.offsetHeight:s,p=sl(i)!==c||sl(s)!==f;return p&&(i=c,s=f),{width:i,height:s,$:p}}function Pd(n){return hn(n)?n:n.contextElement}function ri(n){const r=Pd(n);if(!Fn(r))return Dn(1);const i=r.getBoundingClientRect(),{width:s,height:l,$:c}=qv(r);let f=(c?sl(i.width):i.width)/s,p=(c?sl(i.height):i.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const hC=Dn(0);function Gv(n){const r=Bt(n);return!Rd()||!r.visualViewport?hC:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function mC(n,r,i){return r===void 0&&(r=!1),!i||r&&i!==Bt(n)?!1:r}function So(n,r,i,s){r===void 0&&(r=!1),i===void 0&&(i=!1);const l=n.getBoundingClientRect(),c=Pd(n);let f=Dn(1);r&&(s?hn(s)&&(f=ri(s)):f=ri(n));const p=mC(c,i,s)?Gv(c):Dn(0);let h=(l.left+p.x)/f.x,m=(l.top+p.y)/f.y,w=l.width/f.x,x=l.height/f.y;if(c){const k=Bt(c),g=s&&hn(s)?Bt(s):s;let O=k,S=qc(O);for(;S&&s&&g!==O;){const C=ri(S),P=S.getBoundingClientRect(),T=mn(S),R=P.left+(S.clientLeft+parseFloat(T.paddingLeft))*C.x,L=P.top+(S.clientTop+parseFloat(T.paddingTop))*C.y;h*=C.x,m*=C.y,w*=C.x,x*=C.y,h+=R,m+=L,O=Bt(S),S=qc(O)}}return ll({width:w,height:x,x:h,y:m})}function xl(n,r){const i=wl(n).scrollLeft;return r?r.left+i:So(zn(n)).left+i}function Yv(n,r){const i=n.getBoundingClientRect(),s=i.left+r.scrollLeft-xl(n,i),l=i.top+r.scrollTop;return{x:s,y:l}}function vC(n){let{elements:r,rect:i,offsetParent:s,strategy:l}=n;const c=l==="fixed",f=zn(s),p=r?gl(r.floating):!1;if(s===f||p&&c)return i;let h={scrollLeft:0,scrollTop:0},m=Dn(1);const w=Dn(0),x=Fn(s);if((x||!x&&!c)&&((ki(s)!=="body"||bs(f))&&(h=wl(s)),Fn(s))){const g=So(s);m=ri(s),w.x=g.x+s.clientLeft,w.y=g.y+s.clientTop}const k=f&&!x&&!c?Yv(f,h):Dn(0);return{width:i.width*m.x,height:i.height*m.y,x:i.x*m.x-h.scrollLeft*m.x+w.x+k.x,y:i.y*m.y-h.scrollTop*m.y+w.y+k.y}}function yC(n){return Array.from(n.getClientRects())}function gC(n){const r=zn(n),i=wl(n),s=n.ownerDocument.body,l=jt(r.scrollWidth,r.clientWidth,s.scrollWidth,s.clientWidth),c=jt(r.scrollHeight,r.clientHeight,s.scrollHeight,s.clientHeight);let f=-i.scrollLeft+xl(n);const p=-i.scrollTop;return mn(s).direction==="rtl"&&(f+=jt(r.clientWidth,s.clientWidth)-l),{width:l,height:c,x:f,y:p}}const cm=25;function wC(n,r){const i=Bt(n),s=zn(n),l=i.visualViewport;let c=s.clientWidth,f=s.clientHeight,p=0,h=0;if(l){c=l.width,f=l.height;const w=Rd();(!w||w&&r==="fixed")&&(p=l.offsetLeft,h=l.offsetTop)}const m=xl(s);if(m<=0){const w=s.ownerDocument,x=w.body,k=getComputedStyle(x),g=w.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,O=Math.abs(s.clientWidth-x.clientWidth-g);O<=cm&&(c-=O)}else m<=cm&&(c+=m);return{width:c,height:f,x:p,y:h}}const xC=new Set(["absolute","fixed"]);function SC(n,r){const i=So(n,!0,r==="fixed"),s=i.top+n.clientTop,l=i.left+n.clientLeft,c=Fn(n)?ri(n):Dn(1),f=n.clientWidth*c.x,p=n.clientHeight*c.y,h=l*c.x,m=s*c.y;return{width:f,height:p,x:h,y:m}}function dm(n,r,i){let s;if(r==="viewport")s=wC(n,i);else if(r==="document")s=gC(zn(n));else if(hn(r))s=SC(r,i);else{const l=Gv(n);s={x:r.x-l.x,y:r.y-l.y,width:r.width,height:r.height}}return ll(s)}function Xv(n,r){const i=Hr(n);return i===r||!hn(i)||vi(i)?!1:mn(i).position==="fixed"||Xv(i,r)}function CC(n,r){const i=r.get(n);if(i)return i;let s=vs(n,[],!1).filter(p=>hn(p)&&ki(p)!=="body"),l=null;const c=mn(n).position==="fixed";let f=c?Hr(n):n;for(;hn(f)&&!vi(f);){const p=mn(f),h=bd(f);!h&&p.position==="fixed"&&(l=null),(c?!h&&!l:!h&&p.position==="static"&&!!l&&xC.has(l.position)||bs(f)&&!h&&Xv(n,f))?s=s.filter(w=>w!==f):l=p,f=Hr(f)}return r.set(n,s),s}function kC(n){let{element:r,boundary:i,rootBoundary:s,strategy:l}=n;const f=[...i==="clippingAncestors"?gl(r)?[]:CC(r,this._c):[].concat(i),s],p=f[0],h=f.reduce((m,w)=>{const x=dm(r,w,l);return m.top=jt(x.top,m.top),m.right=Ur(x.right,m.right),m.bottom=Ur(x.bottom,m.bottom),m.left=jt(x.left,m.left),m},dm(r,p,l));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function EC(n){const{width:r,height:i}=qv(n);return{width:r,height:i}}function bC(n,r,i){const s=Fn(r),l=zn(r),c=i==="fixed",f=So(n,!0,c,r);let p={scrollLeft:0,scrollTop:0};const h=Dn(0);function m(){h.x=xl(l)}if(s||!s&&!c)if((ki(r)!=="body"||bs(l))&&(p=wl(r)),s){const g=So(r,!0,c,r);h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}else l&&m();c&&!s&&l&&m();const w=l&&!s&&!c?Yv(l,p):Dn(0),x=f.left+p.scrollLeft-h.x-w.x,k=f.top+p.scrollTop-h.y-w.y;return{x,y:k,width:f.width,height:f.height}}function Cc(n){return mn(n).position==="static"}function fm(n,r){if(!Fn(n)||mn(n).position==="fixed")return null;if(r)return r(n);let i=n.offsetParent;return zn(n)===i&&(i=i.ownerDocument.body),i}function Zv(n,r){const i=Bt(n);if(gl(n))return i;if(!Fn(n)){let l=Hr(n);for(;l&&!vi(l);){if(hn(l)&&!Cc(l))return l;l=Hr(l)}return i}let s=fm(n,r);for(;s&&aC(s)&&Cc(s);)s=fm(s,r);return s&&vi(s)&&Cc(s)&&!bd(s)?i:s||fC(n)||i}const RC=async function(n){const r=this.getOffsetParent||Zv,i=this.getDimensions,s=await i(n.floating);return{reference:bC(n.reference,await r(n.floating),n.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function PC(n){return mn(n).direction==="rtl"}const MC={convertOffsetParentRelativeRectToViewportRelativeRect:vC,getDocumentElement:zn,getClippingRect:kC,getOffsetParent:Zv,getElementRects:RC,getClientRects:yC,getDimensions:EC,getScale:ri,isElement:hn,isRTL:PC};function Jv(n,r){return n.x===r.x&&n.y===r.y&&n.width===r.width&&n.height===r.height}function TC(n,r){let i=null,s;const l=zn(n);function c(){var p;clearTimeout(s),(p=i)==null||p.disconnect(),i=null}function f(p,h){p===void 0&&(p=!1),h===void 0&&(h=1),c();const m=n.getBoundingClientRect(),{left:w,top:x,width:k,height:g}=m;if(p||r(),!k||!g)return;const O=Ga(x),S=Ga(l.clientWidth-(w+k)),C=Ga(l.clientHeight-(x+g)),P=Ga(w),R={rootMargin:-O+"px "+-S+"px "+-C+"px "+-P+"px",threshold:jt(0,Ur(1,h))||1};let L=!0;function z(U){const H=U[0].intersectionRatio;if(H!==h){if(!L)return f();H?f(!1,H):s=setTimeout(()=>{f(!1,1e-7)},1e3)}H===1&&!Jv(m,n.getBoundingClientRect())&&f(),L=!1}try{i=new IntersectionObserver(z,{...R,root:l.ownerDocument})}catch{i=new IntersectionObserver(z,R)}i.observe(n)}return f(!0),c}function OC(n,r,i,s){s===void 0&&(s={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:h=!1}=s,m=Pd(n),w=l||c?[...m?vs(m):[],...vs(r)]:[];w.forEach(P=>{l&&P.addEventListener("scroll",i,{passive:!0}),c&&P.addEventListener("resize",i)});const x=m&&p?TC(m,i):null;let k=-1,g=null;f&&(g=new ResizeObserver(P=>{let[T]=P;T&&T.target===m&&g&&(g.unobserve(r),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var R;(R=g)==null||R.observe(r)})),i()}),m&&!h&&g.observe(m),g.observe(r));let O,S=h?So(n):null;h&&C();function C(){const P=So(n);S&&!Jv(S,P)&&i(),S=P,O=requestAnimationFrame(C)}return i(),()=>{var P;w.forEach(T=>{l&&T.removeEventListener("scroll",i),c&&T.removeEventListener("resize",i)}),x==null||x(),(P=g)==null||P.disconnect(),g=null,h&&cancelAnimationFrame(O)}}const NC=tC,_C=nC,LC=ZS,AC=oC,IC=JS,pm=XS,DC=rC,FC=(n,r,i)=>{const s=new Map,l={platform:MC,...i},c={...l.platform,_c:s};return YS(n,r,{...l,platform:c})};var zC=typeof document<"u",jC=function(){},tl=zC?y.useLayoutEffect:jC;function ul(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let i,s,l;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(i=n.length,i!==r.length)return!1;for(s=i;s--!==0;)if(!ul(n[s],r[s]))return!1;return!0}if(l=Object.keys(n),i=l.length,i!==Object.keys(r).length)return!1;for(s=i;s--!==0;)if(!{}.hasOwnProperty.call(r,l[s]))return!1;for(s=i;s--!==0;){const c=l[s];if(!(c==="_owner"&&n.$$typeof)&&!ul(n[c],r[c]))return!1}return!0}return n!==n&&r!==r}function ey(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function hm(n,r){const i=ey(n);return Math.round(r*i)/i}function kc(n){const r=y.useRef(n);return tl(()=>{r.current=n}),r}function BC(n){n===void 0&&(n={});const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:l,elements:{reference:c,floating:f}={},transform:p=!0,whileElementsMounted:h,open:m}=n,[w,x]=y.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[k,g]=y.useState(s);ul(k,s)||g(s);const[O,S]=y.useState(null),[C,P]=y.useState(null),T=y.useCallback(j=>{j!==U.current&&(U.current=j,S(j))},[]),R=y.useCallback(j=>{j!==H.current&&(H.current=j,P(j))},[]),L=c||O,z=f||C,U=y.useRef(null),H=y.useRef(null),G=y.useRef(w),J=h!=null,te=kc(h),he=kc(l),Z=kc(m),ye=y.useCallback(()=>{if(!U.current||!H.current)return;const j={placement:r,strategy:i,middleware:k};he.current&&(j.platform=he.current),FC(U.current,H.current,j).then(B=>{const Q={...B,isPositioned:Z.current!==!1};de.current&&!ul(G.current,Q)&&(G.current=Q,Es.flushSync(()=>{x(Q)}))})},[k,r,i,he,Z]);tl(()=>{m===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,x(j=>({...j,isPositioned:!1})))},[m]);const de=y.useRef(!1);tl(()=>(de.current=!0,()=>{de.current=!1}),[]),tl(()=>{if(L&&(U.current=L),z&&(H.current=z),L&&z){if(te.current)return te.current(L,z,ye);ye()}},[L,z,ye,te,J]);const xe=y.useMemo(()=>({reference:U,floating:H,setReference:T,setFloating:R}),[T,R]),ue=y.useMemo(()=>({reference:L,floating:z}),[L,z]),se=y.useMemo(()=>{const j={position:i,left:0,top:0};if(!ue.floating)return j;const B=hm(ue.floating,w.x),Q=hm(ue.floating,w.y);return p?{...j,transform:"translate("+B+"px, "+Q+"px)",...ey(ue.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:B,top:Q}},[i,p,ue.floating,w.x,w.y]);return y.useMemo(()=>({...w,update:ye,refs:xe,elements:ue,floatingStyles:se}),[w,ye,xe,ue,se])}const UC=n=>{function r(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:n,fn(i){const{element:s,padding:l}=typeof n=="function"?n(i):n;return s&&r(s)?s.current!=null?pm({element:s.current,padding:l}).fn(i):{}:s?pm({element:s,padding:l}).fn(i):{}}}},HC=(n,r)=>({...NC(n),options:[n,r]}),$C=(n,r)=>({..._C(n),options:[n,r]}),WC=(n,r)=>({...DC(n),options:[n,r]}),VC=(n,r)=>({...LC(n),options:[n,r]}),QC=(n,r)=>({...AC(n),options:[n,r]}),KC=(n,r)=>({...IC(n),options:[n,r]}),qC=(n,r)=>({...UC(n),options:[n,r]});var GC="Arrow",ty=y.forwardRef((n,r)=>{const{children:i,width:s=10,height:l=5,...c}=n;return V.jsx(je.svg,{...c,ref:r,width:s,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?i:V.jsx("polygon",{points:"0,0 30,0 15,10"})})});ty.displayName=GC;var YC=ty;function XC(n){const[r,i]=y.useState(void 0);return yt(()=>{if(n){i({width:n.offsetWidth,height:n.offsetHeight});const s=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const c=l[0];let f,p;if("borderBoxSize"in c){const h=c.borderBoxSize,m=Array.isArray(h)?h[0]:h;f=m.inlineSize,p=m.blockSize}else f=n.offsetWidth,p=n.offsetHeight;i({width:f,height:p})});return s.observe(n,{box:"border-box"}),()=>s.unobserve(n)}else i(void 0)},[n]),r}var Md="Popper",[ny,ry]=pl(Md),[ZC,oy]=ny(Md),iy=n=>{const{__scopePopper:r,children:i}=n,[s,l]=y.useState(null);return V.jsx(ZC,{scope:r,anchor:s,onAnchorChange:l,children:i})};iy.displayName=Md;var sy="PopperAnchor",ay=y.forwardRef((n,r)=>{const{__scopePopper:i,virtualRef:s,...l}=n,c=oy(sy,i),f=y.useRef(null),p=Je(r,f),h=y.useRef(null);return y.useEffect(()=>{const m=h.current;h.current=(s==null?void 0:s.current)||f.current,m!==h.current&&c.onAnchorChange(h.current)}),s?null:V.jsx(je.div,{...l,ref:p})});ay.displayName=sy;var Td="PopperContent",[JC,ek]=ny(Td),ly=y.forwardRef((n,r)=>{var q,pe,Ce,be,Me,Oe;const{__scopePopper:i,side:s="bottom",sideOffset:l=0,align:c="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:h=!0,collisionBoundary:m=[],collisionPadding:w=0,sticky:x="partial",hideWhenDetached:k=!1,updatePositionStrategy:g="optimized",onPlaced:O,...S}=n,C=oy(Td,i),[P,T]=y.useState(null),R=Je(r,Ye=>T(Ye)),[L,z]=y.useState(null),U=XC(L),H=(U==null?void 0:U.width)??0,G=(U==null?void 0:U.height)??0,J=s+(c!=="center"?"-"+c:""),te=typeof w=="number"?w:{top:0,right:0,bottom:0,left:0,...w},he=Array.isArray(m)?m:[m],Z=he.length>0,ye={padding:te,boundary:he.filter(nk),altBoundary:Z},{refs:de,floatingStyles:xe,placement:ue,isPositioned:se,middlewareData:j}=BC({strategy:"fixed",placement:J,whileElementsMounted:(...Ye)=>OC(...Ye,{animationFrame:g==="always"}),elements:{reference:C.anchor},middleware:[HC({mainAxis:l+G,alignmentAxis:f}),h&&$C({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?WC():void 0,...ye}),h&&VC({...ye}),QC({...ye,apply:({elements:Ye,rects:dt,availableWidth:gn,availableHeight:Xt})=>{const{width:Zt,height:ir}=dt.reference,wn=Ye.floating.style;wn.setProperty("--radix-popper-available-width",`${gn}px`),wn.setProperty("--radix-popper-available-height",`${Xt}px`),wn.setProperty("--radix-popper-anchor-width",`${Zt}px`),wn.setProperty("--radix-popper-anchor-height",`${ir}px`)}}),L&&qC({element:L,padding:p}),rk({arrowWidth:H,arrowHeight:G}),k&&KC({strategy:"referenceHidden",...ye})]}),[B,Q]=dy(ue),N=wo(O);yt(()=>{se&&(N==null||N())},[se,N]);const F=(q=j.arrow)==null?void 0:q.x,ne=(pe=j.arrow)==null?void 0:pe.y,re=((Ce=j.arrow)==null?void 0:Ce.centerOffset)!==0,[ve,Se]=y.useState();return yt(()=>{P&&Se(window.getComputedStyle(P).zIndex)},[P]),V.jsx("div",{ref:de.setFloating,"data-radix-popper-content-wrapper":"",style:{...xe,transform:se?xe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(be=j.transformOrigin)==null?void 0:be.x,(Me=j.transformOrigin)==null?void 0:Me.y].join(" "),...((Oe=j.hide)==null?void 0:Oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:V.jsx(JC,{scope:i,placedSide:B,onArrowChange:z,arrowX:F,arrowY:ne,shouldHideArrow:re,children:V.jsx(je.div,{"data-side":B,"data-align":Q,...S,ref:R,style:{...S.style,animation:se?void 0:"none"}})})})});ly.displayName=Td;var uy="PopperArrow",tk={top:"bottom",right:"left",bottom:"top",left:"right"},cy=y.forwardRef(function(r,i){const{__scopePopper:s,...l}=r,c=ek(uy,s),f=tk[c.placedSide];return V.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:V.jsx(YC,{...l,ref:i,style:{...l.style,display:"block"}})})});cy.displayName=uy;function nk(n){return n!==null}var rk=n=>({name:"transformOrigin",options:n,fn(r){var C,P,T;const{placement:i,rects:s,middlewareData:l}=r,f=((C=l.arrow)==null?void 0:C.centerOffset)!==0,p=f?0:n.arrowWidth,h=f?0:n.arrowHeight,[m,w]=dy(i),x={start:"0%",center:"50%",end:"100%"}[w],k=(((P=l.arrow)==null?void 0:P.x)??0)+p/2,g=(((T=l.arrow)==null?void 0:T.y)??0)+h/2;let O="",S="";return m==="bottom"?(O=f?x:`${k}px`,S=`${-h}px`):m==="top"?(O=f?x:`${k}px`,S=`${s.floating.height+h}px`):m==="right"?(O=`${-h}px`,S=f?x:`${g}px`):m==="left"&&(O=`${s.floating.width+h}px`,S=f?x:`${g}px`),{data:{x:O,y:S}}}});function dy(n){const[r,i="center"]=n.split("-");return[r,i]}var ok=iy,ik=ay,sk=ly,ak=cy;function lk(n){const r=y.useRef({value:n,previous:n});return y.useMemo(()=>(r.current.value!==n&&(r.current.previous=r.current.value,r.current.value=n),r.current.previous),[n])}var fy=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uk="VisuallyHidden",py=y.forwardRef((n,r)=>V.jsx(je.span,{...n,ref:r,style:{...fy,...n.style}}));py.displayName=uk;var gb=py,ck=[" ","Enter","ArrowUp","ArrowDown"],dk=[" ","Enter"],Co="Select",[Sl,Cl,fk]=IS(Co),[Ei]=pl(Co,[fk,ry]),kl=ry(),[pk,Wr]=Ei(Co),[hk,mk]=Ei(Co),hy=n=>{const{__scopeSelect:r,children:i,open:s,defaultOpen:l,onOpenChange:c,value:f,defaultValue:p,onValueChange:h,dir:m,name:w,autoComplete:x,disabled:k,required:g,form:O}=n,S=kl(r),[C,P]=y.useState(null),[T,R]=y.useState(null),[L,z]=y.useState(!1),U=FS(m),[H,G]=Uc({prop:s,defaultProp:l??!1,onChange:c,caller:Co}),[J,te]=Uc({prop:f,defaultProp:p,onChange:h,caller:Co}),he=y.useRef(null),Z=C?O||!!C.closest("form"):!0,[ye,de]=y.useState(new Set),xe=Array.from(ye).map(ue=>ue.props.value).join(";");return V.jsx(ok,{...S,children:V.jsxs(pk,{required:g,scope:r,trigger:C,onTriggerChange:P,valueNode:T,onValueNodeChange:R,valueNodeHasChildren:L,onValueNodeHasChildrenChange:z,contentId:ti(),value:J,onValueChange:te,open:H,onOpenChange:G,dir:U,triggerPointerDownPosRef:he,disabled:k,children:[V.jsx(Sl.Provider,{scope:r,children:V.jsx(hk,{scope:n.__scopeSelect,onNativeOptionAdd:y.useCallback(ue=>{de(se=>new Set(se).add(ue))},[]),onNativeOptionRemove:y.useCallback(ue=>{de(se=>{const j=new Set(se);return j.delete(ue),j})},[]),children:i})}),Z?V.jsxs(zy,{"aria-hidden":!0,required:g,tabIndex:-1,name:w,autoComplete:x,value:J,onChange:ue=>te(ue.target.value),disabled:k,form:O,children:[J===void 0?V.jsx("option",{value:""}):null,Array.from(ye)]},xe):null]})})};hy.displayName=Co;var my="SelectTrigger",vy=y.forwardRef((n,r)=>{const{__scopeSelect:i,disabled:s=!1,...l}=n,c=kl(i),f=Wr(my,i),p=f.disabled||s,h=Je(r,f.onTriggerChange),m=Cl(i),w=y.useRef("touch"),[x,k,g]=By(S=>{const C=m().filter(R=>!R.disabled),P=C.find(R=>R.value===f.value),T=Uy(C,S,P);T!==void 0&&f.onValueChange(T.value)}),O=S=>{p||(f.onOpenChange(!0),g()),S&&(f.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return V.jsx(ik,{asChild:!0,...c,children:V.jsx(je.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:p,"data-disabled":p?"":void 0,"data-placeholder":jy(f.value)?"":void 0,...l,ref:h,onClick:$e(l.onClick,S=>{S.currentTarget.focus(),w.current!=="mouse"&&O(S)}),onPointerDown:$e(l.onPointerDown,S=>{w.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(O(S),S.preventDefault())}),onKeyDown:$e(l.onKeyDown,S=>{const C=x.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&k(S.key),!(C&&S.key===" ")&&ck.includes(S.key)&&(O(),S.preventDefault())})})})});vy.displayName=my;var yy="SelectValue",gy=y.forwardRef((n,r)=>{const{__scopeSelect:i,className:s,style:l,children:c,placeholder:f="",...p}=n,h=Wr(yy,i),{onValueNodeHasChildrenChange:m}=h,w=c!==void 0,x=Je(r,h.onValueNodeChange);return yt(()=>{m(w)},[m,w]),V.jsx(je.span,{...p,ref:x,style:{pointerEvents:"none"},children:jy(h.value)?V.jsx(V.Fragment,{children:f}):c})});gy.displayName=yy;var vk="SelectIcon",wy=y.forwardRef((n,r)=>{const{__scopeSelect:i,children:s,...l}=n;return V.jsx(je.span,{"aria-hidden":!0,...l,ref:r,children:s||"▼"})});wy.displayName=vk;var yk="SelectPortal",xy=n=>V.jsx(yd,{asChild:!0,...n});xy.displayName=yk;var ko="SelectContent",Sy=y.forwardRef((n,r)=>{const i=Wr(ko,n.__scopeSelect),[s,l]=y.useState();if(yt(()=>{l(new DocumentFragment)},[]),!i.open){const c=s;return c?Es.createPortal(V.jsx(Cy,{scope:n.__scopeSelect,children:V.jsx(Sl.Slot,{scope:n.__scopeSelect,children:V.jsx("div",{children:n.children})})}),c):null}return V.jsx(ky,{...n,ref:r})});Sy.displayName=ko;var cn=10,[Cy,Vr]=Ei(ko),gk="SelectContentImpl",wk=ms("SelectContent.RemoveScroll"),ky=y.forwardRef((n,r)=>{const{__scopeSelect:i,position:s="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:c,onPointerDownOutside:f,side:p,sideOffset:h,align:m,alignOffset:w,arrowPadding:x,collisionBoundary:k,collisionPadding:g,sticky:O,hideWhenDetached:S,avoidCollisions:C,...P}=n,T=Wr(ko,i),[R,L]=y.useState(null),[z,U]=y.useState(null),H=Je(r,q=>L(q)),[G,J]=y.useState(null),[te,he]=y.useState(null),Z=Cl(i),[ye,de]=y.useState(!1),xe=y.useRef(!1);y.useEffect(()=>{if(R)return Pv(R)},[R]),gv();const ue=y.useCallback(q=>{const[pe,...Ce]=Z().map(Oe=>Oe.ref.current),[be]=Ce.slice(-1),Me=document.activeElement;for(const Oe of q)if(Oe===Me||(Oe==null||Oe.scrollIntoView({block:"nearest"}),Oe===pe&&z&&(z.scrollTop=0),Oe===be&&z&&(z.scrollTop=z.scrollHeight),Oe==null||Oe.focus(),document.activeElement!==Me))return},[Z,z]),se=y.useCallback(()=>ue([G,R]),[ue,G,R]);y.useEffect(()=>{ye&&se()},[ye,se]);const{onOpenChange:j,triggerPointerDownPosRef:B}=T;y.useEffect(()=>{if(R){let q={x:0,y:0};const pe=be=>{var Me,Oe;q={x:Math.abs(Math.round(be.pageX)-(((Me=B.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(be.pageY)-(((Oe=B.current)==null?void 0:Oe.y)??0))}},Ce=be=>{q.x<=10&&q.y<=10?be.preventDefault():R.contains(be.target)||j(!1),document.removeEventListener("pointermove",pe),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[R,j,B]),y.useEffect(()=>{const q=()=>j(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[j]);const[Q,N]=By(q=>{const pe=Z().filter(Me=>!Me.disabled),Ce=pe.find(Me=>Me.ref.current===document.activeElement),be=Uy(pe,q,Ce);be&&setTimeout(()=>be.ref.current.focus())}),F=y.useCallback((q,pe,Ce)=>{const be=!xe.current&&!Ce;(T.value!==void 0&&T.value===pe||be)&&(J(q),be&&(xe.current=!0))},[T.value]),ne=y.useCallback(()=>R==null?void 0:R.focus(),[R]),re=y.useCallback((q,pe,Ce)=>{const be=!xe.current&&!Ce;(T.value!==void 0&&T.value===pe||be)&&he(q)},[T.value]),ve=s==="popper"?Gc:Ey,Se=ve===Gc?{side:p,sideOffset:h,align:m,alignOffset:w,arrowPadding:x,collisionBoundary:k,collisionPadding:g,sticky:O,hideWhenDetached:S,avoidCollisions:C}:{};return V.jsx(Cy,{scope:i,content:R,viewport:z,onViewportChange:U,itemRefCallback:F,selectedItem:G,onItemLeave:ne,itemTextRefCallback:re,focusSelectedItem:se,selectedItemText:te,position:s,isPositioned:ye,searchRef:Q,children:V.jsx(gd,{as:wk,allowPinchZoom:!0,children:V.jsx(vd,{asChild:!0,trapped:T.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:$e(l,q=>{var pe;(pe=T.trigger)==null||pe.focus({preventScroll:!0}),q.preventDefault()}),children:V.jsx(md,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:V.jsx(ve,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:q=>q.preventDefault(),...P,...Se,onPlaced:()=>de(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...P.style},onKeyDown:$e(P.onKeyDown,q=>{const pe=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!pe&&q.key.length===1&&N(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let be=Z().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(q.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const Me=q.target,Oe=be.indexOf(Me);be=be.slice(Oe+1)}setTimeout(()=>ue(be)),q.preventDefault()}})})})})})})});ky.displayName=gk;var xk="SelectItemAlignedPosition",Ey=y.forwardRef((n,r)=>{const{__scopeSelect:i,onPlaced:s,...l}=n,c=Wr(ko,i),f=Vr(ko,i),[p,h]=y.useState(null),[m,w]=y.useState(null),x=Je(r,H=>w(H)),k=Cl(i),g=y.useRef(!1),O=y.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:P,focusSelectedItem:T}=f,R=y.useCallback(()=>{if(c.trigger&&c.valueNode&&p&&m&&S&&C&&P){const H=c.trigger.getBoundingClientRect(),G=m.getBoundingClientRect(),J=c.valueNode.getBoundingClientRect(),te=P.getBoundingClientRect();if(c.dir!=="rtl"){const Me=te.left-G.left,Oe=J.left-Me,Ye=H.left-Oe,dt=H.width+Ye,gn=Math.max(dt,G.width),Xt=window.innerWidth-cn,Zt=rm(Oe,[cn,Math.max(cn,Xt-gn)]);p.style.minWidth=dt+"px",p.style.left=Zt+"px"}else{const Me=G.right-te.right,Oe=window.innerWidth-J.right-Me,Ye=window.innerWidth-H.right-Oe,dt=H.width+Ye,gn=Math.max(dt,G.width),Xt=window.innerWidth-cn,Zt=rm(Oe,[cn,Math.max(cn,Xt-gn)]);p.style.minWidth=dt+"px",p.style.right=Zt+"px"}const he=k(),Z=window.innerHeight-cn*2,ye=S.scrollHeight,de=window.getComputedStyle(m),xe=parseInt(de.borderTopWidth,10),ue=parseInt(de.paddingTop,10),se=parseInt(de.borderBottomWidth,10),j=parseInt(de.paddingBottom,10),B=xe+ue+ye+j+se,Q=Math.min(C.offsetHeight*5,B),N=window.getComputedStyle(S),F=parseInt(N.paddingTop,10),ne=parseInt(N.paddingBottom,10),re=H.top+H.height/2-cn,ve=Z-re,Se=C.offsetHeight/2,q=C.offsetTop+Se,pe=xe+ue+q,Ce=B-pe;if(pe<=re){const Me=he.length>0&&C===he[he.length-1].ref.current;p.style.bottom="0px";const Oe=m.clientHeight-S.offsetTop-S.offsetHeight,Ye=Math.max(ve,Se+(Me?ne:0)+Oe+se),dt=pe+Ye;p.style.height=dt+"px"}else{const Me=he.length>0&&C===he[0].ref.current;p.style.top="0px";const Ye=Math.max(re,xe+S.offsetTop+(Me?F:0)+Se)+Ce;p.style.height=Ye+"px",S.scrollTop=pe-re+S.offsetTop}p.style.margin=`${cn}px 0`,p.style.minHeight=Q+"px",p.style.maxHeight=Z+"px",s==null||s(),requestAnimationFrame(()=>g.current=!0)}},[k,c.trigger,c.valueNode,p,m,S,C,P,c.dir,s]);yt(()=>R(),[R]);const[L,z]=y.useState();yt(()=>{m&&z(window.getComputedStyle(m).zIndex)},[m]);const U=y.useCallback(H=>{H&&O.current===!0&&(R(),T==null||T(),O.current=!1)},[R,T]);return V.jsx(Ck,{scope:i,contentWrapper:p,shouldExpandOnScrollRef:g,onScrollButtonChange:U,children:V.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:V.jsx(je.div,{...l,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});Ey.displayName=xk;var Sk="SelectPopperPosition",Gc=y.forwardRef((n,r)=>{const{__scopeSelect:i,align:s="start",collisionPadding:l=cn,...c}=n,f=kl(i);return V.jsx(sk,{...f,...c,ref:r,align:s,collisionPadding:l,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Gc.displayName=Sk;var[Ck,Od]=Ei(ko,{}),Yc="SelectViewport",by=y.forwardRef((n,r)=>{const{__scopeSelect:i,nonce:s,...l}=n,c=Vr(Yc,i),f=Od(Yc,i),p=Je(r,c.onViewportChange),h=y.useRef(0);return V.jsxs(V.Fragment,{children:[V.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),V.jsx(Sl.Slot,{scope:i,children:V.jsx(je.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:p,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:$e(l.onScroll,m=>{const w=m.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:k}=f;if(k!=null&&k.current&&x){const g=Math.abs(h.current-w.scrollTop);if(g>0){const O=window.innerHeight-cn*2,S=parseFloat(x.style.minHeight),C=parseFloat(x.style.height),P=Math.max(S,C);if(P<O){const T=P+g,R=Math.min(O,T),L=T-R;x.style.height=R+"px",x.style.bottom==="0px"&&(w.scrollTop=L>0?L:0,x.style.justifyContent="flex-end")}}}h.current=w.scrollTop})})})]})});by.displayName=Yc;var Ry="SelectGroup",[kk,Ek]=Ei(Ry),bk=y.forwardRef((n,r)=>{const{__scopeSelect:i,...s}=n,l=ti();return V.jsx(kk,{scope:i,id:l,children:V.jsx(je.div,{role:"group","aria-labelledby":l,...s,ref:r})})});bk.displayName=Ry;var Py="SelectLabel",My=y.forwardRef((n,r)=>{const{__scopeSelect:i,...s}=n,l=Ek(Py,i);return V.jsx(je.div,{id:l.id,...s,ref:r})});My.displayName=Py;var cl="SelectItem",[Rk,Ty]=Ei(cl),Oy=y.forwardRef((n,r)=>{const{__scopeSelect:i,value:s,disabled:l=!1,textValue:c,...f}=n,p=Wr(cl,i),h=Vr(cl,i),m=p.value===s,[w,x]=y.useState(c??""),[k,g]=y.useState(!1),O=Je(r,T=>{var R;return(R=h.itemRefCallback)==null?void 0:R.call(h,T,s,l)}),S=ti(),C=y.useRef("touch"),P=()=>{l||(p.onValueChange(s),p.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return V.jsx(Rk,{scope:i,value:s,disabled:l,textId:S,isSelected:m,onItemTextChange:y.useCallback(T=>{x(R=>R||((T==null?void 0:T.textContent)??"").trim())},[]),children:V.jsx(Sl.ItemSlot,{scope:i,value:s,disabled:l,textValue:w,children:V.jsx(je.div,{role:"option","aria-labelledby":S,"data-highlighted":k?"":void 0,"aria-selected":m&&k,"data-state":m?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...f,ref:O,onFocus:$e(f.onFocus,()=>g(!0)),onBlur:$e(f.onBlur,()=>g(!1)),onClick:$e(f.onClick,()=>{C.current!=="mouse"&&P()}),onPointerUp:$e(f.onPointerUp,()=>{C.current==="mouse"&&P()}),onPointerDown:$e(f.onPointerDown,T=>{C.current=T.pointerType}),onPointerMove:$e(f.onPointerMove,T=>{var R;C.current=T.pointerType,l?(R=h.onItemLeave)==null||R.call(h):C.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$e(f.onPointerLeave,T=>{var R;T.currentTarget===document.activeElement&&((R=h.onItemLeave)==null||R.call(h))}),onKeyDown:$e(f.onKeyDown,T=>{var L;((L=h.searchRef)==null?void 0:L.current)!==""&&T.key===" "||(dk.includes(T.key)&&P(),T.key===" "&&T.preventDefault())})})})})});Oy.displayName=cl;var fs="SelectItemText",Ny=y.forwardRef((n,r)=>{const{__scopeSelect:i,className:s,style:l,...c}=n,f=Wr(fs,i),p=Vr(fs,i),h=Ty(fs,i),m=mk(fs,i),[w,x]=y.useState(null),k=Je(r,P=>x(P),h.onItemTextChange,P=>{var T;return(T=p.itemTextRefCallback)==null?void 0:T.call(p,P,h.value,h.disabled)}),g=w==null?void 0:w.textContent,O=y.useMemo(()=>V.jsx("option",{value:h.value,disabled:h.disabled,children:g},h.value),[h.disabled,h.value,g]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=m;return yt(()=>(S(O),()=>C(O)),[S,C,O]),V.jsxs(V.Fragment,{children:[V.jsx(je.span,{id:h.textId,...c,ref:k}),h.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Es.createPortal(c.children,f.valueNode):null]})});Ny.displayName=fs;var _y="SelectItemIndicator",Ly=y.forwardRef((n,r)=>{const{__scopeSelect:i,...s}=n;return Ty(_y,i).isSelected?V.jsx(je.span,{"aria-hidden":!0,...s,ref:r}):null});Ly.displayName=_y;var Xc="SelectScrollUpButton",Ay=y.forwardRef((n,r)=>{const i=Vr(Xc,n.__scopeSelect),s=Od(Xc,n.__scopeSelect),[l,c]=y.useState(!1),f=Je(r,s.onScrollButtonChange);return yt(()=>{if(i.viewport&&i.isPositioned){let p=function(){const m=h.scrollTop>0;c(m)};const h=i.viewport;return p(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,i.isPositioned]),l?V.jsx(Dy,{...n,ref:f,onAutoScroll:()=>{const{viewport:p,selectedItem:h}=i;p&&h&&(p.scrollTop=p.scrollTop-h.offsetHeight)}}):null});Ay.displayName=Xc;var Zc="SelectScrollDownButton",Iy=y.forwardRef((n,r)=>{const i=Vr(Zc,n.__scopeSelect),s=Od(Zc,n.__scopeSelect),[l,c]=y.useState(!1),f=Je(r,s.onScrollButtonChange);return yt(()=>{if(i.viewport&&i.isPositioned){let p=function(){const m=h.scrollHeight-h.clientHeight,w=Math.ceil(h.scrollTop)<m;c(w)};const h=i.viewport;return p(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,i.isPositioned]),l?V.jsx(Dy,{...n,ref:f,onAutoScroll:()=>{const{viewport:p,selectedItem:h}=i;p&&h&&(p.scrollTop=p.scrollTop+h.offsetHeight)}}):null});Iy.displayName=Zc;var Dy=y.forwardRef((n,r)=>{const{__scopeSelect:i,onAutoScroll:s,...l}=n,c=Vr("SelectScrollButton",i),f=y.useRef(null),p=Cl(i),h=y.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return y.useEffect(()=>()=>h(),[h]),yt(()=>{var w;const m=p().find(x=>x.ref.current===document.activeElement);(w=m==null?void 0:m.ref.current)==null||w.scrollIntoView({block:"nearest"})},[p]),V.jsx(je.div,{"aria-hidden":!0,...l,ref:r,style:{flexShrink:0,...l.style},onPointerDown:$e(l.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(s,50))}),onPointerMove:$e(l.onPointerMove,()=>{var m;(m=c.onItemLeave)==null||m.call(c),f.current===null&&(f.current=window.setInterval(s,50))}),onPointerLeave:$e(l.onPointerLeave,()=>{h()})})}),Pk="SelectSeparator",Fy=y.forwardRef((n,r)=>{const{__scopeSelect:i,...s}=n;return V.jsx(je.div,{"aria-hidden":!0,...s,ref:r})});Fy.displayName=Pk;var Jc="SelectArrow",Mk=y.forwardRef((n,r)=>{const{__scopeSelect:i,...s}=n,l=kl(i),c=Wr(Jc,i),f=Vr(Jc,i);return c.open&&f.position==="popper"?V.jsx(ak,{...l,...s,ref:r}):null});Mk.displayName=Jc;var Tk="SelectBubbleInput",zy=y.forwardRef(({__scopeSelect:n,value:r,...i},s)=>{const l=y.useRef(null),c=Je(s,l),f=lk(r);return y.useEffect(()=>{const p=l.current;if(!p)return;const h=window.HTMLSelectElement.prototype,w=Object.getOwnPropertyDescriptor(h,"value").set;if(f!==r&&w){const x=new Event("change",{bubbles:!0});w.call(p,r),p.dispatchEvent(x)}},[f,r]),V.jsx(je.select,{...i,style:{...fy,...i.style},ref:c,defaultValue:r})});zy.displayName=Tk;function jy(n){return n===""||n===void 0}function By(n){const r=wo(n),i=y.useRef(""),s=y.useRef(0),l=y.useCallback(f=>{const p=i.current+f;r(p),(function h(m){i.current=m,window.clearTimeout(s.current),m!==""&&(s.current=window.setTimeout(()=>h(""),1e3))})(p)},[r]),c=y.useCallback(()=>{i.current="",window.clearTimeout(s.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(s.current),[]),[i,l,c]}function Uy(n,r,i){const l=r.length>1&&Array.from(r).every(m=>m===r[0])?r[0]:r,c=i?n.indexOf(i):-1;let f=Ok(n,Math.max(c,0));l.length===1&&(f=f.filter(m=>m!==i));const h=f.find(m=>m.textValue.toLowerCase().startsWith(l.toLowerCase()));return h!==i?h:void 0}function Ok(n,r){return n.map((i,s)=>n[(r+s)%n.length])}var wb=hy,xb=vy,Sb=gy,Cb=wy,kb=xy,Eb=Sy,bb=by,Rb=My,Pb=Oy,Mb=Ny,Tb=Ly,Ob=Ay,Nb=Iy,_b=Fy;export{rE as $,nE as A,lE as B,Zk as C,eE as D,gE as E,sb as F,tb as G,BE as H,Cb as I,EE as J,OE as K,AE as L,zE as M,uw as N,Xk as O,Yk as P,zk as Q,Gk as R,ab as S,Jk as T,ib as U,bb as V,fb as W,hb as X,ME as Y,KE as Z,pb as _,Hk as a,sk as a$,ob as a0,HE as a1,NE as a2,sE as a3,$r as a4,jk as a5,vb as a6,Ik as a7,z1 as a8,Ak as a9,cb as aA,JE as aB,QE as aC,GE as aD,jm as aE,Lk as aF,xE as aG,SE as aH,rb as aI,hE as aJ,Uc as aK,ok as aL,ti as aM,Je as aN,je as aO,$e as aP,ik as aQ,ry as aR,hl as aS,yd as aT,pl as aU,Pv as aV,gd as aW,ms as aX,gv as aY,vd as aZ,md as a_,_k as aa,Dk as ab,pE as ac,kE as ad,LE as ae,VE as af,iE as ag,YE as ah,wE as ai,WE as aj,uE as ak,db as al,aE as am,Rm as an,yE as ao,lb as ap,bE as aq,CE as ar,nb as as,mE as at,qE as au,jE as av,Qk as aw,l2 as ax,Kk as ay,Vk as az,tE as b,ak as b0,IE as b1,PE as b2,ub as b3,XE as b4,FE as b5,eb as b6,TE as b7,vE as b8,ZE as b9,_E as ba,gb as bb,Wk as bc,UE as bd,DE as be,$E as bf,oE as bg,RE as bh,Zw as c,yb as d,mb as e,iv as f,Uk as g,xb as h,dE as i,V as j,Ob as k,fE as l,Nb as m,kb as n,Eb as o,Rb as p,Pb as q,y as r,Tb as s,$k as t,Bk as u,cE as v,Mb as w,_b as x,wb as y,Sb as z};
package/dist/index.html CHANGED
@@ -6,9 +6,9 @@
6
6
  <link rel="icon" type="image/svg+xml" href="/logo.svg" />
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
8
  <title>NextClaw - 系统配置</title>
9
- <script type="module" crossorigin src="/assets/index-DS7D1-KS.js"></script>
10
- <link rel="modulepreload" crossorigin href="/assets/vendor-DJt0Azq5.js">
11
- <link rel="stylesheet" crossorigin href="/assets/index-C63mHRbE.css">
9
+ <script type="module" crossorigin src="/assets/index-C6MeoecJ.js"></script>
10
+ <link rel="modulepreload" crossorigin href="/assets/vendor-CNhxtHCf.js">
11
+ <link rel="stylesheet" crossorigin href="/assets/index-DdXzLuNG.css">
12
12
  </head>
13
13
 
14
14
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/ui",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,11 +28,11 @@
28
28
  "tailwind-merge": "^2.5.4",
29
29
  "zod": "^3.23.8",
30
30
  "zustand": "^5.0.2",
31
- "@nextclaw/ncp-http-agent-client": "0.3.2",
32
- "@nextclaw/ncp-react": "0.3.3",
33
- "@nextclaw/agent-chat-ui": "0.2.2",
31
+ "@nextclaw/agent-chat": "0.1.2",
32
+ "@nextclaw/agent-chat-ui": "0.2.3",
34
33
  "@nextclaw/ncp": "0.3.2",
35
- "@nextclaw/agent-chat": "0.1.2"
34
+ "@nextclaw/ncp-http-agent-client": "0.3.2",
35
+ "@nextclaw/ncp-react": "0.3.4"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@testing-library/react": "^16.3.0",
@@ -0,0 +1,41 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import userEvent from '@testing-library/user-event';
3
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
4
+ import AppContent from '@/App';
5
+
6
+ const mocks = vi.hoisted(() => ({
7
+ refetch: vi.fn(),
8
+ useAuthStatus: vi.fn()
9
+ }));
10
+
11
+ vi.mock('@/hooks/use-auth', () => ({
12
+ useAuthStatus: mocks.useAuthStatus
13
+ }));
14
+
15
+ describe('App auth bootstrap', () => {
16
+ beforeEach(() => {
17
+ mocks.refetch.mockReset();
18
+ mocks.useAuthStatus.mockReset();
19
+ });
20
+
21
+ it('shows an actionable error state instead of staying blank when auth bootstrap fails', async () => {
22
+ const user = userEvent.setup();
23
+ mocks.useAuthStatus.mockReturnValue({
24
+ isLoading: false,
25
+ isError: true,
26
+ isRefetching: false,
27
+ error: new Error('Timed out waiting for remote request response after 5000ms: GET /api/auth/status'),
28
+ refetch: mocks.refetch,
29
+ data: undefined
30
+ });
31
+
32
+ render(<AppContent />);
33
+
34
+ expect(screen.getByRole('heading', { name: /load authentication status/i })).toBeTruthy();
35
+ expect(screen.getByText('Timed out waiting for remote request response after 5000ms: GET /api/auth/status')).toBeTruthy();
36
+
37
+ await user.click(screen.getByRole('button', { name: /retry/i }));
38
+
39
+ expect(mocks.refetch).toHaveBeenCalledTimes(1);
40
+ });
41
+ });