@theroutingcompany/components 0.0.153 → 0.0.154

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -230,7 +230,7 @@ object-assign
230
230
  height: 18px;
231
231
  }
232
232
  }
233
- `,Th=y.createContext(void 0),Hu=()=>{const e=y.useContext(Th);if(!e)throw new Error("ActionMenu components must be used within an ActionMenu root");return e},Bh=y.forwardRef(function({children:t,closeOnOutsideClick:n=!0,triggerMoveBehavior:r="follow",size:o="small",align:i="right",autoAdjustAlign:u=!0},a){const[l,s]=y.useState(!1),c=y.useRef(null),d=y.useRef(null),p=y.useCallback(()=>{s(!1)},[]);return y.useEffect(()=>{if(!l||!n)return;const h=v=>{const g=v.target;c.current&&d.current&&!c.current.contains(g)&&!d.current.contains(g)&&p()};return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[l,n,p]),y.useEffect(()=>{if(!l)return;const h=v=>{var g;v.key==="Escape"&&(p(),(g=d.current)==null||g.focus())};return document.addEventListener("keydown",h),()=>{document.removeEventListener("keydown",h)}},[l,p]),m(Th.Provider,{value:{isOpen:l,setIsOpen:s,close:p,contentRef:c,triggerRef:d,closeOnOutsideClick:n,triggerMoveBehavior:r,size:o,align:i,autoAdjustAlign:u},children:m("div",{ref:a,children:t})})});Bh.displayName="ActionMenu";const Fh=y.forwardRef(function({children:t,"aria-label":n="View actions"},r){const{isOpen:o,setIsOpen:i,triggerRef:u,size:a}=Hu();return m("button",{ref:s=>{u.current=s,typeof r=="function"?r(s):r&&(r.current=s)},onClick:()=>{i(!o)},"aria-haspopup":"menu","aria-expanded":o,"aria-label":n,style:{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",width:a==="small"?"24px":"auto",height:a==="small"?"24px":"auto",padding:a==="small"?"0":"4px",borderRadius:"4px",transition:"background-color 100ms ease-out",fontSize:a==="small"?"16px":"20px"},children:t})});Fh.displayName="ActionMenuTrigger";const Ih=y.forwardRef(function({children:t},n){const{isOpen:r,contentRef:o,triggerRef:i,triggerMoveBehavior:u,close:a,align:l,autoAdjustAlign:s}=Hu(),[c,d]=y.useState({top:0,right:0}),[p,h]=y.useState(l),[v,g]=y.useState(16),$=y.useRef(null),x=y.useRef(200),E=y.useCallback(()=>{var O;if(!i.current)return;const C=i.current.getBoundingClientRect(),_=((O=o.current)==null?void 0:O.offsetWidth)||x.current;x.current=_;const k=C.left+C.width/2,S=8;let P=l,B=k-_/2;s?B<S?(B=S,P="left"):B+_>window.innerWidth-S?(B=window.innerWidth-_-S,P="right"):P=l:B=k-_/2,h(P);const I={top:C.bottom+8,left:B},T=k-B;g(Math.max(8,Math.min(_-8,T))),d(I),$.current=C},[i,o,l,s]);return y.useEffect(()=>{if(!r||!i.current)return;E();const C=new ResizeObserver(()=>{if(!$.current||!i.current){E();return}const k=i.current.getBoundingClientRect();(k.top!==$.current.top||k.left!==$.current.left||k.width!==$.current.width||k.height!==$.current.height)&&(u==="follow"?E():a())});C.observe(i.current);const _=()=>{u==="follow"?E():a()};return window.addEventListener("scroll",_,!0),window.addEventListener("resize",_),()=>{C.disconnect(),window.removeEventListener("scroll",_,!0),window.removeEventListener("resize",_)}},[r,i,u,E,a]),m(eo,{children:Q(yS,{ref:C=>{o.current=C,typeof n=="function"?n(C):n&&(n.current=C)},"data-state":r?"open":"closed",style:{top:`${c.top}px`,left:`${c.left}px`},children:[m(xS,{$position:v}),m($S,{role:"menu",children:t})]})})});Ih.displayName="ActionMenuContent";const Rh=y.forwardRef(function({children:t,onClick:n,disabled:r=!1,icon:o,title:i,"aria-label":u,hidden:a},l){const{close:s}=Hu(),c=()=>{r||(n==null||n(),s())},{size:d}=Hu();return Q(_S,{ref:l,onClick:c,disabled:r,"data-disabled":r,title:i,"aria-label":u,hidden:a,role:"menuitem","data-size":d,children:[o&&m("span",{children:o}),m("span",{children:t})]})});Rh.displayName="ActionMenuItem";function yt(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function DS(e,t=globalThis==null?void 0:globalThis.document){const n=yt(e);b.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ES="DismissableLayer",Os="dismissableLayer.update",CS="dismissableLayer.pointerDownOutside",wS="dismissableLayer.focusOutside",Mh,Oh=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),to=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:u,onDismiss:a,...l}=e,s=b.useContext(Oh),[c,d]=b.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=b.useState({}),v=Fe(t,P=>d(P)),g=Array.from(s.layers),[$]=[...s.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf($),E=c?g.indexOf(c):-1,C=s.layersWithOutsidePointerEventsDisabled.size>0,_=E>=x,k=PS(P=>{const B=P.target,I=[...s.branches].some(T=>T.contains(B));!_||I||(o==null||o(P),u==null||u(P),P.defaultPrevented||a==null||a())},p),S=kS(P=>{const B=P.target;[...s.branches].some(T=>T.contains(B))||(i==null||i(P),u==null||u(P),P.defaultPrevented||a==null||a())},p);return DS(P=>{E===s.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},p),b.useEffect(()=>{if(c)return n&&(s.layersWithOutsidePointerEventsDisabled.size===0&&(Mh=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),s.layersWithOutsidePointerEventsDisabled.add(c)),s.layers.add(c),Lh(),()=>{n&&s.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Mh)}},[c,p,n,s]),b.useEffect(()=>()=>{c&&(s.layers.delete(c),s.layersWithOutsidePointerEventsDisabled.delete(c),Lh())},[c,s]),b.useEffect(()=>{const P=()=>h({});return document.addEventListener(Os,P),()=>document.removeEventListener(Os,P)},[]),m($e.div,{...l,ref:v,style:{pointerEvents:C?_?"auto":"none":void 0,...e.style},onFocusCapture:se(e.onFocusCapture,S.onFocusCapture),onBlurCapture:se(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:se(e.onPointerDownCapture,k.onPointerDownCapture)})});to.displayName=ES;var SS="DismissableLayerBranch",Nh=b.forwardRef((e,t)=>{const n=b.useContext(Oh),r=b.useRef(null),o=Fe(t,r);return b.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),m($e.div,{...e,ref:o})});Nh.displayName=SS;function PS(e,t=globalThis==null?void 0:globalThis.document){const n=yt(e),r=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){zh(CS,n,s,{discrete:!0})};const s={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kS(e,t=globalThis==null?void 0:globalThis.document){const n=yt(e),r=b.useRef(!1);return b.useEffect(()=>{const o=i=>{i.target&&!r.current&&zh(wS,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Lh(){const e=new CustomEvent(Os);document.dispatchEvent(e)}function zh(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?xs(o,i):o.dispatchEvent(i)}var AS=to,TS=Nh,Ns="focusScope.autoFocusOnMount",Ls="focusScope.autoFocusOnUnmount",Kh={bubbles:!1,cancelable:!0},BS="FocusScope",Gu=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...u}=e,[a,l]=b.useState(null),s=yt(o),c=yt(i),d=b.useRef(null),p=Fe(t,g=>l(g)),h=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let g=function(C){if(h.paused||!a)return;const _=C.target;a.contains(_)?d.current=_:qn(d.current,{select:!0})},$=function(C){if(h.paused||!a)return;const _=C.relatedTarget;_!==null&&(a.contains(_)||qn(d.current,{select:!0}))},x=function(C){if(document.activeElement===document.body)for(const k of C)k.removedNodes.length>0&&qn(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",$);const E=new MutationObserver(x);return a&&E.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",$),E.disconnect()}}},[r,a,h.paused]),b.useEffect(()=>{if(a){Wh.add(h);const g=document.activeElement;if(!a.contains(g)){const x=new CustomEvent(Ns,Kh);a.addEventListener(Ns,s),a.dispatchEvent(x),x.defaultPrevented||(FS(NS(Vh(a)),{select:!0}),document.activeElement===g&&qn(a))}return()=>{a.removeEventListener(Ns,s),setTimeout(()=>{const x=new CustomEvent(Ls,Kh);a.addEventListener(Ls,c),a.dispatchEvent(x),x.defaultPrevented||qn(g??document.body,{select:!0}),a.removeEventListener(Ls,c),Wh.remove(h)},0)}}},[a,s,c,h]);const v=b.useCallback(g=>{if(!n&&!r||h.paused)return;const $=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if($&&x){const E=g.currentTarget,[C,_]=IS(E);C&&_?!g.shiftKey&&x===_?(g.preventDefault(),n&&qn(C,{select:!0})):g.shiftKey&&x===C&&(g.preventDefault(),n&&qn(_,{select:!0})):x===E&&g.preventDefault()}},[n,r,h.paused]);return m($e.div,{tabIndex:-1,...u,ref:p,onKeyDown:v})});Gu.displayName=BS;function FS(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qn(r,{select:t}),document.activeElement!==n)return}function IS(e){const t=Vh(e),n=jh(t,e),r=jh(t.reverse(),e);return[n,r]}function Vh(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function jh(e,t){for(const n of e)if(!RS(n,{upTo:t}))return n}function RS(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function MS(e){return e instanceof HTMLInputElement&&"select"in e}function qn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&MS(e)&&t&&e.select()}}var Wh=OS();function OS(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Uh(e,t),e.unshift(t)},remove(t){var n;e=Uh(e,t),(n=e[0])==null||n.resume()}}}function Uh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function NS(e){return e.filter(t=>t.tagName!=="A")}var LS="Portal",no=b.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=b.useState(!1);fn(()=>i(!0),[]);const u=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return u?qt.default.createPortal(m($e.div,{...r,ref:t}),u):null});no.displayName=LS;var zs=0;function Ks(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Hh()),document.body.insertAdjacentElement("beforeend",e[1]??Hh()),zs++,()=>{zs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zs--}},[])}function Hh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var mn=function(){return mn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},mn.apply(this,arguments)};function Gh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function zS(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Yu="right-scroll-bar-position",qu="width-before-scroll-bar",KS="with-scroll-bars-hidden",VS="--removed-body-scroll-bar-size";function Vs(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function jS(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var WS=typeof window<"u"?b.useLayoutEffect:b.useEffect,Yh=new WeakMap;function qh(e,t){var n=jS(t||null,function(r){return e.forEach(function(o){return Vs(o,r)})});return WS(function(){var r=Yh.get(n);if(r){var o=new Set(r),i=new Set(e),u=n.current;o.forEach(function(a){i.has(a)||Vs(a,null)}),i.forEach(function(a){o.has(a)||Vs(a,u)})}Yh.set(n,e)},[e]),n}function Xh(e){return e}function Zh(e,t){t===void 0&&(t=Xh);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var u=t(i,r);return n.push(u),function(){n=n.filter(function(a){return a!==u})}},assignSyncMedium:function(i){for(r=!0;n.length;){var u=n;n=[],u.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var u=[];if(n.length){var a=n;n=[],a.forEach(i),u=n}var l=function(){var c=u;u=[],c.forEach(i)},s=function(){return Promise.resolve().then(l)};s(),n={push:function(c){u.push(c),s()},filter:function(c){return u=u.filter(c),n}}}};return o}function js(e,t){return t===void 0&&(t=Xh),Zh(e,t)}function Jh(e){e===void 0&&(e={});var t=Zh(null);return t.options=mn({async:!0,ssr:!1},e),t}var Qh=function(e){var t=e.sideCar,n=Gh(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,mn({},n))};Qh.isSideCarExport=!0;function US(e,t){return e.useMedium(t),Qh}var eg=Jh(),Ws=function(){},Xu=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:Ws,onWheelCapture:Ws,onTouchMoveCapture:Ws}),o=r[0],i=r[1],u=e.forwardProps,a=e.children,l=e.className,s=e.removeScrollBar,c=e.enabled,d=e.shards,p=e.sideCar,h=e.noRelative,v=e.noIsolation,g=e.inert,$=e.allowPinchZoom,x=e.as,E=x===void 0?"div":x,C=e.gapMode,_=Gh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=p,S=qh([n,t]),P=mn(mn({},_),o);return b.createElement(b.Fragment,null,c&&b.createElement(k,{sideCar:eg,removeScrollBar:s,shards:d,noRelative:h,noIsolation:v,inert:g,setCallbacks:i,allowPinchZoom:!!$,lockRef:n,gapMode:C}),u?b.cloneElement(b.Children.only(a),mn(mn({},P),{ref:S})):b.createElement(E,mn({},P,{className:l,ref:S}),a))});Xu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Xu.classNames={fullWidth:qu,zeroRight:Yu};var tg,HS=function(){if(tg)return tg;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GS(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=HS();return t&&e.setAttribute("nonce",t),e}function YS(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qS(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var XS=function(){var e=0,t=null;return{add:function(n){e==0&&(t=GS())&&(YS(t,n),qS(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ZS=function(){var e=XS();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ng=function(){var e=ZS(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},JS={left:0,top:0,right:0,gap:0},Us=function(e){return parseInt(e||"",10)||0},QS=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Us(n),Us(r),Us(o)]},e7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return JS;var t=QS(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},t7=ng(),ro="data-scroll-locked",n7=function(e,t,n,r){var o=e.left,i=e.top,u=e.right,a=e.gap;return n===void 0&&(n="margin"),`
233
+ `,Th=y.createContext(void 0),Hu=()=>{const e=y.useContext(Th);if(!e)throw new Error("ActionMenu components must be used within an ActionMenu root");return e},Bh=y.forwardRef(function({children:t,closeOnOutsideClick:n=!0,triggerMoveBehavior:r="follow",size:o="small",align:i="right",autoAdjustAlign:u=!0},a){const[l,s]=y.useState(!1),c=y.useRef(null),d=y.useRef(null),p=y.useCallback(()=>{s(!1)},[]);return y.useEffect(()=>{if(!l||!n)return;const h=v=>{const g=v.target;c.current&&d.current&&!c.current.contains(g)&&!d.current.contains(g)&&p()};return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[l,n,p]),y.useEffect(()=>{if(!l)return;const h=v=>{var g;v.key==="Escape"&&(p(),(g=d.current)==null||g.focus())};return document.addEventListener("keydown",h),()=>{document.removeEventListener("keydown",h)}},[l,p]),m(Th.Provider,{value:{isOpen:l,setIsOpen:s,close:p,contentRef:c,triggerRef:d,closeOnOutsideClick:n,triggerMoveBehavior:r,size:o,align:i,autoAdjustAlign:u},children:m("div",{ref:a,children:t})})});Bh.displayName="ActionMenu";const Fh=y.forwardRef(function({children:t,"aria-label":n="View actions"},r){const{isOpen:o,setIsOpen:i,triggerRef:u,size:a}=Hu();return m("button",{ref:s=>{u.current=s,typeof r=="function"?r(s):r&&(r.current=s)},onClick:()=>{i(!o)},"aria-haspopup":"menu","aria-expanded":o,"aria-label":n,style:{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",width:a==="small"?"24px":"auto",height:a==="small"?"24px":"auto",padding:a==="small"?"0":"4px",borderRadius:"4px",transition:"background-color 100ms ease-out",fontSize:a==="small"?"16px":"20px"},children:t})});Fh.displayName="ActionMenuTrigger";const Ih=y.forwardRef(function({children:t},n){const{isOpen:r,contentRef:o,triggerRef:i,triggerMoveBehavior:u,close:a,align:l,autoAdjustAlign:s}=Hu(),[c,d]=y.useState({top:0,right:0}),[p,h]=y.useState(l),[v,g]=y.useState(16),$=y.useRef(null),x=y.useRef(200),E=y.useCallback(()=>{var O;if(!i.current)return;const C=i.current.getBoundingClientRect(),_=((O=o.current)==null?void 0:O.offsetWidth)||x.current;x.current=_;const k=C.left+C.width/2,S=8;let P=l,B=k-_/2;s?B<S?(B=S,P="left"):B+_>window.innerWidth-S?(B=window.innerWidth-_-S,P="right"):P=l:B=k-_/2,h(P);const I={top:C.bottom+8,left:B},T=k-B;g(Math.max(8,Math.min(_-8,T))),d(I),$.current=C},[i,o,l,s]);return y.useEffect(()=>{if(!r||!i.current)return;E();const C=new ResizeObserver(()=>{if(!$.current||!i.current){E();return}const k=i.current.getBoundingClientRect();(k.top!==$.current.top||k.left!==$.current.left||k.width!==$.current.width||k.height!==$.current.height)&&(u==="follow"?E():a())});C.observe(i.current);const _=()=>{u==="follow"?E():a()};return window.addEventListener("scroll",_,!0),window.addEventListener("resize",_),()=>{C.disconnect(),window.removeEventListener("scroll",_,!0),window.removeEventListener("resize",_)}},[r,i,u,E,a]),m(eo,{children:Q(yS,{ref:C=>{o.current=C,typeof n=="function"?n(C):n&&(n.current=C)},"data-state":r?"open":"closed",style:{top:`${c.top}px`,left:`${c.left}px`},children:[m(xS,{$position:v}),m($S,{role:"menu",children:t})]})})});Ih.displayName="ActionMenuContent";const Rh=y.forwardRef(function({children:t,onClick:n,disabled:r=!1,icon:o,title:i,"aria-label":u,hidden:a,style:l},s){const{close:c}=Hu(),d=()=>{r||(n==null||n(),c())},{size:p}=Hu();return Q(_S,{ref:s,onClick:d,disabled:r,"data-disabled":r,title:i,"aria-label":u,hidden:a,role:"menuitem","data-size":p,style:l,children:[o&&m("span",{children:o}),m("span",{style:{width:"100%"},children:t})]})});Rh.displayName="ActionMenuItem";function yt(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function DS(e,t=globalThis==null?void 0:globalThis.document){const n=yt(e);b.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ES="DismissableLayer",Os="dismissableLayer.update",CS="dismissableLayer.pointerDownOutside",wS="dismissableLayer.focusOutside",Mh,Oh=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),to=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:u,onDismiss:a,...l}=e,s=b.useContext(Oh),[c,d]=b.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=b.useState({}),v=Fe(t,P=>d(P)),g=Array.from(s.layers),[$]=[...s.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf($),E=c?g.indexOf(c):-1,C=s.layersWithOutsidePointerEventsDisabled.size>0,_=E>=x,k=PS(P=>{const B=P.target,I=[...s.branches].some(T=>T.contains(B));!_||I||(o==null||o(P),u==null||u(P),P.defaultPrevented||a==null||a())},p),S=kS(P=>{const B=P.target;[...s.branches].some(T=>T.contains(B))||(i==null||i(P),u==null||u(P),P.defaultPrevented||a==null||a())},p);return DS(P=>{E===s.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},p),b.useEffect(()=>{if(c)return n&&(s.layersWithOutsidePointerEventsDisabled.size===0&&(Mh=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),s.layersWithOutsidePointerEventsDisabled.add(c)),s.layers.add(c),Lh(),()=>{n&&s.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Mh)}},[c,p,n,s]),b.useEffect(()=>()=>{c&&(s.layers.delete(c),s.layersWithOutsidePointerEventsDisabled.delete(c),Lh())},[c,s]),b.useEffect(()=>{const P=()=>h({});return document.addEventListener(Os,P),()=>document.removeEventListener(Os,P)},[]),m($e.div,{...l,ref:v,style:{pointerEvents:C?_?"auto":"none":void 0,...e.style},onFocusCapture:se(e.onFocusCapture,S.onFocusCapture),onBlurCapture:se(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:se(e.onPointerDownCapture,k.onPointerDownCapture)})});to.displayName=ES;var SS="DismissableLayerBranch",Nh=b.forwardRef((e,t)=>{const n=b.useContext(Oh),r=b.useRef(null),o=Fe(t,r);return b.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),m($e.div,{...e,ref:o})});Nh.displayName=SS;function PS(e,t=globalThis==null?void 0:globalThis.document){const n=yt(e),r=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){zh(CS,n,s,{discrete:!0})};const s={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kS(e,t=globalThis==null?void 0:globalThis.document){const n=yt(e),r=b.useRef(!1);return b.useEffect(()=>{const o=i=>{i.target&&!r.current&&zh(wS,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Lh(){const e=new CustomEvent(Os);document.dispatchEvent(e)}function zh(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?xs(o,i):o.dispatchEvent(i)}var AS=to,TS=Nh,Ns="focusScope.autoFocusOnMount",Ls="focusScope.autoFocusOnUnmount",Kh={bubbles:!1,cancelable:!0},BS="FocusScope",Gu=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...u}=e,[a,l]=b.useState(null),s=yt(o),c=yt(i),d=b.useRef(null),p=Fe(t,g=>l(g)),h=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let g=function(C){if(h.paused||!a)return;const _=C.target;a.contains(_)?d.current=_:qn(d.current,{select:!0})},$=function(C){if(h.paused||!a)return;const _=C.relatedTarget;_!==null&&(a.contains(_)||qn(d.current,{select:!0}))},x=function(C){if(document.activeElement===document.body)for(const k of C)k.removedNodes.length>0&&qn(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",$);const E=new MutationObserver(x);return a&&E.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",$),E.disconnect()}}},[r,a,h.paused]),b.useEffect(()=>{if(a){Wh.add(h);const g=document.activeElement;if(!a.contains(g)){const x=new CustomEvent(Ns,Kh);a.addEventListener(Ns,s),a.dispatchEvent(x),x.defaultPrevented||(FS(NS(Vh(a)),{select:!0}),document.activeElement===g&&qn(a))}return()=>{a.removeEventListener(Ns,s),setTimeout(()=>{const x=new CustomEvent(Ls,Kh);a.addEventListener(Ls,c),a.dispatchEvent(x),x.defaultPrevented||qn(g??document.body,{select:!0}),a.removeEventListener(Ls,c),Wh.remove(h)},0)}}},[a,s,c,h]);const v=b.useCallback(g=>{if(!n&&!r||h.paused)return;const $=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if($&&x){const E=g.currentTarget,[C,_]=IS(E);C&&_?!g.shiftKey&&x===_?(g.preventDefault(),n&&qn(C,{select:!0})):g.shiftKey&&x===C&&(g.preventDefault(),n&&qn(_,{select:!0})):x===E&&g.preventDefault()}},[n,r,h.paused]);return m($e.div,{tabIndex:-1,...u,ref:p,onKeyDown:v})});Gu.displayName=BS;function FS(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qn(r,{select:t}),document.activeElement!==n)return}function IS(e){const t=Vh(e),n=jh(t,e),r=jh(t.reverse(),e);return[n,r]}function Vh(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function jh(e,t){for(const n of e)if(!RS(n,{upTo:t}))return n}function RS(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function MS(e){return e instanceof HTMLInputElement&&"select"in e}function qn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&MS(e)&&t&&e.select()}}var Wh=OS();function OS(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Uh(e,t),e.unshift(t)},remove(t){var n;e=Uh(e,t),(n=e[0])==null||n.resume()}}}function Uh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function NS(e){return e.filter(t=>t.tagName!=="A")}var LS="Portal",no=b.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=b.useState(!1);fn(()=>i(!0),[]);const u=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return u?qt.default.createPortal(m($e.div,{...r,ref:t}),u):null});no.displayName=LS;var zs=0;function Ks(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Hh()),document.body.insertAdjacentElement("beforeend",e[1]??Hh()),zs++,()=>{zs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zs--}},[])}function Hh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var mn=function(){return mn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},mn.apply(this,arguments)};function Gh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function zS(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Yu="right-scroll-bar-position",qu="width-before-scroll-bar",KS="with-scroll-bars-hidden",VS="--removed-body-scroll-bar-size";function Vs(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function jS(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var WS=typeof window<"u"?b.useLayoutEffect:b.useEffect,Yh=new WeakMap;function qh(e,t){var n=jS(t||null,function(r){return e.forEach(function(o){return Vs(o,r)})});return WS(function(){var r=Yh.get(n);if(r){var o=new Set(r),i=new Set(e),u=n.current;o.forEach(function(a){i.has(a)||Vs(a,null)}),i.forEach(function(a){o.has(a)||Vs(a,u)})}Yh.set(n,e)},[e]),n}function Xh(e){return e}function Zh(e,t){t===void 0&&(t=Xh);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var u=t(i,r);return n.push(u),function(){n=n.filter(function(a){return a!==u})}},assignSyncMedium:function(i){for(r=!0;n.length;){var u=n;n=[],u.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var u=[];if(n.length){var a=n;n=[],a.forEach(i),u=n}var l=function(){var c=u;u=[],c.forEach(i)},s=function(){return Promise.resolve().then(l)};s(),n={push:function(c){u.push(c),s()},filter:function(c){return u=u.filter(c),n}}}};return o}function js(e,t){return t===void 0&&(t=Xh),Zh(e,t)}function Jh(e){e===void 0&&(e={});var t=Zh(null);return t.options=mn({async:!0,ssr:!1},e),t}var Qh=function(e){var t=e.sideCar,n=Gh(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,mn({},n))};Qh.isSideCarExport=!0;function US(e,t){return e.useMedium(t),Qh}var eg=Jh(),Ws=function(){},Xu=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:Ws,onWheelCapture:Ws,onTouchMoveCapture:Ws}),o=r[0],i=r[1],u=e.forwardProps,a=e.children,l=e.className,s=e.removeScrollBar,c=e.enabled,d=e.shards,p=e.sideCar,h=e.noRelative,v=e.noIsolation,g=e.inert,$=e.allowPinchZoom,x=e.as,E=x===void 0?"div":x,C=e.gapMode,_=Gh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=p,S=qh([n,t]),P=mn(mn({},_),o);return b.createElement(b.Fragment,null,c&&b.createElement(k,{sideCar:eg,removeScrollBar:s,shards:d,noRelative:h,noIsolation:v,inert:g,setCallbacks:i,allowPinchZoom:!!$,lockRef:n,gapMode:C}),u?b.cloneElement(b.Children.only(a),mn(mn({},P),{ref:S})):b.createElement(E,mn({},P,{className:l,ref:S}),a))});Xu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Xu.classNames={fullWidth:qu,zeroRight:Yu};var tg,HS=function(){if(tg)return tg;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GS(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=HS();return t&&e.setAttribute("nonce",t),e}function YS(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qS(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var XS=function(){var e=0,t=null;return{add:function(n){e==0&&(t=GS())&&(YS(t,n),qS(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ZS=function(){var e=XS();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ng=function(){var e=ZS(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},JS={left:0,top:0,right:0,gap:0},Us=function(e){return parseInt(e||"",10)||0},QS=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Us(n),Us(r),Us(o)]},e7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return JS;var t=QS(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},t7=ng(),ro="data-scroll-locked",n7=function(e,t,n,r){var o=e.left,i=e.top,u=e.right,a=e.gap;return n===void 0&&(n="margin"),`
234
234
  .`.concat(KS,` {
235
235
  overflow: hidden `).concat(r,`;
236
236
  padding-right: `).concat(a,"px ").concat(r,`;