@vertesia/ui 1.6.0-dev.20261014.015055Z → 1.6.0-dev.20261019.172735Z
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/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-core.js +68 -68
- package/lib/vertesia-ui-core.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-layout.js +15 -15
- 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-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +21 -21
- 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/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 +28 -28
- 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/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 I,useFocusScopeBranchRegistry as L}from"@radix-ui/react-focus-scope";import{arrow as R,autoUpdate as ee,computePosition as te,flip as ne,hide as re,limitShift as ie,offset as ae,shift as oe,size as se}from"@floating-ui/dom";import{Env as ce}from"@vertesia/ui/env";import{useFocusGuards as le}from"@radix-ui/react-focus-guards";import{RemoveScroll as ue}from"react-remove-scroll";import{hideOthers as de}from"aria-hidden";import{useDirection as fe}from"@radix-ui/react-direction";import pe from"dayjs";import me from"dayjs/plugin/localizedFormat";import he from"dayjs/plugin/relativeTime";import{isEqual as ge}from"lodash-es";import*as _e from"react-resizable-panels";function ve(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 ye({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=ve(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 be({size:e,shape:n=`circle`,color:r=`bg-muted`,className:i,children:a}){let o=n===`circle`?`rounded-full`:`rounded-md`,s=ve(e||`md`);return t(`span`,{className:`inline-block ${s} overflow-hidden ${o} ${r} ${i}`,children:a})}function xe({className:e,children:n}){return t(`div`,{className:r(`flex items-center justify-center`,e),children:n})}function Se(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
8
|
const Ce=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
15
|
function we(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ce(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
22
|
const Te=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},Ee=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
29
|
let t=Te(e);return t.charAt(0).toUpperCase()+t.slice(1)},De=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Oe={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
49
|
function ke(e){return e!=null}function Ae(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Oe.width,a=e.size??e.height??Oe.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?De(...c):De(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Oe[`stroke-width`])*Number(e.size??e.width??Oe.width)/Number(t.size??t.width??Oe.width):t.strokeWidth??Oe[`stroke-width`];return[`svg`,{...Object.entries(Oe).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&ke(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&ke(t.width)&&{[r(`width`)]:t.width},...`height`in t&&ke(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
56
|
function je(e,t={}){return Ae(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
63
|
const Me=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ne=d({}),Pe=()=>g(Ne),Fe=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
76
|
let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=Pe()??{},b=!!c||Me(d),[x,S,C=[]]=je(u,{color:e??v,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:De(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 z(e,t=[],n=[]){let r=typeof e==`string`?we(e,t,n):e,i=p(({className:e,...t},n)=>f(Fe,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Ee(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 B={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};B.node;const Ie=z(B),Le={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
|
-
;Le.node;const
|
|
97
|
+
;Le.node;const Re=z(Le),ze={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
|
+
;ze.node;const Be=z(ze),Ve={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
|
+
;Ve.node;const He=z(Ve),Ue={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
|
+
;Ue.node;const We=z(Ue),Ge={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
|
+
;Ge.node;const Ke=z(Ge),qe={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
|
+
;qe.node;const Je=z(qe),Ye={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
|
+
;Ye.node;const Xe=z(Ye),Ze={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
|
+
;Ze.node;const Qe=z(Ze),$e={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
|
+
;$e.node;const et=z($e),tt={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
|
+
;tt.node;const nt=z(tt),rt={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
|
+
;rt.node;const it=z(rt),at={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
|
+
;at.node;const ot=z(at),st={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
|
+
;st.node;const ct=z(st),lt={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
|
+
;lt.node;const ut=z(lt),dt={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
|
+
;dt.node;const ft=z(dt),pt={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
|
+
;pt.node;const mt=z(pt),ht={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
|
+
;ht.node;const gt=z(ht),_t={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
|
+
;_t.node;const vt=z(_t),yt={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
|
+
;yt.node;const bt=z(yt),xt={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
|
+
;xt.node;const St=z(xt);function Ct(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 wt(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var Tt=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=wt(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=Ct(e.position);if(t!==e.position)return{...e,position:t}}return null}};function Et(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function Dt(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function Ot(e,t,n,r){let i=new Tt(e.gap),a=i.computePosition(e,t,n),o=Dt(a.rect,r,`x`),s=Dt(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 Tt(i.gap).computePosition(c,t,n),Et(a.rect,r)?a:null):null}function kt(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 At(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=kt(e[n].getBoundingClientRect(),t),!t)return null;return t}function jt(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 Mt(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)jt(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var Nt=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=Mt(this.anchor,this.root),this.visibleClientRect=At(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=Ot(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 Pt=d(void 0);function Ft(){let e=g(Pt);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function It({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 Nt({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(Pt.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 Lt({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(It,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function Rt(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var zt=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}},Bt=class e extends zt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},Vt=class e extends Bt{createItem(e){return e}static instance=new e};function Ht(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:Wt,Menu:Kt,Toggle:Gt}}function Ut({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(Rt()),S=C(void 0),T=C(null),E=p?Object.assign(Ht(d,u),p):Ht(d,u),D=o.useRef(null),O=qt({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(Lt,{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 Wt({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(St,{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 Gt({ctrl:e}){return e.isMenuOpen?t(He,{className:`w-4 h-4`}):t(Re,{className:`w-4 h-4`})}function Kt({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 qt(e){let[t,n]=w(new Jt(e));return _(()=>{t?.withState(n)},[t]),t}var Jt=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:Yt(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:Xt(this.highlightedIndex,e.length),!0)}}}};function Yt(e,t){return(e+1)%t}function Xt(e,t){return(e-1+t)%t}function Zt({options:e,creatable:n,...r}){let i=n?Vt.instance:Bt.instance;return t(Ut,{adapter:i,items:e,...r})}function Qt({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var $t=Object.defineProperty,en=(e,t)=>$t(e,`name`,{value:t,configurable:!0});function tn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}en(tn,`setRef`);function nn(...e){return t=>{let n=!1,r=e.map(e=>{let r=tn(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():tn(e[t],null)}}}}en(nn,`composeRefs`);function V(...e){return a.useCallback(nn(...e),e)}en(V,`useComposedRefs`);var rn=Object.defineProperty,an=(e,t)=>rn(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
231
|
+
function on(e){let t=a.forwardRef((t,n)=>{let{children:r,...i}=t,o=null,s=!1,c=[];r=_n(r),a.Children.forEach(r,e=>{if(pn(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;hn(n)&&typeof xn==`function`;)n=xn(n._payload);o=un(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?fn(o):void 0,u=V(n,l);if(!o){if(r||r===0)throw Error(s?bn(e):yn(e));return r}let d=dn(i,o.props??{});return o.type!==a.Fragment&&(d.ref=n?u:l),a.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}an(on,`createSlot`);var sn=/* @__PURE__ */ on(`Slot`),cn=Symbol.for(`radix.slottable`);// @__NO_SIDE_EFFECTS__
|
|
232
|
+
function ln(e){let t=/* @__PURE__ */ an(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=cn,t}an(ln,`createSlottable`);var un=/* @__PURE__ */ an((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 dn(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]=vn(a,i))}return{...e,...n}}an(dn,`mergeProps`);function fn(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)}an(fn,`getElementRef`);function pn(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===cn}an(pn,`isSlottable`);var mn=Symbol.for(`react.lazy`);function hn(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===mn&&`_payload`in e&&gn(e._payload)}an(hn,`isLazyComponent`);function gn(e){return typeof e==`object`&&!!e&&`then`in e}an(gn,`isPromiseLike`);function _n(e){let t=e;for(;hn(t)&&typeof xn==`function`;)t=xn(t._payload);return t}an(_n,`useUnwrappedLazy`);function vn(...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}an(vn,`concatAriaDescribedby`);var yn=/* @__PURE__ */ an(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),bn=/* @__PURE__ */ an(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),xn=a.use;function H(...e){return j(i(e))}var Sn=Object.defineProperty,Cn=(e,t)=>Sn(e,`name`,{value:t,configurable:!0}),wn=!!(typeof window<`u`&&window.document&&window.document.createElement);function U(e,t,{checkForDefaultPrevented:n=!0}={}){return/* @__PURE__ */ Cn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Cn(U,`composeEventHandlers`);function Tn(e){if(!wn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Cn(Tn,`getOwnerWindow`);function En(e){if(!wn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Cn(En,`getOwnerDocument`);function Dn(e,t=!1){let{activeElement:n}=En(e);if(!n?.nodeName)return null;if(On(n)&&n.contentDocument)return Dn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=En(n).getElementById(e);if(t)return t}}return n}Cn(Dn,`getActiveElement`);function On(e){return e.tagName===`IFRAME`}Cn(On,`isFrame`);var kn=Object.defineProperty,An=(e,t)=>kn(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
233
|
+
function jn(e,n){let r=a.createContext(n);r.displayName=e+`Context`;let i=/* @__PURE__ */ An(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 An(o,`useContext`),[i,o]}An(jn,`createContext`);// @__NO_SIDE_EFFECTS__
|
|
234
|
+
function Mn(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__ */ An(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 An(l,`useContext`),[c,l]}An(i,`createContext`);let o=/* @__PURE__ */ An(()=>{let t=r.map(e=>a.createContext(e));return/* @__PURE__ */ An(function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return o.scopeName=e,[i,Nn(o,...n)]}An(Mn,`createContextScope`);function Nn(...e){let t=e[0];if(e.length===1)return t;let n=/* @__PURE__ */ An(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return/* @__PURE__ */ An(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}An(Nn,`composeContextScopes`);var Pn=globalThis?.document?a.useLayoutEffect:()=>{},Fn=Object.defineProperty,In=(e,t)=>Fn(e,`name`,{value:t,configurable:!0}),Ln=a.useId||(()=>void 0),Rn=0;function W(e){let[t,n]=a.useState(Ln());return Pn(()=>{e||n(e=>e??String(Rn++))},[e]),e||(t?`radix-${t}`:``)}In(W,`useId`);var zn=typeof document<`u`?x:function(){};function Bn(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(!Bn(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)&&!Bn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Vn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hn(e,t){let n=Vn(e);return Math.round(t*n)/n}function Un(e){let t=a.useRef(e);return zn(()=>{t.current=e}),t}function Wn(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);Bn(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=Un(l),k=Un(i),A=Un(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&&!Bn(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);zn(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=a.useRef(!1);zn(()=>(M.current=!0,()=>{M.current=!1}),[]),zn(()=>{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=Hn(P.floating,d.x),r=Hn(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Vn(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 Gn=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?{}:R({element:r.current,padding:i}).fn(n):r?R({element:r,padding:i}).fn(n):{}}}},Kn=(e,t)=>{let n=ae(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)=>({fn:ie(e).fn,options:[e,t]}),Yn=(e,t)=>{let n=ne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xn=(e,t)=>{let n=se(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zn=(e,t)=>{let n=re(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qn=(e,t)=>{let n=Gn(e);return{name:n.name,fn:n.fn,options:[e,t]}};var $n=Object.defineProperty,er=(e,t)=>$n(e,`name`,{value:t,configurable:!0}),G=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=/* @__PURE__ */ on(`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 tr(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}er(tr,`dispatchDiscreteCustomEvent`);var nr=Object.defineProperty,rr=(e,t)=>nr(e,`name`,{value:t,configurable:!0}),ir=a.useInsertionEffect;function ar(e){let t=a.useRef(e);return typeof ir==`function`?ir(()=>{t.current=e}):Pn(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}rr(ar,`useCallbackRef`);var or=Object.defineProperty,sr=(e,t)=>or(e,`name`,{value:t,configurable:!0});function cr(e){let[t,n]=a.useState(void 0);return Pn(()=>{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}sr(cr,`useSize`);var lr=Object.defineProperty,ur=(e,t)=>lr(e,`name`,{value:t,configurable:!0}),dr={Partial:`partial`,Always:`always`},fr={Optimized:`optimized`,Always:`always`},pr=`Popper`,[mr,hr]=/* @__PURE__ */ Mn(pr),[gr,_r]=mr(pr),vr=/* @__PURE__ */ ur(e=>{let{__scopePopper:n,children:r}=e,[i,o]=a.useState(null),[s,c]=a.useState(void 0);return/* @__PURE__ */ t(gr,{scope:n,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:c,children:r})},`Popper`),yr=`PopperAnchor`,br=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ur(function(e,n){let{__scopePopper:r,virtualRef:i,...o}=e,s=_r(yr,r),c=a.useRef(null),l=s.onAnchorChange,u=V(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&&Dr(s.placementState),p=f?.[0],m=f?.[1];return i?null:/* @__PURE__ */ t(G.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:u})},`PopperAnchor`)),xr=`PopperContent`,[Sr,Cr]=mr(xr),wr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ur(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=dr.Partial,hideWhenDetached:m=!1,updatePositionStrategy:h=fr.Optimized,onPlaced:g,..._}=e,v=_r(xr,r),[y,b]=a.useState(null),x=V(n,b),[S,C]=a.useState(null),w=cr(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(Tr),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:I}=Wn({strategy:`fixed`,placement:D,whileElementsMounted:/* @__PURE__ */ ur((...e)=>ee(...e,{animationFrame:h===fr.Always}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Kn({mainAxis:o+E,alignmentAxis:c}),u&&qn({mainAxis:!0,crossAxis:!1,...p===dr.Partial?{limiter:Jn()}:{},...j}),u&&Yn({...j}),Xn({...j,apply:/* @__PURE__ */ ur(({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&&Qn({element:S,padding:l}),Er({arrowWidth:T,arrowHeight:E}),m&&Zn(A?{strategy:`referenceHidden`,...j}:{strategy:`referenceHidden`,padding:j.padding,altBoundary:j.altBoundary})]}),L=v.setPlacementState;Pn(()=>(L(P),()=>{L(void 0)}),[P,L]);let[R,te]=Dr(P),ne=ar(g);Pn(()=>{F&&ne?.()},[F,ne]);let re=I.arrow?.x,ie=I.arrow?.y,ae=I.arrow?.centerOffset!==0,[oe,se]=a.useState();return Pn(()=>{y&&se(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:oe,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:/* @__PURE__ */ t(Sr,{scope:r,placedSide:R,placedAlign:te,onArrowChange:C,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:/* @__PURE__ */ t(G.div,{"data-side":R,"data-align":te,..._,ref:x,style:{..._.style,animation:F?_.style?.animation:`none`}})})})},`PopperContent`));function Tr(e){return e!==null}ur(Tr,`isNotNull`);var Er=/* @__PURE__ */ ur(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]=Dr(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 Dr(e){let[t,n=`center`]=e.split(`-`);return[t,n]}ur(Dr,`getSideAndAlignFromPlacement`);var Or=Object.defineProperty,kr=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>Or(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[o,s]=a.useState(!1);Pn(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?T.createPortal(/* @__PURE__ */ t(G.div,{...i,ref:n}),c):null},`Portal`)),Ar=Object.defineProperty,jr=(e,t)=>Ar(e,`name`,{value:t,configurable:!0});function Mr(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}jr(Mr,`useStateMachine`);var Nr=/* @__PURE__ */ jr(e=>{let{present:t,children:n}=e,r=Pr(t),i=typeof n==`function`?n({present:r.isPresent}):a.Children.only(n),o=Ir(r.ref,Rr(i));return typeof n==`function`||r.isPresent?a.cloneElement(i,{ref:o}):null},`Presence`);function Pr(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]=Mr(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??Lr(r.current),s.current=void 0):o.current=`none`},[c]),Pn(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=Lr(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]),Pn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=/* @__PURE__ */ jr(a=>{let o=Lr(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__ */ jr(e=>{e.target===t&&(o.current=Lr(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=Lr(t)}else r.current=null;n(e)},[])}}jr(Pr,`usePresence`);function Fr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}jr(Fr,`setRef`);function Ir(...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=Fr(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():Fr(n[e],null)}}},[])}jr(Ir,`useStableComposedRefs`);function Lr(e){return e?.animationName||`none`}jr(Lr,`getAnimationName`);function Rr(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)}jr(Rr,`getElementRef`);var zr=Object.defineProperty,Br=(e,t)=>zr(e,`name`,{value:t,configurable:!0}),Vr=a.useEffectEvent,Hr=a.useInsertionEffect;function Ur(e){if(typeof Vr==`function`)return Vr(e);let t=a.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Hr==`function`?Hr(()=>{t.current=e}):Pn(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}Br(Ur,`useEffectEvent`);var Wr=Object.defineProperty,Gr=(e,t)=>Wr(e,`name`,{value:t,configurable:!0}),Kr=a.useInsertionEffect||Pn;function qr({prop:e,defaultProp:t,onChange:n=/* @__PURE__ */ Gr(()=>{},`onChange`),caller:r}){let[i,o,s]=Jr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,a.useCallback(t=>{if(c){let n=Yr(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}Gr(qr,`useControllableState`);function Jr({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return Kr(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}Gr(Jr,`useUncontrolledState`);function Yr(e){return typeof e==`function`}Gr(Yr,`isFunction`);var Xr=Symbol(`RADIX:SYNC_STATE`);function Zr(e,t,n,r){let{prop:i,defaultProp:o,onChange:s,caller:c}=t,l=i!==void 0,u=Ur(s),d=[{...n,state:o}];r&&d.push(r);let[f,p]=a.useReducer((t,n)=>{if(n.type===Xr)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:Xr,state:i})},[i,f.state,l]),[g,p]}Gr(Zr,`useControllableStateReducer`);var Qr=Object.defineProperty,$r=(e,t)=>Qr(e,`name`,{value:t,configurable:!0}),ei=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`}),ti=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $r(function(e,n){return/* @__PURE__ */ t(G.span,{...e,ref:n,style:{...ei,...e.style}})},`VisuallyHidden`)),ni=Object.defineProperty,ri=(e,t)=>ni(e,`name`,{value:t,configurable:!0}),[ii,ai]=/* @__PURE__ */ Mn(`Tooltip`,[hr]),oi=hr(),si=`TooltipProvider`,ci=700,li=`tooltip.open`,[ui,di]=ii(si),fi=/* @__PURE__ */ ri(e=>{let{__scopeTooltip:n,delayDuration:r=ci,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(ui,{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`),pi=`Tooltip`,[mi,hi]=ii(pi),gi=/* @__PURE__ */ ri(e=>{let{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=di(pi,e.__scopeTooltip),d=oi(n),[f,p]=a.useState(null),[m,h]=a.useState(void 0),g=W(),_=a.useRef(0),v=c??u.disableHoverableContent,y=l??u.delayDuration,b=a.useRef(!1),[x,S]=qr({prop:i,defaultProp:o??!1,onChange:/* @__PURE__ */ ri(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(li))):u.onClose(),s?.(e)},`onChange`),caller:pi}),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(vr,{...d,children:/* @__PURE__ */ t(mi,{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`),_i=`TooltipTrigger`,vi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ri(function(e,n){let{__scopeTooltip:r,"aria-describedby":i,...o}=e,s=hi(_i,r),c=di(_i,r),l=oi(r),u=V(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(br,{asChild:!0,...l,children:/* @__PURE__ */ t(G.button,{"aria-describedby":s.open?Pi(i,s.contentId):i,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:U(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!c.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:U(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:U(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:U(e.onBlur,s.onClose),onClick:U(e.onClick,s.onClose)})})},`TooltipTrigger`)),yi=`TooltipPortal`,[bi,xi]=ii(yi,{forceMount:void 0}),Si=/* @__PURE__ */ ri(e=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=e,o=hi(yi,n);return/* @__PURE__ */ t(bi,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Nr,{present:r||o.open,children:/* @__PURE__ */ t(kr,{asChild:!0,container:a,children:i})})})},`TooltipPortal`),Ci=`TooltipContent`,wi=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ri(function(e,n){let r=xi(Ci,e.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=e,s=hi(Ci,e.__scopeTooltip);return/* @__PURE__ */ t(Nr,{present:i||s.open,children:s.disableHoverableContent?/* @__PURE__ */ t(Di,{side:a,...o,ref:n}):/* @__PURE__ */ t(Ti,{side:a,...o,ref:n})})},`TooltipContent`)),Ti=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ri(function(e,n){let r=hi(Ci,e.__scopeTooltip),i=di(Ci,e.__scopeTooltip),o=a.useRef(null),s=V(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=ki(r,Oi(r,n.getBoundingClientRect())),a=Ai(t.getBoundingClientRect()),o=Mi([...i,...a]);l(o),p(!0)},[p]);return a.useEffect(()=>()=>m(),[m]),a.useEffect(()=>{if(u&&f){let e=/* @__PURE__ */ ri(e=>h(e,f),`handleTriggerLeave`),t=/* @__PURE__ */ ri(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__ */ ri(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!ji(n,c);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),/* @__PURE__ */ t(Di,{...e,ref:s})},`TooltipContentHoverable`)),Ei=/* @__PURE__ */ ln(`TooltipContent`),Di=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ri(function(e,r){let{__scopeTooltip:i,children:o,"aria-label":s,id:c,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=hi(Ci,i),p=oi(i),{onClose:m}=f,[h,g]=a.useState(null),_=V(r,g);I(h),a.useEffect(()=>(document.addEventListener(li,m),()=>document.removeEventListener(li,m)),[m]),a.useEffect(()=>{if(f.trigger){let e=/* @__PURE__ */ ri(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 Pn(()=>(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(wr,{"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(Ei,{children:o}),s?/* @__PURE__ */ t(ti,{id:f.contentId,role:`tooltip`,children:s}):null]})})},`TooltipContentImpl`));function Oi(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`)}}ri(Oi,`getExitSideFromRect`);function ki(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}ri(ki,`getPaddedExitPoints`);function Ai(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}]}ri(Ai,`getPointsFromRect`);function ji(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}ri(ji,`isPointInPolygon`);function Mi(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)),Ni(t)}ri(Mi,`getHull`);function Ni(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)}ri(Ni,`getHullPresorted`);function Pi(...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}ri(Pi,`concatAriaDescribedby`);const Fi=o.createContext(void 0);function Ii(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 Li({children:e,id:n=`plugin-portal-container`}){let r=o.useContext(Fi),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=Ii(e,n);s(t)}else s(null)}},[n,r]),a===void 0?t(`div`,{ref:i,style:{display:`none`}}):t(Fi.Provider,{value:a||void 0,children:e})}function Ri(){return o.useContext(Fi)}const zi=fi,Bi=gi,Vi=vi,Hi=a.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=Ri();return t(Si,{container:o,children:t(wi,{ref:a,sideOffset:n,side:r,style:{zIndex:100},className:H(`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})})});Hi.displayName=wi.displayName;function Ui({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(zi,{delayDuration:0,children:n(Bi,{open:l,onOpenChange:e=>{d.current||u(e)},children:[t(Vi,{className:`cursor-pointer`,asChild:c,children:r}),t(Hi,{side:o,className:`px-3 py-1.5 max-w-${i} text-${i} px-3 ${s}`,children:e})]})})}const Wi=/* @__PURE__ */ new Set;function Gi(e,t,n){_(()=>{t&&!Wi.has(e)&&(Wi.add(e),console.warn(`[@vertesia/ui] ${e} is deprecated: ${n}`))},[t,n,e])}function Ki(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:Ki(t.children)}return!1})}const qi=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`}}),K=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)=>{Gi(`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?sn:`button`,_=o?p:p??`button`,v=u??s,y=m[`aria-label`]??s??(Ki(m.children)?void 0:u),b=o?m.children:n(e,{children:[l&&t(ot,{className:`animate-spin`}),m.children]}),x=t(g,{className:H(qi({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(Ui,{description:v,asChild:!0,className:`cursor-pointer`,size:`xs`,placement:d,children:x}):x});K.displayName=`Button`;const Ji=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();Gi(`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(K,{ref:l,className:H(i),variant:`unstyled`,size:e||`sm`,onClick:p,...c,title:m,children:u?t(Ie,{className:`text-success`}):o??t(Qe,{className:`size-4`})})});Ji.displayName=`CopyButton`;function Yi({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(K,{onClick:a,children:[t(ft,{className:`-ms-0.5 me-1.5 size-5`,"aria-hidden":`true`}),e]})})]})})}function Xi(e){return e.isFile}function Zi(e){return e.isDirectory}function Qi(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function $i({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(Qi(i.current.files))}})]})}function ea({onUpload:e}){let r=ia({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 ta(e){if(!e)return!1;let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t}function na(e){if(!e)return!1;let t=e.__dragOver_cnt__;return t?(e.__dragOver_cnt__=t-1,t===1):!1}function ra(e){e&&delete e.__dragOver_cnt__}function ia({onUpload:e,dragOverClass:t=`is-drag-over-on`,dropEffect:n=`copy`}){let r=C(null);return{onDrop:n=>{n.preventDefault(),ra(r.current),r.current?.classList.remove(t);let i=n.dataTransfer.items;if(i){let t=[],n=(e,t=``)=>new Promise(r=>{if(Xi(e))e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if(Zi(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:()=>{ta(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{na(r.current)&&r.current?.classList.remove(t)},ref:r}}function aa({description:e,size:n=`sm`,placement:r=`top`,className:i}){return e?t(Ui,{description:e,placement:r,children:t(nt,{className:H(n===`md`?`size-4`:`size-3`,`text-muted`,i)})}):null}function oa(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` `):void 0}function sa(){try{return ce.isDev}catch{return!1}}function ca({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=oa(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 sa()&&!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(aa,{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 la(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e(t))}}const ua=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 da({className:e,variant:n,children:r,onClick:i,...a}){let o=i?{role:`button`,tabIndex:0,onClick:i,onKeyDown:la(i)}:{};return t(`span`,{className:H(ua({variant:n}),e),...o,...a,children:r})}const fa=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`}}),pa=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 ma({variant:e,className:r,dotClassName:i,children:a,...o}){return n(`span`,{className:H(fa({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:H(pa({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 ha({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(Ui,{description:`click to remove`,children:t(da,{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 ga({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 _a({className:e,children:n}){return t(`ul`,{className:`${e} space-y-1 flex flex-col items-start`,children:n})}_a.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 va=`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`,ya={INPUT_UNSTYLED:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,INPUT_NO_PADDING:va,INPUT:`${va} py-1.5`};function ba(e){return e==null||Number.isNaN(e)?``:e.toString()}const xa=o.forwardRef(({value:e,onChange:n,className:i,noScroll:a=!1,noSpinners:s=!1,...c},l)=>{let[u,d]=o.useState(ba(e));return _(()=>{if(e==null||!Number.isNaN(e)){let t=ba(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,ya.INPUT,{"no-spinners":s},s&&`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`),ref:l,...c})}),Sa=d({});function Ca(e){let t=C(null);return t.current===null&&(t.current=e()),t.current}const wa=typeof window<`u`?x:_,Ta=/* @__PURE__ */ d(null);function Ea(e,t){e.indexOf(t)===-1&&e.push(t)}function Da(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const Oa=(e,t,n)=>n>t?t:n<e?e:n,ka={},Aa=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ja=e=>typeof e==`object`&&!!e,Ma=e=>/^0[^.\s]+$/u.test(e);/*#__NO_SIDE_EFFECTS__*/
|
|
235
|
+
function Na(e){let t;return()=>(t===void 0&&(t=e()),t)}const Pa=/* @__NO_SIDE_EFFECTS__ */ e=>e,Fa=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Ia=/* @__NO_SIDE_EFFECTS__ */ (e,t,n)=>{let r=t-e;return r?(n-e)/r:1};var La=class{constructor(){this.subscriptions=[]}add(e){return Ea(this.subscriptions,e),()=>this.remove(e)}remove(e){Da(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 Ra=/* @__NO_SIDE_EFFECTS__ */ e=>e*1e3,za=/* @__NO_SIDE_EFFECTS__ */ e=>e/1e3,Ba=/* @__NO_SIDE_EFFECTS__ */ (e,t)=>t?1e3/t*e:0,Va=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Ha(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Va(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>1e-7&&++s<12);return o}/*#__NO_SIDE_EFFECTS__*/
|
|
236
|
+
function Ua(e,t,n,r){if(e===t&&n===r)return Pa;let i=t=>Ha(t,0,1,e,n);return e=>e===0||e===1?e:Va(i(e),t,r)}const Wa=/* @__NO_SIDE_EFFECTS__ */ e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ga=/* @__NO_SIDE_EFFECTS__ */ e=>t=>1-e(1-t),Ka=/*@__PURE__*/ Ua(.33,1.53,.69,.99),qa=/*@__PURE__*/ Ga(Ka),Ja=/*@__PURE__*/ Wa(qa),Ya=e=>e>=1?1:(e*=2)<1?.5*qa(e):.5*(2-2**(-10*(e-1))),Xa=e=>1-Math.sin(Math.acos(e)),Za=/* @__PURE__ */ Ga(Xa),Qa=/* @__PURE__ */ Wa(Xa),$a=/*@__PURE__*/ Ua(.42,0,1,1),eo=/*@__PURE__*/ Ua(0,0,.58,1),to=/*@__PURE__*/ Ua(.42,0,.58,1),no=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]!=`number`,ro=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]==`number`,io={linear:Pa,easeIn:$a,easeInOut:to,easeOut:eo,circIn:Xa,circInOut:Qa,circOut:Za,backIn:qa,backInOut:Ja,backOut:Ka,anticipate:Ya},ao=e=>typeof e==`string`,oo=e=>{if(/* @__PURE__ */ ro(e)){e.length;let[t,n,r,i]=e;return/* @__PURE__ */ Ua(t,n,r,i)}return ao(e)?(io[e],`${e}`,io[e]):e},so={delta:0,timestamp:0,isProcessing:!1};let co;function lo(){co=void 0}const uo={now:()=>(co===void 0&&uo.set(so.isProcessing||ka.useManualTiming?so.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=>Oa(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=>Oa(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(`%`),q=/*@__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))+`)`},zo={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=zo.parse(e);return t.alpha=0,zo.transform(t)}},Bo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Vo=/*@__PURE__*/ new RegExp(So.source),Ho=/*@__PURE__*/ new RegExp(Bo.source,`i`);function Uo(e){return isNaN(e)&&typeof e==`string`&&(Vo.test(e)||Ho.test(e))}const Wo=`number`,Go=`color`,Ko=/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 qo(e){let t=e.toString();return Vo.test(t)||Ho.test(t)}function Jo(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Ko,e=>(zo.test(e)?(r.color.push(a),i.push(Go),n.push(zo.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(Wo),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function Yo(e){return Jo(e).values}function Xo({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===Wo?fo(r[a]):e===Go?zo.transform(r[a]):r[a]}return i}}function Zo(e){return Xo(Jo(e))}const Qo=e=>typeof e==`number`?0:zo.test(e)?zo.getAnimatableNone(e):e,$o=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Qo(e);function es(e){let t=Jo(e);return Xo(t)(t.values.map((e,n)=>$o(e,t.split[n])))}const ts={test:Uo,parse:Yo,createTransformer:Zo,getAnimatableNone:es};function ns(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 rs({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=ns(s,r,e+1/3),a=ns(s,r,e),o=ns(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function is(e,t){return n=>n>0?t:e}const J=(e,t,n)=>e+(t-e)*n,as=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},os=[jo,ko,Ro],ss=e=>os.find(t=>t.test(e));function cs(e){let t=ss(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===Ro&&(n=rs(n)),n}const ls=(e,t)=>{let n=cs(e),r=cs(t);if(!n||!r)return is(e,t);let i={...n};return e=>(i.red=as(n.red,r.red,e),i.green=as(n.green,r.green,e),i.blue=as(n.blue,r.blue,e),i.alpha=J(n.alpha,r.alpha,e),ko.transform(i))},us=/* @__PURE__ */ new Set([`none`,`hidden`]);function ds(e,t){return us.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function fs(e,t){return n=>J(e,t,n)}function ps(e){return typeof e==`number`?fs:typeof e==`string`?go(e)?is:zo.test(e)?ls:_s:Array.isArray(e)?ms:typeof e==`object`?zo.test(e)?ls:hs:is}function ms(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ps(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function hs(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ps(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function gs(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 _s=(e,t)=>{let n=ts.createTransformer(t),r=Jo(e),i=Jo(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?us.has(e)&&!i.values.length||us.has(t)&&!r.values.length?ds(e,t):Fa(ms(gs(r,i),i.values),n):(`${e}${t}`,is(e,t))},vs=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function ys(e,t){let n=vs.exec(e);if(!n)return;let r=vs.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 bs(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=ys(e,t);if(n)return n}return ps(e)(e,t)}const xs=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Ss(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 Cs(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=xs.reduce((e,t)=>(e[t]=Ss(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=ka.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:xs.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<xs.length;t++)o[xs[t]].cancel(e)},state:n,steps:o}}const{schedule:Y,cancel:ws,steps:Ts}=/* @__PURE__ */ Cs(typeof requestAnimationFrame<`u`?requestAnimationFrame:Pa,!0,so),Es=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Y.update(t,e),stop:()=>ws(t),now:()=>so.isProcessing?so.timestamp:uo.now()}},Ds=(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)})`},Os=2e4;function ks(e,t=50,n=Os,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 As(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(ks(r),Os);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:/* @__PURE__ */ za(i)}}const js={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},Ms=e=>e<0?1/Math.max(1+e,js.minDamping):Math.max(1-e,js.minDamping);function Ns(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 Fs(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Ps(e,t){return e*Math.sqrt(1-t*t)}function Fs(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const Is=.001;function Ls({duration:e=js.duration,bounce:t=js.bounce}){let n,r;js.maxDuration;let i=Ms(t);e=Oa(js.minDuration,js.maxDuration,/* @__PURE__ */ za(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=Ps(t,i),o=Math.exp(-r);return Is-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Ps(t*t,i);return(-n(t)+Is>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=Fs(n,r,a),s=o*Ns(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:/* @__PURE__ */ Ra(e)}}const Rs=(e,t)=>(t?e>=0:e>0)&&e<1/0;function zs(e,t){if(Rs(e,t))return e}function Bs(e){let t=zs(e.stiffness),n=zs(e.damping,!0),r=zs(e.mass),i={...e,stiffness:t??js.stiffness,damping:n??js.damping,mass:r??js.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=Ms(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Ns(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Ls(i)),i.isResolvedFromDuration=!0;(!Rs(i.stiffness)||!Rs(i.damping,!0))&&(i.stiffness=js.stiffness,i.damping=js.damping)}return i}function Vs(e=js.visualDuration,t=js.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}=Bs({...n}),f=e=>d?0:-/* @__PURE__ */ za(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ za(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?js.restSpeed.granular:js.restSpeed.default),g.restDelta=n.restDelta||(e?js.restDelta.granular:js.restDelta.default)};_();let v,y,b;if(p<1){let e=Ps(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__ */ Ra(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ Ra(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(ks(S),Os),t=Ds(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Vs.applyToOptions=e=>{let t=As(e,100,Vs);return e.ease=t.ease,e.duration=/* @__PURE__ */ Ra(t.duration),e.type=`keyframes`,e};function Hs({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=Vs({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 Us(e,t,n){let r=[],i=n||ka.mix||bs,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]||Pa:t;a=Fa(e,a)}r.push(a)}return r}function Ws(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=Us(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__ */ Ia(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Oa(e[0],e[a-1],t)):l}function Gs(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=/* @__PURE__ */ Ia(0,t,r);e.push(J(n,1,i))}}function Ks(e){let t=[0];return Gs(t,e.length-1),t}function qs(e,t){return e.map(e=>e*t)}function Js(e,t){return e.map(()=>t||to).splice(0,e.length-1)}function Ys({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=/* @__PURE__ */ no(r)?r.map(oo):oo(r)||to,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:(ka.mix||bs)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?Oa(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=Ws(qs(n&&n.length===t.length?n:Ks(t),e),t,{ease:Array.isArray(i)?i:Js(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}function Xs(e,t,n){let r=Math.max(t-5,0);return/* @__PURE__ */ Ba(n-e(r),t-r)}function Zs(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Xs(t=>e.next(t).value,t,e.next(t).value)}const Qs=e=>e!==null;function $s(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Qs),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const ec={decay:Hs,inertia:Hs,tween:Ys,keyframes:Ys,spring:Vs};function tc(e){typeof e.type==`string`&&(e.type=ec[e.type])}function nc(e,t){return{kind:e,animation:t,timestamp:uo.now(),frameTimestamp:so.timestamp,frameIsProcessing:so.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;var sc=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!==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(),rc(this,this.options)}initAnimation(){let{options:e}=this;tc(e);let{type:t=Ys,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Ys;s!==Ys&&typeof o[0]!=`number`&&(this.mixKeyframes=Fa(oc,bs(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=ks(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=Oa(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!==Hs&&(b.value=$s(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__ */ za(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ za(e)}get time(){return/* @__PURE__ */ za(this.currentTime)}set time(e){e=/* @__PURE__ */ Ra(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 Zs(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__ */ za(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Es,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 cc=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function lc(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=+!!cc.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const uc=/\b([a-z-]*)\(.*?\)/gu,dc={...ts,getAnimatableNone:e=>{let t=e.match(uc);return t?t.map(lc).join(` `):e}},fc={...ts,getAnimatableNone:e=>{let t=ts.parse(e);return ts.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},pc={...yo,transform:Math.round},mc={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:No,pathRotation:No,rotateX:No,rotateY:No,rotateZ:No,scale:xo,scaleX:xo,scaleY:xo,scaleZ:xo,skew:No,skewX:No,skewY:No,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:bo,originX:Lo,originY:Lo,originZ:q,zIndex:pc,fillOpacity:bo,strokeOpacity:bo,numOctaves:pc},hc={...mc,color:zo,backgroundColor:zo,outlineColor:zo,fill:zo,stroke:zo,borderColor:zo,borderTopColor:zo,borderRightColor:zo,borderBottomColor:zo,borderLeftColor:zo,filter:dc,WebkitFilter:dc,mask:fc,WebkitMask:fc},gc=e=>hc[e],_c=/*@__PURE__*/ new Set([dc,fc]);function vc(e,t){let n=gc(e);return _c.has(n)||(n=ts),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function yc(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const bc=e=>e*180/Math.PI,xc=e=>{let t=bc(Math.atan2(e[1],e[0]));return Cc(t)},Sc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:xc,rotateZ:xc,skewX:e=>bc(Math.atan(e[1])),skewY:e=>bc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Cc=e=>(e%=360,e<0&&(e+=360),e),wc=xc,Tc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ec=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Dc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Tc,scaleY:Ec,scale:e=>(Tc(e)+Ec(e))/2,rotateX:e=>Cc(bc(Math.atan2(e[6],e[5]))),rotateY:e=>Cc(bc(Math.atan2(-e[2],e[0]))),rotateZ:wc,rotate:wc,skewX:e=>bc(Math.atan(e[4])),skewY:e=>bc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Oc(e){return+!!e.includes(`scale`)}function kc(e,t){if(!e||e===`none`)return Oc(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Dc,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Sc,i=t}if(!i)return Oc(t);let a=r[t],o=i[1].split(`,`).map(jc);return typeof a==`function`?a(o):o[a]}const Ac=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return kc(n,t)};function jc(e){return parseFloat(e.trim())}const Mc=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Nc=/* @__PURE__ */ new Set([...Mc,`pathRotation`]),Pc=e=>e===yo||e===q,Fc=/* @__PURE__ */ new Set([`x`,`y`,`z`]),Ic=Mc.filter(e=>!Fc.has(e));function Lc(e){let t=[];return Ic.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 Rc=/* @__PURE__ */ new Set([`bottom`,`right`]);function zc(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 Bc={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>zc(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>zc(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})=>kc(e,`x`),y:({transform:e})=>kc(e,`y`)};Bc.translateX=Bc.x,Bc.translateY=Bc.y;const Vc=/* @__PURE__ */ new Set;let Hc=!1,Uc=!1,Wc=!1;function Gc(){if(Uc){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;Vc.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Rc.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=Lc(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)})}Uc=!1,Hc=!1,Vc.forEach(e=>e.complete(Wc)),Vc.clear()}function Kc(){Vc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Uc=!0)})}function qc(){Wc=!0,Kc(),Gc(),Wc=!1}function Jc(e,t,n){if(typeof e==`string`){if(Aa(e)||Ma(e))return parseFloat(e);if(!ts.test(e)&&ts.test(n))return vc(t,n)}return e??void 0}var Yc=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?(Vc.add(this),Hc||(Hc=!0,Y.read(Kc),Y.resolveKeyframes(Gc))):(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=Jc(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])}yc(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Vc.delete(this)}cancel(){this.state===`scheduled`&&(Vc.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const Xc=e=>e.startsWith(`--`);function Zc(e,t,n){Xc(t)?e.style.setProperty(t,n):e.style[t]=n}const Qc={};function $c(e,t){let n=/* @__PURE__ */ Na(e);return()=>Qc[t]??n()}const el=/* @__PURE__ */ $c(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),tl=/*@__PURE__*/ $c(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),nl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,rl={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ nl([0,.65,.55,1]),circOut:/*@__PURE__*/ nl([.55,0,1,.45]),backIn:/*@__PURE__*/ nl([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ nl([.33,1.53,.69,.99])};function il(e,t){if(e)return typeof e==`function`?tl()?Ds(e,t):`ease-out`:/* @__PURE__ */ ro(e)?nl(e):Array.isArray(e)?e.map(e=>il(e,t)||rl.easeOut):rl[e]}function al(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=il(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 ol(e){return typeof e==`function`&&`applyToOptions`in e}function sl({type:e,...t}){return ol(e)&&tl()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var cl=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=sl(e);this.animation=al(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=$s(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Zc(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__ */ za(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ za(e)}get time(){return/* @__PURE__ */ za(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ Ra(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&&el()?(this.animation.timeline=e,Object.assign(this.animation,r),t?.(this.animation),Pa):n(this)}};const ll={anticipate:Ya,backInOut:Ja,circInOut:Qa};function ul(e){return e in ll}function dl(e){typeof e.ease==`string`&&ul(e.ease)&&(e.ease=ll[e.ease])}var fl=class extends cl{constructor(e){dl(e),tc(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 sc({...a,autoplay:!1}),s=Math.max(10,uo.now()-this.startTime),c=Oa(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&Zc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const pl=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(ts.test(e)||e===`0`)&&!e.startsWith(`url(`));function ml(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 hl(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=pl(i,t),s=pl(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):ml(e)||(n===`spring`||ol(n))&&r}function gl(e){e.duration=0,e.type=`keyframes`}const _l=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),vl=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function yl(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&vl.test(e[t]))return!0;return!1}const bl=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),xl=/*@__PURE__*/ Na(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Sl(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(_l.has(n)||bl.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 xl()&&(_l.has(n)||bl.has(n)&&yl(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Cl=class extends ac{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||Yc;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;hl(e,i,a,o)||(u=!1,(ka.instantAnimations||!s)&&l?.($s(e,n,t)),e[0]=e[e.length-1],gl(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&&Sl(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new fl(n)}catch{m=new sc(n)}}else m=new sc(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(),qc()),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 wl(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 Tl=e=>!isNaN(parseFloat(e)),El={current:void 0};var Dl=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=Tl(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 La)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new La,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 El.current&&El.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__ */ Ba(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 Ol(e,t){return new Dl(e,t)}function kl(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Al(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},Ml=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Nl={type:`keyframes`,duration:.8},Pl={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Fl=(e,{keyframes:t})=>t.length>2?Nl:Nc.has(e)?e.startsWith(`scale`)?Ml(t[1]):jl:Pl,Il=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Ll(e){for(let t in e)if(!Il.has(t))return!0;return!1}const Rl=(e,t,n,r={},i,a)=>o=>{let s=Al(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ Ra(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};Ll(s)||Object.assign(u,Fl(e,u)),u.duration&&=/* @__PURE__ */ Ra(u.duration),u.repeatDelay&&=/* @__PURE__ */ Ra(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(gl(u),u.delay===0&&(d=!0)),(ka.instantAnimations||ka.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,gl(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=$s(u.keyframes,s);if(e!==void 0){Y.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new sc(u):new Cl(u)},zl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Bl(e){let t=zl.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Vl(e,t,n=1){`${e}`;let[r,i]=Bl(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Aa(e)?parseFloat(e):e}return go(i)?Vl(i,t,n+1):i}function Hl(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ul(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...Hl(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Wl(e,t,n){return Ul(e.getProps(),t,n,e)}const Gl=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Kl=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Mc]),ql=e=>Array.isArray(e);function Jl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ol(n))}function Yl(e){return ql(e)?e[e.length-1]||0:e}function Xl(e,t){let{transitionEnd:n={},transition:r={},...i}=Wl(e,t)||{};i={...i,...n};for(let t in i)Jl(e,t,Yl(i[t]))}const Zl=e=>!!(e&&e.getVelocity);function Ql(e){return!!(Zl(e)&&e.add)}function $l(e,t){let n=e.getValue(`willChange`);if(Ql(n))return n.add(t);if(!n&&ka.WillChange){let n=new ka.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function eu(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const tu=`data-`+eu(`framerAppearId`);function nu(e){return e.props[tu]}const ru=typeof window<`u`;function iu({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function au(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&&iu(f,t))continue;let o={delay:n,...Al(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(ru&&window.MotionHandoffAnimation){let n=nu(e);if(n){let e=window.MotionHandoffAnimation(n,t,Y);e!==null&&(o.startTime=e,p=!0)}}$l(e,t);let m=l??e.shouldReduceMotion;r.start(Rl(t,r,i,m&&Kl.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Y.update(()=>{o&&Xl(e,o)});d.length?Promise.all(d).then(t):t()}return d}function ou(e,t,n={}){let r=Wl(e,t,Gl(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?au(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(ou(e,t,{...n,delay:r+(typeof o==`function`?0:o)+wl(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 su(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>ou(e,t,n))):typeof t==`string`?ou(e,t,n):Promise.all(au(e,Wl(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}const cu={test:e=>e===`auto`,parse:e=>e},lu=e=>t=>t.test(e),uu=[yo,q,Po,No,Io,Fo,cu],du=e=>uu.find(lu(e));function fu(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Ma(e)}const pu=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function mu(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!pu.has(t)&&qo(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=vc(n,i))}var hu=class extends Yc{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=Vl(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Kl.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=du(r),o=du(i);if(vo(r)!==vo(i)&&Bc[n]){this.needsMeasurement=!0;return}if(a!==o){if(Pc(a)&&Pc(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Bc[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||fu(e[t]))&&n.push(t);n.length&&mu(e,n,t)}measure(){let{element:e,name:t}=this;return Bc[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 gu=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function _u(e){return ja(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function vu(e){return ja(e)&&`ownerSVGElement`in e}const yu=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function bu(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 xu={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Su=Mc.length;function Cu(e,t,n){let r=``,i=!0;for(let a=0;a<Su;a++){let o=Mc[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=yu(s,mc[o]);if(!c){i=!1;let t=xu[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${yu(a,mc.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function wu(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(Nc.has(e)){o=!0;continue}if(mo(e)){i[e]=n;continue}{let t=yu(n,mc[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Cu(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 Tu={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Eu={offset:`strokeDashoffset`,array:`strokeDasharray`};function Du(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Tu:Eu;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Ou=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function ku(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(wu(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 Ou)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&&Du(d,i,a,o,!1)}function Au({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ju({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Mu(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 Nu(e){return e===void 0||e===1}function Pu({scale:e,scaleX:t,scaleY:n}){return!Nu(e)||!Nu(t)||!Nu(n)}function Fu(e){return Pu(e)||Iu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Iu(e){return Lu(e.x)||Lu(e.y)}function Lu(e){return e&&e!==`0%`}function Ru(e,t,n){return n+t*(e-n)}function zu(e,t,n,r,i){return i!==void 0&&(e=Ru(e,i,r)),Ru(e,n,r)+t}function Bu(e,t=0,n=1,r,i){e.min=zu(e.min,t,n,r,i),e.max=zu(e.max,t,n,r,i)}function Vu(e,{x:t,y:n}){Bu(e.x,t.translate,t.scale,t.originPoint),Bu(e.y,n.translate,n.scale,n.originPoint)}const Hu=.999999999999,Uu=1.0000000000001;function Wu(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&&(Gu(e.x,-a.scroll.offset.x),Gu(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Vu(e,o)),r&&Fu(a.latestValues)&&Ju(e,a.latestValues,a.layout?.layoutBox))}t.x<Uu&&t.x>Hu&&(t.x=1),t.y<Uu&&t.y>Hu&&(t.y=1)}function Gu(e,t){e.min+=t,e.max+=t}function Ku(e,t,n,r,i=.5){Bu(e,t,n,J(e.min,e.max,i),r)}function qu(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Ju(e,t,n){let r=n??e;Ku(e.x,qu(t.x,r.x),t.scaleX,t.scale,t.originX),Ku(e.y,qu(t.y,r.y),t.scaleY,t.scale,t.originY)}function Yu(e,t){return Au(Mu(e.getBoundingClientRect(),t))}function Xu(e,t,n){let r=Yu(e,n),{scroll:i}=t;return i&&(Gu(r.x,i.offset.x),Gu(r.y,i.offset.y)),r}const{schedule:Zu,cancel:Qu}=/* @__PURE__ */ Cs(queueMicrotask,!1),$u={x:!1,y:!1};function ed(){return $u.x||$u.y}function td(e){return e===`x`||e===`y`?$u[e]?null:($u[e]=!0,()=>{$u[e]=!1}):$u.x||$u.y?null:($u.x=$u.y=!0,()=>{$u.x=$u.y=!1})}function nd(e,t){let n=bu(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function rd(e){return!(e.pointerType===`touch`||ed())}function id(e,t,n={}){let[r,i,a]=nd(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(!rd(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 ad=(e,t)=>t?e===t||ad(e,t.parentElement):!1,od=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,sd=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function cd(e){return sd.has(e.tagName)||e.isContentEditable===!0}const ld=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function ud(e){return ld.has(e.tagName)||e.isContentEditable===!0}const dd=/* @__PURE__ */ new WeakSet;function fd(e){return t=>{t.key===`Enter`&&e(t)}}function pd(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const md=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=fd(()=>{if(dd.has(n))return;pd(n,`down`);let e=fd(()=>{pd(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>pd(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function hd(e){return od(e)&&!ed()}const gd=/* @__PURE__ */ new WeakSet;function _d(e,t,n={}){let[r,i,a]=nd(e,n),o=e=>{let r=e.currentTarget;if(!hd(e)||gd.has(e))return;dd.add(r),n.stopPropagation&&gd.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),dd.has(r)&&dd.delete(r),hd(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||ad(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),_u(e)&&(e.addEventListener(`focus`,e=>md(e,i)),!cd(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}const vd=/* @__PURE__ */ new WeakMap;let yd;const bd=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:vu(r)&&`getBBox`in r?r.getBBox()[t]:r[n],xd=/*@__PURE__*/ bd(`inline`,`width`,`offsetWidth`),Sd=/*@__PURE__*/ bd(`block`,`height`,`offsetHeight`);function Cd({target:e,borderBoxSize:t}){vd.get(e)?.forEach(n=>{n(e,{get width(){return xd(e,t)},get height(){return Sd(e,t)}})})}function wd(e){e.forEach(Cd)}function Td(){typeof ResizeObserver<`u`&&(yd=new ResizeObserver(wd))}function Ed(e,t){yd||Td();let n=bu(e);return n.forEach(e=>{let n=vd.get(e);n||(n=/* @__PURE__ */ new Set,vd.set(e,n)),n.add(t),yd?.observe(e)}),()=>{n.forEach(e=>{let n=vd.get(e);n?.delete(t),n?.size||yd?.unobserve(e)})}}const Dd=/* @__PURE__ */ new Set;let Od;function kd(){Od=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Dd.forEach(t=>t(e))},window.addEventListener(`resize`,Od)}function Ad(e){return Dd.add(e),Od||kd(),()=>{Dd.delete(e),!Dd.size&&typeof Od==`function`&&(window.removeEventListener(`resize`,Od),Od=void 0)}}function jd(e,t){return typeof e==`function`?Ad(e):Ed(e,t)}const Md={value:null,addProjectionMetrics:null};function Nd(e){return vu(e)&&e.tagName===`svg`}const Pd=e=>typeof e==`number`?e:parseFloat(e),Fd=()=>({translate:0,scale:1,origin:0,originPoint:0}),Id=()=>({x:Fd(),y:Fd()}),Ld=()=>({min:0,max:0}),Rd=()=>({x:Ld(),y:Ld()}),zd=/* @__PURE__ */ new WeakMap;function Bd(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Vd(e){return typeof e==`string`||Array.isArray(e)}const Hd=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Ud=[`initial`,...Hd];function Wd(e){if(Bd(e.animate))return!0;for(let t=0;t<Ud.length;t++)if(Vd(e[Ud[t]]))return!0;return!1}function Gd(e){return!!(Wd(e)||e.variants)}function Kd(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Zl(i))e.addValue(r,i);else if(Zl(a))e.addValue(r,Ol(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,Ol(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const qd={current:null},Jd={current:!1},Yd=typeof window<`u`;function Xd(){if(Jd.current=!0,Yd){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>qd.current=e.matches;e.addEventListener(`change`,t),t()}else qd.current=!1}}const Zd=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let Qd={};function $d(e){Qd=e}function ef(){return Qd}var tf=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=Yc,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=Wd(t),this.isVariantNode=Gd(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&&Zl(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,zd.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:(Jd.current||Xd(),this.shouldReduceMotion=qd.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(),ws(this.notifyUpdate),ws(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&&_l.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new cl({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ Ra(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Nc.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 Qd){let t=Qd[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):Rd()}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<Zd.length;t++){let n=Zd[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=Kd(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=Ol(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`&&(Aa(n)||Ma(n))?n=parseFloat(n):typeof n!=`number`&&!ts.test(n)&&ts.test(t)&&(n=vc(e,t)),this.setBaseTarget(e,Zl(n)?n.get():n)),Zl(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new La),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Zu.render(this.render)}},nf=class extends tf{constructor(){super(...arguments),this.KeyframeResolver=hu}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;Zl(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},rf=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function af(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 of={};function sf(e,{layout:t,layoutId:n}){return Nc.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!of[e]||e===`opacity`)}function cf(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Zl(r[t])||i&&Zl(i[t])||sf(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function lf(e){return window.getComputedStyle(e)}var uf=class extends nf{constructor(){super(...arguments),this.type=`html`,this.renderInstance=af}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Nc.has(t))return this.projection?.isProjecting?Oc(t):Ac(e,t);{let n=lf(e),r=(mo(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Yu(e,t)}build(e,t,n){wu(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return cf(e,t,n)}};const df=/* @__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`]),ff=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function pf(e,t,n,r){af(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(df.has(n)?n:eu(n),t.attrs[n])}function mf(e,t,n){let r=cf(e,t,n);for(let n in e)if(Zl(e[n])||Zl(t[n])){let t=Mc.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var hf=class extends nf{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Rd}getBaseTargetFromProps(e,t){return Nc.has(t)?super.getBaseTargetFromProps(e,t)??Oc(t):e[t]}getDefaultValue(e){return Nc.has(e)?this.latestValues[e]??Oc(e):void 0}readValueFromInstance(e,t){if(Nc.has(t)){let e=gc(t);return e&&e.default||0}if(Ou.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=df.has(t)?t:eu(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return mf(e,t,n)}build(e,t,n){ku(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){pf(e,t,n,r)}mount(e){this.isSVGTag=ff(e.tagName),super.mount(e)}};function gf(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 _f=[...Hd].reverse();function vf(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>su(e,t,n))),n=bf(),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(_f.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?Vd(g)||g===!1?g:void 0:h,v=Vd(_),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||Bd(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=yf(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}=Wl(e,n,Gl(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)?!gf(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=Wl(s,n)?.transition?.delayChildren;r.delay=wl(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&Wl(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&&!Zl(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=bf(),i=!0}}}function yf(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!gf(t,e):!1}function bf(){let e={};for(let t of Hd)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function xf(e,t){e.min=t.min,e.max=t.max}function Sf(e,t){xf(e.x,t.x),xf(e.y,t.y)}function Cf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function wf(e){return e.max-e.min}function Tf(e,t,n){return Math.abs(e-t)<=n}function Ef(e,t,n,r=.5){e.origin=r,e.originPoint=J(t.min,t.max,e.origin),e.scale=wf(n)/wf(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 Df(e,t,n,r){Ef(e.x,t.x,n.x,r?r.originX:void 0),Ef(e.y,t.y,n.y,r?r.originY:void 0)}function Of(e,t,n,r=0){e.min=(r?J(n.min,n.max,r):n.min)+t.min,e.max=e.min+wf(t)}function kf(e,t,n,r){Of(e.x,t.x,n.x,r?.x),Of(e.y,t.y,n.y,r?.y)}function Af(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+wf(t)}function jf(e,t,n,r){Af(e.x,t.x,n.x,r?.x),Af(e.y,t.y,n.y,r?.y)}function Mf(e,t,n,r,i){return e-=t,e=Ru(e,1/n,r),i!==void 0&&(e=Ru(e,1/i,r)),e}function Nf(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=Mf(e.min,t,n,s,i),e.max=Mf(e.max,t,n,s,i)}function Pf(e,t,[n,r,i],a,o){Nf(e,t[n],t[r],t[i],t.scale,a,o)}const Ff=[`x`,`scaleX`,`originX`],If=[`y`,`scaleY`,`originY`];function Lf(e,t,n,r){Pf(e.x,t,Ff,n?n.x:void 0,r?r.x:void 0),Pf(e.y,t,If,n?n.y:void 0,r?r.y:void 0)}function Rf(e){return e.translate===0&&e.scale===1}function zf(e){return Rf(e.x)&&Rf(e.y)}function Bf(e,t){return e.min===t.min&&e.max===t.max}function Vf(e,t){return Bf(e.x,t.x)&&Bf(e.y,t.y)}function Hf(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Uf(e,t){return Hf(e.x,t.x)&&Hf(e.y,t.y)}function Wf(e){return wf(e.x)/wf(e.y)}function Gf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Kf(e){return[e(`x`),e(`y`)]}function qf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Jf={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(q.test(e))e=parseFloat(e);else return e}return`${qf(e,t.target.x)}% ${qf(e,t.target.y)}%`}},Yf={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=ts.parse(e);if(i.length>5)return r;let a=ts.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 Xf(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 Zf=gu.length,Qf=e=>typeof e==`number`||q.test(e);function $f(e,t,n,r,i,a){i?(e.opacity=J(0,n.opacity??1,tp(r)),e.opacityExit=J(t.opacity??1,0,np(r))):a&&(e.opacity=J(t.opacity??1,n.opacity??1,r));for(let i=0;i<Zf;i++){let a=gu[i],o=ep(t,a),s=ep(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Qf(o)===Qf(s)?(e[a]=Math.max(J(Pd(o),Pd(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 ep(e,t){return e[t]===void 0?e.borderRadius:e[t]}const tp=/*@__PURE__*/ rp(0,.5,Za),np=/*@__PURE__*/ rp(.5,.95,Pa);function rp(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ Ia(e,t,r))}function ip(e,t,n){let r=Zl(e)?e:Ol(e);return r.start(Rl(``,r,t,n)),r.animation}function ap(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const op=(e,t)=>e.depth-t.depth;var sp=class{constructor(){this.children=[],this.isDirty=!1}add(e){Ea(this.children,e),this.isDirty=!0}remove(e){Da(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(op),this.isDirty=!1,this.children.forEach(e)}};function cp(e,t){let n=uo.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(ws(r),e(a-t))};return Y.setup(r,!0),()=>ws(r)}function lp(e){return Zl(e)?e.get():e}var up=class{constructor(){this.members=[]}add(e){Ea(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&&(Da(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Da(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 dp={borderRadius:{...Jf,applyTo:[...gu]},borderTopLeftRadius:Jf,borderTopRightRadius:Jf,borderBottomLeftRadius:Jf,borderBottomRightRadius:Jf,boxShadow:Yf},fp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(of,{...dp,...of});const pp={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},mp=[``,`X`,`Y`,`Z`];let hp=0;function gp(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function _p(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=nu(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&&_p(r)}function vp({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=hp++,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,Md.value&&(pp.nodes=pp.calculatedTargetDeltas=pp.calculatedProjections=0),this.nodes.forEach(xp),this.nodes.forEach(jp),this.nodes.forEach(Mp),this.nodes.forEach(Sp),Md.addProjectionMetrics&&Md.addProjectionMetrics(pp)},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 sp)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new La),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=vu(t)&&!Nd(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=cp(i,250),fp.hasAnimatedSinceResize&&(fp.hasAnimatedSinceResize=!1,this.nodes.forEach(Ap)))})}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()||zp,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Uf(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={...Al(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||Ap(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(),ws(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(Np),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&&_p(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(Tp),this.nodes.forEach(wp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ep);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Dp),this.nodes.forEach(Op),this.nodes.forEach(kp),this.nodes.forEach(yp),this.nodes.forEach(bp)):this.nodes.forEach(Ep),this.clearAllSnapshots();let e=uo.now();so.delta=Oa(0,1e3/60,e-so.timestamp),so.timestamp=e,so.isProcessing=!0,Ts.update.process(so),Ts.preRender.process(so),Ts.render.process(so),so.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Zu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Cp),this.sharedNodes.forEach(Pp)}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&&!wf(this.snapshot.measuredBox.x)&&!wf(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||=Rd(),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&&!zf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Fu(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)),Up(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Rd();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Gp))){let{scroll:e}=this.root;e&&(Gu(t.x,e.offset.x),Gu(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Rd();if(Sf(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&&Sf(t,e),Gu(t.x,i.offset.x),Gu(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Rd();Sf(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&&(Gu(r.x,-n.scroll.offset.x),Gu(r.y,-n.scroll.offset.y)),Fu(n.latestValues)&&Ju(r,n.latestValues,n.layout?.layoutBox)}return Fu(this.latestValues)&&Ju(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Rd();Sf(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Fu(n.latestValues))continue;let r;n.instance&&(Pu(n.latestValues)&&n.updateSnapshot(),r=Rd(),Sf(r,n.measurePageBox())),Lf(t,n.latestValues,n.snapshot?.layoutBox,r)}return Fu(this.latestValues)&&Lf(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!==so.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=so.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=Rd(),this.targetWithTransforms=Rd()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),kf(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Sf(this.target,this.layout.layoutBox),Vu(this.target,this.targetDelta)):Sf(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),Md.value&&pp.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Pu(this.parent.latestValues)||Iu(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=Rd(),this.relativeTargetOrigin=Rd(),jf(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Sf(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===so.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;Sf(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Wu(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=Rd());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cf(this.prevProjectionDelta.x,this.projectionDelta.x),Cf(this.prevProjectionDelta.y,this.projectionDelta.y)),Df(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Gf(this.projectionDelta.x,this.prevProjectionDelta.x)||!Gf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Md.value&&pp.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=Id(),this.projectionDelta=Id(),this.projectionDeltaWithTransform=Id()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Id();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Rd(),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(Rp));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):(Fp(o.x,e.x,n),Fp(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(jf(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Lp(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Vf(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Rd(),Sf(f,this.relativeTarget)),c&&(this.animationValues=a,$f(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&&=(ws(this.pendingAnimation),void 0),this.pendingAnimation=Y.update(()=>{fp.hasAnimatedSinceResize=!0,this.motionValue||=Ol(0),this.motionValue.jump(0,!1),this.currentAnimation=ip(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&&Wp(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Rd();let t=wf(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=wf(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}Sf(t,i),Ju(t,r),Df(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new up),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&&gp(`z`,e,r,this.animationValues);for(let t=0;t<mp.length;t++)gp(`rotate${mp[t]}`,e,r,this.animationValues),gp(`skew${mp[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=lp(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=lp(t?.pointerEvents)||``),this.hasProjected&&!Fu(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Xf(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 of){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=of[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?lp(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(wp),this.root.sharedNodes.clear()}}}function yp(e){e.updateLayout()}function bp(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`)Kf(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=wf(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;xf(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Wp(i,t.layoutBox,n)&&Kf(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=wf(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=Id();Df(o,n,t.layoutBox);let s=Id();a?Df(s,e.applyTransform(r,!0),t.measuredBox):Df(s,n,t.layoutBox);let c=!zf(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=Rd();jf(s,t.layoutBox,i.layoutBox,o);let c=Rd();jf(c,n,a.layoutBox,o),Uf(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 xp(e){Md.value&&pp.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 Sp(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Cp(e){e.clearSnapshot()}function wp(e){e.clearMeasurements()}function Tp(e){e.isLayoutDirty=!0,e.updateLayout()}function Ep(e){e.isLayoutDirty=!1}function Dp(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Op(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function kp(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Ap(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function jp(e){e.resolveTargetDelta()}function Mp(e){e.calcProjection()}function Np(e){e.resetSkewAndRotation()}function Pp(e){e.removeLeadSnapshot()}function Fp(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 Ip(e,t,n,r){e.min=J(t.min,n.min,r),e.max=J(t.max,n.max,r)}function Lp(e,t,n,r){Ip(e.x,t.x,n.x,r),Ip(e.y,t.y,n.y,r)}function Rp(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const zp={duration:.45,ease:[.4,0,.1,1]},Bp=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Vp=Bp(`applewebkit/`)&&!Bp(`chrome/`)?Math.round:Pa;function Hp(e){e.min=Vp(e.min),e.max=Vp(e.max)}function Up(e){Hp(e.x),Hp(e.y)}function Wp(e,t,n){return e===`position`||e===`preserve-aspect`&&!Tf(Wf(t),Wf(n),.2)}function Gp(e){return e!==e.root&&e.scroll?.wasRoot}const Kp=vp({attachResizeListener:(e,t)=>ap(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),qp={current:void 0},Jp=vp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qp.current){let e=new Kp({});e.mount(window),e.setOptions({layoutScroll:!0}),qp.current=e}return qp.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Yp=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Xp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Zp(...e){return t=>{let n=!1,r=e.map(e=>{let r=Xp(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():Xp(e[t],null)}}}}function Qp(...e){return a.useCallback(Zp(...e),e)}var $p=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(_u(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=_u(e)&&e.offsetWidth||0,r=_u(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 em({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(Yp),f=Qp(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(`
|
|
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`),b.contains(y)&&b.removeChild(y)}},[n]),t($p,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:a.cloneElement(e,{ref:f})})}const tm=({children:e,initial:n,isPresent:r,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=Ca(nm),p=v(),m=C(r),h=C(i);wa(()=>{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(em,{pop:c===`popLayout`,isPresent:r,anchorX:l,anchorY:u,root:d,children:e}),t(Ta.Provider,{value:_,children:e})};function nm(){return/* @__PURE__ */ new Map}function rm(e=!0){let t=g(Ta);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 im=e=>e.key||``;function am(e){let t=[];return s.forEach(e,e=>{m(e)&&t.push(e)}),t}const om=({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]=rm(c),m=S(()=>am(n),[n]),h=c&&!f?[]:m.map(im),_=C(!0),v=Ca(()=>/* @__PURE__ */ new Map),y=C(/* @__PURE__ */ new Set),[b,x]=w(m),[T,E]=w(m);wa(()=>{c&&!f&&!T.length&&p?.()},[f,c,T.length,p]),wa(()=>{_.current=!1;for(let e=0;e<T.length;e++){let t=im(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(im(n));r===-1?(e.splice(t++,0,n),D.push(n)):t=r+D.length+1}return D.every(e=>v.get(im(e)))?e=m:s===`wait`&&(e=D),E(am(e)),x(m),null}let{forceRender:O}=g(Sa);return t(e,{children:T.map(e=>{let n=im(e),g=c&&!f?!1:m===T||h.includes(n);return t(tm,{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 lm=!1;function um(){if(lm)return;let e={};for(let t in cm)e[t]={isEnabled:e=>cm[t].some(t=>!!e[t])};$d(e),lm=!0}function dm(){return um(),ef()}function fm(e){let t=dm();for(let n in e)t[n]={...t[n],...e[n]};$d(t)}const pm=/* @__PURE__ */ d({});function mm(e,t){if(Wd(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Vd(t)?t:void 0,animate:Vd(n)?n:void 0}}return e.inherit===!1?{}:t}function hm(e){let{initial:t,animate:n}=mm(e,g(pm));return S(()=>({initial:t,animate:n}),[gm(t),gm(n)])}function gm(e){return Array.isArray(e)?e.join(` `):e}const _m=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function vm(e,t,n){for(let r in t)!Zl(t[r])&&!sf(r,n)&&(e[r]=t[r])}function ym({transformTemplate:e},t){return S(()=>{let n=_m();return wu(n,t,e),Object.assign({},n.vars,n.style)},[t])}function bm(e,t){let n=e.style||{},r={};return vm(r,n,e),Object.assign(r,ym(e,t)),r}function xm(e,t){let n={},r=bm(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 Sm=()=>({..._m(),attrs:{}});function Cm(e,t,n,r){let i=S(()=>{let n=Sm();return ku(n,t,ff(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};vm(t,e.style,e),i.style={...t,...i.style}}return i}const wm=/* @__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 Tm(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||wm.has(e)}function Em(e,t){return e.startsWith(`on`)?!Tm(e):t?.(e)??!Tm(e)}function Dm(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(Zl(e[a])||(Em(a,r)||n===!0&&Tm(a)||!t&&!Tm(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}const Om=[`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 km(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Om.indexOf(e)>-1||/[A-Z]/u.test(e))}function Am(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??km(e)?Cm:xm)(t,r,i,e),u=Dm(t,typeof e==`string`,a,s),d=e===l?{}:{...u,...c,ref:n},{children:p}=t,m=S(()=>Zl(p)?p.get():p,[p]);return f(e,{...d,children:m})}function jm({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Mm(n,r,i,e),renderState:t()}}function Mm(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=lp(a[e]);let{initial:o,animate:s}=e,c=Wd(e),l=Gd(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`&&!Bd(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Ul(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 Nm=e=>(t,n)=>{let r=g(pm),i=g(Ta),a=()=>jm(e,t,r,i);return n?a():Ca(a)},Pm=/*@__PURE__*/ Nm({scrapeMotionValuesFromProps:cf,createRenderState:_m}),Fm=/*@__PURE__*/ Nm({scrapeMotionValuesFromProps:mf,createRenderState:Sm}),Im=Symbol.for(`motionComponentSymbol`);function Lm(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 Rm=d({});function zm(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Bm(e,t,n,r,i,a){let{visualElement:o}=g(pm),s=g(sm),c=g(Ta),l=g(Yp),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(Rm);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Vm(f.current,n,i,h);let v=C(!1);b(()=>{m&&v.current&&m.update(n,c)});let y=n[tu],x=C(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return wa(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),wa(()=>{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 Vm(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:Hm(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&zm(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Hm(e){if(e)return e.options.allowProjection===!1?Hm(e.parent):e.projection}function Um(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&fm(a);let s=i?i===`svg`:km(e),c=s?Fm:Pm;function l(i,l){let u,d={...g(Yp),...i,layoutId:Wm(i)},{isStatic:f,isValidProp:p}=d,m=hm(i),h=c(i,f);if(!f&&typeof window<`u`){Gm(d,a);let t=Km(d);u=t.MeasureLayout,m.visualElement=Bm(e,h,d,o,t.ProjectionNode,s)}return n(pm.Provider,{value:m,children:[u&&m.visualElement?t(u,{visualElement:m.visualElement,...d}):null,Am(e,i,Lm(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[Im]=e,u}function Wm({layoutId:e}){let t=g(Sa).id;return t&&e!==void 0?t+`-`+e:e}function Gm(e,t){g(sm).strict}function Km(e){let{drag:t,layout:n}=dm();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function qm(e,t){if(typeof Proxy>`u`)return Um;let n=/* @__PURE__ */ new Map,r=(n,r)=>Um(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Um(a,void 0,e,t)),n.get(a))})}const Jm=(e,t)=>t.isSVG??km(e)?new hf(t):new uf(t,{allowProjection:e!==l});var Ym=class extends rf{constructor(e){super(e),e.animationState||=vf(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Bd(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 Xm=0;const Zm={animation:{Feature:Ym},exit:{Feature:class extends rf{constructor(){super(...arguments),this.id=Xm++}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}=Wl(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 Qm(e){return{point:{x:e.pageX,y:e.pageY}}}const $m=e=>t=>od(t)&&e(t,Qm(t));function eh(e,t,n,r){return ap(e,t,$m(n),r)}const th=({current:e})=>e?e.ownerDocument.defaultView:null,nh=(e,t)=>Math.abs(e-t);function rh(e,t){let n=nh(e.x,t.x),r=nh(e.y,t.y);return Math.sqrt(n**2+r**2)}const ih=/*#__PURE__*/ new Set([`auto`,`scroll`]);var ah=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=oh(this.lastRawMoveEventInfo,this.transformPagePoint));let e=ch(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=rh(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=oh(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:oh(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!od(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=oh(Qm(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=so;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,ch(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Fa(eh(this.contextWindow,`pointermove`,this.handlePointerMove,d),eh(this.contextWindow,`pointerup`,this.handlePointerUp,d),eh(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(ih.has(e.overflowX)||ih.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(),ws(this.updatePoint)}};function oh(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,uh(t)),offset:sh(e,lh(t)),velocity:dh(t,.1)}}function lh(e){return e[0]}function uh(e){return e[e.length-1]}function dh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=uh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ Ra(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ Ra(t)*2&&(r=e[1]);let a=/* @__PURE__ */ za(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 fh(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 ph(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 mh(e,{top:t,left:n,bottom:r,right:i}){return{x:ph(e.x,n,i),y:ph(e.y,t,r)}}function hh(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 gh(e,t){return{x:hh(e.x,t.x),y:hh(e.y,t.y)}}function _h(e,t){let n=.5,r=wf(e),i=wf(t);return i>r?n=/* @__PURE__ */ Ia(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ Ia(e.min,e.max-i,t.min)),Oa(0,1,n)}function vh(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 yh=.35;function bh(e=yh){return e===!1?e=0:e===!0&&(e=yh),{x:xh(e,`left`,`right`),y:xh(e,`top`,`bottom`)}}function xh(e,t,n){return{min:Sh(e,t),max:Sh(e,n)}}function Sh(e,t){return typeof e==`number`?e:e[t]||0}const Ch=/* @__PURE__ */ new WeakMap;var wh=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=Rd(),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=td(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),Kf(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=wf(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Y.update(()=>i(e,t),!1,!0),$l(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=Oh(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 ah(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:th(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||!Dh(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=fh(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&&zm(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?mh(n.layoutBox,e):!1,this.elastic=bh(t),r!==this.constraints&&!zm(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Kf(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=vh(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!zm(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=Xu(n,r.root,this.visualElement.getTransformPagePoint()),a=gh(r.layout.layoutBox,i);if(t){let e=t(ju(a));this.hasMutatedConstraints=!!e,e&&(a=Au(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Kf(o=>{if(!Dh(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 $l(this.visualElement,e),n.start(Rl(e,n,0,t,this.visualElement,!1))}stopAnimation(){Kf(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();Kf(e=>{if(!Dh(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(!zm(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Kf(e=>{let t=this.getAxisMotionValue(e).get();i[e]=_h({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(),Kf(t=>{let n=this.getAxisMotionValue(t);if(!Dh(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;Ch.set(this.visualElement,this);let e=this.visualElement.current,t=eh(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&ud(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();zm(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Eh(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=ap(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Kf(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=yh,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Th(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Eh(e,t,n){let r=jd(e,Th(n)),i=jd(t,Th(n));return()=>{r(),i()}}function Dh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Oh(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var kh=class extends rf{constructor(e){super(e),this.removeGroupControls=Pa,this.removeListeners=Pa,this.controls=new wh(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Pa}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 Ah=e=>(t,n)=>{e&&Y.update(()=>e(t,n),!1,!0)};var jh=class extends rf{constructor(){super(...arguments),this.removePointerDownListener=Pa}onPointerDown(e){this.session=new ah(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:th(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ah(e),onStart:Ah(t),onMove:Ah(n),onEnd:(e,t)=>{delete this.session,r&&Y.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=eh(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 Mh=!1;var Nh=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),Mh&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),fp.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}),Mh=!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(),Zu.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Mh=!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 Ph(e){let[n,r]=rm(),i=g(Sa);return t(Nh,{...e,layoutGroup:i,switchLayoutGroup:g(Rm),isPresent:n,safeToRemove:r})}const Fh={pan:{Feature:jh},drag:{Feature:kh,ProjectionNode:Jp,MeasureLayout:Ph}};function Ih(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,Qm(t)))}var Lh=class extends rf{mount(){let{current:e}=this.node;e&&(this.unmount=id(e,(e,t)=>(Ih(this.node,t,`Start`),e=>Ih(this.node,e,`End`))))}unmount(){}},Rh=class extends rf{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=Fa(ap(this.node.current,`focus`,()=>this.onFocus()),ap(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function zh(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,Qm(t)))}var Bh=class extends rf{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=_d(e,(e,t)=>(zh(this.node,t,`Start`),(e,{success:t})=>zh(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const Vh=/* @__PURE__ */ new WeakMap,Hh=/* @__PURE__ */ new WeakMap,Uh=e=>{let t=Vh.get(e.target);t&&t(e)},Wh=e=>{e.forEach(Uh)};function Gh({root:e,...t}){let n=e||document;Hh.has(n)||Hh.set(n,{});let r=Hh.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Wh,{root:e,...t})),r[i]}function Kh(e,t,n){let r=Gh(t);return Vh.set(e,n),r.observe(e),()=>{Vh.delete(e),r.unobserve(e)}}const qh={some:0,all:1};var Jh=class extends rf{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:qh[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=Kh(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(Yh(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Yh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Xh={inView:{Feature:Jh},tap:{Feature:Bh},focus:{Feature:Rh},hover:{Feature:Lh}},Zh={layout:{ProjectionNode:Jp,MeasureLayout:Ph}},Qh=/*@__PURE__*/ qm({...Zm,...Xh,...Fh,...Zh},Jm);function $h({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=eg(o),b=tg(o,s,c);return n(`div`,{className:`flex items-center justify-center w-full ${i}`,children:[t(K,{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(Qh.div,{...y,transition:m,className:`${b} ${a}`,children:[l&&t(`div`,{className:`absolute top-2 end-2 z-10`,children:t(K,{onClick:v,variant:`primary`,children:t(St,{})})}),t(`div`,{className:l?`mt-8`:``,children:r})]})})]})}function eg(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 tg(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 ng=`--tailwind-portal`;function rg({children:e}){let n=C(null),[r,i]=w(null);return _(()=>{if(n.current){let e=n.current.ownerDocument,t=e.getElementById(ng);t||(t=e.createElement(`DIV`),t.id=ng,e.body.appendChild(t)),i(t)}},[]),r?E(e,r):t(`span`,{ref:n})}function ig({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(lg,{onClick:e.onClick,href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):e.href?t(lg,{href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):t(ug,{children:n})};if(s.length<=r)return t(ag,{className:H(`w-full flex items-center`,i),children:t(og,{children:s.map((e,r)=>n(a.Fragment,{children:[t(sg,{children:c(e)}),r<s.length-1&&t(dg,{children:o??t(Be,{className:`cn-rtl-flip`})})]},`crumb-${r}`))})});let l=s.slice(-(r-1));return t(ag,{className:H(`w-full flex items-center`,i),children:n(og,{children:[t(sg,{children:t(fg,{})}),t(dg,{children:o??t(Be,{className:`cn-rtl-flip`})}),l.map((e,r)=>n(a.Fragment,{children:[t(sg,{children:c(e)}),r<l.length-1&&t(dg,{children:o??t(Be,{className:`cn-rtl-flip`})})]},`crumb-${r}`))]})})}const ag=a.forwardRef(({...e},n)=>t(`nav`,{ref:n,"aria-label":`breadcrumb`,...e}));ag.displayName=`Breadcrumb`;const og=a.forwardRef(({className:e,...n},r)=>t(`ol`,{ref:r,className:H(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted sm:gap-2.5`,e),...n}));og.displayName=`BreadcrumbList`;const sg=a.forwardRef(({className:e,...n},r)=>t(`li`,{ref:r,className:H(`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:H(`transition-colors hover:text-muted`,n),...r}));cg.displayName=`BreadcrumbLink`;const lg=a.forwardRef(({className:e,href:n,onClick:r,...i},a)=>t(K,{variant:`ghost`,size:`md`,ref:a,className:H(`p-0! hover:underline! hover:bg-background!`,e),onClick:e=>{e.preventDefault(),r&&r(e)},...i}));lg.displayName=`BreadcrumbButton`;const ug=a.forwardRef(({className:e,...n},r)=>t(`span`,{ref:r,"aria-current":`page`,className:H(`font-normal text-foreground`,e),...n}));ug.displayName=`BreadcrumbPage`;const dg=({children:e,className:n,...r})=>t(`li`,{role:`presentation`,"aria-hidden":`true`,className:H(`[&>svg]:w-3.5 [&>svg]:h-3.5`,n),...r,children:e??t(Be,{className:`cn-rtl-flip`})});dg.displayName=`BreadcrumbSeparator`;const fg=({className:e,...r})=>n(`span`,{role:`presentation`,"aria-hidden":`true`,className:H(`flex h-9 w-9 items-center justify-center`,e),...r,children:[t(et,{className:`h-4 w-4`}),t(`span`,{className:`sr-only`,children:`More`})]});fg.displayName=`BreadcrumbEllipsis`;const pg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`rounded-xl border bg-card text-card-foreground shadow`,e),...n}));pg.displayName=`Card`;const mg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`flex flex-col p-6`,e),...n}));mg.displayName=`CardHeader`;const hg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`font-semibold leading-none tracking-tight`,e),...n}));hg.displayName=`CardTitle`;const gg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`text-sm text-muted`,e),...n}));gg.displayName=`CardDescription`;const _g=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`p-6 pt-0`,e),...n}));_g.displayName=`CardContent`;const vg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:H(`flex items-center p-6 pt-0`,e),...n}));vg.displayName=`CardFooter`;var yg=Object.defineProperty,bg=(e,t)=>yg(e,`name`,{value:t,configurable:!0}),xg=`Checkbox`,[Sg,Cg]=/* @__PURE__ */ Mn(xg),[wg,Tg]=Sg(xg);function Eg(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]=qr({prop:r,defaultProp:o??!1,onChange:u,caller:xg}),[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:!Fg(o)&&o,isFormControl:S,bubbleInput:v,setBubbleInput:y};return/* @__PURE__ */ t(wg,{scope:n,...C,children:Pg(p)?p(C):i})}bg(Eg,`CheckboxProvider`);var Dg=`CheckboxTrigger`,Og=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bg(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}=Tg(Dg,e),_=V(o,f),v=a.useRef(u);return a.useEffect(()=>{let e=s?.form;if(e){let t=/* @__PURE__ */ bg(()=>p(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,p]),/* @__PURE__ */ t(G.button,{type:`button`,role:`checkbox`,"aria-checked":Fg(u)?`mixed`:u,"aria-required":d,"data-state":Ig(u),"data-disabled":l?``:void 0,disabled:l,value:c,...i,ref:_,onKeyDown:U(n,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:U(r,e=>{let t=e.isPropagationStopped();m({requestedChecked:Fg(u)?!0:!u,hasConsumerStoppedPropagation:t}),p(e=>Fg(e)?!0:!e),g&&h&&(t||e.stopPropagation())})})},`CheckboxTrigger`)),kg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bg(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(Eg,{__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(Og,{...m,ref:i,__scopeCheckbox:a}),r&&/* @__PURE__ */ t(Ng,{__scopeCheckbox:a})]})})},`Checkbox`)),Ag=`CheckboxIndicator`,jg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bg(function(e,n){let{__scopeCheckbox:r,forceMount:i,...a}=e,o=Tg(Ag,r);return/* @__PURE__ */ t(Nr,{present:i||Fg(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(G.span,{"data-state":Ig(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Mg=`CheckboxBubbleInput`,Ng=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bg(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}=Tg(Mg,e),_=V(i,g),v=cr(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=Fg(c),n.call(e,!Fg(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=Fg(c),n.call(e,!Fg(c)&&c),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),y.current=!1}},[h,c,s]);let C=a.useRef(!Fg(c)&&c);return/* @__PURE__ */ t(G.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:U(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function Pg(e){return typeof e==`function`}bg(Pg,`isFunction`);function Fg(e){return e===`indeterminate`}bg(Fg,`isIndeterminate`);function Ig(e){return Fg(e)?`indeterminate`:e?`checked`:`unchecked`}bg(Ig,`getState`);const Lg=a.forwardRef(({className:e,...n},r)=>t(kg,{ref:r,className:H(`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(jg,{className:H(`flex items-center justify-center text-current`),children:t(Ie,{className:`size-4`})})}));Lg.displayName=kg.displayName;var Rg=Object.defineProperty,zg=(e,t)=>Rg(e,`name`,{value:t,configurable:!0}),Bg=`Collapsible`,[Vg,Hg]=/* @__PURE__ */ Mn(Bg),[Ug,Wg]=Vg(Bg),Gg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ zg(function(e,n){let{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:s,onOpenChange:c,...l}=e,[u,d]=qr({prop:i,defaultProp:o??!1,onChange:c,caller:Bg});return/* @__PURE__ */ t(Ug,{scope:r,disabled:s,contentId:W(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:/* @__PURE__ */ t(G.div,{"data-state":Zg(u),"data-disabled":s?``:void 0,...l,ref:n})})},`Collapsible`)),Kg=`CollapsibleTrigger`,qg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ zg(function(e,n){let{__scopeCollapsible:r,...i}=e,a=Wg(Kg,r);return/* @__PURE__ */ t(G.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":Zg(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...i,ref:n,onClick:U(e.onClick,a.onOpenToggle)})},`CollapsibleTrigger`)),Jg=`CollapsibleContent`,Yg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ zg(function(e,n){let{forceMount:r,...i}=e,a=Wg(Jg,e.__scopeCollapsible);return/* @__PURE__ */ t(Nr,{present:r||a.open,children:({present:e})=>/* @__PURE__ */ t(Xg,{...i,ref:n,present:e})})},`CollapsibleContent`)),Xg=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ zg(function(e,n){let{__scopeCollapsible:r,present:i,children:o,...s}=e,c=Wg(Jg,r),[l,u]=a.useState(i),d=a.useRef(null),f=V(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)},[]),Pn(()=>{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(G.div,{"data-state":Zg(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 Zg(e){return e?`open`:`closed`}zg(Zg,`getState`);function Qg({...e}){return t(Gg,{"data-slot":`collapsible`,...e})}function $g({...e}){return t(qg,{"data-slot":`collapsible-trigger`,...e})}function e_({...e}){return t(Yg,{"data-slot":`collapsible-content`,...e})}var t_=1,n_=.9,r_=.8,i_=.17,a_=.1,o_=.999,s_=.9999,c_=.99,l_=/[\\\/_+.#"@\[\(\{&]/,u_=/[\\\/_+.#"@\[\(\{&]/g,d_=/[\s-]/,f_=/[\s-]/g;function p_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?t_: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=p_(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=t_:l_.test(e.charAt(l-1))?(d*=r_,p=e.slice(i,l-1).match(u_),p&&i>0&&(d*=o_**+p.length)):d_.test(e.charAt(l-1))?(d*=n_,m=e.slice(i,l-1).match(f_),m&&i>0&&(d*=o_**+m.length)):(d*=i_,i>0&&(d*=o_**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=s_)),(d<a_&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=p_(e,t,n,r,l+1,a+2,o),f*a_>d&&(d=f*a_)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function m_(e){return e.toLowerCase().replace(f_,` `)}function h_(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,p_(e,t,m_(e),m_(t),0,0,{})}var g_=Object.defineProperty,__=(e,t)=>g_(e,`name`,{value:t,configurable:!0}),v_=`Dialog`,[y_,b_]=/* @__PURE__ */ Mn(v_),[x_,S_]=y_(v_),C_=/* @__PURE__ */ __(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}=L(),[p,m]=qr({prop:i,defaultProp:o??!1,onChange:s,caller:v_}),[h,g]=a.useState(0),[_,v]=a.useState(0);return/* @__PURE__ */ t(x_,{scope:n,triggerRef:l,contentRef:u,contentId:W(),titleId:W(),descriptionId:W(),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`),w_=`DialogTrigger`,T_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,...i}=e,a=S_(w_,r),o=V(n,a.triggerRef);return/* @__PURE__ */ t(G.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":W_(a.open),...i,ref:o,onClick:U(e.onClick,a.onOpenToggle)})},`DialogTrigger`)),E_=`DialogPortal`,[D_,O_]=y_(E_,{forceMount:void 0}),k_=/* @__PURE__ */ __(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=S_(E_,n);return/* @__PURE__ */ t(D_,{scope:n,forceMount:r,children:a.Children.map(i,e=>/* @__PURE__ */ t(Nr,{present:r||s.open,children:/* @__PURE__ */ t(kr,{asChild:!0,container:o,children:e})}))})},`DialogPortal`),A_=`DialogOverlay`,j_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let r=O_(A_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=S_(A_,e.__scopeDialog);return o.modal?/* @__PURE__ */ t(Nr,{present:i||o.open,children:/* @__PURE__ */ t(N_,{...a,ref:n})}):null},`DialogOverlay`)),M_=/* @__PURE__ */ on(`DialogOverlay.RemoveScroll`),N_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,...i}=e,o=S_(A_,r),s=V(n,N());return/* @__PURE__ */ t(ue,{as:M_,allowPinchZoom:!0,shards:a.useMemo(()=>[o.contentRef,...o.branchNodes.map(e=>({current:e}))],[o.contentRef,o.branchNodes]),children:/* @__PURE__ */ t(G.div,{"data-state":W_(o.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),P_=`DialogContent`,F_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let r=O_(P_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=S_(P_,e.__scopeDialog);return/* @__PURE__ */ t(Nr,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(I_,{...a,ref:n}):/* @__PURE__ */ t(L_,{...a,ref:n})})},`DialogContent`)),I_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let r=S_(P_,e.__scopeDialog),i=a.useRef(null),o=V(n,r.contentRef,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(R_,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:U(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),L_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let r=S_(P_,e.__scopeDialog),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(R_,{...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`)),R_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,"aria-describedby":s,children:c,...l}=e,u=S_(P_,r);return le(),/* @__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?U_(s,u.descriptionId):s,"data-state":W_(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1),children:c})})})},`DialogContentImpl`)),z_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,...i}=e,a=S_(`DialogTitle`,r),{setTitleCount:o}=a;return Pn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(G.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),B_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,...i}=e,a=S_(`DialogDescription`,r),{setDescriptionCount:o}=a;return Pn(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),/* @__PURE__ */ t(G.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),V_=`DialogClose`,H_=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ __(function(e,n){let{__scopeDialog:r,...i}=e,a=S_(V_,r);return/* @__PURE__ */ t(G.button,{type:`button`,...i,ref:n,onClick:U(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function U_(...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}__(U_,`concatAriaDescribedby`);function W_(e){return e?`open`:`closed`}__(W_,`getState`);var G_=`[cmdk-group=""]`,K_=`[cmdk-group-items=""]`,q_=`[cmdk-group-heading=""]`,J_=`[cmdk-item=""]`,Y_=`${J_}:not([aria-disabled="true"])`,X_=`cmdk-item-select`,Z_=`data-value`,Q_=(e,t,n)=>h_(e,t,n),$_=a.createContext(void 0),ev=()=>a.useContext($_),tv=a.createContext(void 0),nv=()=>a.useContext(tv),rv=a.createContext(void 0),iv=a.forwardRef((e,t)=>{let n=vv(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=vv(()=>/* @__PURE__ */ new Set),i=vv(()=>/* @__PURE__ */ new Map),o=vv(()=>/* @__PURE__ */ new Map),s=vv(()=>/* @__PURE__ */ new Set),c=gv(e),{label:l,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=W(),b=W(),x=W(),S=a.useRef(null),C=xv();_v(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),_v(()=>{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??Q_;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(K_);t?t.appendChild(e.parentElement===t?e:e.closest(`${K_} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${K_} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${G_}[${Z_}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Z_);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(G_)?.querySelector(q_))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${J_}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(Y_)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(Z_))}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(Z_))}function F(e){let t=j()?.closest(G_),n;for(;t&&!n;)t=e>0?mv(t,G_):hv(t,G_),n=t?.querySelector(Y_);n?w.setState(`value`,n.getAttribute(Z_)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return a.createElement(G.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&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:_&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(X_);t.dispatchEvent(e)}}}}},a.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:wv},l),Cv(e,e=>a.createElement(tv.Provider,{value:w},a.createElement($_.Provider,{value:T},e))))}),av=a.forwardRef((e,t)=>{let n=W(),r=a.useRef(null),i=a.useContext(rv),o=ev(),s=gv(e),c=s.current?.forceMount??i?.forceMount;_v(()=>{if(!c)return o.item(n,i?.id)},[c]);let l=bv(n,r,[e.value,e.children,r],e.keywords),u=nv(),d=yv(e=>e.value&&e.value===l.current),f=yv(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(X_,p),()=>t.removeEventListener(X_,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(G.div,{ref:nn(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)}),ov=a.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=W(),c=a.useRef(null),l=a.useRef(null),u=W(),d=ev(),f=yv(e=>i||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));_v(()=>d.group(s),[]),bv(s,c,[e.value,e.heading,l]);let p=a.useMemo(()=>({id:s,forceMount:i}),[i]);return a.createElement(G.div,{ref:nn(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),Cv(e,e=>a.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},a.createElement(rv.Provider,{value:p},e))))}),sv=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=a.useRef(null),o=yv(e=>!e.search);return!n&&!o?null:a.createElement(G.div,{ref:nn(i,t),...r,"cmdk-separator":``,role:`separator`})}),cv=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=nv(),s=yv(e=>e.search),c=yv(e=>e.selectedItemId),l=ev();return a.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),a.createElement(G.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)}})}),lv=a.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,o=a.useRef(null),s=a.useRef(null),c=yv(e=>e.selectedItemId),l=ev();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(G.div,{ref:nn(o,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Cv(e,e=>a.createElement(`div`,{ref:nn(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),uv=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...c}=e;return a.createElement(C_,{open:n,onOpenChange:r},a.createElement(k_,{container:s},a.createElement(j_,{"cmdk-overlay":``,className:i}),a.createElement(F_,{"aria-label":e.label,"cmdk-dialog":``,className:o},a.createElement(iv,{ref:t,...c}))))}),dv=a.forwardRef((e,t)=>yv(e=>e.filtered.count===0)?a.createElement(G.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),fv=a.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...o}=e;return a.createElement(G.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Cv(e,e=>a.createElement(`div`,{"aria-hidden":!0},e)))}),pv=Object.assign(iv,{List:lv,Item:av,Input:cv,Group:ov,Separator:sv,Dialog:uv,Empty:dv,Loading:fv});function mv(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function hv(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function gv(e){let t=a.useRef(e);return _v(()=>{t.current=e}),t}var _v=typeof window>`u`?a.useEffect:a.useLayoutEffect;function vv(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function yv(e){let t=nv(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function bv(e,t,n,r=[]){let i=a.useRef(),o=ev();return _v(()=>{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(Z_,s),i.current=s}),i}var xv=()=>{let[e,t]=a.useState(),n=vv(()=>/* @__PURE__ */ new Map);return _v(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Sv(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Cv({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(Sv(t),{ref:t.ref},n(t.props.children)):n(t)}var wv={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Tv({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 Ev=d(!1);function Dv(){return!!g(Ev)}function Ov({children:e}){return t(Ev.Provider,{value:!0,children:e})}function kv({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(Nv,{open:i,onOpenChange:e=>{(!l||e)&&f(e)},children:[c&&t(Lv,{className:`z-50 fixed inset-0 bg-black/80`}),t(Tv,{children:t(zv,{children:o})}),n(Rv,{className:H(`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(Iv,{onClick:()=>f(!1),asChild:!0,autoFocus:!1,children:t(K,{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(St,{className:`size-4`})})})]})}),t(Ov,{children:r})]})]})}const Av=({children:e,show:r=!0,className:i,description:a,showDivider:o=!1,...s})=>r?n(Bv,{className:H(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(zv,{className:`text-sm !font-normal text-muted pb-2`,children:a})]}):n(Tv,{children:[t(Bv,{children:e}),a&&t(zv,{children:a})]}),jv=({children:e,className:n,...r})=>t(`div`,{className:H(`text-sm max-h-[80vh] overflow-y-auto`,n),...r,children:e}),Mv=({align:e=`right`,children:n,className:r,...i})=>t(`div`,{className:H(`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}),Nv=C_,Pv=T_,Fv=k_,Iv=H_,Lv=a.forwardRef(({className:e,...n},r)=>t(j_,{ref:r,className:H(`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}));Lv.displayName=j_.displayName;const Rv=a.forwardRef(({className:e,children:r,...i},a)=>{let o=Ri();return n(Fv,{container:o,children:[t(Lv,{}),t(F_,{ref:a,className:H(`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})]})});Rv.displayName=F_.displayName;const zv=a.forwardRef(({className:e,...n},r)=>t(B_,{ref:r,className:H(`text-sm text-muted`,e),...n}));zv.displayName=B_.displayName;const Bv=a.forwardRef(({className:e,...n},r)=>t(z_,{ref:r,className:H(`text-lg font-semibold leading-none tracking-tight`,e),...n}));Bv.displayName=z_.displayName;const Vv=a.forwardRef(({className:e,...n},r)=>t(pv,{ref:r,className:H(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...n}));Vv.displayName=pv.displayName;const Hv=({children:e,...n})=>t(Nv,{...n,children:t(Rv,{className:`shadow-lg p-0 overflow-hidden`,children:t(Vv,{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})})}),Uv=a.forwardRef(({className:e,...r},i)=>n(`div`,{className:`flex items-center px-3 border-b`,"cmdk-input-wrapper":``,children:[t(mt,{className:`opacity-50 size-4 shrink-0`}),t(pv.Input,{ref:i,className:H(`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})]}));Uv.displayName=pv.Input.displayName;const Wv=a.forwardRef(({className:e,...n},r)=>t(pv.List,{ref:r,className:H(`overflow-y-auto overflow-x-hidden`,e),...n}));Wv.displayName=pv.List.displayName;const Gv=a.forwardRef((e,n)=>t(pv.Empty,{ref:n,className:`py-2 text-sm text-center`,...e}));Gv.displayName=pv.Empty.displayName;const Kv=a.forwardRef(({className:e,...n},r)=>t(pv.Group,{ref:r,className:H(`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}));Kv.displayName=pv.Group.displayName;const qv=a.forwardRef(({className:e,...n},r)=>t(pv.Separator,{ref:r,className:H(`-mx-1 h-px bg-border`,e),...n}));qv.displayName=pv.Separator.displayName;const Jv=a.forwardRef(({className:e,...n},r)=>t(pv.Item,{ref:r,className:H(`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}));Jv.displayName=pv.Item.displayName;const Yv=({className:e,...n})=>t(`span`,{className:H(`ms-auto text-xs tracking-widest text-muted`,e),...n});Yv.displayName=`CommandShortcut`;var Xv=Object.defineProperty,Zv=(e,t)=>Xv(e,`name`,{value:t,configurable:!0});// @__NO_SIDE_EFFECTS__
|
|
245
|
+
function Qv(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ Mn(n),[o,s]=r(n,{collectionRef:{current:null},itemMap:/* @__PURE__ */ new Map}),c=/* @__PURE__ */ Zv(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__ */ on(l),d=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=V(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__ */ on(f),h=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),l=V(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 Zv(g,`useCollection`),[{Provider:c,Slot:d,ItemSlot:h},g,i]}Zv(Qv,`createCollection`);var $v=/* @__PURE__ */ new WeakMap,ey=class e extends Map{static{Zv(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],$v.set(this,!0)}set(e,t){return $v.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=ry(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=ty(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ty(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ty(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 ty(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=ny(e,t);return n===-1?void 0:e[n]}Zv(ty,`at`);function ny(e,t){let n=e.length,r=ry(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Zv(ny,`toSafeIndex`);function ry(e){return e!==e||e===0?0:Math.trunc(e)}Zv(ry,`toSafeInteger`);// @__NO_SIDE_EFFECTS__
|
|
246
|
+
function iy(e){let n=e+`CollectionProvider`,[r,i]=/* @__PURE__ */ Mn(n),[o,s]=r(n);o.displayName=e+`CollectionStableContextProvider`;let[c,l]=r(n);c.displayName=e+`CollectionStatefulContextProvider`;let u=/* @__PURE__ */ Zv(({state:e,...n})=>e?/* @__PURE__ */ t(f,{...n,state:e}):/* @__PURE__ */ t(d,{...n}),`CollectionProvider`);u.displayName=n;let d=/* @__PURE__ */ Zv(e=>{let n=y();return/* @__PURE__ */ t(f,{...e,state:n})},`CollectionInit`);d.displayName=e+`CollectionInit`;let f=/* @__PURE__ */ Zv(e=>{let{scope:n,children:r,state:i}=e,s=a.useRef(null),[l,u]=a.useState(null),d=V(s,u),[f,p]=i,m=a.useRef(new ey),h=a.useCallback(()=>{let e=m.current;return sy(e)||e.sort(cy),e},[]);return a.useEffect(()=>{if(!l)return;let e=ly(()=>{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__ */ on(p),h=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=V(n,s(p,r).collectionElementRef);return/* @__PURE__ */ t(m,{ref:a,children:i})});h.displayName=p;let g=e+`CollectionItemSlot`,_=/* @__PURE__ */ on(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);ay(d.current,o)||(d.current=o);let f=d.current,p=V(n,a.useCallback(e=>{let t=u.current;e?t.set(e,{...d.current,element:e}):c.current&&t.delete(c.current)},[u]),c);Pn(()=>{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 ey(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 ey(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 ey)}Zv(y,`useInitCollection`);function b(t){let{collection:n}=l(e+`CollectionConsumer`,t);return n}Zv(b,`useCollection`);function x(t){let{getCollection:n}=s(e+`CollectionConsumer`,t);return n}return Zv(x,`useGetCollection`),[{Provider:u,Slot:h,ItemSlot:v},{createCollectionScope:i,useCollection:b,useGetCollection:x,useInitCollection:y}]}Zv(iy,`createCollection`);function ay(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}Zv(ay,`shallowEqual`);function oy(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Zv(oy,`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}Zv(sy,`isInDocumentOrder`);function cy(e,t){return!e[1].element||!t[1].element?0:oy(e[1].element,t[1].element)?-1:1}Zv(cy,`sortByDocumentPosition`);function ly(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Zv(ly,`getChildListObserver`);var uy=Object.defineProperty,dy=(e,t)=>uy(e,`name`,{value:t,configurable:!0}),fy=!1;function py(){let[e,t]=a.useState(fy);return a.useEffect(()=>{fy||(fy=!0,t(!0))},[]),e}dy(py,`useIsHydrated`);var my=a.useSyncExternalStore;function hy(){return()=>{}}dy(hy,`subscribe`);function gy(){return my(hy,()=>!0,()=>!1)}dy(gy,`useIsHydratedModern`);var _y=typeof my==`function`?gy:py,vy=Object.defineProperty,yy=(e,t)=>vy(e,`name`,{value:t,configurable:!0}),by=`rovingFocusGroup.onEntryFocus`,xy={bubbles:!1,cancelable:!0},Sy=`RovingFocusGroup`,[Cy,wy,Ty]=/* @__PURE__ */ Qv(Sy),[Ey,Dy]=/* @__PURE__ */ Mn(Sy,[Ty]),Oy={Vertical:`vertical`,Horizontal:`horizontal`},ky={LTR:`ltr`,RTL:`rtl`},[Ay,jy]=Ey(Sy),My=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yy(function(e,n){return/* @__PURE__ */ t(Cy.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Cy.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ t(Ny,{...e,ref:n})})})},`RovingFocusGroup`)),Ny=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yy(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=V(n,m),g=fe(s),[_,v]=qr({prop:c,defaultProp:l??null,onChange:u,caller:Sy}),[y,b]=a.useState(!1),x=ar(d),S=wy(r),C=a.useRef(!1),[w,T]=a.useState(0);return a.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(by,x),()=>e.removeEventListener(by,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(G.div,{tabIndex:y||w===0?-1:0,"data-orientation":i,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:U(e.onMouseDown,()=>{C.current=!0}),onFocus:U(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(by,xy);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:U(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),Py=`RovingFocusGroupItem`,Fy=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ yy(function(e,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=W(),d=s||u,f=jy(Py,r),p=f.currentTabStopId===d,m=wy(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f,v=_y();return Pn(()=>{if(v&&i)return h(),()=>g()},[v,i,h,g]),a.useEffect(()=>{if(!v&&i)return h(),()=>g()},[v,i,h,g]),/* @__PURE__ */ t(Cy.ItemSlot,{scope:r,id:d,focusable:i,active:o,children:/* @__PURE__ */ t(G.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:n,onMouseDown:U(e.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:U(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:U(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===ky.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}yy(Ly,`getDirectionAwareKey`);function Ry(e,t,n){let r=Ly(e.key,n);if(!(t===Oy.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Oy.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Iy[r]}yy(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}yy(zy,`focusFirst`);function By(e,t){return e.map((n,r)=>e[(t+r)%e.length])}yy(By,`wrapArray`);var Vy=Object.defineProperty,X=(e,t)=>Vy(e,`name`,{value:t,configurable:!0}),Hy={LTR:`ltr`,RTL:`rtl`},Uy=[`Enter`,` `],Wy=[`ArrowDown`,`PageUp`,`Home`],Gy=[`ArrowUp`,`PageDown`,`End`],Ky=[...Wy,...Gy],qy={ltr:[...Uy,`ArrowRight`],rtl:[...Uy,`ArrowLeft`]},Jy={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Yy=`Menu`,[Xy,Zy,Qy]=/* @__PURE__ */ Qv(Yy),[$y,eb]=/* @__PURE__ */ Mn(Yy,[Qy,hr,Dy]),tb=hr(),nb=Dy(),[rb,ib]=$y(Yy),[ab,ob]=$y(Yy),sb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:s,modal:c=!0}=e,l=tb(n),[u,d]=a.useState(null),f=a.useRef(!1),p=ar(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(vr,{...l,children:/* @__PURE__ */ t(rb,{scope:n,open:r,onOpenChange:p,content:u,onContentChange:d,children:/* @__PURE__ */ t(ab,{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=tb(r);return/* @__PURE__ */ t(br,{...a,...i,ref:n})},`MenuAnchor`)),lb=`MenuPortal`,[ub,db]=$y(lb,{forceMount:void 0}),fb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,forceMount:r,children:i,container:a}=e,o=ib(lb,n);return/* @__PURE__ */ t(ub,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Nr,{present:r||o.open,children:/* @__PURE__ */ t(kr,{asChild:!0,container:a,children:i})})})},`MenuPortal`),pb=`MenuContent`,[mb,hb]=$y(pb),gb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=db(pb,e.__scopeMenu),{forceMount:i=r.forceMount,...a}=e,o=ib(pb,e.__scopeMenu),s=ob(pb,e.__scopeMenu);return/* @__PURE__ */ t(Xy.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Nr,{present:i||o.open,children:/* @__PURE__ */ t(Xy.Slot,{scope:e.__scopeMenu,children:s.modal?/* @__PURE__ */ t(_b,{...a,ref:n}):/* @__PURE__ */ t(vb,{...a,ref:n})})})})},`MenuContent`)),_b=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ib(pb,e.__scopeMenu),i=a.useRef(null),o=V(n,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(bb,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:U(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentModal`)),vb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ib(pb,e.__scopeMenu);return/* @__PURE__ */ t(bb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentNonModal`)),yb=/* @__PURE__ */ on(`MenuContent.ScrollLock`),bb=/* @__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=ib(pb,r),y=ob(pb,r),b=tb(r),x=nb(r),S=Zy(r),[C,w]=a.useState(null),T=a.useRef(null),[E,D]=a.useState(null);I(E);let{nodes:O,registry:k}=L(),A=!!(o||g),j=V(n,T,v.onContentChange,D),N=a.useRef(0),R=a.useRef(``),ee=a.useRef(0),te=a.useRef(null),ne=a.useRef(`right`),re=a.useRef(0),ie=a.useMemo(()=>g?[T,...O.map(e=>({current:e}))]:[],[T,O,g]),ae=g?ue:a.Fragment,oe=g?{as:yb,allowPinchZoom:!0,shards:ie}:void 0,se=/* @__PURE__ */ X(e=>{let t=R.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Zb(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){R.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),[]),le();let ce=a.useCallback(e=>ne.current===te.current?.side&&$b(e,te.current?.area),[]);return/* @__PURE__ */ t(mb,{scope:r,searchRef:R,onItemEnter:a.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),onItemLeave:a.useCallback(e=>{ce(e)||(T.current?.focus(),w(null))},[ce]),onTriggerLeave:a.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:a.useCallback(e=>{te.current=e},[]),children:/* @__PURE__ */ t(F,{registry:A?k:null,children:/* @__PURE__ */ t(ae,{...oe,children:/* @__PURE__ */ t(P,{asChild:!0,trapped:o,branches:O,onMountAutoFocus:U(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(My,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:i,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:U(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */ t(wr,{role:`menu`,"aria-orientation":`vertical`,"data-state":Kb(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:j,style:{outline:`none`,..._.style},onKeyDown:U(_.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&&se(e.key));let i=T.current;if(e.target!==i||!Ky.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);Gy.includes(e.key)&&a.reverse(),Yb(a)}),onBlur:U(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),R.current=``)}),onPointerMove:U(e.onPointerMove,ex(e=>{let t=e.target,n=re.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>re.current?`right`:`left`;ne.current=t,re.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),xb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(G.div,{role:`group`,...i,ref:n})},`MenuGroup`)),Sb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(G.div,{...i,ref:n})},`MenuLabel`)),Cb=`MenuItem`,wb=`menu.itemSelect`,Tb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{disabled:r=!1,onSelect:i,...o}=e,s=a.useRef(null),c=ob(Cb,e.__scopeMenu),l=hb(Cb,e.__scopeMenu),u=V(n,s),d=a.useRef(!1),f=/* @__PURE__ */ X(()=>{let e=s.current;if(!r&&e){let t=new CustomEvent(wb,{bubbles:!0,cancelable:!0});e.addEventListener(wb,e=>i?.(e),{once:!0}),tr(e,t),t.defaultPrevented?d.current=!1:c.onClose()}},`handleSelect`);return/* @__PURE__ */ t(Eb,{...o,ref:u,disabled:r,onClick:U(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:U(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:U(e.onKeyDown,e=>{r||e.target!==e.currentTarget||(l.searchRef.current===``||e.key!==` `)&&Uy.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Eb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,disabled:i=!1,textValue:o,...s}=e,c=hb(Cb,r),l=nb(r),u=a.useRef(null),d=V(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(Xy.ItemSlot,{scope:r,disabled:i,textValue:o??m,children:/* @__PURE__ */ t(Fy,{asChild:!0,...l,focusable:!i,children:/* @__PURE__ */ t(G.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...s,ref:d,onPointerMove:U(e.onPointerMove,ex(e=>{i?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:U(e.onPointerLeave,ex(e=>c.onItemLeave(e))),onFocus:U(e.onFocus,()=>p(!0)),onBlur:U(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),Db=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{checked:r=!1,onCheckedChange:i,...a}=e;return/* @__PURE__ */ t(Pb,{scope:e.__scopeMenu,checked:r,children:/* @__PURE__ */ t(Tb,{role:`menuitemcheckbox`,"aria-checked":qb(r)?`mixed`:r,...a,ref:n,"data-state":Jb(r),onSelect:U(a.onSelect,()=>i?.(qb(r)?!0:!r),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[Ob,kb]=$y(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ X(()=>{},`onValueChange`)}),Ab=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,onValueChange:i,...a}=e,o=ar(i);return/* @__PURE__ */ t(Ob,{scope:e.__scopeMenu,value:r,onValueChange:o,children:/* @__PURE__ */ t(xb,{...a,ref:n})})},`MenuRadioGroup`)),jb=`MenuRadioItem`,Mb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{value:r,...i}=e,a=kb(jb,e.__scopeMenu),o=r===a.value;return/* @__PURE__ */ t(Pb,{scope:e.__scopeMenu,checked:o,children:/* @__PURE__ */ t(Tb,{role:`menuitemradio`,"aria-checked":o,...i,ref:n,"data-state":Jb(o),onSelect:U(i.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Nb=`MenuItemIndicator`,[Pb,Fb]=$y(Nb,{checked:!1}),Ib=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,forceMount:i,...a}=e,o=Fb(Nb,r);return/* @__PURE__ */ t(Nr,{present:i||qb(o.checked)||o.checked===!0,children:/* @__PURE__ */ t(G.span,{...a,ref:n,"data-state":Jb(o.checked)})})},`MenuItemIndicator`)),Lb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let{__scopeMenu:r,...i}=e;return/* @__PURE__ */ t(G.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:n})},`MenuSeparator`)),Rb=`MenuSub`,[zb,Bb]=$y(Rb),Vb=/* @__PURE__ */ X(e=>{let{__scopeMenu:n,children:r,open:i=!1,onOpenChange:o}=e,s=ib(Rb,n),c=tb(n),[l,u]=a.useState(null),[d,f]=a.useState(null),p=ar(o);return a.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),/* @__PURE__ */ t(vr,{...c,children:/* @__PURE__ */ t(rb,{scope:n,open:i,onOpenChange:p,content:d,onContentChange:f,children:/* @__PURE__ */ t(zb,{scope:n,contentId:W(),triggerId:W(),trigger:l,onTriggerChange:u,children:r})})})},`MenuSub`),Hb=`MenuSubTrigger`,Ub=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=ib(Hb,e.__scopeMenu),i=ob(Hb,e.__scopeMenu),o=Bb(Hb,e.__scopeMenu),s=hb(Hb,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=V(n,o.onTriggerChange);return/* @__PURE__ */ t(cb,{asChild:!0,...d,children:/* @__PURE__ */ t(Eb,{id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":Kb(r.open),...e,ref:p,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:U(e.onPointerMove,ex(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:U(e.onPointerLeave,ex(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:U(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(s.searchRef.current===``||t.key!==` `)&&qy[i.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Wb=`MenuSubContent`,Gb=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ X(function(e,n){let r=db(pb,e.__scopeMenu),{forceMount:i=r.forceMount,align:o=`start`,...s}=e,c=ib(pb,e.__scopeMenu),l=ob(pb,e.__scopeMenu),u=Bb(Wb,e.__scopeMenu),d=a.useRef(null),f=V(n,d);return/* @__PURE__ */ t(Xy.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(Nr,{present:i||c.open,children:/* @__PURE__ */ t(Xy.Slot,{scope:e.__scopeMenu,children:/* @__PURE__ */ t(bb,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:o,side:l.dir===Hy.RTL?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:U(e.onFocusOutside,e=>{e.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:U(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:U(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Jy[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function Kb(e){return e?`open`:`closed`}X(Kb,`getOpenState`);function qb(e){return e===`indeterminate`}X(qb,`isIndeterminate`);function Jb(e){return qb(e)?`indeterminate`:e?`checked`:`unchecked`}X(Jb,`getCheckedState`);function Yb(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(Yb,`focusFirst`);function Xb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(Xb,`wrapArray`);function Zb(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=Xb(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(Zb,`getNextMatch`);function Qb(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(Qb,`isPointInPolygon`);function $b(e,t){return t?Qb({x:e.clientX,y:e.clientY},t):!1}X($b,`isPointerInGraceArea`);function ex(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(ex,`whenMouse`);var tx=Object.defineProperty,nx=(e,t)=>tx(e,`name`,{value:t,configurable:!0}),rx=`DropdownMenu`,[ix,ax]=/* @__PURE__ */ Mn(rx,[eb]),ox=eb(),[sx,cx]=ix(rx),lx=/* @__PURE__ */ nx(e=>{let{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=ox(n),d=a.useRef(null),[f,p]=qr({prop:o,defaultProp:s??!1,onChange:c,caller:rx});return/* @__PURE__ */ t(sx,{scope:n,triggerId:W(),triggerRef:d,contentId:W(),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`),ux=`DropdownMenuTrigger`,dx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=e,o=cx(ux,r),s=ox(r),c=V(n,o.triggerRef);return/* @__PURE__ */ t(cb,{asChild:!0,...s,children:/* @__PURE__ */ t(G.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:U(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:U(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),fx=/* @__PURE__ */ nx(e=>{let{__scopeDropdownMenu:n,...r}=e,i=ox(n);return/* @__PURE__ */ t(fb,{...i,...r})},`DropdownMenuPortal`),px=`DropdownMenuContent`,mx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,o=cx(px,r),s=ox(r),c=a.useRef(!1);return/* @__PURE__ */ t(gb,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...i,ref:n,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{c.current||o.triggerRef.current?.focus(),c.current=!1,e.preventDefault()}),onInteractOutside:U(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`)),hx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(xb,{...a,...i,ref:n})},`DropdownMenuGroup`)),gx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Sb,{...a,...i,ref:n})},`DropdownMenuLabel`)),_x=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Tb,{...a,...i,ref:n})},`DropdownMenuItem`)),vx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Db,{...a,...i,ref:n})},`DropdownMenuCheckboxItem`)),yx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Ab,{...a,...i,ref:n})},`DropdownMenuRadioGroup`)),bx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Mb,{...a,...i,ref:n})},`DropdownMenuRadioItem`)),xx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Ib,{...a,...i,ref:n})},`DropdownMenuItemIndicator`)),Sx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Lb,{...a,...i,ref:n})},`DropdownMenuSeparator`)),Cx=/* @__PURE__ */ nx(e=>{let{__scopeDropdownMenu:n,children:r,open:i,onOpenChange:a,defaultOpen:o}=e,s=ox(n),[c,l]=qr({prop:i,defaultProp:o??!1,onChange:a,caller:`DropdownMenuSub`});return/* @__PURE__ */ t(Vb,{...s,open:c,onOpenChange:l,children:r})},`DropdownMenuSub`),wx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Ub,{...a,...i,ref:n})},`DropdownMenuSubTrigger`)),Tx=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ nx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=ox(r);return/* @__PURE__ */ t(Gb,{...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 Ex=a.createContext(!1);function Dx({...e}){return t(lx,{"data-slot":`dropdown-menu`,...e})}function Ox({...e}){return t(fx,{"data-slot":`dropdown-menu-portal`,...e})}function kx({...e}){return t(dx,{"data-slot":`dropdown-menu-trigger`,...e})}function Ax({className:e,align:n=`start`,sideOffset:r=4,...i}){return t(fx,{children:t(mx,{"data-slot":`dropdown-menu-content`,sideOffset:r,align:n,className:H(`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 jx({...e}){return t(hx,{"data-slot":`dropdown-menu-group`,...e})}function Mx({className:e,inset:n,variant:r=`default`,...i}){return t(_x,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":r,className:H(`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 Nx({className:e,children:r,checked:i,inset:a,...o}){return n(vx,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:H(`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(xx,{children:t(Ie,{})})}),r]})}function Px({...e}){return t(yx,{"data-slot":`dropdown-menu-radio-group`,...e})}function Fx({className:e,children:r,inset:i,...a}){return n(bx,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:H(`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(xx,{children:t(Ie,{})})}),r]})}function Ix({className:e,inset:n,...r}){return t(gx,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:H(`text-muted px-1.5 py-1 text-xs font-medium data-inset:ps-7`,e),...r})}function Lx({className:e,...n}){return t(Sx,{"data-slot":`dropdown-menu-separator`,className:H(`bg-border -mx-1 my-1 h-px`,e),...n})}function Rx({className:e,...n}){return t(`span`,{"data-slot":`dropdown-menu-shortcut`,className:H(`text-muted group-focus/dropdown-menu-item:text-muted ms-auto text-xs tracking-widest`,e),...n})}function zx({...e}){return t(Cx,{"data-slot":`dropdown-menu-sub`,...e})}function Bx({className:e,inset:r,children:i,...a}){return n(wx,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":r,className:H(`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(Be,{className:`cn-rtl-flip ms-auto`})]})}function Vx({className:e,...n}){return t(Tx,{"data-slot":`dropdown-menu-sub-content`,className:H(`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 Hx={left:`start`,center:`center`,right:`end`};function Ux({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:H(`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(Ex.Provider,{value:!0,children:r})})})]}):n(Dx,{children:[t(kx,{asChild:!0,children:t(`span`,{className:`-m-1.5 flex items-center p-1.5`,children:e})}),t(Ax,{align:Hx[i],className:`w-max`,children:r})]})}function Wx({children:e,label:r}){return n(jx,{children:[r&&t(Ix,{children:r}),e]})}function Gx({children:e,href:n,onClick:r,isDisabled:i=!1,variant:o=`default`,className:s}){let c=a.useContext(Ex),l=H(`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(Mx,{className:H(`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 Kx=({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:H(n,`overflow-hidden transition-all duration-100 ease-in`),style:{height:i},children:t(`div`,{ref:r,children:e})})},qx=(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);(Jx(i,a)||!r)&&Object.defineProperty(e,n,a)},Jx=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)},Yx=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Xx=(e,t)=>`/* Wrapped ${e}*/\n${t}`,Zx=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),Qx=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),$x=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=Xx.bind(null,r,t.toString());Object.defineProperty(i,"name",Qx);let{writable:a,enumerable:o,configurable:s}=Zx;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function eS(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))qx(e,t,r,n);return Yx(e,t),$x(e,t,r),e}const tS=2147483647,nS=/* @__PURE__ */ new WeakMap,rS=/* @__PURE__ */ new WeakMap,iS=/* @__PURE__ */ new WeakMap;function aS(e,t){let n=e.get(t);if(n){if(n.maxAge<=Date.now()){e.delete(t);return}return n}}function oS(e,{cacheKey:t,cache:n=/* @__PURE__ */ new Map,maxAge:r}={}){if(r===0)return e;if(typeof r==`number`&&Number.isFinite(r)){if(r>tS)throw TypeError(`The \`maxAge\` option cannot exceed ${tS}.`);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=aS(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>tS)throw TypeError(`The \`maxAge\` function result cannot exceed ${tS}.`)}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),rS.get(i)?.delete(e)},l);e.unref?.();let t=rS.get(i)??/* @__PURE__ */ new Set;t.add(e),rS.set(i,t)}return c};return eS(i,e,{ignoreNonConfigurable:!0}),nS.set(i,n),iS.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 lS(e){return e.toLowerCase()===e}function uS(e){return e.indexOf(`,`)===-1?e:e.split(`,`)}function dS(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 dS(n)}if(e.indexOf(`@`)!==-1){var r=e.split(`@`)[0],n=r===void 0?``:r;return dS(n)}if(e.indexOf(`-`)===-1||!lS(e))return e;var i=e.split(`-`),a=i[0],o=i[1];return`${a}-${(o===void 0?``:o).toUpperCase()}`}function fS(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(uS(d))}var f=navigator.language,p=f&&uS(f);o=o.concat(c,p)}return r&&o.push(a),o.filter(sS).map(dS).filter(cS)}var pS=oS(fS,{cacheKey:JSON.stringify});function mS(e){return pS(e)[0]||null}var hS=oS(mS,{cacheKey:JSON.stringify});const gS=/* @__PURE__ */ new Map;function _S(e){return function(t,n){let r=t||hS();gS.has(r)||gS.set(r,/* @__PURE__ */ new Map);let i=gS.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 vS(e){let t=new Date(e);return new Date(t.setHours(12))}function yS(e){return(t,n)=>_S(e)(t,vS(n))}const bS={day:`numeric`},xS={day:`numeric`,month:`long`,year:`numeric`},SS={month:`long`},CS={month:`long`,year:`numeric`},wS={weekday:`short`},TS={weekday:`long`},ES={year:`numeric`},DS=yS(bS),OS=yS(xS),kS=yS(SS),AS=yS(CS),jS=yS(wS),MS=yS(TS),NS=yS(ES);function PS(e,t,n){return function(r,i=n){return t(e(r)+i)}}function FS(e){return function(t){return/* @__PURE__ */ new Date(e(t).getTime()-1)}}function IS(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 LS(e){if(e instanceof Date)return e.getMonth();throw Error(`Failed to get month from date: ${e}.`)}function RS(e){if(e instanceof Date)return e.getDate();throw Error(`Failed to get year from date: ${e}.`)}function zS(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 BS=PS(Z,zS,-100),VS=PS(Z,zS,100),HS=FS(VS),US=PS(Z,HS,-100),WS=IS(zS,HS);function GS(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 KS=PS(Z,GS,-10),qS=PS(Z,GS,10),JS=FS(qS),YS=PS(Z,JS,-10),XS=IS(GS,JS);function ZS(e){let t=Z(e),n=/* @__PURE__ */ new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}const QS=PS(Z,ZS,-1),$S=PS(Z,ZS,1),eC=FS($S),tC=PS(Z,eC,-1),nC=IS(ZS,eC);function rC(e,t){return function(n,r=t){let i=Z(n),a=LS(n)+r,o=/* @__PURE__ */ new Date;return o.setFullYear(i,a,1),o.setHours(0,0,0,0),e(o)}}function iC(e){let t=Z(e),n=LS(e),r=/* @__PURE__ */ new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}const aC=rC(iC,-1),oC=rC(iC,1),sC=FS(oC),cC=rC(sC,-1),lC=IS(iC,sC);function uC(e,t){return function(n,r=t){let i=Z(n),a=LS(n),o=RS(n)+r,s=/* @__PURE__ */ new Date;return s.setFullYear(i,a,o),s.setHours(0,0,0,0),e(s)}}function dC(e){let t=Z(e),n=LS(e),r=RS(e),i=/* @__PURE__ */ new Date;return i.setFullYear(t,n,r),i.setHours(0,0,0,0),i}const fC=FS(uC(dC,1)),pC=IS(dC,fC);function mC(e){return RS(sC(e))}const hC={GREGORY:`gregory`,HEBREW:`hebrew`,ISLAMIC:`islamic`,ISO_8601:`iso8601`},gC={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`]},_C=[0,1,2,3,4,5,6],vC=_C[0],yC=_C[5],bC=_C[6];function xC(e,t=hC.ISO_8601){let n=e.getDay();switch(t){case hC.ISO_8601:return(n+6)%7;case hC.ISLAMIC:return(n+1)%7;case hC.HEBREW:case hC.GREGORY:return n;default:throw Error(`Unsupported calendar type.`)}}function SC(e){return Z(zS(e))}function CC(e){return Z(GS(e))}function wC(e,t=hC.ISO_8601){let n=Z(e),r=LS(e),i=e.getDate()-xC(e,t);return new Date(n,r,i)}function TC(e,t=hC.ISO_8601){let n=t===hC.GREGORY?hC.GREGORY:hC.ISO_8601,r=wC(e,t),i=Z(e)+1,a,o;do a=new Date(i,0,n===hC.ISO_8601?4:1),o=wC(a,t),--i;while(e<o);return Math.round((r.getTime()-o.getTime())/6048e5)+1}function EC(e,t){switch(e){case`century`:return zS(t);case`decade`:return GS(t);case`year`:return ZS(t);case`month`:return iC(t);case`day`:return dC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function DC(e,t){switch(e){case`century`:return BS(t);case`decade`:return KS(t);case`year`:return QS(t);case`month`:return aC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function OC(e,t){switch(e){case`century`:return VS(t);case`decade`:return qS(t);case`year`:return $S(t);case`month`:return oC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function kC(e,t){switch(e){case`decade`:return KS(t,-100);case`year`:return QS(t,-10);case`month`:return aC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function AC(e,t){switch(e){case`decade`:return qS(t,100);case`year`:return $S(t,10);case`month`:return oC(t,12);default:throw Error(`Invalid rangeType: ${e}`)}}function jC(e,t){switch(e){case`century`:return HS(t);case`decade`:return JS(t);case`year`:return eC(t);case`month`:return sC(t);case`day`:return fC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function MC(e,t){switch(e){case`century`:return US(t);case`decade`:return YS(t);case`year`:return tC(t);case`month`:return cC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function NC(e,t){switch(e){case`decade`:return YS(t,-100);case`year`:return tC(t,-10);case`month`:return cC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function PC(e,t){switch(e){case`century`:return WS(t);case`decade`:return XS(t);case`year`:return nC(t);case`month`:return lC(t);case`day`:return pC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function FC(e,t,n){let r=[t,n].sort((e,t)=>e.getTime()-t.getTime());return[EC(e,r[0]),jC(e,r[1])]}function IC(e,t,n){return n.map(n=>(t||NS)(e,n)).join(` – `)}function LC(e,t,n){return IC(e,t,WS(n))}function RC(e,t,n){return IC(e,t,XS(n))}function zC(e){return e.getDay()===(/* @__PURE__ */ new Date()).getDay()}function BC(e,t=hC.ISO_8601){let n=e.getDay();switch(t){case hC.ISLAMIC:case hC.HEBREW:return n===yC||n===bC;case hC.ISO_8601:case hC.GREGORY:return n===bC||n===vC;default:throw Error(`Unsupported calendar type.`)}}const VC=`react-calendar__navigation`;function HC({activeStartDate:r,drillUp:i,formatMonthYear:a=AS,formatYear:o=NS,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=DC(C,r),O=E?kC(C,r):void 0,k=OC(C,r),A=E?AC(C,r):void 0,j=(()=>{if(D.getFullYear()<0)return!0;let e=MC(C,r);return l&&l>=e})(),M=E&&(()=>{if(O.getFullYear()<0)return!0;let e=NC(C,r);return l&&l>=e})(),N=c&&c<k,P=E&&c&&c<A;function F(){x(D,`prev`)}function I(){x(O,`prev2`)}function L(){x(k,`next`)}function R(){x(A,`next2`)}function ee(e){let t=(()=>{switch(C){case`century`:return LC(s,o,e);case`decade`:return RC(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||hS()||void 0,view:C}):t}function te(){let a=`${VC}__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:ee(r)}),S?n(e,{children:[t(`span`,{className:`${a}__divider`,children:` – `}),t(`span`,{className:`${a}__labelText ${a}__labelText--to`,children:ee(k)})]}):null]})}return n(`div`,{className:VC,children:[v!==null&&E?t(`button`,{"aria-label":_,className:`${VC}__arrow ${VC}__prev2-button`,disabled:M,onClick:I,type:`button`,children:v}):null,b!==null&&t(`button`,{"aria-label":y,className:`${VC}__arrow ${VC}__prev-button`,disabled:j,onClick:F,type:`button`,children:b}),te(),g!==null&&t(`button`,{"aria-label":h,className:`${VC}__arrow ${VC}__next-button`,disabled:N,onClick:L,type:`button`,children:g}),m!==null&&E?t(`button`,{"aria-label":p,className:`${VC}__arrow ${VC}__next2-button`,disabled:P,onClick:R,type:`button`,children:m}):null]})}function UC(e){return`${e}%`}function WC({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?UC(100*a/r):null;return u(e,{...e.props,style:{flexBasis:UC(100/r),flexShrink:0,flexGrow:0,overflow:`hidden`,marginLeft:n,marginInlineStart:n,marginInlineEnd:0}})})})}function GC(e,t,n){return t&&t>e?t:n&&n<e?n:e}function KC(e,t){return t[0]<=e&&t[1]>=e}function qC(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function JC(e,t){return KC(e[0],t)||KC(e[1],t)}function YC(e,t,n){let r=JC(t,e),i=[];if(r){i.push(n);let r=KC(e[0],t),a=KC(e[1],t);r&&i.push(`${n}Start`),a&&i.push(`${n}End`),r&&a&&i.push(`${n}BothEnds`)}return i}function XC(e){return Array.isArray(e)?e[0]!==null&&e[1]!==null:e!==null}function ZC(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 PC(t,n)})();if(KC(o,s)&&a.push(`${i}--now`),!t||!XC(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 PC(n,t)})();qC(c,s)?a.push(`${i}--active`):JC(c,s)&&a.push(`${i}--hasActive`);let l=YC(c,s,`${i}--range`);if(a.push(...l),r&&(Array.isArray(t)?t:[t]).length===1){let e=YC(r>c[0]?[c[0],r]:[r,c[0]],s,`${i}--hover`);a.push(...e)}return a}function QC({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:ZC({date:t,dateType:i,hover:o,value:d,valueType:f}),date:t}))}return t(WC,{className:e,count:n,offset:s,wrap:!0,children:p})}function $C(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 ew=`react-calendar__century-view__decades__decade`;function tw({classes:e=[],currentCentury:n,formatYear:r=NS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(ew),zS(a).getFullYear()!==n&&s.push(`${ew}--neighboringCentury`),t($C,{...i,classes:s,maxDateTransform:JS,minDateTransform:GS,view:`century`,children:RC(o,r,a)})}function nw(e){let{activeStartDate:n,hover:r,showNeighboringCentury:i,value:a,valueType:o,...s}=e,c=SC(n),l=c+(i?119:99);return t(QC,{className:`react-calendar__century-view__decades`,dateTransform:GS,dateType:`decade`,end:l,hover:r,renderTile:({date:e,...r})=>t(tw,{...s,...r,activeStartDate:n,currentCentury:c,date:e},e.getTime()),start:c,step:10,value:a,valueType:o})}function rw(e){function n(){return t(nw,{...e})}return t(`div`,{className:`react-calendar__century-view`,children:n()})}const iw=`react-calendar__decade-view__years__year`;function aw({classes:e=[],currentDecade:n,formatYear:r=NS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(iw),GS(a).getFullYear()!==n&&s.push(`${iw}--neighboringDecade`),t($C,{...i,classes:s,maxDateTransform:eC,minDateTransform:ZS,view:`decade`,children:r(o,a)})}function ow(e){let{activeStartDate:n,hover:r,showNeighboringDecade:i,value:a,valueType:o,...s}=e,c=CC(n),l=c+(i?11:9);return t(QC,{className:`react-calendar__decade-view__years`,dateTransform:ZS,dateType:`year`,end:l,hover:r,renderTile:({date:e,...r})=>t(aw,{...s,...r,activeStartDate:n,currentDecade:c,date:e},e.getTime()),start:c,value:a,valueType:o})}function sw(e){function n(){return t(ow,{...e})}return t(`div`,{className:`react-calendar__decade-view`,children:n()})}const cw=`react-calendar__month-view__days__day`;function lw({calendarType:e,classes:n=[],currentMonthIndex:r,formatDay:i=DS,formatLongDate:a=OS,...o}){let{date:s,locale:c}=o,l=[];return n&&l.push(...n),l.push(cw),BC(s,e)&&l.push(`${cw}--weekend`),s.getMonth()!==r&&l.push(`${cw}--neighboringMonth`),t($C,{...o,classes:l,formatAbbr:a,maxDateTransform:fC,minDateTransform:dC,view:`month`,children:i(c,s)})}function uw(e){let{activeStartDate:n,calendarType:r,hover:i,showFixedNumberOfWeeks:a,showNeighboringMonth:o,value:s,valueType:c,...l}=e,u=Z(n),d=LS(n),f=a||o,p=xC(n,r),m=f?0:p,h=(f?-p:0)+1,g=(()=>{if(a)return h+42-1;let e=mC(n);if(o){let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),t.setHours(0,0,0,0),e+(7-xC(t,r)-1)}return e})();return t(QC,{className:`react-calendar__month-view__days`,count:7,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(u,d,e),dC(t)},dateType:`day`,hover:i,end:g,renderTile:({date:e,...i})=>t(lw,{...l,...i,activeStartDate:n,calendarType:r,currentMonthIndex:d,date:e},e.getTime()),offset:m,start:h,value:s,valueType:c})}const dw=`react-calendar__month-view__weekdays`,fw=`${dw}__weekday`;function pw(e){let{calendarType:n,formatShortWeekday:i=jS,formatWeekday:a=MS,locale:o,onMouseLeave:s}=e,c=iC(/* @__PURE__ */ new Date),l=Z(c),u=LS(c),d=[];for(let e=1;e<=7;e+=1){let s=new Date(l,u,e-xC(c,n)),f=a(o,s);d.push(t(`div`,{className:r(fw,zC(s)&&`${fw}--current`,BC(s,n)&&`${fw}--weekend`),children:t(`abbr`,{"aria-label":f,title:f,children:i(o,s).replace(`.`,``)})},e))}return t(WC,{className:dw,count:7,onFocus:s,onMouseOver:s,children:d})}const mw=`react-calendar__tile`;function hw(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:mw,onClick:e=>r(a,n,e),type:`button`,children:i})}{let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`div`,{...o,className:mw,children:i})}}function gw(e){let{activeStartDate:n,calendarType:r,onClickWeekNumber:i,onMouseLeave:a,showFixedNumberOfWeeks:o}=e,s=(()=>{if(o)return 6;let e=mC(n)-(7-xC(n,r));return 1+Math.ceil(e/7)})(),c=(()=>{let e=Z(n),t=LS(n),i=RS(n),a=[];for(let n=0;n<s;n+=1)a.push(wC(new Date(e,t,i+n*7),r));return a})(),l=c.map(e=>TC(e,r));return t(WC,{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(hw,{date:r,onClickWeekNumber:i,weekNumber:e},e)})})}function _w(e){if(e){for(let[t,n]of Object.entries(gC))if(n.includes(e))return t}return hC.ISO_8601}function vw(e){let{activeStartDate:i,locale:a,onMouseLeave:o,showFixedNumberOfWeeks:s}=e,{calendarType:c=_w(a),formatShortWeekday:l,formatWeekday:u,onClickWeekNumber:d,showWeekNumbers:f,...p}=e;function m(){return t(pw,{calendarType:c,formatShortWeekday:l,formatWeekday:u,locale:a,onMouseLeave:o})}function h(){return f?t(gw,{activeStartDate:i,calendarType:c,onClickWeekNumber:d,onMouseLeave:o,showFixedNumberOfWeeks:s}):null}function g(){return t(uw,{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 yw({classes:e=[],formatMonth:n=kS,formatMonthYear:r=AS,...i}){let{date:a,locale:o}=i;return t($C,{...i,classes:[...e,`react-calendar__year-view__months__month`],formatAbbr:r,maxDateTransform:sC,minDateTransform:iC,view:`year`,children:n(o,a)})}function bw(e){let{activeStartDate:n,hover:r,value:i,valueType:a,...o}=e,s=Z(n);return t(QC,{className:`react-calendar__year-view__months`,dateTransform:e=>{let t=/* @__PURE__ */ new Date;return t.setFullYear(s,e,1),iC(t)},dateType:`month`,end:11,hover:r,renderTile:({date:e,...r})=>t(yw,{...o,...r,activeStartDate:n,date:e},e.getTime()),start:0,value:i,valueType:a})}function xw(e){function n(){return t(bw,{...e})}return t(`div`,{className:`react-calendar__year-view`,children:n()})}const Sw=`react-calendar`,Cw=[`century`,`decade`,`year`,`month`],ww=[`decade`,`year`,`month`,`day`],Tw=/* @__PURE__ */ new Date;Tw.setFullYear(1,0,1),Tw.setHours(0,0,0,0);const Ew=/* @__PURE__ */ new Date(864e13);function Dw(e){return e instanceof Date?e:new Date(e)}function Ow(e,t){return Cw.slice(Cw.indexOf(e),Cw.indexOf(t)+1)}function kw(e,t,n){return Ow(t,n).indexOf(e)!==-1}function Aw(e,t,n){return e&&kw(e,t,n)?e:n}function jw(e){let t=Cw.indexOf(e);return ww[t]}function Mw(e,t){let n=Array.isArray(e)?e[t]:e;if(!n)return null;let r=Dw(n);if(Number.isNaN(r.getTime()))throw Error(`Invalid date: ${e}`);return r}function Nw({value:e,minDate:t,maxDate:n,maxDetail:r},i){let a=Mw(e,i);if(!a)return null;let o=jw(r);return GC((()=>{switch(i){case 0:return EC(o,a);case 1:return jC(o,a);default:throw Error(`Invalid index value: ${i}`)}})(),t,n)}const Pw=e=>Nw(e,0),Fw=e=>Nw(e,1),Iw=e=>[Pw,Fw].map(t=>t(e));function Lw({maxDate:e,maxDetail:t,minDate:n,minDetail:r,value:i,view:a}){return EC(Aw(a,r,t),Pw({value:i,minDate:n,maxDate:e,maxDetail:t})||/* @__PURE__ */ new Date)}function Rw({activeStartDate:e,defaultActiveStartDate:t,defaultValue:n,defaultView:r,maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c,view:l}){let u=Aw(l,s,a),d=e||t;return d?EC(u,d):Lw({maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c||n,view:l||r})}function zw(e){return e&&(!Array.isArray(e)||e.length===1)}function Bw(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var Vw=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=Ew,maxDetail:D=`month`,minDate:O=Tw,minDetail:k=`century`,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:F,nextLabel:I,onActiveStartDateChange:L,onChange:R,onClickDay:ee,onClickDecade:te,onClickMonth:ne,onClickWeekNumber:re,onClickYear:ie,onDrillDown:ae,onDrillUp:oe,onViewChange:se,prev2AriaLabel:ce,prev2Label:le,prevAriaLabel:ue,prevLabel:de,returnValue:fe=`start`,selectRange:pe,showDoubleView:me,showFixedNumberOfWeeks:he,showNavigation:ge=!0,showNeighboringCentury:_e,showNeighboringDecade:ve,showNeighboringMonth:ye=!0,showWeekNumbers:be,tileClassName:xe,tileContent:Se,tileDisabled:Ce,value:we,view:Te}=e,[Ee,De]=w(u),[Oe,ke]=w(null),[Ae,je]=w(Array.isArray(d)?d.map(e=>e===null?null:Dw(e)):d==null?null:Dw(d)),[Me,Ne]=w(f),Pe=a||Ee||Rw({activeStartDate:a,defaultActiveStartDate:u,defaultValue:d,defaultView:f,maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:we,view:Te}),Fe=(()=>{let e=pe&&zw(Ae)||we===void 0?Ae:we;return e?Array.isArray(e)?e.map(e=>e===null?null:Dw(e)):e===null?null:Dw(e):null})(),z=jw(D),B=Aw(Te||Me,k,D),Ie=Ow(k,D),Le=pe?Oe:null,Re=Ie.indexOf(B)<Ie.length-1,ze=Ie.indexOf(B)>0,Be=h(e=>(()=>{switch(fe){case`start`:return Pw;case`end`:return Fw;case`range`:return Iw;default:throw Error(`Invalid returnValue.`)}})()({maxDate:E,maxDetail:D,minDate:O,value:e}),[E,D,O,fe]),Ve=h((e,t)=>{De(e);let n={action:t,activeStartDate:e,value:Fe,view:B};L&&!Bw(Pe,e)&&L(n)},[Pe,L,Fe,B]),He=h((e,t)=>{let n=(()=>{switch(B){case`century`:return te;case`decade`:return ie;case`year`:return ne;case`month`:return ee;default:throw Error(`Invalid view: ${B}.`)}})();n&&n(e,t)},[ee,te,ne,ie,B]),Ue=h((e,t)=>{if(!Re)return;He(e,t);let n=Ie[Ie.indexOf(B)+1];if(!n)throw Error(`Attempted to drill down from the lowest view.`);De(e),Ne(n);let r={action:`drillDown`,activeStartDate:e,value:Fe,view:n};L&&!Bw(Pe,e)&&L(r),se&&B!==n&&se(r),ae&&ae(r)},[Pe,Re,L,He,ae,se,Fe,B,Ie]),We=h(()=>{if(!ze)return;let e=Ie[Ie.indexOf(B)-1];if(!e)throw Error(`Attempted to drill up from the highest view.`);let t=EC(e,Pe);De(t),Ne(e);let n={action:`drillUp`,activeStartDate:t,value:Fe,view:e};L&&!Bw(Pe,t)&&L(n),se&&B!==e&&se(n),oe&&oe(n)},[Pe,ze,L,oe,se,Fe,B,Ie]),Ge=h((e,t)=>{let n=Fe;He(e,t);let r=pe&&!zw(n),i;if(pe){if(r)i=EC(z,e);else{if(!n)throw Error(`previousValue is required`);if(Array.isArray(n))throw Error(`previousValue must not be an array`);i=FC(z,n,e)}}else i=Be(e);let a=!pe||r||S?Lw({maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:i,view:B}):null;t.persist(),De(a),je(i);let s={action:`onChange`,activeStartDate:a,value:i,view:B};if(L&&!Bw(Pe,a)&&L(s),R){if(pe){if(!zw(i))R(i||null,t);else if(o){if(Array.isArray(i))throw Error(`value must not be an array`);R([i||null,null],t)}}else R(i||null,t)}},[Pe,o,Be,S,E,D,O,k,L,R,He,pe,Fe,z,B]);function Ke(e){ke(e)}function qe(){ke(null)}y(i,()=>({activeStartDate:Pe,drillDown:Ue,drillUp:We,onChange:Ge,setActiveStartDate:Ve,value:Fe,view:B}),[Pe,Ue,We,Ge,Ve,Fe,B]);function Je(e){let n={activeStartDate:e?OC(B,Pe):EC(B,Pe),hover:Le,locale:T,maxDate:E,minDate:O,onClick:Re?Ue:Ge,onMouseOver:pe?Ke:void 0,tileClassName:xe,tileContent:Se,tileDisabled:Ce,value:Fe,valueType:z};switch(B){case`century`:return t(rw,{formatYear:x,showNeighboringCentury:_e,...n});case`decade`:return t(sw,{formatYear:x,showNeighboringDecade:ve,...n});case`year`:return t(xw,{formatMonth:g,formatMonthYear:_,...n});case`month`:return t(vw,{calendarType:s,formatDay:p,formatLongDate:m,formatShortWeekday:v,formatWeekday:b,onClickWeekNumber:re,onMouseLeave:pe?qe:void 0,showFixedNumberOfWeeks:he===void 0?me:he,showNeighboringMonth:ye,showWeekNumbers:be,...n});default:throw Error(`Invalid view: ${B}.`)}}function Ye(){return ge?t(HC,{activeStartDate:Pe,drillUp:We,formatMonthYear:_,formatYear:x,locale:T,maxDate:E,minDate:O,navigationAriaLabel:A,navigationAriaLive:j,navigationLabel:M,next2AriaLabel:N,next2Label:P,nextAriaLabel:F,nextLabel:I,prev2AriaLabel:ce,prev2Label:le,prevAriaLabel:ue,prevLabel:de,setActiveStartDate:Ve,showDoubleView:me,view:B,views:Ie}):null}return n(`div`,{className:r(Sw,pe&&(Array.isArray(Fe)?Fe:[Fe]).length===1&&`${Sw}--selectRange`,me&&`${Sw}--doubleView`,c),"data-testid":l,ref:C,children:[Ye(),n(`div`,{className:`${Sw}__viewContainer`,onBlur:pe?qe:void 0,onMouseLeave:pe?qe:void 0,children:[Je(),me?Je(!0):null]})]})});pe.extend(he),pe.extend(me);var Q=pe,Hw=Object.defineProperty,Uw=(e,t)=>Hw(e,`name`,{value:t,configurable:!0}),Ww=`Popover`,[Gw,Kw]=/* @__PURE__ */ Mn(Ww,[hr]),qw=hr(),[Jw,Yw]=Gw(Ww),Xw=/* @__PURE__ */ Uw(e=>{let{__scopePopover:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,l=qw(n),u=a.useRef(null),[d,f]=a.useState(!1),[p,m]=a.useState(0),[h,g]=a.useState(0),[_,v]=qr({prop:i,defaultProp:o??!1,onChange:s,caller:Ww});return/* @__PURE__ */ t(vr,{...l,children:/* @__PURE__ */ t(Jw,{scope:n,contentId:W(),titleId:W(),descriptionId:W(),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`),Zw=`PopoverAnchor`,Qw=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let{__scopePopover:r,...i}=e,o=Yw(Zw,r),s=qw(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=o;return a.useEffect(()=>(c(),()=>l()),[c,l]),/* @__PURE__ */ t(br,{...s,...i,ref:n})},`PopoverAnchor`)),$w=`PopoverTrigger`,eT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let{__scopePopover:r,...i}=e,a=Yw($w,r),o=qw(r),s=V(n,a.triggerRef),c=/* @__PURE__ */ t(G.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":pT(a.open),...i,ref:s,onClick:U(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:/* @__PURE__ */ t(br,{asChild:!0,...o,children:c})},`PopoverTrigger`)),tT=`PopoverPortal`,[nT,rT]=Gw(tT,{forceMount:void 0}),iT=/* @__PURE__ */ Uw(e=>{let{__scopePopover:n,forceMount:r,children:i,container:a}=e,o=Yw(tT,n);return/* @__PURE__ */ t(nT,{scope:n,forceMount:r,children:/* @__PURE__ */ t(Nr,{present:r||o.open,children:/* @__PURE__ */ t(kr,{asChild:!0,container:a,children:i})})})},`PopoverPortal`),aT=`PopoverContent`,oT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let r=rT(aT,e.__scopePopover),{forceMount:i=r.forceMount,...a}=e,o=Yw(aT,e.__scopePopover);return/* @__PURE__ */ t(Nr,{present:i||o.open,children:o.modal?/* @__PURE__ */ t(cT,{...a,ref:n}):/* @__PURE__ */ t(lT,{...a,ref:n})})},`PopoverContent`)),sT=/* @__PURE__ */ on(`PopoverContent.RemoveScroll`),cT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let r=Yw(aT,e.__scopePopover),i=a.useRef(null),o=V(n,i),s=a.useRef(!1),{nodes:c,registry:l}=L();return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),/* @__PURE__ */ t(ue,{as:sT,allowPinchZoom:!0,shards:a.useMemo(()=>[i,...c.map(e=>({current:e}))],[i,c]),children:/* @__PURE__ */ t(uT,{...e,ref:o,branchNodes:c,branchRegistry:l,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(e.onCloseAutoFocus,e=>{e.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:U(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:U(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),lT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let r=Yw(aT,e.__scopePopover),i=a.useRef(!1),o=a.useRef(!1);return/* @__PURE__ */ t(uT,{...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`)),uT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(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,_=Yw(aT,r),v=qw(r),[y,b]=a.useState(null),x=V(n,b);return I(y),le(),/* @__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(wr,{"data-state":pT(_.open),role:`dialog`,id:_.contentId,"aria-labelledby":_.titlePresent?_.titleId:void 0,"aria-describedby":_.descriptionPresent?mT(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`)),dT=`PopoverClose`,fT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ Uw(function(e,n){let{__scopePopover:r,...i}=e,a=Yw(dT,r);return/* @__PURE__ */ t(G.button,{type:`button`,...i,ref:n,onClick:U(e.onClick,()=>a.onOpenChange(!1))})},`PopoverClose`));function pT(e){return e?`open`:`closed`}Uw(pT,`getState`);function mT(...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}Uw(mT,`concatAriaDescribedby`);const hT=a.createContext(null),gT=({hover:e=!1,click:n=!1,modal:r,children:i,_open:o,onOpenChange:s})=>{let[c,l]=a.useState(o||!1);return t(hT.Provider,{value:{open:c,setOpen:l,hover:e,click:n},children:t(Xw,{open:c,onOpenChange:e=>{l(e),s&&s(e)},modal:r,children:i})})};function _T(e=!1,t=()=>{},n){e&&t(n===`enter`)}const vT=a.forwardRef(({children:e,...n},r)=>{let i=a.useContext(hT);if(!i)throw Error(`PopoverTrigger must be used within a Popover`);let{setOpen:o,hover:s,click:c}=i;return t(eT,{ref:r,asChild:!0,onMouseEnter:()=>_T(s,o,`enter`),onMouseLeave:()=>_T(s,o,`leave`),onClick:()=>{c&&o(e=>!e)},...n,children:e})});vT.displayName=eT.displayName;const yT=Qw,bT=a.forwardRef(({className:e,align:n=`center`,side:r=`bottom`,...i},o)=>{let s=a.useContext(hT);if(!s)throw Error(`PopoverContent must be used within a Popover`);let{setOpen:c,hover:l}=s,u=Ri();return t(iT,{container:u,children:t(oT,{ref:o,align:n,side:r,onMouseEnter:()=>_T(l,c,`enter`),onMouseLeave:()=>_T(l,c,`leave`),className:H(`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})})});bT.displayName=oT.displayName;const xT=fT;xT.displayName=fT.displayName;function ST(){let e=a.useContext(hT);if(!e)throw Error(`usePopoverContext must be used within a Popover`);return{...e,close:()=>e.setOpen(!1)}}const CT=`
|
|
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
|
+
`,wT=({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(gT,{_open:o,onOpenChange:s,children:[t(vT,{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(bT,{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:CT}),t(Vw,{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(K,{variant:`ghost`,size:`sm`,onClick:()=>s(!1),children:`Cancel`}),t(K,{size:`sm`,onClick:()=>s(!1),children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:CT}),t(Vw,{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 TT({value:n,labelRenderer:r,fallbackLabel:i}){let[a,o]=w(i||n),[s,c]=w(!1);return _(()=>{if(!r){o(i||n);return}(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)}})()},[n,r,i]),s?t(`span`,{className:`text-muted`,children:`Loading...`}):t(e,{children:a})}const ET=({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(gT,{_open:l,onOpenChange:e=>{u(e),e||setTimeout(()=>{f(``)},200)},children:[t(vT,{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(TT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})})():`${i?.length} selected`})}),t(bT,{className:`w-[300px] p-0`,children:t(Kx,{children:n(Vv,{children:[t(Uv,{placeholder:r,className:`h-9`,value:d,onInputCapture:e=>{f(e.currentTarget.value)},ref:p}),n(Wv,{children:[t(Gv,{children:m(`filter.noResultsFound`)}),t(Kv,{children:i.map(e=>n(Jv,{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(TT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})]},e.value))}),h?.length>0&&n(e,{children:[t(qv,{}),t(Kv,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(e=>n(Jv,{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(Lg,{checked:!1,className:`opacity-0 group-data-[selected=true]:opacity-100`}),t(`span`,{className:`text-muted`,children:t(TT,{value:e.value||``,labelRenderer:e.labelRenderer||s,fallbackLabel:e.label})})]},e.value))})]})]})]})})})]})},DT=({filterType:e,filterValues:r,setFilterValues:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(gT,{_open:a,onOpenChange:e=>{o(e),!e&&JSON.stringify(s)!==JSON.stringify(r)&&c(r)},children:[t(vT,{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(bT,{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(ha,{value:s,onChange:c,placeholder:`Add ${e.toLowerCase()}...`}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(K,{size:`sm`,variant:`ghost`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(K,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})]})})]})},OT=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`}}),kT=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:H(OT({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(K,{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(St,{size:16})})]})});kT.displayName=`Input`;const AT=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(gT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(vT,{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(bT,{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(kT,{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(K,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(K,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function jT({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:CT}),t(Vw,{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(K,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(K,{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:CT}),t(Vw,{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 MT({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(Jv,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(TT,{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(K,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(K,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function NT({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(ha,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(K,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(K,{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 PT({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(kT,{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(K,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(K,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function FT(e,n,r){switch(e.type){case`date`:return t(wT,{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(AT,{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(DT,{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(ET,{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 IT({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}),FT(e,r,i),t(K,{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(St,{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 LT=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),RT=({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(HT(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(HT(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(LT.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},zT=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(LT),{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=>HT(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(Gv,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(Jv,{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(gT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(vT,{asChild:!0,children:n(K,{variant:`outline`,role:`combobox`,"aria-expanded":c,"aria-label":s(`filter.filter`),size:`md`,className:H(`transition group flex gap-1.5`,e),children:[t(it,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(bT,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(Vv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(Uv,{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(Wv,{children:t(Kv,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(jT,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(PT,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(NT,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(MT,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},BT=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(LT);return t(`div`,{className:H(e),children:t(IT,{filters:n,setFilters:r,filterGroups:i})})},VT=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(LT),{t:i}=k();return n.filter(e=>e.value?.length>0).length>0?t(K,{variant:`outline`,size:`md`,className:H(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function HT(e){return typeof e==`string`?e:e.value||``}var UT;(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`})(UT||={});const WT=p(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:H({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})});WT.displayName=`Heading`;function GT({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":I}){let L=C(null),[R,ee]=w(!1),[te,ne]=w(0),[re,ie]=w(``),ae=v(),oe=v(),se=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?KT(e,T)===KT(s,T):typeof T==`function`?T(e,s):ge(e,s)),[O,x,s,i,T]);_(()=>{let e=L.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ne(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let ce=e=>{if(x){let t=Array.isArray(s)?s:[];le(e,t)?c(t.filter(t=>!ue(t,e))):c([...t,e])}else c(e)},le=(e,t)=>!t||t.length===0?!1:t.some(t=>ue(t,e)),ue=(e,t)=>e==null||t==null?e===t:typeof T==`string`?KT(e,T)===KT(t,T):typeof T==`function`?T(e,t):ge(e,t),de=i||[];function fe(e){return e?typeof e==`string`?t=>String(KT(t,e)).toLowerCase():e:e=>String(e).toLowerCase()}let pe=re.toLowerCase(),me=fe(f);de=de.filter(e=>me(e).includes(pe));let he=()=>{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},_e=()=>{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`]})]})},ve=(e,r)=>{let i=x?le(e,Array.isArray(s)?s:[]):s!=null&&ue(s,e);return t(Jv,{onSelect:()=>ce(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(Ie,{className:`size-4`})]}):n(xT,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Ie,{className:`size-4`})]})},`option-${r}`)},ye=(()=>{if(!o)return null;let e=[],t=/* @__PURE__ */ new Map;for(let n of de){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})(),be=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1 shrink-0`,children:[t(`div`,{className:`mx-2`,children:t(mt,{className:`size-4`})}),t(kT,{variant:`unstyled`,value:re,onChange:ie,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(Vv,{className:E?`min-h-0 flex-1`:`overflow-hidden`,children:n(Wv,{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(Gv,{children:`No result found.`}),ye?ye.map(e=>t(Kv,{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)=>ve(t,`${e.key}-${n}`))},e.key)):t(Kv,{children:de?.map((e,t)=>ve(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(gt,{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(ot,{className:`size-4 animate-spin`})}):be()});let xe=!!p,Se=M??(xe?void 0:typeof m==`string`?m:void 0),Ce=N??(xe?oe:void 0),we=!!y&&!!s&&(!Array.isArray(s)||s.length>0),Te=I===!0||I===`true`||se?!0:I===!1||I===`false`?!1:void 0;return n(gT,{onOpenChange:ee,children:[n(`div`,{ref:L,className:r(`relative`,h),children:[t(vT,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":R,"aria-controls":ae,"aria-label":Se,"aria-labelledby":Ce,"aria-describedby":F,"aria-invalid":Te,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&&(se||Te?`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`,we&&`pe-10`)),children:D?t(ot,{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:oe,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,se&&`text-destructive`),children:[se&&t(Ui,{description:k,placement:`top`,asChild:!0,children:t(bt,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?_e():he()]})]}),!d&&t(We,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),we&&!D&&t(K,{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(St,{className:`size-4`})})]}),t(bT,{id:ae,style:{width:`${te}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:be()})]})}function KT(e,t){return typeof e==`object`&&e?e[t]:void 0}const qT={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 JT({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(GT,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>qT[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var YT=Object.defineProperty,XT=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ ((e,t)=>YT(e,`name`,{value:t,configurable:!0}))(function(e,n){return/* @__PURE__ */ t(G.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 ZT=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),QT=a.forwardRef(({className:e,required:r,...i},a)=>n(XT,{ref:a,className:H(ZT(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive ms-1`,children:`*`})]}));QT.displayName=XT.displayName;function $T({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(Je,{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(bt,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Ke,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(nt,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(nt,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(nt,{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 eE({title:e,className:r,children:i,action:a,actionLabel:o}){return n($T,{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(K,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function tE({title:e,className:n,children:r}){return t($T,{status:`info`,title:e,className:n,children:r})}function nE({title:e,className:n,children:r}){return t($T,{status:`warning`,title:e,className:n,children:r})}function rE({title:e,className:n,children:r}){return t($T,{status:`success`,title:e,className:n,children:r})}function iE({title:e,className:n,children:r}){return t($T,{status:`default`,title:e,className:n,children:r})}function aE({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(kv,{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(bt,{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(Av,{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(ca,{label:l??u,children:t(kT,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(Mv,{align:`right`,children:[t(K,{variant:`destructive`,onClick:v,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(K,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function oE(){return g(sE)}const sE=d(()=>{}),cE={success:Ke,error:Je,warning:bt,info:nt},lE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function uE({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]||nt,u=lE[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(om,{onExitComplete:r,children:i&&t(Qh.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(St,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function dE({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(rg,{children:t(uE,{data:i,onClose:()=>o(null)})})]})}function fE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=oE();return t(aE,{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 pE=4,mE={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 hE(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 gE({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(Dx,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(kx,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(Re,{className:`ms-1 size-4`})]})}),t(Ax,{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=mE[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=hE(e,e=>e.name===r),h=s(`agent.moreTabs`);return n(`div`,{ref:l,className:H(`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:H(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:d,className:H(c.base,c.inactive),children:[h,t(Re,{className:c.icon})]})]}),n(`div`,{className:H(`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:H(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),p.length>0&&t(gE,{label:h,triggerClassName:H(c.base,m?c.active:c.inactive),icon:t(Re,{className:c.icon}),children:p.map(e=>t(Mx,{disabled:e.disabled,onClick:()=>i(e.name),className:H(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function vE({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?Re:He,{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(aa,{description:o,size:`md`})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,l&&(h?v:t(K,{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 yE=Object.defineProperty,bE=(e,t)=>yE(e,`name`,{value:t,configurable:!0}),xE=`Radio`,[SE,CE]=/* @__PURE__ */ Mn(xE),[wE,TE]=SE(xE);function EE(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__ */ bE(()=>l?.(),`onCheck`)};return/* @__PURE__ */ t(wE,{scope:n,...y,children:NE(f)?f(y):i})}bE(EE,`RadioProvider`);var DE=`RadioTrigger`,OE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,onUserClick:u,isFormControl:d,bubbleInput:f}=TE(DE,e),p=V(i,c);return/* @__PURE__ */ t(G.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":PE(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:p,onClick:U(n,e=>{let t=e.isPropagationStopped();a||(u({hasConsumerStoppedPropagation:t}),l()),f&&d&&(t||e.stopPropagation())})})},`RadioTrigger`)),kE=`RadioIndicator`,AE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=TE(kE,r);return/* @__PURE__ */ t(Nr,{present:i||o.checked,children:/* @__PURE__ */ t(G.span,{"data-state":PE(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),jE=`RadioBubbleInput`,ME=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(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}=TE(jE,e),g=V(i,m),_=cr(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(G.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:U(n,e=>{v.current&&e.stopPropagation()}),style:{...r.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function NE(e){return typeof e==`function`}bE(NE,`isFunction`);function PE(e){return e?`checked`:`unchecked`}bE(PE,`getState`);var FE=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],IE=`RadioGroup`,[LE,RE]=/* @__PURE__ */ Mn(IE,[Dy,CE]),zE=Dy(),BE=CE(),[VE,HE]=LE(IE),UE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(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=zE(r),_=fe(f),[v,y]=qr({prop:c,defaultProp:s??null,onChange:m,caller:IE}),[b,x]=a.useState(null),S=V(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__ */ bE(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),/* @__PURE__ */ t(VE,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:/* @__PURE__ */ t(My,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:/* @__PURE__ */ t(G.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),WE=`RadioGroupItemProvider`,GE=`RadioGroupItemTrigger`;function KE(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=HE(WE,n),c=BE(n),l=s.disabled||i;return/* @__PURE__ */ t(EE,{...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})}bE(KE,`RadioGroupItemProvider`);var qE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=zE(r),s=BE(r),{checked:c,disabled:l}=TE(GE,s.__scopeRadio),u=a.useRef(null),d=V(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=/* @__PURE__ */ bE(e=>{FE.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=/* @__PURE__ */ bE(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),/* @__PURE__ */ t(Fy,{asChild:!0,...o,focusable:!l,active:c,children:/* @__PURE__ */ t(OE,{...s,...i,ref:d,onKeyDown:U(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:U(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),JE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return/* @__PURE__ */ t(KE,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(qE,{...c,ref:i,__scopeRadioGroup:a}),r&&/* @__PURE__ */ t(YE,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),YE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=BE(r);return/* @__PURE__ */ t(ME,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),XE=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ bE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=BE(r);return/* @__PURE__ */ t(AE,{...a,...i,ref:n})},`RadioGroupIndicator`));function ZE({className:e,...n}){return t(JE,{"data-slot":`radio-group-item`,className:H(`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(XE,{"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 QE=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function $E({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(UE,{"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(JE,{value:o(e),className:H(`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 eD({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:H(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function tD(e){return typeof e==`number`?`${e}%`:e}function nD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:tD(e),minSize:tD(n),maxSize:tD(r),collapsedSize:tD(i),...a})}function rD({withHandle:e,className:n,...r}){return t(_e.Separator,{"data-slot":`resizable-handle`,className:H(`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(ct,{className:`size-4 rotate-90`})})})}var iD=Object.defineProperty,aD=(e,t)=>iD(e,`name`,{value:t,configurable:!0}),oD={Horizontal:`horizontal`,Vertical:`vertical`},sD=oD.Horizontal,cD=Object.values(oD),lD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ aD(function(e,n){let{decorative:r,orientation:i=sD,...a}=e,o=uD(i)?i:sD,s=o===oD.Vertical?o:void 0,c=r?{role:`none`}:{"aria-orientation":s,role:`separator`};return/* @__PURE__ */ t(G.div,{"data-orientation":o,...c,...a,ref:n})},`Separator`));function uD(e){return cD.includes(e)}aD(uD,`isValidOrientation`);const dD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(lD,{ref:a,decorative:r,orientation:n,className:H(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));dD.displayName=lD.displayName;var fD=Object.defineProperty,pD=(e,t)=>fD(e,`name`,{value:t,configurable:!0});function mD(e,[t,n]){return Math.min(n,Math.max(t,e))}pD(mD,`clamp`);var hD=Object.defineProperty,$=(e,t)=>hD(e,`name`,{value:t,configurable:!0}),gD={Vertical:`vertical`,Horizontal:`horizontal`},_D={LTR:`ltr`,RTL:`rtl`},vD=[`PageUp`,`PageDown`],yD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],bD={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},xD=`Slider`,[SD,CD,wD]=/* @__PURE__ */ Qv(xD),[TD,ED]=/* @__PURE__ */ Mn(xD,[wD]),[DD,OD]=TD(xD),kD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=gD.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===gD.Horizontal?MD:ND,[T,E]=a.useState(null),D=V(n,E),[O=[],k]=qr({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,ZD(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=nO(s),a=mD(rO(Math.round((e-i)/s)*s+i,r),[i,o]),c=u*s;function l(e){let n=d?mD(a,[e[t-1]===void 0?i:e[t-1]+c,e[t+1]===void 0?o:e[t+1]-c]):a,r=JD(e,n,t);return eO(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(DD,{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(SD.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(SD.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ t(w,{"aria-disabled":l,"data-disabled":l?``:void 0,...v,ref:D,onPointerDown:U(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=vD.includes(e.key)||e.shiftKey&&yD.includes(e.key)?10:1,r=b.current,a=O[r];F(iO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[AD,jD]=TD(xD,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),MD=/* @__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=V(n,m),g=a.useRef(void 0),_=fe(o),v=_===_D.LTR,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=tO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),/* @__PURE__ */ t(AD,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:/* @__PURE__ */ t(PD,{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=bD[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),ND=/* @__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=V(n,f),m=a.useRef(void 0),h=!o;function g(e){let t=m.current||f.current.getBoundingClientRect(),n=tO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),/* @__PURE__ */ t(AD,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:/* @__PURE__ */ t(PD,{"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=bD[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),PD=/* @__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=OD(xD,r);return/* @__PURE__ */ t(G.span,{...u,ref:n,onKeyDown:U(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(c(e),e.preventDefault()):vD.concat(yD).includes(e.key)&&(l(e),e.preventDefault())}),onPointerDown:U(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:U(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:U(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},`SliderImpl`)),FD=`SliderTrack`,ID=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=OD(FD,r);return/* @__PURE__ */ t(G.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),LD=`SliderRange`,RD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,o=OD(LD,r),s=jD(LD,r),c=V(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>YD(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return/* @__PURE__ */ t(G.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...i,ref:c,style:{...e.style,[s.startEdge]:d+`%`,[s.endEdge]:f+`%`}})},`SliderRange`)),[zD,BD]=TD(`SliderThumb`),VD=`SliderThumbProvider`;function HD(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=OD(VD,n),c=CD(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=cr(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:YD(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(zD,{scope:n,..._,children:aO(o)?o(_):i})}$(HD,`SliderThumbProvider`);var UD=`SliderThumbTrigger`,WD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(e,n){let{__scopeSlider:r,...i}=e,a=OD(UD,r),o=jD(UD,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=BD(UD,r),f=V(n,d),p=XD(s,a.values.length),m=u?.[o.size],h=m?QD(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(SD.ItemSlot,{scope:r,children:/* @__PURE__ */ t(G.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:U(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),GD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return/* @__PURE__ */ t(HD,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>/* @__PURE__ */ n(e,{children:[/* @__PURE__ */ t(WD,{...s,ref:i,__scopeSlider:a}),o?/* @__PURE__ */ t(qD,{__scopeSlider:a},r):null]})})},`SliderThumb`)),KD=`SliderBubbleInput`,qD=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ $(function({__scopeSlider:e,onInput:n,...r},i){let{index:o,value:s,name:c,form:l}=BD(KD,e),{userRequestedValues:u}=OD(KD,e),d=a.useRef(null),f=V(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(G.input,{style:{display:`none`},name:c,form:l,...r,ref:f,defaultValue:s,onInput:U(n,e=>{p.current&&e.stopPropagation()})})},`SliderBubbleInput`));function JD(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(JD,`getNextSortedValues`);function YD(e,t,n){return mD(100/(n-t)*(e-t),[0,100])}$(YD,`convertValueToPercentage`);function XD(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(XD,`getLabel`);function ZD(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)}$(ZD,`getClosestValueIndex`);function QD(e,t,n){let r=e/2;return(r-tO([0,50],[0,r])(t)*n)*n}$(QD,`getThumbInBoundsOffset`);function $D(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$($D,`getStepsBetweenValues`);function eO(e,t){if(t>0){let n=$D(e);return Math.min(...n)>=t}return!0}$(eO,`hasMinStepsBetweenValues`);function tO(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])}}$(tO,`linearScale`);function nO(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}$(nO,`getDecimalCount`);function rO(e,t){let n=10**t;return Math.round(e*n)/n}$(rO,`roundValue`);function iO(e,{min:t,step:n,direction:r,multiplier:i}){let a=nO(n),o=(e-t)/n,s=Math.round(o),c=rO(s*n+t,a)===rO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),rO(l*n+t,a)}$(iO,`getNextStepValue`);function aO(e){return typeof e==`function`}$(aO,`isFunction`);const oO=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(kD,{ref:p,"data-slot":`slider`,value:s,defaultValue:c,min:l,max:u,...f,className:H(`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(ID,{"data-slot":`slider-track`,className:H(`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(RD,{"data-slot":`slider-range`,className:H(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(GD,{"data-slot":`slider-thumb`,"aria-label":d,className:H(`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))]})});oO.displayName=kD.displayName;var sO=Object.defineProperty,cO=(e,t)=>sO(e,`name`,{value:t,configurable:!0}),lO=`Switch`,[uO,dO]=/* @__PURE__ */ Mn(lO),[fO,pO]=uO(lO);function mO(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]=qr({prop:r,defaultProp:o??!1,onChange:u,caller:lO}),[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(fO,{scope:n,...S,children:SO(p)?p(S):i})}cO(mO,`SwitchProvider`);var hO=`SwitchTrigger`,gO=/* @__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}=pO(hO,e),_=V(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(G.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":CO(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:_,onClick:U(n,e=>{let t=e.isPropagationStopped();m({requestedChecked:!u,hasConsumerStoppedPropagation:t}),p(e=>!e),g&&h&&(t||e.stopPropagation())})})},`SwitchTrigger`)),_O=/* @__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(mO,{__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(gO,{...m,ref:i,__scopeSwitch:a}),r&&/* @__PURE__ */ t(xO,{__scopeSwitch:a})]})})},`Switch`)),vO=`SwitchThumb`,yO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ cO(function(e,n){let{__scopeSwitch:r,...i}=e,a=pO(vO,r);return/* @__PURE__ */ t(G.span,{"data-state":CO(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),bO=`SwitchBubbleInput`,xO=/* @__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}=pO(bO,e),_=V(i,g),v=cr(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(G.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:U(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function SO(e){return typeof e==`function`}cO(SO,`isFunction`);function CO(e){return e?`checked`:`unchecked`}cO(CO,`getState`);const wO={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 TO({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=wO[r],f=t(_O,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:H(`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(yO,{"data-slot":`switch-thumb`,className:H(`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:H(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}var EO=Object.defineProperty,DO=(e,t)=>EO(e,`name`,{value:t,configurable:!0}),OO={Automatic:`automatic`,Manual:`manual`},kO=`Tabs`,[AO,jO]=/* @__PURE__ */ Mn(kO,[Dy]),MO=Dy(),[NO,PO]=AO(kO),FO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ DO(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=OO.Automatic,...u}=e,d=fe(c),[f,p]=qr({prop:i,onChange:a,defaultProp:o??``,caller:kO});return/* @__PURE__ */ t(NO,{scope:r,baseId:W(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:/* @__PURE__ */ t(G.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),IO=`TabsList`,LO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ DO(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=PO(IO,r),s=MO(r);return/* @__PURE__ */ t(My,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:/* @__PURE__ */ t(G.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),RO=`TabsTrigger`,zO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ DO(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=PO(RO,r),c=MO(r),l=HO(s.baseId,i),u=UO(s.baseId,i),d=i===s.value;return/* @__PURE__ */ t(Fy,{asChild:!0,...c,focusable:!a,active:d,children:/* @__PURE__ */ t(G.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:U(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),s.onValueChange(i)):e.preventDefault()}),onKeyDown:U(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:U(e.onFocus,()=>{let e=s.activationMode!==OO.Manual;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),BO=`TabsContent`,VO=/* @__PURE__ */ a.forwardRef(/* @__PURE__ */ DO(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=PO(BO,r),u=HO(l.baseId,i),d=UO(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(Nr,{present:o||f,children:({present:r})=>/* @__PURE__ */ t(G.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 HO(e,t){return`${e}-trigger-${t}`}DO(HO,`makeTriggerId`);function UO(e,t){return`${e}-content-${t}`}DO(UO,`makeContentId`);const WO=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),GO=({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(WO.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(FO,{orientation:e,defaultValue:g||h[0]?.name,value:g,onValueChange:v,className:H(`flex-1 flex flex-col min-h-0 px-2`,c&&`h-full`,o),children:l})})},KO=({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(WO),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(GT,{label:`Tab`,className:H(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(JO,{size:c,variant:f,className:H(_?`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(YO,{className:H(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))})]})},qO=({className:n})=>{let{tabs:r}=a.useContext(WO);return r?t(e,{children:r.map(e=>t(XO,{value:e.name,className:n,children:e.content},e.name))}):null},JO=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(WO.Provider,{value:{size:n,variant:r},children:t(LO,{ref:a,className:H(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));JO.displayName=LO.displayName;const YO=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(WO),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(zO,{ref:o,className:H(r===`tabs`?H(`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`):H(`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})});YO.displayName=zO.displayName;const XO=a.forwardRef(({className:e,...n},r)=>t(VO,{ref:r,className:H(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));XO.displayName=VO.displayName;const ZO=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`}}),QO=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:H(ZO({size:n,weight:r,className:e})),...i}));QO.displayName=`Text`;function $O({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:H(`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 ek=d({theme:`system`,setTheme:()=>null});function tk({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(ek.Provider,{...i,value:c,children:e})}const nk=()=>{let e=g(ek);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function rk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(K,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function ik({label:e,className:r}={}){let{setTheme:i,theme:a}=nk(),{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(rk,{current:a,option:`system`,setTheme:i,icon:t(Xe,{}),alt:o(`theme.system`)}),t(rk,{current:a,option:`light`,setTheme:i,icon:t(vt,{}),alt:o(`theme.light`)}),t(rk,{current:a,option:`dark`,setTheme:i,icon:t(ut,{}),alt:o(`theme.dark`)})]})]})}function ak(e,n){return{label:String(e),check:t(n?Ie:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function ok({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(kT,{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(ak(e,r),i)):i=ak(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(K,{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(rg,{children:t(om,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(Qh.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(Qh.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(ct,{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(lk,{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 lk({onClose:e}){return t(K,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(St,{className:`size-6`,"aria-hidden":`true`})})}function uk(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 dk=d(void 0),fk=dk.Provider;function pk({size:e,className:i}){let a=uk(e||`md`),o=g(dk);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 mk({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(hT),[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),I=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 L=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},R=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},ee=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(vT,{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=>ee(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors flex-shrink-0`,children:t(St,{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=>ee(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(St,{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&&I>0){e.preventDefault(),e.stopPropagation(),b===P.length&&F?R(v):b<P.length&&L(P[b]);return}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),M?x(e=>e<I-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(bT,{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:()=>L(e),onKeyDown:la(()=>L(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(K,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>R(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 hk(e){return t(gT,{click:!0,children:t(mk,{...e})})}function gk({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 _k({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 vk({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 yk({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(vk,{columns:n},e)):i})}function bk({className:e,children:n,...i}){return t(`tr`,{className:r(`hover:bg-muted hover:cursor-pointer`,e),...i,children:n})}function xk({scope:e=`col`,children:n,...r}){return t(`th`,{scope:e,...r,children:n})}function Sk({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 Ck=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 wk(e){let t=o.createContext(void 0);return e.Context=t,t.Provider}var Tk=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 Ek(e){let t=e.Context;if(!t)throw Error(`Context not defined for ${e.name}`);return g(t)}function Dk(e){let[t,n]=w(e.value);return _(()=>e.watch(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Ok(e,t){return _(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function kk(e,t){_(()=>e.watch(t),[e,t])}function Ak(e){let[t,n]=w(e.current);return _(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function jk(e,t){_(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function Mk(e,t){_(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}var Nk=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=[]}},Pk=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 Fk(e){let[t,n]=w(e.value);return _(()=>e.addWatcher(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Ik(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 Lk(){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 Rk(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 zk(e,t){let[n,r]=w(e);return _(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function Bk(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 Vk(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=Bk(e,a,o))}):t=Bk(e,a,o),()=>{n=!0,t?.()}},[e])}function Hk(e){return e instanceof Error?e:Error(String(e))}function Uk(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=Hk(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 Wk(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),Uk(e,t)}function Gk(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 Kk(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 qk(){let e=C(!0);return _(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const Jk=typeof window<`u`?x:_;function Yk(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]),Kk(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 Xk(e,t=[]){return Yk({...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 Zk=class{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}};function Qk(e){return new Zk(w(e))}function $k(...e){return j(i(e))}function eA(e){return typeof e==`object`&&!!e&&`message`in e}function tA(e,t=`An error occurred`){return e instanceof Error?e.message:typeof e==`string`?e:eA(e)&&typeof e.message==`string`?e.message:t}function nA(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{Kx as AnimateChangeInHeight,ye as Avatar,da as Badge,ig as Breadcrumbs,K as Button,pg as Card,_g as CardContent,gg as CardDescription,vg as CardFooter,mg as CardHeader,hg as CardTitle,xe as Center,Lg as Checkbox,Se as CloudIcon,Qg as Collapsible,e_ as CollapsibleContent,$g as CollapsibleTrigger,Ut as ComboBox,Vv as Command,Hv as CommandDialog,Gv as CommandEmpty,Kv as CommandGroup,Uv as CommandInput,Jv as CommandItem,Wv as CommandList,qv as CommandSeparator,Yv as CommandShortcut,Nk as ComputedProperty,aE as ConfirmModal,Ji as CopyButton,It as DOMPopup,wT as DateCombobox,iE as DefaultBox,fE as DeleteModal,Nv as Dialog,Iv as DialogClose,Rv as DialogContent,zv as DialogDescription,Lv as DialogOverlay,Fv as DialogPortal,Bv as DialogTitle,Pv as DialogTrigger,Qt as Divider,ma as DotBadge,ea as DropZone,Ux as Dropdown,Dx as DropdownMenu,Nx as DropdownMenuCheckboxItem,Ax as DropdownMenuContent,jx as DropdownMenuGroup,Mx as DropdownMenuItem,Ix as DropdownMenuLabel,Ox as DropdownMenuPortal,Px as DropdownMenuRadioGroup,Fx as DropdownMenuRadioItem,Lx as DropdownMenuSeparator,Rx as DropdownMenuShortcut,zx as DropdownMenuSub,Vx as DropdownMenuSubContent,Bx as DropdownMenuSubTrigger,kx as DropdownMenuTrigger,Yi as EmptyCollection,eE as ErrorBox,$i as FileUploadInput,BT as FilterBar,zT as FilterBtn,VT as FilterClear,UT as FilterOperator,RT as FilterProvider,ca as FormItem,WT as Heading,tE as InfoBox,aa as InfoTip,kT as Input,ha as InputList,QT as Label,JT as LanguageSwitcher,ga as Link,Wx as MenuGroup,Gx as MenuItem,_a as MenuList,$T as MessageBox,kv as Modal,jv as ModalBody,Ov as ModalContextProvider,Mv as ModalFooter,Av as ModalTitle,rk as ModeOption,ik as ModeToggle,xa as NumberInput,pE as OVERFLOW_TAB_GAP_PX,zt as OptionAdapter,gE as OverflowMoreMenu,_E as OverflowTabsBar,$h as Overlay,vE as Panel,gT as Popover,yT as PopoverAnchor,xT as PopoverClose,bT as PopoverContent,hT as PopoverContext,vT as PopoverTrigger,Lt as Popup,Nt as PopupController,rg as Portal,Fi as PortalContainerContext,Li as PortalContainerProvider,Ck as Property,$E as RadioGroup,QE as RadioGroupAdapter,ZE as RadioGroupItem,rD as ResizableHandle,nD as ResizablePanel,eD as ResizablePanelGroup,vk as RowSkeleton,GT as SelectBox,ok as SelectList,ET as SelectionCombobox,dD as Separator,Pk as SharedState,Zk as SharedValue,ck as SidePanel,Zt as SimpleCombobox,oO as Slider,Tk as Slot,Sk as SortableTableHeaderCell,pk as Spinner,fk as SpinnerIconProvider,DT as StringListCombobox,Bt as StringOptionAdapter,Vt as StringOptionAdapterWithCreate,ya as Styles,rE as SuccessBox,be as SvgAvatar,TO as Switch,yk as TBody,_k as THead,bk as TR,gk as Table,xk as TableHeaderCell,GO as Tabs,KO as TabsBar,XO as TabsContent,JO as TabsList,qO as TabsPanel,YO as TabsTrigger,hk as TagsInput,QO as Text,AT as TextCombobox,$O as Textarea,tk as ThemeProvider,ek as ThemeProviderContext,sE as ToastContext,dE as ToastProvider,Bi as Tooltip,Hi as TooltipContent,zi as TooltipProvider,Vi as TooltipTrigger,Ui as VTooltip,nE as WarningBox,qi as buttonVariants,$k as cn,Ot as computePosition,wk as createCompositeStateProvider,tA as errorMessage,Ht as getDefaultComboBoxLayout,nA as insertNewlineAtCursor,la as onActivateKey,Ik as useClickOutside,qt as useComboboxCtrl,Ek as useCompositeState,Lk as useCopyToClipboard,Rk as useDarkMode,zk as useDebounce,Xk as useDefaultScrollableSearch,Mk as useDefineSlot,ia as useDropZone,Vk as useEventSource,Uk as useFetch,Wk as useFetchOnce,Gk as useFlag,Dk as useGetCompositeStateProperty,Kk as useIntersectionObserver,qk as useIsFirstRendering,Dv as useIsInModal,hE as useOverflowTabs,ST as usePopoverContext,Ft as usePopupController,Ri as usePortalContainer,Jk as useSafeLayoutEffect,Yk as useScrollableSearch,Ok as useSetCompositeStateProperty,Qk as useSharedValue,Ak as useSlot,nk as useTheme,oE as useToast,kk as useWatchCompositeStateProperty,Fk as useWatchSharedState,jk as useWatchSlot};
|
|
340
340
|
//# sourceMappingURL=vertesia-ui-core.js.map
|