@vertesia/ui 1.6.0-dev.20261014.015055Z → 1.6.0-dev.20261022.120426Z
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/lib/core/components/shadcn/selectBox.js +1 -1
- package/lib/core/components/shadcn/selectBox.js.map +1 -1
- package/lib/features/agent/PayloadBuilder.d.ts +1 -1
- package/lib/features/oauth/useMcpConnections.d.ts.map +1 -1
- package/lib/features/oauth/useMcpConnections.js +21 -8
- package/lib/features/oauth/useMcpConnections.js.map +1 -1
- package/lib/features/store/objects/DocumentTable.d.ts.map +1 -1
- package/lib/features/store/objects/DocumentTable.js +0 -9
- package/lib/features/store/objects/DocumentTable.js.map +1 -1
- package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
- package/lib/features/store/objects/components/ContentOverview.js +2 -30
- package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/features/store/objects/components/VectorSearchWidget.d.ts.map +1 -1
- package/lib/features/store/objects/components/VectorSearchWidget.js +1 -1
- package/lib/features/store/objects/components/VectorSearchWidget.js.map +1 -1
- package/lib/features/store/objects/components/textPanelSource.d.ts +14 -0
- package/lib/features/store/objects/components/textPanelSource.d.ts.map +1 -0
- package/lib/features/store/objects/components/textPanelSource.js +52 -0
- package/lib/features/store/objects/components/textPanelSource.js.map +1 -0
- package/lib/features/store/objects/upload/DocumentUploadModal.d.ts.map +1 -1
- package/lib/features/store/objects/upload/DocumentUploadModal.js +13 -9
- package/lib/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
- package/lib/session/auth/oauth.d.ts.map +1 -1
- package/lib/session/auth/oauth.js +18 -10
- package/lib/session/auth/oauth.js.map +1 -1
- package/lib/vertesia-ui-boot.js.map +1 -1
- package/lib/vertesia-ui-core.js +76 -76
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-env.js.map +1 -1
- package/lib/vertesia-ui-features.js +339 -339
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-i18n.js +1 -1
- package/lib/vertesia-ui-i18n.js.map +1 -1
- package/lib/vertesia-ui-layout.js +16 -16
- package/lib/vertesia-ui-layout.js.map +1 -1
- package/lib/vertesia-ui-rich-text.js +118 -118
- package/lib/vertesia-ui-rich-text.js.map +1 -1
- package/lib/vertesia-ui-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +26 -26
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +148 -148
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/lib/widgets/markdown/MermaidDiagram.d.ts.map +1 -1
- package/lib/widgets/markdown/MermaidDiagram.js +5 -2
- package/lib/widgets/markdown/MermaidDiagram.js.map +1 -1
- package/lib/widgets/upload/DropZone.d.ts.map +1 -1
- package/lib/widgets/upload/DropZone.js +1 -0
- package/lib/widgets/upload/DropZone.js.map +1 -1
- package/package.json +46 -41
- package/src/core/components/shadcn/selectBox.tsx +1 -1
- package/src/features/oauth/useMcpConnections.ts +26 -8
- package/src/features/store/objects/DocumentTable.tsx +0 -9
- package/src/features/store/objects/components/ContentOverview.tsx +2 -34
- package/src/features/store/objects/components/VectorSearchWidget.tsx +4 -2
- package/src/features/store/objects/components/textPanelSource.ts +58 -0
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +14 -10
- package/src/session/auth/oauth.ts +18 -9
- package/src/widgets/markdown/MermaidDiagram.tsx +5 -2
- package/src/widgets/upload/DropZone.tsx +1 -0
package/lib/vertesia-ui-core.js
CHANGED
|
@@ -1,239 +1,239 @@
|
|
|
1
|
-
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import r,{clsx as i}from"clsx";import*as a from"react";import o,{Children as s,Component as c,Fragment as l,cloneElement as u,createContext as d,createElement as f,forwardRef as p,isValidElement as m,useCallback as h,useContext as g,useEffect as _,useId as v,useImperativeHandle as y,useInsertionEffect as b,useLayoutEffect as x,useMemo as S,useRef as C,useState as w}from"react";import*as T from"react-dom";import{createPortal as E}from"react-dom";import{SUPPORTED_LANGUAGES as D,useLanguage as O,useUITranslation as k}from"@vertesia/ui/i18n";import{cva as A}from"class-variance-authority";import{twMerge as j}from"tailwind-merge";import{DismissableLayer as M,useDismissableLayerSurface as N}from"@radix-ui/react-dismissable-layer";import{
|
|
1
|
+
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import r,{clsx as i}from"clsx";import*as a from"react";import o,{Children as s,Component as c,Fragment as l,cloneElement as u,createContext as d,createElement as f,forwardRef as p,isValidElement as m,useCallback as h,useContext as g,useEffect as _,useId as v,useImperativeHandle as y,useInsertionEffect as b,useLayoutEffect as x,useMemo as S,useRef as C,useState as w}from"react";import*as T from"react-dom";import{createPortal as E}from"react-dom";import{SUPPORTED_LANGUAGES as D,useLanguage as O,useUITranslation as k}from"@vertesia/ui/i18n";import{cva as A}from"class-variance-authority";import{twMerge as j}from"tailwind-merge";import{DismissableLayer as M,useDismissableLayerSurface as N}from"@radix-ui/react-dismissable-layer";import{FocusScope as P,FocusScopeBranchProvider as F,useFocusScopeBranch as ee,useFocusScopeBranchRegistry as I}from"@radix-ui/react-focus-scope";import{arrow as te,autoUpdate as ne,computePosition as re,flip as ie,hide as ae,limitShift as oe,offset as se,shift as ce,size as le}from"@floating-ui/dom";import{Env as ue}from"@vertesia/ui/env";import{useFocusGuards as de}from"@radix-ui/react-focus-guards";import{RemoveScroll as fe}from"react-remove-scroll";import{hideOthers as pe}from"aria-hidden";import{useDirection as me}from"@radix-ui/react-direction";import he from"dayjs";import ge from"dayjs/plugin/localizedFormat";import _e from"dayjs/plugin/relativeTime";import{isEqual as ve}from"lodash-es";import*as ye from"react-resizable-panels";function be(e){switch(e){case`xs`:return`size-4`;case`sm`:return`size-6`;case`md`:return`size-8`;case`lg`:return`size-10`;case`xl`:return`size-12`;case`2xl`:return`size-14`;default:throw Error(`Unexpected size: ${e}`)}}function xe({size:e,src:n,name:r,shape:i=`circle`,color:a=`bg-muted text-muted`,className:o}){let s=i===`circle`?`rounded-full`:`rounded-md`,c=be(e||`md`);if(n)return t(`img`,{className:`inline-block ${c} ${s} ${a} ${o}`,src:n,alt:r||n,title:r});if(r){let[n,i]=r.split(` `),l=i?`${n[0]}${i[0]}`:`${n[0]}${n[1]}`;return t(`span`,{className:`inline-flex ${c} items-center justify-center ${s} ${a} ${o}`,title:r,children:t(`span`,{className:`${e===`xs`?`text-[0.6rem]`:`text-xs`} font-medium leading-none text-current`,children:l})})}return t(`span`,{className:`inline-block ${c} overflow-hidden ${s} ${a}`,children:t(`svg`,{className:`h-full w-full text-foreground`,fill:`currentColor`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:t(`path`,{d:`M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z`})})})}function Se({size:e,shape:n=`circle`,color:r=`bg-muted`,className:i,children:a}){let o=n===`circle`?`rounded-full`:`rounded-md`,s=be(e||`md`);return t(`span`,{className:`inline-block ${s} overflow-hidden ${o} ${r} ${i}`,children:a})}function Ce({className:e,children:n}){return t(`div`,{className:r(`flex items-center justify-center`,e),children:n})}function we(e){return t(`svg`,{viewBox:`0 0 25 16`,fill:`currentColor`,"aria-hidden":`true`,...e,children:t(`path`,{d:`M19.4 6C18.7 2.6 15.7 0 12 0 9.1 0 6.6 1.6 5.4 4 2.3 4.4 0 6.9 0 10c0 3.3 2.7 6 6 6h13c2.8 0 5-2.2 5-5 0-2.6-2.1-4.8-4.6-5z`})})}
|
|
2
2
|
/**
|
|
3
|
-
* @license lucide-react v1.
|
|
3
|
+
* @license lucide-react v1.57.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
const
|
|
8
|
+
const Te=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();
|
|
9
9
|
/**
|
|
10
|
-
* @license lucide-react v1.
|
|
10
|
+
* @license lucide-react v1.57.0 - ISC
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the ISC license.
|
|
13
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
function
|
|
15
|
+
function Ee(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Te(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}
|
|
16
16
|
/**
|
|
17
|
-
* @license lucide-react v1.
|
|
17
|
+
* @license lucide-react v1.57.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const De=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Oe=e=>{
|
|
23
23
|
/**
|
|
24
|
-
* @license lucide-react v1.
|
|
24
|
+
* @license lucide-react v1.57.0 - ISC
|
|
25
25
|
*
|
|
26
26
|
* This source code is licensed under the ISC license.
|
|
27
27
|
* See the LICENSE file in the root directory of this source tree.
|
|
28
28
|
*/
|
|
29
|
-
let t=
|
|
29
|
+
let t=De(e);return t.charAt(0).toUpperCase()+t.slice(1)},ke=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ae={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`}
|
|
30
30
|
/**
|
|
31
|
-
* @license lucide-react v1.
|
|
31
|
+
* @license lucide-react v1.57.0 - ISC
|
|
32
32
|
*
|
|
33
33
|
* This source code is licensed under the ISC license.
|
|
34
34
|
* See the LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
36
|
/**
|
|
37
|
-
* @license lucide-react v1.
|
|
37
|
+
* @license lucide-react v1.57.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
41
|
*/
|
|
42
42
|
;
|
|
43
43
|
/**
|
|
44
|
-
* @license lucide-react v1.
|
|
44
|
+
* @license lucide-react v1.57.0 - ISC
|
|
45
45
|
*
|
|
46
46
|
* This source code is licensed under the ISC license.
|
|
47
47
|
* See the LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/
|
|
49
|
-
function
|
|
49
|
+
function je(e){return e!=null}function Me(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Ae.width,a=e.size??e.height??Ae.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?ke(...c):ke(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Ae[`stroke-width`])*Number(e.size??e.width??Ae.width)/Number(t.size??t.width??Ae.width):t.strokeWidth??Ae[`stroke-width`];return[`svg`,{...Object.entries(Ae).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&je(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&je(t.width)&&{[r(`width`)]:t.width},...`height`in t&&je(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}
|
|
50
50
|
/**
|
|
51
|
-
* @license lucide-react v1.
|
|
51
|
+
* @license lucide-react v1.57.0 - ISC
|
|
52
52
|
*
|
|
53
53
|
* This source code is licensed under the ISC license.
|
|
54
54
|
* See the LICENSE file in the root directory of this source tree.
|
|
55
55
|
*/
|
|
56
|
-
function
|
|
56
|
+
function Ne(e,t={}){return Me(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}
|
|
57
57
|
/**
|
|
58
|
-
* @license lucide-react v1.
|
|
58
|
+
* @license lucide-react v1.57.0 - ISC
|
|
59
59
|
*
|
|
60
60
|
* This source code is licensed under the ISC license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
62
|
*/
|
|
63
|
-
const
|
|
63
|
+
const Pe=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Fe=d({}),Ie=()=>g(Fe),Le=p(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},p)=>{
|
|
64
64
|
/**
|
|
65
|
-
* @license lucide-react v1.
|
|
65
|
+
* @license lucide-react v1.57.0 - ISC
|
|
66
66
|
*
|
|
67
67
|
* This source code is licensed under the ISC license.
|
|
68
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
69
69
|
*/
|
|
70
70
|
/**
|
|
71
|
-
* @license lucide-react v1.
|
|
71
|
+
* @license lucide-react v1.57.0 - ISC
|
|
72
72
|
*
|
|
73
73
|
* This source code is licensed under the ISC license.
|
|
74
74
|
* See the LICENSE file in the root directory of this source tree.
|
|
75
75
|
*/
|
|
76
|
-
let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=
|
|
76
|
+
let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=Ie()??{},b=!!c||Pe(d),[x,S,C=[]]=Ne(u,{color:e??v,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:ke(y,s),hasA11yProp:b,attributes:d});return f(x,{ref:p,...S},[...C.map(([e,t])=>f(e,t)),...Array.isArray(c)?c:[c]])});
|
|
77
77
|
/**
|
|
78
|
-
* @license lucide-react v1.
|
|
78
|
+
* @license lucide-react v1.57.0 - ISC
|
|
79
79
|
*
|
|
80
80
|
* This source code is licensed under the ISC license.
|
|
81
81
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
82
|
*/
|
|
83
|
-
function
|
|
83
|
+
function L(e,t=[],n=[]){let r=typeof e==`string`?Ee(e,t,n):e,i=p(({className:e,...t},n)=>f(Le,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Oe(r.name)),i}
|
|
84
84
|
/**
|
|
85
|
-
* @license lucide-react v1.
|
|
85
|
+
* @license lucide-react v1.57.0 - ISC
|
|
86
86
|
*
|
|
87
87
|
* This source code is licensed under the ISC license.
|
|
88
88
|
* See the LICENSE file in the root directory of this source tree.
|
|
89
89
|
*/
|
|
90
|
-
const
|
|
90
|
+
const R={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};R.node;const Re=L(R),ze={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}
|
|
91
91
|
/**
|
|
92
|
-
* @license lucide-react v1.
|
|
92
|
+
* @license lucide-react v1.57.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
95
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
96
|
*/
|
|
97
|
-
;
|
|
97
|
+
;ze.node;const Be=L(ze),Ve={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}
|
|
98
98
|
/**
|
|
99
|
-
* @license lucide-react v1.
|
|
99
|
+
* @license lucide-react v1.57.0 - ISC
|
|
100
100
|
*
|
|
101
101
|
* This source code is licensed under the ISC license.
|
|
102
102
|
* See the LICENSE file in the root directory of this source tree.
|
|
103
103
|
*/
|
|
104
|
-
;
|
|
104
|
+
;Ve.node;const He=L(Ve),Ue={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]}
|
|
105
105
|
/**
|
|
106
|
-
* @license lucide-react v1.
|
|
106
|
+
* @license lucide-react v1.57.0 - ISC
|
|
107
107
|
*
|
|
108
108
|
* This source code is licensed under the ISC license.
|
|
109
109
|
* See the LICENSE file in the root directory of this source tree.
|
|
110
110
|
*/
|
|
111
|
-
;
|
|
111
|
+
;Ue.node;const We=L(Ue),Ge={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]}
|
|
112
112
|
/**
|
|
113
|
-
* @license lucide-react v1.
|
|
113
|
+
* @license lucide-react v1.57.0 - ISC
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
117
|
*/
|
|
118
|
-
;
|
|
118
|
+
;Ge.node;const Ke=L(Ge),qe={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]}
|
|
119
119
|
/**
|
|
120
|
-
* @license lucide-react v1.
|
|
120
|
+
* @license lucide-react v1.57.0 - ISC
|
|
121
121
|
*
|
|
122
122
|
* This source code is licensed under the ISC license.
|
|
123
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
124
|
*/
|
|
125
|
-
;
|
|
125
|
+
;qe.node;const Je=L(qe),Ye={name:`circle-x`,size:24,node:[[`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`}]],aliases:[`x-circle`]}
|
|
126
126
|
/**
|
|
127
|
-
* @license lucide-react v1.
|
|
127
|
+
* @license lucide-react v1.57.0 - ISC
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
131
|
*/
|
|
132
|
-
;
|
|
132
|
+
;Ye.node;const Xe=L(Ye),Ze={name:`computer`,size:24,node:[[`path`,{d:`M12 18h6`,key:`aqd8w3`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M8 6h1`,key:`tn6mkg`}],[`rect`,{x:`2`,y:`14`,width:`20`,height:`8`,rx:`2`,key:`rlpjsu`}],[`rect`,{x:`4`,y:`2`,width:`16`,height:`12`,rx:`2`,key:`fhup8x`}]]}
|
|
133
133
|
/**
|
|
134
|
-
* @license lucide-react v1.
|
|
134
|
+
* @license lucide-react v1.57.0 - ISC
|
|
135
135
|
*
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
137
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
138
|
*/
|
|
139
|
-
;
|
|
139
|
+
;Ze.node;const Qe=L(Ze),$e={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]}
|
|
140
140
|
/**
|
|
141
|
-
* @license lucide-react v1.
|
|
141
|
+
* @license lucide-react v1.57.0 - ISC
|
|
142
142
|
*
|
|
143
143
|
* This source code is licensed under the ISC license.
|
|
144
144
|
* See the LICENSE file in the root directory of this source tree.
|
|
145
145
|
*/
|
|
146
|
-
|
|
146
|
+
;$e.node;const et=L($e),tt={name:`ellipsis`,size:24,node:[[`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`}]],aliases:[`more-horizontal`]}
|
|
147
147
|
/**
|
|
148
|
-
* @license lucide-react v1.
|
|
148
|
+
* @license lucide-react v1.57.0 - ISC
|
|
149
149
|
*
|
|
150
150
|
* This source code is licensed under the ISC license.
|
|
151
151
|
* See the LICENSE file in the root directory of this source tree.
|
|
152
152
|
*/
|
|
153
|
-
;
|
|
153
|
+
;tt.node;const nt=L(tt),rt={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]}
|
|
154
154
|
/**
|
|
155
|
-
* @license lucide-react v1.
|
|
155
|
+
* @license lucide-react v1.57.0 - ISC
|
|
156
156
|
*
|
|
157
157
|
* This source code is licensed under the ISC license.
|
|
158
158
|
* See the LICENSE file in the root directory of this source tree.
|
|
159
159
|
*/
|
|
160
|
-
;
|
|
160
|
+
;rt.node;const it=L(rt),at={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]}
|
|
161
161
|
/**
|
|
162
|
-
* @license lucide-react v1.
|
|
162
|
+
* @license lucide-react v1.57.0 - ISC
|
|
163
163
|
*
|
|
164
164
|
* This source code is licensed under the ISC license.
|
|
165
165
|
* See the LICENSE file in the root directory of this source tree.
|
|
166
166
|
*/
|
|
167
|
-
;
|
|
167
|
+
;at.node;const ot=L(at),st={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]}
|
|
168
168
|
/**
|
|
169
|
-
* @license lucide-react v1.
|
|
169
|
+
* @license lucide-react v1.57.0 - ISC
|
|
170
170
|
*
|
|
171
171
|
* This source code is licensed under the ISC license.
|
|
172
172
|
* See the LICENSE file in the root directory of this source tree.
|
|
173
173
|
*/
|
|
174
|
-
;
|
|
174
|
+
;st.node;const ct=L(st),lt={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]}
|
|
175
175
|
/**
|
|
176
|
-
* @license lucide-react v1.
|
|
176
|
+
* @license lucide-react v1.57.0 - ISC
|
|
177
177
|
*
|
|
178
178
|
* This source code is licensed under the ISC license.
|
|
179
179
|
* See the LICENSE file in the root directory of this source tree.
|
|
180
180
|
*/
|
|
181
|
-
;
|
|
181
|
+
;lt.node;const ut=L(lt),dt={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]}
|
|
182
182
|
/**
|
|
183
|
-
* @license lucide-react v1.
|
|
183
|
+
* @license lucide-react v1.57.0 - ISC
|
|
184
184
|
*
|
|
185
185
|
* This source code is licensed under the ISC license.
|
|
186
186
|
* See the LICENSE file in the root directory of this source tree.
|
|
187
187
|
*/
|
|
188
|
-
;
|
|
188
|
+
;dt.node;const ft=L(dt),pt={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]}
|
|
189
189
|
/**
|
|
190
|
-
* @license lucide-react v1.
|
|
190
|
+
* @license lucide-react v1.57.0 - ISC
|
|
191
191
|
*
|
|
192
192
|
* This source code is licensed under the ISC license.
|
|
193
193
|
* See the LICENSE file in the root directory of this source tree.
|
|
194
194
|
*/
|
|
195
|
-
;
|
|
195
|
+
;pt.node;const mt=L(pt),ht={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]}
|
|
196
196
|
/**
|
|
197
|
-
* @license lucide-react v1.
|
|
197
|
+
* @license lucide-react v1.57.0 - ISC
|
|
198
198
|
*
|
|
199
199
|
* This source code is licensed under the ISC license.
|
|
200
200
|
* See the LICENSE file in the root directory of this source tree.
|
|
201
201
|
*/
|
|
202
|
-
;
|
|
202
|
+
;ht.node;const gt=L(ht),_t={name:`square-plus`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]],aliases:[`plus-square`]}
|
|
203
203
|
/**
|
|
204
|
-
* @license lucide-react v1.
|
|
204
|
+
* @license lucide-react v1.57.0 - ISC
|
|
205
205
|
*
|
|
206
206
|
* This source code is licensed under the ISC license.
|
|
207
207
|
* See the LICENSE file in the root directory of this source tree.
|
|
208
208
|
*/
|
|
209
|
-
;
|
|
209
|
+
;_t.node;const vt=L(_t),yt={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]}
|
|
210
210
|
/**
|
|
211
|
-
* @license lucide-react v1.
|
|
211
|
+
* @license lucide-react v1.57.0 - ISC
|
|
212
212
|
*
|
|
213
213
|
* This source code is licensed under the ISC license.
|
|
214
214
|
* See the LICENSE file in the root directory of this source tree.
|
|
215
215
|
*/
|
|
216
|
-
;
|
|
216
|
+
;yt.node;const bt=L(yt),xt={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]}
|
|
217
217
|
/**
|
|
218
|
-
* @license lucide-react v1.
|
|
218
|
+
* @license lucide-react v1.57.0 - ISC
|
|
219
219
|
*
|
|
220
220
|
* This source code is licensed under the ISC license.
|
|
221
221
|
* See the LICENSE file in the root directory of this source tree.
|
|
222
222
|
*/
|
|
223
|
-
;
|
|
223
|
+
;xt.node;const St=L(xt),Ct={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}
|
|
224
224
|
/**
|
|
225
|
-
* @license lucide-react v1.
|
|
225
|
+
* @license lucide-react v1.57.0 - ISC
|
|
226
226
|
*
|
|
227
227
|
* This source code is licensed under the ISC license.
|
|
228
228
|
* See the LICENSE file in the root directory of this source tree.
|
|
229
229
|
*/
|
|
230
|
-
;bt.node;const xt=I(bt);function St(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`;case`ne`:return`sw`;case`nw`:return`se`;case`se`:return`nw`;case`sw`:return`ne`;default:return e}}function Ct(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var wt=class{left;top;width;height;alignAxis;gap;constructor(e=0){this.gap=e}position(e,t,n){switch(e){case`top`:this.top=t.top-n.height-this.gap,this.alignAxis=`x`;break;case`bottom`:this.top=t.bottom+this.gap,this.alignAxis=`x`;break;case`left`:this.left=t.left-n.width-this.gap,this.alignAxis=`y`;break;case`right`:this.left=t.right+this.gap,this.alignAxis=`y`;break;case`ne`:this.top=t.top-n.height-this.gap,this.left=t.right+this.gap;break;case`nw`:this.top=t.top-n.height-this.gap,this.left=t.left-n.width-this.gap;break;case`se`:this.top=t.bottom+this.gap,this.left=t.right+this.gap;break;case`sw`:this.top=t.bottom+this.gap,this.left=t.left-n.width-this.gap}}align(e,t,n){if(this.alignAxis)switch(e){case`start`:this.alignAxis===`x`?this.left=t.left:this.top=t.top;break;case`end`:this.alignAxis===`x`?this.left=t.right-n.width:this.top=t.bottom-n.height;break;case`center`:this.alignAxis===`x`?this.left=t.left+t.width/2-n.width/2:this.top=t.top+t.height/2-n.height/2;break;case`fill`:this.alignAxis===`x`?(this.left=t.left,this.width=t.right-t.left):(this.top=t.top,this.height=t.bottom-t.top)}}computePosition(e,t,n){if(this.position(e.position,n,t),e.align&&this.align(e.align,n,t),!this.left&&!this.top)throw Error(`Invalid position. Cannot compute x,y coordinates`);let r=this.width!=null,i=this.height!=null,a=this.width??t.width,o=this.height??t.height;return{rect:new DOMRect(this.left??0,this.top??0,a,o),constrainWidth:r,constrainHeight:i,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){let t=Ct(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=St(e.position);if(t!==e.position)return{...e,position:t}}return null}};function Tt(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function Et(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function Dt(e,t,n,r){let i=new wt(e.gap),a=i.computePosition(e,t,n),o=Et(a.rect,r,`x`),s=Et(a.rect,r,`y`);if(o&&s)return a;let c=null;return o||(c=i.flipAxis(e,`x`)),s||(c=i.flipAxis(c||e,`y`)),c?(a=new wt(i.gap).computePosition(c,t,n),Tt(a.rect,r)?a:null):null}function Ot(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return i<=n||a<=r?null:new DOMRect(n,r,i-n,a-r)}function kt(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=Ot(e[n].getBoundingClientRect(),t),!t)return null;return t}function At(e){let t=e.scrollHeight>e.clientHeight,n=e.scrollWidth>e.clientWidth;if(t||n){let r=getComputedStyle(e);if(t&&r.overflowY!==`visible`||n&&r.overflowX!==`visible`)return!0}return!1}function jt(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)At(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var Mt=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=jt(this.anchor,this.root),this.visibleClientRect=kt(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){let t=this.scrollableParents,n=()=>{this.update()};window.addEventListener(`resize`,n);for(let e of t)e.addEventListener(`scroll`,n);let r;this.options.closeOnClick&&(r=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout(()=>{r&&document.addEventListener(`click`,r)},0));let i;this.options.closeOnEsc&&(i=e=>{e.key===`Escape`&&this.tryClose()},window.setTimeout(()=>{i&&document.addEventListener(`keydown`,i)},0));let a=this.options.blockPageScroll;return a&&(document.body.style.overflow=`hidden`,document.body.style.height=`100%`),()=>{window.removeEventListener(`resize`,n);for(let e of t)e.removeEventListener(`scroll`,n);r&&document.removeEventListener(`click`,r),i&&document.removeEventListener(`keydown`,i),a&&(document.body.style.overflow=``,document.body.style.height=``)}}open(e,t){if(this.context)throw Error(`The popup controller is already bound to an element`);this.tryOpen(e,t)}tryOpen(e,t){this.context||(this.context={element:e,constraints:t,cleanup:this.registerListeners(e)},e.style.display=``,e.style.visibility=`hidden`,this.update(),this.options.onOpen?.(this))}close(){if(!this.context)throw Error(`The popup controller is not bound to an element`);this.tryClose()}tryClose(){this.context&&=(this.options.onClose?.(this),this.context.cleanup(),this.context.element.style.display=`none`,void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;let e=this.context.element,t=this.context.constraints,n=e.getBoundingClientRect(),r=this.anchor.getBoundingClientRect(),i=this.visibleClientRect;if(!i)return;let a=Dt(t,n,r,i);this.context.position=a||void 0,a&&(a.constrainHeight&&(e.style.height=`${a.rect.height}px`),a.constrainWidth&&(e.style.width=`${a.rect.width}px`),e.style.left=`${a.rect.left}px`,e.style.top=`${a.rect.top}px`,e.style.visibility=`visible`)}createPopupElement(){let e=document.createElement(`div`);return e.style.margin=`0`,e.style.padding=`0`,e.style.border=`none`,e.style.background=`transparent`,e.className=`composable-Popup`,e}};const Nt=d(void 0);function Pt(){let e=g(Nt);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function Ft({ctrlRef:e,id:n,constraints:r,isOpen:i,children:a,className:o,onClose:s,onOpen:c,zIndex:l,position:u,anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h}){let g=C(null),[v,y]=w(),b=C(s),x=C(c);return b.current=s,x.current=c,_(()=>{if(!d)throw Error(`Anchor element is required`);let e=new Mt({anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h,onClose:()=>b.current?.(),onOpen:()=>x.current?.()});return y(e),()=>{e.tryClose()}},[d,h,p,m,f]),_(()=>{e&&(e.current=v)},[v,e]),_(()=>{v&&g.current?v.isOpen!==i&&(i?v.open(g.current,r):v.close()):v?.isOpen&&!i&&v.close()},[r,i,v]),t(Nt.Provider,{value:v,children:i&&E(t(`div`,{id:n,style:{visibility:`hidden`,position:u||`absolute`,zIndex:l||100},ref:g,className:o,children:a}),document.body)})}function It({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(Ft,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function Lt(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var Rt=class{filter(e,t){let n=t.toLowerCase();return e.filter(e=>this.valueOf(e).toLowerCase().includes(n))}renderOption(e){return this.valueOf(e)}findById(e,t){return e.find(e=>this.idOf(e)===t)}createItem(e){return null}},zt=class e extends Rt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},Bt=class e extends zt{createItem(e){return e}static instance=new e};function Vt(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:`w-72 mt-1 border-popover bg-popover text-popover-foreground shadow-md overflow-auto p-0 z-10`,inputClass:r(t?`block m-0 p-0 border-0 focus:outline-none focus:ring-0`:`block sm:text-sm sm:leading-6 bg-muted rounded-md border-0 shadow-sm ring-1 ring-inset ring-muted placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-primary py-1.5`,e?`w-full`:`!w-auto`),optionClass:`py-2 px-3 shadow-sm flex flex-col [&.option-selected]:font-semibold [&.option-highlighted]:bg-info`,Input:Ut,Menu:Gt,Toggle:Wt}}function Ht({menuAlign:r=`fill`,menuGap:i,focusOnMount:a,onSelect:s,value:c,zIndex:l,unstyledInput:u,fullWidth:d,api:f,layout:p,adapter:m,items:h,placeholder:g,clearable:v,noMatchMessage:y,openOnFocus:b}){let[x]=w(Lt()),S=C(void 0),T=C(null),E=p?Object.assign(Vt(d,u),p):Vt(d,u),D=o.useRef(null),O=Kt({adapter:m,items:h,value:c,popupId:x});_(()=>{T.current&&a&&T.current.focus()},[a]),_(()=>{O.onSelect=s,O.popupCtrl=S.current},[O,s]),_(()=>{if(f&&O&&T.current)return f.current={open:()=>O.openMenu(),close:()=>O.closeMenu(),toggle:()=>O.toggleMenu(),setInputValue:e=>O.inputText=e,inputValue:O.inputText||``,selectedItem:O.selectedItem,focus:()=>T.current?.focus()},()=>{f.current=null}},[f,O]);let k=O.isMenuOpen&&(O.filteredItems.length>0||!!y);return n(e,{children:[t(E.Input,{boxRef:D,inputRef:T,ctrl:O,layout:E,placeholder:g,clearable:v,openOnFocus:b}),t(It,{id:x,ctrlRef:S,className:`combobox-popup`,closeOnClick:!0,closeOnEsc:!0,onClose:()=>O.closeMenu(),isOpen:k,anchor:D,zIndex:l,constraints:{position:`bottom`,align:r,gap:i??4},children:t(E.Menu,{fillWidth:r===`fill`,items:O.filteredItems,ctrl:O,layout:E,adapter:m,noMatchMessage:y})})]})}function Ut({inputRef:e,placeholder:r,boxRef:i,ctrl:a,layout:o,clearable:s,openOnFocus:c}){let l=o.Toggle,u=s&&a.selectedItem!=null,d=+!!l+ +!!u,f=d>0?{paddingRight:`${o.buttonWidth*d+o.buttonRight}px`}:void 0;return n(`div`,{className:`relative`,ref:i,children:[t(`input`,{ref:e,placeholder:r,...a.getInputProps(),onFocus:c?()=>a.openMenu():void 0,style:f,className:o.inputClass}),n(`div`,{style:{position:`absolute`,right:`${o.buttonRight}px`,top:0,bottom:0,display:`flex`,alignItems:`center`,gap:`2px`},children:[u&&t(`button`,{type:`button`,style:{border:`none`,padding:0,margin:0,backgroundColor:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,width:`${o.buttonWidth}px`},onClick:()=>{a.selectedItem=null},children:t(xt,{className:`w-4 h-4`})}),l&&t(`button`,{type:`button`,style:{width:`${o.buttonWidth}px`,border:`none`,padding:0,margin:0,backgroundColor:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`},...a.getToggleButtonProps(),children:t(l,{ctrl:a,layout:o})})]})]})}function Wt({ctrl:e}){return e.isMenuOpen?t(ze,{className:`w-4 h-4`}):t(R,{className:`w-4 h-4`})}function Gt({fillWidth:e,items:n,layout:i,ctrl:a,adapter:o,noMatchMessage:s}){let{highlightedIndex:c,selectedItem:l}=a;return n.length===0?s?t(`div`,{style:{width:e?`100%`:void 0},className:i.menuClass,children:s}):null:t(`ul`,{style:{width:e?`100%`:void 0,maxHeight:i.maxMenuHeight?`${i.maxMenuHeight}px`:`240px`},className:i.menuClass,...a.getMenuProps(),children:n.map((e,n)=>t(`li`,{"data-index":n,className:r(i.optionClass,c===n&&`option-highlighted`,l===e&&`option-selected`),...a.getItemProps(e,n),children:o.renderOption(e)},o.idOf(e)))})}function Kt(e){let[t,n]=w(new qt(e));return _(()=>{t?.withState(n)},[t]),t}var qt=class e{popupId;items;adapter;onSelect;setState;_selectedItem=null;_filteredItems;_inputText=``;_highlightedIndex=null;_isMenuOpen=!1;popupCtrl;constructor({adapter:e,items:t,value:n,popupId:r}){this.adapter=e,this.items=t,this.popupId=r,typeof n==`string`?this._inputText=n:n&&(this._selectedItem=e.findById(t,e.idOf(n))||null,this._selectedItem&&(this._inputText=e.valueOf(n))),this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items}withState(e){return this.setState=e,this}clone(){let t=new e({adapter:this.adapter,items:this.items,popupId:this.popupId});return t.setState=this.setState,t.onSelect=this.onSelect,t._inputText=this._inputText,t._highlightedIndex=this._highlightedIndex,t._selectedItem=this._selectedItem,t._isMenuOpen=this._isMenuOpen,t._filteredItems=this._filteredItems,t.popupCtrl=this.popupCtrl,t}updateState(){this.setState?.(this.clone())}get filteredItems(){return this._inputText?this.adapter.filter(this.items,this._inputText):this.items}get selectedItem(){return this._selectedItem}set selectedItem(e){this._selectedItem=e,this._inputText=e?this.adapter.valueOf(e):``,this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items,this.updateState(),this.onSelect?.(e)}get isMenuOpen(){return this._isMenuOpen}set inputText(e){if(this._inputText=e,this._filteredItems=e?this.adapter.filter(this.items,e):this.items,this._highlightedIndex=null,this._selectedItem=null,this.updateState(),this.isMenuOpen&&this.popupCtrl){let e=this.popupCtrl,t=e.context?.position?.position;t&&t===`top`&&window.setTimeout(()=>{e.update()},100)}}get inputText(){return this._inputText}set highlightedIndex(e){this._highlightedIndex=e,this.updateState()}get highlightedIndex(){return this._highlightedIndex}openMenu(){this._filteredItems.length>0&&(this._isMenuOpen=!0,this.updateState())}closeMenu(e){this._isMenuOpen&&(this._highlightedIndex=null,this._isMenuOpen=!1,this.updateState())}toggleMenu(){this._isMenuOpen?this.closeMenu():this.openMenu()}highlightIndex(e,t=!1){this.highlightedIndex=e;let n=document.getElementById(this.popupId);n&&n.querySelector(`li[data-index="${e}"]`)?.scrollIntoView(t)}getMenuProps(){return{}}getToggleButtonProps(){return{onClick:()=>{this._isMenuOpen=!this._isMenuOpen,this.updateState()}}}getItemProps(e,t){return{"aria-selected":this._highlightedIndex===t,onClick:()=>{this.selectedItem=e,this.closeMenu()},onMouseEnter:()=>{this.highlightedIndex!==t&&(this.highlightedIndex=t)},onMouseLeave:()=>{this.highlightedIndex===t&&(this.highlightedIndex=null)}}}getInputProps(){let e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{let t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{let n=t.key;if(n===`Enter`){if(this.highlightedIndex!=null)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){let e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else n===`ArrowDown`?this.isMenuOpen?this.highlightIndex(this.highlightedIndex===null?0:Jt(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:Yt(this.highlightedIndex,e.length),!0)}}}};function Jt(e,t){return(e+1)%t}function Yt(e,t){return(e-1+t)%t}function Xt({options:e,creatable:n,...r}){let i=n?Bt.instance:zt.instance;return t(Ht,{adapter:i,items:e,...r})}function Zt({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var Qt=Object.defineProperty,$t=(e,t)=>Qt(e,`name`,{value:t,configurable:!0});function en(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}$t(en,`setRef`);function tn(...e){return t=>{let n=!1,r=e.map(e=>{let r=en(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():en(e[t],null)}}}}$t(tn,`composeRefs`);function z(...e){return a.useCallback(tn(...e),e)}$t(z,`useComposedRefs`);var nn=Object.defineProperty,rn=(e,t)=>nn(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
231
|
-
function
|
|
232
|
-
function
|
|
233
|
-
function
|
|
234
|
-
function kn(e,n=[]){let r=[];function i(n,i){let o=a.createContext(i);o.displayName=n+`Context`;let s=r.length;r=[...r,i];let c=/* @__PURE__ */ Dn(n=>{let{scope:r,children:i,...c}=n,l=r?.[e]?.[s]||o,u=a.useMemo(()=>c,Object.values(c));return/* @__PURE__ */ t(l.Provider,{value:u,children:i})},`Provider`);c.displayName=n+`Provider`;function l(t,r,c={}){let{optional:l=!1}=c,u=r?.[e]?.[s]||o,d=a.useContext(u);if(d)return d;if(i!==void 0)return i;if(!l)throw Error(`\`${t}\` must be used within \`${n}\``)}return Dn(l,`useContext`),[c,l]}Dn(i,`createContext`);let o=/* @__PURE__ */ Dn(()=>{let t=r.map(e=>a.createContext(e));return/* @__PURE__ */ Dn(function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return o.scopeName=e,[i,An(o,...n)]}Dn(kn,`createContextScope`);function An(...e){let t=e[0];if(e.length===1)return t;let n=/* @__PURE__ */ Dn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return/* @__PURE__ */ Dn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Dn(An,`composeContextScopes`);var jn=globalThis?.document?a.useLayoutEffect:()=>{},Mn=Object.defineProperty,Nn=(e,t)=>Mn(e,`name`,{value:t,configurable:!0}),Pn=a.useId||(()=>void 0),Fn=0;function H(e){let[t,n]=a.useState(Pn());return jn(()=>{e||n(e=>e??String(Fn++))},[e]),e||(t?`radix-${t}`:``)}Nn(H,`useId`);var In=typeof document<`u`?x:function(){};function Ln(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ln(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ln(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zn(e,t){let n=Rn(e);return Math.round(t*n)/n}function Bn(e){let t=a.useRef(e);return In(()=>{t.current=e}),t}function Vn(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=a.useState(r);Ln(p,r)||m(r);let[h,g]=a.useState(null),[_,v]=a.useState(null),y=a.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=a.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=a.useRef(null),w=a.useRef(null),E=a.useRef(d),D=l!=null,O=Bn(l),k=Bn(i),A=Bn(u),j=a.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),te(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Ln(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);In(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=a.useRef(!1);In(()=>(M.current=!0,()=>{M.current=!1}),[]),In(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=a.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=a.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=a.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=zn(P.floating,d.x),r=zn(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Rn(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:ee}),[d,j,N,P,ee])}const Hn=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:P({element:r.current,padding:i}).fn(n):r?P({element:r,padding:i}).fn(n):{}}}},Un=(e,t)=>{let n=ie(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wn=(e,t)=>{let n=ae(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gn=(e,t)=>({fn:re(e).fn,options:[e,t]}),Kn=(e,t)=>{let n=F(e);return{name:n.name,fn:n.fn,options:[e,t]}},qn=(e,t)=>{let n=oe(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jn=(e,t)=>{let n=ne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yn=(e,t)=>{let n=Hn(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Xn=Object.defineProperty,Zn=(e,t)=>Xn(e,`name`,{value:t,configurable:!0}),U=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=/* @__PURE__ */ an(`Primitive.${n}`),i=a.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),/* @__PURE__ */ t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function Qn(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}Zn(Qn,`dispatchDiscreteCustomEvent`);var $n=Object.defineProperty,er=(e,t)=>$n(e,`name`,{value:t,configurable:!0});function tr(e){let t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}er(tr,`useCallbackRef`);var nr=Object.defineProperty,rr=(e,t)=>nr(e,`name`,{value:t,configurable:!0});function ir(e){let[t,n]=a.useState(void 0);return jn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}rr(ir,`useSize`);var ar=Object.defineProperty,or=(e,t)=>ar(e,`name`,{value:t,configurable:!0}),sr=`Popper`,[cr,lr]=/* @__PURE__ */ kn(sr),[ur,dr]=cr(sr),fr=/* @__PURE__ */ or(e=>{let{__scopePopper:n,children:r}=e,[i,o]=a.useState(null),[s,c]=a.useState(void 0);return/* @__PURE__ */ t(ur,{scope:n,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:c,children:r})},`Popper`),pr=`PopperAnchor`,mr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ or(function(e,n){let{__scopePopper:r,virtualRef:i,...o}=e,s=dr(pr,r),c=a.useRef(null),l=s.onAnchorChange,u=z(n,a.useCallback(e=>{c.current=e,e&&l(e)},[l])),d=a.useRef(null);a.useEffect(()=>{if(!i)return;let e=d.current;d.current=i.current,e!==d.current&&l(d.current)});let f=s.placementState&&xr(s.placementState),p=f?.[0],m=f?.[1];return i?null:/* @__PURE__ */ t(U.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:u})},`PopperAnchor`)),hr=`PopperContent`,[gr,_r]=cr(hr),vr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ or(function(e,n){let{__scopePopper:r,side:i=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=dr(hr,r),[y,b]=a.useState(null),x=z(n,b),[S,C]=a.useState(null),w=ir(S),T=w?.width??0,E=w?.height??0,D=i+(s===`center`?``:`-`+s),O=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(d)?d:[d],A=k.length>0,j={padding:O,boundary:k.filter(yr),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:te,middlewareData:F}=Vn({strategy:`fixed`,placement:D,whileElementsMounted:/* @__PURE__ */ or((...e)=>ee(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Un({mainAxis:o+E,alignmentAxis:c}),u&&Wn({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?Gn():void 0,...j}),u&&Kn({...j}),qn({...j,apply:/* @__PURE__ */ or(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&Yn({element:S,padding:l}),br({arrowWidth:T,arrowHeight:E}),m&&Jn({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),ne=v.setPlacementState;jn(()=>(ne(P),()=>{ne(void 0)}),[P,ne]);let[re,ie]=xr(P),ae=tr(g);jn(()=>{te&&ae?.()},[te,ae]);let oe=F.arrow?.x,se=F.arrow?.y,ce=F.arrow?.centerOffset!==0,[le,ue]=a.useState();return jn(()=>{y&&ue(window.getComputedStyle(y).zIndex)},[y]),/* @__PURE__ */ t(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:te?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:/* @__PURE__ */ t(gr,{scope:r,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:/* @__PURE__ */ t(U.div,{"data-side":re,"data-align":ie,..._,ref:x,style:{..._.style,animation:te?_.style?.animation:`none`}})})})},`PopperContent`));function yr(e){return e!==null}or(yr,`isNotNull`);var br=/* @__PURE__ */ or(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=xr(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function xr(e){let[t,n=`center`]=e.split(`-`);return[t,n]}or(xr,`getSideAndAlignFromPlacement`);var Sr=fr,Cr=mr,wr=vr,Tr=Object.defineProperty,Er=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>Tr(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[o,s]=a.useState(!1);jn(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?T.createPortal(/* @__PURE__ */ t(U.div,{...i,ref:n}),c):null},`Portal`)),Dr=Object.defineProperty,Or=(e,t)=>Dr(e,`name`,{value:t,configurable:!0});function kr(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}Or(kr,`useStateMachine`);var Ar=/* @__PURE__ */ Or(e=>{let{present:t,children:n}=e,r=jr(t),i=typeof n==`function`?n({present:r.isPresent}):a.Children.only(n),o=Nr(r.ref,Fr(i));return typeof n==`function`||r.isPresent?a.cloneElement(i,{ref:o}):null},`Presence`);function jr(e){let[t,n]=a.useState(),r=a.useRef(null),i=a.useRef(e),o=a.useRef(`none`),s=a.useRef(void 0),[c,l]=kr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return a.useEffect(()=>{c===`mounted`?(o.current=s.current??Pr(r.current),s.current=void 0):o.current=`none`},[c]),jn(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=Pr(t);e?(s.current=a,l(`MOUNT`)):a===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==a?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),jn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=/* @__PURE__ */ Or(a=>{let o=Pr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=/* @__PURE__ */ Or(e=>{e.target===t&&(o.current=Pr(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,a),t.addEventListener(`animationend`,a),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,a),t.removeEventListener(`animationend`,a)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:a.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=Pr(t)}else r.current=null;n(e)},[])}}Or(jr,`usePresence`);function Mr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Or(Mr,`setRef`);function Nr(...e){let t=a.useRef(e);return t.current=e,a.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Mr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Mr(n[e],null)}}},[])}Or(Nr,`useStableComposedRefs`);function Pr(e){return e?.animationName||`none`}Or(Pr,`getAnimationName`);function Fr(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)}Or(Fr,`getElementRef`);var Ir=Object.defineProperty,Lr=(e,t)=>Ir(e,`name`,{value:t,configurable:!0}),Rr=a.useEffectEvent,zr=a.useInsertionEffect;function Br(e){if(typeof Rr==`function`)return Rr(e);let t=a.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof zr==`function`?zr(()=>{t.current=e}):jn(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}Lr(Br,`useEffectEvent`);var Vr=Object.defineProperty,Hr=(e,t)=>Vr(e,`name`,{value:t,configurable:!0}),Ur=a.useInsertionEffect||jn;function Wr({prop:e,defaultProp:t,onChange:n=/* @__PURE__ */ Hr(()=>{},`onChange`),caller:r}){let[i,o,s]=Gr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,a.useCallback(t=>{if(c){let n=Kr(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}Hr(Wr,`useControllableState`);function Gr({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return Ur(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}Hr(Gr,`useUncontrolledState`);function Kr(e){return typeof e==`function`}Hr(Kr,`isFunction`);var qr=Symbol(`RADIX:SYNC_STATE`);function Jr(e,t,n,r){let{prop:i,defaultProp:o,onChange:s,caller:c}=t,l=i!==void 0,u=Br(s),d=[{...n,state:o}];r&&d.push(r);let[f,p]=a.useReducer((t,n)=>{if(n.type===qr)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=a.useRef(m);a.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=a.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return a.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:qr,state:i})},[i,f.state,l]),[g,p]}Hr(Jr,`useControllableStateReducer`);var Yr=Object.defineProperty,Xr=(e,t)=>Yr(e,`name`,{value:t,configurable:!0}),Zr=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`}),Qr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Xr(function(e,n){return/* @__PURE__ */ t(U.span,{...e,ref:n,style:{...Zr,...e.style}})},`VisuallyHidden`)),$r=Object.defineProperty,ei=(e,t)=>$r(e,`name`,{value:t,configurable:!0}),[ti,ni]=/* @__PURE__ */ kn(`Tooltip`,[lr]),ri=lr(),ii=`TooltipProvider`,ai=700,oi=`tooltip.open`,[si,ci]=ti(ii),li=/* @__PURE__ */ ei(e=>{let{__scopeTooltip:n,delayDuration:r=ai,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:s}=e,c=a.useRef(!0),l=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),/* @__PURE__ */ t(si,{scope:n,isOpenDelayedRef:c,delayDuration:r,onOpen:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),c.current=!1)},[i]),onClose:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:a.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:s})},`TooltipProvider`),ui=`Tooltip`,[di,fi]=ti(ui),pi=/* @__PURE__ */ ei(e=>{let{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=ci(ui,e.__scopeTooltip),d=ri(n),[f,p]=a.useState(null),[m,h]=a.useState(void 0),g=H(),_=a.useRef(0),v=c??u.disableHoverableContent,y=l??u.delayDuration,b=a.useRef(!1),[x,S]=Wr({prop:i,defaultProp:o??!1,onChange:/* @__PURE__ */ ei(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(oi))):u.onClose(),s?.(e)},`onChange`),caller:ui}),C=a.useMemo(()=>x?b.current?`delayed-open`:`instant-open`:`closed`,[x]),w=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b.current=!1,S(!0)},[S]),T=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S(!1)},[S]),E=a.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{b.current=!0,S(!0),_.current=0},y)},[y,S]);a.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let D=m??g;return/* @__PURE__ */ t(Sr,{...d,children:/* @__PURE__ */ t(di,{scope:n,contentId:D,setContentId:h,open:x,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:a.useCallback(()=>{u.isOpenDelayedRef.current?E():w()},[u.isOpenDelayedRef,E,w]),onTriggerLeave:a.useCallback(()=>{v?T():(window.clearTimeout(_.current),_.current=0)},[T,v]),onOpen:w,onClose:T,disableHoverableContent:v,children:r})})},`Tooltip`),mi=`TooltipTrigger`,hi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ei(function(e,n){let{__scopeTooltip:r,...i}=e,o=fi(mi,r),s=ci(mi,r),c=ri(r),l=z(n,a.useRef(null),o.onTriggerChange),u=a.useRef(!1),d=a.useRef(!1),f=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),/* @__PURE__ */ t(Cr,{asChild:!0,...c,children:/* @__PURE__ */ t(U.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:l,onPointerMove:V(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})},`TooltipTrigger`)),gi=`TooltipPortal`,[_i,vi]=ti(gi,{forceMount:void 0}),yi=/* @__PURE__ */ ei(e=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=e,o=fi(gi,n);return/* @__PURE__ */ t(_i,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Ar,{present:r||o.open,children:/* @__PURE__ */ t(Er,{asChild:!0,container:a,children:i})})})},`TooltipPortal`),bi=`TooltipContent`,xi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ei(function(e,n){let r=vi(bi,e.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=e,s=fi(bi,e.__scopeTooltip);return/* @__PURE__ */ t(Ar,{present:i||s.open,children:s.disableHoverableContent?/* @__PURE__ */ t(wi,{side:a,...o,ref:n}):/* @__PURE__ */ t(Si,{side:a,...o,ref:n})})},`TooltipContent`)),Si=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ei(function(e,n){let r=fi(bi,e.__scopeTooltip),i=ci(bi,e.__scopeTooltip),o=a.useRef(null),s=z(n,o),[c,l]=a.useState(null),{trigger:u,onClose:d}=r,f=o.current,{onPointerInTransitChange:p}=i,m=a.useCallback(()=>{l(null),p(!1)},[p]),h=a.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Ei(r,Ti(r,n.getBoundingClientRect())),a=Di(t.getBoundingClientRect()),o=ki([...i,...a]);l(o),p(!0)},[p]);return a.useEffect(()=>()=>m(),[m]),a.useEffect(()=>{if(u&&f){let e=/* @__PURE__ */ ei(e=>h(e,f),`handleTriggerLeave`),t=/* @__PURE__ */ ei(e=>h(e,u),`handleContentLeave`);return u.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{u.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[u,f,h,m]),a.useEffect(()=>{if(c){let e=/* @__PURE__ */ ei(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!Oi(n,c);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),/* @__PURE__ */ t(wi,{...e,ref:s})},`TooltipContentHoverable`)),Ci=/* @__PURE__ */ cn(`TooltipContent`),wi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ei(function(e,r){let{__scopeTooltip:i,children:o,"aria-label":s,id:c,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=fi(bi,i),p=ri(i),{onClose:m}=f;a.useEffect(()=>(document.addEventListener(oi,m),()=>document.removeEventListener(oi,m)),[m]),a.useEffect(()=>{if(f.trigger){let e=/* @__PURE__ */ ei(e=>{e.target instanceof Node&&e.target.contains(f.trigger)&&m()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[f.trigger,m]);let{setContentId:h}=f;return jn(()=>(h(c),()=>{h(void 0)}),[c,h]),/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:/* @__PURE__ */ n(wr,{"data-state":f.stateAttribute,role:s?void 0:`tooltip`,id:s?void 0:f.contentId,...p,...d,ref:r,style:{...d.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:[/* @__PURE__ */ t(Ci,{children:o}),s?/* @__PURE__ */ t(Qr,{id:f.contentId,role:`tooltip`,children:s}):null]})})},`TooltipContentImpl`));function Ti(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}ei(Ti,`getExitSideFromRect`);function Ei(e,t,n=5){let 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})}return r}ei(Ei,`getPaddedExitPoints`);function Di(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}ei(Di,`getPointsFromRect`);function Oi(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}ei(Oi,`isPointInPolygon`);function ki(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Ai(t)}ei(ki,`getHull`);function Ai(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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)}ei(Ai,`getHullPresorted`);var ji=li,Mi=pi,Ni=hi,Pi=yi,Fi=xi;const Ii=o.createContext(void 0);function Li(e,t=`plugin-portal-container`){let n=e instanceof Document?e.body:e;for(let e of Array.from(n.children))if(e instanceof HTMLElement&&e.id===t)return e;let r=document.createElement(`div`);return r.id=t,n.appendChild(r),r}function Ri({children:e,id:n=`plugin-portal-container`}){let r=o.useContext(Ii),i=o.useRef(null),[a,s]=o.useState(r||void 0);return o.useEffect(()=>{if(r){s(r);return}if(i.current){let e=i.current.getRootNode();if(e instanceof ShadowRoot||e instanceof Document){let t=Li(e,n);s(t)}else s(null)}},[n,r]),a===void 0?t(`div`,{ref:i,style:{display:`none`}}):t(Ii.Provider,{value:a||void 0,children:e})}function zi(){return o.useContext(Ii)}const Bi=ji,Vi=Mi,Hi=Ni,Ui=a.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=zi();return t(Pi,{container:o,children:t(Fi,{ref:a,sideOffset:n,side:r,style:{zIndex:100},className:B(`max-w-[90vw]`,`z-50 overflow-hidden rounded-md bg-tooltips border border-border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});Ui.displayName=Fi.displayName;function Wi({description:e,children:r,size:i=`sm`,placement:o=`top`,className:s,asChild:c}){let[l,u]=a.useState(!1),d=a.useRef(!1);return a.useEffect(()=>{let e=()=>{u(!1),d.current=!0,requestAnimationFrame(()=>{d.current=!1})};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,e)}},[]),t(Bi,{delayDuration:0,children:n(Vi,{open:l,onOpenChange:e=>{d.current||u(e)},children:[t(Hi,{className:`cursor-pointer`,asChild:c,children:r}),t(Ui,{side:o,className:`px-3 py-1.5 max-w-${i} text-${i} px-3 ${s}`,children:e})]})})}const Gi=/* @__PURE__ */ new Set;function Ki(e,t,n){_(()=>{t&&!Gi.has(e)&&(Gi.add(e),console.warn(`[@vertesia/ui] ${e} is deprecated: ${n}`))},[t,n,e])}function qi(e){return a.Children.toArray(e).some(e=>{if(typeof e==`string`)return e.trim().length>0;if(typeof e==`number`)return!0;if(a.isValidElement(e)){let t=e.props;return t[`aria-hidden`]===!0||t[`aria-hidden`]===`true`?!1:qi(t.children)}return!1})}const Ji=A(`hover:cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{destructive:`bg-destructive text-destructive ring-1 ring-inset ring-destructive/50 shadow-xs hover:bg-destructive/50`,outline:`border border-input bg-background shadow-xs hover:bg-muted ring-inset`,secondary:`bg-info text-info shadow-xs hover:bg-mixer-info/10 ring-inset`,ghost:`hover:bg-muted/50 ring-inset`,link:`text-foreground underline-offset-4 hover:underline ring-inset`,primary:`bg-primary text-primary shadow-xs hover:bg-primary/90 ring-inset`,unstyled:``},size:{xs:`h-7 rounded px-2 py-1 text-xs gap-x-1`,sm:`h-8 rounded px-3 text-xs`,md:`h-9 rounded-md px-4 py-2`,lg:`h-10 rounded-md px-3`,xl:`rounded-md px-3.5 py-2.5 text-sm gap-x-2`,icon:`p-0 m-0 rounded-full`,none:``}},defaultVariants:{variant:`primary`,size:`md`}}),W=a.forwardRef(({className:r,variant:i,size:a,asChild:o=!1,alt:s,isDisabled:c,isLoading:l,title:u,tooltipPlacement:d=`top`,onClick:f,type:p,...m},h)=>{Ki(`Button.alt`,s!==void 0,"use `title` instead — it drives the same tooltip and the accessible name. `alt` remains an alias for one release.");let g=o?on:`button`,_=o?p:p??`button`,v=u??s,y=m[`aria-label`]??s??(qi(m.children)?void 0:u),b=o?m.children:n(e,{children:[l&&t(at,{className:`animate-spin`}),m.children]}),x=t(g,{className:B(Ji({variant:i,size:a}),r),disabled:c||l||m.disabled,ref:h,onClick:f,type:_,autoFocus:!1,...m,"aria-label":y,children:b});return v?t(Wi,{description:v,asChild:!0,className:`cursor-pointer`,size:`xs`,placement:d,children:x}):x});W.displayName=`Button`;const Yi=a.forwardRef(({size:e,content:n,toast:r,className:i,alt:a,BtnIcon:o,"aria-label":s,...c},l)=>{let[u,d]=w(!1),{t:f}=k();Ki(`CopyButton.alt`,a!==void 0,"use aria-label for the accessible name. `alt` is forwarded for one release.");let p=e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{d(!0),setTimeout(()=>d(!1),2e3),r?.toast&&r.toast({status:`success`,title:r.message||f(`misc.copiedToClipboard`),duration:2e3})}).catch(e=>{console.error(`Failed to copy text: `,e),r?.toast&&r.toast({status:`error`,title:f(`misc.failedToCopy`),duration:2e3})})},m=s??a??f(`misc.copy`);return t(W,{ref:l,className:B(i),variant:`unstyled`,size:e||`sm`,onClick:p,...c,title:m,children:u?t(L,{className:`text-success`}):o??t(Ze,{className:`size-4`})})});Yi.displayName=`CopyButton`;function Xi({buttonLabel:e,title:r,children:i,onClick:a}){return t(`div`,{className:`flex items-center justify-center h-full text-center`,children:n(`div`,{className:`py-12`,children:[t(`svg`,{className:`mx-auto size-12`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`path`,{vectorEffect:`non-scaling-stroke`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z`})}),t(`h3`,{className:`mt-2 text-sm font-semibold`,children:r}),t(`p`,{className:`mt-1 text-sm text-muted`,children:i}),t(`div`,{className:`mt-6`,children:n(W,{onClick:a,children:[t(dt,{className:`-ms-0.5 me-1.5 size-5`,"aria-hidden":`true`}),e]})})]})})}function Zi(e){return e.isFile}function Qi(e){return e.isDirectory}function $i(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function ea({children:e,onUpload:r}){let i=C(null);return n(`label`,{style:{cursor:`pointer`},children:[e,t(`input`,{ref:i,type:`file`,style:{display:`none`},onChange:()=>{i.current?.files&&r($i(i.current.files))}})]})}function ta({onUpload:e}){let r=aa({onUpload:e});return t(`div`,{...r,className:`flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-muted hover:bg-background border-border`,children:n(`label`,{htmlFor:`dropzone-file`,className:`flex flex-col items-center justify-center w-full h-full`,children:[n(`div`,{className:`flex flex-col items-center justify-center pt-5 pb-6`,children:[t(`svg`,{className:`w-8 h-8 mb-4 text-muted`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 20 16`,children:t(`path`,{stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2`})}),n(`p`,{className:`mb-2 text-sm text-muted`,children:[t(`span`,{className:`font-semibold`,children:`Click to upload`}),` or drag and drop`]}),t(`p`,{className:`text-xs text-muted`,children:`SVG, PNG, JPG or GIF (MAX. 800x400px)`})]}),t(`input`,{id:`dropzone-file`,type:`file`,className:`hidden`})]})})}function na(e){if(!e)return!1;let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t}function ra(e){if(!e)return!1;let t=e.__dragOver_cnt__;return t?(e.__dragOver_cnt__=t-1,t===1):!1}function ia(e){e&&delete e.__dragOver_cnt__}function aa({onUpload:e,dragOverClass:t=`is-drag-over-on`,dropEffect:n=`copy`}){let r=C(null);return{onDrop:n=>{n.preventDefault(),ia(r.current),r.current?.classList.remove(t);let i=n.dataTransfer.items;if(i){let t=[],n=(e,t=``)=>new Promise(r=>{if(Zi(e))e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if(Qi(e)){let i=e.createReader(),a=[],o=()=>{i.readEntries(i=>{if(!i.length)Promise.all(a).then(e=>r(e.flat()));else{for(let r of i)a.push(n(r,`${t+e.name}/`));o()}})};o()}});for(let e=0;e<i.length;e++){let r=i[e].webkitGetAsEntry();r&&t.push(n(r))}Promise.all(t).then(t=>{let n=t.flat();n.length&&e(n)})}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=n},onDragEnter:()=>{na(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{ra(r.current)&&r.current?.classList.remove(t)},ref:r}}function oa({description:e,size:n=`sm`,placement:r=`top`,className:i}){return e?t(Wi,{description:e,placement:r,children:t(tt,{className:B(n===`md`?`size-4`:`size-3`,`text-muted`,i)})}):null}function sa(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` `):void 0}function ca(){try{return se.isDev}catch{return!1}}function la({description:e,helpText:i,error:a,required:o,label:c,className:d,direction:f=`column`,children:p,disabled:h=!1,fullWidthLabel:g=!1,childrenId:_}){let y=v(),b=v(),x=v(),S=_??y,w=C(!1),T=s.toArray(p).filter(m),E=T.length===1?T[0]:void 0,D=E?.type===l,O=!!E&&!D,k=!1,A=p;if(O&&E){let e=E,t=e.props??{},n=sa(t[`aria-describedby`],i?b:void 0,a?x:void 0),r=t[`aria-invalid`]??(a?!0:void 0);A=u(e,{id:t.id??S,"aria-describedby":n,"aria-invalid":r}),k=!0}else ca()&&!w.current&&(i||a||_===void 0)&&(w.current=!0,console.warn("[@vertesia/ui] FormItem received zero, multiple, or a fragment as element children. ARIA wiring skipped. Pass `childrenId` and set `id` / `aria-describedby` / `aria-invalid` on your input manually, or wrap the input in a single non-fragment element."));let j=k||_?S:void 0;return n(`div`,{className:r(`flex w-full space-y-1`,d,f===`row`?`flex-row justify-between items-center gap-2`:f===`row-reverse`?`flex-row-reverse justify-between items-center gap-2`:`flex-col`),children:[n(`div`,{className:r(`flex items-center gap-1 mb-0`,g&&`w-full`),children:[n(`label`,{htmlFor:j,className:`text-sm font-medium mb-1 ${h?`text-muted`:``} ${g&&`flex-1`}`,children:[c,o?t(`span`,{className:`text-destructive -mt-4 ms-1`,children:`*`}):``]}),e&&t(`div`,{className:`mx-2 flex w-4 items-center`,children:t(oa,{description:e})})]}),A,i&&t(`p`,{id:b,className:`text-xs text-muted`,children:i}),a&&t(`p`,{id:x,className:`text-xs text-destructive`,children:a})]})}function ua(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e(t))}}const da=A(`inline-flex items-center rounded-md px-2 py-1 text-xs font-medium`,{variants:{variant:{default:`text-foreground bg-muted`,secondary:`bg-secondary text-info`,destructive:`bg-destructive text-destructive`,attention:`bg-attention text-attention`,success:`bg-success text-success`,info:`bg-info text-info`,done:`bg-done text-done`,outline:`bg-transparent border border-border text-foreground`}},defaultVariants:{variant:`default`}});function fa({className:e,variant:n,children:r,onClick:i,...a}){let o=i?{role:`button`,tabIndex:0,onClick:i,onKeyDown:ua(i)}:{};return t(`span`,{className:B(da({variant:n}),e),...o,...a,children:r})}const pa=A(`inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-border`,{variants:{variant:{default:``,success:``,destructive:``,attention:``,done:``,info:``,outline:``}},defaultVariants:{variant:`default`}}),ma=A(`h-1.5 w-1.5`,{variants:{variant:{default:`fill-foreground`,success:`fill-success`,destructive:`fill-destructive`,attention:`fill-attention`,done:`fill-done`,info:`fill-info`,outline:`fill-foreground`}},defaultVariants:{variant:`default`}});function ha({variant:e,className:r,dotClassName:i,children:a,...o}){return n(`span`,{className:B(pa({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:B(ma({variant:e}),i),viewBox:`0 0 6 6`,"aria-hidden":`true`,children:t(`circle`,{cx:3,cy:3,r:3})})}),t(`span`,{className:`truncate`,children:a})]})}function ga({value:e=[],onChange:i,className:a,delimiters:o=`, `,placeholder:s,autoFocus:c,disabled:l=!1}){let[u,d]=w(``),f=t=>{if(l)return;let n=t.currentTarget.value;n?.trim()&&(i([...e,n.trim()]),d(``))},p=t=>{if(l)return;let n=t.currentTarget.value,r=!n.trim(),a=t.key;a===`Enter`||o.indexOf(a)>-1?(t.preventDefault(),e&&!r&&(i([...e,n.trim()]),d(``))):a===`Backspace`&&r&&e&&e.length>0&&(e.pop(),i([...e]))},m=t=>{if(l)return;let n=t.clipboardData.getData(`text`);if(n){t.preventDefault();let r=o.split(``).map(e=>e===` `?`\\s`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),a=RegExp(`[${r}]+`),s=n.split(a).map(e=>e.trim()).filter(e=>e.length>0);s.length>0&&i([...e,...s]),d(``)}},h=t=>{l||e&&e.length>0&&(e.splice(t,1),i([...e]))};return n(`div`,{className:r(a,`w-full flex flex-wrap items-center gap-1 p-2 py-1.5`,`rounded-md text-sm rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,l&&`opacity-50 cursor-not-allowed`),children:[e&&e.length>0&&e.map((e,n)=>t(Wi,{description:`click to remove`,children:t(fa,{variant:`secondary`,onClick:()=>h(n),className:r(`flex-shrink-0 transition-colors`,l?`cursor-not-allowed`:`cursor-pointer hover:bg-destructive hover:text-destructive`),title:e,children:t(`span`,{className:`break-all`,children:e})})},`item-${n}`)),t(`input`,{className:`flex-1 min-w-[80px] m-0 p-0 px-1 border-0 bg-transparent text-sm placeholder:text-muted focus:outline-none focus:ring-0 disabled:cursor-not-allowed`,type:`text`,value:u,onBlur:f,onKeyDown:p,onPaste:m,onChange:e=>d(e.currentTarget.value),placeholder:!e||e.length===0?s:``,autoFocus:c,disabled:l})]})}function _a({underline:e=`always`,className:n,children:i,...a}){let o;return e===`always`?o=`underline`:e===`hover`&&(o=`hover:underline`),t(`a`,{className:r(`text-info`,n,o),...a,children:i})}function va({className:e,children:n}){return t(`ul`,{className:`${e} space-y-1 flex flex-col items-start`,children:n})}va.Item=p(function(e,n){let{current:i,children:a,className:o,href:s=`#`,onClick:c,...l}=e;return t(`li`,{className:r(o,i?`bg-muted`:``,`w-full p-2 ps-3 text-sm leading-6 font-semibold hover:bg-muted`),children:t(`a`,{ref:n,href:s,onClick:e=>{c?(e.preventDefault(),c(e)):s===`#`&&e.preventDefault()},className:`w-full flex items-center gap-x-3`,...l,children:a})})});const ya=`rounded-md text-sm flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,ba={INPUT_UNSTYLED:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,INPUT_NO_PADDING:ya,INPUT:`${ya} py-1.5`};function xa(e){return e==null||Number.isNaN(e)?``:e.toString()}const Sa=o.forwardRef(({value:e,onChange:n,className:i,noScroll:a=!1,noSpinners:s=!1,...c},l)=>{let[u,d]=o.useState(xa(e));return _(()=>{if(e==null||!Number.isNaN(e)){let t=xa(e);d(t)}},[e]),t(`input`,{onWheel:a?e=>{e.currentTarget.blur()}:c.onWheel,type:`number`,value:u,onChange:e=>{let t=e.target.value;d(t),t===``?n?.(void 0,t):n?.(parseFloat(t),t)},className:r(i,ba.INPUT,{"no-spinners":s},s&&`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`),ref:l,...c})}),Ca=d({});function wa(e){let t=C(null);return t.current===null&&(t.current=e()),t.current}const Ta=typeof window<`u`?x:_,Ea=/* @__PURE__ */ d(null);function Da(e,t){e.indexOf(t)===-1&&e.push(t)}function Oa(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const ka=(e,t,n)=>n>t?t:n<e?e:n,Aa={},ja=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ma=e=>typeof e==`object`&&!!e,Na=e=>/^0[^.\s]+$/u.test(e);/*#__NO_SIDE_EFFECTS__*/
|
|
235
|
-
function
|
|
236
|
-
function Wa(e,t,n,r){if(e===t&&n===r)return Fa;let i=t=>Ua(t,0,1,e,n);return e=>e===0||e===1?e:Ha(i(e),t,r)}const Ga=/* @__NO_SIDE_EFFECTS__ */ e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ka=/* @__NO_SIDE_EFFECTS__ */ e=>t=>1-e(1-t),qa=/*@__PURE__*/ Wa(.33,1.53,.69,.99),Ja=/*@__PURE__*/ Ka(qa),Ya=/*@__PURE__*/ Ga(Ja),Xa=e=>e>=1?1:(e*=2)<1?.5*Ja(e):.5*(2-2**(-10*(e-1))),Za=e=>1-Math.sin(Math.acos(e)),Qa=/* @__PURE__ */ Ka(Za),$a=/* @__PURE__ */ Ga(Za),eo=/*@__PURE__*/ Wa(.42,0,1,1),to=/*@__PURE__*/ Wa(0,0,.58,1),no=/*@__PURE__*/ Wa(.42,0,.58,1),ro=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]!=`number`,io=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]==`number`,ao={linear:Fa,easeIn:eo,easeInOut:no,easeOut:to,circIn:Za,circInOut:$a,circOut:Qa,backIn:Ja,backInOut:Ya,backOut:qa,anticipate:Xa},oo=e=>typeof e==`string`,so=e=>{if(/* @__PURE__ */ io(e)){e.length;let[t,n,r,i]=e;return/* @__PURE__ */ Wa(t,n,r,i)}return oo(e)?(ao[e],`${e}`,ao[e]):e},G={delta:0,timestamp:0,isProcessing:!1};let co;function lo(){co=void 0}const uo={now:()=>(co===void 0&&uo.set(G.isProcessing||Aa.useManualTiming?G.timestamp:performance.now()),co),set:e=>{co=e,queueMicrotask(lo)}},fo=e=>Math.round(e*1e5)/1e5,po=e=>t=>typeof t==`string`&&t.startsWith(e),mo=/*@__PURE__*/ po(`--`),ho=/*@__PURE__*/ po(`var(--`),go=e=>ho(e)?_o.test(e.split(`/*`)[0].trim()):!1,_o=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vo(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}const yo={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},bo={...yo,transform:e=>ka(0,1,e)},xo={...yo,default:1},So=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Co(e){return e==null}const wo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,To=(e,t)=>n=>!!(typeof n==`string`&&wo.test(n)&&n.startsWith(e)||t&&!Co(n)&&Object.prototype.hasOwnProperty.call(n,t)),Eo=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(So);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Do=e=>ka(0,255,e),Oo={...yo,transform:e=>Math.round(Do(e))},ko={test:/*@__PURE__*/ To(`rgb`,`red`),parse:/*@__PURE__*/ Eo(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Oo.transform(e)+`, `+Oo.transform(t)+`, `+Oo.transform(n)+`, `+fo(bo.transform(r))+`)`};function Ao(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const jo={test:/*@__PURE__*/ To(`#`),parse:Ao,transform:ko.transform},Mo=/* @__NO_SIDE_EFFECTS__ */ e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),No=/*@__PURE__*/ Mo(`deg`),Po=/*@__PURE__*/ Mo(`%`),K=/*@__PURE__*/ Mo(`px`),Fo=/*@__PURE__*/ Mo(`vh`),Io=/*@__PURE__*/ Mo(`vw`),Lo={...Po,parse:e=>Po.parse(e)/100,transform:e=>Po.transform(e*100)},Ro={test:/*@__PURE__*/ To(`hsl`,`hue`),parse:/*@__PURE__*/ Eo(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Po.transform(fo(t))+`, `+Po.transform(fo(n))+`, `+fo(bo.transform(r))+`)`},q={test:e=>ko.test(e)||jo.test(e)||Ro.test(e),parse:e=>ko.test(e)?ko.parse(e):Ro.test(e)?Ro.parse(e):jo.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?ko.transform(e):Ro.transform(e),getAnimatableNone:e=>{let t=q.parse(e);return t.alpha=0,q.transform(t)}},zo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Bo=/*@__PURE__*/ new RegExp(So.source),Vo=/*@__PURE__*/ new RegExp(zo.source,`i`);function Ho(e){return isNaN(e)&&typeof e==`string`&&(Bo.test(e)||Vo.test(e))}const Uo=`number`,Wo=`color`,Go=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ko(e){let t=e.toString();return Bo.test(t)||Vo.test(t)}function qo(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Go,e=>(q.test(e)?(r.color.push(a),i.push(Wo),n.push(q.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(Uo),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function Jo(e){return qo(e).values}function Yo({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Uo?fo(r[a]):e===Wo?q.transform(r[a]):r[a]}return i}}function Xo(e){return Yo(qo(e))}const Zo=e=>typeof e==`number`?0:q.test(e)?q.getAnimatableNone(e):e,Qo=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Zo(e);function $o(e){let t=qo(e);return Yo(t)(t.values.map((e,n)=>Qo(e,t.split[n])))}const es={test:Ho,parse:Jo,createTransformer:Xo,getAnimatableNone:$o};function ts(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ns({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=ts(s,r,e+1/3),a=ts(s,r,e),o=ts(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function rs(e,t){return n=>n>0?t:e}const J=(e,t,n)=>e+(t-e)*n,is=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},as=[jo,ko,Ro],os=e=>as.find(t=>t.test(e));function ss(e){let t=os(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===Ro&&(n=ns(n)),n}const cs=(e,t)=>{let n=ss(e),r=ss(t);if(!n||!r)return rs(e,t);let i={...n};return e=>(i.red=is(n.red,r.red,e),i.green=is(n.green,r.green,e),i.blue=is(n.blue,r.blue,e),i.alpha=J(n.alpha,r.alpha,e),ko.transform(i))},ls=/* @__PURE__ */ new Set([`none`,`hidden`]);function us(e,t){return ls.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ds(e,t){return n=>J(e,t,n)}function fs(e){return typeof e==`number`?ds:typeof e==`string`?go(e)?rs:q.test(e)?cs:gs:Array.isArray(e)?ps:typeof e==`object`?q.test(e)?cs:ms:rs}function ps(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>fs(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function ms(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=fs(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function hs(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const gs=(e,t)=>{let n=es.createTransformer(t),r=qo(e),i=qo(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ls.has(e)&&!i.values.length||ls.has(t)&&!r.values.length?us(e,t):Ia(ps(hs(r,i),i.values),n):(`${e}${t}`,rs(e,t))},_s=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function vs(e,t){let n=_s.exec(e);if(!n)return;let r=_s.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>fo(J(a,o,e))+i}function ys(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return J(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=vs(e,t);if(n)return n}return fs(e)(e,t)}const bs=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function xs(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set,r=!1,i=!1,a=/* @__PURE__ */ new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}function Ss(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=bs.reduce((e,t)=>(e[t]=xs(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Aa.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,40),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:bs.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<bs.length;t++)o[bs[t]].cancel(e)},state:n,steps:o}}const{schedule:Y,cancel:Cs,steps:ws}=/* @__PURE__ */ Ss(typeof requestAnimationFrame<`u`?requestAnimationFrame:Fa,!0,G),Ts=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Y.update(t,e),stop:()=>Cs(t),now:()=>G.isProcessing?G.timestamp:uo.now()}},Es=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Ds=2e4;function Os(e,t=50,n=Ds,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function ks(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Os(r),Ds);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:/* @__PURE__ */ Ba(i)}}const As={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},js=e=>e<0?1/Math.max(1+e,As.minDamping):Math.max(1-e,As.minDamping);function Ms(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Ps(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Ns(e,t){return e*Math.sqrt(1-t*t)}function Ps(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const Fs=.001;function Is({duration:e=As.duration,bounce:t=As.bounce}){let n,r;As.maxDuration;let i=js(t);e=ka(As.minDuration,As.maxDuration,/* @__PURE__ */ Ba(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=Ns(t,i),o=Math.exp(-r);return Fs-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Ns(t*t,i);return(-n(t)+Fs>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Ps(n,r,a),s=o*Ms(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:/* @__PURE__ */ za(e)}}const Ls=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Rs(e,t){if(Ls(e,t))return e}function zs(e){let t=Rs(e.stiffness),n=Rs(e.damping,!0),r=Rs(e.mass),i={...e,stiffness:t??As.stiffness,damping:n??As.damping,mass:r??As.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=js(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Ms(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Is(i)),i.isResolvedFromDuration=!0;(!Ls(i.stiffness)||!Ls(i.damping,!0))&&(i.stiffness=As.stiffness,i.damping=As.damping)}return i}function Bs(e=As.visualDuration,t=As.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=zs({...n}),f=e=>d?0:-/* @__PURE__ */ Ba(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ Ba(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?As.restSpeed.granular:As.restSpeed.default),g.restDelta=n.restDelta||(e?As.restDelta.granular:As.restDelta.default)};_();let v,y,b;if(p<1){let e=Ns(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>/* @__PURE__ */ za(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ za(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(Os(S),Ds),t=Es(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Bs.applyToOptions=e=>{let t=ks(e,100,Bs);return e.ease=t.ease,e.duration=/* @__PURE__ */ za(t.duration),e.type=`keyframes`,e};function Vs({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Bs({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Hs(e,t,n){let r=[],i=n||Aa.mix||ys,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);if(t){let e=Array.isArray(t)?t[n]||Fa:t;a=Ia(e,a)}r.push(a)}return r}function Us(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Hs(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=/* @__PURE__ */ La(e[r],e[r+1],n);return s[r](i)};return n?t=>l(ka(e[0],e[a-1],t)):l}function Ws(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=/* @__PURE__ */ La(0,t,r);e.push(J(n,1,i))}}function Gs(e){let t=[0];return Ws(t,e.length-1),t}function Ks(e,t){return e.map(e=>e*t)}function qs(e,t){return e.map(()=>t||no).splice(0,e.length-1)}function Js({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=/* @__PURE__ */ ro(r)?r.map(so):so(r)||no,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(Aa.mix||ys)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?ka(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Us(Ks(n&&n.length===t.length?n:Gs(t),e),t,{ease:Array.isArray(i)?i:qs(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}function Ys(e,t,n){let r=Math.max(t-5,0);return/* @__PURE__ */ Va(n-e(r),t-r)}function Xs(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Ys(t=>e.next(t).value,t,e.next(t).value)}const Zs=e=>e!==null;function Qs(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Zs),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const $s={decay:Vs,inertia:Vs,tween:Js,keyframes:Js,spring:Bs};function ec(e){typeof e.type==`string`&&(e.type=$s[e.type])}function tc(e,t){return{kind:e,animation:t,timestamp:uo.now(),frameTimestamp:G.timestamp,frameIsProcessing:G.isProcessing}}function nc(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...tc(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function rc(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...tc(`layout-animation-start`,e),node:t})}catch{}}var ic=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}};const ac=e=>e/100;var oc=class extends ic{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==uo.now()&&this.tick(uo.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),nc(this,this.options)}initAnimation(){let{options:e}=this;ec(e);let{type:t=Js,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Js;s!==Js&&typeof o[0]!=`number`&&(this.mixKeyframes=Ia(ac,ys(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Os(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=ka(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Vs&&(b.value=Qs(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return/* @__PURE__ */ Ba(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Ba(e)}get time(){return/* @__PURE__ */ Ba(this.currentTime)}set time(e){e=/* @__PURE__ */ za(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Xs(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(uo.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=/* @__PURE__ */ Ba(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ts,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(uo.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};const sc=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function cc(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(So)||[];if(!r)return e;let i=n.replace(r,``),a=+!!sc.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const lc=/\b([a-z-]*)\(.*?\)/gu,uc={...es,getAnimatableNone:e=>{let t=e.match(lc);return t?t.map(cc).join(` `):e}},dc={...es,getAnimatableNone:e=>{let t=es.parse(e);return es.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},fc={...yo,transform:Math.round},pc={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,top:K,right:K,bottom:K,left:K,inset:K,insetBlock:K,insetBlockStart:K,insetBlockEnd:K,insetInline:K,insetInlineStart:K,insetInlineEnd:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,paddingBlock:K,paddingBlockStart:K,paddingBlockEnd:K,paddingInline:K,paddingInlineStart:K,paddingInlineEnd:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,marginBlock:K,marginBlockStart:K,marginBlockEnd:K,marginInline:K,marginInlineStart:K,marginInlineEnd:K,fontSize:K,backgroundPositionX:K,backgroundPositionY:K,rotate:No,pathRotation:No,rotateX:No,rotateY:No,rotateZ:No,scale:xo,scaleX:xo,scaleY:xo,scaleZ:xo,skew:No,skewX:No,skewY:No,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:bo,originX:Lo,originY:Lo,originZ:K,zIndex:fc,fillOpacity:bo,strokeOpacity:bo,numOctaves:fc},mc={...pc,color:q,backgroundColor:q,outlineColor:q,fill:q,stroke:q,borderColor:q,borderTopColor:q,borderRightColor:q,borderBottomColor:q,borderLeftColor:q,filter:uc,WebkitFilter:uc,mask:dc,WebkitMask:dc},hc=e=>mc[e],gc=/*@__PURE__*/ new Set([uc,dc]);function _c(e,t){let n=hc(e);return gc.has(n)||(n=es),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function vc(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const yc=e=>e*180/Math.PI,bc=e=>{let t=yc(Math.atan2(e[1],e[0]));return Sc(t)},xc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bc,rotateZ:bc,skewX:e=>yc(Math.atan(e[1])),skewY:e=>yc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Sc=e=>(e%=360,e<0&&(e+=360),e),Cc=bc,wc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Tc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ec={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wc,scaleY:Tc,scale:e=>(wc(e)+Tc(e))/2,rotateX:e=>Sc(yc(Math.atan2(e[6],e[5]))),rotateY:e=>Sc(yc(Math.atan2(-e[2],e[0]))),rotateZ:Cc,rotate:Cc,skewX:e=>yc(Math.atan(e[4])),skewY:e=>yc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Dc(e){return+!!e.includes(`scale`)}function Oc(e,t){if(!e||e===`none`)return Dc(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Ec,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=xc,i=t}if(!i)return Dc(t);let a=r[t],o=i[1].split(`,`).map(Ac);return typeof a==`function`?a(o):o[a]}const kc=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Oc(n,t)};function Ac(e){return parseFloat(e.trim())}const jc=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Mc=/* @__PURE__ */ new Set([...jc,`pathRotation`]),Nc=e=>e===yo||e===K,Pc=/* @__PURE__ */ new Set([`x`,`y`,`z`]),Fc=jc.filter(e=>!Pc.has(e));function Ic(e){let t=[];return Fc.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}const Lc=/* @__PURE__ */ new Set([`bottom`,`right`]);function Rc(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}const zc={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Rc(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Rc(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>Oc(e,`x`),y:({transform:e})=>Oc(e,`y`)};zc.translateX=zc.x,zc.translateY=zc.y;const Bc=/* @__PURE__ */ new Set;let Vc=!1,Hc=!1,Uc=!1;function Wc(){if(Hc){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;Bc.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Lc.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=Ic(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Hc=!1,Vc=!1,Bc.forEach(e=>e.complete(Uc)),Bc.clear()}function Gc(){Bc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hc=!0)})}function Kc(){Uc=!0,Gc(),Wc(),Uc=!1}function qc(e,t,n){if(typeof e==`string`){if(ja(e)||Na(e))return parseFloat(e);if(!es.test(e)&&es.test(n))return _c(t,n)}return e??void 0}var Jc=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Bc.add(this),Vc||(Vc=!0,Y.read(Gc),Y.resolveKeyframes(Wc))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=qc(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}vc(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Bc.delete(this)}cancel(){this.state===`scheduled`&&(Bc.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const Yc=e=>e.startsWith(`--`);function Xc(e,t,n){Yc(t)?e.style.setProperty(t,n):e.style[t]=n}const Zc={};function Qc(e,t){let n=/* @__PURE__ */ Pa(e);return()=>Zc[t]??n()}const $c=/* @__PURE__ */ Qc(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),el=/*@__PURE__*/ Qc(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),tl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,nl={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ tl([0,.65,.55,1]),circOut:/*@__PURE__*/ tl([.55,0,1,.45]),backIn:/*@__PURE__*/ tl([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ tl([.33,1.53,.69,.99])};function rl(e,t){if(e)return typeof e==`function`?el()?Es(e,t):`ease-out`:/* @__PURE__ */ io(e)?tl(e):Array.isArray(e)?e.map(e=>rl(e,t)||nl.easeOut):nl[e]}function il(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=rl(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function al(e){return typeof e==`function`&&`applyToOptions`in e}function ol({type:e,...t}){return al(e)&&el()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var sl=class extends ic{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=ol(e);this.animation=il(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Qs(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Xc(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},nc(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return/* @__PURE__ */ Ba(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Ba(e)}get time(){return/* @__PURE__ */ Ba(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ za(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n,...r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&$c()?(this.animation.timeline=e,Object.assign(this.animation,r),t?.(this.animation),Fa):n(this)}};const cl={anticipate:Xa,backInOut:Ya,circInOut:$a};function ll(e){return e in cl}function ul(e){typeof e.ease==`string`&&ll(e.ease)&&(e.ease=cl[e.ease])}var dl=class extends sl{constructor(e){ul(e),ec(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new oc({...a,autoplay:!1}),s=Math.max(10,uo.now()-this.startTime),c=ka(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&Xc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const fl=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(es.test(e)||e===`0`)&&!e.startsWith(`url(`));function pl(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function ml(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=fl(i,t),s=fl(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):pl(e)||(n===`spring`||al(n))&&r}function hl(e){e.duration=0,e.type=`keyframes`}const gl=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),_l=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function vl(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&_l.test(e[t]))return!0;return!1}const yl=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),bl=/*@__PURE__*/ Pa(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function xl(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(gl.has(n)||yl.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return bl()&&(gl.has(n)||yl.has(n)&&vl(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Sl=class extends ic{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=uo.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Jc;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=uo.now();let u=!0;ml(e,i,a,o)||(u=!1,(Aa.instantAnimations||!s)&&l?.(Qs(e,n,t)),e[0]=e[e.length-1],hl(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&xl(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new dl(n)}catch{m=new oc(n)}}else m=new oc(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Kc()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Cl(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}const wl=e=>!isNaN(parseFloat(e)),Tl={current:void 0};var El=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=uo.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=uo.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wl(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new Ra)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Ra,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){Y.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=/* @__PURE__ */ new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Tl.current&&Tl.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=uo.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return/* @__PURE__ */ Va(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Dl(e,t){return new El(e,t)}function Ol(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function kl(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Ol(n,e)}const Al={type:`spring`,stiffness:500,damping:25,restSpeed:10},jl=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ml={type:`keyframes`,duration:.8},Nl={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Pl=(e,{keyframes:t})=>t.length>2?Ml:Mc.has(e)?e.startsWith(`scale`)?jl(t[1]):Al:Nl,Fl=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Il(e){for(let t in e)if(!Fl.has(t))return!0;return!1}const Ll=(e,t,n,r={},i,a)=>o=>{let s=kl(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ za(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Il(s)||Object.assign(u,Pl(e,u)),u.duration&&=/* @__PURE__ */ za(u.duration),u.repeatDelay&&=/* @__PURE__ */ za(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(hl(u),u.delay===0&&(d=!0)),(Aa.instantAnimations||Aa.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,hl(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Qs(u.keyframes,s);if(e!==void 0){Y.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new oc(u):new Sl(u)},Rl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zl(e){let t=Rl.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Bl(e,t,n=1){`${e}`;let[r,i]=zl(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ja(e)?parseFloat(e):e}return go(i)?Bl(i,t,n+1):i}function Vl(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Hl(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...Vl(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Ul(e,t,n){return Hl(e.getProps(),t,n,e)}const Wl=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Gl=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...jc]),Kl=e=>Array.isArray(e);function ql(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Dl(n))}function Jl(e){return Kl(e)?e[e.length-1]||0:e}function Yl(e,t){let{transitionEnd:n={},transition:r={},...i}=Ul(e,t)||{};i={...i,...n};for(let t in i)ql(e,t,Jl(i[t]))}const Xl=e=>!!(e&&e.getVelocity);function Zl(e){return!!(Xl(e)&&e.add)}function Ql(e,t){let n=e.getValue(`willChange`);if(Zl(n))return n.add(t);if(!n&&Aa.WillChange){let n=new Aa.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function $l(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const eu=`data-`+$l(`framerAppearId`);function tu(e){return e.props[eu]}const nu=typeof window<`u`;function ru({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function iu(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Ol(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&ru(f,t))continue;let o={delay:n,...kl(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Y.update(()=>r.set(i));continue}let p=!1;if(nu&&window.MotionHandoffAnimation){let n=tu(e);if(n){let e=window.MotionHandoffAnimation(n,t,Y);e!==null&&(o.startTime=e,p=!0)}}Ql(e,t);let m=l??e.shouldReduceMotion;r.start(Ll(t,r,i,m&&Gl.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Y.update(()=>{o&&Yl(e,o)});d.length?Promise.all(d).then(t):t()}return d}function au(e,t,n={}){let r=Ul(e,t,Wl(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?iu(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(au(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Cl(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function ou(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>au(e,t,n))):typeof t==`string`?au(e,t,n):Promise.all(iu(e,Ul(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}const su={test:e=>e===`auto`,parse:e=>e},cu=e=>t=>t.test(e),lu=[yo,K,Po,No,Io,Fo,su],uu=e=>lu.find(cu(e));function du(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Na(e)}const fu=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function pu(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!fu.has(t)&&Ko(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=_c(n,i))}var mu=class extends Jc{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),go(r))){let i=Bl(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Gl.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=uu(r),o=uu(i);if(vo(r)!==vo(i)&&zc[n]){this.needsMeasurement=!0;return}if(a!==o){if(Nc(a)&&Nc(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else zc[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||du(e[t]))&&n.push(t);n.length&&pu(e,n,t)}measure(){let{element:e,name:t}=this;return zc[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const hu=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function gu(e){return Ma(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function _u(e){return Ma(e)&&`ownerSVGElement`in e}const vu=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function yu(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}const bu={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},xu=jc.length;function Su(e,t,n){let r=``,i=!0;for(let a=0;a<xu;a++){let o=jc[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=vu(s,pc[o]);if(!c){i=!1;let t=bu[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${vu(a,pc.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Cu(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Mc.has(e)){o=!0;continue}if(mo(e)){i[e]=n;continue}{let t=vu(n,pc[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Su(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}const wu={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Tu={offset:`strokeDashoffset`,array:`strokeDasharray`};function Eu(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?wu:Tu;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Du=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Ou(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Cu(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Du)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Eu(d,i,a,o,!1)}function ku({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Au({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ju(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Mu(e){return e===void 0||e===1}function Nu({scale:e,scaleX:t,scaleY:n}){return!Mu(e)||!Mu(t)||!Mu(n)}function Pu(e){return Nu(e)||Fu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Fu(e){return Iu(e.x)||Iu(e.y)}function Iu(e){return e&&e!==`0%`}function Lu(e,t,n){return n+t*(e-n)}function Ru(e,t,n,r,i){return i!==void 0&&(e=Lu(e,i,r)),Lu(e,n,r)+t}function zu(e,t=0,n=1,r,i){e.min=Ru(e.min,t,n,r,i),e.max=Ru(e.max,t,n,r,i)}function Bu(e,{x:t,y:n}){zu(e.x,t.translate,t.scale,t.originPoint),zu(e.y,n.translate,n.scale,n.originPoint)}const Vu=.999999999999,Hu=1.0000000000001;function Uu(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Wu(e.x,-a.scroll.offset.x),Wu(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Bu(e,o)),r&&Pu(a.latestValues)&&qu(e,a.latestValues,a.layout?.layoutBox))}t.x<Hu&&t.x>Vu&&(t.x=1),t.y<Hu&&t.y>Vu&&(t.y=1)}function Wu(e,t){e.min+=t,e.max+=t}function Gu(e,t,n,r,i=.5){zu(e,t,n,J(e.min,e.max,i),r)}function Ku(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function qu(e,t,n){let r=n??e;Gu(e.x,Ku(t.x,r.x),t.scaleX,t.scale,t.originX),Gu(e.y,Ku(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ju(e,t){return ku(ju(e.getBoundingClientRect(),t))}function Yu(e,t,n){let r=Ju(e,n),{scroll:i}=t;return i&&(Wu(r.x,i.offset.x),Wu(r.y,i.offset.y)),r}const{schedule:Xu,cancel:Zu}=/* @__PURE__ */ Ss(queueMicrotask,!1),Qu={x:!1,y:!1};function $u(){return Qu.x||Qu.y}function ed(e){return e===`x`||e===`y`?Qu[e]?null:(Qu[e]=!0,()=>{Qu[e]=!1}):Qu.x||Qu.y?null:(Qu.x=Qu.y=!0,()=>{Qu.x=Qu.y=!1})}function td(e,t){let n=yu(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function nd(e){return!(e.pointerType===`touch`||$u())}function rd(e,t,n={}){let[r,i,a]=td(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!nd(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}const id=(e,t)=>t?e===t||id(e,t.parentElement):!1,ad=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,od=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function sd(e){return od.has(e.tagName)||e.isContentEditable===!0}const cd=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function ld(e){return cd.has(e.tagName)||e.isContentEditable===!0}const ud=/* @__PURE__ */ new WeakSet;function dd(e){return t=>{t.key===`Enter`&&e(t)}}function fd(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const pd=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=dd(()=>{if(ud.has(n))return;fd(n,`down`);let e=dd(()=>{fd(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>fd(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function md(e){return ad(e)&&!$u()}const hd=/* @__PURE__ */ new WeakSet;function gd(e,t,n={}){let[r,i,a]=td(e,n),o=e=>{let r=e.currentTarget;if(!md(e)||hd.has(e))return;ud.add(r),n.stopPropagation&&hd.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ud.has(r)&&ud.delete(r),md(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||id(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),gu(e)&&(e.addEventListener(`focus`,e=>pd(e,i)),!sd(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}const _d=/* @__PURE__ */ new WeakMap;let vd;const yd=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:_u(r)&&`getBBox`in r?r.getBBox()[t]:r[n],bd=/*@__PURE__*/ yd(`inline`,`width`,`offsetWidth`),xd=/*@__PURE__*/ yd(`block`,`height`,`offsetHeight`);function Sd({target:e,borderBoxSize:t}){_d.get(e)?.forEach(n=>{n(e,{get width(){return bd(e,t)},get height(){return xd(e,t)}})})}function Cd(e){e.forEach(Sd)}function wd(){typeof ResizeObserver<`u`&&(vd=new ResizeObserver(Cd))}function Td(e,t){vd||wd();let n=yu(e);return n.forEach(e=>{let n=_d.get(e);n||(n=/* @__PURE__ */ new Set,_d.set(e,n)),n.add(t),vd?.observe(e)}),()=>{n.forEach(e=>{let n=_d.get(e);n?.delete(t),n?.size||vd?.unobserve(e)})}}const Ed=/* @__PURE__ */ new Set;let Dd;function Od(){Dd=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ed.forEach(t=>t(e))},window.addEventListener(`resize`,Dd)}function kd(e){return Ed.add(e),Dd||Od(),()=>{Ed.delete(e),!Ed.size&&typeof Dd==`function`&&(window.removeEventListener(`resize`,Dd),Dd=void 0)}}function Ad(e,t){return typeof e==`function`?kd(e):Td(e,t)}const jd={value:null,addProjectionMetrics:null};function Md(e){return _u(e)&&e.tagName===`svg`}const Nd=e=>typeof e==`number`?e:parseFloat(e),Pd=()=>({translate:0,scale:1,origin:0,originPoint:0}),Fd=()=>({x:Pd(),y:Pd()}),Id=()=>({min:0,max:0}),Ld=()=>({x:Id(),y:Id()}),Rd=/* @__PURE__ */ new WeakMap;function zd(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Bd(e){return typeof e==`string`||Array.isArray(e)}const Vd=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Hd=[`initial`,...Vd];function Ud(e){if(zd(e.animate))return!0;for(let t=0;t<Hd.length;t++)if(Bd(e[Hd[t]]))return!0;return!1}function Wd(e){return!!(Ud(e)||e.variants)}function Gd(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Xl(i))e.addValue(r,i);else if(Xl(a))e.addValue(r,Dl(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Dl(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const Kd={current:null},qd={current:!1},Jd=typeof window<`u`;function Yd(){if(qd.current=!0,Jd){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Kd.current=e.matches;e.addEventListener(`change`,t),t()}else Kd.current=!1}}const Xd=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let Zd={};function Qd(e){Zd=e}function $d(){return Zd}var ef=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=/* @__PURE__ */ new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=/* @__PURE__ */ new Map,this.KeyframeResolver=Jc,this.features={},this.valueSubscriptions=/* @__PURE__ */ new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=uo.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Y.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Ud(t),this.isVariantNode=Wd(t),this.isVariantNode&&(this.variantChildren=/* @__PURE__ */ new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&Xl(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,Rd.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(qd.current||Yd(),this.shouldReduceMotion=Kd.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Cs(this.notifyUpdate),Cs(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=/* @__PURE__ */ new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&gl.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new sl({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ za(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Mc.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Y.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Zd){let t=Zd[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ld()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Xd.length;t++){let n=Xd[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Gd(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Dl(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ja(n)||Na(n))?n=parseFloat(n):typeof n!=`number`&&!es.test(n)&&es.test(t)&&(n=_c(e,t)),this.setBaseTarget(e,Xl(n)?n.get():n)),Xl(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new Ra),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Xu.render(this.render)}},tf=class extends ef{constructor(){super(...arguments),this.KeyframeResolver=mu}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;Xl(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},nf=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function rf(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}const af={};function of(e,{layout:t,layoutId:n}){return Mc.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!af[e]||e===`opacity`)}function sf(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Xl(r[t])||i&&Xl(i[t])||of(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function cf(e){return window.getComputedStyle(e)}var lf=class extends tf{constructor(){super(...arguments),this.type=`html`,this.renderInstance=rf}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Mc.has(t))return this.projection?.isProjecting?Dc(t):kc(e,t);{let n=cf(e),r=(mo(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ju(e,t)}build(e,t,n){Cu(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return sf(e,t,n)}};const uf=/* @__PURE__ */ new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),df=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function ff(e,t,n,r){rf(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(uf.has(n)?n:$l(n),t.attrs[n])}function pf(e,t,n){let r=sf(e,t,n);for(let n in e)if(Xl(e[n])||Xl(t[n])){let t=jc.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var mf=class extends tf{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Ld}getBaseTargetFromProps(e,t){return Mc.has(t)?super.getBaseTargetFromProps(e,t)??Dc(t):e[t]}getDefaultValue(e){return Mc.has(e)?this.latestValues[e]??Dc(e):void 0}readValueFromInstance(e,t){if(Mc.has(t)){let e=hc(t);return e&&e.default||0}if(Du.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=uf.has(t)?t:$l(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return pf(e,t,n)}build(e,t,n){Ou(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){ff(e,t,n,r)}mount(e){this.isSVGTag=df(e.tagName),super.mount(e)}};function hf(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const gf=[...Vd].reverse();function _f(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>ou(e,t,n))),n=yf(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=/* @__PURE__ */ new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(gf.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?Bd(g)||g===!1?g:void 0:h,v=Bd(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||zd(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=vf(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=Ul(e,n,Wl(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!hf(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=Ul(s,n)?.transition?.delayChildren;r.delay=Cl(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&Ul(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!Xl(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=yf(),i=!0}}}function vf(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!hf(t,e):!1}function yf(){let e={};for(let t of Vd)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function bf(e,t){e.min=t.min,e.max=t.max}function xf(e,t){bf(e.x,t.x),bf(e.y,t.y)}function Sf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Cf(e){return e.max-e.min}function wf(e,t,n){return Math.abs(e-t)<=n}function Tf(e,t,n,r=.5){e.origin=r,e.originPoint=J(t.min,t.max,e.origin),e.scale=Cf(n)/Cf(t),e.translate=J(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Ef(e,t,n,r){Tf(e.x,t.x,n.x,r?r.originX:void 0),Tf(e.y,t.y,n.y,r?r.originY:void 0)}function Df(e,t,n,r=0){e.min=(r?J(n.min,n.max,r):n.min)+t.min,e.max=e.min+Cf(t)}function Of(e,t,n,r){Df(e.x,t.x,n.x,r?.x),Df(e.y,t.y,n.y,r?.y)}function kf(e,t,n,r=0){let i=r?J(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Cf(t)}function Af(e,t,n,r){kf(e.x,t.x,n.x,r?.x),kf(e.y,t.y,n.y,r?.y)}function jf(e,t,n,r,i){return e-=t,e=Lu(e,1/n,r),i!==void 0&&(e=Lu(e,1/i,r)),e}function Mf(e,t=0,n=1,r=.5,i,a=e,o=e){if(Po.test(t)&&(t=parseFloat(t),t=J(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=J(a.min,a.max,r);e===a&&(s-=t),e.min=jf(e.min,t,n,s,i),e.max=jf(e.max,t,n,s,i)}function Nf(e,t,[n,r,i],a,o){Mf(e,t[n],t[r],t[i],t.scale,a,o)}const Pf=[`x`,`scaleX`,`originX`],Ff=[`y`,`scaleY`,`originY`];function If(e,t,n,r){Nf(e.x,t,Pf,n?n.x:void 0,r?r.x:void 0),Nf(e.y,t,Ff,n?n.y:void 0,r?r.y:void 0)}function Lf(e){return e.translate===0&&e.scale===1}function Rf(e){return Lf(e.x)&&Lf(e.y)}function zf(e,t){return e.min===t.min&&e.max===t.max}function Bf(e,t){return zf(e.x,t.x)&&zf(e.y,t.y)}function Vf(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Hf(e,t){return Vf(e.x,t.x)&&Vf(e.y,t.y)}function Uf(e){return Cf(e.x)/Cf(e.y)}function Wf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Gf(e){return[e(`x`),e(`y`)]}function Kf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const qf={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(K.test(e))e=parseFloat(e);else return e}return`${Kf(e,t.target.x)}% ${Kf(e,t.target.y)}%`}},Jf={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=es.parse(e);if(i.length>5)return r;let a=es.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=J(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function Yf(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const Xf=hu.length,Zf=e=>typeof e==`number`||K.test(e);function Qf(e,t,n,r,i,a){i?(e.opacity=J(0,n.opacity??1,ep(r)),e.opacityExit=J(t.opacity??1,0,tp(r))):a&&(e.opacity=J(t.opacity??1,n.opacity??1,r));for(let i=0;i<Xf;i++){let a=hu[i],o=$f(t,a),s=$f(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Zf(o)===Zf(s)?(e[a]=Math.max(J(Nd(o),Nd(s),r),0),(Po.test(s)||Po.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=J(t.rotate||0,n.rotate||0,r))}function $f(e,t){return e[t]===void 0?e.borderRadius:e[t]}const ep=/*@__PURE__*/ np(0,.5,Qa),tp=/*@__PURE__*/ np(.5,.95,Fa);function np(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ La(e,t,r))}function rp(e,t,n){let r=Xl(e)?e:Dl(e);return r.start(Ll(``,r,t,n)),r.animation}function ip(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const ap=(e,t)=>e.depth-t.depth;var op=class{constructor(){this.children=[],this.isDirty=!1}add(e){Da(this.children,e),this.isDirty=!0}remove(e){Oa(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ap),this.isDirty=!1,this.children.forEach(e)}};function sp(e,t){let n=uo.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Cs(r),e(a-t))};return Y.setup(r,!0),()=>Cs(r)}function cp(e){return Xl(e)?e.get():e}var lp=class{constructor(){this.members=[]}add(e){Da(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Oa(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Oa(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const up={borderRadius:{...qf,applyTo:[...hu]},borderTopLeftRadius:qf,borderTopRightRadius:qf,borderBottomLeftRadius:qf,borderBottomRightRadius:qf,boxShadow:Jf},dp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(af,{...up,...af});const fp={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},pp=[``,`X`,`Y`,`Z`];let mp=0;function hp(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function gp(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=tu(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Y,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&gp(r)}function _p({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=mp++,this.animationId=0,this.animationCommitId=0,this.children=/* @__PURE__ */ new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=/* @__PURE__ */ new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,jd.value&&(fp.nodes=fp.calculatedTargetDeltas=fp.calculatedProjections=0),this.nodes.forEach(bp),this.nodes.forEach(Ap),this.nodes.forEach(jp),this.nodes.forEach(xp),jd.addProjectionMetrics&&jd.addProjectionMetrics(fp)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=/* @__PURE__ */ new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new op)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ra),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=_u(t)&&!Md(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Y.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=sp(i,250),dp.hasAnimatedSinceResize&&(dp.hasAnimatedSinceResize=!1,this.nodes.forEach(kp)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Rp,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Hf(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...kl(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||kp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Cs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Mp),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&gp(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(wp),this.nodes.forEach(Cp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Tp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ep),this.nodes.forEach(Dp),this.nodes.forEach(Op),this.nodes.forEach(vp),this.nodes.forEach(yp)):this.nodes.forEach(Tp),this.clearAllSnapshots();let e=uo.now();G.delta=ka(0,1e3/60,e-G.timestamp),G.timestamp=e,G.isProcessing=!0,ws.update.process(G),ws.preRender.process(G),ws.render.process(G),G.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Xu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Sp),this.sharedNodes.forEach(Np)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Y.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Y.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Cf(this.snapshot.measuredBox.x)&&!Cf(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=Ld(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Rf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Pu(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Hp(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Ld();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Wp))){let{scroll:e}=this.root;e&&(Wu(t.x,e.offset.x),Wu(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Ld();if(xf(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&xf(t,e),Wu(t.x,i.offset.x),Wu(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Ld();xf(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Wu(r.x,-n.scroll.offset.x),Wu(r.y,-n.scroll.offset.y)),Pu(n.latestValues)&&qu(r,n.latestValues,n.layout?.layoutBox)}return Pu(this.latestValues)&&qu(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Ld();xf(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Pu(n.latestValues))continue;let r;n.instance&&(Nu(n.latestValues)&&n.updateSnapshot(),r=Ld(),xf(r,n.measurePageBox())),If(t,n.latestValues,n.snapshot?.layoutBox,r)}return Pu(this.latestValues)&&If(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==G.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=G.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Ld(),this.targetWithTransforms=Ld()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Of(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):xf(this.target,this.layout.layoutBox),Bu(this.target,this.targetDelta)):xf(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),jd.value&&fp.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Nu(this.parent.latestValues)||Fu(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ld(),this.relativeTargetOrigin=Ld(),Af(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),xf(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===G.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;xf(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Uu(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Ld());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Sf(this.prevProjectionDelta.x,this.projectionDelta.x),Sf(this.prevProjectionDelta.y,this.projectionDelta.y)),Ef(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Wf(this.projectionDelta.x,this.prevProjectionDelta.x)||!Wf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),jd.value&&fp.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Fd(),this.projectionDelta=Fd(),this.projectionDeltaWithTransform=Fd()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Fd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Ld(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Lp));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=J(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=J(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Pp(o.x,e.x,n),Pp(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Af(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ip(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Bf(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Ld(),xf(f,this.relativeTarget)),c&&(this.animationValues=a,Qf(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Cs(this.pendingAnimation),void 0),this.pendingAnimation=Y.update(()=>{dp.hasAnimatedSinceResize=!0,this.motionValue||=Dl(0),this.motionValue.jump(0,!1),this.currentAnimation=rp(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),rc(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Up(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Ld();let t=Cf(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Cf(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}xf(t,i),qu(t,r),Ef(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new lp),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&hp(`z`,e,r,this.animationValues);for(let t=0;t<pp.length;t++)hp(`rotate${pp[t]}`,e,r,this.animationValues),hp(`skew${pp[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=cp(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=cp(t?.pointerEvents)||``),this.hasProjected&&!Pu(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Yf(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in af){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=af[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?cp(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Cp),this.root.sharedNodes.clear()}}}function vp(e){e.updateLayout()}function yp(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Gf(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Cf(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;bf(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Up(i,t.layoutBox,n)&&Gf(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Cf(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Fd();Ef(o,n,t.layoutBox);let s=Fd();a?Ef(s,e.applyTransform(r,!0),t.measuredBox):Ef(s,n,t.layoutBox);let c=!Rf(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Ld();Af(s,t.layoutBox,i.layoutBox,o);let c=Ld();Af(c,n,a.layoutBox,o),Hf(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function bp(e){jd.value&&fp.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function xp(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Sp(e){e.clearSnapshot()}function Cp(e){e.clearMeasurements()}function wp(e){e.isLayoutDirty=!0,e.updateLayout()}function Tp(e){e.isLayoutDirty=!1}function Ep(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Dp(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Op(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function kp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ap(e){e.resolveTargetDelta()}function jp(e){e.calcProjection()}function Mp(e){e.resetSkewAndRotation()}function Np(e){e.removeLeadSnapshot()}function Pp(e,t,n){e.translate=J(t.translate,0,n),e.scale=J(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Fp(e,t,n,r){e.min=J(t.min,n.min,r),e.max=J(t.max,n.max,r)}function Ip(e,t,n,r){Fp(e.x,t.x,n.x,r),Fp(e.y,t.y,n.y,r)}function Lp(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Rp={duration:.45,ease:[.4,0,.1,1]},zp=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Bp=zp(`applewebkit/`)&&!zp(`chrome/`)?Math.round:Fa;function Vp(e){e.min=Bp(e.min),e.max=Bp(e.max)}function Hp(e){Vp(e.x),Vp(e.y)}function Up(e,t,n){return e===`position`||e===`preserve-aspect`&&!wf(Uf(t),Uf(n),.2)}function Wp(e){return e!==e.root&&e.scroll?.wasRoot}const Gp=_p({attachResizeListener:(e,t)=>ip(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Kp={current:void 0},qp=_p({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Kp.current){let e=new Gp({});e.mount(window),e.setOptions({layoutScroll:!0}),Kp.current=e}return Kp.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Jp=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Yp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Xp(...e){return t=>{let n=!1,r=e.map(e=>{let r=Yp(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Yp(e[t],null)}}}}function Zp(...e){return a.useCallback(Xp(...e),e)}var Qp=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(gu(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=gu(e)&&e.offsetWidth||0,r=gu(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function $p({children:e,isPresent:n,anchorX:r,anchorY:i,root:o,pop:s}){let c=v(),l=C(null),u=C({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:d}=g(Jp),f=Zp(l,s===!1?void 0:e.props?.ref??e?.ref);return b(()=>{let{width:e,height:t,top:a,left:f,right:p,bottom:m,direction:h}=u.current;if(n||s===!1||!l.current||!e||!t)return;let g=h===`rtl`,_=r===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=i===`bottom`?`bottom: ${m}`:`top: ${a}`;l.current.dataset.motionPopId=c;let y=document.createElement(`style`);d&&(y.nonce=d);let b=o??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
230
|
+
;Ct.node;const wt=L(Ct);function Tt(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`;case`ne`:return`sw`;case`nw`:return`se`;case`se`:return`nw`;case`sw`:return`ne`;default:return e}}function Et(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var Dt=class{left;top;width;height;alignAxis;gap;constructor(e=0){this.gap=e}position(e,t,n){switch(e){case`top`:this.top=t.top-n.height-this.gap,this.alignAxis=`x`;break;case`bottom`:this.top=t.bottom+this.gap,this.alignAxis=`x`;break;case`left`:this.left=t.left-n.width-this.gap,this.alignAxis=`y`;break;case`right`:this.left=t.right+this.gap,this.alignAxis=`y`;break;case`ne`:this.top=t.top-n.height-this.gap,this.left=t.right+this.gap;break;case`nw`:this.top=t.top-n.height-this.gap,this.left=t.left-n.width-this.gap;break;case`se`:this.top=t.bottom+this.gap,this.left=t.right+this.gap;break;case`sw`:this.top=t.bottom+this.gap,this.left=t.left-n.width-this.gap}}align(e,t,n){if(this.alignAxis)switch(e){case`start`:this.alignAxis===`x`?this.left=t.left:this.top=t.top;break;case`end`:this.alignAxis===`x`?this.left=t.right-n.width:this.top=t.bottom-n.height;break;case`center`:this.alignAxis===`x`?this.left=t.left+t.width/2-n.width/2:this.top=t.top+t.height/2-n.height/2;break;case`fill`:this.alignAxis===`x`?(this.left=t.left,this.width=t.right-t.left):(this.top=t.top,this.height=t.bottom-t.top)}}computePosition(e,t,n){if(this.position(e.position,n,t),e.align&&this.align(e.align,n,t),!this.left&&!this.top)throw Error(`Invalid position. Cannot compute x,y coordinates`);let r=this.width!=null,i=this.height!=null,a=this.width??t.width,o=this.height??t.height;return{rect:new DOMRect(this.left??0,this.top??0,a,o),constrainWidth:r,constrainHeight:i,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){let t=Et(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=Tt(e.position);if(t!==e.position)return{...e,position:t}}return null}};function Ot(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function kt(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function At(e,t,n,r){let i=new Dt(e.gap),a=i.computePosition(e,t,n),o=kt(a.rect,r,`x`),s=kt(a.rect,r,`y`);if(o&&s)return a;let c=null;return o||(c=i.flipAxis(e,`x`)),s||(c=i.flipAxis(c||e,`y`)),c?(a=new Dt(i.gap).computePosition(c,t,n),Ot(a.rect,r)?a:null):null}function jt(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return i<=n||a<=r?null:new DOMRect(n,r,i-n,a-r)}function Mt(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=jt(e[n].getBoundingClientRect(),t),!t)return null;return t}function Nt(e){let t=e.scrollHeight>e.clientHeight,n=e.scrollWidth>e.clientWidth;if(t||n){let r=getComputedStyle(e);if(t&&r.overflowY!==`visible`||n&&r.overflowX!==`visible`)return!0}return!1}function Pt(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)Nt(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var Ft=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=Pt(this.anchor,this.root),this.visibleClientRect=Mt(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){let t=this.scrollableParents,n=()=>{this.update()};window.addEventListener(`resize`,n);for(let e of t)e.addEventListener(`scroll`,n);let r;this.options.closeOnClick&&(r=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout(()=>{r&&document.addEventListener(`click`,r)},0));let i;this.options.closeOnEsc&&(i=e=>{e.key===`Escape`&&this.tryClose()},window.setTimeout(()=>{i&&document.addEventListener(`keydown`,i)},0));let a=this.options.blockPageScroll;return a&&(document.body.style.overflow=`hidden`,document.body.style.height=`100%`),()=>{window.removeEventListener(`resize`,n);for(let e of t)e.removeEventListener(`scroll`,n);r&&document.removeEventListener(`click`,r),i&&document.removeEventListener(`keydown`,i),a&&(document.body.style.overflow=``,document.body.style.height=``)}}open(e,t){if(this.context)throw Error(`The popup controller is already bound to an element`);this.tryOpen(e,t)}tryOpen(e,t){this.context||(this.context={element:e,constraints:t,cleanup:this.registerListeners(e)},e.style.display=``,e.style.visibility=`hidden`,this.update(),this.options.onOpen?.(this))}close(){if(!this.context)throw Error(`The popup controller is not bound to an element`);this.tryClose()}tryClose(){this.context&&=(this.options.onClose?.(this),this.context.cleanup(),this.context.element.style.display=`none`,void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;let e=this.context.element,t=this.context.constraints,n=e.getBoundingClientRect(),r=this.anchor.getBoundingClientRect(),i=this.visibleClientRect;if(!i)return;let a=At(t,n,r,i);this.context.position=a||void 0,a&&(a.constrainHeight&&(e.style.height=`${a.rect.height}px`),a.constrainWidth&&(e.style.width=`${a.rect.width}px`),e.style.left=`${a.rect.left}px`,e.style.top=`${a.rect.top}px`,e.style.visibility=`visible`)}createPopupElement(){let e=document.createElement(`div`);return e.style.margin=`0`,e.style.padding=`0`,e.style.border=`none`,e.style.background=`transparent`,e.className=`composable-Popup`,e}};const It=d(void 0);function Lt(){let e=g(It);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function Rt({ctrlRef:e,id:n,constraints:r,isOpen:i,children:a,className:o,onClose:s,onOpen:c,zIndex:l,position:u,anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h}){let g=C(null),[v,y]=w(),b=C(s),x=C(c);return b.current=s,x.current=c,_(()=>{if(!d)throw Error(`Anchor element is required`);let e=new Ft({anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h,onClose:()=>b.current?.(),onOpen:()=>x.current?.()});return y(e),()=>{e.tryClose()}},[d,h,p,m,f]),_(()=>{e&&(e.current=v)},[v,e]),_(()=>{v&&g.current?v.isOpen!==i&&(i?v.open(g.current,r):v.close()):v?.isOpen&&!i&&v.close()},[r,i,v]),t(It.Provider,{value:v,children:i&&E(t(`div`,{id:n,style:{visibility:`hidden`,position:u||`absolute`,zIndex:l||100},ref:g,className:o,children:a}),document.body)})}function zt({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(Rt,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function Bt(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var Vt=class{filter(e,t){let n=t.toLowerCase();return e.filter(e=>this.valueOf(e).toLowerCase().includes(n))}renderOption(e){return this.valueOf(e)}findById(e,t){return e.find(e=>this.idOf(e)===t)}createItem(e){return null}},Ht=class e extends Vt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},Ut=class e extends Ht{createItem(e){return e}static instance=new e};function Wt(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:`w-72 mt-1 border-popover bg-popover text-popover-foreground shadow-md overflow-auto p-0 z-10`,inputClass:r(t?`block m-0 p-0 border-0 focus:outline-none focus:ring-0`:`block sm:text-sm sm:leading-6 bg-muted rounded-md border-0 shadow-sm ring-1 ring-inset ring-muted placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-primary py-1.5`,e?`w-full`:`!w-auto`),optionClass:`py-2 px-3 shadow-sm flex flex-col [&.option-selected]:font-semibold [&.option-highlighted]:bg-info`,Input:Kt,Menu:Jt,Toggle:qt}}function Gt({menuAlign:r=`fill`,menuGap:i,focusOnMount:a,onSelect:s,value:c,zIndex:l,unstyledInput:u,fullWidth:d,api:f,layout:p,adapter:m,items:h,placeholder:g,clearable:v,noMatchMessage:y,openOnFocus:b}){let[x]=w(Bt()),S=C(void 0),T=C(null),E=p?Object.assign(Wt(d,u),p):Wt(d,u),D=o.useRef(null),O=Yt({adapter:m,items:h,value:c,popupId:x});_(()=>{T.current&&a&&T.current.focus()},[a]),_(()=>{O.onSelect=s,O.popupCtrl=S.current},[O,s]),_(()=>{if(f&&O&&T.current)return f.current={open:()=>O.openMenu(),close:()=>O.closeMenu(),toggle:()=>O.toggleMenu(),setInputValue:e=>O.inputText=e,inputValue:O.inputText||``,selectedItem:O.selectedItem,focus:()=>T.current?.focus()},()=>{f.current=null}},[f,O]);let k=O.isMenuOpen&&(O.filteredItems.length>0||!!y);return n(e,{children:[t(E.Input,{boxRef:D,inputRef:T,ctrl:O,layout:E,placeholder:g,clearable:v,openOnFocus:b}),t(zt,{id:x,ctrlRef:S,className:`combobox-popup`,closeOnClick:!0,closeOnEsc:!0,onClose:()=>O.closeMenu(),isOpen:k,anchor:D,zIndex:l,constraints:{position:`bottom`,align:r,gap:i??4},children:t(E.Menu,{fillWidth:r===`fill`,items:O.filteredItems,ctrl:O,layout:E,adapter:m,noMatchMessage:y})})]})}function Kt({inputRef:e,placeholder:r,boxRef:i,ctrl:a,layout:o,clearable:s,openOnFocus:c}){let l=o.Toggle,u=s&&a.selectedItem!=null,d=+!!l+ +!!u,f=d>0?{paddingRight:`${o.buttonWidth*d+o.buttonRight}px`}:void 0;return n(`div`,{className:`relative`,ref:i,children:[t(`input`,{ref:e,placeholder:r,...a.getInputProps(),onFocus:c?()=>a.openMenu():void 0,style:f,className:o.inputClass}),n(`div`,{style:{position:`absolute`,right:`${o.buttonRight}px`,top:0,bottom:0,display:`flex`,alignItems:`center`,gap:`2px`},children:[u&&t(`button`,{type:`button`,style:{border:`none`,padding:0,margin:0,backgroundColor:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,width:`${o.buttonWidth}px`},onClick:()=>{a.selectedItem=null},children:t(wt,{className:`w-4 h-4`})}),l&&t(`button`,{type:`button`,style:{width:`${o.buttonWidth}px`,border:`none`,padding:0,margin:0,backgroundColor:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`},...a.getToggleButtonProps(),children:t(l,{ctrl:a,layout:o})})]})]})}function qt({ctrl:e}){return e.isMenuOpen?t(We,{className:`w-4 h-4`}):t(Be,{className:`w-4 h-4`})}function Jt({fillWidth:e,items:n,layout:i,ctrl:a,adapter:o,noMatchMessage:s}){let{highlightedIndex:c,selectedItem:l}=a;return n.length===0?s?t(`div`,{style:{width:e?`100%`:void 0},className:i.menuClass,children:s}):null:t(`ul`,{style:{width:e?`100%`:void 0,maxHeight:i.maxMenuHeight?`${i.maxMenuHeight}px`:`240px`},className:i.menuClass,...a.getMenuProps(),children:n.map((e,n)=>t(`li`,{"data-index":n,className:r(i.optionClass,c===n&&`option-highlighted`,l===e&&`option-selected`),...a.getItemProps(e,n),children:o.renderOption(e)},o.idOf(e)))})}function Yt(e){let[t,n]=w(new Xt(e));return _(()=>{t?.withState(n)},[t]),t}var Xt=class e{popupId;items;adapter;onSelect;setState;_selectedItem=null;_filteredItems;_inputText=``;_highlightedIndex=null;_isMenuOpen=!1;popupCtrl;constructor({adapter:e,items:t,value:n,popupId:r}){this.adapter=e,this.items=t,this.popupId=r,typeof n==`string`?this._inputText=n:n&&(this._selectedItem=e.findById(t,e.idOf(n))||null,this._selectedItem&&(this._inputText=e.valueOf(n))),this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items}withState(e){return this.setState=e,this}clone(){let t=new e({adapter:this.adapter,items:this.items,popupId:this.popupId});return t.setState=this.setState,t.onSelect=this.onSelect,t._inputText=this._inputText,t._highlightedIndex=this._highlightedIndex,t._selectedItem=this._selectedItem,t._isMenuOpen=this._isMenuOpen,t._filteredItems=this._filteredItems,t.popupCtrl=this.popupCtrl,t}updateState(){this.setState?.(this.clone())}get filteredItems(){return this._inputText?this.adapter.filter(this.items,this._inputText):this.items}get selectedItem(){return this._selectedItem}set selectedItem(e){this._selectedItem=e,this._inputText=e?this.adapter.valueOf(e):``,this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items,this.updateState(),this.onSelect?.(e)}get isMenuOpen(){return this._isMenuOpen}set inputText(e){if(this._inputText=e,this._filteredItems=e?this.adapter.filter(this.items,e):this.items,this._highlightedIndex=null,this._selectedItem=null,this.updateState(),this.isMenuOpen&&this.popupCtrl){let e=this.popupCtrl,t=e.context?.position?.position;t&&t===`top`&&window.setTimeout(()=>{e.update()},100)}}get inputText(){return this._inputText}set highlightedIndex(e){this._highlightedIndex=e,this.updateState()}get highlightedIndex(){return this._highlightedIndex}openMenu(){this._filteredItems.length>0&&(this._isMenuOpen=!0,this.updateState())}closeMenu(e){this._isMenuOpen&&(this._highlightedIndex=null,this._isMenuOpen=!1,this.updateState())}toggleMenu(){this._isMenuOpen?this.closeMenu():this.openMenu()}highlightIndex(e,t=!1){this.highlightedIndex=e;let n=document.getElementById(this.popupId);n&&n.querySelector(`li[data-index="${e}"]`)?.scrollIntoView(t)}getMenuProps(){return{}}getToggleButtonProps(){return{onClick:()=>{this._isMenuOpen=!this._isMenuOpen,this.updateState()}}}getItemProps(e,t){return{"aria-selected":this._highlightedIndex===t,onClick:()=>{this.selectedItem=e,this.closeMenu()},onMouseEnter:()=>{this.highlightedIndex!==t&&(this.highlightedIndex=t)},onMouseLeave:()=>{this.highlightedIndex===t&&(this.highlightedIndex=null)}}}getInputProps(){let e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{let t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{let n=t.key;if(n===`Enter`){if(this.highlightedIndex!=null)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){let e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else n===`ArrowDown`?this.isMenuOpen?this.highlightIndex(this.highlightedIndex===null?0:Zt(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:Qt(this.highlightedIndex,e.length),!0)}}}};function Zt(e,t){return(e+1)%t}function Qt(e,t){return(e-1+t)%t}function $t({options:e,creatable:n,...r}){let i=n?Ut.instance:Ht.instance;return t(Gt,{adapter:i,items:e,...r})}function en({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var tn=Object.defineProperty,nn=(e,t)=>tn(e,`name`,{value:t,configurable:!0});function rn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}nn(rn,`setRef`);function an(...e){return t=>{let n=!1,r=e.map(e=>{let r=rn(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():rn(e[t],null)}}}}nn(an,`composeRefs`);function z(...e){return a.useCallback(an(...e),e)}nn(z,`useComposedRefs`);var on=Object.defineProperty,sn=(e,t)=>on(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
231
|
+
function cn(e){let t=a.forwardRef((t,n)=>{let{children:r,...i}=t,o=null,s=!1,c=[];r=yn(r),a.Children.forEach(r,e=>{if(hn(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;_n(n)&&typeof Cn==`function`;)n=Cn(n._payload);o=fn(t,n),c.push(o?.props?.children)}else c.push(e)}),o?o=a.cloneElement(o,void 0,c):!s&&a.Children.count(r)===1&&a.isValidElement(r)&&(o=r);let l=o?mn(o):void 0,u=z(n,l);if(!o){if(r||r===0)throw Error(s?Sn(e):xn(e));return r}let d=pn(i,o.props??{});return o.type!==a.Fragment&&(d.ref=n?u:l),a.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}sn(cn,`createSlot`);var ln=/* @__PURE__ */ cn(`Slot`),un=Symbol.for(`radix.slottable`);// @__NO_SIDE_EFFECTS__
|
|
232
|
+
function dn(e){let t=/* @__PURE__ */ sn(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=un,t}sn(dn,`createSlottable`);var fn=/* @__PURE__ */ sn((e,t)=>`child`in e.props?a.isValidElement(t)?a.cloneElement(t,void 0,e.props.children(t.props.children)):null:a.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function pn(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=bn(a,i))}return{...e,...n}}sn(pn,`mergeProps`);function mn(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)}sn(mn,`getElementRef`);function hn(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===un}sn(hn,`isSlottable`);var gn=Symbol.for(`react.lazy`);function _n(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===gn&&`_payload`in e&&vn(e._payload)}sn(_n,`isLazyComponent`);function vn(e){return typeof e==`object`&&!!e&&`then`in e}sn(vn,`isPromiseLike`);function yn(e){let t=e;for(;_n(t)&&typeof Cn==`function`;)t=Cn(t._payload);return t}sn(yn,`useUnwrappedLazy`);function bn(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}sn(bn,`concatAriaDescribedby`);var xn=/* @__PURE__ */ sn(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Sn=/* @__PURE__ */ sn(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Cn=a.use;function B(...e){return j(i(e))}var wn=Object.defineProperty,Tn=(e,t)=>wn(e,`name`,{value:t,configurable:!0}),En=!!(typeof window<`u`&&window.document&&window.document.createElement);function V(e,t,{checkForDefaultPrevented:n=!0}={}){return/* @__PURE__ */ Tn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Tn(V,`composeEventHandlers`);function Dn(e){if(!En)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Tn(Dn,`getOwnerWindow`);function On(e){if(!En)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Tn(On,`getOwnerDocument`);function kn(e,t=!1){let{activeElement:n}=On(e);if(!n?.nodeName)return null;if(An(n)&&n.contentDocument)return kn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=On(n).getElementById(e);if(t)return t}}return n}Tn(kn,`getActiveElement`);function An(e){return e.tagName===`IFRAME`}Tn(An,`isFrame`);var jn=Object.defineProperty,Mn=(e,t)=>jn(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
233
|
+
function Nn(e,n){let r=a.createContext(n);r.displayName=e+`Context`;let i=/* @__PURE__ */ Mn(e=>{let{children:n,...i}=e,o=a.useMemo(()=>i,Object.values(i));return/* @__PURE__ */ t(r.Provider,{value:o,children:n})},`Provider`);i.displayName=e+`Provider`;function o(t,i={}){let{optional:o=!1}=i,s=a.useContext(r);if(s)return s;if(n!==void 0)return n;if(!o)throw Error(`\`${t}\` must be used within \`${e}\``)}return Mn(o,`useContext`),[i,o]}Mn(Nn,`createContext`);// @__NO_SIDE_EFFECTS__
|
|
234
|
+
function Pn(e,n=[]){let r=[];function i(n,i){let o=a.createContext(i);o.displayName=n+`Context`;let s=r.length;r=[...r,i];let c=/* @__PURE__ */ Mn(n=>{let{scope:r,children:i,...c}=n,l=r?.[e]?.[s]||o,u=a.useMemo(()=>c,Object.values(c));return/* @__PURE__ */ t(l.Provider,{value:u,children:i})},`Provider`);c.displayName=n+`Provider`;function l(t,r,c={}){let{optional:l=!1}=c,u=r?.[e]?.[s]||o,d=a.useContext(u);if(d)return d;if(i!==void 0)return i;if(!l)throw Error(`\`${t}\` must be used within \`${n}\``)}return Mn(l,`useContext`),[c,l]}Mn(i,`createContext`);let o=/* @__PURE__ */ Mn(()=>{let t=r.map(e=>a.createContext(e));return/* @__PURE__ */ Mn(function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return o.scopeName=e,[i,Fn(o,...n)]}Mn(Pn,`createContextScope`);function Fn(...e){let t=e[0];if(e.length===1)return t;let n=/* @__PURE__ */ Mn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return/* @__PURE__ */ Mn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Mn(Fn,`composeContextScopes`);var In=globalThis?.document?a.useLayoutEffect:()=>{},Ln=Object.defineProperty,Rn=(e,t)=>Ln(e,`name`,{value:t,configurable:!0}),zn=a.useId||(()=>void 0),Bn=0;function H(e){let[t,n]=a.useState(zn());return In(()=>{e||n(e=>e??String(Bn++))},[e]),e||(t?`radix-${t}`:``)}Rn(H,`useId`);var Vn=typeof document<`u`?x:function(){};function Hn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Hn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Hn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Un(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wn(e,t){let n=Un(e);return Math.round(t*n)/n}function Gn(e){let t=a.useRef(e);return Vn(()=>{t.current=e}),t}function Kn(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=a.useState(r);Hn(p,r)||m(r);let[h,g]=a.useState(null),[_,v]=a.useState(null),y=a.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=a.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=a.useRef(null),w=a.useRef(null),E=a.useRef(d),D=l!=null,O=Gn(l),k=Gn(i),A=Gn(u),j=a.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),re(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Hn(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);Vn(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=a.useRef(!1);Vn(()=>(M.current=!0,()=>{M.current=!1}),[]),Vn(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=a.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=a.useMemo(()=>({reference:x,floating:S}),[x,S]),F=a.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Wn(P.floating,d.x),r=Wn(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Un(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:F}),[d,j,N,P,F])}const qn=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:te({element:r.current,padding:i}).fn(n):r?te({element:r,padding:i}).fn(n):{}}}},Jn=(e,t)=>{let n=se(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yn=(e,t)=>{let n=ce(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xn=(e,t)=>({fn:oe(e).fn,options:[e,t]}),Zn=(e,t)=>{let n=ie(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qn=(e,t)=>{let n=le(e);return{name:n.name,fn:n.fn,options:[e,t]}},$n=(e,t)=>{let n=ae(e);return{name:n.name,fn:n.fn,options:[e,t]}},er=(e,t)=>{let n=qn(e);return{name:n.name,fn:n.fn,options:[e,t]}};var tr=Object.defineProperty,nr=(e,t)=>tr(e,`name`,{value:t,configurable:!0}),U=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=/* @__PURE__ */ cn(`Primitive.${n}`),i=a.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),/* @__PURE__ */ t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function rr(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}nr(rr,`dispatchDiscreteCustomEvent`);var ir=Object.defineProperty,ar=(e,t)=>ir(e,`name`,{value:t,configurable:!0}),or=a.useInsertionEffect;function sr(e){let t=a.useRef(e);return typeof or==`function`?or(()=>{t.current=e}):In(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}ar(sr,`useCallbackRef`);var cr=Object.defineProperty,lr=(e,t)=>cr(e,`name`,{value:t,configurable:!0});function ur(e){let[t,n]=a.useState(void 0);return In(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}lr(ur,`useSize`);var dr=Object.defineProperty,fr=(e,t)=>dr(e,`name`,{value:t,configurable:!0}),pr={Partial:`partial`,Always:`always`},mr={Optimized:`optimized`,Always:`always`},hr=`Popper`,[gr,_r]=/* @__PURE__ */ Pn(hr),[vr,yr]=gr(hr),br=/* @__PURE__ */ fr(e=>{let{__scopePopper:n,children:r}=e,[i,o]=a.useState(null),[s,c]=a.useState(void 0);return/* @__PURE__ */ t(vr,{scope:n,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:c,children:r})},`Popper`),xr=`PopperAnchor`,Sr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ fr(function(e,n){let{__scopePopper:r,virtualRef:i,...o}=e,s=yr(xr,r),c=a.useRef(null),l=s.onAnchorChange,u=z(n,a.useCallback(e=>{c.current=e,e&&l(e)},[l])),d=a.useRef(null);a.useEffect(()=>{if(!i)return;let e=d.current;d.current=i.current,e!==d.current&&l(d.current)});let f=s.placementState&&kr(s.placementState),p=f?.[0],m=f?.[1];return i?null:/* @__PURE__ */ t(U.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:u})},`PopperAnchor`)),Cr=`PopperContent`,[wr,Tr]=gr(Cr),Er=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ fr(function(e,n){let{__scopePopper:r,side:i=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=pr.Partial,hideWhenDetached:m=!1,updatePositionStrategy:h=mr.Optimized,onPlaced:g,..._}=e,v=yr(Cr,r),[y,b]=a.useState(null),x=z(n,b),[S,C]=a.useState(null),w=ur(S),T=w?.width??0,E=w?.height??0,D=i+(s===`center`?``:`-`+s),O=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(d)?d:[d],A=k.length>0,j={padding:O,boundary:k.filter(Dr),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:ee}=Kn({strategy:`fixed`,placement:D,whileElementsMounted:/* @__PURE__ */ fr((...e)=>ne(...e,{animationFrame:h===mr.Always}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Jn({mainAxis:o+E,alignmentAxis:c}),u&&Yn({mainAxis:!0,crossAxis:!1,...p===pr.Partial?{limiter:Xn()}:{},...j}),u&&Zn({...j}),Qn({...j,apply:/* @__PURE__ */ fr(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&er({element:S,padding:l}),Or({arrowWidth:T,arrowHeight:E}),m&&$n(A?{strategy:`referenceHidden`,...j}:{strategy:`referenceHidden`,padding:j.padding,altBoundary:j.altBoundary})]}),I=v.setPlacementState;In(()=>(I(P),()=>{I(void 0)}),[P,I]);let[te,re]=kr(P),ie=sr(g);In(()=>{F&&ie?.()},[F,ie]);let ae=ee.arrow?.x,oe=ee.arrow?.y,se=ee.arrow?.centerOffset!==0,[ce,le]=a.useState();return In(()=>{y&&le(window.getComputedStyle(y).zIndex)},[y]),/* @__PURE__ */ t(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:F?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[ee.transformOrigin?.x,ee.transformOrigin?.y].join(` `),...ee.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:/* @__PURE__ */ t(wr,{scope:r,placedSide:te,placedAlign:re,onArrowChange:C,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:/* @__PURE__ */ t(U.div,{"data-side":te,"data-align":re,..._,ref:x,style:{..._.style,animation:F?_.style?.animation:`none`}})})})},`PopperContent`));function Dr(e){return e!==null}fr(Dr,`isNotNull`);var Or=/* @__PURE__ */ fr(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=kr(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function kr(e){let[t,n=`center`]=e.split(`-`);return[t,n]}fr(kr,`getSideAndAlignFromPlacement`);var Ar=Object.defineProperty,jr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>Ar(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[o,s]=a.useState(!1);In(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?T.createPortal(/* @__PURE__ */ t(U.div,{...i,ref:n}),c):null},`Portal`)),Mr=Object.defineProperty,Nr=(e,t)=>Mr(e,`name`,{value:t,configurable:!0});function Pr(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}Nr(Pr,`useStateMachine`);var Fr=/* @__PURE__ */ Nr(e=>{let{present:t,children:n}=e,r=Ir(t),i=typeof n==`function`?n({present:r.isPresent}):a.Children.only(n),o=Rr(r.ref,Br(i));return typeof n==`function`||r.isPresent?a.cloneElement(i,{ref:o}):null},`Presence`);function Ir(e){let[t,n]=a.useState(),r=a.useRef(null),i=a.useRef(e),o=a.useRef(`none`),s=a.useRef(void 0),[c,l]=Pr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return a.useEffect(()=>{c===`mounted`?(o.current=s.current??zr(r.current),s.current=void 0):o.current=`none`},[c]),In(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=zr(t);e?(s.current=a,l(`MOUNT`)):a===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==a?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),In(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=/* @__PURE__ */ Nr(a=>{let o=zr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=/* @__PURE__ */ Nr(e=>{e.target===t&&(o.current=zr(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,a),t.addEventListener(`animationend`,a),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,a),t.removeEventListener(`animationend`,a)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:a.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=zr(t)}else r.current=null;n(e)},[])}}Nr(Ir,`usePresence`);function Lr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Nr(Lr,`setRef`);function Rr(...e){let t=a.useRef(e);return t.current=e,a.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Lr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Lr(n[e],null)}}},[])}Nr(Rr,`useStableComposedRefs`);function zr(e){return e?.animationName||`none`}Nr(zr,`getAnimationName`);function Br(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)}Nr(Br,`getElementRef`);var Vr=Object.defineProperty,Hr=(e,t)=>Vr(e,`name`,{value:t,configurable:!0}),Ur=a.useEffectEvent,Wr=a.useInsertionEffect;function Gr(e){if(typeof Ur==`function`)return Ur(e);let t=a.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Wr==`function`?Wr(()=>{t.current=e}):In(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}Hr(Gr,`useEffectEvent`);var Kr=Object.defineProperty,qr=(e,t)=>Kr(e,`name`,{value:t,configurable:!0}),Jr=a.useInsertionEffect||In;function Yr({prop:e,defaultProp:t,onChange:n=/* @__PURE__ */ qr(()=>{},`onChange`),caller:r}){let[i,o,s]=Xr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,a.useCallback(t=>{if(c){let n=Zr(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}qr(Yr,`useControllableState`);function Xr({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return Jr(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}qr(Xr,`useUncontrolledState`);function Zr(e){return typeof e==`function`}qr(Zr,`isFunction`);var Qr=Symbol(`RADIX:SYNC_STATE`);function $r(e,t,n,r){let{prop:i,defaultProp:o,onChange:s,caller:c}=t,l=i!==void 0,u=Gr(s),d=[{...n,state:o}];r&&d.push(r);let[f,p]=a.useReducer((t,n)=>{if(n.type===Qr)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=a.useRef(m);a.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=a.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return a.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:Qr,state:i})},[i,f.state,l]),[g,p]}qr($r,`useControllableStateReducer`);var ei=Object.defineProperty,ti=(e,t)=>ei(e,`name`,{value:t,configurable:!0}),ni=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`}),ri=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ti(function(e,n){return/* @__PURE__ */ t(U.span,{...e,ref:n,style:{...ni,...e.style}})},`VisuallyHidden`)),ii=Object.defineProperty,ai=(e,t)=>ii(e,`name`,{value:t,configurable:!0}),[oi,si]=/* @__PURE__ */ Pn(`Tooltip`,[_r]),ci=_r(),li=`TooltipProvider`,ui=700,di=`tooltip.open`,[fi,pi]=oi(li),mi=/* @__PURE__ */ ai(e=>{let{__scopeTooltip:n,delayDuration:r=ui,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:s}=e,c=a.useRef(!0),l=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),/* @__PURE__ */ t(fi,{scope:n,isOpenDelayedRef:c,delayDuration:r,onOpen:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),c.current=!1)},[i]),onClose:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:a.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:s})},`TooltipProvider`),hi=`Tooltip`,[gi,_i]=oi(hi),vi=/* @__PURE__ */ ai(e=>{let{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=pi(hi,e.__scopeTooltip),d=ci(n),[f,p]=a.useState(null),[m,h]=a.useState(void 0),g=H(),_=a.useRef(0),v=c??u.disableHoverableContent,y=l??u.delayDuration,b=a.useRef(!1),[x,S]=Yr({prop:i,defaultProp:o??!1,onChange:/* @__PURE__ */ ai(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(di))):u.onClose(),s?.(e)},`onChange`),caller:hi}),C=a.useMemo(()=>x?b.current?`delayed-open`:`instant-open`:`closed`,[x]),w=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b.current=!1,S(!0)},[S]),T=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S(!1)},[S]),E=a.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{b.current=!0,S(!0),_.current=0},y)},[y,S]);a.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let D=m??g;return/* @__PURE__ */ t(br,{...d,children:/* @__PURE__ */ t(gi,{scope:n,contentId:D,setContentId:h,open:x,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:a.useCallback(()=>{u.isOpenDelayedRef.current?E():w()},[u.isOpenDelayedRef,E,w]),onTriggerLeave:a.useCallback(()=>{v?T():(window.clearTimeout(_.current),_.current=0)},[T,v]),onOpen:w,onClose:T,disableHoverableContent:v,children:r})})},`Tooltip`),yi=`TooltipTrigger`,bi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ai(function(e,n){let{__scopeTooltip:r,"aria-describedby":i,...o}=e,s=_i(yi,r),c=pi(yi,r),l=ci(r),u=z(n,a.useRef(null),s.onTriggerChange),d=a.useRef(!1),f=a.useRef(!1),p=a.useCallback(()=>d.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),/* @__PURE__ */ t(Sr,{asChild:!0,...l,children:/* @__PURE__ */ t(U.button,{"aria-describedby":s.open?Ii(i,s.contentId):i,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:V(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!c.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:V(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:V(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:V(e.onBlur,s.onClose),onClick:V(e.onClick,s.onClose)})})},`TooltipTrigger`)),xi=`TooltipPortal`,[Si,Ci]=oi(xi,{forceMount:void 0}),wi=/* @__PURE__ */ ai(e=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=e,o=_i(xi,n);return/* @__PURE__ */ t(Si,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Fr,{present:r||o.open,children:/* @__PURE__ */ t(jr,{asChild:!0,container:a,children:i})})})},`TooltipPortal`),Ti=`TooltipContent`,Ei=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ai(function(e,n){let r=Ci(Ti,e.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=e,s=_i(Ti,e.__scopeTooltip);return/* @__PURE__ */ t(Fr,{present:i||s.open,children:s.disableHoverableContent?/* @__PURE__ */ t(ki,{side:a,...o,ref:n}):/* @__PURE__ */ t(Di,{side:a,...o,ref:n})})},`TooltipContent`)),Di=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ai(function(e,n){let r=_i(Ti,e.__scopeTooltip),i=pi(Ti,e.__scopeTooltip),o=a.useRef(null),s=z(n,o),[c,l]=a.useState(null),{trigger:u,onClose:d}=r,f=o.current,{onPointerInTransitChange:p}=i,m=a.useCallback(()=>{l(null),p(!1)},[p]),h=a.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ji(r,Ai(r,n.getBoundingClientRect())),a=Mi(t.getBoundingClientRect()),o=Pi([...i,...a]);l(o),p(!0)},[p]);return a.useEffect(()=>()=>m(),[m]),a.useEffect(()=>{if(u&&f){let e=/* @__PURE__ */ ai(e=>h(e,f),`handleTriggerLeave`),t=/* @__PURE__ */ ai(e=>h(e,u),`handleContentLeave`);return u.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{u.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[u,f,h,m]),a.useEffect(()=>{if(c){let e=/* @__PURE__ */ ai(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!Ni(n,c);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),/* @__PURE__ */ t(ki,{...e,ref:s})},`TooltipContentHoverable`)),Oi=/* @__PURE__ */ dn(`TooltipContent`),ki=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ai(function(e,r){let{__scopeTooltip:i,children:o,"aria-label":s,id:c,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=_i(Ti,i),p=ci(i),{onClose:m}=f,[h,g]=a.useState(null),_=z(r,g);ee(h),a.useEffect(()=>(document.addEventListener(di,m),()=>document.removeEventListener(di,m)),[m]),a.useEffect(()=>{if(f.trigger){let e=/* @__PURE__ */ ai(e=>{e.target instanceof Node&&e.target.contains(f.trigger)&&m()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[f.trigger,m]);let{setContentId:v}=f;return In(()=>(v(c),()=>{v(void 0)}),[c,v]),/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:/* @__PURE__ */ n(Er,{"data-state":f.stateAttribute,role:s?void 0:`tooltip`,id:s?void 0:f.contentId,...p,...d,ref:_,style:{...d.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:[/* @__PURE__ */ t(Oi,{children:o}),s?/* @__PURE__ */ t(ri,{id:f.contentId,role:`tooltip`,children:s}):null]})})},`TooltipContentImpl`));function Ai(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}ai(Ai,`getExitSideFromRect`);function ji(e,t,n=5){let 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})}return r}ai(ji,`getPaddedExitPoints`);function Mi(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}ai(Mi,`getPointsFromRect`);function Ni(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}ai(Ni,`isPointInPolygon`);function Pi(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Fi(t)}ai(Pi,`getHull`);function Fi(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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)}ai(Fi,`getHullPresorted`);function Ii(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}ai(Ii,`concatAriaDescribedby`);const Li=o.createContext(void 0);function Ri(e,t=`plugin-portal-container`){let n=e instanceof Document?e.body:e;for(let e of Array.from(n.children))if(e instanceof HTMLElement&&e.id===t)return e;let r=document.createElement(`div`);return r.id=t,n.appendChild(r),r}function zi({children:e,id:n=`plugin-portal-container`}){let r=o.useContext(Li),i=o.useRef(null),[a,s]=o.useState(r||void 0);return o.useEffect(()=>{if(r)s(r);else if(i.current){let e=i.current.getRootNode();if(e instanceof ShadowRoot||e instanceof Document){let t=Ri(e,n);s(t)}else s(null)}},[n,r]),a===void 0?t(`div`,{ref:i,style:{display:`none`}}):t(Li.Provider,{value:a||void 0,children:e})}function Bi(){return o.useContext(Li)}const Vi=mi,Hi=vi,Ui=bi,Wi=a.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=Bi();return t(wi,{container:o,children:t(Ei,{ref:a,sideOffset:n,side:r,style:{zIndex:100},className:B(`max-w-[90vw]`,`z-50 overflow-hidden rounded-md bg-tooltips border border-border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});Wi.displayName=Ei.displayName;function Gi({description:e,children:r,size:i=`sm`,placement:o=`top`,className:s,asChild:c}){let[l,u]=a.useState(!1),d=a.useRef(!1);return a.useEffect(()=>{let e=()=>{u(!1),d.current=!0,requestAnimationFrame(()=>{d.current=!1})};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,e)}},[]),t(Vi,{delayDuration:0,children:n(Hi,{open:l,onOpenChange:e=>{d.current||u(e)},children:[t(Ui,{className:`cursor-pointer`,asChild:c,children:r}),t(Wi,{side:o,className:`px-3 py-1.5 max-w-${i} text-${i} px-3 ${s}`,children:e})]})})}const Ki=/* @__PURE__ */ new Set;function qi(e,t,n){_(()=>{t&&!Ki.has(e)&&(Ki.add(e),console.warn(`[@vertesia/ui] ${e} is deprecated: ${n}`))},[t,n,e])}function Ji(e){return a.Children.toArray(e).some(e=>{if(typeof e==`string`)return e.trim().length>0;if(typeof e==`number`)return!0;if(a.isValidElement(e)){let t=e.props;return t[`aria-hidden`]===!0||t[`aria-hidden`]===`true`?!1:Ji(t.children)}return!1})}const Yi=A(`hover:cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{destructive:`bg-destructive text-destructive ring-1 ring-inset ring-destructive/50 shadow-xs hover:bg-destructive/50`,outline:`border border-input bg-background shadow-xs hover:bg-muted ring-inset`,secondary:`bg-info text-info shadow-xs hover:bg-mixer-info/10 ring-inset`,ghost:`hover:bg-muted/50 ring-inset`,link:`text-foreground underline-offset-4 hover:underline ring-inset`,primary:`bg-primary text-primary shadow-xs hover:bg-primary/90 ring-inset`,unstyled:``},size:{xs:`h-7 rounded px-2 py-1 text-xs gap-x-1`,sm:`h-8 rounded px-3 text-xs`,md:`h-9 rounded-md px-4 py-2`,lg:`h-10 rounded-md px-3`,xl:`rounded-md px-3.5 py-2.5 text-sm gap-x-2`,icon:`p-0 m-0 rounded-full`,none:``}},defaultVariants:{variant:`primary`,size:`md`}}),W=a.forwardRef(({className:r,variant:i,size:a,asChild:o=!1,alt:s,isDisabled:c,isLoading:l,title:u,tooltipPlacement:d=`top`,onClick:f,type:p,...m},h)=>{qi(`Button.alt`,s!==void 0,"use `title` instead — it drives the same tooltip and the accessible name. `alt` remains an alias for one release.");let g=o?ln:`button`,_=o?p:p??`button`,v=u??s,y=m[`aria-label`]??s??(Ji(m.children)?void 0:u),b=o?m.children:n(e,{children:[l&&t(ct,{className:`animate-spin`}),m.children]}),x=t(g,{className:B(Yi({variant:i,size:a}),r),disabled:c||l||m.disabled,ref:h,onClick:f,type:_,autoFocus:!1,...m,"aria-label":y,children:b});return v?t(Gi,{description:v,asChild:!0,className:`cursor-pointer`,size:`xs`,placement:d,children:x}):x});W.displayName=`Button`;const Xi=a.forwardRef(({size:e,content:n,toast:r,className:i,alt:a,BtnIcon:o,"aria-label":s,...c},l)=>{let[u,d]=w(!1),{t:f}=k();qi(`CopyButton.alt`,a!==void 0,"use aria-label for the accessible name. `alt` is forwarded for one release.");let p=e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{d(!0),setTimeout(()=>d(!1),2e3),r?.toast&&r.toast({status:`success`,title:r.message||f(`misc.copiedToClipboard`),duration:2e3})}).catch(e=>{console.error(`Failed to copy text: `,e),r?.toast&&r.toast({status:`error`,title:f(`misc.failedToCopy`),duration:2e3})})},m=s??a??f(`misc.copy`);return t(W,{ref:l,className:B(i),variant:`unstyled`,size:e||`sm`,onClick:p,...c,title:m,children:u?t(Re,{className:`text-success`}):o??t(et,{className:`size-4`})})});Xi.displayName=`CopyButton`;function Zi({buttonLabel:e,title:r,children:i,onClick:a}){return t(`div`,{className:`flex items-center justify-center h-full text-center`,children:n(`div`,{className:`py-12`,children:[t(`svg`,{className:`mx-auto size-12`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`path`,{vectorEffect:`non-scaling-stroke`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z`})}),t(`h3`,{className:`mt-2 text-sm font-semibold`,children:r}),t(`p`,{className:`mt-1 text-sm text-muted`,children:i}),t(`div`,{className:`mt-6`,children:n(W,{onClick:a,children:[t(mt,{className:`-ms-0.5 me-1.5 size-5`,"aria-hidden":`true`}),e]})})]})})}function Qi(e){return e.isFile}function $i(e){return e.isDirectory}function ea(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function ta({children:e,onUpload:r}){let i=C(null);return n(`label`,{style:{cursor:`pointer`},children:[e,t(`input`,{ref:i,type:`file`,style:{display:`none`},onChange:()=>{i.current?.files&&r(ea(i.current.files))}})]})}function na({onUpload:e}){let r=oa({onUpload:e});return t(`div`,{...r,className:`flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-muted hover:bg-background border-border`,children:n(`label`,{htmlFor:`dropzone-file`,className:`flex flex-col items-center justify-center w-full h-full`,children:[n(`div`,{className:`flex flex-col items-center justify-center pt-5 pb-6`,children:[t(`svg`,{className:`w-8 h-8 mb-4 text-muted`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 20 16`,children:t(`path`,{stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2`})}),n(`p`,{className:`mb-2 text-sm text-muted`,children:[t(`span`,{className:`font-semibold`,children:`Click to upload`}),` or drag and drop`]}),t(`p`,{className:`text-xs text-muted`,children:`SVG, PNG, JPG or GIF (MAX. 800x400px)`})]}),t(`input`,{id:`dropzone-file`,type:`file`,className:`hidden`})]})})}function ra(e){if(!e)return!1;let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t}function ia(e){if(!e)return!1;let t=e.__dragOver_cnt__;return t?(e.__dragOver_cnt__=t-1,t===1):!1}function aa(e){e&&delete e.__dragOver_cnt__}function oa({onUpload:e,dragOverClass:t=`is-drag-over-on`,dropEffect:n=`copy`}){let r=C(null);return{onDrop:n=>{n.preventDefault(),aa(r.current),r.current?.classList.remove(t);let i=n.dataTransfer.items;if(i){let t=[],n=(e,t=``)=>new Promise(r=>{if(Qi(e))e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if($i(e)){let i=e.createReader(),a=[],o=()=>{i.readEntries(i=>{if(!i.length)Promise.all(a).then(e=>r(e.flat()));else{for(let r of i)a.push(n(r,`${t+e.name}/`));o()}})};o()}});for(let e=0;e<i.length;e++){let r=i[e].webkitGetAsEntry();r&&t.push(n(r))}Promise.all(t).then(t=>{let n=t.flat();n.length&&e(n)})}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=n},onDragEnter:()=>{ra(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{ia(r.current)&&r.current?.classList.remove(t)},ref:r}}function sa({description:e,size:n=`sm`,placement:r=`top`,className:i}){return e?t(Gi,{description:e,placement:r,children:t(it,{className:B(n===`md`?`size-4`:`size-3`,`text-muted`,i)})}):null}function ca(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` `):void 0}function la(){try{return ue.isDev}catch{return!1}}function ua({description:e,helpText:i,error:a,required:o,label:c,className:d,direction:f=`column`,children:p,disabled:h=!1,fullWidthLabel:g=!1,childrenId:_}){let y=v(),b=v(),x=v(),S=_??y,w=C(!1),T=s.toArray(p).filter(m),E=T.length===1?T[0]:void 0,D=E?.type===l,O=!!E&&!D,k=!1,A=p;if(O&&E){let e=E,t=e.props??{},n=ca(t[`aria-describedby`],i?b:void 0,a?x:void 0),r=t[`aria-invalid`]??(a?!0:void 0);A=u(e,{id:t.id??S,"aria-describedby":n,"aria-invalid":r}),k=!0}else la()&&!w.current&&(i||a||_===void 0)&&(w.current=!0,console.warn("[@vertesia/ui] FormItem received zero, multiple, or a fragment as element children. ARIA wiring skipped. Pass `childrenId` and set `id` / `aria-describedby` / `aria-invalid` on your input manually, or wrap the input in a single non-fragment element."));let j=k||_?S:void 0;return n(`div`,{className:r(`flex w-full space-y-1`,d,f===`row`?`flex-row justify-between items-center gap-2`:f===`row-reverse`?`flex-row-reverse justify-between items-center gap-2`:`flex-col`),children:[n(`div`,{className:r(`flex items-center gap-1 mb-0`,g&&`w-full`),children:[n(`label`,{htmlFor:j,className:`text-sm font-medium mb-1 ${h?`text-muted`:``} ${g&&`flex-1`}`,children:[c,o?t(`span`,{className:`text-destructive -mt-4 ms-1`,children:`*`}):``]}),e&&t(`div`,{className:`mx-2 flex w-4 items-center`,children:t(sa,{description:e})})]}),A,i&&t(`p`,{id:b,className:`text-xs text-muted`,children:i}),a&&t(`p`,{id:x,className:`text-xs text-destructive`,children:a})]})}function da(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e(t))}}const fa=A(`inline-flex items-center rounded-md px-2 py-1 text-xs font-medium`,{variants:{variant:{default:`text-foreground bg-muted`,secondary:`bg-secondary text-info`,destructive:`bg-destructive text-destructive`,attention:`bg-attention text-attention`,success:`bg-success text-success`,info:`bg-info text-info`,done:`bg-done text-done`,outline:`bg-transparent border border-border text-foreground`}},defaultVariants:{variant:`default`}});function pa({className:e,variant:n,children:r,onClick:i,...a}){let o=i?{role:`button`,tabIndex:0,onClick:i,onKeyDown:da(i)}:{};return t(`span`,{className:B(fa({variant:n}),e),...o,...a,children:r})}const ma=A(`inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-border`,{variants:{variant:{default:``,success:``,destructive:``,attention:``,done:``,info:``,outline:``}},defaultVariants:{variant:`default`}}),ha=A(`h-1.5 w-1.5`,{variants:{variant:{default:`fill-foreground`,success:`fill-success`,destructive:`fill-destructive`,attention:`fill-attention`,done:`fill-done`,info:`fill-info`,outline:`fill-foreground`}},defaultVariants:{variant:`default`}});function ga({variant:e,className:r,dotClassName:i,children:a,...o}){return n(`span`,{className:B(ma({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:B(ha({variant:e}),i),viewBox:`0 0 6 6`,"aria-hidden":`true`,children:t(`circle`,{cx:3,cy:3,r:3})})}),t(`span`,{className:`truncate`,children:a})]})}function _a({value:e=[],onChange:i,className:a,delimiters:o=`, `,placeholder:s,autoFocus:c,disabled:l=!1}){let[u,d]=w(``),f=t=>{if(l)return;let n=t.currentTarget.value;n?.trim()&&(i([...e,n.trim()]),d(``))},p=t=>{if(l)return;let n=t.currentTarget.value,r=!n.trim(),a=t.key;a===`Enter`||o.indexOf(a)>-1?(t.preventDefault(),e&&!r&&(i([...e,n.trim()]),d(``))):a===`Backspace`&&r&&e&&e.length>0&&(e.pop(),i([...e]))},m=t=>{if(l)return;let n=t.clipboardData.getData(`text`);if(n){t.preventDefault();let r=o.split(``).map(e=>e===` `?`\\s`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),a=RegExp(`[${r}]+`),s=n.split(a).map(e=>e.trim()).filter(e=>e.length>0);s.length>0&&i([...e,...s]),d(``)}},h=t=>{l||e&&e.length>0&&(e.splice(t,1),i([...e]))};return n(`div`,{className:r(a,`w-full flex flex-wrap items-center gap-1 p-2 py-1.5`,`rounded-md text-sm rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,l&&`opacity-50 cursor-not-allowed`),children:[e&&e.length>0&&e.map((e,n)=>t(Gi,{description:`click to remove`,children:t(pa,{variant:`secondary`,onClick:()=>h(n),className:r(`flex-shrink-0 transition-colors`,l?`cursor-not-allowed`:`cursor-pointer hover:bg-destructive hover:text-destructive`),title:e,children:t(`span`,{className:`break-all`,children:e})})},`item-${n}`)),t(`input`,{className:`flex-1 min-w-[80px] m-0 p-0 px-1 border-0 bg-transparent text-sm placeholder:text-muted focus:outline-none focus:ring-0 disabled:cursor-not-allowed`,type:`text`,value:u,onBlur:f,onKeyDown:p,onPaste:m,onChange:e=>d(e.currentTarget.value),placeholder:!e||e.length===0?s:``,autoFocus:c,disabled:l})]})}function va({underline:e=`always`,className:n,children:i,...a}){let o;return e===`always`?o=`underline`:e===`hover`&&(o=`hover:underline`),t(`a`,{className:r(`text-info`,n,o),...a,children:i})}function ya({className:e,children:n}){return t(`ul`,{className:`${e} space-y-1 flex flex-col items-start`,children:n})}ya.Item=p(function(e,n){let{current:i,children:a,className:o,href:s=`#`,onClick:c,...l}=e;return t(`li`,{className:r(o,i?`bg-muted`:``,`w-full p-2 ps-3 text-sm leading-6 font-semibold hover:bg-muted`),children:t(`a`,{ref:n,href:s,onClick:e=>{c?(e.preventDefault(),c(e)):s===`#`&&e.preventDefault()},className:`w-full flex items-center gap-x-3`,...l,children:a})})});const ba=`rounded-md text-sm flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,xa={INPUT_UNSTYLED:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,INPUT_NO_PADDING:ba,INPUT:`${ba} py-1.5`};function Sa(e){return e==null||Number.isNaN(e)?``:e.toString()}const Ca=o.forwardRef(({value:e,onChange:n,className:i,noScroll:a=!1,noSpinners:s=!1,...c},l)=>{let[u,d]=o.useState(Sa(e));return _(()=>{if(e==null||!Number.isNaN(e)){let t=Sa(e);d(t)}},[e]),t(`input`,{onWheel:a?e=>{e.currentTarget.blur()}:c.onWheel,type:`number`,value:u,onChange:e=>{let t=e.target.value;d(t),t===``?n?.(void 0,t):n?.(parseFloat(t),t)},className:r(i,xa.INPUT,{"no-spinners":s},s&&`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`),ref:l,...c})}),wa=d({});function Ta(e){let t=C(null);return t.current===null&&(t.current=e()),t.current}const Ea=typeof window<`u`?x:_,Da=/* @__PURE__ */ d(null);function Oa(e,t){e.indexOf(t)===-1&&e.push(t)}function ka(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const Aa=(e,t,n)=>n>t?t:n<e?e:n,ja={},Ma=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Na=e=>typeof e==`object`&&!!e,Pa=e=>/^0[^.\s]+$/u.test(e);/*#__NO_SIDE_EFFECTS__*/
|
|
235
|
+
function Fa(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ia=/* @__NO_SIDE_EFFECTS__ */ e=>e,La=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Ra=/* @__NO_SIDE_EFFECTS__ */ (e,t,n)=>{let r=t-e;return r?(n-e)/r:1};var za=class{constructor(){this.subscriptions=[]}add(e){return Oa(this.subscriptions,e),()=>this.remove(e)}remove(e){ka(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};const Ba=/* @__NO_SIDE_EFFECTS__ */ e=>e*1e3,Va=/* @__NO_SIDE_EFFECTS__ */ e=>e/1e3,Ha=/* @__NO_SIDE_EFFECTS__ */ (e,t)=>t?1e3/t*e:0,Ua=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);/*#__NO_SIDE_EFFECTS__*/
|
|
236
|
+
function Wa(e,t,n,r){return e===t&&n===r?Ia:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=Ua(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(Ua(s+1e-7,e,n)-i-r)}return Ua(s,t,r)}}const Ga=/* @__NO_SIDE_EFFECTS__ */ e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ka=/* @__NO_SIDE_EFFECTS__ */ e=>t=>1-e(1-t),qa=/*@__PURE__*/ Wa(.33,1.53,.69,.99),Ja=/*@__PURE__*/ Ka(qa),Ya=/*@__PURE__*/ Ga(Ja),Xa=e=>e>=1?1:(e*=2)<1?.5*Ja(e):.5*(2-2**(-10*(e-1))),Za=e=>1-Math.sin(Math.acos(e)),Qa=/* @__PURE__ */ Ka(Za),$a=/* @__PURE__ */ Ga(Za),eo=/*@__PURE__*/ Wa(.42,0,1,1),to=/*@__PURE__*/ Wa(0,0,.58,1),no=/*@__PURE__*/ Wa(.42,0,.58,1),ro=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]!=`number`,io=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]==`number`,ao={linear:Ia,easeIn:eo,easeInOut:no,easeOut:to,circIn:Za,circInOut:$a,circOut:Qa,backIn:Ja,backInOut:Ya,backOut:qa,anticipate:Xa},oo=e=>typeof e==`string`,so=e=>{if(/* @__PURE__ */ io(e)){e.length;let[t,n,r,i]=e;return/* @__PURE__ */ Wa(t,n,r,i)}return oo(e)?(ao[e],`${e}`,ao[e]):e},G={delta:0,timestamp:0,isProcessing:!1};let co;function lo(){co=void 0}const K={now:()=>(co===void 0&&K.set(G.isProcessing||ja.useManualTiming?G.timestamp:performance.now()),co),set:e=>{co=e,queueMicrotask(lo)}},uo=e=>Math.round(e*1e5)/1e5,fo=e=>t=>typeof t==`string`&&t.startsWith(e),po=/*@__PURE__*/ fo(`--`),mo=/*@__PURE__*/ fo(`var(--`),ho=e=>mo(e)?go.test(e.split(`/*`)[0].trim()):!1,go=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _o(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}const vo={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},yo={...vo,transform:e=>Aa(0,1,e)},bo={...vo,default:1},xo=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function So(e){return e==null}const Co=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,wo=(e,t)=>n=>!!(typeof n==`string`&&Co.test(n)&&n.startsWith(e)||t&&!So(n)&&Object.prototype.hasOwnProperty.call(n,t)),To=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(xo);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Eo=e=>Aa(0,255,e),Do={...vo,transform:e=>Math.round(Eo(e))},Oo={test:/*@__PURE__*/ wo(`rgb`,`red`),parse:/*@__PURE__*/ To(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Do.transform(e)+`, `+Do.transform(t)+`, `+Do.transform(n)+`, `+uo(yo.transform(r))+`)`};function ko(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Ao={test:/*@__PURE__*/ wo(`#`),parse:ko,transform:Oo.transform},jo=/* @__NO_SIDE_EFFECTS__ */ e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Mo=/*@__PURE__*/ jo(`deg`),No=/*@__PURE__*/ jo(`%`),q=/*@__PURE__*/ jo(`px`),Po=/*@__PURE__*/ jo(`vh`),Fo=/*@__PURE__*/ jo(`vw`),Io={...No,parse:e=>No.parse(e)/100,transform:e=>No.transform(e*100)},Lo={test:/*@__PURE__*/ wo(`hsl`,`hue`),parse:/*@__PURE__*/ To(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+No.transform(uo(t))+`, `+No.transform(uo(n))+`, `+uo(yo.transform(r))+`)`},Ro={test:e=>Oo.test(e)||Ao.test(e)||Lo.test(e),parse:e=>Oo.test(e)?Oo.parse(e):Lo.test(e)?Lo.parse(e):Ao.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Oo.transform(e):Lo.transform(e),getAnimatableNone:e=>{let t=Ro.parse(e);return t.alpha=0,Ro.transform(t)}},zo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Bo=/*@__PURE__*/ new RegExp(xo.source),Vo=/*@__PURE__*/ new RegExp(zo.source,`i`);function Ho(e){return isNaN(e)&&typeof e==`string`&&(Bo.test(e)||Vo.test(e))}const Uo=`number`,Wo=`color`,Go=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ko(e){let t=e.toString();return Bo.test(t)||Vo.test(t)}function qo(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Go,e=>(Ro.test(e)?(r.color.push(a),i.push(Wo),n.push(Ro.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(Uo),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function Jo(e){return qo(e).values}function Yo({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Uo?uo(r[a]):e===Wo?Ro.transform(r[a]):r[a]}return i}}function Xo(e){return Yo(qo(e))}const Zo=e=>typeof e==`number`?0:Ro.test(e)?Ro.getAnimatableNone(e):e,Qo=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Zo(e);function $o(e){let t=qo(e);return Yo(t)(t.values.map((e,n)=>Qo(e,t.split[n])))}const es={test:Ho,parse:Jo,createTransformer:Xo,getAnimatableNone:$o};function ts(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ns({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=ts(s,r,e+1/3),a=ts(s,r,e),o=ts(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function rs(e,t){return n=>n>0?t:e}const J=(e,t,n)=>e+(t-e)*n,is=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},as=[Ao,Oo,Lo],os=e=>as.find(t=>t.test(e));function ss(e){let t=os(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===Lo&&(n=ns(n)),n}const cs=(e,t)=>{let n=ss(e),r=ss(t);if(!n||!r)return rs(e,t);let i={...n};return e=>(i.red=is(n.red,r.red,e),i.green=is(n.green,r.green,e),i.blue=is(n.blue,r.blue,e),i.alpha=J(n.alpha,r.alpha,e),Oo.transform(i))},ls=/* @__PURE__ */ new Set([`none`,`hidden`]);function us(e,t){return ls.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ds(e,t){return n=>J(e,t,n)}function fs(e){return typeof e==`number`?ds:typeof e==`string`?ho(e)?rs:Ro.test(e)?cs:gs:Array.isArray(e)?ps:typeof e==`object`?Ro.test(e)?cs:ms:rs}function ps(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>fs(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function ms(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=fs(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function hs(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const gs=(e,t)=>{let n=es.createTransformer(t),r=qo(e),i=qo(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ls.has(e)&&!i.values.length||ls.has(t)&&!r.values.length?us(e,t):La(ps(hs(r,i),i.values),n):(`${e}${t}`,rs(e,t))},_s=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function vs(e,t){let n=_s.exec(e);if(!n)return;let r=_s.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>uo(J(a,o,e))+i}function ys(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return J(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=vs(e,t);if(n)return n}return fs(e)(e,t)}const bs=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function xs(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set,r=!1,i=!1,a=/* @__PURE__ */ new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}function Ss(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=bs.reduce((e,t)=>(e[t]=xs(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=ja.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,40),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:bs.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<bs.length;t++)o[bs[t]].cancel(e)},state:n,steps:o}}const{schedule:Y,cancel:Cs,steps:ws}=/* @__PURE__ */ Ss(typeof requestAnimationFrame<`u`?requestAnimationFrame:Ia,!0,G),Ts=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Y.update(t,e),stop:()=>Cs(t),now:()=>G.isProcessing?G.timestamp:K.now()}},Es=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Ds=2e4;function Os(e,t=50,n=Ds,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function ks(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(Os(o),Ds);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:/* @__PURE__ */ Va(s)}}const As={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},js=e=>e<0?1/Math.max(1+e,As.minDamping):Math.max(1-e,As.minDamping);function Ms(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Ps(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Ns(e,t){return e*Math.sqrt(1-t*t)}function Ps(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const Fs=.001;function Is({duration:e=As.duration,bounce:t=As.bounce}){let n,r;As.maxDuration;let i=js(t);e=Aa(As.minDuration,As.maxDuration,/* @__PURE__ */ Va(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=Ns(t,i),o=Math.exp(-r);return Fs-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Ns(t*t,i);return(-n(t)+Fs>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Ps(n,r,a),s=o*Ms(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:/* @__PURE__ */ Ba(e)}}const Ls=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Rs(e,t){if(Ls(e,t))return e}function zs(e){let t=Rs(e.stiffness),n=Rs(e.damping,!0),r=Rs(e.mass),i={...e,stiffness:t??As.stiffness,damping:n??As.damping,mass:r??As.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=js(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Ms(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Is(i)),i.isResolvedFromDuration=!0;(!Ls(i.stiffness)||!Ls(i.damping,!0))&&(i.stiffness=As.stiffness,i.damping=As.damping)}return i}function Bs(e=As.visualDuration,t=As.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=zs({...n}),f=e=>d?0:-/* @__PURE__ */ Va(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ Va(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?As.restSpeed.granular:As.restSpeed.default),g.restDelta=n.restDelta||(e?As.restDelta.granular:As.restDelta.default)};_();let v,y,b;if(p<1){let e=Ns(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>/* @__PURE__ */ Ba(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ Ba(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(Os(S),Ds),t=Es(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Bs.applyToOptions=e=>{let t=ks(e,100,Bs);return e.ease=t.ease,e.duration=/* @__PURE__ */ Ba(t.duration),e.type=`keyframes`,e};function Vs({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Bs({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Hs(e,t,n){let r=[],i=n||ja.mix||ys,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);if(t){let e=Array.isArray(t)?t[n]||Ia:t;a=La(e,a)}r.push(a)}return r}function Us(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Hs(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=/* @__PURE__ */ Ra(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Aa(e[0],e[a-1],t)):l}function Ws(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=/* @__PURE__ */ Ra(0,t,r);e.push(J(n,1,i))}}function Gs(e){let t=[0];return Ws(t,e.length-1),t}function Ks(e,t){return e.map(e=>e*t)}function qs(e,t){return e.map(()=>t||no).splice(0,e.length-1)}function Js({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=/* @__PURE__ */ ro(r)?r.map(so):so(r)||no,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(ja.mix||ys)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?Aa(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Us(Ks(n&&n.length===t.length?n:Gs(t),e),t,{ease:Array.isArray(i)?i:qs(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}function Ys(e,t,n){let r=Math.max(t-5,0);return/* @__PURE__ */ Ha(n-e(r),t-r)}function Xs(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Ys(t=>e.next(t).value,t,e.next(t).value)}const Zs=e=>e!==null;function Qs(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Zs),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const $s={decay:Vs,inertia:Vs,tween:Js,keyframes:Js,spring:Bs};function ec(e){typeof e.type==`string`&&(e.type=$s[e.type])}const tc=(e,t)=>t-e>40&&!ja.useManualTiming?t:e;function nc(e,t){return{kind:e,animation:t,timestamp:K.now(),frameTimestamp:G.timestamp,frameIsProcessing:G.isProcessing}}function rc(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...nc(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function ic(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...nc(`layout-animation-start`,e),node:t})}catch{}}var ac=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}};const oc=e=>e/100,sc=e=>Math.round(e*1e4)/1e4;var cc=class extends ac{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==K.now()&&this.tick(K.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),rc(this,this.options)}initAnimation(){let{options:e}=this;ec(e);let{type:t=Js,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Js;s!==Js&&typeof o[0]!=`number`&&(this.mixKeyframes=La(oc,ys(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Os(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=tc(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;!d&&i!==null&&(p=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==Vs&&(f.value=Qs(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??sc((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==Vs?Qs(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=Aa(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}then(e,t){return this.finished.then(e,t)}get duration(){return/* @__PURE__ */ Va(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Va(e)}get time(){return/* @__PURE__ */ Va(this.currentTime)}set time(e){e=/* @__PURE__ */ Ba(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Xs(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(K.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=/* @__PURE__ */ Va(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ts,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(K.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};const lc=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function uc(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(xo)||[];if(!r)return e;let i=n.replace(r,``),a=+!!lc.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const dc=/\b([a-z-]*)\(.*?\)/gu,fc={...es,getAnimatableNone:e=>{let t=e.match(dc);return t?t.map(uc).join(` `):e}},pc={...es,getAnimatableNone:e=>{let t=es.parse(e);return es.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},mc={...vo,transform:Math.round},hc={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,rotate:Mo,pathRotation:Mo,rotateX:Mo,rotateY:Mo,rotateZ:Mo,scale:bo,scaleX:bo,scaleY:bo,scaleZ:bo,skew:Mo,skewX:Mo,skewY:Mo,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:yo,originX:Io,originY:Io,originZ:q,zIndex:mc,fillOpacity:yo,strokeOpacity:yo,numOctaves:mc},gc={...hc,color:Ro,backgroundColor:Ro,outlineColor:Ro,fill:Ro,stroke:Ro,borderColor:Ro,borderTopColor:Ro,borderRightColor:Ro,borderBottomColor:Ro,borderLeftColor:Ro,filter:fc,WebkitFilter:fc,mask:pc,WebkitMask:pc},_c=e=>gc[e],vc=/*@__PURE__*/ new Set([fc,pc]);function yc(e,t){let n=_c(e);return vc.has(n)||(n=es),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function bc(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const xc=e=>e*180/Math.PI,Sc=e=>{let t=xc(Math.atan2(e[1],e[0]));return wc(t)},Cc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Sc,rotateZ:Sc,skewX:e=>xc(Math.atan(e[1])),skewY:e=>xc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},wc=e=>(e%=360,e<0&&(e+=360),e),Tc=Sc,Ec=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Dc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Oc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ec,scaleY:Dc,scale:e=>(Ec(e)+Dc(e))/2,rotateX:e=>wc(xc(Math.atan2(e[6],e[5]))),rotateY:e=>wc(xc(Math.atan2(-e[2],e[0]))),rotateZ:Tc,rotate:Tc,skewX:e=>xc(Math.atan(e[4])),skewY:e=>xc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function kc(e){return+!!e.includes(`scale`)}function Ac(e,t){if(!e||e===`none`)return kc(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Oc,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Cc,i=t}if(!i)return kc(t);let a=r[t],o=i[1].split(`,`).map(Mc);return typeof a==`function`?a(o):o[a]}const jc=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Ac(n,t)};function Mc(e){return parseFloat(e.trim())}const Nc=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Pc=/* @__PURE__ */ new Set([...Nc,`pathRotation`]),Fc=e=>e===vo||e===q,Ic=/* @__PURE__ */ new Set([`x`,`y`,`z`]),Lc=Nc.filter(e=>!Ic.has(e));function Rc(e){let t=[];return Lc.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}const zc=/* @__PURE__ */ new Set([`bottom`,`right`]);function Bc(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}const Vc={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Bc(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Bc(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>Ac(e,`x`),y:({transform:e})=>Ac(e,`y`)};Vc.translateX=Vc.x,Vc.translateY=Vc.y;const Hc=/* @__PURE__ */ new Set;let Uc=!1,Wc=!1,Gc=!1;function Kc(){if(Wc){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;Hc.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),zc.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=Rc(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Wc=!1,Uc=!1,Hc.forEach(e=>e.complete(Gc)),Hc.clear()}function qc(){Hc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Wc=!0)})}function Jc(){Gc=!0,qc(),Kc(),Gc=!1}function Yc(e,t,n){if(typeof e==`string`){if(Ma(e)||Pa(e))return parseFloat(e);if(!es.test(e)&&es.test(n))return yc(t,n)}return e??void 0}var Xc=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Hc.add(this),Uc||(Uc=!0,Y.read(qc),Y.resolveKeyframes(Kc))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Yc(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}bc(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Hc.delete(this)}cancel(){this.state===`scheduled`&&(Hc.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const Zc=e=>e.startsWith(`--`);function Qc(e,t,n){Zc(t)?e.style.setProperty(t,n):e.style[t]=n}const $c={};function el(e,t){let n=/* @__PURE__ */ Fa(e);return()=>$c[t]??n()}const tl=/* @__PURE__ */ el(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),nl=/*@__PURE__*/ el(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),rl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,il={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ rl([0,.65,.55,1]),circOut:/*@__PURE__*/ rl([.55,0,1,.45]),backIn:/*@__PURE__*/ rl([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ rl([.33,1.53,.69,.99])};function al(e,t){if(e)return typeof e==`function`?nl()?Es(e,t):`ease-out`:/* @__PURE__ */ io(e)?rl(e):Array.isArray(e)?e.map(e=>al(e,t)||il.easeOut):il[e]}function ol(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=al(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function sl(e){return typeof e==`function`&&`applyToOptions`in e}function cl({type:e,...t}){return sl(e)&&nl()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var ll=class extends ac{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=cl(e);this.animation=ol(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Qs(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Qc(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},rc(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return/* @__PURE__ */ Va(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Va(e)}get time(){return/* @__PURE__ */ Va(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ Ba(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&tl()?(this.animation.timeline=e,t?.(this.animation),Ia):n(this)}};const ul={anticipate:Xa,backInOut:Ya,circInOut:$a};function dl(e){return e in ul}function fl(e){typeof e.ease==`string`&&dl(e.ease)&&(e.ease=ul[e.ease])}var pl=class extends ll{constructor(e){fl(e),ec(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(K.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new cc({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?Aa(0,10,a):0,s=this.sample(a);n&&r&&Qc(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}};const ml=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(es.test(e)||e===`0`)&&!e.startsWith(`url(`));function hl(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function gl(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=ml(i,t),s=ml(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):hl(e)||(n===`spring`||sl(n))&&r}function _l(e){e.duration=0,e.type=`keyframes`}const vl=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),yl=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function bl(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&yl.test(e[t]))return!0;return!1}const xl=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Sl=/*@__PURE__*/ Fa(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Cl(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(vl.has(n)||xl.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Sl()&&(vl.has(n)||xl.has(n)&&bl(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}const wl=(e,t)=>t&&typeof e==`number`?t.transform(e):e,Tl={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},El=Nc.length;function Dl(e,t,n){let r=``,i=!0;for(let a=0;a<El;a++){let o=Nc[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=wl(s,hc[o]);if(!c){i=!1;let t=Tl[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${wl(a,hc.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}const Ol=/* @__PURE__ */ new WeakMap,kl=.001,Al=e=>/^(linear|ease(In|Out|InOut))$/.test(e),jl=(e,t)=>e-t,Ml=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(J(e,t,i/n));return r},Nl=e=>e.motionValue.owner,Pl=e=>Ol.get(e),Fl=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),Il=({name:e,motionValue:t})=>e&&Nc.includes(e)&&t?.owner?.current instanceof HTMLElement&&Sl()&&nl();function Ll(e){let t=Nl(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(Fl(t,`transform`)||`none`)===`none`&&!Fl(t,`pathRotation`)&&!t.projection?.isProjecting()}var Rl=class extends cc{constructor(e){let t=Nl(e).current,{driver:n=Ts}=e,r=Ll(e);e.driver=e=>{let r=n(e);return{js:r,now:r.now,start:(e=!0)=>{let n=Pl(t);!n||n.isJS?r.start(e):n.schedule(!1,!e)},stop:()=>{r.stop();let e=Pl(t);e?.schedule(!e.isFinishing)}}},super(e),this.canAccelerate=r;let{stop:i}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),i()}}get group(){return Pl(Nl(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(K.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=/* @__PURE__ */ io(n)?rl(n):Al(n)&&il[n];if(o&&!i&&!r&&e.length===2&&t===Js&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||Js)===Js?u||Gs(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=K.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||zl(Nl(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(K.now())}get time(){return this.isAccelerated()?/* @__PURE__ */ Va(Aa(0,this.totalDuration,this.at(K.now())-(this.options.delay||0))):super.time}set time(e){super.time=e}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function zl(e){let t=e.current,n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Map,i={},a=[],o=/* @__PURE__ */ new Map,s=[],c=!1,l=!1,u=!1,d=-1/0,f=e=>{for(let t of n)if(t.name===e)return!0},p=(t,n)=>{let o={};for(let s of t===void 0?Nc:a){let a=r.get(s),c=t===void 0?Fl(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},m=(e,t)=>{let n=``,r=p(e,t);for(let e in r)n+=(Tl[e]||e)+`(`+wl(r[e],hc[e])+`) `;return n||`none`},h=(e=p())=>{t.style.transform=Dl(e,{})},g=(e=!0)=>{e&&h(),s.forEach(({animation:e})=>e.cancel()),s=[]},_=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=K.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),E.schedule(!1)}),e.oncancel=()=>s.includes(r)&&E.demote(),s.push(r)},v=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},y=(e,t,n,r)=>{let i=Math.min(200,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=Ml(t,n,i).concat(r).sort(jl),o=e=>/* @__PURE__ */ Ra(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e[e.length-1]-n,i=e.map(e=>r?(e-n)/r:e-n);if(!r){if(i.some(e=>!(Math.abs(e)<=kl)))return}else if(!s)s=i,c=e=>(t.numberAt(e)-n)/r;else if(i.some((e,t)=>!(Math.abs(e-s[t])<=kl)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=kl))return`linear`;let l=[],u=(e,t=c(e))=>l.push(sc(t)+` `+sc(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&v(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},b=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?.001:.1))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...v(e=>r.numberAt(e),t,n));i.push(n)}},s=Ml(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(jl))e>c&&o(c,e,0),c=e;return i.sort(jl)},x=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},S=(e,n,r,i={fill:`both`},a,o)=>{let s=e.flatMap(e=>e.boundaries(n,r)),c=o||y(e,n,r,s),l=c?[n,r]:b(e,n,r,s),u=l.map(e=>m(e,a)),d={transform:u};return c||(d.offset=l.map(e=>/* @__PURE__ */ Ra(n,r,e))),u.every(e=>e===u[0])&&(h(p(n,a)),d=null),t.animate(d,{...i,duration:r-n,easing:c||`linear`})},C=c=>{let l=c,u=0,d=0,f=[],p=[],m=/* @__PURE__ */ new Set;r.clear(),o=/* @__PURE__ */ new Map;for(let e of n){r.set(e.name,e);let[t,n]=e.timing(),i=t===1/0;if(o.set(e,[e.at(c),e.speed,i]),i)e.sync();else{if(e.speed<0)return;if(n){if(u){let e=(t-d)/n;if(Math.abs(n-u)>1||Math.abs(e-Math.round(e))*u>1)return}else u=n,d=t;p.push(e)}else m.add(t);f.push(e),l=Math.max(l,t)}}i={},a=Nc.filter(t=>{if(r.has(t))return!0;let n=i[t]=Fl(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),g(!1);let h=!u&&x(f);try{if(h&&h[1]>c){let[e,t,n]=h;_(S(f,e,t,void 0,void 0,n),e-c,t-e)}else l>c&&(_(S(f,c,l),0,l-c),m.forEach(e=>e<l-1&&_(t.animate(null,{duration:e-c}),0,e-c)));if(u){let e=d+Math.floor((l-d)/u)*u;_(S(p,e,e+u,{iterations:1/0,iterationStart:(l-e)/u,fill:`forwards`},l),l-c)}}catch{return}return s.length||g(),!0},w=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r?(n.playbackRate=r,n.startTime=e-o/r):(n.pause(),n.currentTime=o)}return!0},T=()=>{let r=K.now();if(E.isJS||(E.isFinishing=!0,n.forEach(t=>{let[n,a]=t.timing();t.state===`running`&&t.speed>0&&!a&&n<=r+1&&(t.complete(),i[t.name]=Fl(e,t.name),o.has(t)||(c=!0))}),E.isFinishing=!1),l=!1,n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),!n.size){Ol.delete(t),E.isJS||g();return}for(let e of n)if(!e.canAccelerate)return E.demote(!0);E.isJS&&(E.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let a=c,s=u;if(c=u=!1,a||!w(r)){if(s){if(r-d<100)return E.demote();d=r}if(!C(r))return E.demote()}},E={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){c||=e,u||=!!t,l||(l=!0,G.isProcessing?Y.render(T,!1,!0):queueMicrotask(T))},check(){if(!E.isJS){for(let t in i)if(Fl(e,t)!==i[t]&&!f(t))return E.schedule(!0,!0)}},demote(e){E.isJS||(n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),E.isJS=!0,o=/* @__PURE__ */ new Map,g(),n.forEach(e=>e.state===`running`&&e.js?.start()))}};return Ol.set(t,E),E}var Bl=class extends ac{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=K.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Xc;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=K.now();let u=!0;gl(e,i,a,o)||(u=!1,(ja.instantAnimations||!s)&&l?.(Qs(e,n,t)),e[0]=e[e.length-1],_l(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&Cl(n),p=!f&&Il(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=tc(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new pl(n)}catch{m=new cc(n)}}else m=p?new Rl(n):new cc(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),Jc()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Vl(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}const Hl=e=>!isNaN(parseFloat(e)),Ul={current:void 0};var Wl=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=K.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=K.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Hl(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new za)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new za,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){Y.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=/* @__PURE__ */ new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){Ul.current&&Ul.current.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=K.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return/* @__PURE__ */ Ha(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Gl(e,t){return new Wl(e,t)}function Kl(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function ql(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Kl(n,e)}const Jl={type:`spring`,stiffness:500,damping:25,restSpeed:10},Yl=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Xl={type:`keyframes`,duration:.8},Zl={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Ql=(e,{keyframes:t})=>t.length>2?Xl:Pc.has(e)?e.startsWith(`scale`)?Yl(t[1]):Jl:Zl,$l=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function eu(e){for(let t in e)if(!$l.has(t))return!0;return!1}const tu=(e,t,n,r={},i,a)=>o=>{let s=ql(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ Ba(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};eu(s)||Object.assign(u,Ql(e,u)),u.duration&&=/* @__PURE__ */ Ba(u.duration),u.repeatDelay&&=/* @__PURE__ */ Ba(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(_l(u),u.delay===0&&(d=!0)),(ja.instantAnimations||ja.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,_l(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Qs(u.keyframes,s);if(e!==void 0){Y.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new cc(u):new Bl(u)},nu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ru(e){let t=nu.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function iu(e,t,n=1){`${e}`;let[r,i]=ru(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Ma(e)?parseFloat(e):e}return ho(i)?iu(i,t,n+1):i}function au(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function ou(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...au(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function su(e,t,n){return ou(e.getProps(),t,n,e)}const cu=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,lu=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Nc]),uu=e=>Array.isArray(e);function du(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Gl(n))}function fu(e){return uu(e)?e[e.length-1]||0:e}function pu(e,t){let{transitionEnd:n={},transition:r={},...i}=su(e,t)||{};i={...i,...n};for(let t in i)du(e,t,fu(i[t]))}const mu=e=>!!(e&&e.getVelocity);function hu(e){return!!(mu(e)&&e.add)}function gu(e,t){let n=e.getValue(`willChange`);if(hu(n))return n.add(t);if(!n&&ja.WillChange){let n=new ja.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function _u(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const vu=`data-`+_u(`framerAppearId`);function yu(e){return e.props[vu]}const bu=typeof window<`u`;function xu({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Su(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Kl(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&xu(f,t))continue;let o={delay:n,...ql(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Y.update(()=>r.set(i));continue}let p=!1;if(bu&&window.MotionHandoffAnimation){let n=yu(e);if(n){let e=window.MotionHandoffAnimation(n,t,Y);e!==null&&(o.startTime=e,p=!0)}}gu(e,t);let m=l??e.shouldReduceMotion;r.start(tu(t,r,i,m&&lu.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Y.update(()=>{o&&pu(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Cu(e,t,n={}){let r=su(e,t,cu(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Su(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Cu(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Vl(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function wu(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Cu(e,t,n))):typeof t==`string`?Cu(e,t,n):Promise.all(Su(e,su(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}const Tu={test:e=>e===`auto`,parse:e=>e},Eu=e=>t=>t.test(e),Du=[vo,q,No,Mo,Fo,Po,Tu],Ou=e=>Du.find(Eu(e));function ku(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Pa(e)}const Au=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function ju(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Au.has(t)&&Ko(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=yc(n,i))}var Mu=class extends Xc{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(_o(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),ho(r))){let i=iu(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!lu.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=Ou(r),o=Ou(i);if(_o(r)!==_o(i)&&Vc[n])this.needsMeasurement=!0;else if(a!==o){if(Fc(a)&&Fc(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Vc[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||ku(e[t]))&&n.push(t);n.length&&ju(e,n,t)}measure(){let{element:e,name:t}=this;return Vc[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const Nu=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Pu(e){return Na(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Fu(e){return Na(e)&&`ownerSVGElement`in e}function Iu(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}function Lu(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Pc.has(e))o=!0;else if(po(e))i[e]=n;else{let t=wl(n,hc[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Dl(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}const Ru={offset:`stroke-dashoffset`,array:`stroke-dasharray`},zu={offset:`strokeDashoffset`,array:`strokeDasharray`};function Bu(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Ru:zu;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Vu=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Hu(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Lu(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Vu)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Bu(d,i,a,o,!1)}function Uu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Wu({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gu(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ku(e){return e===void 0||e===1}function qu({scale:e,scaleX:t,scaleY:n}){return!Ku(e)||!Ku(t)||!Ku(n)}function Ju(e){return qu(e)||Yu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Yu(e){return Xu(e.x)||Xu(e.y)}function Xu(e){return e&&e!==`0%`}function Zu(e,t,n){return n+t*(e-n)}function Qu(e,t,n,r,i){return i!==void 0&&(e=Zu(e,i,r)),Zu(e,n,r)+t}function $u(e,t=0,n=1,r,i){e.min=Qu(e.min,t,n,r,i),e.max=Qu(e.max,t,n,r,i)}function ed(e,{x:t,y:n}){$u(e.x,t.translate,t.scale,t.originPoint),$u(e.y,n.translate,n.scale,n.originPoint)}const td=.999999999999,nd=1.0000000000001;function rd(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(id(e.x,-a.scroll.offset.x),id(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ed(e,o)),r&&Ju(a.latestValues)&&sd(e,a.latestValues,a.layout?.layoutBox))}t.x<nd&&t.x>td&&(t.x=1),t.y<nd&&t.y>td&&(t.y=1)}function id(e,t){e.min+=t,e.max+=t}function ad(e,t,n,r,i=.5){$u(e,t,n,J(e.min,e.max,i),r)}function od(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function sd(e,t,n){let r=n??e;ad(e.x,od(t.x,r.x),t.scaleX,t.scale,t.originX),ad(e.y,od(t.y,r.y),t.scaleY,t.scale,t.originY)}function cd(e,t){return Uu(Gu(e.getBoundingClientRect(),t))}function ld(e,t,n){let r=cd(e,n),{scroll:i}=t;return i&&(id(r.x,i.offset.x),id(r.y,i.offset.y)),r}const{schedule:ud,cancel:dd}=/* @__PURE__ */ Ss(queueMicrotask,!1),fd={x:!1,y:!1};function pd(){return fd.x||fd.y}function md(e){return e===`x`||e===`y`?fd[e]?null:(fd[e]=!0,()=>{fd[e]=!1}):fd.x||fd.y?null:(fd.x=fd.y=!0,()=>{fd.x=fd.y=!1})}function hd(e,t){let n=Iu(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function gd(e){return!(e.pointerType===`touch`||pd())}function _d(e,t,n={}){let[r,i,a]=hd(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!gd(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}const vd=(e,t)=>t?e===t||vd(e,t.parentElement):!1,yd=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,bd=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function xd(e){return bd.has(e.tagName)||e.isContentEditable===!0}const Sd=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Cd(e){return Sd.has(e.tagName)||e.isContentEditable===!0}const wd=/* @__PURE__ */ new WeakSet;function Td(e){return t=>{t.key===`Enter`&&e(t)}}function Ed(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const Dd=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Td(()=>{if(wd.has(n))return;Ed(n,`down`);let e=Td(()=>{Ed(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Ed(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Od(e){return yd(e)&&!pd()}const kd=/* @__PURE__ */ new WeakSet;function Ad(e,t,n={}){let[r,i,a]=hd(e,n),o=e=>{let r=e.currentTarget;if(!Od(e)||kd.has(e))return;wd.add(r),n.stopPropagation&&kd.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),wd.has(r)&&wd.delete(r),Od(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||vd(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Pu(e)&&(e.addEventListener(`focus`,e=>Dd(e,i)),!xd(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}const jd=/* @__PURE__ */ new WeakMap;let Md;const Nd=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Fu(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Pd=/*@__PURE__*/ Nd(`inline`,`width`,`offsetWidth`),Fd=/*@__PURE__*/ Nd(`block`,`height`,`offsetHeight`);function Id({target:e,borderBoxSize:t}){jd.get(e)?.forEach(n=>{n(e,{get width(){return Pd(e,t)},get height(){return Fd(e,t)}})})}function Ld(e){e.forEach(Id)}function Rd(){typeof ResizeObserver<`u`&&(Md=new ResizeObserver(Ld))}function zd(e,t){Md||Rd();let n=Iu(e);return n.forEach(e=>{let n=jd.get(e);n||(n=/* @__PURE__ */ new Set,jd.set(e,n)),n.add(t),Md?.observe(e)}),()=>{n.forEach(e=>{let n=jd.get(e);n?.delete(t),n?.size||Md?.unobserve(e)})}}const Bd=/* @__PURE__ */ new Set;let Vd;function Hd(){Vd=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Bd.forEach(t=>t(e))},window.addEventListener(`resize`,Vd)}function Ud(e){return Bd.add(e),Vd||Hd(),()=>{Bd.delete(e),!Bd.size&&typeof Vd==`function`&&(window.removeEventListener(`resize`,Vd),Vd=void 0)}}function Wd(e,t){return typeof e==`function`?Ud(e):zd(e,t)}const Gd={value:null,addProjectionMetrics:null};function Kd(e){return Fu(e)&&e.tagName===`svg`}const qd=e=>typeof e==`number`?e:parseFloat(e),Jd=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yd=()=>({x:Jd(),y:Jd()}),Xd=()=>({min:0,max:0}),Zd=()=>({x:Xd(),y:Xd()}),Qd=/* @__PURE__ */ new WeakMap;function $d(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function ef(e){return typeof e==`string`||Array.isArray(e)}const tf=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],nf=[`initial`,...tf];function rf(e){if($d(e.animate))return!0;for(let t=0;t<nf.length;t++)if(ef(e[nf[t]]))return!0;return!1}function af(e){return!!(rf(e)||e.variants)}function of(e,t,n){for(let r in t){let i=t[r],a=n[r];if(mu(i))e.addValue(r,i);else if(mu(a))e.addValue(r,Gl(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Gl(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const sf={current:null},cf={current:!1},lf=typeof window<`u`;function uf(){if(cf.current=!0,lf){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>sf.current=e.matches;e.addEventListener(`change`,t),t()}else sf.current=!1}}const df=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let ff={};function pf(e){ff=e}function mf(){return ff}var hf=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=/* @__PURE__ */ new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=/* @__PURE__ */ new Map,this.KeyframeResolver=Xc,this.features={},this.valueSubscriptions=/* @__PURE__ */ new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=K.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Y.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=rf(t),this.isVariantNode=af(t),this.isVariantNode&&(this.variantChildren=/* @__PURE__ */ new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&mu(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,Qd.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(cf.current||uf(),this.shouldReduceMotion=sf.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Cs(this.notifyUpdate),Cs(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=/* @__PURE__ */ new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&vl.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new ll({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ Ba(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Pc.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Y.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),Ol.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in ff){let t=ff[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Zd()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&Ol.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<df.length;t++){let n=df[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=of(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Gl(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Ma(n)||Pa(n))?n=parseFloat(n):typeof n!=`number`&&!es.test(n)&&es.test(t)&&(n=yc(e,t)),this.setBaseTarget(e,mu(n)?n.get():n)),mu(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new za),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){ud.render(this.render)}},gf=class extends hf{constructor(){super(...arguments),this.KeyframeResolver=Mu}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;mu(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},_f=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function vf(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}const yf={};function bf(e,{layout:t,layoutId:n}){return Pc.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!yf[e]||e===`opacity`)}function xf(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(mu(r[t])||i&&mu(i[t])||bf(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Sf(e){return window.getComputedStyle(e)}var Cf=class extends gf{constructor(){super(...arguments),this.type=`html`,this.renderInstance=vf}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Pc.has(t))return this.projection?.isProjecting?kc(t):jc(e,t);{let n=Sf(e),r=(po(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return cd(e,t)}build(e,t,n){Lu(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return xf(e,t,n)}};const wf=/* @__PURE__ */ new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Tf=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Ef(e,t,n,r){vf(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(wf.has(n)?n:_u(n),t.attrs[n])}function Df(e,t,n){let r=xf(e,t,n);for(let n in e)if(mu(e[n])||mu(t[n])){let t=Nc.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Of=class extends gf{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Zd}getBaseTargetFromProps(e,t){return Pc.has(t)?super.getBaseTargetFromProps(e,t)??kc(t):e[t]}getDefaultValue(e){return Pc.has(e)?this.latestValues[e]??kc(e):void 0}readValueFromInstance(e,t){if(Pc.has(t)){let e=_c(t);return e&&e.default||0}if(Vu.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=wf.has(t)?t:_u(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Df(e,t,n)}build(e,t,n){Hu(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Ef(e,t,n,r)}mount(e){this.isSVGTag=Tf(e.tagName),super.mount(e)}};function kf(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Af=[...tf].reverse();function jf(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>wu(e,t,n))),n=Nf(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=/* @__PURE__ */ new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(Af.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?ef(g)||g===!1?g:void 0:h,v=ef(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||$d(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=Mf(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=su(e,n,cu(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!kf(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=su(s,n)?.transition?.delayChildren;r.delay=Vl(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&su(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!mu(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=Nf(),i=!0}}}function Mf(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!kf(t,e):!1}function Nf(){let e={};for(let t of tf)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function Pf(e,t){e.min=t.min,e.max=t.max}function Ff(e,t){Pf(e.x,t.x),Pf(e.y,t.y)}function If(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Lf(e){return e.max-e.min}function Rf(e,t,n){return Math.abs(e-t)<=n}function zf(e,t,n,r=.5){e.origin=r,e.originPoint=J(t.min,t.max,e.origin),e.scale=Lf(n)/Lf(t),e.translate=J(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Bf(e,t,n,r){zf(e.x,t.x,n.x,r?r.originX:void 0),zf(e.y,t.y,n.y,r?r.originY:void 0)}function Vf(e,t,n,r=0){e.min=(r?J(n.min,n.max,r):n.min)+t.min,e.max=e.min+Lf(t)}function Hf(e,t,n,r){Vf(e.x,t.x,n.x,r?.x),Vf(e.y,t.y,n.y,r?.y)}function Uf(e,t,n,r=0){let i=r?J(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Lf(t)}function Wf(e,t,n,r){Uf(e.x,t.x,n.x,r?.x),Uf(e.y,t.y,n.y,r?.y)}function Gf(e,t,n,r,i){return e-=t,e=Zu(e,1/n,r),i!==void 0&&(e=Zu(e,1/i,r)),e}function Kf(e,t=0,n=1,r=.5,i,a=e,o=e){if(No.test(t)&&(t=parseFloat(t),t=J(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=J(a.min,a.max,r);e===a&&(s-=t),e.min=Gf(e.min,t,n,s,i),e.max=Gf(e.max,t,n,s,i)}function qf(e,t,[n,r,i],a,o){Kf(e,t[n],t[r],t[i],t.scale,a,o)}const Jf=[`x`,`scaleX`,`originX`],Yf=[`y`,`scaleY`,`originY`];function Xf(e,t,n,r){qf(e.x,t,Jf,n?n.x:void 0,r?r.x:void 0),qf(e.y,t,Yf,n?n.y:void 0,r?r.y:void 0)}function Zf(e){return e.translate===0&&e.scale===1}function Qf(e){return Zf(e.x)&&Zf(e.y)}function $f(e,t){return e.min===t.min&&e.max===t.max}function ep(e,t){return $f(e.x,t.x)&&$f(e.y,t.y)}function tp(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function np(e,t){return tp(e.x,t.x)&&tp(e.y,t.y)}function rp(e){return Lf(e.x)/Lf(e.y)}function ip(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ap(e){return[e(`x`),e(`y`)]}function op(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const sp={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(q.test(e))e=parseFloat(e);else return e}return`${op(e,t.target.x)}% ${op(e,t.target.y)}%`}},cp={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=es.parse(e);if(i.length>5)return r;let a=es.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=J(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function lp(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const up=Nu.length,dp=e=>typeof e==`number`||q.test(e);function fp(e,t,n,r,i,a){i?(e.opacity=J(0,n.opacity??1,mp(r)),e.opacityExit=J(t.opacity??1,0,hp(r))):a&&(e.opacity=J(t.opacity??1,n.opacity??1,r));for(let i=0;i<up;i++){let a=Nu[i],o=pp(t,a),s=pp(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||dp(o)===dp(s)?(e[a]=Math.max(J(qd(o),qd(s),r),0),(No.test(s)||No.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=J(t.rotate||0,n.rotate||0,r))}function pp(e,t){return e[t]===void 0?e.borderRadius:e[t]}const mp=/*@__PURE__*/ gp(0,.5,Qa),hp=/*@__PURE__*/ gp(.5,.95,Ia);function gp(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ Ra(e,t,r))}function _p(e,t,n){let r=mu(e)?e:Gl(e);return r.start(tu(``,r,t,n)),r.animation}function vp(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const yp=(e,t)=>e.depth-t.depth;var bp=class{constructor(){this.children=[],this.isDirty=!1}add(e){Oa(this.children,e),this.isDirty=!0}remove(e){ka(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(yp),this.isDirty=!1,this.children.forEach(e)}};function xp(e,t){let n=K.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Cs(r),e(a-t))};return Y.setup(r,!0),()=>Cs(r)}function Sp(e){return mu(e)?e.get():e}var Cp=class{constructor(){this.members=[]}add(e){Oa(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(ka(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(ka(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const wp={borderRadius:{...sp,applyTo:[...Nu]},borderTopLeftRadius:sp,borderTopRightRadius:sp,borderBottomLeftRadius:sp,borderBottomRightRadius:sp,boxShadow:cp},Tp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(yf,{...wp,...yf});const Ep={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Dp=[``,`X`,`Y`,`Z`];let Op=0;function kp(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}const Ap=({instance:e})=>e&&Ol.get(e)?.demote();function jp(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=yu(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Y,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&jp(r)}function Mp({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Op++,this.animationId=0,this.animationCommitId=0,this.children=/* @__PURE__ */ new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=/* @__PURE__ */ new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Gd.value&&(Ep.nodes=Ep.calculatedTargetDeltas=Ep.calculatedProjections=0),this.nodes.forEach(Fp),this.nodes.forEach(Kp),this.nodes.forEach(qp),this.nodes.forEach(Ip),Gd.addProjectionMetrics&&Gd.addProjectionMetrics(Ep)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=/* @__PURE__ */ new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new bp)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new za),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Fu(t)&&!Kd(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Y.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=xp(i,250),Tp.hasAnimatedSinceResize&&(Tp.hasAnimatedSinceResize=!1,this.nodes.forEach(Gp)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||em,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!np(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...ql(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Gp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Cs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Jp),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jp(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Ap(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,Ap(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(zp),this.nodes.forEach(Rp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Bp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Hp),this.nodes.forEach(Up),this.nodes.forEach(Wp),this.nodes.forEach(Np),this.nodes.forEach(Pp)):this.nodes.forEach(Bp),this.clearAllSnapshots();let e=K.now();G.delta=Aa(0,1e3/60,e-G.timestamp),G.timestamp=e,G.isProcessing=!0,ws.update.process(G),ws.preRender.process(G),ws.render.process(G),G.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ud.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Lp),this.sharedNodes.forEach(Yp)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Y.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Y.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Lf(this.snapshot.measuredBox.x)&&!Lf(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=Zd(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&Ap(this);let t=this.projectionDelta&&!Qf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Ju(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),im(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Zd();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(om))){let{scroll:e}=this.root;e&&(id(t.x,e.offset.x),id(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Zd();if(Ff(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Ff(t,e),id(t.x,i.offset.x),id(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Zd();Ff(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(id(r.x,-n.scroll.offset.x),id(r.y,-n.scroll.offset.y)),Ju(n.latestValues)&&sd(r,n.latestValues,n.layout?.layoutBox)}return Ju(this.latestValues)&&sd(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Zd();Ff(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Ju(n.latestValues))continue;let r;n.instance&&(qu(n.latestValues)&&n.updateSnapshot(),r=Zd(),Ff(r,n.measurePageBox())),Xf(t,n.latestValues,n.snapshot?.layoutBox,r)}return Ju(this.latestValues)&&Xf(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==G.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=G.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=Zd(),this.targetWithTransforms=Zd()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Hf(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ff(this.target,this.layout.layoutBox),ed(this.target,this.targetDelta)):Ff(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Gd.value&&Ep.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||qu(this.parent.latestValues)||Yu(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Zd(),this.relativeTargetOrigin=Zd(),Wf(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Ff(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===G.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Ff(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;rd(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Zd());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(If(this.prevProjectionDelta.x,this.projectionDelta.x),If(this.prevProjectionDelta.y,this.projectionDelta.y)),Bf(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!ip(this.projectionDelta.x,this.prevProjectionDelta.x)||!ip(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Gd.value&&Ep.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Yd(),this.projectionDelta=Yd(),this.projectionDeltaWithTransform=Yd()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Yd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Zd(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some($p));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=J(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=J(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Xp(o.x,e.x,n),Xp(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Wf(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Qp(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&ep(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Zd(),Ff(f,this.relativeTarget)),c&&(this.animationValues=a,fp(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Cs(this.pendingAnimation),void 0),this.pendingAnimation=Y.update(()=>{Tp.hasAnimatedSinceResize=!0,this.motionValue||=Gl(0),this.motionValue.jump(0,!1),this.currentAnimation=_p(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),ic(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&am(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Zd();let t=Lf(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=Lf(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}Ff(t,i),sd(t,r),Bf(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Cp),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&kp(`z`,e,r,this.animationValues);for(let t=0;t<Dp.length;t++)kp(`rotate${Dp[t]}`,e,r,this.animationValues),kp(`skew${Dp[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Sp(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Sp(t?.pointerEvents)||``),this.hasProjected&&!Ju(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=lp(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in yf){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=yf[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Sp(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Rp),this.root.sharedNodes.clear()}}}function Np(e){e.updateLayout(),Vp(e)}function Pp(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)ap(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Lf(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Pf(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else am(i,t.layoutBox,n)&&ap(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Lf(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Yd();Bf(o,n,t.layoutBox);let s=Yd();a?Bf(s,e.applyTransform(r,!0),t.measuredBox):Bf(s,n,t.layoutBox);let c=!Qf(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Zd();Wf(s,t.layoutBox,i.layoutBox,o);let c=Zd();Wf(c,n,a.layoutBox,o),np(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Fp(e){Gd.value&&Ep.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ip(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Lp(e){e.clearSnapshot()}function Rp(e){e.clearMeasurements()}function zp(e){e.isLayoutDirty=!0,e.updateLayout()}function Bp(e){e.isLayoutDirty=!1}function Vp(e){let{snapshot:t,dragAncestor:n}=e,r=n?.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;ap(e=>id(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function Hp(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Up(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Wp(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Gp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Kp(e){e.resolveTargetDelta()}function qp(e){e.calcProjection()}function Jp(e){e.resetSkewAndRotation()}function Yp(e){e.removeLeadSnapshot()}function Xp(e,t,n){e.translate=J(t.translate,0,n),e.scale=J(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Zp(e,t,n,r){e.min=J(t.min,n.min,r),e.max=J(t.max,n.max,r)}function Qp(e,t,n,r){Zp(e.x,t.x,n.x,r),Zp(e.y,t.y,n.y,r)}function $p(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const em={duration:.45,ease:[.4,0,.1,1]},tm=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nm=tm(`applewebkit/`)&&!tm(`chrome/`)?Math.round:Ia;function rm(e){e.min=nm(e.min),e.max=nm(e.max)}function im(e){rm(e.x),rm(e.y)}function am(e,t,n){return e===`position`||e===`preserve-aspect`&&!Rf(rp(t),rp(n),.2)}function om(e){return e!==e.root&&e.scroll?.wasRoot}const sm=Mp({attachResizeListener:(e,t)=>vp(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),cm={current:void 0},lm=Mp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!cm.current){let e=new sm({});e.mount(window),e.setOptions({layoutScroll:!0}),cm.current=e}return cm.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),um=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function dm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function fm(...e){return t=>{let n=!1,r=e.map(e=>{let r=dm(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():dm(e[t],null)}}}}function pm(...e){return a.useCallback(fm(...e),e)}var mm=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Pu(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Pu(e)&&e.offsetWidth||0,r=Pu(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function hm({children:e,isPresent:n,anchorX:r,anchorY:i,root:o,pop:s}){let c=v(),l=C(null),u=C({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:d}=g(um),f=pm(l,s===!1?void 0:e.props?.ref??e?.ref);return b(()=>{let{width:e,height:t,top:a,left:f,right:p,bottom:m,direction:h}=u.current;if(n||s===!1||!l.current||!e||!t)return;let g=h===`rtl`,_=r===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=i===`bottom`?`bottom: ${m}`:`top: ${a}`,y=l.current;y.dataset.motionPopId=c;let b=y.ownerDocument,x=b.createElement(`style`);d&&(x.nonce=d);let S=o??b.head;return S.appendChild(x),x.sheet&&x.sheet.insertRule(`
|
|
237
237
|
[data-motion-pop-id="${c}"] {
|
|
238
238
|
position: absolute !important;
|
|
239
239
|
width: ${e}px !important;
|
|
@@ -241,9 +241,9 @@ function Wa(e,t,n,r){if(e===t&&n===r)return Fa;let i=t=>Ua(t,0,1,e,n);return e=>
|
|
|
241
241
|
${_}px !important;
|
|
242
242
|
${v}px !important;
|
|
243
243
|
}
|
|
244
|
-
`),()=>{l.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[n]),t(Qp,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:a.cloneElement(e,{ref:f})})}const em=({children:e,initial:n,isPresent:r,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=wa(tm),p=v(),m=C(r),h=C(i);Ta(()=>{m.current=r,h.current=i});let g=!0,_=S(()=>(g=!1,{id:p,initial:n,isPresent:r,custom:o,onExitComplete:e=>{f.set(e,!0);for(let e of f.values())if(!e)return;i&&i()},register:e=>(f.set(e,!1),()=>{f.delete(e),!m.current&&!f.size&&h.current?.()})}),[r,f,i]);return s&&g&&(_={..._}),S(()=>{f.forEach((e,t)=>f.set(t,!1))},[r]),a.useEffect(()=>{!r&&!f.size&&i&&i()},[r]),e=t($p,{pop:c===`popLayout`,isPresent:r,anchorX:l,anchorY:u,root:d,children:e}),t(Ea.Provider,{value:_,children:e})};function tm(){return/* @__PURE__ */ new Map}function nm(e=!0){let t=g(Ea);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=v();_(()=>{if(e)return i(a)},[e]);let o=h(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const rm=e=>e.key||``;function im(e){let t=[];return s.forEach(e,e=>{m(e)&&t.push(e)}),t}const am=({children:n,custom:r,initial:i=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s=`sync`,propagate:c=!1,anchorX:l=`left`,anchorY:u=`top`,root:d})=>{let[f,p]=nm(c),m=S(()=>im(n),[n]),h=c&&!f?[]:m.map(rm),_=C(!0),v=wa(()=>/* @__PURE__ */ new Map),y=C(/* @__PURE__ */ new Set),[b,x]=w(m),[T,E]=w(m);Ta(()=>{c&&!f&&!T.length&&p?.()},[f,c,T.length,p]),Ta(()=>{_.current=!1;for(let e=0;e<T.length;e++){let t=rm(T[e]);h.includes(t)?(v.delete(t),y.current.delete(t)):v.get(t)!==!0&&v.set(t,!1)}},[T,h.length,h.join(`-`)]);let D=[];if(m!==b){let e=[...m],t=0;for(let n of T){let r=h.indexOf(rm(n));r===-1?(e.splice(t++,0,n),D.push(n)):t=r+D.length+1}return D.every(e=>v.get(rm(e)))?e=m:s===`wait`&&(e=D),E(im(e)),x(m),null}let{forceRender:O}=g(Ca);return t(e,{children:T.map(e=>{let n=rm(e),g=c&&!f?!1:m===T||h.includes(n);return t(em,{isPresent:g,initial:!_.current||i?void 0:!1,custom:r,presenceAffectsLayout:o,mode:s,root:d,onExitComplete:g?void 0:()=>{if(y.current.has(n))return;if(v.has(n))y.current.add(n),v.set(n,!0);else return;let e=!0;v.forEach(t=>{t||(e=!1)}),e&&(O?.(),x([]),c&&p?.(),a&&a())},anchorX:l,anchorY:u,children:e},n)})})},om=d({strict:!1}),sm={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]};let cm=!1;function lm(){if(cm)return;let e={};for(let t in sm)e[t]={isEnabled:e=>sm[t].some(t=>!!e[t])};Qd(e),cm=!0}function um(){return lm(),$d()}function dm(e){let t=um();for(let n in e)t[n]={...t[n],...e[n]};Qd(t)}const fm=/* @__PURE__ */ d({});function pm(e,t){if(Ud(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Bd(t)?t:void 0,animate:Bd(n)?n:void 0}}return e.inherit===!1?{}:t}function mm(e){let{initial:t,animate:n}=pm(e,g(fm));return S(()=>({initial:t,animate:n}),[hm(t),hm(n)])}function hm(e){return Array.isArray(e)?e.join(` `):e}const gm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _m(e,t,n){for(let r in t)!Xl(t[r])&&!of(r,n)&&(e[r]=t[r])}function vm({transformTemplate:e},t){return S(()=>{let n=gm();return Cu(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ym(e,t){let n=e.style||{},r={};return _m(r,n,e),Object.assign(r,vm(e,t)),r}function bm(e,t){let n={},r=ym(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const xm=()=>({...gm(),attrs:{}});function Sm(e,t,n,r){let i=S(()=>{let n=xm();return Ou(n,t,df(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};_m(t,e.style,e),i.style={...t,...i.style}}return i}const Cm=/* @__PURE__ */ new Set(/* @__PURE__ */ `animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function wm(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Cm.has(e)}function Tm(e,t){return e.startsWith(`on`)?!wm(e):t?.(e)??!wm(e)}function Em(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(Xl(e[a])||(Tm(a,r)||n===!0&&wm(a)||!t&&!wm(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}const Dm=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Om(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Dm.indexOf(e)>-1||/[A-Z]/u.test(e))}function km(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Om(e)?Sm:bm)(t,r,i,e),u=Em(t,typeof e==`string`,a,s),d=e===l?{}:{...u,...c,ref:n},{children:p}=t,m=S(()=>Xl(p)?p.get():p,[p]);return f(e,{...d,children:m})}function Am({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:jm(n,r,i,e),renderState:t()}}function jm(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=cp(a[e]);let{initial:o,animate:s}=e,c=Ud(e),l=Wd(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!zd(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Hl(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}const Mm=e=>(t,n)=>{let r=g(fm),i=g(Ea),a=()=>Am(e,t,r,i);return n?a():wa(a)},Nm=/*@__PURE__*/ Mm({scrapeMotionValuesFromProps:sf,createRenderState:gm}),Pm=/*@__PURE__*/ Mm({scrapeMotionValuesFromProps:pf,createRenderState:xm}),Fm=Symbol.for(`motionComponentSymbol`);function Im(e,t,n){let r=C(n);b(()=>{r.current=n});let i=C(null);return h(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}const Lm=d({});function Rm(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function zm(e,t,n,r,i,a){let{visualElement:o}=g(fm),s=g(om),c=g(Ea),l=g(Jp),u=l.reducedMotion,d=l.skipAnimations,f=C(null),p=C(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=g(Lm);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Bm(f.current,n,i,h);let v=C(!1);b(()=>{m&&v.current&&m.update(n,c)});let y=n[eu],x=C(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return Ta(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),Ta(()=>{p.current=!0,m&&(v.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),_(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),!1),m.enteringChildren=void 0)}),m}function Bm(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Vm(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Rm(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Vm(e){if(e)return e.options.allowProjection===!1?Vm(e.parent):e.projection}function Hm(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&dm(a);let s=i?i===`svg`:Om(e),c=s?Pm:Nm;function l(i,l){let u,d={...g(Jp),...i,layoutId:Um(i)},{isStatic:f,isValidProp:p}=d,m=mm(i),h=c(i,f);if(!f&&typeof window<`u`){Wm(d,a);let t=Gm(d);u=t.MeasureLayout,m.visualElement=zm(e,h,d,o,t.ProjectionNode,s)}return n(fm.Provider,{value:m,children:[u&&m.visualElement?t(u,{visualElement:m.visualElement,...d}):null,km(e,i,Im(h,m.visualElement,l),h,f,r,s,p)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=p(l);return u[Fm]=e,u}function Um({layoutId:e}){let t=g(Ca).id;return t&&e!==void 0?t+`-`+e:e}function Wm(e,t){g(om).strict}function Gm(e){let{drag:t,layout:n}=um();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Km(e,t){if(typeof Proxy>`u`)return Hm;let n=/* @__PURE__ */ new Map,r=(n,r)=>Hm(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Hm(a,void 0,e,t)),n.get(a))})}const qm=(e,t)=>t.isSVG??Om(e)?new mf(t):new lf(t,{allowProjection:e!==l});var Jm=class extends nf{constructor(e){super(e),e.animationState||=_f(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();zd(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};let Ym=0;const Xm={animation:{Feature:Jm},exit:{Feature:class extends nf{constructor(){super(...arguments),this.id=Ym++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Ul(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Zm(e){return{point:{x:e.pageX,y:e.pageY}}}const Qm=e=>t=>ad(t)&&e(t,Zm(t));function $m(e,t,n,r){return ip(e,t,Qm(n),r)}const eh=({current:e})=>e?e.ownerDocument.defaultView:null,th=(e,t)=>Math.abs(e-t);function nh(e,t){let n=th(e.x,t.x),r=th(e.y,t.y);return Math.sqrt(n**2+r**2)}const rh=/*#__PURE__*/ new Set([`auto`,`scroll`]);var ih=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=/* @__PURE__ */ new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ah(this.lastRawMoveEventInfo,this.transformPagePoint));let e=sh(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=nh(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:uo.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=ah(t,this.transformPagePoint),this.hasPendingMove=!0,Y.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=sh(e.type===`pointercancel`?this.lastMoveEventInfo:ah(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!ad(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=ah(Zm(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=G;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,sh(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Ia($m(this.contextWindow,`pointermove`,this.handlePointerMove,d),$m(this.contextWindow,`pointerup`,this.handlePointerUp,d),$m(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(rh.has(e.overflowX)||rh.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Y.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Cs(this.updatePoint)}};function ah(e,t){return t?{point:t(e.point)}:e}function oh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sh({point:e},t){return{point:e,delta:oh(e,lh(t)),offset:oh(e,ch(t)),velocity:uh(t,.1)}}function ch(e){return e[0]}function lh(e){return e[e.length-1]}function uh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=lh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ za(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ za(t)*2&&(r=e[1]);let a=/* @__PURE__ */ Ba(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function dh(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?J(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?J(n,e,r.max):Math.min(e,n)),e}function fh(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function ph(e,{top:t,left:n,bottom:r,right:i}){return{x:fh(e.x,n,i),y:fh(e.y,t,r)}}function mh(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function hh(e,t){return{x:mh(e.x,t.x),y:mh(e.y,t.y)}}function gh(e,t){let n=.5,r=Cf(e),i=Cf(t);return i>r?n=/* @__PURE__ */ La(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ La(e.min,e.max-i,t.min)),ka(0,1,n)}function _h(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const vh=.35;function yh(e=vh){return e===!1?e=0:e===!0&&(e=vh),{x:bh(e,`left`,`right`),y:bh(e,`top`,`bottom`)}}function bh(e,t,n){return{min:xh(e,t),max:xh(e,n)}}function xh(e,t){return typeof e==`number`?e:e[t]||0}const Sh=/* @__PURE__ */ new WeakMap;var Ch=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ld(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ed(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Gf(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Po.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Cf(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Y.update(()=>i(e,t),!1,!0),Ql(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Dh(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Y.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new ih(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:eh(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Y.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Eh(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=dh(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Rm(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?ph(n.layoutBox,e):!1,this.elastic=yh(t),r!==this.constraints&&!Rm(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Gf(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=_h(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Rm(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Yu(n,r.root,this.visualElement.getTransformPagePoint()),a=hh(r.layout.layoutBox,i);if(t){let e=t(Au(a));this.hasMutatedConstraints=!!e,e&&(a=ku(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Gf(o=>{if(!Eh(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Ql(this.visualElement,e),n.start(Ll(e,n,0,t,this.visualElement,!1))}stopAnimation(){Gf(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Gf(e=>{if(!Eh(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-J(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Rm(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Gf(e=>{let t=this.getAxisMotionValue(e).get();i[e]=gh({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Gf(t=>{let n=this.getAxisMotionValue(t);if(!Eh(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(J(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Sh.set(this.visualElement,this);let e=this.visualElement.current,t=$m(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&ld(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Rm(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Th(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Y.read(r);let o=ip(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Gf(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=vh,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function wh(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Th(e,t,n){let r=Ad(e,wh(n)),i=Ad(t,wh(n));return()=>{r(),i()}}function Eh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Dh(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Oh=class extends nf{constructor(e){super(e),this.removeGroupControls=Fa,this.removeListeners=Fa,this.controls=new Ch(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Fa}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};const kh=e=>(t,n)=>{e&&Y.update(()=>e(t,n),!1,!0)};var Ah=class extends nf{constructor(){super(...arguments),this.removePointerDownListener=Fa}onPointerDown(e){this.session=new ih(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:eh(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:kh(e),onStart:kh(t),onMove:kh(n),onEnd:(e,t)=>{delete this.session,r&&Y.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=$m(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};let jh=!1;var Mh=class extends c{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),jh&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),dp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),jh=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Y.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Xu.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;jh=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Nh(e){let[n,r]=nm(),i=g(Ca);return t(Mh,{...e,layoutGroup:i,switchLayoutGroup:g(Lm),isPresent:n,safeToRemove:r})}const Ph={pan:{Feature:Ah},drag:{Feature:Oh,ProjectionNode:qp,MeasureLayout:Nh}};function Fh(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Y.postRender(()=>i(t,Zm(t)))}var Ih=class extends nf{mount(){let{current:e}=this.node;e&&(this.unmount=rd(e,(e,t)=>(Fh(this.node,t,`Start`),e=>Fh(this.node,e,`End`))))}unmount(){}},Lh=class extends nf{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Ia(ip(this.node.current,`focus`,()=>this.onFocus()),ip(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Rh(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Y.postRender(()=>i(t,Zm(t)))}var zh=class extends nf{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=gd(e,(e,t)=>(Rh(this.node,t,`Start`),(e,{success:t})=>Rh(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const Bh=/* @__PURE__ */ new WeakMap,Vh=/* @__PURE__ */ new WeakMap,Hh=e=>{let t=Bh.get(e.target);t&&t(e)},Uh=e=>{e.forEach(Hh)};function Wh({root:e,...t}){let n=e||document;Vh.has(n)||Vh.set(n,{});let r=Vh.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Uh,{root:e,...t})),r[i]}function Gh(e,t,n){let r=Wh(t);return Bh.set(e,n),r.observe(e),()=>{Bh.delete(e),r.unobserve(e)}}const Kh={some:0,all:1};var qh=class extends nf{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Kh[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Gh(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Jh(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Jh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Yh={inView:{Feature:qh},tap:{Feature:zh},focus:{Feature:Lh},hover:{Feature:Ih}},Xh={layout:{ProjectionNode:qp,MeasureLayout:Nh}},Zh=/*@__PURE__*/ Km({...Xm,...Yh,...Ph,...Xh},qm);function Qh({children:e,overlayContent:r,className:i=``,overlayClassName:a=``,position:o=`right`,width:s,height:c,showCloseButton:l=!0,onOpen:u,onClose:d,triggerClassName:f=``,backdropClassName:p=``,animationConfig:m={type:`spring`,stiffness:300,damping:30}}){let[h,g]=w(!1),_=()=>{g(!0),u?.()},v=()=>{g(!1),d?.()},y=$h(o),b=eg(o,s,c);return n(`div`,{className:`flex items-center justify-center w-full ${i}`,children:[t(W,{variant:`unstyled`,size:`none`,onClick:_,className:`w-full align-left cursor-pointer ${f}`,children:e}),h&&t(`div`,{className:`z-45 fixed inset-0 bg-black bg-opacity-50 ${p}`,children:n(Zh.div,{...y,transition:m,className:`${b} ${a}`,children:[l&&t(`div`,{className:`absolute top-2 end-2 z-10`,children:t(W,{onClick:v,variant:`primary`,children:t(xt,{})})}),t(`div`,{className:l?`mt-8`:``,children:r})]})})]})}function $h(e){switch(e){case`left`:return{initial:{x:`-100%`},animate:{x:0},exit:{x:`-100%`}};case`right`:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}};case`top`:return{initial:{y:`-100%`},animate:{y:0},exit:{y:`-100%`}};case`bottom`:return{initial:{y:`100%`},animate:{y:0},exit:{y:`100%`}};case`center`:return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}};default:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}}}}function eg(e,t,n){let r=`fixed bg-white shadow-lg p-4 relative`;switch(e){case`left`:return`${r} left-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`right`:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`top`:return`${r} top-[var(--header-height)] start-0 end-0 ${n||`h-80`}`;case`bottom`:return`${r} bottom-0 start-0 end-0 ${n||`h-80`}`;case`center`:return`${r} top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 ${t||`w-96`} ${n||`max-h-96`}`;default:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`}}const tg=`--tailwind-portal`;function ng({children:e}){let n=C(null),[r,i]=w(null);return _(()=>{if(n.current){let e=n.current.ownerDocument,t=e.getElementById(tg);t||(t=e.createElement(`DIV`),t.id=tg,e.body.appendChild(t)),i(t)}},[]),r?E(e,r):t(`span`,{ref:n})}function rg({path:e,maxItems:r=3,className:i,separator:o}){let s=e||[],c=e=>{let n=typeof e.label==`string`&&e.label.length>20?`${e.label.slice(0,17)}...`:e.label;return e.onClick?t(cg,{onClick:e.onClick,href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):e.href?t(cg,{href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):t(lg,{children:n})};if(s.length<=r)return t(ig,{className:B(`w-full flex items-center`,i),children:t(ag,{children:s.map((e,r)=>n(a.Fragment,{children:[t(og,{children:c(e)}),r<s.length-1&&t(ug,{children:o??t(Ve,{className:`cn-rtl-flip`})})]},`crumb-${r}`))})});let l=s.slice(-(r-1));return t(ig,{className:B(`w-full flex items-center`,i),children:n(ag,{children:[t(og,{children:t(dg,{})}),t(ug,{children:o??t(Ve,{className:`cn-rtl-flip`})}),l.map((e,r)=>n(a.Fragment,{children:[t(og,{children:c(e)}),r<l.length-1&&t(ug,{children:o??t(Ve,{className:`cn-rtl-flip`})})]},`crumb-${r}`))]})})}const ig=a.forwardRef(({...e},n)=>t(`nav`,{ref:n,"aria-label":`breadcrumb`,...e}));ig.displayName=`Breadcrumb`;const ag=a.forwardRef(({className:e,...n},r)=>t(`ol`,{ref:r,className:B(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted sm:gap-2.5`,e),...n}));ag.displayName=`BreadcrumbList`;const og=a.forwardRef(({className:e,...n},r)=>t(`li`,{ref:r,className:B(`inline-flex items-center gap-1.5 text-muted`,e),...n}));og.displayName=`BreadcrumbItem`;const sg=a.forwardRef(({asChild:e,className:n,...r},i)=>t(`a`,{ref:i,className:B(`transition-colors hover:text-muted`,n),...r}));sg.displayName=`BreadcrumbLink`;const cg=a.forwardRef(({className:e,href:n,onClick:r,...i},a)=>t(W,{variant:`ghost`,size:`md`,ref:a,className:B(`p-0! hover:underline! hover:bg-background!`,e),onClick:e=>{e.preventDefault(),r&&r(e)},...i}));cg.displayName=`BreadcrumbButton`;const lg=a.forwardRef(({className:e,...n},r)=>t(`span`,{ref:r,"aria-current":`page`,className:B(`font-normal text-foreground`,e),...n}));lg.displayName=`BreadcrumbPage`;const ug=({children:e,className:n,...r})=>t(`li`,{role:`presentation`,"aria-hidden":`true`,className:B(`[&>svg]:w-3.5 [&>svg]:h-3.5`,n),...r,children:e??t(Ve,{className:`cn-rtl-flip`})});ug.displayName=`BreadcrumbSeparator`;const dg=({className:e,...r})=>n(`span`,{role:`presentation`,"aria-hidden":`true`,className:B(`flex h-9 w-9 items-center justify-center`,e),...r,children:[t($e,{className:`h-4 w-4`}),t(`span`,{className:`sr-only`,children:`More`})]});dg.displayName=`BreadcrumbEllipsis`;const fg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`rounded-xl border bg-card text-card-foreground shadow`,e),...n}));fg.displayName=`Card`;const pg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex flex-col p-6`,e),...n}));pg.displayName=`CardHeader`;const mg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`font-semibold leading-none tracking-tight`,e),...n}));mg.displayName=`CardTitle`;const hg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`text-sm text-muted`,e),...n}));hg.displayName=`CardDescription`;const gg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`p-6 pt-0`,e),...n}));gg.displayName=`CardContent`;const _g=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex items-center p-6 pt-0`,e),...n}));_g.displayName=`CardFooter`;var vg=Object.defineProperty,yg=(e,t)=>vg(e,`name`,{value:t,configurable:!0}),bg=`Checkbox`,[xg,Sg]=/* @__PURE__ */ kn(bg),[Cg,wg]=xg(bg);function Tg(e){let{__scopeCheckbox:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=Wr({prop:r,defaultProp:o??!1,onChange:u,caller:bg}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C=!g||!!c||!!g.closest(`form`),w={checked:m,disabled:s,setChecked:h,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:!Pg(o)&&o,isFormControl:C,bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(Cg,{scope:n,...w,children:Ng(p)?p(w):i})}yg(Tg,`CheckboxProvider`);var Eg=`CheckboxTrigger`,Dg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yg(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...i},o){let{control:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=wg(Eg,e),v=z(o,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?.form;if(e){let t=/* @__PURE__ */ yg(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,p]),/* @__PURE__ */ t(U.button,{type:`button`,role:`checkbox`,"aria-checked":Pg(u)?`mixed`:u,"aria-required":d,"data-state":Fg(u),"data-disabled":l?``:void 0,disabled:l,value:c,...i,ref:v,onKeyDown:V(n,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:V(r,e=>{h(),p(e=>Pg(e)?!0:!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`CheckboxTrigger`)),Og=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yg(function(r,i){let{__scopeCheckbox:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return/* @__PURE__ */ t(Tg,{__scopeCheckbox:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(Dg,{...m,ref:i,__scopeCheckbox:a}),r&&/* @__PURE__ */ t(Mg,{__scopeCheckbox:a})]})})},`Checkbox`)),kg=`CheckboxIndicator`,Ag=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yg(function(e,n){let{__scopeCheckbox:r,forceMount:i,...a}=e,o=wg(kg,r);return/* @__PURE__ */ t(Ar,{present:i||Pg(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(U.span,{"data-state":Fg(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),jg=`CheckboxBubbleInput`,Mg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yg(function({__scopeCheckbox:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=wg(jg,e),v=z(i,_),y=ir(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});e.indeterminate=Pg(l),n.call(e,!Pg(l)&&l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(!Pg(l)&&l);return/* @__PURE__ */ t(U.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:V(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Ng(e){return typeof e==`function`}yg(Ng,`isFunction`);function Pg(e){return e===`indeterminate`}yg(Pg,`isIndeterminate`);function Fg(e){return Pg(e)?`indeterminate`:e?`checked`:`unchecked`}yg(Fg,`getState`);const Ig=a.forwardRef(({className:e,...n},r)=>t(Og,{ref:r,className:B(`peer size-4 shrink-0 rounded-sm border border-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white`,e),...n,children:t(Ag,{className:B(`flex items-center justify-center text-current`),children:t(L,{className:`size-4`})})}));Ig.displayName=Og.displayName;var Lg=Object.defineProperty,Rg=(e,t)=>Lg(e,`name`,{value:t,configurable:!0}),zg=`Collapsible`,[Bg,Vg]=/* @__PURE__ */ kn(zg),[Hg,Ug]=Bg(zg),Wg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Rg(function(e,n){let{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:s,onOpenChange:c,...l}=e,[u,d]=Wr({prop:i,defaultProp:o??!1,onChange:c,caller:zg});return/* @__PURE__ */ t(Hg,{scope:r,disabled:s,contentId:H(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:/* @__PURE__ */ t(U.div,{"data-state":Xg(u),"data-disabled":s?``:void 0,...l,ref:n})})},`Collapsible`)),Gg=`CollapsibleTrigger`,Kg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Rg(function(e,n){let{__scopeCollapsible:r,...i}=e,a=Ug(Gg,r);return/* @__PURE__ */ t(U.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":Xg(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...i,ref:n,onClick:V(e.onClick,a.onOpenToggle)})},`CollapsibleTrigger`)),qg=`CollapsibleContent`,Jg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Rg(function(e,n){let{forceMount:r,...i}=e,a=Ug(qg,e.__scopeCollapsible);return/* @__PURE__ */ t(Ar,{present:r||a.open,children:({present:e})=>/* @__PURE__ */ t(Yg,{...i,ref:n,present:e})})},`CollapsibleContent`)),Yg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Rg(function(e,n){let{__scopeCollapsible:r,present:i,children:o,...s}=e,c=Ug(qg,r),[l,u]=a.useState(i),d=a.useRef(null),f=z(n,d),p=a.useRef(0),m=p.current,h=a.useRef(0),g=h.current,_=c.open||l,v=a.useRef(_),y=a.useRef(void 0);return a.useEffect(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),jn(()=>{let e=d.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();p.current=t.height,h.current=t.width,v.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),u(i)}},[c.open,i]),/* @__PURE__ */ t(U.div,{"data-state":Xg(c.open),"data-disabled":c.disabled?``:void 0,id:c.contentId,hidden:!_,...s,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:_&&o})},`CollapsibleContentImpl`));function Xg(e){return e?`open`:`closed`}Rg(Xg,`getState`);var Zg=Wg,Qg=Kg,$g=Jg;function e_({...e}){return t(Zg,{"data-slot":`collapsible`,...e})}function t_({...e}){return t(Qg,{"data-slot":`collapsible-trigger`,...e})}function n_({...e}){return t($g,{"data-slot":`collapsible-content`,...e})}var r_=1,i_=.9,a_=.8,o_=.17,s_=.1,c_=.999,l_=.9999,u_=.99,d_=/[\\\/_+.#"@\[\(\{&]/,f_=/[\\\/_+.#"@\[\(\{&]/g,p_=/[\s-]/,m_=/[\s-]/g;function h_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?r_:u_;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=h_(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=r_:d_.test(e.charAt(l-1))?(d*=a_,p=e.slice(i,l-1).match(f_),p&&i>0&&(d*=c_**+p.length)):p_.test(e.charAt(l-1))?(d*=i_,m=e.slice(i,l-1).match(m_),m&&i>0&&(d*=c_**+m.length)):(d*=o_,i>0&&(d*=c_**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=l_)),(d<s_&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=h_(e,t,n,r,l+1,a+2,o),f*s_>d&&(d=f*s_)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function g_(e){return e.toLowerCase().replace(m_,` `)}function __(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,h_(e,t,g_(e),g_(t),0,0,{})}var v_=Object.defineProperty,y_=(e,t)=>v_(e,`name`,{value:t,configurable:!0}),b_=`Dialog`,[x_,S_]=/* @__PURE__ */ kn(b_),[C_,w_]=x_(b_),T_=/* @__PURE__ */ y_(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,l=a.useRef(null),u=a.useRef(null),[d,f]=Wr({prop:i,defaultProp:o??!1,onChange:s,caller:b_}),[p,m]=a.useState(0),[h,g]=a.useState(0);return/* @__PURE__ */ t(C_,{scope:n,triggerRef:l,contentRef:u,contentId:H(),titleId:H(),descriptionId:H(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(e=>!e),[f]),modal:c,children:r})},`Dialog`),E_=`DialogTrigger`,D_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let{__scopeDialog:r,...i}=e,a=w_(E_,r),o=z(n,a.triggerRef);return/* @__PURE__ */ t(U.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":q_(a.open),...i,ref:o,onClick:V(e.onClick,a.onOpenToggle)})},`DialogTrigger`)),O_=`DialogPortal`,[k_,A_]=x_(O_,{forceMount:void 0}),j_=/* @__PURE__ */ y_(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=w_(O_,n);return/* @__PURE__ */ t(k_,{scope:n,forceMount:r,children:a.Children.map(i,e=>/* @__PURE__ */ t(Ar,{present:r||s.open,children:/* @__PURE__ */ t(Er,{asChild:!0,container:o,children:e})}))})},`DialogPortal`),M_=`DialogOverlay`,N_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let r=A_(M_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=w_(M_,e.__scopeDialog);return o.modal?/* @__PURE__ */ t(Ar,{present:i||o.open,children:/* @__PURE__ */ t(F_,{...a,ref:n})}):null},`DialogOverlay`)),P_=/* @__PURE__ */ an(`DialogOverlay.RemoveScroll`),F_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let{__scopeDialog:r,...i}=e,a=w_(M_,r),o=z(n,N());return/* @__PURE__ */ t(ue,{as:P_,allowPinchZoom:!0,shards:[a.contentRef],children:/* @__PURE__ */ t(U.div,{"data-state":q_(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),I_=`DialogContent`,L_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let r=A_(I_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=w_(I_,e.__scopeDialog);return/* @__PURE__ */ t(Ar,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(R_,{...a,ref:n}):/* @__PURE__ */ t(z_,{...a,ref:n})})},`DialogContent`)),R_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let r=w_(I_,e.__scopeDialog),i=a.useRef(null),o=z(n,r.contentRef,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(B_,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),z_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let r=w_(I_,e.__scopeDialog),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(B_,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&o.current&&t.preventDefault()}})},`DialogContentNonModal`)),B_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=w_(I_,i);return le(),/* @__PURE__ */ t(e,{children:/* @__PURE__ */ t(ce,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:/* @__PURE__ */ t(M,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":q_(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),V_=`DialogTitle`,H_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let{__scopeDialog:r,...i}=e,a=w_(V_,r),{setTitleCount:o}=a;return jn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(U.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),U_=`DialogDescription`,W_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let{__scopeDialog:r,...i}=e,a=w_(U_,r),{setDescriptionCount:o}=a;return jn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(U.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),G_=`DialogClose`,K_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ y_(function(e,n){let{__scopeDialog:r,...i}=e,a=w_(G_,r);return/* @__PURE__ */ t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function q_(e){return e?`open`:`closed`}y_(q_,`getState`);var J_=`[cmdk-group=""]`,Y_=`[cmdk-group-items=""]`,X_=`[cmdk-group-heading=""]`,Z_=`[cmdk-item=""]`,Q_=`${Z_}:not([aria-disabled="true"])`,$_=`cmdk-item-select`,ev=`data-value`,tv=(e,t,n)=>__(e,t,n),nv=a.createContext(void 0),rv=()=>a.useContext(nv),iv=a.createContext(void 0),av=()=>a.useContext(iv),ov=a.createContext(void 0),sv=a.forwardRef((e,t)=>{let n=xv(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=xv(()=>/* @__PURE__ */ new Set),i=xv(()=>/* @__PURE__ */ new Map),o=xv(()=>/* @__PURE__ */ new Map),s=xv(()=>/* @__PURE__ */ new Set),c=yv(e),{label:l,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=H(),b=H(),x=H(),S=a.useRef(null),C=wv();bv(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),bv(()=>{C(6,A)},[]);let w=a.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),c.current?.value!==void 0){let e=t??``;(o=(a=c.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),T=a.useMemo(()=>({value:(e,t,r)=>{t!==o.current.get(e)?.value&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,/* @__PURE__ */ new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,/* @__PURE__ */ new Set),()=>{o.current.delete(e),i.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e[`aria-label`],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=c.current?.filter??tv;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Y_);t?t.appendChild(e.parentElement===t?e:e.closest(`${Y_} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Y_} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${J_}[${ev}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(ev);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=/* @__PURE__ */ new Set;let e=0;for(let t of r.current){let r=E(o.current.get(t)?.value??``,o.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(J_)?.querySelector(X_))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${Z_}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(Q_)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(ev))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=c.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(ev))}function ee(e){let t=j()?.closest(J_),n;for(;t&&!n;)t=e>0?_v(t,J_):vv(t,J_),n=t?.querySelector(Q_);n?w.setState(`value`,n.getAttribute(ev)):P(e)}let te=()=>N(M().length-1),F=e=>{e.preventDefault(),e.metaKey?te():e.altKey?ee(1):P(1)},ne=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?ee(-1):P(-1)};return a.createElement(U.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&F(e);break;case`ArrowDown`:F(e);break;case`p`:case`k`:_&&e.ctrlKey&&ne(e);break;case`ArrowUp`:ne(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),te();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event($_);t.dispatchEvent(e)}}}}},a.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Dv},l),Ev(e,e=>a.createElement(iv.Provider,{value:w},a.createElement(nv.Provider,{value:T},e))))}),cv=a.forwardRef((e,t)=>{let n=H(),r=a.useRef(null),i=a.useContext(ov),o=rv(),s=yv(e),c=s.current?.forceMount??i?.forceMount;bv(()=>{if(!c)return o.item(n,i?.id)},[c]);let l=Cv(n,r,[e.value,e.children,r],e.keywords),u=av(),d=Sv(e=>e.value&&e.value===l.current),f=Sv(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);a.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener($_,p),()=>t.removeEventListener($_,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return a.createElement(U.div,{ref:tn(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||o.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),lv=a.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=H(),c=a.useRef(null),l=a.useRef(null),u=H(),d=rv(),f=Sv(e=>i||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));bv(()=>d.group(s),[]),Cv(s,c,[e.value,e.heading,l]);let p=a.useMemo(()=>({id:s,forceMount:i}),[i]);return a.createElement(U.div,{ref:tn(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},n&&a.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Ev(e,e=>a.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},a.createElement(ov.Provider,{value:p},e))))}),uv=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=a.useRef(null),o=Sv(e=>!e.search);return!n&&!o?null:a.createElement(U.div,{ref:tn(i,t),...r,"cmdk-separator":``,role:`separator`})}),dv=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=av(),s=Sv(e=>e.search),c=Sv(e=>e.selectedItemId),l=rv();return a.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),a.createElement(U.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:s,onChange:e=>{i||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),fv=a.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,o=a.useRef(null),s=a.useRef(null),c=Sv(e=>e.selectedItemId),l=rv();return a.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),a.createElement(U.div,{ref:tn(o,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Ev(e,e=>a.createElement(`div`,{ref:tn(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),pv=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...c}=e;return a.createElement(T_,{open:n,onOpenChange:r},a.createElement(j_,{container:s},a.createElement(N_,{"cmdk-overlay":``,className:i}),a.createElement(L_,{"aria-label":e.label,"cmdk-dialog":``,className:o},a.createElement(sv,{ref:t,...c}))))}),mv=a.forwardRef((e,t)=>Sv(e=>e.filtered.count===0)?a.createElement(U.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),hv=a.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...o}=e;return a.createElement(U.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Ev(e,e=>a.createElement(`div`,{"aria-hidden":!0},e)))}),gv=Object.assign(sv,{List:fv,Item:cv,Input:dv,Group:lv,Separator:uv,Dialog:pv,Empty:mv,Loading:hv});function _v(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function vv(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function yv(e){let t=a.useRef(e);return bv(()=>{t.current=e}),t}var bv=typeof window>`u`?a.useEffect:a.useLayoutEffect;function xv(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function Sv(e){let t=av(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function Cv(e,t,n,r=[]){let i=a.useRef(),o=rv();return bv(()=>{var a;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());o.value(e,s,c),(a=t.current)==null||a.setAttribute(ev,s),i.current=s}),i}var wv=()=>{let[e,t]=a.useState(),n=xv(()=>/* @__PURE__ */ new Map);return bv(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Tv(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Ev({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(Tv(t),{ref:t.ref},n(t.props.children)):n(t)}var Dv={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Ov({children:e}){return t(`span`,{style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`},children:e})}const kv=d(!1);function Av(){return!!g(kv)}function jv({children:e}){return t(kv.Provider,{value:!0,children:e})}function Mv({className:e,children:r,isOpen:i,onClose:a,description:o=`Modal Description`,noCloseButton:s=!1,allowOverflow:c=!1,disableCloseOnClickOutside:l=!1,size:u=`md`,action:d}){let f=e=>{e||a()};function p(){switch(u){case`sm`:return`max-w-[20vw]`;case`md`:return`max-w-[60vw] lg:max-w-[40vw]`;case`lg`:return`max-w-[80vw] md:max-w-[60vw]`;case`xl`:return`max-w-[95vw] lg:max-w-[80vw]`;case`full`:return`h-[calc(100vh-2rem)] max-w-[calc(100vw-2rem)]`;default:return`max-w-[60vw] lg:max-w-[40vw]`}}return n(Iv,{open:i,onOpenChange:e=>{(!l||e)&&f(e)},children:[c&&t(Bv,{className:`z-50 fixed inset-0 bg-black/80`}),t(Ov,{children:t(Hv,{children:o})}),n(Vv,{className:B(`min-h-20 p-4`,`fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 sm:rounded-lg`,p(),e),children:[t(`div`,{className:`top-4 end-4 absolute`,children:n(`div`,{className:`flex gap-2`,children:[d&&d,!s&&t(zv,{onClick:()=>f(!1),asChild:!0,autoFocus:!1,children:t(W,{variant:`outline`,title:`Close`,className:`data-[state=open]:bg-muted opacity-70 hover:opacity-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-ring ring-offset-background focus:ring-offset-2 data-[state=open]:text-muted transition-opacity disabled:pointer-events-none`,children:t(xt,{className:`size-4`})})})]})}),t(jv,{children:r})]})]})}const Nv=({children:e,show:r=!0,className:i,description:a,showDivider:o=!1,...s})=>r?n(Uv,{className:B(o?`border-b-solid border-b border-b-1 pb-2 mb-4`:``,`text-lg font-semibold leading-6 tracking-tight`,{"py-2":!a},i),...s,children:[e,a&&t(Hv,{className:`text-sm !font-normal text-muted pb-2`,children:a})]}):n(Ov,{children:[t(Uv,{children:e}),a&&t(Hv,{children:a})]}),Pv=({children:e,className:n,...r})=>t(`div`,{className:B(`text-sm max-h-[80vh] overflow-y-auto`,n),...r,children:e}),Fv=({align:e=`right`,children:n,className:r,...i})=>t(`div`,{className:B(`w-full flex py-3 sm:py-2 sm:flex sm:flex-row-reverse sm:flex-row sm:justify-end gap-2`,{left:`justify-start`,center:`justify-center`,right:`justify-end`}[e],r),...i,children:n}),Iv=T_,Lv=D_,Rv=j_,zv=K_,Bv=a.forwardRef(({className:e,...n},r)=>t(N_,{ref:r,className:B(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...n}));Bv.displayName=N_.displayName;const Vv=a.forwardRef(({className:e,children:r,...i},a)=>{let o=zi();return n(Rv,{container:o,children:[t(Bv,{}),t(L_,{ref:a,className:B(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...i,children:r})]})});Vv.displayName=L_.displayName;const Hv=a.forwardRef(({className:e,...n},r)=>t(W_,{ref:r,className:B(`text-sm text-muted`,e),...n}));Hv.displayName=W_.displayName;const Uv=a.forwardRef(({className:e,...n},r)=>t(H_,{ref:r,className:B(`text-lg font-semibold leading-none tracking-tight`,e),...n}));Uv.displayName=H_.displayName;const Wv=a.forwardRef(({className:e,...n},r)=>t(gv,{ref:r,className:B(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...n}));Wv.displayName=gv.displayName;const Gv=({children:e,...n})=>t(Iv,{...n,children:t(Vv,{className:`shadow-lg p-0 overflow-hidden`,children:t(Wv,{className:`[&_[cmdk-group]]:px-2 [&_[cmdk-item]]:px-2 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:w-5 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,children:e})})}),Kv=a.forwardRef(({className:e,...r},i)=>n(`div`,{className:`flex items-center px-3 border-b`,"cmdk-input-wrapper":``,children:[t(pt,{className:`opacity-50 size-4 shrink-0`}),t(gv.Input,{ref:i,className:B(`focus:ring-0`,`border-0 flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted disabled:cursor-not-allowed disabled:opacity-50`,e),...r})]}));Kv.displayName=gv.Input.displayName;const qv=a.forwardRef(({className:e,...n},r)=>t(gv.List,{ref:r,className:B(`overflow-y-auto overflow-x-hidden`,e),...n}));qv.displayName=gv.List.displayName;const Jv=a.forwardRef((e,n)=>t(gv.Empty,{ref:n,className:`py-2 text-sm text-center`,...e}));Jv.displayName=gv.Empty.displayName;const Yv=a.forwardRef(({className:e,...n},r)=>t(gv.Group,{ref:r,className:B(`overflow-y-auto overflow-x-hidden p-1 text-foreground`,`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,e),...n}));Yv.displayName=gv.Group.displayName;const Xv=a.forwardRef(({className:e,...n},r)=>t(gv.Separator,{ref:r,className:B(`-mx-1 h-px bg-border`,e),...n}));Xv.displayName=gv.Separator.displayName;const Zv=a.forwardRef(({className:e,...n},r)=>t(gv.Item,{ref:r,className:B(`hover:bg-muted cursor-pointer relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-muted data-[selected=true]:text-muted data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,e),...n}));Zv.displayName=gv.Item.displayName;const Qv=({className:e,...n})=>t(`span`,{className:B(`ms-auto text-xs tracking-widest text-muted`,e),...n});Qv.displayName=`CommandShortcut`;var $v=Object.defineProperty,ey=(e,t)=>$v(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
245
|
-
function
|
|
246
|
-
function sy(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ kn(n),[o,s]=r(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new ry,setItemMap:/* @__PURE__ */ ey(()=>void 0,`setItemMap`)}),c=/* @__PURE__ */ ey(({state:e,...n})=>e?/* @__PURE__ */ t(u,{...n,state:e}):/* @__PURE__ */ t(l,{...n}),`CollectionProvider`);c.displayName=n;let l=/* @__PURE__ */ ey(e=>{let n=_();return/* @__PURE__ */ t(u,{...e,state:n})},`CollectionInit`);l.displayName=n+`Init`;let u=/* @__PURE__ */ ey(e=>{let{scope:n,children:r,state:i}=e,s=a.useRef(null),[c,l]=a.useState(null),u=z(s,l),[d,f]=i;return a.useEffect(()=>{if(!c)return;let e=dy(()=>{});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c]),/* @__PURE__ */ t(o,{scope:n,itemMap:d,setItemMap:f,collectionRef:u,collectionRefObject:s,collectionElement:c,children:r})},`CollectionProviderImpl`);u.displayName=n+`Impl`;let d=e+`CollectionSlot`,f=/* @__PURE__ */ an(d),p=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=z(n,s(d,r).collectionRef);return/* @__PURE__ */ t(f,{ref:a,children:i})});p.displayName=d;let m=e+`CollectionItemSlot`,h=/* @__PURE__ */ an(m),g=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),[l,u]=a.useState(null),d=z(n,c,u),{setItemMap:f}=s(m,r),p=a.useRef(o);cy(p.current,o)||(p.current=o);let g=p.current;return a.useEffect(()=>{let e=g;return f(t=>l?t.has(l)?t.set(l,{...e,element:l}).toSorted(uy):(t.set(l,{...e,element:l}),t.toSorted(uy)):t),()=>{f(e=>!l||!e.has(l)?e:(e.delete(l),new ry(e)))}},[l,g,f]),/* @__PURE__ */ t(h,{"data-radix-collection-item":``,ref:d,children:i})});g.displayName=m;function _(){return a.useState(new ry)}ey(_,`useInitCollection`);function v(t){let{itemMap:n}=s(e+`CollectionConsumer`,t);return n}return ey(v,`useCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:i,useCollection:v,useInitCollection:_}]}ey(sy,`createCollection`);function cy(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}ey(cy,`shallowEqual`);function ly(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ey(ly,`isElementPreceding`);function uy(e,t){return!e[1].element||!t[1].element?0:ly(e[1].element,t[1].element)?-1:1}ey(uy,`sortByDocumentPosition`);function dy(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}ey(dy,`getChildListObserver`);var fy=Object.defineProperty,py=(e,t)=>fy(e,`name`,{value:t,configurable:!0}),my=!1;function hy(){let[e,t]=a.useState(my);return a.useEffect(()=>{my||(my=!0,t(!0))},[]),e}py(hy,`useIsHydrated`);var gy=a.useSyncExternalStore;function _y(){return()=>{}}py(_y,`subscribe`);function vy(){return gy(_y,()=>!0,()=>!1)}py(vy,`useIsHydratedModern`);var yy=typeof gy==`function`?vy:hy,by=Object.defineProperty,xy=(e,t)=>by(e,`name`,{value:t,configurable:!0}),Sy=`rovingFocusGroup.onEntryFocus`,Cy={bubbles:!1,cancelable:!0},wy=`RovingFocusGroup`,[Ty,Ey,Dy]=/* @__PURE__ */ ty(wy),[Oy,ky]=/* @__PURE__ */ kn(wy,[Dy]),[Ay,jy]=Oy(wy),My=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ xy(function(e,n){return/* @__PURE__ */ t(Ty.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Ty.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Ny,{...e,ref:n})})})},`RovingFocusGroup`)),Ny=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ xy(function(e,n){let{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=a.useRef(null),h=z(n,m),g=fe(s),[_,v]=Wr({prop:c,defaultProp:l??null,onChange:u,caller:wy}),[y,b]=a.useState(!1),x=tr(d),S=Ey(r),C=a.useRef(!1),[w,T]=a.useState(0);return a.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Sy,x),()=>e.removeEventListener(Sy,x)},[x]),/* @__PURE__ */ t(Ay,{scope:r,orientation:i,dir:g,loop:o,currentTabStopId:_,onItemFocus:a.useCallback(e=>v(e),[v]),onItemShiftTab:a.useCallback(()=>b(!0),[]),onFocusableItemAdd:a.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>T(e=>e-1),[]),children:/* @__PURE__ */ t(U.div,{tabIndex:y||w===0?-1:0,"data-orientation":i,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(Sy,Cy);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);zy([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}C.current=!1}),onBlur:V(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),Py=`RovingFocusGroupItem`,Fy=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ xy(function(e,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=H(),d=s||u,f=jy(Py,r),p=f.currentTabStopId===d,m=Ey(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f,v=yy();return jn(()=>{if(v&&i)return h(),()=>g()},[v,i,h,g]),a.useEffect(()=>{if(!v&&i)return h(),()=>g()},[v,i,h,g]),/* @__PURE__ */ t(Ty.ItemSlot,{scope:r,id:d,focusable:i,active:o,children:/* @__PURE__ */ t(U.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:n,onMouseDown:V(e.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:V(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:V(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ry(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?By(n,r+1):n.slice(r+1)}setTimeout(()=>zy(n))}}),children:typeof c==`function`?c({isCurrentTabStop:p,hasTabStop:_!=null}):c})})},`RovingFocusGroupItem`)),Iy={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Ly(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}xy(Ly,`getDirectionAwareKey`);function Ry(e,t,n){let r=Ly(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Iy[r]}xy(Ry,`getFocusIntent`);function zy(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}xy(zy,`focusFirst`);function By(e,t){return e.map((n,r)=>e[(t+r)%e.length])}xy(By,`wrapArray`);var Vy=My,Hy=Fy,Uy=Object.defineProperty,X=(e,t)=>Uy(e,`name`,{value:t,configurable:!0}),Wy=[`Enter`,` `],Gy=[`ArrowDown`,`PageUp`,`Home`],Ky=[`ArrowUp`,`PageDown`,`End`],qy=[...Gy,...Ky],Jy={ltr:[...Wy,`ArrowRight`],rtl:[...Wy,`ArrowLeft`]},Yy={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Xy=`Menu`,[Zy,Qy,$y]=/* @__PURE__ */ ty(Xy),[eb,tb]=/* @__PURE__ */ kn(Xy,[$y,lr,ky]),nb=lr(),rb=ky(),[ib,ab]=eb(Xy),[ob,sb]=eb(Xy),cb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:s,modal:c=!0}=e,l=nb(n),[u,d]=a.useState(null),f=a.useRef(!1),p=tr(s),m=fe(o);return a.useEffect(()=>{let e=/* @__PURE__ */ X(()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=/* @__PURE__ */ X(()=>f.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),a.useEffect(()=>{if(!r)return;let e=/* @__PURE__ */ X(()=>p(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[r,p]),/* @__PURE__ */ t(Sr,{...l,children:/* @__PURE__ */ t(ib,{scope:n,open:r,onOpenChange:p,content:u,onContentChange:d,children:/* @__PURE__ */ t(ob,{scope:n,onClose:a.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:c,children:i})})})},`Menu`),lb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e,a=nb(r);return/* @__PURE__ */ t(Cr,{...a,...i,ref:n})},`MenuAnchor`)),ub=`MenuPortal`,[db,fb]=eb(ub,{forceMount:void 0}),pb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,forceMount:r,children:i,container:a}=e,o=ab(ub,n);return/* @__PURE__ */ t(db,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Ar,{present:r||o.open,children:/* @__PURE__ */ t(Er,{asChild:!0,container:a,children:i})})})},`MenuPortal`),mb=`MenuContent`,[hb,gb]=eb(mb),_b=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=fb(mb,e.__scopeMenu),{forceMount:i=r.forceMount,...a}=e,o=ab(mb,e.__scopeMenu),s=sb(mb,e.__scopeMenu);return/* @__PURE__ */ t(Zy.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Ar,{present:i||o.open,children:/* @__PURE__ */ t(Zy.Slot,{scope:e.__scopeMenu,children:s.modal?/* @__PURE__ */ t(vb,{...a,ref:n}):/* @__PURE__ */ t(yb,{...a,ref:n})})})})},`MenuContent`)),vb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ab(mb,e.__scopeMenu),i=a.useRef(null),o=z(n,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(xb,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentModal`)),yb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ab(mb,e.__scopeMenu);return/* @__PURE__ */ t(xb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentNonModal`)),bb=/* @__PURE__ */ an(`MenuContent.ScrollLock`),xb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=ab(mb,r),y=sb(mb,r),b=nb(r),x=rb(r),S=Qy(r),[C,w]=a.useState(null),T=a.useRef(null),E=z(n,T,v.onContentChange),D=a.useRef(0),O=a.useRef(``),k=a.useRef(0),A=a.useRef(null),j=a.useRef(`right`),N=a.useRef(0),P=g?ue:a.Fragment,ee=g?{as:bb,allowPinchZoom:!0}:void 0,te=/* @__PURE__ */ X(e=>{let t=O.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Qb(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(/* @__PURE__ */ X((function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`))(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);a.useEffect(()=>()=>window.clearTimeout(D.current),[]),le();let F=a.useCallback(e=>j.current===A.current?.side&&ex(e,A.current?.area),[]);return/* @__PURE__ */ t(hb,{scope:r,searchRef:O,onItemEnter:a.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:a.useCallback(e=>{F(e)||(T.current?.focus(),w(null))},[F]),onTriggerLeave:a.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:k,onPointerGraceIntentChange:a.useCallback(e=>{A.current=e},[]),children:/* @__PURE__ */ t(P,{...ee,children:/* @__PURE__ */ t(ce,{asChild:!0,trapped:o,onMountAutoFocus:V(s,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:/* @__PURE__ */ t(Vy,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:i,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:V(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */ t(wr,{role:`menu`,"aria-orientation":`vertical`,"data-state":qb(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:E,style:{outline:`none`,..._.style},onKeyDown:V(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=T.current;if(e.target!==i||!qy.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);Ky.includes(e.key)&&a.reverse(),Xb(a)}),onBlur:V(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:V(e.onPointerMove,tx(e=>{let t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>N.current?`right`:`left`;j.current=t,N.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),Sb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{role:`group`,...i,ref:n})},`MenuGroup`)),Cb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{...i,ref:n})},`MenuLabel`)),wb=`MenuItem`,Tb=`menu.itemSelect`,Eb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{disabled:r=!1,onSelect:i,...o}=e,s=a.useRef(null),c=sb(wb,e.__scopeMenu),l=gb(wb,e.__scopeMenu),u=z(n,s),d=a.useRef(!1),f=/* @__PURE__ */ X(()=>{let e=s.current;if(!r&&e){let t=new CustomEvent(Tb,{bubbles:!0,cancelable:!0});e.addEventListener(Tb,e=>i?.(e),{once:!0}),Qn(e,t),t.defaultPrevented?d.current=!1:c.onClose()}},`handleSelect`);return/* @__PURE__ */ t(Db,{...o,ref:u,disabled:r,onClick:V(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:V(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:V(e.onKeyDown,e=>{r||e.target!==e.currentTarget||(l.searchRef.current===``||e.key!==` `)&&Wy.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Db=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,disabled:i=!1,textValue:o,...s}=e,c=gb(wb,r),l=rb(r),u=a.useRef(null),d=z(n,u),[f,p]=a.useState(!1),[m,h]=a.useState(``);return a.useEffect(()=>{let e=u.current;e&&h((e.textContent??``).trim())},[s.children]),/* @__PURE__ */ t(Zy.ItemSlot,{scope:r,disabled:i,textValue:o??m,children:/* @__PURE__ */ t(Hy,{asChild:!0,...l,focusable:!i,children:/* @__PURE__ */ t(U.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...s,ref:d,onPointerMove:V(e.onPointerMove,tx(e=>{i?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,tx(e=>c.onItemLeave(e))),onFocus:V(e.onFocus,()=>p(!0)),onBlur:V(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),Ob=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{checked:r=!1,onCheckedChange:i,...a}=e;return/* @__PURE__ */ t(Fb,{scope:e.__scopeMenu,checked:r,children:/* @__PURE__ */ t(Eb,{role:`menuitemcheckbox`,"aria-checked":Jb(r)?`mixed`:r,...a,ref:n,"data-state":Yb(r),onSelect:V(a.onSelect,()=>i?.(Jb(r)?!0:!r),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[kb,Ab]=eb(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ X(()=>{},`onValueChange`)}),jb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,onValueChange:i,...a}=e,o=tr(i);return/* @__PURE__ */ t(kb,{scope:e.__scopeMenu,value:r,onValueChange:o,children:/* @__PURE__ */ t(Sb,{...a,ref:n})})},`MenuRadioGroup`)),Mb=`MenuRadioItem`,Nb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,...i}=e,a=Ab(Mb,e.__scopeMenu),o=r===a.value;return/* @__PURE__ */ t(Fb,{scope:e.__scopeMenu,checked:o,children:/* @__PURE__ */ t(Eb,{role:`menuitemradio`,"aria-checked":o,...i,ref:n,"data-state":Yb(o),onSelect:V(i.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Pb=`MenuItemIndicator`,[Fb,Ib]=eb(Pb,{checked:!1}),Lb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,forceMount:i,...a}=e,o=Ib(Pb,r);return/* @__PURE__ */ t(Ar,{present:i||Jb(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(U.span,{...a,ref:n,"data-state":Yb(o.checked)})})},`MenuItemIndicator`)),Rb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:n})},`MenuSeparator`)),zb=`MenuSub`,[Bb,Vb]=eb(zb),Hb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,children:r,open:i=!1,onOpenChange:o}=e,s=ab(zb,n),c=nb(n),[l,u]=a.useState(null),[d,f]=a.useState(null),p=tr(o);return a.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),/* @__PURE__ */ t(Sr,{...c,children:/* @__PURE__ */ t(ib,{scope:n,open:i,onOpenChange:p,content:d,onContentChange:f,children:/* @__PURE__ */ t(Bb,{scope:n,contentId:H(),triggerId:H(),trigger:l,onTriggerChange:u,children:r})})})},`MenuSub`),Ub=`MenuSubTrigger`,Wb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ab(Ub,e.__scopeMenu),i=sb(Ub,e.__scopeMenu),o=Vb(Ub,e.__scopeMenu),s=gb(Ub,e.__scopeMenu),c=a.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=a.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);a.useEffect(()=>f,[f]),a.useEffect(()=>{let e=l.current;return()=>{window.clearTimeout(e),u(null)}},[l,u]);let p=z(n,o.onTriggerChange);return/* @__PURE__ */ t(lb,{asChild:!0,...d,children:/* @__PURE__ */ t(Db,{id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":qb(r.open),...e,ref:p,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:V(e.onPointerMove,tx(t=>{s.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:V(e.onPointerLeave,tx(e=>{f();let t=r.content?.getBoundingClientRect();if(t){let n=r.content?.dataset.side,i=n===`right`,a=i?-5:5,o=t[i?`left`:`right`],c=t[i?`right`:`left`];s.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:o,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:o,y:t.bottom}],side:n}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:V(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(s.searchRef.current===``||t.key!==` `)&&Jy[i.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Gb=`MenuSubContent`,Kb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=fb(mb,e.__scopeMenu),{forceMount:i=r.forceMount,align:o=`start`,...s}=e,c=ab(mb,e.__scopeMenu),l=sb(mb,e.__scopeMenu),u=Vb(Gb,e.__scopeMenu),d=a.useRef(null),f=z(n,d);return/* @__PURE__ */ t(Zy.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Ar,{present:i||c.open,children:/* @__PURE__ */ t(Zy.Slot,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(xb,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:o,side:l.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:V(e.onFocusOutside,e=>{e.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:V(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:V(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Yy[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function qb(e){return e?`open`:`closed`}X(qb,`getOpenState`);function Jb(e){return e===`indeterminate`}X(Jb,`isIndeterminate`);function Yb(e){return Jb(e)?`indeterminate`:e?`checked`:`unchecked`}X(Yb,`getCheckedState`);function Xb(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(Xb,`focusFirst`);function Zb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(Zb,`wrapArray`);function Qb(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Zb(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}X(Qb,`getNextMatch`);function $b(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}X($b,`isPointInPolygon`);function ex(e,t){return t?$b({x:e.clientX,y:e.clientY},t):!1}X(ex,`isPointerInGraceArea`);function tx(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(tx,`whenMouse`);var nx=cb,rx=lb,ix=pb,ax=_b,ox=Sb,sx=Cb,cx=Eb,lx=Ob,ux=jb,dx=Nb,fx=Lb,px=Rb,mx=Hb,hx=Wb,gx=Kb,_x=Object.defineProperty,vx=(e,t)=>_x(e,`name`,{value:t,configurable:!0}),yx=`DropdownMenu`,[bx,xx]=/* @__PURE__ */ kn(yx,[tb]),Sx=tb(),[Cx,wx]=bx(yx),Tx=/* @__PURE__ */ vx(e=>{let{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=Sx(n),d=a.useRef(null),[f,p]=Wr({prop:o,defaultProp:s??!1,onChange:c,caller:yx});return/* @__PURE__ */ t(Cx,{scope:n,triggerId:H(),triggerRef:d,contentId:H(),open:f,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:/* @__PURE__ */ t(nx,{...u,open:f,onOpenChange:p,dir:i,modal:l,children:r})})},`DropdownMenu`),Ex=`DropdownMenuTrigger`,Dx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=e,o=wx(Ex,r),s=Sx(r),c=z(n,o.triggerRef);return/* @__PURE__ */ t(rx,{asChild:!0,...s,children:/* @__PURE__ */ t(U.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:c,onPointerDown:V(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:V(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Ox=/* @__PURE__ */ vx(e=>{let{__scopeDropdownMenu:n,...r}=e,i=Sx(n);return/* @__PURE__ */ t(ix,{...i,...r})},`DropdownMenuPortal`),kx=`DropdownMenuContent`,Ax=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,o=wx(kx,r),s=Sx(r),c=a.useRef(!1);return/* @__PURE__ */ t(ax,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...i,ref:n,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{c.current||o.triggerRef.current?.focus(),c.current=!1,e.preventDefault()}),onInteractOutside:V(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!o.modal||r)&&(c.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)`}})},`DropdownMenuContent`)),jx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(ox,{...a,...i,ref:n})},`DropdownMenuGroup`)),Mx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(sx,{...a,...i,ref:n})},`DropdownMenuLabel`)),Nx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(cx,{...a,...i,ref:n})},`DropdownMenuItem`)),Px=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(lx,{...a,...i,ref:n})},`DropdownMenuCheckboxItem`)),Fx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(ux,{...a,...i,ref:n})},`DropdownMenuRadioGroup`)),Ix=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(dx,{...a,...i,ref:n})},`DropdownMenuRadioItem`)),Lx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(fx,{...a,...i,ref:n})},`DropdownMenuItemIndicator`)),Rx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(px,{...a,...i,ref:n})},`DropdownMenuSeparator`)),zx=/* @__PURE__ */ vx(e=>{let{__scopeDropdownMenu:n,children:r,open:i,onOpenChange:a,defaultOpen:o}=e,s=Sx(n),[c,l]=Wr({prop:i,defaultProp:o??!1,onChange:a,caller:`DropdownMenuSub`});return/* @__PURE__ */ t(mx,{...s,open:c,onOpenChange:l,children:r})},`DropdownMenuSub`),Bx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(hx,{...a,...i,ref:n})},`DropdownMenuSubTrigger`)),Vx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ vx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Sx(r);return/* @__PURE__ */ t(gx,{...a,...i,ref:n,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)`}})},`DropdownMenuSubContent`)),Hx=Tx,Ux=Dx,Wx=Ox,Gx=Ax,Kx=jx,qx=Mx,Jx=Nx,Yx=Px,Xx=Fx,Zx=Ix,Qx=Lx,$x=Rx,eS=zx,tS=Bx,nS=Vx;const rS=a.createContext(!1);function iS({...e}){return t(Hx,{"data-slot":`dropdown-menu`,...e})}function aS({...e}){return t(Wx,{"data-slot":`dropdown-menu-portal`,...e})}function oS({...e}){return t(Ux,{"data-slot":`dropdown-menu-trigger`,...e})}function sS({className:e,align:n=`start`,sideOffset:r=4,...i}){return t(Wx,{children:t(Gx,{"data-slot":`dropdown-menu-content`,sideOffset:r,align:n,className:B(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden`,e),...i})})}function cS({...e}){return t(Kx,{"data-slot":`dropdown-menu-group`,...e})}function lS({className:e,inset:n,variant:r=`default`,...i}){return t(Jx,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":r,className:B(`hover:bg-muted focus:bg-muted data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...i})}function uS({className:e,children:r,checked:i,inset:a,...o}){return n(Yx,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:B(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),checked:i,...o,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:t(Qx,{children:t(L,{})})}),r]})}function dS({...e}){return t(Xx,{"data-slot":`dropdown-menu-radio-group`,...e})}function fS({className:e,children:r,inset:i,...a}){return n(Zx,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:B(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-radio-item-indicator`,children:t(Qx,{children:t(L,{})})}),r]})}function pS({className:e,inset:n,...r}){return t(qx,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:B(`text-muted px-1.5 py-1 text-xs font-medium data-inset:ps-7`,e),...r})}function mS({className:e,...n}){return t($x,{"data-slot":`dropdown-menu-separator`,className:B(`bg-border -mx-1 my-1 h-px`,e),...n})}function hS({className:e,...n}){return t(`span`,{"data-slot":`dropdown-menu-shortcut`,className:B(`text-muted group-focus/dropdown-menu-item:text-muted ms-auto text-xs tracking-widest`,e),...n})}function gS({...e}){return t(eS,{"data-slot":`dropdown-menu-sub`,...e})}function _S({className:e,inset:r,children:i,...a}){return n(tS,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":r,className:B(`focus:bg-muted focus:text-muted data-open:bg-muted data-open:text-muted not-data-[variant=destructive]:focus:**:text-muted gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[i,t(Ve,{className:`cn-rtl-flip ms-auto`})]})}function vS({className:e,...n}){return t(nS,{"data-slot":`dropdown-menu-sub-content`,className:B(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-lg p-1 shadow-lg ring-1 duration-100 z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden`,e),...n})}const yS={left:`start`,center:`center`,right:`end`};function bS({trigger:e,children:r,align:i=`right`,hover:o}){let[s,c]=a.useState(!1),l=a.useRef(null);return o?n(`div`,{className:`relative inline-flex`,onMouseEnter:()=>{l.current&&clearTimeout(l.current),c(!0)},onMouseLeave:()=>{l.current=setTimeout(()=>c(!1),80)},children:[e,s&&t(`div`,{className:B(`absolute top-full pt-1 z-50`,i===`right`?`end-0`:i===`center`?`left-1/2 -translate-x-1/2`:`start-0`),children:t(`div`,{className:`min-w-32 rounded-lg p-1 shadow-md ring-1 ring-foreground/10 bg-popover text-popover-foreground`,children:t(rS.Provider,{value:!0,children:r})})})]}):n(iS,{children:[t(oS,{asChild:!0,children:t(`span`,{className:`-m-1.5 flex items-center p-1.5`,children:e})}),t(sS,{align:yS[i],className:`w-max`,children:r})]})}function xS({children:e,label:r}){return n(cS,{children:[r&&t(pS,{children:r}),e]})}function SS({children:e,href:n,onClick:r,isDisabled:i=!1,variant:o=`default`,className:s}){let c=a.useContext(rS),l=B(`w-full gap-2 rounded-md px-1.5 py-1 text-sm text-nowrap [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,o===`destructive`?`text-destructive`:``,i?`pointer-events-none opacity-50`:`hover:bg-muted focus:bg-muted`,s);return c?n?t(`a`,{href:n,className:l,children:e}):t(`button`,{type:`button`,className:l,disabled:i,onClick:e=>{e.stopPropagation(),r?.(e)},children:e}):t(lS,{className:B(`data-[disabled]:pointer-events-none data-[disabled]:opacity-50 text-nowrap`,s),disabled:i,variant:o,onClick:e=>{e.stopPropagation(),r?.(e)},asChild:!!n,children:n?t(`a`,{href:n,children:e}):e})}const CS=({children:e,className:n})=>{let r=C(null),[i,a]=w(`auto`);return _(()=>{if(r.current){let e=new ResizeObserver(e=>{let t=e[0].contentRect.height;a(t)});return e.observe(r.current),()=>{e.disconnect()}}},[]),t(`div`,{className:B(n,`overflow-hidden transition-all duration-100 ease-in`),style:{height:i},children:t(`div`,{ref:r,children:e})})},wS=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);(TS(i,a)||!r)&&Object.defineProperty(e,n,a)},TS=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},ES=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},DS=(e,t)=>`/* Wrapped ${e}*/\n${t}`,OS=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),kS=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),AS=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=DS.bind(null,r,t.toString());Object.defineProperty(i,"name",kS);let{writable:a,enumerable:o,configurable:s}=OS;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function jS(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))wS(e,t,r,n);return ES(e,t),AS(e,t,r),e}const MS=2147483647,NS=/* @__PURE__ */ new WeakMap,PS=/* @__PURE__ */ new WeakMap,FS=/* @__PURE__ */ new WeakMap;function IS(e,t){let n=e.get(t);if(n){if(n.maxAge<=Date.now()){e.delete(t);return}return n}}function LS(e,{cacheKey:t,cache:n=/* @__PURE__ */ new Map,maxAge:r}={}){if(r===0)return e;if(typeof r==`number`&&Number.isFinite(r)){if(r>MS)throw TypeError(`The \`maxAge\` option cannot exceed ${MS}.`);if(r<0)throw TypeError("The `maxAge` option should not be a negative number.")}let i=function(...a){let o=t?t(a):a[0],s=IS(n,o);if(s)return s.data;let c=e.apply(this,a),l=typeof r==`function`?r(...a):r;if(l!==void 0&&l!==1/0){if(!Number.isFinite(l))throw TypeError("The `maxAge` function must return a finite number, `0`, or `Infinity`.");if(l<=0)return c;if(l>MS)throw TypeError(`The \`maxAge\` function result cannot exceed ${MS}.`)}if(n.set(o,{data:c,maxAge:l===void 0||l===1/0?1/0:Date.now()+l}),l!==void 0&&l!==1/0){let e=setTimeout(()=>{n.delete(o),PS.get(i)?.delete(e)},l);e.unref?.();let t=PS.get(i)??/* @__PURE__ */ new Set;t.add(e),PS.set(i,t)}return c};return jS(i,e,{ignoreNonConfigurable:!0}),NS.set(i,n),FS.set(i,t??(e=>e[0])),i}function RS(e){return typeof e==`string`}function zS(e,t,n){return n.indexOf(e)===t}function BS(e){return e.toLowerCase()===e}function VS(e){return e.indexOf(`,`)===-1?e:e.split(`,`)}function HS(e){if(!e)return e;if(e===`C`||e===`posix`||e===`POSIX`)return`en-US`;if(e.indexOf(`.`)!==-1){var t=e.split(`.`)[0],n=t===void 0?``:t;return HS(n)}if(e.indexOf(`@`)!==-1){var r=e.split(`@`)[0],n=r===void 0?``:r;return HS(n)}if(e.indexOf(`-`)===-1||!BS(e))return e;var i=e.split(`-`),a=i[0],o=i[1];return`${a}-${(o===void 0?``:o).toUpperCase()}`}function US(e){var t=e===void 0?{}:e,n=t.useFallbackLocale,r=n===void 0||n,i=t.fallbackLocale,a=i===void 0?`en-US`:i,o=[];if(typeof navigator<`u`){for(var s=navigator.languages||[],c=[],l=0,u=s;l<u.length;l++){var d=u[l];c=c.concat(VS(d))}var f=navigator.language,p=f&&VS(f);o=o.concat(c,p)}return r&&o.push(a),o.filter(RS).map(HS).filter(zS)}var WS=LS(US,{cacheKey:JSON.stringify});function GS(e){return WS(e)[0]||null}var KS=LS(GS,{cacheKey:JSON.stringify});const qS=/* @__PURE__ */ new Map;function JS(e){return function(t,n){let r=t||KS();qS.has(r)||qS.set(r,/* @__PURE__ */ new Map);let i=qS.get(r);if(!i.has(e)){let t=new Intl.DateTimeFormat(r||void 0,e);i.set(e,t.format.bind(t))}return i.get(e)(n)}}function YS(e){let t=new Date(e);return new Date(t.setHours(12))}function XS(e){return(t,n)=>JS(e)(t,YS(n))}const ZS={day:`numeric`},QS={day:`numeric`,month:`long`,year:`numeric`},$S={month:`long`},eC={month:`long`,year:`numeric`},tC={weekday:`short`},nC={weekday:`long`},rC={year:`numeric`},iC=XS(ZS),aC=XS(QS),oC=XS($S),sC=XS(eC),cC=XS(tC),lC=XS(nC),uC=XS(rC);function dC(e,t,n){return function(r,i=n){return t(e(r)+i)}}function fC(e){return function(t){return/* @__PURE__ */ new Date(e(t).getTime()-1)}}function pC(e,t){return function(n){return[e(n),t(n)]}}function Z(e){if(e instanceof Date)return e.getFullYear();if(typeof e==`number`)return e;let t=Number.parseInt(e,10);if(typeof e==`string`&&!Number.isNaN(t))return t;throw Error(`Failed to get year from date: ${e}.`)}function mC(e){if(e instanceof Date)return e.getMonth();throw Error(`Failed to get month from date: ${e}.`)}function hC(e){if(e instanceof Date)return e.getDate();throw Error(`Failed to get year from date: ${e}.`)}function gC(e){let t=Z(e),n=t+(-t+1)%100,r=/* @__PURE__ */ new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const _C=dC(Z,gC,-100),vC=dC(Z,gC,100),yC=fC(vC),bC=dC(Z,yC,-100),xC=pC(gC,yC);function SC(e){let t=Z(e),n=t+(-t+1)%10,r=/* @__PURE__ */ new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const CC=dC(Z,SC,-10),wC=dC(Z,SC,10),TC=fC(wC),EC=dC(Z,TC,-10),DC=pC(SC,TC);function OC(e){let t=Z(e),n=/* @__PURE__ */ new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}const kC=dC(Z,OC,-1),AC=dC(Z,OC,1),jC=fC(AC),MC=dC(Z,jC,-1),NC=pC(OC,jC);function PC(e,t){return function(n,r=t){let i=Z(n),a=mC(n)+r,o=/* @__PURE__ */ new Date;return o.setFullYear(i,a,1),o.setHours(0,0,0,0),e(o)}}function FC(e){let t=Z(e),n=mC(e),r=/* @__PURE__ */ new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}const IC=PC(FC,-1),LC=PC(FC,1),RC=fC(LC),zC=PC(RC,-1),BC=pC(FC,RC);function VC(e,t){return function(n,r=t){let i=Z(n),a=mC(n),o=hC(n)+r,s=/* @__PURE__ */ new Date;return s.setFullYear(i,a,o),s.setHours(0,0,0,0),e(s)}}function HC(e){let t=Z(e),n=mC(e),r=hC(e),i=/* @__PURE__ */ new Date;return i.setFullYear(t,n,r),i.setHours(0,0,0,0),i}const UC=fC(VC(HC,1)),WC=pC(HC,UC);function GC(e){return hC(RC(e))}const KC={GREGORY:`gregory`,HEBREW:`hebrew`,ISLAMIC:`islamic`,ISO_8601:`iso8601`},qC={gregory:[`en-CA`,`en-US`,`es-AR`,`es-BO`,`es-CL`,`es-CO`,`es-CR`,`es-DO`,`es-EC`,`es-GT`,`es-HN`,`es-MX`,`es-NI`,`es-PA`,`es-PE`,`es-PR`,`es-SV`,`es-VE`,`pt-BR`],hebrew:[`he`,`he-IL`],islamic:[`ar`,`ar-AE`,`ar-BH`,`ar-DZ`,`ar-EG`,`ar-IQ`,`ar-JO`,`ar-KW`,`ar-LY`,`ar-OM`,`ar-QA`,`ar-SA`,`ar-SD`,`ar-SY`,`ar-YE`,`dv`,`dv-MV`,`ps`,`ps-AR`]},JC=[0,1,2,3,4,5,6],YC=JC[0],XC=JC[5],ZC=JC[6];function QC(e,t=KC.ISO_8601){let n=e.getDay();switch(t){case KC.ISO_8601:return(n+6)%7;case KC.ISLAMIC:return(n+1)%7;case KC.HEBREW:case KC.GREGORY:return n;default:throw Error(`Unsupported calendar type.`)}}function $C(e){return Z(gC(e))}function ew(e){return Z(SC(e))}function tw(e,t=KC.ISO_8601){let n=Z(e),r=mC(e),i=e.getDate()-QC(e,t);return new Date(n,r,i)}function nw(e,t=KC.ISO_8601){let n=t===KC.GREGORY?KC.GREGORY:KC.ISO_8601,r=tw(e,t),i=Z(e)+1,a,o;do a=new Date(i,0,n===KC.ISO_8601?4:1),o=tw(a,t),--i;while(e<o);return Math.round((r.getTime()-o.getTime())/6048e5)+1}function rw(e,t){switch(e){case`century`:return gC(t);case`decade`:return SC(t);case`year`:return OC(t);case`month`:return FC(t);case`day`:return HC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function iw(e,t){switch(e){case`century`:return _C(t);case`decade`:return CC(t);case`year`:return kC(t);case`month`:return IC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function aw(e,t){switch(e){case`century`:return vC(t);case`decade`:return wC(t);case`year`:return AC(t);case`month`:return LC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function ow(e,t){switch(e){case`decade`:return CC(t,-100);case`year`:return kC(t,-10);case`month`:return IC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function sw(e,t){switch(e){case`decade`:return wC(t,100);case`year`:return AC(t,10);case`month`:return LC(t,12);default:throw Error(`Invalid rangeType: ${e}`)}}function cw(e,t){switch(e){case`century`:return yC(t);case`decade`:return TC(t);case`year`:return jC(t);case`month`:return RC(t);case`day`:return UC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function lw(e,t){switch(e){case`century`:return bC(t);case`decade`:return EC(t);case`year`:return MC(t);case`month`:return zC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function uw(e,t){switch(e){case`decade`:return EC(t,-100);case`year`:return MC(t,-10);case`month`:return zC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function dw(e,t){switch(e){case`century`:return xC(t);case`decade`:return DC(t);case`year`:return NC(t);case`month`:return BC(t);case`day`:return WC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function fw(e,t,n){let r=[t,n].sort((e,t)=>e.getTime()-t.getTime());return[rw(e,r[0]),cw(e,r[1])]}function pw(e,t,n){return n.map(n=>(t||uC)(e,n)).join(` – `)}function mw(e,t,n){return pw(e,t,xC(n))}function hw(e,t,n){return pw(e,t,DC(n))}function gw(e){return e.getDay()===(/* @__PURE__ */ new Date()).getDay()}function _w(e,t=KC.ISO_8601){let n=e.getDay();switch(t){case KC.ISLAMIC:case KC.HEBREW:return n===XC||n===ZC;case KC.ISO_8601:case KC.GREGORY:return n===ZC||n===YC;default:throw Error(`Unsupported calendar type.`)}}const vw=`react-calendar__navigation`;function yw({activeStartDate:r,drillUp:i,formatMonthYear:a=sC,formatYear:o=uC,locale:s,maxDate:c,minDate:l,navigationAriaLabel:u=``,navigationAriaLive:d,navigationLabel:f,next2AriaLabel:p=``,next2Label:m=`»`,nextAriaLabel:h=``,nextLabel:g=`›`,prev2AriaLabel:_=``,prev2Label:v=`«`,prevAriaLabel:y=``,prevLabel:b=`‹`,setActiveStartDate:x,showDoubleView:S,view:C,views:w}){let T=w.indexOf(C)>0,E=C!==`century`,D=iw(C,r),O=E?ow(C,r):void 0,k=aw(C,r),A=E?sw(C,r):void 0,j=(()=>{if(D.getFullYear()<0)return!0;let e=lw(C,r);return l&&l>=e})(),M=E&&(()=>{if(O.getFullYear()<0)return!0;let e=uw(C,r);return l&&l>=e})(),N=c&&c<k,P=E&&c&&c<A;function ee(){x(D,`prev`)}function te(){x(O,`prev2`)}function F(){x(k,`next`)}function ne(){x(A,`next2`)}function re(e){let t=(()=>{switch(C){case`century`:return mw(s,o,e);case`decade`:return hw(s,o,e);case`year`:return o(s,e);case`month`:return a(s,e);default:throw Error(`Invalid view: ${C}.`)}})();return f?f({date:e,label:t,locale:s||KS()||void 0,view:C}):t}function ie(){let a=`${vw}__label`;return n(`button`,{"aria-label":u,"aria-live":d,className:a,disabled:!T,onClick:i,style:{flexGrow:1},type:`button`,children:[t(`span`,{className:`${a}__labelText ${a}__labelText--from`,children:re(r)}),S?n(e,{children:[t(`span`,{className:`${a}__divider`,children:` – `}),t(`span`,{className:`${a}__labelText ${a}__labelText--to`,children:re(k)})]}):null]})}return n(`div`,{className:vw,children:[v!==null&&E?t(`button`,{"aria-label":_,className:`${vw}__arrow ${vw}__prev2-button`,disabled:M,onClick:te,type:`button`,children:v}):null,b!==null&&t(`button`,{"aria-label":y,className:`${vw}__arrow ${vw}__prev-button`,disabled:j,onClick:ee,type:`button`,children:b}),ie(),g!==null&&t(`button`,{"aria-label":h,className:`${vw}__arrow ${vw}__next-button`,disabled:N,onClick:F,type:`button`,children:g}),m!==null&&E?t(`button`,{"aria-label":p,className:`${vw}__arrow ${vw}__next2-button`,disabled:P,onClick:ne,type:`button`,children:m}):null]})}function bw(e){return`${e}%`}function xw({children:e,className:n,count:r,direction:i,offset:a,style:o,wrap:c,...l}){return t(`div`,{className:n,style:{display:`flex`,flexDirection:i,flexWrap:c?`wrap`:`nowrap`,...o},...l,children:s.map(e,(e,t)=>{let n=a&&t===0?bw(100*a/r):null;return u(e,{...e.props,style:{flexBasis:bw(100/r),flexShrink:0,flexGrow:0,overflow:`hidden`,marginLeft:n,marginInlineStart:n,marginInlineEnd:0}})})})}function Sw(e,t,n){return t&&t>e?t:n&&n<e?n:e}function Cw(e,t){return t[0]<=e&&t[1]>=e}function ww(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function Tw(e,t){return Cw(e[0],t)||Cw(e[1],t)}function Ew(e,t,n){let r=Tw(t,e),i=[];if(r){i.push(n);let r=Cw(e[0],t),a=Cw(e[1],t);r&&i.push(`${n}Start`),a&&i.push(`${n}End`),r&&a&&i.push(`${n}BothEnds`)}return i}function Dw(e){return Array.isArray(e)?e[0]!==null&&e[1]!==null:e!==null}function Ow(e){if(!e)throw Error(`args is required`);let{value:t,date:n,hover:r}=e,i=`react-calendar__tile`,a=[i];if(!n)return a;let o=/* @__PURE__ */ new Date,s=(()=>{if(Array.isArray(n))return n;let{dateType:t}=e;if(!t)throw Error(`dateType is required when date is not an array of two dates`);return dw(t,n)})();if(Cw(o,s)&&a.push(`${i}--now`),!t||!Dw(t))return a;let c=(()=>{if(Array.isArray(t))return t;let{valueType:n}=e;if(!n)throw Error(`valueType is required when value is not an array of two dates`);return dw(n,t)})();ww(c,s)?a.push(`${i}--active`):Tw(c,s)&&a.push(`${i}--hasActive`);let l=Ew(c,s,`${i}--range`);if(a.push(...l),r&&(Array.isArray(t)?t:[t]).length===1){let e=Ew(r>c[0]?[c[0],r]:[r,c[0]],s,`${i}--hover`);a.push(...e)}return a}function kw({className:e,count:n=3,dateTransform:r,dateType:i,end:a,hover:o,offset:s,renderTile:c,start:l,step:u=1,value:d,valueType:f}){let p=[];for(let e=l;e<=a;e+=u){let t=r(e);p.push(c({classes:Ow({date:t,dateType:i,hover:o,value:d,valueType:f}),date:t}))}return t(xw,{className:e,count:n,offset:s,wrap:!0,children:p})}function Aw(e){let{activeStartDate:i,children:a,classes:o,date:s,formatAbbr:c,locale:l,maxDate:u,maxDateTransform:d,minDate:f,minDateTransform:p,onClick:m,onMouseOver:h,style:g,tileClassName:_,tileContent:v,tileDisabled:y,view:b}=e,x=S(()=>typeof _==`function`?_({activeStartDate:i,date:s,view:b}):_,[i,s,_,b]),C=S(()=>typeof v==`function`?v({activeStartDate:i,date:s,view:b}):v,[i,s,v,b]);return n(`button`,{className:r(o,x),disabled:f&&p(f)>s||u&&d(u)<s||y?.({activeStartDate:i,date:s,view:b}),onClick:m?e=>m(s,e):void 0,onFocus:h?()=>h(s):void 0,onMouseOver:h?()=>h(s):void 0,style:g,type:`button`,children:[c?t(`abbr`,{"aria-label":c(l,s),children:a}):a,C]})}const jw=`react-calendar__century-view__decades__decade`;function Mw({classes:e=[],currentCentury:n,formatYear:r=uC,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(jw),gC(a).getFullYear()!==n&&s.push(`${jw}--neighboringCentury`),t(Aw,{...i,classes:s,maxDateTransform:TC,minDateTransform:SC,view:`century`,children:hw(o,r,a)})}function Nw(e){let{activeStartDate:n,hover:r,showNeighboringCentury:i,value:a,valueType:o,...s}=e,c=$C(n),l=c+(i?119:99);return t(kw,{className:`react-calendar__century-view__decades`,dateTransform:SC,dateType:`decade`,end:l,hover:r,renderTile:({date:e,...r})=>t(Mw,{...s,...r,activeStartDate:n,currentCentury:c,date:e},e.getTime()),start:c,step:10,value:a,valueType:o})}function Pw(e){function n(){return t(Nw,{...e})}return t(`div`,{className:`react-calendar__century-view`,children:n()})}const Fw=`react-calendar__decade-view__years__year`;function Iw({classes:e=[],currentDecade:n,formatYear:r=uC,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(Fw),SC(a).getFullYear()!==n&&s.push(`${Fw}--neighboringDecade`),t(Aw,{...i,classes:s,maxDateTransform:jC,minDateTransform:OC,view:`decade`,children:r(o,a)})}function Lw(e){let{activeStartDate:n,hover:r,showNeighboringDecade:i,value:a,valueType:o,...s}=e,c=ew(n),l=c+(i?11:9);return t(kw,{className:`react-calendar__decade-view__years`,dateTransform:OC,dateType:`year`,end:l,hover:r,renderTile:({date:e,...r})=>t(Iw,{...s,...r,activeStartDate:n,currentDecade:c,date:e},e.getTime()),start:c,value:a,valueType:o})}function Rw(e){function n(){return t(Lw,{...e})}return t(`div`,{className:`react-calendar__decade-view`,children:n()})}const zw=`react-calendar__month-view__days__day`;function Bw({calendarType:e,classes:n=[],currentMonthIndex:r,formatDay:i=iC,formatLongDate:a=aC,...o}){let{date:s,locale:c}=o,l=[];return n&&l.push(...n),l.push(zw),_w(s,e)&&l.push(`${zw}--weekend`),s.getMonth()!==r&&l.push(`${zw}--neighboringMonth`),t(Aw,{...o,classes:l,formatAbbr:a,maxDateTransform:UC,minDateTransform:HC,view:`month`,children:i(c,s)})}function Vw(e){let{activeStartDate:n,calendarType:r,hover:i,showFixedNumberOfWeeks:a,showNeighboringMonth:o,value:s,valueType:c,...l}=e,u=Z(n),d=mC(n),f=a||o,p=QC(n,r),m=f?0:p,h=(f?-p:0)+1,g=(()=>{if(a)return h+42-1;let e=GC(n);if(o){let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),t.setHours(0,0,0,0),e+(7-QC(t,r)-1)}return e})();return t(kw,{className:`react-calendar__month-view__days`,count:7,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),HC(t)},dateType:`day`,hover:i,end:g,renderTile:({date:e,...i})=>t(Bw,{...l,...i,activeStartDate:n,calendarType:r,currentMonthIndex:d,date:e},e.getTime()),offset:m,start:h,value:s,valueType:c})}const Hw=`react-calendar__month-view__weekdays`,Uw=`${Hw}__weekday`;function Ww(e){let{calendarType:n,formatShortWeekday:i=cC,formatWeekday:a=lC,locale:o,onMouseLeave:s}=e,c=FC(/* @__PURE__ */ new Date),l=Z(c),u=mC(c),d=[];for(let e=1;e<=7;e+=1){let s=new Date(l,u,e-QC(c,n)),f=a(o,s);d.push(t(`div`,{className:r(Uw,gw(s)&&`${Uw}--current`,_w(s,n)&&`${Uw}--weekend`),children:t(`abbr`,{"aria-label":f,title:f,children:i(o,s).replace(`.`,``)})},e))}return t(xw,{className:Hw,count:7,onFocus:s,onMouseOver:s,children:d})}const Gw=`react-calendar__tile`;function Kw(e){let{onClickWeekNumber:n,weekNumber:r}=e,i=t(`span`,{children:r});if(n){let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`button`,{...o,className:Gw,onClick:e=>r(a,n,e),type:`button`,children:i})}{let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`div`,{...o,className:Gw,children:i})}}function qw(e){let{activeStartDate:n,calendarType:r,onClickWeekNumber:i,onMouseLeave:a,showFixedNumberOfWeeks:o}=e,s=(()=>{if(o)return 6;let e=GC(n)-(7-QC(n,r));return 1+Math.ceil(e/7)})(),c=(()=>{let e=Z(n),t=mC(n),i=hC(n),a=[];for(let n=0;n<s;n+=1)a.push(tw(new Date(e,t,i+n*7),r));return a})(),l=c.map(e=>nw(e,r));return t(xw,{className:`react-calendar__month-view__weekNumbers`,count:s,direction:`column`,onFocus:a,onMouseOver:a,style:{flexBasis:`calc(100% * (1 / 8)`,flexShrink:0},children:l.map((e,n)=>{let r=c[n];if(!r)throw Error(`date is not defined`);return t(Kw,{date:r,onClickWeekNumber:i,weekNumber:e},e)})})}function Jw(e){if(e){for(let[t,n]of Object.entries(qC))if(n.includes(e))return t}return KC.ISO_8601}function Yw(e){let{activeStartDate:i,locale:a,onMouseLeave:o,showFixedNumberOfWeeks:s}=e,{calendarType:c=Jw(a),formatShortWeekday:l,formatWeekday:u,onClickWeekNumber:d,showWeekNumbers:f,...p}=e;function m(){return t(Ww,{calendarType:c,formatShortWeekday:l,formatWeekday:u,locale:a,onMouseLeave:o})}function h(){return f?t(qw,{activeStartDate:i,calendarType:c,onClickWeekNumber:d,onMouseLeave:o,showFixedNumberOfWeeks:s}):null}function g(){return t(Vw,{calendarType:c,...p})}let _=`react-calendar__month-view`;return t(`div`,{className:r(_,f?`${_}--weekNumbers`:``),children:n(`div`,{style:{display:`flex`,alignItems:`flex-end`},children:[h(),n(`div`,{style:{flexGrow:1,width:`100%`},children:[m(),g()]})]})})}function Xw({classes:e=[],formatMonth:n=oC,formatMonthYear:r=sC,...i}){let{date:a,locale:o}=i;return t(Aw,{...i,classes:[...e,`react-calendar__year-view__months__month`],formatAbbr:r,maxDateTransform:RC,minDateTransform:FC,view:`year`,children:n(o,a)})}function Zw(e){let{activeStartDate:n,hover:r,value:i,valueType:a,...o}=e,s=Z(n);return t(kw,{className:`react-calendar__year-view__months`,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(s,e,1),FC(t)},dateType:`month`,end:11,hover:r,renderTile:({date:e,...r})=>t(Xw,{...o,...r,activeStartDate:n,date:e},e.getTime()),start:0,value:i,valueType:a})}function Qw(e){function n(){return t(Zw,{...e})}return t(`div`,{className:`react-calendar__year-view`,children:n()})}const $w=`react-calendar`,eT=[`century`,`decade`,`year`,`month`],tT=[`decade`,`year`,`month`,`day`],nT=/* @__PURE__ */ new Date;nT.setFullYear(1,0,1),nT.setHours(0,0,0,0);const rT=/* @__PURE__ */ new Date(864e13);function iT(e){return e instanceof Date?e:new Date(e)}function aT(e,t){return eT.slice(eT.indexOf(e),eT.indexOf(t)+1)}function oT(e,t,n){return aT(t,n).indexOf(e)!==-1}function sT(e,t,n){return e&&oT(e,t,n)?e:n}function cT(e){let t=eT.indexOf(e);return tT[t]}function lT(e,t){let n=Array.isArray(e)?e[t]:e;if(!n)return null;let r=iT(n);if(Number.isNaN(r.getTime()))throw Error(`Invalid date: ${e}`);return r}function uT({value:e,minDate:t,maxDate:n,maxDetail:r},i){let a=lT(e,i);if(!a)return null;let o=cT(r);return Sw((()=>{switch(i){case 0:return rw(o,a);case 1:return cw(o,a);default:throw Error(`Invalid index value: ${i}`)}})(),t,n)}const dT=e=>uT(e,0),fT=e=>uT(e,1),pT=e=>[dT,fT].map(t=>t(e));function mT({maxDate:e,maxDetail:t,minDate:n,minDetail:r,value:i,view:a}){return rw(sT(a,r,t),dT({value:i,minDate:n,maxDate:e,maxDetail:t})||/* @__PURE__ */ new Date)}function hT({activeStartDate:e,defaultActiveStartDate:t,defaultValue:n,defaultView:r,maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c,view:l}){let u=sT(l,s,a),d=e||t;return d?rw(u,d):mT({maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c||n,view:l||r})}function gT(e){return e&&(!Array.isArray(e)||e.length===1)}function _T(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var vT=p(function(e,i){let{activeStartDate:a,allowPartialRange:o,calendarType:s,className:c,"data-testid":l,defaultActiveStartDate:u,defaultValue:d,defaultView:f,formatDay:p,formatLongDate:m,formatMonth:g,formatMonthYear:_,formatShortWeekday:v,formatWeekday:b,formatYear:x,goToRangeStartOnSelect:S=!0,inputRef:C,locale:T,maxDate:E=rT,maxDetail:D=`month`,minDate:O=nT,minDetail:k=`century`,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:ee,nextLabel:te,onActiveStartDateChange:F,onChange:ne,onClickDay:re,onClickDecade:ie,onClickMonth:ae,onClickWeekNumber:oe,onClickYear:se,onDrillDown:ce,onDrillUp:le,onViewChange:ue,prev2AriaLabel:de,prev2Label:fe,prevAriaLabel:pe,prevLabel:me,returnValue:he=`start`,selectRange:ge,showDoubleView:_e,showFixedNumberOfWeeks:ve,showNavigation:ye=!0,showNeighboringCentury:be,showNeighboringDecade:xe,showNeighboringMonth:Se=!0,showWeekNumbers:Ce,tileClassName:we,tileContent:Te,tileDisabled:Ee,value:De,view:Oe}=e,[ke,Ae]=w(u),[je,Me]=w(null),[Ne,Pe]=w(Array.isArray(d)?d.map(e=>e===null?null:iT(e)):d==null?null:iT(d)),[Fe,I]=w(f),Ie=a||ke||hT({activeStartDate:a,defaultActiveStartDate:u,defaultValue:d,defaultView:f,maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:De,view:Oe}),L=(()=>{let e=ge&&gT(Ne)||De===void 0?Ne:De;return e?Array.isArray(e)?e.map(e=>e===null?null:iT(e)):e===null?null:iT(e):null})(),Le=cT(D),R=sT(Oe||Fe,k,D),Re=aT(k,D),ze=ge?je:null,Be=Re.indexOf(R)<Re.length-1,Ve=Re.indexOf(R)>0,He=h(e=>(()=>{switch(he){case`start`:return dT;case`end`:return fT;case`range`:return pT;default:throw Error(`Invalid returnValue.`)}})()({maxDate:E,maxDetail:D,minDate:O,value:e}),[E,D,O,he]),Ue=h((e,t)=>{Ae(e);let n={action:t,activeStartDate:e,value:L,view:R};F&&!_T(Ie,e)&&F(n)},[Ie,F,L,R]),We=h((e,t)=>{let n=(()=>{switch(R){case`century`:return ie;case`decade`:return se;case`year`:return ae;case`month`:return re;default:throw Error(`Invalid view: ${R}.`)}})();n&&n(e,t)},[re,ie,ae,se,R]),Ge=h((e,t)=>{if(!Be)return;We(e,t);let n=Re[Re.indexOf(R)+1];if(!n)throw Error(`Attempted to drill down from the lowest view.`);Ae(e),I(n);let r={action:`drillDown`,activeStartDate:e,value:L,view:n};F&&!_T(Ie,e)&&F(r),ue&&R!==n&&ue(r),ce&&ce(r)},[Ie,Be,F,We,ce,ue,L,R,Re]),Ke=h(()=>{if(!Ve)return;let e=Re[Re.indexOf(R)-1];if(!e)throw Error(`Attempted to drill up from the highest view.`);let t=rw(e,Ie);Ae(t),I(e);let n={action:`drillUp`,activeStartDate:t,value:L,view:e};F&&!_T(Ie,t)&&F(n),ue&&R!==e&&ue(n),le&&le(n)},[Ie,Ve,F,le,ue,L,R,Re]),qe=h((e,t)=>{let n=L;We(e,t);let r=ge&&!gT(n),i;if(ge){if(r)i=rw(Le,e);else{if(!n)throw Error(`previousValue is required`);if(Array.isArray(n))throw Error(`previousValue must not be an array`);i=fw(Le,n,e)}}else i=He(e);let a=!ge||r||S?mT({maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:i,view:R}):null;t.persist(),Ae(a),Pe(i);let s={action:`onChange`,activeStartDate:a,value:i,view:R};if(F&&!_T(Ie,a)&&F(s),ne){if(ge){if(!gT(i))ne(i||null,t);else if(o){if(Array.isArray(i))throw Error(`value must not be an array`);ne([i||null,null],t)}}else ne(i||null,t)}},[Ie,o,He,S,E,D,O,k,F,ne,We,ge,L,Le,R]);function Je(e){Me(e)}function Ye(){Me(null)}y(i,()=>({activeStartDate:Ie,drillDown:Ge,drillUp:Ke,onChange:qe,setActiveStartDate:Ue,value:L,view:R}),[Ie,Ge,Ke,qe,Ue,L,R]);function Xe(e){let n={activeStartDate:e?aw(R,Ie):rw(R,Ie),hover:ze,locale:T,maxDate:E,minDate:O,onClick:Be?Ge:qe,onMouseOver:ge?Je:void 0,tileClassName:we,tileContent:Te,tileDisabled:Ee,value:L,valueType:Le};switch(R){case`century`:return t(Pw,{formatYear:x,showNeighboringCentury:be,...n});case`decade`:return t(Rw,{formatYear:x,showNeighboringDecade:xe,...n});case`year`:return t(Qw,{formatMonth:g,formatMonthYear:_,...n});case`month`:return t(Yw,{calendarType:s,formatDay:p,formatLongDate:m,formatShortWeekday:v,formatWeekday:b,onClickWeekNumber:oe,onMouseLeave:ge?Ye:void 0,showFixedNumberOfWeeks:ve===void 0?_e:ve,showNeighboringMonth:Se,showWeekNumbers:Ce,...n});default:throw Error(`Invalid view: ${R}.`)}}function Ze(){return ye?t(yw,{activeStartDate:Ie,drillUp:Ke,formatMonthYear:_,formatYear:x,locale:T,maxDate:E,minDate:O,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:ee,nextLabel:te,prev2AriaLabel:de,prev2Label:fe,prevAriaLabel:pe,prevLabel:me,setActiveStartDate:Ue,showDoubleView:_e,view:R,views:Re}):null}return n(`div`,{className:r($w,ge&&(Array.isArray(L)?L:[L]).length===1&&`${$w}--selectRange`,_e&&`${$w}--doubleView`,c),"data-testid":l,ref:C,children:[Ze(),n(`div`,{className:`${$w}__viewContainer`,onBlur:ge?Ye:void 0,onMouseLeave:ge?Ye:void 0,children:[Xe(),_e?Xe(!0):null]})]})});pe.extend(he),pe.extend(me);var Q=pe,yT=Object.defineProperty,bT=(e,t)=>yT(e,`name`,{value:t,configurable:!0}),xT=`Popover`,[ST,CT]=/* @__PURE__ */ kn(xT,[lr]),wT=lr(),[TT,ET]=ST(xT),DT=/* @__PURE__ */ bT(e=>{let{__scopePopover:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,l=wT(n),u=a.useRef(null),[d,f]=a.useState(!1),[p,m]=Wr({prop:i,defaultProp:o??!1,onChange:s,caller:xT});return/* @__PURE__ */ t(Sr,{...l,children:/* @__PURE__ */ t(TT,{scope:n,contentId:H(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:a.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:c,children:r})})},`Popover`),OT=`PopoverAnchor`,kT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let{__scopePopover:r,...i}=e,o=ET(OT,r),s=wT(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=o;return a.useEffect(()=>(c(),()=>l()),[c,l]),/* @__PURE__ */ t(Cr,{...s,...i,ref:n})},`PopoverAnchor`)),AT=`PopoverTrigger`,jT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let{__scopePopover:r,...i}=e,a=ET(AT,r),o=wT(r),s=z(n,a.triggerRef),c=/* @__PURE__ */ t(U.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":WT(a.open),...i,ref:s,onClick:V(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:/* @__PURE__ */ t(Cr,{asChild:!0,...o,children:c})},`PopoverTrigger`)),MT=`PopoverPortal`,[NT,PT]=ST(MT,{forceMount:void 0}),FT=/* @__PURE__ */ bT(e=>{let{__scopePopover:n,forceMount:r,children:i,container:a}=e,o=ET(MT,n);return/* @__PURE__ */ t(NT,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Ar,{present:r||o.open,children:/* @__PURE__ */ t(Er,{asChild:!0,container:a,children:i})})})},`PopoverPortal`),IT=`PopoverContent`,LT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let r=PT(IT,e.__scopePopover),{forceMount:i=r.forceMount,...a}=e,o=ET(IT,e.__scopePopover);return/* @__PURE__ */ t(Ar,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(zT,{...a,ref:n}):/* @__PURE__ */ t(BT,{...a,ref:n})})},`PopoverContent`)),RT=/* @__PURE__ */ an(`PopoverContent.RemoveScroll`),zT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let r=ET(IT,e.__scopePopover),i=a.useRef(null),o=z(n,i),s=a.useRef(!1);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(ue,{as:RT,allowPinchZoom:!0,children:/* @__PURE__ */ t(VT,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{e.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),BT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let r=ET(IT,e.__scopePopover),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(VT,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&o.current&&t.preventDefault()}})},`PopoverContentNonModal`)),VT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let{__scopePopover:r,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=ET(IT,r),m=wT(r);return le(),/* @__PURE__ */ t(ce,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ t(wr,{"data-state":WT(p.open),role:`dialog`,id:p.contentId,...m,...f,ref:n,style:{...f.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)`}})})})},`PopoverContentImpl`)),HT=`PopoverClose`,UT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bT(function(e,n){let{__scopePopover:r,...i}=e,a=ET(HT,r);return/* @__PURE__ */ t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`PopoverClose`));function WT(e){return e?`open`:`closed`}bT(WT,`getState`);var GT=DT,KT=kT,qT=jT,JT=FT,YT=LT,XT=UT;const ZT=a.createContext(null),QT=({hover:e=!1,click:n=!1,modal:r,children:i,_open:o,onOpenChange:s})=>{let[c,l]=a.useState(o||!1);return t(ZT.Provider,{value:{open:c,setOpen:l,hover:e,click:n},children:t(GT,{open:c,onOpenChange:e=>{l(e),s&&s(e)},modal:r,children:i})})};function $T(e=!1,t=()=>{},n){e&&t(n===`enter`)}const eE=a.forwardRef(({children:e,...n},r)=>{let i=a.useContext(ZT);if(!i)throw Error(`PopoverTrigger must be used within a Popover`);let{setOpen:o,hover:s,click:c}=i;return t(qT,{ref:r,asChild:!0,onMouseEnter:()=>$T(s,o,`enter`),onMouseLeave:()=>$T(s,o,`leave`),onClick:()=>{c&&o(e=>!e)},...n,children:e})});eE.displayName=qT.displayName;const tE=KT,nE=a.forwardRef(({className:e,align:n=`center`,side:r=`bottom`,...i},o)=>{let s=a.useContext(ZT);if(!s)throw Error(`PopoverContent must be used within a Popover`);let{setOpen:c,hover:l}=s,u=zi();return t(JT,{container:u,children:t(YT,{ref:o,align:n,side:r,onMouseEnter:()=>$T(l,c,`enter`),onMouseLeave:()=>$T(l,c,`leave`),className:B(`z-50 w-72 rounded-md border-popover bg-popover text-popover-foreground ring-1 ring-border shadow-md focus:outline-none animate-in`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});nE.displayName=YT.displayName;const rE=XT;rE.displayName=XT.displayName;function iE(){let e=a.useContext(ZT);if(!e)throw Error(`usePopoverContext must be used within a Popover`);return{...e,close:()=>e.setOpen(!1)}}const aE=`
|
|
244
|
+
`),()=>{l.current?.removeAttribute(`data-motion-pop-id`),S.contains(x)&&S.removeChild(x)}},[n]),t(mm,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:a.cloneElement(e,{ref:f})})}const gm=({children:e,initial:n,isPresent:r,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=Ta(_m),p=v(),m=C(r),h=C(i);Ea(()=>{m.current=r,h.current=i});let g=!0,_=S(()=>(g=!1,{id:p,initial:n,isPresent:r,custom:o,onExitComplete:e=>{f.set(e,!0);for(let e of f.values())if(!e)return;i&&i()},register:e=>(f.set(e,!1),()=>{f.delete(e),!m.current&&!f.size&&h.current?.()})}),[r,f,i]);return s&&g&&(_={..._}),S(()=>{f.forEach((e,t)=>f.set(t,!1))},[r]),a.useEffect(()=>{!r&&!f.size&&i&&i()},[r]),e=t(hm,{pop:c===`popLayout`,isPresent:r,anchorX:l,anchorY:u,root:d,children:e}),t(Da.Provider,{value:_,children:e})};function _m(){return/* @__PURE__ */ new Map}function vm(e=!0){let t=g(Da);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=v();_(()=>{if(e)return i(a)},[e]);let o=h(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const ym=e=>e.key||``;function bm(e){let t=[];return s.forEach(e,e=>{m(e)&&t.push(e)}),t}const xm=({children:n,custom:r,initial:i=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s=`sync`,propagate:c=!1,anchorX:l=`left`,anchorY:u=`top`,root:d})=>{let[f,p]=vm(c),m=S(()=>bm(n),[n]),h=c&&!f?[]:m.map(ym),_=C(!0),v=Ta(()=>/* @__PURE__ */ new Map),y=C(/* @__PURE__ */ new Set),[b,x]=w(m),[T,E]=w(m);Ea(()=>{c&&!f&&!T.length&&p?.()},[f,c,T.length,p]),Ea(()=>{_.current=!1;for(let e=0;e<T.length;e++){let t=ym(T[e]);h.includes(t)?(v.delete(t),y.current.delete(t)):v.get(t)!==!0&&v.set(t,!1)}},[T,h.length,h.join(`-`)]);let D=[];if(m!==b){let e=[...m],t=0;for(let n of T){let r=h.indexOf(ym(n));r===-1?(e.splice(t++,0,n),D.push(n)):t=r+D.length+1}return D.every(e=>v.get(ym(e)))?e=m:s===`wait`&&(e=D),E(bm(e)),x(m),null}let{forceRender:O}=g(wa);return t(e,{children:T.map(e=>{let n=ym(e),g=c&&!f?!1:m===T||h.includes(n);return t(gm,{isPresent:g,initial:!_.current||i?void 0:!1,custom:r,presenceAffectsLayout:o,mode:s,root:d,onExitComplete:g?void 0:()=>{if(y.current.has(n))return;if(v.has(n))y.current.add(n),v.set(n,!0);else return;let e=!0;v.forEach(t=>{t||(e=!1)}),e&&(O?.(),x([]),c&&p?.(),a&&a())},anchorX:l,anchorY:u,children:e},n)})})},Sm=d({strict:!1}),Cm={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]};let wm=!1;function Tm(){if(wm)return;let e={};for(let t in Cm)e[t]={isEnabled:e=>Cm[t].some(t=>!!e[t])};pf(e),wm=!0}function Em(){return Tm(),mf()}function Dm(e){let t=Em();for(let n in e)t[n]={...t[n],...e[n]};pf(t)}const Om=/* @__PURE__ */ d({});function km(e,t){if(rf(e)){let{initial:t,animate:n}=e;return{initial:t===!1||ef(t)?t:void 0,animate:ef(n)?n:void 0}}return e.inherit===!1?{}:t}function Am(e){let{initial:t,animate:n}=km(e,g(Om));return S(()=>({initial:t,animate:n}),[jm(t),jm(n)])}function jm(e){return Array.isArray(e)?e.join(` `):e}const Mm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Nm(e,t,n){for(let r in t)!mu(t[r])&&!bf(r,n)&&(e[r]=t[r])}function Pm({transformTemplate:e},t){return S(()=>{let n=Mm();return Lu(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Fm(e,t){let n=e.style||{},r={};return Nm(r,n,e),Object.assign(r,Pm(e,t)),r}function Im(e,t){let n={},r=Fm(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Lm=()=>({...Mm(),attrs:{}});function Rm(e,t,n,r){let i=S(()=>{let n=Lm();return Hu(n,t,Tf(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Nm(t,e.style,e),i.style={...t,...i.style}}return i}const zm=/* @__PURE__ */ new Set(/* @__PURE__ */ `animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Bm(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||zm.has(e)}function Vm(e,t){return e.startsWith(`on`)?!Bm(e):t?.(e)??!Bm(e)}function Hm(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(mu(e[a])||(Vm(a,r)||n===!0&&Bm(a)||!t&&!Bm(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}const Um=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Wm(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Um.indexOf(e)>-1||/[A-Z]/u.test(e))}function Gm(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Wm(e)?Rm:Im)(t,r,i,e),u=Hm(t,typeof e==`string`,a,s),d=e===l?{}:{...u,...c,ref:n},{children:p}=t,m=S(()=>mu(p)?p.get():p,[p]);return f(e,{...d,children:m})}function Km({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:qm(n,r,i,e),renderState:t()}}function qm(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Sp(a[e]);let{initial:o,animate:s}=e,c=rf(e),l=af(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!$d(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=ou(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}const Jm=e=>(t,n)=>{let r=g(Om),i=g(Da),a=()=>Km(e,t,r,i);return n?a():Ta(a)},Ym=/*@__PURE__*/ Jm({scrapeMotionValuesFromProps:xf,createRenderState:Mm}),Xm=/*@__PURE__*/ Jm({scrapeMotionValuesFromProps:Df,createRenderState:Lm}),Zm=Symbol.for(`motionComponentSymbol`);function Qm(e,t,n){let r=C(n);b(()=>{r.current=n});let i=C(null);return h(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}const $m=d({});function eh(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function th(e,t,n,r,i,a){let{visualElement:o}=g(Om),s=g(Sm),c=g(Da),l=g(um),u=l.reducedMotion,d=l.skipAnimations,f=C(null),p=C(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=g($m);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&nh(f.current,n,i,h);let v=C(!1);b(()=>{m&&v.current&&m.update(n,c)});let y=n[vu],x=C(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return Ea(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),Ea(()=>{p.current=!0,m&&(v.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),_(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),!1),m.enteringChildren=void 0)}),m}function nh(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:rh(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&eh(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function rh(e){if(e)return e.options.allowProjection===!1?rh(e.parent):e.projection}function ih(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&Dm(a);let s=i?i===`svg`:Wm(e),c=s?Xm:Ym;function l(i,l){let u,d={...g(um),...i,layoutId:ah(i)},{isStatic:f,isValidProp:p}=d,m=Am(i),h=c(i,f);if(!f&&typeof window<`u`){oh(d,a);let t=sh(d);u=t.MeasureLayout,m.visualElement=th(e,h,d,o,t.ProjectionNode,s)}return n(Om.Provider,{value:m,children:[u&&m.visualElement?t(u,{visualElement:m.visualElement,...d}):null,Gm(e,i,Qm(h,m.visualElement,l),h,f,r,s,p)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=p(l);return u[Zm]=e,u}function ah({layoutId:e}){let t=g(wa).id;return t&&e!==void 0?t+`-`+e:e}function oh(e,t){g(Sm).strict}function sh(e){let{drag:t,layout:n}=Em();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function ch(e,t){if(typeof Proxy>`u`)return ih;let n=/* @__PURE__ */ new Map,r=(n,r)=>ih(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,ih(a,void 0,e,t)),n.get(a))})}const lh=(e,t)=>t.isSVG??Wm(e)?new Of(t):new Cf(t,{allowProjection:e!==l});var uh=class extends _f{constructor(e){super(e),e.animationState||=jf(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();$d(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};let dh=0;const fh={animation:{Feature:uh},exit:{Feature:class extends _f{constructor(){super(...arguments),this.id=dh++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=su(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function ph(e){return{point:{x:e.pageX,y:e.pageY}}}const mh=e=>t=>yd(t)&&e(t,ph(t));function hh(e,t,n,r){return vp(e,t,mh(n),r)}const gh=({current:e})=>e?e.ownerDocument.defaultView:null,_h=(e,t)=>Math.abs(e-t);function vh(e,t){let n=_h(e.x,t.x),r=_h(e.y,t.y);return Math.sqrt(n**2+r**2)}const yh=/*#__PURE__*/ new Set([`auto`,`scroll`]);var bh=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=/* @__PURE__ */ new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=xh(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Ch(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=vh(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:K.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=xh(t,this.transformPagePoint),this.hasPendingMove=!0,Y.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Ch(e.type===`pointercancel`?this.lastMoveEventInfo:xh(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!yd(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=xh(ph(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=G;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Ch(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=La(hh(this.contextWindow,`pointermove`,this.handlePointerMove,d),hh(this.contextWindow,`pointerup`,this.handlePointerUp,d),hh(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(yh.has(e.overflowX)||yh.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Y.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Cs(this.updatePoint)}};function xh(e,t){return t?{point:t(e.point)}:e}function Sh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ch({point:e},t){return{point:e,delta:Sh(e,Th(t)),offset:Sh(e,wh(t)),velocity:Eh(t,.1)}}function wh(e){return e[0]}function Th(e){return e[e.length-1]}function Eh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Th(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ Ba(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ Ba(t)*2&&(r=e[1]);let a=/* @__PURE__ */ Va(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Dh(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?J(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?J(n,e,r.max):Math.min(e,n)),e}function Oh(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function kh(e,{top:t,left:n,bottom:r,right:i}){return{x:Oh(e.x,n,i),y:Oh(e.y,t,r)}}function Ah(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function jh(e,t){return{x:Ah(e.x,t.x),y:Ah(e.y,t.y)}}function Mh(e,t){let n=.5,r=Lf(e),i=Lf(t);return i>r?n=/* @__PURE__ */ Ra(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ Ra(e.min,e.max-i,t.min)),Aa(0,1,n)}function Nh(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ph=.35;function Fh(e=Ph){return e===!1?e=0:e===!0&&(e=Ph),{x:Ih(e,`left`,`right`),y:Ih(e,`top`,`bottom`)}}function Ih(e,t,n){return{min:Lh(e,t),max:Lh(e,n)}}function Lh(e,t){return typeof e==`number`?e:e[t]||0}const Rh=/* @__PURE__ */ new WeakMap;var zh=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Zd(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=md(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ap(e=>{let t=this.getAxisMotionValue(e).get()||0;if(No.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Lf(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Y.update(()=>i(e,t),!1,!0),gu(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;r&&this.currentDirection===null?(this.currentDirection=Uh(o),this.currentDirection!==null&&i&&i(this.currentDirection)):(this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Y.update(()=>a(e,t),!1,!0))},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new bh(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:gh(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Y.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Hh(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Dh(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&eh(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?kh(n.layoutBox,e):!1,this.elastic=Fh(t),r!==this.constraints&&!eh(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&ap(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Nh(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!eh(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=ld(n,r.root,this.visualElement.getTransformPagePoint()),a=jh(r.layout.layoutBox,i);if(t){let e=t(Wu(a));this.hasMutatedConstraints=!!e,e&&(a=Uu(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=ap(o=>{if(!Hh(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return gu(this.visualElement,e),n.start(tu(e,n,0,t,this.visualElement,!1))}stopAnimation(){ap(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();ap(e=>{if(!Hh(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-J(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!eh(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};ap(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Mh({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),ap(t=>{let n=this.getAxisMotionValue(t);if(!Hh(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(J(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Rh.set(this.visualElement,this);let e=this.visualElement.current,t=hh(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Cd(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();eh(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Vh(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Y.read(r);let o=vp(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(ap(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Ph,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Bh(e){let t=!0;return()=>{t?t=!1:e()}}function Vh(e,t,n){let r=Wd(e,Bh(n)),i=Wd(t,Bh(n));return()=>{r(),i()}}function Hh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Uh(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Wh=class extends _f{constructor(e){super(e),this.removeGroupControls=Ia,this.removeListeners=Ia,this.controls=new zh(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ia}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};const Gh=e=>(t,n)=>{e&&Y.update(()=>e(t,n),!1,!0)};var Kh=class extends _f{constructor(){super(...arguments),this.removePointerDownListener=Ia}onPointerDown(e){this.session=new bh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gh(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Gh(e),onStart:Gh(t),onMove:Gh(n),onEnd:(e,t)=>{delete this.session,r&&Y.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=hh(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};let qh=!1;var Jh=class extends c{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),qh&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Tp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a&&(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),qh=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Y.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),ud.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;qh=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Yh(e){let[n,r]=vm(),i=g(wa);return t(Jh,{...e,layoutGroup:i,switchLayoutGroup:g($m),isPresent:n,safeToRemove:r})}const Xh={pan:{Feature:Kh},drag:{Feature:Wh,ProjectionNode:lm,MeasureLayout:Yh}};function Zh(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Y.postRender(()=>i(t,ph(t)))}var Qh=class extends _f{mount(){let{current:e}=this.node;e&&(this.unmount=_d(e,(e,t)=>(Zh(this.node,t,`Start`),e=>Zh(this.node,e,`End`))))}unmount(){}},$h=class extends _f{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=La(vp(this.node.current,`focus`,()=>this.onFocus()),vp(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function eg(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Y.postRender(()=>i(t,ph(t)))}var tg=class extends _f{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Ad(e,(e,t)=>(eg(this.node,t,`Start`),(e,{success:t})=>eg(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const ng=/* @__PURE__ */ new WeakMap,rg=/* @__PURE__ */ new WeakMap,ig=e=>{let t=ng.get(e.target);t&&t(e)},ag=e=>{e.forEach(ig)};function og({root:e,...t}){let n=e||document;rg.has(n)||rg.set(n,{});let r=rg.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(ag,{root:e,...t})),r[i]}function sg(e,t,n){let r=og(t);return ng.set(e,n),r.observe(e),()=>{ng.delete(e),r.unobserve(e)}}const cg={some:0,all:1};var lg=class extends _f{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:cg[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=sg(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(ug(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function ug({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const dg={inView:{Feature:lg},tap:{Feature:tg},focus:{Feature:$h},hover:{Feature:Qh}},fg={layout:{ProjectionNode:lm,MeasureLayout:Yh}},pg=/*@__PURE__*/ ch({...fh,...dg,...Xh,...fg},lh);function mg({children:e,overlayContent:r,className:i=``,overlayClassName:a=``,position:o=`right`,width:s,height:c,showCloseButton:l=!0,onOpen:u,onClose:d,triggerClassName:f=``,backdropClassName:p=``,animationConfig:m={type:`spring`,stiffness:300,damping:30}}){let[h,g]=w(!1),_=()=>{g(!0),u?.()},v=()=>{g(!1),d?.()},y=hg(o),b=gg(o,s,c);return n(`div`,{className:`flex items-center justify-center w-full ${i}`,children:[t(W,{variant:`unstyled`,size:`none`,onClick:_,className:`w-full align-left cursor-pointer ${f}`,children:e}),h&&t(`div`,{className:`z-45 fixed inset-0 bg-black bg-opacity-50 ${p}`,children:n(pg.div,{...y,transition:m,className:`${b} ${a}`,children:[l&&t(`div`,{className:`absolute top-2 end-2 z-10`,children:t(W,{onClick:v,variant:`primary`,children:t(wt,{})})}),t(`div`,{className:l?`mt-8`:``,children:r})]})})]})}function hg(e){switch(e){case`left`:return{initial:{x:`-100%`},animate:{x:0},exit:{x:`-100%`}};case`right`:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}};case`top`:return{initial:{y:`-100%`},animate:{y:0},exit:{y:`-100%`}};case`bottom`:return{initial:{y:`100%`},animate:{y:0},exit:{y:`100%`}};case`center`:return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}};default:return{initial:{x:`100%`},animate:{x:0},exit:{x:`100%`}}}}function gg(e,t,n){let r=`fixed bg-white shadow-lg p-4 relative`;switch(e){case`left`:return`${r} left-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`right`:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`;case`top`:return`${r} top-[var(--header-height)] start-0 end-0 ${n||`h-80`}`;case`bottom`:return`${r} bottom-0 start-0 end-0 ${n||`h-80`}`;case`center`:return`${r} top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 ${t||`w-96`} ${n||`max-h-96`}`;default:return`${r} right-0 top-[var(--header-height)] h-full ${t||`w-80`}`}}const _g=`--tailwind-portal`;function vg({children:e}){let n=C(null),[r,i]=w(null);return _(()=>{if(n.current){let e=n.current.ownerDocument,t=e.getElementById(_g);t||(t=e.createElement(`DIV`),t.id=_g,e.body.appendChild(t)),i(t)}},[]),r?E(e,r):t(`span`,{ref:n})}function yg({path:e,maxItems:r=3,className:i,separator:o}){let s=e||[],c=e=>{let n=typeof e.label==`string`&&e.label.length>20?`${e.label.slice(0,17)}...`:e.label;return e.onClick?t(wg,{onClick:e.onClick,href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):e.href?t(wg,{href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):t(Tg,{children:n})};if(s.length<=r)return t(bg,{className:B(`w-full flex items-center`,i),children:t(xg,{children:s.map((e,r)=>n(a.Fragment,{children:[t(Sg,{children:c(e)}),r<s.length-1&&t(Eg,{children:o??t(He,{className:`cn-rtl-flip`})})]},`crumb-${r}`))})});let l=s.slice(-(r-1));return t(bg,{className:B(`w-full flex items-center`,i),children:n(xg,{children:[t(Sg,{children:t(Dg,{})}),t(Eg,{children:o??t(He,{className:`cn-rtl-flip`})}),l.map((e,r)=>n(a.Fragment,{children:[t(Sg,{children:c(e)}),r<l.length-1&&t(Eg,{children:o??t(He,{className:`cn-rtl-flip`})})]},`crumb-${r}`))]})})}const bg=a.forwardRef(({...e},n)=>t(`nav`,{ref:n,"aria-label":`breadcrumb`,...e}));bg.displayName=`Breadcrumb`;const xg=a.forwardRef(({className:e,...n},r)=>t(`ol`,{ref:r,className:B(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted sm:gap-2.5`,e),...n}));xg.displayName=`BreadcrumbList`;const Sg=a.forwardRef(({className:e,...n},r)=>t(`li`,{ref:r,className:B(`inline-flex items-center gap-1.5 text-muted`,e),...n}));Sg.displayName=`BreadcrumbItem`;const Cg=a.forwardRef(({asChild:e,className:n,...r},i)=>t(`a`,{ref:i,className:B(`transition-colors hover:text-muted`,n),...r}));Cg.displayName=`BreadcrumbLink`;const wg=a.forwardRef(({className:e,href:n,onClick:r,...i},a)=>t(W,{variant:`ghost`,size:`md`,ref:a,className:B(`p-0! hover:underline! hover:bg-background!`,e),onClick:e=>{e.preventDefault(),r&&r(e)},...i}));wg.displayName=`BreadcrumbButton`;const Tg=a.forwardRef(({className:e,...n},r)=>t(`span`,{ref:r,"aria-current":`page`,className:B(`font-normal text-foreground`,e),...n}));Tg.displayName=`BreadcrumbPage`;const Eg=({children:e,className:n,...r})=>t(`li`,{role:`presentation`,"aria-hidden":`true`,className:B(`[&>svg]:w-3.5 [&>svg]:h-3.5`,n),...r,children:e??t(He,{className:`cn-rtl-flip`})});Eg.displayName=`BreadcrumbSeparator`;const Dg=({className:e,...r})=>n(`span`,{role:`presentation`,"aria-hidden":`true`,className:B(`flex h-9 w-9 items-center justify-center`,e),...r,children:[t(nt,{className:`h-4 w-4`}),t(`span`,{className:`sr-only`,children:`More`})]});Dg.displayName=`BreadcrumbEllipsis`;const Og=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`rounded-xl border bg-card text-card-foreground shadow`,e),...n}));Og.displayName=`Card`;const kg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex flex-col p-6`,e),...n}));kg.displayName=`CardHeader`;const Ag=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`font-semibold leading-none tracking-tight`,e),...n}));Ag.displayName=`CardTitle`;const jg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`text-sm text-muted`,e),...n}));jg.displayName=`CardDescription`;const Mg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`p-6 pt-0`,e),...n}));Mg.displayName=`CardContent`;const Ng=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex items-center p-6 pt-0`,e),...n}));Ng.displayName=`CardFooter`;var Pg=Object.defineProperty,Fg=(e,t)=>Pg(e,`name`,{value:t,configurable:!0}),Ig=`Checkbox`,[Lg,Rg]=/* @__PURE__ */ Pn(Ig),[zg,Bg]=Lg(Ig);function Vg(e){let{__scopeCheckbox:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=Yr({prop:r,defaultProp:o??!1,onChange:u,caller:Ig}),[g,_]=a.useState(null),[v,y]=a.useState(null),[b,x]=a.useState(null),S=!g||!!c||!!g.closest(`form`),C={checked:m,disabled:s,setChecked:h,control:g,setControl:_,name:l,form:c,value:f,userClick:b,onUserClick:x,required:d,defaultChecked:!Xg(o)&&o,isFormControl:S,bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(zg,{scope:n,...C,children:Yg(p)?p(C):i})}Fg(Vg,`CheckboxProvider`);var Hg=`CheckboxTrigger`,Ug=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Fg(function({__scopeCheckbox:e,onKeyDown:n,onClick:r,...i},o){let{control:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,onUserClick:m,isFormControl:h,bubbleInput:g}=Bg(Hg,e),_=z(o,f),v=a.useRef(u);return a.useEffect(()=>{let e=s?.form;if(e){let t=/* @__PURE__ */ Fg(()=>p(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,p]),/* @__PURE__ */ t(U.button,{type:`button`,role:`checkbox`,"aria-checked":Xg(u)?`mixed`:u,"aria-required":d,"data-state":Zg(u),"data-disabled":l?``:void 0,disabled:l,value:c,...i,ref:_,onKeyDown:V(n,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:V(r,e=>{let t=e.isPropagationStopped();m({requestedChecked:Xg(u)?!0:!u,hasConsumerStoppedPropagation:t}),p(e=>Xg(e)?!0:!e),g&&h&&(t||e.stopPropagation())})})},`CheckboxTrigger`)),Wg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Fg(function(r,i){let{__scopeCheckbox:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return/* @__PURE__ */ t(Vg,{__scopeCheckbox:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(Ug,{...m,ref:i,__scopeCheckbox:a}),r&&/* @__PURE__ */ t(Jg,{__scopeCheckbox:a})]})})},`Checkbox`)),Gg=`CheckboxIndicator`,Kg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Fg(function(e,n){let{__scopeCheckbox:r,forceMount:i,...a}=e,o=Bg(Gg,r);return/* @__PURE__ */ t(Fr,{present:i||Xg(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(U.span,{"data-state":Zg(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),qg=`CheckboxBubbleInput`,Jg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Fg(function({__scopeCheckbox:e,onClick:n,...r},i){let{control:o,userClick:s,checked:c,defaultChecked:l,required:u,disabled:d,name:f,value:p,form:m,bubbleInput:h,setBubbleInput:g}=Bg(qg,e),_=z(i,g),v=ur(o),y=a.useRef(!1),b=a.useRef(c),x=a.useRef(s),S=a.useRef(null);a.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=b.current!==c;b.current=c;let i=s!==null&&s!==x.current;if(x.current=s,i)S.current=r?null:s,r&&(e.indeterminate=Xg(c),n.call(e,!Xg(c)&&c)),e.dispatchEvent(new Event(`click`,{bubbles:!s.hasConsumerStoppedPropagation}));else if(r){let t=S.current;S.current=null;let r=t?.requestedChecked===c;y.current=!0,e.indeterminate=Xg(c),n.call(e,!Xg(c)&&c),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),y.current=!1}},[h,c,s]);let C=a.useRef(!Xg(c)&&c);return/* @__PURE__ */ t(U.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:l??C.current,required:u,disabled:d,name:f,value:p,form:m,...r,tabIndex:-1,ref:_,onClick:V(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Yg(e){return typeof e==`function`}Fg(Yg,`isFunction`);function Xg(e){return e===`indeterminate`}Fg(Xg,`isIndeterminate`);function Zg(e){return Xg(e)?`indeterminate`:e?`checked`:`unchecked`}Fg(Zg,`getState`);const Qg=a.forwardRef(({className:e,...n},r)=>t(Wg,{ref:r,className:B(`peer size-4 shrink-0 rounded-sm border border-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white`,e),...n,children:t(Kg,{className:B(`flex items-center justify-center text-current`),children:t(Re,{className:`size-4`})})}));Qg.displayName=Wg.displayName;var $g=Object.defineProperty,e_=(e,t)=>$g(e,`name`,{value:t,configurable:!0}),t_=`Collapsible`,[n_,r_]=/* @__PURE__ */ Pn(t_),[i_,a_]=n_(t_),o_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ e_(function(e,n){let{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:s,onOpenChange:c,...l}=e,[u,d]=Yr({prop:i,defaultProp:o??!1,onChange:c,caller:t_});return/* @__PURE__ */ t(i_,{scope:r,disabled:s,contentId:H(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:/* @__PURE__ */ t(U.div,{"data-state":f_(u),"data-disabled":s?``:void 0,...l,ref:n})})},`Collapsible`)),s_=`CollapsibleTrigger`,c_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ e_(function(e,n){let{__scopeCollapsible:r,...i}=e,a=a_(s_,r);return/* @__PURE__ */ t(U.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":f_(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...i,ref:n,onClick:V(e.onClick,a.onOpenToggle)})},`CollapsibleTrigger`)),l_=`CollapsibleContent`,u_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ e_(function(e,n){let{forceMount:r,...i}=e,a=a_(l_,e.__scopeCollapsible);return/* @__PURE__ */ t(Fr,{present:r||a.open,children:({present:e})=>/* @__PURE__ */ t(d_,{...i,ref:n,present:e})})},`CollapsibleContent`)),d_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ e_(function(e,n){let{__scopeCollapsible:r,present:i,children:o,...s}=e,c=a_(l_,r),[l,u]=a.useState(i),d=a.useRef(null),f=z(n,d),p=a.useRef(0),m=p.current,h=a.useRef(0),g=h.current,_=c.open||l,v=a.useRef(_),y=a.useRef(void 0);return a.useEffect(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),In(()=>{let e=d.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();p.current=t.height,h.current=t.width,v.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),u(i)}},[c.open,i]),/* @__PURE__ */ t(U.div,{"data-state":f_(c.open),"data-disabled":c.disabled?``:void 0,id:c.contentId,hidden:!_,...s,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:_&&o})},`CollapsibleContentImpl`));function f_(e){return e?`open`:`closed`}e_(f_,`getState`);function p_({...e}){return t(o_,{"data-slot":`collapsible`,...e})}function m_({...e}){return t(c_,{"data-slot":`collapsible-trigger`,...e})}function h_({...e}){return t(u_,{"data-slot":`collapsible-content`,...e})}var g_=1,__=.9,v_=.8,y_=.17,b_=.1,x_=.999,S_=.9999,C_=.99,w_=/[\\\/_+.#"@\[\(\{&]/,T_=/[\\\/_+.#"@\[\(\{&]/g,E_=/[\s-]/,D_=/[\s-]/g;function O_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?g_:C_;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=O_(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=g_:w_.test(e.charAt(l-1))?(d*=v_,p=e.slice(i,l-1).match(T_),p&&i>0&&(d*=x_**+p.length)):E_.test(e.charAt(l-1))?(d*=__,m=e.slice(i,l-1).match(D_),m&&i>0&&(d*=x_**+m.length)):(d*=y_,i>0&&(d*=x_**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=S_)),(d<b_&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=O_(e,t,n,r,l+1,a+2,o),f*b_>d&&(d=f*b_)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function k_(e){return e.toLowerCase().replace(D_,` `)}function A_(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,O_(e,t,k_(e),k_(t),0,0,{})}var j_=Object.defineProperty,M_=(e,t)=>j_(e,`name`,{value:t,configurable:!0}),N_=`Dialog`,[P_,F_]=/* @__PURE__ */ Pn(N_),[I_,L_]=P_(N_),R_=/* @__PURE__ */ M_(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,l=a.useRef(null),u=a.useRef(null),{nodes:d,registry:f}=I(),[p,m]=Yr({prop:i,defaultProp:o??!1,onChange:s,caller:N_}),[h,g]=a.useState(0),[_,v]=a.useState(0);return/* @__PURE__ */ t(I_,{scope:n,triggerRef:l,contentRef:u,contentId:H(),titleId:H(),descriptionId:H(),titlePresent:h>0,descriptionPresent:_>0,setTitleCount:g,setDescriptionCount:v,open:p,onOpenChange:m,onOpenToggle:a.useCallback(()=>m(e=>!e),[m]),modal:c,branchNodes:d,branchRegistry:f,children:r})},`Dialog`),z_=`DialogTrigger`,B_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,...i}=e,a=L_(z_,r),o=z(n,a.triggerRef);return/* @__PURE__ */ t(U.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":av(a.open),...i,ref:o,onClick:V(e.onClick,a.onOpenToggle)})},`DialogTrigger`)),V_=`DialogPortal`,[H_,U_]=P_(V_,{forceMount:void 0}),W_=/* @__PURE__ */ M_(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=L_(V_,n);return/* @__PURE__ */ t(H_,{scope:n,forceMount:r,children:a.Children.map(i,e=>/* @__PURE__ */ t(Fr,{present:r||s.open,children:/* @__PURE__ */ t(jr,{asChild:!0,container:o,children:e})}))})},`DialogPortal`),G_=`DialogOverlay`,K_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let r=U_(G_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=L_(G_,e.__scopeDialog);return o.modal?/* @__PURE__ */ t(Fr,{present:i||o.open,children:/* @__PURE__ */ t(J_,{...a,ref:n})}):null},`DialogOverlay`)),q_=/* @__PURE__ */ cn(`DialogOverlay.RemoveScroll`),J_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,...i}=e,o=L_(G_,r),s=z(n,N());return/* @__PURE__ */ t(fe,{as:q_,allowPinchZoom:!0,shards:a.useMemo(()=>[o.contentRef,...o.branchNodes.map(e=>({current:e}))],[o.contentRef,o.branchNodes]),children:/* @__PURE__ */ t(U.div,{"data-state":av(o.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),Y_=`DialogContent`,X_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let r=U_(Y_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=L_(Y_,e.__scopeDialog);return/* @__PURE__ */ t(Fr,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(Z_,{...a,ref:n}):/* @__PURE__ */ t(Q_,{...a,ref:n})})},`DialogContent`)),Z_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let r=L_(Y_,e.__scopeDialog),i=a.useRef(null),o=z(n,r.contentRef,i);return a.useEffect(()=>{let e=i.current;if(e)return pe(e)},[]),/* @__PURE__ */ t($_,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Q_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let r=L_(Y_,e.__scopeDialog),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t($_,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&o.current&&t.preventDefault()}})},`DialogContentNonModal`)),$_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,"aria-describedby":s,children:c,...l}=e,u=L_(Y_,r);return de(),/* @__PURE__ */ t(F,{registry:u.branchRegistry,children:/* @__PURE__ */ t(P,{asChild:!0,loop:!0,trapped:i,branches:u.branchNodes,onMountAutoFocus:a,onUnmountAutoFocus:o,children:/* @__PURE__ */ t(M,{role:`dialog`,id:u.contentId,"aria-labelledby":u.titlePresent?u.titleId:void 0,"aria-describedby":u.descriptionPresent?iv(s,u.descriptionId):s,"data-state":av(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1),children:c})})})},`DialogContentImpl`)),ev=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,...i}=e,a=L_(`DialogTitle`,r),{setTitleCount:o}=a;return In(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(U.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),tv=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,...i}=e,a=L_(`DialogDescription`,r),{setDescriptionCount:o}=a;return In(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(U.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),nv=`DialogClose`,rv=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ M_(function(e,n){let{__scopeDialog:r,...i}=e,a=L_(nv,r);return/* @__PURE__ */ t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function iv(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}M_(iv,`concatAriaDescribedby`);function av(e){return e?`open`:`closed`}M_(av,`getState`);var ov=`[cmdk-group=""]`,sv=`[cmdk-group-items=""]`,cv=`[cmdk-group-heading=""]`,lv=`[cmdk-item=""]`,uv=`${lv}:not([aria-disabled="true"])`,dv=`cmdk-item-select`,fv=`data-value`,pv=(e,t,n)=>A_(e,t,n),mv=a.createContext(void 0),hv=()=>a.useContext(mv),gv=a.createContext(void 0),_v=()=>a.useContext(gv),vv=a.createContext(void 0),yv=a.forwardRef((e,t)=>{let n=Nv(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=Nv(()=>/* @__PURE__ */ new Set),i=Nv(()=>/* @__PURE__ */ new Map),o=Nv(()=>/* @__PURE__ */ new Map),s=Nv(()=>/* @__PURE__ */ new Set),c=jv(e),{label:l,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=H(),b=H(),x=H(),S=a.useRef(null),C=Iv();Mv(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),Mv(()=>{C(6,A)},[]);let w=a.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),c.current?.value!==void 0){let e=t??``;(o=(a=c.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),T=a.useMemo(()=>({value:(e,t,r)=>{t!==o.current.get(e)?.value&&(o.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,/* @__PURE__ */ new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{o.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,/* @__PURE__ */ new Set),()=>{o.current.delete(e),i.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e[`aria-label`],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=c.current?.filter??pv;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||c.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(sv);t?t.appendChild(e.parentElement===t?e:e.closest(`${sv} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${sv} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${ov}[${fv}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(fv);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=/* @__PURE__ */ new Set;let e=0;for(let t of r.current){let r=E(o.current.get(t)?.value??``,o.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(ov)?.querySelector(cv))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${lv}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(uv)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(fv))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=c.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(fv))}function F(e){let t=j()?.closest(ov),n;for(;t&&!n;)t=e>0?kv(t,ov):Av(t,ov),n=t?.querySelector(uv);n?w.setState(`value`,n.getAttribute(fv)):P(e)}let ee=()=>N(M().length-1),I=e=>{e.preventDefault(),e.metaKey?ee():e.altKey?F(1):P(1)},te=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return a.createElement(U.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:_&&e.ctrlKey&&te(e);break;case`ArrowUp`:te(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),ee();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(dv);t.dispatchEvent(e)}}}}},a.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:zv},l),Rv(e,e=>a.createElement(gv.Provider,{value:w},a.createElement(mv.Provider,{value:T},e))))}),bv=a.forwardRef((e,t)=>{let n=H(),r=a.useRef(null),i=a.useContext(vv),o=hv(),s=jv(e),c=s.current?.forceMount??i?.forceMount;Mv(()=>{if(!c)return o.item(n,i?.id)},[c]);let l=Fv(n,r,[e.value,e.children,r],e.keywords),u=_v(),d=Pv(e=>e.value&&e.value===l.current),f=Pv(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);a.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(dv,p),()=>t.removeEventListener(dv,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return a.createElement(U.div,{ref:an(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||o.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),xv=a.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=H(),c=a.useRef(null),l=a.useRef(null),u=H(),d=hv(),f=Pv(e=>i||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));Mv(()=>d.group(s),[]),Fv(s,c,[e.value,e.heading,l]);let p=a.useMemo(()=>({id:s,forceMount:i}),[i]);return a.createElement(U.div,{ref:an(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},n&&a.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Rv(e,e=>a.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},a.createElement(vv.Provider,{value:p},e))))}),Sv=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=a.useRef(null),o=Pv(e=>!e.search);return!n&&!o?null:a.createElement(U.div,{ref:an(i,t),...r,"cmdk-separator":``,role:`separator`})}),Cv=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=_v(),s=Pv(e=>e.search),c=Pv(e=>e.selectedItemId),l=hv();return a.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),a.createElement(U.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:s,onChange:e=>{i||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),wv=a.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,o=a.useRef(null),s=a.useRef(null),c=Pv(e=>e.selectedItemId),l=hv();return a.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),a.createElement(U.div,{ref:an(o,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Rv(e,e=>a.createElement(`div`,{ref:an(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),Tv=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...c}=e;return a.createElement(R_,{open:n,onOpenChange:r},a.createElement(W_,{container:s},a.createElement(K_,{"cmdk-overlay":``,className:i}),a.createElement(X_,{"aria-label":e.label,"cmdk-dialog":``,className:o},a.createElement(yv,{ref:t,...c}))))}),Ev=a.forwardRef((e,t)=>Pv(e=>e.filtered.count===0)?a.createElement(U.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Dv=a.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...o}=e;return a.createElement(U.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Rv(e,e=>a.createElement(`div`,{"aria-hidden":!0},e)))}),Ov=Object.assign(yv,{List:wv,Item:bv,Input:Cv,Group:xv,Separator:Sv,Dialog:Tv,Empty:Ev,Loading:Dv});function kv(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Av(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function jv(e){let t=a.useRef(e);return Mv(()=>{t.current=e}),t}var Mv=typeof window>`u`?a.useEffect:a.useLayoutEffect;function Nv(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function Pv(e){let t=_v(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function Fv(e,t,n,r=[]){let i=a.useRef(),o=hv();return Mv(()=>{var a;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());o.value(e,s,c),(a=t.current)==null||a.setAttribute(fv,s),i.current=s}),i}var Iv=()=>{let[e,t]=a.useState(),n=Nv(()=>/* @__PURE__ */ new Map);return Mv(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Lv(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Rv({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(Lv(t),{ref:t.ref},n(t.props.children)):n(t)}var zv={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Bv({children:e}){return t(`span`,{style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`},children:e})}const Vv=d(!1);function Hv(){return!!g(Vv)}function Uv({children:e}){return t(Vv.Provider,{value:!0,children:e})}function Wv({className:e,children:r,isOpen:i,onClose:a,description:o=`Modal Description`,noCloseButton:s=!1,allowOverflow:c=!1,disableCloseOnClickOutside:l=!1,size:u=`md`,action:d}){let f=e=>{e||a()};function p(){switch(u){case`sm`:return`max-w-[20vw]`;case`md`:return`max-w-[60vw] lg:max-w-[40vw]`;case`lg`:return`max-w-[80vw] md:max-w-[60vw]`;case`xl`:return`max-w-[95vw] lg:max-w-[80vw]`;case`full`:return`h-[calc(100vh-2rem)] max-w-[calc(100vw-2rem)]`;default:return`max-w-[60vw] lg:max-w-[40vw]`}}return n(Jv,{open:i,onOpenChange:e=>{(!l||e)&&f(e)},children:[c&&t(Qv,{className:`z-50 fixed inset-0 bg-black/80`}),t(Bv,{children:t(ey,{children:o})}),n($v,{className:B(`min-h-20 p-4`,`fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 sm:rounded-lg`,p(),e),children:[t(`div`,{className:`top-4 end-4 absolute`,children:n(`div`,{className:`flex gap-2`,children:[d&&d,!s&&t(Zv,{onClick:()=>f(!1),asChild:!0,autoFocus:!1,children:t(W,{variant:`outline`,title:`Close`,className:`data-[state=open]:bg-muted opacity-70 hover:opacity-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-ring ring-offset-background focus:ring-offset-2 data-[state=open]:text-muted transition-opacity disabled:pointer-events-none`,children:t(wt,{className:`size-4`})})})]})}),t(Uv,{children:r})]})]})}const Gv=({children:e,show:r=!0,className:i,description:a,showDivider:o=!1,...s})=>r?n(ty,{className:B(o?`border-b-solid border-b border-b-1 pb-2 mb-4`:``,`text-lg font-semibold leading-6 tracking-tight`,{"py-2":!a},i),...s,children:[e,a&&t(ey,{className:`text-sm !font-normal text-muted pb-2`,children:a})]}):n(Bv,{children:[t(ty,{children:e}),a&&t(ey,{children:a})]}),Kv=({children:e,className:n,...r})=>t(`div`,{className:B(`text-sm max-h-[80vh] overflow-y-auto`,n),...r,children:e}),qv=({align:e=`right`,children:n,className:r,...i})=>t(`div`,{className:B(`w-full flex py-3 sm:py-2 sm:flex sm:flex-row-reverse sm:flex-row sm:justify-end gap-2`,{left:`justify-start`,center:`justify-center`,right:`justify-end`}[e],r),...i,children:n}),Jv=R_,Yv=B_,Xv=W_,Zv=rv,Qv=a.forwardRef(({className:e,...n},r)=>t(K_,{ref:r,className:B(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...n}));Qv.displayName=K_.displayName;const $v=a.forwardRef(({className:e,children:r,...i},a)=>{let o=Bi();return n(Xv,{container:o,children:[t(Qv,{}),t(X_,{ref:a,className:B(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...i,children:r})]})});$v.displayName=X_.displayName;const ey=a.forwardRef(({className:e,...n},r)=>t(tv,{ref:r,className:B(`text-sm text-muted`,e),...n}));ey.displayName=tv.displayName;const ty=a.forwardRef(({className:e,...n},r)=>t(ev,{ref:r,className:B(`text-lg font-semibold leading-none tracking-tight`,e),...n}));ty.displayName=ev.displayName;const ny=a.forwardRef(({className:e,...n},r)=>t(Ov,{ref:r,className:B(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...n}));ny.displayName=Ov.displayName;const ry=({children:e,...n})=>t(Jv,{...n,children:t($v,{className:`shadow-lg p-0 overflow-hidden`,children:t(ny,{className:`[&_[cmdk-group]]:px-2 [&_[cmdk-item]]:px-2 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:w-5 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,children:e})})}),iy=a.forwardRef(({className:e,...r},i)=>n(`div`,{className:`flex items-center px-3 border-b`,"cmdk-input-wrapper":``,children:[t(gt,{className:`opacity-50 size-4 shrink-0`}),t(Ov.Input,{ref:i,className:B(`focus:ring-0`,`border-0 flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted disabled:cursor-not-allowed disabled:opacity-50`,e),...r})]}));iy.displayName=Ov.Input.displayName;const ay=a.forwardRef(({className:e,...n},r)=>t(Ov.List,{ref:r,className:B(`overflow-y-auto overflow-x-hidden`,e),...n}));ay.displayName=Ov.List.displayName;const oy=a.forwardRef((e,n)=>t(Ov.Empty,{ref:n,className:`py-2 text-sm text-center`,...e}));oy.displayName=Ov.Empty.displayName;const sy=a.forwardRef(({className:e,...n},r)=>t(Ov.Group,{ref:r,className:B(`overflow-y-auto overflow-x-hidden p-1 text-foreground`,`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,e),...n}));sy.displayName=Ov.Group.displayName;const cy=a.forwardRef(({className:e,...n},r)=>t(Ov.Separator,{ref:r,className:B(`-mx-1 h-px bg-border`,e),...n}));cy.displayName=Ov.Separator.displayName;const ly=a.forwardRef(({className:e,...n},r)=>t(Ov.Item,{ref:r,className:B(`hover:bg-muted cursor-pointer relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-muted data-[selected=true]:text-muted data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,e),...n}));ly.displayName=Ov.Item.displayName;const uy=({className:e,...n})=>t(`span`,{className:B(`ms-auto text-xs tracking-widest text-muted`,e),...n});uy.displayName=`CommandShortcut`;var dy=Object.defineProperty,fy=(e,t)=>dy(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
245
|
+
function py(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ Pn(n),[o,s]=r(n,{collectionRef:{current:null},itemMap:/* @__PURE__ */ new Map}),c=/* @__PURE__ */ fy(e=>{let{scope:n,children:r}=e,i=a.useRef(null),s=a.useRef(/* @__PURE__ */ new Map).current;return/* @__PURE__ */ t(o,{scope:n,itemMap:s,collectionRef:i,children:r})},`CollectionProvider`);c.displayName=n;let l=e+`CollectionSlot`,u=/* @__PURE__ */ cn(l),d=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=z(n,s(l,r).collectionRef);return/* @__PURE__ */ t(u,{ref:a,children:i})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=/* @__PURE__ */ cn(f),h=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),l=z(n,c),u=s(f,r);return a.useEffect(()=>(u.itemMap.set(c,{ref:c,...o}),()=>void u.itemMap.delete(c))),/* @__PURE__ */ t(m,{[p]:``,ref:l,children:i})});h.displayName=f;function g(t){let n=s(e+`CollectionConsumer`,t);return a.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return fy(g,`useCollection`),[{Provider:c,Slot:d,ItemSlot:h},g,i]}fy(py,`createCollection`);var my=/* @__PURE__ */ new WeakMap,hy=class e extends Map{static{fy(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],my.set(this,!0)}set(e,t){return my.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=vy(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=gy(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=gy(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return gy(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function gy(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=_y(e,t);return n===-1?void 0:e[n]}fy(gy,`at`);function _y(e,t){let n=e.length,r=vy(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}fy(_y,`toSafeIndex`);function vy(e){return e!==e||e===0?0:Math.trunc(e)}fy(vy,`toSafeInteger`);// @__NO_SIDE_EFFECTS__
|
|
246
|
+
function yy(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ Pn(n),[o,s]=r(n);o.displayName=e+`CollectionStableContextProvider`;let[c,l]=r(n);c.displayName=e+`CollectionStatefulContextProvider`;let u=/* @__PURE__ */ fy(({state:e,...n})=>e?/* @__PURE__ */ t(f,{...n,state:e}):/* @__PURE__ */ t(d,{...n}),`CollectionProvider`);u.displayName=n;let d=/* @__PURE__ */ fy(e=>{let n=y();return/* @__PURE__ */ t(f,{...e,state:n})},`CollectionInit`);d.displayName=e+`CollectionInit`;let f=/* @__PURE__ */ fy(e=>{let{scope:n,children:r,state:i}=e,s=a.useRef(null),[l,u]=a.useState(null),d=z(s,u),[f,p]=i,m=a.useRef(new hy),h=a.useCallback(()=>{let e=m.current;return Sy(e)||e.sort(Cy),e},[]);return a.useEffect(()=>{if(!l)return;let e=wy(()=>{p(e=>{let t=e.toSorted(Cy);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(l,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[l,p]),/* @__PURE__ */ t(o,{scope:n,collectionElementRef:d,collectionElementRefObject:s,getCollection:h,setCollection:p,registryRef:m,children:/* @__PURE__ */ t(c,{scope:n,collectionElement:l,collection:f,children:r})})},`CollectionProviderImpl`);f.displayName=e+`CollectionProviderImpl`;let p=e+`CollectionSlot`,m=/* @__PURE__ */ cn(p),h=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=z(n,s(p,r).collectionElementRef);return/* @__PURE__ */ t(m,{ref:a,children:i})});h.displayName=p;let g=e+`CollectionItemSlot`,_=/* @__PURE__ */ cn(g),v=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),{setCollection:l,registryRef:u}=s(g,r),d=a.useRef(o);by(d.current,o)||(d.current=o);let f=d.current,p=z(n,a.useCallback(e=>{let t=u.current;e?t.set(e,{...d.current,element:e}):c.current&&t.delete(c.current)},[u]),c);In(()=>{let e=c.current,t=u.current;e&&t.has(e)&&t.set(e,{...f,element:e})},[f,u]);let m=a.useRef(null);return a.useEffect(()=>{let e=c.current,t=m.current;((t?.element??null)!==e||e&&t?.itemData!==f)&&(m.current=e?{element:e,itemData:f}:null,l(n=>{let r=new hy(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...f,element:e}),r.sort(Cy)}))}),a.useEffect(()=>()=>{let e=m.current;m.current=null,e&&l(t=>{if(!t.has(e.element))return t;let n=new hy(t);return n.delete(e.element),n})},[l]),/* @__PURE__ */ t(_,{"data-radix-collection-item":``,ref:p,children:i})});v.displayName=g;function y(){return a.useState(new hy)}fy(y,`useInitCollection`);function b(t){let{collection:n}=l(e+`CollectionConsumer`,t);return n}fy(b,`useCollection`);function x(t){let{getCollection:n}=s(e+`CollectionConsumer`,t);return n}return fy(x,`useGetCollection`),[{Provider:u,Slot:h,ItemSlot:v},{createCollectionScope:i,useCollection:b,useGetCollection:x,useInitCollection:y}]}fy(yy,`createCollection`);function by(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}fy(by,`shallowEqual`);function xy(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}fy(xy,`isElementPreceding`);function Sy(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}fy(Sy,`isInDocumentOrder`);function Cy(e,t){return!e[1].element||!t[1].element?0:xy(e[1].element,t[1].element)?-1:1}fy(Cy,`sortByDocumentPosition`);function wy(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}fy(wy,`getChildListObserver`);var Ty=Object.defineProperty,Ey=(e,t)=>Ty(e,`name`,{value:t,configurable:!0}),Dy=!1;function Oy(){let[e,t]=a.useState(Dy);return a.useEffect(()=>{Dy||(Dy=!0,t(!0))},[]),e}Ey(Oy,`useIsHydrated`);var ky=a.useSyncExternalStore;function Ay(){return()=>{}}Ey(Ay,`subscribe`);function jy(){return ky(Ay,()=>!0,()=>!1)}Ey(jy,`useIsHydratedModern`);var My=typeof ky==`function`?jy:Oy,Ny=Object.defineProperty,Py=(e,t)=>Ny(e,`name`,{value:t,configurable:!0}),Fy=`rovingFocusGroup.onEntryFocus`,Iy={bubbles:!1,cancelable:!0},Ly=`RovingFocusGroup`,[Ry,zy,By]=/* @__PURE__ */ py(Ly),[Vy,Hy]=/* @__PURE__ */ Pn(Ly,[By]),Uy={Vertical:`vertical`,Horizontal:`horizontal`},Wy={LTR:`ltr`,RTL:`rtl`},[Gy,Ky]=Vy(Ly),qy=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Py(function(e,n){return/* @__PURE__ */ t(Ry.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Ry.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Jy,{...e,ref:n})})})},`RovingFocusGroup`)),Jy=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Py(function(e,n){let{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=a.useRef(null),h=z(n,m),g=me(s),[_,v]=Yr({prop:c,defaultProp:l??null,onChange:u,caller:Ly}),[y,b]=a.useState(!1),x=sr(d),S=zy(r),C=a.useRef(!1),[w,T]=a.useState(0);return a.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Fy,x),()=>e.removeEventListener(Fy,x)},[x]),/* @__PURE__ */ t(Gy,{scope:r,orientation:i,dir:g,loop:o,currentTabStopId:_,onItemFocus:a.useCallback(e=>v(e),[v]),onItemShiftTab:a.useCallback(()=>b(!0),[]),onFocusableItemAdd:a.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>T(e=>e-1),[]),children:/* @__PURE__ */ t(U.div,{tabIndex:y||w===0?-1:0,"data-orientation":i,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(Fy,Iy);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);eb([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}C.current=!1}),onBlur:V(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),Yy=`RovingFocusGroupItem`,Xy=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Py(function(e,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=H(),d=s||u,f=Ky(Yy,r),p=f.currentTabStopId===d,m=zy(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f,v=My();return In(()=>{if(v&&i)return h(),()=>g()},[v,i,h,g]),a.useEffect(()=>{if(!v&&i)return h(),()=>g()},[v,i,h,g]),/* @__PURE__ */ t(Ry.ItemSlot,{scope:r,id:d,focusable:i,active:o,children:/* @__PURE__ */ t(U.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:n,onMouseDown:V(e.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:V(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:V(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=$y(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?tb(n,r+1):n.slice(r+1)}setTimeout(()=>eb(n))}}),children:typeof c==`function`?c({isCurrentTabStop:p,hasTabStop:_!=null}):c})})},`RovingFocusGroupItem`)),Zy={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Qy(e,t){return t===Wy.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Py(Qy,`getDirectionAwareKey`);function $y(e,t,n){let r=Qy(e.key,n);if(!(t===Uy.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Uy.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Zy[r]}Py($y,`getFocusIntent`);function eb(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Py(eb,`focusFirst`);function tb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Py(tb,`wrapArray`);var nb=Object.defineProperty,X=(e,t)=>nb(e,`name`,{value:t,configurable:!0}),rb={LTR:`ltr`,RTL:`rtl`},ib=[`Enter`,` `],ab=[`ArrowDown`,`PageUp`,`Home`],ob=[`ArrowUp`,`PageDown`,`End`],sb=[...ab,...ob],cb={ltr:[...ib,`ArrowRight`],rtl:[...ib,`ArrowLeft`]},lb={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},ub=`Menu`,[db,fb,pb]=/* @__PURE__ */ py(ub),[mb,hb]=/* @__PURE__ */ Pn(ub,[pb,_r,Hy]),gb=_r(),_b=Hy(),[vb,yb]=mb(ub),[bb,xb]=mb(ub),Sb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:s,modal:c=!0}=e,l=gb(n),[u,d]=a.useState(null),f=a.useRef(!1),p=sr(s),m=me(o);return a.useEffect(()=>{let e=/* @__PURE__ */ X(()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=/* @__PURE__ */ X(()=>f.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),a.useEffect(()=>{if(!r)return;let e=/* @__PURE__ */ X(()=>p(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[r,p]),/* @__PURE__ */ t(br,{...l,children:/* @__PURE__ */ t(vb,{scope:n,open:r,onOpenChange:p,content:u,onContentChange:d,children:/* @__PURE__ */ t(bb,{scope:n,onClose:a.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:c,children:i})})})},`Menu`),Cb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e,a=gb(r);return/* @__PURE__ */ t(Sr,{...a,...i,ref:n})},`MenuAnchor`)),wb=`MenuPortal`,[Tb,Eb]=mb(wb,{forceMount:void 0}),Db=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,forceMount:r,children:i,container:a}=e,o=yb(wb,n);return/* @__PURE__ */ t(Tb,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Fr,{present:r||o.open,children:/* @__PURE__ */ t(jr,{asChild:!0,container:a,children:i})})})},`MenuPortal`),Ob=`MenuContent`,[kb,Ab]=mb(Ob),jb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=Eb(Ob,e.__scopeMenu),{forceMount:i=r.forceMount,...a}=e,o=yb(Ob,e.__scopeMenu),s=xb(Ob,e.__scopeMenu);return/* @__PURE__ */ t(db.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Fr,{present:i||o.open,children:/* @__PURE__ */ t(db.Slot,{scope:e.__scopeMenu,children:s.modal?/* @__PURE__ */ t(Mb,{...a,ref:n}):/* @__PURE__ */ t(Nb,{...a,ref:n})})})})},`MenuContent`)),Mb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=yb(Ob,e.__scopeMenu),i=a.useRef(null),o=z(n,i);return a.useEffect(()=>{let e=i.current;if(e)return pe(e)},[]),/* @__PURE__ */ t(Fb,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentModal`)),Nb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=yb(Ob,e.__scopeMenu);return/* @__PURE__ */ t(Fb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentNonModal`)),Pb=/* @__PURE__ */ cn(`MenuContent.ScrollLock`),Fb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=yb(Ob,r),y=xb(Ob,r),b=gb(r),x=_b(r),S=fb(r),[C,w]=a.useState(null),T=a.useRef(null),[E,D]=a.useState(null);ee(E);let{nodes:O,registry:k}=I(),A=!!(o||g),j=z(n,T,v.onContentChange,D),N=a.useRef(0),te=a.useRef(``),ne=a.useRef(0),re=a.useRef(null),ie=a.useRef(`right`),ae=a.useRef(0),oe=a.useMemo(()=>g?[T,...O.map(e=>({current:e}))]:[],[T,O,g]),se=g?fe:a.Fragment,ce=g?{as:Pb,allowPinchZoom:!0,shards:oe}:void 0,le=/* @__PURE__ */ X(e=>{let t=te.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=fx(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){te.current=e,window.clearTimeout(N.current),e!==``&&(N.current=window.setTimeout(()=>s(``),1e3))}X(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);a.useEffect(()=>()=>window.clearTimeout(N.current),[]),de();let ue=a.useCallback(e=>ie.current===re.current?.side&&mx(e,re.current?.area),[]);return/* @__PURE__ */ t(kb,{scope:r,searchRef:te,onItemEnter:a.useCallback(e=>{ue(e)&&e.preventDefault()},[ue]),onItemLeave:a.useCallback(e=>{ue(e)||(T.current?.focus(),w(null))},[ue]),onTriggerLeave:a.useCallback(e=>{ue(e)&&e.preventDefault()},[ue]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:a.useCallback(e=>{re.current=e},[]),children:/* @__PURE__ */ t(F,{registry:A?k:null,children:/* @__PURE__ */ t(se,{...ce,children:/* @__PURE__ */ t(P,{asChild:!0,trapped:o,branches:O,onMountAutoFocus:V(s,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:/* @__PURE__ */ t(qy,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:i,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:V(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */ t(Er,{role:`menu`,"aria-orientation":`vertical`,"data-state":sx(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:j,style:{outline:`none`,..._.style},onKeyDown:V(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&le(e.key));let i=T.current;if(e.target!==i||!sb.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);ob.includes(e.key)&&a.reverse(),ux(a)}),onBlur:V(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),te.current=``)}),onPointerMove:V(e.onPointerMove,hx(e=>{let t=e.target,n=ae.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>ae.current?`right`:`left`;ie.current=t,ae.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Ib=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{role:`group`,...i,ref:n})},`MenuGroup`)),Lb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{...i,ref:n})},`MenuLabel`)),Rb=`MenuItem`,zb=`menu.itemSelect`,Bb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{disabled:r=!1,onSelect:i,...o}=e,s=a.useRef(null),c=xb(Rb,e.__scopeMenu),l=Ab(Rb,e.__scopeMenu),u=z(n,s),d=a.useRef(!1),f=/* @__PURE__ */ X(()=>{let e=s.current;if(!r&&e){let t=new CustomEvent(zb,{bubbles:!0,cancelable:!0});e.addEventListener(zb,e=>i?.(e),{once:!0}),rr(e,t),t.defaultPrevented?d.current=!1:c.onClose()}},`handleSelect`);return/* @__PURE__ */ t(Vb,{...o,ref:u,disabled:r,onClick:V(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:V(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:V(e.onKeyDown,e=>{r||e.target!==e.currentTarget||(l.searchRef.current===``||e.key!==` `)&&ib.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Vb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,disabled:i=!1,textValue:o,...s}=e,c=Ab(Rb,r),l=_b(r),u=a.useRef(null),d=z(n,u),[f,p]=a.useState(!1),[m,h]=a.useState(``);return a.useEffect(()=>{let e=u.current;e&&h((e.textContent??``).trim())},[s.children]),/* @__PURE__ */ t(db.ItemSlot,{scope:r,disabled:i,textValue:o??m,children:/* @__PURE__ */ t(Xy,{asChild:!0,...l,focusable:!i,children:/* @__PURE__ */ t(U.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...s,ref:d,onPointerMove:V(e.onPointerMove,hx(e=>{i?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,hx(e=>c.onItemLeave(e))),onFocus:V(e.onFocus,()=>p(!0)),onBlur:V(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),Hb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{checked:r=!1,onCheckedChange:i,...a}=e;return/* @__PURE__ */ t(Yb,{scope:e.__scopeMenu,checked:r,children:/* @__PURE__ */ t(Bb,{role:`menuitemcheckbox`,"aria-checked":cx(r)?`mixed`:r,...a,ref:n,"data-state":lx(r),onSelect:V(a.onSelect,()=>i?.(cx(r)?!0:!r),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[Ub,Wb]=mb(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ X(()=>{},`onValueChange`)}),Gb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,onValueChange:i,...a}=e,o=sr(i);return/* @__PURE__ */ t(Ub,{scope:e.__scopeMenu,value:r,onValueChange:o,children:/* @__PURE__ */ t(Ib,{...a,ref:n})})},`MenuRadioGroup`)),Kb=`MenuRadioItem`,qb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,...i}=e,a=Wb(Kb,e.__scopeMenu),o=r===a.value;return/* @__PURE__ */ t(Yb,{scope:e.__scopeMenu,checked:o,children:/* @__PURE__ */ t(Bb,{role:`menuitemradio`,"aria-checked":o,...i,ref:n,"data-state":lx(o),onSelect:V(i.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Jb=`MenuItemIndicator`,[Yb,Xb]=mb(Jb,{checked:!1}),Zb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,forceMount:i,...a}=e,o=Xb(Jb,r);return/* @__PURE__ */ t(Fr,{present:i||cx(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(U.span,{...a,ref:n,"data-state":lx(o.checked)})})},`MenuItemIndicator`)),Qb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(U.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:n})},`MenuSeparator`)),$b=`MenuSub`,[ex,tx]=mb($b),nx=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,children:r,open:i=!1,onOpenChange:o}=e,s=yb($b,n),c=gb(n),[l,u]=a.useState(null),[d,f]=a.useState(null),p=sr(o);return a.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),/* @__PURE__ */ t(br,{...c,children:/* @__PURE__ */ t(vb,{scope:n,open:i,onOpenChange:p,content:d,onContentChange:f,children:/* @__PURE__ */ t(ex,{scope:n,contentId:H(),triggerId:H(),trigger:l,onTriggerChange:u,children:r})})})},`MenuSub`),rx=`MenuSubTrigger`,ix=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=yb(rx,e.__scopeMenu),i=xb(rx,e.__scopeMenu),o=tx(rx,e.__scopeMenu),s=Ab(rx,e.__scopeMenu),c=a.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=a.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);a.useEffect(()=>f,[f]),a.useEffect(()=>{let e=l.current;return()=>{window.clearTimeout(e),u(null)}},[l,u]);let p=z(n,o.onTriggerChange);return/* @__PURE__ */ t(Cb,{asChild:!0,...d,children:/* @__PURE__ */ t(Vb,{id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":sx(r.open),...e,ref:p,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:V(e.onPointerMove,hx(t=>{s.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:V(e.onPointerLeave,hx(e=>{f();let t=r.content?.getBoundingClientRect();if(t){let n=r.content?.dataset.side,i=n===`right`,a=i?-5:5,o=t[i?`left`:`right`],c=t[i?`right`:`left`];s.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:o,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:o,y:t.bottom}],side:n}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:V(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(s.searchRef.current===``||t.key!==` `)&&cb[i.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),ax=`MenuSubContent`,ox=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=Eb(Ob,e.__scopeMenu),{forceMount:i=r.forceMount,align:o=`start`,...s}=e,c=yb(Ob,e.__scopeMenu),l=xb(Ob,e.__scopeMenu),u=tx(ax,e.__scopeMenu),d=a.useRef(null),f=z(n,d);return/* @__PURE__ */ t(db.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Fr,{present:i||c.open,children:/* @__PURE__ */ t(db.Slot,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Fb,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:o,side:l.dir===rb.RTL?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:V(e.onFocusOutside,e=>{e.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:V(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:V(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=lb[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function sx(e){return e?`open`:`closed`}X(sx,`getOpenState`);function cx(e){return e===`indeterminate`}X(cx,`isIndeterminate`);function lx(e){return cx(e)?`indeterminate`:e?`checked`:`unchecked`}X(lx,`getCheckedState`);function ux(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(ux,`focusFirst`);function dx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(dx,`wrapArray`);function fx(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=dx(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}X(fx,`getNextMatch`);function px(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}X(px,`isPointInPolygon`);function mx(e,t){return t?px({x:e.clientX,y:e.clientY},t):!1}X(mx,`isPointerInGraceArea`);function hx(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(hx,`whenMouse`);var gx=Object.defineProperty,_x=(e,t)=>gx(e,`name`,{value:t,configurable:!0}),vx=`DropdownMenu`,[yx,bx]=/* @__PURE__ */ Pn(vx,[hb]),xx=hb(),[Sx,Cx]=yx(vx),wx=/* @__PURE__ */ _x(e=>{let{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=xx(n),d=a.useRef(null),[f,p]=Yr({prop:o,defaultProp:s??!1,onChange:c,caller:vx});return/* @__PURE__ */ t(Sx,{scope:n,triggerId:H(),triggerRef:d,contentId:H(),open:f,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:/* @__PURE__ */ t(Sb,{...u,open:f,onOpenChange:p,dir:i,modal:l,children:r})})},`DropdownMenu`),Tx=`DropdownMenuTrigger`,Ex=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=e,o=Cx(Tx,r),s=xx(r),c=z(n,o.triggerRef);return/* @__PURE__ */ t(Cb,{asChild:!0,...s,children:/* @__PURE__ */ t(U.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:c,onPointerDown:V(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:V(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Dx=/* @__PURE__ */ _x(e=>{let{__scopeDropdownMenu:n,...r}=e,i=xx(n);return/* @__PURE__ */ t(Db,{...i,...r})},`DropdownMenuPortal`),Ox=`DropdownMenuContent`,kx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,o=Cx(Ox,r),s=xx(r),c=a.useRef(!1);return/* @__PURE__ */ t(jb,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...i,ref:n,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{c.current||o.triggerRef.current?.focus(),c.current=!1,e.preventDefault()}),onInteractOutside:V(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!o.modal||r)&&(c.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)`}})},`DropdownMenuContent`)),Ax=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Ib,{...a,...i,ref:n})},`DropdownMenuGroup`)),jx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Lb,{...a,...i,ref:n})},`DropdownMenuLabel`)),Mx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Bb,{...a,...i,ref:n})},`DropdownMenuItem`)),Nx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Hb,{...a,...i,ref:n})},`DropdownMenuCheckboxItem`)),Px=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Gb,{...a,...i,ref:n})},`DropdownMenuRadioGroup`)),Fx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(qb,{...a,...i,ref:n})},`DropdownMenuRadioItem`)),Ix=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Zb,{...a,...i,ref:n})},`DropdownMenuItemIndicator`)),Lx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(Qb,{...a,...i,ref:n})},`DropdownMenuSeparator`)),Rx=/* @__PURE__ */ _x(e=>{let{__scopeDropdownMenu:n,children:r,open:i,onOpenChange:a,defaultOpen:o}=e,s=xx(n),[c,l]=Yr({prop:i,defaultProp:o??!1,onChange:a,caller:`DropdownMenuSub`});return/* @__PURE__ */ t(nx,{...s,open:c,onOpenChange:l,children:r})},`DropdownMenuSub`),zx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(ix,{...a,...i,ref:n})},`DropdownMenuSubTrigger`)),Bx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ _x(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=xx(r);return/* @__PURE__ */ t(ox,{...a,...i,ref:n,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)`}})},`DropdownMenuSubContent`));const Vx=a.createContext(!1);function Hx({...e}){return t(wx,{"data-slot":`dropdown-menu`,...e})}function Ux({...e}){return t(Dx,{"data-slot":`dropdown-menu-portal`,...e})}function Wx({...e}){return t(Ex,{"data-slot":`dropdown-menu-trigger`,...e})}function Gx({className:e,align:n=`start`,sideOffset:r=4,...i}){return t(Dx,{children:t(kx,{"data-slot":`dropdown-menu-content`,sideOffset:r,align:n,className:B(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden`,e),...i})})}function Kx({...e}){return t(Ax,{"data-slot":`dropdown-menu-group`,...e})}function qx({className:e,inset:n,variant:r=`default`,...i}){return t(Mx,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":r,className:B(`hover:bg-muted focus:bg-muted data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...i})}function Jx({className:e,children:r,checked:i,inset:a,...o}){return n(Nx,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:B(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),checked:i,...o,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:t(Ix,{children:t(Re,{})})}),r]})}function Yx({...e}){return t(Px,{"data-slot":`dropdown-menu-radio-group`,...e})}function Xx({className:e,children:r,inset:i,...a}){return n(Fx,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:B(`focus:bg-muted focus:text-muted focus:**:text-muted gap-2 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[t(`span`,{className:`absolute end-2 flex items-center justify-center pointer-events-none`,"data-slot":`dropdown-menu-radio-item-indicator`,children:t(Ix,{children:t(Re,{})})}),r]})}function Zx({className:e,inset:n,...r}){return t(jx,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:B(`text-muted px-1.5 py-1 text-xs font-medium data-inset:ps-7`,e),...r})}function Qx({className:e,...n}){return t(Lx,{"data-slot":`dropdown-menu-separator`,className:B(`bg-border -mx-1 my-1 h-px`,e),...n})}function $x({className:e,...n}){return t(`span`,{"data-slot":`dropdown-menu-shortcut`,className:B(`text-muted group-focus/dropdown-menu-item:text-muted ms-auto text-xs tracking-widest`,e),...n})}function eS({...e}){return t(Rx,{"data-slot":`dropdown-menu-sub`,...e})}function tS({className:e,inset:r,children:i,...a}){return n(zx,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":r,className:B(`focus:bg-muted focus:text-muted data-open:bg-muted data-open:text-muted not-data-[variant=destructive]:focus:**:text-muted gap-2 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...a,children:[i,t(He,{className:`cn-rtl-flip ms-auto`})]})}function nS({className:e,...n}){return t(Bx,{"data-slot":`dropdown-menu-sub-content`,className:B(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-lg p-1 shadow-lg ring-1 duration-100 z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden`,e),...n})}const rS={left:`start`,center:`center`,right:`end`};function iS({trigger:e,children:r,align:i=`right`,hover:o}){let[s,c]=a.useState(!1),l=a.useRef(null);return o?n(`div`,{className:`relative inline-flex`,onMouseEnter:()=>{l.current&&clearTimeout(l.current),c(!0)},onMouseLeave:()=>{l.current=setTimeout(()=>c(!1),80)},children:[e,s&&t(`div`,{className:B(`absolute top-full pt-1 z-50`,i===`right`?`end-0`:i===`center`?`left-1/2 -translate-x-1/2`:`start-0`),children:t(`div`,{className:`min-w-32 rounded-lg p-1 shadow-md ring-1 ring-foreground/10 bg-popover text-popover-foreground`,children:t(Vx.Provider,{value:!0,children:r})})})]}):n(Hx,{children:[t(Wx,{asChild:!0,children:t(`span`,{className:`-m-1.5 flex items-center p-1.5`,children:e})}),t(Gx,{align:rS[i],className:`w-max`,children:r})]})}function aS({children:e,label:r}){return n(Kx,{children:[r&&t(Zx,{children:r}),e]})}function oS({children:e,href:n,onClick:r,isDisabled:i=!1,variant:o=`default`,className:s}){let c=a.useContext(Vx),l=B(`w-full gap-2 rounded-md px-1.5 py-1 text-sm text-nowrap [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center select-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,o===`destructive`?`text-destructive`:``,i?`pointer-events-none opacity-50`:`hover:bg-muted focus:bg-muted`,s);return c?n?t(`a`,{href:n,className:l,children:e}):t(`button`,{type:`button`,className:l,disabled:i,onClick:e=>{e.stopPropagation(),r?.(e)},children:e}):t(qx,{className:B(`data-[disabled]:pointer-events-none data-[disabled]:opacity-50 text-nowrap`,s),disabled:i,variant:o,onClick:e=>{e.stopPropagation(),r?.(e)},asChild:!!n,children:n?t(`a`,{href:n,children:e}):e})}const sS=({children:e,className:n})=>{let r=C(null),[i,a]=w(`auto`);return _(()=>{if(r.current){let e=new ResizeObserver(e=>{let t=e[0].contentRect.height;a(t)});return e.observe(r.current),()=>{e.disconnect()}}},[]),t(`div`,{className:B(n,`overflow-hidden transition-all duration-100 ease-in`),style:{height:i},children:t(`div`,{ref:r,children:e})})},cS=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);(lS(i,a)||!r)&&Object.defineProperty(e,n,a)},lS=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},uS=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},dS=(e,t)=>`/* Wrapped ${e}*/\n${t}`,fS=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),pS=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),mS=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=dS.bind(null,r,t.toString());Object.defineProperty(i,"name",pS);let{writable:a,enumerable:o,configurable:s}=fS;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function hS(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))cS(e,t,r,n);return uS(e,t),mS(e,t,r),e}const gS=2147483647,_S=/* @__PURE__ */ new WeakMap,vS=/* @__PURE__ */ new WeakMap,yS=/* @__PURE__ */ new WeakMap;function bS(e,t){let n=e.get(t);if(n){if(n.maxAge<=Date.now())e.delete(t);else return n}}function xS(e,{cacheKey:t,cache:n=/* @__PURE__ */ new Map,maxAge:r}={}){if(r===0)return e;if(typeof r==`number`&&Number.isFinite(r)){if(r>gS)throw TypeError(`The \`maxAge\` option cannot exceed ${gS}.`);if(r<0)throw TypeError("The `maxAge` option should not be a negative number.")}let i=function(...a){let o=t?t(a):a[0],s=bS(n,o);if(s)return s.data;let c=e.apply(this,a),l=typeof r==`function`?r(...a):r;if(l!==void 0&&l!==1/0){if(!Number.isFinite(l))throw TypeError("The `maxAge` function must return a finite number, `0`, or `Infinity`.");if(l<=0)return c;if(l>gS)throw TypeError(`The \`maxAge\` function result cannot exceed ${gS}.`)}if(n.set(o,{data:c,maxAge:l===void 0||l===1/0?1/0:Date.now()+l}),l!==void 0&&l!==1/0){let e=setTimeout(()=>{n.delete(o),vS.get(i)?.delete(e)},l);e.unref?.();let t=vS.get(i)??/* @__PURE__ */ new Set;t.add(e),vS.set(i,t)}return c};return hS(i,e,{ignoreNonConfigurable:!0}),_S.set(i,n),yS.set(i,t??(e=>e[0])),i}function SS(e){return typeof e==`string`}function CS(e,t,n){return n.indexOf(e)===t}function wS(e){return e.toLowerCase()===e}function TS(e){return e.indexOf(`,`)===-1?e:e.split(`,`)}function ES(e){if(!e)return e;if(e===`C`||e===`posix`||e===`POSIX`)return`en-US`;if(e.indexOf(`.`)!==-1){var t=e.split(`.`)[0],n=t===void 0?``:t;return ES(n)}if(e.indexOf(`@`)!==-1){var r=e.split(`@`)[0],n=r===void 0?``:r;return ES(n)}if(e.indexOf(`-`)===-1||!wS(e))return e;var i=e.split(`-`),a=i[0],o=i[1];return`${a}-${(o===void 0?``:o).toUpperCase()}`}function DS(e){var t=e===void 0?{}:e,n=t.useFallbackLocale,r=n===void 0||n,i=t.fallbackLocale,a=i===void 0?`en-US`:i,o=[];if(typeof navigator<`u`){for(var s=navigator.languages||[],c=[],l=0,u=s;l<u.length;l++){var d=u[l];c=c.concat(TS(d))}var f=navigator.language,p=f&&TS(f);o=o.concat(c,p)}return r&&o.push(a),o.filter(SS).map(ES).filter(CS)}var OS=xS(DS,{cacheKey:JSON.stringify});function kS(e){return OS(e)[0]||null}var AS=xS(kS,{cacheKey:JSON.stringify});const jS=/* @__PURE__ */ new Map;function MS(e){return function(t,n){let r=t||AS();jS.has(r)||jS.set(r,/* @__PURE__ */ new Map);let i=jS.get(r);if(!i.has(e)){let t=new Intl.DateTimeFormat(r||void 0,e);i.set(e,t.format.bind(t))}return i.get(e)(n)}}function NS(e){let t=new Date(e);return new Date(t.setHours(12))}function PS(e){return(t,n)=>MS(e)(t,NS(n))}const FS={day:`numeric`},IS={day:`numeric`,month:`long`,year:`numeric`},LS={month:`long`},RS={month:`long`,year:`numeric`},zS={weekday:`short`},BS={weekday:`long`},VS={year:`numeric`},HS=PS(FS),US=PS(IS),WS=PS(LS),GS=PS(RS),KS=PS(zS),qS=PS(BS),JS=PS(VS);function YS(e,t,n){return function(r,i=n){return t(e(r)+i)}}function XS(e){return function(t){return/* @__PURE__ */ new Date(e(t).getTime()-1)}}function ZS(e,t){return function(n){return[e(n),t(n)]}}function Z(e){if(e instanceof Date)return e.getFullYear();if(typeof e==`number`)return e;let t=Number.parseInt(e,10);if(typeof e==`string`&&!Number.isNaN(t))return t;throw Error(`Failed to get year from date: ${e}.`)}function QS(e){if(e instanceof Date)return e.getMonth();throw Error(`Failed to get month from date: ${e}.`)}function $S(e){if(e instanceof Date)return e.getDate();throw Error(`Failed to get year from date: ${e}.`)}function eC(e){let t=Z(e),n=t+(-t+1)%100,r=/* @__PURE__ */ new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const tC=YS(Z,eC,-100),nC=YS(Z,eC,100),rC=XS(nC),iC=YS(Z,rC,-100),aC=ZS(eC,rC);function oC(e){let t=Z(e),n=t+(-t+1)%10,r=/* @__PURE__ */ new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const sC=YS(Z,oC,-10),cC=YS(Z,oC,10),lC=XS(cC),uC=YS(Z,lC,-10),dC=ZS(oC,lC);function fC(e){let t=Z(e),n=/* @__PURE__ */ new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}const pC=YS(Z,fC,-1),mC=YS(Z,fC,1),hC=XS(mC),gC=YS(Z,hC,-1),_C=ZS(fC,hC);function vC(e,t){return function(n,r=t){let i=Z(n),a=QS(n)+r,o=/* @__PURE__ */ new Date;return o.setFullYear(i,a,1),o.setHours(0,0,0,0),e(o)}}function yC(e){let t=Z(e),n=QS(e),r=/* @__PURE__ */ new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}const bC=vC(yC,-1),xC=vC(yC,1),SC=XS(xC),CC=vC(SC,-1),wC=ZS(yC,SC);function TC(e,t){return function(n,r=t){let i=Z(n),a=QS(n),o=$S(n)+r,s=/* @__PURE__ */ new Date;return s.setFullYear(i,a,o),s.setHours(0,0,0,0),e(s)}}function EC(e){let t=Z(e),n=QS(e),r=$S(e),i=/* @__PURE__ */ new Date;return i.setFullYear(t,n,r),i.setHours(0,0,0,0),i}const DC=XS(TC(EC,1)),OC=ZS(EC,DC);function kC(e){return $S(SC(e))}const AC={GREGORY:`gregory`,HEBREW:`hebrew`,ISLAMIC:`islamic`,ISO_8601:`iso8601`},jC={gregory:[`en-CA`,`en-US`,`es-AR`,`es-BO`,`es-CL`,`es-CO`,`es-CR`,`es-DO`,`es-EC`,`es-GT`,`es-HN`,`es-MX`,`es-NI`,`es-PA`,`es-PE`,`es-PR`,`es-SV`,`es-VE`,`pt-BR`],hebrew:[`he`,`he-IL`],islamic:[`ar`,`ar-AE`,`ar-BH`,`ar-DZ`,`ar-EG`,`ar-IQ`,`ar-JO`,`ar-KW`,`ar-LY`,`ar-OM`,`ar-QA`,`ar-SA`,`ar-SD`,`ar-SY`,`ar-YE`,`dv`,`dv-MV`,`ps`,`ps-AR`]},MC=[0,1,2,3,4,5,6],NC=MC[0],PC=MC[5],FC=MC[6];function IC(e,t=AC.ISO_8601){let n=e.getDay();switch(t){case AC.ISO_8601:return(n+6)%7;case AC.ISLAMIC:return(n+1)%7;case AC.HEBREW:case AC.GREGORY:return n;default:throw Error(`Unsupported calendar type.`)}}function LC(e){return Z(eC(e))}function RC(e){return Z(oC(e))}function zC(e,t=AC.ISO_8601){let n=Z(e),r=QS(e),i=e.getDate()-IC(e,t);return new Date(n,r,i)}function BC(e,t=AC.ISO_8601){let n=t===AC.GREGORY?AC.GREGORY:AC.ISO_8601,r=zC(e,t),i=Z(e)+1,a,o;do a=new Date(i,0,n===AC.ISO_8601?4:1),o=zC(a,t),--i;while(e<o);return Math.round((r.getTime()-o.getTime())/6048e5)+1}function VC(e,t){switch(e){case`century`:return eC(t);case`decade`:return oC(t);case`year`:return fC(t);case`month`:return yC(t);case`day`:return EC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function HC(e,t){switch(e){case`century`:return tC(t);case`decade`:return sC(t);case`year`:return pC(t);case`month`:return bC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function UC(e,t){switch(e){case`century`:return nC(t);case`decade`:return cC(t);case`year`:return mC(t);case`month`:return xC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function WC(e,t){switch(e){case`decade`:return sC(t,-100);case`year`:return pC(t,-10);case`month`:return bC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function GC(e,t){switch(e){case`decade`:return cC(t,100);case`year`:return mC(t,10);case`month`:return xC(t,12);default:throw Error(`Invalid rangeType: ${e}`)}}function KC(e,t){switch(e){case`century`:return rC(t);case`decade`:return lC(t);case`year`:return hC(t);case`month`:return SC(t);case`day`:return DC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function qC(e,t){switch(e){case`century`:return iC(t);case`decade`:return uC(t);case`year`:return gC(t);case`month`:return CC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function JC(e,t){switch(e){case`decade`:return uC(t,-100);case`year`:return gC(t,-10);case`month`:return CC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function YC(e,t){switch(e){case`century`:return aC(t);case`decade`:return dC(t);case`year`:return _C(t);case`month`:return wC(t);case`day`:return OC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function XC(e,t,n){let r=[t,n].sort((e,t)=>e.getTime()-t.getTime());return[VC(e,r[0]),KC(e,r[1])]}function ZC(e,t,n){return n.map(n=>(t||JS)(e,n)).join(` – `)}function QC(e,t,n){return ZC(e,t,aC(n))}function $C(e,t,n){return ZC(e,t,dC(n))}function ew(e){return e.getDay()===(/* @__PURE__ */ new Date()).getDay()}function tw(e,t=AC.ISO_8601){let n=e.getDay();switch(t){case AC.ISLAMIC:case AC.HEBREW:return n===PC||n===FC;case AC.ISO_8601:case AC.GREGORY:return n===FC||n===NC;default:throw Error(`Unsupported calendar type.`)}}const nw=`react-calendar__navigation`;function rw({activeStartDate:r,drillUp:i,formatMonthYear:a=GS,formatYear:o=JS,locale:s,maxDate:c,minDate:l,navigationAriaLabel:u=``,navigationAriaLive:d,navigationLabel:f,next2AriaLabel:p=``,next2Label:m=`»`,nextAriaLabel:h=``,nextLabel:g=`›`,prev2AriaLabel:_=``,prev2Label:v=`«`,prevAriaLabel:y=``,prevLabel:b=`‹`,setActiveStartDate:x,showDoubleView:S,view:C,views:w}){let T=w.indexOf(C)>0,E=C!==`century`,D=HC(C,r),O=E?WC(C,r):void 0,k=UC(C,r),A=E?GC(C,r):void 0,j=(()=>{if(D.getFullYear()<0)return!0;let e=qC(C,r);return l&&l>=e})(),M=E&&(()=>{if(O.getFullYear()<0)return!0;let e=JC(C,r);return l&&l>=e})(),N=c&&c<k,P=E&&c&&c<A;function F(){x(D,`prev`)}function ee(){x(O,`prev2`)}function I(){x(k,`next`)}function te(){x(A,`next2`)}function ne(e){let t=(()=>{switch(C){case`century`:return QC(s,o,e);case`decade`:return $C(s,o,e);case`year`:return o(s,e);case`month`:return a(s,e);default:throw Error(`Invalid view: ${C}.`)}})();return f?f({date:e,label:t,locale:s||AS()||void 0,view:C}):t}function re(){let a=`${nw}__label`;return n(`button`,{"aria-label":u,"aria-live":d,className:a,disabled:!T,onClick:i,style:{flexGrow:1},type:`button`,children:[t(`span`,{className:`${a}__labelText ${a}__labelText--from`,children:ne(r)}),S?n(e,{children:[t(`span`,{className:`${a}__divider`,children:` – `}),t(`span`,{className:`${a}__labelText ${a}__labelText--to`,children:ne(k)})]}):null]})}return n(`div`,{className:nw,children:[v!==null&&E?t(`button`,{"aria-label":_,className:`${nw}__arrow ${nw}__prev2-button`,disabled:M,onClick:ee,type:`button`,children:v}):null,b!==null&&t(`button`,{"aria-label":y,className:`${nw}__arrow ${nw}__prev-button`,disabled:j,onClick:F,type:`button`,children:b}),re(),g!==null&&t(`button`,{"aria-label":h,className:`${nw}__arrow ${nw}__next-button`,disabled:N,onClick:I,type:`button`,children:g}),m!==null&&E?t(`button`,{"aria-label":p,className:`${nw}__arrow ${nw}__next2-button`,disabled:P,onClick:te,type:`button`,children:m}):null]})}function iw(e){return`${e}%`}function aw({children:e,className:n,count:r,direction:i,offset:a,style:o,wrap:c,...l}){return t(`div`,{className:n,style:{display:`flex`,flexDirection:i,flexWrap:c?`wrap`:`nowrap`,...o},...l,children:s.map(e,(e,t)=>{let n=a&&t===0?iw(100*a/r):null;return u(e,{...e.props,style:{flexBasis:iw(100/r),flexShrink:0,flexGrow:0,overflow:`hidden`,marginLeft:n,marginInlineStart:n,marginInlineEnd:0}})})})}function ow(e,t,n){return t&&t>e?t:n&&n<e?n:e}function sw(e,t){return t[0]<=e&&t[1]>=e}function cw(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function lw(e,t){return sw(e[0],t)||sw(e[1],t)}function uw(e,t,n){let r=lw(t,e),i=[];if(r){i.push(n);let r=sw(e[0],t),a=sw(e[1],t);r&&i.push(`${n}Start`),a&&i.push(`${n}End`),r&&a&&i.push(`${n}BothEnds`)}return i}function dw(e){return Array.isArray(e)?e[0]!==null&&e[1]!==null:e!==null}function fw(e){if(!e)throw Error(`args is required`);let{value:t,date:n,hover:r}=e,i=`react-calendar__tile`,a=[i];if(!n)return a;let o=/* @__PURE__ */ new Date,s=(()=>{if(Array.isArray(n))return n;let{dateType:t}=e;if(!t)throw Error(`dateType is required when date is not an array of two dates`);return YC(t,n)})();if(sw(o,s)&&a.push(`${i}--now`),!t||!dw(t))return a;let c=(()=>{if(Array.isArray(t))return t;let{valueType:n}=e;if(!n)throw Error(`valueType is required when value is not an array of two dates`);return YC(n,t)})();cw(c,s)?a.push(`${i}--active`):lw(c,s)&&a.push(`${i}--hasActive`);let l=uw(c,s,`${i}--range`);if(a.push(...l),r&&(Array.isArray(t)?t:[t]).length===1){let e=uw(r>c[0]?[c[0],r]:[r,c[0]],s,`${i}--hover`);a.push(...e)}return a}function pw({className:e,count:n=3,dateTransform:r,dateType:i,end:a,hover:o,offset:s,renderTile:c,start:l,step:u=1,value:d,valueType:f}){let p=[];for(let e=l;e<=a;e+=u){let t=r(e);p.push(c({classes:fw({date:t,dateType:i,hover:o,value:d,valueType:f}),date:t}))}return t(aw,{className:e,count:n,offset:s,wrap:!0,children:p})}function mw(e){let{activeStartDate:i,children:a,classes:o,date:s,formatAbbr:c,locale:l,maxDate:u,maxDateTransform:d,minDate:f,minDateTransform:p,onClick:m,onMouseOver:h,style:g,tileClassName:_,tileContent:v,tileDisabled:y,view:b}=e,x=S(()=>typeof _==`function`?_({activeStartDate:i,date:s,view:b}):_,[i,s,_,b]),C=S(()=>typeof v==`function`?v({activeStartDate:i,date:s,view:b}):v,[i,s,v,b]);return n(`button`,{className:r(o,x),disabled:f&&p(f)>s||u&&d(u)<s||y?.({activeStartDate:i,date:s,view:b}),onClick:m?e=>m(s,e):void 0,onFocus:h?()=>h(s):void 0,onMouseOver:h?()=>h(s):void 0,style:g,type:`button`,children:[c?t(`abbr`,{"aria-label":c(l,s),children:a}):a,C]})}const hw=`react-calendar__century-view__decades__decade`;function gw({classes:e=[],currentCentury:n,formatYear:r=JS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(hw),eC(a).getFullYear()!==n&&s.push(`${hw}--neighboringCentury`),t(mw,{...i,classes:s,maxDateTransform:lC,minDateTransform:oC,view:`century`,children:$C(o,r,a)})}function _w(e){let{activeStartDate:n,hover:r,showNeighboringCentury:i,value:a,valueType:o,...s}=e,c=LC(n),l=c+(i?119:99);return t(pw,{className:`react-calendar__century-view__decades`,dateTransform:oC,dateType:`decade`,end:l,hover:r,renderTile:({date:e,...r})=>t(gw,{...s,...r,activeStartDate:n,currentCentury:c,date:e},e.getTime()),start:c,step:10,value:a,valueType:o})}function vw(e){function n(){return t(_w,{...e})}return t(`div`,{className:`react-calendar__century-view`,children:n()})}const yw=`react-calendar__decade-view__years__year`;function bw({classes:e=[],currentDecade:n,formatYear:r=JS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(yw),oC(a).getFullYear()!==n&&s.push(`${yw}--neighboringDecade`),t(mw,{...i,classes:s,maxDateTransform:hC,minDateTransform:fC,view:`decade`,children:r(o,a)})}function xw(e){let{activeStartDate:n,hover:r,showNeighboringDecade:i,value:a,valueType:o,...s}=e,c=RC(n),l=c+(i?11:9);return t(pw,{className:`react-calendar__decade-view__years`,dateTransform:fC,dateType:`year`,end:l,hover:r,renderTile:({date:e,...r})=>t(bw,{...s,...r,activeStartDate:n,currentDecade:c,date:e},e.getTime()),start:c,value:a,valueType:o})}function Sw(e){function n(){return t(xw,{...e})}return t(`div`,{className:`react-calendar__decade-view`,children:n()})}const Cw=`react-calendar__month-view__days__day`;function ww({calendarType:e,classes:n=[],currentMonthIndex:r,formatDay:i=HS,formatLongDate:a=US,...o}){let{date:s,locale:c}=o,l=[];return n&&l.push(...n),l.push(Cw),tw(s,e)&&l.push(`${Cw}--weekend`),s.getMonth()!==r&&l.push(`${Cw}--neighboringMonth`),t(mw,{...o,classes:l,formatAbbr:a,maxDateTransform:DC,minDateTransform:EC,view:`month`,children:i(c,s)})}function Tw(e){let{activeStartDate:n,calendarType:r,hover:i,showFixedNumberOfWeeks:a,showNeighboringMonth:o,value:s,valueType:c,...l}=e,u=Z(n),d=QS(n),f=a||o,p=IC(n,r),m=f?0:p,h=(f?-p:0)+1,g=(()=>{if(a)return h+42-1;let e=kC(n);if(o){let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),t.setHours(0,0,0,0),e+(7-IC(t,r)-1)}return e})();return t(pw,{className:`react-calendar__month-view__days`,count:7,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),EC(t)},dateType:`day`,hover:i,end:g,renderTile:({date:e,...i})=>t(ww,{...l,...i,activeStartDate:n,calendarType:r,currentMonthIndex:d,date:e},e.getTime()),offset:m,start:h,value:s,valueType:c})}const Ew=`react-calendar__month-view__weekdays`,Dw=`${Ew}__weekday`;function Ow(e){let{calendarType:n,formatShortWeekday:i=KS,formatWeekday:a=qS,locale:o,onMouseLeave:s}=e,c=yC(/* @__PURE__ */ new Date),l=Z(c),u=QS(c),d=[];for(let e=1;e<=7;e+=1){let s=new Date(l,u,e-IC(c,n)),f=a(o,s);d.push(t(`div`,{className:r(Dw,ew(s)&&`${Dw}--current`,tw(s,n)&&`${Dw}--weekend`),children:t(`abbr`,{"aria-label":f,title:f,children:i(o,s).replace(`.`,``)})},e))}return t(aw,{className:Ew,count:7,onFocus:s,onMouseOver:s,children:d})}const kw=`react-calendar__tile`;function Aw(e){let{onClickWeekNumber:n,weekNumber:r}=e,i=t(`span`,{children:r});if(n){let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`button`,{...o,className:kw,onClick:e=>r(a,n,e),type:`button`,children:i})}{let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`div`,{...o,className:kw,children:i})}}function jw(e){let{activeStartDate:n,calendarType:r,onClickWeekNumber:i,onMouseLeave:a,showFixedNumberOfWeeks:o}=e,s=(()=>{if(o)return 6;let e=kC(n)-(7-IC(n,r));return 1+Math.ceil(e/7)})(),c=(()=>{let e=Z(n),t=QS(n),i=$S(n),a=[];for(let n=0;n<s;n+=1)a.push(zC(new Date(e,t,i+n*7),r));return a})(),l=c.map(e=>BC(e,r));return t(aw,{className:`react-calendar__month-view__weekNumbers`,count:s,direction:`column`,onFocus:a,onMouseOver:a,style:{flexBasis:`calc(100% * (1 / 8)`,flexShrink:0},children:l.map((e,n)=>{let r=c[n];if(!r)throw Error(`date is not defined`);return t(Aw,{date:r,onClickWeekNumber:i,weekNumber:e},e)})})}function Mw(e){if(e){for(let[t,n]of Object.entries(jC))if(n.includes(e))return t}return AC.ISO_8601}function Nw(e){let{activeStartDate:i,locale:a,onMouseLeave:o,showFixedNumberOfWeeks:s}=e,{calendarType:c=Mw(a),formatShortWeekday:l,formatWeekday:u,onClickWeekNumber:d,showWeekNumbers:f,...p}=e;function m(){return t(Ow,{calendarType:c,formatShortWeekday:l,formatWeekday:u,locale:a,onMouseLeave:o})}function h(){return f?t(jw,{activeStartDate:i,calendarType:c,onClickWeekNumber:d,onMouseLeave:o,showFixedNumberOfWeeks:s}):null}function g(){return t(Tw,{calendarType:c,...p})}let _=`react-calendar__month-view`;return t(`div`,{className:r(_,f?`${_}--weekNumbers`:``),children:n(`div`,{style:{display:`flex`,alignItems:`flex-end`},children:[h(),n(`div`,{style:{flexGrow:1,width:`100%`},children:[m(),g()]})]})})}function Pw({classes:e=[],formatMonth:n=WS,formatMonthYear:r=GS,...i}){let{date:a,locale:o}=i;return t(mw,{...i,classes:[...e,`react-calendar__year-view__months__month`],formatAbbr:r,maxDateTransform:SC,minDateTransform:yC,view:`year`,children:n(o,a)})}function Fw(e){let{activeStartDate:n,hover:r,value:i,valueType:a,...o}=e,s=Z(n);return t(pw,{className:`react-calendar__year-view__months`,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(s,e,1),yC(t)},dateType:`month`,end:11,hover:r,renderTile:({date:e,...r})=>t(Pw,{...o,...r,activeStartDate:n,date:e},e.getTime()),start:0,value:i,valueType:a})}function Iw(e){function n(){return t(Fw,{...e})}return t(`div`,{className:`react-calendar__year-view`,children:n()})}const Lw=`react-calendar`,Rw=[`century`,`decade`,`year`,`month`],zw=[`decade`,`year`,`month`,`day`],Bw=/* @__PURE__ */ new Date;Bw.setFullYear(1,0,1),Bw.setHours(0,0,0,0);const Vw=/* @__PURE__ */ new Date(864e13);function Hw(e){return e instanceof Date?e:new Date(e)}function Uw(e,t){return Rw.slice(Rw.indexOf(e),Rw.indexOf(t)+1)}function Ww(e,t,n){return Uw(t,n).indexOf(e)!==-1}function Gw(e,t,n){return e&&Ww(e,t,n)?e:n}function Kw(e){let t=Rw.indexOf(e);return zw[t]}function qw(e,t){let n=Array.isArray(e)?e[t]:e;if(!n)return null;let r=Hw(n);if(Number.isNaN(r.getTime()))throw Error(`Invalid date: ${e}`);return r}function Jw({value:e,minDate:t,maxDate:n,maxDetail:r},i){let a=qw(e,i);if(!a)return null;let o=Kw(r);return ow((()=>{switch(i){case 0:return VC(o,a);case 1:return KC(o,a);default:throw Error(`Invalid index value: ${i}`)}})(),t,n)}const Yw=e=>Jw(e,0),Xw=e=>Jw(e,1),Zw=e=>[Yw,Xw].map(t=>t(e));function Qw({maxDate:e,maxDetail:t,minDate:n,minDetail:r,value:i,view:a}){return VC(Gw(a,r,t),Yw({value:i,minDate:n,maxDate:e,maxDetail:t})||/* @__PURE__ */ new Date)}function $w({activeStartDate:e,defaultActiveStartDate:t,defaultValue:n,defaultView:r,maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c,view:l}){let u=Gw(l,s,a),d=e||t;return d?VC(u,d):Qw({maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c||n,view:l||r})}function eT(e){return e&&(!Array.isArray(e)||e.length===1)}function tT(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var nT=p(function(e,i){let{activeStartDate:a,allowPartialRange:o,calendarType:s,className:c,"data-testid":l,defaultActiveStartDate:u,defaultValue:d,defaultView:f,formatDay:p,formatLongDate:m,formatMonth:g,formatMonthYear:_,formatShortWeekday:v,formatWeekday:b,formatYear:x,goToRangeStartOnSelect:S=!0,inputRef:C,locale:T,maxDate:E=Vw,maxDetail:D=`month`,minDate:O=Bw,minDetail:k=`century`,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:F,nextLabel:ee,onActiveStartDateChange:I,onChange:te,onClickDay:ne,onClickDecade:re,onClickMonth:ie,onClickWeekNumber:ae,onClickYear:oe,onDrillDown:se,onDrillUp:ce,onViewChange:le,prev2AriaLabel:ue,prev2Label:de,prevAriaLabel:fe,prevLabel:pe,returnValue:me=`start`,selectRange:he,showDoubleView:ge,showFixedNumberOfWeeks:_e,showNavigation:ve=!0,showNeighboringCentury:ye,showNeighboringDecade:be,showNeighboringMonth:xe=!0,showWeekNumbers:Se,tileClassName:Ce,tileContent:we,tileDisabled:Te,value:Ee,view:De}=e,[Oe,ke]=w(u),[Ae,je]=w(null),[Me,Ne]=w(Array.isArray(d)?d.map(e=>e===null?null:Hw(e)):d==null?null:Hw(d)),[Pe,Fe]=w(f),Ie=a||Oe||$w({activeStartDate:a,defaultActiveStartDate:u,defaultValue:d,defaultView:f,maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:Ee,view:De}),Le=(()=>{let e=he&&eT(Me)||Ee===void 0?Me:Ee;return e?Array.isArray(e)?e.map(e=>e===null?null:Hw(e)):e===null?null:Hw(e):null})(),L=Kw(D),R=Gw(De||Pe,k,D),Re=Uw(k,D),ze=he?Ae:null,Be=Re.indexOf(R)<Re.length-1,Ve=Re.indexOf(R)>0,He=h(e=>(()=>{switch(me){case`start`:return Yw;case`end`:return Xw;case`range`:return Zw;default:throw Error(`Invalid returnValue.`)}})()({maxDate:E,maxDetail:D,minDate:O,value:e}),[E,D,O,me]),Ue=h((e,t)=>{ke(e);let n={action:t,activeStartDate:e,value:Le,view:R};I&&!tT(Ie,e)&&I(n)},[Ie,I,Le,R]),We=h((e,t)=>{let n=(()=>{switch(R){case`century`:return re;case`decade`:return oe;case`year`:return ie;case`month`:return ne;default:throw Error(`Invalid view: ${R}.`)}})();n&&n(e,t)},[ne,re,ie,oe,R]),Ge=h((e,t)=>{if(!Be)return;We(e,t);let n=Re[Re.indexOf(R)+1];if(!n)throw Error(`Attempted to drill down from the lowest view.`);ke(e),Fe(n);let r={action:`drillDown`,activeStartDate:e,value:Le,view:n};I&&!tT(Ie,e)&&I(r),le&&R!==n&&le(r),se&&se(r)},[Ie,Be,I,We,se,le,Le,R,Re]),Ke=h(()=>{if(!Ve)return;let e=Re[Re.indexOf(R)-1];if(!e)throw Error(`Attempted to drill up from the highest view.`);let t=VC(e,Ie);ke(t),Fe(e);let n={action:`drillUp`,activeStartDate:t,value:Le,view:e};I&&!tT(Ie,t)&&I(n),le&&R!==e&&le(n),ce&&ce(n)},[Ie,Ve,I,ce,le,Le,R,Re]),qe=h((e,t)=>{let n=Le;We(e,t);let r=he&&!eT(n),i;if(he){if(r)i=VC(L,e);else{if(!n)throw Error(`previousValue is required`);if(Array.isArray(n))throw Error(`previousValue must not be an array`);i=XC(L,n,e)}}else i=He(e);let a=!he||r||S?Qw({maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:i,view:R}):null;t.persist(),ke(a),Ne(i);let s={action:`onChange`,activeStartDate:a,value:i,view:R};if(I&&!tT(Ie,a)&&I(s),te){if(he){if(!eT(i))te(i||null,t);else if(o){if(Array.isArray(i))throw Error(`value must not be an array`);te([i||null,null],t)}}else te(i||null,t)}},[Ie,o,He,S,E,D,O,k,I,te,We,he,Le,L,R]);function Je(e){je(e)}function Ye(){je(null)}y(i,()=>({activeStartDate:Ie,drillDown:Ge,drillUp:Ke,onChange:qe,setActiveStartDate:Ue,value:Le,view:R}),[Ie,Ge,Ke,qe,Ue,Le,R]);function Xe(e){let n={activeStartDate:e?UC(R,Ie):VC(R,Ie),hover:ze,locale:T,maxDate:E,minDate:O,onClick:Be?Ge:qe,onMouseOver:he?Je:void 0,tileClassName:Ce,tileContent:we,tileDisabled:Te,value:Le,valueType:L};switch(R){case`century`:return t(vw,{formatYear:x,showNeighboringCentury:ye,...n});case`decade`:return t(Sw,{formatYear:x,showNeighboringDecade:be,...n});case`year`:return t(Iw,{formatMonth:g,formatMonthYear:_,...n});case`month`:return t(Nw,{calendarType:s,formatDay:p,formatLongDate:m,formatShortWeekday:v,formatWeekday:b,onClickWeekNumber:ae,onMouseLeave:he?Ye:void 0,showFixedNumberOfWeeks:_e===void 0?ge:_e,showNeighboringMonth:xe,showWeekNumbers:Se,...n});default:throw Error(`Invalid view: ${R}.`)}}function Ze(){return ve?t(rw,{activeStartDate:Ie,drillUp:Ke,formatMonthYear:_,formatYear:x,locale:T,maxDate:E,minDate:O,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:F,nextLabel:ee,prev2AriaLabel:ue,prev2Label:de,prevAriaLabel:fe,prevLabel:pe,setActiveStartDate:Ue,showDoubleView:ge,view:R,views:Re}):null}return n(`div`,{className:r(Lw,he&&(Array.isArray(Le)?Le:[Le]).length===1&&`${Lw}--selectRange`,ge&&`${Lw}--doubleView`,c),"data-testid":l,ref:C,children:[Ze(),n(`div`,{className:`${Lw}__viewContainer`,onBlur:he?Ye:void 0,onMouseLeave:he?Ye:void 0,children:[Xe(),ge?Xe(!0):null]})]})});he.extend(_e),he.extend(ge);var Q=he,rT=Object.defineProperty,iT=(e,t)=>rT(e,`name`,{value:t,configurable:!0}),aT=`Popover`,[oT,sT]=/* @__PURE__ */ Pn(aT,[_r]),cT=_r(),[lT,uT]=oT(aT),dT=/* @__PURE__ */ iT(e=>{let{__scopePopover:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,l=cT(n),u=a.useRef(null),[d,f]=a.useState(!1),[p,m]=a.useState(0),[h,g]=a.useState(0),[_,v]=Yr({prop:i,defaultProp:o??!1,onChange:s,caller:aT});return/* @__PURE__ */ t(br,{...l,children:/* @__PURE__ */ t(lT,{scope:n,contentId:H(),titleId:H(),descriptionId:H(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,triggerRef:u,open:_,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(e=>!e),[v]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:c,children:r})})},`Popover`),fT=`PopoverAnchor`,pT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let{__scopePopover:r,...i}=e,o=uT(fT,r),s=cT(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=o;return a.useEffect(()=>(c(),()=>l()),[c,l]),/* @__PURE__ */ t(Sr,{...s,...i,ref:n})},`PopoverAnchor`)),mT=`PopoverTrigger`,hT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let{__scopePopover:r,...i}=e,a=uT(mT,r),o=cT(r),s=z(n,a.triggerRef),c=/* @__PURE__ */ t(U.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":OT(a.open),...i,ref:s,onClick:V(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:/* @__PURE__ */ t(Sr,{asChild:!0,...o,children:c})},`PopoverTrigger`)),gT=`PopoverPortal`,[_T,vT]=oT(gT,{forceMount:void 0}),yT=/* @__PURE__ */ iT(e=>{let{__scopePopover:n,forceMount:r,children:i,container:a}=e,o=uT(gT,n);return/* @__PURE__ */ t(_T,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Fr,{present:r||o.open,children:/* @__PURE__ */ t(jr,{asChild:!0,container:a,children:i})})})},`PopoverPortal`),bT=`PopoverContent`,xT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let r=vT(bT,e.__scopePopover),{forceMount:i=r.forceMount,...a}=e,o=uT(bT,e.__scopePopover);return/* @__PURE__ */ t(Fr,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(CT,{...a,ref:n}):/* @__PURE__ */ t(wT,{...a,ref:n})})},`PopoverContent`)),ST=/* @__PURE__ */ cn(`PopoverContent.RemoveScroll`),CT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let r=uT(bT,e.__scopePopover),i=a.useRef(null),o=z(n,i),s=a.useRef(!1),{nodes:c,registry:l}=I();return a.useEffect(()=>{let e=i.current;if(e)return pe(e)},[]),/* @__PURE__ */ t(fe,{as:ST,allowPinchZoom:!0,shards:a.useMemo(()=>[i,...c.map(e=>({current:e}))],[i,c]),children:/* @__PURE__ */ t(TT,{...e,ref:o,branchNodes:c,branchRegistry:l,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{e.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),wT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let r=uT(bT,e.__scopePopover),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(TT,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&o.current&&t.preventDefault()}})},`PopoverContentNonModal`)),TT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let{__scopePopover:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,"aria-describedby":p,branchNodes:m,branchRegistry:h,...g}=e,_=uT(bT,r),v=cT(r),[y,b]=a.useState(null),x=z(n,b);return ee(y),de(),/* @__PURE__ */ t(F,{registry:h,children:/* @__PURE__ */ t(P,{asChild:!0,loop:!0,trapped:i,branches:m,onMountAutoFocus:o,onUnmountAutoFocus:s,children:/* @__PURE__ */ t(M,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:f,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>_.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ t(Er,{"data-state":OT(_.open),role:`dialog`,id:_.contentId,"aria-labelledby":_.titlePresent?_.titleId:void 0,"aria-describedby":_.descriptionPresent?kT(p,_.descriptionId):p,...v,...g,ref:x,style:{...g.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)`}})})})})},`PopoverContentImpl`)),ET=`PopoverClose`,DT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ iT(function(e,n){let{__scopePopover:r,...i}=e,a=uT(ET,r);return/* @__PURE__ */ t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`PopoverClose`));function OT(e){return e?`open`:`closed`}iT(OT,`getState`);function kT(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}iT(kT,`concatAriaDescribedby`);const AT=a.createContext(null),jT=({hover:e=!1,click:n=!1,modal:r,children:i,_open:o,onOpenChange:s})=>{let[c,l]=a.useState(o||!1);return t(AT.Provider,{value:{open:c,setOpen:l,hover:e,click:n},children:t(dT,{open:c,onOpenChange:e=>{l(e),s&&s(e)},modal:r,children:i})})};function MT(e=!1,t=()=>{},n){e&&t(n===`enter`)}const NT=a.forwardRef(({children:e,...n},r)=>{let i=a.useContext(AT);if(!i)throw Error(`PopoverTrigger must be used within a Popover`);let{setOpen:o,hover:s,click:c}=i;return t(hT,{ref:r,asChild:!0,onMouseEnter:()=>MT(s,o,`enter`),onMouseLeave:()=>MT(s,o,`leave`),onClick:()=>{c&&o(e=>!e)},...n,children:e})});NT.displayName=hT.displayName;const PT=pT,FT=a.forwardRef(({className:e,align:n=`center`,side:r=`bottom`,...i},o)=>{let s=a.useContext(AT);if(!s)throw Error(`PopoverContent must be used within a Popover`);let{setOpen:c,hover:l}=s,u=Bi();return t(yT,{container:u,children:t(xT,{ref:o,align:n,side:r,onMouseEnter:()=>MT(l,c,`enter`),onMouseLeave:()=>MT(l,c,`leave`),className:B(`z-50 w-72 rounded-md border-popover bg-popover text-popover-foreground ring-1 ring-border shadow-md focus:outline-none animate-in`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...i})})});FT.displayName=xT.displayName;const IT=DT;IT.displayName=DT.displayName;function LT(){let e=a.useContext(AT);if(!e)throw Error(`usePopoverContext must be used within a Popover`);return{...e,close:()=>e.setOpen(!1)}}const RT=`
|
|
247
247
|
.calendar-wrapper .react-calendar__navigation {
|
|
248
248
|
display: flex !important;
|
|
249
249
|
justify-content: space-between !important;
|
|
@@ -329,12 +329,12 @@ function sy(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ kn(n),[o,s]=r(
|
|
|
329
329
|
text-align: center !important;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
`,
|
|
332
|
+
`,zT=({filterValues:r,setFilterValues:i,isRange:a=!1})=>{let[o,s]=w(!1),[c,l]=w([null,null]),{t:u}=k(),d=r[0]?Q(r[0]).toDate():void 0,f=a?[c[0]||(r[0]?Q(r[0]).toDate():null),c[1]||(r[1]?Q(r[1]).toDate():null)]:[null,null];_(()=>{a&&l([r[0]?Q(r[0]).toDate():null,r[1]?Q(r[1]).toDate():null])},[r,a]);let p=()=>a?f[0]&&f[1]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`-`}),t(`span`,{className:`font-medium`,children:Q(f[1]).format(`MMMM DD, YYYY`)})]}):f[0]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`- Select end`})]}):t(`span`,{className:`text-muted`,children:u(`filter.selectRange`)}):d?Q(d).format(`MMMM DD, YYYY`):`Pick a date`,m=e=>{if(a)Array.isArray(e)&&(l([e[0],e[1]]),e[0]&&e[1]?i([Q(e[0]).format(`YYYY-MM-DD`),Q(e[1]).format(`YYYY-MM-DD`)]):e[0]&&i([Q(e[0]).format(`YYYY-MM-DD`)]));else if(e){let t=Array.isArray(e)?e[0]:e;t&&(i([Q(t).format(`YYYY-MM-DD`)]),s(!1))}};return n(jT,{_open:o,onOpenChange:s,children:[t(NT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-info shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center min-h-[20px]`,children:p()})}),t(FT,{className:`w-auto p-0`,align:`start`,side:`bottom`,alignOffset:-4,sideOffset:6,children:t(`div`,{className:`p-2`,children:a?n(e,{children:[n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:RT}),t(nT,{value:f,onChange:m,selectRange:!0,returnValue:`range`,maxDate:(()=>{let e=/* @__PURE__ */ new Date;return e.setHours(23,59,59,999),e})(),className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=/* @__PURE__ */ new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(f[0]){let e=f[0].getTime();if(f[1]){let n=f[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-info text-info font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}})]}),f[0]&&f[1]&&t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:()=>s(!1),children:`Cancel`}),t(W,{size:`sm`,onClick:()=>s(!1),children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:RT}),t(nT,{value:d,onChange:m,selectRange:!1,maxDate:(()=>{let e=/* @__PURE__ */ new Date;return e.setHours(23,59,59,999),e})(),className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=/* @__PURE__ */ new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(d&&t===d.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})})]})};function BT({value:n,labelRenderer:r,fallbackLabel:i}){let[a,o]=w(i||n),[s,c]=w(!1);return _(()=>{r?(async()=>{c(!0);try{let e=r(n);if(e instanceof Promise){let t=await e;o(t)}else o(e)}catch(e){console.error(`Error rendering label:`,e),o(i||n)}finally{c(!1)}})():o(i||n)},[n,r,i]),s?t(`span`,{className:`text-muted`,children:`Loading...`}):t(e,{children:a})}const VT=({filterType:r,filterValues:i,setFilterValues:a,options:o,labelRenderer:s,multiple:c=!0})=>{let[l,u]=w(!1),[d,f]=w(``),p=C(null),{t:m}=k(),h=o?.filter(e=>!i.some(t=>t.value===e.value));return n(jT,{_open:l,onOpenChange:e=>{u(e),e||setTimeout(()=>{f(``)},200)},children:[t(NT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 transition text-muted hover:text-info shrink-0`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:i?.length===1?(()=>{let e=i[0];return t(BT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})})():`${i?.length} selected`})}),t(FT,{className:`w-[300px] p-0`,children:t(sS,{children:n(ny,{children:[t(iy,{placeholder:r,className:`h-9`,value:d,onInputCapture:e=>{f(e.currentTarget.value)},ref:p}),n(ay,{children:[t(oy,{children:m(`filter.noResultsFound`)}),t(sy,{children:i.map(e=>n(ly,{className:`group flex gap-2 items-center`,onSelect:()=>{a(i.filter(t=>t.value!==e.value)),setTimeout(()=>{f(``)},200),u(!1)},children:[c&&t(`input`,{type:`checkbox`,checked:!0,onChange:()=>{}}),t(BT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})]},e.value))}),h?.length>0&&n(e,{children:[t(cy,{}),t(sy,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(e=>n(ly,{className:`group flex gap-2 items-center`,value:String(e.label||e.value),onSelect:()=>{let t={value:e.value,label:e.label};a(c?[...i,t]:[t]),setTimeout(()=>{f(``)},200),u(!1)},children:[c&&t(Qg,{checked:!1,className:`opacity-0 group-data-[selected=true]:opacity-100`}),t(`span`,{className:`text-muted`,children:t(BT,{value:e.value||``,labelRenderer:e.labelRenderer||s,fallbackLabel:e.label})})]},e.value))})]})]})]})})})]})},HT=({filterType:e,filterValues:r,setFilterValues:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(jT,{_open:a,onOpenChange:e=>{o(e),!e&&JSON.stringify(s)!==JSON.stringify(r)&&c(r)},children:[t(NT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-info shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r.length>0?r.length===1?r[0]:`${r.length} tags`:`Add tags...`})}),t(FT,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-3`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(_a,{value:s,onChange:c,placeholder:`Add ${e.toLowerCase()}...`}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{size:`sm`,variant:`ghost`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(W,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})]})})]})},UT=A(``,{variants:{size:{xs:`rounded py-1 text-xs rounded-xs`,sm:`rounded text-xs rounded-sm`,md:`rounded-md py-2 text-sm`,lg:`rounded-md text-base`,xl:`rounded-md py-2.5 text-lg`},variant:{default:`flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,unstyled:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,noPadding:`block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background`,legacy:`py-1.5 block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background`}},defaultVariants:{size:`md`,variant:`default`}}),WT=a.forwardRef(({className:e,type:r,size:i=`md`,variant:a=`default`,clearable:o=!0,onChange:s,value:c,invalid:l,...u},d)=>{let f=()=>{s?.(``)},p=e=>{s?.(e.target.value)},m=u[`aria-invalid`]??(l?!0:void 0);return n(`div`,{className:`w-full relative inline-block [&:hover_.clear-button]:opacity-100`,children:[t(`input`,{type:r,className:B(UT({size:i,variant:a}),e,o&&c?`pe-8`:``),ref:d,value:c??``,onChange:p,...u,"aria-invalid":m}),o&&c&&!u.readOnly&&!u.disabled&&t(W,{variant:`link`,size:`icon`,type:`button`,onClick:f,className:`clear-button opacity-0 transition-opacity duration-200
|
|
333
333
|
absolute top-1/2 -translate-y-1/2 text-muted !hover:text-destructive cursor-pointer
|
|
334
|
-
flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(xt,{size:16})})]})});dE.displayName=`Input`;const fE=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(QT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(eE,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-info shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r||`Enter text...`})}),t(nE,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(dE,{autoFocus:!0,type:`text`,size:`sm`,value:s,onChange:c,onKeyDown:e=>{e.key===`Enter`&&(i(s),o(!1))},placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(W,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function pE({selectedView:r,selectedDate:i,setSelectedDate:a,setFilters:o,filters:s,handleClose:c,filterGroups:l}){let{t:u}=k(),[d,f]=w([null,null]),[p,m]=w([null,null]),h=l.find(e=>e.name===r),g=h?.multiple,_=/* @__PURE__ */ new Date;_.setHours(23,59,59,999);let v=[p[0]||d[0],p[1]||d[1]],y=e=>{if(g)Array.isArray(e)?(m([e[0],e[1]]),f([e[0],e[1]])):(m([e,null]),f([e,null]));else{let t=Array.isArray(e)?e[0]:e;if(a(t||void 0),t){let e=new Date(t);e.setHours(0,0,0,0),o([...s,{name:r||``,placeholder:h?.placeholder,value:[{value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}],type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}}};return t(`div`,{className:`p-2`,children:g?n(e,{children:[t(`div`,{children:g?v[0]&&v[1]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:u(`filter.to`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[1]).format(`MMMM DD, YYYY`)})]}):v[0]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`→ Select end date`})]}):t(`span`,{className:`text-muted text-xs`,children:h?.placeholder||h?.name||r||`Select date range`}):i?Q(i).format(`MMMM DD, YYYY`):`Pick a date`}),n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:aE}),t(vT,{value:v,onChange:y,selectRange:!0,returnValue:`range`,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=/* @__PURE__ */ new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(v[0]){let e=v[0].getTime();if(v[1]){let n=v[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-info text-info font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}},`${v[0]?.getTime()}-${v[1]?.getTime()}`)]}),t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(W,{size:`sm`,onClick:()=>{if(d[0]){let e=new Date(d[0]),t=d[1]?new Date(d[1]):new Date(d[0]);e.setHours(0,0,0,0),t.setHours(23,59,59,999);let n=[];n.push({value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}),d[1]&&d[0].getTime()!==d[1].getTime()&&n.push({value:t.toISOString(),label:Q(t).format(`LLL dd, y`)}),o([...s,{name:r||``,placeholder:h?.placeholder,value:n,type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}},disabled:!v[0],children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:aE}),t(vT,{value:i,onChange:y,selectRange:!1,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=/* @__PURE__ */ new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(i&&t===i.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})}function mE({selectedView:e,commandInput:r,setFilters:i,handleClose:a,filterGroups:o}){let[s,c]=w([]),l=e=>{let t=o.find(t=>t.name===e);if(!t)return[];let n=t.options||[];if(!r.trim())return n;if(t.filterBy){let e=r.toLowerCase();return n.filter(n=>n.value!==void 0&&t.filterBy?.(n.value,e))}let i=r.toLowerCase();return n.filter(e=>String(e.value||``).toLowerCase().includes(i))};if(!e)return null;let u=l(e),d=o.find(t=>t.name===e),f=d?.placeholder||d?.name,p=()=>{s.length>0&&i(t=>[...t.filter(t=>t.name!==e),{name:e||``,placeholder:d?.placeholder||``,value:s,type:d?.type||`select`,multiple:d?.multiple||!1}]),a()},m=t=>{let n={value:t.value,label:t.label};d?.multiple?s.some(e=>e.value===t.value)?c(e=>e.filter(e=>e.value!==t.value)):c(e=>[...e,n]):(i(t=>{let r=t.findIndex(t=>t.name===e);if(r>=0){let e=[...t];return e[r]={...e[r],value:[n]},e}return[...t,{name:e||``,placeholder:d?.placeholder||``,value:[n],type:d?.type||`select`,multiple:d?.multiple||!1}]}),a())};return n(`div`,{className:`flex flex-col h-full`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted shrink-0`,children:t(`span`,{children:f})}),t(`div`,{className:`flex-1 overflow-hidden min-h-0`,children:t(`div`,{className:`max-h-[200px] overflow-y-auto`,children:u.length>0&&u.map(e=>{let r=s.some(t=>t.value===e.value);return n(Zv,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(sE,{value:e.value||``,labelRenderer:e.labelRenderer||d?.labelRenderer,fallbackLabel:e.label}),d?.multiple&&r&&t(`span`,{className:`ms-auto text-xs text-success`,children:`✓`})]},e.value||`option-${Math.random()}`)})})}),d?.multiple&&t(`div`,{className:`p-2 border-t shrink-0`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(W,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function hE({selectedView:e,setFilters:r,handleClose:i,filterGroups:a}){let[o,s]=w([]),c=a.find(t=>t.name===e);return n(`div`,{className:`p-2 space-y-3`,children:[t(`div`,{className:`space-y-2`,children:t(ga,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(W,{size:`sm`,onClick:()=>{o.length>0&&r(t=>[...t.filter(t=>t.name!==e),{name:e,placeholder:c?.placeholder,value:o,type:`stringList`}]),i()},disabled:o.length===0,children:`Apply`})]})]})}function gE({selectedView:e,textValue:r,setTextValue:i,setFilters:a,handleClose:o,filterGroups:s}){let c=()=>{a(t=>[...t,{name:e||``,placeholder:s.find(t=>t.name===e)?.placeholder,value:[{value:r,label:r}],type:`text`}]),o()};return n(`div`,{className:`p-2 flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:s.find(t=>t.name===e)?.placeholder})}),t(dE,{autoFocus:!0,type:`text`,size:`sm`,value:r,onChange:i,onKeyDown:e=>e.key===`Enter`&&c(),placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(W,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function _E(e,n,r){switch(e.type){case`date`:return t(oE,{filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value.map(e=>e.value||``):[],isRange:e.multiple,setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t.length>0?t.map(e=>({value:e,label:Q(e).format(`LLL dd, y`)})):[]}:n))}});case`text`:return t(fE,{filterType:e.placeholder||e.name,filterValue:Array.isArray(e.value)&&e.value[0]&&typeof e.value[0]==`object`&&e.value[0].value||``,setFilterValue:t=>{n(n=>n.map(n=>n===e?{...n,value:[{value:t,label:t}]}:n))}});case`stringList`:return t(lE,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`string`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))}});default:{let i=r.find(t=>t.name===e.name);return t(cE,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))},options:i?.options||[],labelRenderer:i?.labelRenderer,multiple:e.multiple??i?.multiple})}}}function vE({filters:e,setFilters:r,filterGroups:i}){return t(`div`,{className:`flex gap-2 flex-wrap justify-start`,children:e.filter(e=>e.value?.length>0).map(e=>n(`div`,{className:`flex gap-[1px] items-center text-sm`,children:[t(`div`,{className:`flex gap-1.5 shrink-0 rounded-s bg-muted p-1.5 h-8 items-center`,children:e.placeholder||e.name}),_E(e,r,i),t(W,{variant:`ghost`,size:`icon`,onClick:()=>{r(t=>t.filter(t=>t!==e))},className:`bg-muted rounded-s-none rounded-e-sm size-8 hover:text-info hover:bg-muted/50 transition shrink-0`,children:t(xt,{className:`size-6`})})]},`${e.name}-${e.type===`date`?`date`:e.type===`stringList`&&typeof e.value[0]==`string`?e.value.join(`,`):Array.isArray(e.value)?e.value.map(e=>e.value).join(`,`):``}`))})}const yE=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),bE=({filters:e,setFilters:n,filterGroups:r,children:i,inModal:a})=>{let s=new URL(window.location.href).searchParams.toString(),[c]=o.useState(()=>new URLSearchParams(window.location.search).get(`filters`)),l=o.useRef(/* @__PURE__ */ new Set),u=o.useRef(a||!c);return _(()=>{if(!a&&u.current)try{let t=new URLSearchParams(s);if(e.length>0){let n=e.map(e=>{let t;if(e.type===`stringList`&&Array.isArray(e.value)&&typeof e.value[0]==`string`)t=`[${e.value.map(e=>encodeURIComponent(e)).join(`,`)}]`;else if(Array.isArray(e.value)){if(e.multiple)t=`[${e.value.map(e=>encodeURIComponent(wE(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(wE(e))).join(`,`)}]`;else{let n=e.value[0];t=typeof n==`string`?encodeURIComponent(n):typeof n==`object`&&n?.value!==void 0?encodeURIComponent(String(n.value)):encodeURIComponent(String(n||``))}}else t=encodeURIComponent(e.value||``);return`${encodeURIComponent(e.name)}:${t}`}).join(`;`);t.set(`filters`,n)}else t.delete(`filters`);let n=`${window.location.pathname}?${t.toString()}${window.location.hash}`;window.history.replaceState(window.history.state||{},``,n)}catch(e){console.error(`Failed to update URL with filters:`,e)}},[e,a,s]),_(()=>{if(!a&&c&&r.length!==0)try{let e=c.split(`;`),t=[];for(let n of e){let e=n.indexOf(`:`);if(e===-1)continue;let i=n.slice(0,e),a=n.slice(e+1),o=decodeURIComponent(i);if(l.current.has(o))continue;let s=r.find(e=>e.name===o);if(!s)continue;l.current.add(o);let c;if(a.startsWith(`[`)&&a.endsWith(`]`)){let e=a.slice(1,-1);c=e?e.split(`,`).map(e=>decodeURIComponent(e)):[]}else c=[decodeURIComponent(a)];let u;u=s.type===`stringList`?c:s.type===`text`?c.length===1?[{value:c[0],label:c[0]}]:c.map(e=>({value:e,label:e})):c.map(e=>{let t=s.options?.find(t=>t.value===e),n=e;return t?.label?n=String(t.label):t?.labelRenderer?n=String(t.labelRenderer(e)):s.labelRenderer&&(n=String(s.labelRenderer(e))),{value:e,label:n}}),s.multiple&&!a.startsWith(`[`)&&!a.endsWith(`]`)&&(s.type===`stringList`?u=c:Array.isArray(u)||(u=[u])),t.push({name:o,type:s.type,placeholder:s.placeholder,value:u,multiple:s.multiple})}t.length>0&&n(e=>{let n=new Set(t.map(e=>e.name));return[...e.filter(e=>!n.has(e.name)),...t]}),u.current=!0}catch{}},[r,a,c,n]),t(yE.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},xE=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(yE),{t:s}=k(),[c,l]=o.useState(!1),[u,d]=o.useState(null),[f,p]=o.useState(``),m=o.useRef(null),[h,g]=o.useState(),[_,v]=o.useState(``),y=e=>{d(e),p(``),m.current?.focus()},b=()=>{let e=a.map(e=>({...e,options:(e.options??[]).filter(t=>!r.some(n=>n.type===`date`?n.name===e.name:n.name===e.name&&(Array.isArray(n.value)&&typeof n.value[0]==`string`?n.value.some(e=>e===t.value):n.value.some(e=>wE(e)===t.value))))})).filter(e=>(e.options??[]).length>0||e.type===`date`&&!r.some(t=>t.name===e.name)||e.type===`text`&&!r.some(t=>t.name===e.name)||e.type===`stringList`&&!r.some(t=>t.name===e.name));return e.length===0?t(Jv,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(Zv,{onSelect:()=>y(e.name),className:`group flex gap-2 items-center hover:bg-muted`,children:t(`span`,{children:e.placeholder??e.name})},e.name))},x=()=>{l(!1),setTimeout(()=>{d(null),p(``),g(void 0)},200)};return n(QT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(eE,{asChild:!0,children:n(W,{variant:`outline`,role:`combobox`,"aria-expanded":c,"aria-label":s(`filter.filter`),size:`md`,className:B(`transition group flex gap-1.5`,e),children:[t(rt,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(nE,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(Wv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(Kv,{placeholder:u?s(`filter.filterBy`,{view:u}):s(`filter.filterPlaceholder`),className:`h-9 ring-0`,value:f,onValueChange:e=>{p(e)},ref:m,autoFocus:!0}),t(qv,{children:t(Yv,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(pE,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(gE,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(hE,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(mE,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},SE=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(yE);return t(`div`,{className:B(e),children:t(vE,{filters:n,setFilters:r,filterGroups:i})})},CE=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(yE),{t:i}=k();return n.filter(e=>e.value?.length>0).length>0?t(W,{variant:`outline`,size:`md`,className:B(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function wE(e){return typeof e==`string`?e:e.value||``}var TE;(function(e){e.IS=`is`,e.IS_NOT=`is_not`,e.CONTAINS=`contains`,e.BEFORE=`before`,e.AFTER=`after`,e.IS_ANY_OF=`is_any_of`})(TE||={});const EE=p(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:B({h1:`text-2xl font-medium tracking-tight`,h2:`text-xl font-medium tracking-tight`,h3:`text-lg font-medium`,h4:`text-base font-medium`,h5:`text-sm font-medium`,h6:`text-xs font-medium`}[`h${n}`],`mb-2`,e),...r})});EE.displayName=`Heading`;function DE({options:i,optionLabel:a,groupBy:o,value:s,onChange:c,addNew:l,addNewLabel:u,disabled:d,filterBy:f,label:p,placeholder:m,className:h,popupClass:g,isClearable:y,border:b=!0,multiple:x=!1,by:T,inline:E=!1,isLoading:D=!1,warnOnMissingValue:O=!0,missingValueWarning:k=`Value not in options list, may not be valid`,clearIcon:A,clearTitle:j,"aria-label":M,"aria-labelledby":N,id:P,"aria-describedby":ee,"aria-invalid":te}){let F=C(null),[ne,re]=w(!1),[ie,ae]=w(0),[oe,se]=w(``),ce=v(),le=v(),ue=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?OE(e,T)===OE(s,T):typeof T==`function`?T(e,s):ge(e,s)),[O,x,s,i,T]);_(()=>{let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ae(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let de=e=>{if(x){let t=Array.isArray(s)?s:[];fe(e,t)?c(t.filter(t=>!pe(t,e))):c([...t,e])}else c(e)},fe=(e,t)=>!t||t.length===0?!1:t.some(t=>pe(t,e)),pe=(e,t)=>e==null||t==null?e===t:typeof T==`string`?OE(e,T)===OE(t,T):typeof T==`function`?T(e,t):ge(e,t),me=i||[];function he(e){return e?typeof e==`string`?t=>String(OE(t,e)).toLowerCase():e:e=>String(e).toLowerCase()}let _e=oe.toLowerCase(),ve=he(f);me=me.filter(e=>ve(e).includes(_e));let ye=()=>{if(!s||Array.isArray(s)&&s.length===0)return t(`span`,{className:`text-muted`,children:m});let e=Array.isArray(s)?s[0]:s;return a?a(e):e},be=()=>{let e=Array.isArray(s)?s:s?[s]:[];return e.length===0?t(`span`,{className:`text-muted`,children:m}):e.length===1?a?a(e[0]):e[0]:n(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,1).map((e,n)=>t(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded`,children:a?a(e):e},`chip-${n}`)),e.length>1&&n(`span`,{className:`inline-flex items-center px-2 py-1 text-xs bg-muted rounded`,children:[`+`,e.length-1,` more`]})]})},xe=(e,r)=>{let i=x?fe(e,Array.isArray(s)?s:[]):s!=null&&pe(s,e);return t(Zv,{onSelect:()=>de(e),className:`w-full`,children:x||E?n(`div`,{className:`w-full flex justify-between items-center cursor-pointer`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(L,{className:`size-4`})]}):n(rE,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(L,{className:`size-4`})]})},`option-${r}`)},Se=(()=>{if(!o)return null;let e=[],t=/* @__PURE__ */ new Map;for(let n of me){let r=o(n),i=t.get(r);i||(i=[],t.set(r,i),e.push({key:r,items:i})),i.push(n)}return e})(),Ce=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1 shrink-0`,children:[t(`div`,{className:`mx-2`,children:t(pt,{className:`size-4`})}),t(dE,{variant:`unstyled`,value:oe,onChange:se,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(Wv,{className:E?`min-h-0 flex-1`:`overflow-hidden`,children:n(qv,{className:E?`min-h-0 flex-1 overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(Jv,{children:`No result found.`}),Se?Se.map(e=>t(Yv,{heading:e.key,className:`[&_[cmdk-group-heading]]:text-muted [&_[cmdk-group-heading]]:border-b [&_[cmdk-group-heading]]:border-border [&_[cmdk-group-heading]]:ml-[-0.5rem] [&_[cmdk-group-heading]]:text-xs`,children:e.items.map((t,n)=>xe(t,`${e.key}-${n}`))},e.key)):t(Yv,{children:me?.map((e,t)=>xe(e,t))})]})}),l&&t(`div`,{className:`p-1`,children:n(`button`,{type:`button`,onClick:l,className:r(`w-full text-start gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-muted bg-transparent border-0`),children:[t(ht,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),u]})})]});if(E)return t(`div`,{className:r(`flex flex-col`,h,b&&`border border-border rounded-md`,`bg-popover p-1`,g),children:D?t(`div`,{className:`flex justify-center items-center p-2 text-muted text-sm`,children:t(at,{className:`size-4 animate-spin`})}):Ce()});let we=!!p,Te=M??(we?void 0:typeof m==`string`?m:void 0),Ee=N??(we?le:void 0),De=!!y&&!!s&&(!Array.isArray(s)||s.length>0),Oe=te===!0||te===`true`||ue?!0:te===!1||te===`false`?!1:void 0;return n(QT,{onOpenChange:re,children:[n(`div`,{ref:F,className:r(`relative`,h),children:[t(eE,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":ne,"aria-controls":ce,"aria-label":Te,"aria-labelledby":Ee,"aria-describedby":ee,"aria-invalid":Oe,className:r(D?`flex w-full justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm bg-transparent`:r(b&&(ue||Oe?`border border-destructive`:`border border-border`),`flex w-full flex-row gap-2 items-center justify-between p-2 rounded-md group bg-transparent text-inherit text-start`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,d?`cursor-not-allowed text-muted`:`cursor-pointer hover:bg-muted`,De&&`pe-10`)),children:D?t(at,{className:`size-4 animate-spin`}):n(e,{children:[n(`div`,{className:r(`flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate`),children:[p&&t(`div`,{id:le,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,ue&&`text-destructive`),children:[ue&&t(Wi,{description:k,placement:`top`,asChild:!0,children:t(yt,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?be():ye()]})]}),!d&&t(Ue,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),De&&!D&&t(W,{variant:`link`,size:`icon`,disabled:d,title:j||`Clear selection`,onClick:e=>{e.stopPropagation(),c(x?[]:void 0)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},className:`absolute end-2 top-1/2 -translate-y-1/2 hover:bg-muted/20 rounded p-1`,children:A||t(xt,{className:`size-4`})})]}),t(nE,{id:ce,style:{width:`${ie}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:Ce()})]})}function OE(e,t){return typeof e==`object`&&e?e[t]:void 0}const kE={ar:`العربية`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,it:`Italiano`,ja:`日本語`,ko:`한국어`,pt:`Português`,ru:`Русский`,tr:`Türkçe`,zh:`中文`,"zh-TW":`繁體中文`};function AE({label:e,className:r}={}){let{language:i,setLanguage:a}=O(),{t:o}=k(),s=e===!1?!1:e??o(`language.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center gap-3`:`flex items-center`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),t(DE,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>kE[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var jE=Object.defineProperty,ME=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>jE(e,`name`,{value:t,configurable:!0}))(function(e,n){return/* @__PURE__ */ t(U.label,{...e,ref:n,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));const NE=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),PE=a.forwardRef(({className:e,required:r,...i},a)=>n(ME,{ref:a,className:B(NE(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive ms-1`,children:`*`})]}));PE.displayName=ME.displayName;function FE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(qe,{className:`size-5 text-destructive`,"aria-hidden":`true`}),c=`text-destructive`,l=`text-foreground`,u=`bg-destructive border border-destructive`;break;case`warning`:s=t(yt,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Ge,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(tt,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(tt,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(tt,{className:`size-5 text-done`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-done border border-done`}return t(`div`,{className:`rounded-md p-4 ${u} ${o}`,children:n(`div`,{className:`flex`,children:[t(`div`,{className:`shrink-0`,children:e??s}),n(`div`,{className:`w-full ms-2 px-1`,children:[i&&t(`h3`,{className:`text-base font-medium mb-2 ${c}`,children:i}),t(`div`,{className:`text-sm ${l} break-words`,children:a})]})]})})}function IE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(FE,{status:`error`,title:e,className:`${r} flex flex-col items-center justify-center text-center`,children:[t(`pre`,{className:`whitespace-pre-wrap break-words`,children:i}),a&&o&&t(W,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function LE({title:e,className:n,children:r}){return t(FE,{status:`info`,title:e,className:n,children:r})}function RE({title:e,className:n,children:r}){return t(FE,{status:`warning`,title:e,className:n,children:r})}function zE({title:e,className:n,children:r}){return t(FE,{status:`success`,title:e,className:n,children:r})}function BE({title:e,className:n,children:r}){return t(FE,{status:`default`,title:e,className:n,children:r})}function VE({title:e,content:r,onConfirm:i,onCancel:a,isOpen:o,isLoading:s,confirmationValue:c,confirmationLabel:l,confirmationPlaceholder:u}){let{t:d}=k(),f=C(null),[p,m]=w(``);_(()=>{o||m(``)},[o]);let h=!!c,g=!c||p.trim()===c.trim(),v=()=>{g&&!s&&i()};return n(Mv,{isOpen:o,onClose:a,description:`Confirm Modal`,children:[n(`div`,{className:`sm:flex sm:items-start p-2`,children:[t(`div`,{className:`mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-destructive sm:mx-0 sm:h-10 sm:w-10`,children:t(yt,{className:`size-6 text-destructive`,"aria-hidden":`true`})}),n(`div`,{className:`mt-3 text-center sm:ms-4 sm:mt-0 sm:text-start`,children:[t(Nv,{className:`leading-6`,show:!0,children:e}),t(`div`,{className:`mt-2`,children:t(`div`,{className:`prose text-sm text-muted`,children:r})})]})]}),h&&t(`div`,{className:`px-2 pb-2 text-start`,children:t(la,{label:l??u,children:t(dE,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(Fv,{align:`right`,children:[t(W,{variant:`destructive`,onClick:v,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(W,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function HE(){return g(UE)}const UE=d(()=>{}),WE={success:Ge,error:qe,warning:yt,info:tt},GE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function KE({data:e,onClose:r}){let[i,a]=w(!0),o=C(null),s=h(()=>{o.current&&=(globalThis.clearTimeout(o.current),null)},[]),c=h(()=>{s(),e.duration&&(o.current=setTimeout(()=>a(!1),e.duration))},[s,e.duration]);_(()=>(c(),s),[s,c]);let l=WE[e.status]||tt,u=GE[e.status]||`text-info`;return t(`div`,{"aria-live":`assertive`,className:`pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-100`,children:t(`div`,{className:`flex w-full flex-col items-center space-y-4 sm:items-end`,children:t(am,{onExitComplete:r,children:i&&t(Zh.div,{className:`pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border`,initial:{opacity:0,x:8},animate:{opacity:1,x:0,transition:{ease:`easeOut`,duration:.7}},exit:{opacity:0,transition:{ease:`easeIn`,duration:.3}},onMouseEnter:s,onMouseLeave:c,children:t(`div`,{className:`p-5`,children:n(`div`,{className:`flex items-start`,children:[t(`div`,{className:`shrink-0`,children:t(l,{className:`size-6 ${u}`,"aria-hidden":`true`})}),n(`div`,{className:`ms-3 flex-1 pt-0.5 min-w-0`,children:[t(`p`,{className:`text-sm font-semibold text-foreground break-words`,children:e.title}),e.description&&t(`p`,{className:`mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed`,children:e.description})]}),t(`div`,{className:`ms-4 flex shrink-0`,children:n(`button`,{type:`button`,className:`inline-flex rounded-md bg-muted text-muted hover:text-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background`,onClick:()=>a(!1),children:[t(`span`,{className:`sr-only`,children:`Close`}),t(xt,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function qE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(UE.Provider,{value:o,children:r}),i&&t(ng,{children:t(KE,{data:i,onClose:()=>o(null)})})]})}function JE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=HE();return t(VE,{title:n,content:r,isOpen:!!e,onConfirm:async()=>{if(e)return a(e).then(()=>{s({title:o(`modal.delete.succeeded`),status:`success`})}).catch(e=>{s({title:o(`modal.delete.failed`),description:e instanceof Error?e.message:o(`modal.delete.error`),status:`error`})}).finally(()=>{i(void 0)})},onCancel:()=>{i(void 0)}})}const YE=4,XE={tabs:{base:`flex items-center border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`border-transparent text-muted hover:border-border hover:text-foreground`,active:`border-primary text-info`,icon:`ms-1 size-4`},pills:{base:`flex items-center rounded-md px-2 py-1 text-xs font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`text-muted hover:bg-muted/60`,active:`bg-muted text-foreground`,icon:`ms-0.5 size-3.5`}};function ZE(e,t,n=4){let r=C(null),i=C([]),a=C(null),[o,s]=w({count:e.length,promote:!1}),c=()=>{let o=r.current;if(!o)return;let c=o.clientWidth,l=e.map((e,t)=>i.current[t]?.offsetWidth??0),u=l.reduce((e,t)=>e+t,0)+n*Math.max(0,e.length-1),d=(t,r)=>{let i=0,a=0;for(let o=0;o<e.length;o++){if(o===r)continue;let e=i+(a>0?n:0)+l[o];if(e>t)break;i=e,a+=1}return a},f;if(u<=c)f={count:e.length,promote:!1};else{let r=a.current?.offsetWidth??0,i=Math.max(1,d(c-r-n,-1)),o=e.findIndex(t);f=o<0||o<i?{count:i,promote:!1}:{count:d(c-r-l[o]-n*2,o),promote:!0}}s(e=>e.count===f.count&&e.promote===f.promote?e:f)},l=C(c);l.current=c,x(()=>{l.current()}),_(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>l.current());return t.observe(e),()=>t.disconnect()},[]);let u=e.findIndex(t),d,f;if(o.promote&&u>=0){let t=e.filter((e,t)=>t!==u);d=[...t.slice(0,o.count),e[u]],f=t.slice(o.count)}else d=e.slice(0,o.count),f=e.slice(o.count);return{containerRef:r,setItemRef:e=>t=>{i.current[e]=t},setMoreRef:e=>{a.current=e},visible:d,overflow:f,activeInOverflow:f.some(t)}}function QE({label:e,triggerClassName:r,icon:i,children:a}){let[o,s]=w(!1),c=C(null),l=C(!1),u=()=>{c.current&&=(clearTimeout(c.current),null)},d=()=>{u(),l.current=!0,s(!0)},f=()=>{u(),c.current=setTimeout(()=>s(!1),150)};return _(()=>()=>clearTimeout(c.current??void 0),[]),n(iS,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(oS,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(R,{className:`ms-1 size-4`})]})}),t(sS,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function $E({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=XE[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=ZE(e,e=>e.name===r),h=s(`agent.moreTabs`);return n(`div`,{ref:l,className:B(`relative`,o),children:[n(`div`,{"aria-hidden":!0,className:`pointer-events-none invisible absolute start-0 top-0 flex w-max gap-1`,children:[e.map((e,n)=>t(`button`,{type:`button`,tabIndex:-1,ref:u(n),className:B(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:d,className:B(c.base,c.inactive),children:[h,t(R,{className:c.icon})]})]}),n(`div`,{className:B(`flex gap-1 overflow-hidden`,a===`tabs`&&`-mb-px border-b`),children:[f.map(e=>{let n=e.name===r;return t(`button`,{type:`button`,"aria-current":n?`page`:void 0,disabled:e.disabled,onClick:()=>i(e.name),className:B(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),p.length>0&&t(QE,{label:h,triggerClassName:B(c.base,m?c.active:c.inactive),icon:t(R,{className:c.icon}),children:p.map(e=>t(lS,{disabled:e.disabled,onClick:()=>i(e.name),className:B(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function eD({children:r,action:i,title:a,description:o,footer:s,className:c,collapsible:l,defaultCollapsed:u=!1,size:d=`md`,clickableHeader:f=!1}){let[p,m]=w(u),h=l&&f,g=d===`sm`,_=g||h,v=t(p?R:ze,{className:`size-4 text-muted`}),y=n(e,{children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`div`,{className:`font-semibold ${g?`text-sm`:`text-lg`}`,children:a}),t(oa,{description:o,size:`md`})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,l&&(h?v:t(W,{variant:`ghost`,size:`icon`,onClick:()=>m(!p),children:v}))]})]}),b=g?`px-4 py-2`:`px-4 py-3`,x=g?`px-4 pt-3 pb-3`:`p-4`,S=g?`px-4 pb-3`:`px-4 pb-4`;return n(`div`,{className:`flex flex-col ${_?``:`p-4 gap-2`} rounded-sm border bg-card ${h?`overflow-hidden`:``} ${c??``}`,children:[h?t(`button`,{type:`button`,className:`w-full flex items-center justify-between ${b} hover:bg-muted/50 transition-colors`,onClick:()=>m(!p),children:y}):t(`div`,{className:`flex items-center justify-between ${_?b:``}`,children:y}),!p&&(_?t(`div`,{className:x,children:r}):r),s&&t(`div`,{className:`border-t border-muted flex flex-col-2 text-sm pt-4 ${_?S:``}`,children:s})]})}var tD=Object.defineProperty,nD=(e,t)=>tD(e,`name`,{value:t,configurable:!0}),rD=`Radio`,[iD,aD]=/* @__PURE__ */ kn(rD),[oD,sD]=iD(rD);function cD(e){let{__scopeRadio:n,checked:r=!1,children:i,disabled:o,form:s,name:c,onCheck:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=a.useState(null),[h,g]=a.useState(null),_=a.useRef(!1),[v,y]=a.useReducer(e=>e+1,0),b={checked:r,disabled:o,required:u,name:c,form:s,value:d,control:p,setControl:m,hasConsumerStoppedPropagationRef:_,userInteractionCount:v,onUserInteraction:y,isFormControl:!p||!!s||!!p.closest(`form`),bubbleInput:h,setBubbleInput:g,onCheck:/* @__PURE__ */ nD(()=>l?.(),`onCheck`)};return/* @__PURE__ */ t(oD,{scope:n,...b,children:hD(f)?f(b):i})}nD(cD,`RadioProvider`);var lD=`RadioTrigger`,uD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,hasConsumerStoppedPropagationRef:u,onUserInteraction:d,isFormControl:f,bubbleInput:p}=sD(lD,e),m=z(i,c);return/* @__PURE__ */ t(U.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":gD(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:m,onClick:V(n,e=>{a||(d(),l()),p&&f&&(u.current=e.isPropagationStopped(),u.current||e.stopPropagation())})})},`RadioTrigger`)),dD=`RadioIndicator`,fD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=sD(dD,r);return/* @__PURE__ */ t(Ar,{present:i||o.checked,children:/* @__PURE__ */ t(U.span,{"data-state":gD(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),pD=`RadioBubbleInput`,mD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function({__scopeRadio:e,onClick:n,...r},i){let{control:o,checked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m,hasConsumerStoppedPropagationRef:h,userInteractionCount:g}=sD(pD,e),_=z(i,m),v=ir(o),y=a.useRef(!1),b=a.useRef(s),x=a.useRef(g);a.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=g!==x.current;x.current=g;let i=b.current!==s;b.current=s;let a=!(r&&h.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[p,s,h,g]);let S=a.useRef(s);return/* @__PURE__ */ t(U.input,{type:`radio`,"aria-hidden":!0,defaultChecked:S.current,required:c,disabled:l,name:u,value:d,form:f,...r,tabIndex:-1,ref:_,onClick:V(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function hD(e){return typeof e==`function`}nD(hD,`isFunction`);function gD(e){return e?`checked`:`unchecked`}nD(gD,`getState`);var _D=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],vD=`RadioGroup`,[yD,bD]=/* @__PURE__ */ kn(vD,[ky,aD]),xD=ky(),SD=aD(),[CD,wD]=yD(vD),TD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function(e,n){let{__scopeRadioGroup:r,name:i,form:o,defaultValue:s,value:c,required:l=!1,disabled:u=!1,orientation:d,dir:f,loop:p=!0,onValueChange:m,...h}=e,g=xD(r),_=fe(f),[v,y]=Wr({prop:c,defaultProp:s??null,onChange:m,caller:vD}),[b,x]=a.useState(null),S=z(n,x),C=a.useRef(v);return a.useEffect(()=>{let e=o?b?.ownerDocument.getElementById(o):b?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ nD(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),/* @__PURE__ */ t(CD,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:/* @__PURE__ */ t(Vy,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:/* @__PURE__ */ t(U.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),ED=`RadioGroupItemProvider`,DD=`RadioGroupItemTrigger`;function OD(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=wD(ED,n),c=SD(n),l=s.disabled||i;return/* @__PURE__ */ t(cD,{...c,checked:s.value===r,disabled:l,required:s.required,name:s.name,form:s.form,value:r,onCheck:()=>s.onValueChange(r),internal_do_not_use_render:o,children:a})}nD(OD,`RadioGroupItemProvider`);var kD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=xD(r),s=SD(r),{checked:c,disabled:l}=sD(DD,s.__scopeRadio),u=a.useRef(null),d=z(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=/* @__PURE__ */ nD(e=>{_D.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=/* @__PURE__ */ nD(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),/* @__PURE__ */ t(Hy,{asChild:!0,...o,focusable:!l,active:c,children:/* @__PURE__ */ t(uD,{...s,...i,ref:d,onKeyDown:V(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:V(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),AD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return/* @__PURE__ */ t(OD,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(kD,{...c,ref:i,__scopeRadioGroup:a}),r&&/* @__PURE__ */ t(jD,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),jD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=SD(r);return/* @__PURE__ */ t(mD,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),MD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nD(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=SD(r);return/* @__PURE__ */ t(fD,{...a,...i,ref:n})},`RadioGroupIndicator`));function ND({className:e,...n}){return t(AD,{"data-slot":`radio-group-item`,className:B(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:t(MD,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:t(`span`,{className:`bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full`})})})}var PD=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function FD({onSelect:e,selected:r,options:i,adapter:a}){let o=e=>a?a.idOf(e):e.id,s=e=>a?a.labelOf(e):e.label,c=e=>a?a.descriptionOf(e):e.description,l=e=>a?a.selectedClassName(e):`border-primary`;return t(TD,{"data-slot":`radio-group`,value:r?o(r):void 0,onValueChange:t=>{let n=i.find(e=>o(e)===t);n&&e(n)},className:`space-y-4`,children:i.map(e=>{let i=r?o(r)===o(e):!1;return t(AD,{value:o(e),className:B(`relative block w-full cursor-pointer rounded-lg border border-border bg-muted px-6 py-4 shadow-2xs text-start`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`sm:flex sm:justify-between`,i&&l(e)),children:t(`span`,{className:`flex items-center`,children:n(`span`,{className:`flex flex-col text-sm`,children:[t(`span`,{className:`font-medium text-foreground`,children:s(e)}),c(e)&&t(`span`,{className:`text-muted`,children:c(e)})]})})},o(e))})})}function ID({className:e,direction:n=`horizontal`,orientation:r,...i}){let a=r??n;return t(_e.Group,{"data-slot":`resizable-panel-group`,"data-panel-group-direction":a,orientation:a,className:B(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function LD(e){return typeof e==`number`?`${e}%`:e}function RD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:LD(e),minSize:LD(n),maxSize:LD(r),collapsedSize:LD(i),...a})}function zD({withHandle:e,className:n,...r}){return t(_e.Separator,{"data-slot":`resizable-handle`,className:B(`bg-muted focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:start-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),...r,children:e&&t(`div`,{className:`z-10 flex size-4 items-center justify-center rounded-xs font-semibold`,children:t(st,{className:`size-4 rotate-90`})})})}var BD=Object.defineProperty,VD=(e,t)=>BD(e,`name`,{value:t,configurable:!0}),HD=`horizontal`,UD=[`horizontal`,`vertical`],WD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ VD(function(e,n){let{decorative:r,orientation:i=HD,...a}=e,o=GD(i)?i:HD,s=r?{role:`none`}:{"aria-orientation":o===`vertical`?o:void 0,role:`separator`};return/* @__PURE__ */ t(U.div,{"data-orientation":o,...s,...a,ref:n})},`Separator`));function GD(e){return UD.includes(e)}VD(GD,`isValidOrientation`);var KD=WD;const qD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(KD,{ref:a,decorative:r,orientation:n,className:B(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));qD.displayName=KD.displayName;var JD=Object.defineProperty,YD=(e,t)=>JD(e,`name`,{value:t,configurable:!0});function XD(e,[t,n]){return Math.min(n,Math.max(t,e))}YD(XD,`clamp`);var ZD=Object.defineProperty,QD=(e,t)=>ZD(e,`name`,{value:t,configurable:!0});function $D(e){let t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}QD($D,`usePrevious`);var eO=Object.defineProperty,$=(e,t)=>eO(e,`name`,{value:t,configurable:!0}),tO=[`PageUp`,`PageDown`],nO=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],rO={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},iO=`Slider`,[aO,oO,sO]=/* @__PURE__ */ ty(iO),[cO,lO]=/* @__PURE__ */ kn(iO,[sO]),[uO,dO]=cO(iO),fO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=`horizontal`,disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[i],value:f,onValueChange:p=/* @__PURE__ */ $(()=>{},`onValueChange`),onValueCommit:m=/* @__PURE__ */ $(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=a.useRef(/* @__PURE__ */ new Set),y=a.useRef(0),b=a.useRef(!1),x=c===`horizontal`?hO:gO,[S,C]=a.useState(null),w=z(n,C),[T=[],E]=Wr({prop:f,defaultProp:d,onChange:/* @__PURE__ */ $(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,p(e)},`onChange`)}),D=a.useRef(T),O=a.useRef(T);a.useEffect(()=>{let e=g?S?.ownerDocument.getElementById(g):S?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ $(()=>E(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function k(e){M(e,PO(T,e))}$(k,`handleSlideStart`);function A(e){M(e,y.current)}$(A,`handleSlideMove`);function j(){String(T)!==String(D.current)&&m(T)}$(j,`handleSlideEnd`);function M(e,t,{commit:n}={commit:!1}){let r=zO(s),a=XD(BO(Math.round((e-i)/s)*s+i,r),[i,o]);E((e=[])=>{let r=jO(e,a,t);if(LO(r,u*s)){y.current=r.indexOf(a);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}return e})}return $(M,`updateValues`),/* @__PURE__ */ t(uO,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:c,form:g,children:/* @__PURE__ */ t(aO.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(aO.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(x,{"aria-disabled":l,"data-disabled":l?``:void 0,..._,ref:w,onPointerDown:V(_.onPointerDown,()=>{l||(D.current=T,b.current=!1)}),min:i,max:o,inverted:h,onSlideStart:l?void 0:k,onSlideMove:l?void 0:A,onSlideEnd:l?void 0:j,onHomeKeyDown:()=>{l||(b.current=!0,M(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(b.current=!0,M(o,T.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){b.current=!0;let n=tO.includes(e.key)||e.shiftKey&&nO.includes(e.key)?10:1,r=y.current,a=T[r];M(VO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[pO,mO]=cO(iO,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),hO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{min:r,max:i,dir:o,inverted:s,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,[p,m]=a.useState(null),h=z(n,m),g=a.useRef(void 0),_=fe(o),v=_===`ltr`,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=RO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),/* @__PURE__ */ t(pO,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:/* @__PURE__ */ t(_O,{dir:_,"data-orientation":`horizontal`,...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=b(e.clientX);c?.(t)},onSlideMove:e=>{let t=b(e.clientX);l?.(t)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:e=>{let t=rO[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),gO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{min:r,max:i,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=e,f=a.useRef(null),p=z(n,f),m=a.useRef(void 0),h=!o;function g(e){let t=m.current||f.current.getBoundingClientRect(),n=RO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),/* @__PURE__ */ t(pO,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:/* @__PURE__ */ t(_O,{"data-orientation":`vertical`,...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=g(e.clientY);s?.(t)},onSlideMove:e=>{let t=g(e.clientY);c?.(t)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:e=>{let t=rO[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),_O=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...u}=e,d=dO(iO,r);return/* @__PURE__ */ t(U.span,{...u,ref:n,onKeyDown:V(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(c(e),e.preventDefault()):tO.concat(nO).includes(e.key)&&(l(e),e.preventDefault())}),onPointerDown:V(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):i(e)}),onPointerMove:V(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:V(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},`SliderImpl`)),vO=`SliderTrack`,yO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=dO(vO,r);return/* @__PURE__ */ t(U.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),bO=`SliderRange`,xO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,o=dO(bO,r),s=mO(bO,r),c=z(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>MO(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return/* @__PURE__ */ t(U.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...i,ref:c,style:{...e.style,[s.startEdge]:d+`%`,[s.endEdge]:f+`%`}})},`SliderRange`)),[SO,CO]=cO(`SliderThumb`),wO=`SliderThumbProvider`;function TO(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=dO(wO,n),c=oO(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=ir(l),p=!l||!!s.form||!!l.closest(`form`),m=s.values[d],h=r??(s.name?s.name+(s.values.length>1?`[]`:``):void 0),g=m===void 0?0:MO(m,s.min,s.max);a.useEffect(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]);let _={value:m,name:h,form:s.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:g,size:f};return/* @__PURE__ */ t(SO,{scope:n,..._,children:HO(o)?o(_):i})}$(TO,`SliderThumbProvider`);var EO=`SliderThumbTrigger`,DO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=dO(EO,r),o=mO(EO,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=CO(EO,r),f=z(n,d),p=NO(s,a.values.length),m=u?.[o.size],h=m?FO(m,l,o.direction):0;return/* @__PURE__ */ t(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:/* @__PURE__ */ t(aO.ItemSlot,{scope:r,children:/* @__PURE__ */ t(U.span,{role:`slider`,"aria-label":e[`aria-label`]||p,"aria-valuemin":a.min,"aria-valuenow":c,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?``:void 0,tabIndex:a.disabled?void 0:0,...i,ref:f,style:c===void 0?{display:`none`}:e.style,onFocus:V(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),OO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return/* @__PURE__ */ t(TO,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(DO,{...s,ref:i,__scopeSlider:a}),o?/* @__PURE__ */ t(AO,{__scopeSlider:a},r):null]})})},`SliderThumb`)),kO=`SliderBubbleInput`,AO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function({__scopeSlider:e,...n},r){let{value:i,name:o,form:s}=CO(kO,e),c=a.useRef(null),l=z(c,r),u=$D(i);return a.useEffect(()=>{let e=c.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==i&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,i),e.dispatchEvent(t)}},[u,i]),/* @__PURE__ */ t(U.input,{style:{display:`none`},name:o,form:s,...n,ref:l,defaultValue:i})},`SliderBubbleInput`));function jO(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(jO,`getNextSortedValues`);function MO(e,t,n){return XD(100/(n-t)*(e-t),[0,100])}$(MO,`convertValueToPercentage`);function NO(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(NO,`getLabel`);function PO(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}$(PO,`getClosestValueIndex`);function FO(e,t,n){let r=e/2;return(r-RO([0,50],[0,r])(t)*n)*n}$(FO,`getThumbInBoundsOffset`);function IO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(IO,`getStepsBetweenValues`);function LO(e,t){if(t>0){let n=IO(e);return Math.min(...n)>=t}return!0}$(LO,`hasMinStepsBetweenValues`);function RO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}$(RO,`linearScale`);function zO(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}$(zO,`getDecimalCount`);function BO(e,t){let n=10**t;return Math.round(e*n)/n}$(BO,`roundValue`);function VO(e,{min:t,step:n,direction:r,multiplier:i}){let a=zO(n),o=(e-t)/n,s=Math.round(o),c=BO(s*n+t,a)===BO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),BO(l*n+t,a)}$(VO,`getNextStepValue`);function HO(e){return typeof e==`function`}$(HO,`isFunction`);const UO=a.forwardRef(({className:e,trackClassName:r,rangeClassName:i,thumbClassName:o,value:s,defaultValue:c,min:l=0,max:u=100,"aria-label":d,...f},p)=>{let m=a.useId(),h=Array.isArray(s)?s.length:Array.isArray(c)?c.length:1,g=a.useMemo(()=>Array.from({length:Math.max(1,h)},(e,t)=>`${m}-thumb-${t}`),[m,h]);return n(fO,{ref:p,"data-slot":`slider`,value:s,defaultValue:c,min:l,max:u,...f,className:B(`relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,e),children:[t(yO,{"data-slot":`slider-track`,className:B(`relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`,r),children:t(xO,{"data-slot":`slider-range`,className:B(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(OO,{"data-slot":`slider-thumb`,"aria-label":d,className:B(`block size-3.5 rounded-full border border-primary bg-background shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,o)},e))]})});UO.displayName=fO.displayName;var WO=Object.defineProperty,GO=(e,t)=>WO(e,`name`,{value:t,configurable:!0}),KO=`Switch`,[qO,JO]=/* @__PURE__ */ kn(KO),[YO,XO]=qO(KO);function ZO(e){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=Wr({prop:r,defaultProp:o??!1,onChange:u,caller:KO}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C={checked:m,setChecked:h,disabled:s,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:o,isFormControl:!g||!!c||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(YO,{scope:n,...C,children:ak(p)?p(C):i})}GO(ZO,`SwitchProvider`);var QO=`SwitchTrigger`,$O=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ GO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,form:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=XO(QO,e),v=z(i,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ GO(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,p]),/* @__PURE__ */ t(U.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":ok(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:v,onClick:V(n,e=>{h(),p(e=>!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`SwitchTrigger`)),ek=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ GO(function(r,i){let{__scopeSwitch:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return/* @__PURE__ */ t(ZO,{__scopeSwitch:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t($O,{...m,ref:i,__scopeSwitch:a}),r&&/* @__PURE__ */ t(ik,{__scopeSwitch:a})]})})},`Switch`)),tk=`SwitchThumb`,nk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ GO(function(e,n){let{__scopeSwitch:r,...i}=e,a=XO(tk,r);return/* @__PURE__ */ t(U.span,{"data-state":ok(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),rk=`SwitchBubbleInput`,ik=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ GO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=XO(rk,e),v=z(i,_),y=ir(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(l);return/* @__PURE__ */ t(U.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:V(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function ak(e){return typeof e==`function`}GO(ak,`isFunction`);function ok(e){return e?`checked`:`unchecked`}GO(ok,`getState`);const sk={sm:[`h-5 w-8`,`size-3`,`translate-x-4 rtl:-translate-x-4`],md:[`h-6 w-11`,`size-4`,`translate-x-6 rtl:-translate-x-6`],lg:[`h-8 w-16`,`size-6`,`translate-x-9 rtl:-translate-x-9`]};function ck({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=sk[r],f=t(ek,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:B(`data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-full border focus-visible:ring-3 aria-invalid:ring-3 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,l,!o&&e),children:t(nk,{"data-slot":`switch-thumb`,className:B(`bg-white rounded-full pointer-events-none block ring-0 transition-transform`,u,i?d:`translate-x-1 rtl:-translate-x-1`)})});return o?n(`div`,{className:B(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}var lk=Object.defineProperty,uk=(e,t)=>lk(e,`name`,{value:t,configurable:!0}),dk=`Tabs`,[fk,pk]=/* @__PURE__ */ kn(dk,[ky]),mk=ky(),[hk,gk]=fk(dk),_k=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ uk(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=`automatic`,...u}=e,d=fe(c),[f,p]=Wr({prop:i,onChange:a,defaultProp:o??``,caller:dk});return/* @__PURE__ */ t(hk,{scope:r,baseId:H(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:/* @__PURE__ */ t(U.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),vk=`TabsList`,yk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ uk(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=gk(vk,r),s=mk(r);return/* @__PURE__ */ t(Vy,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:/* @__PURE__ */ t(U.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),bk=`TabsTrigger`,xk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ uk(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=gk(bk,r),c=mk(r),l=wk(s.baseId,i),u=Tk(s.baseId,i),d=i===s.value;return/* @__PURE__ */ t(Hy,{asChild:!0,...c,focusable:!a,active:d,children:/* @__PURE__ */ t(U.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":u,"data-state":d?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:l,...o,ref:n,onMouseDown:V(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(i):e.preventDefault()}),onKeyDown:V(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:V(e.onFocus,()=>{let e=s.activationMode!==`manual`;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),Sk=`TabsContent`,Ck=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ uk(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=gk(Sk,r),u=wk(l.baseId,i),d=Tk(l.baseId,i),f=i===l.value,p=a.useRef(f);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),/* @__PURE__ */ t(Ar,{present:o||f,children:({present:r})=>/* @__PURE__ */ t(U.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:r&&s})})},`TabsContent`));function wk(e,t){return`${e}-trigger-${t}`}uk(wk,`makeTriggerId`);function Tk(e,t){return`${e}-content-${t}`}uk(Tk,`makeContentId`);var Ek=_k,Dk=yk,Ok=xk,kk=Ck;const Ak=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),jk=({orientation:e=`horizontal`,tabs:n,defaultValue:r,current:i,className:o,fullWidth:s,fullHeight:c,children:l,onTabChange:u,responsive:d=!1,variant:f=`tabs`,updateHash:p=!0,canChangeTab:m})=>{let h=a.useMemo(()=>n.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[n]),[g,_]=a.useState(()=>{let e=typeof i==`function`?i():i;if(e)return e;let t=window.location.hash,n=t?t.substring(1):void 0;return n&&h.some(e=>e.name===n)?n:r||h[0]?.name});a.useEffect(()=>{let e=typeof i==`function`?i():i;e&&e!==g&&_(e)},[i,g]),a.useEffect(()=>{if(i)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&h.some(e=>e.name===t)?_(t):!e&&r&&_(r)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[i,h,r]);let v=a.useCallback(e=>{if(e===g||!m||m(e,g)){if(_(e),p&&!i){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}u&&u(e)}},[i,u,p,m,g]),y=a.useCallback(e=>{v(e)},[v]);return t(Ak.Provider,{value:{orientation:e,tabs:h,size:s?h.length:0,current:g,setTab:y,responsive:d,variant:f,updateHash:p,canChangeTab:m},children:t(Ek,{orientation:e,defaultValue:g||h[0]?.name,value:g,onValueChange:v,className:B(`flex-1 flex flex-col min-h-0 px-2`,c&&`h-full`,o),children:l})})},Mk=({className:r,sticky:i,direction:o})=>{let{tabs:s,size:c,current:l,setTab:u,responsive:d,variant:f,updateHash:p,canChangeTab:m,orientation:h}=a.useContext(Ak),g=o??h??`horizontal`,_=c!==0,v=a.useCallback(e=>{if(!s||!u||e!==l&&m&&!m(e,l))return;let t=s.find(t=>t.name===e);if(t?.href&&p){let e=window.history.state;window.history.pushState(e,``,t.href)}u(e)},[s,u,p,m,l]);return!s||!u?(console.warn(`TabsBar: No tabs provided or setTab not available`),null):n(e,{children:[d&&t(`div`,{className:`px-2 block lg:hidden`,children:t(DE,{label:`Tab`,className:B(i&&`sticky top-0 bg-background z-10`,r),options:s,optionLabel:e=>typeof e.label==`string`?e.label:String(e.label),value:s.find(e=>e.name===l),onChange:e=>{v(e.name)}})}),t(Pk,{size:c,variant:f,className:B(_?`w-full`:``,i&&`sticky top-0 bg-background z-10`,g===`vertical`?`flex-col items-start border-b-0 mb-0`:`flex-row`,d?`hidden lg:flex`:``,r),children:s.map(e=>t(Fk,{className:B(g===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:f,onClick:()=>v(e.name),children:e.label},e.name))})]})},Nk=({className:n})=>{let{tabs:r}=a.useContext(Ak);return r?t(e,{children:r.map(e=>t(Ik,{value:e.name,className:n,children:e.content},e.name))}):null},Pk=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(Ak.Provider,{value:{size:n,variant:r},children:t(Dk,{ref:a,className:B(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));Pk.displayName=Dk.displayName;const Fk=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(Ak),c=a.useCallback(e=>{if(n){e.preventDefault();let t=window.history.state;window.history.pushState(t,``,n)}i.onClick&&i.onClick(e)},[n,i.onClick]);return t(Ok,{ref:o,className:B(r===`tabs`?B(`border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer`,`border-transparent text-muted hover:border-border hover:text-foreground`,`data-[state=active]:border-primary data-[state=active]:text-info`,`disabled:pointer-events-none disabled:opacity-50`):B(`px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors`,`border border-input bg-muted shadow-xs hover:bg-muted ring-inset`,`data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm`,`disabled:pointer-events-none disabled:opacity-50`),e,s?`w-1/${s}`:``),onClick:c,...i})});Fk.displayName=Ok.displayName;const Ik=a.forwardRef(({className:e,...n},r)=>t(kk,{ref:r,className:B(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));Ik.displayName=kk.displayName;const Lk=A(`text-foreground`,{variants:{size:{xl:`text-base md:text-lg leading-relaxed`,lg:`text-base leading-relaxed`,default:`text-sm leading-normal`,sm:`text-sm leading-normal`,xs:`text-xs leading-normal`},weight:{normal:`font-normal`,medium:`font-medium`,semibold:`font-semibold`}},defaultVariants:{size:`default`,weight:`normal`}}),Rk=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:B(Lk({size:n,weight:r,className:e})),...i}));Rk.displayName=`Text`;function zk({className:e,minLines:n,maxLines:r,value:i,...a}){let o=C(null),s=n!==void 0||r!==void 0,c=h(()=>{let e=o.current;if(!e)return;let t=getComputedStyle(e),i=parseFloat(t.lineHeight)||parseFloat(t.fontSize)*1.5,a=(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0),s=(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0),c=n??1,l=r??1/0,u=c*i+a+s,d=l===1/0?1/0:l*i+a+s;e.style.height=`auto`;let f=Math.min(Math.max(e.scrollHeight,u),d);e.style.height=`${f}px`,e.style.overflowY=d!==1/0&&e.scrollHeight>d?`auto`:`hidden`},[n,r]);return x(()=>{s&&c()}),t(`textarea`,{ref:o,"data-slot":`textarea`,value:i,className:B(`py-2 text-sm`,`flex w-full rounded-md border border-input bg-background ring-offset-background`,`placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,s&&`resize-none`,e),...a})}const Bk=d({theme:`system`,setTheme:()=>null});function Vk({children:e,defaultTheme:n=`system`,storageKey:r=`vite-ui-theme`,...i}){let[a,o]=w(()=>localStorage.getItem(r)||n);_(()=>{let e=window.document.documentElement;if(a!==`system`){e.classList.remove(`light`,`dark`),e.classList.add(a);return}let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{e.classList.remove(`light`,`dark`),e.classList.add(t.matches?`dark`:`light`)};return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[a]),_(()=>{let e=e=>{if(e.storageArea!==localStorage||e.key!==r&&e.key!==null)return;let t=e.newValue;o(t===`dark`||t===`light`||t===`system`?t:n)};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[n,r]);let s=h((e,t)=>{t?.persist!==!1&&localStorage.setItem(r,e),o(e)},[r]),c=S(()=>({theme:a,setTheme:s}),[s,a]);return t(Bk.Provider,{...i,value:c,children:e})}const Hk=()=>{let e=g(Bk);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function Uk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(W,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function Wk({label:e,className:r}={}){let{setTheme:i,theme:a}=Hk(),{t:o}=k(),s=e===!1?!1:e??o(`theme.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center`:`flex items-center gap-1`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),n(`div`,{className:`flex gap-2`,children:[t(Uk,{current:a,option:`system`,setTheme:i,icon:t(Ye,{}),alt:o(`theme.system`)}),t(Uk,{current:a,option:`light`,setTheme:i,icon:t(_t,{}),alt:o(`theme.light`)}),t(Uk,{current:a,option:`dark`,setTheme:i,icon:t(lt,{}),alt:o(`theme.dark`)})]})]})}function Gk(e,n){return{label:String(e),check:t(n?L:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function Kk({value:e,options:i,onChange:a,className:o,optionLayout:s,by:c,noCheck:l,filterBy:u}){let{t:d}=k(),[f,p]=w(e),[m,h]=w(``),g=e=>{p(e),a(e)},_=S(()=>typeof c==`string`?(e,t)=>e[c]===t[c]:c||((e,t)=>e===t),[c]);return n(`div`,{className:r(``,o),children:[u&&t(dE,{type:`text`,placeholder:d(`form.filter`),value:m,onChange:e=>h(e)}),i.map((e,n)=>{if(u&&!u(m)(e))return null;let r=f?_(f,e):!1,i;return s?(i=s(e,r),i=Object.assign(Gk(e,r),i)):i=Gk(e,r),t(qk,{option:e,onSelect:g,layout:i,noCheck:l,isSelected:r},`option-${n}`)})]})}function qk({option:e,onSelect:i,layout:a,noCheck:o,isSelected:s}){return n(W,{variant:`unstyled`,size:`none`,className:r(`group flex! w-full items-center cursor-pointer gap-x-2 hover:bg-muted`,a.reverse&&`flex-row-reverse`,a.className,s&&`bg-muted`),onClick:()=>i(e),children:[o?null:t(`div`,{className:``,children:a.check}),t(`div`,{className:`flex-1`,children:a.label})]})}function Jk({isOpen:e,title:r,onClose:i,children:a,panelWidth:o=768,backdrop:s=!1,side:c=`right`,resizable:l=!0,className:u,contentClassName:d}){let[f,p]=w(o),m=e=>{e.preventDefault();let t=!0,n=e.pageX,r=f,i=e=>{if(t){let t=n-e.pageX,i=Math.max(r+t,480);p(i)}},a=()=>{t=!1,document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)},h=c===`left`,g=h?`left-0`:`right-0`,_=h?`pr-10 sm:pr-16`:`pl-10 sm:pl-16`,v=h?`border-r`:`border-l`,y=h?`-right-1`:`-left-1`,b=h?`-100%`:`100%`;return t(ng,{children:t(am,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(Zh.div,{className:`fixed inset-0 bg-black/70`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:i}),t(`div`,{className:`fixed inset-y-0 ${g} overflow-hidden`,children:t(`div`,{className:`absolute inset-0 overflow-hidden`,children:t(`div`,{className:`pointer-events-none fixed inset-y-0 ${g} flex max-w-full ${_}`,children:t(Zh.div,{className:`pointer-events-auto ${v}`,style:{width:`${f}px`},initial:{x:b},animate:{x:0},exit:{x:b},transition:{type:`spring`,stiffness:300,damping:30},children:n(`div`,{className:`relative flex h-full`,children:[l&&t(`div`,{"aria-label":`Resize panel`,className:`absolute ${y} top-0 bottom-0 w-3 z-25 cursor-ew-resize hover:bg-primary transition-colors flex items-center justify-center`,onMouseDown:m,children:t(st,{className:`rotate-90 font-semibold`,strokeWidth:4})}),n(`div`,{className:`flex-1 min-w-0 flex flex-col bg-background shadow-xl ${u}`,children:[r&&t(`div`,{className:`sticky top-0 z-10 bg-background px-2 sm:px-4 py-2 border-b`,children:n(`div`,{className:`flex items-start justify-between`,children:[t(`h2`,{className:`w-full text-base font-semibold leading-6`,children:t(`div`,{className:`text-2xl`,children:r??``})}),t(`div`,{className:`ms-3 flex h-7 items-center`,children:t(Yk,{onClose:i})})]})}),t(`div`,{className:d??`flex-1 overflow-auto px-2 sm:px-4 py-4`,children:t(`div`,{className:`w-full h-full flex-1 flex flex-col`,children:a})})]})]})})})})})]})})})}function Yk({onClose:e}){return t(W,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(xt,{className:`size-6`,"aria-hidden":`true`})})}function Xk(e){switch(e){case`xs`:return`size-2`;case`sm`:return`size-3`;case`md`:return`size-4`;case`lg`:return`size-5`;case`xl`:return`size-7`;case`2xl`:return`size-10`;default:throw Error(`Unexpected size: ${e}`)}}const Zk=d(void 0),Qk=Zk.Provider;function $k({size:e,className:i}){let a=Xk(e||`md`),o=g(Zk);return o?t(o,{className:r(a,i)}):n(`svg`,{className:r(`animate-[spin_0.8s_linear_infinite] text-info`,a,i),xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,role:`img`,"aria-label":`Loading`,children:[t(`title`,{children:`Loading`}),t(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),t(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function eA({options:i,value:a,onChange:o,onOptionsChange:s,placeholder:c,className:l,disabled:u,layout:d=`horizontal`,creatable:f=!1,createText:p=`Create "%value%"`,maxDropdownHeight:m=200}){let h=g(ZT),[v,y]=w(``),[b,x]=w(0),[S,T]=w(0),[E,D]=w(null),O=C(null),k=C(null),A=C(null),j=C(null),M=h?.open??!1,N=h?.setOpen??(()=>{});_(()=>{let e=k.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;T(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let P=i.filter(e=>!a.includes(e)&&e.toLowerCase().includes(v.toLowerCase())),ee=f&&v&&!a.includes(v)&&!i.includes(v),te=P.length+ +!!ee;_(()=>{v!==``&&D(null)},[v]),_(()=>{M&&b>=0&&j.current&&A.current&&j.current.scrollIntoView({block:`nearest`,behavior:`smooth`})},[b,M]),_(()=>{M?O.current?.focus():y(``)},[M]),_(()=>{if(!M)return;let e=e=>e instanceof Node&&(k.current?.contains(e)===!0||A.current?.contains(e)===!0),t=t=>{e(t.target)||N(!1)},n=t=>{e(t.target)||N(!1)},r=()=>{N(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,n,!0),window.addEventListener(`blur`,r),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,n,!0),window.removeEventListener(`blur`,r),document.removeEventListener(`visibilitychange`,r)}},[M,N]);let F=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},ne=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},re=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(eE,{asChild:!0,children:n(`div`,{ref:k,className:r(`min-h-[40px] w-full rounded-md border border-input bg-background px-3 py-2`,`flex items-center gap-1`,d===`horizontal`?`flex-wrap`:`flex-col items-stretch`,`cursor-text`,`ring-offset-background`,u&&`opacity-50 cursor-not-allowed`,M?`ring-1 ring-inset ring-ring`:``),onClick:()=>{u||O.current?.focus()},children:[d===`vertical`&&a.length>0&&t(`div`,{className:`flex flex-col gap-1 w-full`,children:a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center justify-between gap-2 px-2 py-1 text-sm bg-info text-info ring-1 ring-info/30 rounded-md w-full transition-all`,E===i&&`ring-2 ring-destructive shadow-md`),children:[t(`span`,{className:`truncate`,children:e}),t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors flex-shrink-0`,children:t(xt,{className:`h-3 w-3`})})]},e))}),d===`horizontal`&&a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center gap-1 px-2 py-1 text-sm bg-info text-info ring-1 ring-info/30 rounded-md transition-all`,E===i&&`ring-2 ring-destructive shadow-md`),children:[e,t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(xt,{className:`h-3 w-3`})})]},e)),t(`input`,{ref:O,type:`text`,value:v,onChange:e=>{y(e.target.value),x(0)},onKeyDown:e=>{if(e.key===`Enter`&&M&&te>0){e.preventDefault(),e.stopPropagation(),b===P.length&&ee?ne(v):b<P.length&&F(P[b]);return}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),M?x(e=>e<te-1?e+1:e):N(!0);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),M?x(e=>e>0?e-1:0):N(!0);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),N(!1);return}if(e.key===`Backspace`&&v===``&&a.length>0){e.stopPropagation();let t=a.length-1;E===t?(o(a.slice(0,-1)),D(null)):D(t);return}!M&&e.key.length===1&&N(!0)},onClick:e=>{e.stopPropagation(),u||N(!0)},onFocus:()=>{u||N(!0)},disabled:u,placeholder:a.length===0?c:``,className:r(`flex-1 min-w-[120px] bg-transparent text-sm`,`placeholder:text-muted`,`border-none outline-none focus:outline-none focus:ring-0 p-0 m-0`,d===`vertical`&&`w-full`)})]})}),t(nE,{style:{width:`${S}px`},className:`p-0 bg-popover border border-border shadow-lg`,align:`start`,side:`bottom`,onOpenAutoFocus:e=>{e.preventDefault()},children:t(`div`,{ref:A,className:`overflow-y-auto`,style:{maxHeight:`${m}px`},children:P.length===0&&!ee?t(`div`,{className:`px-3 py-2 text-sm text-muted`,children:v?`No options found`:`No more options available`}):n(e,{children:[P.length>0&&t(`ul`,{className:`py-1`,children:P.map((e,n)=>t(`li`,{ref:e=>{n===b&&(j.current=e)},role:`option`,"aria-selected":n===b,tabIndex:0,onClick:()=>F(e),onKeyDown:ua(()=>F(e)),onMouseEnter:()=>x(n),className:r(`px-3 py-2 text-sm cursor-pointer transition-colors`,n===b?`bg-info text-foreground`:`hover:bg-muted/50`),children:e},e))}),ee&&n(e,{children:[P.length>0&&t(`div`,{className:`border-t border-border`}),t(W,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>ne(v),onMouseEnter:()=>x(P.length),className:r(`!flex w-full justify-start px-3 py-2 text-sm cursor-pointer transition-colors text-info`,b===P.length?`bg-info`:`hover:bg-muted/50`),children:p.replace(`%value%`,v)})]})]})})})]})}function tA(e){return t(QT,{click:!0,children:t(eA,{...e})})}function nA({className:e,children:n,...i}){return t(`table`,{className:r(`
|
|
334
|
+
flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(wt,{size:16})})]})});WT.displayName=`Input`;const GT=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(jT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(NT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-info shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r||`Enter text...`})}),t(FT,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(WT,{autoFocus:!0,type:`text`,size:`sm`,value:s,onChange:c,onKeyDown:e=>{e.key===`Enter`&&(i(s),o(!1))},placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(W,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function KT({selectedView:r,selectedDate:i,setSelectedDate:a,setFilters:o,filters:s,handleClose:c,filterGroups:l}){let{t:u}=k(),[d,f]=w([null,null]),[p,m]=w([null,null]),h=l.find(e=>e.name===r),g=h?.multiple,_=/* @__PURE__ */ new Date;_.setHours(23,59,59,999);let v=[p[0]||d[0],p[1]||d[1]],y=e=>{if(g)Array.isArray(e)?(m([e[0],e[1]]),f([e[0],e[1]])):(m([e,null]),f([e,null]));else{let t=Array.isArray(e)?e[0]:e;if(a(t||void 0),t){let e=new Date(t);e.setHours(0,0,0,0),o([...s,{name:r||``,placeholder:h?.placeholder,value:[{value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}],type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}}};return t(`div`,{className:`p-2`,children:g?n(e,{children:[t(`div`,{children:g?v[0]&&v[1]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:u(`filter.to`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[1]).format(`MMMM DD, YYYY`)})]}):v[0]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`→ Select end date`})]}):t(`span`,{className:`text-muted text-xs`,children:h?.placeholder||h?.name||r||`Select date range`}):i?Q(i).format(`MMMM DD, YYYY`):`Pick a date`}),n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:RT}),t(nT,{value:v,onChange:y,selectRange:!0,returnValue:`range`,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=/* @__PURE__ */ new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(v[0]){let e=v[0].getTime();if(v[1]){let n=v[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-info text-info font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}},`${v[0]?.getTime()}-${v[1]?.getTime()}`)]}),t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(W,{size:`sm`,onClick:()=>{if(d[0]){let e=new Date(d[0]),t=d[1]?new Date(d[1]):new Date(d[0]);e.setHours(0,0,0,0),t.setHours(23,59,59,999);let n=[];n.push({value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}),d[1]&&d[0].getTime()!==d[1].getTime()&&n.push({value:t.toISOString(),label:Q(t).format(`LLL dd, y`)}),o([...s,{name:r||``,placeholder:h?.placeholder,value:n,type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}},disabled:!v[0],children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:RT}),t(nT,{value:i,onChange:y,selectRange:!1,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=/* @__PURE__ */ new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(i&&t===i.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})}function qT({selectedView:e,commandInput:r,setFilters:i,handleClose:a,filterGroups:o}){let[s,c]=w([]),l=e=>{let t=o.find(t=>t.name===e);if(!t)return[];let n=t.options||[];if(!r.trim())return n;if(t.filterBy){let e=r.toLowerCase();return n.filter(n=>n.value!==void 0&&t.filterBy?.(n.value,e))}let i=r.toLowerCase();return n.filter(e=>String(e.value||``).toLowerCase().includes(i))};if(!e)return null;let u=l(e),d=o.find(t=>t.name===e),f=d?.placeholder||d?.name,p=()=>{s.length>0&&i(t=>[...t.filter(t=>t.name!==e),{name:e||``,placeholder:d?.placeholder||``,value:s,type:d?.type||`select`,multiple:d?.multiple||!1}]),a()},m=t=>{let n={value:t.value,label:t.label};d?.multiple?s.some(e=>e.value===t.value)?c(e=>e.filter(e=>e.value!==t.value)):c(e=>[...e,n]):(i(t=>{let r=t.findIndex(t=>t.name===e);if(r>=0){let e=[...t];return e[r]={...e[r],value:[n]},e}return[...t,{name:e||``,placeholder:d?.placeholder||``,value:[n],type:d?.type||`select`,multiple:d?.multiple||!1}]}),a())};return n(`div`,{className:`flex flex-col h-full`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted shrink-0`,children:t(`span`,{children:f})}),t(`div`,{className:`flex-1 overflow-hidden min-h-0`,children:t(`div`,{className:`max-h-[200px] overflow-y-auto`,children:u.length>0&&u.map(e=>{let r=s.some(t=>t.value===e.value);return n(ly,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(BT,{value:e.value||``,labelRenderer:e.labelRenderer||d?.labelRenderer,fallbackLabel:e.label}),d?.multiple&&r&&t(`span`,{className:`ms-auto text-xs text-success`,children:`✓`})]},e.value||`option-${Math.random()}`)})})}),d?.multiple&&t(`div`,{className:`p-2 border-t shrink-0`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(W,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function JT({selectedView:e,setFilters:r,handleClose:i,filterGroups:a}){let[o,s]=w([]),c=a.find(t=>t.name===e);return n(`div`,{className:`p-2 space-y-3`,children:[t(`div`,{className:`space-y-2`,children:t(_a,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(W,{size:`sm`,onClick:()=>{o.length>0&&r(t=>[...t.filter(t=>t.name!==e),{name:e,placeholder:c?.placeholder,value:o,type:`stringList`}]),i()},disabled:o.length===0,children:`Apply`})]})]})}function YT({selectedView:e,textValue:r,setTextValue:i,setFilters:a,handleClose:o,filterGroups:s}){let c=()=>{a(t=>[...t,{name:e||``,placeholder:s.find(t=>t.name===e)?.placeholder,value:[{value:r,label:r}],type:`text`}]),o()};return n(`div`,{className:`p-2 flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:s.find(t=>t.name===e)?.placeholder})}),t(WT,{autoFocus:!0,type:`text`,size:`sm`,value:r,onChange:i,onKeyDown:e=>e.key===`Enter`&&c(),placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(W,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function XT(e,n,r){switch(e.type){case`date`:return t(zT,{filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value.map(e=>e.value||``):[],isRange:e.multiple,setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t.length>0?t.map(e=>({value:e,label:Q(e).format(`LLL dd, y`)})):[]}:n))}});case`text`:return t(GT,{filterType:e.placeholder||e.name,filterValue:Array.isArray(e.value)&&e.value[0]&&typeof e.value[0]==`object`&&e.value[0].value||``,setFilterValue:t=>{n(n=>n.map(n=>n===e?{...n,value:[{value:t,label:t}]}:n))}});case`stringList`:return t(HT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`string`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))}});default:{let i=r.find(t=>t.name===e.name);return t(VT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))},options:i?.options||[],labelRenderer:i?.labelRenderer,multiple:e.multiple??i?.multiple})}}}function ZT({filters:e,setFilters:r,filterGroups:i}){return t(`div`,{className:`flex gap-2 flex-wrap justify-start`,children:e.filter(e=>e.value?.length>0).map(e=>n(`div`,{className:`flex gap-[1px] items-center text-sm`,children:[t(`div`,{className:`flex gap-1.5 shrink-0 rounded-s bg-muted p-1.5 h-8 items-center`,children:e.placeholder||e.name}),XT(e,r,i),t(W,{variant:`ghost`,size:`icon`,onClick:()=>{r(t=>t.filter(t=>t!==e))},className:`bg-muted rounded-s-none rounded-e-sm size-8 hover:text-info hover:bg-muted/50 transition shrink-0`,children:t(wt,{className:`size-6`})})]},`${e.name}-${e.type===`date`?`date`:e.type===`stringList`&&typeof e.value[0]==`string`?e.value.join(`,`):Array.isArray(e.value)?e.value.map(e=>e.value).join(`,`):``}`))})}const QT=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),$T=({filters:e,setFilters:n,filterGroups:r,children:i,inModal:a})=>{let s=new URL(window.location.href).searchParams.toString(),[c]=o.useState(()=>new URLSearchParams(window.location.search).get(`filters`)),l=o.useRef(/* @__PURE__ */ new Set),u=o.useRef(a||!c);return _(()=>{if(!a&&u.current)try{let t=new URLSearchParams(s);if(e.length>0){let n=e.map(e=>{let t;if(e.type===`stringList`&&Array.isArray(e.value)&&typeof e.value[0]==`string`)t=`[${e.value.map(e=>encodeURIComponent(e)).join(`,`)}]`;else if(Array.isArray(e.value)){if(e.multiple)t=`[${e.value.map(e=>encodeURIComponent(rE(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(rE(e))).join(`,`)}]`;else{let n=e.value[0];t=typeof n==`string`?encodeURIComponent(n):typeof n==`object`&&n?.value!==void 0?encodeURIComponent(String(n.value)):encodeURIComponent(String(n||``))}}else t=encodeURIComponent(e.value||``);return`${encodeURIComponent(e.name)}:${t}`}).join(`;`);t.set(`filters`,n)}else t.delete(`filters`);let n=`${window.location.pathname}?${t.toString()}${window.location.hash}`;window.history.replaceState(window.history.state||{},``,n)}catch(e){console.error(`Failed to update URL with filters:`,e)}},[e,a,s]),_(()=>{if(!a&&c&&r.length!==0)try{let e=c.split(`;`),t=[];for(let n of e){let e=n.indexOf(`:`);if(e===-1)continue;let i=n.slice(0,e),a=n.slice(e+1),o=decodeURIComponent(i);if(l.current.has(o))continue;let s=r.find(e=>e.name===o);if(!s)continue;l.current.add(o);let c;if(a.startsWith(`[`)&&a.endsWith(`]`)){let e=a.slice(1,-1);c=e?e.split(`,`).map(e=>decodeURIComponent(e)):[]}else c=[decodeURIComponent(a)];let u;u=s.type===`stringList`?c:s.type===`text`?c.length===1?[{value:c[0],label:c[0]}]:c.map(e=>({value:e,label:e})):c.map(e=>{let t=s.options?.find(t=>t.value===e),n=e;return t?.label?n=String(t.label):t?.labelRenderer?n=String(t.labelRenderer(e)):s.labelRenderer&&(n=String(s.labelRenderer(e))),{value:e,label:n}}),s.multiple&&!a.startsWith(`[`)&&!a.endsWith(`]`)&&(s.type===`stringList`?u=c:Array.isArray(u)||(u=[u])),t.push({name:o,type:s.type,placeholder:s.placeholder,value:u,multiple:s.multiple})}t.length>0&&n(e=>{let n=new Set(t.map(e=>e.name));return[...e.filter(e=>!n.has(e.name)),...t]}),u.current=!0}catch{}},[r,a,c,n]),t(QT.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},eE=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(QT),{t:s}=k(),[c,l]=o.useState(!1),[u,d]=o.useState(null),[f,p]=o.useState(``),m=o.useRef(null),[h,g]=o.useState(),[_,v]=o.useState(``),y=e=>{d(e),p(``),m.current?.focus()},b=()=>{let e=a.map(e=>({...e,options:(e.options??[]).filter(t=>!r.some(n=>n.type===`date`?n.name===e.name:n.name===e.name&&(Array.isArray(n.value)&&typeof n.value[0]==`string`?n.value.some(e=>e===t.value):n.value.some(e=>rE(e)===t.value))))})).filter(e=>(e.options??[]).length>0||e.type===`date`&&!r.some(t=>t.name===e.name)||e.type===`text`&&!r.some(t=>t.name===e.name)||e.type===`stringList`&&!r.some(t=>t.name===e.name));return e.length===0?t(oy,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(ly,{onSelect:()=>y(e.name),className:`group flex gap-2 items-center hover:bg-muted`,children:t(`span`,{children:e.placeholder??e.name})},e.name))},x=()=>{l(!1),setTimeout(()=>{d(null),p(``),g(void 0)},200)};return n(jT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(NT,{asChild:!0,children:n(W,{variant:`outline`,role:`combobox`,"aria-expanded":c,"aria-label":s(`filter.filter`),size:`md`,className:B(`transition group flex gap-1.5`,e),children:[t(ot,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(FT,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(ny,{children:[a.find(e=>e.name===u)?.type===`select`&&t(iy,{placeholder:u?s(`filter.filterBy`,{view:u}):s(`filter.filterPlaceholder`),className:`h-9 ring-0`,value:f,onValueChange:e=>{p(e)},ref:m,autoFocus:!0}),t(ay,{children:t(sy,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(KT,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(YT,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(JT,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(qT,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},tE=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(QT);return t(`div`,{className:B(e),children:t(ZT,{filters:n,setFilters:r,filterGroups:i})})},nE=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(QT),{t:i}=k();return n.filter(e=>e.value?.length>0).length>0?t(W,{variant:`outline`,size:`md`,className:B(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function rE(e){return typeof e==`string`?e:e.value||``}var iE;(function(e){e.IS=`is`,e.IS_NOT=`is_not`,e.CONTAINS=`contains`,e.BEFORE=`before`,e.AFTER=`after`,e.IS_ANY_OF=`is_any_of`})(iE||={});const aE=p(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:B({h1:`text-2xl font-medium tracking-tight`,h2:`text-xl font-medium tracking-tight`,h3:`text-lg font-medium`,h4:`text-base font-medium`,h5:`text-sm font-medium`,h6:`text-xs font-medium`}[`h${n}`],`mb-2`,e),...r})});aE.displayName=`Heading`;function oE({options:i,optionLabel:a,groupBy:o,value:s,onChange:c,addNew:l,addNewLabel:u,disabled:d,filterBy:f,label:p,placeholder:m,className:h,popupClass:g,isClearable:y,border:b=!0,multiple:x=!1,by:T,inline:E=!1,isLoading:D=!1,warnOnMissingValue:O=!0,missingValueWarning:k=`Value not in options list, may not be valid`,clearIcon:A,clearTitle:j,"aria-label":M,"aria-labelledby":N,id:P,"aria-describedby":F,"aria-invalid":ee}){let I=C(null),[te,ne]=w(!1),[re,ie]=w(0),[ae,oe]=w(``),se=v(),ce=v(),le=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?sE(e,T)===sE(s,T):typeof T==`function`?T(e,s):ve(e,s)),[O,x,s,i,T]);_(()=>{let e=I.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ie(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let ue=e=>{if(x){let t=Array.isArray(s)?s:[];de(e,t)?c(t.filter(t=>!fe(t,e))):c([...t,e])}else c(e)},de=(e,t)=>!t||t.length===0?!1:t.some(t=>fe(t,e)),fe=(e,t)=>e==null||t==null?e===t:typeof T==`string`?sE(e,T)===sE(t,T):typeof T==`function`?T(e,t):ve(e,t),pe=i||[];function me(e){return e?typeof e==`string`?t=>String(sE(t,e)).toLowerCase():t=>e(t).toLowerCase():e=>String(e).toLowerCase()}let he=ae.toLowerCase(),ge=me(f);pe=pe.filter(e=>ge(e).includes(he));let _e=()=>{if(!s||Array.isArray(s)&&s.length===0)return t(`span`,{className:`text-muted`,children:m});let e=Array.isArray(s)?s[0]:s;return a?a(e):e},ye=()=>{let e=Array.isArray(s)?s:s?[s]:[];return e.length===0?t(`span`,{className:`text-muted`,children:m}):e.length===1?a?a(e[0]):e[0]:n(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,1).map((e,n)=>t(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded`,children:a?a(e):e},`chip-${n}`)),e.length>1&&n(`span`,{className:`inline-flex items-center px-2 py-1 text-xs bg-muted rounded`,children:[`+`,e.length-1,` more`]})]})},be=(e,r)=>{let i=x?de(e,Array.isArray(s)?s:[]):s!=null&&fe(s,e);return t(ly,{onSelect:()=>ue(e),className:`w-full`,children:x||E?n(`div`,{className:`w-full flex justify-between items-center cursor-pointer`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Re,{className:`size-4`})]}):n(IT,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Re,{className:`size-4`})]})},`option-${r}`)},xe=(()=>{if(!o)return null;let e=[],t=/* @__PURE__ */ new Map;for(let n of pe){let r=o(n),i=t.get(r);i||(i=[],t.set(r,i),e.push({key:r,items:i})),i.push(n)}return e})(),Se=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1 shrink-0`,children:[t(`div`,{className:`mx-2`,children:t(gt,{className:`size-4`})}),t(WT,{variant:`unstyled`,value:ae,onChange:oe,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(ny,{className:E?`min-h-0 flex-1`:`overflow-hidden`,children:n(ay,{className:E?`min-h-0 flex-1 overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(oy,{children:`No result found.`}),xe?xe.map(e=>t(sy,{heading:e.key,className:`[&_[cmdk-group-heading]]:text-muted [&_[cmdk-group-heading]]:border-b [&_[cmdk-group-heading]]:border-border [&_[cmdk-group-heading]]:ml-[-0.5rem] [&_[cmdk-group-heading]]:text-xs`,children:e.items.map((t,n)=>be(t,`${e.key}-${n}`))},e.key)):t(sy,{children:pe?.map((e,t)=>be(e,t))})]})}),l&&t(`div`,{className:`p-1`,children:n(`button`,{type:`button`,onClick:l,className:r(`w-full text-start gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-muted bg-transparent border-0`),children:[t(vt,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),u]})})]});if(E)return t(`div`,{className:r(`flex flex-col`,h,b&&`border border-border rounded-md`,`bg-popover p-1`,g),children:D?t(`div`,{className:`flex justify-center items-center p-2 text-muted text-sm`,children:t(ct,{className:`size-4 animate-spin`})}):Se()});let Ce=!!p,we=M??(Ce?void 0:typeof m==`string`?m:void 0),Te=N??(Ce?ce:void 0),Ee=!!y&&!!s&&(!Array.isArray(s)||s.length>0),De=ee===!0||ee===`true`||le?!0:ee===!1||ee===`false`?!1:void 0;return n(jT,{onOpenChange:ne,children:[n(`div`,{ref:I,className:r(`relative`,h),children:[t(NT,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":te,"aria-controls":se,"aria-label":we,"aria-labelledby":Te,"aria-describedby":F,"aria-invalid":De,className:r(D?`flex w-full justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm bg-transparent`:r(b&&(le||De?`border border-destructive`:`border border-border`),`flex w-full flex-row gap-2 items-center justify-between p-2 rounded-md group bg-transparent text-inherit text-start`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,d?`cursor-not-allowed text-muted`:`cursor-pointer hover:bg-muted`,Ee&&`pe-10`)),children:D?t(ct,{className:`size-4 animate-spin`}):n(e,{children:[n(`div`,{className:r(`flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate`),children:[p&&t(`div`,{id:ce,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,le&&`text-destructive`),children:[le&&t(Gi,{description:k,placement:`top`,asChild:!0,children:t(St,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?ye():_e()]})]}),!d&&t(Ke,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),Ee&&!D&&t(W,{variant:`link`,size:`icon`,disabled:d,title:j||`Clear selection`,onClick:e=>{e.stopPropagation(),c(x?[]:void 0)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},className:`absolute end-2 top-1/2 -translate-y-1/2 hover:bg-muted/20 rounded p-1`,children:A||t(wt,{className:`size-4`})})]}),t(FT,{id:se,style:{width:`${re}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:Se()})]})}function sE(e,t){return typeof e==`object`&&e?e[t]:void 0}const cE={ar:`العربية`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,it:`Italiano`,ja:`日本語`,ko:`한국어`,pt:`Português`,ru:`Русский`,tr:`Türkçe`,zh:`中文`,"zh-TW":`繁體中文`};function lE({label:e,className:r}={}){let{language:i,setLanguage:a}=O(),{t:o}=k(),s=e===!1?!1:e??o(`language.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center gap-3`:`flex items-center`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),t(oE,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>cE[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var uE=Object.defineProperty,dE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>uE(e,`name`,{value:t,configurable:!0}))(function(e,n){return/* @__PURE__ */ t(U.label,{...e,ref:n,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));const fE=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),pE=a.forwardRef(({className:e,required:r,...i},a)=>n(dE,{ref:a,className:B(fE(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive ms-1`,children:`*`})]}));pE.displayName=dE.displayName;function mE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(Xe,{className:`size-5 text-destructive`,"aria-hidden":`true`}),c=`text-destructive`,l=`text-foreground`,u=`bg-destructive border border-destructive`;break;case`warning`:s=t(St,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Je,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(it,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(it,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(it,{className:`size-5 text-done`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-done border border-done`}return t(`div`,{className:`rounded-md p-4 ${u} ${o}`,children:n(`div`,{className:`flex`,children:[t(`div`,{className:`shrink-0`,children:e??s}),n(`div`,{className:`w-full ms-2 px-1`,children:[i&&t(`h3`,{className:`text-base font-medium mb-2 ${c}`,children:i}),t(`div`,{className:`text-sm ${l} break-words`,children:a})]})]})})}function hE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(mE,{status:`error`,title:e,className:`${r} flex flex-col items-center justify-center text-center`,children:[t(`pre`,{className:`whitespace-pre-wrap break-words`,children:i}),a&&o&&t(W,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function gE({title:e,className:n,children:r}){return t(mE,{status:`info`,title:e,className:n,children:r})}function _E({title:e,className:n,children:r}){return t(mE,{status:`warning`,title:e,className:n,children:r})}function vE({title:e,className:n,children:r}){return t(mE,{status:`success`,title:e,className:n,children:r})}function yE({title:e,className:n,children:r}){return t(mE,{status:`default`,title:e,className:n,children:r})}function bE({title:e,content:r,onConfirm:i,onCancel:a,isOpen:o,isLoading:s,confirmationValue:c,confirmationLabel:l,confirmationPlaceholder:u}){let{t:d}=k(),f=C(null),[p,m]=w(``);_(()=>{o||m(``)},[o]);let h=!!c,g=!c||p.trim()===c.trim(),v=()=>{g&&!s&&i()};return n(Wv,{isOpen:o,onClose:a,description:`Confirm Modal`,children:[n(`div`,{className:`sm:flex sm:items-start p-2`,children:[t(`div`,{className:`mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-destructive sm:mx-0 sm:h-10 sm:w-10`,children:t(St,{className:`size-6 text-destructive`,"aria-hidden":`true`})}),n(`div`,{className:`mt-3 text-center sm:ms-4 sm:mt-0 sm:text-start`,children:[t(Gv,{className:`leading-6`,show:!0,children:e}),t(`div`,{className:`mt-2`,children:t(`div`,{className:`prose text-sm text-muted`,children:r})})]})]}),h&&t(`div`,{className:`px-2 pb-2 text-start`,children:t(ua,{label:l??u,children:t(WT,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(qv,{align:`right`,children:[t(W,{variant:`destructive`,onClick:v,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(W,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function xE(){return g(SE)}const SE=d(()=>{}),CE={success:Je,error:Xe,warning:St,info:it},wE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function TE({data:e,onClose:r}){let[i,a]=w(!0),o=C(null),s=h(()=>{o.current&&=(globalThis.clearTimeout(o.current),null)},[]),c=h(()=>{s(),e.duration&&(o.current=setTimeout(()=>a(!1),e.duration))},[s,e.duration]);_(()=>(c(),s),[s,c]);let l=CE[e.status]||it,u=wE[e.status]||`text-info`;return t(`div`,{"aria-live":`assertive`,className:`pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-100`,children:t(`div`,{className:`flex w-full flex-col items-center space-y-4 sm:items-end`,children:t(xm,{onExitComplete:r,children:i&&t(pg.div,{className:`pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border`,initial:{opacity:0,x:8},animate:{opacity:1,x:0,transition:{ease:`easeOut`,duration:.7}},exit:{opacity:0,transition:{ease:`easeIn`,duration:.3}},onMouseEnter:s,onMouseLeave:c,children:t(`div`,{className:`p-5`,children:n(`div`,{className:`flex items-start`,children:[t(`div`,{className:`shrink-0`,children:t(l,{className:`size-6 ${u}`,"aria-hidden":`true`})}),n(`div`,{className:`ms-3 flex-1 pt-0.5 min-w-0`,children:[t(`p`,{className:`text-sm font-semibold text-foreground break-words`,children:e.title}),e.description&&t(`p`,{className:`mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed`,children:e.description})]}),t(`div`,{className:`ms-4 flex shrink-0`,children:n(`button`,{type:`button`,className:`inline-flex rounded-md bg-muted text-muted hover:text-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background`,onClick:()=>a(!1),children:[t(`span`,{className:`sr-only`,children:`Close`}),t(wt,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function EE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(SE.Provider,{value:o,children:r}),i&&t(vg,{children:t(TE,{data:i,onClose:()=>o(null)})})]})}function DE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=xE();return t(bE,{title:n,content:r,isOpen:!!e,onConfirm:async()=>{if(e)return a(e).then(()=>{s({title:o(`modal.delete.succeeded`),status:`success`})}).catch(e=>{s({title:o(`modal.delete.failed`),description:e instanceof Error?e.message:o(`modal.delete.error`),status:`error`})}).finally(()=>{i(void 0)})},onCancel:()=>{i(void 0)}})}const OE=4,kE={tabs:{base:`flex items-center border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`border-transparent text-muted hover:border-border hover:text-foreground`,active:`border-primary text-info`,icon:`ms-1 size-4`},pills:{base:`flex items-center rounded-md px-2 py-1 text-xs font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`text-muted hover:bg-muted/60`,active:`bg-muted text-foreground`,icon:`ms-0.5 size-3.5`}};function AE(e,t,n=4){let r=C(null),i=C([]),a=C(null),[o,s]=w({count:e.length,promote:!1}),c=()=>{let o=r.current;if(!o)return;let c=o.clientWidth,l=e.map((e,t)=>i.current[t]?.offsetWidth??0),u=l.reduce((e,t)=>e+t,0)+n*Math.max(0,e.length-1),d=(t,r)=>{let i=0,a=0;for(let o=0;o<e.length;o++){if(o===r)continue;let e=i+(a>0?n:0)+l[o];if(e>t)break;i=e,a+=1}return a},f;if(u<=c)f={count:e.length,promote:!1};else{let r=a.current?.offsetWidth??0,i=Math.max(1,d(c-r-n,-1)),o=e.findIndex(t);f=o<0||o<i?{count:i,promote:!1}:{count:d(c-r-l[o]-n*2,o),promote:!0}}s(e=>e.count===f.count&&e.promote===f.promote?e:f)},l=C(c);l.current=c,x(()=>{l.current()}),_(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>l.current());return t.observe(e),()=>t.disconnect()},[]);let u=e.findIndex(t),d,f;if(o.promote&&u>=0){let t=e.filter((e,t)=>t!==u);d=[...t.slice(0,o.count),e[u]],f=t.slice(o.count)}else d=e.slice(0,o.count),f=e.slice(o.count);return{containerRef:r,setItemRef:e=>t=>{i.current[e]=t},setMoreRef:e=>{a.current=e},visible:d,overflow:f,activeInOverflow:f.some(t)}}function jE({label:e,triggerClassName:r,icon:i,children:a}){let[o,s]=w(!1),c=C(null),l=C(!1),u=()=>{c.current&&=(clearTimeout(c.current),null)},d=()=>{u(),l.current=!0,s(!0)},f=()=>{u(),c.current=setTimeout(()=>s(!1),150)};return _(()=>()=>clearTimeout(c.current??void 0),[]),n(Hx,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(Wx,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(Be,{className:`ms-1 size-4`})]})}),t(Gx,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function ME({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=kE[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=AE(e,e=>e.name===r),h=s(`agent.moreTabs`);return n(`div`,{ref:l,className:B(`relative`,o),children:[n(`div`,{"aria-hidden":!0,className:`pointer-events-none invisible absolute start-0 top-0 flex w-max gap-1`,children:[e.map((e,n)=>t(`button`,{type:`button`,tabIndex:-1,ref:u(n),className:B(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:d,className:B(c.base,c.inactive),children:[h,t(Be,{className:c.icon})]})]}),n(`div`,{className:B(`flex gap-1 overflow-hidden`,a===`tabs`&&`-mb-px border-b`),children:[f.map(e=>{let n=e.name===r;return t(`button`,{type:`button`,"aria-current":n?`page`:void 0,disabled:e.disabled,onClick:()=>i(e.name),className:B(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),p.length>0&&t(jE,{label:h,triggerClassName:B(c.base,m?c.active:c.inactive),icon:t(Be,{className:c.icon}),children:p.map(e=>t(qx,{disabled:e.disabled,onClick:()=>i(e.name),className:B(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function NE({children:r,action:i,title:a,description:o,footer:s,className:c,collapsible:l,defaultCollapsed:u=!1,size:d=`md`,clickableHeader:f=!1}){let[p,m]=w(u),h=l&&f,g=d===`sm`,_=g||h,v=t(p?Be:We,{className:`size-4 text-muted`}),y=n(e,{children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`div`,{className:`font-semibold ${g?`text-sm`:`text-lg`}`,children:a}),t(sa,{description:o,size:`md`})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,l&&(h?v:t(W,{variant:`ghost`,size:`icon`,onClick:()=>m(!p),children:v}))]})]}),b=g?`px-4 py-2`:`px-4 py-3`,x=g?`px-4 pt-3 pb-3`:`p-4`,S=g?`px-4 pb-3`:`px-4 pb-4`;return n(`div`,{className:`flex flex-col ${_?``:`p-4 gap-2`} rounded-sm border bg-card ${h?`overflow-hidden`:``} ${c??``}`,children:[h?t(`button`,{type:`button`,className:`w-full flex items-center justify-between ${b} hover:bg-muted/50 transition-colors`,onClick:()=>m(!p),children:y}):t(`div`,{className:`flex items-center justify-between ${_?b:``}`,children:y}),!p&&(_?t(`div`,{className:x,children:r}):r),s&&t(`div`,{className:`border-t border-muted flex flex-col-2 text-sm pt-4 ${_?S:``}`,children:s})]})}var PE=Object.defineProperty,FE=(e,t)=>PE(e,`name`,{value:t,configurable:!0}),IE=`Radio`,[LE,RE]=/* @__PURE__ */ Pn(IE),[zE,BE]=LE(IE);function VE(e){let{__scopeRadio:n,checked:r=!1,children:i,disabled:o,form:s,name:c,onCheck:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=a.useState(null),[h,g]=a.useState(null),[_,v]=a.useState(null),y={checked:r,disabled:o,required:u,name:c,form:s,value:d,control:p,setControl:m,userClick:_,onUserClick:v,isFormControl:!p||!!s||!!p.closest(`form`),bubbleInput:h,setBubbleInput:g,onCheck:/* @__PURE__ */ FE(()=>l?.(),`onCheck`)};return/* @__PURE__ */ t(zE,{scope:n,...y,children:JE(f)?f(y):i})}FE(VE,`RadioProvider`);var HE=`RadioTrigger`,UE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,onUserClick:u,isFormControl:d,bubbleInput:f}=BE(HE,e),p=z(i,c);return/* @__PURE__ */ t(U.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":YE(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:p,onClick:V(n,e=>{let t=e.isPropagationStopped();a||(u({hasConsumerStoppedPropagation:t}),l()),f&&d&&(t||e.stopPropagation())})})},`RadioTrigger`)),WE=`RadioIndicator`,GE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=BE(WE,r);return/* @__PURE__ */ t(Fr,{present:i||o.checked,children:/* @__PURE__ */ t(U.span,{"data-state":YE(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),KE=`RadioBubbleInput`,qE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function({__scopeRadio:e,onClick:n,...r},i){let{control:o,checked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m,userClick:h}=BE(KE,e),g=z(i,m),_=ur(o),v=a.useRef(!1),y=a.useRef(s),b=a.useRef(h),x=a.useRef(null);a.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=y.current!==s;y.current=s;let i=h!==null&&h!==b.current;if(b.current=h,i)x.current=r?null:h,r&&n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!h.hasConsumerStoppedPropagation}));else if(r){let t=x.current;x.current=null;let r=s&&t!==null;v.current=!0,n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),v.current=!1}},[p,s,h]);let S=a.useRef(s);return/* @__PURE__ */ t(U.input,{type:`radio`,"aria-hidden":!0,defaultChecked:S.current,required:c,disabled:l,name:u,value:d,form:f,...r,tabIndex:-1,ref:g,onClick:V(n,e=>{v.current&&e.stopPropagation()}),style:{...r.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function JE(e){return typeof e==`function`}FE(JE,`isFunction`);function YE(e){return e?`checked`:`unchecked`}FE(YE,`getState`);var XE=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],ZE=`RadioGroup`,[QE,$E]=/* @__PURE__ */ Pn(ZE,[Hy,RE]),eD=Hy(),tD=RE(),[nD,rD]=QE(ZE),iD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function(e,n){let{__scopeRadioGroup:r,name:i,form:o,defaultValue:s,value:c,required:l=!1,disabled:u=!1,orientation:d,dir:f,loop:p=!0,onValueChange:m,...h}=e,g=eD(r),_=me(f),[v,y]=Yr({prop:c,defaultProp:s??null,onChange:m,caller:ZE}),[b,x]=a.useState(null),S=z(n,x),C=a.useRef(v);return a.useEffect(()=>{let e=o?b?.ownerDocument.getElementById(o):b?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ FE(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),/* @__PURE__ */ t(nD,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:/* @__PURE__ */ t(qy,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:/* @__PURE__ */ t(U.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),aD=`RadioGroupItemProvider`,oD=`RadioGroupItemTrigger`;function sD(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=rD(aD,n),c=tD(n),l=s.disabled||i;return/* @__PURE__ */ t(VE,{...c,checked:s.value===r,disabled:l,required:s.required,name:s.name,form:s.form,value:r,onCheck:()=>s.onValueChange(r),internal_do_not_use_render:o,children:a})}FE(sD,`RadioGroupItemProvider`);var cD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=eD(r),s=tD(r),{checked:c,disabled:l}=BE(oD,s.__scopeRadio),u=a.useRef(null),d=z(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=/* @__PURE__ */ FE(e=>{XE.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=/* @__PURE__ */ FE(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),/* @__PURE__ */ t(Xy,{asChild:!0,...o,focusable:!l,active:c,children:/* @__PURE__ */ t(UE,{...s,...i,ref:d,onKeyDown:V(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:V(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),lD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return/* @__PURE__ */ t(sD,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(cD,{...c,ref:i,__scopeRadioGroup:a}),r&&/* @__PURE__ */ t(uD,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),uD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=tD(r);return/* @__PURE__ */ t(qE,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),dD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ FE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=tD(r);return/* @__PURE__ */ t(GE,{...a,...i,ref:n})},`RadioGroupIndicator`));function fD({className:e,...n}){return t(lD,{"data-slot":`radio-group-item`,className:B(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:t(dD,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:t(`span`,{className:`bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full`})})})}var pD=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function mD({onSelect:e,selected:r,options:i,adapter:a}){let o=e=>a?a.idOf(e):e.id,s=e=>a?a.labelOf(e):e.label,c=e=>a?a.descriptionOf(e):e.description,l=e=>a?a.selectedClassName(e):`border-primary`;return t(iD,{"data-slot":`radio-group`,value:r?o(r):void 0,onValueChange:t=>{let n=i.find(e=>o(e)===t);n&&e(n)},className:`space-y-4`,children:i.map(e=>{let i=r?o(r)===o(e):!1;return t(lD,{value:o(e),className:B(`relative block w-full cursor-pointer rounded-lg border border-border bg-muted px-6 py-4 shadow-2xs text-start`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`sm:flex sm:justify-between`,i&&l(e)),children:t(`span`,{className:`flex items-center`,children:n(`span`,{className:`flex flex-col text-sm`,children:[t(`span`,{className:`font-medium text-foreground`,children:s(e)}),c(e)&&t(`span`,{className:`text-muted`,children:c(e)})]})})},o(e))})})}function hD({className:e,direction:n=`horizontal`,orientation:r,...i}){let a=r??n;return t(ye.Group,{"data-slot":`resizable-panel-group`,"data-panel-group-direction":a,orientation:a,className:B(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function gD(e){return typeof e==`number`?`${e}%`:e}function _D({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(ye.Panel,{"data-slot":`resizable-panel`,defaultSize:gD(e),minSize:gD(n),maxSize:gD(r),collapsedSize:gD(i),...a})}function vD({withHandle:e,className:n,...r}){return t(ye.Separator,{"data-slot":`resizable-handle`,className:B(`bg-muted focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:start-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),...r,children:e&&t(`div`,{className:`z-10 flex size-4 items-center justify-center rounded-xs font-semibold`,children:t(ut,{className:`size-4 rotate-90`})})})}var yD=Object.defineProperty,bD=(e,t)=>yD(e,`name`,{value:t,configurable:!0}),xD={Horizontal:`horizontal`,Vertical:`vertical`},SD=xD.Horizontal,CD=Object.values(xD),wD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bD(function(e,n){let{decorative:r,orientation:i=SD,...a}=e,o=TD(i)?i:SD,s=o===xD.Vertical?o:void 0,c=r?{role:`none`}:{"aria-orientation":s,role:`separator`};return/* @__PURE__ */ t(U.div,{"data-orientation":o,...c,...a,ref:n})},`Separator`));function TD(e){return CD.includes(e)}bD(TD,`isValidOrientation`);const ED=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(wD,{ref:a,decorative:r,orientation:n,className:B(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));ED.displayName=wD.displayName;var DD=Object.defineProperty,OD=(e,t)=>DD(e,`name`,{value:t,configurable:!0});function kD(e,[t,n]){return Math.min(n,Math.max(t,e))}OD(kD,`clamp`);var AD=Object.defineProperty,$=(e,t)=>AD(e,`name`,{value:t,configurable:!0}),jD={Vertical:`vertical`,Horizontal:`horizontal`},MD={LTR:`ltr`,RTL:`rtl`},ND=[`PageUp`,`PageDown`],PD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],FD={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},ID=`Slider`,[LD,RD,zD]=/* @__PURE__ */ py(ID),[BD,VD]=/* @__PURE__ */ Pn(ID,[zD]),[HD,UD]=BD(ID),WD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=jD.Horizontal,disabled:l=!1,minStepsBetweenThumbs:u=0,preserveThumbOrder:d=!1,defaultValue:f=[i],value:p,onValueChange:m=/* @__PURE__ */ $(()=>{},`onValueChange`),onValueCommit:h=/* @__PURE__ */ $(()=>{},`onValueCommit`),inverted:g=!1,form:_,...v}=e,y=a.useRef(/* @__PURE__ */ new Set),b=a.useRef(0),x=a.useRef(!1),[S,C]=a.useState(null),w=c===jD.Horizontal?qD:JD,[T,E]=a.useState(null),D=z(n,E),[O=[],k]=Yr({prop:p,defaultProp:f,onChange:/* @__PURE__ */ $(e=>{[...y.current][b.current]?.focus({preventScroll:!0,focusVisible:x.current}),x.current=!1,m(e)},`onChange`)}),A=a.useRef(O),j=a.useRef(O);a.useEffect(()=>{let e=_?T?.ownerDocument.getElementById(_):T?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ $(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[T,_,k]);function M(e){F(e,fO(O,e))}$(M,`handleSlideStart`);function N(e){F(e,b.current)}$(N,`handleSlideMove`);function P(){String(O)!==String(A.current)&&h(O)}$(P,`handleSlideEnd`);function F(e,t,{commit:n}={commit:!1}){let r=_O(s),a=kD(vO(Math.round((e-i)/s)*s+i,r),[i,o]),c=u*s;function l(e){let n=d?kD(a,[e[t-1]===void 0?i:e[t-1]+c,e[t+1]===void 0?o:e[t+1]-c]):a,r=lO(e,n,t);return hO(r,c)?{nextValues:r,changedIndex:d?t:r.indexOf(n),hasChanged:String(r)!==String(e)}:null}$(l,`getNextValues`);let f=l(O);f?.hasChanged&&C(f.nextValues),k((e=[])=>{let t=l(e);return t?(b.current=t.changedIndex,t.hasChanged&&n&&h(t.nextValues),t.hasChanged?t.nextValues:e):e})}return $(F,`updateValues`),/* @__PURE__ */ t(HD,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:b,thumbs:y.current,values:O,orientation:c,form:_,userRequestedValues:S,children:/* @__PURE__ */ t(LD.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(LD.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(w,{"aria-disabled":l,"data-disabled":l?``:void 0,...v,ref:D,onPointerDown:V(v.onPointerDown,()=>{l||(A.current=O,x.current=!1)}),min:i,max:o,inverted:g,onSlideStart:l?void 0:M,onSlideMove:l?void 0:N,onSlideEnd:l?void 0:P,onHomeKeyDown:()=>{l||(x.current=!0,F(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(x.current=!0,F(o,O.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){x.current=!0;let n=ND.includes(e.key)||e.shiftKey&&PD.includes(e.key)?10:1,r=b.current,a=O[r];F(yO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[GD,KD]=BD(ID,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),qD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{min:r,max:i,dir:o,inverted:s,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,[p,m]=a.useState(null),h=z(n,m),g=a.useRef(void 0),_=me(o),v=_===MD.LTR,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=gO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),/* @__PURE__ */ t(GD,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:/* @__PURE__ */ t(YD,{dir:_,"data-orientation":`horizontal`,...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=b(e.clientX);c?.(t)},onSlideMove:e=>{let t=b(e.clientX);l?.(t)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:e=>{let t=FD[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),JD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{min:r,max:i,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=e,f=a.useRef(null),p=z(n,f),m=a.useRef(void 0),h=!o;function g(e){let t=m.current||f.current.getBoundingClientRect(),n=gO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),/* @__PURE__ */ t(GD,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:/* @__PURE__ */ t(YD,{"data-orientation":`vertical`,...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=g(e.clientY);s?.(t)},onSlideMove:e=>{let t=g(e.clientY);c?.(t)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:e=>{let t=FD[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),YD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...u}=e,d=UD(ID,r);return/* @__PURE__ */ t(U.span,{...u,ref:n,onKeyDown:V(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(c(e),e.preventDefault()):ND.concat(PD).includes(e.key)&&(l(e),e.preventDefault())}),onPointerDown:V(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):i(e)}),onPointerMove:V(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:V(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},`SliderImpl`)),XD=`SliderTrack`,ZD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=UD(XD,r);return/* @__PURE__ */ t(U.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),QD=`SliderRange`,$D=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,o=UD(QD,r),s=KD(QD,r),c=z(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>uO(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return/* @__PURE__ */ t(U.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...i,ref:c,style:{...e.style,[s.startEdge]:d+`%`,[s.endEdge]:f+`%`}})},`SliderRange`)),[eO,tO]=BD(`SliderThumb`),nO=`SliderThumbProvider`;function rO(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=UD(nO,n),c=RD(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=ur(l),p=!l||!!s.form||!!l.closest(`form`),m=s.values[d],h=r??(s.name?s.name+(s.values.length>1?`[]`:``):void 0),g=m===void 0?0:uO(m,s.min,s.max);a.useEffect(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]);let _={value:m,name:h,form:s.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:g,size:f};return/* @__PURE__ */ t(eO,{scope:n,..._,children:bO(o)?o(_):i})}$(rO,`SliderThumbProvider`);var iO=`SliderThumbTrigger`,aO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=UD(iO,r),o=KD(iO,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=tO(iO,r),f=z(n,d),p=dO(s,a.values.length),m=u?.[o.size],h=m?pO(m,l,o.direction):0;return/* @__PURE__ */ t(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:/* @__PURE__ */ t(LD.ItemSlot,{scope:r,children:/* @__PURE__ */ t(U.span,{role:`slider`,"aria-label":e[`aria-label`]||p,"aria-valuemin":a.min,"aria-valuenow":c,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?``:void 0,tabIndex:a.disabled?void 0:0,...i,ref:f,style:c===void 0?{display:`none`}:e.style,onFocus:V(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),oO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return/* @__PURE__ */ t(rO,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(aO,{...s,ref:i,__scopeSlider:a}),o?/* @__PURE__ */ t(cO,{__scopeSlider:a},r):null]})})},`SliderThumb`)),sO=`SliderBubbleInput`,cO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function({__scopeSlider:e,onInput:n,...r},i){let{index:o,value:s,name:c,form:l}=tO(sO,e),{userRequestedValues:u}=UD(sO,e),d=a.useRef(null),f=z(d,i),p=a.useRef(!1),m=a.useRef(s),h=a.useRef(u),g=a.useRef(u);return a.useEffect(()=>{let e=d.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=m.current,i=r!==s;m.current=s;let a=u!==g.current;if(g.current=u,i&&n){let t=u!==h.current;h.current=u;let i=u?.[o];p.current=!(t&&(a&&i!==r||i===s));let c=new Event(`input`,{bubbles:!0});n.call(e,s),e.dispatchEvent(c),p.current=!1}},[o,s,u]),/* @__PURE__ */ t(U.input,{style:{display:`none`},name:c,form:l,...r,ref:f,defaultValue:s,onInput:V(n,e=>{p.current&&e.stopPropagation()})})},`SliderBubbleInput`));function lO(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(lO,`getNextSortedValues`);function uO(e,t,n){return kD(100/(n-t)*(e-t),[0,100])}$(uO,`convertValueToPercentage`);function dO(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(dO,`getLabel`);function fO(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}$(fO,`getClosestValueIndex`);function pO(e,t,n){let r=e/2;return(r-gO([0,50],[0,r])(t)*n)*n}$(pO,`getThumbInBoundsOffset`);function mO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(mO,`getStepsBetweenValues`);function hO(e,t){if(t>0){let n=mO(e);return Math.min(...n)>=t}return!0}$(hO,`hasMinStepsBetweenValues`);function gO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}$(gO,`linearScale`);function _O(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}$(_O,`getDecimalCount`);function vO(e,t){let n=10**t;return Math.round(e*n)/n}$(vO,`roundValue`);function yO(e,{min:t,step:n,direction:r,multiplier:i}){let a=_O(n),o=(e-t)/n,s=Math.round(o),c=vO(s*n+t,a)===vO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),vO(l*n+t,a)}$(yO,`getNextStepValue`);function bO(e){return typeof e==`function`}$(bO,`isFunction`);const xO=a.forwardRef(({className:e,trackClassName:r,rangeClassName:i,thumbClassName:o,value:s,defaultValue:c,min:l=0,max:u=100,"aria-label":d,...f},p)=>{let m=a.useId(),h=Array.isArray(s)?s.length:Array.isArray(c)?c.length:1,g=a.useMemo(()=>Array.from({length:Math.max(1,h)},(e,t)=>`${m}-thumb-${t}`),[m,h]);return n(WD,{ref:p,"data-slot":`slider`,value:s,defaultValue:c,min:l,max:u,...f,className:B(`relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,e),children:[t(ZD,{"data-slot":`slider-track`,className:B(`relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`,r),children:t($D,{"data-slot":`slider-range`,className:B(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(oO,{"data-slot":`slider-thumb`,"aria-label":d,className:B(`block size-3.5 rounded-full border border-primary bg-background shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,o)},e))]})});xO.displayName=WD.displayName;var SO=Object.defineProperty,CO=(e,t)=>SO(e,`name`,{value:t,configurable:!0}),wO=`Switch`,[TO,EO]=/* @__PURE__ */ Pn(wO),[DO,OO]=TO(wO);function kO(e){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=Yr({prop:r,defaultProp:o??!1,onChange:u,caller:wO}),[g,_]=a.useState(null),[v,y]=a.useState(null),[b,x]=a.useState(null),S={checked:m,setChecked:h,disabled:s,control:g,setControl:_,name:l,form:c,value:f,userClick:b,onUserClick:x,required:d,defaultChecked:o,isFormControl:!g||!!c||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(DO,{scope:n,...S,children:LO(p)?p(S):i})}CO(kO,`SwitchProvider`);var AO=`SwitchTrigger`,jO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ CO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,form:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,onUserClick:m,isFormControl:h,bubbleInput:g}=OO(AO,e),_=z(i,f),v=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ CO(()=>p(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,p]),/* @__PURE__ */ t(U.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":RO(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:_,onClick:V(n,e=>{let t=e.isPropagationStopped();m({requestedChecked:!u,hasConsumerStoppedPropagation:t}),p(e=>!e),g&&h&&(t||e.stopPropagation())})})},`SwitchTrigger`)),MO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ CO(function(r,i){let{__scopeSwitch:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return/* @__PURE__ */ t(kO,{__scopeSwitch:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(jO,{...m,ref:i,__scopeSwitch:a}),r&&/* @__PURE__ */ t(IO,{__scopeSwitch:a})]})})},`Switch`)),NO=`SwitchThumb`,PO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ CO(function(e,n){let{__scopeSwitch:r,...i}=e,a=OO(NO,r);return/* @__PURE__ */ t(U.span,{"data-state":RO(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),FO=`SwitchBubbleInput`,IO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ CO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,userClick:s,checked:c,defaultChecked:l,required:u,disabled:d,name:f,value:p,form:m,bubbleInput:h,setBubbleInput:g}=OO(FO,e),_=z(i,g),v=ur(o),y=a.useRef(!1),b=a.useRef(c),x=a.useRef(s),S=a.useRef(null);a.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=b.current!==c;b.current=c;let i=s!==null&&s!==x.current;if(x.current=s,i)S.current=r?null:s,r&&n.call(e,c),e.dispatchEvent(new Event(`click`,{bubbles:!s.hasConsumerStoppedPropagation}));else if(r){let t=S.current;S.current=null;let r=t?.requestedChecked===c;y.current=!0,n.call(e,c),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),y.current=!1}},[h,c,s]);let C=a.useRef(c);return/* @__PURE__ */ t(U.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:l??C.current,required:u,disabled:d,name:f,value:p,form:m,...r,tabIndex:-1,ref:_,onClick:V(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function LO(e){return typeof e==`function`}CO(LO,`isFunction`);function RO(e){return e?`checked`:`unchecked`}CO(RO,`getState`);const zO={sm:[`h-5 w-8`,`size-3`,`translate-x-4 rtl:-translate-x-4`],md:[`h-6 w-11`,`size-4`,`translate-x-6 rtl:-translate-x-6`],lg:[`h-8 w-16`,`size-6`,`translate-x-9 rtl:-translate-x-9`]};function BO({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=zO[r],f=t(MO,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:B(`data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-full border focus-visible:ring-3 aria-invalid:ring-3 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,l,!o&&e),children:t(PO,{"data-slot":`switch-thumb`,className:B(`bg-white rounded-full pointer-events-none block ring-0 transition-transform`,u,i?d:`translate-x-1 rtl:-translate-x-1`)})});return o?n(`div`,{className:B(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}var VO=Object.defineProperty,HO=(e,t)=>VO(e,`name`,{value:t,configurable:!0}),UO={Automatic:`automatic`,Manual:`manual`},WO=`Tabs`,[GO,KO]=/* @__PURE__ */ Pn(WO,[Hy]),qO=Hy(),[JO,YO]=GO(WO),XO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ HO(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=UO.Automatic,...u}=e,d=me(c),[f,p]=Yr({prop:i,onChange:a,defaultProp:o??``,caller:WO});return/* @__PURE__ */ t(JO,{scope:r,baseId:H(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:/* @__PURE__ */ t(U.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),ZO=`TabsList`,QO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ HO(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=YO(ZO,r),s=qO(r);return/* @__PURE__ */ t(qy,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:/* @__PURE__ */ t(U.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),$O=`TabsTrigger`,ek=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ HO(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=YO($O,r),c=qO(r),l=rk(s.baseId,i),u=ik(s.baseId,i),d=i===s.value;return/* @__PURE__ */ t(Xy,{asChild:!0,...c,focusable:!a,active:d,children:/* @__PURE__ */ t(U.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":u,"data-state":d?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:l,...o,ref:n,onMouseDown:V(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),s.onValueChange(i)):e.preventDefault()}),onKeyDown:V(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:V(e.onFocus,()=>{let e=s.activationMode!==UO.Manual;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),tk=`TabsContent`,nk=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ HO(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=YO(tk,r),u=rk(l.baseId,i),d=ik(l.baseId,i),f=i===l.value,p=a.useRef(f);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),/* @__PURE__ */ t(Fr,{present:o||f,children:({present:r})=>/* @__PURE__ */ t(U.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:r&&s})})},`TabsContent`));function rk(e,t){return`${e}-trigger-${t}`}HO(rk,`makeTriggerId`);function ik(e,t){return`${e}-content-${t}`}HO(ik,`makeContentId`);const ak=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),ok=({orientation:e=`horizontal`,tabs:n,defaultValue:r,current:i,className:o,fullWidth:s,fullHeight:c,children:l,onTabChange:u,responsive:d=!1,variant:f=`tabs`,updateHash:p=!0,canChangeTab:m})=>{let h=a.useMemo(()=>n.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[n]),[g,_]=a.useState(()=>{let e=typeof i==`function`?i():i;if(e)return e;let t=window.location.hash,n=t?t.substring(1):void 0;return n&&h.some(e=>e.name===n)?n:r||h[0]?.name});a.useEffect(()=>{let e=typeof i==`function`?i():i;e&&e!==g&&_(e)},[i,g]),a.useEffect(()=>{if(i)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&h.some(e=>e.name===t)?_(t):!e&&r&&_(r)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[i,h,r]);let v=a.useCallback(e=>{if(e===g||!m||m(e,g)){if(_(e),p&&!i){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}u&&u(e)}},[i,u,p,m,g]),y=a.useCallback(e=>{v(e)},[v]);return t(ak.Provider,{value:{orientation:e,tabs:h,size:s?h.length:0,current:g,setTab:y,responsive:d,variant:f,updateHash:p,canChangeTab:m},children:t(XO,{orientation:e,defaultValue:g||h[0]?.name,value:g,onValueChange:v,className:B(`flex-1 flex flex-col min-h-0 px-2`,c&&`h-full`,o),children:l})})},sk=({className:r,sticky:i,direction:o})=>{let{tabs:s,size:c,current:l,setTab:u,responsive:d,variant:f,updateHash:p,canChangeTab:m,orientation:h}=a.useContext(ak),g=o??h??`horizontal`,_=c!==0,v=a.useCallback(e=>{if(!s||!u||e!==l&&m&&!m(e,l))return;let t=s.find(t=>t.name===e);if(t?.href&&p){let e=window.history.state;window.history.pushState(e,``,t.href)}u(e)},[s,u,p,m,l]);return!s||!u?(console.warn(`TabsBar: No tabs provided or setTab not available`),null):n(e,{children:[d&&t(`div`,{className:`px-2 block lg:hidden`,children:t(oE,{label:`Tab`,className:B(i&&`sticky top-0 bg-background z-10`,r),options:s,optionLabel:e=>typeof e.label==`string`?e.label:String(e.label),value:s.find(e=>e.name===l),onChange:e=>{v(e.name)}})}),t(lk,{size:c,variant:f,className:B(_?`w-full`:``,i&&`sticky top-0 bg-background z-10`,g===`vertical`?`flex-col items-start border-b-0 mb-0`:`flex-row`,d?`hidden lg:flex`:``,r),children:s.map(e=>t(uk,{className:B(g===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:f,onClick:()=>v(e.name),children:e.label},e.name))})]})},ck=({className:n})=>{let{tabs:r}=a.useContext(ak);return r?t(e,{children:r.map(e=>t(dk,{value:e.name,className:n,children:e.content},e.name))}):null},lk=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(ak.Provider,{value:{size:n,variant:r},children:t(QO,{ref:a,className:B(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));lk.displayName=QO.displayName;const uk=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(ak),c=a.useCallback(e=>{if(n){e.preventDefault();let t=window.history.state;window.history.pushState(t,``,n)}i.onClick&&i.onClick(e)},[n,i.onClick]);return t(ek,{ref:o,className:B(r===`tabs`?B(`border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer`,`border-transparent text-muted hover:border-border hover:text-foreground`,`data-[state=active]:border-primary data-[state=active]:text-info`,`disabled:pointer-events-none disabled:opacity-50`):B(`px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors`,`border border-input bg-muted shadow-xs hover:bg-muted ring-inset`,`data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm`,`disabled:pointer-events-none disabled:opacity-50`),e,s?`w-1/${s}`:``),onClick:c,...i})});uk.displayName=ek.displayName;const dk=a.forwardRef(({className:e,...n},r)=>t(nk,{ref:r,className:B(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));dk.displayName=nk.displayName;const fk=A(`text-foreground`,{variants:{size:{xl:`text-base md:text-lg leading-relaxed`,lg:`text-base leading-relaxed`,default:`text-sm leading-normal`,sm:`text-sm leading-normal`,xs:`text-xs leading-normal`},weight:{normal:`font-normal`,medium:`font-medium`,semibold:`font-semibold`}},defaultVariants:{size:`default`,weight:`normal`}}),pk=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:B(fk({size:n,weight:r,className:e})),...i}));pk.displayName=`Text`;function mk({className:e,minLines:n,maxLines:r,value:i,...a}){let o=C(null),s=n!==void 0||r!==void 0,c=h(()=>{let e=o.current;if(!e)return;let t=getComputedStyle(e),i=parseFloat(t.lineHeight)||parseFloat(t.fontSize)*1.5,a=(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0),s=(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0),c=n??1,l=r??1/0,u=c*i+a+s,d=l===1/0?1/0:l*i+a+s;e.style.height=`auto`;let f=Math.min(Math.max(e.scrollHeight,u),d);e.style.height=`${f}px`,e.style.overflowY=d!==1/0&&e.scrollHeight>d?`auto`:`hidden`},[n,r]);return x(()=>{s&&c()}),t(`textarea`,{ref:o,"data-slot":`textarea`,value:i,className:B(`py-2 text-sm`,`flex w-full rounded-md border border-input bg-background ring-offset-background`,`placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,s&&`resize-none`,e),...a})}const hk=d({theme:`system`,setTheme:()=>null});function gk({children:e,defaultTheme:n=`system`,storageKey:r=`vite-ui-theme`,...i}){let[a,o]=w(()=>localStorage.getItem(r)||n);_(()=>{let e=window.document.documentElement;if(a!==`system`){e.classList.remove(`light`,`dark`),e.classList.add(a);return}let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{e.classList.remove(`light`,`dark`),e.classList.add(t.matches?`dark`:`light`)};return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[a]),_(()=>{let e=e=>{if(e.storageArea!==localStorage||e.key!==r&&e.key!==null)return;let t=e.newValue;o(t===`dark`||t===`light`||t===`system`?t:n)};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[n,r]);let s=h((e,t)=>{t?.persist!==!1&&localStorage.setItem(r,e),o(e)},[r]),c=S(()=>({theme:a,setTheme:s}),[s,a]);return t(hk.Provider,{...i,value:c,children:e})}const _k=()=>{let e=g(hk);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function vk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(W,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function yk({label:e,className:r}={}){let{setTheme:i,theme:a}=_k(),{t:o}=k(),s=e===!1?!1:e??o(`theme.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center`:`flex items-center gap-1`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),n(`div`,{className:`flex gap-2`,children:[t(vk,{current:a,option:`system`,setTheme:i,icon:t(Qe,{}),alt:o(`theme.system`)}),t(vk,{current:a,option:`light`,setTheme:i,icon:t(bt,{}),alt:o(`theme.light`)}),t(vk,{current:a,option:`dark`,setTheme:i,icon:t(ft,{}),alt:o(`theme.dark`)})]})]})}function bk(e,n){return{label:String(e),check:t(n?Re:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function xk({value:e,options:i,onChange:a,className:o,optionLayout:s,by:c,noCheck:l,filterBy:u}){let{t:d}=k(),[f,p]=w(e),[m,h]=w(``),g=e=>{p(e),a(e)},_=S(()=>typeof c==`string`?(e,t)=>e[c]===t[c]:c||((e,t)=>e===t),[c]);return n(`div`,{className:r(``,o),children:[u&&t(WT,{type:`text`,placeholder:d(`form.filter`),value:m,onChange:e=>h(e)}),i.map((e,n)=>{if(u&&!u(m)(e))return null;let r=f?_(f,e):!1,i;return s?(i=s(e,r),i=Object.assign(bk(e,r),i)):i=bk(e,r),t(Sk,{option:e,onSelect:g,layout:i,noCheck:l,isSelected:r},`option-${n}`)})]})}function Sk({option:e,onSelect:i,layout:a,noCheck:o,isSelected:s}){return n(W,{variant:`unstyled`,size:`none`,className:r(`group flex! w-full items-center cursor-pointer gap-x-2 hover:bg-muted`,a.reverse&&`flex-row-reverse`,a.className,s&&`bg-muted`),onClick:()=>i(e),children:[o?null:t(`div`,{className:``,children:a.check}),t(`div`,{className:`flex-1`,children:a.label})]})}function Ck({isOpen:e,title:r,onClose:i,children:a,panelWidth:o=768,backdrop:s=!1,side:c=`right`,resizable:l=!0,className:u,contentClassName:d}){let[f,p]=w(o),m=e=>{e.preventDefault();let t=!0,n=e.pageX,r=f,i=e=>{if(t){let t=n-e.pageX,i=Math.max(r+t,480);p(i)}},a=()=>{t=!1,document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)},h=c===`left`,g=h?`left-0`:`right-0`,_=h?`pr-10 sm:pr-16`:`pl-10 sm:pl-16`,v=h?`border-r`:`border-l`,y=h?`-right-1`:`-left-1`,b=h?`-100%`:`100%`;return t(vg,{children:t(xm,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(pg.div,{className:`fixed inset-0 bg-black/70`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:i}),t(`div`,{className:`fixed inset-y-0 ${g} overflow-hidden`,children:t(`div`,{className:`absolute inset-0 overflow-hidden`,children:t(`div`,{className:`pointer-events-none fixed inset-y-0 ${g} flex max-w-full ${_}`,children:t(pg.div,{className:`pointer-events-auto ${v}`,style:{width:`${f}px`},initial:{x:b},animate:{x:0},exit:{x:b},transition:{type:`spring`,stiffness:300,damping:30},children:n(`div`,{className:`relative flex h-full`,children:[l&&t(`div`,{"aria-label":`Resize panel`,className:`absolute ${y} top-0 bottom-0 w-3 z-25 cursor-ew-resize hover:bg-primary transition-colors flex items-center justify-center`,onMouseDown:m,children:t(ut,{className:`rotate-90 font-semibold`,strokeWidth:4})}),n(`div`,{className:`flex-1 min-w-0 flex flex-col bg-background shadow-xl ${u}`,children:[r&&t(`div`,{className:`sticky top-0 z-10 bg-background px-2 sm:px-4 py-2 border-b`,children:n(`div`,{className:`flex items-start justify-between`,children:[t(`h2`,{className:`w-full text-base font-semibold leading-6`,children:t(`div`,{className:`text-2xl`,children:r??``})}),t(`div`,{className:`ms-3 flex h-7 items-center`,children:t(wk,{onClose:i})})]})}),t(`div`,{className:d??`flex-1 overflow-auto px-2 sm:px-4 py-4`,children:t(`div`,{className:`w-full h-full flex-1 flex flex-col`,children:a})})]})]})})})})})]})})})}function wk({onClose:e}){return t(W,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(wt,{className:`size-6`,"aria-hidden":`true`})})}function Tk(e){switch(e){case`xs`:return`size-2`;case`sm`:return`size-3`;case`md`:return`size-4`;case`lg`:return`size-5`;case`xl`:return`size-7`;case`2xl`:return`size-10`;default:throw Error(`Unexpected size: ${e}`)}}const Ek=d(void 0),Dk=Ek.Provider;function Ok({size:e,className:i}){let a=Tk(e||`md`),o=g(Ek);return o?t(o,{className:r(a,i)}):n(`svg`,{className:r(`animate-[spin_0.8s_linear_infinite] text-info`,a,i),xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,role:`img`,"aria-label":`Loading`,children:[t(`title`,{children:`Loading`}),t(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),t(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function kk({options:i,value:a,onChange:o,onOptionsChange:s,placeholder:c,className:l,disabled:u,layout:d=`horizontal`,creatable:f=!1,createText:p=`Create "%value%"`,maxDropdownHeight:m=200}){let h=g(AT),[v,y]=w(``),[b,x]=w(0),[S,T]=w(0),[E,D]=w(null),O=C(null),k=C(null),A=C(null),j=C(null),M=h?.open??!1,N=h?.setOpen??(()=>{});_(()=>{let e=k.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;T(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let P=i.filter(e=>!a.includes(e)&&e.toLowerCase().includes(v.toLowerCase())),F=f&&v&&!a.includes(v)&&!i.includes(v),ee=P.length+ +!!F;_(()=>{v!==``&&D(null)},[v]),_(()=>{M&&b>=0&&j.current&&A.current&&j.current.scrollIntoView({block:`nearest`,behavior:`smooth`})},[b,M]),_(()=>{M?O.current?.focus():y(``)},[M]),_(()=>{if(!M)return;let e=e=>e instanceof Node&&(k.current?.contains(e)===!0||A.current?.contains(e)===!0),t=t=>{e(t.target)||N(!1)},n=t=>{e(t.target)||N(!1)},r=()=>{N(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,n,!0),window.addEventListener(`blur`,r),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,n,!0),window.removeEventListener(`blur`,r),document.removeEventListener(`visibilitychange`,r)}},[M,N]);let I=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},te=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},ne=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(NT,{asChild:!0,children:n(`div`,{ref:k,className:r(`min-h-[40px] w-full rounded-md border border-input bg-background px-3 py-2`,`flex items-center gap-1`,d===`horizontal`?`flex-wrap`:`flex-col items-stretch`,`cursor-text`,`ring-offset-background`,u&&`opacity-50 cursor-not-allowed`,M?`ring-1 ring-inset ring-ring`:``),onClick:()=>{u||O.current?.focus()},children:[d===`vertical`&&a.length>0&&t(`div`,{className:`flex flex-col gap-1 w-full`,children:a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center justify-between gap-2 px-2 py-1 text-sm bg-info text-info ring-1 ring-info/30 rounded-md w-full transition-all`,E===i&&`ring-2 ring-destructive shadow-md`),children:[t(`span`,{className:`truncate`,children:e}),t(`button`,{type:`button`,onClick:t=>ne(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors flex-shrink-0`,children:t(wt,{className:`h-3 w-3`})})]},e))}),d===`horizontal`&&a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center gap-1 px-2 py-1 text-sm bg-info text-info ring-1 ring-info/30 rounded-md transition-all`,E===i&&`ring-2 ring-destructive shadow-md`),children:[e,t(`button`,{type:`button`,onClick:t=>ne(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(wt,{className:`h-3 w-3`})})]},e)),t(`input`,{ref:O,type:`text`,value:v,onChange:e=>{y(e.target.value),x(0)},onKeyDown:e=>{if(e.key===`Enter`&&M&&ee>0)e.preventDefault(),e.stopPropagation(),b===P.length&&F?te(v):b<P.length&&I(P[b]);else if(e.key===`ArrowDown`)e.preventDefault(),e.stopPropagation(),M?x(e=>e<ee-1?e+1:e):N(!0);else if(e.key===`ArrowUp`)e.preventDefault(),e.stopPropagation(),M?x(e=>e>0?e-1:0):N(!0);else if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),N(!1);else if(e.key===`Backspace`&&v===``&&a.length>0){e.stopPropagation();let t=a.length-1;E===t?(o(a.slice(0,-1)),D(null)):D(t)}else!M&&e.key.length===1&&N(!0)},onClick:e=>{e.stopPropagation(),u||N(!0)},onFocus:()=>{u||N(!0)},disabled:u,placeholder:a.length===0?c:``,className:r(`flex-1 min-w-[120px] bg-transparent text-sm`,`placeholder:text-muted`,`border-none outline-none focus:outline-none focus:ring-0 p-0 m-0`,d===`vertical`&&`w-full`)})]})}),t(FT,{style:{width:`${S}px`},className:`p-0 bg-popover border border-border shadow-lg`,align:`start`,side:`bottom`,onOpenAutoFocus:e=>{e.preventDefault()},children:t(`div`,{ref:A,className:`overflow-y-auto`,style:{maxHeight:`${m}px`},children:P.length===0&&!F?t(`div`,{className:`px-3 py-2 text-sm text-muted`,children:v?`No options found`:`No more options available`}):n(e,{children:[P.length>0&&t(`ul`,{className:`py-1`,children:P.map((e,n)=>t(`li`,{ref:e=>{n===b&&(j.current=e)},role:`option`,"aria-selected":n===b,tabIndex:0,onClick:()=>I(e),onKeyDown:da(()=>I(e)),onMouseEnter:()=>x(n),className:r(`px-3 py-2 text-sm cursor-pointer transition-colors`,n===b?`bg-info text-foreground`:`hover:bg-muted/50`),children:e},e))}),F&&n(e,{children:[P.length>0&&t(`div`,{className:`border-t border-border`}),t(W,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>te(v),onMouseEnter:()=>x(P.length),className:r(`!flex w-full justify-start px-3 py-2 text-sm cursor-pointer transition-colors text-info`,b===P.length?`bg-info`:`hover:bg-muted/50`),children:p.replace(`%value%`,v)})]})]})})})]})}function Ak(e){return t(jT,{click:!0,children:t(kk,{...e})})}function jk({className:e,children:n,...i}){return t(`table`,{className:r(`
|
|
335
335
|
divide-y divide-border
|
|
336
336
|
[&>tbody]:divide-y [&>tbody]:divide-border
|
|
337
337
|
[&_th]:text-start [&_th]:px-3 [&_th]:py-3.5 [&_th]:text-sm [&_th]:font-normal [&_th]:text-muted
|
|
338
338
|
[&_td]:px-3 [&_td]:py-4 [&_td]:text-sm
|
|
339
|
-
`,e),...i,children:n})}function rA({children:e}){return t(`thead`,{className:`sticky top-0 bg-background z-10 after:absolute after:bottom-0 after:start-0 after:w-full after:h-px after:bg-muted/20`,children:e})}function iA({columns:e}){return t(`tr`,{className:`hover:bg-muted`,children:Array(e).fill(0).map((e,n)=>t(`td`,{children:t(`div`,{className:`animate-pulse rounded-xs h-5 bg-muted`})},`skeleton-cell-${n}`))})}function aA({isLoading:e=!1,columns:n,rows:r=3,children:i}){let a=Array.from({length:r},(e,t)=>`skeleton-row-${t}`);return t(`tbody`,{children:e?a.map(e=>t(iA,{columns:n},e)):i})}function oA({className:e,children:n,...i}){return t(`tr`,{className:r(`hover:bg-muted hover:cursor-pointer`,e),...i,children:n})}function sA({scope:e=`col`,children:n,...r}){return t(`th`,{scope:e,...r,children:n})}function cA({sortDirection:e=`none`,onSort:r,sortIndicator:i,disabled:a=!1,children:o,className:s,scope:c=`col`,...l}){return t(`th`,{scope:c,"aria-sort":e,className:s,...l,children:a?n(`span`,{className:`inline-flex items-center gap-1`,children:[o,i?.(e)]}):n(`button`,{type:`button`,onClick:r,className:`inline-flex items-center gap-1 bg-transparent border-0 p-0 m-0 text-inherit font-inherit cursor-pointer hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded-sm`,children:[o,i?.(e)]})})}var lA=class{_value;watchers=[];name;constructor(e,t){this._value=e,this.name=t}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function uA(e){let t=o.createContext(void 0);return e.Context=t,t.Provider}var dA=class{consume=void 0;_current;constructor(e){this._current=e}set current(e){e!==this._current&&(this._current=e,this.consume?.(e))}get current(){return this._current}withConsumer(e){return this.consume=e,e?.(this.current),this}};function fA(e){let t=e.Context;if(!t)throw Error(`Context not defined for ${e.name}`);return g(t)}function pA(e){let[t,n]=w(e.value);return _(()=>e.watch(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function mA(e,t){return _(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function hA(e,t){_(()=>e.watch(t),[e,t])}function gA(e){let[t,n]=w(e.current);return _(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function _A(e,t){_(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function vA(e,t){_(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}var yA=class{compute;_value;watchers=[];unsubscribers=[];name;constructor(e,t,n){this.compute=e,this.name=n,this.recalculate();for(let e of t)this.unsubscribers.push(e.watch(()=>this.recalculate()))}recalculate(){let e=this.compute();if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}get value(){return this._value}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}dispose(){for(let e of this.unsubscribers)e();this.watchers=[]}},bA=class{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}addWatcher(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function xA(e){let[t,n]=w(e.value);return _(()=>e.addWatcher(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function SA(e,t){let n=C(null);return _(()=>{let r=r=>{n.current&&!n.current.contains(r.target)&&(t?.(r)||e(r))},i=window.setTimeout(()=>{document.addEventListener(`click`,r)},0);return()=>{window.clearTimeout(i),document.removeEventListener(`click`,r)}},[e,t]),n}function CA(){let[e,t]=w(null);return[e,async e=>{if(!navigator?.clipboard)return console.warn(`Clipboard not supported`),!1;try{return await navigator.clipboard.writeText(e),t(e),!0}catch(e){return console.warn(`Copy failed`,e),t(null),!1}}]}function wA(e){_(()=>{let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=t=>e(t.matches);return t.addEventListener(`change`,n),e(t.matches),()=>t.removeEventListener(`change`,n)},[e])}function TA(e,t){let[n,r]=w(e);return _(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function EA(e,t,n){let r=[],i=new EventSource(e);return i.addEventListener(`message`,e=>{let n=JSON.parse(e.data);n&&(r.push(n),t(r.join(``)))}),i.addEventListener(`close`,e=>{i.close(),n(JSON.parse(e.data))}),()=>{i.close()}}function DA(e,t,n){let r=C(t),i=C(n);r.current=t,i.current=n,_(()=>{let t,n=!1,a=e=>r.current(e),o=e=>i.current(e);return typeof e==`function`?e().then(e=>{n||(t=EA(e,a,o))}):t=EA(e,a,o),()=>{n=!0,t?.()}},[e])}function OA(e){return e instanceof Error?e:Error(String(e))}function kA(e,t){Array.isArray(t)&&(t={deps:t});let n=t||{},[r,i]=w(void 0),[a,o]=w(!1),[s,c]=w(n.defaultValue),l=C(e);l.current=e;let u=C(n);u.current=n;let d=h(()=>{let e=u.current;return e.start?.(),o(!0),i(void 0),l.current().then(t=>{i(void 0),c(t),e.onSuccess?.(t)}).catch(t=>{let n=OA(t);i(n),e.onError?.(n)}).finally(()=>{o(!1),e.end?.()})},[]);return _(()=>{let e=u.current;(!e.condition||e.condition())&&d()},[d,...n.deps??[]]),{data:s,isLoading:a,error:r,setData:c,refetch:d}}function AA(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),kA(e,t)}function jA(e=!1){let[t,n]=w(e);return{isOn:t,isOff:!t,set:e=>n(e),on:()=>n(!0),off:()=>n(!1),toggle:()=>n(!t)}}function MA(e,t,n={}){let r=C(t);r.current=t;let i=C(n);i.current=n;let a=n.threshold||1;_(()=>{let t=e.current,n=new IntersectionObserver(e=>{let t=e[0].isIntersecting;i.current.leave?t||r.current(e[0]):t&&r.current(e[0])},{threshold:a});return t&&n.observe(t),()=>{t&&n.unobserve(t)}},[e,a,...n.deps??[]])}function NA(){let e=C(!0);return _(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const PA=typeof window<`u`?x:_;function FA(e,t=[]){let n=e.pageSize||50,[r,i]=w(null),[a,o]=w(e.payload),[s,c]=w(null),[l,u]=w([]),[d,f]=w(null),[p,m]=w(!1),[h,g]=w(0),v=C(0),y=C(e.search);y.current=e.search;let b=e=>{i(null),u([]),f(null),o(e),g(e=>e+1)},x=()=>{d!==null&&i(d)};return _(()=>{v.current+=1;let e=v.current;m(!0),y.current(a,r,n).then(t=>{e===v.current&&(u(r===null?t.result:e=>[...e,...t.result]),f(t.nextPage),c(null))}).catch(t=>{e===v.current&&c(t)}).finally(()=>{e===v.current&&m(!1)})},[...t,a,h,r,n]),MA(e.nextPageTrigger,()=>{!p&&d&&x()},{threshold:.1,deps:[d,p]}),{search:b,refresh:()=>b(a),searchMore:x,result:l,page:r,hasMore:d!==null,error:s,isSearching:p}}function IA(e,t=[]){return FA({...e,async search(t,n,r){let i=n??0,a=i*r,o=await e.search(t,a,r);return{result:o,nextPage:o.length===0?null:i+1}}},t)}var LA=class{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}};function RA(e){return new LA(w(e))}function zA(...e){return j(i(e))}function BA(e){return typeof e==`object`&&!!e&&`message`in e}function VA(e,t=`An error occurred`){return e instanceof Error?e.message:typeof e==`string`?e:BA(e)&&typeof e.message==`string`?e.message:t}function HA(e,t){let n=e.selectionStart,r=e.selectionEnd,i=e.value,a=`${i.slice(0,n)}\n${i.slice(r)}`;t?.(a),requestAnimationFrame(()=>{e.selectionStart=e.selectionEnd=n+1})}export{CS as AnimateChangeInHeight,ye as Avatar,fa as Badge,rg as Breadcrumbs,W as Button,fg as Card,gg as CardContent,hg as CardDescription,_g as CardFooter,pg as CardHeader,mg as CardTitle,xe as Center,Ig as Checkbox,Se as CloudIcon,e_ as Collapsible,n_ as CollapsibleContent,t_ as CollapsibleTrigger,Ht as ComboBox,Wv as Command,Gv as CommandDialog,Jv as CommandEmpty,Yv as CommandGroup,Kv as CommandInput,Zv as CommandItem,qv as CommandList,Xv as CommandSeparator,Qv as CommandShortcut,yA as ComputedProperty,VE as ConfirmModal,Yi as CopyButton,Ft as DOMPopup,oE as DateCombobox,BE as DefaultBox,JE as DeleteModal,Iv as Dialog,zv as DialogClose,Vv as DialogContent,Hv as DialogDescription,Bv as DialogOverlay,Rv as DialogPortal,Uv as DialogTitle,Lv as DialogTrigger,Zt as Divider,ha as DotBadge,ta as DropZone,bS as Dropdown,iS as DropdownMenu,uS as DropdownMenuCheckboxItem,sS as DropdownMenuContent,cS as DropdownMenuGroup,lS as DropdownMenuItem,pS as DropdownMenuLabel,aS as DropdownMenuPortal,dS as DropdownMenuRadioGroup,fS as DropdownMenuRadioItem,mS as DropdownMenuSeparator,hS as DropdownMenuShortcut,gS as DropdownMenuSub,vS as DropdownMenuSubContent,_S as DropdownMenuSubTrigger,oS as DropdownMenuTrigger,Xi as EmptyCollection,IE as ErrorBox,ea as FileUploadInput,SE as FilterBar,xE as FilterBtn,CE as FilterClear,TE as FilterOperator,bE as FilterProvider,la as FormItem,EE as Heading,LE as InfoBox,oa as InfoTip,dE as Input,ga as InputList,PE as Label,AE as LanguageSwitcher,_a as Link,xS as MenuGroup,SS as MenuItem,va as MenuList,FE as MessageBox,Mv as Modal,Pv as ModalBody,jv as ModalContextProvider,Fv as ModalFooter,Nv as ModalTitle,Uk as ModeOption,Wk as ModeToggle,Sa as NumberInput,YE as OVERFLOW_TAB_GAP_PX,Rt as OptionAdapter,QE as OverflowMoreMenu,$E as OverflowTabsBar,Qh as Overlay,eD as Panel,QT as Popover,tE as PopoverAnchor,rE as PopoverClose,nE as PopoverContent,ZT as PopoverContext,eE as PopoverTrigger,It as Popup,Mt as PopupController,ng as Portal,Ii as PortalContainerContext,Ri as PortalContainerProvider,lA as Property,FD as RadioGroup,PD as RadioGroupAdapter,ND as RadioGroupItem,zD as ResizableHandle,RD as ResizablePanel,ID as ResizablePanelGroup,iA as RowSkeleton,DE as SelectBox,Kk as SelectList,cE as SelectionCombobox,qD as Separator,bA as SharedState,LA as SharedValue,Jk as SidePanel,Xt as SimpleCombobox,UO as Slider,dA as Slot,cA as SortableTableHeaderCell,$k as Spinner,Qk as SpinnerIconProvider,lE as StringListCombobox,zt as StringOptionAdapter,Bt as StringOptionAdapterWithCreate,ba as Styles,zE as SuccessBox,be as SvgAvatar,ck as Switch,aA as TBody,rA as THead,oA as TR,nA as Table,sA as TableHeaderCell,jk as Tabs,Mk as TabsBar,Ik as TabsContent,Pk as TabsList,Nk as TabsPanel,Fk as TabsTrigger,tA as TagsInput,Rk as Text,fE as TextCombobox,zk as Textarea,Vk as ThemeProvider,Bk as ThemeProviderContext,UE as ToastContext,qE as ToastProvider,Vi as Tooltip,Ui as TooltipContent,Bi as TooltipProvider,Hi as TooltipTrigger,Wi as VTooltip,RE as WarningBox,Ji as buttonVariants,zA as cn,Dt as computePosition,uA as createCompositeStateProvider,VA as errorMessage,Vt as getDefaultComboBoxLayout,HA as insertNewlineAtCursor,ua as onActivateKey,SA as useClickOutside,Kt as useComboboxCtrl,fA as useCompositeState,CA as useCopyToClipboard,wA as useDarkMode,TA as useDebounce,IA as useDefaultScrollableSearch,vA as useDefineSlot,aa as useDropZone,DA as useEventSource,kA as useFetch,AA as useFetchOnce,jA as useFlag,pA as useGetCompositeStateProperty,MA as useIntersectionObserver,NA as useIsFirstRendering,Av as useIsInModal,ZE as useOverflowTabs,iE as usePopoverContext,Pt as usePopupController,zi as usePortalContainer,PA as useSafeLayoutEffect,FA as useScrollableSearch,mA as useSetCompositeStateProperty,RA as useSharedValue,gA as useSlot,Hk as useTheme,HE as useToast,hA as useWatchCompositeStateProperty,xA as useWatchSharedState,_A as useWatchSlot};
|
|
339
|
+
`,e),...i,children:n})}function Mk({children:e}){return t(`thead`,{className:`sticky top-0 bg-background z-10 after:absolute after:bottom-0 after:start-0 after:w-full after:h-px after:bg-muted/20`,children:e})}function Nk({columns:e}){return t(`tr`,{className:`hover:bg-muted`,children:Array(e).fill(0).map((e,n)=>t(`td`,{children:t(`div`,{className:`animate-pulse rounded-xs h-5 bg-muted`})},`skeleton-cell-${n}`))})}function Pk({isLoading:e=!1,columns:n,rows:r=3,children:i}){let a=Array.from({length:r},(e,t)=>`skeleton-row-${t}`);return t(`tbody`,{children:e?a.map(e=>t(Nk,{columns:n},e)):i})}function Fk({className:e,children:n,...i}){return t(`tr`,{className:r(`hover:bg-muted hover:cursor-pointer`,e),...i,children:n})}function Ik({scope:e=`col`,children:n,...r}){return t(`th`,{scope:e,...r,children:n})}function Lk({sortDirection:e=`none`,onSort:r,sortIndicator:i,disabled:a=!1,children:o,className:s,scope:c=`col`,...l}){return t(`th`,{scope:c,"aria-sort":e,className:s,...l,children:a?n(`span`,{className:`inline-flex items-center gap-1`,children:[o,i?.(e)]}):n(`button`,{type:`button`,onClick:r,className:`inline-flex items-center gap-1 bg-transparent border-0 p-0 m-0 text-inherit font-inherit cursor-pointer hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded-sm`,children:[o,i?.(e)]})})}var Rk=class{_value;watchers=[];name;constructor(e,t){this._value=e,this.name=t}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function zk(e){let t=o.createContext(void 0);return e.Context=t,t.Provider}var Bk=class{consume=void 0;_current;constructor(e){this._current=e}set current(e){e!==this._current&&(this._current=e,this.consume?.(e))}get current(){return this._current}withConsumer(e){return this.consume=e,e?.(this.current),this}};function Vk(e){let t=e.Context;if(!t)throw Error(`Context not defined for ${e.name}`);return g(t)}function Hk(e){let[t,n]=w(e.value);return _(()=>e.watch(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Uk(e,t){return _(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function Wk(e,t){_(()=>e.watch(t),[e,t])}function Gk(e){let[t,n]=w(e.current);return _(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function Kk(e,t){_(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function qk(e,t){_(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}var Jk=class{compute;_value;watchers=[];unsubscribers=[];name;constructor(e,t,n){this.compute=e,this.name=n,this.recalculate();for(let e of t)this.unsubscribers.push(e.watch(()=>this.recalculate()))}recalculate(){let e=this.compute();if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}get value(){return this._value}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}dispose(){for(let e of this.unsubscribers)e();this.watchers=[]}},Yk=class{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(let t of this.watchers)t(e)}}addWatcher(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}};function Xk(e){let[t,n]=w(e.value);return _(()=>e.addWatcher(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Zk(e,t){let n=C(null);return _(()=>{let r=r=>{n.current&&!n.current.contains(r.target)&&(t?.(r)||e(r))},i=window.setTimeout(()=>{document.addEventListener(`click`,r)},0);return()=>{window.clearTimeout(i),document.removeEventListener(`click`,r)}},[e,t]),n}function Qk(){let[e,t]=w(null);return[e,async e=>{if(!navigator?.clipboard)return console.warn(`Clipboard not supported`),!1;try{return await navigator.clipboard.writeText(e),t(e),!0}catch(e){return console.warn(`Copy failed`,e),t(null),!1}}]}function $k(e){_(()=>{let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=t=>e(t.matches);return t.addEventListener(`change`,n),e(t.matches),()=>t.removeEventListener(`change`,n)},[e])}function eA(e,t){let[n,r]=w(e);return _(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function tA(e,t,n){let r=[],i=new EventSource(e);return i.addEventListener(`message`,e=>{let n=JSON.parse(e.data);n&&(r.push(n),t(r.join(``)))}),i.addEventListener(`close`,e=>{i.close(),n(JSON.parse(e.data))}),()=>{i.close()}}function nA(e,t,n){let r=C(t),i=C(n);r.current=t,i.current=n,_(()=>{let t,n=!1,a=e=>r.current(e),o=e=>i.current(e);return typeof e==`function`?e().then(e=>{n||(t=tA(e,a,o))}):t=tA(e,a,o),()=>{n=!0,t?.()}},[e])}function rA(e){return e instanceof Error?e:Error(String(e))}function iA(e,t){Array.isArray(t)&&(t={deps:t});let n=t||{},[r,i]=w(void 0),[a,o]=w(!1),[s,c]=w(n.defaultValue),l=C(e);l.current=e;let u=C(n);u.current=n;let d=h(()=>{let e=u.current;return e.start?.(),o(!0),i(void 0),l.current().then(t=>{i(void 0),c(t),e.onSuccess?.(t)}).catch(t=>{let n=rA(t);i(n),e.onError?.(n)}).finally(()=>{o(!1),e.end?.()})},[]);return _(()=>{let e=u.current;(!e.condition||e.condition())&&d()},[d,...n.deps??[]]),{data:s,isLoading:a,error:r,setData:c,refetch:d}}function aA(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),iA(e,t)}function oA(e=!1){let[t,n]=w(e);return{isOn:t,isOff:!t,set:e=>n(e),on:()=>n(!0),off:()=>n(!1),toggle:()=>n(!t)}}function sA(e,t,n={}){let r=C(t);r.current=t;let i=C(n);i.current=n;let a=n.threshold||1;_(()=>{let t=e.current,n=new IntersectionObserver(e=>{let t=e[0].isIntersecting;i.current.leave?t||r.current(e[0]):t&&r.current(e[0])},{threshold:a});return t&&n.observe(t),()=>{t&&n.unobserve(t)}},[e,a,...n.deps??[]])}function cA(){let e=C(!0);return _(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const lA=typeof window<`u`?x:_;function uA(e,t=[]){let n=e.pageSize||50,[r,i]=w(null),[a,o]=w(e.payload),[s,c]=w(null),[l,u]=w([]),[d,f]=w(null),[p,m]=w(!1),[h,g]=w(0),v=C(0),y=C(e.search);y.current=e.search;let b=e=>{i(null),u([]),f(null),o(e),g(e=>e+1)},x=()=>{d!==null&&i(d)};return _(()=>{v.current+=1;let e=v.current;m(!0),y.current(a,r,n).then(t=>{e===v.current&&(u(r===null?t.result:e=>[...e,...t.result]),f(t.nextPage),c(null))}).catch(t=>{e===v.current&&c(t)}).finally(()=>{e===v.current&&m(!1)})},[...t,a,h,r,n]),sA(e.nextPageTrigger,()=>{!p&&d&&x()},{threshold:.1,deps:[d,p]}),{search:b,refresh:()=>b(a),searchMore:x,result:l,page:r,hasMore:d!==null,error:s,isSearching:p}}function dA(e,t=[]){return uA({...e,async search(t,n,r){let i=n??0,a=i*r,o=await e.search(t,a,r);return{result:o,nextPage:o.length===0?null:i+1}}},t)}var fA=class{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}};function pA(e){return new fA(w(e))}function mA(...e){return j(i(e))}function hA(e){return typeof e==`object`&&!!e&&`message`in e}function gA(e,t=`An error occurred`){return e instanceof Error?e.message:typeof e==`string`?e:hA(e)&&typeof e.message==`string`?e.message:t}function _A(e,t){let n=e.selectionStart,r=e.selectionEnd,i=e.value,a=`${i.slice(0,n)}\n${i.slice(r)}`;t?.(a),requestAnimationFrame(()=>{e.selectionStart=e.selectionEnd=n+1})}export{sS as AnimateChangeInHeight,xe as Avatar,pa as Badge,yg as Breadcrumbs,W as Button,Og as Card,Mg as CardContent,jg as CardDescription,Ng as CardFooter,kg as CardHeader,Ag as CardTitle,Ce as Center,Qg as Checkbox,we as CloudIcon,p_ as Collapsible,h_ as CollapsibleContent,m_ as CollapsibleTrigger,Gt as ComboBox,ny as Command,ry as CommandDialog,oy as CommandEmpty,sy as CommandGroup,iy as CommandInput,ly as CommandItem,ay as CommandList,cy as CommandSeparator,uy as CommandShortcut,Jk as ComputedProperty,bE as ConfirmModal,Xi as CopyButton,Rt as DOMPopup,zT as DateCombobox,yE as DefaultBox,DE as DeleteModal,Jv as Dialog,Zv as DialogClose,$v as DialogContent,ey as DialogDescription,Qv as DialogOverlay,Xv as DialogPortal,ty as DialogTitle,Yv as DialogTrigger,en as Divider,ga as DotBadge,na as DropZone,iS as Dropdown,Hx as DropdownMenu,Jx as DropdownMenuCheckboxItem,Gx as DropdownMenuContent,Kx as DropdownMenuGroup,qx as DropdownMenuItem,Zx as DropdownMenuLabel,Ux as DropdownMenuPortal,Yx as DropdownMenuRadioGroup,Xx as DropdownMenuRadioItem,Qx as DropdownMenuSeparator,$x as DropdownMenuShortcut,eS as DropdownMenuSub,nS as DropdownMenuSubContent,tS as DropdownMenuSubTrigger,Wx as DropdownMenuTrigger,Zi as EmptyCollection,hE as ErrorBox,ta as FileUploadInput,tE as FilterBar,eE as FilterBtn,nE as FilterClear,iE as FilterOperator,$T as FilterProvider,ua as FormItem,aE as Heading,gE as InfoBox,sa as InfoTip,WT as Input,_a as InputList,pE as Label,lE as LanguageSwitcher,va as Link,aS as MenuGroup,oS as MenuItem,ya as MenuList,mE as MessageBox,Wv as Modal,Kv as ModalBody,Uv as ModalContextProvider,qv as ModalFooter,Gv as ModalTitle,vk as ModeOption,yk as ModeToggle,Ca as NumberInput,OE as OVERFLOW_TAB_GAP_PX,Vt as OptionAdapter,jE as OverflowMoreMenu,ME as OverflowTabsBar,mg as Overlay,NE as Panel,jT as Popover,PT as PopoverAnchor,IT as PopoverClose,FT as PopoverContent,AT as PopoverContext,NT as PopoverTrigger,zt as Popup,Ft as PopupController,vg as Portal,Li as PortalContainerContext,zi as PortalContainerProvider,Rk as Property,mD as RadioGroup,pD as RadioGroupAdapter,fD as RadioGroupItem,vD as ResizableHandle,_D as ResizablePanel,hD as ResizablePanelGroup,Nk as RowSkeleton,oE as SelectBox,xk as SelectList,VT as SelectionCombobox,ED as Separator,Yk as SharedState,fA as SharedValue,Ck as SidePanel,$t as SimpleCombobox,xO as Slider,Bk as Slot,Lk as SortableTableHeaderCell,Ok as Spinner,Dk as SpinnerIconProvider,HT as StringListCombobox,Ht as StringOptionAdapter,Ut as StringOptionAdapterWithCreate,xa as Styles,vE as SuccessBox,Se as SvgAvatar,BO as Switch,Pk as TBody,Mk as THead,Fk as TR,jk as Table,Ik as TableHeaderCell,ok as Tabs,sk as TabsBar,dk as TabsContent,lk as TabsList,ck as TabsPanel,uk as TabsTrigger,Ak as TagsInput,pk as Text,GT as TextCombobox,mk as Textarea,gk as ThemeProvider,hk as ThemeProviderContext,SE as ToastContext,EE as ToastProvider,Hi as Tooltip,Wi as TooltipContent,Vi as TooltipProvider,Ui as TooltipTrigger,Gi as VTooltip,_E as WarningBox,Yi as buttonVariants,mA as cn,At as computePosition,zk as createCompositeStateProvider,gA as errorMessage,Wt as getDefaultComboBoxLayout,_A as insertNewlineAtCursor,da as onActivateKey,Zk as useClickOutside,Yt as useComboboxCtrl,Vk as useCompositeState,Qk as useCopyToClipboard,$k as useDarkMode,eA as useDebounce,dA as useDefaultScrollableSearch,qk as useDefineSlot,oa as useDropZone,nA as useEventSource,iA as useFetch,aA as useFetchOnce,oA as useFlag,Hk as useGetCompositeStateProperty,sA as useIntersectionObserver,cA as useIsFirstRendering,Hv as useIsInModal,AE as useOverflowTabs,LT as usePopoverContext,Lt as usePopupController,Bi as usePortalContainer,lA as useSafeLayoutEffect,uA as useScrollableSearch,Uk as useSetCompositeStateProperty,pA as useSharedValue,Gk as useSlot,_k as useTheme,xE as useToast,Wk as useWatchCompositeStateProperty,Xk as useWatchSharedState,Kk as useWatchSlot};
|
|
340
340
|
//# sourceMappingURL=vertesia-ui-core.js.map
|