import{r as i,R as O,a as Le,b as on}from"./react-vendor-Dv0pxvir.js";var sn={exports:{}},ct={};/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var lr=i,ur=Symbol.for("react.element"),dr=Symbol.for("react.fragment"),fr=Object.prototype.hasOwnProperty,hr=lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,gr={key:!0,ref:!0,__self:!0,__source:!0};function cn(e,t,n){var r,o={},s=null,c=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(c=t.ref);for(r in t)fr.call(t,r)&&!gr.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:ur,type:e,key:s,ref:c,props:o,_owner:hr.current}}ct.Fragment=dr;ct.jsx=cn;ct.jsxs=cn;sn.exports=ct;var M=sn.exports;function pr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const at=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Re(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Tt(e){return"nodeType"in e}function j(e){var t,n;return e?Re(e)?e:Tt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function At(e){const{Document:t}=j(e);return e instanceof t}function ze(e){return Re(e)?!1:e instanceof j(e).HTMLElement}function an(e){return e instanceof j(e).SVGElement}function Se(e){return e?Re(e)?e.document:Tt(e)?At(e)?e:ze(e)||an(e)?e.ownerDocument:document:document:document}const ee=at?i.useLayoutEffect:i.useEffect;function Mt(e){const t=i.useRef(e);return ee(()=>{t.current=e}),i.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function vr(){const e=i.useRef(null),t=i.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=i.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function je(e,t){t===void 0&&(t=[e]);const n=i.useRef(e);return ee(()=>{n.current!==e&&(n.current=e)},t),n}function Ue(e,t){const n=i.useRef();return i.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function et(e){const t=Mt(e),n=i.useRef(null),r=i.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function xt(e){const t=i.useRef();return i.useEffect(()=>{t.current=e},[e]),t.current}let vt={};function We(e,t){return i.useMemo(()=>{if(t)return t;const n=vt[e]==null?0:vt[e]+1;return vt[e]=n,e+"-"+n},[e,t])}function ln(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,c)=>{const a=Object.entries(c);for(const[l,u]of a){const d=s[l];d!=null&&(s[l]=d+e*u)}return s},{...t})}}const Ce=ln(1),$e=ln(-1);function br(e){return"clientX"in e&&"clientY"in e}function Nt(e){if(!e)return!1;const{KeyboardEvent:t}=j(e.target);return t&&e instanceof t}function mr(e){if(!e)return!1;const{TouchEvent:t}=j(e.target);return t&&e instanceof t}function Ct(e){if(mr(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return br(e)?{x:e.clientX,y:e.clientY}:null}const tt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[tt.Translate.toString(e),tt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Vt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function wr(e){return e.matches(Vt)?e:e.querySelector(Vt)}const yr={display:"none"};function xr(e){let{id:t,value:n}=e;return O.createElement("div",{id:t,style:yr},n)}function Cr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return O.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Rr(){const[e,t]=i.useState("");return{announce:i.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const un=i.createContext(null);function Sr(e){const t=i.useContext(un);i.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Dr(){const[e]=i.useState(()=>new Set),t=i.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[i.useCallback(r=>{let{type:o,event:s}=r;e.forEach(c=>{var a;return(a=c[o])==null?void 0:a.call(c,s)})},[e]),t]}const Er={draggable:`
    To pick up a draggable item, press the space bar.
    While dragging, use the arrow keys to move the item.
    Press space again to drop the item in its new position, or press escape to cancel.
  `},Ir={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Tr(e){let{announcements:t=Ir,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Er}=e;const{announce:s,announcement:c}=Rr(),a=We("DndLiveRegion"),[l,u]=i.useState(!1);if(i.useEffect(()=>{u(!0)},[]),Sr(i.useMemo(()=>({onDragStart(f){let{active:h}=f;s(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:g}=f;t.onDragMove&&s(t.onDragMove({active:h,over:g}))},onDragOver(f){let{active:h,over:g}=f;s(t.onDragOver({active:h,over:g}))},onDragEnd(f){let{active:h,over:g}=f;s(t.onDragEnd({active:h,over:g}))},onDragCancel(f){let{active:h,over:g}=f;s(t.onDragCancel({active:h,over:g}))}}),[s,t])),!l)return null;const d=O.createElement(O.Fragment,null,O.createElement(xr,{id:r,value:o.draggable}),O.createElement(Cr,{id:a,announcement:c}));return n?Le.createPortal(d,n):d}var P;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(P||(P={}));function nt(){}function As(e,t){return i.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Ms(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const H=Object.freeze({x:0,y:0});function dn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function fn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Ar(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Kt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function hn(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Gt(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Ns=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Gt(t,t.left,t.top),s=[];for(const c of r){const{id:a}=c,l=n.get(a);if(l){const u=dn(Gt(l),o);s.push({id:a,data:{droppableContainer:c,value:u}})}}return s.sort(fn)},Mr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Kt(t),s=[];for(const c of r){const{id:a}=c,l=n.get(a);if(l){const u=Kt(l),d=o.reduce((h,g,y)=>h+dn(u[y],g),0),f=Number((d/4).toFixed(4));s.push({id:a,data:{droppableContainer:c,value:f}})}}return s.sort(fn)};function Nr(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),c=o-r,a=s-n;if(r<o&&n<s){const l=t.width*t.height,u=e.width*e.height,d=c*a,f=d/(l+u-d);return Number(f.toFixed(4))}return 0}const Or=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:c}=s,a=n.get(c);if(a){const l=Nr(a,t);l>0&&o.push({id:c,data:{droppableContainer:s,value:l}})}}return o.sort(Ar)};function Pr(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function gn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:H}function Lr(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((c,a)=>({...c,top:c.top+e*a.y,bottom:c.bottom+e*a.y,left:c.left+e*a.x,right:c.right+e*a.x}),{...n})}}const Fr=Lr(1);function _r(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function kr(e,t,n){const r=_r(t);if(!r)return e;const{scaleX:o,scaleY:s,x:c,y:a}=r,l=e.left-c-(1-o)*parseFloat(n),u=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,f=s?e.height/s:e.height;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l}}const jr={ignoreTransform:!1};function De(e,t){t===void 0&&(t=jr);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=j(e).getComputedStyle(e);u&&(n=kr(n,u,d))}const{top:r,left:o,width:s,height:c,bottom:a,right:l}=n;return{top:r,left:o,width:s,height:c,bottom:a,right:l}}function Yt(e){return De(e,{ignoreTransform:!0})}function $r(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Br(e,t){return t===void 0&&(t=j(e).getComputedStyle(e)),t.position==="fixed"}function zr(e,t){t===void 0&&(t=j(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function lt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(At(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ze(o)||an(o)||n.includes(o))return n;const s=j(e).getComputedStyle(o);return o!==e&&zr(o,s)&&n.push(o),Br(o,s)?n:r(o.parentNode)}return e?r(e):n}function pn(e){const[t]=lt(e,1);return t??null}function bt(e){return!at||!e?null:Re(e)?e:Tt(e)?At(e)||e===Se(e).scrollingElement?window:ze(e)?e:null:null}function vn(e){return Re(e)?e.scrollX:e.scrollLeft}function bn(e){return Re(e)?e.scrollY:e.scrollTop}function Rt(e){return{x:vn(e),y:bn(e)}}var L;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(L||(L={}));function mn(e){return!at||!e?!1:e===document.scrollingElement}function wn(e){const t={x:0,y:0},n=mn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:c,isRight:a,maxScroll:r,minScroll:t}}const Ur={x:.2,y:.2};function Wr(e,t,n,r,o){let{top:s,left:c,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=Ur);const{isTop:u,isBottom:d,isLeft:f,isRight:h}=wn(e),g={x:0,y:0},y={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&s<=t.top+v.height?(g.y=L.Backward,y.y=r*Math.abs((t.top+v.height-s)/v.height)):!d&&l>=t.bottom-v.height&&(g.y=L.Forward,y.y=r*Math.abs((t.bottom-v.height-l)/v.height)),!h&&a>=t.right-v.width?(g.x=L.Forward,y.x=r*Math.abs((t.right-v.width-a)/v.width)):!f&&c<=t.left+v.width&&(g.x=L.Backward,y.x=r*Math.abs((t.left+v.width-c)/v.width)),{direction:g,speed:y}}function Vr(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:c}=window;return{top:0,left:0,right:s,bottom:c,width:s,height:c}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function yn(e){return e.reduce((t,n)=>Ce(t,Rt(n)),H)}function Kr(e){return e.reduce((t,n)=>t+vn(n),0)}function Gr(e){return e.reduce((t,n)=>t+bn(n),0)}function Yr(e,t){if(t===void 0&&(t=De),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);pn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Xr=[["x",["left","right"],Kr],["y",["top","bottom"],Gr]];class Ot{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=lt(n),o=yn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,c,a]of Xr)for(const l of c)Object.defineProperty(this,l,{get:()=>{const u=a(r),d=o[s]-u;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Fe{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function qr(e){const{EventTarget:t}=j(e);return e instanceof t?e:Se(e)}function mt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var X;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(X||(X={}));function Xt(e){e.preventDefault()}function Hr(e){e.stopPropagation()}var E;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(E||(E={}));const xn={start:[E.Space,E.Enter],cancel:[E.Esc],end:[E.Space,E.Enter,E.Tab]},Jr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case E.Right:return{...n,x:n.x+25};case E.Left:return{...n,x:n.x-25};case E.Down:return{...n,y:n.y+25};case E.Up:return{...n,y:n.y-25}}};class Cn{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Fe(Se(n)),this.windowListeners=new Fe(j(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(X.Resize,this.handleCancel),this.windowListeners.add(X.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(X.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Yr(r),n(H)}handleKeyDown(t){if(Nt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=xn,coordinateGetter:c=Jr,scrollBehavior:a="smooth"}=o,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:H;this.referenceCoordinates||(this.referenceCoordinates=d);const f=c(t,{active:n,context:r.current,currentCoordinates:d});if(f){const h=$e(f,d),g={x:0,y:0},{scrollableAncestors:y}=r.current;for(const v of y){const p=t.code,{isTop:m,isRight:x,isLeft:b,isBottom:w,maxScroll:S,minScroll:D}=wn(v),R=Vr(v),C={x:Math.min(p===E.Right?R.right-R.width/2:R.right,Math.max(p===E.Right?R.left:R.left+R.width/2,f.x)),y:Math.min(p===E.Down?R.bottom-R.height/2:R.bottom,Math.max(p===E.Down?R.top:R.top+R.height/2,f.y))},A=p===E.Right&&!x||p===E.Left&&!b,N=p===E.Down&&!w||p===E.Up&&!m;if(A&&C.x!==f.x){const I=v.scrollLeft+h.x,$=p===E.Right&&I<=S.x||p===E.Left&&I>=D.x;if($&&!h.y){v.scrollTo({left:I,behavior:a});return}$?g.x=v.scrollLeft-I:g.x=p===E.Right?v.scrollLeft-S.x:v.scrollLeft-D.x,g.x&&v.scrollBy({left:-g.x,behavior:a});break}else if(N&&C.y!==f.y){const I=v.scrollTop+h.y,$=p===E.Down&&I<=S.y||p===E.Up&&I>=D.y;if($&&!h.x){v.scrollTo({top:I,behavior:a});return}$?g.y=v.scrollTop-I:g.y=p===E.Down?v.scrollTop-S.y:v.scrollTop-D.y,g.y&&v.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,Ce($e(f,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Cn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=xn,onActivation:o}=t,{active:s}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function qt(e){return!!(e&&"distance"in e)}function Ht(e){return!!(e&&"delay"in e)}class Pt{constructor(t,n,r){var o;r===void 0&&(r=qr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:c}=s;this.props=t,this.events=n,this.document=Se(c),this.documentListeners=new Fe(this.document),this.listeners=new Fe(r),this.windowListeners=new Fe(j(c)),this.initialCoordinates=(o=Ct(s))!=null?o:H,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(X.Resize,this.handleCancel),this.windowListeners.add(X.DragStart,Xt),this.windowListeners.add(X.VisibilityChange,this.handleCancel),this.windowListeners.add(X.ContextMenu,Xt),this.documentListeners.add(X.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ht(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(qt(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(X.Click,Hr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(X.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:c,options:{activationConstraint:a}}=s;if(!o)return;const l=(n=Ct(t))!=null?n:H,u=$e(o,l);if(!r&&a){if(qt(a)){if(a.tolerance!=null&&mt(u,a.tolerance))return this.handleCancel();if(mt(u,a.distance))return this.handleStart()}if(Ht(a)&&mt(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),c(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===E.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Qr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Rn extends Pt{constructor(t){const{event:n}=t,r=Se(n.target);super(t,Qr,r)}}Rn.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Zr={move:{name:"mousemove"},end:{name:"mouseup"}};var St;(function(e){e[e.RightClick=2]="RightClick"})(St||(St={}));class eo extends Pt{constructor(t){super(t,Zr,Se(t.event.target))}}eo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===St.RightClick?!1:(r==null||r({event:n}),!0)}}];const wt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class to extends Pt{constructor(t){super(t,wt)}static setup(){return window.addEventListener(wt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(wt.move.name,t)};function t(){}}}to.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var _e;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(_e||(_e={}));var rt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(rt||(rt={}));function no(e){let{acceleration:t,activator:n=_e.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:c=5,order:a=rt.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:h}=e;const g=oo({delta:f,disabled:!s}),[y,v]=vr(),p=i.useRef({x:0,y:0}),m=i.useRef({x:0,y:0}),x=i.useMemo(()=>{switch(n){case _e.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case _e.DraggableRect:return o}},[n,o,l]),b=i.useRef(null),w=i.useCallback(()=>{const D=b.current;if(!D)return;const R=p.current.x*m.current.x,C=p.current.y*m.current.y;D.scrollBy(R,C)},[]),S=i.useMemo(()=>a===rt.TreeOrder?[...u].reverse():u,[a,u]);i.useEffect(()=>{if(!s||!u.length||!x){v();return}for(const D of S){if((r==null?void 0:r(D))===!1)continue;const R=u.indexOf(D),C=d[R];if(!C)continue;const{direction:A,speed:N}=Wr(D,C,x,t,h);for(const I of["x","y"])g[I][A[I]]||(N[I]=0,A[I]=0);if(N.x>0||N.y>0){v(),b.current=D,y(w,c),p.current=N,m.current=A;return}}p.current={x:0,y:0},m.current={x:0,y:0},v()},[t,w,r,v,s,c,JSON.stringify(x),JSON.stringify(g),y,u,S,d,JSON.stringify(h)])}const ro={x:{[L.Backward]:!1,[L.Forward]:!1},y:{[L.Backward]:!1,[L.Forward]:!1}};function oo(e){let{delta:t,disabled:n}=e;const r=xt(t);return Ue(o=>{if(n||!r||!o)return ro;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[L.Backward]:o.x[L.Backward]||s.x===-1,[L.Forward]:o.x[L.Forward]||s.x===1},y:{[L.Backward]:o.y[L.Backward]||s.y===-1,[L.Forward]:o.y[L.Forward]||s.y===1}}},[n,t,r])}function so(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Ue(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function io(e,t){return i.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...s]},[]),[e,t])}var Be;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Be||(Be={}));var Dt;(function(e){e.Optimized="optimized"})(Dt||(Dt={}));const Jt=new Map;function co(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,c]=i.useState(null),{frequency:a,measure:l,strategy:u}=o,d=i.useRef(e),f=p(),h=je(f),g=i.useCallback(function(m){m===void 0&&(m=[]),!h.current&&c(x=>x===null?m:x.concat(m.filter(b=>!x.includes(b))))},[h]),y=i.useRef(null),v=Ue(m=>{if(f&&!n)return Jt;if(!m||m===Jt||d.current!==e||s!=null){const x=new Map;for(let b of e){if(!b)continue;if(s&&s.length>0&&!s.includes(b.id)&&b.rect.current){x.set(b.id,b.rect.current);continue}const w=b.node.current,S=w?new Ot(l(w),w):null;b.rect.current=S,S&&x.set(b.id,S)}return x}return m},[e,s,n,f,l]);return i.useEffect(()=>{d.current=e},[e]),i.useEffect(()=>{f||g()},[n,f]),i.useEffect(()=>{s&&s.length>0&&c(null)},[JSON.stringify(s)]),i.useEffect(()=>{f||typeof a!="number"||y.current!==null||(y.current=setTimeout(()=>{g(),y.current=null},a))},[a,f,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:s!=null};function p(){switch(u){case Be.Always:return!1;case Be.BeforeDragging:return n;default:return!n}}}function Sn(e,t){return Ue(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function ao(e,t){return Sn(e,t)}function lo(e){let{callback:t,disabled:n}=e;const r=Mt(t),o=i.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return i.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function ut(e){let{callback:t,disabled:n}=e;const r=Mt(t),o=i.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return i.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function uo(e){return new Ot(De(e),e)}function Qt(e,t,n){t===void 0&&(t=uo);const[r,o]=i.useState(null);function s(){o(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const c=lo({callback(l){if(e)for(const u of l){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),a=ut({callback:s});return ee(()=>{s(),e?(a==null||a.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),c==null||c.disconnect())},[e]),r}function fo(e){const t=Sn(e);return gn(e,t)}const Zt=[];function ho(e){const t=i.useRef(e),n=Ue(r=>e?r&&r!==Zt&&e&&t.current&&e.parentNode===t.current.parentNode?r:lt(e):Zt,[e]);return i.useEffect(()=>{t.current=e},[e]),n}function go(e){const[t,n]=i.useState(null),r=i.useRef(e),o=i.useCallback(s=>{const c=bt(s.target);c&&n(a=>a?(a.set(c,Rt(c)),new Map(a)):null)},[]);return i.useEffect(()=>{const s=r.current;if(e!==s){c(s);const a=e.map(l=>{const u=bt(l);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,Rt(u)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{c(e),c(s)};function c(a){a.forEach(l=>{const u=bt(l);u==null||u.removeEventListener("scroll",o)})}},[o,e]),i.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,c)=>Ce(s,c),H):yn(e):H,[e,t])}function en(e,t){t===void 0&&(t=[]);const n=i.useRef(null);return i.useEffect(()=>{n.current=null},t),i.useEffect(()=>{const r=e!==H;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?$e(e,n.current):H}function po(e){i.useEffect(()=>{if(!at)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function vo(e,t){return i.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=c=>{s(c,t)},n},{}),[e,t])}function Dn(e){return i.useMemo(()=>e?$r(e):null,[e])}const tn=[];function bo(e,t){t===void 0&&(t=De);const[n]=e,r=Dn(n?j(n):null),[o,s]=i.useState(tn);function c(){s(()=>e.length?e.map(l=>mn(l)?r:new Ot(t(l),l)):tn)}const a=ut({callback:c});return ee(()=>{a==null||a.disconnect(),c(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function mo(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ze(t)?t:e}function wo(e){let{measure:t}=e;const[n,r]=i.useState(null),o=i.useCallback(u=>{for(const{target:d}of u)if(ze(d)){r(f=>{const h=t(d);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),s=ut({callback:o}),c=i.useCallback(u=>{const d=mo(u);s==null||s.disconnect(),d&&(s==null||s.observe(d)),r(d?t(d):null)},[t,s]),[a,l]=et(c);return i.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const yo=[{sensor:Rn,options:{}},{sensor:Cn,options:{}}],xo={current:{}},Ze={draggable:{measure:Yt},droppable:{measure:Yt,strategy:Be.WhileDragging,frequency:Dt.Optimized},dragOverlay:{measure:De}};class ke extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Co={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ke,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:nt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ze,measureDroppableContainers:nt,windowRect:null,measuringScheduled:!1},Ro={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:nt,draggableNodes:new Map,over:null,measureDroppableContainers:nt},dt=i.createContext(Ro),En=i.createContext(Co);function So(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ke}}}function Do(e,t){switch(t.type){case P.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case P.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case P.DragEnd:case P.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case P.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new ke(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case P.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const c=new ke(e.droppable.containers);return c.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:c}}}case P.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new ke(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Eo(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=i.useContext(dt),s=xt(r),c=xt(n==null?void 0:n.id);return i.useEffect(()=>{if(!t&&!r&&s&&c!=null){if(!Nt(s)||document.activeElement===s.target)return;const a=o.get(c);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[l.current,u.current]){if(!d)continue;const f=wr(d);if(f){f.focus();break}}})}},[r,t,o,c,s]),null}function Io(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function To(e){return i.useMemo(()=>({draggable:{...Ze.draggable,...e==null?void 0:e.draggable},droppable:{...Ze.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ze.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Ao(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=i.useRef(!1),{x:c,y:a}=typeof o=="boolean"?{x:o,y:o}:o;ee(()=>{if(!c&&!a||!t){s.current=!1;return}if(s.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=n(u),f=gn(d,r);if(c||(f.x=0),a||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=pn(u);h&&h.scrollBy({top:f.y,left:f.x})}},[t,c,a,r,n])}const In=i.createContext({...H,scaleX:1,scaleY:1});var he;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(he||(he={}));const Os=i.memo(function(t){var n,r,o,s;let{id:c,accessibility:a,autoScroll:l=!0,children:u,sensors:d=yo,collisionDetection:f=Or,measuring:h,modifiers:g,...y}=t;const v=i.useReducer(Do,void 0,So),[p,m]=v,[x,b]=Dr(),[w,S]=i.useState(he.Uninitialized),D=w===he.Initialized,{draggable:{active:R,nodes:C,translate:A},droppable:{containers:N}}=p,I=R!=null?C.get(R):null,$=i.useRef({initial:null,translated:null}),B=i.useMemo(()=>{var _;return R!=null?{id:R,data:(_=I==null?void 0:I.data)!=null?_:xo,rect:$}:null},[R,I]),q=i.useRef(null),[ge,K]=i.useState(null),[z,Ke]=i.useState(null),te=je(y,Object.values(y)),Ie=We("DndDescribedBy",c),Ge=i.useMemo(()=>N.getEnabled(),[N]),k=To(h),{droppableRects:ne,measureDroppableContainers:pe,measuringScheduled:Te}=co(Ge,{dragging:D,dependencies:[A.x,A.y],config:k.droppable}),G=so(C,R),Ye=i.useMemo(()=>z?Ct(z):null,[z]),ce=ar(),re=ao(G,k.draggable.measure);Ao({activeNode:R!=null?C.get(R):null,config:ce.layoutShiftCompensation,initialRect:re,measure:k.draggable.measure});const T=Qt(G,k.draggable.measure,re),Ae=Qt(G?G.parentElement:null),J=i.useRef({activatorEvent:null,active:null,activeNode:G,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ve=N.getNodeFor((n=J.current.over)==null?void 0:n.id),oe=wo({measure:k.dragOverlay.measure}),be=(r=oe.nodeRef.current)!=null?r:G,me=D?(o=oe.rect)!=null?o:T:null,_t=!!(oe.nodeRef.current&&oe.rect),kt=fo(_t?null:T),ht=Dn(be?j(be):null),ae=ho(D?ve??G:null),Xe=bo(ae),qe=Io(g,{transform:{x:A.x-kt.x,y:A.y-kt.y,scaleX:1,scaleY:1},activatorEvent:z,active:B,activeNodeRect:T,containerNodeRect:Ae,draggingNodeRect:me,over:J.current.over,overlayNodeRect:oe.rect,scrollableAncestors:ae,scrollableAncestorRects:Xe,windowRect:ht}),jt=Ye?Ce(Ye,A):null,$t=go(ae),tr=en($t),nr=en($t,[T]),we=Ce(qe,tr),ye=me?Fr(me,qe):null,Me=B&&ye?f({active:B,collisionRect:ye,droppableRects:ne,droppableContainers:Ge,pointerCoordinates:jt}):null,Bt=hn(Me,"id"),[le,zt]=i.useState(null),rr=_t?qe:Ce(qe,nr),or=Pr(rr,(s=le==null?void 0:le.rect)!=null?s:null,T),gt=i.useRef(null),Ut=i.useCallback((_,U)=>{let{sensor:W,options:ue}=U;if(q.current==null)return;const Y=C.get(q.current);if(!Y)return;const V=_.nativeEvent,Q=new W({active:q.current,activeNode:Y,event:V,options:ue,context:J,onAbort(F){if(!C.get(F))return;const{onDragAbort:Z}=te.current,se={id:F};Z==null||Z(se),x({type:"onDragAbort",event:se})},onPending(F,de,Z,se){if(!C.get(F))return;const{onDragPending:Oe}=te.current,fe={id:F,constraint:de,initialCoordinates:Z,offset:se};Oe==null||Oe(fe),x({type:"onDragPending",event:fe})},onStart(F){const de=q.current;if(de==null)return;const Z=C.get(de);if(!Z)return;const{onDragStart:se}=te.current,Ne={activatorEvent:V,active:{id:de,data:Z.data,rect:$}};Le.unstable_batchedUpdates(()=>{se==null||se(Ne),S(he.Initializing),m({type:P.DragStart,initialCoordinates:F,active:de}),x({type:"onDragStart",event:Ne}),K(gt.current),Ke(V)})},onMove(F){m({type:P.DragMove,coordinates:F})},onEnd:xe(P.DragEnd),onCancel:xe(P.DragCancel)});gt.current=Q;function xe(F){return async function(){const{active:Z,collisions:se,over:Ne,scrollAdjustedTranslate:Oe}=J.current;let fe=null;if(Z&&Oe){const{cancelDrop:Pe}=te.current;fe={activatorEvent:V,active:Z,collisions:se,delta:Oe,over:Ne},F===P.DragEnd&&typeof Pe=="function"&&await Promise.resolve(Pe(fe))&&(F=P.DragCancel)}q.current=null,Le.unstable_batchedUpdates(()=>{m({type:F}),S(he.Uninitialized),zt(null),K(null),Ke(null),gt.current=null;const Pe=F===P.DragEnd?"onDragEnd":"onDragCancel";if(fe){const pt=te.current[Pe];pt==null||pt(fe),x({type:Pe,event:fe})}})}}},[C]),sr=i.useCallback((_,U)=>(W,ue)=>{const Y=W.nativeEvent,V=C.get(ue);if(q.current!==null||!V||Y.dndKit||Y.defaultPrevented)return;const Q={active:V};_(W,U.options,Q)===!0&&(Y.dndKit={capturedBy:U.sensor},q.current=ue,Ut(W,U))},[C,Ut]),Wt=io(d,sr);po(d),ee(()=>{T&&w===he.Initializing&&S(he.Initialized)},[T,w]),i.useEffect(()=>{const{onDragMove:_}=te.current,{active:U,activatorEvent:W,collisions:ue,over:Y}=J.current;if(!U||!W)return;const V={active:U,activatorEvent:W,collisions:ue,delta:{x:we.x,y:we.y},over:Y};Le.unstable_batchedUpdates(()=>{_==null||_(V),x({type:"onDragMove",event:V})})},[we.x,we.y]),i.useEffect(()=>{const{active:_,activatorEvent:U,collisions:W,droppableContainers:ue,scrollAdjustedTranslate:Y}=J.current;if(!_||q.current==null||!U||!Y)return;const{onDragOver:V}=te.current,Q=ue.get(Bt),xe=Q&&Q.rect.current?{id:Q.id,rect:Q.rect.current,data:Q.data,disabled:Q.disabled}:null,F={active:_,activatorEvent:U,collisions:W,delta:{x:Y.x,y:Y.y},over:xe};Le.unstable_batchedUpdates(()=>{zt(xe),V==null||V(F),x({type:"onDragOver",event:F})})},[Bt]),ee(()=>{J.current={activatorEvent:z,active:B,activeNode:G,collisionRect:ye,collisions:Me,droppableRects:ne,draggableNodes:C,draggingNode:be,draggingNodeRect:me,droppableContainers:N,over:le,scrollableAncestors:ae,scrollAdjustedTranslate:we},$.current={initial:me,translated:ye}},[B,G,Me,ye,C,be,me,ne,N,le,ae,we]),no({...ce,delta:A,draggingRect:ye,pointerCoordinates:jt,scrollableAncestors:ae,scrollableAncestorRects:Xe});const ir=i.useMemo(()=>({active:B,activeNode:G,activeNodeRect:T,activatorEvent:z,collisions:Me,containerNodeRect:Ae,dragOverlay:oe,draggableNodes:C,droppableContainers:N,droppableRects:ne,over:le,measureDroppableContainers:pe,scrollableAncestors:ae,scrollableAncestorRects:Xe,measuringConfiguration:k,measuringScheduled:Te,windowRect:ht}),[B,G,T,z,Me,Ae,oe,C,N,ne,le,pe,ae,Xe,k,Te,ht]),cr=i.useMemo(()=>({activatorEvent:z,activators:Wt,active:B,activeNodeRect:T,ariaDescribedById:{draggable:Ie},dispatch:m,draggableNodes:C,over:le,measureDroppableContainers:pe}),[z,Wt,B,T,m,Ie,C,le,pe]);return O.createElement(un.Provider,{value:b},O.createElement(dt.Provider,{value:cr},O.createElement(En.Provider,{value:ir},O.createElement(In.Provider,{value:or},u)),O.createElement(Eo,{disabled:(a==null?void 0:a.restoreFocus)===!1})),O.createElement(Tr,{...a,hiddenTextDescribedById:Ie}));function ar(){const _=(ge==null?void 0:ge.autoScrollEnabled)===!1,U=typeof l=="object"?l.enabled===!1:l===!1,W=D&&!_&&!U;return typeof l=="object"?{...l,enabled:W}:{enabled:W}}}),Mo=i.createContext(null),nn="button",No="Draggable";function Oo(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=We(No),{activators:c,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:h}=i.useContext(dt),{role:g=nn,roleDescription:y="draggable",tabIndex:v=0}=o??{},p=(l==null?void 0:l.id)===t,m=i.useContext(p?In:Mo),[x,b]=et(),[w,S]=et(),D=vo(c,t),R=je(n);ee(()=>(f.set(t,{id:t,key:s,node:x,activatorNode:w,data:R}),()=>{const A=f.get(t);A&&A.key===s&&f.delete(t)}),[f,t]);const C=i.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":p&&g===nn?!0:void 0,"aria-roledescription":y,"aria-describedby":d.draggable}),[r,g,v,p,y,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:C,isDragging:p,listeners:r?void 0:D,node:x,over:h,setNodeRef:b,setActivatorNodeRef:S,transform:m}}function Po(){return i.useContext(En)}const Lo="Droppable",Fo={timeout:25};function _o(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=We(Lo),{active:c,dispatch:a,over:l,measureDroppableContainers:u}=i.useContext(dt),d=i.useRef({disabled:n}),f=i.useRef(!1),h=i.useRef(null),g=i.useRef(null),{disabled:y,updateMeasurementsFor:v,timeout:p}={...Fo,...o},m=je(v??r),x=i.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(m.current)?m.current:[m.current]),g.current=null},p)},[p]),b=ut({callback:x,disabled:y||!c}),w=i.useCallback((C,A)=>{b&&(A&&(b.unobserve(A),f.current=!1),C&&b.observe(C))},[b]),[S,D]=et(w),R=je(t);return i.useEffect(()=>{!b||!S.current||(b.disconnect(),f.current=!1,b.observe(S.current))},[S,b]),i.useEffect(()=>(a({type:P.RegisterDroppable,element:{id:r,key:s,disabled:n,node:S,rect:h,data:R}}),()=>a({type:P.UnregisterDroppable,key:s,id:r})),[r]),i.useEffect(()=>{n!==d.current.disabled&&(a({type:P.SetDroppableDisabled,id:r,key:s,disabled:n}),d.current.disabled=n)},[r,s,n,a]),{active:c,rect:h,isOver:(l==null?void 0:l.id)===r,node:S,over:l,setNodeRef:D}}function Tn(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function ko(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function He(e){return e!==null&&e>=0}function jo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function $o(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const An=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=Tn(t,r,n),c=t[o],a=s[o];return!a||!c?null:{x:a.left-c.left,y:a.top-c.top,scaleX:a.width/c.width,scaleY:a.height/c.height}},Je={scaleX:1,scaleY:1},Ps=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:c}=e;const a=(t=s[n])!=null?t:r;if(!a)return null;if(o===n){const u=s[c];return u?{x:0,y:n<c?u.top+u.height-(a.top+a.height):u.top-a.top,...Je}:null}const l=Bo(s,o,n);return o>n&&o<=c?{x:0,y:-a.height-l,...Je}:o<n&&o>=c?{x:0,y:a.height+l,...Je}:{x:0,y:0,...Je}};function Bo(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const Mn="Sortable",Nn=O.createContext({activeIndex:-1,containerId:Mn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:An,disabled:{draggable:!1,droppable:!1}});function Ls(e){let{children:t,id:n,items:r,strategy:o=An,disabled:s=!1}=e;const{active:c,dragOverlay:a,droppableRects:l,over:u,measureDroppableContainers:d}=Po(),f=We(Mn,n),h=a.rect!==null,g=i.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),y=c!=null,v=c?g.indexOf(c.id):-1,p=u?g.indexOf(u.id):-1,m=i.useRef(g),x=!jo(g,m.current),b=p!==-1&&v===-1||x,w=$o(s);ee(()=>{x&&y&&d(g)},[x,g,y,d]),i.useEffect(()=>{m.current=g},[g]);const S=i.useMemo(()=>({activeIndex:v,containerId:f,disabled:w,disableTransforms:b,items:g,overIndex:p,useDragOverlay:h,sortedRects:ko(g,l),strategy:o}),[v,f,w.draggable,w.droppable,b,g,p,l,h,o]);return O.createElement(Nn.Provider,{value:S},t)}const zo=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Tn(n,r,o).indexOf(t)},Uo=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:c,previousItems:a,previousContainerId:l,transition:u}=e;return!u||!r||a!==s&&o===c?!1:n?!0:c!==o&&t===l},Wo={duration:200,easing:"ease"},On="transform",Vo=tt.Transition.toString({property:On,duration:0,easing:"linear"}),Ko={roleDescription:"sortable"};function Go(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,c]=i.useState(null),a=i.useRef(n);return ee(()=>{if(!t&&n!==a.current&&r.current){const l=o.current;if(l){const u=De(r.current,{ignoreTransform:!0}),d={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(d.x||d.y)&&c(d)}}n!==a.current&&(a.current=n)},[t,n,r,o]),i.useEffect(()=>{s&&c(null)},[s]),s}function Fs(e){let{animateLayoutChanges:t=Uo,attributes:n,disabled:r,data:o,getNewIndex:s=zo,id:c,strategy:a,resizeObserverConfig:l,transition:u=Wo}=e;const{items:d,containerId:f,activeIndex:h,disabled:g,disableTransforms:y,sortedRects:v,overIndex:p,useDragOverlay:m,strategy:x}=i.useContext(Nn),b=Yo(r,g),w=d.indexOf(c),S=i.useMemo(()=>({sortable:{containerId:f,index:w,items:d},...o}),[f,o,w,d]),D=i.useMemo(()=>d.slice(d.indexOf(c)),[d,c]),{rect:R,node:C,isOver:A,setNodeRef:N}=_o({id:c,data:S,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...l}}),{active:I,activatorEvent:$,activeNodeRect:B,attributes:q,setNodeRef:ge,listeners:K,isDragging:z,over:Ke,setActivatorNodeRef:te,transform:Ie}=Oo({id:c,data:S,attributes:{...Ko,...n},disabled:b.draggable}),Ge=pr(N,ge),k=!!I,ne=k&&!y&&He(h)&&He(p),pe=!m&&z,Te=pe&&ne?Ie:null,Ye=ne?Te??(a??x)({rects:v,activeNodeRect:B,activeIndex:h,overIndex:p,index:w}):null,ce=He(h)&&He(p)?s({id:c,items:d,activeIndex:h,overIndex:p}):w,re=I==null?void 0:I.id,T=i.useRef({activeId:re,items:d,newIndex:ce,containerId:f}),Ae=d!==T.current.items,J=t({active:I,containerId:f,isDragging:z,isSorting:k,id:c,index:w,items:d,newIndex:T.current.newIndex,previousItems:T.current.items,previousContainerId:T.current.containerId,transition:u,wasDragging:T.current.activeId!=null}),ve=Go({disabled:!J,index:w,node:C,rect:R});return i.useEffect(()=>{k&&T.current.newIndex!==ce&&(T.current.newIndex=ce),f!==T.current.containerId&&(T.current.containerId=f),d!==T.current.items&&(T.current.items=d)},[k,ce,f,d]),i.useEffect(()=>{if(re===T.current.activeId)return;if(re&&!T.current.activeId){T.current.activeId=re;return}const be=setTimeout(()=>{T.current.activeId=re},50);return()=>clearTimeout(be)},[re]),{active:I,activeIndex:h,attributes:q,data:S,rect:R,index:w,newIndex:ce,items:d,isOver:A,isSorting:k,isDragging:z,listeners:K,node:C,overIndex:p,over:Ke,setNodeRef:Ge,setActivatorNodeRef:te,setDroppableNodeRef:N,setDraggableNodeRef:ge,transform:ve??Ye,transition:oe()};function oe(){if(ve||Ae&&T.current.newIndex===w)return Vo;if(!(pe&&!Nt($)||!u)&&(k||J))return tt.Transition.toString({...u,property:On})}}function Yo(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function ot(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Xo=[E.Down,E.Right,E.Up,E.Left],_s=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:s,over:c,scrollableAncestors:a}}=t;if(Xo.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];s.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=o.get(f.id);if(h)switch(e.code){case E.Down:r.top<h.top&&l.push(f);break;case E.Up:r.top>h.top&&l.push(f);break;case E.Left:r.left>h.left&&l.push(f);break;case E.Right:r.left<h.left&&l.push(f);break}});const u=Mr({collisionRect:r,droppableRects:o,droppableContainers:l});let d=hn(u,"id");if(d===(c==null?void 0:c.id)&&u.length>1&&(d=u[1].id),d!=null){const f=s.get(n.id),h=s.get(d),g=h?o.get(h.id):null,y=h==null?void 0:h.node.current;if(y&&g&&f&&h){const p=lt(y).some((D,R)=>a[R]!==D),m=Pn(f,h),x=qo(f,h),b=p||!m?{x:0,y:0}:{x:x?r.width-g.width:0,y:x?r.height-g.height:0},w={x:g.left,y:g.top};return b.x&&b.y?w:$e(w,b)}}}};function Pn(e,t){return!ot(e)||!ot(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function qo(e,t){return!ot(e)||!ot(t)||!Pn(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Lt(e,t=[]){let n=[];function r(s,c){const a=i.createContext(c),l=n.length;n=[...n,c];const u=f=>{var m;const{scope:h,children:g,...y}=f,v=((m=h==null?void 0:h[e])==null?void 0:m[l])||a,p=i.useMemo(()=>y,Object.values(y));return M.jsx(v.Provider,{value:p,children:g})};u.displayName=s+"Provider";function d(f,h){var v;const g=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,y=i.useContext(g);if(y)return y;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(c=>i.createContext(c));return function(a){const l=(a==null?void 0:a[e])||s;return i.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Ho(o,...t)]}function Ho(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function rn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ln(...e){return t=>{let n=!1;const r=e.map(o=>{const s=rn(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():rn(e[o],null)}}}}function st(...e){return i.useCallback(Ln(...e),e)}function Et(e){const t=Jo(e),n=i.forwardRef((r,o)=>{const{children:s,...c}=r,a=i.Children.toArray(s),l=a.find(Zo);if(l){const u=l.props.children,d=a.map(f=>f===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:f);return M.jsx(t,{...c,ref:o,children:i.isValidElement(u)?i.cloneElement(u,void 0,d):null})}return M.jsx(t,{...c,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Jo(e){const t=i.forwardRef((n,r)=>{const{children:o,...s}=n;if(i.isValidElement(o)){const c=ts(o),a=es(s,o.props);return o.type!==i.Fragment&&(a.ref=r?Ln(r,c):c),i.cloneElement(o,a)}return i.Children.count(o)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qo=Symbol("radix.slottable");function Zo(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qo}function es(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ts(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ns(e){const t=e+"CollectionProvider",[n,r]=Lt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=v=>{const{scope:p,children:m}=v,x=O.useRef(null),b=O.useRef(new Map).current;return M.jsx(o,{scope:p,itemMap:b,collectionRef:x,children:m})};c.displayName=t;const a=e+"CollectionSlot",l=Et(a),u=O.forwardRef((v,p)=>{const{scope:m,children:x}=v,b=s(a,m),w=st(p,b.collectionRef);return M.jsx(l,{ref:w,children:x})});u.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Et(d),g=O.forwardRef((v,p)=>{const{scope:m,children:x,...b}=v,w=O.useRef(null),S=st(p,w),D=s(d,m);return O.useEffect(()=>(D.itemMap.set(w,{ref:w,...b}),()=>void D.itemMap.delete(w))),M.jsx(h,{[f]:"",ref:S,children:x})});g.displayName=d;function y(v){const p=s(e+"CollectionConsumer",v);return O.useCallback(()=>{const x=p.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(p.itemMap.values()).sort((D,R)=>b.indexOf(D.ref.current)-b.indexOf(R.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:c,Slot:u,ItemSlot:g},y,r]}var it=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{},rs=on[" useId ".trim().toString()]||(()=>{}),os=0;function Fn(e){const[t,n]=i.useState(rs());return it(()=>{n(r=>r??String(os++))},[e]),t?`radix-${t}`:""}var ss=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=ss.reduce((e,t)=>{const n=Et(`Primitive.${t}`),r=i.forwardRef((o,s)=>{const{asChild:c,...a}=o,l=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),M.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function is(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var cs=on[" useInsertionEffect ".trim().toString()]||it;function _n({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,c]=as({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=i.useRef(e!==void 0);i.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"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.`),d.current=a},[a,r])}const u=i.useCallback(d=>{var f;if(a){const h=ls(d)?d(e):d;h!==e&&((f=c.current)==null||f.call(c,h))}else s(d)},[a,e,s,c]);return[l,u]}function as({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),s=i.useRef(t);return cs(()=>{s.current=t},[t]),i.useEffect(()=>{var c;o.current!==n&&((c=s.current)==null||c.call(s,n),o.current=n)},[n,o]),[n,r,s]}function ls(e){return typeof e=="function"}var us=i.createContext(void 0);function kn(e){const t=i.useContext(us);return e||t||"ltr"}var yt="rovingFocusGroup.onEntryFocus",ds={bubbles:!1,cancelable:!0},Ve="RovingFocusGroup",[It,jn,fs]=ns(Ve),[hs,$n]=Lt(Ve,[fs]),[gs,ps]=hs(Ve),Bn=i.forwardRef((e,t)=>M.jsx(It.Provider,{scope:e.__scopeRovingFocusGroup,children:M.jsx(It.Slot,{scope:e.__scopeRovingFocusGroup,children:M.jsx(vs,{...e,ref:t})})}));Bn.displayName=Ve;var vs=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=i.useRef(null),g=st(t,h),y=kn(s),[v,p]=_n({prop:c,defaultProp:a??null,onChange:l,caller:Ve}),[m,x]=i.useState(!1),b=is(u),w=jn(n),S=i.useRef(!1),[D,R]=i.useState(0);return i.useEffect(()=>{const C=h.current;if(C)return C.addEventListener(yt,b),()=>C.removeEventListener(yt,b)},[b]),M.jsx(gs,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:v,onItemFocus:i.useCallback(C=>p(C),[p]),onItemShiftTab:i.useCallback(()=>x(!0),[]),onFocusableItemAdd:i.useCallback(()=>R(C=>C+1),[]),onFocusableItemRemove:i.useCallback(()=>R(C=>C-1),[]),children:M.jsx(Ee.div,{tabIndex:m||D===0?-1:0,"data-orientation":r,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:ie(e.onMouseDown,()=>{S.current=!0}),onFocus:ie(e.onFocus,C=>{const A=!S.current;if(C.target===C.currentTarget&&A&&!m){const N=new CustomEvent(yt,ds);if(C.currentTarget.dispatchEvent(N),!N.defaultPrevented){const I=w().filter(K=>K.focusable),$=I.find(K=>K.active),B=I.find(K=>K.id===v),ge=[$,B,...I].filter(Boolean).map(K=>K.ref.current);Wn(ge,d)}}S.current=!1}),onBlur:ie(e.onBlur,()=>x(!1))})})}),zn="RovingFocusGroupItem",Un=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:c,...a}=e,l=Fn(),u=s||l,d=ps(zn,n),f=d.currentTabStopId===u,h=jn(n),{onFocusableItemAdd:g,onFocusableItemRemove:y,currentTabStopId:v}=d;return i.useEffect(()=>{if(r)return g(),()=>y()},[r,g,y]),M.jsx(It.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:M.jsx(Ee.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:ie(e.onMouseDown,p=>{r?d.onItemFocus(u):p.preventDefault()}),onFocus:ie(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:ie(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){d.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=ws(p,d.orientation,d.dir);if(m!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let b=h().filter(w=>w.focusable).map(w=>w.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const w=b.indexOf(p.currentTarget);b=d.loop?ys(b,w+1):b.slice(w+1)}setTimeout(()=>Wn(b))}}),children:typeof c=="function"?c({isCurrentTabStop:f,hasTabStop:v!=null}):c})})});Un.displayName=zn;var bs={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ms(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ws(e,t,n){const r=ms(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return bs[r]}function Wn(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ys(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xs=Bn,Cs=Un;function Rs(e,t){return i.useReducer((n,r)=>t[n][r]??n,e)}var Vn=e=>{const{present:t,children:n}=e,r=Ss(t),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),s=st(r.ref,Ds(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:s}):null};Vn.displayName="Presence";function Ss(e){const[t,n]=i.useState(),r=i.useRef(null),o=i.useRef(e),s=i.useRef("none"),c=e?"mounted":"unmounted",[a,l]=Rs(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const u=Qe(r.current);s.current=a==="mounted"?u:"none"},[a]),it(()=>{const u=r.current,d=o.current;if(d!==e){const h=s.current,g=Qe(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),it(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=g=>{const v=Qe(r.current).includes(g.animationName);if(g.target===t&&v&&(l("ANIMATION_END"),!o.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},h=g=>{g.target===t&&(s.current=Qe(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:i.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Qe(e){return(e==null?void 0:e.animationName)||"none"}function Ds(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ft="Tabs",[Es,ks]=Lt(ft,[$n]),Kn=$n(),[Is,Ft]=Es(ft),Gn=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:c="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=kn(a),[f,h]=_n({prop:r,onChange:o,defaultProp:s??"",caller:ft});return M.jsx(Is,{scope:n,baseId:Fn(),value:f,onValueChange:h,orientation:c,dir:d,activationMode:l,children:M.jsx(Ee.div,{dir:d,"data-orientation":c,...u,ref:t})})});Gn.displayName=ft;var Yn="TabsList",Xn=i.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=Ft(Yn,n),c=Kn(n);return M.jsx(xs,{asChild:!0,...c,orientation:s.orientation,dir:s.dir,loop:r,children:M.jsx(Ee.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Xn.displayName=Yn;var qn="TabsTrigger",Hn=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,c=Ft(qn,n),a=Kn(n),l=Zn(c.baseId,r),u=er(c.baseId,r),d=r===c.value;return M.jsx(Cs,{asChild:!0,...a,focusable:!o,active:d,children:M.jsx(Ee.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...s,ref:t,onMouseDown:ie(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?c.onValueChange(r):f.preventDefault()}),onKeyDown:ie(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&c.onValueChange(r)}),onFocus:ie(e.onFocus,()=>{const f=c.activationMode!=="manual";!d&&!o&&f&&c.onValueChange(r)})})})});Hn.displayName=qn;var Jn="TabsContent",Qn=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...c}=e,a=Ft(Jn,n),l=Zn(a.baseId,r),u=er(a.baseId,r),d=r===a.value,f=i.useRef(d);return i.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),M.jsx(Vn,{present:o||d,children:({present:h})=>M.jsx(Ee.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:u,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&s})})});Qn.displayName=Jn;function Zn(e,t){return`${e}-trigger-${t}`}function er(e,t){return`${e}-content-${t}`}var js=Gn,$s=Xn,Bs=Hn,zs=Qn;export{tt as C,Os as D,Cn as K,$s as L,Rn as P,js as R,Ls as S,Bs as T,Ms as a,As as b,Ns as c,zs as d,M as j,_s as s,Fs as u,Ps as v};
//# sourceMappingURL=ui-vendor-DYHpVWUc.js.map