@tomny-dev/uzi 0.2.3 → 0.2.5
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.
- package/dist/index.cjs +1924 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1380 -6078
- package/dist/index.js.map +1 -1
- package/dist/style.css +2025 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,46 +1,1926 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require("react"),u=c(l,1);l=c(l);let d=require("react/jsx-runtime"),f=require("react-dom");f=c(f,1);function p(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function m(...e){return t=>{let n=!1,r=e.map(e=>{let r=p(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():p(e[t],null)}}}}function h(...e){return u.useCallback(m(...e),e)}var g=Symbol.for(`react.lazy`),_=u.use;function v(e){return typeof e==`object`&&!!e&&`then`in e}function y(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===g&&`_payload`in e&&v(e._payload)}function b(e){let t=S(e),n=u.forwardRef((e,n)=>{let{children:r,...i}=e;y(r)&&typeof _==`function`&&(r=_(r._payload));let a=u.Children.toArray(r),o=a.find(w);if(o){let e=o.props.children,r=a.map(t=>t===o?u.Children.count(e)>1?u.Children.only(null):u.isValidElement(e)?e.props.children:null:t);return(0,d.jsx)(t,{...i,ref:n,children:u.isValidElement(e)?u.cloneElement(e,void 0,r):null})}return(0,d.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var x=b(`Slot`);function S(e){let t=u.forwardRef((e,t)=>{let{children:n,...r}=e;if(y(n)&&typeof _==`function`&&(n=_(n._payload)),u.isValidElement(n)){let e=E(n),i=T(r,n.props);return n.type!==u.Fragment&&(i.ref=t?m(t,e):e),u.cloneElement(n,i)}return u.Children.count(n)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var C=Symbol(`radix.slottable`);function w(e){return u.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===C}function T(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function E(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)}function D(...e){return e.filter(Boolean).join(` `)}var O={button:`uzi-button-module__button__5dzDN`,sizeSm:`uzi-button-module__sizeSm__jb544`,sizeMd:`uzi-button-module__sizeMd__lIo8M`,sizeLg:`uzi-button-module__sizeLg__QSSuW`,sizeIcon:`uzi-button-module__sizeIcon__Aa9tN`,variantPrimary:`uzi-button-module__variantPrimary__zp2Pg`,variantSecondary:`uzi-button-module__variantSecondary__oX5CB`,variantOutline:`uzi-button-module__variantOutline__uXfiP`,variantGhost:`uzi-button-module__variantGhost__-OEB8`,variantDestructive:`uzi-button-module__variantDestructive__5IeYA`,variantLink:`uzi-button-module__variantLink__Olx4I`},k={default:`variantPrimary`,primary:`variantPrimary`,secondary:`variantSecondary`,outline:`variantOutline`,ghost:`variantGhost`,destructive:`variantDestructive`,link:`variantLink`},A={default:`sizeMd`,sm:`sizeSm`,md:`sizeMd`,lg:`sizeLg`,icon:`sizeIcon`};function j({as:e,variant:t=`default`,size:n=`default`,className:r,children:i,asChild:a=!1,...o}){let s=D(O.button,O[k[t]],O[A[n]],r);return a?(0,d.jsx)(x,{className:s,...o,children:i}):e===`a`?(0,d.jsx)(`a`,{className:s,...o,children:i}):(0,d.jsx)(`button`,{type:`button`,className:s,...o,children:i})}function M(e,t=[]){let n=[];function r(t,r){let i=u.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=u.useMemo(()=>o,Object.values(o));return(0,d.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=u.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>u.createContext(e));return function(n){let r=n?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,N(i,...t)]}function N(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function P(e){let t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...e)=>t.current?.(...e),[])}var F=globalThis?.document?u.useLayoutEffect:()=>{},ee=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=b(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,d.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),I=o((e=>{var t=require("react");function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),te=o((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function n(e,t){d||a.startTransition===void 0||(d=!0,console.error(`You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.`));var n=t();if(!f){var i=t();o(n,i)||(console.error(`The result of getSnapshot should be cached to avoid an infinite loop`),f=!0)}i=s({inst:{value:n,getSnapshot:t}});var p=i[0].inst,m=i[1];return l(function(){p.value=n,p.getSnapshot=t,r(p)&&m({inst:p})},[e,n,t]),c(function(){return r(p)&&m({inst:p}),e(function(){r(p)&&m({inst:p})})},[e]),u(n),n}function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch{return!0}}function i(e,t){return t()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=require("react"),o=typeof Object.is==`function`?Object.is:t,s=a.useState,c=a.useEffect,l=a.useLayoutEffect,u=a.useDebugValue,d=!1,f=!1,p=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?i:n;e.useSyncExternalStore=a.useSyncExternalStore===void 0?p:a.useSyncExternalStore,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),ne=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=I():t.exports=te()}))();function re(){return(0,ne.useSyncExternalStore)(ie,()=>!0,()=>!1)}function ie(){return()=>{}}var ae=`Avatar`,[oe,se]=M(ae),[ce,le]=oe(ae),ue=u.forwardRef((e,t)=>{let{__scopeAvatar:n,...r}=e,[i,a]=u.useState(`idle`);return(0,d.jsx)(ce,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:(0,d.jsx)(ee.span,{...r,ref:t})})});ue.displayName=ae;var de=`AvatarImage`,fe=u.forwardRef((e,t)=>{let{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=e,o=le(de,n),s=ge(r,a),c=P(e=>{i(e),o.onImageLoadingStatusChange(e)});return F(()=>{s!==`idle`&&c(s)},[s,c]),s===`loaded`?(0,d.jsx)(ee.img,{...a,ref:t,src:r}):null});fe.displayName=de;var pe=`AvatarFallback`,me=u.forwardRef((e,t)=>{let{__scopeAvatar:n,delayMs:r,...i}=e,a=le(pe,n),[o,s]=u.useState(r===void 0);return u.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,d.jsx)(ee.span,{...i,ref:t}):null});me.displayName=pe;function he(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?`loaded`:`loading`):`error`:`idle`}function ge(e,{referrerPolicy:t,crossOrigin:n}){let r=re(),i=u.useRef(null),a=r?(i.current||=new window.Image,i.current):null,[o,s]=u.useState(()=>he(a,e));return F(()=>{s(he(a,e))},[a,e]),F(()=>{let e=e=>()=>{s(e)};if(!a)return;let r=e(`loaded`),i=e(`error`);return a.addEventListener(`load`,r),a.addEventListener(`error`,i),t&&(a.referrerPolicy=t),typeof n==`string`&&(a.crossOrigin=n),()=>{a.removeEventListener(`load`,r),a.removeEventListener(`error`,i)}},[a,n,t]),o}var _e=ue,ve=fe,ye=me,be={avatar:`uzi-avatar-module__avatar__yPIOs`,"size-sm":`uzi-avatar-module__size-sm__v5riJ`,"size-md":`uzi-avatar-module__size-md__g7IQS`,"size-lg":`uzi-avatar-module__size-lg__Ca4xk`,"size-xl":`uzi-avatar-module__size-xl__K0Dfk`,image:`uzi-avatar-module__image__Ngo7A`,fallback:`uzi-avatar-module__fallback__Tf3oZ`};function xe({className:e,size:t=`md`,...n}){let r=t===`sm`?be[`size-sm`]:t===`lg`?be[`size-lg`]:t===`xl`?be[`size-xl`]:be[`size-md`];return(0,d.jsx)(_e,{className:D(be.avatar,r,e),...n})}function Se({className:e,...t}){return(0,d.jsx)(ve,{className:D(be.image,e),...t})}function Ce({className:e,...t}){return(0,d.jsx)(ye,{className:D(be.fallback,e),...t})}var we={card:`uzi-card-module__card__ZPFTz`,"tone-default":`uzi-card-module__tone-default__7Ujf9`,"tone-muted":`uzi-card-module__tone-muted__RQy5B`,"tone-contrast":`uzi-card-module__tone-contrast__JpFxL`,interactive:`uzi-card-module__interactive__zlPML`,"padding-none":`uzi-card-module__padding-none__LXdx-`,"padding-sm":`uzi-card-module__padding-sm__-Ub1s`,"padding-md":`uzi-card-module__padding-md__kUf46`,"padding-lg":`uzi-card-module__padding-lg__a5mWP`};function Te({as:e,tone:t=`default`,padding:n=`md`,interactive:r=!1,className:i,children:a,...o}){let s=e??`div`,c={default:null,muted:`tone-muted`,contrast:`tone-contrast`};return(0,d.jsx)(s,{className:D(we.card,c[t]?we[c[t]]:null,we[{none:`padding-none`,sm:`padding-sm`,md:`padding-md`,lg:`padding-lg`}[n]],r&&we.interactive,i),...o,children:a})}var Ee={pill:`uzi-pill-module__pill__uCKcP`,"size-sm":`uzi-pill-module__size-sm__JANOQ`,"size-md":`uzi-pill-module__size-md__fdsqR`,"tone-success":`uzi-pill-module__tone-success__kW2Kf`,"tone-warning":`uzi-pill-module__tone-warning__Rc5-s`,"tone-info":`uzi-pill-module__tone-info__0vQrj`,"tone-danger":`uzi-pill-module__tone-danger__gzNOa`,icon:`uzi-pill-module__icon__KQ8zg`,content:`uzi-pill-module__content__T7AG1`};function De({as:e,tone:t=`neutral`,size:n=`md`,icon:r,className:i,children:a,...o}){return(0,d.jsxs)(e??`span`,{className:D(Ee.pill,Ee[`tone-${t}`],Ee[`size-${n}`],i),...o,children:[r?(0,d.jsx)(`span`,{className:Ee.icon,"aria-hidden":`true`,children:r}):null,(0,d.jsx)(`span`,{className:Ee.content,children:a})]})}typeof window<`u`&&window.document&&window.document.createElement;function L(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Oe(e,t){let n=u.createContext(t),r=e=>{let{children:t,...r}=e,i=u.useMemo(()=>r,Object.values(r));return(0,d.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function ke(e,t=[]){let n=[];function r(t,r){let i=u.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=u.useMemo(()=>o,Object.values(o));return(0,d.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=u.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>u.createContext(e));return function(n){let r=n?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Ae(i,...t)]}function Ae(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var je=u.useId||(()=>void 0),Me=0;function R(e){let[t,n]=u.useState(je());return F(()=>{e||n(e=>e??String(Me++))},[e]),e||(t?`radix-${t}`:``)}var Ne=u.useInsertionEffect||F;function Pe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Fe({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=u.useRef(e!==void 0);u.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`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.`),t.current=s},[s,r])}return[c,u.useCallback(t=>{if(s){let n=Ie(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Fe({defaultProp:e,onChange:t}){let[n,r]=u.useState(e),i=u.useRef(n),a=u.useRef(t);return Ne(()=>{a.current=t},[t]),u.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Ie(e){return typeof e==`function`}function Le(e){let t=Re(e),n=u.forwardRef((e,n)=>{let{children:r,...i}=e,a=u.Children.toArray(r),o=a.find(Be);if(o){let e=o.props.children,r=a.map(t=>t===o?u.Children.count(e)>1?u.Children.only(null):u.isValidElement(e)?e.props.children:null:t);return(0,d.jsx)(t,{...i,ref:n,children:u.isValidElement(e)?u.cloneElement(e,void 0,r):null})}return(0,d.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Re(e){let t=u.forwardRef((e,t)=>{let{children:n,...r}=e;if(u.isValidElement(n)){let e=He(n),i=Ve(r,n.props);return n.type!==u.Fragment&&(i.ref=t?m(t,e):e),u.cloneElement(n,i)}return u.Children.count(n)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ze=Symbol(`radix.slottable`);function Be(e){return u.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ze}function Ve(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function He(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)}var z=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Le(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,d.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ue(e,t){e&&f.flushSync(()=>e.dispatchEvent(t))}function We(e,t=globalThis?.document){let n=P(e);u.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Ge=`DismissableLayer`,Ke=`dismissableLayer.update`,qe=`dismissableLayer.pointerDownOutside`,Je=`dismissableLayer.focusOutside`,Ye,Xe=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ze=u.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=u.useContext(Xe),[f,p]=u.useState(null),m=f?.ownerDocument??globalThis?.document,[,g]=u.useState({}),_=h(t,e=>p(e)),v=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=f?v.indexOf(f):-1,S=l.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,w=et(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!C||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},m),T=tt(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},m);return We(e=>{x===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},m),u.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ye=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),nt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ye)}},[f,m,n,l]),u.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),nt())},[f,l]),u.useEffect(()=>{let e=()=>g({});return document.addEventListener(Ke,e),()=>document.removeEventListener(Ke,e)},[]),(0,d.jsx)(z.div,{...c,ref:_,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:L(e.onFocusCapture,T.onFocusCapture),onBlurCapture:L(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:L(e.onPointerDownCapture,w.onPointerDownCapture)})});Ze.displayName=Ge;var Qe=`DismissableLayerBranch`,$e=u.forwardRef((e,t)=>{let n=u.useContext(Xe),r=u.useRef(null),i=h(t,r);return u.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,d.jsx)(z.div,{...e,ref:i})});$e.displayName=Qe;function et(e,t=globalThis?.document){let n=P(e),r=u.useRef(!1),i=u.useRef(()=>{});return u.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){rt(qe,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function tt(e,t=globalThis?.document){let n=P(e),r=u.useRef(!1);return u.useEffect(()=>{let e=e=>{e.target&&!r.current&&rt(Je,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function nt(){let e=new CustomEvent(Ke);document.dispatchEvent(e)}function rt(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ue(i,a):i.dispatchEvent(a)}var it=Ze,at=$e,ot=`focusScope.autoFocusOnMount`,st=`focusScope.autoFocusOnUnmount`,ct={bubbles:!1,cancelable:!0},lt=`FocusScope`,ut=u.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=u.useState(null),l=P(i),f=P(a),p=u.useRef(null),m=h(t,e=>c(e)),g=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let e=function(e){if(g.paused||!s)return;let t=e.target;s.contains(t)?p.current=t:_t(p.current,{select:!0})},t=function(e){if(g.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||_t(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&_t(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,g.paused]),u.useEffect(()=>{if(s){vt.add(g);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ot,ct);s.addEventListener(ot,l),s.dispatchEvent(t),t.defaultPrevented||(dt(xt(pt(s)),{select:!0}),document.activeElement===e&&_t(s))}return()=>{s.removeEventListener(ot,l),setTimeout(()=>{let t=new CustomEvent(st,ct);s.addEventListener(st,f),s.dispatchEvent(t),t.defaultPrevented||_t(e??document.body,{select:!0}),s.removeEventListener(st,f),vt.remove(g)},0)}}},[s,l,f,g]);let _=u.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ft(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&_t(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&_t(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,d.jsx)(z.div,{tabIndex:-1,...o,ref:m,onKeyDown:_})});ut.displayName=lt;function dt(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(_t(r,{select:t}),document.activeElement!==n)return}function ft(e){let t=pt(e);return[mt(t,e),mt(t.reverse(),e)]}function pt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;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 mt(e,t){for(let n of e)if(!ht(n,{upTo:t}))return n}function ht(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 gt(e){return e instanceof HTMLInputElement&&`select`in e}function _t(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&>(e)&&t&&e.select()}}var vt=yt();function yt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=bt(e,t),e.unshift(t)},remove(t){e=bt(e,t),e[0]?.resume()}}}function bt(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xt(e){return e.filter(e=>e.tagName!==`A`)}var St=`Portal`,Ct=u.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=u.useState(!1);F(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?f.default.createPortal((0,d.jsx)(z.div,{...r,ref:t}),o):null});Ct.displayName=St;function wt(e,t){return u.useReducer((e,n)=>t[e][n]??e,e)}var Tt=e=>{let{present:t,children:n}=e,r=Et(t),i=typeof n==`function`?n({present:r.isPresent}):u.Children.only(n),a=h(r.ref,Ot(i));return typeof n==`function`||r.isPresent?u.cloneElement(i,{ref:a}):null};Tt.displayName=`Presence`;function Et(e){let[t,n]=u.useState(),r=u.useRef(null),i=u.useRef(e),a=u.useRef(`none`),[o,s]=wt(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return u.useEffect(()=>{let e=Dt(r.current);a.current=o===`mounted`?e:`none`},[o]),F(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Dt(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),F(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Dt(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Dt(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:u.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Dt(e){return e?.animationName||`none`}function Ot(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)}var kt=0;function At(){u.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??jt()),document.body.insertAdjacentElement(`beforeend`,e[1]??jt()),kt++,()=>{kt===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),kt--}},[])}function jt(){let 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 Mt=function(){return Mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Mt.apply(this,arguments)};function Nt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Pt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ft=`right-scroll-bar-position`,It=`width-before-scroll-bar`,Lt=`with-scroll-bars-hidden`,Rt=`--removed-body-scroll-bar-size`;function zt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Bt(e,t){var n=(0,l.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Vt=typeof window<`u`?l.useLayoutEffect:l.useEffect,Ht=new WeakMap;function Ut(e,t){var n=Bt(t||null,function(t){return e.forEach(function(e){return zt(e,t)})});return Vt(function(){var t=Ht.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||zt(e,null)}),i.forEach(function(e){r.has(e)||zt(e,a)})}Ht.set(n,e)},[e]),n}function Wt(e){return e}function Gt(e,t){t===void 0&&(t=Wt);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},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 i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Kt(e){e===void 0&&(e={});var t=Gt(null);return t.options=Mt({async:!0,ssr:!1},e),t}var qt=function(e){var t=e.sideCar,n=Nt(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return l.createElement(r,Mt({},n))};qt.isSideCarExport=!0;function Jt(e,t){return e.useMedium(t),qt}var Yt=Kt(),Xt=function(){},Zt=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:Xt,onWheelCapture:Xt,onTouchMoveCapture:Xt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Nt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Ut([n,t]),w=Mt(Mt({},x),i);return l.createElement(l.Fragment,null,d&&l.createElement(S,{sideCar:Yt,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?l.cloneElement(l.Children.only(s),Mt(Mt({},w),{ref:C})):l.createElement(y,Mt({},w,{className:c,ref:C}),s))});Zt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Zt.classNames={fullWidth:It,zeroRight:Ft};var Qt,$t=function(){if(Qt)return Qt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function en(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=$t();return t&&e.setAttribute(`nonce`,t),e}function tn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function nn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var rn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=en())&&(tn(t,n),nn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},an=function(){var e=rn();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},on=function(){var e=an();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},sn={left:0,top:0,right:0,gap:0},cn=function(e){return parseInt(e||``,10)||0},ln=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[cn(n),cn(r),cn(i)]},un=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return sn;var t=ln(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])}},dn=on(),fn=`data-scroll-locked`,pn=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
//#endregion
|
|
24
|
+
let react = require("react");
|
|
25
|
+
react = __toESM(react, 1);
|
|
26
|
+
let _radix_ui_react_slot = require("@radix-ui/react-slot");
|
|
27
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
let _radix_ui_react_avatar = require("@radix-ui/react-avatar");
|
|
29
|
+
_radix_ui_react_avatar = __toESM(_radix_ui_react_avatar, 1);
|
|
30
|
+
let _radix_ui_react_dialog = require("@radix-ui/react-dialog");
|
|
31
|
+
_radix_ui_react_dialog = __toESM(_radix_ui_react_dialog, 1);
|
|
32
|
+
let _radix_ui_react_toast = require("@radix-ui/react-toast");
|
|
33
|
+
_radix_ui_react_toast = __toESM(_radix_ui_react_toast, 1);
|
|
34
|
+
let _radix_ui_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
35
|
+
_radix_ui_react_dropdown_menu = __toESM(_radix_ui_react_dropdown_menu, 1);
|
|
36
|
+
let _radix_ui_react_select = require("@radix-ui/react-select");
|
|
37
|
+
_radix_ui_react_select = __toESM(_radix_ui_react_select, 1);
|
|
38
|
+
//#region src/utils/cx.ts
|
|
39
|
+
function cx(...values) {
|
|
40
|
+
return values.filter(Boolean).join(" ");
|
|
41
|
+
}
|
|
42
|
+
var button_module_default = {
|
|
43
|
+
button: "uzi-button-module__button__5dzDN",
|
|
44
|
+
sizeSm: "uzi-button-module__sizeSm__jb544",
|
|
45
|
+
sizeMd: "uzi-button-module__sizeMd__lIo8M",
|
|
46
|
+
sizeLg: "uzi-button-module__sizeLg__QSSuW",
|
|
47
|
+
sizeIcon: "uzi-button-module__sizeIcon__Aa9tN",
|
|
48
|
+
variantPrimary: "uzi-button-module__variantPrimary__zp2Pg",
|
|
49
|
+
variantSecondary: "uzi-button-module__variantSecondary__oX5CB",
|
|
50
|
+
variantOutline: "uzi-button-module__variantOutline__uXfiP",
|
|
51
|
+
variantGhost: "uzi-button-module__variantGhost__-OEB8",
|
|
52
|
+
variantDestructive: "uzi-button-module__variantDestructive__5IeYA",
|
|
53
|
+
variantLink: "uzi-button-module__variantLink__Olx4I"
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/button/Button.tsx
|
|
57
|
+
var variantClass = {
|
|
58
|
+
default: "variantPrimary",
|
|
59
|
+
primary: "variantPrimary",
|
|
60
|
+
secondary: "variantSecondary",
|
|
61
|
+
outline: "variantOutline",
|
|
62
|
+
ghost: "variantGhost",
|
|
63
|
+
destructive: "variantDestructive",
|
|
64
|
+
link: "variantLink"
|
|
65
|
+
};
|
|
66
|
+
var sizeClass = {
|
|
67
|
+
default: "sizeMd",
|
|
68
|
+
sm: "sizeSm",
|
|
69
|
+
md: "sizeMd",
|
|
70
|
+
lg: "sizeLg",
|
|
71
|
+
icon: "sizeIcon"
|
|
72
|
+
};
|
|
73
|
+
function Button({ as, variant = "default", size = "default", className, children, asChild = false, ...rest }) {
|
|
74
|
+
const classes = cx(button_module_default.button, button_module_default[variantClass[variant]], button_module_default[sizeClass[size]], className);
|
|
75
|
+
if (asChild) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_slot.Slot, {
|
|
76
|
+
className: classes,
|
|
77
|
+
...rest,
|
|
78
|
+
children
|
|
79
|
+
});
|
|
80
|
+
if (as === "a") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
81
|
+
className: classes,
|
|
82
|
+
...rest,
|
|
83
|
+
children
|
|
84
|
+
});
|
|
85
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
86
|
+
type: "button",
|
|
87
|
+
className: classes,
|
|
88
|
+
...rest,
|
|
89
|
+
children
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
var avatar_module_default = {
|
|
93
|
+
avatar: "uzi-avatar-module__avatar__yPIOs",
|
|
94
|
+
"size-sm": "uzi-avatar-module__size-sm__v5riJ",
|
|
95
|
+
"size-md": "uzi-avatar-module__size-md__g7IQS",
|
|
96
|
+
"size-lg": "uzi-avatar-module__size-lg__Ca4xk",
|
|
97
|
+
"size-xl": "uzi-avatar-module__size-xl__K0Dfk",
|
|
98
|
+
image: "uzi-avatar-module__image__Ngo7A",
|
|
99
|
+
fallback: "uzi-avatar-module__fallback__Tf3oZ"
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/components/avatar/Avatar.tsx
|
|
103
|
+
function Avatar({ className, size = "md", ...props }) {
|
|
104
|
+
const sizeClass = size === "sm" ? avatar_module_default["size-sm"] : size === "lg" ? avatar_module_default["size-lg"] : size === "xl" ? avatar_module_default["size-xl"] : avatar_module_default["size-md"];
|
|
105
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_avatar.Root, {
|
|
106
|
+
className: cx(avatar_module_default.avatar, sizeClass, className),
|
|
107
|
+
...props
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function AvatarImage({ className, ...props }) {
|
|
111
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_avatar.Image, {
|
|
112
|
+
className: cx(avatar_module_default.image, className),
|
|
113
|
+
...props
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function AvatarFallback({ className, ...props }) {
|
|
117
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_avatar.Fallback, {
|
|
118
|
+
className: cx(avatar_module_default.fallback, className),
|
|
119
|
+
...props
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
var card_module_default = {
|
|
123
|
+
card: "uzi-card-module__card__ZPFTz",
|
|
124
|
+
"tone-default": "uzi-card-module__tone-default__7Ujf9",
|
|
125
|
+
"tone-muted": "uzi-card-module__tone-muted__RQy5B",
|
|
126
|
+
"tone-contrast": "uzi-card-module__tone-contrast__JpFxL",
|
|
127
|
+
interactive: "uzi-card-module__interactive__zlPML",
|
|
128
|
+
"padding-none": "uzi-card-module__padding-none__LXdx-",
|
|
129
|
+
"padding-sm": "uzi-card-module__padding-sm__-Ub1s",
|
|
130
|
+
"padding-md": "uzi-card-module__padding-md__kUf46",
|
|
131
|
+
"padding-lg": "uzi-card-module__padding-lg__a5mWP"
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/components/card/Card.tsx
|
|
135
|
+
function Card({ as, tone = "default", padding = "md", interactive = false, className, children, ...rest }) {
|
|
136
|
+
const Component = as ?? "div";
|
|
137
|
+
const TONE_CLASS = {
|
|
138
|
+
default: null,
|
|
139
|
+
muted: "tone-muted",
|
|
140
|
+
contrast: "tone-contrast"
|
|
141
|
+
};
|
|
142
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
143
|
+
className: cx(card_module_default.card, TONE_CLASS[tone] ? card_module_default[TONE_CLASS[tone]] : null, card_module_default[{
|
|
144
|
+
none: "padding-none",
|
|
145
|
+
sm: "padding-sm",
|
|
146
|
+
md: "padding-md",
|
|
147
|
+
lg: "padding-lg"
|
|
148
|
+
}[padding]], interactive && card_module_default.interactive, className),
|
|
149
|
+
...rest,
|
|
150
|
+
children
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
var pill_module_default = {
|
|
154
|
+
pill: "uzi-pill-module__pill__uCKcP",
|
|
155
|
+
"size-sm": "uzi-pill-module__size-sm__JANOQ",
|
|
156
|
+
"size-md": "uzi-pill-module__size-md__fdsqR",
|
|
157
|
+
"tone-success": "uzi-pill-module__tone-success__kW2Kf",
|
|
158
|
+
"tone-warning": "uzi-pill-module__tone-warning__Rc5-s",
|
|
159
|
+
"tone-info": "uzi-pill-module__tone-info__0vQrj",
|
|
160
|
+
"tone-danger": "uzi-pill-module__tone-danger__gzNOa",
|
|
161
|
+
icon: "uzi-pill-module__icon__KQ8zg",
|
|
162
|
+
content: "uzi-pill-module__content__T7AG1"
|
|
163
|
+
};
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/components/pill/Pill.tsx
|
|
166
|
+
function Pill({ as, tone = "neutral", size = "md", icon, className, children, ...rest }) {
|
|
167
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(as ?? "span", {
|
|
168
|
+
className: cx(pill_module_default.pill, pill_module_default[`tone-${tone}`], pill_module_default[`size-${size}`], className),
|
|
169
|
+
...rest,
|
|
170
|
+
children: [icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
171
|
+
className: pill_module_default.icon,
|
|
172
|
+
"aria-hidden": "true",
|
|
173
|
+
children: icon
|
|
174
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
175
|
+
className: pill_module_default.content,
|
|
176
|
+
children
|
|
177
|
+
})]
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
var modal_module_default = {
|
|
181
|
+
portalLayer: "uzi-modal-module__portalLayer__t7blc",
|
|
182
|
+
backdrop: "uzi-modal-module__backdrop__IMd3b",
|
|
183
|
+
backdropFadeIn: "uzi-modal-module__backdropFadeIn__GNJdx",
|
|
184
|
+
backdropFadeOut: "uzi-modal-module__backdropFadeOut__R-3K5",
|
|
185
|
+
overlayContent: "uzi-modal-module__overlayContent__0DtbP",
|
|
186
|
+
modalContentIn: "uzi-modal-module__modalContentIn__fub8M",
|
|
187
|
+
modalContentOut: "uzi-modal-module__modalContentOut__elTJ3",
|
|
188
|
+
modal: "uzi-modal-module__modal__Mao59",
|
|
189
|
+
"size-sm": "uzi-modal-module__size-sm__Uu9je",
|
|
190
|
+
"size-md": "uzi-modal-module__size-md__TiiWy",
|
|
191
|
+
"size-lg": "uzi-modal-module__size-lg__BrTIO",
|
|
192
|
+
"size-xl": "uzi-modal-module__size-xl__sj0mh",
|
|
193
|
+
header: "uzi-modal-module__header__PmCaO",
|
|
194
|
+
titles: "uzi-modal-module__titles__IboyQ",
|
|
195
|
+
title: "uzi-modal-module__title__Zd7pL",
|
|
196
|
+
subtitle: "uzi-modal-module__subtitle__t-LRK",
|
|
197
|
+
closeButton: "uzi-modal-module__closeButton__GTiZr",
|
|
198
|
+
body: "uzi-modal-module__body__km6FQ",
|
|
199
|
+
footer: "uzi-modal-module__footer__jWLTv"
|
|
200
|
+
};
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/components/modal/Modal.tsx
|
|
203
|
+
function ModalOverlay({ open, onClose, className, children }) {
|
|
204
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Root, {
|
|
205
|
+
open,
|
|
206
|
+
onOpenChange: (nextOpen) => {
|
|
207
|
+
if (!nextOpen) onClose();
|
|
208
|
+
},
|
|
209
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
210
|
+
className: modal_module_default.portalLayer,
|
|
211
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Overlay, { className: cx(modal_module_default.backdrop, className) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Content, {
|
|
212
|
+
className: modal_module_default.overlayContent,
|
|
213
|
+
children
|
|
214
|
+
})]
|
|
215
|
+
}) })
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
function Modal({ open, onClose, title, subtitle, size = "md", children, footer }) {
|
|
219
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalOverlay, {
|
|
220
|
+
open,
|
|
221
|
+
onClose,
|
|
222
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
223
|
+
className: cx(modal_module_default.modal, modal_module_default[`size-${size}`]),
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
226
|
+
className: modal_module_default.header,
|
|
227
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
228
|
+
className: modal_module_default.titles,
|
|
229
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Title, {
|
|
230
|
+
className: modal_module_default.title,
|
|
231
|
+
children: title
|
|
232
|
+
}), subtitle ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Description, {
|
|
233
|
+
className: modal_module_default.subtitle,
|
|
234
|
+
children: subtitle
|
|
235
|
+
}) : null]
|
|
236
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Close, {
|
|
237
|
+
asChild: true,
|
|
238
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
239
|
+
className: modal_module_default.closeButton,
|
|
240
|
+
"aria-label": "Close",
|
|
241
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
242
|
+
width: "14",
|
|
243
|
+
height: "14",
|
|
244
|
+
viewBox: "0 0 24 24",
|
|
245
|
+
fill: "none",
|
|
246
|
+
stroke: "currentColor",
|
|
247
|
+
strokeWidth: "2.5",
|
|
248
|
+
strokeLinecap: "round",
|
|
249
|
+
strokeLinejoin: "round",
|
|
250
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
|
|
251
|
+
x1: "18",
|
|
252
|
+
y1: "6",
|
|
253
|
+
x2: "6",
|
|
254
|
+
y2: "18"
|
|
255
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
|
|
256
|
+
x1: "6",
|
|
257
|
+
y1: "6",
|
|
258
|
+
x2: "18",
|
|
259
|
+
y2: "18"
|
|
260
|
+
})]
|
|
261
|
+
})
|
|
262
|
+
})
|
|
263
|
+
})]
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
266
|
+
className: modal_module_default.body,
|
|
267
|
+
children
|
|
268
|
+
}),
|
|
269
|
+
footer && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
270
|
+
className: modal_module_default.footer,
|
|
271
|
+
children: footer
|
|
272
|
+
})
|
|
273
|
+
]
|
|
274
|
+
})
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
var alert_module_default = {
|
|
278
|
+
alert: "uzi-alert-module__alert__7Bt6c",
|
|
279
|
+
success: "uzi-alert-module__success__apdFG",
|
|
280
|
+
error: "uzi-alert-module__error__KLgi1",
|
|
281
|
+
warning: "uzi-alert-module__warning__F4fpk",
|
|
282
|
+
info: "uzi-alert-module__info__1IKHt"
|
|
283
|
+
};
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/components/alert/Alert.tsx
|
|
286
|
+
function Alert({ tone, children, className }) {
|
|
287
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
288
|
+
className: cx(alert_module_default.alert, alert_module_default[tone], className),
|
|
289
|
+
role: "alert",
|
|
290
|
+
children
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
var toast_module_default = {
|
|
294
|
+
stack: "uzi-toast-module__stack__SRrda",
|
|
295
|
+
topRight: "uzi-toast-module__topRight__WiZzM",
|
|
296
|
+
topLeft: "uzi-toast-module__topLeft__SzFS9",
|
|
297
|
+
topCenter: "uzi-toast-module__topCenter__X5W-x",
|
|
298
|
+
bottomRight: "uzi-toast-module__bottomRight__DMtoS",
|
|
299
|
+
bottomLeft: "uzi-toast-module__bottomLeft__ZZ7VF",
|
|
300
|
+
bottomCenter: "uzi-toast-module__bottomCenter__QNJrM",
|
|
301
|
+
toast: "uzi-toast-module__toast__HNUcj",
|
|
302
|
+
toastSlideIn: "uzi-toast-module__toastSlideIn__BTXfm",
|
|
303
|
+
toastSlideOut: "uzi-toast-module__toastSlideOut__mBX-G",
|
|
304
|
+
toastSwipeOut: "uzi-toast-module__toastSwipeOut__R-jk2",
|
|
305
|
+
icon: "uzi-toast-module__icon__LIAqr",
|
|
306
|
+
body: "uzi-toast-module__body__9vzs7",
|
|
307
|
+
message: "uzi-toast-module__message__TBY65",
|
|
308
|
+
actions: "uzi-toast-module__actions__Iykd9",
|
|
309
|
+
actionButton: "uzi-toast-module__actionButton__cvUr0",
|
|
310
|
+
controls: "uzi-toast-module__controls__LqA4Q",
|
|
311
|
+
iconButton: "uzi-toast-module__iconButton__FOsOp",
|
|
312
|
+
iconButtonError: "uzi-toast-module__iconButtonError__NJsLX"
|
|
313
|
+
};
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/components/toast/ToastContext.tsx
|
|
316
|
+
/** Default provider configuration. */
|
|
317
|
+
var DEFAULT_CONFIG = {
|
|
318
|
+
position: "top-right",
|
|
319
|
+
maxToasts: 5,
|
|
320
|
+
defaultDuration: 4e3,
|
|
321
|
+
pauseOnHover: true,
|
|
322
|
+
pauseOnFocusLoss: true
|
|
323
|
+
};
|
|
324
|
+
var ToastContext = (0, react.createContext)(void 0);
|
|
325
|
+
var toastIdCounter = 0;
|
|
326
|
+
var generateToastId = () => `toast-${++toastIdCounter}-${Date.now()}`;
|
|
327
|
+
/**
|
|
328
|
+
* Toast notification context provider.
|
|
329
|
+
*
|
|
330
|
+
* @remarks
|
|
331
|
+
* Wrap your app (or a section) to enable `useToast` calls. Supports configurable placement,
|
|
332
|
+
* maximum visible toasts, and pause behavior on hover or window blur.
|
|
333
|
+
*
|
|
334
|
+
* @param props.children - React subtree that can consume the toast context.
|
|
335
|
+
* @param props.config - Optional provider configuration overrides.
|
|
336
|
+
*/
|
|
337
|
+
function ToastProvider({ children, config }) {
|
|
338
|
+
const [toasts, setToasts] = (0, react.useState)([]);
|
|
339
|
+
const [isPaused, setIsPaused] = (0, react.useState)(false);
|
|
340
|
+
const merged = (0, react.useMemo)(() => ({
|
|
341
|
+
...DEFAULT_CONFIG,
|
|
342
|
+
...config
|
|
343
|
+
}), [config]);
|
|
344
|
+
const push = (0, react.useCallback)((message, options = {}) => {
|
|
345
|
+
const id = generateToastId();
|
|
346
|
+
setToasts((prev) => {
|
|
347
|
+
const next = [...prev, {
|
|
348
|
+
id,
|
|
349
|
+
message,
|
|
350
|
+
type: options.type ?? "info",
|
|
351
|
+
duration: options.duration ?? (options.type === "error" ? 6e3 : merged.defaultDuration),
|
|
352
|
+
dismissible: options.dismissible ?? true,
|
|
353
|
+
copyable: options.copyable ?? false,
|
|
354
|
+
action: options.action
|
|
355
|
+
}];
|
|
356
|
+
if (next.length > merged.maxToasts) next.shift();
|
|
357
|
+
return next;
|
|
358
|
+
});
|
|
359
|
+
return id;
|
|
360
|
+
}, [merged.defaultDuration, merged.maxToasts]);
|
|
361
|
+
const success = (0, react.useCallback)((message, options) => push(message, {
|
|
362
|
+
...options,
|
|
363
|
+
type: "success"
|
|
364
|
+
}), [push]);
|
|
365
|
+
const error = (0, react.useCallback)((message, options) => push(message, {
|
|
366
|
+
copyable: true,
|
|
367
|
+
...options,
|
|
368
|
+
type: "error"
|
|
369
|
+
}), [push]);
|
|
370
|
+
const warning = (0, react.useCallback)((message, options) => push(message, {
|
|
371
|
+
...options,
|
|
372
|
+
type: "warning"
|
|
373
|
+
}), [push]);
|
|
374
|
+
const info = (0, react.useCallback)((message, options) => push(message, {
|
|
375
|
+
...options,
|
|
376
|
+
type: "info"
|
|
377
|
+
}), [push]);
|
|
378
|
+
const dismiss = (0, react.useCallback)((id) => {
|
|
379
|
+
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
380
|
+
}, []);
|
|
381
|
+
const dismissAll = (0, react.useCallback)(() => setToasts([]), []);
|
|
382
|
+
(0, react.useEffect)(() => {
|
|
383
|
+
if (!merged.pauseOnFocusLoss) return;
|
|
384
|
+
const handleVisibility = () => setIsPaused(document.visibilityState !== "visible");
|
|
385
|
+
document.addEventListener("visibilitychange", handleVisibility);
|
|
386
|
+
return () => document.removeEventListener("visibilitychange", handleVisibility);
|
|
387
|
+
}, [merged.pauseOnFocusLoss]);
|
|
388
|
+
const value = (0, react.useMemo)(() => ({
|
|
389
|
+
toasts,
|
|
390
|
+
push,
|
|
391
|
+
success,
|
|
392
|
+
error,
|
|
393
|
+
warning,
|
|
394
|
+
info,
|
|
395
|
+
dismiss,
|
|
396
|
+
dismissAll
|
|
397
|
+
}), [
|
|
398
|
+
toasts,
|
|
399
|
+
push,
|
|
400
|
+
success,
|
|
401
|
+
error,
|
|
402
|
+
warning,
|
|
403
|
+
info,
|
|
404
|
+
dismiss,
|
|
405
|
+
dismissAll
|
|
406
|
+
]);
|
|
407
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastContext.Provider, {
|
|
408
|
+
value,
|
|
409
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_toast.Provider, {
|
|
410
|
+
swipeDirection: "right",
|
|
411
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastContainer, {
|
|
412
|
+
toasts,
|
|
413
|
+
position: merged.position,
|
|
414
|
+
pauseOnHover: merged.pauseOnHover,
|
|
415
|
+
isPaused,
|
|
416
|
+
onDismiss: dismiss,
|
|
417
|
+
onPauseChange: setIsPaused
|
|
418
|
+
})]
|
|
419
|
+
})
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Hook to access the toast API.
|
|
424
|
+
*
|
|
425
|
+
* @remarks
|
|
426
|
+
* Exposes `push`, intent helpers (`success`, `error`, `warning`, `info`), and dismissal helpers.
|
|
427
|
+
* Must be called within a `ToastProvider`.
|
|
428
|
+
*
|
|
429
|
+
* @throws Error if used outside of a `ToastProvider`.
|
|
430
|
+
*/
|
|
431
|
+
function useToast() {
|
|
432
|
+
const ctx = (0, react.useContext)(ToastContext);
|
|
433
|
+
if (!ctx) throw new Error("useToast must be used within a ToastProvider");
|
|
434
|
+
return ctx;
|
|
435
|
+
}
|
|
436
|
+
/** Renders the positioned toast stack. */
|
|
437
|
+
function ToastContainer({ toasts, position, pauseOnHover, isPaused, onDismiss, onPauseChange }) {
|
|
438
|
+
const posClass = (() => {
|
|
439
|
+
switch (position) {
|
|
440
|
+
case "top-left": return "topLeft";
|
|
441
|
+
case "top-center": return "topCenter";
|
|
442
|
+
case "bottom-right": return "bottomRight";
|
|
443
|
+
case "bottom-left": return "bottomLeft";
|
|
444
|
+
case "bottom-center": return "bottomCenter";
|
|
445
|
+
default: return "topRight";
|
|
446
|
+
}
|
|
447
|
+
})();
|
|
448
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [toasts.map((toast) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastItem, {
|
|
449
|
+
toast,
|
|
450
|
+
isPaused,
|
|
451
|
+
onDismiss
|
|
452
|
+
}, toast.id)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Viewport, {
|
|
453
|
+
className: cx(toast_module_default.stack, toast_module_default[posClass]),
|
|
454
|
+
label: "Notifications",
|
|
455
|
+
onMouseEnter: () => pauseOnHover && onPauseChange(true),
|
|
456
|
+
onMouseLeave: () => pauseOnHover && onPauseChange(false)
|
|
457
|
+
})] });
|
|
458
|
+
}
|
|
459
|
+
/** Individual toast item with timers and actions. */
|
|
460
|
+
function ToastItem({ toast, isPaused, onDismiss }) {
|
|
461
|
+
const [open, setOpen] = (0, react.useState)(true);
|
|
462
|
+
const [copyState, setCopyState] = (0, react.useState)("idle");
|
|
463
|
+
const copyTimerRef = (0, react.useRef)(null);
|
|
464
|
+
const timerRef = (0, react.useRef)(null);
|
|
465
|
+
const startRef = (0, react.useRef)(0);
|
|
466
|
+
const remainingRef = (0, react.useRef)(toast.duration ?? 0);
|
|
467
|
+
const closingRef = (0, react.useRef)(false);
|
|
468
|
+
const palette = getPalette(toast.type);
|
|
469
|
+
const styleVars = {
|
|
470
|
+
["--toast-bg"]: palette.background,
|
|
471
|
+
["--toast-border"]: palette.border,
|
|
472
|
+
["--toast-accent"]: palette.accent,
|
|
473
|
+
["--toast-text"]: palette.text,
|
|
474
|
+
["--toast-action-bg"]: palette.actionBg,
|
|
475
|
+
["--toast-action-border"]: palette.actionBorder
|
|
476
|
+
};
|
|
477
|
+
const stopTimer = () => {
|
|
478
|
+
if (timerRef.current) {
|
|
479
|
+
window.clearTimeout(timerRef.current);
|
|
480
|
+
timerRef.current = null;
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
const triggerDismiss = (0, react.useCallback)(() => {
|
|
484
|
+
if (closingRef.current) return;
|
|
485
|
+
closingRef.current = true;
|
|
486
|
+
setOpen(false);
|
|
487
|
+
stopTimer();
|
|
488
|
+
window.setTimeout(() => onDismiss(toast.id), 160);
|
|
489
|
+
}, [onDismiss, toast.id]);
|
|
490
|
+
const schedule = (0, react.useCallback)((delay) => {
|
|
491
|
+
if (!delay || delay <= 0) {
|
|
492
|
+
triggerDismiss();
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
startRef.current = performance.now();
|
|
496
|
+
stopTimer();
|
|
497
|
+
timerRef.current = window.setTimeout(() => triggerDismiss(), delay);
|
|
498
|
+
}, [triggerDismiss]);
|
|
499
|
+
(0, react.useEffect)(() => {
|
|
500
|
+
if (!toast.duration || toast.duration <= 0) return void 0;
|
|
501
|
+
schedule(toast.duration);
|
|
502
|
+
return stopTimer;
|
|
503
|
+
}, [schedule, toast.duration]);
|
|
504
|
+
(0, react.useEffect)(() => {
|
|
505
|
+
if (!toast.duration || toast.duration <= 0) return;
|
|
506
|
+
if (isPaused) {
|
|
507
|
+
const elapsed = performance.now() - startRef.current;
|
|
508
|
+
remainingRef.current = Math.max(0, remainingRef.current - elapsed);
|
|
509
|
+
stopTimer();
|
|
510
|
+
} else schedule(remainingRef.current);
|
|
511
|
+
}, [
|
|
512
|
+
isPaused,
|
|
513
|
+
schedule,
|
|
514
|
+
toast.duration
|
|
515
|
+
]);
|
|
516
|
+
(0, react.useEffect)(() => {
|
|
517
|
+
return () => {
|
|
518
|
+
if (copyTimerRef.current) window.clearTimeout(copyTimerRef.current);
|
|
519
|
+
};
|
|
520
|
+
}, []);
|
|
521
|
+
const handleCopy = (0, react.useCallback)(async () => {
|
|
522
|
+
if (copyTimerRef.current) window.clearTimeout(copyTimerRef.current);
|
|
523
|
+
try {
|
|
524
|
+
if (!navigator.clipboard) throw new Error("Clipboard API unavailable");
|
|
525
|
+
await navigator.clipboard.writeText(toast.message);
|
|
526
|
+
setCopyState("copied");
|
|
527
|
+
} catch {
|
|
528
|
+
setCopyState("failed");
|
|
529
|
+
}
|
|
530
|
+
copyTimerRef.current = window.setTimeout(() => setCopyState("idle"), 1800);
|
|
531
|
+
}, [toast.message]);
|
|
532
|
+
const icon = getIcon(toast.type);
|
|
533
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_toast.Root, {
|
|
534
|
+
open,
|
|
535
|
+
onOpenChange: (nextOpen) => {
|
|
536
|
+
if (!nextOpen) triggerDismiss();
|
|
537
|
+
},
|
|
538
|
+
duration: 2147483647,
|
|
539
|
+
className: toast_module_default.toast,
|
|
540
|
+
style: styleVars,
|
|
541
|
+
children: [
|
|
542
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
543
|
+
className: toast_module_default.icon,
|
|
544
|
+
"aria-hidden": true,
|
|
545
|
+
children: icon
|
|
546
|
+
}),
|
|
547
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
548
|
+
className: toast_module_default.body,
|
|
549
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Description, {
|
|
550
|
+
className: toast_module_default.message,
|
|
551
|
+
children: toast.message
|
|
552
|
+
}), toast.action && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
553
|
+
className: toast_module_default.actions,
|
|
554
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Action, {
|
|
555
|
+
asChild: true,
|
|
556
|
+
altText: toast.action.label,
|
|
557
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
558
|
+
type: "button",
|
|
559
|
+
className: toast_module_default.actionButton,
|
|
560
|
+
onClick: () => {
|
|
561
|
+
toast.action?.onClick();
|
|
562
|
+
triggerDismiss();
|
|
563
|
+
},
|
|
564
|
+
children: toast.action.label
|
|
565
|
+
})
|
|
566
|
+
})
|
|
567
|
+
})]
|
|
568
|
+
}),
|
|
569
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
570
|
+
className: toast_module_default.controls,
|
|
571
|
+
children: [toast.copyable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
572
|
+
type: "button",
|
|
573
|
+
className: cx(toast_module_default.iconButton, copyState === "failed" && toast_module_default.iconButtonError),
|
|
574
|
+
"aria-label": "Copy message",
|
|
575
|
+
onClick: handleCopy,
|
|
576
|
+
children: copyState === "copied" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
577
|
+
width: "13",
|
|
578
|
+
height: "13",
|
|
579
|
+
viewBox: "0 0 13 13",
|
|
580
|
+
fill: "none",
|
|
581
|
+
"aria-hidden": true,
|
|
582
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
583
|
+
d: "M2 6.5l3 3 6-6",
|
|
584
|
+
stroke: "currentColor",
|
|
585
|
+
strokeWidth: "1.5",
|
|
586
|
+
strokeLinecap: "round",
|
|
587
|
+
strokeLinejoin: "round"
|
|
588
|
+
})
|
|
589
|
+
}) : copyState === "failed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
590
|
+
width: "13",
|
|
591
|
+
height: "13",
|
|
592
|
+
viewBox: "0 0 13 13",
|
|
593
|
+
fill: "none",
|
|
594
|
+
"aria-hidden": true,
|
|
595
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
596
|
+
d: "M10 3L3 10M3 3l7 7",
|
|
597
|
+
stroke: "currentColor",
|
|
598
|
+
strokeWidth: "1.5",
|
|
599
|
+
strokeLinecap: "round"
|
|
600
|
+
})
|
|
601
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
602
|
+
width: "13",
|
|
603
|
+
height: "13",
|
|
604
|
+
viewBox: "0 0 13 13",
|
|
605
|
+
fill: "none",
|
|
606
|
+
"aria-hidden": true,
|
|
607
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
|
|
608
|
+
x: "4.5",
|
|
609
|
+
y: "1.5",
|
|
610
|
+
width: "7",
|
|
611
|
+
height: "7",
|
|
612
|
+
rx: "1.5",
|
|
613
|
+
stroke: "currentColor",
|
|
614
|
+
strokeWidth: "1.25"
|
|
615
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
616
|
+
d: "M1.5 5.5v5a1.5 1.5 0 001.5 1.5h5",
|
|
617
|
+
stroke: "currentColor",
|
|
618
|
+
strokeWidth: "1.25",
|
|
619
|
+
strokeLinecap: "round"
|
|
620
|
+
})]
|
|
621
|
+
})
|
|
622
|
+
}), toast.dismissible !== false && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_toast.Close, {
|
|
623
|
+
asChild: true,
|
|
624
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
625
|
+
type: "button",
|
|
626
|
+
className: toast_module_default.iconButton,
|
|
627
|
+
"aria-label": "Dismiss notification",
|
|
628
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
629
|
+
width: "13",
|
|
630
|
+
height: "13",
|
|
631
|
+
viewBox: "0 0 13 13",
|
|
632
|
+
fill: "none",
|
|
633
|
+
"aria-hidden": true,
|
|
634
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
635
|
+
d: "M10 3L3 10M3 3l7 7",
|
|
636
|
+
stroke: "currentColor",
|
|
637
|
+
strokeWidth: "1.5",
|
|
638
|
+
strokeLinecap: "round"
|
|
639
|
+
})
|
|
640
|
+
})
|
|
641
|
+
})
|
|
642
|
+
})]
|
|
643
|
+
})
|
|
644
|
+
]
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
function getPalette(type) {
|
|
648
|
+
switch (type) {
|
|
649
|
+
case "success": return {
|
|
650
|
+
background: "color-mix(in srgb, var(--success) 12%, var(--popover))",
|
|
651
|
+
border: "color-mix(in srgb, var(--success) 30%, transparent)",
|
|
652
|
+
accent: "var(--success)",
|
|
653
|
+
text: "var(--popover-foreground)",
|
|
654
|
+
actionBg: "color-mix(in srgb, var(--success) 14%, transparent)",
|
|
655
|
+
actionBorder: "color-mix(in srgb, var(--success) 35%, transparent)"
|
|
656
|
+
};
|
|
657
|
+
case "error": return {
|
|
658
|
+
background: "color-mix(in srgb, var(--destructive) 12%, var(--popover))",
|
|
659
|
+
border: "color-mix(in srgb, var(--destructive) 30%, transparent)",
|
|
660
|
+
accent: "var(--destructive)",
|
|
661
|
+
text: "var(--popover-foreground)",
|
|
662
|
+
actionBg: "color-mix(in srgb, var(--destructive) 14%, transparent)",
|
|
663
|
+
actionBorder: "color-mix(in srgb, var(--destructive) 35%, transparent)"
|
|
664
|
+
};
|
|
665
|
+
case "warning": return {
|
|
666
|
+
background: "color-mix(in srgb, var(--warning) 12%, var(--popover))",
|
|
667
|
+
border: "color-mix(in srgb, var(--warning) 30%, transparent)",
|
|
668
|
+
accent: "var(--warning)",
|
|
669
|
+
text: "var(--popover-foreground)",
|
|
670
|
+
actionBg: "color-mix(in srgb, var(--warning) 14%, transparent)",
|
|
671
|
+
actionBorder: "color-mix(in srgb, var(--warning) 35%, transparent)"
|
|
672
|
+
};
|
|
673
|
+
default: return {
|
|
674
|
+
background: "color-mix(in srgb, var(--primary) 12%, var(--popover))",
|
|
675
|
+
border: "color-mix(in srgb, var(--primary) 30%, transparent)",
|
|
676
|
+
accent: "var(--primary)",
|
|
677
|
+
text: "var(--popover-foreground)",
|
|
678
|
+
actionBg: "color-mix(in srgb, var(--primary) 14%, transparent)",
|
|
679
|
+
actionBorder: "color-mix(in srgb, var(--primary) 35%, transparent)"
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
function getIcon(type) {
|
|
684
|
+
switch (type) {
|
|
685
|
+
case "success": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
686
|
+
width: "16",
|
|
687
|
+
height: "16",
|
|
688
|
+
viewBox: "0 0 16 16",
|
|
689
|
+
fill: "none",
|
|
690
|
+
"aria-hidden": true,
|
|
691
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
692
|
+
d: "M3 8l3.5 3.5L13 4.5",
|
|
693
|
+
stroke: "currentColor",
|
|
694
|
+
strokeWidth: "1.75",
|
|
695
|
+
strokeLinecap: "round",
|
|
696
|
+
strokeLinejoin: "round"
|
|
697
|
+
})
|
|
698
|
+
});
|
|
699
|
+
case "error": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
700
|
+
width: "16",
|
|
701
|
+
height: "16",
|
|
702
|
+
viewBox: "0 0 16 16",
|
|
703
|
+
fill: "none",
|
|
704
|
+
"aria-hidden": true,
|
|
705
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
706
|
+
d: "M4 4l8 8M12 4l-8 8",
|
|
707
|
+
stroke: "currentColor",
|
|
708
|
+
strokeWidth: "1.75",
|
|
709
|
+
strokeLinecap: "round"
|
|
710
|
+
})
|
|
711
|
+
});
|
|
712
|
+
case "warning": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
713
|
+
width: "16",
|
|
714
|
+
height: "16",
|
|
715
|
+
viewBox: "0 0 16 16",
|
|
716
|
+
fill: "none",
|
|
717
|
+
"aria-hidden": true,
|
|
718
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
719
|
+
d: "M8 3v6M8 11.5v1",
|
|
720
|
+
stroke: "currentColor",
|
|
721
|
+
strokeWidth: "1.75",
|
|
722
|
+
strokeLinecap: "round"
|
|
723
|
+
})
|
|
724
|
+
});
|
|
725
|
+
default: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
726
|
+
width: "16",
|
|
727
|
+
height: "16",
|
|
728
|
+
viewBox: "0 0 16 16",
|
|
729
|
+
fill: "none",
|
|
730
|
+
"aria-hidden": true,
|
|
731
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
732
|
+
d: "M8 7v5M8 4.5v.5",
|
|
733
|
+
stroke: "currentColor",
|
|
734
|
+
strokeWidth: "1.75",
|
|
735
|
+
strokeLinecap: "round"
|
|
736
|
+
})
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
var input_module_default = { input: "uzi-input-module__input__-ipHD" };
|
|
741
|
+
//#endregion
|
|
742
|
+
//#region src/components/input/Input.tsx
|
|
743
|
+
var Input = react.forwardRef(({ className, type, ...props }, ref) => {
|
|
744
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
745
|
+
ref,
|
|
746
|
+
type,
|
|
747
|
+
className: cx(input_module_default.input, className),
|
|
748
|
+
...props
|
|
749
|
+
});
|
|
750
|
+
});
|
|
751
|
+
Input.displayName = "Input";
|
|
752
|
+
var label_module_default = { label: "uzi-label-module__label__gKflt" };
|
|
753
|
+
//#endregion
|
|
754
|
+
//#region src/components/label/Label.tsx
|
|
755
|
+
var Label = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
756
|
+
ref,
|
|
757
|
+
className: cx(label_module_default.label, className),
|
|
758
|
+
...props
|
|
759
|
+
}));
|
|
760
|
+
Label.displayName = "Label";
|
|
761
|
+
var checkbox_module_default = { checkbox: "uzi-checkbox-module__checkbox__zAB1y" };
|
|
762
|
+
//#endregion
|
|
763
|
+
//#region src/components/checkbox/Checkbox.tsx
|
|
764
|
+
var Checkbox = react.forwardRef(({ className, ...props }, ref) => {
|
|
765
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
766
|
+
ref,
|
|
767
|
+
type: "checkbox",
|
|
768
|
+
className: cx(checkbox_module_default.checkbox, className),
|
|
769
|
+
...props
|
|
770
|
+
});
|
|
771
|
+
});
|
|
772
|
+
Checkbox.displayName = "Checkbox";
|
|
773
|
+
var multi_select_module_default = {
|
|
774
|
+
wrapper: "uzi-multi-select-module__wrapper__Izj2x",
|
|
775
|
+
wrapperFullWidth: "uzi-multi-select-module__wrapperFullWidth__eH8pf",
|
|
776
|
+
trigger: "uzi-multi-select-module__trigger__r3816",
|
|
777
|
+
value: "uzi-multi-select-module__value__PuUmG",
|
|
778
|
+
placeholder: "uzi-multi-select-module__placeholder__dJIU-",
|
|
779
|
+
chip: "uzi-multi-select-module__chip__46Ms-",
|
|
780
|
+
chipSummary: "uzi-multi-select-module__chipSummary__zLwi8",
|
|
781
|
+
chevron: "uzi-multi-select-module__chevron__SWK5l",
|
|
782
|
+
menu: "uzi-multi-select-module__menu__q8auA",
|
|
783
|
+
menuFadeIn: "uzi-multi-select-module__menuFadeIn__Plo7-",
|
|
784
|
+
option: "uzi-multi-select-module__option__-Ioqk",
|
|
785
|
+
optionDisabled: "uzi-multi-select-module__optionDisabled__qtCi8",
|
|
786
|
+
optionSelected: "uzi-multi-select-module__optionSelected__74IO8",
|
|
787
|
+
optionLabel: "uzi-multi-select-module__optionLabel__cVoN7",
|
|
788
|
+
indicator: "uzi-multi-select-module__indicator__NO-WE",
|
|
789
|
+
indicatorSelected: "uzi-multi-select-module__indicatorSelected__9sEAy",
|
|
790
|
+
indicatorDisabled: "uzi-multi-select-module__indicatorDisabled__vqdiH"
|
|
791
|
+
};
|
|
792
|
+
//#endregion
|
|
793
|
+
//#region src/components/multi-select/MultiSelect.tsx
|
|
794
|
+
var MultiSelect = react.forwardRef(({ options, value, onChange, placeholder = "Select options", fullWidth = true, maxVisibleValues = 2, className, disabled = false, name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }, ref) => {
|
|
795
|
+
const selectedSet = react.useMemo(() => new Set(value), [value]);
|
|
796
|
+
const selectedOptions = react.useMemo(() => options.filter((opt) => selectedSet.has(opt.value)), [options, selectedSet]);
|
|
797
|
+
const toggleValue = react.useCallback((nextValue) => {
|
|
798
|
+
if (selectedSet.has(nextValue)) {
|
|
799
|
+
onChange(value.filter((entry) => entry !== nextValue));
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
onChange([...value, nextValue]);
|
|
803
|
+
}, [
|
|
804
|
+
onChange,
|
|
805
|
+
selectedSet,
|
|
806
|
+
value
|
|
807
|
+
]);
|
|
808
|
+
const visibleCount = Math.max(1, maxVisibleValues);
|
|
809
|
+
const visibleOptions = selectedOptions.slice(0, visibleCount);
|
|
810
|
+
const overflowCount = Math.max(0, selectedOptions.length - visibleOptions.length);
|
|
811
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Root, {
|
|
812
|
+
modal: false,
|
|
813
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
814
|
+
className: cx(multi_select_module_default.wrapper, fullWidth && multi_select_module_default.wrapperFullWidth, className),
|
|
815
|
+
children: [
|
|
816
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Trigger, {
|
|
817
|
+
asChild: true,
|
|
818
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
819
|
+
ref,
|
|
820
|
+
type: "button",
|
|
821
|
+
className: multi_select_module_default.trigger,
|
|
822
|
+
"aria-label": ariaLabel,
|
|
823
|
+
"aria-labelledby": ariaLabelledBy,
|
|
824
|
+
disabled,
|
|
825
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
826
|
+
className: multi_select_module_default.value,
|
|
827
|
+
children: selectedOptions.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
828
|
+
className: multi_select_module_default.placeholder,
|
|
829
|
+
children: placeholder
|
|
830
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [visibleOptions.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
831
|
+
className: multi_select_module_default.chip,
|
|
832
|
+
children: option.label
|
|
833
|
+
}, option.value)), overflowCount > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
834
|
+
className: cx(multi_select_module_default.chip, multi_select_module_default.chipSummary),
|
|
835
|
+
children: ["+", overflowCount]
|
|
836
|
+
}) : null] })
|
|
837
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
838
|
+
className: multi_select_module_default.chevron,
|
|
839
|
+
"aria-hidden": "true",
|
|
840
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
841
|
+
viewBox: "0 0 10 10",
|
|
842
|
+
fill: "none",
|
|
843
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
844
|
+
width: "10",
|
|
845
|
+
height: "10",
|
|
846
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
847
|
+
d: "M2 3.5L5 6.5L8 3.5",
|
|
848
|
+
stroke: "currentColor",
|
|
849
|
+
strokeWidth: "1.5",
|
|
850
|
+
strokeLinecap: "round",
|
|
851
|
+
strokeLinejoin: "round"
|
|
852
|
+
})
|
|
853
|
+
})
|
|
854
|
+
})]
|
|
855
|
+
})
|
|
856
|
+
}),
|
|
857
|
+
name ? value.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
858
|
+
type: "hidden",
|
|
859
|
+
name,
|
|
860
|
+
value: entry
|
|
861
|
+
}, entry)) : null,
|
|
862
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Content, {
|
|
863
|
+
className: multi_select_module_default.menu,
|
|
864
|
+
sideOffset: 4,
|
|
865
|
+
align: "start",
|
|
866
|
+
children: options.map((option) => {
|
|
867
|
+
const selected = selectedSet.has(option.value);
|
|
868
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.CheckboxItem, {
|
|
869
|
+
className: cx(multi_select_module_default.option, selected && multi_select_module_default.optionSelected, option.disabled && multi_select_module_default.optionDisabled),
|
|
870
|
+
checked: selected,
|
|
871
|
+
disabled: option.disabled,
|
|
872
|
+
onCheckedChange: () => toggleValue(option.value),
|
|
873
|
+
onSelect: (event) => event.preventDefault(),
|
|
874
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
875
|
+
className: cx(multi_select_module_default.indicator, selected && multi_select_module_default.indicatorSelected, option.disabled && multi_select_module_default.indicatorDisabled),
|
|
876
|
+
"aria-hidden": "true",
|
|
877
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.ItemIndicator, {
|
|
878
|
+
forceMount: true,
|
|
879
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
880
|
+
viewBox: "0 0 16 16",
|
|
881
|
+
width: "16",
|
|
882
|
+
height: "16",
|
|
883
|
+
fill: "none",
|
|
884
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
885
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
886
|
+
d: "M3.5 8.5 6.5 11.5 12.5 4.5",
|
|
887
|
+
stroke: "currentColor",
|
|
888
|
+
strokeWidth: "1.8",
|
|
889
|
+
strokeLinecap: "round",
|
|
890
|
+
strokeLinejoin: "round"
|
|
891
|
+
})
|
|
892
|
+
})
|
|
893
|
+
})
|
|
894
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
895
|
+
className: multi_select_module_default.optionLabel,
|
|
896
|
+
children: option.label
|
|
897
|
+
})]
|
|
898
|
+
}, option.value);
|
|
899
|
+
})
|
|
900
|
+
}) })
|
|
901
|
+
]
|
|
902
|
+
})
|
|
903
|
+
});
|
|
904
|
+
});
|
|
905
|
+
MultiSelect.displayName = "MultiSelect";
|
|
906
|
+
var select_module_default = {
|
|
907
|
+
wrapper: "uzi-select-module__wrapper__7szq0",
|
|
908
|
+
wrapperFullWidth: "uzi-select-module__wrapperFullWidth__IyOIG",
|
|
909
|
+
trigger: "uzi-select-module__trigger__ldh8w",
|
|
910
|
+
value: "uzi-select-module__value__FTUJh",
|
|
911
|
+
chevron: "uzi-select-module__chevron__U6HXS",
|
|
912
|
+
content: "uzi-select-module__content__pOWWy",
|
|
913
|
+
selectFadeIn: "uzi-select-module__selectFadeIn__Z-yKX",
|
|
914
|
+
viewport: "uzi-select-module__viewport__VGZM6",
|
|
915
|
+
item: "uzi-select-module__item__6uM6-",
|
|
916
|
+
indicator: "uzi-select-module__indicator__ZHcg5",
|
|
917
|
+
indicatorIcon: "uzi-select-module__indicatorIcon__kOV2G"
|
|
918
|
+
};
|
|
919
|
+
//#endregion
|
|
920
|
+
//#region src/components/select/Select.tsx
|
|
921
|
+
var EMPTY_OPTION_VALUE = "__uzi_select_empty__";
|
|
922
|
+
var Select = react.forwardRef(({ options, value, onChange, placeholder, allowEmptyOption = false, fullWidth = true, className, id, name, disabled, required, autoComplete, form, title, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onBlur, onFocus }, ref) => {
|
|
923
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
924
|
+
className: cx(select_module_default.wrapper, fullWidth && select_module_default.wrapperFullWidth, className),
|
|
925
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Root, {
|
|
926
|
+
value,
|
|
927
|
+
onValueChange: (nextValue) => onChange(nextValue === EMPTY_OPTION_VALUE ? "" : nextValue),
|
|
928
|
+
name,
|
|
929
|
+
disabled,
|
|
930
|
+
required,
|
|
931
|
+
autoComplete,
|
|
932
|
+
form,
|
|
933
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Trigger, {
|
|
934
|
+
ref,
|
|
935
|
+
id,
|
|
936
|
+
className: select_module_default.trigger,
|
|
937
|
+
title,
|
|
938
|
+
"aria-label": ariaLabel,
|
|
939
|
+
"aria-labelledby": ariaLabelledBy,
|
|
940
|
+
onBlur,
|
|
941
|
+
onFocus,
|
|
942
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Value, {
|
|
943
|
+
className: select_module_default.value,
|
|
944
|
+
placeholder
|
|
945
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Icon, {
|
|
946
|
+
className: select_module_default.chevron,
|
|
947
|
+
"aria-hidden": "true",
|
|
948
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
949
|
+
viewBox: "0 0 10 10",
|
|
950
|
+
fill: "none",
|
|
951
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
952
|
+
width: "10",
|
|
953
|
+
height: "10",
|
|
954
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
955
|
+
d: "M2 3.5L5 6.5L8 3.5",
|
|
956
|
+
stroke: "currentColor",
|
|
957
|
+
strokeWidth: "1.5",
|
|
958
|
+
strokeLinecap: "round",
|
|
959
|
+
strokeLinejoin: "round"
|
|
960
|
+
})
|
|
961
|
+
})
|
|
962
|
+
})]
|
|
963
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Content, {
|
|
964
|
+
className: select_module_default.content,
|
|
965
|
+
position: "popper",
|
|
966
|
+
sideOffset: 4,
|
|
967
|
+
align: "start",
|
|
968
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Viewport, {
|
|
969
|
+
className: select_module_default.viewport,
|
|
970
|
+
children: [placeholder && allowEmptyOption ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Item, {
|
|
971
|
+
value: EMPTY_OPTION_VALUE,
|
|
972
|
+
className: select_module_default.item,
|
|
973
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
974
|
+
className: select_module_default.indicator,
|
|
975
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
976
|
+
viewBox: "0 0 16 16",
|
|
977
|
+
width: "16",
|
|
978
|
+
height: "16",
|
|
979
|
+
"aria-hidden": "true",
|
|
980
|
+
className: select_module_default.indicatorIcon,
|
|
981
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
982
|
+
d: "M3.5 8.5 6.5 11.5 12.5 4.5",
|
|
983
|
+
fill: "none",
|
|
984
|
+
stroke: "currentColor",
|
|
985
|
+
strokeWidth: "1.8",
|
|
986
|
+
strokeLinecap: "round",
|
|
987
|
+
strokeLinejoin: "round"
|
|
988
|
+
})
|
|
989
|
+
}) })
|
|
990
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemText, { children: placeholder })]
|
|
991
|
+
}) : null, options.map((opt) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Item, {
|
|
992
|
+
value: opt.value,
|
|
993
|
+
disabled: opt.disabled,
|
|
994
|
+
className: select_module_default.item,
|
|
995
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
996
|
+
className: select_module_default.indicator,
|
|
997
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
998
|
+
viewBox: "0 0 16 16",
|
|
999
|
+
width: "16",
|
|
1000
|
+
height: "16",
|
|
1001
|
+
"aria-hidden": "true",
|
|
1002
|
+
className: select_module_default.indicatorIcon,
|
|
1003
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
1004
|
+
d: "M3.5 8.5 6.5 11.5 12.5 4.5",
|
|
1005
|
+
fill: "none",
|
|
1006
|
+
stroke: "currentColor",
|
|
1007
|
+
strokeWidth: "1.8",
|
|
1008
|
+
strokeLinecap: "round",
|
|
1009
|
+
strokeLinejoin: "round"
|
|
1010
|
+
})
|
|
1011
|
+
}) })
|
|
1012
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemText, { children: opt.label })]
|
|
1013
|
+
}, opt.value))]
|
|
1014
|
+
})
|
|
1015
|
+
}) })]
|
|
1016
|
+
})
|
|
1017
|
+
});
|
|
1018
|
+
});
|
|
1019
|
+
Select.displayName = "Select";
|
|
1020
|
+
//#endregion
|
|
1021
|
+
//#region src/components/dropdown/Dropdown.tsx
|
|
1022
|
+
/**
|
|
1023
|
+
* @deprecated Use Select for value selection and DropdownMenu for action menus.
|
|
1024
|
+
* Dropdown remains as a compatibility alias during migration.
|
|
1025
|
+
*/
|
|
1026
|
+
var Dropdown = react.forwardRef(({ options, value, onChange, placeholder = "All", allowClear = true, ...rest }, ref) => {
|
|
1027
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
|
|
1028
|
+
ref,
|
|
1029
|
+
options,
|
|
1030
|
+
value,
|
|
1031
|
+
onChange,
|
|
1032
|
+
placeholder,
|
|
1033
|
+
allowEmptyOption: allowClear,
|
|
1034
|
+
fullWidth: false,
|
|
1035
|
+
...rest
|
|
1036
|
+
});
|
|
1037
|
+
});
|
|
1038
|
+
Dropdown.displayName = "Dropdown";
|
|
1039
|
+
var dropdown_menu_module_default = {
|
|
1040
|
+
content: "uzi-dropdown-menu-module__content__n-ElH",
|
|
1041
|
+
menuFadeIn: "uzi-dropdown-menu-module__menuFadeIn__ITxMo",
|
|
1042
|
+
item: "uzi-dropdown-menu-module__item__tBNtW",
|
|
1043
|
+
itemDestructive: "uzi-dropdown-menu-module__itemDestructive__oWmKd",
|
|
1044
|
+
insetItem: "uzi-dropdown-menu-module__insetItem__g7ONJ",
|
|
1045
|
+
indicator: "uzi-dropdown-menu-module__indicator__5qwFh",
|
|
1046
|
+
indicatorIcon: "uzi-dropdown-menu-module__indicatorIcon__nhJMw",
|
|
1047
|
+
radioDot: "uzi-dropdown-menu-module__radioDot__GWUVT",
|
|
1048
|
+
label: "uzi-dropdown-menu-module__label__sFnNR",
|
|
1049
|
+
separator: "uzi-dropdown-menu-module__separator__PgUob",
|
|
1050
|
+
chevron: "uzi-dropdown-menu-module__chevron__kxfiF"
|
|
1051
|
+
};
|
|
1052
|
+
//#endregion
|
|
1053
|
+
//#region src/components/dropdown-menu/DropdownMenu.tsx
|
|
1054
|
+
function DropdownMenu(props) {
|
|
1055
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Root, { ...props });
|
|
1056
|
+
}
|
|
1057
|
+
function DropdownMenuTrigger(props) {
|
|
1058
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Trigger, { ...props });
|
|
1059
|
+
}
|
|
1060
|
+
function DropdownMenuGroup(props) {
|
|
1061
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Group, { ...props });
|
|
1062
|
+
}
|
|
1063
|
+
function DropdownMenuPortal(props) {
|
|
1064
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Portal, { ...props });
|
|
1065
|
+
}
|
|
1066
|
+
function DropdownMenuSub(props) {
|
|
1067
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Sub, { ...props });
|
|
1068
|
+
}
|
|
1069
|
+
function DropdownMenuRadioGroup(props) {
|
|
1070
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.RadioGroup, { ...props });
|
|
1071
|
+
}
|
|
1072
|
+
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
1073
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Content, {
|
|
1074
|
+
sideOffset,
|
|
1075
|
+
className: cx(dropdown_menu_module_default.content, className),
|
|
1076
|
+
...props
|
|
1077
|
+
}) });
|
|
1078
|
+
}
|
|
1079
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
1080
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Item, {
|
|
1081
|
+
"data-inset": inset ? "true" : void 0,
|
|
1082
|
+
className: cx(dropdown_menu_module_default.item, variant === "destructive" && dropdown_menu_module_default.itemDestructive, className),
|
|
1083
|
+
...props
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
function DropdownMenuCheckboxItem({ className, children, ...props }) {
|
|
1087
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.CheckboxItem, {
|
|
1088
|
+
className: cx(dropdown_menu_module_default.item, dropdown_menu_module_default.insetItem, className),
|
|
1089
|
+
...props,
|
|
1090
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1091
|
+
className: dropdown_menu_module_default.indicator,
|
|
1092
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
1093
|
+
viewBox: "0 0 16 16",
|
|
1094
|
+
width: "16",
|
|
1095
|
+
height: "16",
|
|
1096
|
+
"aria-hidden": "true",
|
|
1097
|
+
className: dropdown_menu_module_default.indicatorIcon,
|
|
1098
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
1099
|
+
d: "M3.5 8.5 6.5 11.5 12.5 4.5",
|
|
1100
|
+
fill: "none",
|
|
1101
|
+
stroke: "currentColor",
|
|
1102
|
+
strokeWidth: "1.8",
|
|
1103
|
+
strokeLinecap: "round",
|
|
1104
|
+
strokeLinejoin: "round"
|
|
1105
|
+
})
|
|
1106
|
+
}) })
|
|
1107
|
+
}), children]
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
1111
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.RadioItem, {
|
|
1112
|
+
className: cx(dropdown_menu_module_default.item, dropdown_menu_module_default.insetItem, className),
|
|
1113
|
+
...props,
|
|
1114
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1115
|
+
className: dropdown_menu_module_default.indicator,
|
|
1116
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: dropdown_menu_module_default.radioDot }) })
|
|
1117
|
+
}), children]
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
1120
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
1121
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Label, {
|
|
1122
|
+
"data-inset": inset ? "true" : void 0,
|
|
1123
|
+
className: cx(dropdown_menu_module_default.label, className),
|
|
1124
|
+
...props
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
1128
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Separator, {
|
|
1129
|
+
className: cx(dropdown_menu_module_default.separator, className),
|
|
1130
|
+
...props
|
|
1131
|
+
});
|
|
1132
|
+
}
|
|
1133
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
1134
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.SubTrigger, {
|
|
1135
|
+
"data-inset": inset ? "true" : void 0,
|
|
1136
|
+
className: cx(dropdown_menu_module_default.item, className),
|
|
1137
|
+
...props,
|
|
1138
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
1139
|
+
viewBox: "0 0 16 16",
|
|
1140
|
+
width: "16",
|
|
1141
|
+
height: "16",
|
|
1142
|
+
"aria-hidden": "true",
|
|
1143
|
+
className: dropdown_menu_module_default.chevron,
|
|
1144
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
1145
|
+
d: "M6 3.5 10.5 8 6 12.5",
|
|
1146
|
+
fill: "none",
|
|
1147
|
+
stroke: "currentColor",
|
|
1148
|
+
strokeWidth: "1.6",
|
|
1149
|
+
strokeLinecap: "round",
|
|
1150
|
+
strokeLinejoin: "round"
|
|
1151
|
+
})
|
|
1152
|
+
})]
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
1156
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.SubContent, {
|
|
1157
|
+
className: cx(dropdown_menu_module_default.content, className),
|
|
1158
|
+
...props
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
//#endregion
|
|
1162
|
+
//#region src/theme/constants.ts
|
|
1163
|
+
var UZI_THEMES = [
|
|
1164
|
+
"light",
|
|
1165
|
+
"dark",
|
|
1166
|
+
"system"
|
|
1167
|
+
];
|
|
1168
|
+
var UZI_ACCENTS = [
|
|
1169
|
+
"blue",
|
|
1170
|
+
"cyan",
|
|
1171
|
+
"violet",
|
|
1172
|
+
"emerald",
|
|
1173
|
+
"amber",
|
|
1174
|
+
"rose"
|
|
1175
|
+
];
|
|
1176
|
+
var THEME_STORAGE_KEY$1 = "uzi-theme";
|
|
1177
|
+
var ACCENT_STORAGE_KEY$1 = "uzi-accent";
|
|
1178
|
+
//#endregion
|
|
1179
|
+
//#region src/theme/ThemeProvider.tsx
|
|
1180
|
+
var THEME_STORAGE_KEY = THEME_STORAGE_KEY$1;
|
|
1181
|
+
var ACCENT_STORAGE_KEY = ACCENT_STORAGE_KEY$1;
|
|
1182
|
+
var THEME_ATTRIBUTE = "data-uzi-theme";
|
|
1183
|
+
var ACCENT_ATTRIBUTE = "data-uzi-accent";
|
|
1184
|
+
var ThemeContext = (0, react.createContext)(void 0);
|
|
1185
|
+
function isTheme(value) {
|
|
1186
|
+
return UZI_THEMES.includes(value);
|
|
1187
|
+
}
|
|
1188
|
+
function isAccent(value) {
|
|
1189
|
+
return UZI_ACCENTS.includes(value);
|
|
1190
|
+
}
|
|
1191
|
+
function getSystemTheme() {
|
|
1192
|
+
if (typeof window === "undefined") return "light";
|
|
1193
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
1194
|
+
}
|
|
1195
|
+
function ThemeProvider({ children, theme, defaultTheme = "system", accent, defaultAccent = "blue", onThemeChange, onAccentChange, storageKey = THEME_STORAGE_KEY, accentStorageKey = ACCENT_STORAGE_KEY, disableStorage = false, toastConfig }) {
|
|
1196
|
+
const [internalTheme, setInternalTheme] = (0, react.useState)(defaultTheme);
|
|
1197
|
+
const [internalAccent, setInternalAccent] = (0, react.useState)(defaultAccent);
|
|
1198
|
+
const [systemTheme, setSystemTheme] = (0, react.useState)("light");
|
|
1199
|
+
(0, react.useEffect)(() => {
|
|
1200
|
+
setSystemTheme(getSystemTheme());
|
|
1201
|
+
if (!disableStorage) {
|
|
1202
|
+
const storedTheme = window.localStorage.getItem(storageKey);
|
|
1203
|
+
if (isTheme(storedTheme)) setInternalTheme(storedTheme);
|
|
1204
|
+
const storedAccent = window.localStorage.getItem(accentStorageKey);
|
|
1205
|
+
if (isAccent(storedAccent)) setInternalAccent(storedAccent);
|
|
1206
|
+
}
|
|
1207
|
+
}, [
|
|
1208
|
+
disableStorage,
|
|
1209
|
+
storageKey,
|
|
1210
|
+
accentStorageKey
|
|
1211
|
+
]);
|
|
1212
|
+
const isThemeControlled = theme !== void 0;
|
|
1213
|
+
const isAccentControlled = accent !== void 0;
|
|
1214
|
+
const currentTheme = isThemeControlled ? theme : internalTheme;
|
|
1215
|
+
const currentAccent = isAccentControlled ? accent : internalAccent;
|
|
1216
|
+
const resolvedTheme = currentTheme === "system" ? systemTheme : currentTheme;
|
|
1217
|
+
(0, react.useEffect)(() => {
|
|
1218
|
+
if (typeof window === "undefined") return;
|
|
1219
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1220
|
+
const handleChange = () => setSystemTheme(mediaQuery.matches ? "dark" : "light");
|
|
1221
|
+
handleChange();
|
|
1222
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
1223
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
1224
|
+
}, []);
|
|
1225
|
+
(0, react.useEffect)(() => {
|
|
1226
|
+
if (typeof document === "undefined") return;
|
|
1227
|
+
const root = document.documentElement;
|
|
1228
|
+
root.setAttribute(THEME_ATTRIBUTE, resolvedTheme);
|
|
1229
|
+
root.setAttribute(ACCENT_ATTRIBUTE, currentAccent);
|
|
1230
|
+
root.style.colorScheme = resolvedTheme;
|
|
1231
|
+
root.classList.toggle("dark", resolvedTheme === "dark");
|
|
1232
|
+
}, [currentAccent, resolvedTheme]);
|
|
1233
|
+
const setTheme = (0, react.useCallback)((nextTheme) => {
|
|
1234
|
+
if (!isThemeControlled) setInternalTheme(nextTheme);
|
|
1235
|
+
if (!disableStorage && typeof window !== "undefined") window.localStorage.setItem(storageKey, nextTheme);
|
|
1236
|
+
onThemeChange?.(nextTheme);
|
|
1237
|
+
}, [
|
|
1238
|
+
disableStorage,
|
|
1239
|
+
isThemeControlled,
|
|
1240
|
+
onThemeChange,
|
|
1241
|
+
storageKey
|
|
1242
|
+
]);
|
|
1243
|
+
const setAccent = (0, react.useCallback)((nextAccent) => {
|
|
1244
|
+
if (!isAccentControlled) setInternalAccent(nextAccent);
|
|
1245
|
+
if (!disableStorage && typeof window !== "undefined") window.localStorage.setItem(accentStorageKey, nextAccent);
|
|
1246
|
+
onAccentChange?.(nextAccent);
|
|
1247
|
+
}, [
|
|
1248
|
+
accentStorageKey,
|
|
1249
|
+
disableStorage,
|
|
1250
|
+
isAccentControlled,
|
|
1251
|
+
onAccentChange
|
|
1252
|
+
]);
|
|
1253
|
+
const toggleTheme = (0, react.useCallback)(() => {
|
|
1254
|
+
setTheme(resolvedTheme === "dark" ? "light" : "dark");
|
|
1255
|
+
}, [resolvedTheme, setTheme]);
|
|
1256
|
+
const value = (0, react.useMemo)(() => ({
|
|
1257
|
+
theme: currentTheme,
|
|
1258
|
+
resolvedTheme,
|
|
1259
|
+
accent: currentAccent,
|
|
1260
|
+
setTheme,
|
|
1261
|
+
setAccent,
|
|
1262
|
+
toggleTheme
|
|
1263
|
+
}), [
|
|
1264
|
+
currentAccent,
|
|
1265
|
+
currentTheme,
|
|
1266
|
+
resolvedTheme,
|
|
1267
|
+
setAccent,
|
|
1268
|
+
setTheme,
|
|
1269
|
+
toggleTheme
|
|
1270
|
+
]);
|
|
1271
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeContext.Provider, {
|
|
1272
|
+
value,
|
|
1273
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastProvider, {
|
|
1274
|
+
config: toastConfig,
|
|
1275
|
+
children
|
|
1276
|
+
})
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
1279
|
+
function useTheme() {
|
|
1280
|
+
const context = (0, react.useContext)(ThemeContext);
|
|
1281
|
+
if (!context) throw new Error("useTheme must be used within a ThemeProvider");
|
|
1282
|
+
return context;
|
|
1283
|
+
}
|
|
1284
|
+
var theme_toggle_button_module_default = { withLabel: "uzi-theme-toggle-button-module__withLabel__KqtDj" };
|
|
1285
|
+
//#endregion
|
|
1286
|
+
//#region src/components/theme-toggle-button/ThemeToggleButton.tsx
|
|
1287
|
+
function MoonIcon() {
|
|
1288
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
1289
|
+
viewBox: "0 0 24 24",
|
|
1290
|
+
"aria-hidden": "true",
|
|
1291
|
+
width: "16",
|
|
1292
|
+
height: "16",
|
|
1293
|
+
fill: "none",
|
|
1294
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
1295
|
+
d: "M20 15.2A8.5 8.5 0 0 1 8.8 4 9 9 0 1 0 20 15.2Z",
|
|
1296
|
+
stroke: "currentColor",
|
|
1297
|
+
strokeWidth: "1.8",
|
|
1298
|
+
strokeLinecap: "round",
|
|
1299
|
+
strokeLinejoin: "round"
|
|
1300
|
+
})
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
function SunIcon() {
|
|
1304
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
1305
|
+
viewBox: "0 0 24 24",
|
|
1306
|
+
"aria-hidden": "true",
|
|
1307
|
+
width: "16",
|
|
1308
|
+
height: "16",
|
|
1309
|
+
fill: "none",
|
|
1310
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
1311
|
+
cx: "12",
|
|
1312
|
+
cy: "12",
|
|
1313
|
+
r: "4",
|
|
1314
|
+
stroke: "currentColor",
|
|
1315
|
+
strokeWidth: "1.8"
|
|
1316
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
1317
|
+
d: "M12 2.75v2.5M12 18.75v2.5M21.25 12h-2.5M5.25 12h-2.5M18.54 5.46l-1.77 1.77M7.23 16.77l-1.77 1.77M18.54 18.54l-1.77-1.77M7.23 7.23 5.46 5.46",
|
|
1318
|
+
stroke: "currentColor",
|
|
1319
|
+
strokeWidth: "1.8",
|
|
1320
|
+
strokeLinecap: "round"
|
|
1321
|
+
})]
|
|
1322
|
+
});
|
|
1323
|
+
}
|
|
1324
|
+
function ThemeToggleButton({ showLabel = false, lightLabel = "Light mode", darkLabel = "Dark mode", className, onClick, ...rest }) {
|
|
1325
|
+
const { resolvedTheme, toggleTheme } = useTheme();
|
|
1326
|
+
const nextThemeLabel = resolvedTheme === "dark" ? lightLabel : darkLabel;
|
|
1327
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button, {
|
|
1328
|
+
type: "button",
|
|
1329
|
+
variant: "ghost",
|
|
1330
|
+
size: showLabel ? "sm" : "icon",
|
|
1331
|
+
className: cx(showLabel && theme_toggle_button_module_default.withLabel, className),
|
|
1332
|
+
"aria-label": `Switch to ${nextThemeLabel.toLowerCase()}`,
|
|
1333
|
+
title: `Switch to ${nextThemeLabel.toLowerCase()}`,
|
|
1334
|
+
onClick: (event) => {
|
|
1335
|
+
onClick?.(event);
|
|
1336
|
+
if (!event.defaultPrevented) toggleTheme();
|
|
1337
|
+
},
|
|
1338
|
+
...rest,
|
|
1339
|
+
children: [resolvedTheme === "dark" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SunIcon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MoonIcon, {}), showLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: nextThemeLabel })]
|
|
1340
|
+
});
|
|
1341
|
+
}
|
|
1342
|
+
var top_bar_module_default = {
|
|
1343
|
+
topBar: "uzi-top-bar-module__topBar__MJ-7S",
|
|
1344
|
+
topBarStatic: "uzi-top-bar-module__topBarStatic__JvEwt",
|
|
1345
|
+
topBarInner: "uzi-top-bar-module__topBarInner__PBbi8",
|
|
1346
|
+
topBarStart: "uzi-top-bar-module__topBarStart__DrdN2",
|
|
1347
|
+
topBarBrand: "uzi-top-bar-module__topBarBrand__80VV3",
|
|
1348
|
+
topBarBrandContent: "uzi-top-bar-module__topBarBrandContent__O4Uto",
|
|
1349
|
+
topBarCenter: "uzi-top-bar-module__topBarCenter__Kwxg-",
|
|
1350
|
+
topBarCenterGroup: "uzi-top-bar-module__topBarCenterGroup__7Ishp",
|
|
1351
|
+
topBarActions: "uzi-top-bar-module__topBarActions__mgMd8"
|
|
1352
|
+
};
|
|
1353
|
+
//#endregion
|
|
1354
|
+
//#region src/components/top-bar/TopBar.tsx
|
|
1355
|
+
function TopBar({ leading, brand, brandHref, brandingLocation = "left", start, center, actions, showThemeToggle = false, themeToggleProps, className, innerClassName, isSticky, sticky = true, children, ...rest }) {
|
|
1356
|
+
const shouldStick = isSticky ?? sticky;
|
|
1357
|
+
const brandNode = !brand ? null : brandHref ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
1358
|
+
href: brandHref,
|
|
1359
|
+
className: top_bar_module_default.topBarBrand,
|
|
1360
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1361
|
+
className: top_bar_module_default.topBarBrandContent,
|
|
1362
|
+
children: brand
|
|
1363
|
+
})
|
|
1364
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1365
|
+
className: top_bar_module_default.topBarBrand,
|
|
1366
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1367
|
+
className: top_bar_module_default.topBarBrandContent,
|
|
1368
|
+
children: brand
|
|
1369
|
+
})
|
|
1370
|
+
});
|
|
1371
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("header", {
|
|
1372
|
+
className: cx(top_bar_module_default.topBar, !shouldStick && top_bar_module_default.topBarStatic, className),
|
|
1373
|
+
...rest,
|
|
1374
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1375
|
+
className: cx(top_bar_module_default.topBarInner, innerClassName),
|
|
1376
|
+
children: [
|
|
1377
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1378
|
+
className: top_bar_module_default.topBarStart,
|
|
1379
|
+
children: [
|
|
1380
|
+
leading,
|
|
1381
|
+
brandingLocation === "left" && brandNode,
|
|
1382
|
+
start
|
|
1383
|
+
]
|
|
1384
|
+
}),
|
|
1385
|
+
brandNode && brandingLocation === "center" || center || children ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1386
|
+
className: top_bar_module_default.topBarCenter,
|
|
1387
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1388
|
+
className: top_bar_module_default.topBarCenterGroup,
|
|
1389
|
+
children: [brandingLocation === "center" && brandNode, center ?? children]
|
|
1390
|
+
})
|
|
1391
|
+
}) : null,
|
|
1392
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1393
|
+
className: top_bar_module_default.topBarActions,
|
|
1394
|
+
children: [showThemeToggle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeToggleButton, { ...themeToggleProps }), actions]
|
|
1395
|
+
})
|
|
1396
|
+
]
|
|
1397
|
+
})
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
var app_shell_module_default = {
|
|
1401
|
+
appShell: "uzi-app-shell-module__appShell__S0cVI",
|
|
1402
|
+
appShellAnimated: "uzi-app-shell-module__appShellAnimated__-CRIl",
|
|
1403
|
+
appShellOpen: "uzi-app-shell-module__appShellOpen__1rZUl",
|
|
1404
|
+
appShellCollapsed: "uzi-app-shell-module__appShellCollapsed__fSasN",
|
|
1405
|
+
appShellTopbar: "uzi-app-shell-module__appShellTopbar__rgXsW",
|
|
1406
|
+
appShellTopbarLeft: "uzi-app-shell-module__appShellTopbarLeft__-EVuB",
|
|
1407
|
+
appShellTopbarStart: "uzi-app-shell-module__appShellTopbarStart__XXQpq",
|
|
1408
|
+
appShellTopbarRight: "uzi-app-shell-module__appShellTopbarRight__l1G57",
|
|
1409
|
+
appShellBrand: "uzi-app-shell-module__appShellBrand__TXwyN",
|
|
1410
|
+
appShellHamburger: "uzi-app-shell-module__appShellHamburger__BciFA",
|
|
1411
|
+
appShellSidebar: "uzi-app-shell-module__appShellSidebar__oY7uj",
|
|
1412
|
+
appShellMain: "uzi-app-shell-module__appShellMain__eHP2r",
|
|
1413
|
+
appShellBackdrop: "uzi-app-shell-module__appShellBackdrop__y31xs",
|
|
1414
|
+
appShellSidebarOpen: "uzi-app-shell-module__appShellSidebarOpen__Z5AIo"
|
|
1415
|
+
};
|
|
1416
|
+
//#endregion
|
|
1417
|
+
//#region src/components/app-shell/AppShell.tsx
|
|
1418
|
+
var DESKTOP_BREAKPOINT = 960;
|
|
1419
|
+
function getIsDesktop() {
|
|
1420
|
+
if (typeof window === "undefined") return false;
|
|
1421
|
+
return window.innerWidth >= DESKTOP_BREAKPOINT;
|
|
1422
|
+
}
|
|
1423
|
+
/**
|
|
1424
|
+
* Responsive application shell with a collapsible sidebar and sticky top bar.
|
|
1425
|
+
*
|
|
1426
|
+
* - Sidebar opens by default on desktop, collapses on mobile.
|
|
1427
|
+
* - Closes on outside click/scroll/touch when in mobile mode.
|
|
1428
|
+
* - Provides optional hook to close the sidebar when a prop value changes
|
|
1429
|
+
* (e.g., route transitions).
|
|
1430
|
+
*/
|
|
1431
|
+
function AppShell({ children, sidebar, brand, brandHref, topbarStart, topbarEnd, showThemeToggle = false, themeToggleProps, topBarBrandingLocation = "left", className, sidebarClassName, topbarClassName, mainClassName, sidebarWidth, closeSidebarOnChangeKey, hamburgerLabel = "Toggle navigation", onSidebarToggle }) {
|
|
1432
|
+
const [isDesktop, setIsDesktop] = (0, react.useState)(false);
|
|
1433
|
+
const [sidebarOpen, setSidebarOpen] = (0, react.useState)(false);
|
|
1434
|
+
const [transitionsReady, setTransitionsReady] = (0, react.useState)(false);
|
|
1435
|
+
const prevIsDesktopRef = (0, react.useRef)(false);
|
|
1436
|
+
const closeKeyRef = (0, react.useRef)(closeSidebarOnChangeKey);
|
|
1437
|
+
const sidebarRef = (0, react.useRef)(null);
|
|
1438
|
+
const hamburgerRef = (0, react.useRef)(null);
|
|
1439
|
+
const mainRef = (0, react.useRef)(null);
|
|
1440
|
+
const sidebarId = (0, react.useId)();
|
|
1441
|
+
(0, react.useEffect)(() => {
|
|
1442
|
+
const desktop = getIsDesktop();
|
|
1443
|
+
setIsDesktop(desktop);
|
|
1444
|
+
setSidebarOpen(desktop);
|
|
1445
|
+
prevIsDesktopRef.current = desktop;
|
|
1446
|
+
const transitionFrame = window.requestAnimationFrame(() => {
|
|
1447
|
+
setTransitionsReady(true);
|
|
1448
|
+
});
|
|
1449
|
+
const handleResize = () => {
|
|
1450
|
+
const nowDesktop = getIsDesktop();
|
|
1451
|
+
setIsDesktop(nowDesktop);
|
|
1452
|
+
if (nowDesktop !== prevIsDesktopRef.current) {
|
|
1453
|
+
setSidebarOpen(nowDesktop);
|
|
1454
|
+
prevIsDesktopRef.current = nowDesktop;
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
window.addEventListener("resize", handleResize);
|
|
1458
|
+
return () => {
|
|
1459
|
+
window.cancelAnimationFrame(transitionFrame);
|
|
1460
|
+
window.removeEventListener("resize", handleResize);
|
|
1461
|
+
};
|
|
1462
|
+
}, []);
|
|
1463
|
+
(0, react.useEffect)(() => {
|
|
1464
|
+
if (isDesktop || !sidebarOpen) return;
|
|
1465
|
+
const mainElement = mainRef.current;
|
|
1466
|
+
const closeSidebar = () => setSidebarOpen(false);
|
|
1467
|
+
const onPointerDown = (e) => {
|
|
1468
|
+
const target = e.target;
|
|
1469
|
+
if (!target) return;
|
|
1470
|
+
if (sidebarRef.current?.contains(target)) return;
|
|
1471
|
+
if (hamburgerRef.current?.contains(target)) return;
|
|
1472
|
+
closeSidebar();
|
|
1473
|
+
};
|
|
1474
|
+
const timeoutId = window.setTimeout(() => {
|
|
1475
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
1476
|
+
window.addEventListener("scroll", closeSidebar, { passive: true });
|
|
1477
|
+
mainElement?.addEventListener("scroll", closeSidebar, { passive: true });
|
|
1478
|
+
document.addEventListener("touchmove", closeSidebar, { passive: true });
|
|
1479
|
+
}, 10);
|
|
1480
|
+
return () => {
|
|
1481
|
+
window.clearTimeout(timeoutId);
|
|
1482
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
1483
|
+
window.removeEventListener("scroll", closeSidebar);
|
|
1484
|
+
mainElement?.removeEventListener("scroll", closeSidebar);
|
|
1485
|
+
document.removeEventListener("touchmove", closeSidebar);
|
|
1486
|
+
};
|
|
1487
|
+
}, [sidebarOpen, isDesktop]);
|
|
1488
|
+
(0, react.useEffect)(() => {
|
|
1489
|
+
if (!isDesktop && closeKeyRef.current !== closeSidebarOnChangeKey) setSidebarOpen(false);
|
|
1490
|
+
closeKeyRef.current = closeSidebarOnChangeKey;
|
|
1491
|
+
}, [closeSidebarOnChangeKey, isDesktop]);
|
|
1492
|
+
(0, react.useEffect)(() => {
|
|
1493
|
+
onSidebarToggle?.(sidebarOpen);
|
|
1494
|
+
}, [sidebarOpen, onSidebarToggle]);
|
|
1495
|
+
const toggleSidebar = () => setSidebarOpen((open) => !open);
|
|
1496
|
+
const sidebarWidthValue = sidebarWidth === void 0 ? void 0 : typeof sidebarWidth === "number" ? `${sidebarWidth}px` : sidebarWidth;
|
|
1497
|
+
const shellStyle = sidebarWidthValue ? { ["--app-shell-sidebar-width"]: sidebarWidthValue } : void 0;
|
|
1498
|
+
const shellClasses = cx(app_shell_module_default.appShell, transitionsReady && app_shell_module_default.appShellAnimated, sidebarOpen ? app_shell_module_default.appShellOpen : app_shell_module_default.appShellCollapsed, className);
|
|
1499
|
+
const sidebarClasses = cx(app_shell_module_default.appShellSidebar, sidebarOpen && app_shell_module_default.appShellSidebarOpen, sidebarClassName);
|
|
1500
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1501
|
+
className: shellClasses,
|
|
1502
|
+
style: shellStyle,
|
|
1503
|
+
"data-app-shell": true,
|
|
1504
|
+
"data-desktop": isDesktop ? "true" : "false",
|
|
1505
|
+
"data-sidebar-open": sidebarOpen ? "true" : "false",
|
|
1506
|
+
children: [
|
|
1507
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TopBar, {
|
|
1508
|
+
className: cx(app_shell_module_default.appShellTopbar, topbarClassName),
|
|
1509
|
+
leading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1510
|
+
ref: hamburgerRef,
|
|
1511
|
+
type: "button",
|
|
1512
|
+
className: app_shell_module_default.appShellHamburger,
|
|
1513
|
+
onClick: toggleSidebar,
|
|
1514
|
+
"aria-label": hamburgerLabel,
|
|
1515
|
+
"aria-expanded": sidebarOpen,
|
|
1516
|
+
"aria-controls": sidebarId,
|
|
1517
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
1518
|
+
viewBox: "0 0 24 24",
|
|
1519
|
+
"aria-hidden": "true",
|
|
1520
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
1521
|
+
d: "M3 6h18M3 12h18M3 18h18",
|
|
1522
|
+
stroke: "currentColor",
|
|
1523
|
+
strokeWidth: "2.5",
|
|
1524
|
+
strokeLinecap: "round"
|
|
1525
|
+
})
|
|
1526
|
+
})
|
|
1527
|
+
}),
|
|
1528
|
+
brand,
|
|
1529
|
+
brandHref,
|
|
1530
|
+
brandingLocation: topBarBrandingLocation,
|
|
1531
|
+
start: topbarStart,
|
|
1532
|
+
actions: topbarEnd,
|
|
1533
|
+
showThemeToggle,
|
|
1534
|
+
themeToggleProps
|
|
1535
|
+
}),
|
|
1536
|
+
!isDesktop && sidebarOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1537
|
+
className: app_shell_module_default.appShellBackdrop,
|
|
1538
|
+
onClick: () => setSidebarOpen(false),
|
|
1539
|
+
onTouchStart: () => setSidebarOpen(false),
|
|
1540
|
+
"aria-hidden": "true"
|
|
1541
|
+
}),
|
|
1542
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
|
|
1543
|
+
ref: sidebarRef,
|
|
1544
|
+
id: sidebarId,
|
|
1545
|
+
className: sidebarClasses,
|
|
1546
|
+
"aria-label": "Sidebar navigation",
|
|
1547
|
+
children: sidebar
|
|
1548
|
+
}),
|
|
1549
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("main", {
|
|
1550
|
+
ref: mainRef,
|
|
1551
|
+
className: cx(app_shell_module_default.appShellMain, mainClassName),
|
|
1552
|
+
children
|
|
1553
|
+
})
|
|
1554
|
+
]
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1557
|
+
var sidebar_nav_module_default = {
|
|
1558
|
+
sidebarNav: "uzi-sidebar-nav-module__sidebarNav__eUI5c",
|
|
1559
|
+
sidebarNavCollapsed: "uzi-sidebar-nav-module__sidebarNavCollapsed__xTM9s",
|
|
1560
|
+
header: "uzi-sidebar-nav-module__header__Y4NLy",
|
|
1561
|
+
footer: "uzi-sidebar-nav-module__footer__GjWky",
|
|
1562
|
+
sections: "uzi-sidebar-nav-module__sections__mXuGQ",
|
|
1563
|
+
section: "uzi-sidebar-nav-module__section__yjtCY",
|
|
1564
|
+
sectionItems: "uzi-sidebar-nav-module__sectionItems__tNcph",
|
|
1565
|
+
sectionLabel: "uzi-sidebar-nav-module__sectionLabel__Wx94m",
|
|
1566
|
+
item: "uzi-sidebar-nav-module__item__uMHkJ",
|
|
1567
|
+
itemActive: "uzi-sidebar-nav-module__itemActive__wBbiS",
|
|
1568
|
+
itemCollapsed: "uzi-sidebar-nav-module__itemCollapsed__jLJN-",
|
|
1569
|
+
itemDisabled: "uzi-sidebar-nav-module__itemDisabled__Yf8Il",
|
|
1570
|
+
icon: "uzi-sidebar-nav-module__icon__tyrUg",
|
|
1571
|
+
itemBody: "uzi-sidebar-nav-module__itemBody__wI0iy",
|
|
1572
|
+
labelRow: "uzi-sidebar-nav-module__labelRow__D8sEJ",
|
|
1573
|
+
label: "uzi-sidebar-nav-module__label__A-nt6",
|
|
1574
|
+
description: "uzi-sidebar-nav-module__description__Xf3Si",
|
|
1575
|
+
badge: "uzi-sidebar-nav-module__badge__-hnFd"
|
|
1576
|
+
};
|
|
1577
|
+
//#endregion
|
|
1578
|
+
//#region src/components/sidebar-nav/SidebarNav.tsx
|
|
1579
|
+
var isActivePrefix = (item, path) => {
|
|
1580
|
+
if (item.active !== void 0) return item.active;
|
|
1581
|
+
if (!item.href) return false;
|
|
1582
|
+
if (!path) return false;
|
|
1583
|
+
if (item.href === "/") return path === "/";
|
|
1584
|
+
return path.startsWith(item.href);
|
|
1585
|
+
};
|
|
1586
|
+
var isActiveExact = (item, path) => {
|
|
1587
|
+
if (item.active !== void 0) return item.active;
|
|
1588
|
+
if (!item.href) return false;
|
|
1589
|
+
if (!path) return false;
|
|
1590
|
+
if (item.href === "/") return path === "/";
|
|
1591
|
+
const normalizedHref = item.href.endsWith("/") ? item.href.slice(0, -1) : item.href;
|
|
1592
|
+
return normalizedHref === path || path.startsWith(`${normalizedHref}/`);
|
|
1593
|
+
};
|
|
1594
|
+
var isNaturalPrefixMatch = (href, path) => {
|
|
1595
|
+
if (href === "/") return path === "/";
|
|
1596
|
+
return path.startsWith(href);
|
|
1597
|
+
};
|
|
1598
|
+
var isNaturalExactMatch = (href, path) => {
|
|
1599
|
+
if (href === "/") return path === "/";
|
|
1600
|
+
return (href.endsWith("/") ? href.slice(0, -1) : href) === path;
|
|
1601
|
+
};
|
|
1602
|
+
var hrefLength = (href) => href.endsWith("/") ? href.length - 1 : href.length;
|
|
1603
|
+
var findMostSpecific = (items, currentPath) => {
|
|
1604
|
+
const result = /* @__PURE__ */ new Set();
|
|
1605
|
+
if (!currentPath) return result;
|
|
1606
|
+
const matchingItems = items.filter((item) => {
|
|
1607
|
+
if (item.disabled || !item.href) return false;
|
|
1608
|
+
return item.exact ? isNaturalExactMatch(item.href, currentPath) : isNaturalPrefixMatch(item.href, currentPath);
|
|
1609
|
+
});
|
|
1610
|
+
if (matchingItems.length === 0) return result;
|
|
1611
|
+
let maxLen = 0;
|
|
1612
|
+
for (const item of matchingItems) {
|
|
1613
|
+
if (!item.href) continue;
|
|
1614
|
+
const len = hrefLength(item.href);
|
|
1615
|
+
if (len > maxLen) maxLen = len;
|
|
1616
|
+
}
|
|
1617
|
+
for (const item of matchingItems) {
|
|
1618
|
+
if (!item.href) continue;
|
|
1619
|
+
if (hrefLength(item.href) === maxLen) result.add(item.href);
|
|
1620
|
+
}
|
|
1621
|
+
return result;
|
|
1622
|
+
};
|
|
1623
|
+
function SidebarNav({ items = [], sections, currentPath, getIsActive, matchStrategy = "prefix", onItemClick, header, footer, ariaLabel = "Sidebar navigation", collapsed = false, iconSize, className, itemClassName, sectionClassName }) {
|
|
1624
|
+
const resolvedSections = (0, react.useMemo)(() => {
|
|
1625
|
+
return sections?.length ? sections : [{
|
|
1626
|
+
id: "default",
|
|
1627
|
+
items
|
|
1628
|
+
}];
|
|
1629
|
+
}, [sections, items]);
|
|
1630
|
+
const allItems = (0, react.useMemo)(() => resolvedSections.flatMap((section) => section.items), [resolvedSections]);
|
|
1631
|
+
const defaultIsActiveFn = (0, react.useMemo)(() => {
|
|
1632
|
+
if (matchStrategy === "most-specific") {
|
|
1633
|
+
const mostSpecificHrefs = findMostSpecific(allItems, currentPath);
|
|
1634
|
+
return (item) => {
|
|
1635
|
+
if (item.active !== void 0) return item.active;
|
|
1636
|
+
if (!item.href) return false;
|
|
1637
|
+
return mostSpecificHrefs.has(item.href);
|
|
1638
|
+
};
|
|
1639
|
+
} else return (item, path) => {
|
|
1640
|
+
if (item.active !== void 0) return item.active;
|
|
1641
|
+
if (item.exact) return isActiveExact(item, path);
|
|
1642
|
+
return isActivePrefix(item, path);
|
|
1643
|
+
};
|
|
1644
|
+
}, [
|
|
1645
|
+
matchStrategy,
|
|
1646
|
+
allItems,
|
|
1647
|
+
currentPath
|
|
1648
|
+
]);
|
|
1649
|
+
const resolvedGetIsActive = getIsActive ?? defaultIsActiveFn;
|
|
1650
|
+
const style = iconSize !== void 0 ? { ["--sidebar-nav-icon-size"]: typeof iconSize === "number" ? `${iconSize}px` : iconSize } : void 0;
|
|
1651
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("nav", {
|
|
1652
|
+
className: cx(sidebar_nav_module_default.sidebarNav, collapsed && sidebar_nav_module_default.sidebarNavCollapsed, className),
|
|
1653
|
+
"aria-label": ariaLabel,
|
|
1654
|
+
style,
|
|
1655
|
+
children: [
|
|
1656
|
+
header ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1657
|
+
className: sidebar_nav_module_default.header,
|
|
1658
|
+
children: header
|
|
1659
|
+
}) : null,
|
|
1660
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1661
|
+
className: sidebar_nav_module_default.sections,
|
|
1662
|
+
children: resolvedSections.map((section, sectionIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1663
|
+
className: cx(sidebar_nav_module_default.section, sectionClassName),
|
|
1664
|
+
children: [section.label && !collapsed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1665
|
+
className: sidebar_nav_module_default.sectionLabel,
|
|
1666
|
+
children: section.label
|
|
1667
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1668
|
+
className: sidebar_nav_module_default.sectionItems,
|
|
1669
|
+
children: section.items.map((item, itemIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarNavEntry, {
|
|
1670
|
+
item,
|
|
1671
|
+
active: resolvedGetIsActive(item, currentPath),
|
|
1672
|
+
collapsed,
|
|
1673
|
+
itemClassName,
|
|
1674
|
+
onItemClick
|
|
1675
|
+
}, `${section.id ?? sectionIndex}-${item.href ?? item.title ?? itemIndex}`))
|
|
1676
|
+
})]
|
|
1677
|
+
}, section.id ?? `section-${sectionIndex}`))
|
|
1678
|
+
}),
|
|
1679
|
+
footer ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1680
|
+
className: sidebar_nav_module_default.footer,
|
|
1681
|
+
children: footer
|
|
1682
|
+
}) : null
|
|
1683
|
+
]
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
function SidebarNavEntry({ item, active, collapsed, itemClassName, onItemClick }) {
|
|
1687
|
+
const rel = item.rel ?? (item.target === "_blank" ? "noreferrer" : void 0);
|
|
1688
|
+
const title = item.title ?? (typeof item.label === "string" ? item.label : void 0);
|
|
1689
|
+
const classes = cx(sidebar_nav_module_default.item, active && sidebar_nav_module_default.itemActive, collapsed && sidebar_nav_module_default.itemCollapsed, item.disabled && sidebar_nav_module_default.itemDisabled, itemClassName);
|
|
1690
|
+
const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [item.icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1691
|
+
className: sidebar_nav_module_default.icon,
|
|
1692
|
+
children: item.icon
|
|
1693
|
+
}), !collapsed ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1694
|
+
className: sidebar_nav_module_default.itemBody,
|
|
1695
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1696
|
+
className: sidebar_nav_module_default.labelRow,
|
|
1697
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1698
|
+
className: sidebar_nav_module_default.label,
|
|
1699
|
+
children: item.label
|
|
1700
|
+
}), item.badge && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1701
|
+
className: sidebar_nav_module_default.badge,
|
|
1702
|
+
children: item.badge
|
|
1703
|
+
})]
|
|
1704
|
+
}), item.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1705
|
+
className: sidebar_nav_module_default.description,
|
|
1706
|
+
children: item.description
|
|
1707
|
+
}) : null]
|
|
1708
|
+
}) : null] });
|
|
1709
|
+
const handleClick = () => {
|
|
1710
|
+
if (item.disabled) return;
|
|
1711
|
+
item.onClick?.();
|
|
1712
|
+
onItemClick?.(item);
|
|
1713
|
+
};
|
|
1714
|
+
if (!item.href) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1715
|
+
type: "button",
|
|
1716
|
+
className: classes,
|
|
1717
|
+
"aria-current": active ? "page" : void 0,
|
|
1718
|
+
"aria-disabled": item.disabled ? "true" : void 0,
|
|
1719
|
+
disabled: item.disabled,
|
|
1720
|
+
title: collapsed ? title : void 0,
|
|
1721
|
+
onClick: handleClick,
|
|
1722
|
+
children: content
|
|
1723
|
+
});
|
|
1724
|
+
if (item.disabled) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1725
|
+
className: classes,
|
|
1726
|
+
"aria-current": active ? "page" : void 0,
|
|
1727
|
+
"aria-disabled": "true",
|
|
1728
|
+
title: collapsed ? title : void 0,
|
|
1729
|
+
children: content
|
|
1730
|
+
});
|
|
1731
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
1732
|
+
className: classes,
|
|
1733
|
+
href: item.href,
|
|
1734
|
+
target: item.target,
|
|
1735
|
+
rel,
|
|
1736
|
+
"aria-current": active ? "page" : void 0,
|
|
1737
|
+
title: collapsed ? title : void 0,
|
|
1738
|
+
onClick: handleClick,
|
|
1739
|
+
children: content
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
var skeleton_module_default = {
|
|
1743
|
+
skeleton: "uzi-skeleton-module__skeleton__fula5",
|
|
1744
|
+
"skeleton-pulse": "uzi-skeleton-module__skeleton-pulse__Yp45W",
|
|
1745
|
+
"radius-sm": "uzi-skeleton-module__radius-sm__FdccD",
|
|
1746
|
+
"radius-md": "uzi-skeleton-module__radius-md__zH3RE",
|
|
1747
|
+
"radius-lg": "uzi-skeleton-module__radius-lg__YVrHw",
|
|
1748
|
+
"radius-full": "uzi-skeleton-module__radius-full__5o2m0"
|
|
1749
|
+
};
|
|
1750
|
+
//#endregion
|
|
1751
|
+
//#region src/components/skeleton/Skeleton.tsx
|
|
1752
|
+
function Skeleton({ width, height, radius = "md", className, style, ...rest }) {
|
|
1753
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1754
|
+
className: cx(skeleton_module_default.skeleton, skeleton_module_default[`radius-${radius}`], className),
|
|
1755
|
+
style: {
|
|
1756
|
+
width,
|
|
1757
|
+
height,
|
|
1758
|
+
...style
|
|
1759
|
+
},
|
|
1760
|
+
"aria-hidden": "true",
|
|
1761
|
+
...rest
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
var progress_module_default = {
|
|
1765
|
+
track: "uzi-progress-module__track__gM0oV",
|
|
1766
|
+
fill: "uzi-progress-module__fill__aLAbp",
|
|
1767
|
+
"tone-default": "uzi-progress-module__tone-default__fhf7o",
|
|
1768
|
+
"tone-success": "uzi-progress-module__tone-success__FsGHD",
|
|
1769
|
+
"tone-warning": "uzi-progress-module__tone-warning__UAttL",
|
|
1770
|
+
"tone-danger": "uzi-progress-module__tone-danger__-L-Ee"
|
|
1771
|
+
};
|
|
1772
|
+
//#endregion
|
|
1773
|
+
//#region src/components/progress/Progress.tsx
|
|
1774
|
+
function Progress({ value, tone = "default", className, "aria-label": ariaLabel, ...rest }) {
|
|
1775
|
+
const clamped = Math.max(0, Math.min(100, value));
|
|
1776
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1777
|
+
className: cx(progress_module_default.track, className),
|
|
1778
|
+
role: "progressbar",
|
|
1779
|
+
"aria-valuenow": clamped,
|
|
1780
|
+
"aria-valuemin": 0,
|
|
1781
|
+
"aria-valuemax": 100,
|
|
1782
|
+
"aria-label": ariaLabel,
|
|
1783
|
+
...rest,
|
|
1784
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1785
|
+
className: cx(progress_module_default.fill, progress_module_default[`tone-${tone}`]),
|
|
1786
|
+
style: { width: `${clamped}%` }
|
|
1787
|
+
})
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
var segmented_toggle_module_default = {
|
|
1791
|
+
track: "uzi-segmented-toggle-module__track__M4fjm",
|
|
1792
|
+
option: "uzi-segmented-toggle-module__option__7cEZJ",
|
|
1793
|
+
label: "uzi-segmented-toggle-module__label__bDAIv"
|
|
1794
|
+
};
|
|
1795
|
+
//#endregion
|
|
1796
|
+
//#region src/components/segmented-toggle/SegmentedToggle.tsx
|
|
1797
|
+
function SegmentedToggle({ options, value, onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className }) {
|
|
1798
|
+
const itemRefs = react.useRef([]);
|
|
1799
|
+
const selectedIndex = options.findIndex((opt) => opt.value === value);
|
|
1800
|
+
const fallbackIndex = options.findIndex((opt) => !opt.disabled);
|
|
1801
|
+
let lastEnabledIndex = -1;
|
|
1802
|
+
for (let index = options.length - 1; index >= 0; index -= 1) if (!options[index]?.disabled) {
|
|
1803
|
+
lastEnabledIndex = index;
|
|
1804
|
+
break;
|
|
1805
|
+
}
|
|
1806
|
+
const tabbableIndex = selectedIndex >= 0 && !options[selectedIndex]?.disabled ? selectedIndex : fallbackIndex;
|
|
1807
|
+
const focusItem = (index) => {
|
|
1808
|
+
itemRefs.current[index]?.focus();
|
|
1809
|
+
};
|
|
1810
|
+
const findEnabledIndex = (startIndex, direction) => {
|
|
1811
|
+
if (options.length === 0) return -1;
|
|
1812
|
+
let nextIndex = startIndex;
|
|
1813
|
+
for (let i = 0; i < options.length; i += 1) {
|
|
1814
|
+
nextIndex = (nextIndex + direction + options.length) % options.length;
|
|
1815
|
+
if (!options[nextIndex]?.disabled) return nextIndex;
|
|
1816
|
+
}
|
|
1817
|
+
return startIndex;
|
|
1818
|
+
};
|
|
1819
|
+
const selectIndex = (index) => {
|
|
1820
|
+
const nextOption = options[index];
|
|
1821
|
+
if (!nextOption || nextOption.disabled || nextOption.value === value) return;
|
|
1822
|
+
onChange(nextOption.value);
|
|
1823
|
+
};
|
|
1824
|
+
const handleKeyDown = (event, index) => {
|
|
1825
|
+
switch (event.key) {
|
|
1826
|
+
case "ArrowRight":
|
|
1827
|
+
case "ArrowDown": {
|
|
1828
|
+
event.preventDefault();
|
|
1829
|
+
const nextIndex = findEnabledIndex(index, 1);
|
|
1830
|
+
focusItem(nextIndex);
|
|
1831
|
+
selectIndex(nextIndex);
|
|
1832
|
+
break;
|
|
1833
|
+
}
|
|
1834
|
+
case "ArrowLeft":
|
|
1835
|
+
case "ArrowUp": {
|
|
1836
|
+
event.preventDefault();
|
|
1837
|
+
const nextIndex = findEnabledIndex(index, -1);
|
|
1838
|
+
focusItem(nextIndex);
|
|
1839
|
+
selectIndex(nextIndex);
|
|
1840
|
+
break;
|
|
1841
|
+
}
|
|
1842
|
+
case "Home":
|
|
1843
|
+
event.preventDefault();
|
|
1844
|
+
focusItem(fallbackIndex);
|
|
1845
|
+
if (fallbackIndex >= 0) selectIndex(fallbackIndex);
|
|
1846
|
+
break;
|
|
1847
|
+
case "End":
|
|
1848
|
+
event.preventDefault();
|
|
1849
|
+
if (lastEnabledIndex >= 0) {
|
|
1850
|
+
focusItem(lastEnabledIndex);
|
|
1851
|
+
selectIndex(lastEnabledIndex);
|
|
1852
|
+
}
|
|
1853
|
+
break;
|
|
1854
|
+
default: break;
|
|
1855
|
+
}
|
|
1856
|
+
};
|
|
1857
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1858
|
+
className: cx(segmented_toggle_module_default.track, className),
|
|
1859
|
+
role: "radiogroup",
|
|
1860
|
+
"aria-label": ariaLabel,
|
|
1861
|
+
"aria-labelledby": ariaLabelledBy,
|
|
1862
|
+
children: options.map((opt, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1863
|
+
ref: (node) => {
|
|
1864
|
+
itemRefs.current[index] = node;
|
|
1865
|
+
},
|
|
1866
|
+
type: "button",
|
|
1867
|
+
role: "radio",
|
|
1868
|
+
"aria-checked": opt.value === value,
|
|
1869
|
+
disabled: opt.disabled,
|
|
1870
|
+
tabIndex: opt.disabled ? -1 : index === tabbableIndex ? 0 : -1,
|
|
1871
|
+
onClick: () => {
|
|
1872
|
+
if (opt.value !== value) onChange(opt.value);
|
|
1873
|
+
},
|
|
1874
|
+
onKeyDown: (event) => handleKeyDown(event, index),
|
|
1875
|
+
className: cx(segmented_toggle_module_default.option),
|
|
1876
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1877
|
+
className: segmented_toggle_module_default.label,
|
|
1878
|
+
children: opt.label
|
|
1879
|
+
})
|
|
1880
|
+
}, opt.value))
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
//#endregion
|
|
1884
|
+
exports.Alert = Alert;
|
|
1885
|
+
exports.AppShell = AppShell;
|
|
1886
|
+
exports.Avatar = Avatar;
|
|
1887
|
+
exports.AvatarFallback = AvatarFallback;
|
|
1888
|
+
exports.AvatarImage = AvatarImage;
|
|
1889
|
+
exports.Button = Button;
|
|
1890
|
+
exports.Card = Card;
|
|
1891
|
+
exports.Checkbox = Checkbox;
|
|
1892
|
+
exports.Dropdown = Dropdown;
|
|
1893
|
+
exports.DropdownMenu = DropdownMenu;
|
|
1894
|
+
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
1895
|
+
exports.DropdownMenuContent = DropdownMenuContent;
|
|
1896
|
+
exports.DropdownMenuGroup = DropdownMenuGroup;
|
|
1897
|
+
exports.DropdownMenuItem = DropdownMenuItem;
|
|
1898
|
+
exports.DropdownMenuLabel = DropdownMenuLabel;
|
|
1899
|
+
exports.DropdownMenuPortal = DropdownMenuPortal;
|
|
1900
|
+
exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
|
|
1901
|
+
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
|
|
1902
|
+
exports.DropdownMenuSeparator = DropdownMenuSeparator;
|
|
1903
|
+
exports.DropdownMenuSub = DropdownMenuSub;
|
|
1904
|
+
exports.DropdownMenuSubContent = DropdownMenuSubContent;
|
|
1905
|
+
exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
|
|
1906
|
+
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
1907
|
+
exports.Input = Input;
|
|
1908
|
+
exports.Label = Label;
|
|
1909
|
+
exports.Modal = Modal;
|
|
1910
|
+
exports.ModalOverlay = ModalOverlay;
|
|
1911
|
+
exports.MultiSelect = MultiSelect;
|
|
1912
|
+
exports.Pill = Pill;
|
|
1913
|
+
exports.Progress = Progress;
|
|
1914
|
+
exports.SegmentedToggle = SegmentedToggle;
|
|
1915
|
+
exports.Select = Select;
|
|
1916
|
+
exports.SidebarNav = SidebarNav;
|
|
1917
|
+
exports.Skeleton = Skeleton;
|
|
1918
|
+
exports.ThemeProvider = ThemeProvider;
|
|
1919
|
+
exports.ThemeToggleButton = ThemeToggleButton;
|
|
1920
|
+
exports.ToastProvider = ToastProvider;
|
|
1921
|
+
exports.TopBar = TopBar;
|
|
1922
|
+
exports.cx = cx;
|
|
1923
|
+
exports.useTheme = useTheme;
|
|
1924
|
+
exports.useToast = useToast;
|
|
42
1925
|
|
|
43
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
|
-
|
|
45
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return u.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Or=`DialogDescriptionWarning`,kr=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Er(Or).contentName}}.`;return u.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Ar=tr,jr=sr,Mr=lr,Nr=pr,Pr=vr,Fr=br,Ir=Sr,V={portalLayer:`uzi-modal-module__portalLayer__t7blc`,backdrop:`uzi-modal-module__backdrop__IMd3b`,backdropFadeIn:`uzi-modal-module__backdropFadeIn__GNJdx`,backdropFadeOut:`uzi-modal-module__backdropFadeOut__R-3K5`,overlayContent:`uzi-modal-module__overlayContent__0DtbP`,modalContentIn:`uzi-modal-module__modalContentIn__fub8M`,modalContentOut:`uzi-modal-module__modalContentOut__elTJ3`,modal:`uzi-modal-module__modal__Mao59`,"size-sm":`uzi-modal-module__size-sm__Uu9je`,"size-md":`uzi-modal-module__size-md__TiiWy`,"size-lg":`uzi-modal-module__size-lg__BrTIO`,"size-xl":`uzi-modal-module__size-xl__sj0mh`,header:`uzi-modal-module__header__PmCaO`,titles:`uzi-modal-module__titles__IboyQ`,title:`uzi-modal-module__title__Zd7pL`,subtitle:`uzi-modal-module__subtitle__t-LRK`,closeButton:`uzi-modal-module__closeButton__GTiZr`,body:`uzi-modal-module__body__km6FQ`,footer:`uzi-modal-module__footer__jWLTv`};function Lr({open:e,onClose:t,className:n,children:r}){return(0,d.jsx)(Ar,{open:e,onOpenChange:e=>{e||t()},children:(0,d.jsx)(jr,{children:(0,d.jsxs)(`div`,{className:V.portalLayer,children:[(0,d.jsx)(Mr,{className:D(V.backdrop,n)}),(0,d.jsx)(Nr,{className:V.overlayContent,children:r})]})})})}function Rr({open:e,onClose:t,title:n,subtitle:r,size:i=`md`,children:a,footer:o}){return(0,d.jsx)(Lr,{open:e,onClose:t,children:(0,d.jsxs)(`div`,{className:D(V.modal,V[`size-${i}`]),children:[(0,d.jsxs)(`div`,{className:V.header,children:[(0,d.jsxs)(`div`,{className:V.titles,children:[(0,d.jsx)(Pr,{className:V.title,children:n}),r?(0,d.jsx)(Fr,{className:V.subtitle,children:r}):null]}),(0,d.jsx)(Ir,{asChild:!0,children:(0,d.jsx)(`button`,{className:V.closeButton,"aria-label":`Close`,children:(0,d.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,d.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})})]}),(0,d.jsx)(`div`,{className:V.body,children:a}),o&&(0,d.jsx)(`div`,{className:V.footer,children:o})]})})}var zr={alert:`uzi-alert-module__alert__7Bt6c`,success:`uzi-alert-module__success__apdFG`,error:`uzi-alert-module__error__KLgi1`,warning:`uzi-alert-module__warning__F4fpk`,info:`uzi-alert-module__info__1IKHt`};function Br({tone:e,children:t,className:n}){return(0,d.jsx)(`div`,{className:D(zr.alert,zr[e],n),role:`alert`,children:t})}function Vr(e){let t=e+`CollectionProvider`,[n,r]=ke(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=u.default.useRef(null),a=u.default.useRef(new Map).current;return(0,d.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Le(s),l=u.default.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,d.jsx)(c,{ref:h(t,a(s,n).collectionRef),children:r})});l.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=Le(f),g=u.default.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=u.default.useRef(null),s=h(t,o),c=a(f,n);return u.default.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,d.jsx)(m,{[p]:``,ref:s,children:r})});g.displayName=f;function _(t){let n=a(e+`CollectionConsumer`,t);return u.default.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:g},_,r]}var Hr=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ur=`VisuallyHidden`,Wr=u.forwardRef((e,t)=>(0,d.jsx)(z.span,{...e,ref:t,style:{...Hr,...e.style}}));Wr.displayName=Ur;var Gr=`ToastProvider`,[Kr,qr,Jr]=Vr(`Toast`),[Yr,Xr]=ke(`Toast`,[Jr]),[Zr,Qr]=Yr(Gr),$r=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=u.useState(null),[l,f]=u.useState(0),p=u.useRef(!1),m=u.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Gr}\`. Expected non-empty \`string\`.`),(0,d.jsx)(Kr.Provider,{scope:t,children:(0,d.jsx)(Zr,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:u.useCallback(()=>f(e=>e+1),[]),onToastRemove:u.useCallback(()=>f(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:o})})};$r.displayName=Gr;var ei=`ToastViewport`,ti=[`F8`],ni=`toast.viewportPause`,ri=`toast.viewportResume`,ii=u.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=ti,label:i=`Notifications ({hotkey})`,...a}=e,o=Qr(ei,n),s=qr(n),c=u.useRef(null),l=u.useRef(null),f=u.useRef(null),p=u.useRef(null),m=h(t,p,o.onViewportChange),g=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),_=o.toastCount>0;u.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&p.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),u.useEffect(()=>{let e=c.current,t=p.current;if(_&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(ni);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(ri);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[_,o.isClosePausedRef]);let v=u.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...ji(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return u.useEffect(()=>{let e=p.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=v({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Mi(i.slice(a+1))?t.preventDefault():r?l.current?.focus():f.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,v]),(0,d.jsxs)(at,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,g),tabIndex:-1,style:{pointerEvents:_?void 0:`none`},children:[_&&(0,d.jsx)(oi,{ref:l,onFocusFromOutsideViewport:()=>{Mi(v({tabbingDirection:`forwards`}))}}),(0,d.jsx)(Kr.Slot,{scope:n,children:(0,d.jsx)(z.ol,{tabIndex:-1,...a,ref:m})}),_&&(0,d.jsx)(oi,{ref:f,onFocusFromOutsideViewport:()=>{Mi(v({tabbingDirection:`backwards`}))}})]})});ii.displayName=ei;var ai=`ToastFocusProxy`,oi=u.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Qr(ai,n);return(0,d.jsx)(Wr,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});oi.displayName=ai;var si=`Toast`,ci=`toast.swipeStart`,li=`toast.swipeMove`,ui=`toast.swipeCancel`,di=`toast.swipeEnd`,fi=u.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Pe({prop:r,defaultProp:i??!0,onChange:a,caller:si});return(0,d.jsx)(Tt,{present:n||s,children:(0,d.jsx)(hi,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:P(e.onPause),onResume:P(e.onResume),onSwipeStart:L(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:L(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:L(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:L(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});fi.displayName=si;var[pi,mi]=Yr(si,{onClose(){}}),hi=u.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:p,onSwipeMove:m,onSwipeCancel:g,onSwipeEnd:_,...v}=e,y=Qr(si,n),[b,x]=u.useState(null),S=h(t,e=>x(e)),C=u.useRef(null),w=u.useRef(null),T=i||y.duration,E=u.useRef(0),D=u.useRef(T),O=u.useRef(0),{onToastAdd:k,onToastRemove:A}=y,j=P(()=>{b?.contains(document.activeElement)&&y.viewport?.focus(),o()}),M=u.useCallback(e=>{!e||e===1/0||(window.clearTimeout(O.current),E.current=new Date().getTime(),O.current=window.setTimeout(j,e))},[j]);u.useEffect(()=>{let e=y.viewport;if(e){let t=()=>{M(D.current),l?.()},n=()=>{let e=new Date().getTime()-E.current;D.current-=e,window.clearTimeout(O.current),c?.()};return e.addEventListener(ni,n),e.addEventListener(ri,t),()=>{e.removeEventListener(ni,n),e.removeEventListener(ri,t)}}},[y.viewport,T,c,l,M]),u.useEffect(()=>{a&&!y.isClosePausedRef.current&&M(T)},[a,T,y.isClosePausedRef,M]),u.useEffect(()=>(k(),()=>A()),[k,A]);let N=u.useMemo(()=>b?Ei(b):null,[b]);return y.viewport?(0,d.jsxs)(d.Fragment,{children:[N&&(0,d.jsx)(gi,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:N}),(0,d.jsx)(pi,{scope:n,onClose:j,children:f.createPortal((0,d.jsx)(Kr.ItemSlot,{scope:n,children:(0,d.jsx)(it,{asChild:!0,onEscapeKeyDown:L(s,()=>{y.isFocusedToastEscapeKeyDownRef.current||j(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,d.jsx)(z.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":y.swipeDirection,...v,ref:S,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:L(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:L(e.onPointerDown,e=>{e.button===0&&(C.current={x:e.clientX,y:e.clientY})}),onPointerMove:L(e.onPointerMove,e=>{if(!C.current)return;let t=e.clientX-C.current.x,n=e.clientY-C.current.y,r=!!w.current,i=[`left`,`right`].includes(y.swipeDirection),a=[`left`,`up`].includes(y.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},u={originalEvent:e,delta:l};r?(w.current=l,Di(li,m,u,{discrete:!1})):Oi(l,y.swipeDirection,c)?(w.current=l,Di(ci,p,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(C.current=null)}),onPointerUp:L(e.onPointerUp,e=>{let t=w.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),w.current=null,C.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Oi(t,y.swipeDirection,y.swipeThreshold)?Di(di,_,r,{discrete:!0}):Di(ui,g,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),gi=e=>{let{__scopeToast:t,children:n,...r}=e,i=Qr(si,t),[a,o]=u.useState(!1),[s,c]=u.useState(!1);return ki(()=>o(!0)),u.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,d.jsx)(Ct,{asChild:!0,children:(0,d.jsx)(Wr,{...r,children:a&&(0,d.jsxs)(d.Fragment,{children:[i.label,` `,n]})})})},_i=`ToastTitle`,vi=u.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,d.jsx)(z.div,{...r,ref:t})});vi.displayName=_i;var yi=`ToastDescription`,bi=u.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,d.jsx)(z.div,{...r,ref:t})});bi.displayName=yi;var xi=`ToastAction`,Si=u.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,d.jsx)(Ti,{altText:n,asChild:!0,children:(0,d.jsx)(wi,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${xi}\`. Expected non-empty \`string\`.`),null)});Si.displayName=xi;var Ci=`ToastClose`,wi=u.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=mi(Ci,n);return(0,d.jsx)(Ti,{asChild:!0,children:(0,d.jsx)(z.button,{type:`button`,...r,ref:t,onClick:L(e.onClick,i.onClose)})})});wi.displayName=Ci;var Ti=u.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,d.jsx)(z.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Ei(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Ai(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Ei(e))}}),t}function Di(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ue(i,a):i.dispatchEvent(a)}var Oi=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function ki(e=()=>{}){let t=P(e);F(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function Ai(e){return e.nodeType===e.ELEMENT_NODE}function ji(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;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 Mi(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var Ni=$r,Pi=ii,Fi=fi,Ii=bi,Li=Si,Ri=wi,H={stack:`uzi-toast-module__stack__SRrda`,topRight:`uzi-toast-module__topRight__WiZzM`,topLeft:`uzi-toast-module__topLeft__SzFS9`,topCenter:`uzi-toast-module__topCenter__X5W-x`,bottomRight:`uzi-toast-module__bottomRight__DMtoS`,bottomLeft:`uzi-toast-module__bottomLeft__ZZ7VF`,bottomCenter:`uzi-toast-module__bottomCenter__QNJrM`,toast:`uzi-toast-module__toast__HNUcj`,toastSlideIn:`uzi-toast-module__toastSlideIn__BTXfm`,toastSlideOut:`uzi-toast-module__toastSlideOut__mBX-G`,toastSwipeOut:`uzi-toast-module__toastSwipeOut__R-jk2`,icon:`uzi-toast-module__icon__LIAqr`,body:`uzi-toast-module__body__9vzs7`,message:`uzi-toast-module__message__TBY65`,actions:`uzi-toast-module__actions__Iykd9`,actionButton:`uzi-toast-module__actionButton__cvUr0`,controls:`uzi-toast-module__controls__LqA4Q`,iconButton:`uzi-toast-module__iconButton__FOsOp`,iconButtonError:`uzi-toast-module__iconButtonError__NJsLX`},zi={position:`top-right`,maxToasts:5,defaultDuration:4e3,pauseOnHover:!0,pauseOnFocusLoss:!0},Bi=(0,u.createContext)(void 0),Vi=0,Hi=()=>`toast-${++Vi}-${Date.now()}`;function Ui({children:e,config:t}){let[n,r]=(0,u.useState)([]),[i,a]=(0,u.useState)(!1),o=(0,u.useMemo)(()=>({...zi,...t}),[t]),s=(0,u.useCallback)((e,t={})=>{let n=Hi();return r(r=>{let i=[...r,{id:n,message:e,type:t.type??`info`,duration:t.duration??(t.type===`error`?6e3:o.defaultDuration),dismissible:t.dismissible??!0,copyable:t.copyable??!1,action:t.action}];return i.length>o.maxToasts&&i.shift(),i}),n},[o.defaultDuration,o.maxToasts]),c=(0,u.useCallback)((e,t)=>s(e,{...t,type:`success`}),[s]),l=(0,u.useCallback)((e,t)=>s(e,{copyable:!0,...t,type:`error`}),[s]),f=(0,u.useCallback)((e,t)=>s(e,{...t,type:`warning`}),[s]),p=(0,u.useCallback)((e,t)=>s(e,{...t,type:`info`}),[s]),m=(0,u.useCallback)(e=>{r(t=>t.filter(t=>t.id!==e))},[]),h=(0,u.useCallback)(()=>r([]),[]);(0,u.useEffect)(()=>{if(!o.pauseOnFocusLoss)return;let e=()=>a(document.visibilityState!==`visible`);return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[o.pauseOnFocusLoss]);let g=(0,u.useMemo)(()=>({toasts:n,push:s,success:c,error:l,warning:f,info:p,dismiss:m,dismissAll:h}),[n,s,c,l,f,p,m,h]);return(0,d.jsx)(Bi.Provider,{value:g,children:(0,d.jsxs)(Ni,{swipeDirection:`right`,children:[e,(0,d.jsx)(Gi,{toasts:n,position:o.position,pauseOnHover:o.pauseOnHover,isPaused:i,onDismiss:m,onPauseChange:a})]})})}function Wi(){let e=(0,u.useContext)(Bi);if(!e)throw Error(`useToast must be used within a ToastProvider`);return e}function Gi({toasts:e,position:t,pauseOnHover:n,isPaused:r,onDismiss:i,onPauseChange:a}){let o=(()=>{switch(t){case`top-left`:return`topLeft`;case`top-center`:return`topCenter`;case`bottom-right`:return`bottomRight`;case`bottom-left`:return`bottomLeft`;case`bottom-center`:return`bottomCenter`;default:return`topRight`}})();return(0,d.jsxs)(d.Fragment,{children:[e.map(e=>(0,d.jsx)(Ki,{toast:e,isPaused:r,onDismiss:i},e.id)),(0,d.jsx)(Pi,{className:D(H.stack,H[o]),label:`Notifications`,onMouseEnter:()=>n&&a(!0),onMouseLeave:()=>n&&a(!1)})]})}function Ki({toast:e,isPaused:t,onDismiss:n}){let[r,i]=(0,u.useState)(!0),[a,o]=(0,u.useState)(`idle`),s=(0,u.useRef)(null),c=(0,u.useRef)(null),l=(0,u.useRef)(0),f=(0,u.useRef)(e.duration??0),p=(0,u.useRef)(!1),m=qi(e.type),h={"--toast-bg":m.background,"--toast-border":m.border,"--toast-accent":m.accent,"--toast-text":m.text,"--toast-action-bg":m.actionBg,"--toast-action-border":m.actionBorder},g=()=>{c.current&&=(window.clearTimeout(c.current),null)},_=(0,u.useCallback)(()=>{p.current||(p.current=!0,i(!1),g(),window.setTimeout(()=>n(e.id),160))},[n,e.id]),v=(0,u.useCallback)(e=>{if(!e||e<=0){_();return}l.current=performance.now(),g(),c.current=window.setTimeout(()=>_(),e)},[_]);(0,u.useEffect)(()=>{if(!(!e.duration||e.duration<=0))return v(e.duration),g},[v,e.duration]),(0,u.useEffect)(()=>{if(!(!e.duration||e.duration<=0))if(t){let e=performance.now()-l.current;f.current=Math.max(0,f.current-e),g()}else v(f.current)},[t,v,e.duration]),(0,u.useEffect)(()=>()=>{s.current&&window.clearTimeout(s.current)},[]);let y=(0,u.useCallback)(async()=>{s.current&&window.clearTimeout(s.current);try{if(!navigator.clipboard)throw Error(`Clipboard API unavailable`);await navigator.clipboard.writeText(e.message),o(`copied`)}catch{o(`failed`)}s.current=window.setTimeout(()=>o(`idle`),1800)},[e.message]),b=Ji(e.type);return(0,d.jsxs)(Fi,{open:r,onOpenChange:e=>{e||_()},duration:2147483647,className:H.toast,style:h,children:[(0,d.jsx)(`span`,{className:H.icon,"aria-hidden":!0,children:b}),(0,d.jsxs)(`div`,{className:H.body,children:[(0,d.jsx)(Ii,{className:H.message,children:e.message}),e.action&&(0,d.jsx)(`div`,{className:H.actions,children:(0,d.jsx)(Li,{asChild:!0,altText:e.action.label,children:(0,d.jsx)(`button`,{type:`button`,className:H.actionButton,onClick:()=>{e.action?.onClick(),_()},children:e.action.label})})})]}),(0,d.jsxs)(`div`,{className:H.controls,children:[e.copyable&&(0,d.jsx)(`button`,{type:`button`,className:D(H.iconButton,a===`failed`&&H.iconButtonError),"aria-label":`Copy message`,onClick:y,children:a===`copied`?(0,d.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 13 13`,fill:`none`,"aria-hidden":!0,children:(0,d.jsx)(`path`,{d:`M2 6.5l3 3 6-6`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}):a===`failed`?(0,d.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 13 13`,fill:`none`,"aria-hidden":!0,children:(0,d.jsx)(`path`,{d:`M10 3L3 10M3 3l7 7`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})}):(0,d.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 13 13`,fill:`none`,"aria-hidden":!0,children:[(0,d.jsx)(`rect`,{x:`4.5`,y:`1.5`,width:`7`,height:`7`,rx:`1.5`,stroke:`currentColor`,strokeWidth:`1.25`}),(0,d.jsx)(`path`,{d:`M1.5 5.5v5a1.5 1.5 0 001.5 1.5h5`,stroke:`currentColor`,strokeWidth:`1.25`,strokeLinecap:`round`})]})}),e.dismissible!==!1&&(0,d.jsx)(Ri,{asChild:!0,children:(0,d.jsx)(`button`,{type:`button`,className:H.iconButton,"aria-label":`Dismiss notification`,children:(0,d.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 13 13`,fill:`none`,"aria-hidden":!0,children:(0,d.jsx)(`path`,{d:`M10 3L3 10M3 3l7 7`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})})})]})]})}function qi(e){switch(e){case`success`:return{background:`color-mix(in srgb, var(--success) 12%, var(--popover))`,border:`color-mix(in srgb, var(--success) 30%, transparent)`,accent:`var(--success)`,text:`var(--popover-foreground)`,actionBg:`color-mix(in srgb, var(--success) 14%, transparent)`,actionBorder:`color-mix(in srgb, var(--success) 35%, transparent)`};case`error`:return{background:`color-mix(in srgb, var(--destructive) 12%, var(--popover))`,border:`color-mix(in srgb, var(--destructive) 30%, transparent)`,accent:`var(--destructive)`,text:`var(--popover-foreground)`,actionBg:`color-mix(in srgb, var(--destructive) 14%, transparent)`,actionBorder:`color-mix(in srgb, var(--destructive) 35%, transparent)`};case`warning`:return{background:`color-mix(in srgb, var(--warning) 12%, var(--popover))`,border:`color-mix(in srgb, var(--warning) 30%, transparent)`,accent:`var(--warning)`,text:`var(--popover-foreground)`,actionBg:`color-mix(in srgb, var(--warning) 14%, transparent)`,actionBorder:`color-mix(in srgb, var(--warning) 35%, transparent)`};default:return{background:`color-mix(in srgb, var(--primary) 12%, var(--popover))`,border:`color-mix(in srgb, var(--primary) 30%, transparent)`,accent:`var(--primary)`,text:`var(--popover-foreground)`,actionBg:`color-mix(in srgb, var(--primary) 14%, transparent)`,actionBorder:`color-mix(in srgb, var(--primary) 35%, transparent)`}}}function Ji(e){switch(e){case`success`:return(0,d.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,d.jsx)(`path`,{d:`M3 8l3.5 3.5L13 4.5`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`})});case`error`:return(0,d.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,d.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`})});case`warning`:return(0,d.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,d.jsx)(`path`,{d:`M8 3v6M8 11.5v1`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`})});default:return(0,d.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":!0,children:(0,d.jsx)(`path`,{d:`M8 7v5M8 4.5v.5`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`})})}}var Yi={input:`uzi-input-module__input__-ipHD`},Xi=u.forwardRef(({className:e,type:t,...n},r)=>(0,d.jsx)(`input`,{ref:r,type:t,className:D(Yi.input,e),...n}));Xi.displayName=`Input`;var Zi={label:`uzi-label-module__label__gKflt`},Qi=u.forwardRef(({className:e,...t},n)=>(0,d.jsx)(`label`,{ref:n,className:D(Zi.label,e),...t}));Qi.displayName=`Label`;var $i={checkbox:`uzi-checkbox-module__checkbox__zAB1y`},ea=u.forwardRef(({className:e,...t},n)=>(0,d.jsx)(`input`,{ref:n,type:`checkbox`,className:D($i.checkbox,e),...t}));ea.displayName=`Checkbox`;var ta=u.createContext(void 0);function na(e){let t=u.useContext(ta);return e||t||`ltr`}var ra=[`top`,`right`,`bottom`,`left`],ia=Math.min,U=Math.max,aa=Math.round,oa=Math.floor,sa=e=>({x:e,y:e}),ca={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function la(e,t,n){return U(e,ia(t,n))}function ua(e,t){return typeof e==`function`?e(t):e}function da(e){return e.split(`-`)[0]}function fa(e){return e.split(`-`)[1]}function pa(e){return e===`x`?`y`:`x`}function ma(e){return e===`y`?`height`:`width`}function ha(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ga(e){return pa(ha(e))}function _a(e,t,n){n===void 0&&(n=!1);let r=fa(e),i=ga(e),a=ma(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ea(o)),[o,Ea(o)]}function va(e){let t=Ea(e);return[ya(e),t,ya(t)]}function ya(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ba=[`left`,`right`],xa=[`right`,`left`],Sa=[`top`,`bottom`],Ca=[`bottom`,`top`];function wa(e,t,n){switch(e){case`top`:case`bottom`:return n?t?xa:ba:t?ba:xa;case`left`:case`right`:return t?Sa:Ca;default:return[]}}function Ta(e,t,n,r){let i=fa(e),a=wa(da(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ya)))),a}function Ea(e){let t=da(e);return ca[t]+e.slice(t.length)}function Da(e){return{top:0,right:0,bottom:0,left:0,...e}}function Oa(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Da(e)}function ka(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Aa(e,t,n){let{reference:r,floating:i}=e,a=ha(t),o=ga(t),s=ma(o),c=da(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(fa(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function ja(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ua(t,e),p=Oa(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ka(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ka(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ma=50,Na=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ja},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Aa(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ma&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Aa(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Pa=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ua(e,t)||{};if(l==null)return{};let d=Oa(u),f={x:n,y:r},p=ga(i),m=ma(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=ia(d[_],T),D=ia(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=la(O,A,k),M=!c.arrow&&fa(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Fa=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ua(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=da(r),_=ha(o),v=da(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ea(o)]:va(o)),x=p!==`none`;!d&&x&&b.push(...Ta(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=_a(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==ha(t))||T.every(e=>ha(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ha(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ia(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function La(e){return ra.some(t=>e[t]>=0)}var Ra=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ua(e,t);switch(i){case`referenceHidden`:{let e=Ia(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:La(e)}}}case`escaped`:{let e=Ia(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:La(e)}}}default:return{}}}}},za=new Set([`left`,`top`]);async function Ba(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=da(n),s=fa(n),c=ha(n)===`y`,l=za.has(o)?-1:1,u=a&&c?-1:1,d=ua(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Va=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ba(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ha=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ua(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ha(da(i)),p=pa(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=la(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=la(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ua=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ua(e,t),u={x:n,y:r},d=ha(i),f=pa(d),p=u[f],m=u[d],h=ua(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=za.has(da(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Wa=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ua(e,t),u=await o.detectOverflow(t,l),d=da(i),f=fa(i),p=ha(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=ia(h-u[g],v),x=ia(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=U(u.left,0),t=U(u.right,0),n=U(u.top,0),r=U(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:U(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:U(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Ga(){return typeof window<`u`}function Ka(e){return Ja(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qa(e){return((Ja(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ja(e){return Ga()?e instanceof Node||e instanceof W(e).Node:!1}function G(e){return Ga()?e instanceof Element||e instanceof W(e).Element:!1}function Ya(e){return Ga()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function Xa(e){return!Ga()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function Za(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=K(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Qa(e){return/^(table|td|th)$/.test(Ka(e))}function $a(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var eo=/transform|translate|scale|rotate|perspective|filter/,to=/paint|layout|strict|content/,no=e=>!!e&&e!==`none`,ro;function io(e){let t=G(e)?K(e):e;return no(t.transform)||no(t.translate)||no(t.scale)||no(t.rotate)||no(t.perspective)||!oo()&&(no(t.backdropFilter)||no(t.filter))||eo.test(t.willChange||``)||to.test(t.contain||``)}function ao(e){let t=lo(e);for(;Ya(t)&&!so(t);){if(io(t))return t;if($a(t))return null;t=lo(t)}return null}function oo(){return ro??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ro}function so(e){return/^(html|body|#document)$/.test(Ka(e))}function K(e){return W(e).getComputedStyle(e)}function co(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lo(e){if(Ka(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Xa(e)&&e.host||qa(e);return Xa(t)?t.host:t}function uo(e){let t=lo(e);return so(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ya(t)&&Za(t)?t:uo(t)}function fo(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=uo(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=po(a);return t.concat(a,a.visualViewport||[],Za(r)?r:[],e&&n?fo(e):[])}else return t.concat(r,fo(r,[],n))}function po(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mo(e){let t=K(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ya(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=aa(n)!==a||aa(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ho(e){return G(e)?e:e.contextElement}function go(e){let t=ho(e);if(!Ya(t))return sa(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=mo(t),o=(a?aa(n.width):n.width)/r,s=(a?aa(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var _o=sa(0);function vo(e){let t=W(e);return!oo()||!t.visualViewport?_o:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yo(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==W(e)?!1:t}function bo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ho(e),o=sa(1);t&&(r?G(r)&&(o=go(r)):o=go(e));let s=yo(a,n,r)?vo(a):sa(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=W(a),t=r&&G(r)?W(r):r,n=e,i=po(n);for(;i&&r&&t!==n;){let e=go(i),t=i.getBoundingClientRect(),r=K(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=W(i),i=po(n)}}return ka({width:u,height:d,x:c,y:l})}function xo(e,t){let n=co(e).scrollLeft;return t?t.left+n:bo(qa(e)).left+n}function So(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xo(e,n),y:n.top+t.scrollTop}}function Co(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=qa(r),s=t?$a(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=sa(1),u=sa(0),d=Ya(r);if((d||!d&&!a)&&((Ka(r)!==`body`||Za(o))&&(c=co(r)),d)){let e=bo(r);l=go(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?So(o,c):sa(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function wo(e){return Array.from(e.getClientRects())}function To(e){let t=qa(e),n=co(e),r=e.ownerDocument.body,i=U(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=U(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+xo(e),s=-n.scrollTop;return K(r).direction===`rtl`&&(o+=U(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Eo=25;function Do(e,t){let n=W(e),r=qa(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=oo();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=xo(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Eo&&(a-=o)}else l<=Eo&&(a+=l);return{width:a,height:o,x:s,y:c}}function Oo(e,t){let n=bo(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ya(e)?go(e):sa(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ko(e,t,n){let r;if(t===`viewport`)r=Do(e,n);else if(t===`document`)r=To(qa(e));else if(G(t))r=Oo(t,n);else{let n=vo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ka(r)}function Ao(e,t){let n=lo(e);return n===t||!G(n)||so(n)?!1:K(n).position===`fixed`||Ao(n,t)}function jo(e,t){let n=t.get(e);if(n)return n;let r=fo(e,[],!1).filter(e=>G(e)&&Ka(e)!==`body`),i=null,a=K(e).position===`fixed`,o=a?lo(e):e;for(;G(o)&&!so(o);){let t=K(o),n=io(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Za(o)&&!n&&Ao(e,o))?r=r.filter(e=>e!==o):i=t,o=lo(o)}return t.set(e,r),r}function Mo(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?$a(t)?[]:jo(t,this._c):[].concat(n),r],o=ko(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ko(t,a[e],i);s=U(n.top,s),c=ia(n.right,c),l=ia(n.bottom,l),u=U(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function No(e){let{width:t,height:n}=mo(e);return{width:t,height:n}}function Po(e,t,n){let r=Ya(t),i=qa(t),a=n===`fixed`,o=bo(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=sa(0);function l(){c.x=xo(i)}if(r||!r&&!a)if((Ka(t)!==`body`||Za(i))&&(s=co(t)),r){let e=bo(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?So(i,s):sa(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Fo(e){return K(e).position===`static`}function Io(e,t){if(!Ya(e)||K(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return qa(e)===n&&(n=n.ownerDocument.body),n}function Lo(e,t){let n=W(e);if($a(e))return n;if(!Ya(e)){let t=lo(e);for(;t&&!so(t);){if(G(t)&&!Fo(t))return t;t=lo(t)}return n}let r=Io(e,t);for(;r&&Qa(r)&&Fo(r);)r=Io(r,t);return r&&so(r)&&Fo(r)&&!io(r)?n:r||ao(e)||n}var Ro=async function(e){let t=this.getOffsetParent||Lo,n=this.getDimensions,r=await n(e.floating);return{reference:Po(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zo(e){return K(e).direction===`rtl`}var Bo={convertOffsetParentRelativeRectToViewportRelativeRect:Co,getDocumentElement:qa,getClippingRect:Mo,getOffsetParent:Lo,getElementRects:Ro,getClientRects:wo,getDimensions:No,getScale:go,isElement:G,isRTL:zo};function Vo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ho(e,t){let n=null,r,i=qa(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=oa(d),h=oa(i.clientWidth-(u+f)),g=oa(i.clientHeight-(d+p)),_=oa(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:U(0,ia(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Vo(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Uo(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ho(e),u=i||a?[...l?fo(l):[],...t?fo(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ho(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?bo(e):null;c&&g();function g(){let t=bo(e);h&&!Vo(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Wo=Va,Go=Ha,Ko=Fa,qo=Wa,Jo=Ra,Yo=Pa,Xo=Ua,Zo=(e,t,n)=>{let r=new Map,i={platform:Bo,...n},a={...i.platform,_c:r};return Na(e,t,{...i,platform:a})},Qo=typeof document<`u`?u.useLayoutEffect:function(){};function $o(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!$o(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!$o(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function es(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ts(e,t){let n=es(e);return Math.round(t*n)/n}function ns(e){let t=u.useRef(e);return Qo(()=>{t.current=e}),t}function rs(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,p]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=u.useState(r);$o(m,r)||h(r);let[g,_]=u.useState(null),[v,y]=u.useState(null),b=u.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=u.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=u.useRef(null),T=u.useRef(null),E=u.useRef(d),D=c!=null,O=ns(c),k=ns(i),A=ns(l),j=u.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),Zo(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!$o(E.current,t)&&(E.current=t,f.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);Qo(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[l]);let M=u.useRef(!1);Qo(()=>(M.current=!0,()=>{M.current=!1}),[]),Qo(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=u.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=u.useMemo(()=>({reference:S,floating:C}),[S,C]),F=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=ts(P.floating,d.x),r=ts(P.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...es(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:F}),[d,j,N,P,F])}var is=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Yo({element:r.current,padding:i}).fn(n):r?Yo({element:r,padding:i}).fn(n):{}}}},as=(e,t)=>{let n=Wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},os=(e,t)=>{let n=Go(e);return{name:n.name,fn:n.fn,options:[e,t]}},ss=(e,t)=>({fn:Xo(e).fn,options:[e,t]}),cs=(e,t)=>{let n=Ko(e);return{name:n.name,fn:n.fn,options:[e,t]}},ls=(e,t)=>{let n=qo(e);return{name:n.name,fn:n.fn,options:[e,t]}},us=(e,t)=>{let n=Jo(e);return{name:n.name,fn:n.fn,options:[e,t]}},ds=(e,t)=>{let n=is(e);return{name:n.name,fn:n.fn,options:[e,t]}},fs=`Arrow`,ps=u.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,d.jsx)(z.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,d.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});ps.displayName=fs;var ms=ps;function hs(e){let[t,n]=u.useState(void 0);return F(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var gs=`Popper`,[_s,vs]=ke(gs),[ys,bs]=_s(gs),xs=e=>{let{__scopePopper:t,children:n}=e,[r,i]=u.useState(null);return(0,d.jsx)(ys,{scope:t,anchor:r,onAnchorChange:i,children:n})};xs.displayName=gs;var Ss=`PopperAnchor`,Cs=u.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=bs(Ss,n),o=u.useRef(null),s=h(t,o),c=u.useRef(null);return u.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,d.jsx)(z.div,{...i,ref:s})});Cs.displayName=Ss;var ws=`PopperContent`,[Ts,Es]=_s(ws),Ds=u.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=bs(ws,n),[b,x]=u.useState(null),S=h(t,e=>x(e)),[C,w]=u.useState(null),T=hs(C),E=T?.width??0,D=T?.height??0,O=r+(a===`center`?``:`-`+a),k=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(l)?l:[l],j=A.length>0,M={padding:k,boundary:A.filter(js),altBoundary:j},{refs:N,floatingStyles:ee,placement:I,isPositioned:te,middlewareData:ne}=rs({strategy:`fixed`,placement:O,whileElementsMounted:(...e)=>Uo(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[as({mainAxis:i+D,alignmentAxis:o}),c&&os({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?ss():void 0,...M}),c&&cs({...M}),ls({...M,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),C&&ds({element:C,padding:s}),Ms({arrowWidth:E,arrowHeight:D}),m&&us({strategy:`referenceHidden`,...M})]}),[re,ie]=Ns(I),ae=P(_);F(()=>{te&&ae?.()},[te,ae]);let oe=ne.arrow?.x,se=ne.arrow?.y,ce=ne.arrow?.centerOffset!==0,[le,ue]=u.useState();return F(()=>{b&&ue(window.getComputedStyle(b).zIndex)},[b]),(0,d.jsx)(`div`,{ref:N.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:te?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[ne.transformOrigin?.x,ne.transformOrigin?.y].join(` `),...ne.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,d.jsx)(Ts,{scope:n,placedSide:re,onArrowChange:w,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,d.jsx)(z.div,{"data-side":re,"data-align":ie,...v,ref:S,style:{...v.style,animation:te?void 0:`none`}})})})});Ds.displayName=ws;var Os=`PopperArrow`,ks={top:`bottom`,right:`left`,bottom:`top`,left:`right`},As=u.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Es(Os,n),a=ks[i.placedSide];return(0,d.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,d.jsx)(ms,{...r,ref:t,style:{...r.style,display:`block`}})})});As.displayName=Os;function js(e){return e!==null}var Ms=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Ns(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Ns(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ps=xs,Fs=Cs,Is=Ds,Ls=As,Rs=`rovingFocusGroup.onEntryFocus`,zs={bubbles:!1,cancelable:!0},Bs=`RovingFocusGroup`,[Vs,Hs,Us]=Vr(Bs),[Ws,Gs]=ke(Bs,[Us]),[Ks,qs]=Ws(Bs),Js=u.forwardRef((e,t)=>(0,d.jsx)(Vs.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(Vs.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(Ys,{...e,ref:t})})}));Js.displayName=Bs;var Ys=u.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...p}=e,m=u.useRef(null),g=h(t,m),_=na(a),[v,y]=Pe({prop:o,defaultProp:s??null,onChange:c,caller:Bs}),[b,x]=u.useState(!1),S=P(l),C=Hs(n),w=u.useRef(!1),[T,E]=u.useState(0);return u.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Rs,S),()=>e.removeEventListener(Rs,S)},[S]),(0,d.jsx)(Ks,{scope:n,orientation:r,dir:_,loop:i,currentTabStopId:v,onItemFocus:u.useCallback(e=>y(e),[y]),onItemShiftTab:u.useCallback(()=>x(!0),[]),onFocusableItemAdd:u.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:u.useCallback(()=>E(e=>e-1),[]),children:(0,d.jsx)(z.div,{tabIndex:b||T===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:`none`,...e.style},onMouseDown:L(e.onMouseDown,()=>{w.current=!0}),onFocus:L(e.onFocus,e=>{let t=!w.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(Rs,zs);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=C().filter(e=>e.focusable);tc([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),f)}}w.current=!1}),onBlur:L(e.onBlur,()=>x(!1))})})}),Xs=`RovingFocusGroupItem`,Zs=u.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=R(),l=a||c,f=qs(Xs,n),p=f.currentTabStopId===l,m=Hs(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f;return u.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),(0,d.jsx)(Vs.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,d.jsx)(z.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:L(e.onMouseDown,e=>{r?f.onItemFocus(l):e.preventDefault()}),onFocus:L(e.onFocus,()=>f.onItemFocus(l)),onKeyDown:L(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ec(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?nc(n,r+1):n.slice(r+1)}setTimeout(()=>tc(n))}}),children:typeof o==`function`?o({isCurrentTabStop:p,hasTabStop:_!=null}):o})})});Zs.displayName=Xs;var Qs={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function $s(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ec(e,t,n){let r=$s(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Qs[r]}function tc(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function nc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rc=Js,ic=Zs,ac=[`Enter`,` `],oc=[`ArrowDown`,`PageUp`,`Home`],sc=[`ArrowUp`,`PageDown`,`End`],cc=[...oc,...sc],lc={ltr:[...ac,`ArrowRight`],rtl:[...ac,`ArrowLeft`]},uc={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},dc=`Menu`,[fc,pc,mc]=Vr(dc),[hc,gc]=ke(dc,[mc,vs,Gs]),_c=vs(),vc=Gs(),[yc,bc]=hc(dc),[xc,Sc]=hc(dc),Cc=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=_c(t),[c,l]=u.useState(null),f=u.useRef(!1),p=P(a),m=na(i);return u.useEffect(()=>{let e=()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,d.jsx)(Ps,{...s,children:(0,d.jsx)(yc,{scope:t,open:n,onOpenChange:p,content:c,onContentChange:l,children:(0,d.jsx)(xc,{scope:t,onClose:u.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:o,children:r})})})};Cc.displayName=dc;var wc=`MenuAnchor`,Tc=u.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=_c(n);return(0,d.jsx)(Fs,{...i,...r,ref:t})});Tc.displayName=wc;var Ec=`MenuPortal`,[Dc,Oc]=hc(Ec,{forceMount:void 0}),kc=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=bc(Ec,t);return(0,d.jsx)(Dc,{scope:t,forceMount:n,children:(0,d.jsx)(Tt,{present:n||a.open,children:(0,d.jsx)(Ct,{asChild:!0,container:i,children:r})})})};kc.displayName=Ec;var q=`MenuContent`,[Ac,jc]=hc(q),Mc=u.forwardRef((e,t)=>{let n=Oc(q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=bc(q,e.__scopeMenu),o=Sc(q,e.__scopeMenu);return(0,d.jsx)(fc.Provider,{scope:e.__scopeMenu,children:(0,d.jsx)(Tt,{present:r||a.open,children:(0,d.jsx)(fc.Slot,{scope:e.__scopeMenu,children:o.modal?(0,d.jsx)(Nc,{...i,ref:t}):(0,d.jsx)(Pc,{...i,ref:t})})})})}),Nc=u.forwardRef((e,t)=>{let n=bc(q,e.__scopeMenu),r=u.useRef(null),i=h(t,r);return u.useEffect(()=>{let e=r.current;if(e)return Xn(e)},[]),(0,d.jsx)(Ic,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:L(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Pc=u.forwardRef((e,t)=>{let n=bc(q,e.__scopeMenu);return(0,d.jsx)(Ic,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Fc=Le(`MenuContent.ScrollLock`),Ic=u.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:g,disableOutsideScroll:_,...v}=e,y=bc(q,n),b=Sc(q,n),x=_c(n),S=vc(n),C=pc(n),[w,T]=u.useState(null),E=u.useRef(null),D=h(t,E,y.onContentChange),O=u.useRef(0),k=u.useRef(``),A=u.useRef(0),j=u.useRef(null),M=u.useRef(`right`),N=u.useRef(0),P=_?Vn:u.Fragment,F=_?{as:Fc,allowPinchZoom:!0}:void 0,ee=e=>{let t=k.current+e,n=C().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=bl(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){k.current=t,window.clearTimeout(O.current),t!==``&&(O.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};u.useEffect(()=>()=>window.clearTimeout(O.current),[]),At();let I=u.useCallback(e=>M.current===j.current?.side&&Sl(e,j.current?.area),[]);return(0,d.jsx)(Ac,{scope:n,searchRef:k,onItemEnter:u.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:u.useCallback(e=>{I(e)||(E.current?.focus(),T(null))},[I]),onTriggerLeave:u.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:A,onPointerGraceIntentChange:u.useCallback(e=>{j.current=e},[]),children:(0,d.jsx)(P,{...F,children:(0,d.jsx)(ut,{asChild:!0,trapped:i,onMountAutoFocus:L(a,e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,d.jsx)(Ze,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:g,children:(0,d.jsx)(rc,{asChild:!0,...S,dir:b.dir,orientation:`vertical`,loop:r,currentTabStopId:w,onCurrentTabStopIdChange:T,onEntryFocus:L(c,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,d.jsx)(Is,{role:`menu`,"aria-orientation":`vertical`,"data-state":hl(y.open),"data-radix-menu-content":``,dir:b.dir,...x,...v,ref:D,style:{outline:`none`,...v.style},onKeyDown:L(v.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ee(e.key));let i=E.current;if(e.target!==i||!cc.includes(e.key))return;e.preventDefault();let a=C().filter(e=>!e.disabled).map(e=>e.ref.current);sc.includes(e.key)&&a.reverse(),vl(a)}),onBlur:L(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),k.current=``)}),onPointerMove:L(e.onPointerMove,Cl(e=>{let t=e.target,n=N.current!==e.clientX;e.currentTarget.contains(t)&&n&&(M.current=e.clientX>N.current?`right`:`left`,N.current=e.clientX)}))})})})})})})});Mc.displayName=q;var Lc=`MenuGroup`,Rc=u.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,d.jsx)(z.div,{role:`group`,...r,ref:t})});Rc.displayName=Lc;var zc=`MenuLabel`,Bc=u.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,d.jsx)(z.div,{...r,ref:t})});Bc.displayName=zc;var Vc=`MenuItem`,Hc=`menu.itemSelect`,Uc=u.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=u.useRef(null),o=Sc(Vc,e.__scopeMenu),s=jc(Vc,e.__scopeMenu),c=h(t,a),l=u.useRef(!1),f=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Hc,{bubbles:!0,cancelable:!0});e.addEventListener(Hc,e=>r?.(e),{once:!0}),Ue(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,d.jsx)(Wc,{...i,ref:c,disabled:n,onClick:L(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:L(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:L(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||ac.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Uc.displayName=Vc;var Wc=u.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=jc(Vc,n),s=vc(n),c=u.useRef(null),l=h(t,c),[f,p]=u.useState(!1),[m,g]=u.useState(``);return u.useEffect(()=>{let e=c.current;e&&g((e.textContent??``).trim())},[a.children]),(0,d.jsx)(fc.ItemSlot,{scope:n,disabled:r,textValue:i??m,children:(0,d.jsx)(ic,{asChild:!0,...s,focusable:!r,children:(0,d.jsx)(z.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:L(e.onPointerMove,Cl(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:L(e.onPointerLeave,Cl(e=>o.onItemLeave(e))),onFocus:L(e.onFocus,()=>p(!0)),onBlur:L(e.onBlur,()=>p(!1))})})})}),Gc=`MenuCheckboxItem`,Kc=u.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,d.jsx)(el,{scope:e.__scopeMenu,checked:n,children:(0,d.jsx)(Uc,{role:`menuitemcheckbox`,"aria-checked":gl(n)?`mixed`:n,...i,ref:t,"data-state":_l(n),onSelect:L(i.onSelect,()=>r?.(gl(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Kc.displayName=Gc;var qc=`MenuRadioGroup`,[Jc,Yc]=hc(qc,{value:void 0,onValueChange:()=>{}}),Xc=u.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=P(r);return(0,d.jsx)(Jc,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,d.jsx)(Rc,{...i,ref:t})})});Xc.displayName=qc;var Zc=`MenuRadioItem`,Qc=u.forwardRef((e,t)=>{let{value:n,...r}=e,i=Yc(Zc,e.__scopeMenu),a=n===i.value;return(0,d.jsx)(el,{scope:e.__scopeMenu,checked:a,children:(0,d.jsx)(Uc,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":_l(a),onSelect:L(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Qc.displayName=Zc;var $c=`MenuItemIndicator`,[el,tl]=hc($c,{checked:!1}),nl=u.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=tl($c,n);return(0,d.jsx)(Tt,{present:r||gl(a.checked)||a.checked===!0,children:(0,d.jsx)(z.span,{...i,ref:t,"data-state":_l(a.checked)})})});nl.displayName=$c;var rl=`MenuSeparator`,il=u.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,d.jsx)(z.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});il.displayName=rl;var al=`MenuArrow`,ol=u.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=_c(n);return(0,d.jsx)(Ls,{...i,...r,ref:t})});ol.displayName=al;var sl=`MenuSub`,[cl,ll]=hc(sl),ul=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=bc(sl,t),o=_c(t),[s,c]=u.useState(null),[l,f]=u.useState(null),p=P(i);return u.useEffect(()=>(a.open===!1&&p(!1),()=>p(!1)),[a.open,p]),(0,d.jsx)(Ps,{...o,children:(0,d.jsx)(yc,{scope:t,open:r,onOpenChange:p,content:l,onContentChange:f,children:(0,d.jsx)(cl,{scope:t,contentId:R(),triggerId:R(),trigger:s,onTriggerChange:c,children:n})})})};ul.displayName=sl;var dl=`MenuSubTrigger`,fl=u.forwardRef((e,t)=>{let n=bc(dl,e.__scopeMenu),r=Sc(dl,e.__scopeMenu),i=ll(dl,e.__scopeMenu),a=jc(dl,e.__scopeMenu),o=u.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},f=u.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return u.useEffect(()=>f,[f]),u.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,d.jsx)(Tc,{asChild:!0,...l,children:(0,d.jsx)(Wc,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":hl(n.open),...e,ref:m(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:L(e.onPointerMove,Cl(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:L(e.onPointerLeave,Cl(e=>{f();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:L(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||lc[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});fl.displayName=dl;var pl=`MenuSubContent`,ml=u.forwardRef((e,t)=>{let n=Oc(q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=bc(q,e.__scopeMenu),o=Sc(q,e.__scopeMenu),s=ll(pl,e.__scopeMenu),c=u.useRef(null),l=h(t,c);return(0,d.jsx)(fc.Provider,{scope:e.__scopeMenu,children:(0,d.jsx)(Tt,{present:r||a.open,children:(0,d.jsx)(fc.Slot,{scope:e.__scopeMenu,children:(0,d.jsx)(Ic,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:L(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:L(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:L(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=uc[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});ml.displayName=pl;function hl(e){return e?`open`:`closed`}function gl(e){return e===`indeterminate`}function _l(e){return gl(e)?`indeterminate`:e?`checked`:`unchecked`}function vl(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function yl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function bl(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=yl(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function xl(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Sl(e,t){return t?xl({x:e.clientX,y:e.clientY},t):!1}function Cl(e){return t=>t.pointerType===`mouse`?e(t):void 0}var wl=Cc,Tl=Tc,El=kc,Dl=Mc,Ol=Rc,kl=Bc,Al=Uc,jl=Kc,Ml=Xc,Nl=Qc,Pl=nl,Fl=il,Il=ol,Ll=ul,Rl=fl,zl=ml,Bl=`DropdownMenu`,[Vl,Hl]=ke(Bl,[gc]),J=gc(),[Ul,Wl]=Vl(Bl),Gl=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=J(t),l=u.useRef(null),[f,p]=Pe({prop:i,defaultProp:a??!1,onChange:o,caller:Bl});return(0,d.jsx)(Ul,{scope:t,triggerId:R(),triggerRef:l,contentId:R(),open:f,onOpenChange:p,onOpenToggle:u.useCallback(()=>p(e=>!e),[p]),modal:s,children:(0,d.jsx)(wl,{...c,open:f,onOpenChange:p,dir:r,modal:s,children:n})})};Gl.displayName=Bl;var Kl=`DropdownMenuTrigger`,ql=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Wl(Kl,n),o=J(n);return(0,d.jsx)(Tl,{asChild:!0,...o,children:(0,d.jsx)(z.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:m(t,a.triggerRef),onPointerDown:L(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:L(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});ql.displayName=Kl;var Jl=`DropdownMenuPortal`,Yl=e=>{let{__scopeDropdownMenu:t,...n}=e,r=J(t);return(0,d.jsx)(El,{...r,...n})};Yl.displayName=Jl;var Xl=`DropdownMenuContent`,Zl=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Wl(Xl,n),a=J(n),o=u.useRef(!1);return(0,d.jsx)(Dl,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:L(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:L(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Zl.displayName=Xl;var Ql=`DropdownMenuGroup`,$l=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,d.jsx)(Ol,{...i,...r,ref:t})});$l.displayName=Ql;var eu=`DropdownMenuLabel`,tu=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,d.jsx)(kl,{...i,...r,ref:t})});tu.displayName=eu;var nu=`DropdownMenuItem`,ru=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,d.jsx)(Al,{...i,...r,ref:t})});ru.displayName=nu;var iu=`DropdownMenuCheckboxItem`,au=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,d.jsx)(jl,{...i,...r,ref:t})});au.displayName=iu;var ou=`DropdownMenuRadioGroup`,su=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,d.jsx)(Ml,{...i,...r,ref:t})});su.displayName=ou;var cu=`DropdownMenuRadioItem`,lu=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,d.jsx)(Nl,{...i,...r,ref:t})});lu.displayName=cu;var uu=`DropdownMenuItemIndicator`,du=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,d.jsx)(Pl,{...i,...r,ref:t})});du.displayName=uu;var fu=`DropdownMenuSeparator`,pu=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,d.jsx)(Fl,{...i,...r,ref:t})});pu.displayName=fu;var mu=`DropdownMenuArrow`,hu=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,d.jsx)(Il,{...i,...r,ref:t})});hu.displayName=mu;var gu=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=J(t),[s,c]=Pe({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,d.jsx)(Ll,{...o,open:s,onOpenChange:c,children:n})},_u=`DropdownMenuSubTrigger`,vu=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,d.jsx)(Rl,{...i,...r,ref:t})});vu.displayName=_u;var yu=`DropdownMenuSubContent`,bu=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=J(n);return(0,d.jsx)(zl,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});bu.displayName=yu;var xu=Gl,Su=ql,Cu=Yl,wu=Zl,Tu=$l,Eu=tu,Du=ru,Ou=au,ku=su,Au=lu,ju=du,Mu=pu,Nu=gu,Pu=vu,Fu=bu,Y={wrapper:`uzi-multi-select-module__wrapper__Izj2x`,wrapperFullWidth:`uzi-multi-select-module__wrapperFullWidth__eH8pf`,trigger:`uzi-multi-select-module__trigger__r3816`,value:`uzi-multi-select-module__value__PuUmG`,placeholder:`uzi-multi-select-module__placeholder__dJIU-`,chip:`uzi-multi-select-module__chip__46Ms-`,chipSummary:`uzi-multi-select-module__chipSummary__zLwi8`,chevron:`uzi-multi-select-module__chevron__SWK5l`,menu:`uzi-multi-select-module__menu__q8auA`,menuFadeIn:`uzi-multi-select-module__menuFadeIn__Plo7-`,option:`uzi-multi-select-module__option__-Ioqk`,optionDisabled:`uzi-multi-select-module__optionDisabled__qtCi8`,optionSelected:`uzi-multi-select-module__optionSelected__74IO8`,optionLabel:`uzi-multi-select-module__optionLabel__cVoN7`,indicator:`uzi-multi-select-module__indicator__NO-WE`,indicatorSelected:`uzi-multi-select-module__indicatorSelected__9sEAy`,indicatorDisabled:`uzi-multi-select-module__indicatorDisabled__vqdiH`},Iu=u.forwardRef(({options:e,value:t,onChange:n,placeholder:r=`Select options`,fullWidth:i=!0,maxVisibleValues:a=2,className:o,disabled:s=!1,name:c,"aria-label":l,"aria-labelledby":f},p)=>{let m=u.useMemo(()=>new Set(t),[t]),h=u.useMemo(()=>e.filter(e=>m.has(e.value)),[e,m]),g=u.useCallback(e=>{if(m.has(e)){n(t.filter(t=>t!==e));return}n([...t,e])},[n,m,t]),_=Math.max(1,a),v=h.slice(0,_),y=Math.max(0,h.length-v.length);return(0,d.jsx)(xu,{modal:!1,children:(0,d.jsxs)(`div`,{className:D(Y.wrapper,i&&Y.wrapperFullWidth,o),children:[(0,d.jsx)(Su,{asChild:!0,children:(0,d.jsxs)(`button`,{ref:p,type:`button`,className:Y.trigger,"aria-label":l,"aria-labelledby":f,disabled:s,children:[(0,d.jsx)(`span`,{className:Y.value,children:h.length===0?(0,d.jsx)(`span`,{className:Y.placeholder,children:r}):(0,d.jsxs)(d.Fragment,{children:[v.map(e=>(0,d.jsx)(`span`,{className:Y.chip,children:e.label},e.value)),y>0?(0,d.jsxs)(`span`,{className:D(Y.chip,Y.chipSummary),children:[`+`,y]}):null]})}),(0,d.jsx)(`span`,{className:Y.chevron,"aria-hidden":`true`,children:(0,d.jsx)(`svg`,{viewBox:`0 0 10 10`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,width:`10`,height:`10`,children:(0,d.jsx)(`path`,{d:`M2 3.5L5 6.5L8 3.5`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]})}),c?t.map(e=>(0,d.jsx)(`input`,{type:`hidden`,name:c,value:e},e)):null,(0,d.jsx)(Cu,{children:(0,d.jsx)(wu,{className:Y.menu,sideOffset:4,align:`start`,children:e.map(e=>{let t=m.has(e.value);return(0,d.jsxs)(Ou,{className:D(Y.option,t&&Y.optionSelected,e.disabled&&Y.optionDisabled),checked:t,disabled:e.disabled,onCheckedChange:()=>g(e.value),onSelect:e=>e.preventDefault(),children:[(0,d.jsx)(`span`,{className:D(Y.indicator,t&&Y.indicatorSelected,e.disabled&&Y.indicatorDisabled),"aria-hidden":`true`,children:(0,d.jsx)(ju,{forceMount:!0,children:(0,d.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{d:`M3.5 8.5 6.5 11.5 12.5 4.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})})}),(0,d.jsx)(`span`,{className:Y.optionLabel,children:e.label})]},e.value)})})})]})})});Iu.displayName=`MultiSelect`;function Lu(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ru(e){let t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var zu=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Bu=[` `,`Enter`],Vu=`Select`,[Hu,Uu,Wu]=Vr(Vu),[Gu,Ku]=ke(Vu,[Wu,vs]),qu=vs(),[Ju,Yu]=Gu(Vu),[Xu,Zu]=Gu(Vu),Qu=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:f,autoComplete:p,disabled:m,required:h,form:g}=e,_=qu(t),[v,y]=u.useState(null),[b,x]=u.useState(null),[S,C]=u.useState(!1),w=na(l),[T,E]=Pe({prop:r,defaultProp:i??!1,onChange:a,caller:Vu}),[D,O]=Pe({prop:o,defaultProp:s,onChange:c,caller:Vu}),k=u.useRef(null),A=v?g||!!v.closest(`form`):!0,[j,M]=u.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(`;`);return(0,d.jsx)(Ps,{..._,children:(0,d.jsxs)(Ju,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:R(),value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:m,children:[(0,d.jsx)(Hu.Provider,{scope:t,children:(0,d.jsx)(Xu,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:u.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),A?(0,d.jsxs)(Kd,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:D,onChange:e=>O(e.target.value),disabled:m,form:g,children:[D===void 0?(0,d.jsx)(`option`,{value:``}):null,Array.from(j)]},N):null]})})};Qu.displayName=Vu;var $u=`SelectTrigger`,ed=u.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=qu(n),o=Yu($u,n),s=o.disabled||r,c=h(t,o.onTriggerChange),l=Uu(n),f=u.useRef(`touch`),[p,m,g]=Jd(e=>{let t=l().filter(e=>!e.disabled),n=Yd(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),_=e=>{s||(o.onOpenChange(!0),g()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,d.jsx)(Fs,{asChild:!0,...a,children:(0,d.jsx)(z.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":qd(o.value)?``:void 0,...i,ref:c,onClick:L(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&_(e)}),onPointerDown:L(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:L(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&zu.includes(e.key)&&(_(),e.preventDefault())})})})});ed.displayName=$u;var td=`SelectValue`,nd=u.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Yu(td,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,f=h(t,c.onValueNodeChange);return F(()=>{l(u)},[l,u]),(0,d.jsx)(z.span,{...s,ref:f,style:{pointerEvents:`none`},children:qd(c.value)?(0,d.jsx)(d.Fragment,{children:o}):a})});nd.displayName=td;var rd=`SelectIcon`,id=u.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,d.jsx)(z.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});id.displayName=rd;var ad=`SelectPortal`,od=e=>(0,d.jsx)(Ct,{asChild:!0,...e});od.displayName=ad;var sd=`SelectContent`,cd=u.forwardRef((e,t)=>{let n=Yu(sd,e.__scopeSelect),[r,i]=u.useState();if(F(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?f.createPortal((0,d.jsx)(ld,{scope:e.__scopeSelect,children:(0,d.jsx)(Hu.Slot,{scope:e.__scopeSelect,children:(0,d.jsx)(`div`,{children:e.children})})}),t):null}return(0,d.jsx)(pd,{...e,ref:t})});cd.displayName=sd;var X=10,[ld,ud]=Gu(sd),dd=`SelectContentImpl`,fd=Le(`SelectContent.RemoveScroll`),pd=u.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:_,hideWhenDetached:v,avoidCollisions:y,...b}=e,x=Yu(sd,n),[S,C]=u.useState(null),[w,T]=u.useState(null),E=h(t,e=>C(e)),[D,O]=u.useState(null),[k,A]=u.useState(null),j=Uu(n),[M,N]=u.useState(!1),P=u.useRef(!1);u.useEffect(()=>{if(S)return Xn(S)},[S]),At();let F=u.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&w&&(w.scrollTop=0),n===r&&w&&(w.scrollTop=w.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,w]),ee=u.useCallback(()=>F([D,S]),[F,D,S]);u.useEffect(()=>{M&&ee()},[M,ee]);let{onOpenChange:I,triggerPointerDownPosRef:te}=x;u.useEffect(()=>{if(S){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(te.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(te.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():S.contains(n.target)||I(!1),document.removeEventListener(`pointermove`,t),te.current=null};return te.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[S,I,te]),u.useEffect(()=>{let e=()=>I(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[I]);let[ne,re]=Jd(e=>{let t=j().filter(e=>!e.disabled),n=Yd(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ie=u.useCallback((e,t,n)=>{let r=!P.current&&!n;(x.value!==void 0&&x.value===t||r)&&(O(e),r&&(P.current=!0))},[x.value]),ae=u.useCallback(()=>S?.focus(),[S]),oe=u.useCallback((e,t,n)=>{let r=!P.current&&!n;(x.value!==void 0&&x.value===t||r)&&A(e)},[x.value]),se=r===`popper`?_d:hd,ce=se===_d?{side:s,sideOffset:c,align:l,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:_,hideWhenDetached:v,avoidCollisions:y}:{};return(0,d.jsx)(ld,{scope:n,content:S,viewport:w,onViewportChange:T,itemRefCallback:ie,selectedItem:D,onItemLeave:ae,itemTextRefCallback:oe,focusSelectedItem:ee,selectedItemText:k,position:r,isPositioned:M,searchRef:ne,children:(0,d.jsx)(Vn,{as:fd,allowPinchZoom:!0,children:(0,d.jsx)(ut,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:L(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,d.jsx)(Ze,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:(0,d.jsx)(se,{role:`listbox`,id:x.contentId,"data-state":x.open?`open`:`closed`,dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...ce,onPlaced:()=>N(!0),ref:E,style:{display:`flex`,flexDirection:`column`,outline:`none`,...b.style},onKeyDown:L(b.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});pd.displayName=dd;var md=`SelectItemAlignedPosition`,hd=u.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Yu(sd,n),o=ud(sd,n),[s,c]=u.useState(null),[l,f]=u.useState(null),p=h(t,e=>f(e)),m=Uu(n),g=u.useRef(!1),_=u.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=o,S=u.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&v&&y&&b){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=Lu(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=Lu(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=m(),c=window.innerHeight-X*2,u=v.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),h=parseInt(d.borderBottomWidth,10),_=parseInt(d.paddingBottom,10),x=f+p+u+_+h,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-X,D=c-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&y===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+h);s.style.height=n+`px`}else{let e=o.length>0&&y===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+v.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}s.style.margin=`${X}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>g.current=!0)}},[m,a.trigger,a.valueNode,s,l,v,y,b,a.dir,r]);F(()=>S(),[S]);let[C,w]=u.useState();return F(()=>{l&&w(window.getComputedStyle(l).zIndex)},[l]),(0,d.jsx)(vd,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:g,onScrollButtonChange:u.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]),children:(0,d.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,d.jsx)(z.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});hd.displayName=md;var gd=`SelectPopperPosition`,_d=u.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=X,...a}=e,o=qu(n);return(0,d.jsx)(Is,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});_d.displayName=gd;var[vd,yd]=Gu(sd,{}),bd=`SelectViewport`,xd=u.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=ud(bd,n),o=yd(bd,n),s=h(t,a.onViewportChange),c=u.useRef(0);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,d.jsx)(Hu.Slot,{scope:n,children:(0,d.jsx)(z.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:L(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-X*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});xd.displayName=bd;var Sd=`SelectGroup`,[Cd,wd]=Gu(Sd),Td=u.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=R();return(0,d.jsx)(Cd,{scope:n,id:i,children:(0,d.jsx)(z.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Td.displayName=Sd;var Ed=`SelectLabel`,Dd=u.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=wd(Ed,n);return(0,d.jsx)(z.div,{id:i.id,...r,ref:t})});Dd.displayName=Ed;var Od=`SelectItem`,[kd,Ad]=Gu(Od),jd=u.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Yu(Od,n),c=ud(Od,n),l=s.value===r,[f,p]=u.useState(a??``),[m,g]=u.useState(!1),_=h(t,e=>c.itemRefCallback?.(e,r,i)),v=R(),y=u.useRef(`touch`),b=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,d.jsx)(kd,{scope:n,value:r,disabled:i,textId:v,isSelected:l,onItemTextChange:u.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,d.jsx)(Hu.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:(0,d.jsx)(z.div,{role:`option`,"aria-labelledby":v,"data-highlighted":m?``:void 0,"aria-selected":l&&m,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:_,onFocus:L(o.onFocus,()=>g(!0)),onBlur:L(o.onBlur,()=>g(!1)),onClick:L(o.onClick,()=>{y.current!==`mouse`&&b()}),onPointerUp:L(o.onPointerUp,()=>{y.current===`mouse`&&b()}),onPointerDown:L(o.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:L(o.onPointerMove,e=>{y.current=e.pointerType,i?c.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:L(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:L(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(Bu.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})});jd.displayName=Od;var Md=`SelectItemText`,Nd=u.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Yu(Md,n),s=ud(Md,n),c=Ad(Md,n),l=Zu(Md,n),[p,m]=u.useState(null),g=h(t,e=>m(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),_=p?.textContent,v=u.useMemo(()=>(0,d.jsx)(`option`,{value:c.value,disabled:c.disabled,children:_},c.value),[c.disabled,c.value,_]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=l;return F(()=>(y(v),()=>b(v)),[y,b,v]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(z.span,{id:c.textId,...a,ref:g}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?f.createPortal(a.children,o.valueNode):null]})});Nd.displayName=Md;var Pd=`SelectItemIndicator`,Fd=u.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Ad(Pd,n).isSelected?(0,d.jsx)(z.span,{"aria-hidden":!0,...r,ref:t}):null});Fd.displayName=Pd;var Id=`SelectScrollUpButton`,Ld=u.forwardRef((e,t)=>{let n=ud(Id,e.__scopeSelect),r=yd(Id,e.__scopeSelect),[i,a]=u.useState(!1),o=h(t,r.onScrollButtonChange);return F(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,d.jsx)(Bd,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ld.displayName=Id;var Rd=`SelectScrollDownButton`,zd=u.forwardRef((e,t)=>{let n=ud(Rd,e.__scopeSelect),r=yd(Rd,e.__scopeSelect),[i,a]=u.useState(!1),o=h(t,r.onScrollButtonChange);return F(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,d.jsx)(Bd,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});zd.displayName=Rd;var Bd=u.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=ud(`SelectScrollButton`,n),o=u.useRef(null),s=Uu(n),c=u.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),F(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,d.jsx)(z.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:L(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:L(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:L(i.onPointerLeave,()=>{c()})})}),Vd=`SelectSeparator`,Hd=u.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,d.jsx)(z.div,{"aria-hidden":!0,...r,ref:t})});Hd.displayName=Vd;var Ud=`SelectArrow`,Wd=u.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=qu(n),a=Yu(Ud,n),o=ud(Ud,n);return a.open&&o.position===`popper`?(0,d.jsx)(Ls,{...i,...r,ref:t}):null});Wd.displayName=Ud;var Gd=`SelectBubbleInput`,Kd=u.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=u.useRef(null),a=h(r,i),o=Ru(t);return u.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,d.jsx)(z.select,{...n,style:{...Hr,...n.style},ref:a,defaultValue:t})});Kd.displayName=Gd;function qd(e){return e===``||e===void 0}function Jd(e){let t=P(e),n=u.useRef(``),r=u.useRef(0),i=u.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=u.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Yd(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Xd(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Xd(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Zd=Qu,Qd=ed,$d=nd,ef=id,tf=od,nf=cd,rf=xd,af=jd,of=Nd,sf=Fd,Z={wrapper:`uzi-select-module__wrapper__7szq0`,wrapperFullWidth:`uzi-select-module__wrapperFullWidth__IyOIG`,trigger:`uzi-select-module__trigger__ldh8w`,value:`uzi-select-module__value__FTUJh`,chevron:`uzi-select-module__chevron__U6HXS`,content:`uzi-select-module__content__pOWWy`,selectFadeIn:`uzi-select-module__selectFadeIn__Z-yKX`,viewport:`uzi-select-module__viewport__VGZM6`,item:`uzi-select-module__item__6uM6-`,indicator:`uzi-select-module__indicator__ZHcg5`,indicatorIcon:`uzi-select-module__indicatorIcon__kOV2G`},cf=`__uzi_select_empty__`,lf=u.forwardRef(({options:e,value:t,onChange:n,placeholder:r,allowEmptyOption:i=!1,fullWidth:a=!0,className:o,id:s,name:c,disabled:l,required:u,autoComplete:f,form:p,title:m,"aria-label":h,"aria-labelledby":g,onBlur:_,onFocus:v},y)=>(0,d.jsx)(`div`,{className:D(Z.wrapper,a&&Z.wrapperFullWidth,o),children:(0,d.jsxs)(Zd,{value:t,onValueChange:e=>n(e===cf?``:e),name:c,disabled:l,required:u,autoComplete:f,form:p,children:[(0,d.jsxs)(Qd,{ref:y,id:s,className:Z.trigger,title:m,"aria-label":h,"aria-labelledby":g,onBlur:_,onFocus:v,children:[(0,d.jsx)($d,{className:Z.value,placeholder:r}),(0,d.jsx)(ef,{className:Z.chevron,"aria-hidden":`true`,children:(0,d.jsx)(`svg`,{viewBox:`0 0 10 10`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,width:`10`,height:`10`,children:(0,d.jsx)(`path`,{d:`M2 3.5L5 6.5L8 3.5`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]}),(0,d.jsx)(tf,{children:(0,d.jsx)(nf,{className:Z.content,position:`popper`,sideOffset:4,align:`start`,children:(0,d.jsxs)(rf,{className:Z.viewport,children:[r&&i?(0,d.jsxs)(af,{value:cf,className:Z.item,children:[(0,d.jsx)(`span`,{className:Z.indicator,children:(0,d.jsx)(sf,{children:(0,d.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,className:Z.indicatorIcon,children:(0,d.jsx)(`path`,{d:`M3.5 8.5 6.5 11.5 12.5 4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})})}),(0,d.jsx)(of,{children:r})]}):null,e.map(e=>(0,d.jsxs)(af,{value:e.value,disabled:e.disabled,className:Z.item,children:[(0,d.jsx)(`span`,{className:Z.indicator,children:(0,d.jsx)(sf,{children:(0,d.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,className:Z.indicatorIcon,children:(0,d.jsx)(`path`,{d:`M3.5 8.5 6.5 11.5 12.5 4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})})}),(0,d.jsx)(of,{children:e.label})]},e.value))]})})})]})}));lf.displayName=`Select`;var uf=u.forwardRef(({options:e,value:t,onChange:n,placeholder:r=`All`,allowClear:i=!0,...a},o)=>(0,d.jsx)(lf,{ref:o,options:e,value:t,onChange:n,placeholder:r,allowEmptyOption:i,fullWidth:!1,...a}));uf.displayName=`Dropdown`;var Q={content:`uzi-dropdown-menu-module__content__n-ElH`,menuFadeIn:`uzi-dropdown-menu-module__menuFadeIn__ITxMo`,item:`uzi-dropdown-menu-module__item__tBNtW`,itemDestructive:`uzi-dropdown-menu-module__itemDestructive__oWmKd`,insetItem:`uzi-dropdown-menu-module__insetItem__g7ONJ`,indicator:`uzi-dropdown-menu-module__indicator__5qwFh`,indicatorIcon:`uzi-dropdown-menu-module__indicatorIcon__nhJMw`,radioDot:`uzi-dropdown-menu-module__radioDot__GWUVT`,label:`uzi-dropdown-menu-module__label__sFnNR`,separator:`uzi-dropdown-menu-module__separator__PgUob`,chevron:`uzi-dropdown-menu-module__chevron__kxfiF`};function df(e){return(0,d.jsx)(xu,{...e})}function ff(e){return(0,d.jsx)(Su,{...e})}function pf(e){return(0,d.jsx)(Tu,{...e})}function mf(e){return(0,d.jsx)(Cu,{...e})}function hf(e){return(0,d.jsx)(Nu,{...e})}function gf(e){return(0,d.jsx)(ku,{...e})}function _f({className:e,sideOffset:t=4,...n}){return(0,d.jsx)(Cu,{children:(0,d.jsx)(wu,{sideOffset:t,className:D(Q.content,e),...n})})}function vf({className:e,inset:t,variant:n=`default`,...r}){return(0,d.jsx)(Du,{"data-inset":t?`true`:void 0,className:D(Q.item,n===`destructive`&&Q.itemDestructive,e),...r})}function yf({className:e,children:t,...n}){return(0,d.jsxs)(Ou,{className:D(Q.item,Q.insetItem,e),...n,children:[(0,d.jsx)(`span`,{className:Q.indicator,children:(0,d.jsx)(ju,{children:(0,d.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,className:Q.indicatorIcon,children:(0,d.jsx)(`path`,{d:`M3.5 8.5 6.5 11.5 12.5 4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})})}),t]})}function bf({className:e,children:t,...n}){return(0,d.jsxs)(Au,{className:D(Q.item,Q.insetItem,e),...n,children:[(0,d.jsx)(`span`,{className:Q.indicator,children:(0,d.jsx)(ju,{children:(0,d.jsx)(`span`,{className:Q.radioDot})})}),t]})}function xf({className:e,inset:t,...n}){return(0,d.jsx)(Eu,{"data-inset":t?`true`:void 0,className:D(Q.label,e),...n})}function Sf({className:e,...t}){return(0,d.jsx)(Mu,{className:D(Q.separator,e),...t})}function Cf({className:e,inset:t,children:n,...r}){return(0,d.jsxs)(Pu,{"data-inset":t?`true`:void 0,className:D(Q.item,e),...r,children:[n,(0,d.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,className:Q.chevron,children:(0,d.jsx)(`path`,{d:`M6 3.5 10.5 8 6 12.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})})]})}function wf({className:e,...t}){return(0,d.jsx)(Fu,{className:D(Q.content,e),...t})}var Tf=[`light`,`dark`,`system`],Ef=[`blue`,`cyan`,`violet`,`emerald`,`amber`,`rose`],Df=`uzi-theme`,Of=`uzi-accent`,kf=Df,Af=Of,jf=`data-uzi-theme`,Mf=`data-uzi-accent`,Nf=(0,u.createContext)(void 0);function Pf(e){return Tf.includes(e)}function Ff(e){return Ef.includes(e)}function If(){return typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function Lf({children:e,theme:t,defaultTheme:n=`system`,accent:r,defaultAccent:i=`blue`,onThemeChange:a,onAccentChange:o,storageKey:s=kf,accentStorageKey:c=Af,disableStorage:l=!1,toastConfig:f}){let[p,m]=(0,u.useState)(n),[h,g]=(0,u.useState)(i),[_,v]=(0,u.useState)(`light`);(0,u.useEffect)(()=>{if(v(If()),!l){let e=window.localStorage.getItem(s);Pf(e)&&m(e);let t=window.localStorage.getItem(c);Ff(t)&&g(t)}},[l,s,c]);let y=t!==void 0,b=r!==void 0,x=y?t:p,S=b?r:h,C=x===`system`?_:x;(0,u.useEffect)(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>v(e.matches?`dark`:`light`);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,u.useEffect)(()=>{if(typeof document>`u`)return;let e=document.documentElement;e.setAttribute(jf,C),e.setAttribute(Mf,S),e.style.colorScheme=C,e.classList.toggle(`dark`,C===`dark`)},[S,C]);let w=(0,u.useCallback)(e=>{y||m(e),!l&&typeof window<`u`&&window.localStorage.setItem(s,e),a?.(e)},[l,y,a,s]),T=(0,u.useCallback)(e=>{b||g(e),!l&&typeof window<`u`&&window.localStorage.setItem(c,e),o?.(e)},[c,l,b,o]),E=(0,u.useCallback)(()=>{w(C===`dark`?`light`:`dark`)},[C,w]),D=(0,u.useMemo)(()=>({theme:x,resolvedTheme:C,accent:S,setTheme:w,setAccent:T,toggleTheme:E}),[S,x,C,T,w,E]);return(0,d.jsx)(Nf.Provider,{value:D,children:(0,d.jsx)(Ui,{config:f,children:e})})}function Rf(){let e=(0,u.useContext)(Nf);if(!e)throw Error(`useTheme must be used within a ThemeProvider`);return e}var zf={withLabel:`uzi-theme-toggle-button-module__withLabel__KqtDj`};function Bf(){return(0,d.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,width:`16`,height:`16`,fill:`none`,children:(0,d.jsx)(`path`,{d:`M20 15.2A8.5 8.5 0 0 1 8.8 4 9 9 0 1 0 20 15.2Z`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Vf(){return(0,d.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,width:`16`,height:`16`,fill:`none`,children:[(0,d.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,d.jsx)(`path`,{d:`M12 2.75v2.5M12 18.75v2.5M21.25 12h-2.5M5.25 12h-2.5M18.54 5.46l-1.77 1.77M7.23 16.77l-1.77 1.77M18.54 18.54l-1.77-1.77M7.23 7.23 5.46 5.46`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})]})}function Hf({showLabel:e=!1,lightLabel:t=`Light mode`,darkLabel:n=`Dark mode`,className:r,onClick:i,...a}){let{resolvedTheme:o,toggleTheme:s}=Rf(),c=o===`dark`?t:n;return(0,d.jsxs)(j,{type:`button`,variant:`ghost`,size:e?`sm`:`icon`,className:D(e&&zf.withLabel,r),"aria-label":`Switch to ${c.toLowerCase()}`,title:`Switch to ${c.toLowerCase()}`,onClick:e=>{i?.(e),e.defaultPrevented||s()},...a,children:[o===`dark`?(0,d.jsx)(Vf,{}):(0,d.jsx)(Bf,{}),e&&(0,d.jsx)(`span`,{children:c})]})}var Uf={topBar:`uzi-top-bar-module__topBar__MJ-7S`,topBarStatic:`uzi-top-bar-module__topBarStatic__JvEwt`,topBarInner:`uzi-top-bar-module__topBarInner__PBbi8`,topBarStart:`uzi-top-bar-module__topBarStart__DrdN2`,topBarBrand:`uzi-top-bar-module__topBarBrand__80VV3`,topBarBrandContent:`uzi-top-bar-module__topBarBrandContent__O4Uto`,topBarCenter:`uzi-top-bar-module__topBarCenter__Kwxg-`,topBarCenterGroup:`uzi-top-bar-module__topBarCenterGroup__7Ishp`,topBarActions:`uzi-top-bar-module__topBarActions__mgMd8`};function Wf({leading:e,brand:t,brandHref:n,brandingLocation:r=`left`,start:i,center:a,actions:o,showThemeToggle:s=!1,themeToggleProps:c,className:l,innerClassName:u,isSticky:f,sticky:p=!0,children:m,...h}){let g=f??p,_=t?n?(0,d.jsx)(`a`,{href:n,className:Uf.topBarBrand,children:(0,d.jsx)(`span`,{className:Uf.topBarBrandContent,children:t})}):(0,d.jsx)(`div`,{className:Uf.topBarBrand,children:(0,d.jsx)(`span`,{className:Uf.topBarBrandContent,children:t})}):null;return(0,d.jsx)(`header`,{className:D(Uf.topBar,!g&&Uf.topBarStatic,l),...h,children:(0,d.jsxs)(`div`,{className:D(Uf.topBarInner,u),children:[(0,d.jsxs)(`div`,{className:Uf.topBarStart,children:[e,r===`left`&&_,i]}),_&&r===`center`||a||m?(0,d.jsx)(`div`,{className:Uf.topBarCenter,children:(0,d.jsxs)(`div`,{className:Uf.topBarCenterGroup,children:[r===`center`&&_,a??m]})}):null,(0,d.jsxs)(`div`,{className:Uf.topBarActions,children:[s&&(0,d.jsx)(Hf,{...c}),o]})]})})}var Gf={appShell:`uzi-app-shell-module__appShell__S0cVI`,appShellAnimated:`uzi-app-shell-module__appShellAnimated__-CRIl`,appShellOpen:`uzi-app-shell-module__appShellOpen__1rZUl`,appShellCollapsed:`uzi-app-shell-module__appShellCollapsed__fSasN`,appShellTopbar:`uzi-app-shell-module__appShellTopbar__rgXsW`,appShellTopbarLeft:`uzi-app-shell-module__appShellTopbarLeft__-EVuB`,appShellTopbarStart:`uzi-app-shell-module__appShellTopbarStart__XXQpq`,appShellTopbarRight:`uzi-app-shell-module__appShellTopbarRight__l1G57`,appShellBrand:`uzi-app-shell-module__appShellBrand__TXwyN`,appShellHamburger:`uzi-app-shell-module__appShellHamburger__BciFA`,appShellSidebar:`uzi-app-shell-module__appShellSidebar__oY7uj`,appShellMain:`uzi-app-shell-module__appShellMain__eHP2r`,appShellBackdrop:`uzi-app-shell-module__appShellBackdrop__y31xs`,appShellSidebarOpen:`uzi-app-shell-module__appShellSidebarOpen__Z5AIo`},Kf=960;function qf(){return typeof window>`u`?!1:window.innerWidth>=Kf}function Jf({children:e,sidebar:t,brand:n,brandHref:r,topbarStart:i,topbarEnd:a,showThemeToggle:o=!1,themeToggleProps:s,topBarBrandingLocation:c=`left`,className:l,sidebarClassName:f,topbarClassName:p,mainClassName:m,sidebarWidth:h,closeSidebarOnChangeKey:g,hamburgerLabel:_=`Toggle navigation`,onSidebarToggle:v}){let[y,b]=(0,u.useState)(!1),[x,S]=(0,u.useState)(!1),[C,w]=(0,u.useState)(!1),T=(0,u.useRef)(!1),E=(0,u.useRef)(g),O=(0,u.useRef)(null),k=(0,u.useRef)(null),A=(0,u.useRef)(null),j=(0,u.useId)();(0,u.useEffect)(()=>{let e=qf();b(e),S(e),T.current=e;let t=window.requestAnimationFrame(()=>{w(!0)}),n=()=>{let e=qf();b(e),e!==T.current&&(S(e),T.current=e)};return window.addEventListener(`resize`,n),()=>{window.cancelAnimationFrame(t),window.removeEventListener(`resize`,n)}},[]),(0,u.useEffect)(()=>{if(y||!x)return;let e=A.current,t=()=>S(!1),n=e=>{let n=e.target;n&&(O.current?.contains(n)||k.current?.contains(n)||t())},r=window.setTimeout(()=>{document.addEventListener(`pointerdown`,n),window.addEventListener(`scroll`,t,{passive:!0}),e?.addEventListener(`scroll`,t,{passive:!0}),document.addEventListener(`touchmove`,t,{passive:!0})},10);return()=>{window.clearTimeout(r),document.removeEventListener(`pointerdown`,n),window.removeEventListener(`scroll`,t),e?.removeEventListener(`scroll`,t),document.removeEventListener(`touchmove`,t)}},[x,y]),(0,u.useEffect)(()=>{!y&&E.current!==g&&S(!1),E.current=g},[g,y]),(0,u.useEffect)(()=>{v?.(x)},[x,v]);let M=()=>S(e=>!e),N=h===void 0?void 0:typeof h==`number`?`${h}px`:h,P=N?{"--app-shell-sidebar-width":N}:void 0,F=D(Gf.appShell,C&&Gf.appShellAnimated,x?Gf.appShellOpen:Gf.appShellCollapsed,l),ee=D(Gf.appShellSidebar,x&&Gf.appShellSidebarOpen,f);return(0,d.jsxs)(`div`,{className:F,style:P,"data-app-shell":!0,"data-desktop":y?`true`:`false`,"data-sidebar-open":x?`true`:`false`,children:[(0,d.jsx)(Wf,{className:D(Gf.appShellTopbar,p),leading:(0,d.jsx)(`button`,{ref:k,type:`button`,className:Gf.appShellHamburger,onClick:M,"aria-label":_,"aria-expanded":x,"aria-controls":j,children:(0,d.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,d.jsx)(`path`,{d:`M3 6h18M3 12h18M3 18h18`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`})})}),brand:n,brandHref:r,brandingLocation:c,start:i,actions:a,showThemeToggle:o,themeToggleProps:s}),!y&&x&&(0,d.jsx)(`div`,{className:Gf.appShellBackdrop,onClick:()=>S(!1),onTouchStart:()=>S(!1),"aria-hidden":`true`}),(0,d.jsx)(`aside`,{ref:O,id:j,className:ee,"aria-label":`Sidebar navigation`,children:t}),(0,d.jsx)(`main`,{ref:A,className:D(Gf.appShellMain,m),children:e})]})}var $={sidebarNav:`uzi-sidebar-nav-module__sidebarNav__eUI5c`,sidebarNavCollapsed:`uzi-sidebar-nav-module__sidebarNavCollapsed__xTM9s`,header:`uzi-sidebar-nav-module__header__Y4NLy`,footer:`uzi-sidebar-nav-module__footer__GjWky`,sections:`uzi-sidebar-nav-module__sections__mXuGQ`,section:`uzi-sidebar-nav-module__section__yjtCY`,sectionItems:`uzi-sidebar-nav-module__sectionItems__tNcph`,sectionLabel:`uzi-sidebar-nav-module__sectionLabel__Wx94m`,item:`uzi-sidebar-nav-module__item__uMHkJ`,itemActive:`uzi-sidebar-nav-module__itemActive__wBbiS`,itemCollapsed:`uzi-sidebar-nav-module__itemCollapsed__jLJN-`,itemDisabled:`uzi-sidebar-nav-module__itemDisabled__Yf8Il`,icon:`uzi-sidebar-nav-module__icon__tyrUg`,itemBody:`uzi-sidebar-nav-module__itemBody__wI0iy`,labelRow:`uzi-sidebar-nav-module__labelRow__D8sEJ`,label:`uzi-sidebar-nav-module__label__A-nt6`,description:`uzi-sidebar-nav-module__description__Xf3Si`,badge:`uzi-sidebar-nav-module__badge__-hnFd`},Yf=(e,t)=>e.active===void 0?!e.href||!t?!1:e.href===`/`?t===`/`:t.startsWith(e.href):e.active,Xf=(e,t)=>{if(e.active!==void 0)return e.active;if(!e.href||!t)return!1;if(e.href===`/`)return t===`/`;let n=e.href.endsWith(`/`)?e.href.slice(0,-1):e.href;return n===t||t.startsWith(`${n}/`)},Zf=(e,t)=>e===`/`?t===`/`:t.startsWith(e),Qf=(e,t)=>e===`/`?t===`/`:(e.endsWith(`/`)?e.slice(0,-1):e)===t,$f=e=>e.endsWith(`/`)?e.length-1:e.length,ep=(e,t)=>{let n=new Set;if(!t)return n;let r=e.filter(e=>e.disabled||!e.href?!1:e.exact?Qf(e.href,t):Zf(e.href,t));if(r.length===0)return n;let i=0;for(let e of r){if(!e.href)continue;let t=$f(e.href);t>i&&(i=t)}for(let e of r)e.href&&$f(e.href)===i&&n.add(e.href);return n};function tp({items:e=[],sections:t,currentPath:n,getIsActive:r,matchStrategy:i=`prefix`,onItemClick:a,header:o,footer:s,ariaLabel:c=`Sidebar navigation`,collapsed:l=!1,iconSize:f,className:p,itemClassName:m,sectionClassName:h}){let g=(0,u.useMemo)(()=>t?.length?t:[{id:`default`,items:e}],[t,e]),_=(0,u.useMemo)(()=>g.flatMap(e=>e.items),[g]),v=(0,u.useMemo)(()=>{if(i===`most-specific`){let e=ep(_,n);return t=>t.active===void 0?t.href?e.has(t.href):!1:t.active}else return(e,t)=>e.active===void 0?e.exact?Xf(e,t):Yf(e,t):e.active},[i,_,n]),y=r??v,b=f===void 0?void 0:{"--sidebar-nav-icon-size":typeof f==`number`?`${f}px`:f};return(0,d.jsxs)(`nav`,{className:D($.sidebarNav,l&&$.sidebarNavCollapsed,p),"aria-label":c,style:b,children:[o?(0,d.jsx)(`div`,{className:$.header,children:o}):null,(0,d.jsx)(`div`,{className:$.sections,children:g.map((e,t)=>(0,d.jsxs)(`div`,{className:D($.section,h),children:[e.label&&!l?(0,d.jsx)(`div`,{className:$.sectionLabel,children:e.label}):null,(0,d.jsx)(`div`,{className:$.sectionItems,children:e.items.map((r,i)=>(0,d.jsx)(np,{item:r,active:y(r,n),collapsed:l,itemClassName:m,onItemClick:a},`${e.id??t}-${r.href??r.title??i}`))})]},e.id??`section-${t}`))}),s?(0,d.jsx)(`div`,{className:$.footer,children:s}):null]})}function np({item:e,active:t,collapsed:n,itemClassName:r,onItemClick:i}){let a=e.rel??(e.target===`_blank`?`noreferrer`:void 0),o=e.title??(typeof e.label==`string`?e.label:void 0),s=D($.item,t&&$.itemActive,n&&$.itemCollapsed,e.disabled&&$.itemDisabled,r),c=(0,d.jsxs)(d.Fragment,{children:[e.icon&&(0,d.jsx)(`span`,{className:$.icon,children:e.icon}),n?null:(0,d.jsxs)(`span`,{className:$.itemBody,children:[(0,d.jsxs)(`span`,{className:$.labelRow,children:[(0,d.jsx)(`span`,{className:$.label,children:e.label}),e.badge&&(0,d.jsx)(`span`,{className:$.badge,children:e.badge})]}),e.description?(0,d.jsx)(`span`,{className:$.description,children:e.description}):null]})]}),l=()=>{e.disabled||(e.onClick?.(),i?.(e))};return e.href?e.disabled?(0,d.jsx)(`div`,{className:s,"aria-current":t?`page`:void 0,"aria-disabled":`true`,title:n?o:void 0,children:c}):(0,d.jsx)(`a`,{className:s,href:e.href,target:e.target,rel:a,"aria-current":t?`page`:void 0,title:n?o:void 0,onClick:l,children:c}):(0,d.jsx)(`button`,{type:`button`,className:s,"aria-current":t?`page`:void 0,"aria-disabled":e.disabled?`true`:void 0,disabled:e.disabled,title:n?o:void 0,onClick:l,children:c})}var rp={skeleton:`uzi-skeleton-module__skeleton__fula5`,"skeleton-pulse":`uzi-skeleton-module__skeleton-pulse__Yp45W`,"radius-sm":`uzi-skeleton-module__radius-sm__FdccD`,"radius-md":`uzi-skeleton-module__radius-md__zH3RE`,"radius-lg":`uzi-skeleton-module__radius-lg__YVrHw`,"radius-full":`uzi-skeleton-module__radius-full__5o2m0`};function ip({width:e,height:t,radius:n=`md`,className:r,style:i,...a}){return(0,d.jsx)(`div`,{className:D(rp.skeleton,rp[`radius-${n}`],r),style:{width:e,height:t,...i},"aria-hidden":`true`,...a})}var ap={track:`uzi-progress-module__track__gM0oV`,fill:`uzi-progress-module__fill__aLAbp`,"tone-default":`uzi-progress-module__tone-default__fhf7o`,"tone-success":`uzi-progress-module__tone-success__FsGHD`,"tone-warning":`uzi-progress-module__tone-warning__UAttL`,"tone-danger":`uzi-progress-module__tone-danger__-L-Ee`};function op({value:e,tone:t=`default`,className:n,"aria-label":r,...i}){let a=Math.max(0,Math.min(100,e));return(0,d.jsx)(`div`,{className:D(ap.track,n),role:`progressbar`,"aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r,...i,children:(0,d.jsx)(`div`,{className:D(ap.fill,ap[`tone-${t}`]),style:{width:`${a}%`}})})}var sp={track:`uzi-segmented-toggle-module__track__M4fjm`,option:`uzi-segmented-toggle-module__option__7cEZJ`,label:`uzi-segmented-toggle-module__label__bDAIv`};function cp({options:e,value:t,onChange:n,"aria-label":r,"aria-labelledby":i,className:a}){let o=u.useRef([]),s=e.findIndex(e=>e.value===t),c=e.findIndex(e=>!e.disabled),l=-1;for(let t=e.length-1;t>=0;--t)if(!e[t]?.disabled){l=t;break}let f=s>=0&&!e[s]?.disabled?s:c,p=e=>{o.current[e]?.focus()},m=(t,n)=>{if(e.length===0)return-1;let r=t;for(let t=0;t<e.length;t+=1)if(r=(r+n+e.length)%e.length,!e[r]?.disabled)return r;return t},h=r=>{let i=e[r];!i||i.disabled||i.value===t||n(i.value)},g=(e,t)=>{switch(e.key){case`ArrowRight`:case`ArrowDown`:{e.preventDefault();let n=m(t,1);p(n),h(n);break}case`ArrowLeft`:case`ArrowUp`:{e.preventDefault();let n=m(t,-1);p(n),h(n);break}case`Home`:e.preventDefault(),p(c),c>=0&&h(c);break;case`End`:e.preventDefault(),l>=0&&(p(l),h(l));break;default:break}};return(0,d.jsx)(`div`,{className:D(sp.track,a),role:`radiogroup`,"aria-label":r,"aria-labelledby":i,children:e.map((e,r)=>(0,d.jsx)(`button`,{ref:e=>{o.current[r]=e},type:`button`,role:`radio`,"aria-checked":e.value===t,disabled:e.disabled,tabIndex:e.disabled?-1:r===f?0:-1,onClick:()=>{e.value!==t&&n(e.value)},onKeyDown:e=>g(e,r),className:D(sp.option),children:(0,d.jsx)(`span`,{className:sp.label,children:e.label})},e.value))})}exports.Alert=Br,exports.AppShell=Jf,exports.Avatar=xe,exports.AvatarFallback=Ce,exports.AvatarImage=Se,exports.Button=j,exports.Card=Te,exports.Checkbox=ea,exports.Dropdown=uf,exports.DropdownMenu=df,exports.DropdownMenuCheckboxItem=yf,exports.DropdownMenuContent=_f,exports.DropdownMenuGroup=pf,exports.DropdownMenuItem=vf,exports.DropdownMenuLabel=xf,exports.DropdownMenuPortal=mf,exports.DropdownMenuRadioGroup=gf,exports.DropdownMenuRadioItem=bf,exports.DropdownMenuSeparator=Sf,exports.DropdownMenuSub=hf,exports.DropdownMenuSubContent=wf,exports.DropdownMenuSubTrigger=Cf,exports.DropdownMenuTrigger=ff,exports.Input=Xi,exports.Label=Qi,exports.Modal=Rr,exports.ModalOverlay=Lr,exports.MultiSelect=Iu,exports.Pill=De,exports.Progress=op,exports.SegmentedToggle=cp,exports.Select=lf,exports.SidebarNav=tp,exports.Skeleton=ip,exports.ThemeProvider=Lf,exports.ThemeToggleButton=Hf,exports.ToastProvider=Ui,exports.TopBar=Wf,exports.cx=D,exports.useTheme=Rf,exports.useToast=Wi;
|
|
46
1926
|
//# sourceMappingURL=index.cjs.map
|