mirror of https://github.com/Mai-with-u/MaiBot.git
13 lines
43 KiB
JavaScript
13 lines
43 KiB
JavaScript
import{r as i,j as u,d as Po}from"./router-Bz250laD.js";import{c as k,a as ke,u as re,P as A,b as P,d as T,e as ne,f as G,g as F,h as V,i as Z,j as be,k as Se,l as Ve,m as Be,n as He,O as Co,o as Ro,W as Ao,C as Eo,T as yo,D as _o,p as ze,R as To,q as Do,r as Io,s as No,t as Ke,v as jo,w as Oo,x as Mo,F as Lo,y as Fo,z as $o,A as ko,B as We,E as Vo}from"./radix-core-9dEfQl-6.js";var pe="rovingFocusGroup.onEntryFocus",Bo={bubbles:!1,cancelable:!0},J="RovingFocusGroup",[ve,Ue,Ho]=ke(J),[zo,Ge]=k(J,[Ho]),[Ko,Wo]=zo(J),Ye=i.forwardRef((e,t)=>u.jsx(ve.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(ve.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Uo,{...e,ref:t})})}));Ye.displayName=J;var Uo=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:o,orientation:n,loop:r=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,v=i.useRef(null),m=T(t,v),g=ne(a),[S,h]=G({prop:s,defaultProp:c??null,onChange:l,caller:J}),[b,C]=i.useState(!1),x=F(d),w=Ue(o),D=i.useRef(!1),[j,O]=i.useState(0);return i.useEffect(()=>{const y=v.current;if(y)return y.addEventListener(pe,x),()=>y.removeEventListener(pe,x)},[x]),u.jsx(Ko,{scope:o,orientation:n,dir:g,loop:r,currentTabStopId:S,onItemFocus:i.useCallback(y=>h(y),[h]),onItemShiftTab:i.useCallback(()=>C(!0),[]),onFocusableItemAdd:i.useCallback(()=>O(y=>y+1),[]),onFocusableItemRemove:i.useCallback(()=>O(y=>y-1),[]),children:u.jsx(A.div,{tabIndex:b||j===0?-1:0,"data-orientation":n,...p,ref:m,style:{outline:"none",...e.style},onMouseDown:P(e.onMouseDown,()=>{D.current=!0}),onFocus:P(e.onFocus,y=>{const E=!D.current;if(y.target===y.currentTarget&&E&&!b){const _=new CustomEvent(pe,Bo);if(y.currentTarget.dispatchEvent(_),!_.defaultPrevented){const R=w().filter(I=>I.focusable),M=R.find(I=>I.active),X=R.find(I=>I.id===S),q=[M,X,...R].filter(Boolean).map(I=>I.ref.current);Ze(q,f)}}D.current=!1}),onBlur:P(e.onBlur,()=>C(!1))})})}),Xe="RovingFocusGroupItem",qe=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:o,focusable:n=!0,active:r=!1,tabStopId:a,children:s,...c}=e,l=re(),d=a||l,f=Wo(Xe,o),p=f.currentTabStopId===d,v=Ue(o),{onFocusableItemAdd:m,onFocusableItemRemove:g,currentTabStopId:S}=f;return i.useEffect(()=>{if(n)return m(),()=>g()},[n,m,g]),u.jsx(ve.ItemSlot,{scope:o,id:d,focusable:n,active:r,children:u.jsx(A.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:P(e.onMouseDown,h=>{n?f.onItemFocus(d):h.preventDefault()}),onFocus:P(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:P(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){f.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const b=Xo(h,f.orientation,f.dir);if(b!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let x=v().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const w=x.indexOf(h.currentTarget);x=f.loop?qo(x,w+1):x.slice(w+1)}setTimeout(()=>Ze(x))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:S!=null}):s})})});qe.displayName=Xe;var Go={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Yo(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Xo(e,t,o){const n=Yo(e.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Go[n]}function Ze(e,t=!1){const o=document.activeElement;for(const n of e)if(n===o||(n.focus({preventScroll:t}),document.activeElement!==o))return}function qo(e,t){return e.map((o,n)=>e[(t+n)%e.length])}var Zo=Ye,Jo=qe,ae="Tabs",[Qo]=k(ae,[Ge]),Je=Ge(),[er,xe]=Qo(ae),Qe=i.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,onValueChange:r,defaultValue:a,orientation:s="horizontal",dir:c,activationMode:l="automatic",...d}=e,f=ne(c),[p,v]=G({prop:n,onChange:r,defaultProp:a??"",caller:ae});return u.jsx(er,{scope:o,baseId:re(),value:p,onValueChange:v,orientation:s,dir:f,activationMode:l,children:u.jsx(A.div,{dir:f,"data-orientation":s,...d,ref:t})})});Qe.displayName=ae;var et="TabsList",tt=i.forwardRef((e,t)=>{const{__scopeTabs:o,loop:n=!0,...r}=e,a=xe(et,o),s=Je(o);return u.jsx(Zo,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:n,children:u.jsx(A.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:t})})});tt.displayName=et;var ot="TabsTrigger",rt=i.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,disabled:r=!1,...a}=e,s=xe(ot,o),c=Je(o),l=st(s.baseId,n),d=it(s.baseId,n),f=n===s.value;return u.jsx(Jo,{asChild:!0,...c,focusable:!r,active:f,children:u.jsx(A.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...a,ref:t,onMouseDown:P(e.onMouseDown,p=>{!r&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:P(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:P(e.onFocus,()=>{const p=s.activationMode!=="manual";!f&&!r&&p&&s.onValueChange(n)})})})});rt.displayName=ot;var nt="TabsContent",at=i.forwardRef((e,t)=>{const{__scopeTabs:o,value:n,forceMount:r,children:a,...s}=e,c=xe(nt,o),l=st(c.baseId,n),d=it(c.baseId,n),f=n===c.value,p=i.useRef(f);return i.useEffect(()=>{const v=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(v)},[]),u.jsx(V,{present:r||f,children:({present:v})=>u.jsx(A.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!v,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:v&&a})})});at.displayName=nt;function st(e,t){return`${e}-trigger-${t}`}function it(e,t){return`${e}-content-${t}`}var Fn=Qe,$n=tt,kn=rt,Vn=at;function tr(e,t){return i.useReducer((o,n)=>t[o][n]??o,e)}var we="ScrollArea",[ct]=k(we),[or,N]=ct(we),lt=i.forwardRef((e,t)=>{const{__scopeScrollArea:o,type:n="hover",dir:r,scrollHideDelay:a=600,...s}=e,[c,l]=i.useState(null),[d,f]=i.useState(null),[p,v]=i.useState(null),[m,g]=i.useState(null),[S,h]=i.useState(null),[b,C]=i.useState(0),[x,w]=i.useState(0),[D,j]=i.useState(!1),[O,y]=i.useState(!1),E=T(t,R=>l(R)),_=ne(r);return u.jsx(or,{scope:o,type:n,dir:_,scrollHideDelay:a,scrollArea:c,viewport:d,onViewportChange:f,content:p,onContentChange:v,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:D,onScrollbarXEnabledChange:j,scrollbarY:S,onScrollbarYChange:h,scrollbarYEnabled:O,onScrollbarYEnabledChange:y,onCornerWidthChange:C,onCornerHeightChange:w,children:u.jsx(A.div,{dir:_,...s,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});lt.displayName=we;var ut="ScrollAreaViewport",dt=i.forwardRef((e,t)=>{const{__scopeScrollArea:o,children:n,nonce:r,...a}=e,s=N(ut,o),c=i.useRef(null),l=T(t,c,s.onViewportChange);return u.jsxs(u.Fragment,{children:[u.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}),u.jsx(A.div,{"data-radix-scroll-area-viewport":"",...a,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});dt.displayName=ut;var L="ScrollAreaScrollbar",rr=i.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=N(L,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:s}=r,c=e.orientation==="horizontal";return i.useEffect(()=>(c?a(!0):s(!0),()=>{c?a(!1):s(!1)}),[c,a,s]),r.type==="hover"?u.jsx(nr,{...n,ref:t,forceMount:o}):r.type==="scroll"?u.jsx(ar,{...n,ref:t,forceMount:o}):r.type==="auto"?u.jsx(ft,{...n,ref:t,forceMount:o}):r.type==="always"?u.jsx(Pe,{...n,ref:t}):null});rr.displayName=L;var nr=i.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=N(L,e.__scopeScrollArea),[a,s]=i.useState(!1);return i.useEffect(()=>{const c=r.scrollArea;let l=0;if(c){const d=()=>{window.clearTimeout(l),s(!0)},f=()=>{l=window.setTimeout(()=>s(!1),r.scrollHideDelay)};return c.addEventListener("pointerenter",d),c.addEventListener("pointerleave",f),()=>{window.clearTimeout(l),c.removeEventListener("pointerenter",d),c.removeEventListener("pointerleave",f)}}},[r.scrollArea,r.scrollHideDelay]),u.jsx(V,{present:o||a,children:u.jsx(ft,{"data-state":a?"visible":"hidden",...n,ref:t})})}),ar=i.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=N(L,e.__scopeScrollArea),a=e.orientation==="horizontal",s=ie(()=>l("SCROLL_END"),100),[c,l]=tr("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 i.useEffect(()=>{if(c==="idle"){const d=window.setTimeout(()=>l("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(d)}},[c,r.scrollHideDelay,l]),i.useEffect(()=>{const d=r.viewport,f=a?"scrollLeft":"scrollTop";if(d){let p=d[f];const v=()=>{const m=d[f];p!==m&&(l("SCROLL"),s()),p=m};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[r.viewport,a,l,s]),u.jsx(V,{present:o||c!=="hidden",children:u.jsx(Pe,{"data-state":c==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:P(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:P(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),ft=i.forwardRef((e,t)=>{const o=N(L,e.__scopeScrollArea),{forceMount:n,...r}=e,[a,s]=i.useState(!1),c=e.orientation==="horizontal",l=ie(()=>{if(o.viewport){const d=o.viewport.offsetWidth<o.viewport.scrollWidth,f=o.viewport.offsetHeight<o.viewport.scrollHeight;s(c?d:f)}},10);return W(o.viewport,l),W(o.content,l),u.jsx(V,{present:n||a,children:u.jsx(Pe,{"data-state":a?"visible":"hidden",...r,ref:t})})}),Pe=i.forwardRef((e,t)=>{const{orientation:o="vertical",...n}=e,r=N(L,e.__scopeScrollArea),a=i.useRef(null),s=i.useRef(0),[c,l]=i.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=ht(c.viewport,c.content),f={...n,sizes:c,onSizesChange:l,hasThumb:d>0&&d<1,onThumbChange:v=>a.current=v,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:v=>s.current=v};function p(v,m){return fr(v,s.current,c,m)}return o==="horizontal"?u.jsx(sr,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&a.current){const v=r.viewport.scrollLeft,m=Oe(v,c,r.dir);a.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollLeft=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollLeft=p(v,r.dir))}}):o==="vertical"?u.jsx(ir,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&a.current){const v=r.viewport.scrollTop,m=Oe(v,c);a.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollTop=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollTop=p(v))}}):null}),sr=i.forwardRef((e,t)=>{const{sizes:o,onSizesChange:n,...r}=e,a=N(L,e.__scopeScrollArea),[s,c]=i.useState(),l=i.useRef(null),d=T(t,l,a.onScrollbarXChange);return i.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),u.jsx(vt,{"data-orientation":"horizontal",...r,ref:d,sizes:o,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":se(o)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,p)=>{if(a.viewport){const v=a.viewport.scrollLeft+f.deltaX;e.onWheelScroll(v),bt(v,p)&&f.preventDefault()}},onResize:()=>{l.current&&a.viewport&&s&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:te(s.paddingLeft),paddingEnd:te(s.paddingRight)}})}})}),ir=i.forwardRef((e,t)=>{const{sizes:o,onSizesChange:n,...r}=e,a=N(L,e.__scopeScrollArea),[s,c]=i.useState(),l=i.useRef(null),d=T(t,l,a.onScrollbarYChange);return i.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),u.jsx(vt,{"data-orientation":"vertical",...r,ref:d,sizes:o,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":se(o)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,p)=>{if(a.viewport){const v=a.viewport.scrollTop+f.deltaY;e.onWheelScroll(v),bt(v,p)&&f.preventDefault()}},onResize:()=>{l.current&&a.viewport&&s&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:te(s.paddingTop),paddingEnd:te(s.paddingBottom)}})}})}),[cr,pt]=ct(L),vt=i.forwardRef((e,t)=>{const{__scopeScrollArea:o,sizes:n,hasThumb:r,onThumbChange:a,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:d,onWheelScroll:f,onResize:p,...v}=e,m=N(L,o),[g,S]=i.useState(null),h=T(t,E=>S(E)),b=i.useRef(null),C=i.useRef(""),x=m.viewport,w=n.content-n.viewport,D=F(f),j=F(l),O=ie(p,10);function y(E){if(b.current){const _=E.clientX-b.current.left,R=E.clientY-b.current.top;d({x:_,y:R})}}return i.useEffect(()=>{const E=_=>{const R=_.target;g?.contains(R)&&D(_,w)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[x,g,w,D]),i.useEffect(j,[n,j]),W(g,O),W(m.content,O),u.jsx(cr,{scope:o,scrollbar:g,hasThumb:r,onThumbChange:F(a),onThumbPointerUp:F(s),onThumbPositionChange:j,onThumbPointerDown:F(c),children:u.jsx(A.div,{...v,ref:h,style:{position:"absolute",...v.style},onPointerDown:P(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),b.current=g.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),y(E))}),onPointerMove:P(e.onPointerMove,y),onPointerUp:P(e.onPointerUp,E=>{const _=E.target;_.hasPointerCapture(E.pointerId)&&_.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=C.current,m.viewport&&(m.viewport.style.scrollBehavior=""),b.current=null})})})}),ee="ScrollAreaThumb",lr=i.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=pt(ee,e.__scopeScrollArea);return u.jsx(V,{present:o||r.hasThumb,children:u.jsx(ur,{ref:t,...n})})}),ur=i.forwardRef((e,t)=>{const{__scopeScrollArea:o,style:n,...r}=e,a=N(ee,o),s=pt(ee,o),{onThumbPositionChange:c}=s,l=T(t,p=>s.onThumbChange(p)),d=i.useRef(void 0),f=ie(()=>{d.current&&(d.current(),d.current=void 0)},100);return i.useEffect(()=>{const p=a.viewport;if(p){const v=()=>{if(f(),!d.current){const m=pr(p,c);d.current=m,c()}};return c(),p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[a.viewport,f,c]),u.jsx(A.div,{"data-state":s.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:P(e.onPointerDownCapture,p=>{const m=p.target.getBoundingClientRect(),g=p.clientX-m.left,S=p.clientY-m.top;s.onThumbPointerDown({x:g,y:S})}),onPointerUp:P(e.onPointerUp,s.onThumbPointerUp)})});lr.displayName=ee;var Ce="ScrollAreaCorner",mt=i.forwardRef((e,t)=>{const o=N(Ce,e.__scopeScrollArea),n=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&n?u.jsx(dr,{...e,ref:t}):null});mt.displayName=Ce;var dr=i.forwardRef((e,t)=>{const{__scopeScrollArea:o,...n}=e,r=N(Ce,o),[a,s]=i.useState(0),[c,l]=i.useState(0),d=!!(a&&c);return W(r.scrollbarX,()=>{const f=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(f),l(f)}),W(r.scrollbarY,()=>{const f=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(f),s(f)}),d?u.jsx(A.div,{...n,ref:t,style:{width:a,height:c,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function te(e){return e?parseInt(e,10):0}function ht(e,t){const o=e/t;return isNaN(o)?0:o}function se(e){const t=ht(e.viewport,e.content),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-o)*t;return Math.max(n,18)}function fr(e,t,o,n="ltr"){const r=se(o),a=r/2,s=t||a,c=r-s,l=o.scrollbar.paddingStart+s,d=o.scrollbar.size-o.scrollbar.paddingEnd-c,f=o.content-o.viewport,p=n==="ltr"?[0,f]:[f*-1,0];return gt([l,d],p)(e)}function Oe(e,t,o="ltr"){const n=se(t),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-r,s=t.content-t.viewport,c=a-n,l=o==="ltr"?[0,s]:[s*-1,0],d=be(e,l);return gt([0,s],[0,c])(d)}function gt(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function bt(e,t){return e>0&&e<t}var pr=(e,t=()=>{})=>{let o={left:e.scrollLeft,top:e.scrollTop},n=0;return(function r(){const a={left:e.scrollLeft,top:e.scrollTop},s=o.left!==a.left,c=o.top!==a.top;(s||c)&&t(),o=a,n=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(n)};function ie(e,t){const o=F(e),n=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(n.current),[]),i.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(o,t)},[o,t])}function W(e,t){const o=F(t);Z(()=>{let n=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(o)});return r.observe(e),()=>{window.cancelAnimationFrame(n),r.unobserve(e)}}},[e,o])}var Bn=lt,Hn=dt,zn=mt;function vr(e,t=[]){let o=[];function n(a,s){const c=i.createContext(s);c.displayName=a+"Context";const l=o.length;o=[...o,s];const d=p=>{const{scope:v,children:m,...g}=p,S=v?.[e]?.[l]||c,h=i.useMemo(()=>g,Object.values(g));return u.jsx(S.Provider,{value:h,children:m})};d.displayName=a+"Provider";function f(p,v){const m=v?.[e]?.[l]||c,g=i.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[d,f]}const r=()=>{const a=o.map(s=>i.createContext(s));return function(c){const l=c?.[e]||a;return i.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[n,mr(r,...t)]}function mr(...e){const t=e[0];if(e.length===1)return t;const o=()=>{const n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const s=n.reduce((c,{useScope:l,scopeName:d})=>{const p=l(a)[`__scope${d}`];return{...c,...p}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return o.scopeName=t.scopeName,o}var hr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],St=hr.reduce((e,t)=>{const o=Se(`Primitive.${t}`),n=i.forwardRef((r,a)=>{const{asChild:s,...c}=r,l=s?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...c,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Re="Progress",Ae=100,[gr]=vr(Re),[br,Sr]=gr(Re),xt=i.forwardRef((e,t)=>{const{__scopeProgress:o,value:n=null,max:r,getValueLabel:a=xr,...s}=e;(r||r===0)&&!Me(r)&&console.error(wr(`${r}`,"Progress"));const c=Me(r)?r:Ae;n!==null&&!Le(n,c)&&console.error(Pr(`${n}`,"Progress"));const l=Le(n,c)?n:null,d=oe(l)?a(l,c):void 0;return u.jsx(br,{scope:o,value:l,max:c,children:u.jsx(St.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":oe(l)?l:void 0,"aria-valuetext":d,role:"progressbar","data-state":Ct(l,c),"data-value":l??void 0,"data-max":c,...s,ref:t})})});xt.displayName=Re;var wt="ProgressIndicator",Pt=i.forwardRef((e,t)=>{const{__scopeProgress:o,...n}=e,r=Sr(wt,o);return u.jsx(St.div,{"data-state":Ct(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...n,ref:t})});Pt.displayName=wt;function xr(e,t){return`${Math.round(e/t*100)}%`}function Ct(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function oe(e){return typeof e=="number"}function Me(e){return oe(e)&&!isNaN(e)&&e>0}function Le(e,t){return oe(e)&&!isNaN(e)&&e<=t&&e>=0}function wr(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ae}\`.`}function Pr(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
- a positive number
|
|
- less than the value passed to \`max\` (or ${Ae} if no \`max\` prop is set)
|
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
|
|
Defaulting to \`null\`.`}var Kn=xt,Wn=Pt,ce="Switch",[Cr]=k(ce),[Rr,Ar]=Cr(ce),Rt=i.forwardRef((e,t)=>{const{__scopeSwitch:o,name:n,checked:r,defaultChecked:a,required:s,disabled:c,value:l="on",onCheckedChange:d,form:f,...p}=e,[v,m]=i.useState(null),g=T(t,x=>m(x)),S=i.useRef(!1),h=v?f||!!v.closest("form"):!0,[b,C]=G({prop:r,defaultProp:a??!1,onChange:d,caller:ce});return u.jsxs(Rr,{scope:o,checked:b,disabled:c,children:[u.jsx(A.button,{type:"button",role:"switch","aria-checked":b,"aria-required":s,"data-state":_t(b),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:g,onClick:P(e.onClick,x=>{C(w=>!w),h&&(S.current=x.isPropagationStopped(),S.current||x.stopPropagation())})}),h&&u.jsx(yt,{control:v,bubbles:!S.current,name:n,value:l,checked:b,required:s,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});Rt.displayName=ce;var At="SwitchThumb",Et=i.forwardRef((e,t)=>{const{__scopeSwitch:o,...n}=e,r=Ar(At,o);return u.jsx(A.span,{"data-state":_t(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:t})});Et.displayName=At;var Er="SwitchBubbleInput",yt=i.forwardRef(({__scopeSwitch:e,control:t,checked:o,bubbles:n=!0,...r},a)=>{const s=i.useRef(null),c=T(s,a),l=Ve(o),d=Be(t);return i.useEffect(()=>{const f=s.current;if(!f)return;const p=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(p,"checked").set;if(l!==o&&m){const g=new Event("click",{bubbles:n});m.call(f,o),f.dispatchEvent(g)}},[l,o,n]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...r,tabIndex:-1,ref:c,style:{...r.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});yt.displayName=Er;function _t(e){return e?"checked":"unchecked"}var Un=Rt,Gn=Et,Tt=["PageUp","PageDown"],Dt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],It={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Y="Slider",[me,yr,_r]=ke(Y),[Nt]=k(Y,[_r]),[Tr,le]=Nt(Y),jt=i.forwardRef((e,t)=>{const{name:o,min:n=0,max:r=100,step:a=1,orientation:s="horizontal",disabled:c=!1,minStepsBetweenThumbs:l=0,defaultValue:d=[n],value:f,onValueChange:p=()=>{},onValueCommit:v=()=>{},inverted:m=!1,form:g,...S}=e,h=i.useRef(new Set),b=i.useRef(0),x=s==="horizontal"?Dr:Ir,[w=[],D]=G({prop:f,defaultProp:d,onChange:R=>{[...h.current][b.current]?.focus(),p(R)}}),j=i.useRef(w);function O(R){const M=Lr(w,R);_(R,M)}function y(R){_(R,b.current)}function E(){const R=j.current[b.current];w[b.current]!==R&&v(w)}function _(R,M,{commit:X}={commit:!1}){const fe=Vr(a),q=Br(Math.round((R-n)/a)*a+n,fe),I=be(q,[n,r]);D((z=[])=>{const H=Or(z,I,M);if(kr(H,l*a)){b.current=H.indexOf(I);const je=String(H)!==String(z);return je&&X&&v(H),je?H:z}else return z})}return u.jsx(Tr,{scope:e.__scopeSlider,name:o,disabled:c,min:n,max:r,valueIndexToChangeRef:b,thumbs:h.current,values:w,orientation:s,form:g,children:u.jsx(me.Provider,{scope:e.__scopeSlider,children:u.jsx(me.Slot,{scope:e.__scopeSlider,children:u.jsx(x,{"aria-disabled":c,"data-disabled":c?"":void 0,...S,ref:t,onPointerDown:P(S.onPointerDown,()=>{c||(j.current=w)}),min:n,max:r,inverted:m,onSlideStart:c?void 0:O,onSlideMove:c?void 0:y,onSlideEnd:c?void 0:E,onHomeKeyDown:()=>!c&&_(n,0,{commit:!0}),onEndKeyDown:()=>!c&&_(r,w.length-1,{commit:!0}),onStepKeyDown:({event:R,direction:M})=>{if(!c){const q=Tt.includes(R.key)||R.shiftKey&&Dt.includes(R.key)?10:1,I=b.current,z=w[I],H=a*q*M;_(z+H,I,{commit:!0})}}})})})})});jt.displayName=Y;var[Ot,Mt]=Nt(Y,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Dr=i.forwardRef((e,t)=>{const{min:o,max:n,dir:r,inverted:a,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:d,...f}=e,[p,v]=i.useState(null),m=T(t,x=>v(x)),g=i.useRef(void 0),S=ne(r),h=S==="ltr",b=h&&!a||!h&&a;function C(x){const w=g.current||p.getBoundingClientRect(),D=[0,w.width],O=Ee(D,b?[o,n]:[n,o]);return g.current=w,O(x-w.left)}return u.jsx(Ot,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:u.jsx(Lt,{dir:S,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const w=C(x.clientX);s?.(w)},onSlideMove:x=>{const w=C(x.clientX);c?.(w)},onSlideEnd:()=>{g.current=void 0,l?.()},onStepKeyDown:x=>{const D=It[b?"from-left":"from-right"].includes(x.key);d?.({event:x,direction:D?-1:1})}})})}),Ir=i.forwardRef((e,t)=>{const{min:o,max:n,inverted:r,onSlideStart:a,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...d}=e,f=i.useRef(null),p=T(t,f),v=i.useRef(void 0),m=!r;function g(S){const h=v.current||f.current.getBoundingClientRect(),b=[0,h.height],x=Ee(b,m?[n,o]:[o,n]);return v.current=h,x(S-h.top)}return u.jsx(Ot,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:u.jsx(Lt,{"data-orientation":"vertical",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const h=g(S.clientY);a?.(h)},onSlideMove:S=>{const h=g(S.clientY);s?.(h)},onSlideEnd:()=>{v.current=void 0,c?.()},onStepKeyDown:S=>{const b=It[m?"from-bottom":"from-top"].includes(S.key);l?.({event:S,direction:b?-1:1})}})})}),Lt=i.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:r,onSlideEnd:a,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...d}=e,f=le(Y,o);return u.jsx(A.span,{...d,ref:t,onKeyDown:P(e.onKeyDown,p=>{p.key==="Home"?(s(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):Tt.concat(Dt).includes(p.key)&&(l(p),p.preventDefault())}),onPointerDown:P(e.onPointerDown,p=>{const v=p.target;v.setPointerCapture(p.pointerId),p.preventDefault(),f.thumbs.has(v)?v.focus():n(p)}),onPointerMove:P(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&r(p)}),onPointerUp:P(e.onPointerUp,p=>{const v=p.target;v.hasPointerCapture(p.pointerId)&&(v.releasePointerCapture(p.pointerId),a(p))})})}),Ft="SliderTrack",$t=i.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,r=le(Ft,o);return u.jsx(A.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...n,ref:t})});$t.displayName=Ft;var he="SliderRange",kt=i.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,r=le(he,o),a=Mt(he,o),s=i.useRef(null),c=T(t,s),l=r.values.length,d=r.values.map(v=>Ht(v,r.min,r.max)),f=l>1?Math.min(...d):0,p=100-Math.max(...d);return u.jsx(A.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...n,ref:c,style:{...e.style,[a.startEdge]:f+"%",[a.endEdge]:p+"%"}})});kt.displayName=he;var ge="SliderThumb",Vt=i.forwardRef((e,t)=>{const o=yr(e.__scopeSlider),[n,r]=i.useState(null),a=T(t,c=>r(c)),s=i.useMemo(()=>n?o().findIndex(c=>c.ref.current===n):-1,[o,n]);return u.jsx(Nr,{...e,ref:a,index:s})}),Nr=i.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:r,...a}=e,s=le(ge,o),c=Mt(ge,o),[l,d]=i.useState(null),f=T(t,C=>d(C)),p=l?s.form||!!l.closest("form"):!0,v=Be(l),m=s.values[n],g=m===void 0?0:Ht(m,s.min,s.max),S=Mr(n,s.values.length),h=v?.[c.size],b=h?Fr(h,g,c.direction):0;return i.useEffect(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]),u.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${g}% + ${b}px)`},children:[u.jsx(me.ItemSlot,{scope:e.__scopeSlider,children:u.jsx(A.span,{role:"slider","aria-label":e["aria-label"]||S,"aria-valuemin":s.min,"aria-valuenow":m,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...a,ref:f,style:m===void 0?{display:"none"}:e.style,onFocus:P(e.onFocus,()=>{s.valueIndexToChangeRef.current=n})})}),p&&u.jsx(Bt,{name:r??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:m},n)]})});Vt.displayName=ge;var jr="RadioBubbleInput",Bt=i.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const r=i.useRef(null),a=T(r,n),s=Ve(t);return i.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&f){const p=new Event("input",{bubbles:!0});f.call(c,t),c.dispatchEvent(p)}},[s,t]),u.jsx(A.input,{style:{display:"none"},...o,ref:a,defaultValue:t})});Bt.displayName=jr;function Or(e=[],t,o){const n=[...e];return n[o]=t,n.sort((r,a)=>r-a)}function Ht(e,t,o){const a=100/(o-t)*(e-t);return be(a,[0,100])}function Mr(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Lr(e,t){if(e.length===1)return 0;const o=e.map(r=>Math.abs(r-t)),n=Math.min(...o);return o.indexOf(n)}function Fr(e,t,o){const n=e/2,a=Ee([0,50],[0,n]);return(n-a(t)*o)*o}function $r(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function kr(e,t){if(t>0){const o=$r(e);return Math.min(...o)>=t}return!0}function Ee(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function Vr(e){return(String(e).split(".")[1]||"").length}function Br(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Yn=jt,Xn=$t,qn=kt,Zn=Vt,Hr=Symbol("radix.slottable");function zr(e){const t=({children:o})=>u.jsx(u.Fragment,{children:o});return t.displayName=`${e}.Slottable`,t.__radixId=Hr,t}var zt="AlertDialog",[Kr]=k(zt,[He]),$=He(),Kt=e=>{const{__scopeAlertDialog:t,...o}=e,n=$(t);return u.jsx(To,{...n,...o,modal:!0})};Kt.displayName=zt;var Wr="AlertDialogTrigger",Wt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=$(o);return u.jsx(Do,{...r,...n,ref:t})});Wt.displayName=Wr;var Ur="AlertDialogPortal",Ut=e=>{const{__scopeAlertDialog:t,...o}=e,n=$(t);return u.jsx(Ro,{...n,...o})};Ut.displayName=Ur;var Gr="AlertDialogOverlay",Gt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=$(o);return u.jsx(Co,{...r,...n,ref:t})});Gt.displayName=Gr;var K="AlertDialogContent",[Yr,Xr]=Kr(K),qr=zr("AlertDialogContent"),Yt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,children:n,...r}=e,a=$(o),s=i.useRef(null),c=T(t,s),l=i.useRef(null);return u.jsx(Ao,{contentName:K,titleName:Xt,docsSlug:"alert-dialog",children:u.jsx(Yr,{scope:o,cancelRef:l,children:u.jsxs(Eo,{role:"alertdialog",...a,...r,ref:c,onOpenAutoFocus:P(r.onOpenAutoFocus,d=>{d.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[u.jsx(qr,{children:n}),u.jsx(Jr,{contentRef:s})]})})})});Yt.displayName=K;var Xt="AlertDialogTitle",qt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=$(o);return u.jsx(yo,{...r,...n,ref:t})});qt.displayName=Xt;var Zt="AlertDialogDescription",Jt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=$(o);return u.jsx(_o,{...r,...n,ref:t})});Jt.displayName=Zt;var Zr="AlertDialogAction",Qt=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,r=$(o);return u.jsx(ze,{...r,...n,ref:t})});Qt.displayName=Zr;var eo="AlertDialogCancel",to=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,{cancelRef:r}=Xr(eo,o),a=$(o),s=T(t,r);return u.jsx(ze,{...a,...n,ref:s})});to.displayName=eo;var Jr=({contentRef:e})=>{const t=`\`${K}\` requires a description for the component to be accessible for screen reader users.
|
|
|
|
You can add a description to the \`${K}\` by passing a \`${Zt}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
|
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${K}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
|
|
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return i.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Jn=Kt,Qn=Wt,ea=Ut,ta=Gt,oa=Yt,ra=Qt,na=to,aa=qt,sa=Jt,Qr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],en=Qr.reduce((e,t)=>{const o=Se(`Primitive.${t}`),n=i.forwardRef((r,a)=>{const{asChild:s,...c}=r,l=s?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...c,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),tn="Separator",Fe="horizontal",on=["horizontal","vertical"],oo=i.forwardRef((e,t)=>{const{decorative:o,orientation:n=Fe,...r}=e,a=rn(n)?n:Fe,c=o?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return u.jsx(en.div,{"data-orientation":a,...c,...r,ref:t})});oo.displayName=tn;function rn(e){return on.includes(e)}var ia=oo;function nn(e){const t=an(e),o=i.forwardRef((n,r)=>{const{children:a,...s}=n,c=i.Children.toArray(a),l=c.find(cn);if(l){const d=l.props.children,f=c.map(p=>p===l?i.Children.count(d)>1?i.Children.only(null):i.isValidElement(d)?d.props.children:null:p);return u.jsx(t,{...s,ref:r,children:i.isValidElement(d)?i.cloneElement(d,void 0,f):null})}return u.jsx(t,{...s,ref:r,children:a})});return o.displayName=`${e}.Slot`,o}function an(e){const t=i.forwardRef((o,n)=>{const{children:r,...a}=o;if(i.isValidElement(r)){const s=un(r),c=ln(a,r.props);return r.type!==i.Fragment&&(c.ref=n?Io(n,s):s),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sn=Symbol("radix.slottable");function cn(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sn}function ln(e,t){const o={...t};for(const n in t){const r=e[n],a=t[n];/^on[A-Z]/.test(n)?r&&a?o[n]=(...c)=>{const l=a(...c);return r(...c),l}:r&&(o[n]=r):n==="style"?o[n]={...r,...a}:n==="className"&&(o[n]=[r,a].filter(Boolean).join(" "))}return{...e,...o}}function un(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var ue="Popover",[ro]=k(ue,[Ke]),Q=Ke(),[dn,B]=ro(ue),no=e=>{const{__scopePopover:t,children:o,open:n,defaultOpen:r,onOpenChange:a,modal:s=!1}=e,c=Q(t),l=i.useRef(null),[d,f]=i.useState(!1),[p,v]=G({prop:n,defaultProp:r??!1,onChange:a,caller:ue});return u.jsx(ko,{...c,children:u.jsx(dn,{scope:t,contentId:re(),triggerRef:l,open:p,onOpenChange:v,onOpenToggle:i.useCallback(()=>v(m=>!m),[v]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>f(!0),[]),onCustomAnchorRemove:i.useCallback(()=>f(!1),[]),modal:s,children:o})})};no.displayName=ue;var ao="PopoverAnchor",fn=i.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=B(ao,o),a=Q(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:c}=r;return i.useEffect(()=>(s(),()=>c()),[s,c]),u.jsx(We,{...a,...n,ref:t})});fn.displayName=ao;var so="PopoverTrigger",io=i.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=B(so,o),a=Q(o),s=T(t,r.triggerRef),c=u.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":po(r.open),...n,ref:s,onClick:P(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?c:u.jsx(We,{asChild:!0,...a,children:c})});io.displayName=so;var ye="PopoverPortal",[pn,vn]=ro(ye,{forceMount:void 0}),co=e=>{const{__scopePopover:t,forceMount:o,children:n,container:r}=e,a=B(ye,t);return u.jsx(pn,{scope:t,forceMount:o,children:u.jsx(V,{present:o||a.open,children:u.jsx(No,{asChild:!0,container:r,children:n})})})};co.displayName=ye;var U="PopoverContent",lo=i.forwardRef((e,t)=>{const o=vn(U,e.__scopePopover),{forceMount:n=o.forceMount,...r}=e,a=B(U,e.__scopePopover);return u.jsx(V,{present:n||a.open,children:a.modal?u.jsx(hn,{...r,ref:t}):u.jsx(gn,{...r,ref:t})})});lo.displayName=U;var mn=nn("PopoverContent.RemoveScroll"),hn=i.forwardRef((e,t)=>{const o=B(U,e.__scopePopover),n=i.useRef(null),r=T(t,n),a=i.useRef(!1);return i.useEffect(()=>{const s=n.current;if(s)return jo(s)},[]),u.jsx(Oo,{as:mn,allowPinchZoom:!0,children:u.jsx(uo,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,d=c.button===2||l;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),gn=i.forwardRef((e,t)=>{const o=B(U,e.__scopePopover),n=i.useRef(!1),r=i.useRef(!1);return u.jsx(uo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||o.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),uo=i.forwardRef((e,t)=>{const{__scopePopover:o,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:f,...p}=e,v=B(U,o),m=Q(o);return Mo(),u.jsx(Lo,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:a,children:u.jsx(Fo,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:u.jsx($o,{"data-state":po(v.open),role:"dialog",id:v.contentId,...m,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),fo="PopoverClose",bn=i.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=B(fo,o);return u.jsx(A.button,{type:"button",...n,ref:t,onClick:P(e.onClick,()=>r.onOpenChange(!1))})});bn.displayName=fo;var Sn="PopoverArrow",xn=i.forwardRef((e,t)=>{const{__scopePopover:o,...n}=e,r=Q(o);return u.jsx(Vo,{...r,...n,ref:t})});xn.displayName=Sn;function po(e){return e?"open":"closed"}var ca=no,la=io,ua=co,da=lo,de="Collapsible",[wn]=k(de),[Pn,_e]=wn(de),vo=i.forwardRef((e,t)=>{const{__scopeCollapsible:o,open:n,defaultOpen:r,disabled:a,onOpenChange:s,...c}=e,[l,d]=G({prop:n,defaultProp:r??!1,onChange:s,caller:de});return u.jsx(Pn,{scope:o,disabled:a,contentId:re(),open:l,onOpenToggle:i.useCallback(()=>d(f=>!f),[d]),children:u.jsx(A.div,{"data-state":De(l),"data-disabled":a?"":void 0,...c,ref:t})})});vo.displayName=de;var mo="CollapsibleTrigger",Cn=i.forwardRef((e,t)=>{const{__scopeCollapsible:o,...n}=e,r=_e(mo,o);return u.jsx(A.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":De(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...n,ref:t,onClick:P(e.onClick,r.onOpenToggle)})});Cn.displayName=mo;var Te="CollapsibleContent",Rn=i.forwardRef((e,t)=>{const{forceMount:o,...n}=e,r=_e(Te,e.__scopeCollapsible);return u.jsx(V,{present:o||r.open,children:({present:a})=>u.jsx(An,{...n,ref:t,present:a})})});Rn.displayName=Te;var An=i.forwardRef((e,t)=>{const{__scopeCollapsible:o,present:n,children:r,...a}=e,s=_e(Te,o),[c,l]=i.useState(n),d=i.useRef(null),f=T(t,d),p=i.useRef(0),v=p.current,m=i.useRef(0),g=m.current,S=s.open||c,h=i.useRef(S),b=i.useRef(void 0);return i.useEffect(()=>{const C=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(C)},[]),Z(()=>{const C=d.current;if(C){b.current=b.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const x=C.getBoundingClientRect();p.current=x.height,m.current=x.width,h.current||(C.style.transitionDuration=b.current.transitionDuration,C.style.animationName=b.current.animationName),l(n)}},[s.open,n]),u.jsx(A.div,{"data-state":De(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!S,...a,ref:f,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:S&&r})});function De(e){return e?"open":"closed"}var fa=vo;function En(e,t=[]){let o=[];function n(a,s){const c=i.createContext(s);c.displayName=a+"Context";const l=o.length;o=[...o,s];const d=p=>{const{scope:v,children:m,...g}=p,S=v?.[e]?.[l]||c,h=i.useMemo(()=>g,Object.values(g));return u.jsx(S.Provider,{value:h,children:m})};d.displayName=a+"Provider";function f(p,v){const m=v?.[e]?.[l]||c,g=i.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[d,f]}const r=()=>{const a=o.map(s=>i.createContext(s));return function(c){const l=c?.[e]||a;return i.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[n,yn(r,...t)]}function yn(...e){const t=e[0];if(e.length===1)return t;const o=()=>{const n=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const s=n.reduce((c,{useScope:l,scopeName:d})=>{const p=l(a)[`__scope${d}`];return{...c,...p}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return o.scopeName=t.scopeName,o}var _n=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ie=_n.reduce((e,t)=>{const o=Se(`Primitive.${t}`),n=i.forwardRef((r,a)=>{const{asChild:s,...c}=r,l=s?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...c,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Tn=Po();function Dn(){return Tn.useSyncExternalStore(In,()=>!0,()=>!1)}function In(){return()=>{}}var Ne="Avatar",[Nn]=En(Ne),[jn,ho]=Nn(Ne),go=i.forwardRef((e,t)=>{const{__scopeAvatar:o,...n}=e,[r,a]=i.useState("idle");return u.jsx(jn,{scope:o,imageLoadingStatus:r,onImageLoadingStatusChange:a,children:u.jsx(Ie.span,{...n,ref:t})})});go.displayName=Ne;var bo="AvatarImage",So=i.forwardRef((e,t)=>{const{__scopeAvatar:o,src:n,onLoadingStatusChange:r=()=>{},...a}=e,s=ho(bo,o),c=On(n,a),l=F(d=>{r(d),s.onImageLoadingStatusChange(d)});return Z(()=>{c!=="idle"&&l(c)},[c,l]),c==="loaded"?u.jsx(Ie.img,{...a,ref:t,src:n}):null});So.displayName=bo;var xo="AvatarFallback",wo=i.forwardRef((e,t)=>{const{__scopeAvatar:o,delayMs:n,...r}=e,a=ho(xo,o),[s,c]=i.useState(n===void 0);return i.useEffect(()=>{if(n!==void 0){const l=window.setTimeout(()=>c(!0),n);return()=>window.clearTimeout(l)}},[n]),s&&a.imageLoadingStatus!=="loaded"?u.jsx(Ie.span,{...r,ref:t}):null});wo.displayName=xo;function $e(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function On(e,{referrerPolicy:t,crossOrigin:o}){const n=Dn(),r=i.useRef(null),a=n?(r.current||(r.current=new window.Image),r.current):null,[s,c]=i.useState(()=>$e(a,e));return Z(()=>{c($e(a,e))},[a,e]),Z(()=>{const l=p=>()=>{c(p)};if(!a)return;const d=l("loaded"),f=l("error");return a.addEventListener("load",d),a.addEventListener("error",f),t&&(a.referrerPolicy=t),typeof o=="string"&&(a.crossOrigin=o),()=>{a.removeEventListener("load",d),a.removeEventListener("error",f)}},[a,o,t]),s}var pa=go,va=So,ma=wo;export{ra as A,Zo as B,Vn as C,sa as D,Jo as E,ma as F,Wn as I,$n as L,ta as O,ea as P,Fn as R,rr as S,kn as T,Hn as V,Bn as a,zn as b,lr as c,Kn as d,Un as e,Gn as f,Yn as g,Xn as h,qn as i,Zn as j,oa as k,aa as l,na as m,Jn as n,Qn as o,ia as p,ua as q,da as r,ca as s,la as t,fa as u,Cn as v,Rn as w,pa as x,va as y,Ge as z};
|