trae-ui
Version:
Trae UI is a modern, highly customizable, and accessible UI component library for React and Next.js, built with TailwindCSS and TypeScript. It offers a responsive, reusable, and developer-friendly set of components to accelerate building visually stunning
1 lines • 856 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react/jsx-runtime"),n=require("react-dom");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=r(e),a=o(e),s=r(t),l=o(n),c=r(n),u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},u.apply(this,arguments)};function d(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function f(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function p(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=p(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function h(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=p(e))&&(r&&(r+=" "),r+=t);return r}"function"==typeof SuppressedError&&SuppressedError;var m=function(t){var n=t.src,r=t.color,o=void 0===r?"default":r,a=t.radius,s=void 0===a?"full":a,l=t.size,c=void 0===l?"md":l,d=t.name,f=t.icon,p=t.fallback,m=t.isBordered,y=void 0!==m&&m,v=t.isDisabled,g=void 0!==v&&v,b=t.showFallback,w=void 0!==b&&b,x=t.isFocusable,O=void 0!==x&&x,E=t.ImgComponent,S=void 0===E?"img":E,P=t.imgProps,j=t.classNames,A=e.useState(!1),k=A[0],T=A[1],C=y?"ring-2 ring-white":"",M="full"===s?"rounded-full":"sm"===s?"rounded-sm":"md"===s?"rounded-md":"rounded-lg",N=g?"opacity-50 cursor-not-allowed":"",_=p||(d?d.charAt(0):f);return i.default.createElement("div",{className:h("inline-flex items-center justify-center",{default:"bg-gray-200",primary:"bg-blue-500 text-white",secondary:"bg-gray-500 text-white",success:"bg-green-500 text-white",warning:"bg-yellow-500 text-black",danger:"bg-red-500 text-white"}[o],{sm:"w-8 h-8 text-sm",md:"w-12 h-12 text-md",lg:"w-16 h-16 text-lg"}[c],M,C,N,null==j?void 0:j.base),"aria-disabled":g,tabIndex:O?0:-1,title:d},k||!n||w?i.default.createElement("div",{className:h("flex items-center justify-center",null==j?void 0:j.fallback)},_):i.default.createElement(S,u({src:n,alt:d,onError:function(){return T(!0)},className:h("object-cover",M,null==j?void 0:j.img)},P)))};function y(e,n=[]){let r=[];const o=()=>{const t=r.map((e=>a.createContext(e)));return function(n){const r=n?.[e]||t;return a.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return o.scopeName=e,[function(n,o){const i=a.createContext(o),s=r.length;r=[...r,o];const l=n=>{const{scope:r,children:o,...l}=n,c=r?.[e]?.[s]||i,u=a.useMemo((()=>l),Object.values(l));return t.jsx(c.Provider,{value:u,children:o})};return l.displayName=n+"Provider",[l,function(t,r){const l=r?.[e]?.[s]||i,c=a.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},v(o,...n)]}function v(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return a.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function g(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function b(...e){return t=>{let n=!1;const r=e.map((e=>{const r=g(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():g(e[t],null)}}}}function w(...e){return a.useCallback(b(...e),e)}function x(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var O=Boolean(globalThis?.document)?a.useLayoutEffect:()=>{},E=a["useId".toString()]||(()=>{}),S=0;function P(e){const[t,n]=a.useState(E());return O((()=>{e||n((e=>e??String(S++)))}),[e]),e||(t?`radix-${t}`:"")}function j(e){const t=a.useRef(e);return a.useEffect((()=>{t.current=e})),a.useMemo((()=>(...e)=>t.current?.(...e)),[])}function A({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=a.useState(e),[r]=n,o=a.useRef(r),i=j(t);return a.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:r,l=j(n);return[s,a.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[i,e,o,l])]}var k=a.forwardRef(((e,n)=>{const{children:r,...o}=e,i=a.Children.toArray(r),s=i.find(M);if(s){const e=s.props.children,r=i.map((t=>t===s?a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null:t));return t.jsx(T,{...o,ref:n,children:a.isValidElement(e)?a.cloneElement(e,void 0,r):null})}return t.jsx(T,{...o,ref:n,children:r})}));k.displayName="Slot";var T=a.forwardRef(((e,t)=>{const{children:n,...r}=e;if(a.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(n),o=function(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]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==a.Fragment&&(o.ref=t?b(t,e):e),a.cloneElement(n,o)}return a.Children.count(n)>1?a.Children.only(null):null}));T.displayName="SlotClone";var C=({children:e})=>t.jsx(t.Fragment,{children:e});function M(e){return a.isValidElement(e)&&e.type===C}var N,_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=a.forwardRef(((e,r)=>{const{asChild:o,...i}=e,a=o?k:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(a,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{}),D="dismissableLayer.update",R=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),I=a.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=a.useContext(R),[f,p]=a.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=a.useState({}),y=w(n,(e=>p(e))),v=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(g),O=f?v.indexOf(f):-1,E=d.layersWithOutsidePointerEventsDisabled.size>0,S=O>=b,P=function(e,t=globalThis?.document){const n=j(e),r=a.useRef(!1),o=a.useRef((()=>{}));return a.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){B("dismissableLayer.pointerDownOutside",n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(i?.(e),l?.(e),e.defaultPrevented||c?.())}),h),A=function(e,t=globalThis?.document){const n=j(e),r=a.useRef(!1);return a.useEffect((()=>{const e=e=>{e.target&&!r.current&&B("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(s?.(e),l?.(e),e.defaultPrevented||c?.())}),h);return function(e,t=globalThis?.document){const n=j(e);a.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{O===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),h),a.useEffect((()=>{if(f)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(N=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),L(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=N)}}),[f,h,r,d]),a.useEffect((()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),L())}),[f,d]),a.useEffect((()=>{const e=()=>m({});return document.addEventListener(D,e),()=>document.removeEventListener(D,e)}),[]),t.jsx(_.div,{...u,ref:y,style:{pointerEvents:E?S?"auto":"none":void 0,...e.style},onFocusCapture:x(e.onFocusCapture,A.onFocusCapture),onBlurCapture:x(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:x(e.onPointerDownCapture,P.onPointerDownCapture)})}));function L(){const e=new CustomEvent(D);document.dispatchEvent(e)}function B(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?function(e,t){e&&l.flushSync((()=>e.dispatchEvent(t)))}(o,i):o.dispatchEvent(i)}I.displayName="DismissableLayer",a.forwardRef(((e,n)=>{const r=a.useContext(R),o=a.useRef(null),i=w(n,o);return a.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(_.div,{...e,ref:i})})).displayName="DismissableLayerBranch";var F="focusScope.autoFocusOnMount",z="focusScope.autoFocusOnUnmount",V={bubbles:!1,cancelable:!0},$=a.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,u]=a.useState(null),d=j(i),f=j(s),p=a.useRef(null),h=w(n,(e=>u(e))),m=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?p.current=t:q(p.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||q(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&q(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),a.useEffect((()=>{if(c){Y.add(m);const e=document.activeElement;if(!c.contains(e)){const t=new CustomEvent(F,V);c.addEventListener(F,d),c.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(q(r,{select:t}),document.activeElement!==n)return}(U(c).filter((e=>"A"!==e.tagName)),{select:!0}),document.activeElement===e&&q(c))}return()=>{c.removeEventListener(F,d),setTimeout((()=>{const t=new CustomEvent(z,V);c.addEventListener(z,f),c.dispatchEvent(t),t.defaultPrevented||q(e??document.body,{select:!0}),c.removeEventListener(z,f),Y.remove(m)}),0)}}}),[c,d,f,m]);const y=a.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,i]=function(e){const t=U(e);return[W(t,e),W(t.reverse(),e)]}(t);o&&i?e.shiftKey||n!==i?e.shiftKey&&n===o&&(e.preventDefault(),r&&q(i,{select:!0})):(e.preventDefault(),r&&q(o,{select:!0})):n===t&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(_.div,{tabIndex:-1,...l,ref:h,onKeyDown:y})}));function U(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function W(e,t){for(const n of e)if(!H(n,{upTo:t}))return n}function H(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function q(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}$.displayName="FocusScope";var Y=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=X(e,t),e.unshift(t)},remove(t){e=X(e,t),e[0]?.resume()}}}();function X(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var K=a.forwardRef(((e,n)=>{const{container:r,...o}=e,[i,s]=a.useState(!1);O((()=>s(!0)),[]);const l=r||i&&globalThis?.document?.body;return l?c.default.createPortal(t.jsx(_.div,{...o,ref:n}),l):null}));K.displayName="Portal";var G=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=a.useState(),r=a.useRef({}),o=a.useRef(e),i=a.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return a.useReducer(((e,n)=>t[e][n]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect((()=>{const e=Z(r.current);i.current="mounted"===l?e:"none"}),[l]),O((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=Z(t);c(e?"MOUNT":"none"===a||"none"===t?.display?"UNMOUNT":n&&r!==a?"ANIMATION_OUT":"UNMOUNT"),o.current=e}}),[e,c]),O((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,a=i=>{const a=Z(r.current).includes(i.animationName);if(i.target===t&&a&&(c("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},s=e=>{e.target===t&&(i.current=Z(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:a.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):a.Children.only(n),i=w(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(o));return"function"==typeof n||r.isPresent?a.cloneElement(o,{ref:i}):null};function Z(e){return e?.animationName||"none"}G.displayName="Presence";var Q=0;function J(){a.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ee()),document.body.insertAdjacentElement("beforeend",e[1]??ee()),Q++,()=>{1===Q&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Q--}}),[])}function ee(){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 te="right-scroll-bar-position",ne="width-before-scroll-bar";function re(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var oe="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,ie=new WeakMap;function ae(t,n){var r,o,i,a=(r=n||null,o=function(e){return t.forEach((function(t){return re(t,e)}))},i=e.useState((function(){return{value:r,callback:o,facade:{get current(){return i.value},set current(e){var t=i.value;t!==e&&(i.value=e,i.callback(e,t))}}}}))[0],i.callback=o,i.facade);return oe((function(){var e=ie.get(a);if(e){var n=new Set(e),r=new Set(t),o=a.current;n.forEach((function(e){r.has(e)||re(e,null)})),r.forEach((function(e){n.has(e)||re(e,o)}))}ie.set(a,t)}),[t]),a}function se(e){return e}var le=function(e){var t=e.sideCar,n=d(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return a.createElement(r,u({},n))};le.isSideCarExport=!0;var ce=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=se);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:null},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return o}();return t.options=u({async:!0,ssr:!1},e),t}(),ue=function(){},de=a.forwardRef((function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:ue,onWheelCapture:ue,onTouchMoveCapture:ue}),o=r[0],i=r[1],s=e.forwardProps,l=e.children,c=e.className,f=e.removeScrollBar,p=e.enabled,h=e.shards,m=e.sideCar,y=e.noIsolation,v=e.inert,g=e.allowPinchZoom,b=e.as,w=void 0===b?"div":b,x=e.gapMode,O=d(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=m,S=ae([n,t]),P=u(u({},O),o);return a.createElement(a.Fragment,null,p&&a.createElement(E,{sideCar:ce,removeScrollBar:f,shards:h,noIsolation:y,inert:v,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:x}),s?a.cloneElement(a.Children.only(l),u(u({},P),{ref:S})):a.createElement(w,u({},P,{className:c,ref:S}),l))}));de.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},de.classNames={fullWidth:ne,zeroRight:te};var fe=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pe=function(){var e,t=(e=fe(),function(t,n){a.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},he={left:0,top:0,right:0,gap:0},me=function(e){return parseInt(e||"",10)||0},ye=pe(),ve="data-scroll-locked",ge=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(ve,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(te," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(ne," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(te," .").concat(te," {\n right: 0 ").concat(r,";\n }\n \n .").concat(ne," .").concat(ne," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(ve,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},be=function(){var e=parseInt(document.body.getAttribute(ve)||"0",10);return isFinite(e)?e:0},we=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;a.useEffect((function(){return document.body.setAttribute(ve,(be()+1).toString()),function(){var e=be()-1;e<=0?document.body.removeAttribute(ve):document.body.setAttribute(ve,e.toString())}}),[]);var i=a.useMemo((function(){return function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return he;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[me(n),me(r),me(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}}(o)}),[o]);return a.createElement(ye,{styles:ge(i,!t,o,n?"":"!important")})},xe=!1;if("undefined"!=typeof window)try{var Oe=Object.defineProperty({},"passive",{get:function(){return xe=!0,!0}});window.addEventListener("test",Oe,Oe),window.removeEventListener("test",Oe,Oe)}catch(e){xe=!1}var Ee=!!xe&&{passive:!1},Se=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Pe=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),je(e,r)){var o=Ae(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},je=function(e,t){return"v"===e?function(e){return Se(e,"overflowY")}(t):function(e){return Se(e,"overflowX")}(t)},Ae=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},ke=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Te=function(e){return[e.deltaX,e.deltaY]},Ce=function(e){return e&&"current"in e?e.current:e},Me=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Ne=0,_e=[];function De(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Re,Ie=(Re=function(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(Ne++)[0],i=a.useState(pe)[0],s=a.useRef(e);a.useEffect((function(){s.current=e}),[e]),a.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=f([e.lockRef.current],(e.shards||[]).map(Ce),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=a.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,i=ke(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=Pe(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=Pe(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,s=t.contains(a),l=!1,c=i>0,u=0,d=0;do{var f=Ae(e,a),p=f[0],h=f[1]-f[2]-o*p;(p||h)&&je(e,a)&&(u+=h,d+=p),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!s&&a!==document.body||s&&(t.contains(a)||t===a));return(c&&(Math.abs(u)<1||!1)||!c&&(Math.abs(d)<1||!1))&&(l=!0),l}(p,t,e,"h"===p?l:c)}),[]),c=a.useCallback((function(e){var n=e;if(_e.length&&_e[_e.length-1]===i){var r="deltaY"in n?Te(n):ke(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var a=(s.current.shards||[]).map(Ce).filter(Boolean).filter((function(e){return e.contains(n.target)}));(a.length>0?l(n,a[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=a.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:De(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=a.useCallback((function(e){n.current=ke(e),r.current=void 0}),[]),p=a.useCallback((function(t){u(t.type,Te(t),t.target,l(t,e.lockRef.current))}),[]),h=a.useCallback((function(t){u(t.type,ke(t),t.target,l(t,e.lockRef.current))}),[]);a.useEffect((function(){return _e.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Ee),document.addEventListener("touchmove",c,Ee),document.addEventListener("touchstart",d,Ee),function(){_e=_e.filter((function(e){return e!==i})),document.removeEventListener("wheel",c,Ee),document.removeEventListener("touchmove",c,Ee),document.removeEventListener("touchstart",d,Ee)}}),[]);var m=e.removeScrollBar,y=e.inert;return a.createElement(a.Fragment,null,y?a.createElement(i,{styles:Me(o)}):null,m?a.createElement(we,{gapMode:e.gapMode}):null)},ce.useMedium(Re),le),Le=a.forwardRef((function(e,t){return a.createElement(de,u({},e,{ref:t,sideCar:Ie}))}));Le.classNames=de.classNames;var Be=Le,Fe=new WeakMap,ze=new WeakMap,Ve={},$e=0,Ue=function(e){return e&&(e.host||Ue(e.parentNode))},We=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=Ue(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);Ve[n]||(Ve[n]=new WeakMap);var i=Ve[n],a=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(Fe.get(e)||0)+1,c=(i.get(e)||0)+1;Fe.set(e,l),i.set(e,c),a.push(e),1===l&&o&&ze.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return u(t),s.clear(),$e++,function(){a.forEach((function(e){var t=Fe.get(e)-1,o=i.get(e)-1;Fe.set(e,t),i.set(e,o),t||(ze.has(e)||e.removeAttribute(r),ze.delete(e)),o||e.removeAttribute(n)})),--$e||(Fe=new WeakMap,Fe=new WeakMap,ze=new WeakMap,Ve={})}}(r,o,n,"aria-hidden")):function(){return null}},He="Dialog",[qe,Ye]=y(He),[Xe,Ke]=qe(He),Ge=e=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=a.useRef(null),u=a.useRef(null),[d=!1,f]=A({prop:o,defaultProp:i,onChange:s});return t.jsx(Xe,{scope:n,triggerRef:c,contentRef:u,contentId:P(),titleId:P(),descriptionId:P(),open:d,onOpenChange:f,onOpenToggle:a.useCallback((()=>f((e=>!e))),[f]),modal:l,children:r})};Ge.displayName=He;var Ze="DialogTrigger",Qe=a.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Ke(Ze,r),a=w(n,i.triggerRef);return t.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":vt(i.open),...o,ref:a,onClick:x(e.onClick,i.onOpenToggle)})}));Qe.displayName=Ze;var Je="DialogPortal",[et,tt]=qe(Je,{forceMount:void 0}),nt=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:i}=e,s=Ke(Je,n);return t.jsx(et,{scope:n,forceMount:r,children:a.Children.map(o,(e=>t.jsx(G,{present:r||s.open,children:t.jsx(K,{asChild:!0,container:i,children:e})})))})};nt.displayName=Je;var rt="DialogOverlay",ot=a.forwardRef(((e,n)=>{const r=tt(rt,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=Ke(rt,e.__scopeDialog);return a.modal?t.jsx(G,{present:o||a.open,children:t.jsx(it,{...i,ref:n})}):null}));ot.displayName=rt;var it=a.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Ke(rt,r);return t.jsx(Be,{as:k,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(_.div,{"data-state":vt(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})})),at="DialogContent",st=a.forwardRef(((e,n)=>{const r=tt(at,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=Ke(at,e.__scopeDialog);return t.jsx(G,{present:o||a.open,children:a.modal?t.jsx(lt,{...i,ref:n}):t.jsx(ct,{...i,ref:n})})}));st.displayName=at;var lt=a.forwardRef(((e,n)=>{const r=Ke(at,e.__scopeDialog),o=a.useRef(null),i=w(n,r.contentRef,o);return a.useEffect((()=>{const e=o.current;if(e)return We(e)}),[]),t.jsx(ut,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:x(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()})),onFocusOutside:x(e.onFocusOutside,(e=>e.preventDefault()))})})),ct=a.forwardRef(((e,n)=>{const r=Ke(at,e.__scopeDialog),o=a.useRef(!1),i=a.useRef(!1);return t.jsx(ut,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const n=t.target,a=r.triggerRef.current?.contains(n);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})})),ut=a.forwardRef(((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=Ke(at,r),u=a.useRef(null),d=w(n,u);return J(),t.jsxs(t.Fragment,{children:[t.jsx($,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(I,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":vt(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(xt,{titleId:c.titleId}),t.jsx(Ot,{contentRef:u,descriptionId:c.descriptionId})]})]})})),dt="DialogTitle",ft=a.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Ke(dt,r);return t.jsx(_.h2,{id:i.titleId,...o,ref:n})}));ft.displayName=dt;var pt="DialogDescription",ht=a.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Ke(pt,r);return t.jsx(_.p,{id:i.descriptionId,...o,ref:n})}));ht.displayName=pt;var mt="DialogClose",yt=a.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=Ke(mt,r);return t.jsx(_.button,{type:"button",...o,ref:n,onClick:x(e.onClick,(()=>i.onOpenChange(!1)))})}));function vt(e){return e?"open":"closed"}yt.displayName=mt;var gt="DialogTitleWarning",[bt,wt]=function(e,n){const r=a.createContext(n),o=e=>{const{children:n,...o}=e,i=a.useMemo((()=>o),Object.values(o));return t.jsx(r.Provider,{value:i,children:n})};return o.displayName=e+"Provider",[o,function(t){const o=a.useContext(r);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(gt,{contentName:at,titleName:dt,docsSlug:"dialog"}),xt=({titleId:e})=>{const t=wt(gt),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect((()=>{e&&(document.getElementById(e)||console.error(n))}),[n,e]),null},Ot=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wt("DialogDescriptionWarning").contentName}}.`;return a.useEffect((()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))}),[n,e,t]),null},Et=Ge,St=Qe,Pt=nt,jt=ot,At=st,kt=ft,Tt=ht,Ct=yt,Mt="AlertDialog",[Nt,_t]=y(Mt,[Ye]),Dt=Ye(),Rt=e=>{const{__scopeAlertDialog:n,...r}=e,o=Dt(n);return t.jsx(Et,{...o,...r,modal:!0})};Rt.displayName=Mt;var It=a.forwardRef(((e,n)=>{const{__scopeAlertDialog:r,...o}=e,i=Dt(r);return t.jsx(St,{...i,...o,ref:n})}));It.displayName="AlertDialogTrigger";var Lt=e=>{const{__scopeAlertDialog:n,...r}=e,o=Dt(n);return t.jsx(Pt,{...o,...r})};Lt.displayName="AlertDialogPortal";var Bt=a.forwardRef(((e,n)=>{const{__scopeAlertDialog:r,...o}=e,i=Dt(r);return t.jsx(jt,{...i,...o,ref:n})}));Bt.displayName="AlertDialogOverlay";var Ft="AlertDialogContent",[zt,Vt]=Nt(Ft),$t=a.forwardRef(((e,n)=>{const{__scopeAlertDialog:r,children:o,...i}=e,s=Dt(r),l=a.useRef(null),c=w(n,l),u=a.useRef(null);return t.jsx(bt,{contentName:Ft,titleName:Ut,docsSlug:"alert-dialog",children:t.jsx(zt,{scope:r,cancelRef:u,children:t.jsxs(At,{role:"alertdialog",...s,...i,ref:c,onOpenAutoFocus:x(i.onOpenAutoFocus,(e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})})),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[t.jsx(C,{children:o}),t.jsx(Gt,{contentRef:l})]})})})}));$t.displayName=Ft;var Ut="AlertDialogTitle",Wt=a.forwardRef(((e,n)=>{const{__scopeAlertDialog:r,...o}=e,i=Dt(r);return t.jsx(kt,{...i,...o,ref:n})}));Wt.displayName=Ut;var Ht="AlertDialogDescription",qt=a.forwardRef(((e,n)=>{const{__scopeAlertDialog:r,...o}=e,i=Dt(r);return t.jsx(Tt,{...i,...o,ref:n})}));qt.displayName=Ht;var Yt=a.forwardRef(((e,n)=>{const{__scopeAlertDialog:r,...o}=e,i=Dt(r);return t.jsx(Ct,{...i,...o,ref:n})}));Yt.displayName="AlertDialogAction";var Xt="AlertDialogCancel",Kt=a.forwardRef(((e,n)=>{const{__scopeAlertDialog:r,...o}=e,{cancelRef:i}=Vt(Xt,r),a=Dt(r),s=w(n,i);return t.jsx(Ct,{...a,...o,ref:s})}));Kt.displayName=Xt;var Gt=({contentRef:e})=>{const t=`\`${Ft}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Ft}\` by passing a \`${Ht}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ft}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect((()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)}),[t,e]),null},Zt=It,Qt=Lt,Jt=Bt,en=$t,tn=Yt,nn=Kt,rn=Wt,on=qt;function an(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return h(e)}var sn=Rt,ln=i.default.forwardRef((function(e,t){var n=e.className,r=d(e,["className"]);return i.default.createElement(Jt,u({ref:t,className:an("fixed inset-0 bg-black/50 z-50 transition-opacity",n)},r))}));ln.displayName="AlertDialogOverlay";var cn=i.default.forwardRef((function(e,t){var n=e.className,r=e.children,o=d(e,["className","children"]);return i.default.createElement(Qt,null,i.default.createElement(ln,null),i.default.createElement("div",{className:"fixed inset-0 flex items-center justify-center z-50"},i.default.createElement(en,u({ref:t,className:an("bg-white rounded-lg shadow-lg p-6 max-w-lg w-full space-y-4","focus:outline-none",n)},o),r)))}));function un(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return h(e)}cn.displayName="AlertDialogContent";const dn=e.createContext({});function fn(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const pn=e.createContext(null),hn=e.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class mn extends a.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function yn({children:n,isPresent:r}){const o=e.useId(),i=e.useRef(null),s=e.useRef({width:0,height:0,top:0,left:0}),{nonce:l}=e.useContext(hn);return e.useInsertionEffect((()=>{const{width:e,height:t,top:n,left:a}=s.current;if(r||!i.current||!e||!t)return;i.current.dataset.motionPopId=o;const c=document.createElement("style");return l&&(c.nonce=l),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n top: ${n}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[r]),t.jsx(mn,{isPresent:r,childRef:i,sizeRef:s,children:a.cloneElement(n,{ref:i})})}const vn=({children:n,initial:r,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:l,mode:c})=>{const u=fn(gn),d=e.useId(),f=e.useCallback((e=>{u.set(e,!0);for(const e of u.values())if(!e)return;i&&i()}),[u,i]),p=e.useMemo((()=>({id:d,initial:r,isPresent:o,custom:s,onExitComplete:f,register:e=>(u.set(e,!1),()=>u.delete(e))})),l?[Math.random(),f]:[o,f]);return e.useMemo((()=>{u.forEach(((e,t)=>u.set(t,!1)))}),[o]),a.useEffect((()=>{!o&&!u.size&&i&&i()}),[o]),"popLayout"===c&&(n=t.jsx(yn,{isPresent:o,children:n})),t.jsx(pn.Provider,{value:p,children:n})};function gn(){return new Map}function bn(t=!0){const n=e.useContext(pn);if(null===n)return[!0,null];const{isPresent:r,onExitComplete:o,register:i}=n,a=e.useId();e.useEffect((()=>{t&&i(a)}),[t]);const s=e.useCallback((()=>t&&o&&o(a)),[a,o,t]);return!r&&o?[!1,s]:[!0]}const wn=e=>e.key||"";function xn(t){const n=[];return e.Children.forEach(t,(t=>{e.isValidElement(t)&&n.push(t)})),n}const On="undefined"!=typeof window,En=On?e.useLayoutEffect:e.useEffect,Sn=({children:n,custom:r,initial:o=!0,onExitComplete:i,presenceAffectsLayout:a=!0,mode:s="sync",propagate:l=!1})=>{const[c,u]=bn(l),d=e.useMemo((()=>xn(n)),[n]),f=l&&!c?[]:d.map(wn),p=e.useRef(!0),h=e.useRef(d),m=fn((()=>new Map)),[y,v]=e.useState(d),[g,b]=e.useState(d);En((()=>{p.current=!1,h.current=d;for(let e=0;e<g.length;e++){const t=wn(g[e]);f.includes(t)?m.delete(t):!0!==m.get(t)&&m.set(t,!1)}}),[g,f.length,f.join("-")]);const w=[];if(d!==y){let e=[...d];for(let t=0;t<g.length;t++){const n=g[t],r=wn(n);f.includes(r)||(e.splice(t,0,n),w.push(n))}return"wait"===s&&w.length&&(e=w),b(xn(e)),void v(d)}"production"!==process.env.NODE_ENV&&"wait"===s&&g.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.');const{forceRender:x}=e.useContext(dn);return t.jsx(t.Fragment,{children:g.map((e=>{const n=wn(e),y=!(l&&!c)&&(d===g||f.includes(n));return t.jsx(vn,{isPresent:y,initial:!(p.current&&!o)&&void 0,custom:y?void 0:r,presenceAffectsLayout:a,mode:s,onExitComplete:y?void 0:()=>{if(!m.has(n))return;m.set(n,!0);let e=!0;m.forEach((t=>{t||(e=!1)})),e&&(null==x||x(),b(h.current),l&&(null==u||u()),i&&i())},children:e},n)}))})},Pn=e=>e;let jn=Pn,An=Pn;function kn(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(jn=(e,t)=>{e||"undefined"==typeof console||console.warn(t)},An=(e,t)=>{if(!e)throw new Error(t)});const Tn=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Cn=e=>1e3*e,Mn=e=>e/1e3,Nn=["read","resolveKeyframes","update","preRender","render","postRender"];function _n(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Nn.reduce(((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function s(t){i.has(t)&&(l.schedule(t),e()),t(a)}const l={schedule:(e,o=!1,a=!1)=>{const s=a&&r?t:n;return o&&i.add(e),s.has(e)||s.add(e),e},cancel:e=>{n.delete(e),i.delete(e)},process:e=>{a=e,r?o=!0:(r=!0,[t,n]=[n,t],t.forEach(s),t.clear(),r=!1,o&&(o=!1,l.process(e)))}};return l}(i),e)),{}),{read:s,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=a,p=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))};return{schedule:Nn.reduce(((t,i)=>{const s=a[i];return t[i]=(t,i=!1,a=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(p)),s.schedule(t,i,a)),t}),{}),cancel:e=>{for(let t=0;t<Nn.length;t++)a[Nn[t]].cancel(e)},state:o,steps:a}}const{schedule:Dn,cancel:Rn,state:In,steps:Ln}=_n("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Pn,!0),Bn=e.createContext({strict:!1}),Fn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},zn={};for(const e in Fn)zn[e]={isEnabled:t=>Fn[e].some((e=>!!t[e]))};const Vn=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function $n(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Vn.has(e)}let Un=e=>!$n(e);try{(Wn=require("@emotion/is-prop-valid").default)&&(Un=e=>e.startsWith("on")?!$n(e):Wn(e))}catch(e){}var Wn;const Hn=new Set;function qn(e,t,n){e||Hn.has(t)||(console.warn(t),n&&console.warn(n),Hn.add(t))}const Yn=e.createContext({});function Xn(e){return"string"==typeof e||Array.isArray(e)}function Kn(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const Gn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Zn=["initial",...Gn];function Qn(e){return Kn(e.animate)||Zn.some((t=>Xn(e[t])))}function Jn(e){return Boolean(Qn(e)||e.variants)}function er(e){return Array.isArray(e)?e.join(" "):e}const tr=Symbol.for("motionComponentSymbol");function nr(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function rr(t,n,r){return e.useCallback((e=>{e&&t.onMount&&t.onMount(e),n&&(e?n.mount(e):n.unmount()),r&&("function"==typeof r?r(e):nr(r)&&(r.current=e))}),[n])}const or=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ir="data-"+or("framerAppearId"),{schedule:ar,cancel:sr}=_n(queueMicrotask,!1),lr=e.createContext({});function cr(t,n,r,o,i){var a,s;const{visualElement:l}=e.useContext(Yn),c=e.useContext(Bn),u=e.useContext(pn),d=e.useContext(hn).reducedMotion,f=e.useRef(null);o=o||c.renderer,!f.current&&o&&(f.current=o(t,{visualState:n,parent:l,props:r,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:d}));const p=f.current,h=e.useContext(lr);!p||p.projection||!i||"html"!==p.type&&"svg"!==p.type||function(e,t,n,r){const{layoutId:o,layout:i,drag:a,dragConstraints:s,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ur(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(a)||s&&nr(s),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(f.current,r,i,h);const m=e.useRef(!1);e.useInsertionEffect((()=>{p&&m.current&&p.update(r,u)}));const y=r[ir],v=e.useRef(Boolean(y)&&!(null===(a=window.MotionHandoffIsComplete)||void 0===a?void 0:a.call(window,y))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,y)));return En((()=>{p&&(m.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),ar.render(p.render),v.current&&p.animationState&&p.animationState.animateChanges())})),e.useEffect((()=>{p&&(!v.current&&p.animationState&&p.animationState.animateChanges(),v.current&&(queueMicrotask((()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,y)})),v.current=!1))})),p}function ur(e){if(e)return!1!==e.options.allowProjection?e.projection:ur(e.parent)}function dr({preloadedFeatures:n,createVisualElement:r,useRender:o,useVisualState:i,Component:a}){var s,l;function c(s,l){let c;const u={...e.useContext(hn),...s,layoutId:fr(s)},{isStatic:d}=u,f=function(t){const{initial:n,animate:r}=function(e,t){if(Qn(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Xn(t)?t:void 0,animate:Xn(n)?n:void 0}}return!1!==e.inherit?t:{}}(t,e.useContext(Yn));return e.useMemo((()=>({initial:n,animate:r})),[er(n),er(r)])}(s),p=i(s,d);if(!d&&On){!function(t,n){const r=e.useContext(Bn).strict;if("production"!==process.env.NODE_ENV&&n&&r){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?jn(!1,e):An(!1,e)}}(u,n);const t=function(e){const{drag:t,layout:n}=zn;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(u);c=t.MeasureLayout,f.visualElement=cr(a,p,u,r,t.ProjectionNode)}return t.jsxs(Yn.Provider,{value:f,children:[c&&f.visualElement?t.jsx(c,{visualElement:f.visualElement,...u}):null,o(a,s,rr(p,f.visualElement,l),p,d,f.visualElement)]})}n&&function(e){for(const t in e)zn[t]={...zn[t],...e[t]}}(n),c.displayName=`motion.${"string"==typeof a?a:`create(${null!==(l=null!==(s=a.displayName)&&void 0!==s?s:a.name)&&void 0!==l?l:""})`}`;const u=e.forwardRef(c);return u[tr]=a,u}function fr({layoutId:t}){const n=e.useContext(dn).id;return n&&void 0!==t?n+"-"+t:t}const pr=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function hr(e){return"string"==typeof e&&!e.includes("-")&&!!(pr.indexOf(e)>-1||/[A-Z]/u.test(e))}function mr(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function yr(e,t,n,r){if("function"==typeof t){const[o,i]=mr(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=mr(r);t=t(void 0!==n?n:e.custom,o,i)}return t}const vr=e=>Array.isArray(e),gr=e=>vr(e)?e[e.length-1]||0:e,br=e=>Boolean(e&&e.getVelocity);function wr(e){const t=br(e)?e.get():e;return(e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const xr=t=>(n,r)=>{const o=e.useContext(Yn),i=e.useContext(pn),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const a={latestValues:Or(r,o,i,e),renderState:t()};return n&&(a.onMount=e=>n({props:r,current:e,...a}),a.onUpdate=e=>n(e)),a}(t,n,o,i);return r?a():fn(a)};function Or(e,t,n,r){const o={},i=r(e,{});for(const e in i)o[e]=wr(i[e]);let{initial:a,animate:s}=e;const l=Qn(e),c=Jn(e);t&&c&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===s&&(s=t.animate));let u=!!n&&!1===n.initial;u=u||!1===a;const d=u?s:a;if(d&&"boolean"!=typeof d&&!Kn(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=yr(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const e in n){let t=n[e];Array.isArray(t)&&(t=t[u?t.length-1:0]),null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const Er=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Sr=new Set(Er),Pr=e=>t=>"string"==typeof t&&t.startsWith(e),jr=Pr("--"),Ar=Pr("var(--"),kr=e=>!!Ar(e)&&Tr.test(e.split("/*")[0].trim()),Tr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Cr=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Mr=(e,t,n)=>n>t?t:n<e?e:n,Nr={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},_r={...Nr,transform:e=>Mr(0,1,e)},Dr={...Nr,default:1},Rr=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Ir=Rr("deg"),Lr=Rr("%"),Br=Rr("px"),Fr=Rr("vh"),zr=Rr("vw"),Vr={...Lr,parse:e=>Lr.parse(e)/100,transform:e=>Lr.transform(100*e)},$r={borderWidth:Br,borderTopWidth:Br,borderRightWidth:Br,borderBottomWidth:Br,borderLeftWidth:Br,borderRadius:Br,radius:Br,borderTopLeftRadius:Br,borderTopRightRadius:Br,borderBottomRightRadius:Br,borderBottomLeftRadius:Br,width:Br,maxWidth:Br,height:Br,maxHeight:Br,top:Br,right:Br,bottom:Br,left:Br,padding:Br,paddingTop:Br,paddingRight:Br,paddingBottom:Br,paddingLeft:Br,ma