@json-to-office/jto 0.2.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/cli.js +54 -17
  2. package/dist/cli.js.map +1 -1
  3. package/dist/client/assets/HomePage-CW9U2ufj.js +99 -0
  4. package/dist/client/assets/HomePage-CW9U2ufj.js.map +1 -0
  5. package/dist/client/assets/JsonEditorPage-B7Dvlxwb.js +3 -0
  6. package/dist/client/assets/{JsonEditorPage-C8a43kG2.js.map → JsonEditorPage-B7Dvlxwb.js.map} +1 -1
  7. package/dist/client/assets/MonacoPluginProvider-DML1yjXU.js +3 -0
  8. package/dist/client/assets/MonacoPluginProvider-DML1yjXU.js.map +1 -0
  9. package/dist/client/assets/NotFoundPage-SV9cseZ6.js +2 -0
  10. package/dist/client/assets/{NotFoundPage-ILCklaD-.js.map → NotFoundPage-SV9cseZ6.js.map} +1 -1
  11. package/dist/client/assets/button-DIVbkn2f.js +2 -0
  12. package/dist/client/assets/{button-DLt0WPRa.js.map → button-DIVbkn2f.js.map} +1 -1
  13. package/dist/client/assets/{docx-preview-DkKCgwb-.js → docx-preview-DQa8jhzH.js} +3 -3
  14. package/dist/client/assets/{docx-preview-DkKCgwb-.js.map → docx-preview-DQa8jhzH.js.map} +1 -1
  15. package/dist/client/assets/editor-CIPfAaib.js +9 -0
  16. package/dist/client/assets/editor-CIPfAaib.js.map +1 -0
  17. package/dist/client/assets/editor-monaco-json-Bjq1VFZK.js +6 -0
  18. package/dist/client/assets/{editor-monaco-json-CTzuM8w2.js.map → editor-monaco-json-Bjq1VFZK.js.map} +1 -1
  19. package/dist/client/assets/index-YMR5mZvu.js +3 -0
  20. package/dist/client/assets/index-YMR5mZvu.js.map +1 -0
  21. package/dist/client/assets/{monaco-editor-B-NlkJ5A.js → monaco-editor-BcgxPCqT.js} +3 -3
  22. package/dist/client/assets/{monaco-editor-B-NlkJ5A.js.map → monaco-editor-BcgxPCqT.js.map} +1 -1
  23. package/dist/client/assets/preview-BrYFbmhA.js +3 -0
  24. package/dist/client/assets/preview-BrYFbmhA.js.map +1 -0
  25. package/dist/client/assets/query-vendor-Df8-oete.js +7 -0
  26. package/dist/client/assets/query-vendor-Df8-oete.js.map +1 -0
  27. package/dist/client/assets/radix-ui-BZ5iKMtq.js +51 -0
  28. package/dist/client/assets/radix-ui-BZ5iKMtq.js.map +1 -0
  29. package/dist/client/assets/react-vendor-CTFDOf2G.js +61 -0
  30. package/dist/client/assets/react-vendor-CTFDOf2G.js.map +1 -0
  31. package/dist/client/assets/{state-vendor-Az8redj0.js → state-vendor-BDrPu9qj.js} +2 -2
  32. package/dist/client/assets/{state-vendor-Az8redj0.js.map → state-vendor-BDrPu9qj.js.map} +1 -1
  33. package/dist/client/assets/{ui-vendor-ChWVh3T-.js → ui-vendor-Dyg3GRT-.js} +2 -2
  34. package/dist/client/assets/{ui-vendor-ChWVh3T-.js.map → ui-vendor-Dyg3GRT-.js.map} +1 -1
  35. package/dist/client/index.html +6 -6
  36. package/package.json +20 -20
  37. package/dist/client/assets/HomePage-DX_EbLqY.js +0 -99
  38. package/dist/client/assets/HomePage-DX_EbLqY.js.map +0 -1
  39. package/dist/client/assets/JsonEditorPage-C8a43kG2.js +0 -3
  40. package/dist/client/assets/MonacoPluginProvider-C_k1zpkx.js +0 -3
  41. package/dist/client/assets/MonacoPluginProvider-C_k1zpkx.js.map +0 -1
  42. package/dist/client/assets/NotFoundPage-ILCklaD-.js +0 -2
  43. package/dist/client/assets/button-DLt0WPRa.js +0 -2
  44. package/dist/client/assets/editor-LsSIrw3S.js +0 -9
  45. package/dist/client/assets/editor-LsSIrw3S.js.map +0 -1
  46. package/dist/client/assets/editor-monaco-json-CTzuM8w2.js +0 -6
  47. package/dist/client/assets/index-CslfgN2g.js +0 -3
  48. package/dist/client/assets/index-CslfgN2g.js.map +0 -1
  49. package/dist/client/assets/preview-CeZ8u4Ec.js +0 -3
  50. package/dist/client/assets/preview-CeZ8u4Ec.js.map +0 -1
  51. package/dist/client/assets/query-vendor-CT0SoqJh.js +0 -15
  52. package/dist/client/assets/query-vendor-CT0SoqJh.js.map +0 -1
  53. package/dist/client/assets/radix-ui-DkKm4m5M.js +0 -2
  54. package/dist/client/assets/radix-ui-DkKm4m5M.js.map +0 -1
  55. package/dist/client/assets/react-vendor-B_QXlk-T.js +0 -102
  56. package/dist/client/assets/react-vendor-B_QXlk-T.js.map +0 -1
