velloo 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +1 -1
  2. package/canvas/assets/index-DZFrkC4P.js +29 -0
  3. package/canvas/assets/index-gB0StCrx.css +2 -0
  4. package/canvas/assets/lucide-all-Bu8-9UDF.js +1 -0
  5. package/canvas/assets/{radix-C3HaOB-d.js → radix-gmpYzWRH.js} +1 -1
  6. package/canvas/index.html +3 -3
  7. package/chunk-0s6drs3n.js +2 -0
  8. package/chunk-0zen7bzb.js +3 -0
  9. package/{chunk-er1fxb7d.js → chunk-1xb88e07.js} +1 -1
  10. package/{chunk-jv0xggh0.js → chunk-2e3nd4tz.js} +1 -1
  11. package/{chunk-08sv3k41.js → chunk-2fgfex9b.js} +1 -1
  12. package/{chunk-a84n72m2.js → chunk-2p37rp3j.js} +1 -1
  13. package/{chunk-ydhwv29b.js → chunk-2zbn6641.js} +2 -2
  14. package/{chunk-6w6ch4ce.js → chunk-3px2d1j1.js} +1 -1
  15. package/{chunk-2c7jbx46.js → chunk-4e9jh482.js} +1 -1
  16. package/{chunk-dgwjpbp9.js → chunk-4g250157.js} +1 -1
  17. package/{chunk-sjgqnykd.js → chunk-4ma2wnqw.js} +1 -1
  18. package/{chunk-x4f4k9pp.js → chunk-59zas5y2.js} +7 -7
  19. package/{chunk-0fe83yzt.js → chunk-5wv5a52y.js} +1 -1
  20. package/{chunk-bwnvcncx.js → chunk-6zz9kfbd.js} +1 -1
  21. package/{chunk-mh2pr7cq.js → chunk-7cvhnp9h.js} +1 -1
  22. package/{chunk-1h55s5he.js → chunk-7s8frnag.js} +1 -1
  23. package/chunk-7t13w87m.js +2 -0
  24. package/{chunk-zb6hc1y0.js → chunk-7yaafw73.js} +1 -1
  25. package/chunk-88eqqdk1.js +688 -0
  26. package/{chunk-ampmdzz4.js → chunk-8z3ykvcs.js} +1 -1
  27. package/{chunk-r22epxz2.js → chunk-98vvrj0c.js} +1 -1
  28. package/{chunk-vdkrbzh1.js → chunk-9cdwhrkh.js} +1 -1
  29. package/{chunk-xt5ayg7g.js → chunk-9p1dk5cb.js} +1 -1
  30. package/{chunk-dg6z4vdd.js → chunk-9psr8atb.js} +1 -1
  31. package/{chunk-4fj5tahv.js → chunk-9ydc34wc.js} +1 -1
  32. package/{chunk-pp86v6m6.js → chunk-as08hzp3.js} +1 -1
  33. package/chunk-asbajsmd.js +5 -0
  34. package/{chunk-vgmr98cv.js → chunk-avkfsc3p.js} +1 -1
  35. package/{chunk-ngnymg2q.js → chunk-bhx8k09w.js} +1 -1
  36. package/{chunk-3e8vez4d.js → chunk-c4fym47a.js} +63 -19
  37. package/{chunk-jb21jkp1.js → chunk-c6hywdvq.js} +1 -1
  38. package/{chunk-rpwpeph5.js → chunk-f0vsjfpc.js} +1 -1
  39. package/{chunk-ek71z2fv.js → chunk-g71v35gd.js} +1 -1
  40. package/{chunk-80r93t2e.js → chunk-hfzg98c8.js} +1 -1
  41. package/{chunk-jfx9xjmr.js → chunk-js6mz7h1.js} +1 -1
  42. package/{chunk-4dn75m6t.js → chunk-mfbxfb9b.js} +1 -1
  43. package/{chunk-mnapdp1y.js → chunk-mt8ds8zj.js} +1 -1
  44. package/chunk-n9t36h0q.js +2 -0
  45. package/{chunk-fsbsksga.js → chunk-nev5mv85.js} +1 -1
  46. package/{chunk-40xgcth8.js → chunk-nte0t7v3.js} +2 -2
  47. package/{chunk-hcb68zt7.js → chunk-p62fygqz.js} +1 -1
  48. package/{chunk-ayrb3qnm.js → chunk-p6e1eg76.js} +1 -1
  49. package/{chunk-7eq7nx37.js → chunk-ph2jfg1x.js} +1 -1
  50. package/{chunk-n9gs6yx9.js → chunk-pve2mmnr.js} +1 -1
  51. package/{chunk-avns4dbf.js → chunk-sn9vg42q.js} +1 -1
  52. package/{chunk-dy41n60j.js → chunk-t2w8a591.js} +5 -5
  53. package/{chunk-735ezz23.js → chunk-t5m5mznb.js} +2 -2
  54. package/{chunk-6nqghjda.js → chunk-t947mxr1.js} +1 -1
  55. package/chunk-tt7fys2w.js +2 -0
  56. package/chunk-wafb2xm9.js +6 -0
  57. package/{chunk-sn3x2m0m.js → chunk-whw3epmr.js} +1 -1
  58. package/{chunk-j11fyeqh.js → chunk-wndntr7s.js} +1 -1
  59. package/{chunk-7eyb8yrf.js → chunk-wnwgqvtd.js} +1 -1
  60. package/{chunk-v40fn08f.js → chunk-wp123630.js} +2 -2
  61. package/{chunk-ccszg02q.js → chunk-wvs939t5.js} +1 -1
  62. package/{chunk-jr0ss0mm.js → chunk-z21hg6j3.js} +2 -2
  63. package/cli.js +1 -1
  64. package/package.json +1 -1
  65. package/pkgs/helpers/src/descriptors.ts +7 -1
  66. package/pkgs/provider-antd/src/index.ts +1 -0
  67. package/pkgs/provider-chakra/src/index.ts +1 -0
  68. package/pkgs/provider-mui/src/index.ts +1 -0
  69. package/pkgs/provider-none/src/index.ts +42 -1
  70. package/pkgs/provider-none/src/intro.ts +2 -2
  71. package/pkgs/schema/src/config.ts +19 -0
  72. package/pkgs/schema/src/extension.ts +26 -0
  73. package/pkgs/schema/src/index.ts +10 -0
  74. package/pkgs/schema/src/node.ts +99 -0
  75. package/pkgs/schema/src/screen.ts +7 -0
  76. package/pkgs/shadcn-snapshot/dist/manifest.json +9 -1
  77. package/skills/velloo-setup/SKILL.md +70 -48
  78. package/canvas/assets/index-BCvDZiBo.css +0 -2
  79. package/canvas/assets/index-ClaBqcaS.js +0 -28
  80. package/canvas/assets/lucide-all-iIF-pmzN.js +0 -1
  81. package/chunk-308ynsxd.js +0 -2
  82. package/chunk-9vg3yafz.js +0 -3
  83. package/chunk-eyr8hrzf.js +0 -2
  84. package/chunk-k17gfwq3.js +0 -2
  85. package/chunk-rgasy862.js +0 -5
  86. package/chunk-t448rrfr.js +0 -2
  87. package/chunk-tdsk5wxa.js +0 -451
  88. package/chunk-vsv8z729.js +0 -6
@@ -38,4 +38,4 @@ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,r as n,t as r}f
38
38
  `},hr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},gr=function(){i.useEffect(function(){return document.body.setAttribute(pr,(hr()+1).toString()),function(){var e=hr()-1;e<=0?document.body.removeAttribute(pr):document.body.setAttribute(pr,e.toString())}},[])},_r=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?`margin`:r;gr();var o=i.useMemo(function(){return dr(a)},[a]);return i.createElement(fr,{styles:mr(o,!t,a,n?``:`!important`)})},vr=!1;if(typeof window<`u`)try{var yr=Object.defineProperty({},"passive",{get:function(){return vr=!0,!0}});window.addEventListener(`test`,yr,yr),window.removeEventListener(`test`,yr,yr)}catch{vr=!1}var br=vr?{passive:!1}:!1,xr=function(e){return e.tagName===`TEXTAREA`},Sr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!xr(e)&&n[t]===`visible`)},Cr=function(e){return Sr(e,`overflowY`)},wr=function(e){return Sr(e,`overflowX`)},Tr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Or(e,r)){var i=kr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Er=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Dr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Or=function(e,t){return e===`v`?Cr(t):wr(t)},kr=function(e,t){return e===`v`?Er(t):Dr(t)},Ar=function(e,t){return e===`h`&&t===`rtl`?-1:1},jr=function(e,t,n,r,i){var a=Ar(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=kr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Or(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Mr=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Nr=function(e){return[e.deltaX,e.deltaY]},Pr=function(e){return e&&`current`in e?e.current:e},Fr=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ir=function(e){return`
39
39
  .block-interactivity-${e} {pointer-events: none;}
40
40
  .allow-interactivity-${e} {pointer-events: all;}
