@gardenfi/garden-book 0.2.6 → 0.2.7

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.
@@ -8,6 +8,7 @@ declare const modalStyles: (props?: ({
8
8
  type ModalProps = VariantProps<typeof modalStyles> & {
9
9
  onClose?: () => void;
10
10
  children: React.ReactNode;
11
+ disableScrollLock?: boolean;
11
12
  };
12
13
  declare const Modal: React.FC<ModalProps> & {
13
14
  Children: React.FC<ChildrenProps>;
package/dist/ui.cjs.js CHANGED
@@ -38,7 +38,7 @@
38
38
  `)},Q3=function(){var e=parseInt(document.body.getAttribute(ke)||"0",10);return isFinite(e)?e:0},ni=function(){j.useEffect(function(){return document.body.setAttribute(ke,(Q3()+1).toString()),function(){var e=Q3()-1;e<=0?document.body.removeAttribute(ke):document.body.setAttribute(ke,e.toString())}},[])},ri=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;ni();var i=j.useMemo(function(){return Jo(o)},[o]);return j.createElement(ei,{styles:ti(i,!t,o,n?"":"!important")})},N2=!1;if(typeof window<"u")try{var jt=Object.defineProperty({},"passive",{get:function(){return N2=!0,!0}});window.addEventListener("test",jt,jt),window.removeEventListener("test",jt,jt)}catch{N2=!1}var Le=N2?{passive:!1}:!1,oi=function(e){return e.tagName==="TEXTAREA"},zr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!oi(e)&&n[t]==="visible")},ii=function(e){return zr(e,"overflowY")},si=function(e){return zr(e,"overflowX")},J3=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Gr(e,r);if(o){var i=Kr(e,r),a=i[1],l=i[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ai=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},li=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Gr=function(e,t){return e==="v"?ii(t):si(t)},Kr=function(e,t){return e==="v"?ai(t):li(t)},ci=function(e,t){return e==="h"&&t==="rtl"?-1:1},ui=function(e,t,n,r,o){var i=ci(e,window.getComputedStyle(t).direction),a=i*r,l=n.target,c=t.contains(l),u=!1,f=a>0,d=0,h=0;do{var g=Kr(e,l),w=g[0],C=g[1],y=g[2],m=C-y-i*w;(w||m)&&Gr(e,l)&&(d+=m,h+=w),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(f&&(Math.abs(d)<1||!o)||!f&&(Math.abs(h)<1||!o))&&(u=!0),u},St=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},en=function(e){return[e.deltaX,e.deltaY]},tn=function(e){return e&&"current"in e?e.current:e},fi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},di=function(e){return`
39
39
  .block-interactivity-`.concat(e,` {pointer-events: none;}
40
40
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
- `)},hi=0,Me=[];function Ci(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),o=j.useState(hi++)[0],i=j.useState(Wr)[0],a=j.useRef(e);j.useEffect(function(){a.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var C=Ao([e.lockRef.current],(e.shards||[]).map(tn),!0).filter(Boolean);return C.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),C.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=j.useCallback(function(C,y){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!a.current.allowPinchZoom;var m=St(C),S=n.current,L="deltaX"in C?C.deltaX:S[0]-m[0],T="deltaY"in C?C.deltaY:S[1]-m[1],E,D=C.target,k=Math.abs(L)>Math.abs(T)?"h":"v";if("touches"in C&&k==="h"&&D.type==="range")return!1;var H=J3(k,D);if(!H)return!0;if(H?E=k:(E=k==="v"?"h":"v",H=J3(k,D)),!H)return!1;if(!r.current&&"changedTouches"in C&&(L||T)&&(r.current=E),!E)return!0;var A=r.current||E;return ui(A,y,C,A==="h"?L:T,!0)},[]),c=j.useCallback(function(C){var y=C;if(!(!Me.length||Me[Me.length-1]!==i)){var m="deltaY"in y?en(y):St(y),S=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&fi(E.delta,m)})[0];if(S&&S.should){y.cancelable&&y.preventDefault();return}if(!S){var L=(a.current.shards||[]).map(tn).filter(Boolean).filter(function(E){return E.contains(y.target)}),T=L.length>0?l(y,L[0]):!a.current.noIsolation;T&&y.cancelable&&y.preventDefault()}}},[]),u=j.useCallback(function(C,y,m,S){var L={name:C,delta:y,target:m,should:S,shadowParent:pi(m)};t.current.push(L),setTimeout(function(){t.current=t.current.filter(function(T){return T!==L})},1)},[]),f=j.useCallback(function(C){n.current=St(C),r.current=void 0},[]),d=j.useCallback(function(C){u(C.type,en(C),C.target,l(C,e.lockRef.current))},[]),h=j.useCallback(function(C){u(C.type,St(C),C.target,l(C,e.lockRef.current))},[]);j.useEffect(function(){return Me.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Le),document.addEventListener("touchmove",c,Le),document.addEventListener("touchstart",f,Le),function(){Me=Me.filter(function(C){return C!==i}),document.removeEventListener("wheel",c,Le),document.removeEventListener("touchmove",c,Le),document.removeEventListener("touchstart",f,Le)}},[]);var g=e.removeScrollBar,w=e.inert;return j.createElement(j.Fragment,null,w?j.createElement(i,{styles:di(o)}):null,g?j.createElement(ri,{gapMode:e.gapMode}):null)}function pi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const gi=$o($r,Ci);var Jt=j.forwardRef(function(e,t){return j.createElement(Qt,ee({},e,{ref:t,sideCar:gi}))});Jt.classNames=Qt.classNames;const mi=Ze("gf-fixed gf-inset-y-0 gf-right-0 gf-transition-transform gf-duration-200 gf-bg-white gf-backdrop-blur-sm gf-p-4",{variants:{open:{true:"gf-translate-x-0",false:"gf-translate-x-full"},size:{small:"gf-w-full md:gf-w-[360px]",large:"gf-w-full md:gf-w-[480px]"}},defaultVariants:{open:!1}}),vi=({open:e,size:t,children:n,className:r,...o})=>s.jsx(dt,{children:s.jsx(Jt,{removeScrollBar:!1,enabled:!!e,children:s.jsx(ht,{level:"medium",className:V1(mi({open:e,size:t,className:r})),...o,children:n})})}),yi=Ze(["gf-fixed gf-inset-0 gf-z-50 gf-flex gf-items-center gf-justify-center gf-min-h-screen gf-transition-all"],{variants:{open:{true:"gf-bg-black",false:"gf-opacity-0 gf-pointer-events-none"}},defaultVariants:{open:!1}}),Xr=({open:e,onClose:t,children:n})=>{const[r,o]=x.useState(!1);x.useEffect(()=>{e&&o(!0)},[e]);const i=a=>{t&&(a.stopPropagation(),t())};return s.jsx(dt,{children:s.jsx(Jt,{removeScrollBar:!1,enabled:!!e,children:s.jsx("div",{className:`gf-bg-dark-grey gf-bg-opacity-40 ${yi({open:e})} ${r?e?"gf-animate-fade-in ":"gf-animate-fade-out":""}`,onClick:i,children:s.jsx("div",{className:`gf-transform gf-transition-transform ${e?"gf-animate-scale-in":"gf-animate-scale-out"}`,children:n})})})})},xi=({children:e,className:t,opacityLevel:n,...r})=>{const o=i=>{i.stopPropagation()};return s.jsx(ht,{level:n,onClick:o,className:`gf-mx-auto gf-backdrop-blur-md gf-overscroll-contain ${t||""}`,...r,children:e})};Xr.Children=xi;function te(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 nn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wi(...e){return t=>{let n=!1;const r=e.map(o=>{const i=nn(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():nn(e[o],null)}}}}function oe(...e){return j.useCallback(wi(...e),e)}function bi(e,t){const n=j.createContext(t),r=i=>{const{children:a,...l}=i,c=j.useMemo(()=>l,Object.values(l));return s.jsx(n.Provider,{value:c,children:a})};r.displayName=e+"Provider";function o(i){const a=j.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Li(e,t=[]){let n=[];function r(i,a){const l=j.createContext(a),c=n.length;n=[...n,a];const u=d=>{var m;const{scope:h,children:g,...w}=d,C=((m=h==null?void 0:h[e])==null?void 0:m[c])||l,y=j.useMemo(()=>w,Object.values(w));return s.jsx(C.Provider,{value:y,children:g})};u.displayName=i+"Provider";function f(d,h){var C;const g=((C=h==null?void 0:h[e])==null?void 0:C[c])||l,w=j.useContext(g);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,f]}const o=()=>{const i=n.map(a=>j.createContext(a));return function(l){const c=(l==null?void 0:l[e])||i;return j.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[r,Mi(o,...t)]}function Mi(...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(i){const a=r.reduce((l,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...l,...d}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var st=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},Vi=j[" useId ".trim().toString()]||(()=>{}),ji=0;function m2(e){const[t,n]=j.useState(Vi());return st(()=>{e||n(r=>r??String(ji++))},[e]),e||(t?`radix-${t}`:"")}var Si=j[" useInsertionEffect ".trim().toString()]||st;function Ti({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=Pi({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:o;{const f=j.useRef(e!==void 0);j.useEffect(()=>{const d=f.current;d!==l&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${l?"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.`),f.current=l},[l,r])}const u=j.useCallback(f=>{var d;if(l){const h=Hi(f)?f(e):f;h!==e&&((d=a.current)==null||d.call(a,h))}else i(f)},[l,e,i,a]);return[c,u]}function Pi({defaultProp:e,onChange:t}){const[n,r]=j.useState(e),o=j.useRef(n),i=j.useRef(t);return Si(()=>{i.current=t},[t]),j.useEffect(()=>{var a;o.current!==n&&((a=i.current)==null||a.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Hi(e){return typeof e=="function"}function Yr(e){const t=Ei(e),n=j.forwardRef((r,o)=>{const{children:i,...a}=r,l=j.Children.toArray(i),c=l.find(Ri);if(c){const u=c.props.children,f=l.map(d=>d===c?j.Children.count(u)>1?j.Children.only(null):j.isValidElement(u)?u.props.children:null:d);return s.jsx(t,{...a,ref:o,children:j.isValidElement(u)?j.cloneElement(u,void 0,f):null})}return s.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ei(e){const t=j.forwardRef((n,r)=>{const{children:o,...i}=n,a=j.isValidElement(o)?Oi(o):void 0,l=oe(a,r);if(j.isValidElement(o)){const c=Ai(i,o.props);return o.type!==j.Fragment&&(c.ref=l),j.cloneElement(o,c)}return j.Children.count(o)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ki=Symbol("radix.slottable");function Ri(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ki}function Ai(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Oi(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 Di=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],K1=Di.reduce((e,t)=>{const n=Yr(`Primitive.${t}`),r=j.forwardRef((o,i)=>{const{asChild:a,...l}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Zi(e,t){e&&D0.flushSync(()=>e.dispatchEvent(t))}function at(e){const t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ii(e,t=globalThis==null?void 0:globalThis.document){const n=at(e);j.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 _i="DismissableLayer",F2="dismissableLayer.update",Bi="dismissableLayer.pointerDownOutside",Ni="dismissableLayer.focusOutside",rn,qr=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qr=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...c}=e,u=j.useContext(qr),[f,d]=j.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=j.useState({}),w=oe(t,k=>d(k)),C=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=C.indexOf(y),S=f?C.indexOf(f):-1,L=u.layersWithOutsidePointerEventsDisabled.size>0,T=S>=m,E=$i(k=>{const H=k.target,A=[...u.branches].some(_=>_.contains(H));!T||A||(o==null||o(k),a==null||a(k),k.defaultPrevented||l==null||l())},h),D=Wi(k=>{const H=k.target;[...u.branches].some(_=>_.contains(H))||(i==null||i(k),a==null||a(k),k.defaultPrevented||l==null||l())},h);return Ii(k=>{S===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},h),j.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(rn=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),on(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=rn)}},[f,h,n,u]),j.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),on())},[f,u]),j.useEffect(()=>{const k=()=>g({});return document.addEventListener(F2,k),()=>document.removeEventListener(F2,k)},[]),s.jsx(K1.div,{...c,ref:w,style:{pointerEvents:L?T?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,D.onFocusCapture),onBlurCapture:te(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,E.onPointerDownCapture)})});Qr.displayName=_i;var Fi="DismissableLayerBranch",Ui=j.forwardRef((e,t)=>{const n=j.useContext(qr),r=j.useRef(null),o=oe(t,r);return j.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(K1.div,{...e,ref:o})});Ui.displayName=Fi;function $i(e,t=globalThis==null?void 0:globalThis.document){const n=at(e),r=j.useRef(!1),o=j.useRef(()=>{});return j.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){Jr(Bi,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Wi(e,t=globalThis==null?void 0:globalThis.document){const n=at(e),r=j.useRef(!1);return j.useEffect(()=>{const o=i=>{i.target&&!r.current&&Jr(Ni,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 on(){const e=new CustomEvent(F2);document.dispatchEvent(e)}function Jr(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?Zi(o,i):o.dispatchEvent(i)}var v2="focusScope.autoFocusOnMount",y2="focusScope.autoFocusOnUnmount",sn={bubbles:!1,cancelable:!0},zi="FocusScope",e6=j.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,c]=j.useState(null),u=at(o),f=at(i),d=j.useRef(null),h=oe(t,C=>c(C)),g=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let C=function(L){if(g.paused||!l)return;const T=L.target;l.contains(T)?d.current=T:Q1(d.current,{select:!0})},y=function(L){if(g.paused||!l)return;const T=L.relatedTarget;T!==null&&(l.contains(T)||Q1(d.current,{select:!0}))},m=function(L){if(document.activeElement===document.body)for(const E of L)E.removedNodes.length>0&&Q1(l)};document.addEventListener("focusin",C),document.addEventListener("focusout",y);const S=new MutationObserver(m);return l&&S.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",y),S.disconnect()}}},[r,l,g.paused]),j.useEffect(()=>{if(l){ln.add(g);const C=document.activeElement;if(!l.contains(C)){const m=new CustomEvent(v2,sn);l.addEventListener(v2,u),l.dispatchEvent(m),m.defaultPrevented||(Gi(Qi(t6(l)),{select:!0}),document.activeElement===C&&Q1(l))}return()=>{l.removeEventListener(v2,u),setTimeout(()=>{const m=new CustomEvent(y2,sn);l.addEventListener(y2,f),l.dispatchEvent(m),m.defaultPrevented||Q1(C??document.body,{select:!0}),l.removeEventListener(y2,f),ln.remove(g)},0)}}},[l,u,f,g]);const w=j.useCallback(C=>{if(!n&&!r||g.paused)return;const y=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,m=document.activeElement;if(y&&m){const S=C.currentTarget,[L,T]=Ki(S);L&&T?!C.shiftKey&&m===T?(C.preventDefault(),n&&Q1(L,{select:!0})):C.shiftKey&&m===L&&(C.preventDefault(),n&&Q1(T,{select:!0})):m===S&&C.preventDefault()}},[n,r,g.paused]);return s.jsx(K1.div,{tabIndex:-1,...a,ref:h,onKeyDown:w})});e6.displayName=zi;function Gi(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Q1(r,{select:t}),document.activeElement!==n)return}function Ki(e){const t=t6(e),n=an(t,e),r=an(t.reverse(),e);return[n,r]}function t6(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 an(e,t){for(const n of e)if(!Xi(n,{upTo:t}))return n}function Xi(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 Yi(e){return e instanceof HTMLInputElement&&"select"in e}function Q1(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Yi(e)&&t&&e.select()}}var ln=qi();function qi(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=cn(e,t),e.unshift(t)},remove(t){var n;e=cn(e,t),(n=e[0])==null||n.resume()}}}function cn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Qi(e){return e.filter(t=>t.tagName!=="A")}var Ji="Portal",n6=j.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[o,i]=j.useState(!1);st(()=>i(!0),[]);const a=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?Rr.createPortal(s.jsx(K1.div,{...r,ref:t}),a):null});n6.displayName=Ji;function es(e,t){return j.useReducer((n,r)=>t[n][r]??n,e)}var e2=e=>{const{present:t,children:n}=e,r=ts(t),o=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),i=oe(r.ref,ns(o));return typeof n=="function"||r.isPresent?j.cloneElement(o,{ref:i}):null};e2.displayName="Presence";function ts(e){const[t,n]=j.useState(),r=j.useRef(null),o=j.useRef(e),i=j.useRef("none"),a=e?"mounted":"unmounted",[l,c]=es(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const u=Tt(r.current);i.current=l==="mounted"?u:"none"},[l]),st(()=>{const u=r.current,f=o.current;if(f!==e){const h=i.current,g=Tt(u);e?c("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),st(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=g=>{const C=Tt(r.current).includes(g.animationName);if(g.target===t&&C&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=g=>{g.target===t&&(i.current=Tt(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:j.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Tt(e){return(e==null?void 0:e.animationName)||"none"}function ns(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 x2=0;function rs(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??un()),document.body.insertAdjacentElement("beforeend",e[1]??un()),x2++,()=>{x2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),x2--}},[])}function un(){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 os=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ve=new WeakMap,Pt=new WeakMap,Ht={},w2=0,r6=function(e){return e&&(e.host||r6(e.parentNode))},is=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=r6(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ss=function(e,t,n,r){var o=is(t,Array.isArray(e)?e:[e]);Ht[n]||(Ht[n]=new WeakMap);var i=Ht[n],a=[],l=new Set,c=new Set(o),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};o.forEach(u);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(h){if(l.has(h))f(h);else try{var g=h.getAttribute(r),w=g!==null&&g!=="false",C=(Ve.get(h)||0)+1,y=(i.get(h)||0)+1;Ve.set(h,C),i.set(h,y),a.push(h),C===1&&w&&Pt.set(h,!0),y===1&&h.setAttribute(n,"true"),w||h.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",h,m)}})};return f(t),l.clear(),w2++,function(){a.forEach(function(d){var h=Ve.get(d)-1,g=i.get(d)-1;Ve.set(d,h),i.set(d,g),h||(Pt.has(d)||d.removeAttribute(r),Pt.delete(d)),g||d.removeAttribute(n)}),w2--,w2||(Ve=new WeakMap,Ve=new WeakMap,Pt=new WeakMap,Ht={})}},as=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=os(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),ss(r,o,n,"aria-hidden")):function(){return null}},t2="Dialog",[o6,Nc]=Li(t2),[ls,A1]=o6(t2),i6=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=j.useRef(null),c=j.useRef(null),[u,f]=Ti({prop:r,defaultProp:o??!1,onChange:i,caller:t2});return s.jsx(ls,{scope:t,triggerRef:l,contentRef:c,contentId:m2(),titleId:m2(),descriptionId:m2(),open:u,onOpenChange:f,onOpenToggle:j.useCallback(()=>f(d=>!d),[f]),modal:a,children:n})};i6.displayName=t2;var s6="DialogTrigger",a6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=A1(s6,n),i=oe(t,o.triggerRef);return s.jsx(K1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":u3(o.open),...r,ref:i,onClick:te(e.onClick,o.onOpenToggle)})});a6.displayName=s6;var l3="DialogPortal",[cs,l6]=o6(l3,{forceMount:void 0}),c6=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=A1(l3,t);return s.jsx(cs,{scope:t,forceMount:n,children:j.Children.map(r,a=>s.jsx(e2,{present:n||i.open,children:s.jsx(n6,{asChild:!0,container:o,children:a})}))})};c6.displayName=l3;var Wt="DialogOverlay",u6=j.forwardRef((e,t)=>{const n=l6(Wt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=A1(Wt,e.__scopeDialog);return i.modal?s.jsx(e2,{present:r||i.open,children:s.jsx(fs,{...o,ref:t})}):null});u6.displayName=Wt;var us=Yr("DialogOverlay.RemoveScroll"),fs=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=A1(Wt,n);return s.jsx(Jt,{as:us,allowPinchZoom:!0,shards:[o.contentRef],children:s.jsx(K1.div,{"data-state":u3(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),pe="DialogContent",f6=j.forwardRef((e,t)=>{const n=l6(pe,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=A1(pe,e.__scopeDialog);return s.jsx(e2,{present:r||i.open,children:i.modal?s.jsx(ds,{...o,ref:t}):s.jsx(hs,{...o,ref:t})})});f6.displayName=pe;var ds=j.forwardRef((e,t)=>{const n=A1(pe,e.__scopeDialog),r=j.useRef(null),o=oe(t,n.contentRef,r);return j.useEffect(()=>{const i=r.current;if(i)return as(i)},[]),s.jsx(d6,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&i.preventDefault()}),onFocusOutside:te(e.onFocusOutside,i=>i.preventDefault())})}),hs=j.forwardRef((e,t)=>{const n=A1(pe,e.__scopeDialog),r=j.useRef(!1),o=j.useRef(!1);return s.jsx(d6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),d6=j.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,l=A1(pe,n),c=j.useRef(null),u=oe(t,c);return rs(),s.jsxs(s.Fragment,{children:[s.jsx(e6,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:s.jsx(Qr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":u3(l.open),...a,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(Cs,{titleId:l.titleId}),s.jsx(gs,{contentRef:c,descriptionId:l.descriptionId})]})]})}),c3="DialogTitle",h6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=A1(c3,n);return s.jsx(K1.h2,{id:o.titleId,...r,ref:t})});h6.displayName=c3;var C6="DialogDescription",p6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=A1(C6,n);return s.jsx(K1.p,{id:o.descriptionId,...r,ref:t})});p6.displayName=C6;var g6="DialogClose",m6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=A1(g6,n);return s.jsx(K1.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});m6.displayName=g6;function u3(e){return e?"open":"closed"}var v6="DialogTitleWarning",[Fc,y6]=bi(v6,{contentName:pe,titleName:c3,docsSlug:"dialog"}),Cs=({titleId:e})=>{const t=y6(v6),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
41
+ `)},hi=0,Me=[];function Ci(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),o=j.useState(hi++)[0],i=j.useState(Wr)[0],a=j.useRef(e);j.useEffect(function(){a.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var C=Ao([e.lockRef.current],(e.shards||[]).map(tn),!0).filter(Boolean);return C.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),C.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=j.useCallback(function(C,y){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!a.current.allowPinchZoom;var m=St(C),S=n.current,L="deltaX"in C?C.deltaX:S[0]-m[0],T="deltaY"in C?C.deltaY:S[1]-m[1],E,D=C.target,k=Math.abs(L)>Math.abs(T)?"h":"v";if("touches"in C&&k==="h"&&D.type==="range")return!1;var H=J3(k,D);if(!H)return!0;if(H?E=k:(E=k==="v"?"h":"v",H=J3(k,D)),!H)return!1;if(!r.current&&"changedTouches"in C&&(L||T)&&(r.current=E),!E)return!0;var A=r.current||E;return ui(A,y,C,A==="h"?L:T,!0)},[]),c=j.useCallback(function(C){var y=C;if(!(!Me.length||Me[Me.length-1]!==i)){var m="deltaY"in y?en(y):St(y),S=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&fi(E.delta,m)})[0];if(S&&S.should){y.cancelable&&y.preventDefault();return}if(!S){var L=(a.current.shards||[]).map(tn).filter(Boolean).filter(function(E){return E.contains(y.target)}),T=L.length>0?l(y,L[0]):!a.current.noIsolation;T&&y.cancelable&&y.preventDefault()}}},[]),u=j.useCallback(function(C,y,m,S){var L={name:C,delta:y,target:m,should:S,shadowParent:pi(m)};t.current.push(L),setTimeout(function(){t.current=t.current.filter(function(T){return T!==L})},1)},[]),f=j.useCallback(function(C){n.current=St(C),r.current=void 0},[]),d=j.useCallback(function(C){u(C.type,en(C),C.target,l(C,e.lockRef.current))},[]),h=j.useCallback(function(C){u(C.type,St(C),C.target,l(C,e.lockRef.current))},[]);j.useEffect(function(){return Me.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Le),document.addEventListener("touchmove",c,Le),document.addEventListener("touchstart",f,Le),function(){Me=Me.filter(function(C){return C!==i}),document.removeEventListener("wheel",c,Le),document.removeEventListener("touchmove",c,Le),document.removeEventListener("touchstart",f,Le)}},[]);var g=e.removeScrollBar,w=e.inert;return j.createElement(j.Fragment,null,w?j.createElement(i,{styles:di(o)}):null,g?j.createElement(ri,{gapMode:e.gapMode}):null)}function pi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const gi=$o($r,Ci);var Jt=j.forwardRef(function(e,t){return j.createElement(Qt,ee({},e,{ref:t,sideCar:gi}))});Jt.classNames=Qt.classNames;const mi=Ze("gf-fixed gf-inset-y-0 gf-right-0 gf-transition-transform gf-duration-200 gf-bg-white gf-backdrop-blur-sm gf-p-4",{variants:{open:{true:"gf-translate-x-0",false:"gf-translate-x-full"},size:{small:"gf-w-full md:gf-w-[360px]",large:"gf-w-full md:gf-w-[480px]"}},defaultVariants:{open:!1}}),vi=({open:e,size:t,children:n,className:r,...o})=>s.jsx(dt,{children:s.jsx(Jt,{removeScrollBar:!1,enabled:!!e,children:s.jsx(ht,{level:"medium",className:V1(mi({open:e,size:t,className:r})),...o,children:n})})}),yi=Ze(["gf-fixed gf-inset-0 gf-z-50 gf-flex gf-items-center gf-justify-center gf-min-h-screen gf-transition-all"],{variants:{open:{true:"gf-bg-black",false:"gf-opacity-0 gf-pointer-events-none"}},defaultVariants:{open:!1}}),Xr=({open:e,onClose:t,disableScrollLock:n,children:r})=>{const[o,i]=x.useState(!1);x.useEffect(()=>{e&&i(!0)},[e]);const a=l=>{t&&(l.stopPropagation(),t())};return s.jsx(dt,{children:s.jsx(Jt,{removeScrollBar:!1,enabled:!!e&&!n,children:s.jsx("div",{className:`gf-bg-dark-grey gf-bg-opacity-40 ${yi({open:e})} ${o?e?"gf-animate-fade-in ":"gf-animate-fade-out":""}`,onClick:a,children:s.jsx("div",{className:`gf-transform gf-transition-transform ${e?"gf-animate-scale-in":"gf-animate-scale-out"}`,children:r})})})})},xi=({children:e,className:t,opacityLevel:n,...r})=>{const o=i=>{i.stopPropagation()};return s.jsx(ht,{level:n,onClick:o,className:`gf-mx-auto gf-backdrop-blur-md gf-overscroll-contain ${t||""}`,...r,children:e})};Xr.Children=xi;function te(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 nn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wi(...e){return t=>{let n=!1;const r=e.map(o=>{const i=nn(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():nn(e[o],null)}}}}function oe(...e){return j.useCallback(wi(...e),e)}function bi(e,t){const n=j.createContext(t),r=i=>{const{children:a,...l}=i,c=j.useMemo(()=>l,Object.values(l));return s.jsx(n.Provider,{value:c,children:a})};r.displayName=e+"Provider";function o(i){const a=j.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Li(e,t=[]){let n=[];function r(i,a){const l=j.createContext(a),c=n.length;n=[...n,a];const u=d=>{var m;const{scope:h,children:g,...w}=d,C=((m=h==null?void 0:h[e])==null?void 0:m[c])||l,y=j.useMemo(()=>w,Object.values(w));return s.jsx(C.Provider,{value:y,children:g})};u.displayName=i+"Provider";function f(d,h){var C;const g=((C=h==null?void 0:h[e])==null?void 0:C[c])||l,w=j.useContext(g);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,f]}const o=()=>{const i=n.map(a=>j.createContext(a));return function(l){const c=(l==null?void 0:l[e])||i;return j.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[r,Mi(o,...t)]}function Mi(...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(i){const a=r.reduce((l,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...l,...d}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var st=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},Vi=j[" useId ".trim().toString()]||(()=>{}),ji=0;function m2(e){const[t,n]=j.useState(Vi());return st(()=>{e||n(r=>r??String(ji++))},[e]),e||(t?`radix-${t}`:"")}var Si=j[" useInsertionEffect ".trim().toString()]||st;function Ti({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=Pi({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:o;{const f=j.useRef(e!==void 0);j.useEffect(()=>{const d=f.current;d!==l&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${l?"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.`),f.current=l},[l,r])}const u=j.useCallback(f=>{var d;if(l){const h=Hi(f)?f(e):f;h!==e&&((d=a.current)==null||d.call(a,h))}else i(f)},[l,e,i,a]);return[c,u]}function Pi({defaultProp:e,onChange:t}){const[n,r]=j.useState(e),o=j.useRef(n),i=j.useRef(t);return Si(()=>{i.current=t},[t]),j.useEffect(()=>{var a;o.current!==n&&((a=i.current)==null||a.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Hi(e){return typeof e=="function"}function Yr(e){const t=Ei(e),n=j.forwardRef((r,o)=>{const{children:i,...a}=r,l=j.Children.toArray(i),c=l.find(Ri);if(c){const u=c.props.children,f=l.map(d=>d===c?j.Children.count(u)>1?j.Children.only(null):j.isValidElement(u)?u.props.children:null:d);return s.jsx(t,{...a,ref:o,children:j.isValidElement(u)?j.cloneElement(u,void 0,f):null})}return s.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ei(e){const t=j.forwardRef((n,r)=>{const{children:o,...i}=n,a=j.isValidElement(o)?Oi(o):void 0,l=oe(a,r);if(j.isValidElement(o)){const c=Ai(i,o.props);return o.type!==j.Fragment&&(c.ref=l),j.cloneElement(o,c)}return j.Children.count(o)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ki=Symbol("radix.slottable");function Ri(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ki}function Ai(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Oi(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 Di=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],K1=Di.reduce((e,t)=>{const n=Yr(`Primitive.${t}`),r=j.forwardRef((o,i)=>{const{asChild:a,...l}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Zi(e,t){e&&D0.flushSync(()=>e.dispatchEvent(t))}function at(e){const t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ii(e,t=globalThis==null?void 0:globalThis.document){const n=at(e);j.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 _i="DismissableLayer",F2="dismissableLayer.update",Bi="dismissableLayer.pointerDownOutside",Ni="dismissableLayer.focusOutside",rn,qr=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qr=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...c}=e,u=j.useContext(qr),[f,d]=j.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=j.useState({}),w=oe(t,k=>d(k)),C=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=C.indexOf(y),S=f?C.indexOf(f):-1,L=u.layersWithOutsidePointerEventsDisabled.size>0,T=S>=m,E=$i(k=>{const H=k.target,A=[...u.branches].some(_=>_.contains(H));!T||A||(o==null||o(k),a==null||a(k),k.defaultPrevented||l==null||l())},h),D=Wi(k=>{const H=k.target;[...u.branches].some(_=>_.contains(H))||(i==null||i(k),a==null||a(k),k.defaultPrevented||l==null||l())},h);return Ii(k=>{S===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},h),j.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(rn=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),on(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=rn)}},[f,h,n,u]),j.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),on())},[f,u]),j.useEffect(()=>{const k=()=>g({});return document.addEventListener(F2,k),()=>document.removeEventListener(F2,k)},[]),s.jsx(K1.div,{...c,ref:w,style:{pointerEvents:L?T?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,D.onFocusCapture),onBlurCapture:te(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,E.onPointerDownCapture)})});Qr.displayName=_i;var Fi="DismissableLayerBranch",Ui=j.forwardRef((e,t)=>{const n=j.useContext(qr),r=j.useRef(null),o=oe(t,r);return j.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(K1.div,{...e,ref:o})});Ui.displayName=Fi;function $i(e,t=globalThis==null?void 0:globalThis.document){const n=at(e),r=j.useRef(!1),o=j.useRef(()=>{});return j.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){Jr(Bi,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Wi(e,t=globalThis==null?void 0:globalThis.document){const n=at(e),r=j.useRef(!1);return j.useEffect(()=>{const o=i=>{i.target&&!r.current&&Jr(Ni,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 on(){const e=new CustomEvent(F2);document.dispatchEvent(e)}function Jr(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?Zi(o,i):o.dispatchEvent(i)}var v2="focusScope.autoFocusOnMount",y2="focusScope.autoFocusOnUnmount",sn={bubbles:!1,cancelable:!0},zi="FocusScope",e6=j.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,c]=j.useState(null),u=at(o),f=at(i),d=j.useRef(null),h=oe(t,C=>c(C)),g=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let C=function(L){if(g.paused||!l)return;const T=L.target;l.contains(T)?d.current=T:Q1(d.current,{select:!0})},y=function(L){if(g.paused||!l)return;const T=L.relatedTarget;T!==null&&(l.contains(T)||Q1(d.current,{select:!0}))},m=function(L){if(document.activeElement===document.body)for(const E of L)E.removedNodes.length>0&&Q1(l)};document.addEventListener("focusin",C),document.addEventListener("focusout",y);const S=new MutationObserver(m);return l&&S.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",y),S.disconnect()}}},[r,l,g.paused]),j.useEffect(()=>{if(l){ln.add(g);const C=document.activeElement;if(!l.contains(C)){const m=new CustomEvent(v2,sn);l.addEventListener(v2,u),l.dispatchEvent(m),m.defaultPrevented||(Gi(Qi(t6(l)),{select:!0}),document.activeElement===C&&Q1(l))}return()=>{l.removeEventListener(v2,u),setTimeout(()=>{const m=new CustomEvent(y2,sn);l.addEventListener(y2,f),l.dispatchEvent(m),m.defaultPrevented||Q1(C??document.body,{select:!0}),l.removeEventListener(y2,f),ln.remove(g)},0)}}},[l,u,f,g]);const w=j.useCallback(C=>{if(!n&&!r||g.paused)return;const y=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,m=document.activeElement;if(y&&m){const S=C.currentTarget,[L,T]=Ki(S);L&&T?!C.shiftKey&&m===T?(C.preventDefault(),n&&Q1(L,{select:!0})):C.shiftKey&&m===L&&(C.preventDefault(),n&&Q1(T,{select:!0})):m===S&&C.preventDefault()}},[n,r,g.paused]);return s.jsx(K1.div,{tabIndex:-1,...a,ref:h,onKeyDown:w})});e6.displayName=zi;function Gi(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Q1(r,{select:t}),document.activeElement!==n)return}function Ki(e){const t=t6(e),n=an(t,e),r=an(t.reverse(),e);return[n,r]}function t6(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 an(e,t){for(const n of e)if(!Xi(n,{upTo:t}))return n}function Xi(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 Yi(e){return e instanceof HTMLInputElement&&"select"in e}function Q1(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Yi(e)&&t&&e.select()}}var ln=qi();function qi(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=cn(e,t),e.unshift(t)},remove(t){var n;e=cn(e,t),(n=e[0])==null||n.resume()}}}function cn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Qi(e){return e.filter(t=>t.tagName!=="A")}var Ji="Portal",n6=j.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[o,i]=j.useState(!1);st(()=>i(!0),[]);const a=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?Rr.createPortal(s.jsx(K1.div,{...r,ref:t}),a):null});n6.displayName=Ji;function es(e,t){return j.useReducer((n,r)=>t[n][r]??n,e)}var e2=e=>{const{present:t,children:n}=e,r=ts(t),o=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),i=oe(r.ref,ns(o));return typeof n=="function"||r.isPresent?j.cloneElement(o,{ref:i}):null};e2.displayName="Presence";function ts(e){const[t,n]=j.useState(),r=j.useRef(null),o=j.useRef(e),i=j.useRef("none"),a=e?"mounted":"unmounted",[l,c]=es(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const u=Tt(r.current);i.current=l==="mounted"?u:"none"},[l]),st(()=>{const u=r.current,f=o.current;if(f!==e){const h=i.current,g=Tt(u);e?c("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),st(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=g=>{const C=Tt(r.current).includes(g.animationName);if(g.target===t&&C&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=g=>{g.target===t&&(i.current=Tt(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:j.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Tt(e){return(e==null?void 0:e.animationName)||"none"}function ns(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 x2=0;function rs(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??un()),document.body.insertAdjacentElement("beforeend",e[1]??un()),x2++,()=>{x2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),x2--}},[])}function un(){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 os=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ve=new WeakMap,Pt=new WeakMap,Ht={},w2=0,r6=function(e){return e&&(e.host||r6(e.parentNode))},is=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=r6(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ss=function(e,t,n,r){var o=is(t,Array.isArray(e)?e:[e]);Ht[n]||(Ht[n]=new WeakMap);var i=Ht[n],a=[],l=new Set,c=new Set(o),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};o.forEach(u);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(h){if(l.has(h))f(h);else try{var g=h.getAttribute(r),w=g!==null&&g!=="false",C=(Ve.get(h)||0)+1,y=(i.get(h)||0)+1;Ve.set(h,C),i.set(h,y),a.push(h),C===1&&w&&Pt.set(h,!0),y===1&&h.setAttribute(n,"true"),w||h.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",h,m)}})};return f(t),l.clear(),w2++,function(){a.forEach(function(d){var h=Ve.get(d)-1,g=i.get(d)-1;Ve.set(d,h),i.set(d,g),h||(Pt.has(d)||d.removeAttribute(r),Pt.delete(d)),g||d.removeAttribute(n)}),w2--,w2||(Ve=new WeakMap,Ve=new WeakMap,Pt=new WeakMap,Ht={})}},as=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=os(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),ss(r,o,n,"aria-hidden")):function(){return null}},t2="Dialog",[o6,Nc]=Li(t2),[ls,A1]=o6(t2),i6=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=j.useRef(null),c=j.useRef(null),[u,f]=Ti({prop:r,defaultProp:o??!1,onChange:i,caller:t2});return s.jsx(ls,{scope:t,triggerRef:l,contentRef:c,contentId:m2(),titleId:m2(),descriptionId:m2(),open:u,onOpenChange:f,onOpenToggle:j.useCallback(()=>f(d=>!d),[f]),modal:a,children:n})};i6.displayName=t2;var s6="DialogTrigger",a6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=A1(s6,n),i=oe(t,o.triggerRef);return s.jsx(K1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":u3(o.open),...r,ref:i,onClick:te(e.onClick,o.onOpenToggle)})});a6.displayName=s6;var l3="DialogPortal",[cs,l6]=o6(l3,{forceMount:void 0}),c6=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=A1(l3,t);return s.jsx(cs,{scope:t,forceMount:n,children:j.Children.map(r,a=>s.jsx(e2,{present:n||i.open,children:s.jsx(n6,{asChild:!0,container:o,children:a})}))})};c6.displayName=l3;var Wt="DialogOverlay",u6=j.forwardRef((e,t)=>{const n=l6(Wt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=A1(Wt,e.__scopeDialog);return i.modal?s.jsx(e2,{present:r||i.open,children:s.jsx(fs,{...o,ref:t})}):null});u6.displayName=Wt;var us=Yr("DialogOverlay.RemoveScroll"),fs=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=A1(Wt,n);return s.jsx(Jt,{as:us,allowPinchZoom:!0,shards:[o.contentRef],children:s.jsx(K1.div,{"data-state":u3(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),pe="DialogContent",f6=j.forwardRef((e,t)=>{const n=l6(pe,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=A1(pe,e.__scopeDialog);return s.jsx(e2,{present:r||i.open,children:i.modal?s.jsx(ds,{...o,ref:t}):s.jsx(hs,{...o,ref:t})})});f6.displayName=pe;var ds=j.forwardRef((e,t)=>{const n=A1(pe,e.__scopeDialog),r=j.useRef(null),o=oe(t,n.contentRef,r);return j.useEffect(()=>{const i=r.current;if(i)return as(i)},[]),s.jsx(d6,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&i.preventDefault()}),onFocusOutside:te(e.onFocusOutside,i=>i.preventDefault())})}),hs=j.forwardRef((e,t)=>{const n=A1(pe,e.__scopeDialog),r=j.useRef(!1),o=j.useRef(!1);return s.jsx(d6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),d6=j.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,l=A1(pe,n),c=j.useRef(null),u=oe(t,c);return rs(),s.jsxs(s.Fragment,{children:[s.jsx(e6,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:s.jsx(Qr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":u3(l.open),...a,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(Cs,{titleId:l.titleId}),s.jsx(gs,{contentRef:c,descriptionId:l.descriptionId})]})]})}),c3="DialogTitle",h6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=A1(c3,n);return s.jsx(K1.h2,{id:o.titleId,...r,ref:t})});h6.displayName=c3;var C6="DialogDescription",p6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=A1(C6,n);return s.jsx(K1.p,{id:o.descriptionId,...r,ref:t})});p6.displayName=C6;var g6="DialogClose",m6=j.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=A1(g6,n);return s.jsx(K1.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});m6.displayName=g6;function u3(e){return e?"open":"closed"}var v6="DialogTitleWarning",[Fc,y6]=bi(v6,{contentName:pe,titleName:c3,docsSlug:"dialog"}),Cs=({titleId:e})=>{const t=y6(v6),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
42
 
43
43
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
44
 
package/dist/ui.es.js CHANGED
@@ -3487,26 +3487,26 @@ const ho = $e(
3487
3487
  open: !1
3488
3488
  }
3489
3489
  }
3490
- ), Co = ({ open: e, onClose: t, children: n }) => {
3491
- const [r, i] = M1(!1);
3490
+ ), Co = ({ open: e, onClose: t, disableScrollLock: n, children: r }) => {
3491
+ const [i, o] = M1(!1);
3492
3492
  S1(() => {
3493
- e && i(!0);
3493
+ e && o(!0);
3494
3494
  }, [e]);
3495
- const o = (s) => {
3496
- t && (s.stopPropagation(), t());
3495
+ const s = (l) => {
3496
+ t && (l.stopPropagation(), t());
3497
3497
  };
3498
- return /* @__PURE__ */ a(i2, { children: /* @__PURE__ */ a(a2, { removeScrollBar: !1, enabled: !!e, children: /* @__PURE__ */ a(
3498
+ return /* @__PURE__ */ a(i2, { children: /* @__PURE__ */ a(a2, { removeScrollBar: !1, enabled: !!e && !n, children: /* @__PURE__ */ a(
3499
3499
  "div",
3500
3500
  {
3501
3501
  className: `gf-bg-dark-grey gf-bg-opacity-40 ${po({
3502
3502
  open: e
3503
- })} ${r ? e ? "gf-animate-fade-in " : "gf-animate-fade-out" : ""}`,
3504
- onClick: o,
3503
+ })} ${i ? e ? "gf-animate-fade-in " : "gf-animate-fade-out" : ""}`,
3504
+ onClick: s,
3505
3505
  children: /* @__PURE__ */ a(
3506
3506
  "div",
3507
3507
  {
3508
3508
  className: `gf-transform gf-transition-transform ${e ? "gf-animate-scale-in" : "gf-animate-scale-out"}`,
3509
- children: n
3509
+ children: r
3510
3510
  }
3511
3511
  )
3512
3512
  }
package/dist/ui.umd.js CHANGED
@@ -38,7 +38,7 @@
38
38
  `)},getCurrentUseCounter=function(){var e=parseInt(document.body.getAttribute(lockAttribute)||"0",10);return isFinite(e)?e:0},useLockAttribute=function(){React__namespace.useEffect(function(){return document.body.setAttribute(lockAttribute,(getCurrentUseCounter()+1).toString()),function(){var e=getCurrentUseCounter()-1;e<=0?document.body.removeAttribute(lockAttribute):document.body.setAttribute(lockAttribute,e.toString())}},[])},RemoveScrollBar=function(e){var t=e.noRelative,i=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;useLockAttribute();var a=React__namespace.useMemo(function(){return getGapWidth(s)},[s]);return React__namespace.createElement(Style,{styles:getStyles(a,!t,s,i?"":"!important")})},passiveSupported=!1;if(typeof window<"u")try{var options=Object.defineProperty({},"passive",{get:function(){return passiveSupported=!0,!0}});window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch{passiveSupported=!1}var nonPassive=passiveSupported?{passive:!1}:!1,alwaysContainsScroll=function(e){return e.tagName==="TEXTAREA"},elementCanBeScrolled=function(e,t){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return i[t]!=="hidden"&&!(i.overflowY===i.overflowX&&!alwaysContainsScroll(e)&&i[t]==="visible")},elementCouldBeVScrolled=function(e){return elementCanBeScrolled(e,"overflowY")},elementCouldBeHScrolled=function(e){return elementCanBeScrolled(e,"overflowX")},locationCouldBeScrolled=function(e,t){var i=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=elementCouldBeScrolled(e,n);if(s){var a=getScrollVariables(e,n),o=a[1],l=a[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==i.body);return!1},getVScrollVariables=function(e){var t=e.scrollTop,i=e.scrollHeight,n=e.clientHeight;return[t,i,n]},getHScrollVariables=function(e){var t=e.scrollLeft,i=e.scrollWidth,n=e.clientWidth;return[t,i,n]},elementCouldBeScrolled=function(e,t){return e==="v"?elementCouldBeVScrolled(t):elementCouldBeHScrolled(t)},getScrollVariables=function(e,t){return e==="v"?getVScrollVariables(t):getHScrollVariables(t)},getDirectionFactor=function(e,t){return e==="h"&&t==="rtl"?-1:1},handleScroll=function(e,t,i,n,s){var a=getDirectionFactor(e,window.getComputedStyle(t).direction),o=a*n,l=i.target,c=t.contains(l),u=!1,f=o>0,d=0,p=0;do{var b=getScrollVariables(e,l),C=b[0],y=b[1],R=b[2],m=y-R-a*C;(C||m)&&elementCouldBeScrolled(e,l)&&(d+=m,p+=C),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(f&&(Math.abs(d)<1||!s)||!f&&(Math.abs(p)<1||!s))&&(u=!0),u},getTouchXY=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(e){return[e.deltaX,e.deltaY]},extractRef=function(e){return e&&"current"in e?e.current:e},deltaCompare=function(e,t){return e[0]===t[0]&&e[1]===t[1]},generateStyle=function(e){return`
39
39
  .block-interactivity-`.concat(e,` {pointer-events: none;}
40
40
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
- `)},idCounter=0,lockStack=[];function RemoveScrollSideCar(e){var t=React__namespace.useRef([]),i=React__namespace.useRef([0,0]),n=React__namespace.useRef(),s=React__namespace.useState(idCounter++)[0],a=React__namespace.useState(styleSingleton)[0],o=React__namespace.useRef(e);React__namespace.useEffect(function(){o.current=e},[e]),React__namespace.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=__spreadArray([e.lockRef.current],(e.shards||[]).map(extractRef),!0).filter(Boolean);return y.forEach(function(R){return R.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=React__namespace.useCallback(function(y,R){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var m=getTouchXY(y),x=i.current,g="deltaX"in y?y.deltaX:x[0]-m[0],S="deltaY"in y?y.deltaY:x[1]-m[1],E,M=y.target,L=Math.abs(g)>Math.abs(S)?"h":"v";if("touches"in y&&L==="h"&&M.type==="range")return!1;var _=locationCouldBeScrolled(L,M);if(!_)return!0;if(_?E=L:(E=L==="v"?"h":"v",_=locationCouldBeScrolled(L,M)),!_)return!1;if(!n.current&&"changedTouches"in y&&(g||S)&&(n.current=E),!E)return!0;var I=n.current||E;return handleScroll(I,R,y,I==="h"?g:S,!0)},[]),c=React__namespace.useCallback(function(y){var R=y;if(!(!lockStack.length||lockStack[lockStack.length-1]!==a)){var m="deltaY"in R?getDeltaXY(R):getTouchXY(R),x=t.current.filter(function(E){return E.name===R.type&&(E.target===R.target||R.target===E.shadowParent)&&deltaCompare(E.delta,m)})[0];if(x&&x.should){R.cancelable&&R.preventDefault();return}if(!x){var g=(o.current.shards||[]).map(extractRef).filter(Boolean).filter(function(E){return E.contains(R.target)}),S=g.length>0?l(R,g[0]):!o.current.noIsolation;S&&R.cancelable&&R.preventDefault()}}},[]),u=React__namespace.useCallback(function(y,R,m,x){var g={name:y,delta:R,target:m,should:x,shadowParent:getOutermostShadowParent(m)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(S){return S!==g})},1)},[]),f=React__namespace.useCallback(function(y){i.current=getTouchXY(y),n.current=void 0},[]),d=React__namespace.useCallback(function(y){u(y.type,getDeltaXY(y),y.target,l(y,e.lockRef.current))},[]),p=React__namespace.useCallback(function(y){u(y.type,getTouchXY(y),y.target,l(y,e.lockRef.current))},[]);React__namespace.useEffect(function(){return lockStack.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",c,nonPassive),document.addEventListener("touchmove",c,nonPassive),document.addEventListener("touchstart",f,nonPassive),function(){lockStack=lockStack.filter(function(y){return y!==a}),document.removeEventListener("wheel",c,nonPassive),document.removeEventListener("touchmove",c,nonPassive),document.removeEventListener("touchstart",f,nonPassive)}},[]);var b=e.removeScrollBar,C=e.inert;return React__namespace.createElement(React__namespace.Fragment,null,C?React__namespace.createElement(a,{styles:generateStyle(s)}):null,b?React__namespace.createElement(RemoveScrollBar,{gapMode:e.gapMode}):null)}function getOutermostShadowParent(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=React__namespace.forwardRef(function(e,t){return React__namespace.createElement(RemoveScroll,__assign$1({},e,{ref:t,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;const sidebarStyles=cva("gf-fixed gf-inset-y-0 gf-right-0 gf-transition-transform gf-duration-200 gf-bg-white gf-backdrop-blur-sm gf-p-4",{variants:{open:{true:"gf-translate-x-0",false:"gf-translate-x-full"},size:{small:"gf-w-full md:gf-w-[360px]",large:"gf-w-full md:gf-w-[480px]"}},defaultVariants:{open:!1}}),Sidebar=({open:e,size:t,children:i,className:n,...s})=>jsxRuntime.jsx(ClientOnly,{children:jsxRuntime.jsx(ReactRemoveScroll,{removeScrollBar:!1,enabled:!!e,children:jsxRuntime.jsx(Opacity,{level:"medium",className:cn(sidebarStyles({open:e,size:t,className:n})),...s,children:i})})}),modalStyles=cva(["gf-fixed gf-inset-0 gf-z-50 gf-flex gf-items-center gf-justify-center gf-min-h-screen gf-transition-all"],{variants:{open:{true:"gf-bg-black",false:"gf-opacity-0 gf-pointer-events-none"}},defaultVariants:{open:!1}}),Modal=({open:e,onClose:t,children:i})=>{const[n,s]=React.useState(!1);React.useEffect(()=>{e&&s(!0)},[e]);const a=o=>{t&&(o.stopPropagation(),t())};return jsxRuntime.jsx(ClientOnly,{children:jsxRuntime.jsx(ReactRemoveScroll,{removeScrollBar:!1,enabled:!!e,children:jsxRuntime.jsx("div",{className:`gf-bg-dark-grey gf-bg-opacity-40 ${modalStyles({open:e})} ${n?e?"gf-animate-fade-in ":"gf-animate-fade-out":""}`,onClick:a,children:jsxRuntime.jsx("div",{className:`gf-transform gf-transition-transform ${e?"gf-animate-scale-in":"gf-animate-scale-out"}`,children:i})})})})},Children=({children:e,className:t,opacityLevel:i,...n})=>{const s=a=>{a.stopPropagation()};return jsxRuntime.jsx(Opacity,{level:i,onClick:s,className:`gf-mx-auto gf-backdrop-blur-md gf-overscroll-contain ${t||""}`,...n,children:e})};Modal.Children=Children;function composeEventHandlers(e,t,{checkForDefaultPrevented:i=!0}={}){return function(s){if(e==null||e(s),i===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function setRef$1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function composeRefs$1(...e){return t=>{let i=!1;const n=e.map(s=>{const a=setRef$1(s,t);return!i&&typeof a=="function"&&(i=!0),a});if(i)return()=>{for(let s=0;s<n.length;s++){const a=n[s];typeof a=="function"?a():setRef$1(e[s],null)}}}}function useComposedRefs$1(...e){return React__namespace.useCallback(composeRefs$1(...e),e)}function createContext2(e,t){const i=React__namespace.createContext(t),n=a=>{const{children:o,...l}=a,c=React__namespace.useMemo(()=>l,Object.values(l));return jsxRuntime.jsx(i.Provider,{value:c,children:o})};n.displayName=e+"Provider";function s(a){const o=React__namespace.useContext(i);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,s]}function createContextScope(e,t=[]){let i=[];function n(a,o){const l=React__namespace.createContext(o),c=i.length;i=[...i,o];const u=d=>{var m;const{scope:p,children:b,...C}=d,y=((m=p==null?void 0:p[e])==null?void 0:m[c])||l,R=React__namespace.useMemo(()=>C,Object.values(C));return jsxRuntime.jsx(y.Provider,{value:R,children:b})};u.displayName=a+"Provider";function f(d,p){var y;const b=((y=p==null?void 0:p[e])==null?void 0:y[c])||l,C=React__namespace.useContext(b);if(C)return C;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[u,f]}const s=()=>{const a=i.map(o=>React__namespace.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return React__namespace.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,composeContextScopes(s,...t)]}function composeContextScopes(...e){const t=e[0];if(e.length===1)return t;const i=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const d=c(a)[`__scope${u}`];return{...l,...d}},{});return React__namespace.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return i.scopeName=t.scopeName,i}var useLayoutEffect2=globalThis!=null&&globalThis.document?React__namespace.useLayoutEffect:()=>{},useReactId=React__namespace[" useId ".trim().toString()]||(()=>{}),count$1=0;function useId(e){const[t,i]=React__namespace.useState(useReactId());return useLayoutEffect2(()=>{e||i(n=>n??String(count$1++))},[e]),e||(t?`radix-${t}`:"")}var useInsertionEffect=React__namespace[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState$1({prop:e,defaultProp:t,onChange:i=()=>{},caller:n}){const[s,a,o]=useUncontrolledState$1({defaultProp:t,onChange:i}),l=e!==void 0,c=l?e:s;{const f=React__namespace.useRef(e!==void 0);React__namespace.useEffect(()=>{const d=f.current;d!==l&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${l?"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.`),f.current=l},[l,n])}const u=React__namespace.useCallback(f=>{var d;if(l){const p=isFunction(f)?f(e):f;p!==e&&((d=o.current)==null||d.call(o,p))}else a(f)},[l,e,a,o]);return[c,u]}function useUncontrolledState$1({defaultProp:e,onChange:t}){const[i,n]=React__namespace.useState(e),s=React__namespace.useRef(i),a=React__namespace.useRef(t);return useInsertionEffect(()=>{a.current=t},[t]),React__namespace.useEffect(()=>{var o;s.current!==i&&((o=a.current)==null||o.call(a,i),s.current=i)},[i,s]),[i,n,a]}function isFunction(e){return typeof e=="function"}function createSlot(e){const t=createSlotClone(e),i=React__namespace.forwardRef((n,s)=>{const{children:a,...o}=n,l=React__namespace.Children.toArray(a),c=l.find(isSlottable);if(c){const u=c.props.children,f=l.map(d=>d===c?React__namespace.Children.count(u)>1?React__namespace.Children.only(null):React__namespace.isValidElement(u)?u.props.children:null:d);return jsxRuntime.jsx(t,{...o,ref:s,children:React__namespace.isValidElement(u)?React__namespace.cloneElement(u,void 0,f):null})}return jsxRuntime.jsx(t,{...o,ref:s,children:a})});return i.displayName=`${e}.Slot`,i}function createSlotClone(e){const t=React__namespace.forwardRef((i,n)=>{const{children:s,...a}=i,o=React__namespace.isValidElement(s)?getElementRef$1(s):void 0,l=useComposedRefs$1(o,n);if(React__namespace.isValidElement(s)){const c=mergeProps(a,s.props);return s.type!==React__namespace.Fragment&&(c.ref=l),React__namespace.cloneElement(s,c)}return React__namespace.Children.count(s)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function isSlottable(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER}function mergeProps(e,t){const i={...t};for(const n in t){const s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?i[n]=(...l)=>{const c=a(...l);return s(...l),c}:s&&(i[n]=s):n==="style"?i[n]={...s,...a}:n==="className"&&(i[n]=[s,a].filter(Boolean).join(" "))}return{...e,...i}}function getElementRef$1(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,i=t&&"isReactWarning"in t&&t.isReactWarning;return i?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,i=t&&"isReactWarning"in t&&t.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive=NODES.reduce((e,t)=>{const i=createSlot(`Primitive.${t}`),n=React__namespace.forwardRef((s,a)=>{const{asChild:o,...l}=s,c=o?i:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntime.jsx(c,{...l,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function dispatchDiscreteCustomEvent(e,t){e&&ReactDOM__namespace.flushSync(()=>e.dispatchEvent(t))}function useCallbackRef$1(e){const t=React__namespace.useRef(e);return React__namespace.useEffect(()=>{t.current=e}),React__namespace.useMemo(()=>(...i)=>{var n;return(n=t.current)==null?void 0:n.call(t,...i)},[])}function useEscapeKeydown(e,t=globalThis==null?void 0:globalThis.document){const i=useCallbackRef$1(e);React__namespace.useEffect(()=>{const n=s=>{s.key==="Escape"&&i(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[i,t])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=React__namespace.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=React__namespace.forwardRef((e,t)=>{const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=React__namespace.useContext(DismissableLayerContext),[f,d]=React__namespace.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=React__namespace.useState({}),C=useComposedRefs$1(t,L=>d(L)),y=Array.from(u.layers),[R]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=y.indexOf(R),x=f?y.indexOf(f):-1,g=u.layersWithOutsidePointerEventsDisabled.size>0,S=x>=m,E=usePointerDownOutside(L=>{const _=L.target,I=[...u.branches].some($=>$.contains(_));!S||I||(s==null||s(L),o==null||o(L),L.defaultPrevented||l==null||l())},p),M=useFocusOutside(L=>{const _=L.target;[...u.branches].some($=>$.contains(_))||(a==null||a(L),o==null||o(L),L.defaultPrevented||l==null||l())},p);return useEscapeKeydown(L=>{x===u.layers.size-1&&(n==null||n(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},p),React__namespace.useEffect(()=>{if(f)return i&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),dispatchUpdate(),()=>{i&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=originalBodyPointerEvents)}},[f,p,i,u]),React__namespace.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),dispatchUpdate())},[f,u]),React__namespace.useEffect(()=>{const L=()=>b({});return document.addEventListener(CONTEXT_UPDATE,L),()=>document.removeEventListener(CONTEXT_UPDATE,L)},[]),jsxRuntime.jsx(Primitive.div,{...c,ref:C,style:{pointerEvents:g?S?"auto":"none":void 0,...e.style},onFocusCapture:composeEventHandlers(e.onFocusCapture,M.onFocusCapture),onBlurCapture:composeEventHandlers(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:composeEventHandlers(e.onPointerDownCapture,E.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=React__namespace.forwardRef((e,t)=>{const i=React__namespace.useContext(DismissableLayerContext),n=React__namespace.useRef(null),s=useComposedRefs$1(t,n);return React__namespace.useEffect(()=>{const a=n.current;if(a)return i.branches.add(a),()=>{i.branches.delete(a)}},[i.branches]),jsxRuntime.jsx(Primitive.div,{...e,ref:s})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(e,t=globalThis==null?void 0:globalThis.document){const i=useCallbackRef$1(e),n=React__namespace.useRef(!1),s=React__namespace.useRef(()=>{});return React__namespace.useEffect(()=>{const a=l=>{if(l.target&&!n.current){let c=function(){handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE,i,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,i]),{onPointerDownCapture:()=>n.current=!0}}function useFocusOutside(e,t=globalThis==null?void 0:globalThis.document){const i=useCallbackRef$1(e),n=React__namespace.useRef(!1);return React__namespace.useEffect(()=>{const s=a=>{a.target&&!n.current&&handleAndDispatchCustomEvent(FOCUS_OUTSIDE,i,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,i]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function dispatchUpdate(){const e=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(e)}function handleAndDispatchCustomEvent(e,t,i,{discrete:n}){const s=i.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});t&&s.addEventListener(e,t,{once:!0}),n?dispatchDiscreteCustomEvent(s,a):s.dispatchEvent(a)}var AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=React__namespace.forwardRef((e,t)=>{const{loop:i=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=React__namespace.useState(null),u=useCallbackRef$1(s),f=useCallbackRef$1(a),d=React__namespace.useRef(null),p=useComposedRefs$1(t,y=>c(y)),b=React__namespace.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;React__namespace.useEffect(()=>{if(n){let y=function(g){if(b.paused||!l)return;const S=g.target;l.contains(S)?d.current=S:focus(d.current,{select:!0})},R=function(g){if(b.paused||!l)return;const S=g.relatedTarget;S!==null&&(l.contains(S)||focus(d.current,{select:!0}))},m=function(g){if(document.activeElement===document.body)for(const E of g)E.removedNodes.length>0&&focus(l)};document.addEventListener("focusin",y),document.addEventListener("focusout",R);const x=new MutationObserver(m);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",R),x.disconnect()}}},[n,l,b.paused]),React__namespace.useEffect(()=>{if(l){focusScopesStack.add(b);const y=document.activeElement;if(!l.contains(y)){const m=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);l.addEventListener(AUTOFOCUS_ON_MOUNT,u),l.dispatchEvent(m),m.defaultPrevented||(focusFirst(removeLinks(getTabbableCandidates(l)),{select:!0}),document.activeElement===y&&focus(l))}return()=>{l.removeEventListener(AUTOFOCUS_ON_MOUNT,u),setTimeout(()=>{const m=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS);l.addEventListener(AUTOFOCUS_ON_UNMOUNT,f),l.dispatchEvent(m),m.defaultPrevented||focus(y??document.body,{select:!0}),l.removeEventListener(AUTOFOCUS_ON_UNMOUNT,f),focusScopesStack.remove(b)},0)}}},[l,u,f,b]);const C=React__namespace.useCallback(y=>{if(!i&&!n||b.paused)return;const R=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,m=document.activeElement;if(R&&m){const x=y.currentTarget,[g,S]=getTabbableEdges(x);g&&S?!y.shiftKey&&m===S?(y.preventDefault(),i&&focus(g,{select:!0})):y.shiftKey&&m===g&&(y.preventDefault(),i&&focus(S,{select:!0})):m===x&&y.preventDefault()}},[i,n,b.paused]);return jsxRuntime.jsx(Primitive.div,{tabIndex:-1,...o,ref:p,onKeyDown:C})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst(e,{select:t=!1}={}){const i=document.activeElement;for(const n of e)if(focus(n,{select:t}),document.activeElement!==i)return}function getTabbableEdges(e){const t=getTabbableCandidates(e),i=findVisible(t,e),n=findVisible(t.reverse(),e);return[i,n]}function getTabbableCandidates(e){const t=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)t.push(i.currentNode);return t}function findVisible(e,t){for(const i of e)if(!isHidden(i,{upTo:t}))return i}function isHidden(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 isSelectableInput(e){return e instanceof HTMLInputElement&&"select"in e}function focus(e,{select:t=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&isSelectableInput(e)&&t&&e.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let e=[];return{add(t){const i=e[0];t!==i&&(i==null||i.pause()),e=arrayRemove(e,t),e.unshift(t)},remove(t){var i;e=arrayRemove(e,t),(i=e[0])==null||i.resume()}}}function arrayRemove(e,t){const i=[...e],n=i.indexOf(t);return n!==-1&&i.splice(n,1),i}function removeLinks(e){return e.filter(t=>t.tagName!=="A")}var PORTAL_NAME$1="Portal",Portal$2=React__namespace.forwardRef((e,t)=>{var l;const{container:i,...n}=e,[s,a]=React__namespace.useState(!1);useLayoutEffect2(()=>a(!0),[]);const o=i||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?ReactDOM.createPortal(jsxRuntime.jsx(Primitive.div,{...n,ref:t}),o):null});Portal$2.displayName=PORTAL_NAME$1;function useStateMachine(e,t){return React__namespace.useReducer((i,n)=>t[i][n]??i,e)}var Presence=e=>{const{present:t,children:i}=e,n=usePresence$1(t),s=typeof i=="function"?i({present:n.isPresent}):React__namespace.Children.only(i),a=useComposedRefs$1(n.ref,getElementRef(s));return typeof i=="function"||n.isPresent?React__namespace.cloneElement(s,{ref:a}):null};Presence.displayName="Presence";function usePresence$1(e){const[t,i]=React__namespace.useState(),n=React__namespace.useRef(null),s=React__namespace.useRef(e),a=React__namespace.useRef("none"),o=e?"mounted":"unmounted",[l,c]=useStateMachine(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return React__namespace.useEffect(()=>{const u=getAnimationName(n.current);a.current=l==="mounted"?u:"none"},[l]),useLayoutEffect2(()=>{const u=n.current,f=s.current;if(f!==e){const p=a.current,b=getAnimationName(u);e?c("MOUNT"):b==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&p!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),useLayoutEffect2(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=b=>{const y=getAnimationName(n.current).includes(b.animationName);if(b.target===t&&y&&(c("ANIMATION_END"),!s.current)){const R=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=R)})}},p=b=>{b.target===t&&(a.current=getAnimationName(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:React__namespace.useCallback(u=>{n.current=u?getComputedStyle(u):null,i(u)},[])}}function getAnimationName(e){return(e==null?void 0:e.animationName)||"none"}function getElementRef(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,i=t&&"isReactWarning"in t&&t.isReactWarning;return i?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,i=t&&"isReactWarning"in t&&t.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var count=0;function useFocusGuards(){React__namespace.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",e[1]??createFocusGuard()),count++,()=>{count===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),count--}},[])}function createFocusGuard(){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 getDefaultParent=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(e){return e&&(e.host||unwrapHost(e.parentNode))},correctTargets=function(e,t){return t.map(function(i){if(e.contains(i))return i;var n=unwrapHost(i);return n&&e.contains(n)?n:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},applyAttributeToOthers=function(e,t,i,n){var s=correctTargets(t,Array.isArray(e)?e:[e]);markerMap[i]||(markerMap[i]=new WeakMap);var a=markerMap[i],o=[],l=new Set,c=new Set(s),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};s.forEach(u);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(p){if(l.has(p))f(p);else try{var b=p.getAttribute(n),C=b!==null&&b!=="false",y=(counterMap.get(p)||0)+1,R=(a.get(p)||0)+1;counterMap.set(p,y),a.set(p,R),o.push(p),y===1&&C&&uncontrolledNodes.set(p,!0),R===1&&p.setAttribute(i,"true"),C||p.setAttribute(n,"true")}catch(m){console.error("aria-hidden: cannot operate on ",p,m)}})};return f(t),l.clear(),lockCount++,function(){o.forEach(function(d){var p=counterMap.get(d)-1,b=a.get(d)-1;counterMap.set(d,p),a.set(d,b),p||(uncontrolledNodes.has(d)||d.removeAttribute(n),uncontrolledNodes.delete(d)),b||d.removeAttribute(i)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(e,t,i){i===void 0&&(i="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=getDefaultParent(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),applyAttributeToOthers(n,s,i,"aria-hidden")):function(){return null}},DIALOG_NAME="Dialog",[createDialogContext,createDialogScope]=createContextScope(DIALOG_NAME),[DialogProvider,useDialogContext]=createDialogContext(DIALOG_NAME),Dialog=e=>{const{__scopeDialog:t,children:i,open:n,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=React__namespace.useRef(null),c=React__namespace.useRef(null),[u,f]=useControllableState$1({prop:n,defaultProp:s??!1,onChange:a,caller:DIALOG_NAME});return jsxRuntime.jsx(DialogProvider,{scope:t,triggerRef:l,contentRef:c,contentId:useId(),titleId:useId(),descriptionId:useId(),open:u,onOpenChange:f,onOpenToggle:React__namespace.useCallback(()=>f(d=>!d),[f]),modal:o,children:i})};Dialog.displayName=DIALOG_NAME;var TRIGGER_NAME="DialogTrigger",DialogTrigger=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,...n}=e,s=useDialogContext(TRIGGER_NAME,i),a=useComposedRefs$1(t,s.triggerRef);return jsxRuntime.jsx(Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":getState(s.open),...n,ref:a,onClick:composeEventHandlers(e.onClick,s.onOpenToggle)})});DialogTrigger.displayName=TRIGGER_NAME;var PORTAL_NAME="DialogPortal",[PortalProvider,usePortalContext]=createDialogContext(PORTAL_NAME,{forceMount:void 0}),DialogPortal=e=>{const{__scopeDialog:t,forceMount:i,children:n,container:s}=e,a=useDialogContext(PORTAL_NAME,t);return jsxRuntime.jsx(PortalProvider,{scope:t,forceMount:i,children:React__namespace.Children.map(n,o=>jsxRuntime.jsx(Presence,{present:i||a.open,children:jsxRuntime.jsx(Portal$2,{asChild:!0,container:s,children:o})}))})};DialogPortal.displayName=PORTAL_NAME;var OVERLAY_NAME="DialogOverlay",DialogOverlay=React__namespace.forwardRef((e,t)=>{const i=usePortalContext(OVERLAY_NAME,e.__scopeDialog),{forceMount:n=i.forceMount,...s}=e,a=useDialogContext(OVERLAY_NAME,e.__scopeDialog);return a.modal?jsxRuntime.jsx(Presence,{present:n||a.open,children:jsxRuntime.jsx(DialogOverlayImpl,{...s,ref:t})}):null});DialogOverlay.displayName=OVERLAY_NAME;var Slot=createSlot("DialogOverlay.RemoveScroll"),DialogOverlayImpl=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,...n}=e,s=useDialogContext(OVERLAY_NAME,i);return jsxRuntime.jsx(ReactRemoveScroll,{as:Slot,allowPinchZoom:!0,shards:[s.contentRef],children:jsxRuntime.jsx(Primitive.div,{"data-state":getState(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),CONTENT_NAME="DialogContent",DialogContent=React__namespace.forwardRef((e,t)=>{const i=usePortalContext(CONTENT_NAME,e.__scopeDialog),{forceMount:n=i.forceMount,...s}=e,a=useDialogContext(CONTENT_NAME,e.__scopeDialog);return jsxRuntime.jsx(Presence,{present:n||a.open,children:a.modal?jsxRuntime.jsx(DialogContentModal,{...s,ref:t}):jsxRuntime.jsx(DialogContentNonModal,{...s,ref:t})})});DialogContent.displayName=CONTENT_NAME;var DialogContentModal=React__namespace.forwardRef((e,t)=>{const i=useDialogContext(CONTENT_NAME,e.__scopeDialog),n=React__namespace.useRef(null),s=useComposedRefs$1(t,i.contentRef,n);return React__namespace.useEffect(()=>{const a=n.current;if(a)return hideOthers(a)},[]),jsxRuntime.jsx(DialogContentImpl,{...e,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:composeEventHandlers(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=i.triggerRef.current)==null||o.focus()}),onPointerDownOutside:composeEventHandlers(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:composeEventHandlers(e.onFocusOutside,a=>a.preventDefault())})}),DialogContentNonModal=React__namespace.forwardRef((e,t)=>{const i=useDialogContext(CONTENT_NAME,e.__scopeDialog),n=React__namespace.useRef(!1),s=React__namespace.useRef(!1);return jsxRuntime.jsx(DialogContentImpl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(n.current||(l=i.triggerRef.current)==null||l.focus(),a.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=i.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),DialogContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,...o}=e,l=useDialogContext(CONTENT_NAME,i),c=React__namespace.useRef(null),u=useComposedRefs$1(t,c);return useFocusGuards(),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(FocusScope,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:jsxRuntime.jsx(DismissableLayer,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":getState(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(TitleWarning,{titleId:l.titleId}),jsxRuntime.jsx(DescriptionWarning,{contentRef:c,descriptionId:l.descriptionId})]})]})}),TITLE_NAME="DialogTitle",DialogTitle=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,...n}=e,s=useDialogContext(TITLE_NAME,i);return jsxRuntime.jsx(Primitive.h2,{id:s.titleId,...n,ref:t})});DialogTitle.displayName=TITLE_NAME;var DESCRIPTION_NAME="DialogDescription",DialogDescription=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,...n}=e,s=useDialogContext(DESCRIPTION_NAME,i);return jsxRuntime.jsx(Primitive.p,{id:s.descriptionId,...n,ref:t})});DialogDescription.displayName=DESCRIPTION_NAME;var CLOSE_NAME="DialogClose",DialogClose=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,...n}=e,s=useDialogContext(CLOSE_NAME,i);return jsxRuntime.jsx(Primitive.button,{type:"button",...n,ref:t,onClick:composeEventHandlers(e.onClick,()=>s.onOpenChange(!1))})});DialogClose.displayName=CLOSE_NAME;function getState(e){return e?"open":"closed"}var TITLE_WARNING_NAME="DialogTitleWarning",[WarningProvider,useWarningContext]=createContext2(TITLE_WARNING_NAME,{contentName:CONTENT_NAME,titleName:TITLE_NAME,docsSlug:"dialog"}),TitleWarning=({titleId:e})=>{const t=useWarningContext(TITLE_WARNING_NAME),i=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
41
+ `)},idCounter=0,lockStack=[];function RemoveScrollSideCar(e){var t=React__namespace.useRef([]),i=React__namespace.useRef([0,0]),n=React__namespace.useRef(),s=React__namespace.useState(idCounter++)[0],a=React__namespace.useState(styleSingleton)[0],o=React__namespace.useRef(e);React__namespace.useEffect(function(){o.current=e},[e]),React__namespace.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=__spreadArray([e.lockRef.current],(e.shards||[]).map(extractRef),!0).filter(Boolean);return y.forEach(function(R){return R.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=React__namespace.useCallback(function(y,R){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var m=getTouchXY(y),x=i.current,g="deltaX"in y?y.deltaX:x[0]-m[0],S="deltaY"in y?y.deltaY:x[1]-m[1],E,M=y.target,L=Math.abs(g)>Math.abs(S)?"h":"v";if("touches"in y&&L==="h"&&M.type==="range")return!1;var _=locationCouldBeScrolled(L,M);if(!_)return!0;if(_?E=L:(E=L==="v"?"h":"v",_=locationCouldBeScrolled(L,M)),!_)return!1;if(!n.current&&"changedTouches"in y&&(g||S)&&(n.current=E),!E)return!0;var I=n.current||E;return handleScroll(I,R,y,I==="h"?g:S,!0)},[]),c=React__namespace.useCallback(function(y){var R=y;if(!(!lockStack.length||lockStack[lockStack.length-1]!==a)){var m="deltaY"in R?getDeltaXY(R):getTouchXY(R),x=t.current.filter(function(E){return E.name===R.type&&(E.target===R.target||R.target===E.shadowParent)&&deltaCompare(E.delta,m)})[0];if(x&&x.should){R.cancelable&&R.preventDefault();return}if(!x){var g=(o.current.shards||[]).map(extractRef).filter(Boolean).filter(function(E){return E.contains(R.target)}),S=g.length>0?l(R,g[0]):!o.current.noIsolation;S&&R.cancelable&&R.preventDefault()}}},[]),u=React__namespace.useCallback(function(y,R,m,x){var g={name:y,delta:R,target:m,should:x,shadowParent:getOutermostShadowParent(m)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(S){return S!==g})},1)},[]),f=React__namespace.useCallback(function(y){i.current=getTouchXY(y),n.current=void 0},[]),d=React__namespace.useCallback(function(y){u(y.type,getDeltaXY(y),y.target,l(y,e.lockRef.current))},[]),p=React__namespace.useCallback(function(y){u(y.type,getTouchXY(y),y.target,l(y,e.lockRef.current))},[]);React__namespace.useEffect(function(){return lockStack.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",c,nonPassive),document.addEventListener("touchmove",c,nonPassive),document.addEventListener("touchstart",f,nonPassive),function(){lockStack=lockStack.filter(function(y){return y!==a}),document.removeEventListener("wheel",c,nonPassive),document.removeEventListener("touchmove",c,nonPassive),document.removeEventListener("touchstart",f,nonPassive)}},[]);var b=e.removeScrollBar,C=e.inert;return React__namespace.createElement(React__namespace.Fragment,null,C?React__namespace.createElement(a,{styles:generateStyle(s)}):null,b?React__namespace.createElement(RemoveScrollBar,{gapMode:e.gapMode}):null)}function getOutermostShadowParent(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=React__namespace.forwardRef(function(e,t){return React__namespace.createElement(RemoveScroll,__assign$1({},e,{ref:t,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;const sidebarStyles=cva("gf-fixed gf-inset-y-0 gf-right-0 gf-transition-transform gf-duration-200 gf-bg-white gf-backdrop-blur-sm gf-p-4",{variants:{open:{true:"gf-translate-x-0",false:"gf-translate-x-full"},size:{small:"gf-w-full md:gf-w-[360px]",large:"gf-w-full md:gf-w-[480px]"}},defaultVariants:{open:!1}}),Sidebar=({open:e,size:t,children:i,className:n,...s})=>jsxRuntime.jsx(ClientOnly,{children:jsxRuntime.jsx(ReactRemoveScroll,{removeScrollBar:!1,enabled:!!e,children:jsxRuntime.jsx(Opacity,{level:"medium",className:cn(sidebarStyles({open:e,size:t,className:n})),...s,children:i})})}),modalStyles=cva(["gf-fixed gf-inset-0 gf-z-50 gf-flex gf-items-center gf-justify-center gf-min-h-screen gf-transition-all"],{variants:{open:{true:"gf-bg-black",false:"gf-opacity-0 gf-pointer-events-none"}},defaultVariants:{open:!1}}),Modal=({open:e,onClose:t,disableScrollLock:i,children:n})=>{const[s,a]=React.useState(!1);React.useEffect(()=>{e&&a(!0)},[e]);const o=l=>{t&&(l.stopPropagation(),t())};return jsxRuntime.jsx(ClientOnly,{children:jsxRuntime.jsx(ReactRemoveScroll,{removeScrollBar:!1,enabled:!!e&&!i,children:jsxRuntime.jsx("div",{className:`gf-bg-dark-grey gf-bg-opacity-40 ${modalStyles({open:e})} ${s?e?"gf-animate-fade-in ":"gf-animate-fade-out":""}`,onClick:o,children:jsxRuntime.jsx("div",{className:`gf-transform gf-transition-transform ${e?"gf-animate-scale-in":"gf-animate-scale-out"}`,children:n})})})})},Children=({children:e,className:t,opacityLevel:i,...n})=>{const s=a=>{a.stopPropagation()};return jsxRuntime.jsx(Opacity,{level:i,onClick:s,className:`gf-mx-auto gf-backdrop-blur-md gf-overscroll-contain ${t||""}`,...n,children:e})};Modal.Children=Children;function composeEventHandlers(e,t,{checkForDefaultPrevented:i=!0}={}){return function(s){if(e==null||e(s),i===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function setRef$1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function composeRefs$1(...e){return t=>{let i=!1;const n=e.map(s=>{const a=setRef$1(s,t);return!i&&typeof a=="function"&&(i=!0),a});if(i)return()=>{for(let s=0;s<n.length;s++){const a=n[s];typeof a=="function"?a():setRef$1(e[s],null)}}}}function useComposedRefs$1(...e){return React__namespace.useCallback(composeRefs$1(...e),e)}function createContext2(e,t){const i=React__namespace.createContext(t),n=a=>{const{children:o,...l}=a,c=React__namespace.useMemo(()=>l,Object.values(l));return jsxRuntime.jsx(i.Provider,{value:c,children:o})};n.displayName=e+"Provider";function s(a){const o=React__namespace.useContext(i);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,s]}function createContextScope(e,t=[]){let i=[];function n(a,o){const l=React__namespace.createContext(o),c=i.length;i=[...i,o];const u=d=>{var m;const{scope:p,children:b,...C}=d,y=((m=p==null?void 0:p[e])==null?void 0:m[c])||l,R=React__namespace.useMemo(()=>C,Object.values(C));return jsxRuntime.jsx(y.Provider,{value:R,children:b})};u.displayName=a+"Provider";function f(d,p){var y;const b=((y=p==null?void 0:p[e])==null?void 0:y[c])||l,C=React__namespace.useContext(b);if(C)return C;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[u,f]}const s=()=>{const a=i.map(o=>React__namespace.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return React__namespace.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,composeContextScopes(s,...t)]}function composeContextScopes(...e){const t=e[0];if(e.length===1)return t;const i=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const d=c(a)[`__scope${u}`];return{...l,...d}},{});return React__namespace.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return i.scopeName=t.scopeName,i}var useLayoutEffect2=globalThis!=null&&globalThis.document?React__namespace.useLayoutEffect:()=>{},useReactId=React__namespace[" useId ".trim().toString()]||(()=>{}),count$1=0;function useId(e){const[t,i]=React__namespace.useState(useReactId());return useLayoutEffect2(()=>{e||i(n=>n??String(count$1++))},[e]),e||(t?`radix-${t}`:"")}var useInsertionEffect=React__namespace[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState$1({prop:e,defaultProp:t,onChange:i=()=>{},caller:n}){const[s,a,o]=useUncontrolledState$1({defaultProp:t,onChange:i}),l=e!==void 0,c=l?e:s;{const f=React__namespace.useRef(e!==void 0);React__namespace.useEffect(()=>{const d=f.current;d!==l&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${l?"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.`),f.current=l},[l,n])}const u=React__namespace.useCallback(f=>{var d;if(l){const p=isFunction(f)?f(e):f;p!==e&&((d=o.current)==null||d.call(o,p))}else a(f)},[l,e,a,o]);return[c,u]}function useUncontrolledState$1({defaultProp:e,onChange:t}){const[i,n]=React__namespace.useState(e),s=React__namespace.useRef(i),a=React__namespace.useRef(t);return useInsertionEffect(()=>{a.current=t},[t]),React__namespace.useEffect(()=>{var o;s.current!==i&&((o=a.current)==null||o.call(a,i),s.current=i)},[i,s]),[i,n,a]}function isFunction(e){return typeof e=="function"}function createSlot(e){const t=createSlotClone(e),i=React__namespace.forwardRef((n,s)=>{const{children:a,...o}=n,l=React__namespace.Children.toArray(a),c=l.find(isSlottable);if(c){const u=c.props.children,f=l.map(d=>d===c?React__namespace.Children.count(u)>1?React__namespace.Children.only(null):React__namespace.isValidElement(u)?u.props.children:null:d);return jsxRuntime.jsx(t,{...o,ref:s,children:React__namespace.isValidElement(u)?React__namespace.cloneElement(u,void 0,f):null})}return jsxRuntime.jsx(t,{...o,ref:s,children:a})});return i.displayName=`${e}.Slot`,i}function createSlotClone(e){const t=React__namespace.forwardRef((i,n)=>{const{children:s,...a}=i,o=React__namespace.isValidElement(s)?getElementRef$1(s):void 0,l=useComposedRefs$1(o,n);if(React__namespace.isValidElement(s)){const c=mergeProps(a,s.props);return s.type!==React__namespace.Fragment&&(c.ref=l),React__namespace.cloneElement(s,c)}return React__namespace.Children.count(s)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function isSlottable(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER}function mergeProps(e,t){const i={...t};for(const n in t){const s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?i[n]=(...l)=>{const c=a(...l);return s(...l),c}:s&&(i[n]=s):n==="style"?i[n]={...s,...a}:n==="className"&&(i[n]=[s,a].filter(Boolean).join(" "))}return{...e,...i}}function getElementRef$1(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,i=t&&"isReactWarning"in t&&t.isReactWarning;return i?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,i=t&&"isReactWarning"in t&&t.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive=NODES.reduce((e,t)=>{const i=createSlot(`Primitive.${t}`),n=React__namespace.forwardRef((s,a)=>{const{asChild:o,...l}=s,c=o?i:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntime.jsx(c,{...l,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function dispatchDiscreteCustomEvent(e,t){e&&ReactDOM__namespace.flushSync(()=>e.dispatchEvent(t))}function useCallbackRef$1(e){const t=React__namespace.useRef(e);return React__namespace.useEffect(()=>{t.current=e}),React__namespace.useMemo(()=>(...i)=>{var n;return(n=t.current)==null?void 0:n.call(t,...i)},[])}function useEscapeKeydown(e,t=globalThis==null?void 0:globalThis.document){const i=useCallbackRef$1(e);React__namespace.useEffect(()=>{const n=s=>{s.key==="Escape"&&i(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[i,t])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=React__namespace.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=React__namespace.forwardRef((e,t)=>{const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=React__namespace.useContext(DismissableLayerContext),[f,d]=React__namespace.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=React__namespace.useState({}),C=useComposedRefs$1(t,L=>d(L)),y=Array.from(u.layers),[R]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=y.indexOf(R),x=f?y.indexOf(f):-1,g=u.layersWithOutsidePointerEventsDisabled.size>0,S=x>=m,E=usePointerDownOutside(L=>{const _=L.target,I=[...u.branches].some($=>$.contains(_));!S||I||(s==null||s(L),o==null||o(L),L.defaultPrevented||l==null||l())},p),M=useFocusOutside(L=>{const _=L.target;[...u.branches].some($=>$.contains(_))||(a==null||a(L),o==null||o(L),L.defaultPrevented||l==null||l())},p);return useEscapeKeydown(L=>{x===u.layers.size-1&&(n==null||n(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},p),React__namespace.useEffect(()=>{if(f)return i&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),dispatchUpdate(),()=>{i&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=originalBodyPointerEvents)}},[f,p,i,u]),React__namespace.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),dispatchUpdate())},[f,u]),React__namespace.useEffect(()=>{const L=()=>b({});return document.addEventListener(CONTEXT_UPDATE,L),()=>document.removeEventListener(CONTEXT_UPDATE,L)},[]),jsxRuntime.jsx(Primitive.div,{...c,ref:C,style:{pointerEvents:g?S?"auto":"none":void 0,...e.style},onFocusCapture:composeEventHandlers(e.onFocusCapture,M.onFocusCapture),onBlurCapture:composeEventHandlers(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:composeEventHandlers(e.onPointerDownCapture,E.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=React__namespace.forwardRef((e,t)=>{const i=React__namespace.useContext(DismissableLayerContext),n=React__namespace.useRef(null),s=useComposedRefs$1(t,n);return React__namespace.useEffect(()=>{const a=n.current;if(a)return i.branches.add(a),()=>{i.branches.delete(a)}},[i.branches]),jsxRuntime.jsx(Primitive.div,{...e,ref:s})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(e,t=globalThis==null?void 0:globalThis.document){const i=useCallbackRef$1(e),n=React__namespace.useRef(!1),s=React__namespace.useRef(()=>{});return React__namespace.useEffect(()=>{const a=l=>{if(l.target&&!n.current){let c=function(){handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE,i,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,i]),{onPointerDownCapture:()=>n.current=!0}}function useFocusOutside(e,t=globalThis==null?void 0:globalThis.document){const i=useCallbackRef$1(e),n=React__namespace.useRef(!1);return React__namespace.useEffect(()=>{const s=a=>{a.target&&!n.current&&handleAndDispatchCustomEvent(FOCUS_OUTSIDE,i,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,i]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function dispatchUpdate(){const e=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(e)}function handleAndDispatchCustomEvent(e,t,i,{discrete:n}){const s=i.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});t&&s.addEventListener(e,t,{once:!0}),n?dispatchDiscreteCustomEvent(s,a):s.dispatchEvent(a)}var AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=React__namespace.forwardRef((e,t)=>{const{loop:i=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=React__namespace.useState(null),u=useCallbackRef$1(s),f=useCallbackRef$1(a),d=React__namespace.useRef(null),p=useComposedRefs$1(t,y=>c(y)),b=React__namespace.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;React__namespace.useEffect(()=>{if(n){let y=function(g){if(b.paused||!l)return;const S=g.target;l.contains(S)?d.current=S:focus(d.current,{select:!0})},R=function(g){if(b.paused||!l)return;const S=g.relatedTarget;S!==null&&(l.contains(S)||focus(d.current,{select:!0}))},m=function(g){if(document.activeElement===document.body)for(const E of g)E.removedNodes.length>0&&focus(l)};document.addEventListener("focusin",y),document.addEventListener("focusout",R);const x=new MutationObserver(m);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",R),x.disconnect()}}},[n,l,b.paused]),React__namespace.useEffect(()=>{if(l){focusScopesStack.add(b);const y=document.activeElement;if(!l.contains(y)){const m=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);l.addEventListener(AUTOFOCUS_ON_MOUNT,u),l.dispatchEvent(m),m.defaultPrevented||(focusFirst(removeLinks(getTabbableCandidates(l)),{select:!0}),document.activeElement===y&&focus(l))}return()=>{l.removeEventListener(AUTOFOCUS_ON_MOUNT,u),setTimeout(()=>{const m=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS);l.addEventListener(AUTOFOCUS_ON_UNMOUNT,f),l.dispatchEvent(m),m.defaultPrevented||focus(y??document.body,{select:!0}),l.removeEventListener(AUTOFOCUS_ON_UNMOUNT,f),focusScopesStack.remove(b)},0)}}},[l,u,f,b]);const C=React__namespace.useCallback(y=>{if(!i&&!n||b.paused)return;const R=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,m=document.activeElement;if(R&&m){const x=y.currentTarget,[g,S]=getTabbableEdges(x);g&&S?!y.shiftKey&&m===S?(y.preventDefault(),i&&focus(g,{select:!0})):y.shiftKey&&m===g&&(y.preventDefault(),i&&focus(S,{select:!0})):m===x&&y.preventDefault()}},[i,n,b.paused]);return jsxRuntime.jsx(Primitive.div,{tabIndex:-1,...o,ref:p,onKeyDown:C})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst(e,{select:t=!1}={}){const i=document.activeElement;for(const n of e)if(focus(n,{select:t}),document.activeElement!==i)return}function getTabbableEdges(e){const t=getTabbableCandidates(e),i=findVisible(t,e),n=findVisible(t.reverse(),e);return[i,n]}function getTabbableCandidates(e){const t=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)t.push(i.currentNode);return t}function findVisible(e,t){for(const i of e)if(!isHidden(i,{upTo:t}))return i}function isHidden(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 isSelectableInput(e){return e instanceof HTMLInputElement&&"select"in e}function focus(e,{select:t=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&isSelectableInput(e)&&t&&e.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let e=[];return{add(t){const i=e[0];t!==i&&(i==null||i.pause()),e=arrayRemove(e,t),e.unshift(t)},remove(t){var i;e=arrayRemove(e,t),(i=e[0])==null||i.resume()}}}function arrayRemove(e,t){const i=[...e],n=i.indexOf(t);return n!==-1&&i.splice(n,1),i}function removeLinks(e){return e.filter(t=>t.tagName!=="A")}var PORTAL_NAME$1="Portal",Portal$2=React__namespace.forwardRef((e,t)=>{var l;const{container:i,...n}=e,[s,a]=React__namespace.useState(!1);useLayoutEffect2(()=>a(!0),[]);const o=i||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?ReactDOM.createPortal(jsxRuntime.jsx(Primitive.div,{...n,ref:t}),o):null});Portal$2.displayName=PORTAL_NAME$1;function useStateMachine(e,t){return React__namespace.useReducer((i,n)=>t[i][n]??i,e)}var Presence=e=>{const{present:t,children:i}=e,n=usePresence$1(t),s=typeof i=="function"?i({present:n.isPresent}):React__namespace.Children.only(i),a=useComposedRefs$1(n.ref,getElementRef(s));return typeof i=="function"||n.isPresent?React__namespace.cloneElement(s,{ref:a}):null};Presence.displayName="Presence";function usePresence$1(e){const[t,i]=React__namespace.useState(),n=React__namespace.useRef(null),s=React__namespace.useRef(e),a=React__namespace.useRef("none"),o=e?"mounted":"unmounted",[l,c]=useStateMachine(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return React__namespace.useEffect(()=>{const u=getAnimationName(n.current);a.current=l==="mounted"?u:"none"},[l]),useLayoutEffect2(()=>{const u=n.current,f=s.current;if(f!==e){const p=a.current,b=getAnimationName(u);e?c("MOUNT"):b==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&p!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),useLayoutEffect2(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=b=>{const y=getAnimationName(n.current).includes(b.animationName);if(b.target===t&&y&&(c("ANIMATION_END"),!s.current)){const R=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=R)})}},p=b=>{b.target===t&&(a.current=getAnimationName(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:React__namespace.useCallback(u=>{n.current=u?getComputedStyle(u):null,i(u)},[])}}function getAnimationName(e){return(e==null?void 0:e.animationName)||"none"}function getElementRef(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,i=t&&"isReactWarning"in t&&t.isReactWarning;return i?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,i=t&&"isReactWarning"in t&&t.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var count=0;function useFocusGuards(){React__namespace.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",e[1]??createFocusGuard()),count++,()=>{count===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),count--}},[])}function createFocusGuard(){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 getDefaultParent=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(e){return e&&(e.host||unwrapHost(e.parentNode))},correctTargets=function(e,t){return t.map(function(i){if(e.contains(i))return i;var n=unwrapHost(i);return n&&e.contains(n)?n:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},applyAttributeToOthers=function(e,t,i,n){var s=correctTargets(t,Array.isArray(e)?e:[e]);markerMap[i]||(markerMap[i]=new WeakMap);var a=markerMap[i],o=[],l=new Set,c=new Set(s),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};s.forEach(u);var f=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(p){if(l.has(p))f(p);else try{var b=p.getAttribute(n),C=b!==null&&b!=="false",y=(counterMap.get(p)||0)+1,R=(a.get(p)||0)+1;counterMap.set(p,y),a.set(p,R),o.push(p),y===1&&C&&uncontrolledNodes.set(p,!0),R===1&&p.setAttribute(i,"true"),C||p.setAttribute(n,"true")}catch(m){console.error("aria-hidden: cannot operate on ",p,m)}})};return f(t),l.clear(),lockCount++,function(){o.forEach(function(d){var p=counterMap.get(d)-1,b=a.get(d)-1;counterMap.set(d,p),a.set(d,b),p||(uncontrolledNodes.has(d)||d.removeAttribute(n),uncontrolledNodes.delete(d)),b||d.removeAttribute(i)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(e,t,i){i===void 0&&(i="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=getDefaultParent(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),applyAttributeToOthers(n,s,i,"aria-hidden")):function(){return null}},DIALOG_NAME="Dialog",[createDialogContext,createDialogScope]=createContextScope(DIALOG_NAME),[DialogProvider,useDialogContext]=createDialogContext(DIALOG_NAME),Dialog=e=>{const{__scopeDialog:t,children:i,open:n,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=React__namespace.useRef(null),c=React__namespace.useRef(null),[u,f]=useControllableState$1({prop:n,defaultProp:s??!1,onChange:a,caller:DIALOG_NAME});return jsxRuntime.jsx(DialogProvider,{scope:t,triggerRef:l,contentRef:c,contentId:useId(),titleId:useId(),descriptionId:useId(),open:u,onOpenChange:f,onOpenToggle:React__namespace.useCallback(()=>f(d=>!d),[f]),modal:o,children:i})};Dialog.displayName=DIALOG_NAME;var TRIGGER_NAME="DialogTrigger",DialogTrigger=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,...n}=e,s=useDialogContext(TRIGGER_NAME,i),a=useComposedRefs$1(t,s.triggerRef);return jsxRuntime.jsx(Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":getState(s.open),...n,ref:a,onClick:composeEventHandlers(e.onClick,s.onOpenToggle)})});DialogTrigger.displayName=TRIGGER_NAME;var PORTAL_NAME="DialogPortal",[PortalProvider,usePortalContext]=createDialogContext(PORTAL_NAME,{forceMount:void 0}),DialogPortal=e=>{const{__scopeDialog:t,forceMount:i,children:n,container:s}=e,a=useDialogContext(PORTAL_NAME,t);return jsxRuntime.jsx(PortalProvider,{scope:t,forceMount:i,children:React__namespace.Children.map(n,o=>jsxRuntime.jsx(Presence,{present:i||a.open,children:jsxRuntime.jsx(Portal$2,{asChild:!0,container:s,children:o})}))})};DialogPortal.displayName=PORTAL_NAME;var OVERLAY_NAME="DialogOverlay",DialogOverlay=React__namespace.forwardRef((e,t)=>{const i=usePortalContext(OVERLAY_NAME,e.__scopeDialog),{forceMount:n=i.forceMount,...s}=e,a=useDialogContext(OVERLAY_NAME,e.__scopeDialog);return a.modal?jsxRuntime.jsx(Presence,{present:n||a.open,children:jsxRuntime.jsx(DialogOverlayImpl,{...s,ref:t})}):null});DialogOverlay.displayName=OVERLAY_NAME;var Slot=createSlot("DialogOverlay.RemoveScroll"),DialogOverlayImpl=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,...n}=e,s=useDialogContext(OVERLAY_NAME,i);return jsxRuntime.jsx(ReactRemoveScroll,{as:Slot,allowPinchZoom:!0,shards:[s.contentRef],children:jsxRuntime.jsx(Primitive.div,{"data-state":getState(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),CONTENT_NAME="DialogContent",DialogContent=React__namespace.forwardRef((e,t)=>{const i=usePortalContext(CONTENT_NAME,e.__scopeDialog),{forceMount:n=i.forceMount,...s}=e,a=useDialogContext(CONTENT_NAME,e.__scopeDialog);return jsxRuntime.jsx(Presence,{present:n||a.open,children:a.modal?jsxRuntime.jsx(DialogContentModal,{...s,ref:t}):jsxRuntime.jsx(DialogContentNonModal,{...s,ref:t})})});DialogContent.displayName=CONTENT_NAME;var DialogContentModal=React__namespace.forwardRef((e,t)=>{const i=useDialogContext(CONTENT_NAME,e.__scopeDialog),n=React__namespace.useRef(null),s=useComposedRefs$1(t,i.contentRef,n);return React__namespace.useEffect(()=>{const a=n.current;if(a)return hideOthers(a)},[]),jsxRuntime.jsx(DialogContentImpl,{...e,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:composeEventHandlers(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=i.triggerRef.current)==null||o.focus()}),onPointerDownOutside:composeEventHandlers(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:composeEventHandlers(e.onFocusOutside,a=>a.preventDefault())})}),DialogContentNonModal=React__namespace.forwardRef((e,t)=>{const i=useDialogContext(CONTENT_NAME,e.__scopeDialog),n=React__namespace.useRef(!1),s=React__namespace.useRef(!1);return jsxRuntime.jsx(DialogContentImpl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(n.current||(l=i.triggerRef.current)==null||l.focus(),a.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=i.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),DialogContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,...o}=e,l=useDialogContext(CONTENT_NAME,i),c=React__namespace.useRef(null),u=useComposedRefs$1(t,c);return useFocusGuards(),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(FocusScope,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:jsxRuntime.jsx(DismissableLayer,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":getState(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(TitleWarning,{titleId:l.titleId}),jsxRuntime.jsx(DescriptionWarning,{contentRef:c,descriptionId:l.descriptionId})]})]})}),TITLE_NAME="DialogTitle",DialogTitle=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,...n}=e,s=useDialogContext(TITLE_NAME,i);return jsxRuntime.jsx(Primitive.h2,{id:s.titleId,...n,ref:t})});DialogTitle.displayName=TITLE_NAME;var DESCRIPTION_NAME="DialogDescription",DialogDescription=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,...n}=e,s=useDialogContext(DESCRIPTION_NAME,i);return jsxRuntime.jsx(Primitive.p,{id:s.descriptionId,...n,ref:t})});DialogDescription.displayName=DESCRIPTION_NAME;var CLOSE_NAME="DialogClose",DialogClose=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:i,...n}=e,s=useDialogContext(CLOSE_NAME,i);return jsxRuntime.jsx(Primitive.button,{type:"button",...n,ref:t,onClick:composeEventHandlers(e.onClick,()=>s.onOpenChange(!1))})});DialogClose.displayName=CLOSE_NAME;function getState(e){return e?"open":"closed"}var TITLE_WARNING_NAME="DialogTitleWarning",[WarningProvider,useWarningContext]=createContext2(TITLE_WARNING_NAME,{contentName:CONTENT_NAME,titleName:TITLE_NAME,docsSlug:"dialog"}),TitleWarning=({titleId:e})=>{const t=useWarningContext(TITLE_WARNING_NAME),i=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
42
 
43
43
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/garden-book",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "type": "module",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",