@@ -0,0 +1,51 @@
1
+ import{r as a,j as m,a as Ft,R as kn,b as $a,c as Ie}from"./react-vendor-CTFDOf2G.js";function R(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function So(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function at(...e){return t=>{let n=!1;const o=e.map(r=>{const s=So(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<o.length;r++){const s=o[r];typeof s=="function"?s():So(e[r],null)}}}}function j(...e){return a.useCallback(at(...e),e)}function Fa(e,t){const n=a.createContext(t),o=s=>{const{children:i,...c}=s,l=a.useMemo(()=>c,Object.values(c));return m.jsx(n.Provider,{value:l,children:i})};o.displayName=e+"Provider";function r(s){const i=a.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[o,r]}function se(e,t=[]){let n=[];function o(s,i){const c=a.createContext(i),l=n.length;n=[...n,i];const d=f=>{var y;const{scope:p,children:v,...g}=f,h=((y=p==null?void 0:p[e])==null?void 0:y[l])||c,w=a.useMemo(()=>g,Object.values(g));return m.jsx(h.Provider,{value:w,children:v})};d.displayName=s+"Provider";function u(f,p){var h;const v=((h=p==null?void 0:p[e])==null?void 0:h[l])||c,g=a.useContext(v);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,u]}const r=()=>{const s=n.map(i=>a.createContext(i));return function(c){const l=(c==null?void 0:c[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,Ba(r,...t)]}function Ba(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=o.reduce((c,{useScope:l,scopeName:d})=>{const f=l(s)[`__scope${d}`];return{...c,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Ue(e){const t=Wa(e),n=a.forwardRef((o,r)=>{const{children:s,...i}=o,c=a.Children.toArray(s),l=c.find(Va);if(l){const d=l.props.children,u=c.map(f=>f===l?a.Children.count(d)>1?a.Children.only(null):a.isValidElement(d)?d.props.children:null:f);return m.jsx(t,{...i,ref:r,children:a.isValidElement(d)?a.cloneElement(d,void 0,u):null})}return m.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function Wa(e){const t=a.forwardRef((n,o)=>{const{children:r,...s}=n;if(a.isValidElement(r)){const i=Ga(r),c=Ua(s,r.props);return r.type!==a.Fragment&&(c.ref=o?at(o,i):i),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qo=Symbol("radix.slottable");function Ha(e){const t=({children:n})=>m.jsx(m.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Qo,t}function Va(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qo}function Ua(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Ga(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ka=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],O=Ka.reduce((e,t)=>{const n=Ue(`Primitive.${t}`),o=a.forwardRef((r,s)=>{const{asChild:i,...c}=r,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Jo(e,t){e&&Ft.flushSync(()=>e.dispatchEvent(t))}function X(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function za(e,t=globalThis==null?void 0:globalThis.document){const n=X(e);a.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Ya="DismissableLayer",Cn="dismissableLayer.update",Xa="dismissableLayer.pointerDownOutside",qa="dismissableLayer.focusOutside",Eo,er=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ct=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:i,onDismiss:c,...l}=e,d=a.useContext(er),[u,f]=a.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=a.useState({}),g=j(t,S=>f(S)),h=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=h.indexOf(w),x=u?h.indexOf(u):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,C=x>=y,E=Ja(S=>{const M=S.target,_=[...d.branches].some(A=>A.contains(M));!C||_||(r==null||r(S),i==null||i(S),S.defaultPrevented||c==null||c())},p),P=ec(S=>{const M=S.target;[...d.branches].some(A=>A.contains(M))||(s==null||s(S),i==null||i(S),S.defaultPrevented||c==null||c())},p);return za(S=>{x===d.layers.size-1&&(o==null||o(S),!S.defaultPrevented&&c&&(S.preventDefault(),c()))},p),a.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Eo=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Ro(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Eo)}},[u,p,n,d]),a.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Ro())},[u,d]),a.useEffect(()=>{const S=()=>v({});return document.addEventListener(Cn,S),()=>document.removeEventListener(Cn,S)},[]),m.jsx(O.div,{...l,ref:g,style:{pointerEvents:b?C?"auto":"none":void 0,...e.style},onFocusCapture:R(e.onFocusCapture,P.onFocusCapture),onBlurCapture:R(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,E.onPointerDownCapture)})});ct.displayName=Ya;var Za="DismissableLayerBranch",Qa=a.forwardRef((e,t)=>{const n=a.useContext(er),o=a.useRef(null),r=j(t,o);return a.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),m.jsx(O.div,{...e,ref:r})});Qa.displayName=Za;function Ja(e,t=globalThis==null?void 0:globalThis.document){const n=X(e),o=a.useRef(!1),r=a.useRef(()=>{});return a.useEffect(()=>{const s=c=>{if(c.target&&!o.current){let l=function(){tr(Xa,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function ec(e,t=globalThis==null?void 0:globalThis.document){const n=X(e),o=a.useRef(!1);return a.useEffect(()=>{const r=s=>{s.target&&!o.current&&tr(qa,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Ro(){const e=new CustomEvent(Cn);document.dispatchEvent(e)}function tr(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Jo(r,s):r.dispatchEvent(s)}var q=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},tc=kn[" useId ".trim().toString()]||(()=>{}),nc=0;function ae(e){const[t,n]=a.useState(tc());return q(()=>{n(o=>o??String(nc++))},[e]),e||(t?`radix-${t}`:"")}const oc=["top","right","bottom","left"],Te=Math.min,oe=Math.max,Tt=Math.round,gt=Math.floor,ge=e=>({x:e,y:e}),rc={left:"right",right:"left",bottom:"top",top:"bottom"};function Sn(e,t,n){return oe(e,Te(t,n))}function Ce(e,t){return typeof e=="function"?e(t):e}function Se(e){return e.split("-")[0]}function Ye(e){return e.split("-")[1]}function $n(e){return e==="x"?"y":"x"}function Fn(e){return e==="y"?"height":"width"}function ve(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Bn(e){return $n(ve(e))}function sc(e,t,n){n===void 0&&(n=!1);const o=Ye(e),r=Bn(e),s=Fn(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Mt(i)),[i,Mt(i)]}function ic(e){const t=Mt(e);return[En(e),t,En(t)]}function En(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Po=["left","right"],To=["right","left"],ac=["top","bottom"],cc=["bottom","top"];function lc(e,t,n){switch(e){case"top":case"bottom":return n?t?To:Po:t?Po:To;case"left":case"right":return t?ac:cc;default:return[]}}function uc(e,t,n,o){const r=Ye(e);let s=lc(Se(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(En)))),s}function Mt(e){const t=Se(e);return rc[t]+e.slice(t.length)}function dc(e){return{top:0,right:0,bottom:0,left:0,...e}}function nr(e){return typeof e!="number"?dc(e):{top:e,right:e,bottom:e,left:e}}function _t(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Mo(e,t,n){let{reference:o,floating:r}=e;const s=ve(t),i=Bn(t),c=Fn(i),l=Se(t),d=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[c]/2-r[c]/2;let v;switch(l){case"top":v={x:u,y:o.y-r.height};break;case"bottom":v={x:u,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:f};break;case"left":v={x:o.x-r.width,y:f};break;default:v={x:o.x,y:o.y}}switch(Ye(t)){case"start":v[i]-=p*(n&&d?-1:1);break;case"end":v[i]+=p*(n&&d?-1:1);break}return v}async function fc(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:v=0}=Ce(t,e),g=nr(v),w=c[p?f==="floating"?"reference":"floating":f],y=_t(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:u,strategy:l})),x=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),C=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},E=_t(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:b,strategy:l}):x);return{top:(y.top-E.top+g.top)/C.y,bottom:(E.bottom-y.bottom+g.bottom)/C.y,left:(y.left-E.left+g.left)/C.x,right:(E.right-y.right+g.right)/C.x}}const pc=50,mc=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:fc},l=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=Mo(d,o,l),p=o,v=0;const g={};for(let h=0;h<s.length;h++){const w=s[h];if(!w)continue;const{name:y,fn:x}=w,{x:b,y:C,data:E,reset:P}=await x({x:u,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:g,rects:d,platform:c,elements:{reference:e,floating:t}});u=b??u,f=C??f,g[y]={...g[y],...E},P&&v<pc&&(v++,typeof P=="object"&&(P.placement&&(p=P.placement),P.rects&&(d=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):P.rects),{x:u,y:f}=Mo(d,p,l)),h=-1)}return{x:u,y:f,placement:p,strategy:r,middlewareData:g}},hc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:l}=t,{element:d,padding:u=0}=Ce(e,t)||{};if(d==null)return{};const f=nr(u),p={x:n,y:o},v=Bn(r),g=Fn(v),h=await i.getDimensions(d),w=v==="y",y=w?"top":"left",x=w?"bottom":"right",b=w?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[v]-p[v]-s.floating[g],E=p[v]-s.reference[v],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let S=P?P[b]:0;(!S||!await(i.isElement==null?void 0:i.isElement(P)))&&(S=c.floating[b]||s.floating[g]);const M=C/2-E/2,_=S/2-h[g]/2-1,A=Te(f[y],_),L=Te(f[x],_),$=A,F=S-h[g]-L,k=S/2-h[g]/2+M,G=Sn($,k,F),D=!l.arrow&&Ye(r)!=null&&k!==G&&s.reference[g]/2-(k<$?A:L)-h[g]/2<0,B=D?k<$?k-$:k-F:0;return{[v]:p[v]+B,data:{[v]:G,centerOffset:k-G-B,...D&&{alignmentOffset:B}},reset:D}}}),vc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...w}=Ce(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Se(r),x=ve(c),b=Se(c)===c,C=await(l.isRTL==null?void 0:l.isRTL(d.floating)),E=p||(b||!h?[Mt(c)]:ic(c)),P=g!=="none";!p&&P&&E.push(...uc(c,h,g,C));const S=[c,...E],M=await l.detectOverflow(t,w),_=[];let A=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&_.push(M[y]),f){const k=sc(r,i,C);_.push(M[k[0]],M[k[1]])}if(A=[...A,{placement:r,overflows:_}],!_.every(k=>k<=0)){var L,$;const k=(((L=s.flip)==null?void 0:L.index)||0)+1,G=S[k];if(G&&(!(f==="alignment"?x!==ve(G):!1)||A.every(I=>ve(I.placement)===x?I.overflows[0]>0:!0)))return{data:{index:k,overflows:A},reset:{placement:G}};let D=($=A.filter(B=>B.overflows[0]<=0).sort((B,I)=>B.overflows[1]-I.overflows[1])[0])==null?void 0:$.placement;if(!D)switch(v){case"bestFit":{var F;const B=(F=A.filter(I=>{if(P){const T=ve(I.placement);return T===x||T==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(T=>T>0).reduce((T,K)=>T+K,0)]).sort((I,T)=>I[1]-T[1])[0])==null?void 0:F[0];B&&(D=B);break}case"initialPlacement":D=c;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function _o(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ao(e){return oc.some(t=>e[t]>=0)}const gc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=Ce(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=_o(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Ao(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),c=_o(i,n.floating);return{data:{escapedOffsets:c,escaped:Ao(c)}}}default:return{}}}}},or=new Set(["left","top"]);async function wc(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Se(n),c=Ye(n),l=ve(n)==="y",d=or.has(i)?-1:1,u=s&&l?-1:1,f=Ce(t,e);let{mainAxis:p,crossAxis:v,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(v=c==="end"?g*-1:g),l?{x:v*u,y:p*d}:{x:p*d,y:v*u}}const xc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,l=await wc(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:i}}}}},yc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:l={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...d}=Ce(e,t),u={x:n,y:o},f=await s.detectOverflow(t,d),p=ve(Se(r)),v=$n(p);let g=u[v],h=u[p];if(i){const y=v==="y"?"top":"left",x=v==="y"?"bottom":"right",b=g+f[y],C=g-f[x];g=Sn(b,g,C)}if(c){const y=p==="y"?"top":"left",x=p==="y"?"bottom":"right",b=h+f[y],C=h-f[x];h=Sn(b,h,C)}const w=l.fn({...t,[v]:g,[p]:h});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[v]:i,[p]:c}}}}}},bc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:l=!0,crossAxis:d=!0}=Ce(e,t),u={x:n,y:o},f=ve(r),p=$n(f);let v=u[p],g=u[f];const h=Ce(c,t),w=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const b=p==="y"?"height":"width",C=s.reference[p]-s.floating[b]+w.mainAxis,E=s.reference[p]+s.reference[b]-w.mainAxis;v<C?v=C:v>E&&(v=E)}if(d){var y,x;const b=p==="y"?"width":"height",C=or.has(Se(r)),E=s.reference[f]-s.floating[b]+(C&&((y=i.offset)==null?void 0:y[f])||0)+(C?0:w.crossAxis),P=s.reference[f]+s.reference[b]+(C?0:((x=i.offset)==null?void 0:x[f])||0)-(C?w.crossAxis:0);g<E?g=E:g>P&&(g=P)}return{[p]:v,[f]:g}}}},Cc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:l=()=>{},...d}=Ce(e,t),u=await i.detectOverflow(t,d),f=Se(r),p=Ye(r),v=ve(r)==="y",{width:g,height:h}=s.floating;let w,y;f==="top"||f==="bottom"?(w=f,y=p===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(y=f,w=p==="end"?"top":"bottom");const x=h-u.top-u.bottom,b=g-u.left-u.right,C=Te(h-u[w],x),E=Te(g-u[y],b),P=!t.middlewareData.shift;let S=C,M=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(S=x),P&&!p){const A=oe(u.left,0),L=oe(u.right,0),$=oe(u.top,0),F=oe(u.bottom,0);v?M=g-2*(A!==0||L!==0?A+L:oe(u.left,u.right)):S=h-2*($!==0||F!==0?$+F:oe(u.top,u.bottom))}await l({...t,availableWidth:M,availableHeight:S});const _=await i.getDimensions(c.floating);return g!==_.width||h!==_.height?{reset:{rects:!0}}:{}}}};function Bt(){return typeof window<"u"}function Xe(e){return rr(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function we(e){var t;return(t=(rr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function rr(e){return Bt()?e instanceof Node||e instanceof re(e).Node:!1}function de(e){return Bt()?e instanceof Element||e instanceof re(e).Element:!1}function Re(e){return Bt()?e instanceof HTMLElement||e instanceof re(e).HTMLElement:!1}function Io(e){return!Bt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}function lt(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function Sc(e){return/^(table|td|th)$/.test(Xe(e))}function Wt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Ec=/transform|translate|scale|rotate|perspective|filter/,Rc=/paint|layout|strict|content/,Ne=e=>!!e&&e!=="none";let dn;function Wn(e){const t=de(e)?fe(e):e;return Ne(t.transform)||Ne(t.translate)||Ne(t.scale)||Ne(t.rotate)||Ne(t.perspective)||!Hn()&&(Ne(t.backdropFilter)||Ne(t.filter))||Ec.test(t.willChange||"")||Rc.test(t.contain||"")}function Pc(e){let t=Me(e);for(;Re(t)&&!Ge(t);){if(Wn(t))return t;if(Wt(t))return null;t=Me(t)}return null}function Hn(){return dn==null&&(dn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),dn}function Ge(e){return/^(html|body|#document)$/.test(Xe(e))}function fe(e){return re(e).getComputedStyle(e)}function Ht(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Me(e){if(Xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Io(e)&&e.host||we(e);return Io(t)?t.host:t}function sr(e){const t=Me(e);return Ge(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&lt(t)?t:sr(t)}function ot(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=sr(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=re(r);if(s){const c=Rn(i);return t.concat(i,i.visualViewport||[],lt(r)?r:[],c&&n?ot(c):[])}else return t.concat(r,ot(r,[],n))}function Rn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ir(e){const t=fe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Re(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=Tt(n)!==s||Tt(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function Vn(e){return de(e)?e:e.contextElement}function He(e){const t=Vn(e);if(!Re(t))return ge(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=ir(t);let i=(s?Tt(n.width):n.width)/o,c=(s?Tt(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Tc=ge(0);function ar(e){const t=re(e);return!Hn()||!t.visualViewport?Tc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==re(e)?!1:t}function Oe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Vn(e);let i=ge(1);t&&(o?de(o)&&(i=He(o)):i=He(e));const c=Mc(s,n,o)?ar(s):ge(0);let l=(r.left+c.x)/i.x,d=(r.top+c.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const p=re(s),v=o&&de(o)?re(o):o;let g=p,h=Rn(g);for(;h&&o&&v!==g;){const w=He(h),y=h.getBoundingClientRect(),x=fe(h),b=y.left+(h.clientLeft+parseFloat(x.paddingLeft))*w.x,C=y.top+(h.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,d*=w.y,u*=w.x,f*=w.y,l+=b,d+=C,g=re(h),h=Rn(g)}}return _t({width:u,height:f,x:l,y:d})}function Vt(e,t){const n=Ht(e).scrollLeft;return t?t.left+n:Oe(we(e)).left+n}function cr(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Vt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function _c(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=we(o),c=t?Wt(t.floating):!1;if(o===i||c&&s)return n;let l={scrollLeft:0,scrollTop:0},d=ge(1);const u=ge(0),f=Re(o);if((f||!f&&!s)&&((Xe(o)!=="body"||lt(i))&&(l=Ht(o)),f)){const v=Oe(o);d=He(o),u.x=v.x+o.clientLeft,u.y=v.y+o.clientTop}const p=i&&!f&&!s?cr(i,l):ge(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+u.x+p.x,y:n.y*d.y-l.scrollTop*d.y+u.y+p.y}}function Ac(e){return Array.from(e.getClientRects())}function Ic(e){const t=we(e),n=Ht(e),o=e.ownerDocument.body,r=oe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=oe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Vt(e);const c=-n.scrollTop;return fe(o).direction==="rtl"&&(i+=oe(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const No=25;function Nc(e,t){const n=re(e),o=we(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,l=0;if(r){s=r.width,i=r.height;const u=Hn();(!u||u&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const d=Vt(o);if(d<=0){const u=o.ownerDocument,f=u.body,p=getComputedStyle(f),v=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(o.clientWidth-f.clientWidth-v);g<=No&&(s-=g)}else d<=No&&(s+=d);return{width:s,height:i,x:c,y:l}}function Oc(e,t){const n=Oe(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Re(e)?He(e):ge(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,l=r*s.x,d=o*s.y;return{width:i,height:c,x:l,y:d}}function Oo(e,t,n){let o;if(t==="viewport")o=Nc(e,n);else if(t==="document")o=Ic(we(e));else if(de(t))o=Oc(t,n);else{const r=ar(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return _t(o)}function lr(e,t){const n=Me(e);return n===t||!de(n)||Ge(n)?!1:fe(n).position==="fixed"||lr(n,t)}function Dc(e,t){const n=t.get(e);if(n)return n;let o=ot(e,[],!1).filter(c=>de(c)&&Xe(c)!=="body"),r=null;const s=fe(e).position==="fixed";let i=s?Me(e):e;for(;de(i)&&!Ge(i);){const c=fe(i),l=Wn(i);!l&&c.position==="fixed"&&(r=null),(s?!l&&!r:!l&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||lt(i)&&!l&&lr(e,i))?o=o.filter(u=>u!==i):r=c,i=Me(i)}return t.set(e,o),o}function Lc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Wt(t)?[]:Dc(t,this._c):[].concat(n),o],c=Oo(t,i[0],r);let l=c.top,d=c.right,u=c.bottom,f=c.left;for(let p=1;p<i.length;p++){const v=Oo(t,i[p],r);l=oe(v.top,l),d=Te(v.right,d),u=Te(v.bottom,u),f=oe(v.left,f)}return{width:d-f,height:u-l,x:f,y:l}}function jc(e){const{width:t,height:n}=ir(e);return{width:t,height:n}}function kc(e,t,n){const o=Re(t),r=we(t),s=n==="fixed",i=Oe(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=ge(0);function d(){l.x=Vt(r)}if(o||!o&&!s)if((Xe(t)!=="body"||lt(r))&&(c=Ht(t)),o){const v=Oe(t,!0,s,t);l.x=v.x+t.clientLeft,l.y=v.y+t.clientTop}else r&&d();s&&!o&&r&&d();const u=r&&!o&&!s?cr(r,c):ge(0),f=i.left+c.scrollLeft-l.x-u.x,p=i.top+c.scrollTop-l.y-u.y;return{x:f,y:p,width:i.width,height:i.height}}function fn(e){return fe(e).position==="static"}function Do(e,t){if(!Re(e)||fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function ur(e,t){const n=re(e);if(Wt(e))return n;if(!Re(e)){let r=Me(e);for(;r&&!Ge(r);){if(de(r)&&!fn(r))return r;r=Me(r)}return n}let o=Do(e,t);for(;o&&Sc(o)&&fn(o);)o=Do(o,t);return o&&Ge(o)&&fn(o)&&!Wn(o)?n:o||Pc(e)||n}const $c=async function(e){const t=this.getOffsetParent||ur,n=this.getDimensions,o=await n(e.floating);return{reference:kc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Fc(e){return fe(e).direction==="rtl"}const Bc={convertOffsetParentRelativeRectToViewportRelativeRect:_c,getDocumentElement:we,getClippingRect:Lc,getOffsetParent:ur,getElementRects:$c,getClientRects:Ac,getDimensions:jc,getScale:He,isElement:de,isRTL:Fc};function dr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wc(e,t){let n=null,o;const r=we(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const d=e.getBoundingClientRect(),{left:u,top:f,width:p,height:v}=d;if(c||t(),!p||!v)return;const g=gt(f),h=gt(r.clientWidth-(u+p)),w=gt(r.clientHeight-(f+v)),y=gt(u),b={rootMargin:-g+"px "+-h+"px "+-w+"px "+-y+"px",threshold:oe(0,Te(1,l))||1};let C=!0;function E(P){const S=P[0].intersectionRatio;if(S!==l){if(!C)return i();S?i(!1,S):o=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!dr(d,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(E,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return i(!0),s}function Hc(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,d=Vn(e),u=r||s?[...d?ot(d):[],...t?ot(t):[]]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=d&&c?Wc(d,n):null;let p=-1,v=null;i&&(v=new ResizeObserver(y=>{let[x]=y;x&&x.target===d&&v&&t&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=v)==null||b.observe(t)})),n()}),d&&!l&&v.observe(d),t&&v.observe(t));let g,h=l?Oe(e):null;l&&w();function w(){const y=Oe(e);h&&!dr(h,y)&&n(),h=y,g=requestAnimationFrame(w)}return n(),()=>{var y;u.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(y=v)==null||y.disconnect(),v=null,l&&cancelAnimationFrame(g)}}const Vc=xc,Uc=yc,Gc=vc,Kc=Cc,zc=gc,Lo=hc,Yc=bc,Xc=(e,t,n)=>{const o=new Map,r={platform:Bc,...n},s={...r.platform,_c:o};return mc(e,t,{...r,platform:s})};var qc=typeof document<"u",Zc=function(){},Et=qc?a.useLayoutEffect:Zc;function At(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!At(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!At(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function fr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jo(e,t){const n=fr(e);return Math.round(t*n)/n}function pn(e){const t=a.useRef(e);return Et(()=>{t.current=e}),t}function Qc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:d}=e,[u,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,v]=a.useState(o);At(p,o)||v(o);const[g,h]=a.useState(null),[w,y]=a.useState(null),x=a.useCallback(I=>{I!==P.current&&(P.current=I,h(I))},[]),b=a.useCallback(I=>{I!==S.current&&(S.current=I,y(I))},[]),C=s||g,E=i||w,P=a.useRef(null),S=a.useRef(null),M=a.useRef(u),_=l!=null,A=pn(l),L=pn(r),$=pn(d),F=a.useCallback(()=>{if(!P.current||!S.current)return;const I={placement:t,strategy:n,middleware:p};L.current&&(I.platform=L.current),Xc(P.current,S.current,I).then(T=>{const K={...T,isPositioned:$.current!==!1};k.current&&!At(M.current,K)&&(M.current=K,Ft.flushSync(()=>{f(K)}))})},[p,t,n,L,$]);Et(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,f(I=>({...I,isPositioned:!1})))},[d]);const k=a.useRef(!1);Et(()=>(k.current=!0,()=>{k.current=!1}),[]),Et(()=>{if(C&&(P.current=C),E&&(S.current=E),C&&E){if(A.current)return A.current(C,E,F);F()}},[C,E,F,A,_]);const G=a.useMemo(()=>({reference:P,floating:S,setReference:x,setFloating:b}),[x,b]),D=a.useMemo(()=>({reference:C,floating:E}),[C,E]),B=a.useMemo(()=>{const I={position:n,left:0,top:0};if(!D.floating)return I;const T=jo(D.floating,u.x),K=jo(D.floating,u.y);return c?{...I,transform:"translate("+T+"px, "+K+"px)",...fr(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:T,top:K}},[n,c,D.floating,u.x,u.y]);return a.useMemo(()=>({...u,update:F,refs:G,elements:D,floatingStyles:B}),[u,F,G,D,B])}const Jc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Lo({element:o.current,padding:r}).fn(n):{}:o?Lo({element:o,padding:r}).fn(n):{}}}},el=(e,t)=>{const n=Vc(e);return{name:n.name,fn:n.fn,options:[e,t]}},tl=(e,t)=>{const n=Uc(e);return{name:n.name,fn:n.fn,options:[e,t]}},nl=(e,t)=>({fn:Yc(e).fn,options:[e,t]}),ol=(e,t)=>{const n=Gc(e);return{name:n.name,fn:n.fn,options:[e,t]}},rl=(e,t)=>{const n=Kc(e);return{name:n.name,fn:n.fn,options:[e,t]}},sl=(e,t)=>{const n=zc(e);return{name:n.name,fn:n.fn,options:[e,t]}},il=(e,t)=>{const n=Jc(e);return{name:n.name,fn:n.fn,options:[e,t]}};var al="Arrow",pr=a.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return m.jsx(O.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});pr.displayName=al;var cl=pr;function mr(e){const[t,n]=a.useState(void 0);return q(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,c;if("borderBoxSize"in s){const l=s.borderBoxSize,d=Array.isArray(l)?l[0]:l;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Un="Popper",[hr,qe]=se(Un),[ll,vr]=hr(Un),gr=e=>{const{__scopePopper:t,children:n}=e,[o,r]=a.useState(null);return m.jsx(ll,{scope:t,anchor:o,onAnchorChange:r,children:n})};gr.displayName=Un;var wr="PopperAnchor",xr=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=vr(wr,n),i=a.useRef(null),c=j(t,i),l=a.useRef(null);return a.useEffect(()=>{const d=l.current;l.current=(o==null?void 0:o.current)||i.current,d!==l.current&&s.onAnchorChange(l.current)}),o?null:m.jsx(O.div,{...r,ref:c})});xr.displayName=wr;var Gn="PopperContent",[ul,dl]=hr(Gn),yr=a.forwardRef((e,t)=>{var N,H,z,W,V,U;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:v="optimized",onPlaced:g,...h}=e,w=vr(Gn,n),[y,x]=a.useState(null),b=j(t,ne=>x(ne)),[C,E]=a.useState(null),P=mr(C),S=(P==null?void 0:P.width)??0,M=(P==null?void 0:P.height)??0,_=o+(s!=="center"?"-"+s:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(d)?d:[d],$=L.length>0,F={padding:A,boundary:L.filter(pl),altBoundary:$},{refs:k,floatingStyles:G,placement:D,isPositioned:B,middlewareData:I}=Qc({strategy:"fixed",placement:_,whileElementsMounted:(...ne)=>Hc(...ne,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[el({mainAxis:r+M,alignmentAxis:i}),l&&tl({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?nl():void 0,...F}),l&&ol({...F}),rl({...F,apply:({elements:ne,rects:me,availableWidth:Qe,availableHeight:Je})=>{const{width:et,height:ka}=me.reference,vt=ne.floating.style;vt.setProperty("--radix-popper-available-width",`${Qe}px`),vt.setProperty("--radix-popper-available-height",`${Je}px`),vt.setProperty("--radix-popper-anchor-width",`${et}px`),vt.setProperty("--radix-popper-anchor-height",`${ka}px`)}}),C&&il({element:C,padding:c}),ml({arrowWidth:S,arrowHeight:M}),p&&sl({strategy:"referenceHidden",...F})]}),[T,K]=Sr(D),Y=X(g);q(()=>{B&&(Y==null||Y())},[B,Y]);const ee=(N=I.arrow)==null?void 0:N.x,ye=(H=I.arrow)==null?void 0:H.y,ie=((z=I.arrow)==null?void 0:z.centerOffset)!==0,[be,te]=a.useState();return q(()=>{y&&te(window.getComputedStyle(y).zIndex)},[y]),m.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:B?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(W=I.transformOrigin)==null?void 0:W.x,(V=I.transformOrigin)==null?void 0:V.y].join(" "),...((U=I.hide)==null?void 0:U.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(ul,{scope:n,placedSide:T,onArrowChange:E,arrowX:ee,arrowY:ye,shouldHideArrow:ie,children:m.jsx(O.div,{"data-side":T,"data-align":K,...h,ref:b,style:{...h.style,animation:B?void 0:"none"}})})})});yr.displayName=Gn;var br="PopperArrow",fl={top:"bottom",right:"left",bottom:"top",left:"right"},Cr=a.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=dl(br,o),i=fl[s.placedSide];return m.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:m.jsx(cl,{...r,ref:n,style:{...r.style,display:"block"}})})});Cr.displayName=br;function pl(e){return e!==null}var ml=e=>({name:"transformOrigin",options:e,fn(t){var w,y,x;const{placement:n,rects:o,middlewareData:r}=t,i=((w=r.arrow)==null?void 0:w.centerOffset)!==0,c=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[d,u]=Sr(n),f={start:"0%",center:"50%",end:"100%"}[u],p=(((y=r.arrow)==null?void 0:y.x)??0)+c/2,v=(((x=r.arrow)==null?void 0:x.y)??0)+l/2;let g="",h="";return d==="bottom"?(g=i?f:`${p}px`,h=`${-l}px`):d==="top"?(g=i?f:`${p}px`,h=`${o.floating.height+l}px`):d==="right"?(g=`${-l}px`,h=i?f:`${v}px`):d==="left"&&(g=`${o.floating.width+l}px`,h=i?f:`${v}px`),{data:{x:g,y:h}}}});function Sr(e){const[t,n="center"]=e.split("-");return[t,n]}var Kn=gr,zn=xr,Yn=yr,Xn=Cr,hl="Portal",ut=a.forwardRef((e,t)=>{var c;const{container:n,...o}=e,[r,s]=a.useState(!1);q(()=>s(!0),[]);const i=n||r&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return i?$a.createPortal(m.jsx(O.div,{...o,ref:t}),i):null});ut.displayName=hl;function vl(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var Z=e=>{const{present:t,children:n}=e,o=gl(t),r=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),s=j(o.ref,wl(r));return typeof n=="function"||o.isPresent?a.cloneElement(r,{ref:s}):null};Z.displayName="Presence";function gl(e){const[t,n]=a.useState(),o=a.useRef(null),r=a.useRef(e),s=a.useRef("none"),i=e?"mounted":"unmounted",[c,l]=vl(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const d=wt(o.current);s.current=c==="mounted"?d:"none"},[c]),q(()=>{const d=o.current,u=r.current;if(u!==e){const p=s.current,v=wt(d);e?l("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(u&&p!==v?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),q(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=v=>{const h=wt(o.current).includes(CSS.escape(v.animationName));if(v.target===t&&h&&(l("ANIMATION_END"),!r.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},p=v=>{v.target===t&&(s.current=wt(o.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(d=>{o.current=d?getComputedStyle(d):null,n(d)},[])}}function wt(e){return(e==null?void 0:e.animationName)||"none"}function wl(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xl=kn[" useInsertionEffect ".trim().toString()]||q;function Ee({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,i]=yl({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:r;{const u=a.useRef(e!==void 0);a.useEffect(()=>{const f=u.current;f!==c&&console.warn(`${o} is changing from ${f?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=c},[c,o])}const d=a.useCallback(u=>{var f;if(c){const p=bl(u)?u(e):u;p!==e&&((f=i.current)==null||f.call(i,p))}else s(u)},[c,e,s,i]);return[l,d]}function yl({defaultProp:e,onChange:t}){const[n,o]=a.useState(e),r=a.useRef(n),s=a.useRef(t);return xl(()=>{s.current=t},[t]),a.useEffect(()=>{var i;r.current!==n&&((i=s.current)==null||i.call(s,n),r.current=n)},[n,r]),[n,o,s]}function bl(e){return typeof e=="function"}var Er=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Cl="VisuallyHidden",Rr=a.forwardRef((e,t)=>m.jsx(O.span,{...e,ref:t,style:{...Er,...e.style}}));Rr.displayName=Cl;var Sl=Rr,[Ut]=se("Tooltip",[qe]),Gt=qe(),Pr="TooltipProvider",El=700,Pn="tooltip.open",[Rl,qn]=Ut(Pr),Tr=e=>{const{__scopeTooltip:t,delayDuration:n=El,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:s}=e,i=a.useRef(!0),c=a.useRef(!1),l=a.useRef(0);return a.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),m.jsx(Rl,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:a.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(d=>{c.current=d},[]),disableHoverableContent:r,children:s})};Tr.displayName=Pr;var rt="Tooltip",[Pl,dt]=Ut(rt),Mr=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:s,disableHoverableContent:i,delayDuration:c}=e,l=qn(rt,e.__scopeTooltip),d=Gt(t),[u,f]=a.useState(null),p=ae(),v=a.useRef(0),g=i??l.disableHoverableContent,h=c??l.delayDuration,w=a.useRef(!1),[y,x]=Ee({prop:o,defaultProp:r??!1,onChange:S=>{S?(l.onOpen(),document.dispatchEvent(new CustomEvent(Pn))):l.onClose(),s==null||s(S)},caller:rt}),b=a.useMemo(()=>y?w.current?"delayed-open":"instant-open":"closed",[y]),C=a.useCallback(()=>{window.clearTimeout(v.current),v.current=0,w.current=!1,x(!0)},[x]),E=a.useCallback(()=>{window.clearTimeout(v.current),v.current=0,x(!1)},[x]),P=a.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{w.current=!0,x(!0),v.current=0},h)},[h,x]);return a.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),m.jsx(Kn,{...d,children:m.jsx(Pl,{scope:t,contentId:p,open:y,stateAttribute:b,trigger:u,onTriggerChange:f,onTriggerEnter:a.useCallback(()=>{l.isOpenDelayedRef.current?P():C()},[l.isOpenDelayedRef,P,C]),onTriggerLeave:a.useCallback(()=>{g?E():(window.clearTimeout(v.current),v.current=0)},[E,g]),onOpen:C,onClose:E,disableHoverableContent:g,children:n})})};Mr.displayName=rt;var Tn="TooltipTrigger",_r=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=dt(Tn,n),s=qn(Tn,n),i=Gt(n),c=a.useRef(null),l=j(t,c,r.onTriggerChange),d=a.useRef(!1),u=a.useRef(!1),f=a.useCallback(()=>d.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.jsx(zn,{asChild:!0,...i,children:m.jsx(O.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:R(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),u.current=!0)}),onPointerLeave:R(e.onPointerLeave,()=>{r.onTriggerLeave(),u.current=!1}),onPointerDown:R(e.onPointerDown,()=>{r.open&&r.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:R(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:R(e.onBlur,r.onClose),onClick:R(e.onClick,r.onClose)})})});_r.displayName=Tn;var Zn="TooltipPortal",[Tl,Ml]=Ut(Zn,{forceMount:void 0}),Ar=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,s=dt(Zn,t);return m.jsx(Tl,{scope:t,forceMount:n,children:m.jsx(Z,{present:n||s.open,children:m.jsx(ut,{asChild:!0,container:r,children:o})})})};Ar.displayName=Zn;var Ke="TooltipContent",Ir=a.forwardRef((e,t)=>{const n=Ml(Ke,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...s}=e,i=dt(Ke,e.__scopeTooltip);return m.jsx(Z,{present:o||i.open,children:i.disableHoverableContent?m.jsx(Nr,{side:r,...s,ref:t}):m.jsx(_l,{side:r,...s,ref:t})})}),_l=a.forwardRef((e,t)=>{const n=dt(Ke,e.__scopeTooltip),o=qn(Ke,e.__scopeTooltip),r=a.useRef(null),s=j(t,r),[i,c]=a.useState(null),{trigger:l,onClose:d}=n,u=r.current,{onPointerInTransitChange:f}=o,p=a.useCallback(()=>{c(null),f(!1)},[f]),v=a.useCallback((g,h)=>{const w=g.currentTarget,y={x:g.clientX,y:g.clientY},x=Dl(y,w.getBoundingClientRect()),b=Ll(y,x),C=jl(h.getBoundingClientRect()),E=$l([...b,...C]);c(E),f(!0)},[f]);return a.useEffect(()=>()=>p(),[p]),a.useEffect(()=>{if(l&&u){const g=w=>v(w,u),h=w=>v(w,l);return l.addEventListener("pointerleave",g),u.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",h)}}},[l,u,v,p]),a.useEffect(()=>{if(i){const g=h=>{const w=h.target,y={x:h.clientX,y:h.clientY},x=(l==null?void 0:l.contains(w))||(u==null?void 0:u.contains(w)),b=!kl(y,i);x?p():b&&(p(),d())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,u,i,d,p]),m.jsx(Nr,{...e,ref:s})}),[Al,Il]=Ut(rt,{isInside:!1}),Nl=Ha("TooltipContent"),Nr=a.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:i,...c}=e,l=dt(Ke,n),d=Gt(n),{onClose:u}=l;return a.useEffect(()=>(document.addEventListener(Pn,u),()=>document.removeEventListener(Pn,u)),[u]),a.useEffect(()=>{if(l.trigger){const f=p=>{const v=p.target;v!=null&&v.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),m.jsx(ct,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:m.jsxs(Yn,{"data-state":l.stateAttribute,...d,...c,ref:t,style:{...c.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:[m.jsx(Nl,{children:o}),m.jsx(Al,{scope:n,isInside:!0,children:m.jsx(Sl,{id:l.contentId,role:"tooltip",children:r||o})})]})})});Ir.displayName=Ke;var Or="TooltipArrow",Ol=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Gt(n);return Il(Or,n).isInside?null:m.jsx(Xn,{...r,...o,ref:t})});Ol.displayName=Or;function Dl(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,o,r,s)){case s:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Ll(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function jl(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function kl(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const c=t[s],l=t[i],d=c.x,u=c.y,f=l.x,p=l.y;u>o!=p>o&&n<(f-d)*(o-u)/(p-u)+d&&(r=!r)}return r}function $l(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),Fl(t)}function Fl(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.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)}var wp=Tr,xp=Mr,yp=_r,bp=Ar,Cp=Ir,Bl=Symbol.for("react.lazy"),It=kn[" use ".trim().toString()];function Wl(e){return typeof e=="object"&&e!==null&&"then"in e}function Dr(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Bl&&"_payload"in e&&Wl(e._payload)}function Lr(e){const t=Hl(e),n=a.forwardRef((o,r)=>{let{children:s,...i}=o;Dr(s)&&typeof It=="function"&&(s=It(s._payload));const c=a.Children.toArray(s),l=c.find(Ul);if(l){const d=l.props.children,u=c.map(f=>f===l?a.Children.count(d)>1?a.Children.only(null):a.isValidElement(d)?d.props.children:null:f);return m.jsx(t,{...i,ref:r,children:a.isValidElement(d)?a.cloneElement(d,void 0,u):null})}return m.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}var Sp=Lr("Slot");function Hl(e){const t=a.forwardRef((n,o)=>{let{children:r,...s}=n;if(Dr(r)&&typeof It=="function"&&(r=It(r._payload)),a.isValidElement(r)){const i=Kl(r),c=Gl(s,r.props);return r.type!==a.Fragment&&(c.ref=o?at(o,i):i),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vl=Symbol("radix.slottable");function Ul(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vl}function Gl(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Kl(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mn="focusScope.autoFocusOnMount",hn="focusScope.autoFocusOnUnmount",ko={bubbles:!1,cancelable:!0},zl="FocusScope",Kt=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...i}=e,[c,l]=a.useState(null),d=X(r),u=X(s),f=a.useRef(null),p=j(t,h=>l(h)),v=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let h=function(b){if(v.paused||!c)return;const C=b.target;c.contains(C)?f.current=C:Pe(f.current,{select:!0})},w=function(b){if(v.paused||!c)return;const C=b.relatedTarget;C!==null&&(c.contains(C)||Pe(f.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const E of b)E.removedNodes.length>0&&Pe(c)};document.addEventListener("focusin",h),document.addEventListener("focusout",w);const x=new MutationObserver(y);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",w),x.disconnect()}}},[o,c,v.paused]),a.useEffect(()=>{if(c){Fo.add(v);const h=document.activeElement;if(!c.contains(h)){const y=new CustomEvent(mn,ko);c.addEventListener(mn,d),c.dispatchEvent(y),y.defaultPrevented||(Yl(Jl(jr(c)),{select:!0}),document.activeElement===h&&Pe(c))}return()=>{c.removeEventListener(mn,d),setTimeout(()=>{const y=new CustomEvent(hn,ko);c.addEventListener(hn,u),c.dispatchEvent(y),y.defaultPrevented||Pe(h??document.body,{select:!0}),c.removeEventListener(hn,u),Fo.remove(v)},0)}}},[c,d,u,v]);const g=a.useCallback(h=>{if(!n&&!o||v.paused)return;const w=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,y=document.activeElement;if(w&&y){const x=h.currentTarget,[b,C]=Xl(x);b&&C?!h.shiftKey&&y===C?(h.preventDefault(),n&&Pe(b,{select:!0})):h.shiftKey&&y===b&&(h.preventDefault(),n&&Pe(C,{select:!0})):y===x&&h.preventDefault()}},[n,o,v.paused]);return m.jsx(O.div,{tabIndex:-1,...i,ref:p,onKeyDown:g})});Kt.displayName=zl;function Yl(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Pe(o,{select:t}),document.activeElement!==n)return}function Xl(e){const t=jr(e),n=$o(t,e),o=$o(t.reverse(),e);return[n,o]}function jr(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $o(e,t){for(const n of e)if(!ql(n,{upTo:t}))return n}function ql(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Zl(e){return e instanceof HTMLInputElement&&"select"in e}function Pe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Zl(e)&&t&&e.select()}}var Fo=Ql();function Ql(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Bo(e,t),e.unshift(t)},remove(t){var n;e=Bo(e,t),(n=e[0])==null||n.resume()}}}function Bo(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Jl(e){return e.filter(t=>t.tagName!=="A")}var vn=0;function Qn(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wo()),document.body.insertAdjacentElement("beforeend",e[1]??Wo()),vn++,()=>{vn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),vn--}},[])}function Wo(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var he=function(){return he=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},he.apply(this,arguments)};function kr(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function eu(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,s;o<r;o++)(s||!(o in t))&&(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}var Rt="right-scroll-bar-position",Pt="width-before-scroll-bar",tu="with-scroll-bars-hidden",nu="--removed-body-scroll-bar-size";function gn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ou(e,t){var n=a.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var ru=typeof window<"u"?a.useLayoutEffect:a.useEffect,Ho=new WeakMap;function su(e,t){var n=ou(null,function(o){return e.forEach(function(r){return gn(r,o)})});return ru(function(){var o=Ho.get(n);if(o){var r=new Set(o),s=new Set(e),i=n.current;r.forEach(function(c){s.has(c)||gn(c,null)}),s.forEach(function(c){r.has(c)||gn(c,i)})}Ho.set(n,e)},[e]),n}function iu(e){return e}function au(e,t){t===void 0&&(t=iu);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,o);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(o=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){o=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(s),i=n}var l=function(){var u=i;i=[],u.forEach(s)},d=function(){return Promise.resolve().then(l)};d(),n={push:function(u){i.push(u),d()},filter:function(u){return i=i.filter(u),n}}}};return r}function cu(e){e===void 0&&(e={});var t=au(null);return t.options=he({async:!0,ssr:!1},e),t}var $r=function(e){var t=e.sideCar,n=kr(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return a.createElement(o,he({},n))};$r.isSideCarExport=!0;function lu(e,t){return e.useMedium(t),$r}var Fr=cu(),wn=function(){},zt=a.forwardRef(function(e,t){var n=a.useRef(null),o=a.useState({onScrollCapture:wn,onWheelCapture:wn,onTouchMoveCapture:wn}),r=o[0],s=o[1],i=e.forwardProps,c=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,v=e.noRelative,g=e.noIsolation,h=e.inert,w=e.allowPinchZoom,y=e.as,x=y===void 0?"div":y,b=e.gapMode,C=kr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,P=su([n,t]),S=he(he({},C),r);return a.createElement(a.Fragment,null,u&&a.createElement(E,{sideCar:Fr,removeScrollBar:d,shards:f,noRelative:v,noIsolation:g,inert:h,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:b}),i?a.cloneElement(a.Children.only(c),he(he({},S),{ref:P})):a.createElement(x,he({},S,{className:l,ref:P}),c))});zt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zt.classNames={fullWidth:Pt,zeroRight:Rt};var uu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function du(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=uu();return t&&e.setAttribute("nonce",t),e}function fu(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pu(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var mu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=du())&&(fu(t,n),pu(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hu=function(){var e=mu();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Br=function(){var e=hu(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},vu={left:0,top:0,right:0,gap:0},xn=function(e){return parseInt(e||"",10)||0},gu=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[xn(n),xn(o),xn(r)]},wu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vu;var t=gu(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},xu=Br(),Ve="data-scroll-locked",yu=function(e,t,n,o){var r=e.left,s=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
2
+ .`.concat(tu,` {
3
+ overflow: hidden `).concat(o,`;
4
+ padding-right: `).concat(c,"px ").concat(o,`;
5
+ }
6
+ body[`).concat(Ve,`] {
7
+ overflow: hidden `).concat(o,`;
8
+ overscroll-behavior: contain;
9
+ `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
10
+ padding-left: `.concat(r,`px;
11
+ padding-top: `).concat(s,`px;
12
+ padding-right: `).concat(i,`px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: `).concat(c,"px ").concat(o,`;
16
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(o,";")].filter(Boolean).join(""),`
17
+ }
18
+
19
+ .`).concat(Rt,` {
20
+ right: `).concat(c,"px ").concat(o,`;
21
+ }
22
+
23
+ .`).concat(Pt,` {
24
+ margin-right: `).concat(c,"px ").concat(o,`;
25
+ }
26
+
27
+ .`).concat(Rt," .").concat(Rt,` {
28
+ right: 0 `).concat(o,`;
29
+ }
30
+
31
+ .`).concat(Pt," .").concat(Pt,` {
32
+ margin-right: 0 `).concat(o,`;
33
+ }
34
+
35
+ body[`).concat(Ve,`] {
36
+ `).concat(nu,": ").concat(c,`px;
37
+ }
38
+ `)},Vo=function(){var e=parseInt(document.body.getAttribute(Ve)||"0",10);return isFinite(e)?e:0},bu=function(){a.useEffect(function(){return document.body.setAttribute(Ve,(Vo()+1).toString()),function(){var e=Vo()-1;e<=0?document.body.removeAttribute(Ve):document.body.setAttribute(Ve,e.toString())}},[])},Cu=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;bu();var s=a.useMemo(function(){return wu(r)},[r]);return a.createElement(xu,{styles:yu(s,!t,r,n?"":"!important")})},Mn=!1;if(typeof window<"u")try{var xt=Object.defineProperty({},"passive",{get:function(){return Mn=!0,!0}});window.addEventListener("test",xt,xt),window.removeEventListener("test",xt,xt)}catch{Mn=!1}var Fe=Mn?{passive:!1}:!1,Su=function(e){return e.tagName==="TEXTAREA"},Wr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Su(e)&&n[t]==="visible")},Eu=function(e){return Wr(e,"overflowY")},Ru=function(e){return Wr(e,"overflowX")},Uo=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Hr(e,o);if(r){var s=Vr(e,o),i=s[1],c=s[2];if(i>c)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Pu=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},Tu=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Hr=function(e,t){return e==="v"?Eu(t):Ru(t)},Vr=function(e,t){return e==="v"?Pu(t):Tu(t)},Mu=function(e,t){return e==="h"&&t==="rtl"?-1:1},_u=function(e,t,n,o,r){var s=Mu(e,window.getComputedStyle(t).direction),i=s*o,c=n.target,l=t.contains(c),d=!1,u=i>0,f=0,p=0;do{if(!c)break;var v=Vr(e,c),g=v[0],h=v[1],w=v[2],y=h-w-s*g;(g||y)&&Hr(e,c)&&(f+=y,p+=g);var x=c.parentNode;c=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(u&&Math.abs(f)<1||!u&&Math.abs(p)<1)&&(d=!0),d},yt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Go=function(e){return[e.deltaX,e.deltaY]},Ko=function(e){return e&&"current"in e?e.current:e},Au=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Iu=function(e){return`
39
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
40
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
+ `)},Nu=0,Be=[];function Ou(e){var t=a.useRef([]),n=a.useRef([0,0]),o=a.useRef(),r=a.useState(Nu++)[0],s=a.useState(Br)[0],i=a.useRef(e);a.useEffect(function(){i.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var h=eu([e.lockRef.current],(e.shards||[]).map(Ko),!0).filter(Boolean);return h.forEach(function(w){return w.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),h.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(h,w){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!i.current.allowPinchZoom;var y=yt(h),x=n.current,b="deltaX"in h?h.deltaX:x[0]-y[0],C="deltaY"in h?h.deltaY:x[1]-y[1],E,P=h.target,S=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in h&&S==="h"&&P.type==="range")return!1;var M=window.getSelection(),_=M&&M.anchorNode,A=_?_===P||_.contains(P):!1;if(A)return!1;var L=Uo(S,P);if(!L)return!0;if(L?E=S:(E=S==="v"?"h":"v",L=Uo(S,P)),!L)return!1;if(!o.current&&"changedTouches"in h&&(b||C)&&(o.current=E),!E)return!0;var $=o.current||E;return _u($,w,h,$==="h"?b:C)},[]),l=a.useCallback(function(h){var w=h;if(!(!Be.length||Be[Be.length-1]!==s)){var y="deltaY"in w?Go(w):yt(w),x=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&Au(E.delta,y)})[0];if(x&&x.should){w.cancelable&&w.preventDefault();return}if(!x){var b=(i.current.shards||[]).map(Ko).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=b.length>0?c(w,b[0]):!i.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),d=a.useCallback(function(h,w,y,x){var b={name:h,delta:w,target:y,should:x,shadowParent:Du(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),u=a.useCallback(function(h){n.current=yt(h),o.current=void 0},[]),f=a.useCallback(function(h){d(h.type,Go(h),h.target,c(h,e.lockRef.current))},[]),p=a.useCallback(function(h){d(h.type,yt(h),h.target,c(h,e.lockRef.current))},[]);a.useEffect(function(){return Be.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Fe),document.addEventListener("touchmove",l,Fe),document.addEventListener("touchstart",u,Fe),function(){Be=Be.filter(function(h){return h!==s}),document.removeEventListener("wheel",l,Fe),document.removeEventListener("touchmove",l,Fe),document.removeEventListener("touchstart",u,Fe)}},[]);var v=e.removeScrollBar,g=e.inert;return a.createElement(a.Fragment,null,g?a.createElement(s,{styles:Iu(r)}):null,v?a.createElement(Cu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Du(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Lu=lu(Fr,Ou);var Yt=a.forwardRef(function(e,t){return a.createElement(zt,he({},e,{ref:t,sideCar:Lu}))});Yt.classNames=zt.classNames;var ju=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},We=new WeakMap,bt=new WeakMap,Ct={},yn=0,Ur=function(e){return e&&(e.host||Ur(e.parentNode))},ku=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Ur(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},$u=function(e,t,n,o){var r=ku(t,Array.isArray(e)?e:[e]);Ct[n]||(Ct[n]=new WeakMap);var s=Ct[n],i=[],c=new Set,l=new Set(r),d=function(f){!f||c.has(f)||(c.add(f),d(f.parentNode))};r.forEach(d);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(c.has(p))u(p);else try{var v=p.getAttribute(o),g=v!==null&&v!=="false",h=(We.get(p)||0)+1,w=(s.get(p)||0)+1;We.set(p,h),s.set(p,w),i.push(p),h===1&&g&&bt.set(p,!0),w===1&&p.setAttribute(n,"true"),g||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return u(t),c.clear(),yn++,function(){i.forEach(function(f){var p=We.get(f)-1,v=s.get(f)-1;We.set(f,p),s.set(f,v),p||(bt.has(f)||f.removeAttribute(o),bt.delete(f)),v||f.removeAttribute(n)}),yn--,yn||(We=new WeakMap,We=new WeakMap,bt=new WeakMap,Ct={})}},Jn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=ju(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),$u(o,r,n,"aria-hidden")):function(){return null}},Xt="Dialog",[Gr]=se(Xt),[Fu,pe]=Gr(Xt),Kr=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,c=a.useRef(null),l=a.useRef(null),[d,u]=Ee({prop:o,defaultProp:r??!1,onChange:s,caller:Xt});return m.jsx(Fu,{scope:t,triggerRef:c,contentRef:l,contentId:ae(),titleId:ae(),descriptionId:ae(),open:d,onOpenChange:u,onOpenToggle:a.useCallback(()=>u(f=>!f),[u]),modal:i,children:n})};Kr.displayName=Xt;var zr="DialogTrigger",Yr=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(zr,n),s=j(t,r.triggerRef);return m.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":no(r.open),...o,ref:s,onClick:R(e.onClick,r.onOpenToggle)})});Yr.displayName=zr;var eo="DialogPortal",[Bu,Xr]=Gr(eo,{forceMount:void 0}),qr=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=pe(eo,t);return m.jsx(Bu,{scope:t,forceMount:n,children:a.Children.map(o,i=>m.jsx(Z,{present:n||s.open,children:m.jsx(ut,{asChild:!0,container:r,children:i})}))})};qr.displayName=eo;var Nt="DialogOverlay",Zr=a.forwardRef((e,t)=>{const n=Xr(Nt,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=pe(Nt,e.__scopeDialog);return s.modal?m.jsx(Z,{present:o||s.open,children:m.jsx(Hu,{...r,ref:t})}):null});Zr.displayName=Nt;var Wu=Ue("DialogOverlay.RemoveScroll"),Hu=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(Nt,n);return m.jsx(Yt,{as:Wu,allowPinchZoom:!0,shards:[r.contentRef],children:m.jsx(O.div,{"data-state":no(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),De="DialogContent",Qr=a.forwardRef((e,t)=>{const n=Xr(De,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=pe(De,e.__scopeDialog);return m.jsx(Z,{present:o||s.open,children:s.modal?m.jsx(Vu,{...r,ref:t}):m.jsx(Uu,{...r,ref:t})})});Qr.displayName=De;var Vu=a.forwardRef((e,t)=>{const n=pe(De,e.__scopeDialog),o=a.useRef(null),r=j(t,n.contentRef,o);return a.useEffect(()=>{const s=o.current;if(s)return Jn(s)},[]),m.jsx(Jr,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:R(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:R(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&s.preventDefault()}),onFocusOutside:R(e.onFocusOutside,s=>s.preventDefault())})}),Uu=a.forwardRef((e,t)=>{const n=pe(De,e.__scopeDialog),o=a.useRef(!1),r=a.useRef(!1);return m.jsx(Jr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(o.current||(c=n.triggerRef.current)==null||c.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{var l,d;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),Jr=a.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...i}=e,c=pe(De,n),l=a.useRef(null),d=j(t,l);return Qn(),m.jsxs(m.Fragment,{children:[m.jsx(Kt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:m.jsx(ct,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":no(c.open),...i,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(Gu,{titleId:c.titleId}),m.jsx(zu,{contentRef:l,descriptionId:c.descriptionId})]})]})}),to="DialogTitle",es=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(to,n);return m.jsx(O.h2,{id:r.titleId,...o,ref:t})});es.displayName=to;var ts="DialogDescription",ns=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(ts,n);return m.jsx(O.p,{id:r.descriptionId,...o,ref:t})});ns.displayName=ts;var os="DialogClose",rs=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(os,n);return m.jsx(O.button,{type:"button",...o,ref:t,onClick:R(e.onClick,()=>r.onOpenChange(!1))})});rs.displayName=os;function no(e){return e?"open":"closed"}var ss="DialogTitleWarning",[Ep,is]=Fa(ss,{contentName:De,titleName:to,docsSlug:"dialog"}),Gu=({titleId:e})=>{const t=is(ss),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
+
43
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
+
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ku="DialogDescriptionWarning",zu=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${is(Ku).contentName}}.`;return a.useEffect(()=>{var s;const r=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Rp=Kr,Pp=Yr,Tp=qr,Mp=Zr,_p=Qr,Ap=es,Ip=ns,Np=rs,Yu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qt=Yu.reduce((e,t)=>{const n=Lr(`Primitive.${t}`),o=a.forwardRef((r,s)=>{const{asChild:i,...c}=r,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Xu="Label",as=a.forwardRef((e,t)=>m.jsx(qt.label,{...e,ref:t,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));as.displayName=Xu;var Op=as;function _n(e,[t,n]){return Math.min(n,Math.max(t,e))}function oo(e){const t=e+"CollectionProvider",[n,o]=se(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:w,children:y}=h,x=Ie.useRef(null),b=Ie.useRef(new Map).current;return m.jsx(r,{scope:w,itemMap:b,collectionRef:x,children:y})};i.displayName=t;const c=e+"CollectionSlot",l=Ue(c),d=Ie.forwardRef((h,w)=>{const{scope:y,children:x}=h,b=s(c,y),C=j(w,b.collectionRef);return m.jsx(l,{ref:C,children:x})});d.displayName=c;const u=e+"CollectionItemSlot",f="data-radix-collection-item",p=Ue(u),v=Ie.forwardRef((h,w)=>{const{scope:y,children:x,...b}=h,C=Ie.useRef(null),E=j(w,C),P=s(u,y);return Ie.useEffect(()=>(P.itemMap.set(C,{ref:C,...b}),()=>void P.itemMap.delete(C))),m.jsx(p,{[f]:"",ref:E,children:x})});v.displayName=u;function g(h){const w=s(e+"CollectionConsumer",h);return Ie.useCallback(()=>{const x=w.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(w.itemMap.values()).sort((P,S)=>b.indexOf(P.ref.current)-b.indexOf(S.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:i,Slot:d,ItemSlot:v},g,o]}var qu=a.createContext(void 0);function ft(e){const t=a.useContext(qu);return e||t||"ltr"}function cs(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Zu=[" ","Enter","ArrowUp","ArrowDown"],Qu=[" ","Enter"],Le="Select",[Zt,Qt,Ju]=oo(Le),[Ze]=se(Le,[Ju,qe]),Jt=qe(),[ed,_e]=Ze(Le),[td,nd]=Ze(Le),ls=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:i,defaultValue:c,onValueChange:l,dir:d,name:u,autoComplete:f,disabled:p,required:v,form:g}=e,h=Jt(t),[w,y]=a.useState(null),[x,b]=a.useState(null),[C,E]=a.useState(!1),P=ft(d),[S,M]=Ee({prop:o,defaultProp:r??!1,onChange:s,caller:Le}),[_,A]=Ee({prop:i,defaultProp:c,onChange:l,caller:Le}),L=a.useRef(null),$=w?g||!!w.closest("form"):!0,[F,k]=a.useState(new Set),G=Array.from(F).map(D=>D.props.value).join(";");return m.jsx(Kn,{...h,children:m.jsxs(ed,{required:v,scope:t,trigger:w,onTriggerChange:y,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:ae(),value:_,onValueChange:A,open:S,onOpenChange:M,dir:P,triggerPointerDownPosRef:L,disabled:p,children:[m.jsx(Zt.Provider,{scope:t,children:m.jsx(td,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(D=>{k(B=>new Set(B).add(D))},[]),onNativeOptionRemove:a.useCallback(D=>{k(B=>{const I=new Set(B);return I.delete(D),I})},[]),children:n})}),$?m.jsxs(Ds,{"aria-hidden":!0,required:v,tabIndex:-1,name:u,autoComplete:f,value:_,onChange:D=>A(D.target.value),disabled:p,form:g,children:[_===void 0?m.jsx("option",{value:""}):null,Array.from(F)]},G):null]})})};ls.displayName=Le;var us="SelectTrigger",ds=a.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=Jt(n),i=_e(us,n),c=i.disabled||o,l=j(t,i.onTriggerChange),d=Qt(n),u=a.useRef("touch"),[f,p,v]=js(h=>{const w=d().filter(b=>!b.disabled),y=w.find(b=>b.value===i.value),x=ks(w,h,y);x!==void 0&&i.onValueChange(x.value)}),g=h=>{c||(i.onOpenChange(!0),v()),h&&(i.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return m.jsx(zn,{asChild:!0,...s,children:m.jsx(O.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Ls(i.value)?"":void 0,...r,ref:l,onClick:R(r.onClick,h=>{h.currentTarget.focus(),u.current!=="mouse"&&g(h)}),onPointerDown:R(r.onPointerDown,h=>{u.current=h.pointerType;const w=h.target;w.hasPointerCapture(h.pointerId)&&w.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(g(h),h.preventDefault())}),onKeyDown:R(r.onKeyDown,h=>{const w=f.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&p(h.key),!(w&&h.key===" ")&&Zu.includes(h.key)&&(g(),h.preventDefault())})})})});ds.displayName=us;var fs="SelectValue",ps=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:i="",...c}=e,l=_e(fs,n),{onValueNodeHasChildrenChange:d}=l,u=s!==void 0,f=j(t,l.onValueNodeChange);return q(()=>{d(u)},[d,u]),m.jsx(O.span,{...c,ref:f,style:{pointerEvents:"none"},children:Ls(l.value)?m.jsx(m.Fragment,{children:i}):s})});ps.displayName=fs;var od="SelectIcon",ms=a.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return m.jsx(O.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});ms.displayName=od;var rd="SelectPortal",hs=e=>m.jsx(ut,{asChild:!0,...e});hs.displayName=rd;var je="SelectContent",vs=a.forwardRef((e,t)=>{const n=_e(je,e.__scopeSelect),[o,r]=a.useState();if(q(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?Ft.createPortal(m.jsx(gs,{scope:e.__scopeSelect,children:m.jsx(Zt.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),s):null}return m.jsx(ws,{...e,ref:t})});vs.displayName=je;var ue=10,[gs,Ae]=Ze(je),sd="SelectContentImpl",id=Ue("SelectContent.RemoveScroll"),ws=a.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:i,side:c,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:v,sticky:g,hideWhenDetached:h,avoidCollisions:w,...y}=e,x=_e(je,n),[b,C]=a.useState(null),[E,P]=a.useState(null),S=j(t,N=>C(N)),[M,_]=a.useState(null),[A,L]=a.useState(null),$=Qt(n),[F,k]=a.useState(!1),G=a.useRef(!1);a.useEffect(()=>{if(b)return Jn(b)},[b]),Qn();const D=a.useCallback(N=>{const[H,...z]=$().map(U=>U.ref.current),[W]=z.slice(-1),V=document.activeElement;for(const U of N)if(U===V||(U==null||U.scrollIntoView({block:"nearest"}),U===H&&E&&(E.scrollTop=0),U===W&&E&&(E.scrollTop=E.scrollHeight),U==null||U.focus(),document.activeElement!==V))return},[$,E]),B=a.useCallback(()=>D([M,b]),[D,M,b]);a.useEffect(()=>{F&&B()},[F,B]);const{onOpenChange:I,triggerPointerDownPosRef:T}=x;a.useEffect(()=>{if(b){let N={x:0,y:0};const H=W=>{var V,U;N={x:Math.abs(Math.round(W.pageX)-(((V=T.current)==null?void 0:V.x)??0)),y:Math.abs(Math.round(W.pageY)-(((U=T.current)==null?void 0:U.y)??0))}},z=W=>{N.x<=10&&N.y<=10?W.preventDefault():b.contains(W.target)||I(!1),document.removeEventListener("pointermove",H),T.current=null};return T.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",z,{capture:!0})}}},[b,I,T]),a.useEffect(()=>{const N=()=>I(!1);return window.addEventListener("blur",N),window.addEventListener("resize",N),()=>{window.removeEventListener("blur",N),window.removeEventListener("resize",N)}},[I]);const[K,Y]=js(N=>{const H=$().filter(V=>!V.disabled),z=H.find(V=>V.ref.current===document.activeElement),W=ks(H,N,z);W&&setTimeout(()=>W.ref.current.focus())}),ee=a.useCallback((N,H,z)=>{const W=!G.current&&!z;(x.value!==void 0&&x.value===H||W)&&(_(N),W&&(G.current=!0))},[x.value]),ye=a.useCallback(()=>b==null?void 0:b.focus(),[b]),ie=a.useCallback((N,H,z)=>{const W=!G.current&&!z;(x.value!==void 0&&x.value===H||W)&&L(N)},[x.value]),be=o==="popper"?An:xs,te=be===An?{side:c,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:v,sticky:g,hideWhenDetached:h,avoidCollisions:w}:{};return m.jsx(gs,{scope:n,content:b,viewport:E,onViewportChange:P,itemRefCallback:ee,selectedItem:M,onItemLeave:ye,itemTextRefCallback:ie,focusSelectedItem:B,selectedItemText:A,position:o,isPositioned:F,searchRef:K,children:m.jsx(Yt,{as:id,allowPinchZoom:!0,children:m.jsx(Kt,{asChild:!0,trapped:x.open,onMountAutoFocus:N=>{N.preventDefault()},onUnmountAutoFocus:R(r,N=>{var H;(H=x.trigger)==null||H.focus({preventScroll:!0}),N.preventDefault()}),children:m.jsx(ct,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:N=>N.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:m.jsx(be,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:N=>N.preventDefault(),...y,...te,onPlaced:()=>k(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:R(y.onKeyDown,N=>{const H=N.ctrlKey||N.altKey||N.metaKey;if(N.key==="Tab"&&N.preventDefault(),!H&&N.key.length===1&&Y(N.key),["ArrowUp","ArrowDown","Home","End"].includes(N.key)){let W=$().filter(V=>!V.disabled).map(V=>V.ref.current);if(["ArrowUp","End"].includes(N.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(N.key)){const V=N.target,U=W.indexOf(V);W=W.slice(U+1)}setTimeout(()=>D(W)),N.preventDefault()}})})})})})})});ws.displayName=sd;var ad="SelectItemAlignedPosition",xs=a.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=_e(je,n),i=Ae(je,n),[c,l]=a.useState(null),[d,u]=a.useState(null),f=j(t,S=>u(S)),p=Qt(n),v=a.useRef(!1),g=a.useRef(!0),{viewport:h,selectedItem:w,selectedItemText:y,focusSelectedItem:x}=i,b=a.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&h&&w&&y){const S=s.trigger.getBoundingClientRect(),M=d.getBoundingClientRect(),_=s.valueNode.getBoundingClientRect(),A=y.getBoundingClientRect();if(s.dir!=="rtl"){const V=A.left-M.left,U=_.left-V,ne=S.left-U,me=S.width+ne,Qe=Math.max(me,M.width),Je=window.innerWidth-ue,et=_n(U,[ue,Math.max(ue,Je-Qe)]);c.style.minWidth=me+"px",c.style.left=et+"px"}else{const V=M.right-A.right,U=window.innerWidth-_.right-V,ne=window.innerWidth-S.right-U,me=S.width+ne,Qe=Math.max(me,M.width),Je=window.innerWidth-ue,et=_n(U,[ue,Math.max(ue,Je-Qe)]);c.style.minWidth=me+"px",c.style.right=et+"px"}const L=p(),$=window.innerHeight-ue*2,F=h.scrollHeight,k=window.getComputedStyle(d),G=parseInt(k.borderTopWidth,10),D=parseInt(k.paddingTop,10),B=parseInt(k.borderBottomWidth,10),I=parseInt(k.paddingBottom,10),T=G+D+F+I+B,K=Math.min(w.offsetHeight*5,T),Y=window.getComputedStyle(h),ee=parseInt(Y.paddingTop,10),ye=parseInt(Y.paddingBottom,10),ie=S.top+S.height/2-ue,be=$-ie,te=w.offsetHeight/2,N=w.offsetTop+te,H=G+D+N,z=T-H;if(H<=ie){const V=L.length>0&&w===L[L.length-1].ref.current;c.style.bottom="0px";const U=d.clientHeight-h.offsetTop-h.offsetHeight,ne=Math.max(be,te+(V?ye:0)+U+B),me=H+ne;c.style.height=me+"px"}else{const V=L.length>0&&w===L[0].ref.current;c.style.top="0px";const ne=Math.max(ie,G+h.offsetTop+(V?ee:0)+te)+z;c.style.height=ne+"px",h.scrollTop=H-ie+h.offsetTop}c.style.margin=`${ue}px 0`,c.style.minHeight=K+"px",c.style.maxHeight=$+"px",o==null||o(),requestAnimationFrame(()=>v.current=!0)}},[p,s.trigger,s.valueNode,c,d,h,w,y,s.dir,o]);q(()=>b(),[b]);const[C,E]=a.useState();q(()=>{d&&E(window.getComputedStyle(d).zIndex)},[d]);const P=a.useCallback(S=>{S&&g.current===!0&&(b(),x==null||x(),g.current=!1)},[b,x]);return m.jsx(ld,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:v,onScrollButtonChange:P,children:m.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:m.jsx(O.div,{...r,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});xs.displayName=ad;var cd="SelectPopperPosition",An=a.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=ue,...s}=e,i=Jt(n);return m.jsx(Yn,{...i,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.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)"}})});An.displayName=cd;var[ld,ro]=Ze(je,{}),In="SelectViewport",ys=a.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=Ae(In,n),i=ro(In,n),c=j(t,s.onViewportChange),l=a.useRef(0);return m.jsxs(m.Fragment,{children:[m.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:o}),m.jsx(Zt.Slot,{scope:n,children:m.jsx(O.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:R(r.onScroll,d=>{const u=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=i;if(p!=null&&p.current&&f){const v=Math.abs(l.current-u.scrollTop);if(v>0){const g=window.innerHeight-ue*2,h=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),y=Math.max(h,w);if(y<g){const x=y+v,b=Math.min(g,x),C=x-b;f.style.height=b+"px",f.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});ys.displayName=In;var bs="SelectGroup",[ud,dd]=Ze(bs),Cs=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ae();return m.jsx(ud,{scope:n,id:r,children:m.jsx(O.div,{role:"group","aria-labelledby":r,...o,ref:t})})});Cs.displayName=bs;var Ss="SelectLabel",Es=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=dd(Ss,n);return m.jsx(O.div,{id:r.id,...o,ref:t})});Es.displayName=Ss;var Ot="SelectItem",[fd,Rs]=Ze(Ot),Ps=a.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...i}=e,c=_e(Ot,n),l=Ae(Ot,n),d=c.value===o,[u,f]=a.useState(s??""),[p,v]=a.useState(!1),g=j(t,x=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,x,o,r)}),h=ae(),w=a.useRef("touch"),y=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.jsx(fd,{scope:n,value:o,disabled:r,textId:h,isSelected:d,onItemTextChange:a.useCallback(x=>{f(b=>b||((x==null?void 0:x.textContent)??"").trim())},[]),children:m.jsx(Zt.ItemSlot,{scope:n,value:o,disabled:r,textValue:u,children:m.jsx(O.div,{role:"option","aria-labelledby":h,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:g,onFocus:R(i.onFocus,()=>v(!0)),onBlur:R(i.onBlur,()=>v(!1)),onClick:R(i.onClick,()=>{w.current!=="mouse"&&y()}),onPointerUp:R(i.onPointerUp,()=>{w.current==="mouse"&&y()}),onPointerDown:R(i.onPointerDown,x=>{w.current=x.pointerType}),onPointerMove:R(i.onPointerMove,x=>{var b;w.current=x.pointerType,r?(b=l.onItemLeave)==null||b.call(l):w.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:R(i.onPointerLeave,x=>{var b;x.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:R(i.onKeyDown,x=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&x.key===" "||(Qu.includes(x.key)&&y(),x.key===" "&&x.preventDefault())})})})})});Ps.displayName=Ot;var tt="SelectItemText",Ts=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,i=_e(tt,n),c=Ae(tt,n),l=Rs(tt,n),d=nd(tt,n),[u,f]=a.useState(null),p=j(t,y=>f(y),l.onItemTextChange,y=>{var x;return(x=c.itemTextRefCallback)==null?void 0:x.call(c,y,l.value,l.disabled)}),v=u==null?void 0:u.textContent,g=a.useMemo(()=>m.jsx("option",{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:h,onNativeOptionRemove:w}=d;return q(()=>(h(g),()=>w(g)),[h,w,g]),m.jsxs(m.Fragment,{children:[m.jsx(O.span,{id:l.textId,...s,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ft.createPortal(s.children,i.valueNode):null]})});Ts.displayName=tt;var Ms="SelectItemIndicator",_s=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Rs(Ms,n).isSelected?m.jsx(O.span,{"aria-hidden":!0,...o,ref:t}):null});_s.displayName=Ms;var Nn="SelectScrollUpButton",As=a.forwardRef((e,t)=>{const n=Ae(Nn,e.__scopeSelect),o=ro(Nn,e.__scopeSelect),[r,s]=a.useState(!1),i=j(t,o.onScrollButtonChange);return q(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=l.scrollTop>0;s(d)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?m.jsx(Ns,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});As.displayName=Nn;var On="SelectScrollDownButton",Is=a.forwardRef((e,t)=>{const n=Ae(On,e.__scopeSelect),o=ro(On,e.__scopeSelect),[r,s]=a.useState(!1),i=j(t,o.onScrollButtonChange);return q(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<d;s(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?m.jsx(Ns,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Is.displayName=On;var Ns=a.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=Ae("SelectScrollButton",n),i=a.useRef(null),c=Qt(n),l=a.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return a.useEffect(()=>()=>l(),[l]),q(()=>{var u;const d=c().find(f=>f.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[c]),m.jsx(O.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:R(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:R(r.onPointerMove,()=>{var d;(d=s.onItemLeave)==null||d.call(s),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:R(r.onPointerLeave,()=>{l()})})}),pd="SelectSeparator",Os=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return m.jsx(O.div,{"aria-hidden":!0,...o,ref:t})});Os.displayName=pd;var Dn="SelectArrow",md=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Jt(n),s=_e(Dn,n),i=Ae(Dn,n);return s.open&&i.position==="popper"?m.jsx(Xn,{...r,...o,ref:t}):null});md.displayName=Dn;var hd="SelectBubbleInput",Ds=a.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=a.useRef(null),s=j(o,r),i=cs(t);return a.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&u){const f=new Event("change",{bubbles:!0});u.call(c,t),c.dispatchEvent(f)}},[i,t]),m.jsx(O.select,{...n,style:{...Er,...n.style},ref:s,defaultValue:t})});Ds.displayName=hd;function Ls(e){return e===""||e===void 0}function js(e){const t=X(e),n=a.useRef(""),o=a.useRef(0),r=a.useCallback(i=>{const c=n.current+i;t(c),function l(d){n.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>l(""),1e3))}(c)},[t]),s=a.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function ks(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=vd(e,Math.max(s,0));r.length===1&&(i=i.filter(d=>d!==n));const l=i.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function vd(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Dp=ls,Lp=ds,jp=ps,kp=ms,$p=hs,Fp=vs,Bp=ys,Wp=Cs,Hp=Es,Vp=Ps,Up=Ts,Gp=_s,Kp=As,zp=Is,Yp=Os,bn="rovingFocusGroup.onEntryFocus",gd={bubbles:!1,cancelable:!0},pt="RovingFocusGroup",[Ln,$s,wd]=oo(pt),[xd,en]=se(pt,[wd]),[yd,bd]=xd(pt),Fs=a.forwardRef((e,t)=>m.jsx(Ln.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(Ln.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(Cd,{...e,ref:t})})}));Fs.displayName=pt;var Cd=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=e,p=a.useRef(null),v=j(t,p),g=ft(s),[h,w]=Ee({prop:i,defaultProp:c??null,onChange:l,caller:pt}),[y,x]=a.useState(!1),b=X(d),C=$s(n),E=a.useRef(!1),[P,S]=a.useState(0);return a.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(bn,b),()=>M.removeEventListener(bn,b)},[b]),m.jsx(yd,{scope:n,orientation:o,dir:g,loop:r,currentTabStopId:h,onItemFocus:a.useCallback(M=>w(M),[w]),onItemShiftTab:a.useCallback(()=>x(!0),[]),onFocusableItemAdd:a.useCallback(()=>S(M=>M+1),[]),onFocusableItemRemove:a.useCallback(()=>S(M=>M-1),[]),children:m.jsx(O.div,{tabIndex:y||P===0?-1:0,"data-orientation":o,...f,ref:v,style:{outline:"none",...e.style},onMouseDown:R(e.onMouseDown,()=>{E.current=!0}),onFocus:R(e.onFocus,M=>{const _=!E.current;if(M.target===M.currentTarget&&_&&!y){const A=new CustomEvent(bn,gd);if(M.currentTarget.dispatchEvent(A),!A.defaultPrevented){const L=C().filter(D=>D.focusable),$=L.find(D=>D.active),F=L.find(D=>D.id===h),G=[$,F,...L].filter(Boolean).map(D=>D.ref.current);Hs(G,u)}}E.current=!1}),onBlur:R(e.onBlur,()=>x(!1))})})}),Bs="RovingFocusGroupItem",Ws=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:i,...c}=e,l=ae(),d=s||l,u=bd(Bs,n),f=u.currentTabStopId===d,p=$s(n),{onFocusableItemAdd:v,onFocusableItemRemove:g,currentTabStopId:h}=u;return a.useEffect(()=>{if(o)return v(),()=>g()},[o,v,g]),m.jsx(Ln.ItemSlot,{scope:n,id:d,focusable:o,active:r,children:m.jsx(O.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...c,ref:t,onMouseDown:R(e.onMouseDown,w=>{o?u.onItemFocus(d):w.preventDefault()}),onFocus:R(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:R(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){u.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const y=Rd(w,u.orientation,u.dir);if(y!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let b=p().filter(C=>C.focusable).map(C=>C.ref.current);if(y==="last")b.reverse();else if(y==="prev"||y==="next"){y==="prev"&&b.reverse();const C=b.indexOf(w.currentTarget);b=u.loop?Pd(b,C+1):b.slice(C+1)}setTimeout(()=>Hs(b))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:h!=null}):i})})});Ws.displayName=Bs;var Sd={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ed(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Rd(e,t,n){const o=Ed(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Sd[o]}function Hs(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function Pd(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Vs=Fs,Us=Ws,jn=["Enter"," "],Td=["ArrowDown","PageUp","Home"],Gs=["ArrowUp","PageDown","End"],Md=[...Td,...Gs],_d={ltr:[...jn,"ArrowRight"],rtl:[...jn,"ArrowLeft"]},Ad={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mt="Menu",[st,Id,Nd]=oo(mt),[ke,tn]=se(mt,[Nd,qe,en]),nn=qe(),Ks=en(),[Od,$e]=ke(mt),[Dd,ht]=ke(mt),zs=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:s,modal:i=!0}=e,c=nn(t),[l,d]=a.useState(null),u=a.useRef(!1),f=X(s),p=ft(r);return a.useEffect(()=>{const v=()=>{u.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>u.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),m.jsx(Kn,{...c,children:m.jsx(Od,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:d,children:m.jsx(Dd,{scope:t,onClose:a.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:i,children:o})})})};zs.displayName=mt;var Ld="MenuAnchor",so=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=nn(n);return m.jsx(zn,{...r,...o,ref:t})});so.displayName=Ld;var io="MenuPortal",[jd,Ys]=ke(io,{forceMount:void 0}),Xs=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,s=$e(io,t);return m.jsx(jd,{scope:t,forceMount:n,children:m.jsx(Z,{present:n||s.open,children:m.jsx(ut,{asChild:!0,container:r,children:o})})})};Xs.displayName=io;var ce="MenuContent",[kd,ao]=ke(ce),qs=a.forwardRef((e,t)=>{const n=Ys(ce,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=$e(ce,e.__scopeMenu),i=ht(ce,e.__scopeMenu);return m.jsx(st.Provider,{scope:e.__scopeMenu,children:m.jsx(Z,{present:o||s.open,children:m.jsx(st.Slot,{scope:e.__scopeMenu,children:i.modal?m.jsx($d,{...r,ref:t}):m.jsx(Fd,{...r,ref:t})})})})}),$d=a.forwardRef((e,t)=>{const n=$e(ce,e.__scopeMenu),o=a.useRef(null),r=j(t,o);return a.useEffect(()=>{const s=o.current;if(s)return Jn(s)},[]),m.jsx(co,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:R(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Fd=a.forwardRef((e,t)=>{const n=$e(ce,e.__scopeMenu);return m.jsx(co,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Bd=Ue("MenuContent.ScrollLock"),co=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:v,disableOutsideScroll:g,...h}=e,w=$e(ce,n),y=ht(ce,n),x=nn(n),b=Ks(n),C=Id(n),[E,P]=a.useState(null),S=a.useRef(null),M=j(t,S,w.onContentChange),_=a.useRef(0),A=a.useRef(""),L=a.useRef(0),$=a.useRef(null),F=a.useRef("right"),k=a.useRef(0),G=g?Yt:a.Fragment,D=g?{as:Bd,allowPinchZoom:!0}:void 0,B=T=>{var N,H;const K=A.current+T,Y=C().filter(z=>!z.disabled),ee=document.activeElement,ye=(N=Y.find(z=>z.ref.current===ee))==null?void 0:N.textValue,ie=Y.map(z=>z.textValue),be=Qd(ie,K,ye),te=(H=Y.find(z=>z.textValue===be))==null?void 0:H.ref.current;(function z(W){A.current=W,window.clearTimeout(_.current),W!==""&&(_.current=window.setTimeout(()=>z(""),1e3))})(K),te&&setTimeout(()=>te.focus())};a.useEffect(()=>()=>window.clearTimeout(_.current),[]),Qn();const I=a.useCallback(T=>{var Y,ee;return F.current===((Y=$.current)==null?void 0:Y.side)&&ef(T,(ee=$.current)==null?void 0:ee.area)},[]);return m.jsx(kd,{scope:n,searchRef:A,onItemEnter:a.useCallback(T=>{I(T)&&T.preventDefault()},[I]),onItemLeave:a.useCallback(T=>{var K;I(T)||((K=S.current)==null||K.focus(),P(null))},[I]),onTriggerLeave:a.useCallback(T=>{I(T)&&T.preventDefault()},[I]),pointerGraceTimerRef:L,onPointerGraceIntentChange:a.useCallback(T=>{$.current=T},[]),children:m.jsx(G,{...D,children:m.jsx(Kt,{asChild:!0,trapped:r,onMountAutoFocus:R(s,T=>{var K;T.preventDefault(),(K=S.current)==null||K.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:m.jsx(ct,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:v,children:m.jsx(Vs,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:o,currentTabStopId:E,onCurrentTabStopIdChange:P,onEntryFocus:R(l,T=>{y.isUsingKeyboardRef.current||T.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(Yn,{role:"menu","aria-orientation":"vertical","data-state":fi(w.open),"data-radix-menu-content":"",dir:y.dir,...x,...h,ref:M,style:{outline:"none",...h.style},onKeyDown:R(h.onKeyDown,T=>{const Y=T.target.closest("[data-radix-menu-content]")===T.currentTarget,ee=T.ctrlKey||T.altKey||T.metaKey,ye=T.key.length===1;Y&&(T.key==="Tab"&&T.preventDefault(),!ee&&ye&&B(T.key));const ie=S.current;if(T.target!==ie||!Md.includes(T.key))return;T.preventDefault();const te=C().filter(N=>!N.disabled).map(N=>N.ref.current);Gs.includes(T.key)&&te.reverse(),qd(te)}),onBlur:R(e.onBlur,T=>{T.currentTarget.contains(T.target)||(window.clearTimeout(_.current),A.current="")}),onPointerMove:R(e.onPointerMove,it(T=>{const K=T.target,Y=k.current!==T.clientX;if(T.currentTarget.contains(K)&&Y){const ee=T.clientX>k.current?"right":"left";F.current=ee,k.current=T.clientX}}))})})})})})})});qs.displayName=ce;var Wd="MenuGroup",lo=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return m.jsx(O.div,{role:"group",...o,ref:t})});lo.displayName=Wd;var Hd="MenuLabel",Zs=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return m.jsx(O.div,{...o,ref:t})});Zs.displayName=Hd;var Dt="MenuItem",zo="menu.itemSelect",on=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,s=a.useRef(null),i=ht(Dt,e.__scopeMenu),c=ao(Dt,e.__scopeMenu),l=j(t,s),d=a.useRef(!1),u=()=>{const f=s.current;if(!n&&f){const p=new CustomEvent(zo,{bubbles:!0,cancelable:!0});f.addEventListener(zo,v=>o==null?void 0:o(v),{once:!0}),Jo(f,p),p.defaultPrevented?d.current=!1:i.onClose()}};return m.jsx(Qs,{...r,ref:l,disabled:n,onClick:R(e.onClick,u),onPointerDown:f=>{var p;(p=e.onPointerDown)==null||p.call(e,f),d.current=!0},onPointerUp:R(e.onPointerUp,f=>{var p;d.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:R(e.onKeyDown,f=>{const p=c.searchRef.current!=="";n||p&&f.key===" "||jn.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});on.displayName=Dt;var Qs=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=e,i=ao(Dt,n),c=Ks(n),l=a.useRef(null),d=j(t,l),[u,f]=a.useState(!1),[p,v]=a.useState("");return a.useEffect(()=>{const g=l.current;g&&v((g.textContent??"").trim())},[s.children]),m.jsx(st.ItemSlot,{scope:n,disabled:o,textValue:r??p,children:m.jsx(Us,{asChild:!0,...c,focusable:!o,children:m.jsx(O.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:d,onPointerMove:R(e.onPointerMove,it(g=>{o?i.onItemLeave(g):(i.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:R(e.onPointerLeave,it(g=>i.onItemLeave(g))),onFocus:R(e.onFocus,()=>f(!0)),onBlur:R(e.onBlur,()=>f(!1))})})})}),Vd="MenuCheckboxItem",Js=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return m.jsx(ri,{scope:e.__scopeMenu,checked:n,children:m.jsx(on,{role:"menuitemcheckbox","aria-checked":Lt(n)?"mixed":n,...r,ref:t,"data-state":fo(n),onSelect:R(r.onSelect,()=>o==null?void 0:o(Lt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Js.displayName=Vd;var ei="MenuRadioGroup",[Ud,Gd]=ke(ei,{value:void 0,onValueChange:()=>{}}),ti=a.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,s=X(o);return m.jsx(Ud,{scope:e.__scopeMenu,value:n,onValueChange:s,children:m.jsx(lo,{...r,ref:t})})});ti.displayName=ei;var ni="MenuRadioItem",oi=a.forwardRef((e,t)=>{const{value:n,...o}=e,r=Gd(ni,e.__scopeMenu),s=n===r.value;return m.jsx(ri,{scope:e.__scopeMenu,checked:s,children:m.jsx(on,{role:"menuitemradio","aria-checked":s,...o,ref:t,"data-state":fo(s),onSelect:R(o.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,n)},{checkForDefaultPrevented:!1})})})});oi.displayName=ni;var uo="MenuItemIndicator",[ri,Kd]=ke(uo,{checked:!1}),si=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,s=Kd(uo,n);return m.jsx(Z,{present:o||Lt(s.checked)||s.checked===!0,children:m.jsx(O.span,{...r,ref:t,"data-state":fo(s.checked)})})});si.displayName=uo;var zd="MenuSeparator",ii=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return m.jsx(O.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});ii.displayName=zd;var Yd="MenuArrow",ai=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=nn(n);return m.jsx(Xn,{...r,...o,ref:t})});ai.displayName=Yd;var Xd="MenuSub",[Xp,ci]=ke(Xd),nt="MenuSubTrigger",li=a.forwardRef((e,t)=>{const n=$e(nt,e.__scopeMenu),o=ht(nt,e.__scopeMenu),r=ci(nt,e.__scopeMenu),s=ao(nt,e.__scopeMenu),i=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=s,d={__scopeMenu:e.__scopeMenu},u=a.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return a.useEffect(()=>u,[u]),a.useEffect(()=>{const f=c.current;return()=>{window.clearTimeout(f),l(null)}},[c,l]),m.jsx(so,{asChild:!0,...d,children:m.jsx(Qs,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":fi(n.open),...e,ref:at(t,r.onTriggerChange),onClick:f=>{var p;(p=e.onClick)==null||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:R(e.onPointerMove,it(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:R(e.onPointerLeave,it(f=>{var v,g;u();const p=(v=n.content)==null?void 0:v.getBoundingClientRect();if(p){const h=(g=n.content)==null?void 0:g.dataset.side,w=h==="right",y=w?-5:5,x=p[w?"left":"right"],b=p[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x,y:p.top},{x:b,y:p.top},{x:b,y:p.bottom},{x,y:p.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:R(e.onKeyDown,f=>{var v;const p=s.searchRef.current!=="";e.disabled||p&&f.key===" "||_d[o.dir].includes(f.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),f.preventDefault())})})})});li.displayName=nt;var ui="MenuSubContent",di=a.forwardRef((e,t)=>{const n=Ys(ce,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=$e(ce,e.__scopeMenu),i=ht(ce,e.__scopeMenu),c=ci(ui,e.__scopeMenu),l=a.useRef(null),d=j(t,l);return m.jsx(st.Provider,{scope:e.__scopeMenu,children:m.jsx(Z,{present:o||s.open,children:m.jsx(st.Slot,{scope:e.__scopeMenu,children:m.jsx(co,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;i.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:R(e.onFocusOutside,u=>{u.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:R(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:R(e.onKeyDown,u=>{var v;const f=u.currentTarget.contains(u.target),p=Ad[i.dir].includes(u.key);f&&p&&(s.onOpenChange(!1),(v=c.trigger)==null||v.focus(),u.preventDefault())})})})})})});di.displayName=ui;function fi(e){return e?"open":"closed"}function Lt(e){return e==="indeterminate"}function fo(e){return Lt(e)?"indeterminate":e?"checked":"unchecked"}function qd(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Zd(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function Qd(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Zd(e,Math.max(s,0));r.length===1&&(i=i.filter(d=>d!==n));const l=i.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function Jd(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const c=t[s],l=t[i],d=c.x,u=c.y,f=l.x,p=l.y;u>o!=p>o&&n<(f-d)*(o-u)/(p-u)+d&&(r=!r)}return r}function ef(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Jd(n,t)}function it(e){return t=>t.pointerType==="mouse"?e(t):void 0}var pi=zs,mi=so,hi=Xs,vi=qs,gi=lo,wi=Zs,xi=on,yi=Js,bi=ti,Ci=oi,Si=si,Ei=ii,Ri=ai,Pi=li,Ti=di,po="ContextMenu",[tf]=se(po,[tn]),Q=tn(),[nf,Mi]=tf(po),_i=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:o,dir:r,modal:s=!0}=e,[i,c]=a.useState(!1),l=Q(t),d=X(o),u=a.useCallback(f=>{c(f),d(f)},[d]);return m.jsx(nf,{scope:t,open:i,onOpenChange:u,modal:s,children:m.jsx(pi,{...l,dir:r,open:i,onOpenChange:u,modal:s,children:n})})};_i.displayName=po;var Ai="ContextMenuTrigger",Ii=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:o=!1,...r}=e,s=Mi(Ai,n),i=Q(n),c=a.useRef({x:0,y:0}),l=a.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),d=a.useRef(0),u=a.useCallback(()=>window.clearTimeout(d.current),[]),f=p=>{c.current={x:p.clientX,y:p.clientY},s.onOpenChange(!0)};return a.useEffect(()=>u,[u]),a.useEffect(()=>void(o&&u()),[o,u]),m.jsxs(m.Fragment,{children:[m.jsx(mi,{...i,virtualRef:l}),m.jsx(O.span,{"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,...r,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:R(e.onContextMenu,p=>{u(),f(p),p.preventDefault()}),onPointerDown:o?e.onPointerDown:R(e.onPointerDown,St(p=>{u(),d.current=window.setTimeout(()=>f(p),700)})),onPointerMove:o?e.onPointerMove:R(e.onPointerMove,St(u)),onPointerCancel:o?e.onPointerCancel:R(e.onPointerCancel,St(u)),onPointerUp:o?e.onPointerUp:R(e.onPointerUp,St(u))})]})});Ii.displayName=Ai;var of="ContextMenuPortal",Ni=e=>{const{__scopeContextMenu:t,...n}=e,o=Q(t);return m.jsx(hi,{...o,...n})};Ni.displayName=of;var Oi="ContextMenuContent",Di=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Mi(Oi,n),s=Q(n),i=a.useRef(!1);return m.jsx(vi,{...s,...o,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var l;(l=e.onCloseAutoFocus)==null||l.call(e,c),!c.defaultPrevented&&i.current&&c.preventDefault(),i.current=!1},onInteractOutside:c=>{var l;(l=e.onInteractOutside)==null||l.call(e,c),!c.defaultPrevented&&!r.modal&&(i.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Di.displayName=Oi;var rf="ContextMenuGroup",sf=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Q(n);return m.jsx(gi,{...r,...o,ref:t})});sf.displayName=rf;var af="ContextMenuLabel",Li=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Q(n);return m.jsx(wi,{...r,...o,ref:t})});Li.displayName=af;var cf="ContextMenuItem",ji=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Q(n);return m.jsx(xi,{...r,...o,ref:t})});ji.displayName=cf;var lf="ContextMenuCheckboxItem",ki=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Q(n);return m.jsx(yi,{...r,...o,ref:t})});ki.displayName=lf;var uf="ContextMenuRadioGroup",df=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Q(n);return m.jsx(bi,{...r,...o,ref:t})});df.displayName=uf;var ff="ContextMenuRadioItem",$i=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Q(n);return m.jsx(Ci,{...r,...o,ref:t})});$i.displayName=ff;var pf="ContextMenuItemIndicator",Fi=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Q(n);return m.jsx(Si,{...r,...o,ref:t})});Fi.displayName=pf;var mf="ContextMenuSeparator",Bi=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Q(n);return m.jsx(Ei,{...r,...o,ref:t})});Bi.displayName=mf;var hf="ContextMenuArrow",vf=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Q(n);return m.jsx(Ri,{...r,...o,ref:t})});vf.displayName=hf;var gf="ContextMenuSubTrigger",Wi=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Q(n);return m.jsx(Pi,{...r,...o,ref:t})});Wi.displayName=gf;var wf="ContextMenuSubContent",Hi=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Q(n);return m.jsx(Ti,{...r,...o,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Hi.displayName=wf;function St(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var qp=_i,Zp=Ii,Qp=Ni,Jp=Di,em=Li,tm=ji,nm=ki,om=$i,rm=Fi,sm=Bi,im=Wi,am=Hi,xf="Separator",Yo="horizontal",yf=["horizontal","vertical"],Vi=a.forwardRef((e,t)=>{const{decorative:n,orientation:o=Yo,...r}=e,s=bf(o)?o:Yo,c=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return m.jsx(qt.div,{"data-orientation":s,...c,...r,ref:t})});Vi.displayName=xf;function bf(e){return yf.includes(e)}var cm=Vi;function Cf(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var mo="ScrollArea",[Ui]=se(mo),[Sf,le]=Ui(mo),Gi=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:o="hover",dir:r,scrollHideDelay:s=600,...i}=e,[c,l]=a.useState(null),[d,u]=a.useState(null),[f,p]=a.useState(null),[v,g]=a.useState(null),[h,w]=a.useState(null),[y,x]=a.useState(0),[b,C]=a.useState(0),[E,P]=a.useState(!1),[S,M]=a.useState(!1),_=j(t,L=>l(L)),A=ft(r);return m.jsx(Sf,{scope:n,type:o,dir:A,scrollHideDelay:s,scrollArea:c,viewport:d,onViewportChange:u,content:f,onContentChange:p,scrollbarX:v,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:P,scrollbarY:h,onScrollbarYChange:w,scrollbarYEnabled:S,onScrollbarYEnabledChange:M,onCornerWidthChange:x,onCornerHeightChange:C,children:m.jsx(O.div,{dir:A,...i,ref:_,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});Gi.displayName=mo;var Ki="ScrollAreaViewport",zi=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:o,nonce:r,...s}=e,i=le(Ki,n),c=a.useRef(null),l=j(t,c,i.onViewportChange);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),m.jsx(O.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});zi.displayName=Ki;var xe="ScrollAreaScrollbar",Ef=a.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=le(xe,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=r,c=e.orientation==="horizontal";return a.useEffect(()=>(c?s(!0):i(!0),()=>{c?s(!1):i(!1)}),[c,s,i]),r.type==="hover"?m.jsx(Rf,{...o,ref:t,forceMount:n}):r.type==="scroll"?m.jsx(Pf,{...o,ref:t,forceMount:n}):r.type==="auto"?m.jsx(Yi,{...o,ref:t,forceMount:n}):r.type==="always"?m.jsx(ho,{...o,ref:t}):null});Ef.displayName=xe;var Rf=a.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=le(xe,e.__scopeScrollArea),[s,i]=a.useState(!1);return a.useEffect(()=>{const c=r.scrollArea;let l=0;if(c){const d=()=>{window.clearTimeout(l),i(!0)},u=()=>{l=window.setTimeout(()=>i(!1),r.scrollHideDelay)};return c.addEventListener("pointerenter",d),c.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),c.removeEventListener("pointerenter",d),c.removeEventListener("pointerleave",u)}}},[r.scrollArea,r.scrollHideDelay]),m.jsx(Z,{present:n||s,children:m.jsx(Yi,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Pf=a.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=le(xe,e.__scopeScrollArea),s=e.orientation==="horizontal",i=sn(()=>l("SCROLL_END"),100),[c,l]=Cf("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if(c==="idle"){const d=window.setTimeout(()=>l("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(d)}},[c,r.scrollHideDelay,l]),a.useEffect(()=>{const d=r.viewport,u=s?"scrollLeft":"scrollTop";if(d){let f=d[u];const p=()=>{const v=d[u];f!==v&&(l("SCROLL"),i()),f=v};return d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[r.viewport,s,l,i]),m.jsx(Z,{present:n||c!=="hidden",children:m.jsx(ho,{"data-state":c==="hidden"?"hidden":"visible",...o,ref:t,onPointerEnter:R(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:R(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Yi=a.forwardRef((e,t)=>{const n=le(xe,e.__scopeScrollArea),{forceMount:o,...r}=e,[s,i]=a.useState(!1),c=e.orientation==="horizontal",l=sn(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;i(c?d:u)}},10);return ze(n.viewport,l),ze(n.content,l),m.jsx(Z,{present:o||s,children:m.jsx(ho,{"data-state":s?"visible":"hidden",...r,ref:t})})}),ho=a.forwardRef((e,t)=>{const{orientation:n="vertical",...o}=e,r=le(xe,e.__scopeScrollArea),s=a.useRef(null),i=a.useRef(0),[c,l]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Qi(c.viewport,c.content),u={...o,sizes:c,onSizesChange:l,hasThumb:d>0&&d<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function f(p,v){return Of(p,i.current,c,v)}return n==="horizontal"?m.jsx(Tf,{...u,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const p=r.viewport.scrollLeft,v=Xo(p,c,r.dir);s.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollLeft=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollLeft=f(p,r.dir))}}):n==="vertical"?m.jsx(Mf,{...u,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const p=r.viewport.scrollTop,v=Xo(p,c);s.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollTop=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollTop=f(p))}}):null}),Tf=a.forwardRef((e,t)=>{const{sizes:n,onSizesChange:o,...r}=e,s=le(xe,e.__scopeScrollArea),[i,c]=a.useState(),l=a.useRef(null),d=j(t,l,s.onScrollbarXChange);return a.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),m.jsx(qi,{"data-orientation":"horizontal",...r,ref:d,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":rn(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(s.viewport){const p=s.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),ea(p,f)&&u.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:kt(i.paddingLeft),paddingEnd:kt(i.paddingRight)}})}})}),Mf=a.forwardRef((e,t)=>{const{sizes:n,onSizesChange:o,...r}=e,s=le(xe,e.__scopeScrollArea),[i,c]=a.useState(),l=a.useRef(null),d=j(t,l,s.onScrollbarYChange);return a.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),m.jsx(qi,{"data-orientation":"vertical",...r,ref:d,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":rn(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(s.viewport){const p=s.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),ea(p,f)&&u.preventDefault()}},onResize:()=>{l.current&&s.viewport&&i&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:kt(i.paddingTop),paddingEnd:kt(i.paddingBottom)}})}})}),[_f,Xi]=Ui(xe),qi=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:r,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:d,onWheelScroll:u,onResize:f,...p}=e,v=le(xe,n),[g,h]=a.useState(null),w=j(t,_=>h(_)),y=a.useRef(null),x=a.useRef(""),b=v.viewport,C=o.content-o.viewport,E=X(u),P=X(l),S=sn(f,10);function M(_){if(y.current){const A=_.clientX-y.current.left,L=_.clientY-y.current.top;d({x:A,y:L})}}return a.useEffect(()=>{const _=A=>{const L=A.target;(g==null?void 0:g.contains(L))&&E(A,C)};return document.addEventListener("wheel",_,{passive:!1}),()=>document.removeEventListener("wheel",_,{passive:!1})},[b,g,C,E]),a.useEffect(P,[o,P]),ze(g,S),ze(v.content,S),m.jsx(_f,{scope:n,scrollbar:g,hasThumb:r,onThumbChange:X(s),onThumbPointerUp:X(i),onThumbPositionChange:P,onThumbPointerDown:X(c),children:m.jsx(O.div,{...p,ref:w,style:{position:"absolute",...p.style},onPointerDown:R(e.onPointerDown,_=>{_.button===0&&(_.target.setPointerCapture(_.pointerId),y.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),M(_))}),onPointerMove:R(e.onPointerMove,M),onPointerUp:R(e.onPointerUp,_=>{const A=_.target;A.hasPointerCapture(_.pointerId)&&A.releasePointerCapture(_.pointerId),document.body.style.webkitUserSelect=x.current,v.viewport&&(v.viewport.style.scrollBehavior=""),y.current=null})})})}),jt="ScrollAreaThumb",Af=a.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Xi(jt,e.__scopeScrollArea);return m.jsx(Z,{present:n||r.hasThumb,children:m.jsx(If,{ref:t,...o})})}),If=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:o,...r}=e,s=le(jt,n),i=Xi(jt,n),{onThumbPositionChange:c}=i,l=j(t,f=>i.onThumbChange(f)),d=a.useRef(void 0),u=sn(()=>{d.current&&(d.current(),d.current=void 0)},100);return a.useEffect(()=>{const f=s.viewport;if(f){const p=()=>{if(u(),!d.current){const v=Df(f,c);d.current=v,c()}};return c(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[s.viewport,u,c]),m.jsx(O.div,{"data-state":i.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:R(e.onPointerDownCapture,f=>{const v=f.target.getBoundingClientRect(),g=f.clientX-v.left,h=f.clientY-v.top;i.onThumbPointerDown({x:g,y:h})}),onPointerUp:R(e.onPointerUp,i.onThumbPointerUp)})});Af.displayName=jt;var vo="ScrollAreaCorner",Zi=a.forwardRef((e,t)=>{const n=le(vo,e.__scopeScrollArea),o=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&o?m.jsx(Nf,{...e,ref:t}):null});Zi.displayName=vo;var Nf=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,...o}=e,r=le(vo,n),[s,i]=a.useState(0),[c,l]=a.useState(0),d=!!(s&&c);return ze(r.scrollbarX,()=>{var f;const u=((f=r.scrollbarX)==null?void 0:f.offsetHeight)||0;r.onCornerHeightChange(u),l(u)}),ze(r.scrollbarY,()=>{var f;const u=((f=r.scrollbarY)==null?void 0:f.offsetWidth)||0;r.onCornerWidthChange(u),i(u)}),d?m.jsx(O.div,{...o,ref:t,style:{width:s,height:c,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function kt(e){return e?parseInt(e,10):0}function Qi(e,t){const n=e/t;return isNaN(n)?0:n}function rn(e){const t=Qi(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-n)*t;return Math.max(o,18)}function Of(e,t,n,o="ltr"){const r=rn(n),s=r/2,i=t||s,c=r-i,l=n.scrollbar.paddingStart+i,d=n.scrollbar.size-n.scrollbar.paddingEnd-c,u=n.content-n.viewport,f=o==="ltr"?[0,u]:[u*-1,0];return Ji([l,d],f)(e)}function Xo(e,t,n="ltr"){const o=rn(t),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-r,i=t.content-t.viewport,c=s-o,l=n==="ltr"?[0,i]:[i*-1,0],d=_n(e,l);return Ji([0,i],[0,c])(d)}function Ji(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function ea(e,t){return e>0&&e<t}var Df=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},o=0;return function r(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,c=n.top!==s.top;(i||c)&&t(),n=s,o=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(o)};function sn(e,t){const n=X(e),o=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(o.current),[]),a.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(n,t)},[n,t])}function ze(e,t){const n=X(t);q(()=>{let o=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}},[e,n])}var lm=Gi,um=zi,dm=Zi,an="Switch",[Lf]=se(an),[jf,kf]=Lf(an),ta=a.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:s,required:i,disabled:c,value:l="on",onCheckedChange:d,form:u,...f}=e,[p,v]=a.useState(null),g=j(t,b=>v(b)),h=a.useRef(!1),w=p?u||!!p.closest("form"):!0,[y,x]=Ee({prop:r,defaultProp:s??!1,onChange:d,caller:an});return m.jsxs(jf,{scope:n,checked:y,disabled:c,children:[m.jsx(O.button,{type:"button",role:"switch","aria-checked":y,"aria-required":i,"data-state":sa(y),"data-disabled":c?"":void 0,disabled:c,value:l,...f,ref:g,onClick:R(e.onClick,b=>{x(C=>!C),w&&(h.current=b.isPropagationStopped(),h.current||b.stopPropagation())})}),w&&m.jsx(ra,{control:p,bubbles:!h.current,name:o,value:l,checked:y,required:i,disabled:c,form:u,style:{transform:"translateX(-100%)"}})]})});ta.displayName=an;var na="SwitchThumb",oa=a.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=kf(na,n);return m.jsx(O.span,{"data-state":sa(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});oa.displayName=na;var $f="SwitchBubbleInput",ra=a.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},s)=>{const i=a.useRef(null),c=j(i,s),l=cs(n),d=mr(t);return a.useEffect(()=>{const u=i.current;if(!u)return;const f=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&v){const g=new Event("click",{bubbles:o});v.call(u,n),u.dispatchEvent(g)}},[l,n,o]),m.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:c,style:{...r.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ra.displayName=$f;function sa(e){return e?"checked":"unchecked"}var fm=ta,pm=oa,cn="Collapsible",[Ff]=se(cn),[Bf,go]=Ff(cn),ia=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:o,defaultOpen:r,disabled:s,onOpenChange:i,...c}=e,[l,d]=Ee({prop:o,defaultProp:r??!1,onChange:i,caller:cn});return m.jsx(Bf,{scope:n,disabled:s,contentId:ae(),open:l,onOpenToggle:a.useCallback(()=>d(u=>!u),[d]),children:m.jsx(O.div,{"data-state":xo(l),"data-disabled":s?"":void 0,...c,ref:t})})});ia.displayName=cn;var aa="CollapsibleTrigger",Wf=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,r=go(aa,n);return m.jsx(O.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":xo(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:t,onClick:R(e.onClick,r.onOpenToggle)})});Wf.displayName=aa;var wo="CollapsibleContent",Hf=a.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=go(wo,e.__scopeCollapsible);return m.jsx(Z,{present:n||r.open,children:({present:s})=>m.jsx(Vf,{...o,ref:t,present:s})})});Hf.displayName=wo;var Vf=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:r,...s}=e,i=go(wo,n),[c,l]=a.useState(o),d=a.useRef(null),u=j(t,d),f=a.useRef(0),p=f.current,v=a.useRef(0),g=v.current,h=i.open||c,w=a.useRef(h),y=a.useRef(void 0);return a.useEffect(()=>{const x=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(x)},[]),q(()=>{const x=d.current;if(x){y.current=y.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const b=x.getBoundingClientRect();f.current=b.height,v.current=b.width,w.current||(x.style.transitionDuration=y.current.transitionDuration,x.style.animationName=y.current.animationName),l(o)}},[i.open,o]),m.jsx(O.div,{"data-state":xo(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!h,...s,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:h&&r})});function xo(e){return e?"open":"closed"}var mm=ia,ln="DropdownMenu",[Uf]=se(ln,[tn]),J=tn(),[Gf,ca]=Uf(ln),la=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:s,onOpenChange:i,modal:c=!0}=e,l=J(t),d=a.useRef(null),[u,f]=Ee({prop:r,defaultProp:s??!1,onChange:i,caller:ln});return m.jsx(Gf,{scope:t,triggerId:ae(),triggerRef:d,contentId:ae(),open:u,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(p=>!p),[f]),modal:c,children:m.jsx(pi,{...l,open:u,onOpenChange:f,dir:o,modal:c,children:n})})};la.displayName=ln;var ua="DropdownMenuTrigger",da=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,s=ca(ua,n),i=J(n);return m.jsx(mi,{asChild:!0,...i,children:m.jsx(O.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:at(t,s.triggerRef),onPointerDown:R(e.onPointerDown,c=>{!o&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:R(e.onKeyDown,c=>{o||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});da.displayName=ua;var Kf="DropdownMenuPortal",fa=e=>{const{__scopeDropdownMenu:t,...n}=e,o=J(t);return m.jsx(hi,{...o,...n})};fa.displayName=Kf;var pa="DropdownMenuContent",ma=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ca(pa,n),s=J(n),i=a.useRef(!1);return m.jsx(vi,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...o,ref:t,onCloseAutoFocus:R(e.onCloseAutoFocus,c=>{var l;i.current||(l=r.triggerRef.current)==null||l.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:R(e.onInteractOutside,c=>{const l=c.detail.originalEvent,d=l.button===0&&l.ctrlKey===!0,u=l.button===2||d;(!r.modal||u)&&(i.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)"}})});ma.displayName=pa;var zf="DropdownMenuGroup",Yf=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return m.jsx(gi,{...r,...o,ref:t})});Yf.displayName=zf;var Xf="DropdownMenuLabel",ha=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return m.jsx(wi,{...r,...o,ref:t})});ha.displayName=Xf;var qf="DropdownMenuItem",va=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return m.jsx(xi,{...r,...o,ref:t})});va.displayName=qf;var Zf="DropdownMenuCheckboxItem",ga=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return m.jsx(yi,{...r,...o,ref:t})});ga.displayName=Zf;var Qf="DropdownMenuRadioGroup",Jf=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return m.jsx(bi,{...r,...o,ref:t})});Jf.displayName=Qf;var ep="DropdownMenuRadioItem",wa=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return m.jsx(Ci,{...r,...o,ref:t})});wa.displayName=ep;var tp="DropdownMenuItemIndicator",xa=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return m.jsx(Si,{...r,...o,ref:t})});xa.displayName=tp;var np="DropdownMenuSeparator",ya=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return m.jsx(Ei,{...r,...o,ref:t})});ya.displayName=np;var op="DropdownMenuArrow",rp=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return m.jsx(Ri,{...r,...o,ref:t})});rp.displayName=op;var sp="DropdownMenuSubTrigger",ba=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return m.jsx(Pi,{...r,...o,ref:t})});ba.displayName=sp;var ip="DropdownMenuSubContent",Ca=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return m.jsx(Ti,{...r,...o,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)"}})});Ca.displayName=ip;var hm=la,vm=da,gm=fa,wm=ma,xm=ha,ym=va,bm=ga,Cm=wa,Sm=xa,Em=ya,Rm=ba,Pm=Ca,un="Tabs",[ap]=se(un,[en]),Sa=en(),[cp,yo]=ap(un),Ea=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:s,orientation:i="horizontal",dir:c,activationMode:l="automatic",...d}=e,u=ft(c),[f,p]=Ee({prop:o,onChange:r,defaultProp:s??"",caller:un});return m.jsx(cp,{scope:n,baseId:ae(),value:f,onValueChange:p,orientation:i,dir:u,activationMode:l,children:m.jsx(O.div,{dir:u,"data-orientation":i,...d,ref:t})})});Ea.displayName=un;var Ra="TabsList",Pa=a.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,s=yo(Ra,n),i=Sa(n);return m.jsx(Vs,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:o,children:m.jsx(O.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});Pa.displayName=Ra;var Ta="TabsTrigger",Ma=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...s}=e,i=yo(Ta,n),c=Sa(n),l=Ia(i.baseId,o),d=Na(i.baseId,o),u=o===i.value;return m.jsx(Us,{asChild:!0,...c,focusable:!r,active:u,children:m.jsx(O.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:t,onMouseDown:R(e.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?i.onValueChange(o):f.preventDefault()}),onKeyDown:R(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(o)}),onFocus:R(e.onFocus,()=>{const f=i.activationMode!=="manual";!u&&!r&&f&&i.onValueChange(o)})})})});Ma.displayName=Ta;var _a="TabsContent",Aa=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:s,...i}=e,c=yo(_a,n),l=Ia(c.baseId,o),d=Na(c.baseId,o),u=o===c.value,f=a.useRef(u);return a.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),m.jsx(Z,{present:r||u,children:({present:p})=>m.jsx(O.div,{"data-state":u?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&s})})});Aa.displayName=_a;function Ia(e,t){return`${e}-trigger-${t}`}function Na(e,t){return`${e}-content-${t}`}var Tm=Ea,Mm=Pa,_m=Ma,Am=Aa;function lp(e,t=[]){let n=[];function o(s,i){const c=a.createContext(i);c.displayName=s+"Context";const l=n.length;n=[...n,i];const d=f=>{var y;const{scope:p,children:v,...g}=f,h=((y=p==null?void 0:p[e])==null?void 0:y[l])||c,w=a.useMemo(()=>g,Object.values(g));return m.jsx(h.Provider,{value:w,children:v})};d.displayName=s+"Provider";function u(f,p){var h;const v=((h=p==null?void 0:p[e])==null?void 0:h[l])||c,g=a.useContext(v);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,u]}const r=()=>{const s=n.map(i=>a.createContext(i));return function(c){const l=(c==null?void 0:c[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,up(r,...t)]}function up(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=o.reduce((c,{useScope:l,scopeName:d})=>{const f=l(s)[`__scope${d}`];return{...c,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var bo="Progress",Co=100,[dp]=lp(bo),[fp,pp]=dp(bo),Oa=a.forwardRef((e,t)=>{const{__scopeProgress:n,value:o=null,max:r,getValueLabel:s=mp,...i}=e;(r||r===0)&&!qo(r)&&console.error(hp(`${r}`,"Progress"));const c=qo(r)?r:Co;o!==null&&!Zo(o,c)&&console.error(vp(`${o}`,"Progress"));const l=Zo(o,c)?o:null,d=$t(l)?s(l,c):void 0;return m.jsx(fp,{scope:n,value:l,max:c,children:m.jsx(qt.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":$t(l)?l:void 0,"aria-valuetext":d,role:"progressbar","data-state":ja(l,c),"data-value":l??void 0,"data-max":c,...i,ref:t})})});Oa.displayName=bo;var Da="ProgressIndicator",La=a.forwardRef((e,t)=>{const{__scopeProgress:n,...o}=e,r=pp(Da,n);return m.jsx(qt.div,{"data-state":ja(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...o,ref:t})});La.displayName=Da;function mp(e,t){return`${Math.round(e/t*100)}%`}function ja(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function $t(e){return typeof e=="number"}function qo(e){return $t(e)&&!isNaN(e)&&e>0}function Zo(e,t){return $t(e)&&!isNaN(e)&&e<=t&&e>=0}function hp(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Co}\`.`}function vp(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
46
+ - a positive number
47
+ - less than the value passed to \`max\` (or ${Co} if no \`max\` prop is set)
48
+ - \`null\` or \`undefined\` if the progress is indeterminate.
49
+
50
+ Defaulting to \`null\`.`}var Im=Oa,Nm=La;export{hm as $,am as A,nm as B,Cp as C,Ip as D,rm as E,om as F,Wp as G,em as H,kp as I,cm as J,lm as K,Hp as L,um as M,dm as N,Mp as O,bp as P,Ef as Q,xp as R,Sp as S,yp as T,Af as U,jp as V,fm as W,pm as X,mm as Y,Wf as Z,Hf as _,wp as a,vm as a0,gm as a1,wm as a2,ym as a3,Em as a4,Rm as a5,Pm as a6,bm as a7,Sm as a8,Cm as a9,xm as aa,Tm as ab,Mm as ac,_m as ad,Am as ae,Im as af,Nm as ag,Rp as b,Np as c,Pp as d,Tp as e,_p as f,Ap as g,Op as h,Dp as i,Lp as j,$p as k,Fp as l,Bp as m,Vp as n,Gp as o,Up as p,Kp as q,zp as r,Yp as s,qp as t,Zp as u,Qp as v,Jp as w,tm as x,sm as y,im as z};
51
+ //# sourceMappingURL=radix-ui-BZ5iKMtq.js.map