41
- `},Lr=0,Rr=[];function zr(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),a=i.useState(Lr++)[0],o=i.useState(sr)[0],s=i.useRef(e);i.useEffect(function(){s.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${a}`);var t=Ln([e.lockRef.current],(e.shards||[]).map(Pr),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${a}`)}),function(){document.body.classList.remove(`block-interactivity-${a}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${a}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=i.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var i=Mr(e),a=n.current,o=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(o)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Tr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Tr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(o||c)&&(r.current=l),!l)return!0;var h=r.current||l;return jr(h,t,e,h===`h`?o:c,!0)},[]),l=i.useCallback(function(e){var n=e;if(Rr.length&&Rr[Rr.length-1]===o){var r=`deltaY`in n?Nr(n):Mr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Fr(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var a=(s.current.shards||[]).map(Pr).filter(Boolean).filter(function(e){return e.contains(n.target)});(a.length>0?c(n,a[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=i.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Br(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=i.useCallback(function(e){n.current=Mr(e),r.current=void 0},[]),f=i.useCallback(function(t){u(t.type,Nr(t),t.target,c(t,e.lockRef.current))},[]),p=i.useCallback(function(t){u(t.type,Mr(t),t.target,c(t,e.lockRef.current))},[]);i.useEffect(function(){return Rr.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,br),document.addEventListener(`touchmove`,l,br),document.addEventListener(`touchstart`,d,br),function(){Rr=Rr.filter(function(e){return e!==o}),document.removeEventListener(`wheel`,l,br),document.removeEventListener(`touchmove`,l,br),document.removeEventListener(`touchstart`,d,br)}},[]);var m=e.removeScrollBar,h=e.inert;return i.createElement(i.Fragment,null,h?i.createElement(o,{styles:Ir(a)}):null,m?i.createElement(_r,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Br(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Vr=Zn(Qn,zr),Hr=i.forwardRef(function(e,t){return i.createElement(er,Fn({},e,{ref:t,sideCar:Vr}))});Hr.classNames=er.classNames;var Ur=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Wr=new WeakMap,Gr=new WeakMap,Kr={},qr=0,Jr=function(e){return e&&(e.host||Jr(e.parentNode))},Yr=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Jr(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Xr=function(e,t,n,r){var i=Yr(t,Array.isArray(e)?e:[e]);Kr[n]||(Kr[n]=new WeakMap);var a=Kr[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Wr.get(e)||0)+1,l=(a.get(e)||0)+1;Wr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Gr.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),qr++,function(){o.forEach(function(e){var t=Wr.get(e)-1,i=a.get(e)-1;Wr.set(e,t),a.set(e,i),t||(Gr.has(e)||e.removeAttribute(r),Gr.delete(e)),i||e.removeAttribute(n)}),qr--,qr||(Wr=new WeakMap,Wr=new WeakMap,Gr=new WeakMap,Kr={})}},Zr=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ur(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Xr(r,i,n,`aria-hidden`)):function(){return null}},Qr=Object.defineProperty,J=(e,t)=>Qr(e,`name`,{value:t,configurable:!0}),$r=`Dialog`,[ei,ti]=L($r),[ni,ri]=ei($r),ii=J(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=i.useRef(null),l=i.useRef(null),[u,d]=V({prop:r,defaultProp:a??!1,onChange:o,caller:$r}),[f,p]=i.useState(0),[m,h]=i.useState(0);return(0,D.jsx)(ni,{scope:t,triggerRef:c,contentRef:l,contentId:U(),titleId:U(),descriptionId:U(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:i.useCallback(()=>d(e=>!e),[d]),modal:s,children:n})},`Dialog`),ai=`DialogTrigger`,oi=i.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=ri(ai,n),a=l(t,i.triggerRef);return(0,D.jsx)(A.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Ei(i.open),...r,ref:a,onClick:z(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),si=`DialogPortal`,[ci,li]=ei(si,{forceMount:void 0}),ui=J(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=ri(si,t);return(0,D.jsx)(ci,{scope:t,forceMount:n,children:i.Children.map(r,e=>(0,D.jsx)(H,{present:n||o.open,children:(0,D.jsx)(Dn,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),di=`DialogOverlay`,fi=i.forwardRef(J(function(e,t){let n=li(di,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ri(di,e.__scopeDialog);return a.modal?(0,D.jsx)(H,{present:r||a.open,children:(0,D.jsx)(mi,{...i,ref:t})}):null},`DialogOverlay`)),pi=f(`DialogOverlay.RemoveScroll`),mi=i.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=ri(di,n),a=l(t,rn());return(0,D.jsx)(Hr,{as:pi,allowPinchZoom:!0,shards:[i.contentRef],children:(0,D.jsx)(A.div,{"data-state":Ei(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),hi=`DialogContent`,gi=i.forwardRef(J(function(e,t){let n=li(hi,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ri(hi,e.__scopeDialog);return(0,D.jsx)(H,{present:r||a.open,children:a.modal?(0,D.jsx)(_i,{...i,ref:t}):(0,D.jsx)(vi,{...i,ref:t})})},`DialogContent`)),_i=i.forwardRef(J(function(e,t){let n=ri(hi,e.__scopeDialog),r=i.useRef(null),a=l(t,n.contentRef,r);return i.useEffect(()=>{let e=r.current;if(e)return Zr(e)},[]),(0,D.jsx)(yi,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),vi=i.forwardRef(J(function(e,t){let n=ri(hi,e.__scopeDialog),r=i.useRef(!1),a=i.useRef(!1);return(0,D.jsx)(yi,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let i=t.target;n.triggerRef.current?.contains(i)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&a.current&&t.preventDefault()}})},`DialogContentNonModal`)),yi=i.forwardRef(J(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ri(hi,n);return Nn(),(0,D.jsx)(D.Fragment,{children:(0,D.jsx)(mn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,D.jsx)(nn,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Ei(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),bi=`DialogTitle`,xi=i.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=ri(bi,n),{setTitleCount:a}=i;return B(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,D.jsx)(A.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Si=`DialogDescription`,Ci=i.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=ri(Si,n),{setDescriptionCount:a}=i;return B(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,D.jsx)(A.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),wi=`DialogClose`,Ti=i.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=ri(wi,n);return(0,D.jsx)(A.button,{type:`button`,...r,ref:t,onClick:z(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Ei(e){return e?`open`:`closed`}J(Ei,`getState`);var Di=Object.defineProperty,Oi=(e,t)=>Di(e,`name`,{value:t,configurable:!0}),[ki,Ai]=L(`AlertDialog`,[ti]),ji=ti(),Mi=Oi(e=>{let{__scopeAlertDialog:t,...n}=e,r=ji(t);return(0,D.jsx)(ii,{...r,...n,modal:!0})},`AlertDialog`);i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=ji(n);return(0,D.jsx)(oi,{...i,...r,ref:t})},`AlertDialogTrigger`));var Ni=Oi(e=>{let{__scopeAlertDialog:t,...n}=e,r=ji(t);return(0,D.jsx)(ui,{...r,...n})},`AlertDialogPortal`),Pi=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=ji(n);return(0,D.jsx)(fi,{...i,...r,ref:t})},`AlertDialogOverlay`)),[Fi,Ii]=ki(`AlertDialogContent`),Li=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,children:r,...a}=e,o=ji(n),s=l(t,i.useRef(null)),c=i.useRef(null);return(0,D.jsx)(Fi,{scope:n,cancelRef:c,children:(0,D.jsx)(gi,{role:`alertdialog`,...o,...a,ref:s,onOpenAutoFocus:z(a.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),Ri=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=ji(n);return(0,D.jsx)(xi,{...i,...r,ref:t})},`AlertDialogTitle`)),zi=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=ji(n);return(0,D.jsx)(Ci,{...i,...r,ref:t})},`AlertDialogDescription`)),Bi=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=ji(n);return(0,D.jsx)(Ti,{...i,...r,ref:t})},`AlertDialogAction`)),Vi=`AlertDialogCancel`,Hi=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Ii(Vi,n),a=ji(n),o=l(t,i);return(0,D.jsx)(Ti,{...a,...r,ref:o})},`AlertDialogCancel`)),Ui=Mi,Wi=Ni,Gi=Pi,Ki=Li,qi=Bi,Ji=Hi,Yi=Ri,Xi=zi,Zi=Object.defineProperty,Qi=(e,t)=>Zi(e,`name`,{value:t,configurable:!0}),$i=`Avatar`,[ea,ta]=L($i),na=[0,()=>void 0],[ra,ia]=ea($i),aa=i.forwardRef(Qi(function(e,t){let{__scopeAvatar:n,...r}=e,[a,o]=i.useState(`idle`),[s,c]=ua();return(0,D.jsx)(ra,{scope:n,imageLoadingStatus:a,setImageLoadingStatus:o,imageCount:s,setImageCount:c,children:(0,D.jsx)(A.span,{...r,ref:t})})},`Avatar`)),oa=`AvatarFallback`,sa=i.forwardRef(Qi(function(e,t){let{__scopeAvatar:n,delayMs:r,...a}=e,o=ia(oa,n),[s,c]=i.useState(r===void 0);return i.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>c(!0),r);return()=>window.clearTimeout(e)}},[r]),s&&o.imageLoadingStatus!==`loaded`?(0,D.jsx)(A.span,{...a,ref:t}):null},`AvatarFallback`));function ca(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return B(()=>{if(!e){n(`error`);return}let t=new window.Image,a=Qi(e=>{let t=e.currentTarget;n(la(t))},`handleLoad`),o=Qi(()=>n(`error`),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(la(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(`idle`)}},[e,i,r,n]),t}Qi(ca,`useImageLoadingStatus`);function la(e){return e.complete?e.naturalWidth>0?`loaded`:`error`:`loading`}Qi(la,`getImageLoadingStatus`);function ua(){return na}Qi(ua,`useImageCount`);function da(e){}Qi(da,`useUpdateImageCount`);var fa=Object.defineProperty,pa=(e,t)=>fa(e,`name`,{value:t,configurable:!0});function ma(e){let[t,n]=i.useState(void 0);return B(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}pa(ma,`useSize`);var ha=Object.defineProperty,ga=(e,t)=>ha(e,`name`,{value:t,configurable:!0}),_a=`Checkbox`,[va,ya]=L(_a),[ba,xa]=va(_a);function Sa(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:o,form:s,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=V({prop:n,defaultProp:a??!1,onChange:l,caller:_a}),[h,g]=i.useState(null),[_,v]=i.useState(null),y=i.useRef(!1),[b,x]=i.useReducer(e=>e+1,0),S=!h||!!s||!!h.closest(`form`),C={checked:p,disabled:o,setChecked:m,control:h,setControl:g,name:c,form:s,value:d,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:u,defaultChecked:!ja(a)&&a,isFormControl:S,bubbleInput:_,setBubbleInput:v};return(0,D.jsx)(ba,{scope:t,...C,children:Aa(f)?f(C):r})}ga(Sa,`CheckboxProvider`);var Ca=`CheckboxTrigger`,wa=i.forwardRef(ga(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a){let{control:o,value:s,disabled:c,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=xa(Ca,e),v=l(a,f),y=i.useRef(u);return i.useEffect(()=>{let e=o?.form;if(e){let t=ga(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,p]),(0,D.jsx)(A.button,{type:`button`,role:`checkbox`,"aria-checked":ja(u)?`mixed`:u,"aria-required":d,"data-state":Ma(u),"data-disabled":c?``:void 0,disabled:c,value:s,...r,ref:v,onKeyDown:z(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:z(n,e=>{h(),p(e=>ja(e)?!0:!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`CheckboxTrigger`)),Ta=i.forwardRef(ga(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,D.jsx)(Sa,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(wa,{...d,ref:t,__scopeCheckbox:n}),e&&(0,D.jsx)(ka,{__scopeCheckbox:n})]})})},`Checkbox`)),Ea=`CheckboxIndicator`,Da=i.forwardRef(ga(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=xa(Ea,n);return(0,D.jsx)(H,{present:r||ja(a.checked)||a.checked===!0,children:(0,D.jsx)(A.span,{"data-state":Ma(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Oa=`CheckboxBubbleInput`,ka=i.forwardRef(ga(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:a,hasConsumerStoppedPropagationRef:o,userInteractionCount:s,checked:c,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=xa(Oa,e),v=l(r,_),y=ma(a),b=i.useRef(!1),x=i.useRef(c),S=i.useRef(s);i.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=s!==S.current;S.current=s;let i=x.current!==c;x.current=c;let a=!(r&&o.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});e.indeterminate=ja(c),n.call(e,!ja(c)&&c),e.dispatchEvent(t),b.current=!1}},[g,c,o,s]);let C=i.useRef(!ja(c)&&c);return(0,D.jsx)(A.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...n,tabIndex:-1,ref:v,onClick:z(t,e=>{b.current&&e.stopPropagation()}),style:{...n.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Aa(e){return typeof e==`function`}ga(Aa,`isFunction`);function ja(e){return e===`indeterminate`}ga(ja,`isIndeterminate`);function Ma(e){return ja(e)?`indeterminate`:e?`checked`:`unchecked`}ga(Ma,`getState`);var Na=[`top`,`right`,`bottom`,`left`],Pa=Math.min,Fa=Math.max,Ia=Math.round,La=Math.floor,Ra=e=>({x:e,y:e}),za={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ba(e,t,n){return Fa(e,Pa(t,n))}function Va(e,t){return typeof e==`function`?e(t):e}function Ha(e){return e.split(`-`)[0]}function Ua(e){return e.split(`-`)[1]}function Wa(e){return e===`x`?`y`:`x`}function Ga(e){return e===`y`?`height`:`width`}function Ka(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function qa(e){return Wa(Ka(e))}function Ja(e,t,n){n===void 0&&(n=!1);let r=Ua(e),i=qa(e),a=Ga(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ro(o)),[o,ro(o)]}function Ya(e){let t=ro(e);return[Xa(e),t,Xa(t)]}function Xa(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Za=[`left`,`right`],Qa=[`right`,`left`],$a=[`top`,`bottom`],eo=[`bottom`,`top`];function to(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Qa:Za:t?Za:Qa;case`left`:case`right`:return t?$a:eo;default:return[]}}function no(e,t,n,r){let i=Ua(e),a=to(Ha(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Xa)))),a}function ro(e){let t=Ha(e);return za[t]+e.slice(t.length)}function io(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ao(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:io(e)}function oo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function so(e,t,n){let{reference:r,floating:i}=e,a=Ka(t),o=qa(t),s=Ga(o),c=Ha(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ua(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function co(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Va(t,e),p=ao(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=oo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=oo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var lo=50,uo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:co},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=so(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<lo&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=so(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},fo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Va(e,t)||{};if(l==null)return{};let d=ao(u),f={x:n,y:r},p=qa(i),m=Ga(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Pa(d[_],T),D=Pa(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Ba(E,k,O),j=!c.arrow&&Ua(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),po=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Va(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ha(r),_=Ka(o),v=Ha(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ro(o)]:Ya(o)),x=p!==`none`;!d&&x&&b.push(...no(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ja(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Ka(t)||T.every(e=>Ka(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Ka(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function mo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ho(e){return Na.some(t=>e[t]>=0)}var go=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Va(e,t);switch(i){case`referenceHidden`:{let e=mo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ho(e)}}}case`escaped`:{let e=mo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ho(e)}}}default:return{}}}}},_o=new Set([`left`,`top`]);async function vo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ha(n),s=Ua(n),c=Ka(n)===`y`,l=_o.has(o)?-1:1,u=a&&c?-1:1,d=Va(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var yo=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await vo(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},bo=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Va(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ka(i),p=Wa(f),m=u[p],h=u[f],g=(e,t)=>Ba(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},xo=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Va(e,t),u={x:n,y:r},d=Ka(i),f=Wa(d),p=u[f],m=u[d],h=Va(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=_o.has(Ha(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},So=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Va(e,t),c=await i.detectOverflow(t,s),l=Ha(n),u=Ua(n),d=Ka(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Pa(p-c[m],g),y=Pa(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Fa(c.left,c.right):S=p-2*Fa(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Co(){return typeof window<`u`}function wo(e){return Eo(e)?(e.nodeName||``).toLowerCase():`#document`}function Y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function To(e){return((Eo(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Eo(e){return Co()?e instanceof Node||e instanceof Y(e).Node:!1}function Do(e){return Co()?e instanceof Element||e instanceof Y(e).Element:!1}function Oo(e){return Co()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function ko(e){return!Co()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}function Ao(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Vo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function jo(e){return/^(table|td|th)$/.test(wo(e))}function Mo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var No=/transform|translate|scale|rotate|perspective|filter/,Po=/paint|layout|strict|content/,Fo=e=>!!e&&e!==`none`,Io;function Lo(e){let t=Do(e)?Vo(e):e;return Fo(t.transform)||Fo(t.translate)||Fo(t.scale)||Fo(t.rotate)||Fo(t.perspective)||!zo()&&(Fo(t.backdropFilter)||Fo(t.filter))||No.test(t.willChange||``)||Po.test(t.contain||``)}function Ro(e){let t=Uo(e);for(;Oo(t)&&!Bo(t);){if(Lo(t))return t;if(Mo(t))return null;t=Uo(t)}return null}function zo(){return Io??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Io}function Bo(e){return/^(html|body|#document)$/.test(wo(e))}function Vo(e){return Y(e).getComputedStyle(e)}function Ho(e){return Do(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Uo(e){if(wo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ko(e)&&e.host||To(e);return ko(t)?t.host:t}function Wo(e){let t=Uo(e);return Bo(t)?(e.ownerDocument||e).body:Oo(t)&&Ao(t)?t:Wo(t)}function Go(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Wo(e),i=r===e.ownerDocument?.body,a=Y(r);if(i){let e=Ko(a);return t.concat(a,a.visualViewport||[],Ao(r)?r:[],e&&n?Go(e):[])}return t.concat(r,Go(r,[],n))}function Ko(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qo(e){let t=Vo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Oo(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ia(n)!==a||Ia(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Jo(e){return Do(e)?e:e.contextElement}function Yo(e){let t=Jo(e);if(!Oo(t))return Ra(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=qo(t),o=(a?Ia(n.width):n.width)/r,s=(a?Ia(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Xo=Ra(0);function Zo(e){let t=Y(e);return!zo()||!t.visualViewport?Xo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qo(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Y(e)}function $o(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Jo(e),o=Ra(1);t&&(r?Do(r)&&(o=Yo(r)):o=Yo(e));let s=Qo(a,n,r)?Zo(a):Ra(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Y(a),t=Do(r)?Y(r):r,n=e,i=Ko(n);for(;i&&t!==n;){let e=Yo(i),t=i.getBoundingClientRect(),r=Vo(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Y(i),i=Ko(n)}}return oo({width:u,height:d,x:c,y:l})}function es(e,t){let n=Ho(e).scrollLeft;return t?t.left+n:$o(To(e)).left+n}function ts(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-es(e,n),y:n.top+t.scrollTop}}function ns(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=To(r),s=t?Mo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ra(1),u=Ra(0),d=Oo(r);if((d||!a)&&((wo(r)!==`body`||Ao(o))&&(c=Ho(r)),d)){let e=$o(r);l=Yo(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ts(o,c):Ra(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function rs(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function is(e){let t=Ho(e),n=e.ownerDocument.body,r=Fa(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Fa(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+es(e),o=-t.scrollTop;return Vo(n).direction===`rtl`&&(a+=Fa(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var as=25;function os(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Y(e),a=To(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!zo()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(es(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=as&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ss(e,t){let n=$o(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Yo(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function cs(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=os(e,n,t);else if(t===`document`)r=is(To(e));else if(Do(t))r=ss(t,n);else{let n=Zo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return oo(r)}function ls(e,t){let n=t.get(e);if(n)return n;let r=Go(e,[],!1).filter(e=>Do(e)&&wo(e)!==`body`),i=null,a=Vo(e).position===`fixed`,o=a?Uo(e):e;for(;Do(o)&&!Bo(o);){let e=Vo(o),t=Lo(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Uo(o)}return t.set(e,r),r}function us(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Mo(t)?[]:ls(t,this._c):[].concat(n),r],o=cs(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=cs(t,a[e],i);s=Fa(n.top,s),c=Pa(n.right,c),l=Pa(n.bottom,l),u=Fa(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ds(e){let{width:t,height:n}=qo(e);return{width:t,height:n}}function fs(e,t,n){let r=Oo(t),i=To(t),a=n===`fixed`,o=$o(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ra(0);if((r||!a)&&((wo(t)!==`body`||Ao(i))&&(s=Ho(t)),r)){let e=$o(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=es(i));let l=i&&!r&&!a?ts(i,s):Ra(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ps(e){return Vo(e).position===`static`}function ms(e,t){if(!Oo(e)||Vo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return To(e)===n&&(n=n.ownerDocument.body),n}function hs(e,t){let n=Y(e);if(Mo(e))return n;if(!Oo(e)){let t=Uo(e);for(;t&&!Bo(t);){if(Do(t)&&!ps(t))return t;t=Uo(t)}return n}let r=ms(e,t);for(;r&&jo(r)&&ps(r);)r=ms(r,t);return r&&Bo(r)&&ps(r)&&!Lo(r)?n:r||Ro(e)||n}var gs=async function(e){let t=this.getOffsetParent||hs,n=this.getDimensions,r=await n(e.floating);return{reference:fs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _s(e){return Vo(e).direction===`rtl`}var vs={convertOffsetParentRelativeRectToViewportRelativeRect:ns,getDocumentElement:To,getClippingRect:us,getOffsetParent:hs,getElementRects:gs,getClientRects:rs,getDimensions:ds,getScale:Yo,isElement:Do,isRTL:_s};function ys(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bs(e,t,n){let r=null,i,a=To(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=La(d),h=La(a.clientWidth-(u+f)),g=La(a.clientHeight-(d+p)),_=La(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Fa(0,Pa(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!ys(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Y(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function xs(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Jo(e),u=i||a?[...l?Go(l):[],...t?Go(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?bs(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?$o(e):null;c&&g();function g(){let t=$o(e);h&&!ys(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ss=yo,Cs=bo,ws=po,Ts=So,Es=go,Ds=fo,Os=xo,ks=(e,t,n)=>{let r=new Map,i=n??{},a={...vs,...i.platform,_c:r};return uo(e,t,{...i,platform:a})},As=typeof document<`u`?i.useLayoutEffect:function(){};function js(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!js(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!js(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ms(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ns(e,t){let n=Ms(e);return Math.round(t*n)/n}function Ps(e){let t=i.useRef(e);return As(()=>{t.current=e}),t}function Fs(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:a,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=i.useState(r);js(p,r)||m(r);let[h,g]=i.useState(null),[_,v]=i.useState(null),y=i.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=i.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=i.useRef(null),w=i.useRef(null),T=i.useRef(d),D=l!=null,O=Ps(l),k=Ps(a),A=Ps(u),j=i.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),ks(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!js(T.current,t)&&(T.current=t,E.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);As(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=i.useRef(!1);As(()=>(M.current=!0,()=>{M.current=!1}),[]),As(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=i.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=i.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=i.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ns(P.floating,d.x),r=Ns(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ms(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return i.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:ee}),[d,j,N,P,ee])}var Is=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Ds({element:r.current,padding:i}).fn(n):r?Ds({element:r,padding:i}).fn(n):{}}}},Ls=(e,t)=>{let n=Ss(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rs=(e,t)=>{let n=Cs(e);return{name:n.name,fn:n.fn,options:[e,t]}},zs=(e,t)=>({fn:Os(e).fn,options:[e,t]}),Bs=(e,t)=>{let n=ws(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vs=(e,t)=>{let n=Ts(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hs=(e,t)=>{let n=Es(e);return{name:n.name,fn:n.fn,options:[e,t]}},Us=(e,t)=>{let n=Is(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ws=Object.defineProperty,Gs=i.forwardRef(((e,t)=>Ws(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,D.jsx)(A.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,D.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Ks=Object.defineProperty,qs=(e,t)=>Ks(e,`name`,{value:t,configurable:!0}),Js=`Popper`,[Ys,Xs]=L(Js),[Zs,Qs]=Ys(Js),$s=qs(e=>{let{__scopePopper:t,children:n}=e,[r,a]=i.useState(null),[o,s]=i.useState(void 0);return(0,D.jsx)(Zs,{scope:t,anchor:r,onAnchorChange:a,placementState:o,setPlacementState:s,children:n})},`Popper`),ec=`PopperAnchor`,tc=i.forwardRef(qs(function(e,t){let{__scopePopper:n,virtualRef:r,...a}=e,o=Qs(ec,n),s=i.useRef(null),c=o.onAnchorChange,u=l(t,i.useCallback(e=>{s.current=e,e&&c(e)},[c])),d=i.useRef(null);i.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&c(d.current)});let f=o.placementState&&dc(o.placementState),p=f?.[0],m=f?.[1];return r?null:(0,D.jsx)(A.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...a,ref:u})},`PopperAnchor`)),nc=`PopperContent`,[rc,ic]=Ys(nc),ac=i.forwardRef(qs(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=Qs(nc,n),[y,b]=i.useState(null),x=l(t,b),[S,C]=i.useState(null),w=ma(S),T=w?.width??0,E=w?.height??0,O=r+(o===`center`?``:`-`+o),k=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(d)?d:[d],M=j.length>0,N={padding:k,boundary:j.filter(lc),altBoundary:M},{refs:P,floatingStyles:ee,placement:te,isPositioned:F,middlewareData:I}=Fs({strategy:`fixed`,placement:O,whileElementsMounted:qs((...e)=>xs(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Ls({mainAxis:a+E,alignmentAxis:s}),u&&Rs({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?zs():void 0,...N}),u&&Bs({...N}),Vs({...N,apply:qs(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&Us({element:S,padding:c}),uc({arrowWidth:T,arrowHeight:E}),m&&Hs({strategy:`referenceHidden`,...N,boundary:M?N.boundary:void 0})]}),L=v.setPlacementState;B(()=>(L(te),()=>{L(void 0)}),[te,L]);let[ne,re]=dc(te),R=G(g);B(()=>{F&&R?.()},[F,R]);let ie=I.arrow?.x,ae=I.arrow?.y,oe=I.arrow?.centerOffset!==0,[se,ce]=i.useState();return B(()=>{y&&ce(window.getComputedStyle(y).zIndex)},[y]),(0,D.jsx)(`div`,{ref:P.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:F?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,D.jsx)(rc,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:C,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,D.jsx)(A.div,{"data-side":ne,"data-align":re,..._,ref:x,style:{..._.style,animation:F?_.style?.animation:`none`}})})})},`PopperContent`)),oc=`PopperArrow`,sc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},cc=i.forwardRef(qs(function(e,t){let{__scopePopper:n,...r}=e,i=ic(oc,n),a=sc[i.placedSide];return(0,D.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,D.jsx)(Gs,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function lc(e){return e!==null}qs(lc,`isNotNull`);var uc=qs(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=dc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function dc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}qs(dc,`getSideAndAlignFromPlacement`);var fc=$s,pc=tc,mc=ac,hc=cc,gc=Object.defineProperty,_c=(e,t)=>gc(e,`name`,{value:t,configurable:!0}),vc=!1;function yc(){let[e,t]=i.useState(vc);return i.useEffect(()=>{vc||(vc=!0,t(!0))},[]),e}_c(yc,`useIsHydrated`);var bc=i.useSyncExternalStore;function xc(){return()=>{}}_c(xc,`subscribe`);function Sc(){return bc(xc,()=>!0,()=>!1)}_c(Sc,`useIsHydratedModern`);var Cc=typeof bc==`function`?Sc:yc,wc=Object.defineProperty,Tc=(e,t)=>wc(e,`name`,{value:t,configurable:!0}),Ec=`rovingFocusGroup.onEntryFocus`,Dc={bubbles:!1,cancelable:!0},Oc=`RovingFocusGroup`,[kc,Ac,jc]=ie(Oc),[Mc,Nc]=L(Oc,[jc]),[Pc,Fc]=Mc(Oc),Ic=i.forwardRef(Tc(function(e,t){return(0,D.jsx)(kc.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(kc.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(Lc,{...e,ref:t})})})},`RovingFocusGroup`)),Lc=i.forwardRef(Tc(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=i.useRef(null),h=l(t,m),g=ft(o),[_,v]=V({prop:s,defaultProp:c??null,onChange:u,caller:Oc}),[y,b]=i.useState(!1),x=G(d),S=Ac(n),C=i.useRef(!1),[w,T]=i.useState(0);return i.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Ec,x),()=>e.removeEventListener(Ec,x)},[x]),(0,D.jsx)(Pc,{scope:n,orientation:r,dir:g,loop:a,currentTabStopId:_,onItemFocus:i.useCallback(e=>v(e),[v]),onItemShiftTab:i.useCallback(()=>b(!0),[]),onFocusableItemAdd:i.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:i.useCallback(()=>T(e=>e-1),[]),children:(0,D.jsx)(A.div,{tabIndex:y||w===0?-1:0,"data-orientation":r,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:z(e.onMouseDown,()=>{C.current=!0}),onFocus:z(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(Ec,Dc);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);Uc([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}C.current=!1}),onBlur:z(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),Rc=`RovingFocusGroupItem`,zc=i.forwardRef(Tc(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:s,...c}=e,l=U(),u=o||l,d=Fc(Rc,n),f=d.currentTabStopId===u,p=Ac(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=d,_=Cc();return B(()=>{if(_&&r)return m(),()=>h()},[_,r,m,h]),i.useEffect(()=>{if(!_&&r)return m(),()=>h()},[_,r,m,h]),(0,D.jsx)(kc.ItemSlot,{scope:n,id:u,focusable:r,active:a,children:(0,D.jsx)(A.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:z(e.onMouseDown,e=>{r?d.onItemFocus(u):e.preventDefault()}),onFocus:z(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:z(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Hc(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?Wc(n,r+1):n.slice(r+1)}setTimeout(()=>Uc(n))}}),children:typeof s==`function`?s({isCurrentTabStop:f,hasTabStop:g!=null}):s})})},`RovingFocusGroupItem`)),Bc={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Vc(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Tc(Vc,`getDirectionAwareKey`);function Hc(e,t,n){let r=Vc(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Bc[r]}Tc(Hc,`getFocusIntent`);function Uc(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Tc(Uc,`focusFirst`);function Wc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Tc(Wc,`wrapArray`);var Gc=Ic,Kc=zc,qc=Object.defineProperty,X=(e,t)=>qc(e,`name`,{value:t,configurable:!0}),Jc=[`Enter`,` `],Yc=[`ArrowDown`,`PageUp`,`Home`],Xc=[`ArrowUp`,`PageDown`,`End`],Zc=[...Yc,...Xc],Qc={ltr:[...Jc,`ArrowRight`],rtl:[...Jc,`ArrowLeft`]},$c={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},el=`Menu`,[tl,nl,rl]=ie(el),[il,al]=L(el,[rl,Xs,Nc]),ol=Xs(),sl=Nc(),[cl,ll]=il(el),[ul,dl]=il(el),fl=X(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:s=!0}=e,c=ol(t),[l,u]=i.useState(null),d=i.useRef(!1),f=G(o),p=ft(a);return i.useEffect(()=>{let e=X(()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=X(()=>d.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),i.useEffect(()=>{if(!n)return;let e=X(()=>f(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,D.jsx)(fc,{...c,children:(0,D.jsx)(cl,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,D.jsx)(ul,{scope:t,onClose:i.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:r})})})},`Menu`),pl=i.forwardRef(X(function(e,t){let{__scopeMenu:n,...r}=e,i=ol(n);return(0,D.jsx)(pc,{...i,...r,ref:t})},`MenuAnchor`)),ml=`MenuPortal`,[hl,gl]=il(ml,{forceMount:void 0}),_l=X(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=ll(ml,t);return(0,D.jsx)(hl,{scope:t,forceMount:n,children:(0,D.jsx)(H,{present:n||a.open,children:(0,D.jsx)(Dn,{asChild:!0,container:i,children:r})})})},`MenuPortal`),vl=`MenuContent`,[yl,bl]=il(vl),xl=i.forwardRef(X(function(e,t){let n=gl(vl,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=ll(vl,e.__scopeMenu),o=dl(vl,e.__scopeMenu);return(0,D.jsx)(tl.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(H,{present:r||a.open,children:(0,D.jsx)(tl.Slot,{scope:e.__scopeMenu,children:o.modal?(0,D.jsx)(Sl,{...i,ref:t}):(0,D.jsx)(Cl,{...i,ref:t})})})})},`MenuContent`)),Sl=i.forwardRef(X(function(e,t){let n=ll(vl,e.__scopeMenu),r=i.useRef(null),a=l(t,r);return i.useEffect(()=>{let e=r.current;if(e)return Zr(e)},[]),(0,D.jsx)(Tl,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Cl=i.forwardRef(X(function(e,t){let n=ll(vl,e.__scopeMenu);return(0,D.jsx)(Tl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),wl=f(`MenuContent.ScrollLock`),Tl=i.forwardRef(X(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=ll(vl,n),y=dl(vl,n),b=ol(n),x=sl(n),S=nl(n),[C,w]=i.useState(null),T=i.useRef(null),E=l(t,T,v.onContentChange),O=i.useRef(0),k=i.useRef(``),A=i.useRef(0),j=i.useRef(null),M=i.useRef(`right`),N=i.useRef(0),P=g?Hr:i.Fragment,ee=g?{as:wl,allowPinchZoom:!0}:void 0,te=X(e=>{let t=k.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Yl(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;X((function e(t){k.current=t,window.clearTimeout(O.current),t!==``&&(O.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);i.useEffect(()=>()=>window.clearTimeout(O.current),[]),Nn();let F=i.useCallback(e=>M.current===j.current?.side&&Zl(e,j.current?.area),[]);return(0,D.jsx)(yl,{scope:n,searchRef:k,onItemEnter:i.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:i.useCallback(e=>{F(e)||(T.current?.focus(),w(null))},[F]),onTriggerLeave:i.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:A,onPointerGraceIntentChange:i.useCallback(e=>{j.current=e},[]),children:(0,D.jsx)(P,{...ee,children:(0,D.jsx)(mn,{asChild:!0,trapped:a,onMountAutoFocus:z(o,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,D.jsx)(nn,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,D.jsx)(Gc,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:z(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,D.jsx)(mc,{role:`menu`,"aria-orientation":`vertical`,"data-state":Wl(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:E,style:{outline:`none`,..._.style},onKeyDown:z(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=T.current;if(e.target!==i||!Zc.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);Xc.includes(e.key)&&a.reverse(),ql(a)}),onBlur:z(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),k.current=``)}),onPointerMove:z(e.onPointerMove,Ql(e=>{let t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>N.current?`right`:`left`;M.current=t,N.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),El=i.forwardRef(X(function(e,t){let{__scopeMenu:n,...r}=e;return(0,D.jsx)(A.div,{...r,ref:t})},`MenuLabel`)),Dl=`MenuItem`,Ol=`menu.itemSelect`,kl=i.forwardRef(X(function(e,t){let{disabled:n=!1,onSelect:r,...a}=e,o=i.useRef(null),s=dl(Dl,e.__scopeMenu),c=bl(Dl,e.__scopeMenu),u=l(t,o),d=i.useRef(!1),f=X(()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(Ol,{bubbles:!0,cancelable:!0});e.addEventListener(Ol,e=>r?.(e),{once:!0}),j(e,t),t.defaultPrevented?d.current=!1:s.onClose()}},`handleSelect`);return(0,D.jsx)(Al,{...a,ref:u,disabled:n,onClick:z(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:z(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:z(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(c.searchRef.current===``||e.key!==` `)&&Jc.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Al=i.forwardRef(X(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:a,...o}=e,s=bl(Dl,n),c=sl(n),u=i.useRef(null),d=l(t,u),[f,p]=i.useState(!1),[m,h]=i.useState(``);return i.useEffect(()=>{let e=u.current;e&&h((e.textContent??``).trim())},[o.children]),(0,D.jsx)(tl.ItemSlot,{scope:n,disabled:r,textValue:a??m,children:(0,D.jsx)(Kc,{asChild:!0,...c,focusable:!r,children:(0,D.jsx)(A.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...o,ref:d,onPointerMove:z(e.onPointerMove,Ql(e=>{r?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,Ql(e=>s.onItemLeave(e))),onFocus:z(e.onFocus,()=>p(!0)),onBlur:z(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),[jl,Ml]=il(`MenuRadioGroup`,{value:void 0,onValueChange:X(()=>{},`onValueChange`)}),[Nl,Pl]=il(`MenuItemIndicator`,{checked:!1}),Fl=i.forwardRef(X(function(e,t){let{__scopeMenu:n,...r}=e;return(0,D.jsx)(A.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),Il=`MenuSub`,[Ll,Rl]=il(Il),zl=X(e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:a}=e,o=ll(Il,t),s=ol(t),[c,l]=i.useState(null),[u,d]=i.useState(null),f=G(a);return i.useEffect(()=>(o.open===!1&&f(!1),()=>f(!1)),[o.open,f]),(0,D.jsx)(fc,{...s,children:(0,D.jsx)(cl,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:(0,D.jsx)(Ll,{scope:t,contentId:U(),triggerId:U(),trigger:c,onTriggerChange:l,children:n})})})},`MenuSub`),Bl=`MenuSubTrigger`,Vl=i.forwardRef(X(function(e,t){let n=ll(Bl,e.__scopeMenu),r=dl(Bl,e.__scopeMenu),a=Rl(Bl,e.__scopeMenu),o=bl(Bl,e.__scopeMenu),s=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:e.__scopeMenu},f=i.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);i.useEffect(()=>f,[f]),i.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]);let p=l(t,a.onTriggerChange);return(0,D.jsx)(pl,{asChild:!0,...d,children:(0,D.jsx)(Al,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":Wl(n.open),...e,ref:p,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,Ql(t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:z(e.onPointerLeave,Ql(e=>{f();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,a=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];o.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(o.searchRef.current===``||t.key!==` `)&&Qc[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Hl=`MenuSubContent`,Ul=i.forwardRef(X(function(e,t){let n=gl(vl,e.__scopeMenu),{forceMount:r=n.forceMount,align:a=`start`,...o}=e,s=ll(vl,e.__scopeMenu),c=dl(vl,e.__scopeMenu),u=Rl(Hl,e.__scopeMenu),d=i.useRef(null),f=l(t,d);return(0,D.jsx)(tl.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(H,{present:r||s.open,children:(0,D.jsx)(tl.Slot,{scope:e.__scopeMenu,children:(0,D.jsx)(Tl,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:a,side:c.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:z(e.onFocusOutside,e=>{e.target!==u.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:z(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=$c[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function Wl(e){return e?`open`:`closed`}X(Wl,`getOpenState`);function Gl(e){return e===`indeterminate`}X(Gl,`isIndeterminate`);function Kl(e){return Gl(e)?`indeterminate`:e?`checked`:`unchecked`}X(Kl,`getCheckedState`);function ql(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(ql,`focusFirst`);function Jl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(Jl,`wrapArray`);function Yl(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Jl(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}X(Yl,`getNextMatch`);function Xl(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}X(Xl,`isPointInPolygon`);function Zl(e,t){return t?Xl({x:e.clientX,y:e.clientY},t):!1}X(Zl,`isPointerInGraceArea`);function Ql(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(Ql,`whenMouse`);var $l=fl,eu=pl,tu=_l,nu=xl,ru=El,iu=kl,au=Fl,ou=zl,su=Vl,cu=Ul,lu=Object.defineProperty,uu=(e,t)=>lu(e,`name`,{value:t,configurable:!0}),du=`DropdownMenu`,[fu,pu]=L(du,[al]),mu=al(),[hu,gu]=fu(du),_u=uu(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,l=mu(t),u=i.useRef(null),[d,f]=V({prop:a,defaultProp:o??!1,onChange:s,caller:du});return(0,D.jsx)(hu,{scope:t,triggerId:U(),triggerRef:u,contentId:U(),open:d,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(e=>!e),[f]),modal:c,children:(0,D.jsx)($l,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})},`DropdownMenu`),vu=`DropdownMenuTrigger`,yu=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=gu(vu,n),o=mu(n),s=l(t,a.triggerRef);return(0,D.jsx)(eu,{asChild:!0,...o,children:(0,D.jsx)(A.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:z(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:z(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),bu=uu(e=>{let{__scopeDropdownMenu:t,...n}=e,r=mu(t);return(0,D.jsx)(tu,{...r,...n})},`DropdownMenuPortal`),xu=`DropdownMenuContent`,Su=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,a=gu(xu,n),o=mu(n),s=i.useRef(!1);return(0,D.jsx)(nu,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...r,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{s.current||a.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:z(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!a.modal||r)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Cu=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mu(n);return(0,D.jsx)(ru,{...i,...r,ref:t})},`DropdownMenuLabel`)),wu=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mu(n);return(0,D.jsx)(iu,{...i,...r,ref:t})},`DropdownMenuItem`)),Tu=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mu(n);return(0,D.jsx)(au,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Eu=uu(e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=mu(t),[s,c]=V({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,D.jsx)(ou,{...o,open:s,onOpenChange:c,children:n})},`DropdownMenuSub`),Du=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mu(n);return(0,D.jsx)(su,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),Ou=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mu(n);return(0,D.jsx)(cu,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),ku=_u,Au=yu,ju=bu,Mu=Su,Nu=Cu,Pu=wu,Fu=Tu,Iu=Eu,Lu=Du,Ru=Ou,zu=Object.defineProperty,Bu=i.forwardRef(((e,t)=>zu(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,D.jsx)(A.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Vu=Object.defineProperty,Hu=(e,t)=>Vu(e,`name`,{value:t,configurable:!0});function Uu(e){let t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Hu(Uu,`usePrevious`);var Wu=Object.defineProperty,Gu=(e,t)=>Wu(e,`name`,{value:t,configurable:!0});function Ku(e,[t,n]){return Math.min(n,Math.max(t,e))}Gu(Ku,`clamp`);var qu=Object.defineProperty,Ju=(e,t)=>qu(e,`name`,{value:t,configurable:!0}),Yu=`Popover`,[Xu,Zu]=L(Yu,[Xs]),Qu=Xs(),[$u,ed]=Xu(Yu),td=Ju(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!1}=e,c=Qu(t),l=i.useRef(null),[u,d]=i.useState(!1),[f,p]=V({prop:r,defaultProp:a??!1,onChange:o,caller:Yu});return(0,D.jsx)(fc,{...c,children:(0,D.jsx)($u,{scope:t,contentId:U(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:i.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>d(!0),[]),onCustomAnchorRemove:i.useCallback(()=>d(!1),[]),modal:s,children:n})})},`Popover`),nd=`PopoverTrigger`,rd=i.forwardRef(Ju(function(e,t){let{__scopePopover:n,...r}=e,i=ed(nd,n),a=Qu(n),o=l(t,i.triggerRef),s=(0,D.jsx)(A.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":md(i.open),...r,ref:o,onClick:z(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,D.jsx)(pc,{asChild:!0,...a,children:s})},`PopoverTrigger`)),id=`PopoverPortal`,[ad,od]=Xu(id,{forceMount:void 0}),sd=Ju(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=ed(id,t);return(0,D.jsx)(ad,{scope:t,forceMount:n,children:(0,D.jsx)(H,{present:n||a.open,children:(0,D.jsx)(Dn,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),cd=`PopoverContent`,ld=i.forwardRef(Ju(function(e,t){let n=od(cd,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=ed(cd,e.__scopePopover);return(0,D.jsx)(H,{present:r||a.open,children:a.modal?(0,D.jsx)(dd,{...i,ref:t}):(0,D.jsx)(fd,{...i,ref:t})})},`PopoverContent`)),ud=f(`PopoverContent.RemoveScroll`),dd=i.forwardRef(Ju(function(e,t){let n=ed(cd,e.__scopePopover),r=i.useRef(null),a=l(t,r),o=i.useRef(!1);return i.useEffect(()=>{let e=r.current;if(e)return Zr(e)},[]),(0,D.jsx)(Hr,{as:ud,allowPinchZoom:!0,children:(0,D.jsx)(pd,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),fd=i.forwardRef(Ju(function(e,t){let n=ed(cd,e.__scopePopover),r=i.useRef(!1),a=i.useRef(!1);return(0,D.jsx)(pd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let i=t.target;n.triggerRef.current?.contains(i)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&a.current&&t.preventDefault()}})},`PopoverContentNonModal`)),pd=i.forwardRef(Ju(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=ed(cd,n),p=Qu(n);return Nn(),(0,D.jsx)(mn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,D.jsx)(nn,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,D.jsx)(mc,{"data-state":md(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.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)`}})})})},`PopoverContentImpl`));function md(e){return e?`open`:`closed`}Ju(md,`getState`);var hd=td,gd=rd,_d=sd,vd=ld,yd=Object.defineProperty,Z=(e,t)=>yd(e,`name`,{value:t,configurable:!0}),bd=[` `,`Enter`,`ArrowUp`,`ArrowDown`],xd=[` `,`Enter`],Sd=`Select`,[Cd,wd,Td]=ie(Sd),[Ed,Dd]=L(Sd,[Td,Xs]),Od=Xs(),[kd,Ad]=Ed(Sd),[jd,Md]=Ed(Sd);function Nd(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:s,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:h,internal_do_not_use_render:g}=e,_=Od(t),[v,y]=i.useState(null),[b,x]=i.useState(null),[S,C]=i.useState(!1),w=ft(u),[T,E]=V({prop:r,defaultProp:a??!1,onChange:o,caller:Sd}),[O,k]=V({prop:s,defaultProp:c,onChange:l,caller:Sd}),A=i.useRef(null),j=i.useRef(O);i.useEffect(()=>{let e=h?v?.ownerDocument.getElementById(h):v?.form;if(e instanceof HTMLFormElement){let t=Z(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,v,k]);let M=!v||!!h||!!v.closest(`form`),[N,P]=i.useState(new Set),ee=U(),te=Array.from(N).map(e=>e.props.value).join(`;`),F=i.useCallback(e=>{P(t=>new Set(t).add(e))},[]),I=i.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),L={required:m,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:ee,value:O,onValueChange:k,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:A,disabled:p,name:d,autoComplete:f,form:h,nativeOptions:N,nativeSelectKey:te,isFormControl:M};return(0,D.jsx)(fc,{..._,children:(0,D.jsx)(kd,{scope:t,...L,children:(0,D.jsx)(Cd.Provider,{scope:t,children:(0,D.jsx)(jd,{scope:t,onNativeOptionAdd:F,onNativeOptionRemove:I,children:xf(g)?g(L):n})})})})}Z(Nd,`SelectProvider`);var Pd=Z(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,D.jsx)(Nd,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,D.jsxs)(D.Fragment,{children:[n,e?(0,D.jsx)(bf,{__scopeSelect:t}):null]})})},`Select`),Fd=`SelectTrigger`,Id=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,disabled:r=!1,...a}=e,o=Od(n),s=Ad(Fd,n),c=s.disabled||r,u=l(t,s.onTriggerChange),d=wd(n),f=i.useRef(`touch`),[p,m,h]=Cf(e=>{let t=d().filter(e=>!e.disabled),n=wf(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),g=Z(e=>{c||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,D.jsx)(pc,{asChild:!0,...o,children:(0,D.jsx)(A.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":Sf(s.value)?``:void 0,...a,ref:u,onClick:z(a.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:z(a.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:z(a.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&bd.includes(e.key)&&(g(),e.preventDefault())})})})},`SelectTrigger`)),Ld=`SelectValue`,Rd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,className:r,style:a,children:o,placeholder:s=``,...c}=e,u=Ad(Ld,n),{onValueNodeHasChildrenChange:d}=u,f=o!==void 0,p=l(t,u.onValueNodeChange);B(()=>{d(f)},[d,f]);let m=Sf(u.value);return(0,D.jsx)(A.span,{...c,asChild:!m&&c.asChild,ref:p,style:{pointerEvents:`none`},children:(0,D.jsx)(i.Fragment,{children:m?s:o},m?`placeholder`:`value`)})},`SelectValue`)),zd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,D.jsx)(A.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[Bd,Vd]=Ed(`SelectPortal`,{forceMount:void 0}),Hd=Z(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,D.jsx)(Bd,{scope:e.__scopeSelect,forceMount:n,children:(0,D.jsx)(Dn,{asChild:!0,...r})})},`SelectPortal`),Ud=`SelectContent`,Wd=i.forwardRef(Z(function(e,t){let n=Vd(Ud,e.__scopeSelect),{forceMount:r=n.forceMount,...a}=e,o=Ad(Ud,e.__scopeSelect),[s,c]=i.useState();return B(()=>{c(new DocumentFragment)},[]),(0,D.jsx)(H,{present:r||o.open,children:({present:e})=>e?(0,D.jsx)(Xd,{...a,ref:t}):(0,D.jsx)(Gd,{...a,fragment:s})})},`SelectContent`)),Gd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?E.createPortal((0,D.jsx)(qd,{scope:n,children:(0,D.jsx)(Cd.Slot,{scope:n,children:(0,D.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Kd=10,[qd,Jd]=Ed(Ud),Yd=f(`SelectContent.RemoveScroll`),Xd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v,...y}=e,b=Ad(Ud,n),[x,S]=i.useState(null),[C,w]=i.useState(null),T=l(t,S),[E,O]=i.useState(null),[k,A]=i.useState(null),j=wd(n),[M,N]=i.useState(!1),P=i.useRef(!1);i.useEffect(()=>{if(x)return Zr(x)},[x]),Nn();let ee=i.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,C]),te=i.useCallback(()=>ee([E,x]),[ee,E,x]);i.useEffect(()=>{M&&te()},[M,te]);let{onOpenChange:F,triggerPointerDownPosRef:I}=b;i.useEffect(()=>{if(x){let e={x:0,y:0},t=Z(t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},`handlePointerMove`),n=Z(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(x)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null},`handlePointerUp`);return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[x,F,I]),i.useEffect(()=>{let e=Z(()=>F(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[L,ne]=Cf(e=>{let t=j().filter(e=>!e.disabled),n=wf(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),re=i.useCallback((e,t,n)=>{let r=!P.current&&!n;(b.value!==void 0&&b.value===t||r)&&(O(e),r&&(P.current=!0))},[b.value]),R=i.useCallback(()=>x?.focus(),[x]),ie=i.useCallback((e,t,n)=>{let r=!P.current&&!n;(b.value!==void 0&&b.value===t||r)&&A(e)},[b.value]),ae=r===`popper`?Qd:Zd,oe=ae===Qd?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,D.jsx)(qd,{scope:n,content:x,viewport:C,onViewportChange:w,itemRefCallback:re,selectedItem:E,onItemLeave:R,itemTextRefCallback:ie,focusSelectedItem:te,selectedItemText:k,position:r,isPositioned:M,searchRef:L,children:(0,D.jsx)(Hr,{as:Yd,allowPinchZoom:!0,children:(0,D.jsx)(mn,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:z(a,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,D.jsx)(nn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,D.jsx)(ae,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...oe,onPlaced:()=>N(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,...y.style},onKeyDown:z(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ee(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Zd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,onPlaced:r,...a}=e,o=Ad(Ud,n),s=Jd(Ud,n),[c,u]=i.useState(null),[d,f]=i.useState(null),p=l(t,f),m=wd(n),h=i.useRef(!1),g=i.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=s,x=i.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&d&&_&&v&&y){let e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(o.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Kd,d=Ku(a,[Kd,Math.max(Kd,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Kd,d=Ku(a,[Kd,Math.max(Kd,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=m(),s=window.innerHeight-Kd*2,l=_.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),b=parseInt(u.paddingBottom,10),x=f+p+l+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Kd,D=s-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=a.length>0&&v===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=d.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);c.style.height=n+`px`}else{let e=a.length>0&&v===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}c.style.margin=`${Kd}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,o.trigger,o.valueNode,c,d,_,v,y,o.dir,r]);B(()=>x(),[x]);let[S,C]=i.useState();B(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);let w=i.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]);return(0,D.jsx)($d,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:w,children:(0,D.jsx)(`div`,{ref:u,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,D.jsx)(A.div,{...a,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})},`SelectItemAlignedPosition`)),Qd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Kd,...a}=e,o=Od(n);return(0,D.jsx)(mc,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.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)`}})},`SelectPopperPosition`)),[$d,ef]=Ed(Ud,{}),tf=`SelectViewport`,nf=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,nonce:r,...a}=e,o=Jd(tf,n),s=ef(tf,n),c=l(t,o.onViewportChange),u=i.useRef(0);return(0,D.jsxs)(D.Fragment,{children:[(0,D.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:r}),(0,D.jsx)(Cd.Slot,{scope:n,children:(0,D.jsx)(A.div,{"data-radix-select-viewport":``,role:`presentation`,...a,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...a.style},onScroll:z(a.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-Kd*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})},`SelectViewport`)),[rf,af]=Ed(`SelectGroup`),of=`SelectItem`,[sf,cf]=Ed(of),lf=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...s}=e,c=Ad(of,n),u=Jd(of,n),d=c.value===r,[f,p]=i.useState(o??``),[m,h]=i.useState(!1),g=l(t,G(e=>u.itemRefCallback?.(e,r,a))),_=U(),v=i.useRef(`touch`),y=Z(()=>{a||(c.onValueChange(r),c.onOpenChange(!1))},`handleSelect`);return(0,D.jsx)(sf,{scope:n,value:r,disabled:a,textId:_,isSelected:d,onItemTextChange:i.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,D.jsx)(Cd.ItemSlot,{scope:n,value:r,disabled:a,textValue:f,children:(0,D.jsx)(A.div,{role:`option`,"aria-labelledby":_,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,tabIndex:a?void 0:-1,...s,ref:g,onFocus:z(s.onFocus,()=>h(!0)),onBlur:z(s.onBlur,()=>h(!1)),onClick:z(s.onClick,()=>{v.current!==`mouse`&&y()}),onPointerUp:z(s.onPointerUp,()=>{v.current===`mouse`&&y()}),onPointerDown:z(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:z(s.onPointerMove,e=>{v.current=e.pointerType,a?u.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:z(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:z(s.onKeyDown,e=>{a||e.target!==e.currentTarget||(u.searchRef?.current===``||e.key!==` `)&&(xd.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),uf=`SelectItemText`,df=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,className:r,style:a,...o}=e,s=Ad(uf,n),c=Jd(uf,n),u=cf(uf,n),d=Md(uf,n),[f,p]=i.useState(null),m=G(e=>c.itemTextRefCallback?.(e,u.value,u.disabled)),h=l(t,p,u.onItemTextChange,m),g=f?.textContent,_=i.useMemo(()=>(0,D.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=d;return B(()=>(v(_),()=>y(_)),[v,y,_]),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(A.span,{id:u.textId,...o,ref:h}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!Sf(s.value)?E.createPortal(o.children,s.valueNode):null]})},`SelectItemText`)),ff=`SelectItemIndicator`,pf=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,...r}=e;return cf(ff,n).isSelected?(0,D.jsx)(A.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),mf=`SelectScrollUpButton`,hf=i.forwardRef(Z(function(e,t){let n=Jd(mf,e.__scopeSelect),r=ef(mf,e.__scopeSelect),[a,o]=i.useState(!1),s=l(t,r.onScrollButtonChange);return B(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;o(e)};Z(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,D.jsx)(vf,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),gf=`SelectScrollDownButton`,_f=i.forwardRef(Z(function(e,t){let n=Jd(gf,e.__scopeSelect),r=ef(gf,e.__scopeSelect),[a,o]=i.useState(!1),s=l(t,r.onScrollButtonChange);return B(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)};Z(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,D.jsx)(vf,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),vf=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...a}=e,o=Jd(`SelectScrollButton`,n),s=i.useRef(null),c=wd(n),l=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>l(),[l]),B(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,D.jsx)(A.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:z(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:z(a.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:z(a.onPointerLeave,()=>{l()})})},`SelectScrollButtonImpl`)),yf=`SelectBubbleInput`,bf=i.forwardRef(Z(function({__scopeSelect:e,...t},n){let r=Ad(yf,e),{value:a,onValueChange:o,required:s,disabled:c,name:u,autoComplete:d,form:f}=r,{nativeOptions:p,nativeSelectKey:m}=r,h=i.useRef(null),g=l(n,h),_=a??``,v=Uu(_),y=Array.from(p).some(e=>(e.props.value??``)===``);return i.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==_&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,_),e.dispatchEvent(t)}},[v,_]),(0,D.jsxs)(A.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:u,autoComplete:d,disabled:c,form:f,onChange:e=>o(e.target.value),...t,style:{...P,...t.style},ref:g,defaultValue:_,children:[Sf(a)&&!y?(0,D.jsx)(`option`,{value:``}):null,Array.from(p)]},m)},`SelectBubbleInput`));function xf(e){return typeof e==`function`}Z(xf,`isFunction`);function Sf(e){return e===``||e===void 0}Z(Sf,`shouldShowPlaceholder`);function Cf(e){let t=G(e),n=i.useRef(``),r=i.useRef(0),a=i.useCallback(e=>{let i=n.current+e;t(i),Z((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),o=i.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}Z(Cf,`useTypeaheadSearch`);function wf(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Tf(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Z(wf,`findNextItem`);function Tf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Z(Tf,`wrapArray`);var Ef=Object.defineProperty,Df=(e,t)=>Ef(e,`name`,{value:t,configurable:!0}),Of=`horizontal`,kf=[`horizontal`,`vertical`],Af=i.forwardRef(Df(function(e,t){let{decorative:n,orientation:r=Of,...i}=e,a=jf(r)?r:Of,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,D.jsx)(A.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function jf(e){return kf.includes(e)}Df(jf,`isValidOrientation`);var Mf=Af,Nf=Object.defineProperty,Q=(e,t)=>Nf(e,`name`,{value:t,configurable:!0}),Pf=[`PageUp`,`PageDown`],Ff=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],If={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},Lf=`Slider`,[Rf,zf,Bf]=ie(Lf),[Vf,Hf]=L(Lf,[Bf]),[Uf,Wf]=Vf(Lf),Gf=i.forwardRef(Q(function(e,t){let{name:n,min:r=0,max:a=100,step:o=1,orientation:s=`horizontal`,disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[r],value:f,onValueChange:p=Q(()=>{},`onValueChange`),onValueCommit:m=Q(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=i.useRef(new Set),y=i.useRef(0),b=i.useRef(!1),x=s===`horizontal`?Jf:Yf,[S,C]=i.useState(null),w=l(t,C),[T=[],E]=V({prop:f,defaultProp:d,onChange:Q(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,p(e)},`onChange`)}),O=i.useRef(T),k=i.useRef(T);i.useEffect(()=>{let e=g?S?.ownerDocument.getElementById(g):S?.closest(`form`);if(e instanceof HTMLFormElement){let t=Q(()=>E(k.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function A(e){N(e,pp(T,e))}Q(A,`handleSlideStart`);function j(e){N(e,y.current)}Q(j,`handleSlideMove`);function M(){String(T)!==String(O.current)&&m(T)}Q(M,`handleSlideEnd`);function N(e,t,{commit:n}={commit:!1}){let i=vp(o),s=Ku(yp(Math.round((e-r)/o)*o+r,i),[r,a]);E((e=[])=>{let r=up(e,s,t);if(gp(r,u*o)){y.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}return e})}return Q(N,`updateValues`),(0,D.jsx)(Uf,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:s,form:g,children:(0,D.jsx)(Rf.Provider,{scope:e.__scopeSlider,children:(0,D.jsx)(Rf.Slot,{scope:e.__scopeSlider,children:(0,D.jsx)(x,{"aria-disabled":c,"data-disabled":c?``:void 0,..._,ref:w,onPointerDown:z(_.onPointerDown,()=>{c||(O.current=T,b.current=!1)}),min:r,max:a,inverted:h,onSlideStart:c?void 0:A,onSlideMove:c?void 0:j,onSlideEnd:c?void 0:M,onHomeKeyDown:()=>{c||(b.current=!0,N(r,0,{commit:!0}))},onEndKeyDown:()=>{c||(b.current=!0,N(a,T.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!c){b.current=!0;let n=Pf.includes(e.key)||e.shiftKey&&Ff.includes(e.key)?10:1,i=y.current,a=T[i];N(bp(a,{min:r,step:o,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[Kf,qf]=Vf(Lf,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),Jf=i.forwardRef(Q(function(e,t){let{min:n,max:r,dir:a,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:u,onStepKeyDown:d,...f}=e,[p,m]=i.useState(null),h=l(t,m),g=i.useRef(void 0),_=ft(a),v=_===`ltr`,y=v&&!o||!v&&o;function b(e){let t=g.current||p.getBoundingClientRect(),i=_p([0,t.width],y?[n,r]:[r,n]);return g.current=t,i(e-t.left)}return Q(b,`getValueFromPointer`),(0,D.jsx)(Kf,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:(0,D.jsx)(Xf,{dir:_,"data-orientation":`horizontal`,...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=b(e.clientX);s?.(t)},onSlideMove:e=>{let t=b(e.clientX);c?.(t)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:e=>{let t=If[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),Yf=i.forwardRef(Q(function(e,t){let{min:n,max:r,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:u,...d}=e,f=i.useRef(null),p=l(t,f),m=i.useRef(void 0),h=!a;function g(e){let t=m.current||f.current.getBoundingClientRect(),i=_p([0,t.height],h?[r,n]:[n,r]);return m.current=t,i(e-t.top)}return Q(g,`getValueFromPointer`),(0,D.jsx)(Kf,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:(0,D.jsx)(Xf,{"data-orientation":`vertical`,...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=g(e.clientY);o?.(t)},onSlideMove:e=>{let t=g(e.clientY);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=If[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),Xf=i.forwardRef(Q(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Wf(Lf,n);return(0,D.jsx)(A.span,{...l,ref:t,onKeyDown:z(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Pf.concat(Ff).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:z(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:z(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:z(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),Zf=`SliderTrack`,Qf=i.forwardRef(Q(function(e,t){let{__scopeSlider:n,...r}=e,i=Wf(Zf,n);return(0,D.jsx)(A.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),$f=`SliderRange`,ep=i.forwardRef(Q(function(e,t){let{__scopeSlider:n,...r}=e,a=Wf($f,n),o=qf($f,n),s=l(t,i.useRef(null)),c=a.values.length,u=a.values.map(e=>dp(e,a.min,a.max)),d=c>1?Math.min(...u):0,f=100-Math.max(...u);return(0,D.jsx)(A.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?``:void 0,...r,ref:s,style:{...e.style,[o.startEdge]:d+`%`,[o.endEdge]:f+`%`}})},`SliderRange`)),[tp,np]=Vf(`SliderThumb`),rp=`SliderThumbProvider`;function ip(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:a}=e,o=Wf(rp,t),s=zf(t),[c,l]=i.useState(null),u=i.useMemo(()=>c?s().findIndex(e=>e.ref.current===c):-1,[s,c]),d=ma(c),f=!c||!!o.form||!!c.closest(`form`),p=o.values[u],m=n??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),h=p===void 0?0:dp(p,o.min,o.max);i.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]);let g={value:p,name:m,form:o.form,isFormControl:f,index:u,thumb:c,onThumbChange:l,percent:h,size:d};return(0,D.jsx)(tp,{scope:t,...g,children:xp(a)?a(g):r})}Q(ip,`SliderThumbProvider`);var ap=`SliderThumbTrigger`,op=i.forwardRef(Q(function(e,t){let{__scopeSlider:n,...r}=e,i=Wf(ap,n),a=qf(ap,n),{index:o,value:s,percent:c,size:u,onThumbChange:d}=np(ap,n),f=l(t,d),p=fp(o,i.values.length),m=u?.[a.size],h=m?mp(m,c,a.direction):0;return(0,D.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${c}% + ${h}px)`},children:(0,D.jsx)(Rf.ItemSlot,{scope:n,children:(0,D.jsx)(A.span,{role:`slider`,"aria-label":e[`aria-label`]||p,"aria-valuemin":i.min,"aria-valuenow":s,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:f,style:s===void 0?{display:`none`}:e.style,onFocus:z(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},`SliderThumbTrigger`)),sp=i.forwardRef(Q(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return(0,D.jsx)(ip,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(op,{...i,ref:t,__scopeSlider:n}),r?(0,D.jsx)(lp,{__scopeSlider:n},e):null]})})},`SliderThumb`)),cp=`SliderBubbleInput`,lp=i.forwardRef(Q(function({__scopeSlider:e,...t},n){let{value:r,name:a,form:o}=np(cp,e),s=i.useRef(null),c=l(s,n),u=Uu(r);return i.useEffect(()=>{let e=s.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==r&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[u,r]),(0,D.jsx)(A.input,{style:{display:`none`},name:a,form:o,...t,ref:c,defaultValue:r})},`SliderBubbleInput`));function up(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}Q(up,`getNextSortedValues`);function dp(e,t,n){return Ku(100/(n-t)*(e-t),[0,100])}Q(dp,`convertValueToPercentage`);function fp(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}Q(fp,`getLabel`);function pp(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}Q(pp,`getClosestValueIndex`);function mp(e,t,n){let r=e/2;return(r-_p([0,50],[0,r])(t)*n)*n}Q(mp,`getThumbInBoundsOffset`);function hp(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}Q(hp,`getStepsBetweenValues`);function gp(e,t){if(t>0){let n=hp(e);return Math.min(...n)>=t}return!0}Q(gp,`hasMinStepsBetweenValues`);function _p(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Q(_p,`linearScale`);function vp(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}Q(vp,`getDecimalCount`);function yp(e,t){let n=10**t;return Math.round(e*n)/n}Q(yp,`roundValue`);function bp(e,{min:t,step:n,direction:r,multiplier:i}){let a=vp(n),o=(e-t)/n,s=Math.round(o),c=yp(s*n+t,a)===yp(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),yp(l*n+t,a)}Q(bp,`getNextStepValue`);function xp(e){return typeof e==`function`}Q(xp,`isFunction`);var Sp=Object.defineProperty,Cp=(e,t)=>Sp(e,`name`,{value:t,configurable:!0}),wp=`Switch`,[Tp,Ep]=L(wp),[Dp,Op]=Tp(wp);function kp(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:a,disabled:o,form:s,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=V({prop:n,defaultProp:a??!1,onChange:l,caller:wp}),[h,g]=i.useState(null),[_,v]=i.useState(null),y=i.useRef(!1),[b,x]=i.useReducer(e=>e+1,0),S={checked:p,setChecked:m,disabled:o,control:h,setControl:g,name:c,form:s,value:d,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:u,defaultChecked:a,isFormControl:!h||!!s||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,D.jsx)(Dp,{scope:t,...S,children:Lp(f)?f(S):r})}Cp(kp,`SwitchProvider`);var Ap=`SwitchTrigger`,jp=i.forwardRef(Cp(function({__scopeSwitch:e,onClick:t,...n},r){let{control:a,form:o,value:s,disabled:c,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=Op(Ap,e),v=l(r,f),y=i.useRef(u);return i.useEffect(()=>{let e=o?a?.ownerDocument.getElementById(o):a?.form;if(e instanceof HTMLFormElement){let t=Cp(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,o,p]),(0,D.jsx)(A.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":Rp(u),"data-disabled":c?``:void 0,disabled:c,value:s,...n,ref:v,onClick:z(t,e=>{h(),p(e=>!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`SwitchTrigger`)),Mp=i.forwardRef(Cp(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,D.jsx)(kp,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(jp,{...d,ref:t,__scopeSwitch:n}),e&&(0,D.jsx)(Ip,{__scopeSwitch:n})]})})},`Switch`)),Np=`SwitchThumb`,Pp=i.forwardRef(Cp(function(e,t){let{__scopeSwitch:n,...r}=e,i=Op(Np,n);return(0,D.jsx)(A.span,{"data-state":Rp(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),Fp=`SwitchBubbleInput`,Ip=i.forwardRef(Cp(function({__scopeSwitch:e,onClick:t,...n},r){let{control:a,hasConsumerStoppedPropagationRef:o,userInteractionCount:s,checked:c,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=Op(Fp,e),v=l(r,_),y=ma(a),b=i.useRef(!1),x=i.useRef(c),S=i.useRef(s);i.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=s!==S.current;S.current=s;let i=x.current!==c;x.current=c;let a=!(r&&o.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,c),e.dispatchEvent(t),b.current=!1}},[g,c,o,s]);let C=i.useRef(c);return(0,D.jsx)(A.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...n,tabIndex:-1,ref:v,onClick:z(t,e=>{b.current&&e.stopPropagation()}),style:{...n.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function Lp(e){return typeof e==`function`}Cp(Lp,`isFunction`);function Rp(e){return e?`checked`:`unchecked`}Cp(Rp,`getState`);var zp=Object.defineProperty,Bp=(e,t)=>zp(e,`name`,{value:t,configurable:!0}),Vp=`Tabs`,[Hp,Up]=L(Vp,[Nc]),Wp=Nc(),[Gp,Kp]=Hp(Vp),qp=i.forwardRef(Bp(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=ft(s),[d,f]=V({prop:r,onChange:i,defaultProp:a??``,caller:Vp});return(0,D.jsx)(Gp,{scope:n,baseId:U(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,D.jsx)(A.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Jp=`TabsList`,Yp=i.forwardRef(Bp(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Kp(Jp,n),o=Wp(n);return(0,D.jsx)(Gc,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,D.jsx)(A.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Xp=`TabsTrigger`,Zp=i.forwardRef(Bp(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Kp(Xp,n),s=Wp(n),c=Qp(o.baseId,r),l=$p(o.baseId,r),u=r===o.value;return(0,D.jsx)(Kc,{asChild:!0,...s,focusable:!i,active:u,children:(0,D.jsx)(A.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:z(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:z(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:z(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`));function Qp(e,t){return`${e}-trigger-${t}`}Bp(Qp,`makeTriggerId`);function $p(e,t){return`${e}-content-${t}`}Bp($p,`makeContentId`);var em=qp,tm=Yp,nm=Zp,rm=Object.defineProperty,im=(e,t)=>rm(e,`name`,{value:t,configurable:!0}),am=`Toggle`,om=i.forwardRef(im(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=V({prop:n,onChange:i,defaultProp:r??!1,caller:am});return(0,D.jsx)(A.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:z(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),sm=Object.defineProperty,cm=(e,t)=>sm(e,`name`,{value:t,configurable:!0}),lm=`ToggleGroup`,[um,dm]=L(lm,[Nc]),fm=Nc(),pm=i.forwardRef(cm(function(e,t){let{type:n,...r}=e;if(n===`single`)return(0,D.jsx)(gm,{role:`radiogroup`,...r,ref:t});if(n===`multiple`)return(0,D.jsx)(_m,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${lm}\``)},`ToggleGroup`)),[mm,hm]=um(lm),gm=i.forwardRef(cm(function(e,t){let{value:n,defaultValue:r,onValueChange:a=cm(()=>{},`onValueChange`),...o}=e,[s,c]=V({prop:n,defaultProp:r??``,onChange:a,caller:lm});return(0,D.jsx)(mm,{scope:e.__scopeToggleGroup,type:`single`,value:i.useMemo(()=>s?[s]:[],[s]),onItemActivate:c,onItemDeactivate:i.useCallback(()=>c(``),[c]),children:(0,D.jsx)(bm,{...o,ref:t})})},`ToggleGroupImplSingle`)),_m=i.forwardRef(cm(function(e,t){let{value:n,defaultValue:r,onValueChange:a=cm(()=>{},`onValueChange`),...o}=e,[s,c]=V({prop:n,defaultProp:r??[],onChange:a,caller:lm}),l=i.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=i.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return(0,D.jsx)(mm,{scope:e.__scopeToggleGroup,type:`multiple`,value:s,onItemActivate:l,onItemDeactivate:u,children:(0,D.jsx)(bm,{...o,ref:t})})},`ToggleGroupImplMultiple`)),[vm,ym]=um(lm),bm=i.forwardRef(cm(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=fm(n),u=ft(o),d={dir:u,...c};return(0,D.jsx)(vm,{scope:n,rovingFocus:i,disabled:r,children:i?(0,D.jsx)(Gc,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,D.jsx)(A.div,{...d,ref:t})}):(0,D.jsx)(A.div,{...d,ref:t})})},`ToggleGroupImpl`)),xm=`ToggleGroupItem`,Sm=i.forwardRef(cm(function(e,t){let n=hm(xm,e.__scopeToggleGroup),r=ym(xm,e.__scopeToggleGroup),a=fm(e.__scopeToggleGroup),o=n.value.includes(e.value),s=r.disabled||e.disabled,c={...e,pressed:o,disabled:s},l=i.useRef(null);return r.rovingFocus?(0,D.jsx)(Kc,{asChild:!0,...a,focusable:!s,active:o,ref:l,children:(0,D.jsx)(Cm,{...c,ref:t})}):(0,D.jsx)(Cm,{...c,ref:t})},`ToggleGroupItem`)),Cm=i.forwardRef(cm(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=hm(xm,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===`single`?o:void 0;return(0,D.jsx)(om,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),wm=Object.defineProperty,$=(e,t)=>wm(e,`name`,{value:t,configurable:!0}),[Tm,Em]=L(`Tooltip`,[Xs]),Dm=Xs(),Om=`TooltipProvider`,km=700,Am=`tooltip.open`,[jm,Mm]=Tm(Om),Nm=$(e=>{let{__scopeTooltip:t,delayDuration:n=km,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=e,s=i.useRef(!0),c=i.useRef(!1),l=i.useRef(0);return i.useEffect(()=>{let e=l.current;return()=>window.clearTimeout(e)},[]),(0,D.jsx)(jm,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:i.useCallback(()=>{r<=0||(window.clearTimeout(l.current),s.current=!1)},[r]),onClose:i.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r))},[r]),isPointerInTransitRef:c,onPointerInTransitChange:i.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:o})},`TooltipProvider`),Pm=`Tooltip`,[Fm,Im]=Tm(Pm),Lm=$(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:o,disableHoverableContent:s,delayDuration:c}=e,l=Mm(Pm,e.__scopeTooltip),u=Dm(t),[d,f]=i.useState(null),[p,m]=i.useState(void 0),h=U(),g=i.useRef(0),_=s??l.disableHoverableContent,v=c??l.delayDuration,y=i.useRef(!1),[b,x]=V({prop:r,defaultProp:a??!1,onChange:$(e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(Am))):l.onClose(),o?.(e)},`onChange`),caller:Pm}),S=i.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=i.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=i.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=i.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);i.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=p??h;return(0,D.jsx)(fc,{...u,children:(0,D.jsx)(Fm,{scope:t,contentId:E,setContentId:m,open:b,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:i.useCallback(()=>{l.isOpenDelayedRef.current?T():C()},[l.isOpenDelayedRef,T,C]),onTriggerLeave:i.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),Rm=`TooltipTrigger`,zm=i.forwardRef($(function(e,t){let{__scopeTooltip:n,...r}=e,a=Im(Rm,n),o=Mm(Rm,n),s=Dm(n),c=l(t,i.useRef(null),a.onTriggerChange),u=i.useRef(!1),d=i.useRef(!1),f=i.useCallback(()=>u.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,D.jsx)(pc,{asChild:!0,...s,children:(0,D.jsx)(A.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:z(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:z(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:z(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:z(e.onBlur,a.onClose),onClick:z(e.onClick,a.onClose)})})},`TooltipTrigger`)),Bm=`TooltipPortal`,[Vm,Hm]=Tm(Bm,{forceMount:void 0}),Um=$(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Im(Bm,t);return(0,D.jsx)(Vm,{scope:t,forceMount:n,children:(0,D.jsx)(H,{present:n||a.open,children:(0,D.jsx)(Dn,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Wm=`TooltipContent`,Gm=i.forwardRef($(function(e,t){let n=Hm(Wm,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Im(Wm,e.__scopeTooltip);return(0,D.jsx)(H,{present:r||o.open,children:o.disableHoverableContent?(0,D.jsx)(Jm,{side:i,...a,ref:t}):(0,D.jsx)(Km,{side:i,...a,ref:t})})},`TooltipContent`)),Km=i.forwardRef($(function(e,t){let n=Im(Wm,e.__scopeTooltip),r=Mm(Wm,e.__scopeTooltip),a=i.useRef(null),o=l(t,a),[s,c]=i.useState(null),{trigger:u,onClose:d}=n,f=a.current,{onPointerInTransitChange:p}=r,m=i.useCallback(()=>{c(null),p(!1)},[p]),h=i.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Zm(r,Xm(r,n.getBoundingClientRect())),a=Qm(t.getBoundingClientRect()),o=eh([...i,...a]);c(o),p(!0)},[p]);return i.useEffect(()=>()=>m(),[m]),i.useEffect(()=>{if(u&&f){let e=$(e=>h(e,f),`handleTriggerLeave`),t=$(e=>h(e,u),`handleContentLeave`);return u.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{u.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[u,f,h,m]),i.useEffect(()=>{if(s){let e=$(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!$m(n,s);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,s,d,m]),(0,D.jsx)(Jm,{...e,ref:o})},`TooltipContentHoverable`)),qm=h(`TooltipContent`),Jm=i.forwardRef($(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":a,id:o,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=Im(Wm,n),d=Dm(n),{onClose:f}=u;i.useEffect(()=>(document.addEventListener(Am,f),()=>document.removeEventListener(Am,f)),[f]),i.useEffect(()=>{if(u.trigger){let e=$(e=>{e.target instanceof Node&&e.target.contains(u.trigger)&&f()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[u.trigger,f]);let{setContentId:p}=u;return B(()=>(p(o),()=>{p(void 0)}),[o,p]),(0,D.jsx)(nn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,D.jsxs)(mc,{"data-state":u.stateAttribute,role:a?void 0:`tooltip`,id:a?void 0:u.contentId,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,D.jsx)(qm,{children:r}),a?(0,D.jsx)(ee,{id:u.contentId,role:`tooltip`,children:a}):null]})})},`TooltipContentImpl`)),Ym=i.forwardRef($(function(e,t){let{__scopeTooltip:n,...r}=e,i=Dm(n);return(0,D.jsx)(hc,{...i,...r,ref:t})},`TooltipArrow`));function Xm(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}$(Xm,`getExitSideFromRect`);function Zm(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}$(Zm,`getPaddedExitPoints`);function Qm(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}$(Qm,`getPointsFromRect`);function $m(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}$($m,`isPointInPolygon`);function eh(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),th(t)}$(eh,`getHull`);function th(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}$(th,`getHullPresorted`);var nh=Nm,rh=Lm,ih=zm,ah=Um,oh=Gm,sh=Ym;export{Xi as $,nf as A,ku as B,pf as C,hf as D,_f as E,Bu as F,Au as G,Iu as H,Mu as I,aa as J,Ta as K,Pu as L,_d as M,hd as N,Id as O,gd as P,Ki as Q,Nu as R,lf as S,Hd as T,Ru as U,Fu as V,Lu as W,qi as X,sa as Y,Ji as Z,Qf as _,rh as a,Ti as at,Wd as b,Sm as c,fi as ct,nm as d,qt as dt,Gi as et,Mp as f,Gt as ft,sp as g,p as gt,ep as h,Kt as ht,nh as i,ii as it,vd as j,Rd as k,tm as l,ui as lt,Gf as m,Ut as mt,oh as n,Ui as nt,ih as o,gi as ot,Pp as p,Wt as pt,Da as q,ah as r,Yi as rt,pm as s,Ci as st,sh as t,Wi as tt,em as u,xi as ut,Mf as v,df as w,zd as x,Pd as y,ju as z};
41
+ `},Lr=0,Rr=[];function zr(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),a=i.useState(Lr++)[0],o=i.useState(sr)[0],s=i.useRef(e);i.useEffect(function(){s.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${a}`);var t=Ln([e.lockRef.current],(e.shards||[]).map(Pr),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${a}`)}),function(){document.body.classList.remove(`block-interactivity-${a}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${a}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=i.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var i=Mr(e),a=n.current,o=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(o)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Tr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Tr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(o||c)&&(r.current=l),!l)return!0;var h=r.current||l;return jr(h,t,e,h===`h`?o:c,!0)},[]),l=i.useCallback(function(e){var n=e;if(Rr.length&&Rr[Rr.length-1]===o){var r=`deltaY`in n?Nr(n):Mr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Fr(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var a=(s.current.shards||[]).map(Pr).filter(Boolean).filter(function(e){return e.contains(n.target)});(a.length>0?c(n,a[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=i.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Br(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=i.useCallback(function(e){n.current=Mr(e),r.current=void 0},[]),f=i.useCallback(function(t){u(t.type,Nr(t),t.target,c(t,e.lockRef.current))},[]),p=i.useCallback(function(t){u(t.type,Mr(t),t.target,c(t,e.lockRef.current))},[]);i.useEffect(function(){return Rr.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,br),document.addEventListener(`touchmove`,l,br),document.addEventListener(`touchstart`,d,br),function(){Rr=Rr.filter(function(e){return e!==o}),document.removeEventListener(`wheel`,l,br),document.removeEventListener(`touchmove`,l,br),document.removeEventListener(`touchstart`,d,br)}},[]);var m=e.removeScrollBar,h=e.inert;return i.createElement(i.Fragment,null,h?i.createElement(o,{styles:Ir(a)}):null,m?i.createElement(_r,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Br(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Vr=Zn(Qn,zr),Hr=i.forwardRef(function(e,t){return i.createElement(er,Fn({},e,{ref:t,sideCar:Vr}))});Hr.classNames=er.classNames;var Ur=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Wr=new WeakMap,Gr=new WeakMap,Kr={},qr=0,Jr=function(e){return e&&(e.host||Jr(e.parentNode))},Yr=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Jr(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Xr=function(e,t,n,r){var i=Yr(t,Array.isArray(e)?e:[e]);Kr[n]||(Kr[n]=new WeakMap);var a=Kr[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Wr.get(e)||0)+1,l=(a.get(e)||0)+1;Wr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Gr.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),qr++,function(){o.forEach(function(e){var t=Wr.get(e)-1,i=a.get(e)-1;Wr.set(e,t),a.set(e,i),t||(Gr.has(e)||e.removeAttribute(r),Gr.delete(e)),i||e.removeAttribute(n)}),qr--,qr||(Wr=new WeakMap,Wr=new WeakMap,Gr=new WeakMap,Kr={})}},Zr=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ur(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Xr(r,i,n,`aria-hidden`)):function(){return null}},Qr=Object.defineProperty,J=(e,t)=>Qr(e,`name`,{value:t,configurable:!0}),$r=`Dialog`,[ei,ti]=L($r),[ni,ri]=ei($r),ii=J(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=i.useRef(null),l=i.useRef(null),[u,d]=V({prop:r,defaultProp:a??!1,onChange:o,caller:$r}),[f,p]=i.useState(0),[m,h]=i.useState(0);return(0,D.jsx)(ni,{scope:t,triggerRef:c,contentRef:l,contentId:U(),titleId:U(),descriptionId:U(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:i.useCallback(()=>d(e=>!e),[d]),modal:s,children:n})},`Dialog`),ai=`DialogTrigger`,oi=i.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=ri(ai,n),a=l(t,i.triggerRef);return(0,D.jsx)(A.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Ei(i.open),...r,ref:a,onClick:z(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),si=`DialogPortal`,[ci,li]=ei(si,{forceMount:void 0}),ui=J(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=ri(si,t);return(0,D.jsx)(ci,{scope:t,forceMount:n,children:i.Children.map(r,e=>(0,D.jsx)(H,{present:n||o.open,children:(0,D.jsx)(Dn,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),di=`DialogOverlay`,fi=i.forwardRef(J(function(e,t){let n=li(di,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ri(di,e.__scopeDialog);return a.modal?(0,D.jsx)(H,{present:r||a.open,children:(0,D.jsx)(mi,{...i,ref:t})}):null},`DialogOverlay`)),pi=f(`DialogOverlay.RemoveScroll`),mi=i.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=ri(di,n),a=l(t,rn());return(0,D.jsx)(Hr,{as:pi,allowPinchZoom:!0,shards:[i.contentRef],children:(0,D.jsx)(A.div,{"data-state":Ei(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),hi=`DialogContent`,gi=i.forwardRef(J(function(e,t){let n=li(hi,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ri(hi,e.__scopeDialog);return(0,D.jsx)(H,{present:r||a.open,children:a.modal?(0,D.jsx)(_i,{...i,ref:t}):(0,D.jsx)(vi,{...i,ref:t})})},`DialogContent`)),_i=i.forwardRef(J(function(e,t){let n=ri(hi,e.__scopeDialog),r=i.useRef(null),a=l(t,n.contentRef,r);return i.useEffect(()=>{let e=r.current;if(e)return Zr(e)},[]),(0,D.jsx)(yi,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),vi=i.forwardRef(J(function(e,t){let n=ri(hi,e.__scopeDialog),r=i.useRef(!1),a=i.useRef(!1);return(0,D.jsx)(yi,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let i=t.target;n.triggerRef.current?.contains(i)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&a.current&&t.preventDefault()}})},`DialogContentNonModal`)),yi=i.forwardRef(J(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ri(hi,n);return Nn(),(0,D.jsx)(D.Fragment,{children:(0,D.jsx)(mn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,D.jsx)(nn,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Ei(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),bi=`DialogTitle`,xi=i.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=ri(bi,n),{setTitleCount:a}=i;return B(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,D.jsx)(A.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Si=`DialogDescription`,Ci=i.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=ri(Si,n),{setDescriptionCount:a}=i;return B(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,D.jsx)(A.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),wi=`DialogClose`,Ti=i.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=ri(wi,n);return(0,D.jsx)(A.button,{type:`button`,...r,ref:t,onClick:z(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Ei(e){return e?`open`:`closed`}J(Ei,`getState`);var Di=Object.defineProperty,Oi=(e,t)=>Di(e,`name`,{value:t,configurable:!0}),[ki,Ai]=L(`AlertDialog`,[ti]),ji=ti(),Mi=Oi(e=>{let{__scopeAlertDialog:t,...n}=e,r=ji(t);return(0,D.jsx)(ii,{...r,...n,modal:!0})},`AlertDialog`);i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=ji(n);return(0,D.jsx)(oi,{...i,...r,ref:t})},`AlertDialogTrigger`));var Ni=Oi(e=>{let{__scopeAlertDialog:t,...n}=e,r=ji(t);return(0,D.jsx)(ui,{...r,...n})},`AlertDialogPortal`),Pi=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=ji(n);return(0,D.jsx)(fi,{...i,...r,ref:t})},`AlertDialogOverlay`)),[Fi,Ii]=ki(`AlertDialogContent`),Li=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,children:r,...a}=e,o=ji(n),s=l(t,i.useRef(null)),c=i.useRef(null);return(0,D.jsx)(Fi,{scope:n,cancelRef:c,children:(0,D.jsx)(gi,{role:`alertdialog`,...o,...a,ref:s,onOpenAutoFocus:z(a.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),Ri=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=ji(n);return(0,D.jsx)(xi,{...i,...r,ref:t})},`AlertDialogTitle`)),zi=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=ji(n);return(0,D.jsx)(Ci,{...i,...r,ref:t})},`AlertDialogDescription`)),Bi=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=ji(n);return(0,D.jsx)(Ti,{...i,...r,ref:t})},`AlertDialogAction`)),Vi=`AlertDialogCancel`,Hi=i.forwardRef(Oi(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Ii(Vi,n),a=ji(n),o=l(t,i);return(0,D.jsx)(Ti,{...a,...r,ref:o})},`AlertDialogCancel`)),Ui=Mi,Wi=Ni,Gi=Pi,Ki=Li,qi=Bi,Ji=Hi,Yi=Ri,Xi=zi,Zi=Object.defineProperty,Qi=(e,t)=>Zi(e,`name`,{value:t,configurable:!0}),$i=`Avatar`,[ea,ta]=L($i),na=[0,()=>void 0],[ra,ia]=ea($i),aa=i.forwardRef(Qi(function(e,t){let{__scopeAvatar:n,...r}=e,[a,o]=i.useState(`idle`),[s,c]=ua();return(0,D.jsx)(ra,{scope:n,imageLoadingStatus:a,setImageLoadingStatus:o,imageCount:s,setImageCount:c,children:(0,D.jsx)(A.span,{...r,ref:t})})},`Avatar`)),oa=`AvatarFallback`,sa=i.forwardRef(Qi(function(e,t){let{__scopeAvatar:n,delayMs:r,...a}=e,o=ia(oa,n),[s,c]=i.useState(r===void 0);return i.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>c(!0),r);return()=>window.clearTimeout(e)}},[r]),s&&o.imageLoadingStatus!==`loaded`?(0,D.jsx)(A.span,{...a,ref:t}):null},`AvatarFallback`));function ca(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return B(()=>{if(!e){n(`error`);return}let t=new window.Image,a=Qi(e=>{let t=e.currentTarget;n(la(t))},`handleLoad`),o=Qi(()=>n(`error`),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(la(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(`idle`)}},[e,i,r,n]),t}Qi(ca,`useImageLoadingStatus`);function la(e){return e.complete?e.naturalWidth>0?`loaded`:`error`:`loading`}Qi(la,`getImageLoadingStatus`);function ua(){return na}Qi(ua,`useImageCount`);function da(e){}Qi(da,`useUpdateImageCount`);var fa=Object.defineProperty,pa=(e,t)=>fa(e,`name`,{value:t,configurable:!0});function ma(e){let[t,n]=i.useState(void 0);return B(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}pa(ma,`useSize`);var ha=Object.defineProperty,ga=(e,t)=>ha(e,`name`,{value:t,configurable:!0}),_a=`Checkbox`,[va,ya]=L(_a),[ba,xa]=va(_a);function Sa(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:o,form:s,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=V({prop:n,defaultProp:a??!1,onChange:l,caller:_a}),[h,g]=i.useState(null),[_,v]=i.useState(null),y=i.useRef(!1),[b,x]=i.useReducer(e=>e+1,0),S=!h||!!s||!!h.closest(`form`),C={checked:p,disabled:o,setChecked:m,control:h,setControl:g,name:c,form:s,value:d,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:u,defaultChecked:!ja(a)&&a,isFormControl:S,bubbleInput:_,setBubbleInput:v};return(0,D.jsx)(ba,{scope:t,...C,children:Aa(f)?f(C):r})}ga(Sa,`CheckboxProvider`);var Ca=`CheckboxTrigger`,wa=i.forwardRef(ga(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a){let{control:o,value:s,disabled:c,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=xa(Ca,e),v=l(a,f),y=i.useRef(u);return i.useEffect(()=>{let e=o?.form;if(e){let t=ga(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,p]),(0,D.jsx)(A.button,{type:`button`,role:`checkbox`,"aria-checked":ja(u)?`mixed`:u,"aria-required":d,"data-state":Ma(u),"data-disabled":c?``:void 0,disabled:c,value:s,...r,ref:v,onKeyDown:z(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:z(n,e=>{h(),p(e=>ja(e)?!0:!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`CheckboxTrigger`)),Ta=i.forwardRef(ga(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,D.jsx)(Sa,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(wa,{...d,ref:t,__scopeCheckbox:n}),e&&(0,D.jsx)(ka,{__scopeCheckbox:n})]})})},`Checkbox`)),Ea=`CheckboxIndicator`,Da=i.forwardRef(ga(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=xa(Ea,n);return(0,D.jsx)(H,{present:r||ja(a.checked)||a.checked===!0,children:(0,D.jsx)(A.span,{"data-state":Ma(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Oa=`CheckboxBubbleInput`,ka=i.forwardRef(ga(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:a,hasConsumerStoppedPropagationRef:o,userInteractionCount:s,checked:c,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=xa(Oa,e),v=l(r,_),y=ma(a),b=i.useRef(!1),x=i.useRef(c),S=i.useRef(s);i.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=s!==S.current;S.current=s;let i=x.current!==c;x.current=c;let a=!(r&&o.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});e.indeterminate=ja(c),n.call(e,!ja(c)&&c),e.dispatchEvent(t),b.current=!1}},[g,c,o,s]);let C=i.useRef(!ja(c)&&c);return(0,D.jsx)(A.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...n,tabIndex:-1,ref:v,onClick:z(t,e=>{b.current&&e.stopPropagation()}),style:{...n.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Aa(e){return typeof e==`function`}ga(Aa,`isFunction`);function ja(e){return e===`indeterminate`}ga(ja,`isIndeterminate`);function Ma(e){return ja(e)?`indeterminate`:e?`checked`:`unchecked`}ga(Ma,`getState`);var Na=[`top`,`right`,`bottom`,`left`],Pa=Math.min,Fa=Math.max,Ia=Math.round,La=Math.floor,Ra=e=>({x:e,y:e}),za={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ba(e,t,n){return Fa(e,Pa(t,n))}function Va(e,t){return typeof e==`function`?e(t):e}function Ha(e){return e.split(`-`)[0]}function Ua(e){return e.split(`-`)[1]}function Wa(e){return e===`x`?`y`:`x`}function Ga(e){return e===`y`?`height`:`width`}function Ka(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function qa(e){return Wa(Ka(e))}function Ja(e,t,n){n===void 0&&(n=!1);let r=Ua(e),i=qa(e),a=Ga(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ro(o)),[o,ro(o)]}function Ya(e){let t=ro(e);return[Xa(e),t,Xa(t)]}function Xa(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Za=[`left`,`right`],Qa=[`right`,`left`],$a=[`top`,`bottom`],eo=[`bottom`,`top`];function to(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Qa:Za:t?Za:Qa;case`left`:case`right`:return t?$a:eo;default:return[]}}function no(e,t,n,r){let i=Ua(e),a=to(Ha(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Xa)))),a}function ro(e){let t=Ha(e);return za[t]+e.slice(t.length)}function io(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ao(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:io(e)}function oo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function so(e,t,n){let{reference:r,floating:i}=e,a=Ka(t),o=qa(t),s=Ga(o),c=Ha(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ua(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function co(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Va(t,e),p=ao(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=oo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=oo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var lo=50,uo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:co},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=so(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<lo&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=so(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},fo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Va(e,t)||{};if(l==null)return{};let d=ao(u),f={x:n,y:r},p=qa(i),m=Ga(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Pa(d[_],T),D=Pa(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Ba(E,k,O),j=!c.arrow&&Ua(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),po=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Va(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ha(r),_=Ka(o),v=Ha(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ro(o)]:Ya(o)),x=p!==`none`;!d&&x&&b.push(...no(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ja(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Ka(t)||T.every(e=>Ka(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Ka(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function mo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ho(e){return Na.some(t=>e[t]>=0)}var go=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Va(e,t);switch(i){case`referenceHidden`:{let e=mo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ho(e)}}}case`escaped`:{let e=mo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ho(e)}}}default:return{}}}}},_o=new Set([`left`,`top`]);async function vo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ha(n),s=Ua(n),c=Ka(n)===`y`,l=_o.has(o)?-1:1,u=a&&c?-1:1,d=Va(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var yo=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await vo(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},bo=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Va(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ka(i),p=Wa(f),m=u[p],h=u[f],g=(e,t)=>Ba(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},xo=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Va(e,t),u={x:n,y:r},d=Ka(i),f=Wa(d),p=u[f],m=u[d],h=Va(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=_o.has(Ha(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},So=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Va(e,t),c=await i.detectOverflow(t,s),l=Ha(n),u=Ua(n),d=Ka(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Pa(p-c[m],g),y=Pa(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Fa(c.left,c.right):S=p-2*Fa(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Co(){return typeof window<`u`}function wo(e){return Eo(e)?(e.nodeName||``).toLowerCase():`#document`}function Y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function To(e){return((Eo(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Eo(e){return Co()?e instanceof Node||e instanceof Y(e).Node:!1}function Do(e){return Co()?e instanceof Element||e instanceof Y(e).Element:!1}function Oo(e){return Co()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function ko(e){return!Co()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}function Ao(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Vo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function jo(e){return/^(table|td|th)$/.test(wo(e))}function Mo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var No=/transform|translate|scale|rotate|perspective|filter/,Po=/paint|layout|strict|content/,Fo=e=>!!e&&e!==`none`,Io;function Lo(e){let t=Do(e)?Vo(e):e;return Fo(t.transform)||Fo(t.translate)||Fo(t.scale)||Fo(t.rotate)||Fo(t.perspective)||!zo()&&(Fo(t.backdropFilter)||Fo(t.filter))||No.test(t.willChange||``)||Po.test(t.contain||``)}function Ro(e){let t=Uo(e);for(;Oo(t)&&!Bo(t);){if(Lo(t))return t;if(Mo(t))return null;t=Uo(t)}return null}function zo(){return Io??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Io}function Bo(e){return/^(html|body|#document)$/.test(wo(e))}function Vo(e){return Y(e).getComputedStyle(e)}function Ho(e){return Do(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Uo(e){if(wo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ko(e)&&e.host||To(e);return ko(t)?t.host:t}function Wo(e){let t=Uo(e);return Bo(t)?(e.ownerDocument||e).body:Oo(t)&&Ao(t)?t:Wo(t)}function Go(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Wo(e),i=r===e.ownerDocument?.body,a=Y(r);if(i){let e=Ko(a);return t.concat(a,a.visualViewport||[],Ao(r)?r:[],e&&n?Go(e):[])}return t.concat(r,Go(r,[],n))}function Ko(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qo(e){let t=Vo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Oo(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ia(n)!==a||Ia(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Jo(e){return Do(e)?e:e.contextElement}function Yo(e){let t=Jo(e);if(!Oo(t))return Ra(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=qo(t),o=(a?Ia(n.width):n.width)/r,s=(a?Ia(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Xo=Ra(0);function Zo(e){let t=Y(e);return!zo()||!t.visualViewport?Xo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qo(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Y(e)}function $o(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Jo(e),o=Ra(1);t&&(r?Do(r)&&(o=Yo(r)):o=Yo(e));let s=Qo(a,n,r)?Zo(a):Ra(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Y(a),t=Do(r)?Y(r):r,n=e,i=Ko(n);for(;i&&t!==n;){let e=Yo(i),t=i.getBoundingClientRect(),r=Vo(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Y(i),i=Ko(n)}}return oo({width:u,height:d,x:c,y:l})}function es(e,t){let n=Ho(e).scrollLeft;return t?t.left+n:$o(To(e)).left+n}function ts(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-es(e,n),y:n.top+t.scrollTop}}function ns(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=To(r),s=t?Mo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ra(1),u=Ra(0),d=Oo(r);if((d||!a)&&((wo(r)!==`body`||Ao(o))&&(c=Ho(r)),d)){let e=$o(r);l=Yo(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ts(o,c):Ra(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function rs(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function is(e){let t=Ho(e),n=e.ownerDocument.body,r=Fa(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Fa(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+es(e),o=-t.scrollTop;return Vo(n).direction===`rtl`&&(a+=Fa(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var as=25;function os(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Y(e),a=To(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!zo()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(es(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=as&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ss(e,t){let n=$o(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Yo(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function cs(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=os(e,n,t);else if(t===`document`)r=is(To(e));else if(Do(t))r=ss(t,n);else{let n=Zo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return oo(r)}function ls(e,t){let n=t.get(e);if(n)return n;let r=Go(e,[],!1).filter(e=>Do(e)&&wo(e)!==`body`),i=null,a=Vo(e).position===`fixed`,o=a?Uo(e):e;for(;Do(o)&&!Bo(o);){let e=Vo(o),t=Lo(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Uo(o)}return t.set(e,r),r}function us(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Mo(t)?[]:ls(t,this._c):[].concat(n),r],o=cs(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=cs(t,a[e],i);s=Fa(n.top,s),c=Pa(n.right,c),l=Pa(n.bottom,l),u=Fa(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ds(e){let{width:t,height:n}=qo(e);return{width:t,height:n}}function fs(e,t,n){let r=Oo(t),i=To(t),a=n===`fixed`,o=$o(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ra(0);if((r||!a)&&((wo(t)!==`body`||Ao(i))&&(s=Ho(t)),r)){let e=$o(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=es(i));let l=i&&!r&&!a?ts(i,s):Ra(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ps(e){return Vo(e).position===`static`}function ms(e,t){if(!Oo(e)||Vo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return To(e)===n&&(n=n.ownerDocument.body),n}function hs(e,t){let n=Y(e);if(Mo(e))return n;if(!Oo(e)){let t=Uo(e);for(;t&&!Bo(t);){if(Do(t)&&!ps(t))return t;t=Uo(t)}return n}let r=ms(e,t);for(;r&&jo(r)&&ps(r);)r=ms(r,t);return r&&Bo(r)&&ps(r)&&!Lo(r)?n:r||Ro(e)||n}var gs=async function(e){let t=this.getOffsetParent||hs,n=this.getDimensions,r=await n(e.floating);return{reference:fs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _s(e){return Vo(e).direction===`rtl`}var vs={convertOffsetParentRelativeRectToViewportRelativeRect:ns,getDocumentElement:To,getClippingRect:us,getOffsetParent:hs,getElementRects:gs,getClientRects:rs,getDimensions:ds,getScale:Yo,isElement:Do,isRTL:_s};function ys(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bs(e,t,n){let r=null,i,a=To(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=La(d),h=La(a.clientWidth-(u+f)),g=La(a.clientHeight-(d+p)),_=La(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Fa(0,Pa(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!ys(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Y(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function xs(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Jo(e),u=i||a?[...l?Go(l):[],...t?Go(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?bs(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?$o(e):null;c&&g();function g(){let t=$o(e);h&&!ys(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ss=yo,Cs=bo,ws=po,Ts=So,Es=go,Ds=fo,Os=xo,ks=(e,t,n)=>{let r=new Map,i=n??{},a={...vs,...i.platform,_c:r};return uo(e,t,{...i,platform:a})},As=typeof document<`u`?i.useLayoutEffect:function(){};function js(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!js(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!js(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ms(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ns(e,t){let n=Ms(e);return Math.round(t*n)/n}function Ps(e){let t=i.useRef(e);return As(()=>{t.current=e}),t}function Fs(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:a,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=i.useState(r);js(p,r)||m(r);let[h,g]=i.useState(null),[_,v]=i.useState(null),y=i.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=i.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=i.useRef(null),w=i.useRef(null),T=i.useRef(d),D=l!=null,O=Ps(l),k=Ps(a),A=Ps(u),j=i.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),ks(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!js(T.current,t)&&(T.current=t,E.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);As(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=i.useRef(!1);As(()=>(M.current=!0,()=>{M.current=!1}),[]),As(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=i.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=i.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=i.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ns(P.floating,d.x),r=Ns(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ms(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return i.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:ee}),[d,j,N,P,ee])}var Is=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Ds({element:r.current,padding:i}).fn(n):r?Ds({element:r,padding:i}).fn(n):{}}}},Ls=(e,t)=>{let n=Ss(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rs=(e,t)=>{let n=Cs(e);return{name:n.name,fn:n.fn,options:[e,t]}},zs=(e,t)=>({fn:Os(e).fn,options:[e,t]}),Bs=(e,t)=>{let n=ws(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vs=(e,t)=>{let n=Ts(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hs=(e,t)=>{let n=Es(e);return{name:n.name,fn:n.fn,options:[e,t]}},Us=(e,t)=>{let n=Is(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ws=Object.defineProperty,Gs=i.forwardRef(((e,t)=>Ws(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,D.jsx)(A.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,D.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Ks=Object.defineProperty,qs=(e,t)=>Ks(e,`name`,{value:t,configurable:!0}),Js=`Popper`,[Ys,Xs]=L(Js),[Zs,Qs]=Ys(Js),$s=qs(e=>{let{__scopePopper:t,children:n}=e,[r,a]=i.useState(null),[o,s]=i.useState(void 0);return(0,D.jsx)(Zs,{scope:t,anchor:r,onAnchorChange:a,placementState:o,setPlacementState:s,children:n})},`Popper`),ec=`PopperAnchor`,tc=i.forwardRef(qs(function(e,t){let{__scopePopper:n,virtualRef:r,...a}=e,o=Qs(ec,n),s=i.useRef(null),c=o.onAnchorChange,u=l(t,i.useCallback(e=>{s.current=e,e&&c(e)},[c])),d=i.useRef(null);i.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&c(d.current)});let f=o.placementState&&dc(o.placementState),p=f?.[0],m=f?.[1];return r?null:(0,D.jsx)(A.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...a,ref:u})},`PopperAnchor`)),nc=`PopperContent`,[rc,ic]=Ys(nc),ac=i.forwardRef(qs(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=Qs(nc,n),[y,b]=i.useState(null),x=l(t,b),[S,C]=i.useState(null),w=ma(S),T=w?.width??0,E=w?.height??0,O=r+(o===`center`?``:`-`+o),k=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(d)?d:[d],M=j.length>0,N={padding:k,boundary:j.filter(lc),altBoundary:M},{refs:P,floatingStyles:ee,placement:te,isPositioned:F,middlewareData:I}=Fs({strategy:`fixed`,placement:O,whileElementsMounted:qs((...e)=>xs(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Ls({mainAxis:a+E,alignmentAxis:s}),u&&Rs({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?zs():void 0,...N}),u&&Bs({...N}),Vs({...N,apply:qs(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&Us({element:S,padding:c}),uc({arrowWidth:T,arrowHeight:E}),m&&Hs({strategy:`referenceHidden`,...N,boundary:M?N.boundary:void 0})]}),L=v.setPlacementState;B(()=>(L(te),()=>{L(void 0)}),[te,L]);let[ne,re]=dc(te),R=G(g);B(()=>{F&&R?.()},[F,R]);let ie=I.arrow?.x,ae=I.arrow?.y,oe=I.arrow?.centerOffset!==0,[se,ce]=i.useState();return B(()=>{y&&ce(window.getComputedStyle(y).zIndex)},[y]),(0,D.jsx)(`div`,{ref:P.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:F?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,D.jsx)(rc,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:C,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,D.jsx)(A.div,{"data-side":ne,"data-align":re,..._,ref:x,style:{..._.style,animation:F?_.style?.animation:`none`}})})})},`PopperContent`)),oc=`PopperArrow`,sc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},cc=i.forwardRef(qs(function(e,t){let{__scopePopper:n,...r}=e,i=ic(oc,n),a=sc[i.placedSide];return(0,D.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,D.jsx)(Gs,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function lc(e){return e!==null}qs(lc,`isNotNull`);var uc=qs(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=dc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function dc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}qs(dc,`getSideAndAlignFromPlacement`);var fc=$s,pc=tc,mc=ac,hc=cc,gc=Object.defineProperty,_c=(e,t)=>gc(e,`name`,{value:t,configurable:!0}),vc=!1;function yc(){let[e,t]=i.useState(vc);return i.useEffect(()=>{vc||(vc=!0,t(!0))},[]),e}_c(yc,`useIsHydrated`);var bc=i.useSyncExternalStore;function xc(){return()=>{}}_c(xc,`subscribe`);function Sc(){return bc(xc,()=>!0,()=>!1)}_c(Sc,`useIsHydratedModern`);var Cc=typeof bc==`function`?Sc:yc,wc=Object.defineProperty,Tc=(e,t)=>wc(e,`name`,{value:t,configurable:!0}),Ec=`rovingFocusGroup.onEntryFocus`,Dc={bubbles:!1,cancelable:!0},Oc=`RovingFocusGroup`,[kc,Ac,jc]=ie(Oc),[Mc,Nc]=L(Oc,[jc]),[Pc,Fc]=Mc(Oc),Ic=i.forwardRef(Tc(function(e,t){return(0,D.jsx)(kc.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(kc.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(Lc,{...e,ref:t})})})},`RovingFocusGroup`)),Lc=i.forwardRef(Tc(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=i.useRef(null),h=l(t,m),g=ft(o),[_,v]=V({prop:s,defaultProp:c??null,onChange:u,caller:Oc}),[y,b]=i.useState(!1),x=G(d),S=Ac(n),C=i.useRef(!1),[w,T]=i.useState(0);return i.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Ec,x),()=>e.removeEventListener(Ec,x)},[x]),(0,D.jsx)(Pc,{scope:n,orientation:r,dir:g,loop:a,currentTabStopId:_,onItemFocus:i.useCallback(e=>v(e),[v]),onItemShiftTab:i.useCallback(()=>b(!0),[]),onFocusableItemAdd:i.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:i.useCallback(()=>T(e=>e-1),[]),children:(0,D.jsx)(A.div,{tabIndex:y||w===0?-1:0,"data-orientation":r,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:z(e.onMouseDown,()=>{C.current=!0}),onFocus:z(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(Ec,Dc);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);Uc([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}C.current=!1}),onBlur:z(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),Rc=`RovingFocusGroupItem`,zc=i.forwardRef(Tc(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:s,...c}=e,l=U(),u=o||l,d=Fc(Rc,n),f=d.currentTabStopId===u,p=Ac(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=d,_=Cc();return B(()=>{if(_&&r)return m(),()=>h()},[_,r,m,h]),i.useEffect(()=>{if(!_&&r)return m(),()=>h()},[_,r,m,h]),(0,D.jsx)(kc.ItemSlot,{scope:n,id:u,focusable:r,active:a,children:(0,D.jsx)(A.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:z(e.onMouseDown,e=>{r?d.onItemFocus(u):e.preventDefault()}),onFocus:z(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:z(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Hc(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?Wc(n,r+1):n.slice(r+1)}setTimeout(()=>Uc(n))}}),children:typeof s==`function`?s({isCurrentTabStop:f,hasTabStop:g!=null}):s})})},`RovingFocusGroupItem`)),Bc={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Vc(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Tc(Vc,`getDirectionAwareKey`);function Hc(e,t,n){let r=Vc(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Bc[r]}Tc(Hc,`getFocusIntent`);function Uc(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Tc(Uc,`focusFirst`);function Wc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Tc(Wc,`wrapArray`);var Gc=Ic,Kc=zc,qc=Object.defineProperty,X=(e,t)=>qc(e,`name`,{value:t,configurable:!0}),Jc=[`Enter`,` `],Yc=[`ArrowDown`,`PageUp`,`Home`],Xc=[`ArrowUp`,`PageDown`,`End`],Zc=[...Yc,...Xc],Qc={ltr:[...Jc,`ArrowRight`],rtl:[...Jc,`ArrowLeft`]},$c={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},el=`Menu`,[tl,nl,rl]=ie(el),[il,al]=L(el,[rl,Xs,Nc]),ol=Xs(),sl=Nc(),[cl,ll]=il(el),[ul,dl]=il(el),fl=X(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:s=!0}=e,c=ol(t),[l,u]=i.useState(null),d=i.useRef(!1),f=G(o),p=ft(a);return i.useEffect(()=>{let e=X(()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=X(()=>d.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),i.useEffect(()=>{if(!n)return;let e=X(()=>f(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,D.jsx)(fc,{...c,children:(0,D.jsx)(cl,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,D.jsx)(ul,{scope:t,onClose:i.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:r})})})},`Menu`),pl=i.forwardRef(X(function(e,t){let{__scopeMenu:n,...r}=e,i=ol(n);return(0,D.jsx)(pc,{...i,...r,ref:t})},`MenuAnchor`)),ml=`MenuPortal`,[hl,gl]=il(ml,{forceMount:void 0}),_l=X(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=ll(ml,t);return(0,D.jsx)(hl,{scope:t,forceMount:n,children:(0,D.jsx)(H,{present:n||a.open,children:(0,D.jsx)(Dn,{asChild:!0,container:i,children:r})})})},`MenuPortal`),vl=`MenuContent`,[yl,bl]=il(vl),xl=i.forwardRef(X(function(e,t){let n=gl(vl,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=ll(vl,e.__scopeMenu),o=dl(vl,e.__scopeMenu);return(0,D.jsx)(tl.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(H,{present:r||a.open,children:(0,D.jsx)(tl.Slot,{scope:e.__scopeMenu,children:o.modal?(0,D.jsx)(Sl,{...i,ref:t}):(0,D.jsx)(Cl,{...i,ref:t})})})})},`MenuContent`)),Sl=i.forwardRef(X(function(e,t){let n=ll(vl,e.__scopeMenu),r=i.useRef(null),a=l(t,r);return i.useEffect(()=>{let e=r.current;if(e)return Zr(e)},[]),(0,D.jsx)(Tl,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Cl=i.forwardRef(X(function(e,t){let n=ll(vl,e.__scopeMenu);return(0,D.jsx)(Tl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),wl=f(`MenuContent.ScrollLock`),Tl=i.forwardRef(X(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=ll(vl,n),y=dl(vl,n),b=ol(n),x=sl(n),S=nl(n),[C,w]=i.useState(null),T=i.useRef(null),E=l(t,T,v.onContentChange),O=i.useRef(0),k=i.useRef(``),A=i.useRef(0),j=i.useRef(null),M=i.useRef(`right`),N=i.useRef(0),P=g?Hr:i.Fragment,ee=g?{as:wl,allowPinchZoom:!0}:void 0,te=X(e=>{let t=k.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Yl(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;X((function e(t){k.current=t,window.clearTimeout(O.current),t!==``&&(O.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);i.useEffect(()=>()=>window.clearTimeout(O.current),[]),Nn();let F=i.useCallback(e=>M.current===j.current?.side&&Zl(e,j.current?.area),[]);return(0,D.jsx)(yl,{scope:n,searchRef:k,onItemEnter:i.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:i.useCallback(e=>{F(e)||(T.current?.focus(),w(null))},[F]),onTriggerLeave:i.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:A,onPointerGraceIntentChange:i.useCallback(e=>{j.current=e},[]),children:(0,D.jsx)(P,{...ee,children:(0,D.jsx)(mn,{asChild:!0,trapped:a,onMountAutoFocus:z(o,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,D.jsx)(nn,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,D.jsx)(Gc,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:z(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,D.jsx)(mc,{role:`menu`,"aria-orientation":`vertical`,"data-state":Wl(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:E,style:{outline:`none`,..._.style},onKeyDown:z(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=T.current;if(e.target!==i||!Zc.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);Xc.includes(e.key)&&a.reverse(),ql(a)}),onBlur:z(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),k.current=``)}),onPointerMove:z(e.onPointerMove,Ql(e=>{let t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>N.current?`right`:`left`;M.current=t,N.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),El=i.forwardRef(X(function(e,t){let{__scopeMenu:n,...r}=e;return(0,D.jsx)(A.div,{...r,ref:t})},`MenuLabel`)),Dl=`MenuItem`,Ol=`menu.itemSelect`,kl=i.forwardRef(X(function(e,t){let{disabled:n=!1,onSelect:r,...a}=e,o=i.useRef(null),s=dl(Dl,e.__scopeMenu),c=bl(Dl,e.__scopeMenu),u=l(t,o),d=i.useRef(!1),f=X(()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(Ol,{bubbles:!0,cancelable:!0});e.addEventListener(Ol,e=>r?.(e),{once:!0}),j(e,t),t.defaultPrevented?d.current=!1:s.onClose()}},`handleSelect`);return(0,D.jsx)(Al,{...a,ref:u,disabled:n,onClick:z(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:z(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:z(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(c.searchRef.current===``||e.key!==` `)&&Jc.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Al=i.forwardRef(X(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:a,...o}=e,s=bl(Dl,n),c=sl(n),u=i.useRef(null),d=l(t,u),[f,p]=i.useState(!1),[m,h]=i.useState(``);return i.useEffect(()=>{let e=u.current;e&&h((e.textContent??``).trim())},[o.children]),(0,D.jsx)(tl.ItemSlot,{scope:n,disabled:r,textValue:a??m,children:(0,D.jsx)(Kc,{asChild:!0,...c,focusable:!r,children:(0,D.jsx)(A.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...o,ref:d,onPointerMove:z(e.onPointerMove,Ql(e=>{r?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,Ql(e=>s.onItemLeave(e))),onFocus:z(e.onFocus,()=>p(!0)),onBlur:z(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),[jl,Ml]=il(`MenuRadioGroup`,{value:void 0,onValueChange:X(()=>{},`onValueChange`)}),[Nl,Pl]=il(`MenuItemIndicator`,{checked:!1}),Fl=i.forwardRef(X(function(e,t){let{__scopeMenu:n,...r}=e;return(0,D.jsx)(A.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),Il=`MenuSub`,[Ll,Rl]=il(Il),zl=X(e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:a}=e,o=ll(Il,t),s=ol(t),[c,l]=i.useState(null),[u,d]=i.useState(null),f=G(a);return i.useEffect(()=>(o.open===!1&&f(!1),()=>f(!1)),[o.open,f]),(0,D.jsx)(fc,{...s,children:(0,D.jsx)(cl,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:(0,D.jsx)(Ll,{scope:t,contentId:U(),triggerId:U(),trigger:c,onTriggerChange:l,children:n})})})},`MenuSub`),Bl=`MenuSubTrigger`,Vl=i.forwardRef(X(function(e,t){let n=ll(Bl,e.__scopeMenu),r=dl(Bl,e.__scopeMenu),a=Rl(Bl,e.__scopeMenu),o=bl(Bl,e.__scopeMenu),s=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:e.__scopeMenu},f=i.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);i.useEffect(()=>f,[f]),i.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]);let p=l(t,a.onTriggerChange);return(0,D.jsx)(pl,{asChild:!0,...d,children:(0,D.jsx)(Al,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":Wl(n.open),...e,ref:p,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,Ql(t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:z(e.onPointerLeave,Ql(e=>{f();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,a=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];o.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(o.searchRef.current===``||t.key!==` `)&&Qc[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Hl=`MenuSubContent`,Ul=i.forwardRef(X(function(e,t){let n=gl(vl,e.__scopeMenu),{forceMount:r=n.forceMount,align:a=`start`,...o}=e,s=ll(vl,e.__scopeMenu),c=dl(vl,e.__scopeMenu),u=Rl(Hl,e.__scopeMenu),d=i.useRef(null),f=l(t,d);return(0,D.jsx)(tl.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(H,{present:r||s.open,children:(0,D.jsx)(tl.Slot,{scope:e.__scopeMenu,children:(0,D.jsx)(Tl,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:a,side:c.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:z(e.onFocusOutside,e=>{e.target!==u.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:z(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=$c[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function Wl(e){return e?`open`:`closed`}X(Wl,`getOpenState`);function Gl(e){return e===`indeterminate`}X(Gl,`isIndeterminate`);function Kl(e){return Gl(e)?`indeterminate`:e?`checked`:`unchecked`}X(Kl,`getCheckedState`);function ql(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(ql,`focusFirst`);function Jl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(Jl,`wrapArray`);function Yl(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Jl(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}X(Yl,`getNextMatch`);function Xl(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}X(Xl,`isPointInPolygon`);function Zl(e,t){return t?Xl({x:e.clientX,y:e.clientY},t):!1}X(Zl,`isPointerInGraceArea`);function Ql(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(Ql,`whenMouse`);var $l=fl,eu=pl,tu=_l,nu=xl,ru=El,iu=kl,au=Fl,ou=zl,su=Vl,cu=Ul,lu=Object.defineProperty,uu=(e,t)=>lu(e,`name`,{value:t,configurable:!0}),du=`DropdownMenu`,[fu,pu]=L(du,[al]),mu=al(),[hu,gu]=fu(du),_u=uu(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,l=mu(t),u=i.useRef(null),[d,f]=V({prop:a,defaultProp:o??!1,onChange:s,caller:du});return(0,D.jsx)(hu,{scope:t,triggerId:U(),triggerRef:u,contentId:U(),open:d,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(e=>!e),[f]),modal:c,children:(0,D.jsx)($l,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})},`DropdownMenu`),vu=`DropdownMenuTrigger`,yu=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=gu(vu,n),o=mu(n),s=l(t,a.triggerRef);return(0,D.jsx)(eu,{asChild:!0,...o,children:(0,D.jsx)(A.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:z(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:z(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),bu=uu(e=>{let{__scopeDropdownMenu:t,...n}=e,r=mu(t);return(0,D.jsx)(tu,{...r,...n})},`DropdownMenuPortal`),xu=`DropdownMenuContent`,Su=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,a=gu(xu,n),o=mu(n),s=i.useRef(!1);return(0,D.jsx)(nu,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...r,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{s.current||a.triggerRef.current?.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:z(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!a.modal||r)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Cu=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mu(n);return(0,D.jsx)(ru,{...i,...r,ref:t})},`DropdownMenuLabel`)),wu=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mu(n);return(0,D.jsx)(iu,{...i,...r,ref:t})},`DropdownMenuItem`)),Tu=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mu(n);return(0,D.jsx)(au,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Eu=uu(e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=mu(t),[s,c]=V({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,D.jsx)(ou,{...o,open:s,onOpenChange:c,children:n})},`DropdownMenuSub`),Du=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mu(n);return(0,D.jsx)(su,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),Ou=i.forwardRef(uu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=mu(n);return(0,D.jsx)(cu,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),ku=_u,Au=yu,ju=bu,Mu=Su,Nu=Cu,Pu=wu,Fu=Tu,Iu=Eu,Lu=Du,Ru=Ou,zu=Object.defineProperty,Bu=i.forwardRef(((e,t)=>zu(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,D.jsx)(A.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Vu=Object.defineProperty,Hu=(e,t)=>Vu(e,`name`,{value:t,configurable:!0});function Uu(e){let t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Hu(Uu,`usePrevious`);var Wu=Object.defineProperty,Gu=(e,t)=>Wu(e,`name`,{value:t,configurable:!0});function Ku(e,[t,n]){return Math.min(n,Math.max(t,e))}Gu(Ku,`clamp`);var qu=Object.defineProperty,Ju=(e,t)=>qu(e,`name`,{value:t,configurable:!0}),Yu=`Popover`,[Xu,Zu]=L(Yu,[Xs]),Qu=Xs(),[$u,ed]=Xu(Yu),td=Ju(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!1}=e,c=Qu(t),l=i.useRef(null),[u,d]=i.useState(!1),[f,p]=V({prop:r,defaultProp:a??!1,onChange:o,caller:Yu});return(0,D.jsx)(fc,{...c,children:(0,D.jsx)($u,{scope:t,contentId:U(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:i.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>d(!0),[]),onCustomAnchorRemove:i.useCallback(()=>d(!1),[]),modal:s,children:n})})},`Popover`),nd=`PopoverTrigger`,rd=i.forwardRef(Ju(function(e,t){let{__scopePopover:n,...r}=e,i=ed(nd,n),a=Qu(n),o=l(t,i.triggerRef),s=(0,D.jsx)(A.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":md(i.open),...r,ref:o,onClick:z(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,D.jsx)(pc,{asChild:!0,...a,children:s})},`PopoverTrigger`)),id=`PopoverPortal`,[ad,od]=Xu(id,{forceMount:void 0}),sd=Ju(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=ed(id,t);return(0,D.jsx)(ad,{scope:t,forceMount:n,children:(0,D.jsx)(H,{present:n||a.open,children:(0,D.jsx)(Dn,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),cd=`PopoverContent`,ld=i.forwardRef(Ju(function(e,t){let n=od(cd,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=ed(cd,e.__scopePopover);return(0,D.jsx)(H,{present:r||a.open,children:a.modal?(0,D.jsx)(dd,{...i,ref:t}):(0,D.jsx)(fd,{...i,ref:t})})},`PopoverContent`)),ud=f(`PopoverContent.RemoveScroll`),dd=i.forwardRef(Ju(function(e,t){let n=ed(cd,e.__scopePopover),r=i.useRef(null),a=l(t,r),o=i.useRef(!1);return i.useEffect(()=>{let e=r.current;if(e)return Zr(e)},[]),(0,D.jsx)(Hr,{as:ud,allowPinchZoom:!0,children:(0,D.jsx)(pd,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),fd=i.forwardRef(Ju(function(e,t){let n=ed(cd,e.__scopePopover),r=i.useRef(!1),a=i.useRef(!1);return(0,D.jsx)(pd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let i=t.target;n.triggerRef.current?.contains(i)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&a.current&&t.preventDefault()}})},`PopoverContentNonModal`)),pd=i.forwardRef(Ju(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=ed(cd,n),p=Qu(n);return Nn(),(0,D.jsx)(mn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,D.jsx)(nn,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,D.jsx)(mc,{"data-state":md(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.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)`}})})})},`PopoverContentImpl`));function md(e){return e?`open`:`closed`}Ju(md,`getState`);var hd=td,gd=rd,_d=sd,vd=ld,yd=Object.defineProperty,Z=(e,t)=>yd(e,`name`,{value:t,configurable:!0}),bd=[` `,`Enter`,`ArrowUp`,`ArrowDown`],xd=[` `,`Enter`],Sd=`Select`,[Cd,wd,Td]=ie(Sd),[Ed,Dd]=L(Sd,[Td,Xs]),Od=Xs(),[kd,Ad]=Ed(Sd),[jd,Md]=Ed(Sd);function Nd(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:s,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:h,internal_do_not_use_render:g}=e,_=Od(t),[v,y]=i.useState(null),[b,x]=i.useState(null),[S,C]=i.useState(!1),w=ft(u),[T,E]=V({prop:r,defaultProp:a??!1,onChange:o,caller:Sd}),[O,k]=V({prop:s,defaultProp:c,onChange:l,caller:Sd}),A=i.useRef(null),j=i.useRef(O);i.useEffect(()=>{let e=h?v?.ownerDocument.getElementById(h):v?.form;if(e instanceof HTMLFormElement){let t=Z(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,v,k]);let M=!v||!!h||!!v.closest(`form`),[N,P]=i.useState(new Set),ee=U(),te=Array.from(N).map(e=>e.props.value).join(`;`),F=i.useCallback(e=>{P(t=>new Set(t).add(e))},[]),I=i.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),L={required:m,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:ee,value:O,onValueChange:k,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:A,disabled:p,name:d,autoComplete:f,form:h,nativeOptions:N,nativeSelectKey:te,isFormControl:M};return(0,D.jsx)(fc,{..._,children:(0,D.jsx)(kd,{scope:t,...L,children:(0,D.jsx)(Cd.Provider,{scope:t,children:(0,D.jsx)(jd,{scope:t,onNativeOptionAdd:F,onNativeOptionRemove:I,children:xf(g)?g(L):n})})})})}Z(Nd,`SelectProvider`);var Pd=Z(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,D.jsx)(Nd,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,D.jsxs)(D.Fragment,{children:[n,e?(0,D.jsx)(bf,{__scopeSelect:t}):null]})})},`Select`),Fd=`SelectTrigger`,Id=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,disabled:r=!1,...a}=e,o=Od(n),s=Ad(Fd,n),c=s.disabled||r,u=l(t,s.onTriggerChange),d=wd(n),f=i.useRef(`touch`),[p,m,h]=Cf(e=>{let t=d().filter(e=>!e.disabled),n=wf(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),g=Z(e=>{c||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,D.jsx)(pc,{asChild:!0,...o,children:(0,D.jsx)(A.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":Sf(s.value)?``:void 0,...a,ref:u,onClick:z(a.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:z(a.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:z(a.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&bd.includes(e.key)&&(g(),e.preventDefault())})})})},`SelectTrigger`)),Ld=`SelectValue`,Rd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,className:r,style:a,children:o,placeholder:s=``,...c}=e,u=Ad(Ld,n),{onValueNodeHasChildrenChange:d}=u,f=o!==void 0,p=l(t,u.onValueNodeChange);B(()=>{d(f)},[d,f]);let m=Sf(u.value);return(0,D.jsx)(A.span,{...c,asChild:!m&&c.asChild,ref:p,style:{pointerEvents:`none`},children:(0,D.jsx)(i.Fragment,{children:m?s:o},m?`placeholder`:`value`)})},`SelectValue`)),zd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,D.jsx)(A.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[Bd,Vd]=Ed(`SelectPortal`,{forceMount:void 0}),Hd=Z(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,D.jsx)(Bd,{scope:e.__scopeSelect,forceMount:n,children:(0,D.jsx)(Dn,{asChild:!0,...r})})},`SelectPortal`),Ud=`SelectContent`,Wd=i.forwardRef(Z(function(e,t){let n=Vd(Ud,e.__scopeSelect),{forceMount:r=n.forceMount,...a}=e,o=Ad(Ud,e.__scopeSelect),[s,c]=i.useState();return B(()=>{c(new DocumentFragment)},[]),(0,D.jsx)(H,{present:r||o.open,children:({present:e})=>e?(0,D.jsx)(Xd,{...a,ref:t}):(0,D.jsx)(Gd,{...a,fragment:s})})},`SelectContent`)),Gd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?E.createPortal((0,D.jsx)(qd,{scope:n,children:(0,D.jsx)(Cd.Slot,{scope:n,children:(0,D.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Kd=10,[qd,Jd]=Ed(Ud),Yd=f(`SelectContent.RemoveScroll`),Xd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v,...y}=e,b=Ad(Ud,n),[x,S]=i.useState(null),[C,w]=i.useState(null),T=l(t,S),[E,O]=i.useState(null),[k,A]=i.useState(null),j=wd(n),[M,N]=i.useState(!1),P=i.useRef(!1);i.useEffect(()=>{if(x)return Zr(x)},[x]),Nn();let ee=i.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,C]),te=i.useCallback(()=>ee([E,x]),[ee,E,x]);i.useEffect(()=>{M&&te()},[M,te]);let{onOpenChange:F,triggerPointerDownPosRef:I}=b;i.useEffect(()=>{if(x){let e={x:0,y:0},t=Z(t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},`handlePointerMove`),n=Z(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(x)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null},`handlePointerUp`);return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[x,F,I]),i.useEffect(()=>{let e=Z(()=>F(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[L,ne]=Cf(e=>{let t=j().filter(e=>!e.disabled),n=wf(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),re=i.useCallback((e,t,n)=>{let r=!P.current&&!n;(b.value!==void 0&&b.value===t||r)&&(O(e),r&&(P.current=!0))},[b.value]),R=i.useCallback(()=>x?.focus(),[x]),ie=i.useCallback((e,t,n)=>{let r=!P.current&&!n;(b.value!==void 0&&b.value===t||r)&&A(e)},[b.value]),ae=r===`popper`?Qd:Zd,oe=ae===Qd?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,D.jsx)(qd,{scope:n,content:x,viewport:C,onViewportChange:w,itemRefCallback:re,selectedItem:E,onItemLeave:R,itemTextRefCallback:ie,focusSelectedItem:te,selectedItemText:k,position:r,isPositioned:M,searchRef:L,children:(0,D.jsx)(Hr,{as:Yd,allowPinchZoom:!0,children:(0,D.jsx)(mn,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:z(a,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,D.jsx)(nn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,D.jsx)(ae,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...oe,onPlaced:()=>N(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,...y.style},onKeyDown:z(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ee(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Zd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,onPlaced:r,...a}=e,o=Ad(Ud,n),s=Jd(Ud,n),[c,u]=i.useState(null),[d,f]=i.useState(null),p=l(t,f),m=wd(n),h=i.useRef(!1),g=i.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=s,x=i.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&d&&_&&v&&y){let e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(o.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Kd,d=Ku(a,[Kd,Math.max(Kd,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Kd,d=Ku(a,[Kd,Math.max(Kd,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=m(),s=window.innerHeight-Kd*2,l=_.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),b=parseInt(u.paddingBottom,10),x=f+p+l+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Kd,D=s-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=a.length>0&&v===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=d.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);c.style.height=n+`px`}else{let e=a.length>0&&v===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}c.style.margin=`${Kd}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,o.trigger,o.valueNode,c,d,_,v,y,o.dir,r]);B(()=>x(),[x]);let[S,C]=i.useState();B(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);let w=i.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]);return(0,D.jsx)($d,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:w,children:(0,D.jsx)(`div`,{ref:u,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,D.jsx)(A.div,{...a,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})},`SelectItemAlignedPosition`)),Qd=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Kd,...a}=e,o=Od(n);return(0,D.jsx)(mc,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.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)`}})},`SelectPopperPosition`)),[$d,ef]=Ed(Ud,{}),tf=`SelectViewport`,nf=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,nonce:r,...a}=e,o=Jd(tf,n),s=ef(tf,n),c=l(t,o.onViewportChange),u=i.useRef(0);return(0,D.jsxs)(D.Fragment,{children:[(0,D.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:r}),(0,D.jsx)(Cd.Slot,{scope:n,children:(0,D.jsx)(A.div,{"data-radix-select-viewport":``,role:`presentation`,...a,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...a.style},onScroll:z(a.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-Kd*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})},`SelectViewport`)),[rf,af]=Ed(`SelectGroup`),of=`SelectItem`,[sf,cf]=Ed(of),lf=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...s}=e,c=Ad(of,n),u=Jd(of,n),d=c.value===r,[f,p]=i.useState(o??``),[m,h]=i.useState(!1),g=l(t,G(e=>u.itemRefCallback?.(e,r,a))),_=U(),v=i.useRef(`touch`),y=Z(()=>{a||(c.onValueChange(r),c.onOpenChange(!1))},`handleSelect`);return(0,D.jsx)(sf,{scope:n,value:r,disabled:a,textId:_,isSelected:d,onItemTextChange:i.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,D.jsx)(Cd.ItemSlot,{scope:n,value:r,disabled:a,textValue:f,children:(0,D.jsx)(A.div,{role:`option`,"aria-labelledby":_,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,tabIndex:a?void 0:-1,...s,ref:g,onFocus:z(s.onFocus,()=>h(!0)),onBlur:z(s.onBlur,()=>h(!1)),onClick:z(s.onClick,()=>{v.current!==`mouse`&&y()}),onPointerUp:z(s.onPointerUp,()=>{v.current===`mouse`&&y()}),onPointerDown:z(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:z(s.onPointerMove,e=>{v.current=e.pointerType,a?u.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:z(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:z(s.onKeyDown,e=>{a||e.target!==e.currentTarget||(u.searchRef?.current===``||e.key!==` `)&&(xd.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),uf=`SelectItemText`,df=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,className:r,style:a,...o}=e,s=Ad(uf,n),c=Jd(uf,n),u=cf(uf,n),d=Md(uf,n),[f,p]=i.useState(null),m=G(e=>c.itemTextRefCallback?.(e,u.value,u.disabled)),h=l(t,p,u.onItemTextChange,m),g=f?.textContent,_=i.useMemo(()=>(0,D.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=d;return B(()=>(v(_),()=>y(_)),[v,y,_]),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(A.span,{id:u.textId,...o,ref:h}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!Sf(s.value)?E.createPortal(o.children,s.valueNode):null]})},`SelectItemText`)),ff=`SelectItemIndicator`,pf=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,...r}=e;return cf(ff,n).isSelected?(0,D.jsx)(A.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),mf=`SelectScrollUpButton`,hf=i.forwardRef(Z(function(e,t){let n=Jd(mf,e.__scopeSelect),r=ef(mf,e.__scopeSelect),[a,o]=i.useState(!1),s=l(t,r.onScrollButtonChange);return B(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;o(e)};Z(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,D.jsx)(vf,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),gf=`SelectScrollDownButton`,_f=i.forwardRef(Z(function(e,t){let n=Jd(gf,e.__scopeSelect),r=ef(gf,e.__scopeSelect),[a,o]=i.useState(!1),s=l(t,r.onScrollButtonChange);return B(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)};Z(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,D.jsx)(vf,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),vf=i.forwardRef(Z(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...a}=e,o=Jd(`SelectScrollButton`,n),s=i.useRef(null),c=wd(n),l=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>l(),[l]),B(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,D.jsx)(A.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:z(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:z(a.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:z(a.onPointerLeave,()=>{l()})})},`SelectScrollButtonImpl`)),yf=`SelectBubbleInput`,bf=i.forwardRef(Z(function({__scopeSelect:e,...t},n){let r=Ad(yf,e),{value:a,onValueChange:o,required:s,disabled:c,name:u,autoComplete:d,form:f}=r,{nativeOptions:p,nativeSelectKey:m}=r,h=i.useRef(null),g=l(n,h),_=a??``,v=Uu(_),y=Array.from(p).some(e=>(e.props.value??``)===``);return i.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==_&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,_),e.dispatchEvent(t)}},[v,_]),(0,D.jsxs)(A.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:u,autoComplete:d,disabled:c,form:f,onChange:e=>o(e.target.value),...t,style:{...P,...t.style},ref:g,defaultValue:_,children:[Sf(a)&&!y?(0,D.jsx)(`option`,{value:``}):null,Array.from(p)]},m)},`SelectBubbleInput`));function xf(e){return typeof e==`function`}Z(xf,`isFunction`);function Sf(e){return e===``||e===void 0}Z(Sf,`shouldShowPlaceholder`);function Cf(e){let t=G(e),n=i.useRef(``),r=i.useRef(0),a=i.useCallback(e=>{let i=n.current+e;t(i),Z((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),o=i.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}Z(Cf,`useTypeaheadSearch`);function wf(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Tf(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Z(wf,`findNextItem`);function Tf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Z(Tf,`wrapArray`);var Ef=Object.defineProperty,Df=(e,t)=>Ef(e,`name`,{value:t,configurable:!0}),Of=`horizontal`,kf=[`horizontal`,`vertical`],Af=i.forwardRef(Df(function(e,t){let{decorative:n,orientation:r=Of,...i}=e,a=jf(r)?r:Of,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,D.jsx)(A.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function jf(e){return kf.includes(e)}Df(jf,`isValidOrientation`);var Mf=Af,Nf=Object.defineProperty,Q=(e,t)=>Nf(e,`name`,{value:t,configurable:!0}),Pf=[`PageUp`,`PageDown`],Ff=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],If={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},Lf=`Slider`,[Rf,zf,Bf]=ie(Lf),[Vf,Hf]=L(Lf,[Bf]),[Uf,Wf]=Vf(Lf),Gf=i.forwardRef(Q(function(e,t){let{name:n,min:r=0,max:a=100,step:o=1,orientation:s=`horizontal`,disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[r],value:f,onValueChange:p=Q(()=>{},`onValueChange`),onValueCommit:m=Q(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=i.useRef(new Set),y=i.useRef(0),b=i.useRef(!1),x=s===`horizontal`?Jf:Yf,[S,C]=i.useState(null),w=l(t,C),[T=[],E]=V({prop:f,defaultProp:d,onChange:Q(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,p(e)},`onChange`)}),O=i.useRef(T),k=i.useRef(T);i.useEffect(()=>{let e=g?S?.ownerDocument.getElementById(g):S?.closest(`form`);if(e instanceof HTMLFormElement){let t=Q(()=>E(k.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function A(e){N(e,pp(T,e))}Q(A,`handleSlideStart`);function j(e){N(e,y.current)}Q(j,`handleSlideMove`);function M(){String(T)!==String(O.current)&&m(T)}Q(M,`handleSlideEnd`);function N(e,t,{commit:n}={commit:!1}){let i=vp(o),s=Ku(yp(Math.round((e-r)/o)*o+r,i),[r,a]);E((e=[])=>{let r=up(e,s,t);if(gp(r,u*o)){y.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}return e})}return Q(N,`updateValues`),(0,D.jsx)(Uf,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:s,form:g,children:(0,D.jsx)(Rf.Provider,{scope:e.__scopeSlider,children:(0,D.jsx)(Rf.Slot,{scope:e.__scopeSlider,children:(0,D.jsx)(x,{"aria-disabled":c,"data-disabled":c?``:void 0,..._,ref:w,onPointerDown:z(_.onPointerDown,()=>{c||(O.current=T,b.current=!1)}),min:r,max:a,inverted:h,onSlideStart:c?void 0:A,onSlideMove:c?void 0:j,onSlideEnd:c?void 0:M,onHomeKeyDown:()=>{c||(b.current=!0,N(r,0,{commit:!0}))},onEndKeyDown:()=>{c||(b.current=!0,N(a,T.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!c){b.current=!0;let n=Pf.includes(e.key)||e.shiftKey&&Ff.includes(e.key)?10:1,i=y.current,a=T[i];N(bp(a,{min:r,step:o,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[Kf,qf]=Vf(Lf,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),Jf=i.forwardRef(Q(function(e,t){let{min:n,max:r,dir:a,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:u,onStepKeyDown:d,...f}=e,[p,m]=i.useState(null),h=l(t,m),g=i.useRef(void 0),_=ft(a),v=_===`ltr`,y=v&&!o||!v&&o;function b(e){let t=g.current||p.getBoundingClientRect(),i=_p([0,t.width],y?[n,r]:[r,n]);return g.current=t,i(e-t.left)}return Q(b,`getValueFromPointer`),(0,D.jsx)(Kf,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:(0,D.jsx)(Xf,{dir:_,"data-orientation":`horizontal`,...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=b(e.clientX);s?.(t)},onSlideMove:e=>{let t=b(e.clientX);c?.(t)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:e=>{let t=If[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),Yf=i.forwardRef(Q(function(e,t){let{min:n,max:r,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:u,...d}=e,f=i.useRef(null),p=l(t,f),m=i.useRef(void 0),h=!a;function g(e){let t=m.current||f.current.getBoundingClientRect(),i=_p([0,t.height],h?[r,n]:[n,r]);return m.current=t,i(e-t.top)}return Q(g,`getValueFromPointer`),(0,D.jsx)(Kf,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:(0,D.jsx)(Xf,{"data-orientation":`vertical`,...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=g(e.clientY);o?.(t)},onSlideMove:e=>{let t=g(e.clientY);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=If[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),Xf=i.forwardRef(Q(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Wf(Lf,n);return(0,D.jsx)(A.span,{...l,ref:t,onKeyDown:z(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Pf.concat(Ff).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:z(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:z(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:z(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),Zf=`SliderTrack`,Qf=i.forwardRef(Q(function(e,t){let{__scopeSlider:n,...r}=e,i=Wf(Zf,n);return(0,D.jsx)(A.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),$f=`SliderRange`,ep=i.forwardRef(Q(function(e,t){let{__scopeSlider:n,...r}=e,a=Wf($f,n),o=qf($f,n),s=l(t,i.useRef(null)),c=a.values.length,u=a.values.map(e=>dp(e,a.min,a.max)),d=c>1?Math.min(...u):0,f=100-Math.max(...u);return(0,D.jsx)(A.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?``:void 0,...r,ref:s,style:{...e.style,[o.startEdge]:d+`%`,[o.endEdge]:f+`%`}})},`SliderRange`)),[tp,np]=Vf(`SliderThumb`),rp=`SliderThumbProvider`;function ip(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:a}=e,o=Wf(rp,t),s=zf(t),[c,l]=i.useState(null),u=i.useMemo(()=>c?s().findIndex(e=>e.ref.current===c):-1,[s,c]),d=ma(c),f=!c||!!o.form||!!c.closest(`form`),p=o.values[u],m=n??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),h=p===void 0?0:dp(p,o.min,o.max);i.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]);let g={value:p,name:m,form:o.form,isFormControl:f,index:u,thumb:c,onThumbChange:l,percent:h,size:d};return(0,D.jsx)(tp,{scope:t,...g,children:xp(a)?a(g):r})}Q(ip,`SliderThumbProvider`);var ap=`SliderThumbTrigger`,op=i.forwardRef(Q(function(e,t){let{__scopeSlider:n,...r}=e,i=Wf(ap,n),a=qf(ap,n),{index:o,value:s,percent:c,size:u,onThumbChange:d}=np(ap,n),f=l(t,d),p=fp(o,i.values.length),m=u?.[a.size],h=m?mp(m,c,a.direction):0;return(0,D.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${c}% + ${h}px)`},children:(0,D.jsx)(Rf.ItemSlot,{scope:n,children:(0,D.jsx)(A.span,{role:`slider`,"aria-label":e[`aria-label`]||p,"aria-valuemin":i.min,"aria-valuenow":s,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:f,style:s===void 0?{display:`none`}:e.style,onFocus:z(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},`SliderThumbTrigger`)),sp=i.forwardRef(Q(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return(0,D.jsx)(ip,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(op,{...i,ref:t,__scopeSlider:n}),r?(0,D.jsx)(lp,{__scopeSlider:n},e):null]})})},`SliderThumb`)),cp=`SliderBubbleInput`,lp=i.forwardRef(Q(function({__scopeSlider:e,...t},n){let{value:r,name:a,form:o}=np(cp,e),s=i.useRef(null),c=l(s,n),u=Uu(r);return i.useEffect(()=>{let e=s.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==r&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[u,r]),(0,D.jsx)(A.input,{style:{display:`none`},name:a,form:o,...t,ref:c,defaultValue:r})},`SliderBubbleInput`));function up(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}Q(up,`getNextSortedValues`);function dp(e,t,n){return Ku(100/(n-t)*(e-t),[0,100])}Q(dp,`convertValueToPercentage`);function fp(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}Q(fp,`getLabel`);function pp(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}Q(pp,`getClosestValueIndex`);function mp(e,t,n){let r=e/2;return(r-_p([0,50],[0,r])(t)*n)*n}Q(mp,`getThumbInBoundsOffset`);function hp(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}Q(hp,`getStepsBetweenValues`);function gp(e,t){if(t>0){let n=hp(e);return Math.min(...n)>=t}return!0}Q(gp,`hasMinStepsBetweenValues`);function _p(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Q(_p,`linearScale`);function vp(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}Q(vp,`getDecimalCount`);function yp(e,t){let n=10**t;return Math.round(e*n)/n}Q(yp,`roundValue`);function bp(e,{min:t,step:n,direction:r,multiplier:i}){let a=vp(n),o=(e-t)/n,s=Math.round(o),c=yp(s*n+t,a)===yp(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),yp(l*n+t,a)}Q(bp,`getNextStepValue`);function xp(e){return typeof e==`function`}Q(xp,`isFunction`);var Sp=Object.defineProperty,Cp=(e,t)=>Sp(e,`name`,{value:t,configurable:!0}),wp=`Switch`,[Tp,Ep]=L(wp),[Dp,Op]=Tp(wp);function kp(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:a,disabled:o,form:s,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=V({prop:n,defaultProp:a??!1,onChange:l,caller:wp}),[h,g]=i.useState(null),[_,v]=i.useState(null),y=i.useRef(!1),[b,x]=i.useReducer(e=>e+1,0),S={checked:p,setChecked:m,disabled:o,control:h,setControl:g,name:c,form:s,value:d,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:u,defaultChecked:a,isFormControl:!h||!!s||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,D.jsx)(Dp,{scope:t,...S,children:Lp(f)?f(S):r})}Cp(kp,`SwitchProvider`);var Ap=`SwitchTrigger`,jp=i.forwardRef(Cp(function({__scopeSwitch:e,onClick:t,...n},r){let{control:a,form:o,value:s,disabled:c,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=Op(Ap,e),v=l(r,f),y=i.useRef(u);return i.useEffect(()=>{let e=o?a?.ownerDocument.getElementById(o):a?.form;if(e instanceof HTMLFormElement){let t=Cp(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,o,p]),(0,D.jsx)(A.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":Rp(u),"data-disabled":c?``:void 0,disabled:c,value:s,...n,ref:v,onClick:z(t,e=>{h(),p(e=>!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`SwitchTrigger`)),Mp=i.forwardRef(Cp(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,D.jsx)(kp,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(jp,{...d,ref:t,__scopeSwitch:n}),e&&(0,D.jsx)(Ip,{__scopeSwitch:n})]})})},`Switch`)),Np=`SwitchThumb`,Pp=i.forwardRef(Cp(function(e,t){let{__scopeSwitch:n,...r}=e,i=Op(Np,n);return(0,D.jsx)(A.span,{"data-state":Rp(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),Fp=`SwitchBubbleInput`,Ip=i.forwardRef(Cp(function({__scopeSwitch:e,onClick:t,...n},r){let{control:a,hasConsumerStoppedPropagationRef:o,userInteractionCount:s,checked:c,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=Op(Fp,e),v=l(r,_),y=ma(a),b=i.useRef(!1),x=i.useRef(c),S=i.useRef(s);i.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=s!==S.current;S.current=s;let i=x.current!==c;x.current=c;let a=!(r&&o.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,c),e.dispatchEvent(t),b.current=!1}},[g,c,o,s]);let C=i.useRef(c);return(0,D.jsx)(A.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...n,tabIndex:-1,ref:v,onClick:z(t,e=>{b.current&&e.stopPropagation()}),style:{...n.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function Lp(e){return typeof e==`function`}Cp(Lp,`isFunction`);function Rp(e){return e?`checked`:`unchecked`}Cp(Rp,`getState`);var zp=Object.defineProperty,Bp=(e,t)=>zp(e,`name`,{value:t,configurable:!0}),Vp=`Tabs`,[Hp,Up]=L(Vp,[Nc]),Wp=Nc(),[Gp,Kp]=Hp(Vp),qp=i.forwardRef(Bp(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=ft(s),[d,f]=V({prop:r,onChange:i,defaultProp:a??``,caller:Vp});return(0,D.jsx)(Gp,{scope:n,baseId:U(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,D.jsx)(A.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Jp=`TabsList`,Yp=i.forwardRef(Bp(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Kp(Jp,n),o=Wp(n);return(0,D.jsx)(Gc,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,D.jsx)(A.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Xp=`TabsTrigger`,Zp=i.forwardRef(Bp(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Kp(Xp,n),s=Wp(n),c=Qp(o.baseId,r),l=$p(o.baseId,r),u=r===o.value;return(0,D.jsx)(Kc,{asChild:!0,...s,focusable:!i,active:u,children:(0,D.jsx)(A.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:z(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:z(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:z(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`));function Qp(e,t){return`${e}-trigger-${t}`}Bp(Qp,`makeTriggerId`);function $p(e,t){return`${e}-content-${t}`}Bp($p,`makeContentId`);var em=qp,tm=Yp,nm=Zp,rm=Object.defineProperty,im=(e,t)=>rm(e,`name`,{value:t,configurable:!0}),am=`Toggle`,om=i.forwardRef(im(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=V({prop:n,onChange:i,defaultProp:r??!1,caller:am});return(0,D.jsx)(A.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:z(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),sm=Object.defineProperty,cm=(e,t)=>sm(e,`name`,{value:t,configurable:!0}),lm=`ToggleGroup`,[um,dm]=L(lm,[Nc]),fm=Nc(),pm=i.forwardRef(cm(function(e,t){let{type:n,...r}=e;if(n===`single`)return(0,D.jsx)(gm,{role:`radiogroup`,...r,ref:t});if(n===`multiple`)return(0,D.jsx)(_m,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${lm}\``)},`ToggleGroup`)),[mm,hm]=um(lm),gm=i.forwardRef(cm(function(e,t){let{value:n,defaultValue:r,onValueChange:a=cm(()=>{},`onValueChange`),...o}=e,[s,c]=V({prop:n,defaultProp:r??``,onChange:a,caller:lm});return(0,D.jsx)(mm,{scope:e.__scopeToggleGroup,type:`single`,value:i.useMemo(()=>s?[s]:[],[s]),onItemActivate:c,onItemDeactivate:i.useCallback(()=>c(``),[c]),children:(0,D.jsx)(bm,{...o,ref:t})})},`ToggleGroupImplSingle`)),_m=i.forwardRef(cm(function(e,t){let{value:n,defaultValue:r,onValueChange:a=cm(()=>{},`onValueChange`),...o}=e,[s,c]=V({prop:n,defaultProp:r??[],onChange:a,caller:lm}),l=i.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=i.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return(0,D.jsx)(mm,{scope:e.__scopeToggleGroup,type:`multiple`,value:s,onItemActivate:l,onItemDeactivate:u,children:(0,D.jsx)(bm,{...o,ref:t})})},`ToggleGroupImplMultiple`)),[vm,ym]=um(lm),bm=i.forwardRef(cm(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=fm(n),u=ft(o),d={dir:u,...c};return(0,D.jsx)(vm,{scope:n,rovingFocus:i,disabled:r,children:i?(0,D.jsx)(Gc,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,D.jsx)(A.div,{...d,ref:t})}):(0,D.jsx)(A.div,{...d,ref:t})})},`ToggleGroupImpl`)),xm=`ToggleGroupItem`,Sm=i.forwardRef(cm(function(e,t){let n=hm(xm,e.__scopeToggleGroup),r=ym(xm,e.__scopeToggleGroup),a=fm(e.__scopeToggleGroup),o=n.value.includes(e.value),s=r.disabled||e.disabled,c={...e,pressed:o,disabled:s},l=i.useRef(null);return r.rovingFocus?(0,D.jsx)(Kc,{asChild:!0,...a,focusable:!s,active:o,ref:l,children:(0,D.jsx)(Cm,{...c,ref:t})}):(0,D.jsx)(Cm,{...c,ref:t})},`ToggleGroupItem`)),Cm=i.forwardRef(cm(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=hm(xm,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===`single`?o:void 0;return(0,D.jsx)(om,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),wm=Object.defineProperty,$=(e,t)=>wm(e,`name`,{value:t,configurable:!0}),[Tm,Em]=L(`Tooltip`,[Xs]),Dm=Xs(),Om=`TooltipProvider`,km=700,Am=`tooltip.open`,[jm,Mm]=Tm(Om),Nm=$(e=>{let{__scopeTooltip:t,delayDuration:n=km,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=e,s=i.useRef(!0),c=i.useRef(!1),l=i.useRef(0);return i.useEffect(()=>{let e=l.current;return()=>window.clearTimeout(e)},[]),(0,D.jsx)(jm,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:i.useCallback(()=>{r<=0||(window.clearTimeout(l.current),s.current=!1)},[r]),onClose:i.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r))},[r]),isPointerInTransitRef:c,onPointerInTransitChange:i.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:o})},`TooltipProvider`),Pm=`Tooltip`,[Fm,Im]=Tm(Pm),Lm=$(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:o,disableHoverableContent:s,delayDuration:c}=e,l=Mm(Pm,e.__scopeTooltip),u=Dm(t),[d,f]=i.useState(null),[p,m]=i.useState(void 0),h=U(),g=i.useRef(0),_=s??l.disableHoverableContent,v=c??l.delayDuration,y=i.useRef(!1),[b,x]=V({prop:r,defaultProp:a??!1,onChange:$(e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(Am))):l.onClose(),o?.(e)},`onChange`),caller:Pm}),S=i.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=i.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=i.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=i.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);i.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=p??h;return(0,D.jsx)(fc,{...u,children:(0,D.jsx)(Fm,{scope:t,contentId:E,setContentId:m,open:b,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:i.useCallback(()=>{l.isOpenDelayedRef.current?T():C()},[l.isOpenDelayedRef,T,C]),onTriggerLeave:i.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),Rm=`TooltipTrigger`,zm=i.forwardRef($(function(e,t){let{__scopeTooltip:n,...r}=e,a=Im(Rm,n),o=Mm(Rm,n),s=Dm(n),c=l(t,i.useRef(null),a.onTriggerChange),u=i.useRef(!1),d=i.useRef(!1),f=i.useCallback(()=>u.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,D.jsx)(pc,{asChild:!0,...s,children:(0,D.jsx)(A.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:z(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:z(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:z(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:z(e.onBlur,a.onClose),onClick:z(e.onClick,a.onClose)})})},`TooltipTrigger`)),Bm=`TooltipPortal`,[Vm,Hm]=Tm(Bm,{forceMount:void 0}),Um=$(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Im(Bm,t);return(0,D.jsx)(Vm,{scope:t,forceMount:n,children:(0,D.jsx)(H,{present:n||a.open,children:(0,D.jsx)(Dn,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Wm=`TooltipContent`,Gm=i.forwardRef($(function(e,t){let n=Hm(Wm,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Im(Wm,e.__scopeTooltip);return(0,D.jsx)(H,{present:r||o.open,children:o.disableHoverableContent?(0,D.jsx)(Jm,{side:i,...a,ref:t}):(0,D.jsx)(Km,{side:i,...a,ref:t})})},`TooltipContent`)),Km=i.forwardRef($(function(e,t){let n=Im(Wm,e.__scopeTooltip),r=Mm(Wm,e.__scopeTooltip),a=i.useRef(null),o=l(t,a),[s,c]=i.useState(null),{trigger:u,onClose:d}=n,f=a.current,{onPointerInTransitChange:p}=r,m=i.useCallback(()=>{c(null),p(!1)},[p]),h=i.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Zm(r,Xm(r,n.getBoundingClientRect())),a=Qm(t.getBoundingClientRect()),o=eh([...i,...a]);c(o),p(!0)},[p]);return i.useEffect(()=>()=>m(),[m]),i.useEffect(()=>{if(u&&f){let e=$(e=>h(e,f),`handleTriggerLeave`),t=$(e=>h(e,u),`handleContentLeave`);return u.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{u.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[u,f,h,m]),i.useEffect(()=>{if(s){let e=$(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!$m(n,s);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,s,d,m]),(0,D.jsx)(Jm,{...e,ref:o})},`TooltipContentHoverable`)),qm=h(`TooltipContent`),Jm=i.forwardRef($(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":a,id:o,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=Im(Wm,n),d=Dm(n),{onClose:f}=u;i.useEffect(()=>(document.addEventListener(Am,f),()=>document.removeEventListener(Am,f)),[f]),i.useEffect(()=>{if(u.trigger){let e=$(e=>{e.target instanceof Node&&e.target.contains(u.trigger)&&f()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[u.trigger,f]);let{setContentId:p}=u;return B(()=>(p(o),()=>{p(void 0)}),[o,p]),(0,D.jsx)(nn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,D.jsxs)(mc,{"data-state":u.stateAttribute,role:a?void 0:`tooltip`,id:a?void 0:u.contentId,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,D.jsx)(qm,{children:r}),a?(0,D.jsx)(ee,{id:u.contentId,role:`tooltip`,children:a}):null]})})},`TooltipContentImpl`)),Ym=i.forwardRef($(function(e,t){let{__scopeTooltip:n,...r}=e,i=Dm(n);return(0,D.jsx)(hc,{...i,...r,ref:t})},`TooltipArrow`));function Xm(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}$(Xm,`getExitSideFromRect`);function Zm(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}$(Zm,`getPaddedExitPoints`);function Qm(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}$(Qm,`getPointsFromRect`);function $m(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}$($m,`isPointInPolygon`);function eh(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),th(t)}$(eh,`getHull`);function th(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}$(th,`getHullPresorted`);var nh=Nm,rh=Lm,ih=zm,ah=Um,oh=Gm,sh=Ym;export{Xi as $,nf as A,ku as B,pf as C,hf as D,_f as E,Bu as F,Au as G,Iu as H,Mu as I,aa as J,Ta as K,Pu as L,_d as M,hd as N,Id as O,gd as P,Ki as Q,Nu as R,lf as S,Hd as T,Ru as U,Fu as V,Lu as W,qi as X,sa as Y,Ji as Z,Qf as _,tt as _t,rh as a,Ti as at,Wd as b,Sm as c,fi as ct,nm as d,qt as dt,Gi as et,Mp as f,Gt as ft,sp as g,rt as gt,ep as h,Kt as ht,nh as i,ii as it,vd as j,Rd as k,tm as l,ui as lt,Gf as m,Ut as mt,oh as n,Ui as nt,ih as o,gi as ot,Pp as p,Wt as pt,Da as q,ah as r,Yi as rt,pm as s,Ci as st,sh as t,Wi as tt,em as u,xi as ut,Mf as v,ot as vt,df as w,zd as x,Pd as y,p as yt,ju as z};
package/canvas/index.html CHANGED
@@ -9,12 +9,12 @@
9
9
  <link rel="manifest" href="/site.webmanifest" />
10
10
  <meta name="theme-color" content="#0d0c0a" />
11
11
  <title>velloo</title>
12
- <script type="module" crossorigin src="/assets/index-ClaBqcaS.js"></script>
12
+ <script type="module" crossorigin src="/assets/index-DZFrkC4P.js"></script>
13
13
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
14
14
  <link rel="modulepreload" crossorigin href="/assets/react-D0Ec-185.js">
15
15
  <link rel="modulepreload" crossorigin href="/assets/vendor-CKmQ-Zst.js">
16
- <link rel="modulepreload" crossorigin href="/assets/radix-C3HaOB-d.js">
17
- <link rel="stylesheet" crossorigin href="/assets/index-BCvDZiBo.css">
16
+ <link rel="modulepreload" crossorigin href="/assets/radix-gmpYzWRH.js">
17
+ <link rel="stylesheet" crossorigin href="/assets/index-gB0StCrx.css">
18
18
  </head>
19
19
  <body>
20
20
  <div id="root"></div>
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{init_default,runInit2}from"./chunk-59zas5y2.js";import"./chunk-nev5mv85.js";import"./chunk-avkfsc3p.js";import"./chunk-ph2jfg1x.js";import"./chunk-wafb2xm9.js";import"./chunk-6zz9kfbd.js";import"./chunk-hfzg98c8.js";import"./chunk-t2w8a591.js";import"./chunk-t5m5mznb.js";import"./chunk-2fgfex9b.js";import"./chunk-4ma2wnqw.js";import"./chunk-80fjfyha.js";import"./chunk-88eqqdk1.js";import"./chunk-c4fym47a.js";import"./chunk-as08hzp3.js";import"./chunk-n9t36h0q.js";import"./chunk-9p1dk5cb.js";import"./chunk-9ydc34wc.js";import"./chunk-9psr8atb.js";import"./chunk-s23gtejf.js";import"./chunk-nte0t7v3.js";import"./chunk-cvn689d5.js";export{init_default as default,runInit2 as runInit};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{join,sep}from"path";async function withAssetServer(folder,liveCode,fn,bundle){let assetsRoot=join(folder,"assets"),server=Bun.serve({port:0,hostname:"127.0.0.1",async fetch(req){let url=new URL(req.url),mounted=bundle?await bundle(url):null;if(mounted!==null)return new Response(mounted,{headers:{"Content-Type":"text/javascript","Access-Control-Allow-Origin":"*"}});if(liveCode!==null&&url.pathname==="/live/bundle.js")return new Response(liveCode,{headers:{"Content-Type":"text/javascript"}});if(url.pathname.startsWith("/assets/")){let fsPath=join(folder,decodeURIComponent(url.pathname));if(fsPath.startsWith(assetsRoot+sep)){let file=Bun.file(fsPath);if(await file.exists())return new Response(file)}}return new Response("not found",{status:404})}});try{return await fn(`http://127.0.0.1:${server.port}/`)}finally{server.stop(!0)}}
3
+ export{withAssetServer};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{fail}from"./chunk-s23gtejf.js";import"./chunk-4fj5tahv.js";import{SHELLS,completionScript,commandSpecs,detectShell,installCompletions}from"./chunk-735ezz23.js";import{require_picocolors}from"./chunk-jrsknzjt.js";import{__toESM,defineCommand}from"./chunk-2smsg2ct.js";var import_picocolors=__toESM(require_picocolors(),1);var completions_default=defineCommand({meta:{name:"completions",description:"Shell TAB completions \u2014 print the script, or install it with --install"},args:{shell:{type:"positional",required:!1,description:`Shell: ${SHELLS.join(" | ")} (default: detected from $SHELL)`},install:{type:"boolean",default:!1,description:"Write the script + wire it into your shell (idempotent)"}},async run({args}){let shell=args.shell??detectShell();if(!shell||!SHELLS.includes(shell))fail("completions",`unsupported or undetected shell${args.shell?` "${args.shell}"`:""} \u2014 pass one of: ${SHELLS.join(", ")}.`);if(!args.install){console.log(completionScript(shell,await commandSpecs()));return}let r=await installCompletions(shell);if(console.log(""),console.log(import_picocolors.default.green(`\u2713 ${shell} completions installed.`)),console.log(` script ${import_picocolors.default.cyan(r.scriptPath)}`),r.rcPath)console.log(r.rcUpdated?` rc ${import_picocolors.default.cyan(r.rcPath)} ${import_picocolors.default.dim("(source line appended)")}`:` rc ${import_picocolors.default.cyan(r.rcPath)} ${import_picocolors.default.dim("(already wired)")}`);console.log(""),console.log(import_picocolors.default.dim(shell==="fish"?" New fish sessions pick it up automatically.":` Restart your shell (or \`source ${r.rcPath}\`) to activate TAB completion.`))}});export{completions_default as default};
2
+ import{fail}from"./chunk-s23gtejf.js";import"./chunk-9ydc34wc.js";import{SHELLS,completionScript,commandSpecs,detectShell,installCompletions}from"./chunk-t5m5mznb.js";import{require_picocolors}from"./chunk-jrsknzjt.js";import{__toESM,defineCommand}from"./chunk-2smsg2ct.js";var import_picocolors=__toESM(require_picocolors(),1);var completions_default=defineCommand({meta:{name:"completions",description:"Shell TAB completions \u2014 print the script, or install it with --install"},args:{shell:{type:"positional",required:!1,description:`Shell: ${SHELLS.join(" | ")} (default: detected from $SHELL)`},install:{type:"boolean",default:!1,description:"Write the script + wire it into your shell (idempotent)"}},async run({args}){let shell=args.shell??detectShell();if(!shell||!SHELLS.includes(shell))fail("completions",`unsupported or undetected shell${args.shell?` "${args.shell}"`:""} \u2014 pass one of: ${SHELLS.join(", ")}.`);if(!args.install){console.log(completionScript(shell,await commandSpecs()));return}let r=await installCompletions(shell);if(console.log(""),console.log(import_picocolors.default.green(`\u2713 ${shell} completions installed.`)),console.log(` script ${import_picocolors.default.cyan(r.scriptPath)}`),r.rcPath)console.log(r.rcUpdated?` rc ${import_picocolors.default.cyan(r.rcPath)} ${import_picocolors.default.dim("(source line appended)")}`:` rc ${import_picocolors.default.cyan(r.rcPath)} ${import_picocolors.default.dim("(already wired)")}`);console.log(""),console.log(import_picocolors.default.dim(shell==="fish"?" New fish sessions pick it up automatically.":` Restart your shell (or \`source ${r.rcPath}\`) to activate TAB completion.`))}});export{completions_default as default};