@khaos-systems/helm 0.1.13 → 0.2.0
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/MtAvatar-03YpvbOy.js +6572 -0
- package/dist/MtAvatar-DvtEpPF_.cjs +46 -0
- package/dist/experimental.cjs +4 -0
- package/dist/experimental.d.ts +1 -0
- package/dist/experimental.js +2561 -0
- package/dist/lib.d.ts +1 -1
- package/dist/matter.cjs +3 -48
- package/dist/matter.js +697 -7205
- package/package.json +1 -1
package/dist/lib.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import './index.css';
|
|
|
2
2
|
export { MtButton } from './components/matter/MtButton';
|
|
3
3
|
export { MtCheckbox } from './components/matter/MtCheckbox';
|
|
4
4
|
export { MtContextMenu, WithContextMenu } from './components/matter/MtContextMenu';
|
|
5
|
-
export { MtDialog } from './components/matter/MtDialog';
|
|
5
|
+
export { MtDialog, MtDialogClose } from './components/matter/MtDialog';
|
|
6
6
|
export { MtDivider } from './components/matter/MtDivider';
|
|
7
7
|
export { MtDropdown, MtDropdownItem } from './components/matter/MtDropdown';
|
|
8
8
|
export { MtFilterDropdown } from './components/matter/MtFilter';
|
package/dist/matter.cjs
CHANGED
|
@@ -1,50 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
let props = %s;
|
|
3
|
-
<%s {...props} />
|
|
4
|
-
React keys must be passed directly to JSX without using spread:
|
|
5
|
-
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,K,_,G,_),X[_+K]=!0)}if(_=null,U!==void 0&&(n(U),_=""+U),a(B)&&(n(B.key),_=""+B.key),"key"in B){U={};for(var J in B)J!=="key"&&(U[J]=B[J])}else U=B;return _&&c(U,typeof S=="function"?S.displayName||S.name||"Unknown":S),p(S,_,U,o(),oe,Q)}function d(S){m(S)?S._store&&(S._store.validated=1):typeof S=="object"&&S!==null&&S.$$typeof===T&&(S._payload.status==="fulfilled"?m(S._payload.value)&&S._payload.value._store&&(S._payload.value._store.validated=1):S._store&&(S._store.validated=1))}function m(S){return typeof S=="object"&&S!==null&&S.$$typeof===x}var v=j,x=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),C=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),N=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,k=Array.isArray,V=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(S){return S()}};var F,W={},L=v.react_stack_bottom_frame.bind(v,s)(),O=V(r(s)),X={};at.Fragment=g,at.jsx=function(S,B,U){var K=1e4>N.recentlyCreatedOwnerStacks++;return f(S,B,U,!1,K?Error("react-stack-top-frame"):L,K?V(r(S)):O)},at.jsxs=function(S,B,U){var K=1e4>N.recentlyCreatedOwnerStacks++;return f(S,B,U,!0,K?Error("react-stack-top-frame"):L,K?V(r(S)):O)}})()),at}var Ar;function La(){return Ar||(Ar=1,process.env.NODE_ENV==="production"?Rt.exports=Da():Rt.exports=ka()),Rt.exports}var i=La();const uo=j.forwardRef(({children:e,type:t="button",size:n="medium",variant:r="default",kind:o="default",selected:s=!1,className:a,...c},u)=>{const p={medium:"mt-layout-input-medium w-fit",large:"mt-layout-input-large w-fit"},f={medium:"w-[24px] h-[24px] p-1 flex items-center justify-center",large:"w-[32px] h-[32px] p-1 flex items-center justify-center"},d={default:"mt-surface-input-default",accent:"mt-surface-input-accent",ghost:"mt-surface-input-ghost"},m="flex items-center gap-2 rounded transition-all duration-150",v=o==="icon"?f[n]:p[n];return i.jsx("button",{ref:u,type:t,"data-selected":s?"true":void 0,className:`${m} ${v} ${d[r]} ${a||""}`,...c,children:e})});uo.displayName="MtButton";const we=uo;const fo=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const $a=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Fa=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Or=e=>{const t=Fa(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ba={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Wa=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Va=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...c},u)=>j.createElement("svg",{ref:u,...Ba,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:fo("lucide",o),...!s&&!Wa(c)&&{"aria-hidden":"true"},...c},[...a.map(([p,f])=>j.createElement(p,f)),...Array.isArray(s)?s:[s]]));const ee=(e,t)=>{const n=j.forwardRef(({className:r,...o},s)=>j.createElement(Va,{ref:s,iconNode:t,className:fo(`lucide-${$a(Or(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Or(e),n};const Ha=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Ua=ee("arrow-down",Ha);const Ka=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Ga=ee("arrow-up-down",Ka);const za=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Ya=ee("arrow-up",za);const Xa=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],po=ee("check",Xa);const qa=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ho=ee("chevron-down",qa);const Za=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],mo=ee("chevron-right",Za);const Ja=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Qa=ee("circle-alert",Ja);const ec=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],tc=ee("circle-check",ec);const nc=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],rc=ee("circle-x",nc);const oc=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],sc=ee("ellipsis",oc);const ic=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ac=ee("info",ic);const cc=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],Mt=ee("list-filter",cc);const lc=[["path",{d:"M5 12h14",key:"1ays0h"}]],uc=ee("minus",lc);const dc=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],On=ee("plus",dc);const fc=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],pc=ee("search",fc);const hc=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],In=ee("trash-2",hc);const mc=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zt=ee("x",mc);function vc({label:e,checked:t,invalid:n=!1,description:r,intermediate:o=!1,disabled:s,onChange:a,className:c,...u}){const p=o?i.jsx(uc,{className:"h-3 w-3"}):i.jsx(po,{className:"h-3 w-3"});return i.jsxs("label",{className:`inline-flex items-start gap-2.5 ${s?"cursor-not-allowed":"cursor-pointer"} ${c||""}`,children:[i.jsxs("span",{className:"relative inline-flex h-6 w-6 items-center justify-center rounded-md","aria-hidden":!0,children:[i.jsx("input",{...u,type:"checkbox",checked:t,disabled:s,onChange:a,className:"absolute inset-0 m-0 h-full w-full cursor-inherit opacity-0"}),i.jsx("span",{className:`pointer-events-none inline-flex h-[14px] w-[14px] items-center justify-center rounded-[3px] text-[10px] transition-colors ${n?"border border-red-500 bg-red-500/15 text-status-danger":t||o?"mt-surface-input-accent border border-input-accent-background-default text-white":"mt-surface-input-default text-transparent"} ${s?"opacity-45":""}`,children:(t||o)&&p})]}),(e||r)&&i.jsxs("span",{className:"flex min-w-0 flex-col",children:[e&&i.jsx("span",{className:`text-sm leading-5 ${s?"":"text-text-primary"}`,children:e}),r?i.jsx("span",{className:"text-xs text-text-muted",children:r}):null]})]})}function Ir(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yt(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ir(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ir(e[o],null)}}}}function z(...e){return l.useCallback(Yt(...e),e)}function We(e){const t=gc(e),n=l.forwardRef((r,o)=>{const{children:s,...a}=r,c=l.Children.toArray(s),u=c.find(wc);if(u){const p=u.props.children,f=c.map(d=>d===u?l.Children.count(p)>1?l.Children.only(null):l.isValidElement(p)?p.props.children:null:d);return i.jsx(t,{...a,ref:o,children:l.isValidElement(p)?l.cloneElement(p,void 0,f):null})}return i.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function gc(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const a=Cc(o),c=yc(s,o.props);return o.type!==l.Fragment&&(c.ref=r?Yt(r,a):a),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vo=Symbol("radix.slottable");function xc(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=vo,t}function wc(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vo}function yc(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Cc(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 bc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],H=bc.reduce((e,t)=>{const n=We(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:a,...c}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function go(e,t){e&&Gt.flushSync(()=>e.dispatchEvent(t))}var xo=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"}),Sc="VisuallyHidden",wo=l.forwardRef((e,t)=>i.jsx(H.span,{...e,ref:t,style:{...xo,...e.style}}));wo.displayName=Sc;var Ec=wo;function Rc(e,t){const n=l.createContext(t),r=s=>{const{children:a,...c}=s,u=l.useMemo(()=>c,Object.values(c));return i.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function o(s){const a=l.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function ye(e,t=[]){let n=[];function r(s,a){const c=l.createContext(a),u=n.length;n=[...n,a];const p=d=>{const{scope:m,children:v,...x}=d,h=m?.[e]?.[u]||c,g=l.useMemo(()=>x,Object.values(x));return i.jsx(h.Provider,{value:g,children:v})};p.displayName=s+"Provider";function f(d,m){const v=m?.[e]?.[u]||c,x=l.useContext(v);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[p,f]}const o=()=>{const s=n.map(a=>l.createContext(a));return function(c){const u=c?.[e]||s;return l.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return o.scopeName=e,[r,Mc(o,...t)]}function Mc(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((c,{useScope:u,scopeName:p})=>{const d=u(s)[`__scope${p}`];return{...c,...d}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Jn(e){const t=e+"CollectionProvider",[n,r]=ye(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:g,children:w}=h,y=j.useRef(null),b=j.useRef(new Map).current;return i.jsx(o,{scope:g,itemMap:b,collectionRef:y,children:w})};a.displayName=t;const c=e+"CollectionSlot",u=We(c),p=j.forwardRef((h,g)=>{const{scope:w,children:y}=h,b=s(c,w),C=z(g,b.collectionRef);return i.jsx(u,{ref:C,children:y})});p.displayName=c;const f=e+"CollectionItemSlot",d="data-radix-collection-item",m=We(f),v=j.forwardRef((h,g)=>{const{scope:w,children:y,...b}=h,C=j.useRef(null),M=z(g,C),P=s(f,w);return j.useEffect(()=>(P.itemMap.set(C,{ref:C,...b}),()=>{P.itemMap.delete(C)})),i.jsx(m,{[d]:"",ref:M,children:y})});v.displayName=f;function x(h){const g=s(e+"CollectionConsumer",h);return j.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((P,R)=>b.indexOf(P.ref.current)-b.indexOf(R.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:p,ItemSlot:v},x,r]}function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var te=globalThis?.document?l.useLayoutEffect:()=>{},Nc=l[" useInsertionEffect ".trim().toString()]||te;function je({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=Pc({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o;{const f=l.useRef(e!==void 0);l.useEffect(()=>{const d=f.current;d!==c&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const p=l.useCallback(f=>{if(c){const d=_c(f)?f(e):f;d!==e&&a.current?.(d)}else s(f)},[c,e,s,a]);return[u,p]}function Pc({defaultProp:e,onChange:t}){const[n,r]=l.useState(e),o=l.useRef(n),s=l.useRef(t);return Nc(()=>{s.current=t},[t]),l.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function _c(e){return typeof e=="function"}function jc(e,t){return l.useReducer((n,r)=>t[n][r]??n,e)}var de=e=>{const{present:t,children:n}=e,r=Tc(t),o=typeof n=="function"?n({present:r.isPresent}):l.Children.only(n),s=z(r.ref,Ac(o));return typeof n=="function"||r.isPresent?l.cloneElement(o,{ref:s}):null};de.displayName="Presence";function Tc(e){const[t,n]=l.useState(),r=l.useRef(null),o=l.useRef(e),s=l.useRef("none"),a=e?"mounted":"unmounted",[c,u]=jc(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const p=Nt(r.current);s.current=c==="mounted"?p:"none"},[c]),te(()=>{const p=r.current,f=o.current;if(f!==e){const m=s.current,v=Nt(p);e?u("MOUNT"):v==="none"||p?.display==="none"?u("UNMOUNT"):u(f&&m!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),te(()=>{if(t){let p;const f=t.ownerDocument.defaultView??window,d=v=>{const h=Nt(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&h&&(u("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",p=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},m=v=>{v.target===t&&(s.current=Nt(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(p),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:l.useCallback(p=>{r.current=p?getComputedStyle(p):null,n(p)},[])}}function Nt(e){return e?.animationName||"none"}function Ac(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 Oc=l[" useId ".trim().toString()]||(()=>{}),Ic=0;function ie(e){const[t,n]=l.useState(Oc());return te(()=>{n(r=>r??String(Ic++))},[e]),t?`radix-${t}`:""}var Dc=l.createContext(void 0);function Qn(e){const t=l.useContext(Dc);return e||t||"ltr"}function ue(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...n)=>t.current?.(...n),[])}function kc(e,t=globalThis?.document){const n=ue(e);l.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Lc="DismissableLayer",Dn="dismissableLayer.update",$c="dismissableLayer.pointerDownOutside",Fc="dismissableLayer.focusOutside",Dr,yo=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tt=l.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...u}=e,p=l.useContext(yo),[f,d]=l.useState(null),m=f?.ownerDocument??globalThis?.document,[,v]=l.useState({}),x=z(t,R=>d(R)),h=Array.from(p.layers),[g]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),w=h.indexOf(g),y=f?h.indexOf(f):-1,b=p.layersWithOutsidePointerEventsDisabled.size>0,C=y>=w,M=Vc(R=>{const E=R.target,T=[...p.branches].some($=>$.contains(E));!C||T||(o?.(R),a?.(R),R.defaultPrevented||c?.())},m),P=Hc(R=>{const E=R.target;[...p.branches].some($=>$.contains(E))||(s?.(R),a?.(R),R.defaultPrevented||c?.())},m);return kc(R=>{y===p.layers.size-1&&(r?.(R),!R.defaultPrevented&&c&&(R.preventDefault(),c()))},m),l.useEffect(()=>{if(f)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Dr=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(f)),p.layers.add(f),kr(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Dr)}},[f,m,n,p]),l.useEffect(()=>()=>{f&&(p.layers.delete(f),p.layersWithOutsidePointerEventsDisabled.delete(f),kr())},[f,p]),l.useEffect(()=>{const R=()=>v({});return document.addEventListener(Dn,R),()=>document.removeEventListener(Dn,R)},[]),i.jsx(H.div,{...u,ref:x,style:{pointerEvents:b?C?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,P.onFocusCapture),onBlurCapture:A(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,M.onPointerDownCapture)})});tt.displayName=Lc;var Bc="DismissableLayerBranch",Wc=l.forwardRef((e,t)=>{const n=l.useContext(yo),r=l.useRef(null),o=z(t,r);return l.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),i.jsx(H.div,{...e,ref:o})});Wc.displayName=Bc;function Vc(e,t=globalThis?.document){const n=ue(e),r=l.useRef(!1),o=l.useRef(()=>{});return l.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let u=function(){Co($c,n,p,{discrete:!0})};const p={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Hc(e,t=globalThis?.document){const n=ue(e),r=l.useRef(!1);return l.useEffect(()=>{const o=s=>{s.target&&!r.current&&Co(Fc,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function kr(){const e=new CustomEvent(Dn);document.dispatchEvent(e)}function Co(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?go(o,s):o.dispatchEvent(s)}var wn="focusScope.autoFocusOnMount",yn="focusScope.autoFocusOnUnmount",Lr={bubbles:!1,cancelable:!0},Uc="FocusScope",ht=l.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[c,u]=l.useState(null),p=ue(o),f=ue(s),d=l.useRef(null),m=z(t,h=>u(h)),v=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let h=function(b){if(v.paused||!c)return;const C=b.target;c.contains(C)?d.current=C:Ne(d.current,{select:!0})},g=function(b){if(v.paused||!c)return;const C=b.relatedTarget;C!==null&&(c.contains(C)||Ne(d.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(const M of b)M.removedNodes.length>0&&Ne(c)};document.addEventListener("focusin",h),document.addEventListener("focusout",g);const y=new MutationObserver(w);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",g),y.disconnect()}}},[r,c,v.paused]),l.useEffect(()=>{if(c){Fr.add(v);const h=document.activeElement;if(!c.contains(h)){const w=new CustomEvent(wn,Lr);c.addEventListener(wn,p),c.dispatchEvent(w),w.defaultPrevented||(Kc(qc(bo(c)),{select:!0}),document.activeElement===h&&Ne(c))}return()=>{c.removeEventListener(wn,p),setTimeout(()=>{const w=new CustomEvent(yn,Lr);c.addEventListener(yn,f),c.dispatchEvent(w),w.defaultPrevented||Ne(h??document.body,{select:!0}),c.removeEventListener(yn,f),Fr.remove(v)},0)}}},[c,p,f,v]);const x=l.useCallback(h=>{if(!n&&!r||v.paused)return;const g=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,w=document.activeElement;if(g&&w){const y=h.currentTarget,[b,C]=Gc(y);b&&C?!h.shiftKey&&w===C?(h.preventDefault(),n&&Ne(b,{select:!0})):h.shiftKey&&w===b&&(h.preventDefault(),n&&Ne(C,{select:!0})):w===y&&h.preventDefault()}},[n,r,v.paused]);return i.jsx(H.div,{tabIndex:-1,...a,ref:m,onKeyDown:x})});ht.displayName=Uc;function Kc(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ne(r,{select:t}),document.activeElement!==n)return}function Gc(e){const t=bo(e),n=$r(t,e),r=$r(t.reverse(),e);return[n,r]}function bo(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $r(e,t){for(const n of e)if(!zc(n,{upTo:t}))return n}function zc(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 Yc(e){return e instanceof HTMLInputElement&&"select"in e}function Ne(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Yc(e)&&t&&e.select()}}var Fr=Xc();function Xc(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Br(e,t),e.unshift(t)},remove(t){e=Br(e,t),e[0]?.resume()}}}function Br(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qc(e){return e.filter(t=>t.tagName!=="A")}var Zc="Portal",nt=l.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=l.useState(!1);te(()=>s(!0),[]);const a=n||o&&globalThis?.document?.body;return a?co.createPortal(i.jsx(H.div,{...r,ref:t}),a):null});nt.displayName=Zc;var Cn=0;function Xt(){l.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wr()),document.body.insertAdjacentElement("beforeend",e[1]??Wr()),Cn++,()=>{Cn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Cn--}},[])}function Wr(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ve=function(){return ve=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ve.apply(this,arguments)};function So(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Jc(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var It="right-scroll-bar-position",Dt="width-before-scroll-bar",Qc="with-scroll-bars-hidden",el="--removed-body-scroll-bar-size";function bn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tl(e,t){var n=j.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var nl=typeof window<"u"?l.useLayoutEffect:l.useEffect,Vr=new WeakMap;function rl(e,t){var n=tl(null,function(r){return e.forEach(function(o){return bn(o,r)})});return nl(function(){var r=Vr.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(c){s.has(c)||bn(c,null)}),s.forEach(function(c){o.has(c)||bn(c,a)})}Vr.set(n,e)},[e]),n}function ol(e){return e}function sl(e,t){t===void 0&&(t=ol);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(s),a=n}var u=function(){var f=a;a=[],f.forEach(s)},p=function(){return Promise.resolve().then(u)};p(),n={push:function(f){a.push(f),p()},filter:function(f){return a=a.filter(f),n}}}};return o}function il(e){e===void 0&&(e={});var t=sl(null);return t.options=ve({async:!0,ssr:!1},e),t}var Eo=function(e){var t=e.sideCar,n=So(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return l.createElement(r,ve({},n))};Eo.isSideCarExport=!0;function al(e,t){return e.useMedium(t),Eo}var Ro=il(),Sn=function(){},qt=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:Sn,onWheelCapture:Sn,onTouchMoveCapture:Sn}),o=r[0],s=r[1],a=e.forwardProps,c=e.children,u=e.className,p=e.removeScrollBar,f=e.enabled,d=e.shards,m=e.sideCar,v=e.noRelative,x=e.noIsolation,h=e.inert,g=e.allowPinchZoom,w=e.as,y=w===void 0?"div":w,b=e.gapMode,C=So(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=m,P=rl([n,t]),R=ve(ve({},C),o);return l.createElement(l.Fragment,null,f&&l.createElement(M,{sideCar:Ro,removeScrollBar:p,shards:d,noRelative:v,noIsolation:x,inert:h,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?l.cloneElement(l.Children.only(c),ve(ve({},R),{ref:P})):l.createElement(y,ve({},R,{className:u,ref:P}),c))});qt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qt.classNames={fullWidth:Dt,zeroRight:It};var cl=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ll(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=cl();return t&&e.setAttribute("nonce",t),e}function ul(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dl(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var fl=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ll())&&(ul(t,n),dl(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pl=function(){var e=fl();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Mo=function(){var e=pl(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},hl={left:0,top:0,right:0,gap:0},En=function(e){return parseInt(e||"",10)||0},ml=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[En(n),En(r),En(o)]},vl=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return hl;var t=ml(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])}},gl=Mo(),qe="data-scroll-locked",xl=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
7
|
-
.`.concat(Qc,` {
|
|
8
|
-
overflow: hidden `).concat(r,`;
|
|
9
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
10
|
-
}
|
|
11
|
-
body[`).concat(qe,`] {
|
|
12
|
-
overflow: hidden `).concat(r,`;
|
|
13
|
-
overscroll-behavior: contain;
|
|
14
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
15
|
-
padding-left: `.concat(o,`px;
|
|
16
|
-
padding-top: `).concat(s,`px;
|
|
17
|
-
padding-right: `).concat(a,`px;
|
|
18
|
-
margin-left:0;
|
|
19
|
-
margin-top:0;
|
|
20
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
21
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.`).concat(It,` {
|
|
25
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.`).concat(Dt,` {
|
|
29
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.`).concat(It," .").concat(It,` {
|
|
33
|
-
right: 0 `).concat(r,`;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.`).concat(Dt," .").concat(Dt,` {
|
|
37
|
-
margin-right: 0 `).concat(r,`;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
body[`).concat(qe,`] {
|
|
41
|
-
`).concat(el,": ").concat(c,`px;
|
|
42
|
-
}
|
|
43
|
-
`)},Hr=function(){var e=parseInt(document.body.getAttribute(qe)||"0",10);return isFinite(e)?e:0},wl=function(){l.useEffect(function(){return document.body.setAttribute(qe,(Hr()+1).toString()),function(){var e=Hr()-1;e<=0?document.body.removeAttribute(qe):document.body.setAttribute(qe,e.toString())}},[])},yl=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;wl();var s=l.useMemo(function(){return vl(o)},[o]);return l.createElement(gl,{styles:xl(s,!t,o,n?"":"!important")})},kn=!1;if(typeof window<"u")try{var Pt=Object.defineProperty({},"passive",{get:function(){return kn=!0,!0}});window.addEventListener("test",Pt,Pt),window.removeEventListener("test",Pt,Pt)}catch{kn=!1}var ze=kn?{passive:!1}:!1,Cl=function(e){return e.tagName==="TEXTAREA"},No=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Cl(e)&&n[t]==="visible")},bl=function(e){return No(e,"overflowY")},Sl=function(e){return No(e,"overflowX")},Ur=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Po(e,r);if(o){var s=_o(e,r),a=s[1],c=s[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},El=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Rl=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Po=function(e,t){return e==="v"?bl(t):Sl(t)},_o=function(e,t){return e==="v"?El(t):Rl(t)},Ml=function(e,t){return e==="h"&&t==="rtl"?-1:1},Nl=function(e,t,n,r,o){var s=Ml(e,window.getComputedStyle(t).direction),a=s*r,c=n.target,u=t.contains(c),p=!1,f=a>0,d=0,m=0;do{if(!c)break;var v=_o(e,c),x=v[0],h=v[1],g=v[2],w=h-g-s*x;(x||w)&&Po(e,c)&&(d+=w,m+=x);var y=c.parentNode;c=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(d)<1||!f&&Math.abs(m)<1)&&(p=!0),p},_t=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Kr=function(e){return[e.deltaX,e.deltaY]},Gr=function(e){return e&&"current"in e?e.current:e},Pl=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_l=function(e){return`
|
|
44
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
45
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
46
|
-
`)},jl=0,Ye=[];function Tl(e){var t=l.useRef([]),n=l.useRef([0,0]),r=l.useRef(),o=l.useState(jl++)[0],s=l.useState(Mo)[0],a=l.useRef(e);l.useEffect(function(){a.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=Jc([e.lockRef.current],(e.shards||[]).map(Gr),!0).filter(Boolean);return h.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=l.useCallback(function(h,g){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var w=_t(h),y=n.current,b="deltaX"in h?h.deltaX:y[0]-w[0],C="deltaY"in h?h.deltaY:y[1]-w[1],M,P=h.target,R=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in h&&R==="h"&&P.type==="range")return!1;var E=window.getSelection(),T=E&&E.anchorNode,$=T?T===P||T.contains(P):!1;if($)return!1;var I=Ur(R,P);if(!I)return!0;if(I?M=R:(M=R==="v"?"h":"v",I=Ur(R,P)),!I)return!1;if(!r.current&&"changedTouches"in h&&(b||C)&&(r.current=M),!M)return!0;var N=r.current||M;return Nl(N,g,h,N==="h"?b:C)},[]),u=l.useCallback(function(h){var g=h;if(!(!Ye.length||Ye[Ye.length-1]!==s)){var w="deltaY"in g?Kr(g):_t(g),y=t.current.filter(function(M){return M.name===g.type&&(M.target===g.target||g.target===M.shadowParent)&&Pl(M.delta,w)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var b=(a.current.shards||[]).map(Gr).filter(Boolean).filter(function(M){return M.contains(g.target)}),C=b.length>0?c(g,b[0]):!a.current.noIsolation;C&&g.cancelable&&g.preventDefault()}}},[]),p=l.useCallback(function(h,g,w,y){var b={name:h,delta:g,target:w,should:y,shadowParent:Al(w)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),f=l.useCallback(function(h){n.current=_t(h),r.current=void 0},[]),d=l.useCallback(function(h){p(h.type,Kr(h),h.target,c(h,e.lockRef.current))},[]),m=l.useCallback(function(h){p(h.type,_t(h),h.target,c(h,e.lockRef.current))},[]);l.useEffect(function(){return Ye.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",u,ze),document.addEventListener("touchmove",u,ze),document.addEventListener("touchstart",f,ze),function(){Ye=Ye.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,ze),document.removeEventListener("touchmove",u,ze),document.removeEventListener("touchstart",f,ze)}},[]);var v=e.removeScrollBar,x=e.inert;return l.createElement(l.Fragment,null,x?l.createElement(s,{styles:_l(o)}):null,v?l.createElement(yl,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Al(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ol=al(Ro,Tl);var mt=l.forwardRef(function(e,t){return l.createElement(qt,ve({},e,{ref:t,sideCar:Ol}))});mt.classNames=qt.classNames;var Il=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xe=new WeakMap,jt=new WeakMap,Tt={},Rn=0,jo=function(e){return e&&(e.host||jo(e.parentNode))},Dl=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=jo(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kl=function(e,t,n,r){var o=Dl(t,Array.isArray(e)?e:[e]);Tt[n]||(Tt[n]=new WeakMap);var s=Tt[n],a=[],c=new Set,u=new Set(o),p=function(d){!d||c.has(d)||(c.add(d),p(d.parentNode))};o.forEach(p);var f=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(m){if(c.has(m))f(m);else try{var v=m.getAttribute(r),x=v!==null&&v!=="false",h=(Xe.get(m)||0)+1,g=(s.get(m)||0)+1;Xe.set(m,h),s.set(m,g),a.push(m),h===1&&x&&jt.set(m,!0),g===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};return f(t),c.clear(),Rn++,function(){a.forEach(function(d){var m=Xe.get(d)-1,v=s.get(d)-1;Xe.set(d,m),s.set(d,v),m||(jt.has(d)||d.removeAttribute(r),jt.delete(d)),v||d.removeAttribute(n)}),Rn--,Rn||(Xe=new WeakMap,Xe=new WeakMap,jt=new WeakMap,Tt={})}},Zt=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Il(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),kl(r,o,n,"aria-hidden")):function(){return null}},Jt="Dialog",[To]=ye(Jt),[Ll,me]=To(Jt),Ao=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,c=l.useRef(null),u=l.useRef(null),[p,f]=je({prop:r,defaultProp:o??!1,onChange:s,caller:Jt});return i.jsx(Ll,{scope:t,triggerRef:c,contentRef:u,contentId:ie(),titleId:ie(),descriptionId:ie(),open:p,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(d=>!d),[f]),modal:a,children:n})};Ao.displayName=Jt;var Oo="DialogTrigger",$l=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=me(Oo,n),s=z(t,o.triggerRef);return i.jsx(H.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":nr(o.open),...r,ref:s,onClick:A(e.onClick,o.onOpenToggle)})});$l.displayName=Oo;var er="DialogPortal",[Fl,Io]=To(er,{forceMount:void 0}),Do=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=me(er,t);return i.jsx(Fl,{scope:t,forceMount:n,children:l.Children.map(r,a=>i.jsx(de,{present:n||s.open,children:i.jsx(nt,{asChild:!0,container:o,children:a})}))})};Do.displayName=er;var Lt="DialogOverlay",ko=l.forwardRef((e,t)=>{const n=Io(Lt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=me(Lt,e.__scopeDialog);return s.modal?i.jsx(de,{present:r||s.open,children:i.jsx(Wl,{...o,ref:t})}):null});ko.displayName=Lt;var Bl=We("DialogOverlay.RemoveScroll"),Wl=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=me(Lt,n);return i.jsx(mt,{as:Bl,allowPinchZoom:!0,shards:[o.contentRef],children:i.jsx(H.div,{"data-state":nr(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ve="DialogContent",Lo=l.forwardRef((e,t)=>{const n=Io(Ve,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=me(Ve,e.__scopeDialog);return i.jsx(de,{present:r||s.open,children:s.modal?i.jsx(Vl,{...o,ref:t}):i.jsx(Hl,{...o,ref:t})})});Lo.displayName=Ve;var Vl=l.forwardRef((e,t)=>{const n=me(Ve,e.__scopeDialog),r=l.useRef(null),o=z(t,n.contentRef,r);return l.useEffect(()=>{const s=r.current;if(s)return Zt(s)},[]),i.jsx($o,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:A(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:A(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&s.preventDefault()}),onFocusOutside:A(e.onFocusOutside,s=>s.preventDefault())})}),Hl=l.forwardRef((e,t)=>{const n=me(Ve,e.__scopeDialog),r=l.useRef(!1),o=l.useRef(!1);return i.jsx($o,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),$o=l.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,c=me(Ve,n),u=l.useRef(null),p=z(t,u);return Xt(),i.jsxs(i.Fragment,{children:[i.jsx(ht,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:i.jsx(tt,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":nr(c.open),...a,ref:p,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(Ul,{titleId:c.titleId}),i.jsx(Gl,{contentRef:u,descriptionId:c.descriptionId})]})]})}),tr="DialogTitle",Fo=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=me(tr,n);return i.jsx(H.h2,{id:o.titleId,...r,ref:t})});Fo.displayName=tr;var Bo="DialogDescription",Wo=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=me(Bo,n);return i.jsx(H.p,{id:o.descriptionId,...r,ref:t})});Wo.displayName=Bo;var Vo="DialogClose",Ho=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=me(Vo,n);return i.jsx(H.button,{type:"button",...r,ref:t,onClick:A(e.onClick,()=>o.onOpenChange(!1))})});Ho.displayName=Vo;function nr(e){return e?"open":"closed"}var Uo="DialogTitleWarning",[mm,Ko]=Rc(Uo,{contentName:Ve,titleName:tr,docsSlug:"dialog"}),Ul=({titleId:e})=>{const t=Ko(Uo),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./MtAvatar-DvtEpPF_.cjs"),v=require("react");function Pe(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const l=Pe(v);const _e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ke=e.createLucideIcon("circle-alert",_e);const Oe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Se=e.createLucideIcon("circle-check",Oe);const Ae=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],$e=e.createLucideIcon("circle-x",Ae);const Le=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Fe=e.createLucideIcon("info",Le);var L="Dialog",[ee]=e.createContextScope(L),[He,y]=ee(L),te=t=>{const{__scopeDialog:r,children:n,open:s,defaultOpen:o,onOpenChange:a,modal:i=!0}=t,u=l.useRef(null),c=l.useRef(null),[x,d]=e.useControllableState({prop:s,defaultProp:o??!1,onChange:a,caller:L});return e.jsxRuntimeExports.jsx(He,{scope:r,triggerRef:u,contentRef:c,contentId:e.useId(),titleId:e.useId(),descriptionId:e.useId(),open:x,onOpenChange:d,onOpenToggle:l.useCallback(()=>d(p=>!p),[d]),modal:i,children:n})};te.displayName=L;var ne="DialogTrigger",Be=l.forwardRef((t,r)=>{const{__scopeDialog:n,...s}=t,o=y(ne,n),a=e.useComposedRefs(r,o.triggerRef);return e.jsxRuntimeExports.jsx(e.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":X(o.open),...s,ref:a,onClick:e.composeEventHandlers(t.onClick,o.onOpenToggle)})});Be.displayName=ne;var V="DialogPortal",[Ge,re]=ee(V,{forceMount:void 0}),se=t=>{const{__scopeDialog:r,forceMount:n,children:s,container:o}=t,a=y(V,r);return e.jsxRuntimeExports.jsx(Ge,{scope:r,forceMount:n,children:l.Children.map(s,i=>e.jsxRuntimeExports.jsx(e.Presence,{present:n||a.open,children:e.jsxRuntimeExports.jsx(e.Portal,{asChild:!0,container:o,children:i})}))})};se.displayName=V;var $="DialogOverlay",oe=l.forwardRef((t,r)=>{const n=re($,t.__scopeDialog),{forceMount:s=n.forceMount,...o}=t,a=y($,t.__scopeDialog);return a.modal?e.jsxRuntimeExports.jsx(e.Presence,{present:s||a.open,children:e.jsxRuntimeExports.jsx(ze,{...o,ref:r})}):null});oe.displayName=$;var We=e.createSlot("DialogOverlay.RemoveScroll"),ze=l.forwardRef((t,r)=>{const{__scopeDialog:n,...s}=t,o=y($,n);return e.jsxRuntimeExports.jsx(e.ReactRemoveScroll,{as:We,allowPinchZoom:!0,shards:[o.contentRef],children:e.jsxRuntimeExports.jsx(e.Primitive.div,{"data-state":X(o.open),...s,ref:r,style:{pointerEvents:"auto",...s.style}})})}),T="DialogContent",ae=l.forwardRef((t,r)=>{const n=re(T,t.__scopeDialog),{forceMount:s=n.forceMount,...o}=t,a=y(T,t.__scopeDialog);return e.jsxRuntimeExports.jsx(e.Presence,{present:s||a.open,children:a.modal?e.jsxRuntimeExports.jsx(Ve,{...o,ref:r}):e.jsxRuntimeExports.jsx(qe,{...o,ref:r})})});ae.displayName=T;var Ve=l.forwardRef((t,r)=>{const n=y(T,t.__scopeDialog),s=l.useRef(null),o=e.useComposedRefs(r,n.contentRef,s);return l.useEffect(()=>{const a=s.current;if(a)return e.hideOthers(a)},[]),e.jsxRuntimeExports.jsx(ie,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:e.composeEventHandlers(t.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:e.composeEventHandlers(t.onPointerDownOutside,a=>{const i=a.detail.originalEvent,u=i.button===0&&i.ctrlKey===!0;(i.button===2||u)&&a.preventDefault()}),onFocusOutside:e.composeEventHandlers(t.onFocusOutside,a=>a.preventDefault())})}),qe=l.forwardRef((t,r)=>{const n=y(T,t.__scopeDialog),s=l.useRef(!1),o=l.useRef(!1);return e.jsxRuntimeExports.jsx(ie,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(s.current||n.triggerRef.current?.focus(),a.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;n.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),ie=l.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=t,u=y(T,n),c=l.useRef(null),x=e.useComposedRefs(r,c);return e.useFocusGuards(),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:a,children:e.jsxRuntimeExports.jsx(e.DismissableLayer,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":X(u.open),...i,ref:x,onDismiss:()=>u.onOpenChange(!1)})}),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Xe,{titleId:u.titleId}),e.jsxRuntimeExports.jsx(Ue,{contentRef:c,descriptionId:u.descriptionId})]})]})}),q="DialogTitle",le=l.forwardRef((t,r)=>{const{__scopeDialog:n,...s}=t,o=y(q,n);return e.jsxRuntimeExports.jsx(e.Primitive.h2,{id:o.titleId,...s,ref:r})});le.displayName=q;var ce="DialogDescription",ue=l.forwardRef((t,r)=>{const{__scopeDialog:n,...s}=t,o=y(ce,n);return e.jsxRuntimeExports.jsx(e.Primitive.p,{id:o.descriptionId,...s,ref:r})});ue.displayName=ce;var de="DialogClose",xe=l.forwardRef((t,r)=>{const{__scopeDialog:n,...s}=t,o=y(de,n);return e.jsxRuntimeExports.jsx(e.Primitive.button,{type:"button",...s,ref:r,onClick:e.composeEventHandlers(t.onClick,()=>o.onOpenChange(!1))})});xe.displayName=de;function X(t){return t?"open":"closed"}var pe="DialogTitleWarning",[Bt,me]=e.createContext2(pe,{contentName:T,titleName:q,docsSlug:"dialog"}),Xe=({titleId:t})=>{const r=me(pe),n=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
|
|
47
2
|
|
|
48
|
-
If you want to hide the \`${
|
|
3
|
+
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
49
4
|
|
|
50
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Kl="DialogDescriptionWarning",Gl=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ko(Kl).contentName}}.`;return l.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},zl=Ao,Yl=Do,Xl=ko,ql=Lo,Zl=Fo,Jl=Wo,Ql=Ho;function eu(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function tu(e){const[t,n]=l.useState(void 0);return te(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,c;if("borderBoxSize"in s){const u=s.borderBoxSize,p=Array.isArray(u)?u[0]:u;a=p.inlineSize,c=p.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const nu=["top","right","bottom","left"],Te=Math.min,se=Math.max,$t=Math.round,At=Math.floor,xe=e=>({x:e,y:e}),ru={left:"right",right:"left",bottom:"top",top:"bottom"};function Ln(e,t,n){return se(e,Te(t,n))}function Ee(e,t){return typeof e=="function"?e(t):e}function Re(e){return e.split("-")[0]}function rt(e){return e.split("-")[1]}function rr(e){return e==="x"?"y":"x"}function or(e){return e==="y"?"height":"width"}function ge(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function sr(e){return rr(ge(e))}function ou(e,t,n){n===void 0&&(n=!1);const r=rt(e),o=sr(e),s=or(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Ft(a)),[a,Ft(a)]}function su(e){const t=Ft(e);return[$n(e),t,$n(t)]}function $n(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const zr=["left","right"],Yr=["right","left"],iu=["top","bottom"],au=["bottom","top"];function cu(e,t,n){switch(e){case"top":case"bottom":return n?t?Yr:zr:t?zr:Yr;case"left":case"right":return t?iu:au;default:return[]}}function lu(e,t,n,r){const o=rt(e);let s=cu(Re(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map($n)))),s}function Ft(e){const t=Re(e);return ru[t]+e.slice(t.length)}function uu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Go(e){return typeof e!="number"?uu(e):{top:e,right:e,bottom:e,left:e}}function Bt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xr(e,t,n){let{reference:r,floating:o}=e;const s=ge(t),a=sr(t),c=or(a),u=Re(t),p=s==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,m=r[c]/2-o[c]/2;let v;switch(u){case"top":v={x:f,y:r.y-o.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:d};break;case"left":v={x:r.x-o.width,y:d};break;default:v={x:r.x,y:r.y}}switch(rt(t)){case"start":v[a]-=m*(n&&p?-1:1);break;case"end":v[a]+=m*(n&&p?-1:1);break}return v}async function du(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:c,strategy:u}=e,{boundary:p="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:v=0}=Ee(t,e),x=Go(v),g=c[m?d==="floating"?"reference":"floating":d],w=Bt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:p,rootBoundary:f,strategy:u})),y=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),C=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},M=Bt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:b,strategy:u}):y);return{top:(w.top-M.top+x.top)/C.y,bottom:(M.bottom-w.bottom+x.bottom)/C.y,left:(w.left-M.left+x.left)/C.x,right:(M.right-w.right+x.right)/C.x}}const fu=50,pu=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:du},u=await(a.isRTL==null?void 0:a.isRTL(t));let p=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=Xr(p,r,u),m=r,v=0;const x={};for(let h=0;h<s.length;h++){const g=s[h];if(!g)continue;const{name:w,fn:y}=g,{x:b,y:C,data:M,reset:P}=await y({x:f,y:d,initialPlacement:r,placement:m,strategy:o,middlewareData:x,rects:p,platform:c,elements:{reference:e,floating:t}});f=b??f,d=C??d,x[w]={...x[w],...M},P&&v<fu&&(v++,typeof P=="object"&&(P.placement&&(m=P.placement),P.rects&&(p=P.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:f,y:d}=Xr(p,m,u)),h=-1)}return{x:f,y:d,placement:m,strategy:o,middlewareData:x}},hu=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:c,middlewareData:u}=t,{element:p,padding:f=0}=Ee(e,t)||{};if(p==null)return{};const d=Go(f),m={x:n,y:r},v=sr(o),x=or(v),h=await a.getDimensions(p),g=v==="y",w=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",C=s.reference[x]+s.reference[v]-m[v]-s.floating[x],M=m[v]-s.reference[v],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(p));let R=P?P[b]:0;(!R||!await(a.isElement==null?void 0:a.isElement(P)))&&(R=c.floating[b]||s.floating[x]);const E=C/2-M/2,T=R/2-h[x]/2-1,$=Te(d[w],T),I=Te(d[y],T),N=$,D=R-h[x]-I,k=R/2-h[x]/2+E,V=Ln(N,k,D),F=!u.arrow&&rt(o)!=null&&k!==V&&s.reference[x]/2-(k<N?$:I)-h[x]/2<0,W=F?k<N?k-N:k-D:0;return{[v]:m[v]+W,data:{[v]:V,centerOffset:k-V-W,...F&&{alignmentOffset:W}},reset:F}}}),mu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:c,platform:u,elements:p}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:h=!0,...g}=Ee(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=Re(o),y=ge(c),b=Re(c)===c,C=await(u.isRTL==null?void 0:u.isRTL(p.floating)),M=m||(b||!h?[Ft(c)]:su(c)),P=x!=="none";!m&&P&&M.push(...lu(c,h,x,C));const R=[c,...M],E=await u.detectOverflow(t,g),T=[];let $=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&T.push(E[w]),d){const k=ou(o,a,C);T.push(E[k[0]],E[k[1]])}if($=[...$,{placement:o,overflows:T}],!T.every(k=>k<=0)){var I,N;const k=(((I=s.flip)==null?void 0:I.index)||0)+1,V=R[k];if(V&&(!(d==="alignment"?y!==ge(V):!1)||$.every(L=>ge(L.placement)===y?L.overflows[0]>0:!0)))return{data:{index:k,overflows:$},reset:{placement:V}};let F=(N=$.filter(W=>W.overflows[0]<=0).sort((W,L)=>W.overflows[1]-L.overflows[1])[0])==null?void 0:N.placement;if(!F)switch(v){case"bestFit":{var D;const W=(D=$.filter(L=>{if(P){const O=ge(L.placement);return O===y||O==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(O=>O>0).reduce((O,X)=>O+X,0)]).sort((L,O)=>L[1]-O[1])[0])==null?void 0:D[0];W&&(F=W);break}case"initialPlacement":F=c;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function qr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zr(e){return nu.some(t=>e[t]>=0)}const vu=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Ee(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...s,elementContext:"reference"}),c=qr(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Zr(c)}}}case"escaped":{const a=await r.detectOverflow(t,{...s,altBoundary:!0}),c=qr(a,n.floating);return{data:{escapedOffsets:c,escaped:Zr(c)}}}default:return{}}}}},zo=new Set(["left","top"]);async function gu(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Re(n),c=rt(n),u=ge(n)==="y",p=zo.has(a)?-1:1,f=s&&u?-1:1,d=Ee(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof x=="number"&&(v=c==="end"?x*-1:x),u?{x:v*f,y:m*p}:{x:m*p,y:v*f}}const xu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:c}=t,u=await gu(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:a}}}}},wu=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:c=!1,limiter:u={fn:w=>{let{x:y,y:b}=w;return{x:y,y:b}}},...p}=Ee(e,t),f={x:n,y:r},d=await s.detectOverflow(t,p),m=ge(Re(o)),v=rr(m);let x=f[v],h=f[m];if(a){const w=v==="y"?"top":"left",y=v==="y"?"bottom":"right",b=x+d[w],C=x-d[y];x=Ln(b,x,C)}if(c){const w=m==="y"?"top":"left",y=m==="y"?"bottom":"right",b=h+d[w],C=h-d[y];h=Ln(b,h,C)}const g=u.fn({...t,[v]:x,[m]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[v]:a,[m]:c}}}}}},yu=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:p=!0}=Ee(e,t),f={x:n,y:r},d=ge(o),m=rr(d);let v=f[m],x=f[d];const h=Ee(c,t),g=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const b=m==="y"?"height":"width",C=s.reference[m]-s.floating[b]+g.mainAxis,M=s.reference[m]+s.reference[b]-g.mainAxis;v<C?v=C:v>M&&(v=M)}if(p){var w,y;const b=m==="y"?"width":"height",C=zo.has(Re(o)),M=s.reference[d]-s.floating[b]+(C&&((w=a.offset)==null?void 0:w[d])||0)+(C?0:g.crossAxis),P=s.reference[d]+s.reference[b]+(C?0:((y=a.offset)==null?void 0:y[d])||0)-(C?g.crossAxis:0);x<M?x=M:x>P&&(x=P)}return{[m]:v,[d]:x}}}},Cu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:c}=t,{apply:u=()=>{},...p}=Ee(e,t),f=await a.detectOverflow(t,p),d=Re(o),m=rt(o),v=ge(o)==="y",{width:x,height:h}=s.floating;let g,w;d==="top"||d==="bottom"?(g=d,w=m===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(w=d,g=m==="end"?"top":"bottom");const y=h-f.top-f.bottom,b=x-f.left-f.right,C=Te(h-f[g],y),M=Te(x-f[w],b),P=!t.middlewareData.shift;let R=C,E=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=y),P&&!m){const $=se(f.left,0),I=se(f.right,0),N=se(f.top,0),D=se(f.bottom,0);v?E=x-2*($!==0||I!==0?$+I:se(f.left,f.right)):R=h-2*(N!==0||D!==0?N+D:se(f.top,f.bottom))}await u({...t,availableWidth:E,availableHeight:R});const T=await a.getDimensions(c.floating);return x!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Qt(){return typeof window<"u"}function ot(e){return Yo(e)?(e.nodeName||"").toLowerCase():"#document"}function ae(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ce(e){var t;return(t=(Yo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yo(e){return Qt()?e instanceof Node||e instanceof ae(e).Node:!1}function pe(e){return Qt()?e instanceof Element||e instanceof ae(e).Element:!1}function Me(e){return Qt()?e instanceof HTMLElement||e instanceof ae(e).HTMLElement:!1}function Jr(e){return!Qt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ae(e).ShadowRoot}function vt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=he(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function bu(e){return/^(table|td|th)$/.test(ot(e))}function en(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Su=/transform|translate|scale|rotate|perspective|filter/,Eu=/paint|layout|strict|content/,Fe=e=>!!e&&e!=="none";let Mn;function ir(e){const t=pe(e)?he(e):e;return Fe(t.transform)||Fe(t.translate)||Fe(t.scale)||Fe(t.rotate)||Fe(t.perspective)||!ar()&&(Fe(t.backdropFilter)||Fe(t.filter))||Su.test(t.willChange||"")||Eu.test(t.contain||"")}function Ru(e){let t=Ae(e);for(;Me(t)&&!Je(t);){if(ir(t))return t;if(en(t))return null;t=Ae(t)}return null}function ar(){return Mn==null&&(Mn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Mn}function Je(e){return/^(html|body|#document)$/.test(ot(e))}function he(e){return ae(e).getComputedStyle(e)}function tn(e){return pe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ae(e){if(ot(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jr(e)&&e.host||Ce(e);return Jr(t)?t.host:t}function Xo(e){const t=Ae(e);return Je(t)?e.ownerDocument?e.ownerDocument.body:e.body:Me(t)&&vt(t)?t:Xo(t)}function ut(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Xo(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=ae(o);if(s){const c=Fn(a);return t.concat(a,a.visualViewport||[],vt(o)?o:[],c&&n?ut(c):[])}else return t.concat(o,ut(o,[],n))}function Fn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qo(e){const t=he(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Me(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,c=$t(n)!==s||$t(r)!==a;return c&&(n=s,r=a),{width:n,height:r,$:c}}function cr(e){return pe(e)?e:e.contextElement}function Ze(e){const t=cr(e);if(!Me(t))return xe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=qo(t);let a=(s?$t(n.width):n.width)/r,c=(s?$t(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Mu=xe(0);function Zo(e){const t=ae(e);return!ar()||!t.visualViewport?Mu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Nu(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ae(e)?!1:t}function He(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=cr(e);let a=xe(1);t&&(r?pe(r)&&(a=Ze(r)):a=Ze(e));const c=Nu(s,n,r)?Zo(s):xe(0);let u=(o.left+c.x)/a.x,p=(o.top+c.y)/a.y,f=o.width/a.x,d=o.height/a.y;if(s){const m=ae(s),v=r&&pe(r)?ae(r):r;let x=m,h=Fn(x);for(;h&&r&&v!==x;){const g=Ze(h),w=h.getBoundingClientRect(),y=he(h),b=w.left+(h.clientLeft+parseFloat(y.paddingLeft))*g.x,C=w.top+(h.clientTop+parseFloat(y.paddingTop))*g.y;u*=g.x,p*=g.y,f*=g.x,d*=g.y,u+=b,p+=C,x=ae(h),h=Fn(x)}}return Bt({width:f,height:d,x:u,y:p})}function nn(e,t){const n=tn(e).scrollLeft;return t?t.left+n:He(Ce(e)).left+n}function Jo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-nn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Pu(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=Ce(r),c=t?en(t.floating):!1;if(r===a||c&&s)return n;let u={scrollLeft:0,scrollTop:0},p=xe(1);const f=xe(0),d=Me(r);if((d||!d&&!s)&&((ot(r)!=="body"||vt(a))&&(u=tn(r)),d)){const v=He(r);p=Ze(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const m=a&&!d&&!s?Jo(a,u):xe(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-u.scrollLeft*p.x+f.x+m.x,y:n.y*p.y-u.scrollTop*p.y+f.y+m.y}}function _u(e){return Array.from(e.getClientRects())}function ju(e){const t=Ce(e),n=tn(e),r=e.ownerDocument.body,o=se(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=se(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+nn(e);const c=-n.scrollTop;return he(r).direction==="rtl"&&(a+=se(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:c}}const Qr=25;function Tu(e,t){const n=ae(e),r=Ce(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,c=0,u=0;if(o){s=o.width,a=o.height;const f=ar();(!f||f&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}const p=nn(r);if(p<=0){const f=r.ownerDocument,d=f.body,m=getComputedStyle(d),v=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-d.clientWidth-v);x<=Qr&&(s-=x)}else p<=Qr&&(s+=p);return{width:s,height:a,x:c,y:u}}function Au(e,t){const n=He(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Me(e)?Ze(e):xe(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,u=o*s.x,p=r*s.y;return{width:a,height:c,x:u,y:p}}function eo(e,t,n){let r;if(t==="viewport")r=Tu(e,n);else if(t==="document")r=ju(Ce(e));else if(pe(t))r=Au(t,n);else{const o=Zo(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Bt(r)}function Qo(e,t){const n=Ae(e);return n===t||!pe(n)||Je(n)?!1:he(n).position==="fixed"||Qo(n,t)}function Ou(e,t){const n=t.get(e);if(n)return n;let r=ut(e,[],!1).filter(c=>pe(c)&&ot(c)!=="body"),o=null;const s=he(e).position==="fixed";let a=s?Ae(e):e;for(;pe(a)&&!Je(a);){const c=he(a),u=ir(a);!u&&c.position==="fixed"&&(o=null),(s?!u&&!o:!u&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||vt(a)&&!u&&Qo(e,a))?r=r.filter(f=>f!==a):o=c,a=Ae(a)}return t.set(e,r),r}function Iu(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?en(t)?[]:Ou(t,this._c):[].concat(n),r],c=eo(t,a[0],o);let u=c.top,p=c.right,f=c.bottom,d=c.left;for(let m=1;m<a.length;m++){const v=eo(t,a[m],o);u=se(v.top,u),p=Te(v.right,p),f=Te(v.bottom,f),d=se(v.left,d)}return{width:p-d,height:f-u,x:d,y:u}}function Du(e){const{width:t,height:n}=qo(e);return{width:t,height:n}}function ku(e,t,n){const r=Me(t),o=Ce(t),s=n==="fixed",a=He(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=xe(0);function p(){u.x=nn(o)}if(r||!r&&!s)if((ot(t)!=="body"||vt(o))&&(c=tn(t)),r){const v=He(t,!0,s,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else o&&p();s&&!r&&o&&p();const f=o&&!r&&!s?Jo(o,c):xe(0),d=a.left+c.scrollLeft-u.x-f.x,m=a.top+c.scrollTop-u.y-f.y;return{x:d,y:m,width:a.width,height:a.height}}function Nn(e){return he(e).position==="static"}function to(e,t){if(!Me(e)||he(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ce(e)===n&&(n=n.ownerDocument.body),n}function es(e,t){const n=ae(e);if(en(e))return n;if(!Me(e)){let o=Ae(e);for(;o&&!Je(o);){if(pe(o)&&!Nn(o))return o;o=Ae(o)}return n}let r=to(e,t);for(;r&&bu(r)&&Nn(r);)r=to(r,t);return r&&Je(r)&&Nn(r)&&!ir(r)?n:r||Ru(e)||n}const Lu=async function(e){const t=this.getOffsetParent||es,n=this.getDimensions,r=await n(e.floating);return{reference:ku(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $u(e){return he(e).direction==="rtl"}const Fu={convertOffsetParentRelativeRectToViewportRelativeRect:Pu,getDocumentElement:Ce,getClippingRect:Iu,getOffsetParent:es,getElementRects:Lu,getClientRects:_u,getDimensions:Du,getScale:Ze,isElement:pe,isRTL:$u};function ts(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bu(e,t){let n=null,r;const o=Ce(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const p=e.getBoundingClientRect(),{left:f,top:d,width:m,height:v}=p;if(c||t(),!m||!v)return;const x=At(d),h=At(o.clientWidth-(f+m)),g=At(o.clientHeight-(d+v)),w=At(f),b={rootMargin:-x+"px "+-h+"px "+-g+"px "+-w+"px",threshold:se(0,Te(1,u))||1};let C=!0;function M(P){const R=P[0].intersectionRatio;if(R!==u){if(!C)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!ts(p,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(M,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(M,b)}n.observe(e)}return a(!0),s}function Wu(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,p=cr(e),f=o||s?[...p?ut(p):[],...t?ut(t):[]]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const d=p&&c?Bu(p,n):null;let m=-1,v=null;a&&(v=new ResizeObserver(w=>{let[y]=w;y&&y.target===p&&v&&t&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=v)==null||b.observe(t)})),n()}),p&&!u&&v.observe(p),t&&v.observe(t));let x,h=u?He(e):null;u&&g();function g(){const w=He(e);h&&!ts(h,w)&&n(),h=w,x=requestAnimationFrame(g)}return n(),()=>{var w;f.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),d?.(),(w=v)==null||w.disconnect(),v=null,u&&cancelAnimationFrame(x)}}const Vu=xu,Hu=wu,Uu=mu,Ku=Cu,Gu=vu,no=hu,zu=yu,Yu=(e,t,n)=>{const r=new Map,o={platform:Fu,...n},s={...o.platform,_c:r};return pu(e,t,{...o,platform:s})};var Xu=typeof document<"u",qu=function(){},kt=Xu?j.useLayoutEffect:qu;function Wt(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,o;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(!Wt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Wt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ns(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ro(e,t){const n=ns(e);return Math.round(t*n)/n}function Pn(e){const t=l.useRef(e);return kt(()=>{t.current=e}),t}function Zu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:u,open:p}=e,[f,d]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=l.useState(r);Wt(m,r)||v(r);const[x,h]=l.useState(null),[g,w]=l.useState(null),y=l.useCallback(L=>{L!==P.current&&(P.current=L,h(L))},[]),b=l.useCallback(L=>{L!==R.current&&(R.current=L,w(L))},[]),C=s||x,M=a||g,P=l.useRef(null),R=l.useRef(null),E=l.useRef(f),T=u!=null,$=Pn(u),I=Pn(o),N=Pn(p),D=l.useCallback(()=>{if(!P.current||!R.current)return;const L={placement:t,strategy:n,middleware:m};I.current&&(L.platform=I.current),Yu(P.current,R.current,L).then(O=>{const X={...O,isPositioned:N.current!==!1};k.current&&!Wt(E.current,X)&&(E.current=X,Gt.flushSync(()=>{d(X)}))})},[m,t,n,I,N]);kt(()=>{p===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(L=>({...L,isPositioned:!1})))},[p]);const k=l.useRef(!1);kt(()=>(k.current=!0,()=>{k.current=!1}),[]),kt(()=>{if(C&&(P.current=C),M&&(R.current=M),C&&M){if($.current)return $.current(C,M,D);D()}},[C,M,D,$,T]);const V=l.useMemo(()=>({reference:P,floating:R,setReference:y,setFloating:b}),[y,b]),F=l.useMemo(()=>({reference:C,floating:M}),[C,M]),W=l.useMemo(()=>{const L={position:n,left:0,top:0};if(!F.floating)return L;const O=ro(F.floating,f.x),X=ro(F.floating,f.y);return c?{...L,transform:"translate("+O+"px, "+X+"px)",...ns(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:X}},[n,c,F.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:D,refs:V,elements:F,floatingStyles:W}),[f,D,V,F,W])}const Ju=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?no({element:r.current,padding:o}).fn(n):{}:r?no({element:r,padding:o}).fn(n):{}}}},Qu=(e,t)=>{const n=Vu(e);return{name:n.name,fn:n.fn,options:[e,t]}},ed=(e,t)=>{const n=Hu(e);return{name:n.name,fn:n.fn,options:[e,t]}},td=(e,t)=>({fn:zu(e).fn,options:[e,t]}),nd=(e,t)=>{const n=Uu(e);return{name:n.name,fn:n.fn,options:[e,t]}},rd=(e,t)=>{const n=Ku(e);return{name:n.name,fn:n.fn,options:[e,t]}},od=(e,t)=>{const n=Gu(e);return{name:n.name,fn:n.fn,options:[e,t]}},sd=(e,t)=>{const n=Ju(e);return{name:n.name,fn:n.fn,options:[e,t]}};var id="Arrow",rs=l.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return i.jsx(H.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});rs.displayName=id;var ad=rs,lr="Popper",[os,Oe]=ye(lr),[cd,ss]=os(lr),is=e=>{const{__scopePopper:t,children:n}=e,[r,o]=l.useState(null);return i.jsx(cd,{scope:t,anchor:r,onAnchorChange:o,children:n})};is.displayName=lr;var as="PopperAnchor",cs=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=ss(as,n),a=l.useRef(null),c=z(t,a),u=l.useRef(null);return l.useEffect(()=>{const p=u.current;u.current=r?.current||a.current,p!==u.current&&s.onAnchorChange(u.current)}),r?null:i.jsx(H.div,{...o,ref:c})});cs.displayName=as;var ur="PopperContent",[ld,ud]=os(ur),ls=l.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:p=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:x,...h}=e,g=ss(ur,n),[w,y]=l.useState(null),b=z(t,_=>y(_)),[C,M]=l.useState(null),P=tu(C),R=P?.width??0,E=P?.height??0,T=r+(s!=="center"?"-"+s:""),$=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=Array.isArray(p)?p:[p],N=I.length>0,D={padding:$,boundary:I.filter(fd),altBoundary:N},{refs:k,floatingStyles:V,placement:F,isPositioned:W,middlewareData:L}=Zu({strategy:"fixed",placement:T,whileElementsMounted:(..._)=>Wu(..._,{animationFrame:v==="always"}),elements:{reference:g.anchor},middleware:[Qu({mainAxis:o+E,alignmentAxis:a}),u&&ed({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?td():void 0,...D}),u&&nd({...D}),rd({...D,apply:({elements:_,rects:G,availableWidth:J,availableHeight:Y})=>{const{width:q,height:Z}=G.reference,ce=_.floating.style;ce.setProperty("--radix-popper-available-width",`${J}px`),ce.setProperty("--radix-popper-available-height",`${Y}px`),ce.setProperty("--radix-popper-anchor-width",`${q}px`),ce.setProperty("--radix-popper-anchor-height",`${Z}px`)}}),C&&sd({element:C,padding:c}),pd({arrowWidth:R,arrowHeight:E}),m&&od({strategy:"referenceHidden",...D})]}),[O,X]=fs(F),S=ue(x);te(()=>{W&&S?.()},[W,S]);const B=L.arrow?.x,U=L.arrow?.y,K=L.arrow?.centerOffset!==0,[oe,Q]=l.useState();return te(()=>{w&&Q(window.getComputedStyle(w).zIndex)},[w]),i.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:W?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(ld,{scope:n,placedSide:O,onArrowChange:M,arrowX:B,arrowY:U,shouldHideArrow:K,children:i.jsx(H.div,{"data-side":O,"data-align":X,...h,ref:b,style:{...h.style,animation:W?void 0:"none"}})})})});ls.displayName=ur;var us="PopperArrow",dd={top:"bottom",right:"left",bottom:"top",left:"right"},ds=l.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=ud(us,r),a=dd[s.placedSide];return i.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:i.jsx(ad,{...o,ref:n,style:{...o.style,display:"block"}})})});ds.displayName=us;function fd(e){return e!==null}var pd=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[p,f]=fs(n),d={start:"0%",center:"50%",end:"100%"}[f],m=(o.arrow?.x??0)+c/2,v=(o.arrow?.y??0)+u/2;let x="",h="";return p==="bottom"?(x=a?d:`${m}px`,h=`${-u}px`):p==="top"?(x=a?d:`${m}px`,h=`${r.floating.height+u}px`):p==="right"?(x=`${-u}px`,h=a?d:`${v}px`):p==="left"&&(x=`${r.floating.width+u}px`,h=a?d:`${v}px`),{data:{x,y:h}}}});function fs(e){const[t,n="center"]=e.split("-");return[t,n]}var gt=is,xt=cs,rn=ls,on=ds,_n="rovingFocusGroup.onEntryFocus",hd={bubbles:!1,cancelable:!0},wt="RovingFocusGroup",[Bn,ps,md]=Jn(wt),[vd,hs]=ye(wt,[md]),[gd,xd]=vd(wt),ms=l.forwardRef((e,t)=>i.jsx(Bn.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Bn.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(wd,{...e,ref:t})})}));ms.displayName=wt;var wd=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:p,preventScrollOnEntryFocus:f=!1,...d}=e,m=l.useRef(null),v=z(t,m),x=Qn(s),[h,g]=je({prop:a,defaultProp:c??null,onChange:u,caller:wt}),[w,y]=l.useState(!1),b=ue(p),C=ps(n),M=l.useRef(!1),[P,R]=l.useState(0);return l.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(_n,b),()=>E.removeEventListener(_n,b)},[b]),i.jsx(gd,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:h,onItemFocus:l.useCallback(E=>g(E),[g]),onItemShiftTab:l.useCallback(()=>y(!0),[]),onFocusableItemAdd:l.useCallback(()=>R(E=>E+1),[]),onFocusableItemRemove:l.useCallback(()=>R(E=>E-1),[]),children:i.jsx(H.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:A(e.onMouseDown,()=>{M.current=!0}),onFocus:A(e.onFocus,E=>{const T=!M.current;if(E.target===E.currentTarget&&T&&!w){const $=new CustomEvent(_n,hd);if(E.currentTarget.dispatchEvent($),!$.defaultPrevented){const I=C().filter(F=>F.focusable),N=I.find(F=>F.active),D=I.find(F=>F.id===h),V=[N,D,...I].filter(Boolean).map(F=>F.ref.current);xs(V,f)}}M.current=!1}),onBlur:A(e.onBlur,()=>y(!1))})})}),vs="RovingFocusGroupItem",gs=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...c}=e,u=ie(),p=s||u,f=xd(vs,n),d=f.currentTabStopId===p,m=ps(n),{onFocusableItemAdd:v,onFocusableItemRemove:x,currentTabStopId:h}=f;return l.useEffect(()=>{if(r)return v(),()=>x()},[r,v,x]),i.jsx(Bn.ItemSlot,{scope:n,id:p,focusable:r,active:o,children:i.jsx(H.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:A(e.onMouseDown,g=>{r?f.onItemFocus(p):g.preventDefault()}),onFocus:A(e.onFocus,()=>f.onItemFocus(p)),onKeyDown:A(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const w=bd(g,f.orientation,f.dir);if(w!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=m().filter(C=>C.focusable).map(C=>C.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const C=b.indexOf(g.currentTarget);b=f.loop?Sd(b,C+1):b.slice(C+1)}setTimeout(()=>xs(b))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:h!=null}):a})})});gs.displayName=vs;var yd={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cd(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function bd(e,t,n){const r=Cd(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return yd[r]}function xs(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Sd(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ed=ms,Rd=gs,Wn=["Enter"," "],Md=["ArrowDown","PageUp","Home"],ws=["ArrowUp","PageDown","End"],Nd=[...Md,...ws],Pd={ltr:[...Wn,"ArrowRight"],rtl:[...Wn,"ArrowLeft"]},_d={ltr:["ArrowLeft"],rtl:["ArrowRight"]},yt="Menu",[dt,jd,Td]=Jn(yt),[Ge,sn]=ye(yt,[Td,Oe,hs]),Ct=Oe(),ys=hs(),[Cs,Ie]=Ge(yt),[Ad,bt]=Ge(yt),bs=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=e,c=Ct(t),[u,p]=l.useState(null),f=l.useRef(!1),d=ue(s),m=Qn(o);return l.useEffect(()=>{const v=()=>{f.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>f.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),i.jsx(gt,{...c,children:i.jsx(Cs,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:p,children:i.jsx(Ad,{scope:t,onClose:l.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:m,modal:a,children:r})})})};bs.displayName=yt;var Od="MenuAnchor",dr=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Ct(n);return i.jsx(xt,{...o,...r,ref:t})});dr.displayName=Od;var fr="MenuPortal",[Id,Ss]=Ge(fr,{forceMount:void 0}),Es=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Ie(fr,t);return i.jsx(Id,{scope:t,forceMount:n,children:i.jsx(de,{present:n||s.open,children:i.jsx(nt,{asChild:!0,container:o,children:r})})})};Es.displayName=fr;var le="MenuContent",[Dd,pr]=Ge(le),Rs=l.forwardRef((e,t)=>{const n=Ss(le,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Ie(le,e.__scopeMenu),a=bt(le,e.__scopeMenu);return i.jsx(dt.Provider,{scope:e.__scopeMenu,children:i.jsx(de,{present:r||s.open,children:i.jsx(dt.Slot,{scope:e.__scopeMenu,children:a.modal?i.jsx(kd,{...o,ref:t}):i.jsx(Ld,{...o,ref:t})})})})}),kd=l.forwardRef((e,t)=>{const n=Ie(le,e.__scopeMenu),r=l.useRef(null),o=z(t,r);return l.useEffect(()=>{const s=r.current;if(s)return Zt(s)},[]),i.jsx(hr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:A(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ld=l.forwardRef((e,t)=>{const n=Ie(le,e.__scopeMenu);return i.jsx(hr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$d=We("MenuContent.ScrollLock"),hr=l.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:v,disableOutsideScroll:x,...h}=e,g=Ie(le,n),w=bt(le,n),y=Ct(n),b=ys(n),C=jd(n),[M,P]=l.useState(null),R=l.useRef(null),E=z(t,R,g.onContentChange),T=l.useRef(0),$=l.useRef(""),I=l.useRef(0),N=l.useRef(null),D=l.useRef("right"),k=l.useRef(0),V=x?mt:l.Fragment,F=x?{as:$d,allowPinchZoom:!0}:void 0,W=O=>{const X=$.current+O,S=C().filter(_=>!_.disabled),B=document.activeElement,U=S.find(_=>_.ref.current===B)?.textValue,K=S.map(_=>_.textValue),oe=qd(K,X,U),Q=S.find(_=>_.textValue===oe)?.ref.current;(function _(G){$.current=G,window.clearTimeout(T.current),G!==""&&(T.current=window.setTimeout(()=>_(""),1e3))})(X),Q&&setTimeout(()=>Q.focus())};l.useEffect(()=>()=>window.clearTimeout(T.current),[]),Xt();const L=l.useCallback(O=>D.current===N.current?.side&&Jd(O,N.current?.area),[]);return i.jsx(Dd,{scope:n,searchRef:$,onItemEnter:l.useCallback(O=>{L(O)&&O.preventDefault()},[L]),onItemLeave:l.useCallback(O=>{L(O)||(R.current?.focus(),P(null))},[L]),onTriggerLeave:l.useCallback(O=>{L(O)&&O.preventDefault()},[L]),pointerGraceTimerRef:I,onPointerGraceIntentChange:l.useCallback(O=>{N.current=O},[]),children:i.jsx(V,{...F,children:i.jsx(ht,{asChild:!0,trapped:o,onMountAutoFocus:A(s,O=>{O.preventDefault(),R.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:i.jsx(tt,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:v,children:i.jsx(Ed,{asChild:!0,...b,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:M,onCurrentTabStopIdChange:P,onEntryFocus:A(u,O=>{w.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(rn,{role:"menu","aria-orientation":"vertical","data-state":Vs(g.open),"data-radix-menu-content":"",dir:w.dir,...y,...h,ref:E,style:{outline:"none",...h.style},onKeyDown:A(h.onKeyDown,O=>{const S=O.target.closest("[data-radix-menu-content]")===O.currentTarget,B=O.ctrlKey||O.altKey||O.metaKey,U=O.key.length===1;S&&(O.key==="Tab"&&O.preventDefault(),!B&&U&&W(O.key));const K=R.current;if(O.target!==K||!Nd.includes(O.key))return;O.preventDefault();const Q=C().filter(_=>!_.disabled).map(_=>_.ref.current);ws.includes(O.key)&&Q.reverse(),Yd(Q)}),onBlur:A(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(T.current),$.current="")}),onPointerMove:A(e.onPointerMove,ft(O=>{const X=O.target,S=k.current!==O.clientX;if(O.currentTarget.contains(X)&&S){const B=O.clientX>k.current?"right":"left";D.current=B,k.current=O.clientX}}))})})})})})})});Rs.displayName=le;var Fd="MenuGroup",mr=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(H.div,{role:"group",...r,ref:t})});mr.displayName=Fd;var Bd="MenuLabel",Ms=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(H.div,{...r,ref:t})});Ms.displayName=Bd;var Vt="MenuItem",oo="menu.itemSelect",an=l.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=l.useRef(null),a=bt(Vt,e.__scopeMenu),c=pr(Vt,e.__scopeMenu),u=z(t,s),p=l.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const m=new CustomEvent(oo,{bubbles:!0,cancelable:!0});d.addEventListener(oo,v=>r?.(v),{once:!0}),go(d,m),m.defaultPrevented?p.current=!1:a.onClose()}};return i.jsx(Ns,{...o,ref:u,disabled:n,onClick:A(e.onClick,f),onPointerDown:d=>{e.onPointerDown?.(d),p.current=!0},onPointerUp:A(e.onPointerUp,d=>{p.current||d.currentTarget?.click()}),onKeyDown:A(e.onKeyDown,d=>{const m=c.searchRef.current!=="";n||m&&d.key===" "||Wn.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});an.displayName=Vt;var Ns=l.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,a=pr(Vt,n),c=ys(n),u=l.useRef(null),p=z(t,u),[f,d]=l.useState(!1),[m,v]=l.useState("");return l.useEffect(()=>{const x=u.current;x&&v((x.textContent??"").trim())},[s.children]),i.jsx(dt.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:i.jsx(Rd,{asChild:!0,...c,focusable:!r,children:i.jsx(H.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:p,onPointerMove:A(e.onPointerMove,ft(x=>{r?a.onItemLeave(x):(a.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:A(e.onPointerLeave,ft(x=>a.onItemLeave(x))),onFocus:A(e.onFocus,()=>d(!0)),onBlur:A(e.onBlur,()=>d(!1))})})})}),Wd="MenuCheckboxItem",Ps=l.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return i.jsx(Os,{scope:e.__scopeMenu,checked:n,children:i.jsx(an,{role:"menuitemcheckbox","aria-checked":Ht(n)?"mixed":n,...o,ref:t,"data-state":xr(n),onSelect:A(o.onSelect,()=>r?.(Ht(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ps.displayName=Wd;var _s="MenuRadioGroup",[Vd,Hd]=Ge(_s,{value:void 0,onValueChange:()=>{}}),js=l.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=ue(r);return i.jsx(Vd,{scope:e.__scopeMenu,value:n,onValueChange:s,children:i.jsx(mr,{...o,ref:t})})});js.displayName=_s;var Ts="MenuRadioItem",As=l.forwardRef((e,t)=>{const{value:n,...r}=e,o=Hd(Ts,e.__scopeMenu),s=n===o.value;return i.jsx(Os,{scope:e.__scopeMenu,checked:s,children:i.jsx(an,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":xr(s),onSelect:A(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});As.displayName=Ts;var vr="MenuItemIndicator",[Os,Ud]=Ge(vr,{checked:!1}),Is=l.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Ud(vr,n);return i.jsx(de,{present:r||Ht(s.checked)||s.checked===!0,children:i.jsx(H.span,{...o,ref:t,"data-state":xr(s.checked)})})});Is.displayName=vr;var Kd="MenuSeparator",Ds=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(H.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Ds.displayName=Kd;var Gd="MenuArrow",ks=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Ct(n);return i.jsx(on,{...o,...r,ref:t})});ks.displayName=Gd;var gr="MenuSub",[zd,Ls]=Ge(gr),$s=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=Ie(gr,t),a=Ct(t),[c,u]=l.useState(null),[p,f]=l.useState(null),d=ue(o);return l.useEffect(()=>(s.open===!1&&d(!1),()=>d(!1)),[s.open,d]),i.jsx(gt,{...a,children:i.jsx(Cs,{scope:t,open:r,onOpenChange:d,content:p,onContentChange:f,children:i.jsx(zd,{scope:t,contentId:ie(),triggerId:ie(),trigger:c,onTriggerChange:u,children:n})})})};$s.displayName=gr;var ct="MenuSubTrigger",Fs=l.forwardRef((e,t)=>{const n=Ie(ct,e.__scopeMenu),r=bt(ct,e.__scopeMenu),o=Ls(ct,e.__scopeMenu),s=pr(ct,e.__scopeMenu),a=l.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,p={__scopeMenu:e.__scopeMenu},f=l.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return l.useEffect(()=>f,[f]),l.useEffect(()=>{const d=c.current;return()=>{window.clearTimeout(d),u(null)}},[c,u]),i.jsx(dr,{asChild:!0,...p,children:i.jsx(Ns,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Vs(n.open),...e,ref:Yt(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:A(e.onPointerMove,ft(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:A(e.onPointerLeave,ft(d=>{f();const m=n.content?.getBoundingClientRect();if(m){const v=n.content?.dataset.side,x=v==="right",h=x?-5:5,g=m[x?"left":"right"],w=m[x?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:g,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:g,y:m.bottom}],side:v}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:A(e.onKeyDown,d=>{const m=s.searchRef.current!=="";e.disabled||m&&d.key===" "||Pd[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});Fs.displayName=ct;var Bs="MenuSubContent",Ws=l.forwardRef((e,t)=>{const n=Ss(le,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Ie(le,e.__scopeMenu),a=bt(le,e.__scopeMenu),c=Ls(Bs,e.__scopeMenu),u=l.useRef(null),p=z(t,u);return i.jsx(dt.Provider,{scope:e.__scopeMenu,children:i.jsx(de,{present:r||s.open,children:i.jsx(dt.Slot,{scope:e.__scopeMenu,children:i.jsx(hr,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:p,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{a.isUsingKeyboardRef.current&&u.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:A(e.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:A(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:A(e.onKeyDown,f=>{const d=f.currentTarget.contains(f.target),m=_d[a.dir].includes(f.key);d&&m&&(s.onOpenChange(!1),c.trigger?.focus(),f.preventDefault())})})})})})});Ws.displayName=Bs;function Vs(e){return e?"open":"closed"}function Ht(e){return e==="indeterminate"}function xr(e){return Ht(e)?"indeterminate":e?"checked":"unchecked"}function Yd(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Xd(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function qd(e,t,n){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Xd(e,Math.max(s,0));o.length===1&&(a=a.filter(p=>p!==n));const u=a.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function Zd(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const c=t[s],u=t[a],p=c.x,f=c.y,d=u.x,m=u.y;f>r!=m>r&&n<(d-p)*(r-f)/(m-f)+p&&(o=!o)}return o}function Jd(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Zd(n,t)}function ft(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Hs=bs,Us=dr,Ks=Es,Gs=Rs,zs=mr,Ys=Ms,Xs=an,qs=Ps,Zs=js,Js=As,Qs=Is,ei=Ds,ti=ks,Qd=$s,ni=Fs,ri=Ws,wr="ContextMenu",[ef]=ye(wr,[sn]),ne=sn(),[tf,oi]=ef(wr),si=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:s=!0}=e,[a,c]=l.useState(!1),u=ne(t),p=ue(r),f=l.useCallback(d=>{c(d),p(d)},[p]);return i.jsx(tf,{scope:t,open:a,onOpenChange:f,modal:s,children:i.jsx(Hs,{...u,dir:o,open:a,onOpenChange:f,modal:s,children:n})})};si.displayName=wr;var ii="ContextMenuTrigger",ai=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=e,s=oi(ii,n),a=ne(n),c=l.useRef({x:0,y:0}),u=l.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),p=l.useRef(0),f=l.useCallback(()=>window.clearTimeout(p.current),[]),d=m=>{c.current={x:m.clientX,y:m.clientY},s.onOpenChange(!0)};return l.useEffect(()=>f,[f]),l.useEffect(()=>{r&&f()},[r,f]),i.jsxs(i.Fragment,{children:[i.jsx(Us,{...a,virtualRef:u}),i.jsx(H.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:A(e.onContextMenu,m=>{f(),d(m),m.preventDefault()}),onPointerDown:r?e.onPointerDown:A(e.onPointerDown,Ot(m=>{f(),p.current=window.setTimeout(()=>d(m),700)})),onPointerMove:r?e.onPointerMove:A(e.onPointerMove,Ot(f)),onPointerCancel:r?e.onPointerCancel:A(e.onPointerCancel,Ot(f)),onPointerUp:r?e.onPointerUp:A(e.onPointerUp,Ot(f))})]})});ai.displayName=ii;var nf="ContextMenuPortal",ci=e=>{const{__scopeContextMenu:t,...n}=e,r=ne(t);return i.jsx(Ks,{...r,...n})};ci.displayName=nf;var li="ContextMenuContent",ui=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=oi(li,n),s=ne(n),a=l.useRef(!1);return i.jsx(Gs,{...s,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),!c.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ui.displayName=li;var rf="ContextMenuGroup",of=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=ne(n);return i.jsx(zs,{...o,...r,ref:t})});of.displayName=rf;var sf="ContextMenuLabel",af=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=ne(n);return i.jsx(Ys,{...o,...r,ref:t})});af.displayName=sf;var cf="ContextMenuItem",di=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=ne(n);return i.jsx(Xs,{...o,...r,ref:t})});di.displayName=cf;var lf="ContextMenuCheckboxItem",uf=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=ne(n);return i.jsx(qs,{...o,...r,ref:t})});uf.displayName=lf;var df="ContextMenuRadioGroup",ff=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=ne(n);return i.jsx(Zs,{...o,...r,ref:t})});ff.displayName=df;var pf="ContextMenuRadioItem",hf=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=ne(n);return i.jsx(Js,{...o,...r,ref:t})});hf.displayName=pf;var mf="ContextMenuItemIndicator",vf=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=ne(n);return i.jsx(Qs,{...o,...r,ref:t})});vf.displayName=mf;var gf="ContextMenuSeparator",fi=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=ne(n);return i.jsx(ei,{...o,...r,ref:t})});fi.displayName=gf;var xf="ContextMenuArrow",wf=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=ne(n);return i.jsx(ti,{...o,...r,ref:t})});wf.displayName=xf;var pi="ContextMenuSub",hi=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:o,defaultOpen:s}=e,a=ne(t),[c,u]=je({prop:o,defaultProp:s??!1,onChange:r,caller:pi});return i.jsx(Qd,{...a,open:c,onOpenChange:u,children:n})};hi.displayName=pi;var yf="ContextMenuSubTrigger",mi=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=ne(n);return i.jsx(ni,{...o,...r,ref:t})});mi.displayName=yf;var Cf="ContextMenuSubContent",vi=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=ne(n);return i.jsx(ri,{...o,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});vi.displayName=Cf;function Ot(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var bf=si,Sf=ai,gi=ci,Ef=ui,Rf=di,xi=fi,Mf=hi,Nf=mi,Pf=vi,cn="DropdownMenu",[_f]=ye(cn,[sn]),re=sn(),[jf,wi]=_f(cn),yi=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:a,modal:c=!0}=e,u=re(t),p=l.useRef(null),[f,d]=je({prop:o,defaultProp:s??!1,onChange:a,caller:cn});return i.jsx(jf,{scope:t,triggerId:ie(),triggerRef:p,contentId:ie(),open:f,onOpenChange:d,onOpenToggle:l.useCallback(()=>d(m=>!m),[d]),modal:c,children:i.jsx(Hs,{...u,open:f,onOpenChange:d,dir:r,modal:c,children:n})})};yi.displayName=cn;var Ci="DropdownMenuTrigger",bi=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=wi(Ci,n),a=re(n);return i.jsx(Us,{asChild:!0,...a,children:i.jsx(H.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Yt(t,s.triggerRef),onPointerDown:A(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:A(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});bi.displayName=Ci;var Tf="DropdownMenuPortal",Si=e=>{const{__scopeDropdownMenu:t,...n}=e,r=re(t);return i.jsx(Ks,{...r,...n})};Si.displayName=Tf;var Ei="DropdownMenuContent",Ri=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=wi(Ei,n),s=re(n),a=l.useRef(!1);return i.jsx(Gs,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:A(e.onCloseAutoFocus,c=>{a.current||o.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:A(e.onInteractOutside,c=>{const u=c.detail.originalEvent,p=u.button===0&&u.ctrlKey===!0,f=u.button===2||p;(!o.modal||f)&&(a.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)"}})});Ri.displayName=Ei;var Af="DropdownMenuGroup",Of=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return i.jsx(zs,{...o,...r,ref:t})});Of.displayName=Af;var If="DropdownMenuLabel",Df=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return i.jsx(Ys,{...o,...r,ref:t})});Df.displayName=If;var kf="DropdownMenuItem",Mi=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return i.jsx(Xs,{...o,...r,ref:t})});Mi.displayName=kf;var Lf="DropdownMenuCheckboxItem",$f=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return i.jsx(qs,{...o,...r,ref:t})});$f.displayName=Lf;var Ff="DropdownMenuRadioGroup",Bf=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return i.jsx(Zs,{...o,...r,ref:t})});Bf.displayName=Ff;var Wf="DropdownMenuRadioItem",Vf=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return i.jsx(Js,{...o,...r,ref:t})});Vf.displayName=Wf;var Hf="DropdownMenuItemIndicator",Uf=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return i.jsx(Qs,{...o,...r,ref:t})});Uf.displayName=Hf;var Kf="DropdownMenuSeparator",Gf=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return i.jsx(ei,{...o,...r,ref:t})});Gf.displayName=Kf;var zf="DropdownMenuArrow",Yf=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return i.jsx(ti,{...o,...r,ref:t})});Yf.displayName=zf;var Xf="DropdownMenuSubTrigger",qf=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return i.jsx(ni,{...o,...r,ref:t})});qf.displayName=Xf;var Zf="DropdownMenuSubContent",Jf=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return i.jsx(ri,{...o,...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)"}})});Jf.displayName=Zf;var Qf=yi,ep=bi,tp=Si,np=Ri,rp=Mi;function so(e,[t,n]){return Math.min(n,Math.max(t,e))}var ln="Popover",[Ni]=ye(ln,[Oe]),St=Oe(),[op,De]=Ni(ln),Pi=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!1}=e,c=St(t),u=l.useRef(null),[p,f]=l.useState(!1),[d,m]=je({prop:r,defaultProp:o??!1,onChange:s,caller:ln});return i.jsx(gt,{...c,children:i.jsx(op,{scope:t,contentId:ie(),triggerRef:u,open:d,onOpenChange:m,onOpenToggle:l.useCallback(()=>m(v=>!v),[m]),hasCustomAnchor:p,onCustomAnchorAdd:l.useCallback(()=>f(!0),[]),onCustomAnchorRemove:l.useCallback(()=>f(!1),[]),modal:a,children:n})})};Pi.displayName=ln;var _i="PopoverAnchor",sp=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=De(_i,n),s=St(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=o;return l.useEffect(()=>(a(),()=>c()),[a,c]),i.jsx(xt,{...s,...r,ref:t})});sp.displayName=_i;var ji="PopoverTrigger",Ti=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=De(ji,n),s=St(n),a=z(t,o.triggerRef),c=i.jsx(H.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Li(o.open),...r,ref:a,onClick:A(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:i.jsx(xt,{asChild:!0,...s,children:c})});Ti.displayName=ji;var yr="PopoverPortal",[ip,ap]=Ni(yr,{forceMount:void 0}),Ai=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=De(yr,t);return i.jsx(ip,{scope:t,forceMount:n,children:i.jsx(de,{present:n||s.open,children:i.jsx(nt,{asChild:!0,container:o,children:r})})})};Ai.displayName=yr;var Qe="PopoverContent",Oi=l.forwardRef((e,t)=>{const n=ap(Qe,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=De(Qe,e.__scopePopover);return i.jsx(de,{present:r||s.open,children:s.modal?i.jsx(lp,{...o,ref:t}):i.jsx(up,{...o,ref:t})})});Oi.displayName=Qe;var cp=We("PopoverContent.RemoveScroll"),lp=l.forwardRef((e,t)=>{const n=De(Qe,e.__scopePopover),r=l.useRef(null),o=z(t,r),s=l.useRef(!1);return l.useEffect(()=>{const a=r.current;if(a)return Zt(a)},[]),i.jsx(mt,{as:cp,allowPinchZoom:!0,children:i.jsx(Ii,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:A(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:A(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,p=c.button===2||u;s.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:A(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),up=l.forwardRef((e,t)=>{const n=De(Qe,e.__scopePopover),r=l.useRef(!1),o=l.useRef(!1);return i.jsx(Ii,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Ii=l.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:p,onInteractOutside:f,...d}=e,m=De(Qe,n),v=St(n);return Xt(),i.jsx(ht,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:i.jsx(tt,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:p,onDismiss:()=>m.onOpenChange(!1),children:i.jsx(rn,{"data-state":Li(m.open),role:"dialog",id:m.contentId,...v,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Di="PopoverClose",dp=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=De(Di,n);return i.jsx(H.button,{type:"button",...r,ref:t,onClick:A(e.onClick,()=>o.onOpenChange(!1))})});dp.displayName=Di;var fp="PopoverArrow",ki=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=St(n);return i.jsx(on,{...o,...r,ref:t})});ki.displayName=fp;function Li(e){return e?"open":"closed"}var Cr=Pi,br=Ti,Sr=Ai,Er=Oi,$i=ki,pp=[" ","Enter","ArrowUp","ArrowDown"],hp=[" ","Enter"],Ue="Select",[un,dn,mp]=Jn(Ue),[st]=ye(Ue,[mp,Oe]),fn=Oe(),[vp,ke]=st(Ue),[gp,xp]=st(Ue),Fi=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:c,onValueChange:u,dir:p,name:f,autoComplete:d,disabled:m,required:v,form:x}=e,h=fn(t),[g,w]=l.useState(null),[y,b]=l.useState(null),[C,M]=l.useState(!1),P=Qn(p),[R,E]=je({prop:r,defaultProp:o??!1,onChange:s,caller:Ue}),[T,$]=je({prop:a,defaultProp:c,onChange:u,caller:Ue}),I=l.useRef(null),N=g?x||!!g.closest("form"):!0,[D,k]=l.useState(new Set),V=Array.from(D).map(F=>F.props.value).join(";");return i.jsx(gt,{...h,children:i.jsxs(vp,{required:v,scope:t,trigger:g,onTriggerChange:w,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:M,contentId:ie(),value:T,onValueChange:$,open:R,onOpenChange:E,dir:P,triggerPointerDownPosRef:I,disabled:m,children:[i.jsx(un.Provider,{scope:t,children:i.jsx(gp,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(F=>{k(W=>new Set(W).add(F))},[]),onNativeOptionRemove:l.useCallback(F=>{k(W=>{const L=new Set(W);return L.delete(F),L})},[]),children:n})}),N?i.jsxs(aa,{"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:d,value:T,onChange:F=>$(F.target.value),disabled:m,form:x,children:[T===void 0?i.jsx("option",{value:""}):null,Array.from(D)]},V):null]})})};Fi.displayName=Ue;var Bi="SelectTrigger",Wi=l.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=fn(n),a=ke(Bi,n),c=a.disabled||r,u=z(t,a.onTriggerChange),p=dn(n),f=l.useRef("touch"),[d,m,v]=la(h=>{const g=p().filter(b=>!b.disabled),w=g.find(b=>b.value===a.value),y=ua(g,h,w);y!==void 0&&a.onValueChange(y.value)}),x=h=>{c||(a.onOpenChange(!0),v()),h&&(a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return i.jsx(xt,{asChild:!0,...s,children:i.jsx(H.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ca(a.value)?"":void 0,...o,ref:u,onClick:A(o.onClick,h=>{h.currentTarget.focus(),f.current!=="mouse"&&x(h)}),onPointerDown:A(o.onPointerDown,h=>{f.current=h.pointerType;const g=h.target;g.hasPointerCapture(h.pointerId)&&g.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(x(h),h.preventDefault())}),onKeyDown:A(o.onKeyDown,h=>{const g=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&m(h.key),!(g&&h.key===" ")&&pp.includes(h.key)&&(x(),h.preventDefault())})})})});Wi.displayName=Bi;var Vi="SelectValue",Hi=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:a="",...c}=e,u=ke(Vi,n),{onValueNodeHasChildrenChange:p}=u,f=s!==void 0,d=z(t,u.onValueNodeChange);return te(()=>{p(f)},[p,f]),i.jsx(H.span,{...c,ref:d,style:{pointerEvents:"none"},children:ca(u.value)?i.jsx(i.Fragment,{children:a}):s})});Hi.displayName=Vi;var wp="SelectIcon",yp=l.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return i.jsx(H.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});yp.displayName=wp;var Cp="SelectPortal",Ui=e=>i.jsx(nt,{asChild:!0,...e});Ui.displayName=Cp;var Ke="SelectContent",Ki=l.forwardRef((e,t)=>{const n=ke(Ke,e.__scopeSelect),[r,o]=l.useState();if(te(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Gt.createPortal(i.jsx(Gi,{scope:e.__scopeSelect,children:i.jsx(un.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),s):null}return i.jsx(zi,{...e,ref:t})});Ki.displayName=Ke;var fe=10,[Gi,Le]=st(Ke),bp="SelectContentImpl",Sp=We("SelectContent.RemoveScroll"),zi=l.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:u,align:p,alignOffset:f,arrowPadding:d,collisionBoundary:m,collisionPadding:v,sticky:x,hideWhenDetached:h,avoidCollisions:g,...w}=e,y=ke(Ke,n),[b,C]=l.useState(null),[M,P]=l.useState(null),R=z(t,_=>C(_)),[E,T]=l.useState(null),[$,I]=l.useState(null),N=dn(n),[D,k]=l.useState(!1),V=l.useRef(!1);l.useEffect(()=>{if(b)return Zt(b)},[b]),Xt();const F=l.useCallback(_=>{const[G,...J]=N().map(Z=>Z.ref.current),[Y]=J.slice(-1),q=document.activeElement;for(const Z of _)if(Z===q||(Z?.scrollIntoView({block:"nearest"}),Z===G&&M&&(M.scrollTop=0),Z===Y&&M&&(M.scrollTop=M.scrollHeight),Z?.focus(),document.activeElement!==q))return},[N,M]),W=l.useCallback(()=>F([E,b]),[F,E,b]);l.useEffect(()=>{D&&W()},[D,W]);const{onOpenChange:L,triggerPointerDownPosRef:O}=y;l.useEffect(()=>{if(b){let _={x:0,y:0};const G=Y=>{_={x:Math.abs(Math.round(Y.pageX)-(O.current?.x??0)),y:Math.abs(Math.round(Y.pageY)-(O.current?.y??0))}},J=Y=>{_.x<=10&&_.y<=10?Y.preventDefault():b.contains(Y.target)||L(!1),document.removeEventListener("pointermove",G),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",J,{capture:!0})}}},[b,L,O]),l.useEffect(()=>{const _=()=>L(!1);return window.addEventListener("blur",_),window.addEventListener("resize",_),()=>{window.removeEventListener("blur",_),window.removeEventListener("resize",_)}},[L]);const[X,S]=la(_=>{const G=N().filter(q=>!q.disabled),J=G.find(q=>q.ref.current===document.activeElement),Y=ua(G,_,J);Y&&setTimeout(()=>Y.ref.current.focus())}),B=l.useCallback((_,G,J)=>{const Y=!V.current&&!J;(y.value!==void 0&&y.value===G||Y)&&(T(_),Y&&(V.current=!0))},[y.value]),U=l.useCallback(()=>b?.focus(),[b]),K=l.useCallback((_,G,J)=>{const Y=!V.current&&!J;(y.value!==void 0&&y.value===G||Y)&&I(_)},[y.value]),oe=r==="popper"?Vn:Yi,Q=oe===Vn?{side:c,sideOffset:u,align:p,alignOffset:f,arrowPadding:d,collisionBoundary:m,collisionPadding:v,sticky:x,hideWhenDetached:h,avoidCollisions:g}:{};return i.jsx(Gi,{scope:n,content:b,viewport:M,onViewportChange:P,itemRefCallback:B,selectedItem:E,onItemLeave:U,itemTextRefCallback:K,focusSelectedItem:W,selectedItemText:$,position:r,isPositioned:D,searchRef:X,children:i.jsx(mt,{as:Sp,allowPinchZoom:!0,children:i.jsx(ht,{asChild:!0,trapped:y.open,onMountAutoFocus:_=>{_.preventDefault()},onUnmountAutoFocus:A(o,_=>{y.trigger?.focus({preventScroll:!0}),_.preventDefault()}),children:i.jsx(tt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:_=>_.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:i.jsx(oe,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:_=>_.preventDefault(),...w,...Q,onPlaced:()=>k(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:A(w.onKeyDown,_=>{const G=_.ctrlKey||_.altKey||_.metaKey;if(_.key==="Tab"&&_.preventDefault(),!G&&_.key.length===1&&S(_.key),["ArrowUp","ArrowDown","Home","End"].includes(_.key)){let Y=N().filter(q=>!q.disabled).map(q=>q.ref.current);if(["ArrowUp","End"].includes(_.key)&&(Y=Y.slice().reverse()),["ArrowUp","ArrowDown"].includes(_.key)){const q=_.target,Z=Y.indexOf(q);Y=Y.slice(Z+1)}setTimeout(()=>F(Y)),_.preventDefault()}})})})})})})});zi.displayName=bp;var Ep="SelectItemAlignedPosition",Yi=l.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=ke(Ke,n),a=Le(Ke,n),[c,u]=l.useState(null),[p,f]=l.useState(null),d=z(t,R=>f(R)),m=dn(n),v=l.useRef(!1),x=l.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:w,focusSelectedItem:y}=a,b=l.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&p&&h&&g&&w){const R=s.trigger.getBoundingClientRect(),E=p.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),$=w.getBoundingClientRect();if(s.dir!=="rtl"){const q=$.left-E.left,Z=T.left-q,ce=R.left-Z,$e=R.width+ce,vn=Math.max($e,E.width),gn=window.innerWidth-fe,xn=so(Z,[fe,Math.max(fe,gn-vn)]);c.style.minWidth=$e+"px",c.style.left=xn+"px"}else{const q=E.right-$.right,Z=window.innerWidth-T.right-q,ce=window.innerWidth-R.right-Z,$e=R.width+ce,vn=Math.max($e,E.width),gn=window.innerWidth-fe,xn=so(Z,[fe,Math.max(fe,gn-vn)]);c.style.minWidth=$e+"px",c.style.right=xn+"px"}const I=m(),N=window.innerHeight-fe*2,D=h.scrollHeight,k=window.getComputedStyle(p),V=parseInt(k.borderTopWidth,10),F=parseInt(k.paddingTop,10),W=parseInt(k.borderBottomWidth,10),L=parseInt(k.paddingBottom,10),O=V+F+D+L+W,X=Math.min(g.offsetHeight*5,O),S=window.getComputedStyle(h),B=parseInt(S.paddingTop,10),U=parseInt(S.paddingBottom,10),K=R.top+R.height/2-fe,oe=N-K,Q=g.offsetHeight/2,_=g.offsetTop+Q,G=V+F+_,J=O-G;if(G<=K){const q=I.length>0&&g===I[I.length-1].ref.current;c.style.bottom="0px";const Z=p.clientHeight-h.offsetTop-h.offsetHeight,ce=Math.max(oe,Q+(q?U:0)+Z+W),$e=G+ce;c.style.height=$e+"px"}else{const q=I.length>0&&g===I[0].ref.current;c.style.top="0px";const ce=Math.max(K,V+h.offsetTop+(q?B:0)+Q)+J;c.style.height=ce+"px",h.scrollTop=G-K+h.offsetTop}c.style.margin=`${fe}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=N+"px",r?.(),requestAnimationFrame(()=>v.current=!0)}},[m,s.trigger,s.valueNode,c,p,h,g,w,s.dir,r]);te(()=>b(),[b]);const[C,M]=l.useState();te(()=>{p&&M(window.getComputedStyle(p).zIndex)},[p]);const P=l.useCallback(R=>{R&&x.current===!0&&(b(),y?.(),x.current=!1)},[b,y]);return i.jsx(Mp,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:v,onScrollButtonChange:P,children:i.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:i.jsx(H.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Yi.displayName=Ep;var Rp="SelectPopperPosition",Vn=l.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=fe,...s}=e,a=fn(n);return i.jsx(rn,{...a,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});Vn.displayName=Rp;var[Mp,Rr]=st(Ke,{}),Hn="SelectViewport",Xi=l.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Le(Hn,n),a=Rr(Hn,n),c=z(t,s.onViewportChange),u=l.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(un.Slot,{scope:n,children:i.jsx(H.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:A(o.onScroll,p=>{const f=p.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:m}=a;if(m?.current&&d){const v=Math.abs(u.current-f.scrollTop);if(v>0){const x=window.innerHeight-fe*2,h=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),w=Math.max(h,g);if(w<x){const y=w+v,b=Math.min(x,y),C=y-b;d.style.height=b+"px",d.style.bottom==="0px"&&(f.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});Xi.displayName=Hn;var qi="SelectGroup",[Np,Pp]=st(qi),Zi=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ie();return i.jsx(Np,{scope:n,id:o,children:i.jsx(H.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Zi.displayName=qi;var Ji="SelectLabel",_p=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pp(Ji,n);return i.jsx(H.div,{id:o.id,...r,ref:t})});_p.displayName=Ji;var Ut="SelectItem",[jp,Qi]=st(Ut),ea=l.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...a}=e,c=ke(Ut,n),u=Le(Ut,n),p=c.value===r,[f,d]=l.useState(s??""),[m,v]=l.useState(!1),x=z(t,y=>u.itemRefCallback?.(y,r,o)),h=ie(),g=l.useRef("touch"),w=()=>{o||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new 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 i.jsx(jp,{scope:n,value:r,disabled:o,textId:h,isSelected:p,onItemTextChange:l.useCallback(y=>{d(b=>b||(y?.textContent??"").trim())},[]),children:i.jsx(un.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:i.jsx(H.div,{role:"option","aria-labelledby":h,"data-highlighted":m?"":void 0,"aria-selected":p&&m,"data-state":p?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:x,onFocus:A(a.onFocus,()=>v(!0)),onBlur:A(a.onBlur,()=>v(!1)),onClick:A(a.onClick,()=>{g.current!=="mouse"&&w()}),onPointerUp:A(a.onPointerUp,()=>{g.current==="mouse"&&w()}),onPointerDown:A(a.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:A(a.onPointerMove,y=>{g.current=y.pointerType,o?u.onItemLeave?.():g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:A(a.onPointerLeave,y=>{y.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:A(a.onKeyDown,y=>{u.searchRef?.current!==""&&y.key===" "||(hp.includes(y.key)&&w(),y.key===" "&&y.preventDefault())})})})})});ea.displayName=Ut;var lt="SelectItemText",ta=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,a=ke(lt,n),c=Le(lt,n),u=Qi(lt,n),p=xp(lt,n),[f,d]=l.useState(null),m=z(t,w=>d(w),u.onItemTextChange,w=>c.itemTextRefCallback?.(w,u.value,u.disabled)),v=f?.textContent,x=l.useMemo(()=>i.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=p;return te(()=>(h(x),()=>g(x)),[h,g,x]),i.jsxs(i.Fragment,{children:[i.jsx(H.span,{id:u.textId,...s,ref:m}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Gt.createPortal(s.children,a.valueNode):null]})});ta.displayName=lt;var na="SelectItemIndicator",ra=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Qi(na,n).isSelected?i.jsx(H.span,{"aria-hidden":!0,...r,ref:t}):null});ra.displayName=na;var Un="SelectScrollUpButton",oa=l.forwardRef((e,t)=>{const n=Le(Un,e.__scopeSelect),r=Rr(Un,e.__scopeSelect),[o,s]=l.useState(!1),a=z(t,r.onScrollButtonChange);return te(()=>{if(n.viewport&&n.isPositioned){let c=function(){const p=u.scrollTop>0;s(p)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?i.jsx(ia,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});oa.displayName=Un;var Kn="SelectScrollDownButton",sa=l.forwardRef((e,t)=>{const n=Le(Kn,e.__scopeSelect),r=Rr(Kn,e.__scopeSelect),[o,s]=l.useState(!1),a=z(t,r.onScrollButtonChange);return te(()=>{if(n.viewport&&n.isPositioned){let c=function(){const p=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<p;s(f)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?i.jsx(ia,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});sa.displayName=Kn;var ia=l.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Le("SelectScrollButton",n),a=l.useRef(null),c=dn(n),u=l.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return l.useEffect(()=>()=>u(),[u]),te(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),i.jsx(H.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:A(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:A(o.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:A(o.onPointerLeave,()=>{u()})})}),Tp="SelectSeparator",Ap=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(H.div,{"aria-hidden":!0,...r,ref:t})});Ap.displayName=Tp;var Gn="SelectArrow",Op=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=fn(n),s=ke(Gn,n),a=Le(Gn,n);return s.open&&a.position==="popper"?i.jsx(on,{...o,...r,ref:t}):null});Op.displayName=Gn;var Ip="SelectBubbleInput",aa=l.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=l.useRef(null),s=z(r,o),a=eu(t);return l.useEffect(()=>{const c=o.current;if(!c)return;const u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==t&&f){const d=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(d)}},[a,t]),i.jsx(H.select,{...n,style:{...xo,...n.style},ref:s,defaultValue:t})});aa.displayName=Ip;function ca(e){return e===""||e===void 0}function la(e){const t=ue(e),n=l.useRef(""),r=l.useRef(0),o=l.useCallback(a=>{const c=n.current+a;t(c),(function u(p){n.current=p,window.clearTimeout(r.current),p!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(c)},[t]),s=l.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function ua(e,t,n){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Dp(e,Math.max(s,0));o.length===1&&(a=a.filter(p=>p!==n));const u=a.find(p=>p.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function Dp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kp=Fi,Lp=Wi,$p=Hi,Fp=Ui,Bp=Ki,Wp=Xi,Vp=Zi,Hp=ea,Up=ta,Kp=ra,Gp=oa,zp=sa,[pn]=ye("Tooltip",[Oe]),hn=Oe(),da="TooltipProvider",Yp=700,zn="tooltip.open",[Xp,Mr]=pn(da),fa=e=>{const{__scopeTooltip:t,delayDuration:n=Yp,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,a=l.useRef(!0),c=l.useRef(!1),u=l.useRef(0);return l.useEffect(()=>{const p=u.current;return()=>window.clearTimeout(p)},[]),i.jsx(Xp,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:l.useCallback(()=>{window.clearTimeout(u.current),a.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(p=>{c.current=p},[]),disableHoverableContent:o,children:s})};fa.displayName=da;var pt="Tooltip",[qp,Et]=pn(pt),pa=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:a,delayDuration:c}=e,u=Mr(pt,e.__scopeTooltip),p=hn(t),[f,d]=l.useState(null),m=ie(),v=l.useRef(0),x=a??u.disableHoverableContent,h=c??u.delayDuration,g=l.useRef(!1),[w,y]=je({prop:r,defaultProp:o??!1,onChange:R=>{R?(u.onOpen(),document.dispatchEvent(new CustomEvent(zn))):u.onClose(),s?.(R)},caller:pt}),b=l.useMemo(()=>w?g.current?"delayed-open":"instant-open":"closed",[w]),C=l.useCallback(()=>{window.clearTimeout(v.current),v.current=0,g.current=!1,y(!0)},[y]),M=l.useCallback(()=>{window.clearTimeout(v.current),v.current=0,y(!1)},[y]),P=l.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{g.current=!0,y(!0),v.current=0},h)},[h,y]);return l.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),i.jsx(gt,{...p,children:i.jsx(qp,{scope:t,contentId:m,open:w,stateAttribute:b,trigger:f,onTriggerChange:d,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayedRef.current?P():C()},[u.isOpenDelayedRef,P,C]),onTriggerLeave:l.useCallback(()=>{x?M():(window.clearTimeout(v.current),v.current=0)},[M,x]),onOpen:C,onClose:M,disableHoverableContent:x,children:n})})};pa.displayName=pt;var Yn="TooltipTrigger",ha=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Et(Yn,n),s=Mr(Yn,n),a=hn(n),c=l.useRef(null),u=z(t,c,o.onTriggerChange),p=l.useRef(!1),f=l.useRef(!1),d=l.useCallback(()=>p.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),i.jsx(xt,{asChild:!0,...a,children:i.jsx(H.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:A(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:A(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:A(e.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:A(e.onFocus,()=>{p.current||o.onOpen()}),onBlur:A(e.onBlur,o.onClose),onClick:A(e.onClick,o.onClose)})})});ha.displayName=Yn;var Nr="TooltipPortal",[Zp,Jp]=pn(Nr,{forceMount:void 0}),ma=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Et(Nr,t);return i.jsx(Zp,{scope:t,forceMount:n,children:i.jsx(de,{present:n||s.open,children:i.jsx(nt,{asChild:!0,container:o,children:r})})})};ma.displayName=Nr;var et="TooltipContent",va=l.forwardRef((e,t)=>{const n=Jp(et,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,a=Et(et,e.__scopeTooltip);return i.jsx(de,{present:r||a.open,children:a.disableHoverableContent?i.jsx(ga,{side:o,...s,ref:t}):i.jsx(Qp,{side:o,...s,ref:t})})}),Qp=l.forwardRef((e,t)=>{const n=Et(et,e.__scopeTooltip),r=Mr(et,e.__scopeTooltip),o=l.useRef(null),s=z(t,o),[a,c]=l.useState(null),{trigger:u,onClose:p}=n,f=o.current,{onPointerInTransitChange:d}=r,m=l.useCallback(()=>{c(null),d(!1)},[d]),v=l.useCallback((x,h)=>{const g=x.currentTarget,w={x:x.clientX,y:x.clientY},y=rh(w,g.getBoundingClientRect()),b=oh(w,y),C=sh(h.getBoundingClientRect()),M=ah([...b,...C]);c(M),d(!0)},[d]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(u&&f){const x=g=>v(g,f),h=g=>v(g,u);return u.addEventListener("pointerleave",x),f.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",x),f.removeEventListener("pointerleave",h)}}},[u,f,v,m]),l.useEffect(()=>{if(a){const x=h=>{const g=h.target,w={x:h.clientX,y:h.clientY},y=u?.contains(g)||f?.contains(g),b=!ih(w,a);y?m():b&&(m(),p())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[u,f,a,p,m]),i.jsx(ga,{...e,ref:s})}),[eh,th]=pn(pt,{isInside:!1}),nh=xc("TooltipContent"),ga=l.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:a,...c}=e,u=Et(et,n),p=hn(n),{onClose:f}=u;return l.useEffect(()=>(document.addEventListener(zn,f),()=>document.removeEventListener(zn,f)),[f]),l.useEffect(()=>{if(u.trigger){const d=m=>{m.target?.contains(u.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[u.trigger,f]),i.jsx(tt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:i.jsxs(rn,{"data-state":u.stateAttribute,...p,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(nh,{children:r}),i.jsx(eh,{scope:n,isInside:!0,children:i.jsx(Ec,{id:u.contentId,role:"tooltip",children:o||r})})]})})});va.displayName=et;var xa="TooltipArrow",wa=l.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=hn(n);return th(xa,n).isInside?null:i.jsx(on,{...o,...r,ref:t})});wa.displayName=xa;function rh(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function oh(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function sh(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function ih(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const c=t[s],u=t[a],p=c.x,f=c.y,d=u.x,m=u.y;f>r!=m>r&&n<(d-p)*(r-f)/(m-f)+p&&(o=!o)}return o}function ah(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),ch(t)}function ch(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var lh=fa,uh=pa,dh=ha,fh=ma,ph=va,hh=wa;function ya(e){return e.map((t,n)=>t.separator?i.jsx(xi,{className:"my-1 h-px bg-border-default"},`separator-${n}`):t.items?.length?i.jsxs(Mf,{children:[i.jsxs(Nf,{disabled:t.disabled,className:"flex min-w-44 cursor-pointer items-center justify-between rounded-md px-2.5 py-1.5 text-sm text-text-default outline-none transition-colors data-disabled:cursor-not-allowed data-disabled:opacity-40 data-highlighted:bg-surface-hover",children:[i.jsx("span",{children:t.label}),i.jsx(mo,{className:"h-3.5 w-3.5 opacity-70"})]}),i.jsx(gi,{children:i.jsx(Pf,{sideOffset:6,alignOffset:-4,className:"z-50 min-w-44 rounded-lg border border-border-default bg-surface-base p-1.5 shadow-2xl",children:ya(t.items)})})]},`sub-${n}`):i.jsxs(Rf,{disabled:t.disabled,onSelect:t.onSelect,className:"flex min-w-44 cursor-pointer items-center justify-between rounded-md px-2.5 py-1.5 text-sm text-text-default outline-none transition-colors data-disabled:cursor-not-allowed data-disabled:opacity-40 data-highlighted:bg-surface-hover",children:[i.jsx("span",{children:t.label}),t.shortcut?i.jsx("span",{className:"ml-6 text-xs text-text-muted",children:t.shortcut}):null]},`item-${n}`))}function Ca({open:e,x:t,y:n,items:r,onOpenChange:o,onClose:s,renderMenuItems:a,renderHeader:c,className:u}){const p=j.useRef(null),f=j.useRef(!1),d=j.useCallback(v=>{o?.(v),v||s?.()},[s,o]),m=j.useMemo(()=>a?a():ya(r??[]),[r,a]);return j.useEffect(()=>{if(!e){f.current=!1;return}if(f.current||!p.current)return;const v=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,button:2,clientX:t,clientY:n});p.current.dispatchEvent(v),f.current=!0},[e,t,n]),e?i.jsxs(bf,{onOpenChange:d,children:[i.jsx(Sf,{asChild:!0,children:i.jsx("span",{ref:p,"aria-hidden":!0,className:"fixed h-0 w-0",style:{left:t,top:n}})}),i.jsx(gi,{children:i.jsxs(Ef,{onCloseAutoFocus:v=>v.preventDefault(),className:`z-50 min-w-48 rounded-lg border border-border-default bg-surface-base p-1.5 shadow-2xl ${u??""}`,children:[c?i.jsx("div",{className:"px-2.5 py-1.5 text-xs text-text-muted",children:c()}):null,c?i.jsx(xi,{className:"my-1 h-px bg-border-default"}):null,m]})})]}):null}function mh(e){if(e.clientX||e.clientY)return{x:e.clientX,y:e.clientY};const n=e.currentTarget.getBoundingClientRect();return{x:n.left+n.width/2,y:n.top+n.height/2}}function vh({children:e,getContextMenuItems:t,renderMenuItems:n,renderHeader:r}){const[o,s]=j.useState(!1),[a,c]=j.useState({x:0,y:0}),u=j.useCallback(p=>{p.preventDefault(),c(mh(p)),s(!0)},[]);return i.jsxs(i.Fragment,{children:[e({openMenu:u}),i.jsx(Ca,{open:o,x:a.x,y:a.y,onOpenChange:s,onClose:()=>s(!1),items:t?.(),renderMenuItems:n,renderHeader:r})]})}function gh({open:e,onOpenChange:t,title:n,description:r,children:o,maxWidth:s="900px",showCloseButton:a=!0,className:c,contentClassName:u}){return i.jsx(zl,{open:e,onOpenChange:t,children:i.jsxs(Yl,{children:[i.jsx(Xl,{className:"fixed inset-0 z-40 bg-black/70 backdrop-blur-[2px]"}),i.jsxs(ql,{style:{maxWidth:s},className:`mt-surface-dialog fixed left-1/2 top-1/2 z-50 w-[92vw] max-h-[86vh] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-2xl p-6 shadow-[0_24px_80px_rgba(0,0,0,0.65)] focus:outline-none ${c||""} ${u||""}`,children:[(n||r||a)&&i.jsxs("div",{className:"mb-5 flex items-center gap-3 border-b pb-4",children:[(n||r)&&i.jsxs("div",{className:"min-w-0 flex-1",children:[n&&i.jsx(Zl,{className:"text-xl font-semibold flex items-center gap-2 before:content-none!",children:n}),r&&i.jsx(Jl,{className:"mt-2 text-sm",children:r})]}),a&&i.jsx(Ql,{asChild:!0,children:i.jsx(we,{kind:"icon",size:"large",variant:"ghost","aria-label":"Close",className:"shrink-0",children:i.jsx(zt,{className:"h-4 w-4"})})})]}),o]})]})})}function xh({title:e,className:t}){return e?i.jsxs("div",{className:`my-4 flex items-center gap-3 ${t||""}`,children:[i.jsx("div",{className:"h-px flex-1 bg-border-default"}),i.jsx("span",{className:"text-xs uppercase tracking-wide text-text-muted",children:e}),i.jsx("div",{className:"h-px flex-1 bg-border-default"})]}):i.jsx("div",{className:`my-4 ${t||""}`,children:i.jsx("div",{className:"h-px w-full bg-border-default"})})}function ba({children:e}){return e}function wh({children:e,className:t,...n}){return i.jsx(rp,{className:`mt-surface-input-ghost data-highlighted:bg-surface-popover flex min-w-44 cursor-pointer items-center justify-between rounded-md px-2.5 py-1.5 text-sm outline-none transition-colors data-disabled:cursor-not-allowed data-disabled:opacity-40 ${t||""}`,...n,children:e})}const yh=({title:e,children:t,className:n,kind:r="default",size:o="medium",variant:s="default",showCaret:a=!0})=>{const c=o==="large"?"[&_svg]:h-5 [&_svg]:w-5":"[&_svg]:h-4 [&_svg]:w-4",u=o==="large"?"h-4 w-4":"h-3.5 w-3.5";let p=null;const f=[];return j.Children.forEach(t,d=>{if(j.isValidElement(d)&&d.type===ba){p=d.props.children;return}f.push(d)}),i.jsxs(Qf,{children:[i.jsx(ep,{asChild:!0,children:p||i.jsxs(we,{kind:r,size:o,variant:s,className:r==="icon"?`${c} ${n||""}`:n,children:[i.jsx("span",{className:"leading-none inline-flex items-center justify-center",children:e||"Dropdown"}),r!=="icon"&&a&&i.jsx("span",{className:"inline-flex items-center justify-center",children:i.jsx(ho,{className:`${u} opacity-70`,"aria-hidden":"true"})})]})}),i.jsx(tp,{children:i.jsx(np,{sideOffset:5,side:"bottom",className:"mt-surface-menu z-50 min-w-48 rounded-lg border p-1.5 shadow-2xl",children:f})})]})},mn=yh;mn.Trigger=ba;const Xn=j.forwardRef(({size:e,variant:t,className:n,...r},o)=>{const s=e||"medium",a={medium:"mt-layout-input-medium",large:"mt-layout-input-large"},c=t||"default",u={default:"mt-surface-input-default",ghost:"mt-surface-input-ghost"};return i.jsx("input",{...r,ref:o,className:`w-fit border rounded outline-none ${a[s]} ${u[c]} ${n||""}`})}),Sa=["shift","alt","meta","mod","ctrl","control"],Ch={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function _e(e){return(Ch[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function Ea(e){return Sa.includes(e)}function jn(e,t=","){return e.toLowerCase().split(t)}function Tn(e,t="+",n=">",r=!1,o,s){let a=[],c=!1;e=e.trim(),e.includes(n)?(c=!0,a=e.toLocaleLowerCase().split(n).map(f=>_e(f))):a=e.toLocaleLowerCase().split(t).map(f=>_e(f));const u={alt:a.includes("alt"),ctrl:a.includes("ctrl")||a.includes("control"),shift:a.includes("shift"),meta:a.includes("meta"),mod:a.includes("mod"),useKey:r},p=a.filter(f=>!Sa.includes(f));return{...u,keys:p,description:o,isSequence:c,hotkey:e,metadata:s}}typeof document<"u"&&(document.addEventListener("keydown",e=>{e.code!==void 0&&Ra([_e(e.code)])}),document.addEventListener("keyup",e=>{e.code!==void 0&&Ma([_e(e.code)])})),typeof window<"u"&&(window.addEventListener("blur",()=>{be.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{be.clear()},0)}));const be=new Set;function Pr(e){return Array.isArray(e)}function bh(e,t=","){return(Pr(e)?e:e.split(t)).every(n=>be.has(n.trim().toLowerCase()))}function Ra(e){const t=Array.isArray(e)?e:[e];be.has("meta")&&be.forEach(n=>{Ea(n)||be.delete(n.toLowerCase())}),t.forEach(n=>{be.add(n.toLowerCase())})}function Ma(e){const t=Array.isArray(e)?e:[e];e==="meta"?be.clear():t.forEach(n=>{be.delete(n.toLowerCase())})}function Sh(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function Eh(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}const Rh=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"];function Mh(e){return Na(e,Rh)}function Na(e,t=!1){const{target:n,composed:r}=e;let o,s;return Nh(n)&&r?(o=e.composedPath()[0]&&e.composedPath()[0].tagName,s=e.composedPath()[0]&&e.composedPath()[0].role):(o=n&&n.tagName,s=n&&n.role),Pr(t)?!!(o&&t&&t.some(a=>a.toLowerCase()===o.toLowerCase()||a===s)):!!(o&&t&&t)}function Nh(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function Ph(e,t){return e.length===0&&t?!1:t?e.some(n=>t.includes(n))||e.includes("*"):!0}const _h=(e,t,n=!1)=>{const{alt:r,meta:o,mod:s,shift:a,ctrl:c,keys:u,useKey:p}=t,{code:f,key:d,ctrlKey:m,metaKey:v,shiftKey:x,altKey:h}=e,g=_e(f);if(p&&u?.length===1&&u.includes(d.toLowerCase()))return!0;if(!u?.includes(g)&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(g))return!1;if(!n){if(r!==h&&g!=="alt"||a!==x&&g!=="shift")return!1;if(s){if(!v&&!m)return!1}else if(o!==v&&g!=="meta"&&g!=="os"||c!==m&&g!=="ctrl"&&g!=="control")return!1}return u&&u.length===1&&u.includes(g)?!0:u&&u.length>0?u.includes(g)?bh(u):!1:!u||u.length===0},jh=j.createContext(void 0),Th=()=>j.useContext(jh);function Pa(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce((n,r)=>n&&Pa(e[r],t[r]),!0):e===t}const Ah=j.createContext({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),Oh=()=>j.useContext(Ah);function Ih(e){const t=j.useRef(void 0);return Pa(t.current,e)||(t.current=e),t.current}const io=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},Dh=typeof window<"u"?j.useLayoutEffect:j.useEffect;function kh(e,t,n,r){const o=j.useRef(null),s=j.useRef(!1),a=Array.isArray(n)?Array.isArray(r)?void 0:r:n,c=Pr(e)?e.join(a?.delimiter):e,u=Array.isArray(n)?n:Array.isArray(r)?r:void 0,p=j.useCallback(t,u??[]),f=j.useRef(p);u?f.current=p:f.current=t;const d=Ih(a),{activeScopes:m}=Oh(),v=Th();return Dh(()=>{if(d?.enabled===!1||!Ph(m,d?.scopes))return;let x=[],h;const g=(C,M=!1)=>{if(!(Mh(C)&&!Na(C,d?.enableOnFormTags))){if(o.current!==null){const P=o.current.getRootNode();if((P instanceof Document||P instanceof ShadowRoot)&&P.activeElement!==o.current&&!o.current.contains(P.activeElement)){io(C);return}}C.target?.isContentEditable&&!d?.enableOnContentEditable||jn(c,d?.delimiter).forEach(P=>{if(P.includes(d?.splitKey??"+")&&P.includes(d?.sequenceSplitKey??">")){console.warn(`Hotkey ${P} contains both ${d?.splitKey??"+"} and ${d?.sequenceSplitKey??">"} which is not supported.`);return}const R=Tn(P,d?.splitKey,d?.sequenceSplitKey,d?.useKey,d?.description,d?.metadata);if(R.isSequence){h=setTimeout(()=>{x=[]},d?.sequenceTimeoutMs??1e3);const E=R.useKey?C.key:_e(C.code);if(Ea(E.toLowerCase()))return;x.push(E);const T=R.keys?.[x.length-1];if(E!==T){x=[],h&&clearTimeout(h);return}x.length===R.keys?.length&&(f.current(C,R),h&&clearTimeout(h),x=[])}else if(_h(C,R,d?.ignoreModifiers)||R.keys?.includes("*")){if(d?.ignoreEventWhen?.(C)||M&&s.current)return;if(Sh(C,R,d?.preventDefault),!Eh(C,R,d?.enabled)){io(C);return}f.current(C,R),M||(s.current=!0)}})}},w=C=>{C.code!==void 0&&(Ra(_e(C.code)),(d?.keydown===void 0&&d?.keyup!==!0||d?.keydown)&&g(C))},y=C=>{C.code!==void 0&&(Ma(_e(C.code)),s.current=!1,d?.keyup&&g(C,!0))},b=o.current||a?.document||document;return b.addEventListener("keyup",y,a?.eventListenerOptions),b.addEventListener("keydown",w,a?.eventListenerOptions),v&&jn(c,d?.delimiter).forEach(C=>{v.addHotkey(Tn(C,d?.splitKey,d?.sequenceSplitKey,d?.useKey,d?.description,d?.metadata))}),()=>{b.removeEventListener("keyup",y,a?.eventListenerOptions),b.removeEventListener("keydown",w,a?.eventListenerOptions),v&&jn(c,d?.delimiter).forEach(C=>{v.removeHotkey(Tn(C,d?.splitKey,d?.sequenceSplitKey,d?.useKey,d?.description,d?.metadata))}),x=[],h&&clearTimeout(h)}},[c,d,m]),o}function _a({children:e}){return e}function ja(e,t){j.Children.forEach(e,n=>{if(j.isValidElement(n)){if(n.type===_a){t.triggerOverride=n.props.children;return}if(n.type===j.Fragment){ja(n.props.children,t);return}t.selectItems.push(n)}})}const Se=j.forwardRef(({children:e,className:t,icon:n,shortcut:r="",...o},s)=>i.jsxs(Hp,{className:`mt-surface-input-ghost focus:ring-0 focus:ring-offset-0 data-highlighted:bg-surface-popover data-[state=checked]:bg-surface-popover flex min-w-44 cursor-pointer items-center justify-between rounded-md px-2.5 py-1.5 text-sm outline-none transition-colors data-disabled:cursor-not-allowed data-disabled:opacity-40 ${t||""}`,...o,ref:s,children:[i.jsxs("span",{className:"flex items-center",children:[n?i.jsx("span",{className:"mr-2",children:n}):null,i.jsx(Up,{children:e})]}),i.jsxs("span",{className:"ml-6 flex items-center gap-2 text-xs text-text-muted",children:[r?i.jsx("span",{children:r}):null,i.jsx(Kp,{children:i.jsx(po,{className:"h-4 w-4 text-text-muted"})})]})]})),Lh=({children:e,className:t,placeholder:n,kind:r="default",size:o="medium",options:s,variant:a="default",value:c,onValueChange:u,showCaret:p=!0,...f})=>{const d=c!==void 0&&u!==void 0,[m,v]=j.useState(c??""),x=d?c:m,[h,g]=j.useState(!1),[w,y]=j.useState(!1),b=o==="large"?"[&_svg]:h-5 [&_svg]:w-5":"[&_svg]:h-4 [&_svg]:w-4",C=o==="large"?"h-4 w-4":"h-3.5 w-3.5",{triggerOverride:M,selectItems:P}=j.useMemo(()=>{const E={triggerOverride:null,selectItems:[]};return e&&ja(e,E),!e&&s&&(E.selectItems=s.map(T=>i.jsx(Se,{value:T.value,icon:T.icon,disabled:T.disabled,children:T.label},T.value))),E},[e,s]),R=P.find(E=>j.isValidElement(E)&&E.props.value===x);return j.useEffect(()=>{!d&&c!==void 0&&c!==m&&v(c)},[d,c,m]),kh("1,2,3,4,5,6,7,8,9",E=>{const T=Number(E.key)-1,$=P[T];$&&(d||v($.props.value),u?.($.props.value),g(!1))},{enabled:h||w,enableOnFormTags:!0,document:window.document}),i.jsxs(kp,{value:x,onValueChange:E=>{d||v(E),u?.(E)},open:h,onOpenChange:g,...f,children:[i.jsx(Lp,{asChild:!0,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:M||i.jsxs(we,{kind:r,size:o,variant:a,className:r==="icon"?`${b} ${t||""}`:t,children:[i.jsx("span",{className:"leading-none inline-flex items-center justify-center",children:r==="icon"?i.jsx("span",{className:`inline-flex h-full w-full items-center justify-center leading-none ${b}`,children:R?.props.icon??n}):i.jsx($p,{placeholder:n})}),r!=="icon"&&p&&i.jsx("span",{className:"inline-flex items-center justify-center",children:i.jsx(ho,{className:`${C} opacity-70`,"aria-hidden":"true"})})]})}),i.jsx(Fp,{children:i.jsxs(Bp,{sideOffset:5,position:"popper",align:"center",className:"mt-surface-menu z-50 min-w-48 rounded-lg border p-1.5 shadow-2xl",children:[i.jsx(Gp,{}),i.jsx(Wp,{children:i.jsx(Vp,{className:"flex flex-col gap-0.5",children:P.map((E,T)=>j.cloneElement(E,{shortcut:(T+1).toString()}))})}),i.jsx(zp,{})]})})]})},Pe=Lh;Pe.Trigger=_a;const Kt=(e,t)=>{const n=e[0]?.value??"",r=t[0]?.value??"";return{type:"rule",field:n,operator:r,value:null}},$h=(e,t)=>({type:"group",conjunction:"AND",children:[Kt(e,t)]}),Be=(e,t,n)=>{if(t.length===0)return n(e);const[r,...o]=t,s=e.children[r];if(!s)return e;let a=s;return o.length===0?a=n(s):s.type==="group"&&(a=Be(s,o,n)),a===s?e:{...e,children:e.children.map((c,u)=>u===r?a:c)}},qn=(e,t)=>{if(t.length===0)return e;const[n,...r]=t;if(r.length===0)return{...e,children:e.children.filter((a,c)=>c!==n)};const o=e.children[n];if(!o||o.type!=="group")return e;const s=qn(o,r);return{...e,children:e.children.map((a,c)=>c===n?s:a)}},Fh=(e,t,n)=>e.children.length>0?e:{...e,children:[Kt(t,n)]};function Bh({title:e="Filter",value:t,onChange:n,fields:r,operators:o,advanced:s,onAdvancedChange:a,kind:c="default",size:u="medium",variant:p="default",showCaret:f=!0}){const[d,m]=j.useState(!1),v=s??d,x=a??m,h=j.useMemo(()=>{const E=new Map;return o.forEach(T=>E.set(T.value,T)),E},[o]),g=j.useMemo(()=>{const E=new Map;return r.forEach(T=>E.set(T.value,T)),E},[r]),w=E=>n(Fh(E,r,o)),y=()=>{const E=t.children[0];return E&&E.type==="rule"?E:Kt(r,o)},b=()=>{const E=y(),$=h.get(E.operator)?.requiresValue??!0,I=g.get(E.field)?.icon;return i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border-default bg-surface-subtle px-2 py-1.5",children:[i.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center",children:I||i.jsx(Mt,{className:"h-4 w-4"})}),i.jsx(Pe,{value:E.field,onValueChange:N=>{const D={...E,field:N};w({...t,conjunction:"AND",children:[D]})},variant:"ghost",size:"medium",showCaret:!1,className:"text-xs",children:r.map(N=>i.jsx(Se,{value:N.value,icon:N.icon,children:N.label},N.value))}),i.jsx(Pe,{value:E.operator,onValueChange:N=>{const D={...E,operator:N,value:null};w({...t,conjunction:"AND",children:[D]})},variant:"ghost",size:"medium",showCaret:!1,className:"text-xs",children:o.map(N=>i.jsx(Se,{value:N.value,children:N.label},N.value))}),$?i.jsx(Xn,{className:"flex-1 w-full text-xs",placeholder:"Value",value:E.value??"",onChange:N=>{const D={...E,value:N.target.value};w({...t,conjunction:"AND",children:[D]})},variant:"ghost"}):i.jsx("span",{className:"text-xs",children:"No value"})]})},C=(E,T)=>{const I=h.get(E.operator)?.requiresValue??!0;return i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border-default bg-surface-subtle px-2 py-1.5",children:[i.jsx(Pe,{value:E.field,onValueChange:N=>{w(Be(t,T,D=>({...D,field:N})))},variant:"ghost",size:"medium",showCaret:!1,className:"text-xs",children:r.map(N=>i.jsx(Se,{value:N.value,icon:N.icon,children:N.label},N.value))}),i.jsx(Pe,{value:E.operator,onValueChange:N=>{w(Be(t,T,D=>({...D,operator:N,value:null})))},variant:"ghost",size:"medium",showCaret:!1,className:"text-xs",children:o.map(N=>i.jsx(Se,{value:N.value,children:N.label},N.value))}),I?i.jsx(Xn,{className:"flex-1 w-full text-xs",placeholder:"Value",value:E.value??"",onChange:N=>{w(Be(t,T,D=>({...D,value:N.target.value})))},variant:"ghost"}):i.jsx("span",{className:"text-xs text-text-muted",children:"No value"}),i.jsx("button",{type:"button",className:"text-text-muted hover:text-text-default",onClick:()=>w(qn(t,T)),"aria-label":"Delete rule",children:i.jsx(In,{className:"h-4 w-4"})})]})},M=(E,T,$=!1)=>i.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-border-default bg-surface-subtle p-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[i.jsx("span",{className:"uppercase tracking-wide",children:$?"Where":"Group"}),i.jsx("button",{type:"button",className:"rounded-md border border-border-default bg-surface-subtle px-2 py-1 text-xs text-text-primary",onClick:()=>{w(Be(t,T,I=>({...I,conjunction:I.conjunction==="AND"?"OR":"AND"})))},children:E.conjunction}),!$&&i.jsx("button",{type:"button",className:"ml-auto text-text-muted hover:text-text-default",onClick:()=>w(qn(t,T)),"aria-label":"Delete group",children:i.jsx(In,{className:"h-4 w-4"})})]}),i.jsx("div",{className:"flex flex-col gap-2",children:E.children.map((I,N)=>{const D=[...T,N];return I.type==="group"?i.jsx("div",{children:M(I,D)},`group-${N}`):i.jsx("div",{children:C(I,D)},`rule-${N}`)})}),i.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.jsx(we,{kind:"icon",variant:"ghost",className:"text-text-muted",onClick:()=>{w(Be(t,T,I=>({...I,children:[...I.children,Kt(r,o)]})))},children:i.jsx(On,{className:"h-4 w-4"})}),i.jsx("span",{className:"text-text-primary",children:"Add rule"}),i.jsx(we,{kind:"icon",variant:"ghost",className:"text-text-muted",onClick:()=>{w(Be(t,T,I=>({...I,children:[...I.children,$h(r,o)]})))},children:i.jsx(On,{className:"h-4 w-4"})}),i.jsx("span",{className:"text-text-primary",children:"Add group"})]})]}),P=g.get(y().field)?.icon,R=v?i.jsx(Mt,{className:"h-4 w-4"}):P||i.jsx(Mt,{className:"h-4 w-4"});return i.jsx(mn,{title:c==="icon"?i.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center text-text-primary",children:R}):i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center text-text-primary",children:R}),i.jsx("span",{children:e})]}),kind:c,size:u,variant:p,showCaret:f,children:i.jsxs("div",{className:"w-130 max-w-[80vw] p-2 text-text-primary",children:[i.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[i.jsxs("span",{className:"flex items-center gap-2 text-xs uppercase tracking-wide text-text-muted",children:[v&&i.jsx(Mt,{className:"h-3.5 w-3.5"}),v?"Advanced":"Simple"," filter"]}),i.jsx("button",{type:"button",className:"text-text-muted hover:text-text-default",onClick:()=>x(!v),"aria-label":"Toggle filter type",children:i.jsx(sc,{className:"h-4 w-4"})})]}),v?M(t,[],!0):b()]})})}function Wh(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxs("g",{"clip-path":"url(#clip0_129_4601)",children:[i.jsx("rect",{y:"7",width:"3.5",height:"6.41667",rx:"1",fill:"white",style:{fill:"white",fillOpacity:1}}),i.jsx("rect",{x:"5.25",y:"3.5",width:"3.5",height:"9.91667",rx:"1",fill:"#7F7F7F",style:{fill:"#7F7F7F",fillOpacity:1}}),i.jsx("rect",{x:"10.5",y:"0.583252",width:"3.5",height:"12.8333",rx:"1",fill:"#7F7F7F",style:{fill:"#7F7F7F",fillOpacity:1}})]}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_129_4601",children:i.jsx("rect",{width:"14",height:"14",fill:"white",style:{fill:"white",fillOpacity:1}})})})]})}function Vh(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxs("g",{"clip-path":"url(#clip0_25_3437)",children:[i.jsx("rect",{y:"7",width:"3.5",height:"6.41667",rx:"1",fill:"white",style:{fill:"white",fillOpacity:1}}),i.jsx("rect",{x:"5.25",y:"3.5",width:"3.5",height:"9.91667",rx:"1",fill:"white",style:{fill:"white",fillOpacity:1}}),i.jsx("rect",{x:"10.5",y:"0.583252",width:"3.5",height:"12.8333",rx:"1",fill:"#808080",style:{fill:"#808080",fillOpacity:1}})]}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_25_3437",children:i.jsx("rect",{width:"14",height:"14",fill:"white",style:{fill:"white",fillOpacity:1}})})})]})}function Hh(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxs("g",{"clip-path":"url(#clip0_25_3441)",children:[i.jsx("rect",{y:"7",width:"3.5",height:"6.41667",rx:"1",fill:"white",style:{fill:"white",fillOpacity:1}}),i.jsx("rect",{x:"5.25",y:"3.5",width:"3.5",height:"9.91667",rx:"1",fill:"white",style:{fill:"white",fillOpacity:1}}),i.jsx("rect",{x:"10.5",y:"0.583252",width:"3.5",height:"12.8333",rx:"1",fill:"white",style:{fill:"white",fillOpacity:1}})]}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_25_3441",children:i.jsx("rect",{width:"14",height:"14",fill:"white",style:{fill:"white",fillOpacity:1}})})})]})}function Uh(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("g",{"clip-path":"url(#clip0_25_3445)",children:i.jsx("circle",{cx:"7",cy:"7",r:"6",stroke:"white",style:{stroke:"white",strokeOpacity:1},"stroke-width":"2","stroke-dasharray":"6 6"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_25_3445",children:i.jsx("rect",{width:"14",height:"14",fill:"white",style:{fill:"white",fillOpacity:1}})})})]})}function Kh(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("g",{"clip-path":"url(#clip0_25_3447)",children:i.jsx("circle",{cx:"7",cy:"7",r:"6",stroke:"white",style:{stroke:"white",strokeOpacity:1},"stroke-width":"2"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_25_3447",children:i.jsx("rect",{width:"14",height:"14",fill:"white",style:{fill:"white",fillOpacity:1}})})})]})}function Gh(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxs("g",{"clip-path":"url(#clip0_25_3452)",children:[i.jsx("circle",{cx:"7",cy:"7",r:"6",stroke:"#F0BF00",style:{stroke:"#F0BF00",strokeOpacity:1},"stroke-width":"2"}),i.jsx("path",{d:"M7 10.5C8.933 10.5 10.5 8.933 10.5 7C10.5 5.067 8.933 3.5 7 3.5V10.5Z",fill:"#F0BF00",style:{fill:"#F0BF00",fillOpacity:1}})]}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_25_3452",children:i.jsx("rect",{width:"14",height:"14",fill:"white",style:{fill:"white",fillOpacity:1}})})})]})}function zh(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxs("g",{"clip-path":"url(#clip0_25_3458)",children:[i.jsx("circle",{cx:"7",cy:"7",r:"7",fill:"#16A34A",style:{fill:"#16A34A",fillOpacity:1}}),i.jsx("path",{d:"M3.5 7.40872L5.42979 9.26765C5.46807 9.30452 5.52852 9.30501 5.56738 9.26874L10.5 4.66675",stroke:"#1F2023",style:{stroke:"#1F2023",strokeOpacity:1},"stroke-width":"2","stroke-linecap":"round"})]}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_25_3458",children:i.jsx("rect",{width:"14",height:"14",fill:"white",style:{fill:"white",fillOpacity:1}})})})]})}function Yh({children:e,message:t="Copied",durationMs:n=1400,side:r="top",align:o="center",disabled:s=!1}){const[a,c]=j.useState(!1),u=j.useRef(null),p=j.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),f=j.useCallback(()=>{p(),c(!0),u.current=setTimeout(()=>{c(!1),u.current=null},n)},[p,n]);j.useEffect(()=>p,[p]);const d=j.useCallback(m=>{if(s){c(!1);return}if(!m){p(),c(!1);return}f()},[p,s,f]);return i.jsxs(Cr,{open:a,onOpenChange:d,children:[i.jsx(br,{asChild:!0,children:e}),i.jsx(Sr,{children:i.jsxs(Er,{side:r,align:o,sideOffset:8,role:"status","aria-live":"polite",className:"pointer-events-none rounded-md border border-border-default bg-surface-subtle px-2 py-1 text-xs text-text-primary shadow-[0_10px_24px_rgba(0,0,0,0.45)] backdrop-blur-sm transition-all duration-150 data-[state=open]:opacity-100 data-[state=open]:translate-y-0 data-[state=closed]:opacity-0 data-[state=closed]:translate-y-1",children:[t,i.jsx($i,{className:"fill-surface-subtle"})]})})]})}function Ta({children:e}){return e}const Xh=({children:e,content:t,open:n,onOpenChange:r,side:o="bottom",align:s="start",sideOffset:a=6,className:c})=>{let u=null;const p=[];j.Children.forEach(e,d=>{if(j.isValidElement(d)&&d.type===Ta){u=d.props.children;return}p.push(d)});const f=u??(j.isValidElement(p[0])?p[0]:null);return f?i.jsxs(Cr,{open:n,onOpenChange:r,children:[i.jsx(br,{asChild:!0,children:f}),i.jsx(Sr,{children:i.jsx(Er,{side:o,align:s,sideOffset:a,className:`bg-surface-subtle border border-border-default rounded-lg p-2 shadow-2xl backdrop-blur-md z-50 ${c||""}`,children:t})})]}):i.jsx(i.Fragment,{})},Aa=Xh;Aa.Trigger=Ta;function qh({value:e,max:t=100,className:n,barClassName:r}){const o=Math.min(Math.max(e,0),t),s=t>0?o/t*100:0;return i.jsx("div",{className:`h-2 w-full overflow-hidden rounded-full bg-surface-subtle ${n||""}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":o,children:i.jsx("div",{className:`h-full rounded-full bg-blue-500 transition-[width] duration-300 ${r||""}`,style:{width:`${s}%`}})})}function Zh({size:e="medium",variant:t="default",className:n,value:r,onChange:o,placeholder:s="Search",...a}){const c=j.useRef(null),[u,p]=j.useState(""),f=r!==void 0,d=f?String(r??""):u,m={medium:"mt-layout-input-medium",large:"mt-layout-input-large"},v={default:"mt-surface-input-default",ghost:"mt-surface-input-ghost"},x=e==="large"?"h-4 w-4":"h-3.5 w-3.5",h="w-fit flex items-center gap-2 rounded",g=y=>{f||p(y.target.value),o?.(y)},w=()=>{f?o?.({target:{value:""}}):p(""),c.current?.focus()};return i.jsxs("div",{className:`relative pl-2 ${h} ${m[e]} ${v[t]} ${n||""}`,children:[i.jsx(pc,{className:`${x} shrink-0`,"aria-hidden":"true"}),i.jsx("input",{...a,ref:c,type:"text",value:d,onChange:g,placeholder:s,className:"w-full min-w-24 bg-transparent outline-none"}),d.length>0&&i.jsx(we,{kind:"icon",size:e,variant:"ghost",onClick:w,className:"absolute right-2 shrink-0 w-5! h-5!","aria-label":"Clear search",children:i.jsx(zt,{className:x})})]})}const Jh=e=>({property:e[0]?.value??"",direction:"asc"});function Qh({title:e="Sort",value:t,onChange:n,fields:r,kind:o="default",size:s="medium",variant:a="default",showCaret:c=!0}){const u=(m,v)=>{n(t.map((x,h)=>h===m?{...x,...v}:x))},p=m=>{n(t.filter((v,x)=>x!==m))},f=()=>{n([...t,Jh(r)])},d=()=>t.length===1?t[0].direction==="desc"?i.jsx(Ua,{className:"h-4 w-4"}):i.jsx(Ya,{className:"h-4 w-4"}):i.jsx(Ga,{className:"h-4 w-4"});return i.jsx(mn,{title:o==="icon"?i.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center text-text-muted",children:d()}):i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center text-text-muted",children:d()}),i.jsx("span",{children:e})]}),kind:o,size:s,variant:a,showCaret:c,children:i.jsxs("div",{className:"w-105 max-w-[80vw] p-2 text-text-muted",children:[i.jsxs("div",{className:"flex flex-col gap-2",children:[t.length===0&&i.jsx("div",{className:"text-xs text-text-muted",children:"No sorting rules."}),t.map((m,v)=>i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border-default bg-surface-subtle px-2 py-1.5",children:[i.jsx(Pe,{value:m.property,onValueChange:x=>u(v,{property:x}),variant:"ghost",size:"medium",showCaret:!1,className:"text-xs",children:r.map(x=>i.jsx(Se,{value:x.value,children:x.label},x.value))}),i.jsxs(Pe,{value:m.direction,onValueChange:x=>u(v,{direction:x}),variant:"ghost",size:"medium",showCaret:!1,className:"text-xs",children:[i.jsx(Se,{value:"asc",children:"Ascending"}),i.jsx(Se,{value:"desc",children:"Descending"})]}),i.jsx("button",{type:"button",className:"ml-auto text-text-muted hover:text-text-default",onClick:()=>p(v),"aria-label":"Delete sort rule",children:i.jsx(In,{className:"h-4 w-4"})})]},`${m.property}-${v}`))]}),i.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs",children:[i.jsx(we,{kind:"icon",variant:"ghost",className:"text-text-muted",onClick:f,children:i.jsx(On,{className:"h-4 w-4"})}),i.jsx("span",{className:"text-text-muted",children:"Add sort"})]})]})})}function em({children:e,gap:t=0,row:n=!1,align:r,justify:o="start",className:s=""}){const c={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"}[r??(n?"center":"stretch")],u={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch",baseline:"justify-baseline",normal:"justify-normal"}[o];return i.jsx("div",{className:`flex flex-1 ${c} ${u} ${n?"flex-row":"flex-col"} ${s}`,style:{gap:`${t*.25}rem`},children:e})}const tm=({variant:e="default",className:t,...n})=>{const r={default:"mt-surface-input-default",ghost:"mt-surface-input-ghost"};return i.jsx("textarea",{...n,className:`w-full border rounded outline-none px-3 py-2 min-h-24 resize-y ${r[e]} ${t||""}`})};function nm({children:e,title:t,content:n,footer:r,closeButton:o=!0,side:s="top",align:a="center"}){const[c,u]=j.useState(!1);return i.jsxs(Cr,{open:c,onOpenChange:u,children:[i.jsx(br,{asChild:!0,children:e}),i.jsx(Sr,{children:i.jsxs(Er,{side:s,align:a,sideOffset:8,className:"z-50 w-[320px] rounded-xl border border-border-default bg-surface-subtle p-3 text-text-default shadow-[0_20px_60px_rgba(0,0,0,0.55)]",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t?i.jsx("div",{className:"text-sm font-semibold leading-5",children:t}):i.jsx("div",{}),o&&i.jsx("button",{type:"button","aria-label":"Close toggletip",onClick:()=>u(!1),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border-default bg-surface-subtle text-text-muted transition-colors hover:bg-surface-default hover:text-text-default",children:i.jsx(zt,{className:"h-4 w-4"})})]}),i.jsx("div",{className:"mt-2 text-sm text-text-muted",children:n}),r&&i.jsx("div",{className:"mt-3 border-t border-border-default pt-2",children:r}),i.jsx($i,{className:"fill-border-default"})]})})]})}function rm(e){return i.jsx(lh,{delayDuration:0,children:i.jsxs(uh,{children:[i.jsx(dh,{asChild:!0,children:e.children}),i.jsx(fh,{children:i.jsxs(ph,{className:"rounded p-2 border-[#222222] bg-[#111111]",side:e.side,align:e.align,sideOffset:5,children:[e.content,i.jsx(hh,{className:"TooltipArrow"})]})})]})})}function _r({children:e}){return i.jsx(i.Fragment,{children:e})}_r.displayName="MtTreeItem";function om(e){return j.isValidElement(e)&&e.type===_r}function Oa(e){const t=[];return j.Children.forEach(e,n=>{if(!om(n))return;const r=Oa(n.props.children);t.push({id:n.props.itemId,label:n.props.label,icon:n.props.icon,trailing:n.props.trailing,disabled:n.props.disabled,data:n.props.data,children:r.length>0?r:void 0})}),t}function sm(e){const t=[],n=r=>{for(const o of r)t.push(o),o.children?.length&&n(o.children)};return n(e),t}function im(e,t,n){const r=new Set(e);return!r.has(t)?r.add(t):r.delete(t),r}const am=({items:e,children:t,className:n,selectedId:r,defaultSelectedId:o,onSelectedIdChange:s,expandedIds:a,defaultExpandedIds:c=[],onExpandedIdsChange:u,onItemClick:p,renderItem:f,indentPx:d=14,toggleOnItemClick:m=!0})=>{const v=r!==void 0,x=a!==void 0,[h,g]=j.useState(o??""),[w,y]=j.useState(new Set(c)),b=v?r:h,C=j.useMemo(()=>x?new Set(a):w,[a,w,x]),M=j.useMemo(()=>Oa(t),[t]),P=j.useMemo(()=>e?.length&&M.length?[...e,...M]:e?.length?e:M,[e,M]),R=j.useMemo(()=>new Map(sm(P).map(N=>[N.id,N])),[P]),E=N=>{const D=R.get(N)??null;v||g(N),s?.(N,D)},T=N=>{x||y(N),u?.(Array.from(N))},$=(N,D)=>{T(im(C,N))},I=(N,D)=>i.jsx("ul",{role:"group",className:"flex flex-col gap-0.5",children:N.map(k=>{const V=!!k.children?.length,F=V&&C.has(k.id),W=b===k.id,L={isSelected:W,isExpanded:F,hasChildren:V,depth:D};return i.jsxs("li",{role:"none",className:"flex flex-col",children:[i.jsx(we,{variant:"ghost",selected:W,role:"treeitem","aria-expanded":V?F:void 0,"aria-selected":W,"aria-disabled":k.disabled||void 0,disabled:k.disabled,onClick:()=>{p?.(k),E(k.id),V&&m&&$(k.id)},className:"h-auto min-h-0 w-full items-center justify-start gap-1 py-1 pr-2 text-left",style:{paddingLeft:`${D*d+6}px`},children:f?f(k,L):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center text-text-muted",children:V?i.jsx(mo,{onClick:O=>{O.stopPropagation(),$(k.id)},className:`h-3.5 w-3.5 transition-transform ${F?"rotate-90":""}`}):null}),k.icon&&i.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center text-text-primary",children:k.icon}),i.jsx("span",{className:"truncate text-sm",children:k.label}),k.trailing&&i.jsx("span",{className:"ml-auto text-xs text-text-primary",children:k.trailing})]})}),V&&F&&k.children?I(k.children,D+1):null]},k.id)})});return i.jsx("div",{role:"tree",className:`w-full ${n||""}`,children:I(P,0)})},Ia=am;Ia.Item=_r;const cm={success:{icon:tc,iconClassName:"text-status-success",borderClassName:"border-status-success"},info:{icon:ac,iconClassName:"text-status-info",borderClassName:"border-status-info"},warning:{icon:Qa,iconClassName:"text-status-warning",borderClassName:"border-status-warning"},error:{icon:rc,iconClassName:"text-status-danger",borderClassName:"border-status-danger"}};function lm({title:e,content:t,severity:n="info",actions:r,showCloseButton:o=!0,className:s}){const[a,c]=j.useState(!0),{icon:u,iconClassName:p,borderClassName:f}=cm[n];return a?i.jsx("div",{role:"alert",className:`mt-surface-elevated p-3 border-2 ${f} ${s||""}`,children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(u,{className:`mt-0.5 h-5 w-5 shrink-0 ${p}`}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"text-sm font-semibold",children:e}),i.jsx("div",{className:"mt-1 text-sm",children:t}),r&&i.jsx("div",{className:"mt-3",children:r})]}),o&&i.jsx(we,{kind:"icon",size:"medium",variant:"ghost","aria-label":"Close alert",onClick:()=>c(!1),className:"shrink-0",children:i.jsx(zt,{className:"h-4 w-4"})})]})}):null}const um={xs:"h-[18px] w-[18px] text-[9px]",sm:"h-6 w-6 text-[10px]",md:"h-8 w-8 text-xs",lg:"h-10 w-10 text-sm"};function dm(e){const t=e?.trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length===1?n[0].slice(0,2).toUpperCase():`${n[0][0]??""}${n[n.length-1][0]??""}`.toUpperCase()}function Zn({src:e,alt:t,name:n,initials:r,size:o="sm",className:s,...a}){const[c,u]=j.useState(null),p=j.useMemo(()=>dm(r??n??t),[t,r,n]),f=["inline-flex rounded-full shrink-0 select-none items-center justify-center overflow-hidden bg-surface-popover text-white",um[o],s].filter(Boolean).join(" ");return i.jsx("div",{className:f,title:t??n,...a,children:e&&c!==e?i.jsx("img",{src:e,alt:t??n??"Avatar",className:"h-full w-full object-cover",onError:()=>u(e)}):i.jsx("span",{"aria-hidden":"true",className:"font-medium leading-none",children:p})})}const An="outline-3 outline-[#111]";function ao(...e){return e.filter(Boolean).join(" ")}function fm(e){return typeof e!="number"||Number.isNaN(e)||e<0?Number.POSITIVE_INFINITY:Math.floor(e)}function pm(e){return typeof e!="number"||Number.isNaN(e)?-4:e}function hm({avatars:e=[],children:t,max:n,size:r="sm",spacing:o=-4,className:s,...a}){const c=e.map((g,w)=>i.jsx(Zn,{size:g.size??r,...g,className:ao(An,g.className)},`data-avatar-${w}`)),u=j.Children.toArray(t).filter(g=>j.isValidElement(g)).map((g,w)=>j.cloneElement(g,{key:g.key??`child-avatar-${w}`,className:ao(An,g.props.className)})),p=[...c,...u],f=p.length,d=fm(n),m=pm(o),v=Math.min(f,d),x=Math.max(f-v,0),h=p.slice(0,v);return i.jsxs("div",{className:["inline-flex items-center",s].filter(Boolean).join(" "),...a,children:[h.map((g,w)=>i.jsx("div",{style:{zIndex:v-w,marginLeft:w===0?0:m},children:g},`visible-avatar-${w}`)),x>0&&i.jsx("div",{style:{zIndex:0,marginLeft:v>0?m:0},children:i.jsx(Zn,{size:r,initials:`+${x}`,alt:`${x} more`,className:An})})]})}exports.MtAlert=lm;exports.MtAvatar=Zn;exports.MtAvatarGroup=hm;exports.MtBacklogIcon=Uh;exports.MtButton=we;exports.MtCheckIcon=zh;exports.MtCheckbox=vc;exports.MtContextMenu=Ca;exports.MtDialog=gh;exports.MtDivider=xh;exports.MtDropdown=mn;exports.MtDropdownItem=wh;exports.MtFilterDropdown=Bh;exports.MtHighIcon=Hh;exports.MtInProgressIcon=Gh;exports.MtInlineToast=Yh;exports.MtInput=Xn;exports.MtLowIcon=Wh;exports.MtMediumIcon=Vh;exports.MtOpenIcon=Kh;exports.MtPopover=Aa;exports.MtProgress=qh;exports.MtSearch=Zh;exports.MtSelect=Pe;exports.MtSelectItem=Se;exports.MtSortDropdown=Qh;exports.MtStack=em;exports.MtTextarea=tm;exports.MtToggletip=nm;exports.MtTooltip=rm;exports.MtTree=Ia;exports.WithContextMenu=vh;
|
|
5
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return l.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Ye="DialogDescriptionWarning",Ue=({contentRef:t,descriptionId:r})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${me(Ye).contentName}}.`;return l.useEffect(()=>{const o=t.current?.getAttribute("aria-describedby");r&&o&&(document.getElementById(r)||console.warn(s))},[s,t,r]),null},Ke=te,Ze=se,Je=oe,Qe=ae,et=le,tt=ue,fe=xe,[F]=e.createContextScope("Tooltip",[e.createPopperScope]),H=e.createPopperScope(),ge="TooltipProvider",nt=700,W="tooltip.open",[rt,Y]=F(ge),he=t=>{const{__scopeTooltip:r,delayDuration:n=nt,skipDelayDuration:s=300,disableHoverableContent:o=!1,children:a}=t,i=l.useRef(!0),u=l.useRef(!1),c=l.useRef(0);return l.useEffect(()=>{const x=c.current;return()=>window.clearTimeout(x)},[]),e.jsxRuntimeExports.jsx(rt,{scope:r,isOpenDelayedRef:i,delayDuration:n,onOpen:l.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,s)},[s]),isPointerInTransitRef:u,onPointerInTransitChange:l.useCallback(x=>{u.current=x},[]),disableHoverableContent:o,children:a})};he.displayName=ge;var k="Tooltip",[st,O]=F(k),ve=t=>{const{__scopeTooltip:r,children:n,open:s,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:u}=t,c=Y(k,t.__scopeTooltip),x=H(r),[d,p]=l.useState(null),g=e.useId(),m=l.useRef(0),h=i??c.disableHoverableContent,R=u??c.delayDuration,f=l.useRef(!1),[j,C]=e.useControllableState({prop:s,defaultProp:o??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(W))):c.onClose(),a?.(S)},caller:k}),w=l.useMemo(()=>j?f.current?"delayed-open":"instant-open":"closed",[j]),N=l.useCallback(()=>{window.clearTimeout(m.current),m.current=0,f.current=!1,C(!0)},[C]),M=l.useCallback(()=>{window.clearTimeout(m.current),m.current=0,C(!1)},[C]),D=l.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{f.current=!0,C(!0),m.current=0},R)},[R,C]);return l.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),e.jsxRuntimeExports.jsx(e.Root2,{...x,children:e.jsxRuntimeExports.jsx(st,{scope:r,contentId:g,open:j,stateAttribute:w,trigger:d,onTriggerChange:p,onTriggerEnter:l.useCallback(()=>{c.isOpenDelayedRef.current?D():N()},[c.isOpenDelayedRef,D,N]),onTriggerLeave:l.useCallback(()=>{h?M():(window.clearTimeout(m.current),m.current=0)},[M,h]),onOpen:N,onClose:M,disableHoverableContent:h,children:n})})};ve.displayName=k;var z="TooltipTrigger",je=l.forwardRef((t,r)=>{const{__scopeTooltip:n,...s}=t,o=O(z,n),a=Y(z,n),i=H(n),u=l.useRef(null),c=e.useComposedRefs(r,u,o.onTriggerChange),x=l.useRef(!1),d=l.useRef(!1),p=l.useCallback(()=>x.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),e.jsxRuntimeExports.jsx(e.Anchor,{asChild:!0,...i,children:e.jsxRuntimeExports.jsx(e.Primitive.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...s,ref:c,onPointerMove:e.composeEventHandlers(t.onPointerMove,g=>{g.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:e.composeEventHandlers(t.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:e.composeEventHandlers(t.onPointerDown,()=>{o.open&&o.onClose(),x.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:e.composeEventHandlers(t.onFocus,()=>{x.current||o.onOpen()}),onBlur:e.composeEventHandlers(t.onBlur,o.onClose),onClick:e.composeEventHandlers(t.onClick,o.onClose)})})});je.displayName=z;var U="TooltipPortal",[ot,at]=F(U,{forceMount:void 0}),Ee=t=>{const{__scopeTooltip:r,forceMount:n,children:s,container:o}=t,a=O(U,r);return e.jsxRuntimeExports.jsx(ot,{scope:r,forceMount:n,children:e.jsxRuntimeExports.jsx(e.Presence,{present:n||a.open,children:e.jsxRuntimeExports.jsx(e.Portal,{asChild:!0,container:o,children:s})})})};Ee.displayName=U;var _="TooltipContent",Re=l.forwardRef((t,r)=>{const n=at(_,t.__scopeTooltip),{forceMount:s=n.forceMount,side:o="top",...a}=t,i=O(_,t.__scopeTooltip);return e.jsxRuntimeExports.jsx(e.Presence,{present:s||i.open,children:i.disableHoverableContent?e.jsxRuntimeExports.jsx(Ce,{side:o,...a,ref:r}):e.jsxRuntimeExports.jsx(it,{side:o,...a,ref:r})})}),it=l.forwardRef((t,r)=>{const n=O(_,t.__scopeTooltip),s=Y(_,t.__scopeTooltip),o=l.useRef(null),a=e.useComposedRefs(r,o),[i,u]=l.useState(null),{trigger:c,onClose:x}=n,d=o.current,{onPointerInTransitChange:p}=s,g=l.useCallback(()=>{u(null),p(!1)},[p]),m=l.useCallback((h,R)=>{const f=h.currentTarget,j={x:h.clientX,y:h.clientY},C=dt(j,f.getBoundingClientRect()),w=xt(j,C),N=pt(R.getBoundingClientRect()),M=ft([...w,...N]);u(M),p(!0)},[p]);return l.useEffect(()=>()=>g(),[g]),l.useEffect(()=>{if(c&&d){const h=f=>m(f,d),R=f=>m(f,c);return c.addEventListener("pointerleave",h),d.addEventListener("pointerleave",R),()=>{c.removeEventListener("pointerleave",h),d.removeEventListener("pointerleave",R)}}},[c,d,m,g]),l.useEffect(()=>{if(i){const h=R=>{const f=R.target,j={x:R.clientX,y:R.clientY},C=c?.contains(f)||d?.contains(f),w=!mt(j,i);C?g():w&&(g(),x())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[c,d,i,x,g]),e.jsxRuntimeExports.jsx(Ce,{...t,ref:a})}),[lt,ct]=F(k,{isInside:!1}),ut=e.createSlottable("TooltipContent"),Ce=l.forwardRef((t,r)=>{const{__scopeTooltip:n,children:s,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...u}=t,c=O(_,n),x=H(n),{onClose:d}=c;return l.useEffect(()=>(document.addEventListener(W,d),()=>document.removeEventListener(W,d)),[d]),l.useEffect(()=>{if(c.trigger){const p=g=>{g.target?.contains(c.trigger)&&d()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,d]),e.jsxRuntimeExports.jsx(e.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:d,children:e.jsxRuntimeExports.jsxs(e.Content,{"data-state":c.stateAttribute,...x,...u,ref:r,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[e.jsxRuntimeExports.jsx(ut,{children:s}),e.jsxRuntimeExports.jsx(lt,{scope:n,isInside:!0,children:e.jsxRuntimeExports.jsx(e.Root,{id:c.contentId,role:"tooltip",children:o||s})})]})})});Re.displayName=_;var be="TooltipArrow",ye=l.forwardRef((t,r)=>{const{__scopeTooltip:n,...s}=t,o=H(n);return ct(be,n).isInside?null:e.jsxRuntimeExports.jsx(e.Arrow,{...o,...s,ref:r})});ye.displayName=be;function dt(t,r){const n=Math.abs(r.top-t.y),s=Math.abs(r.bottom-t.y),o=Math.abs(r.right-t.x),a=Math.abs(r.left-t.x);switch(Math.min(n,s,o,a)){case a:return"left";case o:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function xt(t,r,n=5){const s=[];switch(r){case"top":s.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":s.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":s.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":s.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return s}function pt(t){const{top:r,right:n,bottom:s,left:o}=t;return[{x:o,y:r},{x:n,y:r},{x:n,y:s},{x:o,y:s}]}function mt(t,r){const{x:n,y:s}=t;let o=!1;for(let a=0,i=r.length-1;a<r.length;i=a++){const u=r[a],c=r[i],x=u.x,d=u.y,p=c.x,g=c.y;d>s!=g>s&&n<(p-x)*(s-d)/(g-d)+x&&(o=!o)}return o}function ft(t){const r=t.slice();return r.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),gt(r)}function gt(t){if(t.length<=1)return t.slice();const r=[];for(let s=0;s<t.length;s++){const o=t[s];for(;r.length>=2;){const a=r[r.length-1],i=r[r.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}r.pop();const n=[];for(let s=t.length-1;s>=0;s--){const o=t[s];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),r.length===1&&n.length===1&&r[0].x===n[0].x&&r[0].y===n[0].y?r:r.concat(n)}var ht=he,vt=ve,jt=je,Et=Ee,Rt=Re,Ct=ye;function bt({open:t,onOpenChange:r,title:n,description:s,children:o,maxWidth:a="900px",showCloseButton:i=!0,className:u,contentClassName:c}){return e.jsxRuntimeExports.jsx(Ke,{open:t,onOpenChange:r,children:e.jsxRuntimeExports.jsxs(Ze,{children:[e.jsxRuntimeExports.jsx(Je,{className:"fixed inset-0 z-40 bg-black/70 backdrop-blur-[2px]"}),e.jsxRuntimeExports.jsxs(Qe,{style:{maxWidth:a},className:`mt-surface-dialog fixed left-1/2 top-1/2 z-50 w-[92vw] max-h-[86vh] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-2xl p-6 shadow-[0_24px_80px_rgba(0,0,0,0.65)] focus:outline-none ${u||""} ${c||""}`,children:[(n||s||i)&&e.jsxRuntimeExports.jsxs("div",{className:"mb-5 flex items-center gap-3 border-b pb-4",children:[(n||s)&&e.jsxRuntimeExports.jsxs("div",{className:"min-w-0 flex-1",children:[n&&e.jsxRuntimeExports.jsx(et,{className:"text-xl font-semibold flex items-center gap-2 before:content-none!",children:n}),s&&e.jsxRuntimeExports.jsx(tt,{className:"mt-2 text-sm",children:s})]}),i&&e.jsxRuntimeExports.jsx(fe,{asChild:!0,children:e.jsxRuntimeExports.jsx(e.MtButton,{kind:"icon",size:"large",variant:"ghost","aria-label":"Close",className:"shrink-0",children:e.jsxRuntimeExports.jsx(e.X,{className:"h-4 w-4"})})})]}),o]})]})})}const yt=fe;function Mt({title:t,className:r}){return t?e.jsxRuntimeExports.jsxs("div",{className:`my-4 flex items-center gap-3 ${r||""}`,children:[e.jsxRuntimeExports.jsx("div",{className:"h-px flex-1 bg-border-default"}),e.jsxRuntimeExports.jsx("span",{className:"text-xs uppercase tracking-wide text-text-muted",children:t}),e.jsxRuntimeExports.jsx("div",{className:"h-px flex-1 bg-border-default"})]}):e.jsxRuntimeExports.jsx("div",{className:`my-4 ${r||""}`,children:e.jsxRuntimeExports.jsx("div",{className:"h-px w-full bg-border-default"})})}function Nt({children:t,message:r="Copied",durationMs:n=1400,side:s="top",align:o="center",disabled:a=!1}){const[i,u]=v.useState(!1),c=v.useRef(null),x=v.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]),d=v.useCallback(()=>{x(),u(!0),c.current=setTimeout(()=>{u(!1),c.current=null},n)},[x,n]);v.useEffect(()=>x,[x]);const p=v.useCallback(g=>{if(a){u(!1);return}if(!g){x(),u(!1);return}d()},[x,a,d]);return e.jsxRuntimeExports.jsxs(e.Root2$1,{open:i,onOpenChange:p,children:[e.jsxRuntimeExports.jsx(e.Trigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsx(e.Portal$1,{children:e.jsxRuntimeExports.jsxs(e.Content2,{side:s,align:o,sideOffset:8,role:"status","aria-live":"polite",className:"pointer-events-none rounded-md border border-border-default bg-surface-subtle px-2 py-1 text-xs text-text-primary shadow-[0_10px_24px_rgba(0,0,0,0.45)] backdrop-blur-sm transition-all duration-150 data-[state=open]:opacity-100 data-[state=open]:translate-y-0 data-[state=closed]:opacity-0 data-[state=closed]:translate-y-1",children:[r,e.jsxRuntimeExports.jsx(e.Arrow2,{className:"fill-surface-subtle"})]})})]})}function wt({value:t,max:r=100,className:n,barClassName:s}){const o=Math.min(Math.max(t,0),r),a=r>0?o/r*100:0;return e.jsxRuntimeExports.jsx("div",{className:`h-2 w-full overflow-hidden rounded-full bg-surface-subtle ${n||""}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":o,children:e.jsxRuntimeExports.jsx("div",{className:`h-full rounded-full bg-blue-500 transition-[width] duration-300 ${s||""}`,style:{width:`${a}%`}})})}function Tt({size:t="medium",variant:r="default",className:n,value:s,onChange:o,placeholder:a="Search",...i}){const u=v.useRef(null),[c,x]=v.useState(""),d=s!==void 0,p=d?String(s??""):c,g={medium:"mt-layout-input-medium",large:"mt-layout-input-large"},m={default:"mt-surface-input-default",ghost:"mt-surface-input-ghost"},h=t==="large"?"h-4 w-4":"h-3.5 w-3.5",R="w-fit flex items-center gap-2 rounded",f=C=>{d||x(C.target.value),o?.(C)},j=()=>{d?o?.({target:{value:""}}):x(""),u.current?.focus()};return e.jsxRuntimeExports.jsxs("div",{className:`relative pl-2 ${R} ${g[t]} ${m[r]} ${n||""}`,children:[e.jsxRuntimeExports.jsx(e.Search,{className:`${h} shrink-0`,"aria-hidden":"true"}),e.jsxRuntimeExports.jsx("input",{...i,ref:u,type:"text",value:p,onChange:f,placeholder:a,className:"w-full min-w-24 bg-transparent outline-none"}),p.length>0&&e.jsxRuntimeExports.jsx(e.MtButton,{kind:"icon",size:t,variant:"ghost",onClick:j,className:"absolute right-2 shrink-0 w-5! h-5!","aria-label":"Clear search",children:e.jsxRuntimeExports.jsx(e.X,{className:h})})]})}const Dt=({variant:t="default",className:r,...n})=>{const s={default:"mt-surface-input-default",ghost:"mt-surface-input-ghost"};return e.jsxRuntimeExports.jsx("textarea",{...n,className:`w-full border rounded outline-none px-3 py-2 min-h-24 resize-y ${s[t]} ${r||""}`})};function It({children:t,title:r,content:n,footer:s,closeButton:o=!0,side:a="top",align:i="center"}){const[u,c]=v.useState(!1);return e.jsxRuntimeExports.jsxs(e.Root2$1,{open:u,onOpenChange:c,children:[e.jsxRuntimeExports.jsx(e.Trigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsx(e.Portal$1,{children:e.jsxRuntimeExports.jsxs(e.Content2,{side:a,align:i,sideOffset:8,className:"z-50 w-[320px] rounded-xl border border-border-default bg-surface-subtle p-3 text-text-default shadow-[0_20px_60px_rgba(0,0,0,0.55)]",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r?e.jsxRuntimeExports.jsx("div",{className:"text-sm font-semibold leading-5",children:r}):e.jsxRuntimeExports.jsx("div",{}),o&&e.jsxRuntimeExports.jsx("button",{type:"button","aria-label":"Close toggletip",onClick:()=>c(!1),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border-default bg-surface-subtle text-text-muted transition-colors hover:bg-surface-default hover:text-text-default",children:e.jsxRuntimeExports.jsx(e.X,{className:"h-4 w-4"})})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-2 text-sm text-text-muted",children:n}),s&&e.jsxRuntimeExports.jsx("div",{className:"mt-3 border-t border-border-default pt-2",children:s}),e.jsxRuntimeExports.jsx(e.Arrow2,{className:"fill-border-default"})]})})]})}function Pt(t){return e.jsxRuntimeExports.jsx(ht,{delayDuration:0,children:e.jsxRuntimeExports.jsxs(vt,{children:[e.jsxRuntimeExports.jsx(jt,{asChild:!0,children:t.children}),e.jsxRuntimeExports.jsx(Et,{children:e.jsxRuntimeExports.jsxs(Rt,{className:"rounded p-2 border-[#222222] bg-[#111111]",side:t.side,align:t.align,sideOffset:5,children:[t.content,e.jsxRuntimeExports.jsx(Ct,{className:"TooltipArrow"})]})})]})})}function K({children:t}){return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t})}K.displayName="MtTreeItem";function _t(t){return v.isValidElement(t)&&t.type===K}function Me(t){const r=[];return v.Children.forEach(t,n=>{if(!_t(n))return;const s=Me(n.props.children);r.push({id:n.props.itemId,label:n.props.label,icon:n.props.icon,trailing:n.props.trailing,disabled:n.props.disabled,data:n.props.data,children:s.length>0?s:void 0})}),r}function kt(t){const r=[],n=s=>{for(const o of s)r.push(o),o.children?.length&&n(o.children)};return n(t),r}function Ot(t,r,n){const s=new Set(t);return!s.has(r)?s.add(r):s.delete(r),s}const St=({items:t,children:r,className:n,selectedId:s,defaultSelectedId:o,onSelectedIdChange:a,expandedIds:i,defaultExpandedIds:u=[],onExpandedIdsChange:c,onItemClick:x,renderItem:d,indentPx:p=14,toggleOnItemClick:g=!0})=>{const m=s!==void 0,h=i!==void 0,[R,f]=v.useState(o??""),[j,C]=v.useState(new Set(u)),w=m?s:R,N=v.useMemo(()=>h?new Set(i):j,[i,j,h]),M=v.useMemo(()=>Me(r),[r]),D=v.useMemo(()=>t?.length&&M.length?[...t,...M]:t?.length?t:M,[t,M]),S=v.useMemo(()=>new Map(kt(D).map(b=>[b.id,b])),[D]),we=b=>{const I=S.get(b)??null;m||f(b),a?.(b,I)},Te=b=>{h||C(b),c?.(Array.from(b))},Z=(b,I)=>{Te(Ot(N,b))},J=(b,I)=>e.jsxRuntimeExports.jsx("ul",{role:"group",className:"flex flex-col gap-0.5",children:b.map(E=>{const P=!!E.children?.length,A=P&&N.has(E.id),B=w===E.id,De={isSelected:B,isExpanded:A,hasChildren:P,depth:I};return e.jsxRuntimeExports.jsxs("li",{role:"none",className:"flex flex-col",children:[e.jsxRuntimeExports.jsx(e.MtButton,{variant:"ghost",selected:B,role:"treeitem","aria-expanded":P?A:void 0,"aria-selected":B,"aria-disabled":E.disabled||void 0,disabled:E.disabled,onClick:()=>{x?.(E),we(E.id),P&&g&&Z(E.id)},className:"h-auto min-h-0 w-full items-center justify-start gap-1 py-1 pr-2 text-left",style:{paddingLeft:`${I*p+6}px`},children:d?d(E,De):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center text-text-muted",children:P?e.jsxRuntimeExports.jsx(e.ChevronRight,{onClick:Ie=>{Ie.stopPropagation(),Z(E.id)},className:`h-3.5 w-3.5 transition-transform ${A?"rotate-90":""}`}):null}),E.icon&&e.jsxRuntimeExports.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center text-text-primary",children:E.icon}),e.jsxRuntimeExports.jsx("span",{className:"truncate text-sm",children:E.label}),E.trailing&&e.jsxRuntimeExports.jsx("span",{className:"ml-auto text-xs text-text-primary",children:E.trailing})]})}),P&&A&&E.children?J(E.children,I+1):null]},E.id)})});return e.jsxRuntimeExports.jsx("div",{role:"tree",className:`w-full ${n||""}`,children:J(D,0)})},Ne=St;Ne.Item=K;const At={success:{icon:Se,iconClassName:"text-status-success",borderClassName:"border-status-success"},info:{icon:Fe,iconClassName:"text-status-info",borderClassName:"border-status-info"},warning:{icon:ke,iconClassName:"text-status-warning",borderClassName:"border-status-warning"},error:{icon:$e,iconClassName:"text-status-danger",borderClassName:"border-status-danger"}};function $t({title:t,content:r,severity:n="info",actions:s,showCloseButton:o=!0,className:a}){const[i,u]=v.useState(!0),{icon:c,iconClassName:x,borderClassName:d}=At[n];return i?e.jsxRuntimeExports.jsx("div",{role:"alert",className:`mt-surface-elevated p-3 border-2 ${d} ${a||""}`,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxRuntimeExports.jsx(c,{className:`mt-0.5 h-5 w-5 shrink-0 ${x}`}),e.jsxRuntimeExports.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxRuntimeExports.jsx("div",{className:"text-sm font-semibold",children:t}),e.jsxRuntimeExports.jsx("div",{className:"mt-1 text-sm",children:r}),s&&e.jsxRuntimeExports.jsx("div",{className:"mt-3",children:s})]}),o&&e.jsxRuntimeExports.jsx(e.MtButton,{kind:"icon",size:"medium",variant:"ghost","aria-label":"Close alert",onClick:()=>u(!1),className:"shrink-0",children:e.jsxRuntimeExports.jsx(e.X,{className:"h-4 w-4"})})]})}):null}const G="outline-3 outline-[#111]";function Q(...t){return t.filter(Boolean).join(" ")}function Lt(t){return typeof t!="number"||Number.isNaN(t)||t<0?Number.POSITIVE_INFINITY:Math.floor(t)}function Ft(t){return typeof t!="number"||Number.isNaN(t)?-4:t}function Ht({avatars:t=[],children:r,max:n,size:s="sm",spacing:o=-4,className:a,...i}){const u=t.map((f,j)=>e.jsxRuntimeExports.jsx(e.MtAvatar,{size:f.size??s,...f,className:Q(G,f.className)},`data-avatar-${j}`)),c=v.Children.toArray(r).filter(f=>v.isValidElement(f)).map((f,j)=>v.cloneElement(f,{key:f.key??`child-avatar-${j}`,className:Q(G,f.props.className)})),x=[...u,...c],d=x.length,p=Lt(n),g=Ft(o),m=Math.min(d,p),h=Math.max(d-m,0),R=x.slice(0,m);return e.jsxRuntimeExports.jsxs("div",{className:["inline-flex items-center",a].filter(Boolean).join(" "),...i,children:[R.map((f,j)=>e.jsxRuntimeExports.jsx("div",{style:{zIndex:m-j,marginLeft:j===0?0:g},children:f},`visible-avatar-${j}`)),h>0&&e.jsxRuntimeExports.jsx("div",{style:{zIndex:0,marginLeft:m>0?g:0},children:e.jsxRuntimeExports.jsx(e.MtAvatar,{size:s,initials:`+${h}`,alt:`${h} more`,className:G})})]})}exports.MtAvatar=e.MtAvatar;exports.MtBacklogIcon=e.MtBacklogIcon;exports.MtButton=e.MtButton;exports.MtCheckIcon=e.MtCheckIcon;exports.MtCheckbox=e.MtCheckbox;exports.MtContextMenu=e.MtContextMenu;exports.MtDropdown=e.MtDropdown;exports.MtDropdownItem=e.MtDropdownItem;exports.MtFilterDropdown=e.MtFilterDropdown;exports.MtHighIcon=e.MtHighIcon;exports.MtInProgressIcon=e.MtInProgressIcon;exports.MtInput=e.MtInput;exports.MtLowIcon=e.MtLowIcon;exports.MtMediumIcon=e.MtMediumIcon;exports.MtOpenIcon=e.MtOpenIcon;exports.MtPopover=e.MtPopover;exports.MtSelect=e.MtSelect;exports.MtSelectItem=e.MtSelectItem;exports.MtSortDropdown=e.MtSortDropdown;exports.MtStack=e.MtStack;exports.WithContextMenu=e.WithContextMenu;exports.MtAlert=$t;exports.MtAvatarGroup=Ht;exports.MtDialog=bt;exports.MtDialogClose=yt;exports.MtDivider=Mt;exports.MtInlineToast=Nt;exports.MtProgress=wt;exports.MtSearch=Tt;exports.MtTextarea=Dt;exports.MtToggletip=It;exports.MtTooltip=Pt;exports.MtTree=Ne;
|