@vertesia/ui 1.6.0-dev.20260912.110338Z → 1.6.0-dev.20260918.063824Z

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.
Files changed (89) hide show
  1. package/lib/env/index.d.ts +10 -4
  2. package/lib/env/index.d.ts.map +1 -1
  3. package/lib/env/index.js +8 -0
  4. package/lib/env/index.js.map +1 -1
  5. package/lib/features/agent/PayloadBuilder.d.ts.map +1 -1
  6. package/lib/features/agent/PayloadBuilder.js +6 -1
  7. package/lib/features/agent/PayloadBuilder.js.map +1 -1
  8. package/lib/features/agent/chat/AgentRunFeedback.d.ts +7 -0
  9. package/lib/features/agent/chat/AgentRunFeedback.d.ts.map +1 -1
  10. package/lib/features/agent/chat/AgentRunFeedback.js +13 -1
  11. package/lib/features/agent/chat/AgentRunFeedback.js.map +1 -1
  12. package/lib/features/agent/chat/ModernAgentConversation.js +4 -3
  13. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  14. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +2 -2
  15. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  16. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +2 -2
  17. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  18. package/lib/features/agent/chat/hooks/useAgentPlans.d.ts +1 -1
  19. package/lib/features/agent/chat/hooks/useAgentPlans.d.ts.map +1 -1
  20. package/lib/features/agent/chat/hooks/useAgentPlans.js +5 -5
  21. package/lib/features/agent/chat/hooks/useAgentPlans.js.map +1 -1
  22. package/lib/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
  23. package/lib/features/store/objects/search/DocumentSearchContext.js +6 -1
  24. package/lib/features/store/objects/search/DocumentSearchContext.js.map +1 -1
  25. package/lib/features/user/UserInfo.d.ts +2 -0
  26. package/lib/features/user/UserInfo.d.ts.map +1 -1
  27. package/lib/session/UserSessionProvider.js +3 -3
  28. package/lib/session/UserSessionProvider.js.map +1 -1
  29. package/lib/session/auth/domainRouting.d.ts +3 -4
  30. package/lib/session/auth/domainRouting.d.ts.map +1 -1
  31. package/lib/session/auth/domainRouting.js +3 -4
  32. package/lib/session/auth/domainRouting.js.map +1 -1
  33. package/lib/session/auth/firebase.d.ts.map +1 -1
  34. package/lib/session/auth/firebase.js +10 -0
  35. package/lib/session/auth/firebase.js.map +1 -1
  36. package/lib/shell/login/SignInAuthPending.js +1 -1
  37. package/lib/shell/login/SignInAuthPending.js.map +1 -1
  38. package/lib/shell/login/SignInEmailStep.d.ts.map +1 -1
  39. package/lib/shell/login/SignInEmailStep.js +2 -2
  40. package/lib/shell/login/SignInEmailStep.js.map +1 -1
  41. package/lib/shell/login/SignInIcons.d.ts +1 -1
  42. package/lib/shell/login/SignInIcons.d.ts.map +1 -1
  43. package/lib/shell/login/signInUtils.d.ts +1 -1
  44. package/lib/shell/login/signInUtils.d.ts.map +1 -1
  45. package/lib/shell/login/signInUtils.js +5 -6
  46. package/lib/shell/login/signInUtils.js.map +1 -1
  47. package/lib/vertesia-ui-core.js +83 -41
  48. package/lib/vertesia-ui-core.js.map +1 -1
  49. package/lib/vertesia-ui-env.js +1 -1
  50. package/lib/vertesia-ui-env.js.map +1 -1
  51. package/lib/vertesia-ui-features.js +336 -317
  52. package/lib/vertesia-ui-features.js.map +1 -1
  53. package/lib/vertesia-ui-layout.js +43 -19
  54. package/lib/vertesia-ui-layout.js.map +1 -1
  55. package/lib/vertesia-ui-rich-text.js +123 -74
  56. package/lib/vertesia-ui-rich-text.js.map +1 -1
  57. package/lib/vertesia-ui-router.js.map +1 -1
  58. package/lib/vertesia-ui-session.js +1 -1
  59. package/lib/vertesia-ui-session.js.map +1 -1
  60. package/lib/vertesia-ui-shell.js +57 -28
  61. package/lib/vertesia-ui-shell.js.map +1 -1
  62. package/lib/vertesia-ui-widgets.js +153 -97
  63. package/lib/vertesia-ui-widgets.js.map +1 -1
  64. package/lib/widgets/xml-viewer/hooks/useCollapsible.d.ts +1 -1
  65. package/package.json +20 -20
  66. package/src/env/index.test.ts +48 -0
  67. package/src/env/index.ts +15 -2
  68. package/src/features/agent/PayloadBuilder.tsx +6 -1
  69. package/src/features/agent/chat/AgentRunFeedback.test.tsx +18 -1
  70. package/src/features/agent/chat/AgentRunFeedback.tsx +13 -0
  71. package/src/features/agent/chat/ModernAgentConversation.test.tsx +1 -1
  72. package/src/features/agent/chat/ModernAgentConversation.tsx +6 -5
  73. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +2 -2
  74. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +2 -2
  75. package/src/features/agent/chat/hooks/useAgentPlans.test.ts +52 -0
  76. package/src/features/agent/chat/hooks/useAgentPlans.ts +5 -5
  77. package/src/features/store/objects/search/DocumentSearchContext.ts +8 -3
  78. package/src/router/path.test.ts +5 -5
  79. package/src/session/UserSessionProvider.tsx +3 -3
  80. package/src/session/auth/auth-flow.md +21 -9
  81. package/src/session/auth/domainRouting.test.ts +1 -1
  82. package/src/session/auth/domainRouting.ts +3 -4
  83. package/src/session/auth/firebase.test.ts +25 -0
  84. package/src/session/auth/firebase.ts +10 -0
  85. package/src/shell/login/SignInAuthPending.tsx +3 -3
  86. package/src/shell/login/SignInEmailStep.test.tsx +32 -0
  87. package/src/shell/login/SignInEmailStep.tsx +13 -9
  88. package/src/shell/login/signInUtils.ts +12 -4
  89. package/src/widgets/markdown/CollaborativeMarkdownRenderer.test.tsx +11 -3
@@ -1,191 +1,233 @@
1
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{arrow as P,autoUpdate as ee,computePosition as te,flip as F,hide as ne,limitShift as re,offset as ie,shift as ae,size as oe}from"@floating-ui/dom";import{Env as se}from"@vertesia/ui/env";import{FocusScope as ce}from"@radix-ui/react-focus-scope";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`,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-white`,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})}
2
2
  /**
3
- * @license lucide-react v1.40.0 - ISC
3
+ * @license lucide-react v1.45.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
- const Se=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ce=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),we=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Te=e=>{
8
+ const Se=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();
9
9
  /**
10
- * @license lucide-react v1.40.0 - ISC
10
+ * @license lucide-react v1.45.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
14
  */
15
+ function Ce(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Se(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}
15
16
  /**
16
- * @license lucide-react v1.40.0 - ISC
17
+ * @license lucide-react v1.45.0 - ISC
17
18
  *
18
19
  * This source code is licensed under the ISC license.
19
20
  * See the LICENSE file in the root directory of this source tree.
20
21
  */
22
+ const we=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},Te=e=>{
21
23
  /**
22
- * @license lucide-react v1.40.0 - ISC
24
+ * @license lucide-react v1.45.0 - ISC
23
25
  *
24
26
  * This source code is licensed under the ISC license.
25
27
  * See the LICENSE file in the root directory of this source tree.
26
28
  */
27
- let t=we(e);return t.charAt(0).toUpperCase()+t.slice(1)};
29
+ let t=we(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ee=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),De={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`}
28
30
  /**
29
- * @license lucide-react v1.40.0 - ISC
31
+ * @license lucide-react v1.45.0 - ISC
30
32
  *
31
33
  * This source code is licensed under the ISC license.
32
34
  * See the LICENSE file in the root directory of this source tree.
33
35
  */
34
- var Ee={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};
35
36
  /**
36
- * @license lucide-react v1.40.0 - ISC
37
+ * @license lucide-react v1.45.0 - ISC
37
38
  *
38
39
  * This source code is licensed under the ISC license.
39
40
  * See the LICENSE file in the root directory of this source tree.
40
41
  */
41
- const De=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Oe=d({}),ke=()=>g(Oe),Ae=p(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{
42
+ ;
42
43
  /**
43
- * @license lucide-react v1.40.0 - ISC
44
+ * @license lucide-react v1.45.0 - ISC
44
45
  *
45
46
  * This source code is licensed under the ISC license.
46
47
  * See the LICENSE file in the root directory of this source tree.
47
48
  */
49
+ function Oe(e){return e!=null}function ke(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??De.width,a=e.size??e.height??De.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?Ee(...c):Ee(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??De[`stroke-width`])*Number(e.size??e.width??De.width)/Number(t.size??t.width??De.width):t.strokeWidth??De[`stroke-width`];return[`svg`,{...Object.entries(De).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Oe(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Oe(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Oe(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]})]}
48
50
  /**
49
- * @license lucide-react v1.40.0 - ISC
51
+ * @license lucide-react v1.45.0 - ISC
50
52
  *
51
53
  * This source code is licensed under the ISC license.
52
54
  * See the LICENSE file in the root directory of this source tree.
53
55
  */
54
- let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:p=`currentColor`,className:m=``}=ke()??{},h=r??d?Number(n??u)*24/Number(t??l):n??u;return f(`svg`,{ref:c,...Ee,width:t??l??Ee.width,height:t??l??Ee.height,stroke:e??p,strokeWidth:h,className:Se(`lucide`,m,i),...!a&&!De(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>f(e,t)),...Array.isArray(a)?a:[a]])}),I=(e,t)=>{
56
+ function Ae(e,t={}){return ke(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}
55
57
  /**
56
- * @license lucide-react v1.40.0 - ISC
58
+ * @license lucide-react v1.45.0 - ISC
57
59
  *
58
60
  * This source code is licensed under the ISC license.
59
61
  * See the LICENSE file in the root directory of this source tree.
60
62
  */
61
- let n=p(({className:n,...r},i)=>f(Ae,{ref:i,iconNode:t,className:Se(`lucide-${Ce(Te(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Te(e),n},je=I(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Me=I(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ne=I(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Pe=I(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Fe=I(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Ie=I(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]]),Le=I(`circle-x`,[[`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`}]]),Re=I(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),L=I(`copy`,[[`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`}]]),ze=I(`ellipsis`,[[`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`}]]),Be=I(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Ve=I(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),He=I(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ue=I(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),We=I(`moon`,[[`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`}]]),Ge=I(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Ke=I(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),qe=I(`square-plus`,[[`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`}]]),Je=I(`sun`,[[`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`}]]),Ye=I(`triangle-alert`,[[`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`}]]),Xe=I(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]])
63
+ const je=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Me=d({}),Ne=()=>g(Me),Pe=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)=>{
62
64
  /**
63
- * @license lucide-react v1.40.0 - ISC
65
+ * @license lucide-react v1.45.0 - ISC
64
66
  *
65
67
  * This source code is licensed under the ISC license.
66
68
  * See the LICENSE file in the root directory of this source tree.
67
69
  */
68
70
  /**
69
- * @license lucide-react v1.40.0 - ISC
71
+ * @license lucide-react v1.45.0 - ISC
70
72
  *
71
73
  * This source code is licensed under the ISC license.
72
74
  * See the LICENSE file in the root directory of this source tree.
73
75
  */
76
+ let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=Ne()??{},b=!!c||je(d),[x,S,C=[]]=Ae(u,{color:e??v,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:Ee(y,s),hasA11yProp:b,attributes:d});return f(x,{ref:p,...S},[...C.map(([e,t])=>f(e,t)),...Array.isArray(c)?c:[c]])});
74
77
  /**
75
- * @license lucide-react v1.40.0 - ISC
78
+ * @license lucide-react v1.45.0 - ISC
76
79
  *
77
80
  * This source code is licensed under the ISC license.
78
81
  * See the LICENSE file in the root directory of this source tree.
79
82
  */
83
+ function I(e,t=[],n=[]){let r=typeof e==`string`?Ce(e,t,n):e,i=p(({className:e,...t},n)=>f(Pe,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Te(r.name)),i}
80
84
  /**
81
- * @license lucide-react v1.40.0 - ISC
85
+ * @license lucide-react v1.45.0 - ISC
82
86
  *
83
87
  * This source code is licensed under the ISC license.
84
88
  * See the LICENSE file in the root directory of this source tree.
85
89
  */
90
+ const Fe={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Fe.node;const L=I(Fe),Ie={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}
86
91
  /**
87
- * @license lucide-react v1.40.0 - ISC
92
+ * @license lucide-react v1.45.0 - ISC
88
93
  *
89
94
  * This source code is licensed under the ISC license.
90
95
  * See the LICENSE file in the root directory of this source tree.
91
96
  */
97
+ ;Ie.node;const Le=I(Ie),R={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}
92
98
  /**
93
- * @license lucide-react v1.40.0 - ISC
99
+ * @license lucide-react v1.45.0 - ISC
94
100
  *
95
101
  * This source code is licensed under the ISC license.
96
102
  * See the LICENSE file in the root directory of this source tree.
97
103
  */
104
+ ;R.node;const Re=I(R),ze={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]}
98
105
  /**
99
- * @license lucide-react v1.40.0 - ISC
106
+ * @license lucide-react v1.45.0 - ISC
100
107
  *
101
108
  * This source code is licensed under the ISC license.
102
109
  * See the LICENSE file in the root directory of this source tree.
103
110
  */
111
+ ;ze.node;const Be=I(ze),Ve={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`}]]}
104
112
  /**
105
- * @license lucide-react v1.40.0 - ISC
113
+ * @license lucide-react v1.45.0 - ISC
106
114
  *
107
115
  * This source code is licensed under the ISC license.
108
116
  * See the LICENSE file in the root directory of this source tree.
109
117
  */
118
+ ;Ve.node;const He=I(Ve),Ue={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`]}
110
119
  /**
111
- * @license lucide-react v1.40.0 - ISC
120
+ * @license lucide-react v1.45.0 - ISC
112
121
  *
113
122
  * This source code is licensed under the ISC license.
114
123
  * See the LICENSE file in the root directory of this source tree.
115
124
  */
125
+ ;Ue.node;const We=I(Ue),Ge={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`]}
116
126
  /**
117
- * @license lucide-react v1.40.0 - ISC
127
+ * @license lucide-react v1.45.0 - ISC
118
128
  *
119
129
  * This source code is licensed under the ISC license.
120
130
  * See the LICENSE file in the root directory of this source tree.
121
131
  */
132
+ ;Ge.node;const Ke=I(Ge),qe={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`}]]}
122
133
  /**
123
- * @license lucide-react v1.40.0 - ISC
134
+ * @license lucide-react v1.45.0 - ISC
124
135
  *
125
136
  * This source code is licensed under the ISC license.
126
137
  * See the LICENSE file in the root directory of this source tree.
127
138
  */
139
+ ;qe.node;const Je=I(qe),Ye={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`}]]}
128
140
  /**
129
- * @license lucide-react v1.40.0 - ISC
141
+ * @license lucide-react v1.45.0 - ISC
130
142
  *
131
143
  * This source code is licensed under the ISC license.
132
144
  * See the LICENSE file in the root directory of this source tree.
133
145
  */
146
+ ;Ye.node;const Xe=I(Ye),Ze={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`]}
134
147
  /**
135
- * @license lucide-react v1.40.0 - ISC
148
+ * @license lucide-react v1.45.0 - ISC
136
149
  *
137
150
  * This source code is licensed under the ISC license.
138
151
  * See the LICENSE file in the root directory of this source tree.
139
152
  */
153
+ ;Ze.node;const Qe=I(Ze),$e={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`}]]}
140
154
  /**
141
- * @license lucide-react v1.40.0 - ISC
155
+ * @license lucide-react v1.45.0 - ISC
142
156
  *
143
157
  * This source code is licensed under the ISC license.
144
158
  * See the LICENSE file in the root directory of this source tree.
145
159
  */
160
+ ;$e.node;const et=I($e),tt={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]}
146
161
  /**
147
- * @license lucide-react v1.40.0 - ISC
162
+ * @license lucide-react v1.45.0 - ISC
148
163
  *
149
164
  * This source code is licensed under the ISC license.
150
165
  * See the LICENSE file in the root directory of this source tree.
151
166
  */
167
+ ;tt.node;const nt=I(tt),rt={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]}
152
168
  /**
153
- * @license lucide-react v1.40.0 - ISC
169
+ * @license lucide-react v1.45.0 - ISC
154
170
  *
155
171
  * This source code is licensed under the ISC license.
156
172
  * See the LICENSE file in the root directory of this source tree.
157
173
  */
174
+ ;rt.node;const it=I(rt),at={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]}
158
175
  /**
159
- * @license lucide-react v1.40.0 - ISC
176
+ * @license lucide-react v1.45.0 - ISC
160
177
  *
161
178
  * This source code is licensed under the ISC license.
162
179
  * See the LICENSE file in the root directory of this source tree.
163
180
  */
181
+ ;at.node;const ot=I(at),st={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`}]]}
164
182
  /**
165
- * @license lucide-react v1.40.0 - ISC
183
+ * @license lucide-react v1.45.0 - ISC
166
184
  *
167
185
  * This source code is licensed under the ISC license.
168
186
  * See the LICENSE file in the root directory of this source tree.
169
187
  */
188
+ ;st.node;const ct=I(st),lt={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]}
170
189
  /**
171
- * @license lucide-react v1.40.0 - ISC
190
+ * @license lucide-react v1.45.0 - ISC
172
191
  *
173
192
  * This source code is licensed under the ISC license.
174
193
  * See the LICENSE file in the root directory of this source tree.
175
194
  */
195
+ ;lt.node;const ut=I(lt),dt={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]}
176
196
  /**
177
- * @license lucide-react v1.40.0 - ISC
197
+ * @license lucide-react v1.45.0 - ISC
178
198
  *
179
199
  * This source code is licensed under the ISC license.
180
200
  * See the LICENSE file in the root directory of this source tree.
181
201
  */
202
+ ;dt.node;const ft=I(dt),pt={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`]}
182
203
  /**
183
- * @license lucide-react v1.40.0 - ISC
204
+ * @license lucide-react v1.45.0 - ISC
184
205
  *
185
206
  * This source code is licensed under the ISC license.
186
207
  * See the LICENSE file in the root directory of this source tree.
187
208
  */
188
- ;function Ze(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 Qe(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var $e=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=Qe(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=Ze(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 tt(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function nt(e,t,n,r){let i=new $e(e.gap),a=i.computePosition(e,t,n),o=tt(a.rect,r,`x`),s=tt(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 $e(i.gap).computePosition(c,t,n),et(a.rect,r)?a:null):null}function rt(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 it(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=rt(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 ot(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 st=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=ot(this.anchor,this.root),this.visibleClientRect=it(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=nt(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 ct=d(void 0);function lt(){let e=g(ct);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function ut({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 st({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(ct.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 dt({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(ut,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function ft(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var pt=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}},mt=class e extends pt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},ht=class e extends mt{createItem(e){return e}static instance=new e};function gt(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:vt,Menu:bt,Toggle:yt}}function _t({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(ft()),S=C(void 0),T=C(null),E=p?Object.assign(gt(d,u),p):gt(d,u),D=o.useRef(null),O=xt({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(dt,{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 vt({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(Xe,{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 yt({ctrl:e}){return e.isMenuOpen?t(Pe,{className:`w-4 h-4`}):t(Me,{className:`w-4 h-4`})}function bt({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 xt(e){let[t,n]=w(new St(e));return _(()=>{t?.withState(n)},[t]),t}var St=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:Ct(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:wt(this.highlightedIndex,e.length),!0)}}}};function Ct(e,t){return(e+1)%t}function wt(e,t){return(e-1+t)%t}function Tt({options:e,creatable:n,...r}){let i=n?ht.instance:mt.instance;return t(_t,{adapter:i,items:e,...r})}function Et({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var Dt=Object.defineProperty,Ot=(e,t)=>Dt(e,`name`,{value:t,configurable:!0});function kt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ot(kt,`setRef`);function At(...e){return t=>{let n=!1,r=e.map(e=>{let r=kt(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():kt(e[t],null)}}}}Ot(At,`composeRefs`);function R(...e){return a.useCallback(At(...e),e)}Ot(R,`useComposedRefs`);var jt=Object.defineProperty,Mt=(e,t)=>jt(e,`name`,{value:t,configurable:!0});function Nt(e){let t=a.forwardRef((t,n)=>{let{children:r,...i}=t,o=null,s=!1,c=[];Ht(r)&&typeof Kt==`function`&&(r=Kt(r._payload)),a.Children.forEach(r,e=>{if(Bt(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ht(n)&&typeof Kt==`function`&&(n=Kt(n._payload)),o=Lt(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?zt(o):void 0,u=R(n,l);if(!o){if(r||r===0)throw Error(s?Gt(e):Wt(e));return r}let d=Rt(i,o.props??{});return o.type!==a.Fragment&&(d.ref=n?u:l),a.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}Mt(Nt,`createSlot`);var Pt=Nt(`Slot`),Ft=Symbol.for(`radix.slottable`);function It(e){let t=Mt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Ft,t}Mt(It,`createSlottable`);var Lt=Mt((e,t)=>{if(`child`in e.props){let t=e.props.child;return a.isValidElement(t)?a.cloneElement(t,void 0,e.props.children(t.props.children)):null}return a.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Rt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Mt(Rt,`mergeProps`);function zt(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)}Mt(zt,`getElementRef`);function Bt(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ft}Mt(Bt,`isSlottable`);var Vt=Symbol.for(`react.lazy`);function Ht(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Vt&&`_payload`in e&&Ut(e._payload)}Mt(Ht,`isLazyComponent`);function Ut(e){return typeof e==`object`&&!!e&&`then`in e}Mt(Ut,`isPromiseLike`);var Wt=Mt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Gt=Mt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Kt=a.use;function z(...e){return j(i(e))}var qt=Object.defineProperty,Jt=(e,t)=>qt(e,`name`,{value:t,configurable:!0}),Yt=!!(typeof window<`u`&&window.document&&window.document.createElement);function B(e,t,{checkForDefaultPrevented:n=!0}={}){return Jt(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Jt(B,`composeEventHandlers`);function Xt(e){if(!Yt)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Jt(Xt,`getOwnerWindow`);function Zt(e){if(!Yt)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Jt(Zt,`getOwnerDocument`);function Qt(e,t=!1){let{activeElement:n}=Zt(e);if(!n?.nodeName)return null;if($t(n)&&n.contentDocument)return Qt(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Zt(n).getElementById(e);if(t)return t}}return n}Jt(Qt,`getActiveElement`);function $t(e){return e.tagName===`IFRAME`}Jt($t,`isFrame`);var en=Object.defineProperty,tn=(e,t)=>en(e,`name`,{value:t,configurable:!0});function nn(e,n){let r=a.createContext(n);r.displayName=e+`Context`;let i=tn(e=>{let{children:n,...i}=e,o=a.useMemo(()=>i,Object.values(i));return 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 tn(o,`useContext`),[i,o]}tn(nn,`createContext`);function rn(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=tn(n=>{let{scope:r,children:i,...c}=n,l=r?.[e]?.[s]||o,u=a.useMemo(()=>c,Object.values(c));return 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 tn(l,`useContext`),[c,l]}tn(i,`createContext`);let o=tn(()=>{let t=r.map(e=>a.createContext(e));return tn(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)]}tn(rn,`createContextScope`);function an(...e){let t=e[0];if(e.length===1)return t;let n=tn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return tn(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}tn(an,`composeContextScopes`);var on=globalThis?.document?a.useLayoutEffect:()=>{},sn=Object.defineProperty,cn=(e,t)=>sn(e,`name`,{value:t,configurable:!0}),ln=a.useId||(()=>void 0),un=0;function V(e){let[t,n]=a.useState(ln());return on(()=>{e||n(e=>e??String(un++))},[e]),e||(t?`radix-${t}`:``)}cn(V,`useId`);var dn=typeof document<`u`?x:function(){};function fn(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(!fn(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)&&!fn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function pn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mn(e,t){let n=pn(e);return Math.round(t*n)/n}function hn(e){let t=a.useRef(e);return dn(()=>{t.current=e}),t}function gn(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);fn(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=hn(l),k=hn(i),A=hn(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&&!fn(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);dn(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=a.useRef(!1);dn(()=>(M.current=!0,()=>{M.current=!1}),[]),dn(()=>{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=mn(P.floating,d.x),r=mn(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...pn(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 _n=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):{}}}},vn=(e,t)=>{let n=ie(e);return{name:n.name,fn:n.fn,options:[e,t]}},yn=(e,t)=>{let n=ae(e);return{name:n.name,fn:n.fn,options:[e,t]}},bn=(e,t)=>({fn:re(e).fn,options:[e,t]}),xn=(e,t)=>{let n=F(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sn=(e,t)=>{let n=oe(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cn=(e,t)=>{let n=ne(e);return{name:n.name,fn:n.fn,options:[e,t]}},wn=(e,t)=>{let n=_n(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Tn=Object.defineProperty,En=(e,t)=>Tn(e,`name`,{value:t,configurable:!0}),H=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=Nt(`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),t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function Dn(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}En(Dn,`dispatchDiscreteCustomEvent`);var On=Object.defineProperty,kn=(e,t)=>On(e,`name`,{value:t,configurable:!0});function An(e){let t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}kn(An,`useCallbackRef`);var jn=Object.defineProperty,Mn=(e,t)=>jn(e,`name`,{value:t,configurable:!0});function Nn(e){let[t,n]=a.useState(void 0);return on(()=>{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}Mn(Nn,`useSize`);var Pn=Object.defineProperty,Fn=(e,t)=>Pn(e,`name`,{value:t,configurable:!0}),In=`Popper`,[Ln,Rn]=rn(In),[zn,Bn]=Ln(In),Vn=Fn(e=>{let{__scopePopper:n,children:r}=e,[i,o]=a.useState(null),[s,c]=a.useState(void 0);return t(zn,{scope:n,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:c,children:r})},`Popper`),Hn=`PopperAnchor`,Un=a.forwardRef(Fn(function(e,n){let{__scopePopper:r,virtualRef:i,...o}=e,s=Bn(Hn,r),c=a.useRef(null),l=s.onAnchorChange,u=R(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&&Xn(s.placementState),p=f?.[0],m=f?.[1];return i?null:t(H.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:u})},`PopperAnchor`)),Wn=`PopperContent`,[Gn,Kn]=Ln(Wn),qn=a.forwardRef(Fn(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=Bn(Wn,r),[y,b]=a.useState(null),x=R(n,b),[S,C]=a.useState(null),w=Nn(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(Jn),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:te,middlewareData:F}=gn({strategy:`fixed`,placement:D,whileElementsMounted:Fn((...e)=>ee(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[vn({mainAxis:o+E,alignmentAxis:c}),u&&yn({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?bn():void 0,...j}),u&&xn({...j}),Sn({...j,apply:Fn(({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&&wn({element:S,padding:l}),Yn({arrowWidth:T,arrowHeight:E}),m&&Cn({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),ne=v.setPlacementState;on(()=>(ne(P),()=>{ne(void 0)}),[P,ne]);let[re,ie]=Xn(P),ae=An(g);on(()=>{te&&ae?.()},[te,ae]);let oe=F.arrow?.x,se=F.arrow?.y,ce=F.arrow?.centerOffset!==0,[le,ue]=a.useState();return on(()=>{y&&ue(window.getComputedStyle(y).zIndex)},[y]),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:t(Gn,{scope:r,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:t(H.div,{"data-side":re,"data-align":ie,..._,ref:x,style:{..._.style,animation:te?_.style?.animation:`none`}})})})},`PopperContent`));function Jn(e){return e!==null}Fn(Jn,`isNotNull`);var Yn=Fn(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]=Xn(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 Xn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Fn(Xn,`getSideAndAlignFromPlacement`);var Zn=Vn,Qn=Un,$n=qn,er=Object.defineProperty,tr=a.forwardRef(((e,t)=>er(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[o,s]=a.useState(!1);on(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?T.createPortal(t(H.div,{...i,ref:n}),c):null},`Portal`)),nr=Object.defineProperty,rr=(e,t)=>nr(e,`name`,{value:t,configurable:!0});function ir(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}rr(ir,`useStateMachine`);var ar=rr(e=>{let{present:t,children:n}=e,r=or(t),i=typeof n==`function`?n({present:r.isPresent}):a.Children.only(n),o=cr(r.ref,ur(i));return typeof n==`function`||r.isPresent?a.cloneElement(i,{ref:o}):null},`Presence`);function or(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]=ir(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]),on(()=>{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]),on(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=rr(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=rr(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)},[])}}rr(or,`usePresence`);function sr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}rr(sr,`setRef`);function cr(...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=sr(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():sr(n[e],null)}}},[])}rr(cr,`useStableComposedRefs`);function lr(e){return e?.animationName||`none`}rr(lr,`getAnimationName`);function ur(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)}rr(ur,`getElementRef`);var dr=Object.defineProperty,fr=(e,t)=>dr(e,`name`,{value:t,configurable:!0}),pr=a.useEffectEvent,mr=a.useInsertionEffect;function hr(e){if(typeof pr==`function`)return pr(e);let t=a.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof mr==`function`?mr(()=>{t.current=e}):on(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}fr(hr,`useEffectEvent`);var gr=Object.defineProperty,_r=(e,t)=>gr(e,`name`,{value:t,configurable:!0}),vr=a.useInsertionEffect||on;function yr({prop:e,defaultProp:t,onChange:n=_r(()=>{},`onChange`),caller:r}){let[i,o,s]=br({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,a.useCallback(t=>{if(c){let n=xr(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}_r(yr,`useControllableState`);function br({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return vr(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}_r(br,`useUncontrolledState`);function xr(e){return typeof e==`function`}_r(xr,`isFunction`);var Sr=Symbol(`RADIX:SYNC_STATE`);function Cr(e,t,n,r){let{prop:i,defaultProp:o,onChange:s,caller:c}=t,l=i!==void 0,u=hr(s),d=[{...n,state:o}];r&&d.push(r);let[f,p]=a.useReducer((t,n)=>{if(n.type===Sr)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:Sr,state:i})},[i,f.state,l]),[g,p]}_r(Cr,`useControllableStateReducer`);var wr=Object.defineProperty,Tr=(e,t)=>wr(e,`name`,{value:t,configurable:!0}),Er=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`}),Dr=a.forwardRef(Tr(function(e,n){return t(H.span,{...e,ref:n,style:{...Er,...e.style}})},`VisuallyHidden`)),Or=Object.defineProperty,kr=(e,t)=>Or(e,`name`,{value:t,configurable:!0}),[Ar,jr]=rn(`Tooltip`,[Rn]),Mr=Rn(),Nr=`TooltipProvider`,Pr=700,Fr=`tooltip.open`,[Ir,Lr]=Ar(Nr),Rr=kr(e=>{let{__scopeTooltip:n,delayDuration:r=Pr,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)},[]),t(Ir,{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`),zr=`Tooltip`,[Br,Vr]=Ar(zr),Hr=kr(e=>{let{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=Lr(zr,e.__scopeTooltip),d=Mr(n),[f,p]=a.useState(null),[m,h]=a.useState(void 0),g=V(),_=a.useRef(0),v=c??u.disableHoverableContent,y=l??u.delayDuration,b=a.useRef(!1),[x,S]=yr({prop:i,defaultProp:o??!1,onChange:kr(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(Fr))):u.onClose(),s?.(e)},`onChange`),caller:zr}),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 t(Zn,{...d,children:t(Br,{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`),Ur=`TooltipTrigger`,Wr=a.forwardRef(kr(function(e,n){let{__scopeTooltip:r,...i}=e,o=Vr(Ur,r),s=Lr(Ur,r),c=Mr(r),l=R(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]),t(Qn,{asChild:!0,...c,children:t(H.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:l,onPointerMove:B(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:B(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:B(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:B(e.onBlur,o.onClose),onClick:B(e.onClick,o.onClose)})})},`TooltipTrigger`)),Gr=`TooltipPortal`,[Kr,qr]=Ar(Gr,{forceMount:void 0}),Jr=kr(e=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=e,o=Vr(Gr,n);return t(Kr,{scope:n,forceMount:r,children:t(ar,{present:r||o.open,children:t(tr,{asChild:!0,container:a,children:i})})})},`TooltipPortal`),Yr=`TooltipContent`,Xr=a.forwardRef(kr(function(e,n){let r=qr(Yr,e.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=e,s=Vr(Yr,e.__scopeTooltip);return t(ar,{present:i||s.open,children:s.disableHoverableContent?t($r,{side:a,...o,ref:n}):t(Zr,{side:a,...o,ref:n})})},`TooltipContent`)),Zr=a.forwardRef(kr(function(e,n){let r=Vr(Yr,e.__scopeTooltip),i=Lr(Yr,e.__scopeTooltip),o=a.useRef(null),s=R(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=ti(r,ei(r,n.getBoundingClientRect())),a=ni(t.getBoundingClientRect()),o=ii([...i,...a]);l(o),p(!0)},[p]);return a.useEffect(()=>()=>m(),[m]),a.useEffect(()=>{if(u&&f){let e=kr(e=>h(e,f),`handleTriggerLeave`),t=kr(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=kr(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!ri(n,c);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),t($r,{...e,ref:s})},`TooltipContentHoverable`)),Qr=It(`TooltipContent`),$r=a.forwardRef(kr(function(e,r){let{__scopeTooltip:i,children:o,"aria-label":s,id:c,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=Vr(Yr,i),p=Mr(i),{onClose:m}=f;a.useEffect(()=>(document.addEventListener(Fr,m),()=>document.removeEventListener(Fr,m)),[m]),a.useEffect(()=>{if(f.trigger){let e=kr(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 on(()=>(h(c),()=>{h(void 0)}),[c,h]),t(M,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:n($n,{"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:[t(Qr,{children:o}),s?t(Dr,{id:f.contentId,role:`tooltip`,children:s}):null]})})},`TooltipContentImpl`));function ei(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`)}}kr(ei,`getExitSideFromRect`);function ti(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}kr(ti,`getPaddedExitPoints`);function ni(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}]}kr(ni,`getPointsFromRect`);function ri(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}kr(ri,`isPointInPolygon`);function ii(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)}kr(ii,`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)}kr(ai,`getHullPresorted`);var oi=Rr,si=Hr,ci=Wr,li=Jr,ui=Xr;const di=o.createContext(void 0);function fi(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 pi({children:e,id:n=`plugin-portal-container`}){let r=o.useContext(di),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=fi(e,n);s(t)}else s(null)}},[n,r]),a===void 0?t(`div`,{ref:i,style:{display:`none`}}):t(di.Provider,{value:a||void 0,children:e})}function mi(){return o.useContext(di)}const hi=oi,gi=si,_i=ci,vi=a.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=mi();return t(li,{container:o,children:t(ui,{ref:a,sideOffset:n,side:r,style:{zIndex:100},className:z(`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})})});vi.displayName=ui.displayName;function yi({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(hi,{delayDuration:0,children:n(gi,{open:l,onOpenChange:e=>{d.current||u(e)},children:[t(_i,{className:`cursor-pointer`,asChild:c,children:r}),t(vi,{side:o,className:`px-3 py-1.5 max-w-${i} text-${i} px-3 ${s}`,children:e})]})})}const bi=new Set;function xi(e,t,n){_(()=>{t&&!bi.has(e)&&(bi.add(e),console.warn(`[@vertesia/ui] ${e} is deprecated: ${n}`))},[t,n,e])}function Si(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:Si(t.children)}return!1})}const Ci=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 dark:hover:bg-muted/20 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`}}),U=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)=>{xi(`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?Pt:`button`,_=o?p:p??`button`,v=u??s,y=m[`aria-label`]??s??(Si(m.children)?void 0:u),b=o?m.children:n(e,{children:[l&&t(He,{className:`animate-spin`}),m.children]}),x=t(g,{className:z(Ci({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(yi,{description:v,asChild:!0,className:`cursor-pointer`,size:`xs`,placement:d,children:x}):x});U.displayName=`Button`;const wi=a.forwardRef(({size:e,content:n,toast:r,className:i,alt:a,"aria-label":o,...s},c)=>{let[l,u]=w(!1),{t:d}=k();xi(`CopyButton.alt`,a!==void 0,"use aria-label for the accessible name. `alt` is forwarded for one release.");let f=e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{u(!0),setTimeout(()=>u(!1),2e3),r?.toast&&r.toast({status:`success`,title:r.message||d(`misc.copiedToClipboard`),duration:2e3})}).catch(e=>{console.error(`Failed to copy text: `,e),r?.toast&&r.toast({status:`error`,title:d(`misc.failedToCopy`),duration:2e3})})},p=o??a??d(`misc.copy`);return t(U,{ref:c,className:z(i),variant:`unstyled`,size:e||`sm`,onClick:f,...s,title:p,children:l?t(je,{className:`text-success`}):t(L,{className:`size-4`})})});wi.displayName=`CopyButton`;function Ti({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(U,{onClick:a,children:[t(Ge,{className:`-ms-0.5 me-1.5 size-5`,"aria-hidden":`true`}),e]})})]})})}function Ei(e){return e.isFile}function Di(e){return e.isDirectory}function Oi(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function ki({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(Oi(i.current.files))}})]})}function Ai({onUpload:e}){let r=Pi({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 dark:hover:bg-bray-800 hover:bg-muted dark:border-border dark:hover: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 ji(e){if(!e)return!1;let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t}function Mi(e){if(!e)return!1;let t=e.__dragOver_cnt__;return t?(e.__dragOver_cnt__=t-1,t===1):!1}function Ni(e){e&&delete e.__dragOver_cnt__}function Pi({onUpload:e,dragOverClass:t=`is-drag-over-on`,dropEffect:n=`copy`}){let r=C(null);return{onDrop:n=>{n.preventDefault(),Ni(r.current),r.current?.classList.remove(t);let i=n.dataTransfer.items;if(i){let t=[],n=(e,t=``)=>new Promise(r=>{if(Ei(e))e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if(Di(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:()=>{ji(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{Mi(r.current)&&r.current?.classList.remove(t)},ref:r}}function Fi({description:e,size:n=`sm`,placement:r=`top`,className:i}){return e?t(yi,{description:e,placement:r,children:t(Be,{className:z(n===`md`?`size-4`:`size-3`,`text-muted`,i)})}):null}function Ii(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` `):void 0}function Li(){try{return se.isDev}catch{return!1}}function Ri({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=Ii(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 Li()&&!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(Fi,{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 zi(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e(t))}}const Bi=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 Vi({className:e,variant:n,children:r,onClick:i,...a}){let o=i?{role:`button`,tabIndex:0,onClick:i,onKeyDown:zi(i)}:{};return t(`span`,{className:z(Bi({variant:n}),e),...o,...a,children:r})}const Hi=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`}}),Ui=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 Wi({variant:e,className:r,dotClassName:i,children:a,...o}){return n(`span`,{className:z(Hi({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:z(Ui({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 Gi({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(yi,{description:`click to remove`,children:t(Vi,{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 Ki({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 qi({className:e,children:n}){return t(`ul`,{className:`${e} space-y-1 flex flex-col items-start`,children:n})}qi.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 Ji=`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`,Yi={INPUT_UNSTYLED:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,INPUT_NO_PADDING:Ji,INPUT:`${Ji} py-1.5`};function Xi(e){return e==null||Number.isNaN(e)?``:e.toString()}const Zi=o.forwardRef(({value:e,onChange:n,className:i,noScroll:a=!1,noSpinners:s=!1,...c},l)=>{let[u,d]=o.useState(Xi(e));return _(()=>{if(e==null||!Number.isNaN(e)){let t=Xi(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,Yi.INPUT,{"no-spinners":s},s&&`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`),ref:l,...c})}),Qi=d({});function $i(e){let t=C(null);return t.current===null&&(t.current=e()),t.current}const ea=typeof window<`u`?x:_,ta=d(null);function na(e,t){e.indexOf(t)===-1&&e.push(t)}function ra(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const ia=(e,t,n)=>n>t?t:n<e?e:n,aa={},oa=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),sa=e=>typeof e==`object`&&!!e,ca=e=>/^0[^.\s]+$/u.test(e);function la(e){let t;return()=>(t===void 0&&(t=e()),t)}const ua=e=>e,da=(...e)=>e.reduce((e,t)=>n=>t(e(n))),fa=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1};var pa=class{constructor(){this.subscriptions=[]}add(e){return na(this.subscriptions,e),()=>ra(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 ma=e=>e*1e3,ha=e=>e/1e3,ga=(e,t)=>t?1e3/t*e:0,_a=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function va(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=_a(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>1e-7&&++s<12);return o}function ya(e,t,n,r){if(e===t&&n===r)return ua;let i=t=>va(t,0,1,e,n);return e=>e===0||e===1?e:_a(i(e),t,r)}const ba=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xa=e=>t=>1-e(1-t),Sa=ya(.33,1.53,.69,.99),Ca=xa(Sa),wa=ba(Ca),Ta=e=>e>=1?1:(e*=2)<1?.5*Ca(e):.5*(2-2**(-10*(e-1))),Ea=e=>1-Math.sin(Math.acos(e)),Da=xa(Ea),Oa=ba(Ea),ka=ya(.42,0,1,1),Aa=ya(0,0,.58,1),ja=ya(.42,0,.58,1),Ma=e=>Array.isArray(e)&&typeof e[0]!=`number`,Na=e=>Array.isArray(e)&&typeof e[0]==`number`,Pa={linear:ua,easeIn:ka,easeInOut:ja,easeOut:Aa,circIn:Ea,circInOut:Oa,circOut:Da,backIn:Ca,backInOut:wa,backOut:Sa,anticipate:Ta},Fa=e=>typeof e==`string`,Ia=e=>{if(Na(e)){e.length;let[t,n,r,i]=e;return ya(t,n,r,i)}return Fa(e)?(Pa[e],`${e}`,Pa[e]):e},La=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Ra(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(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 za(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=La.reduce((e,t)=>(e[t]=Ra(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?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:La.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<La.length;t++)o[La[t]].cancel(e)},state:i,steps:o}}const{schedule:W,cancel:Ba,state:Va,steps:Ha}=za(typeof requestAnimationFrame<`u`?requestAnimationFrame:ua,!0);let Ua;function Wa(){Ua=void 0}const Ga={now:()=>(Ua===void 0&&Ga.set(Va.isProcessing||aa.useManualTiming?Va.timestamp:performance.now()),Ua),set:e=>{Ua=e,queueMicrotask(Wa)}},Ka=e=>t=>typeof t==`string`&&t.startsWith(e),qa=Ka(`--`),Ja=Ka(`var(--`),Ya=e=>Ja(e)?Xa.test(e.split(`/*`)[0].trim()):!1,Xa=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Za(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}const Qa={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},$a={...Qa,transform:e=>ia(0,1,e)},eo={...Qa,default:1},to=e=>Math.round(e*1e5)/1e5,no=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ro(e){return e==null}const io=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ao=(e,t)=>n=>!!(typeof n==`string`&&io.test(n)&&n.startsWith(e)||t&&!ro(n)&&Object.prototype.hasOwnProperty.call(n,t)),oo=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(no);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},so=e=>ia(0,255,e),co={...Qa,transform:e=>Math.round(so(e))},lo={test:ao(`rgb`,`red`),parse:oo(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+co.transform(e)+`, `+co.transform(t)+`, `+co.transform(n)+`, `+to($a.transform(r))+`)`};function uo(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 fo={test:ao(`#`),parse:uo,transform:lo.transform},po=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),mo=po(`deg`),ho=po(`%`),G=po(`px`),go=po(`vh`),_o=po(`vw`),vo={...ho,parse:e=>ho.parse(e)/100,transform:e=>ho.transform(e*100)},yo={test:ao(`hsl`,`hue`),parse:oo(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+ho.transform(to(t))+`, `+ho.transform(to(n))+`, `+to($a.transform(r))+`)`},K={test:e=>lo.test(e)||fo.test(e)||yo.test(e),parse:e=>lo.test(e)?lo.parse(e):yo.test(e)?yo.parse(e):fo.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?lo.transform(e):yo.transform(e),getAnimatableNone:e=>{let t=K.parse(e);return t.alpha=0,K.transform(t)}},bo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function xo(e){return isNaN(e)&&typeof e==`string`&&(e.match(no)?.length||0)+(e.match(bo)?.length||0)>0}const So=`number`,Co=`color`,wo=/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 To(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(wo,e=>(K.test(e)?(r.color.push(a),i.push(Co),n.push(K.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(So),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function Eo(e){return To(e).values}function Do({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===So?to(r[a]):e===Co?K.transform(r[a]):r[a]}return i}}function Oo(e){return Do(To(e))}const ko=e=>typeof e==`number`?0:K.test(e)?K.getAnimatableNone(e):e,Ao=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:ko(e);function jo(e){let t=To(e);return Do(t)(t.values.map((e,n)=>Ao(e,t.split[n])))}const Mo={test:xo,parse:Eo,createTransformer:Oo,getAnimatableNone:jo};function No(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 Po({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=No(s,r,e+1/3),a=No(s,r,e),o=No(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Fo(e,t){return n=>n>0?t:e}const q=(e,t,n)=>e+(t-e)*n,Io=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Lo=[fo,lo,yo],Ro=e=>Lo.find(t=>t.test(e));function zo(e){let t=Ro(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===yo&&(n=Po(n)),n}const Bo=(e,t)=>{let n=zo(e),r=zo(t);if(!n||!r)return Fo(e,t);let i={...n};return e=>(i.red=Io(n.red,r.red,e),i.green=Io(n.green,r.green,e),i.blue=Io(n.blue,r.blue,e),i.alpha=q(n.alpha,r.alpha,e),lo.transform(i))},Vo=new Set([`none`,`hidden`]);function Ho(e,t){return Vo.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Uo(e,t){return n=>q(e,t,n)}function Wo(e){return typeof e==`number`?Uo:typeof e==`string`?Ya(e)?Fo:K.test(e)?Bo:Jo:Array.isArray(e)?Go:typeof e==`object`?K.test(e)?Bo:Ko:Fo}function Go(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Wo(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Ko(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Wo(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function qo(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 Jo=(e,t)=>{let n=Mo.createTransformer(t),r=To(e),i=To(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?Vo.has(e)&&!i.values.length||Vo.has(t)&&!r.values.length?Ho(e,t):da(Go(qo(r,i),i.values),n):(`${e}${t}`,Fo(e,t))};function Yo(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?q(e,t,n):Wo(e)(e,t)}const Xo=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>W.update(t,e),stop:()=>Ba(t),now:()=>Va.isProcessing?Va.timestamp:Ga.now()}},Zo=(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)})`},Qo=2e4;function $o(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function es(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min($o(r),Qo);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:ha(i)}}const J={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ts(e,t){return e*Math.sqrt(1-t*t)}function ns(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const rs=.001;function is({duration:e=J.duration,bounce:t=J.bounce,velocity:n=J.velocity,mass:r=J.mass}){let i,a;J.maxDuration;let o=1-t;o=ia(J.minDamping,J.maxDamping,o),e=ia(J.minDuration,J.maxDuration,ha(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=ts(t,o),c=Math.exp(-i);return rs-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=ts(t**2,o);return(-i(t)+rs>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=ns(i,a,s);if(e=ma(e),isNaN(c))return{stiffness:J.stiffness,damping:J.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}const as=[`duration`,`bounce`],os=[`stiffness`,`damping`,`mass`];function ss(e,t){return t.some(t=>e[t]!==void 0)}function cs(e){let t={velocity:J.velocity,stiffness:J.stiffness,damping:J.damping,mass:J.mass,isResolvedFromDuration:!1,...e};if(!ss(e,os)&&ss(e,as)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*ia(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:J.mass,stiffness:i,damping:a}}else{let n=is({...e,velocity:0});t={...t,...n,mass:J.mass},t.isResolvedFromDuration=!0}}return t}function ls(e=J.visualDuration,t=J.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=cs({...n,velocity:-ha(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=ha(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?J.restSpeed.granular:J.restSpeed.default,i||=v?J.restDelta.granular:J.restDelta.default;let y,b,x,S,C,w;if(h<1)x=ts(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>ma(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=ma(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=ma(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min($o(T),Qo),t=Zo(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}ls.applyToOptions=e=>{let t=es(e,100,ls);return e.ease=t.ease,e.duration=ma(t.duration),e.type=`keyframes`,e};function us(e,t,n){let r=Math.max(t-5,0);return ga(n-e(r),t-r)}function ds({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=>s!==void 0&&e<s||c!==void 0&&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=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=ls({keyframes:[f.value,m(f.value)],velocity:us(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function fs(e,t,n){let r=[],i=n||aa.mix||Yo,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]||ua:t;a=da(e,a)}r.push(a)}return r}function ps(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=fs(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=fa(e[r],e[r+1],n);return s[r](i)};return n?t=>l(ia(e[0],e[a-1],t)):l}function ms(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=fa(0,t,r);e.push(q(n,1,i))}}function hs(e){let t=[0];return ms(t,e.length-1),t}function gs(e,t){return e.map(e=>e*t)}function _s(e,t){return e.map(()=>t||ja).splice(0,e.length-1)}function vs({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Ma(r)?r.map(Ia):Ia(r),a={done:!1,value:t[0]},o=ps(gs(n&&n.length===t.length?n:hs(t),e),t,{ease:Array.isArray(i)?i:_s(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}const ys=e=>e!==null;function bs(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(ys),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const xs={decay:ds,inertia:ds,tween:vs,keyframes:vs,spring:ls};function Ss(e){typeof e.type==`string`&&(e.type=xs[e.type])}var Cs=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}};const ws=e=>e/100;var Ts=class extends Cs{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!==Ga.now()&&this.tick(Ga.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Ss(e);let{type:t=vs,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||vs;s!==vs&&typeof o[0]!=`number`&&(this.mixKeyframes=da(ws,Yo(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=$o(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=ia(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!==ds&&(b.value=bs(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 ha(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ha(e)}get time(){return ha(this.currentTime)}set time(e){e=ma(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(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return us(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Ga.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=ha(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Xo,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(Ga.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)}};function Es(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ds=e=>e*180/Math.PI,Os=e=>{let t=Ds(Math.atan2(e[1],e[0]));return As(t)},ks={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Os,rotateZ:Os,skewX:e=>Ds(Math.atan(e[1])),skewY:e=>Ds(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},As=e=>(e%=360,e<0&&(e+=360),e),js=Os,Ms=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ns=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ps={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ms,scaleY:Ns,scale:e=>(Ms(e)+Ns(e))/2,rotateX:e=>As(Ds(Math.atan2(e[6],e[5]))),rotateY:e=>As(Ds(Math.atan2(-e[2],e[0]))),rotateZ:js,rotate:js,skewX:e=>Ds(Math.atan(e[4])),skewY:e=>Ds(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Fs(e){return+!!e.includes(`scale`)}function Is(e,t){if(!e||e===`none`)return Fs(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Ps,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=ks,i=t}if(!i)return Fs(t);let a=r[t],o=i[1].split(`,`).map(Rs);return typeof a==`function`?a(o):o[a]}const Ls=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Is(n,t)};function Rs(e){return parseFloat(e.trim())}const zs=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Bs=new Set([...zs,`pathRotation`]),Vs=e=>e===Qa||e===G,Hs=new Set([`x`,`y`,`z`]),Us=zs.filter(e=>!Hs.has(e));function Ws(e){let t=[];return Us.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}const Gs={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Is(t,`x`),y:(e,{transform:t})=>Is(t,`y`)};Gs.translateX=Gs.x,Gs.translateY=Gs.y;const Ks=new Set;let qs=!1,Js=!1,Ys=!1;function Xs(){if(Js){let e=Array.from(Ks).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Ws(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.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)})}Js=!1,qs=!1,Ks.forEach(e=>e.complete(Ys)),Ks.clear()}function Zs(){Ks.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Js=!0)})}function Qs(){Ys=!0,Zs(),Xs(),Ys=!1}var $s=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?(Ks.add(this),qs||(qs=!0,W.read(Zs),W.resolveKeyframes(Xs))):(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=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Es(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ks.delete(this)}cancel(){this.state===`scheduled`&&(Ks.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const ec=e=>e.startsWith(`--`);function tc(e,t,n){ec(t)?e.style.setProperty(t,n):e.style[t]=n}const nc={};function rc(e,t){let n=la(e);return()=>nc[t]??n()}const ic=rc(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),ac=rc(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),oc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,sc={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:oc([0,.65,.55,1]),circOut:oc([.55,0,1,.45]),backIn:oc([.31,.01,.66,-.59]),backOut:oc([.33,1.53,.69,.99])};function cc(e,t){if(e)return typeof e==`function`?ac()?Zo(e,t):`ease-out`:Na(e)?oc(e):Array.isArray(e)?e.map(e=>cc(e,t)||sc.easeOut):sc[e]}function lc(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=cc(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 uc(e){return typeof e==`function`&&`applyToOptions`in e}function dc({type:e,...t}){return uc(e)&&ac()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var fc=class extends Cs{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=dc(e);this.animation=lc(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=bs(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),tc(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}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 ha(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ha(e)}get time(){return ha(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ma(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,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&ic()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),ua):r(this)}};const pc={anticipate:Ta,backInOut:wa,circInOut:Oa};function mc(e){return e in pc}function hc(e){typeof e.ease==`string`&&mc(e.ease)&&(e.ease=pc[e.ease])}var gc=class extends fc{constructor(e){hc(e),Ss(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 Ts({...a,autoplay:!1}),s=Math.max(10,Ga.now()-this.startTime),c=ia(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&tc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const _c=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Mo.test(e)||e===`0`)&&!e.startsWith(`url(`));function vc(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 yc(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=_c(i,t),s=_c(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:vc(e)||(n===`spring`||uc(n))&&r}function bc(e){e.duration=0,e.type=`keyframes`}const xc=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),Sc=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Cc(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Sc.test(e[t]))return!0;return!1}const wc=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Tc=la(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Ec(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Tc()&&n&&(xc.has(n)||wc.has(n)&&Cc(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Dc=class extends Cs{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ga.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||$s;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),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=Ga.now();let u=!0;yc(e,i,a,o)||(u=!1,(aa.instantAnimations||!s)&&l?.(bs(e,n,t)),e[0]=e[e.length-1],bc(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Ec(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new gc({...d,element:p})}catch{m=new Ts(d)}else m=new Ts(d);m.finished.then(()=>{this.notifyFinished()}).catch(ua),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Qs()),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 Oc(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 kc=e=>!isNaN(parseFloat(e)),Ac={current:void 0};var jc=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Ga.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),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=Ga.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=kc(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new pa);let n=this.events[e].add(t);return e===`change`?()=>{n(),W.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){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.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Ac.current&&Ac.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Ga.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return ga(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Mc(e,t){return new jc(e,t)}function Nc(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Pc(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Nc(n,e)}const Fc={type:`spring`,stiffness:500,damping:25,restSpeed:10},Ic=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Lc={type:`keyframes`,duration:.8},Rc={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},zc=(e,{keyframes:t})=>t.length>2?Lc:Bs.has(e)?e.startsWith(`scale`)?Ic(t[1]):Fc:Rc,Bc=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Vc(e){for(let t in e)if(!Bc.has(t))return!0;return!1}const Hc=(e,t,n,r={},i,a)=>o=>{let s=Pc(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=ma(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};Vc(s)||Object.assign(u,zc(e,u)),u.duration&&=ma(u.duration),u.repeatDelay&&=ma(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(bc(u),u.delay===0&&(d=!0)),(aa.instantAnimations||aa.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,bc(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=bs(u.keyframes,s);if(e!==void 0){W.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Ts(u):new Dc(u)},Uc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Wc(e){let t=Uc.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Gc(e,t,n=1){`${e}`;let[r,i]=Wc(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return oa(e)?parseFloat(e):e}return Ya(i)?Gc(i,t,n+1):i}function Kc(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function qc(e,t,n,r){if(typeof t==`function`){let[i,a]=Kc(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Kc(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Jc(e,t,n){let r=e.getProps();return qc(r,t,n===void 0?r.custom:n,e)}const Yc=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...zs]),Xc=e=>Array.isArray(e);function Zc(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Mc(n))}function Qc(e){return Xc(e)?e[e.length-1]||0:e}function $c(e,t){let{transitionEnd:n={},transition:r={},...i}=Jc(e,t)||{};i={...i,...n};for(let t in i)Zc(e,t,Qc(i[t]))}const el=e=>!!(e&&e.getVelocity);function tl(e){return!!(el(e)&&e.add)}function nl(e,t){let n=e.getValue(`willChange`);if(tl(n))return n.add(t);if(!n&&aa.WillChange){let n=new aa.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function rl(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const il=`data-`+rl(`framerAppearId`);function al(e){return e.props[il]}const ol=typeof window<`u`;function sl({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function cl(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Nc(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&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&&sl(f,t))continue;let o={delay:n,...Pc(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){W.update(()=>r.set(i));continue}let p=!1;if(ol&&window.MotionHandoffAnimation){let n=al(e);if(n){let e=window.MotionHandoffAnimation(n,t,W);e!==null&&(o.startTime=e,p=!0)}}nl(e,t);let m=l??e.shouldReduceMotion;r.start(Hc(t,r,i,m&&Yc.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>W.update(()=>{o&&$c(e,o)});d.length?Promise.all(d).then(t):t()}return d}function ll(e,t,n={}){let r=Jc(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(cl(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return ul(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function ul(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(ll(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Oc(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function dl(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>ll(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=ll(e,t,n);else{let i=typeof t==`function`?Jc(e,t,n.custom):t;r=Promise.all(cl(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}const fl={test:e=>e===`auto`,parse:e=>e},pl=e=>t=>t.test(e),ml=[Qa,G,ho,mo,_o,go,fl],hl=e=>ml.find(pl(e));function gl(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||ca(e)}const _l=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function vl(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(no)||[];if(!r)return e;let i=n.replace(r,``),a=+!!_l.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const yl=/\b([a-z-]*)\(.*?\)/gu,bl={...Mo,getAnimatableNone:e=>{let t=e.match(yl);return t?t.map(vl).join(` `):e}},xl={...Mo,getAnimatableNone:e=>{let t=Mo.parse(e);return Mo.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Sl={...Qa,transform:Math.round},Cl={borderWidth:G,borderTopWidth:G,borderRightWidth:G,borderBottomWidth:G,borderLeftWidth:G,borderRadius:G,borderTopLeftRadius:G,borderTopRightRadius:G,borderBottomRightRadius:G,borderBottomLeftRadius:G,width:G,maxWidth:G,height:G,maxHeight:G,top:G,right:G,bottom:G,left:G,inset:G,insetBlock:G,insetBlockStart:G,insetBlockEnd:G,insetInline:G,insetInlineStart:G,insetInlineEnd:G,padding:G,paddingTop:G,paddingRight:G,paddingBottom:G,paddingLeft:G,paddingBlock:G,paddingBlockStart:G,paddingBlockEnd:G,paddingInline:G,paddingInlineStart:G,paddingInlineEnd:G,margin:G,marginTop:G,marginRight:G,marginBottom:G,marginLeft:G,marginBlock:G,marginBlockStart:G,marginBlockEnd:G,marginInline:G,marginInlineStart:G,marginInlineEnd:G,fontSize:G,backgroundPositionX:G,backgroundPositionY:G,rotate:mo,pathRotation:mo,rotateX:mo,rotateY:mo,rotateZ:mo,scale:eo,scaleX:eo,scaleY:eo,scaleZ:eo,skew:mo,skewX:mo,skewY:mo,distance:G,translateX:G,translateY:G,translateZ:G,x:G,y:G,z:G,perspective:G,transformPerspective:G,opacity:$a,originX:vo,originY:vo,originZ:G,zIndex:Sl,fillOpacity:$a,strokeOpacity:$a,numOctaves:Sl},wl={...Cl,color:K,backgroundColor:K,outlineColor:K,fill:K,stroke:K,borderColor:K,borderTopColor:K,borderRightColor:K,borderBottomColor:K,borderLeftColor:K,filter:bl,WebkitFilter:bl,mask:xl,WebkitMask:xl},Tl=e=>wl[e],El=new Set([bl,xl]);function Dl(e,t){let n=Tl(e);return El.has(n)||(n=Mo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ol=new Set([`auto`,`none`,`0`]);function kl(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Ol.has(t)&&To(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Dl(n,i)}var Al=class extends $s{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(),Ya(r))){let i=Gc(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Yc.has(n)||e.length!==2)return;let[r,i]=e,a=hl(r),o=hl(i);if(Za(r)!==Za(i)&&Gs[n]){this.needsMeasurement=!0;return}if(a!==o){if(Vs(a)&&Vs(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Gs[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||gl(e[t]))&&n.push(t);n.length&&kl(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Gs[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Gs[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const jl=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Ml(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 Nl=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Pl(e){return sa(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}const{schedule:Fl,cancel:Il}=za(queueMicrotask,!1),Ll={x:!1,y:!1};function Rl(){return Ll.x||Ll.y}function zl(e){return e===`x`||e===`y`?Ll[e]?null:(Ll[e]=!0,()=>{Ll[e]=!1}):Ll.x||Ll.y?null:(Ll.x=Ll.y=!0,()=>{Ll.x=Ll.y=!1})}function Bl(e,t){let n=Ml(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Vl(e){return!(e.pointerType===`touch`||Rl())}function Hl(e,t,n={}){let[r,i,a]=Bl(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(!Vl(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 Ul=(e,t)=>t?e===t||Ul(e,t.parentElement):!1,Wl=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Gl=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Kl(e){return Gl.has(e.tagName)||e.isContentEditable===!0}const ql=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Jl(e){return ql.has(e.tagName)||e.isContentEditable===!0}const Yl=new WeakSet;function Xl(e){return t=>{t.key===`Enter`&&e(t)}}function Zl(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const Ql=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Xl(()=>{if(Yl.has(n))return;Zl(n,`down`);let e=Xl(()=>{Zl(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Zl(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function $l(e){return Wl(e)&&!Rl()}const eu=new WeakSet;function tu(e,t,n={}){let[r,i,a]=Bl(e,n),o=e=>{let r=e.currentTarget;if(!$l(e)||eu.has(e))return;Yl.add(r),n.stopPropagation&&eu.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Yl.has(r)&&Yl.delete(r),$l(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Ul(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),Pl(e)&&(e.addEventListener(`focus`,e=>Ql(e,i)),!Kl(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function nu(e){return sa(e)&&`ownerSVGElement`in e}const ru=new WeakMap;let iu;const au=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:nu(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ou=au(`inline`,`width`,`offsetWidth`),su=au(`block`,`height`,`offsetHeight`);function cu({target:e,borderBoxSize:t}){ru.get(e)?.forEach(n=>{n(e,{get width(){return ou(e,t)},get height(){return su(e,t)}})})}function lu(e){e.forEach(cu)}function uu(){typeof ResizeObserver>`u`||(iu=new ResizeObserver(lu))}function du(e,t){iu||uu();let n=Ml(e);return n.forEach(e=>{let n=ru.get(e);n||(n=new Set,ru.set(e,n)),n.add(t),iu?.observe(e)}),()=>{n.forEach(e=>{let n=ru.get(e);n?.delete(t),n?.size||iu?.unobserve(e)})}}const fu=new Set;let pu;function mu(){pu=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};fu.forEach(t=>t(e))},window.addEventListener(`resize`,pu)}function hu(e){return fu.add(e),pu||mu(),()=>{fu.delete(e),!fu.size&&typeof pu==`function`&&(window.removeEventListener(`resize`,pu),pu=void 0)}}function gu(e,t){return typeof e==`function`?hu(e):du(e,t)}const _u={value:null,addProjectionMetrics:null};function vu(e){return nu(e)&&e.tagName===`svg`}const yu=[...ml,K,Mo],bu=e=>yu.find(pl(e)),xu=()=>({translate:0,scale:1,origin:0,originPoint:0}),Su=()=>({x:xu(),y:xu()}),Cu=()=>({min:0,max:0}),Y=()=>({x:Cu(),y:Cu()}),wu=new WeakMap;function Tu(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Eu(e){return typeof e==`string`||Array.isArray(e)}const Du=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Ou=[`initial`,...Du];function ku(e){return Tu(e.animate)||Ou.some(t=>Eu(e[t]))}function Au(e){return!!(ku(e)||e.variants)}function ju(e,t,n){for(let r in t){let i=t[r],a=n[r];if(el(i))e.addValue(r,i);else if(el(a))e.addValue(r,Mc(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,Mc(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const Mu={current:null},Nu={current:!1},Pu=typeof window<`u`;function Fu(){if(Nu.current=!0,Pu){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Mu.current=e.matches;e.addEventListener(`change`,t),t()}else Mu.current=!1}}const Iu=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let Lu={};function Ru(e){Lu=e}function zu(){return Lu}var Bu=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=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=$s,this.features={},this.valueSubscriptions=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=Ga.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,W.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=ku(t),this.isVariantNode=Au(t),this.isVariantNode&&(this.variantChildren=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&&el(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];this.current=e,wu.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Nu.current||Fu(),this.shouldReduceMotion=Mu.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(),Ba(this.notifyUpdate),Ba(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??=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&&xc.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new fc({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:ma(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Bs.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&W.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||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Lu){let t=Lu[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):Y()}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<Iu.length;t++){let n=Iu[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=ju(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}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}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=Mc(t===null?void 0:t,{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`&&(oa(n)||ca(n))?n=parseFloat(n):!bu(n)&&Mo.test(t)&&(n=Dl(e,t)),this.setBaseTarget(e,el(n)?n.get():n)),el(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=qc(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!el(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new pa),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Fl.render(this.render)}},Vu=class extends Bu{constructor(){super(...arguments),this.KeyframeResolver=Al}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;el(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Hu=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Uu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Wu({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gu(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ku(e){return e===void 0||e===1}function qu({scale:e,scaleX:t,scaleY:n}){return!Ku(e)||!Ku(t)||!Ku(n)}function Ju(e){return qu(e)||Yu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Yu(e){return Xu(e.x)||Xu(e.y)}function Xu(e){return e&&e!==`0%`}function Zu(e,t,n){return n+t*(e-n)}function Qu(e,t,n,r,i){return i!==void 0&&(e=Zu(e,i,r)),Zu(e,n,r)+t}function $u(e,t=0,n=1,r,i){e.min=Qu(e.min,t,n,r,i),e.max=Qu(e.max,t,n,r,i)}function ed(e,{x:t,y:n}){$u(e.x,t.translate,t.scale,t.originPoint),$u(e.y,n.translate,n.scale,n.originPoint)}const td=.999999999999,nd=1.0000000000001;function rd(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(id(e.x,-a.scroll.offset.x),id(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ed(e,o)),r&&Ju(a.latestValues)&&sd(e,a.latestValues,a.layout?.layoutBox))}t.x<nd&&t.x>td&&(t.x=1),t.y<nd&&t.y>td&&(t.y=1)}function id(e,t){e.min+=t,e.max+=t}function ad(e,t,n,r,i=.5){$u(e,t,n,q(e.min,e.max,i),r)}function od(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function sd(e,t,n){let r=n??e;ad(e.x,od(t.x,r.x),t.scaleX,t.scale,t.originX),ad(e.y,od(t.y,r.y),t.scaleY,t.scale,t.originY)}function cd(e,t){return Uu(Gu(e.getBoundingClientRect(),t))}function ld(e,t,n){let r=cd(e,n),{scroll:i}=t;return i&&(id(r.x,i.offset.x),id(r.y,i.offset.y)),r}const ud={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},dd=zs.length;function fd(e,t,n){let r=``,i=!0;for(let a=0;a<dd;a++){let o=zs[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=Nl(s,Cl[o]);if(!c){i=!1;let t=ud[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${Nl(a,Cl.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function pd(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(Bs.has(e)){o=!0;continue}if(qa(e)){i[e]=n;continue}{let t=Nl(n,Cl[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=fd(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function md(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])}function hd(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const gd={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(G.test(e))e=parseFloat(e);else return e}return`${hd(e,t.target.x)}% ${hd(e,t.target.y)}%`}},_d={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Mo.parse(e);if(i.length>5)return r;let a=Mo.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=q(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},vd={borderRadius:{...gd,applyTo:[...jl]},borderTopLeftRadius:gd,borderTopRightRadius:gd,borderBottomLeftRadius:gd,borderBottomRightRadius:gd,boxShadow:_d};function yd(e,{layout:t,layoutId:n}){return Bs.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!vd[e]||e===`opacity`)}function bd(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(el(r[t])||i&&el(i[t])||yd(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function xd(e){return window.getComputedStyle(e)}var Sd=class extends Vu{constructor(){super(...arguments),this.type=`html`,this.renderInstance=md}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Bs.has(t))return this.projection?.isProjecting?Fs(t):Ls(e,t);{let n=xd(e),r=(qa(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return cd(e,t)}build(e,t,n){pd(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return bd(e,t,n)}};const Cd={offset:`stroke-dashoffset`,array:`stroke-dasharray`},wd={offset:`strokeDashoffset`,array:`strokeDasharray`};function Td(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Cd:wd;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Ed=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Dd(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(pd(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 Ed)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&&Td(d,i,a,o,!1)}const Od=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`]),kd=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Ad(e,t,n,r){md(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Od.has(n)?n:rl(n),t.attrs[n])}function jd(e,t,n){let r=bd(e,t,n);for(let n in e)if(el(e[n])||el(t[n])){let t=zs.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Md=class extends Vu{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Y}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Bs.has(t)){let e=Tl(t);return e&&e.default||0}if(Ed.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=Od.has(t)?t:rl(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return jd(e,t,n)}build(e,t,n){Dd(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Ad(e,t,n,r)}mount(e){this.isSVGTag=kd(e.tagName),super.mount(e)}};const Nd=Ou.length;function Pd(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&Pd(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Nd;n++){let r=Ou[n],i=e.props[r];(Eu(i)||i===!1)&&(t[r]=i)}return t}function Fd(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 Id=[...Du].reverse(),Ld=Du.length;function Rd(e){return t=>Promise.all(t.map(({animation:t,options:n})=>dl(e,t,n)))}function zd(e){let t=Rd(e),n=Hd(),r=!0,i=!1,a=t=>(n,r)=>{let i=Jc(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=Pd(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Ld;t++){let p=Id[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Eu(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Tu(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Bd(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Xc(t)&&Xc(n)?!Fd(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Jc(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Oc(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Jc(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(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=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Hd(),i=!0}}}function Bd(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Fd(t,e):!1}function Vd(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hd(){return{animate:Vd(!0),whileInView:Vd(),whileHover:Vd(),whileTap:Vd(),whileDrag:Vd(),whileFocus:Vd(),exit:Vd()}}function Ud(e,t){e.min=t.min,e.max=t.max}function Wd(e,t){Ud(e.x,t.x),Ud(e.y,t.y)}function Gd(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Kd(e){return e.max-e.min}function qd(e,t,n){return Math.abs(e-t)<=n}function Jd(e,t,n,r=.5){e.origin=r,e.originPoint=q(t.min,t.max,e.origin),e.scale=Kd(n)/Kd(t),e.translate=q(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 Yd(e,t,n,r){Jd(e.x,t.x,n.x,r?r.originX:void 0),Jd(e.y,t.y,n.y,r?r.originY:void 0)}function Xd(e,t,n,r=0){e.min=(r?q(n.min,n.max,r):n.min)+t.min,e.max=e.min+Kd(t)}function Zd(e,t,n,r){Xd(e.x,t.x,n.x,r?.x),Xd(e.y,t.y,n.y,r?.y)}function Qd(e,t,n,r=0){let i=r?q(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Kd(t)}function $d(e,t,n,r){Qd(e.x,t.x,n.x,r?.x),Qd(e.y,t.y,n.y,r?.y)}function ef(e,t,n,r,i){return e-=t,e=Zu(e,1/n,r),i!==void 0&&(e=Zu(e,1/i,r)),e}function tf(e,t=0,n=1,r=.5,i,a=e,o=e){if(ho.test(t)&&(t=parseFloat(t),t=q(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=q(a.min,a.max,r);e===a&&(s-=t),e.min=ef(e.min,t,n,s,i),e.max=ef(e.max,t,n,s,i)}function nf(e,t,[n,r,i],a,o){tf(e,t[n],t[r],t[i],t.scale,a,o)}const rf=[`x`,`scaleX`,`originX`],af=[`y`,`scaleY`,`originY`];function of(e,t,n,r){nf(e.x,t,rf,n?n.x:void 0,r?r.x:void 0),nf(e.y,t,af,n?n.y:void 0,r?r.y:void 0)}function sf(e){return e.translate===0&&e.scale===1}function cf(e){return sf(e.x)&&sf(e.y)}function lf(e,t){return e.min===t.min&&e.max===t.max}function uf(e,t){return lf(e.x,t.x)&&lf(e.y,t.y)}function df(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ff(e,t){return df(e.x,t.x)&&df(e.y,t.y)}function pf(e){return Kd(e.x)/Kd(e.y)}function mf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function hf(e){return[e(`x`),e(`y`)]}function gf(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 _f=jl.length,vf=e=>typeof e==`string`?parseFloat(e):e,yf=e=>typeof e==`number`||G.test(e);function bf(e,t,n,r,i,a){i?(e.opacity=q(0,n.opacity??1,Sf(r)),e.opacityExit=q(t.opacity??1,0,Cf(r))):a&&(e.opacity=q(t.opacity??1,n.opacity??1,r));for(let i=0;i<_f;i++){let a=jl[i],o=xf(t,a),s=xf(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||yf(o)===yf(s)?(e[a]=Math.max(q(vf(o),vf(s),r),0),(ho.test(s)||ho.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=q(t.rotate||0,n.rotate||0,r))}function xf(e,t){return e[t]===void 0?e.borderRadius:e[t]}const Sf=wf(0,.5,Da),Cf=wf(.5,.95,ua);function wf(e,t,n){return r=>r<e?0:r>t?1:n(fa(e,t,r))}function Tf(e,t,n){let r=el(e)?e:Mc(e);return r.start(Hc(``,r,t,n)),r.animation}function Ef(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const Df=(e,t)=>e.depth-t.depth;var Of=class{constructor(){this.children=[],this.isDirty=!1}add(e){na(this.children,e),this.isDirty=!0}remove(e){ra(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Df),this.isDirty=!1,this.children.forEach(e)}};function kf(e,t){let n=Ga.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Ba(r),e(a-t))};return W.setup(r,!0),()=>Ba(r)}function Af(e){return el(e)?e.get():e}var jf=class{constructor(){this.members=[]}add(e){na(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&&(ra(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(ra(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 Mf={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Nf={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Pf=[``,`X`,`Y`,`Z`];let Ff=0;function If(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Lf(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=al(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,W,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Lf(r)}function Rf({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Ff++,this.animationId=0,this.animationCommitId=0,this.children=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=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,_u.value&&(Nf.nodes=Nf.calculatedTargetDeltas=Nf.calculatedProjections=0),this.nodes.forEach(Vf),this.nodes.forEach(Xf),this.nodes.forEach(Zf),this.nodes.forEach(Hf),_u.addProjectionMetrics&&_u.addProjectionMetrics(Nf)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=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 Of)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new pa),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=nu(t)&&!vu(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;W.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=kf(i,250),Mf.hasAnimatedSinceResize&&(Mf.hasAnimatedSinceResize=!1,this.nodes.forEach(Yf)))})}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()||ip,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!ff(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={...Pc(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||Yf(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(),Ba(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(Qf),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&&Lf(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(Gf),this.nodes.forEach(Wf);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Kf);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qf),this.nodes.forEach(Jf),this.nodes.forEach(zf),this.nodes.forEach(Bf)):this.nodes.forEach(Kf),this.clearAllSnapshots();let e=Ga.now();Va.delta=ia(0,1e3/60,e-Va.timestamp),Va.timestamp=e,Va.isProcessing=!0,Ha.update.process(Va),Ha.preRender.process(Va),Ha.render.process(Va),Va.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Uf),this.sharedNodes.forEach($f)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,W.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){W.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Kd(this.snapshot.measuredBox.x)&&!Kd(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.layoutVersion++,this.layoutCorrected||=Y(),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&&!cf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Ju(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),cp(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Y();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(up))){let{scroll:e}=this.root;e&&(id(t.x,e.offset.x),id(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Y();if(Wd(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&&Wd(t,e),id(t.x,i.offset.x),id(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Y();Wd(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(id(r.x,-n.scroll.offset.x),id(r.y,-n.scroll.offset.y)),Ju(n.latestValues)&&sd(r,n.latestValues,n.layout?.layoutBox)}return Ju(this.latestValues)&&sd(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Y();Wd(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Ju(n.latestValues))continue;let r;n.instance&&(qu(n.latestValues)&&n.updateSnapshot(),r=Y(),Wd(r,n.measurePageBox())),of(t,n.latestValues,n.snapshot?.layoutBox,r)}return Ju(this.latestValues)&&of(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!==Va.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=Va.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!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=Y(),this.targetWithTransforms=Y()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Zd(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Wd(this.target,this.layout.layoutBox),ed(this.target,this.targetDelta)):Wd(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),_u.value&&Nf.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||qu(this.parent.latestValues)||Yu(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Y(),this.relativeTargetOrigin=Y(),$d(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Wd(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===Va.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;Wd(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;rd(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Y());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gd(this.prevProjectionDelta.x,this.projectionDelta.x),Gd(this.prevProjectionDelta.y,this.projectionDelta.y)),Yd(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!mf(this.projectionDelta.x,this.prevProjectionDelta.x)||!mf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),_u.value&&Nf.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=Su(),this.projectionDelta=Su(),this.projectionDeltaWithTransform=Su()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Su();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Y(),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=q(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=q(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(ep(o.x,e.x,n),ep(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($d(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),np(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&uf(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Y(),Wd(f,this.relativeTarget)),c&&(this.animationValues=a,bf(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&&=(Ba(this.pendingAnimation),void 0),this.pendingAnimation=W.update(()=>{Mf.hasAnimatedSinceResize=!0,this.motionValue||=Mc(0),this.motionValue.jump(0,!1),this.currentAnimation=Tf(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()}}),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,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&lp(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Y();let t=Kd(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Kd(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Wd(t,n),sd(t,i),Yd(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new jf),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&&If(`z`,e,r,this.animationValues);for(let t=0;t<Pf.length;t++)If(`rotate${Pf[t]}`,e,r,this.animationValues),If(`skew${Pf[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=Af(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=Af(t?.pointerEvents)||``),this.hasProjected&&!Ju(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=gf(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 vd){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=vd[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?Af(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Wf),this.root.sharedNodes.clear()}}}function zf(e){e.updateLayout()}function Bf(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`)hf(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Kd(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Ud(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else lp(i,t.layoutBox,n)&&hf(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Kd(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=Su();Yd(o,n,t.layoutBox);let s=Su();a?Yd(s,e.applyTransform(r,!0),t.measuredBox):Yd(s,n,t.layoutBox);let c=!cf(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=Y();$d(s,t.layoutBox,i.layoutBox,o);let c=Y();$d(c,n,a.layoutBox,o),ff(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 Vf(e){_u.value&&Nf.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 Hf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Uf(e){e.clearSnapshot()}function Wf(e){e.clearMeasurements()}function Gf(e){e.isLayoutDirty=!0,e.updateLayout()}function Kf(e){e.isLayoutDirty=!1}function qf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Jf(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Yf(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Xf(e){e.resolveTargetDelta()}function Zf(e){e.calcProjection()}function Qf(e){e.resetSkewAndRotation()}function $f(e){e.removeLeadSnapshot()}function ep(e,t,n){e.translate=q(t.translate,0,n),e.scale=q(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function tp(e,t,n,r){e.min=q(t.min,n.min,r),e.max=q(t.max,n.max,r)}function np(e,t,n,r){tp(e.x,t.x,n.x,r),tp(e.y,t.y,n.y,r)}function rp(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ip={duration:.45,ease:[.4,0,.1,1]},ap=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),op=ap(`applewebkit/`)&&!ap(`chrome/`)?Math.round:ua;function sp(e){e.min=op(e.min),e.max=op(e.max)}function cp(e){sp(e.x),sp(e.y)}function lp(e,t,n){return e===`position`||e===`preserve-aspect`&&!qd(pf(t),pf(n),.2)}function up(e){return e!==e.root&&e.scroll?.wasRoot}const dp=Rf({attachResizeListener:(e,t)=>Ef(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),fp={current:void 0},pp=Rf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fp.current){let e=new dp({});e.mount(window),e.setOptions({layoutScroll:!0}),fp.current=e}return fp.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),mp=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function hp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function gp(...e){return t=>{let n=!1,r=e.map(e=>{let r=hp(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():hp(e[t],null)}}}}function _p(...e){return a.useCallback(gp(...e),e)}var vp=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Pl(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Pl(e)&&e.offsetWidth||0,r=Pl(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 yp({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(mp),f=_p(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(`
209
+ ;pt.node;const mt=I(pt),ht={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
+ /**
211
+ * @license lucide-react v1.45.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */
216
+ ;ht.node;const gt=I(ht),_t={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
+ /**
218
+ * @license lucide-react v1.45.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */
223
+ ;_t.node;const vt=I(_t),yt={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]}
224
+ /**
225
+ * @license lucide-react v1.45.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */
230
+ ;yt.node;const bt=I(yt);function xt(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 St(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var Ct=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=St(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=xt(e.position);if(t!==e.position)return{...e,position:t}}return null}};function wt(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function Tt(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function Et(e,t,n,r){let i=new Ct(e.gap),a=i.computePosition(e,t,n),o=Tt(a.rect,r,`x`),s=Tt(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 Ct(i.gap).computePosition(c,t,n),wt(a.rect,r)?a:null):null}function Dt(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 Ot(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=Dt(e[n].getBoundingClientRect(),t),!t)return null;return t}function kt(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 At(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)kt(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var jt=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=At(this.anchor,this.root),this.visibleClientRect=Ot(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=Et(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 Mt=d(void 0);function Nt(){let e=g(Mt);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function Pt({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 jt({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(Mt.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 Ft({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(Pt,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function It(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var Lt=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}},Rt=class e extends Lt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},zt=class e extends Rt{createItem(e){return e}static instance=new e};function Bt(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:Ht,Menu:Wt,Toggle:Ut}}function Vt({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(It()),S=C(void 0),T=C(null),E=p?Object.assign(Bt(d,u),p):Bt(d,u),D=o.useRef(null),O=Gt({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(Ft,{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 Ht({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(bt,{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 Ut({ctrl:e}){return e.isMenuOpen?t(Be,{className:`w-4 h-4`}):t(Le,{className:`w-4 h-4`})}function Wt({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 Gt(e){let[t,n]=w(new Kt(e));return _(()=>{t?.withState(n)},[t]),t}var Kt=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:qt(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:Jt(this.highlightedIndex,e.length),!0)}}}};function qt(e,t){return(e+1)%t}function Jt(e,t){return(e-1+t)%t}function Yt({options:e,creatable:n,...r}){let i=n?zt.instance:Rt.instance;return t(Vt,{adapter:i,items:e,...r})}function Xt({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var Zt=Object.defineProperty,Qt=(e,t)=>Zt(e,`name`,{value:t,configurable:!0});function $t(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Qt($t,`setRef`);function en(...e){return t=>{let n=!1,r=e.map(e=>{let r=$t(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():$t(e[t],null)}}}}Qt(en,`composeRefs`);function z(...e){return a.useCallback(en(...e),e)}Qt(z,`useComposedRefs`);var tn=Object.defineProperty,nn=(e,t)=>tn(e,`name`,{value:t,configurable:!0});function rn(e){let t=a.forwardRef((t,n)=>{let{children:r,...i}=t,o=null,s=!1,c=[];pn(r)&&typeof _n==`function`&&(r=_n(r._payload)),a.Children.forEach(r,e=>{if(dn(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;pn(n)&&typeof _n==`function`&&(n=_n(n._payload)),o=cn(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?un(o):void 0,u=z(n,l);if(!o){if(r||r===0)throw Error(s?gn(e):hn(e));return r}let d=ln(i,o.props??{});return o.type!==a.Fragment&&(d.ref=n?u:l),a.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}nn(rn,`createSlot`);var an=rn(`Slot`),on=Symbol.for(`radix.slottable`);function sn(e){let t=nn(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=on,t}nn(sn,`createSlottable`);var cn=nn((e,t)=>{if(`child`in e.props){let t=e.props.child;return a.isValidElement(t)?a.cloneElement(t,void 0,e.props.children(t.props.children)):null}return a.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function ln(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}nn(ln,`mergeProps`);function un(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)}nn(un,`getElementRef`);function dn(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===on}nn(dn,`isSlottable`);var fn=Symbol.for(`react.lazy`);function pn(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===fn&&`_payload`in e&&mn(e._payload)}nn(pn,`isLazyComponent`);function mn(e){return typeof e==`object`&&!!e&&`then`in e}nn(mn,`isPromiseLike`);var hn=nn(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),gn=nn(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),_n=a.use;function B(...e){return j(i(e))}var vn=Object.defineProperty,yn=(e,t)=>vn(e,`name`,{value:t,configurable:!0}),bn=!!(typeof window<`u`&&window.document&&window.document.createElement);function V(e,t,{checkForDefaultPrevented:n=!0}={}){return yn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}yn(V,`composeEventHandlers`);function xn(e){if(!bn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}yn(xn,`getOwnerWindow`);function Sn(e){if(!bn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}yn(Sn,`getOwnerDocument`);function Cn(e,t=!1){let{activeElement:n}=Sn(e);if(!n?.nodeName)return null;if(wn(n)&&n.contentDocument)return Cn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Sn(n).getElementById(e);if(t)return t}}return n}yn(Cn,`getActiveElement`);function wn(e){return e.tagName===`IFRAME`}yn(wn,`isFrame`);var Tn=Object.defineProperty,En=(e,t)=>Tn(e,`name`,{value:t,configurable:!0});function Dn(e,n){let r=a.createContext(n);r.displayName=e+`Context`;let i=En(e=>{let{children:n,...i}=e,o=a.useMemo(()=>i,Object.values(i));return 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 En(o,`useContext`),[i,o]}En(Dn,`createContext`);function On(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=En(n=>{let{scope:r,children:i,...c}=n,l=r?.[e]?.[s]||o,u=a.useMemo(()=>c,Object.values(c));return 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 En(l,`useContext`),[c,l]}En(i,`createContext`);let o=En(()=>{let t=r.map(e=>a.createContext(e));return En(function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return o.scopeName=e,[i,kn(o,...n)]}En(On,`createContextScope`);function kn(...e){let t=e[0];if(e.length===1)return t;let n=En(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return En(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}En(kn,`composeContextScopes`);var An=globalThis?.document?a.useLayoutEffect:()=>{},jn=Object.defineProperty,Mn=(e,t)=>jn(e,`name`,{value:t,configurable:!0}),Nn=a.useId||(()=>void 0),Pn=0;function H(e){let[t,n]=a.useState(Nn());return An(()=>{e||n(e=>e??String(Pn++))},[e]),e||(t?`radix-${t}`:``)}Mn(H,`useId`);var Fn=typeof document<`u`?x:function(){};function In(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(!In(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)&&!In(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ln(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rn(e,t){let n=Ln(e);return Math.round(t*n)/n}function zn(e){let t=a.useRef(e);return Fn(()=>{t.current=e}),t}function Bn(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);In(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=zn(l),k=zn(i),A=zn(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&&!In(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);Fn(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=a.useRef(!1);Fn(()=>(M.current=!0,()=>{M.current=!1}),[]),Fn(()=>{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=Rn(P.floating,d.x),r=Rn(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ln(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 Vn=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):{}}}},Hn=(e,t)=>{let n=ie(e);return{name:n.name,fn:n.fn,options:[e,t]}},Un=(e,t)=>{let n=ae(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wn=(e,t)=>({fn:re(e).fn,options:[e,t]}),Gn=(e,t)=>{let n=F(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kn=(e,t)=>{let n=oe(e);return{name:n.name,fn:n.fn,options:[e,t]}},qn=(e,t)=>{let n=ne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jn=(e,t)=>{let n=Vn(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Yn=Object.defineProperty,Xn=(e,t)=>Yn(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=rn(`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),t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function Zn(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}Xn(Zn,`dispatchDiscreteCustomEvent`);var Qn=Object.defineProperty,$n=(e,t)=>Qn(e,`name`,{value:t,configurable:!0});function er(e){let t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}$n(er,`useCallbackRef`);var tr=Object.defineProperty,nr=(e,t)=>tr(e,`name`,{value:t,configurable:!0});function rr(e){let[t,n]=a.useState(void 0);return An(()=>{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}nr(rr,`useSize`);var ir=Object.defineProperty,ar=(e,t)=>ir(e,`name`,{value:t,configurable:!0}),or=`Popper`,[sr,cr]=On(or),[lr,ur]=sr(or),dr=ar(e=>{let{__scopePopper:n,children:r}=e,[i,o]=a.useState(null),[s,c]=a.useState(void 0);return t(lr,{scope:n,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:c,children:r})},`Popper`),fr=`PopperAnchor`,pr=a.forwardRef(ar(function(e,n){let{__scopePopper:r,virtualRef:i,...o}=e,s=ur(fr,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&&br(s.placementState),p=f?.[0],m=f?.[1];return i?null:t(U.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:u})},`PopperAnchor`)),mr=`PopperContent`,[hr,gr]=sr(mr),_r=a.forwardRef(ar(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=ur(mr,r),[y,b]=a.useState(null),x=z(n,b),[S,C]=a.useState(null),w=rr(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(vr),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:te,middlewareData:F}=Bn({strategy:`fixed`,placement:D,whileElementsMounted:ar((...e)=>ee(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[Hn({mainAxis:o+E,alignmentAxis:c}),u&&Un({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?Wn():void 0,...j}),u&&Gn({...j}),Kn({...j,apply:ar(({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&&Jn({element:S,padding:l}),yr({arrowWidth:T,arrowHeight:E}),m&&qn({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),ne=v.setPlacementState;An(()=>(ne(P),()=>{ne(void 0)}),[P,ne]);let[re,ie]=br(P),ae=er(g);An(()=>{te&&ae?.()},[te,ae]);let oe=F.arrow?.x,se=F.arrow?.y,ce=F.arrow?.centerOffset!==0,[le,ue]=a.useState();return An(()=>{y&&ue(window.getComputedStyle(y).zIndex)},[y]),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:t(hr,{scope:r,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:t(U.div,{"data-side":re,"data-align":ie,..._,ref:x,style:{..._.style,animation:te?_.style?.animation:`none`}})})})},`PopperContent`));function vr(e){return e!==null}ar(vr,`isNotNull`);var yr=ar(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]=br(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 br(e){let[t,n=`center`]=e.split(`-`);return[t,n]}ar(br,`getSideAndAlignFromPlacement`);var xr=dr,Sr=pr,Cr=_r,wr=Object.defineProperty,Tr=a.forwardRef(((e,t)=>wr(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[o,s]=a.useState(!1);An(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?T.createPortal(t(U.div,{...i,ref:n}),c):null},`Portal`)),Er=Object.defineProperty,Dr=(e,t)=>Er(e,`name`,{value:t,configurable:!0});function Or(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}Dr(Or,`useStateMachine`);var kr=Dr(e=>{let{present:t,children:n}=e,r=Ar(t),i=typeof n==`function`?n({present:r.isPresent}):a.Children.only(n),o=Mr(r.ref,Pr(i));return typeof n==`function`||r.isPresent?a.cloneElement(i,{ref:o}):null},`Presence`);function Ar(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]=Or(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??Nr(r.current),s.current=void 0):o.current=`none`},[c]),An(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=Nr(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]),An(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=Dr(a=>{let o=Nr(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=Dr(e=>{e.target===t&&(o.current=Nr(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=Nr(t)}else r.current=null;n(e)},[])}}Dr(Ar,`usePresence`);function jr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Dr(jr,`setRef`);function Mr(...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=jr(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():jr(n[e],null)}}},[])}Dr(Mr,`useStableComposedRefs`);function Nr(e){return e?.animationName||`none`}Dr(Nr,`getAnimationName`);function Pr(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)}Dr(Pr,`getElementRef`);var Fr=Object.defineProperty,Ir=(e,t)=>Fr(e,`name`,{value:t,configurable:!0}),Lr=a.useEffectEvent,Rr=a.useInsertionEffect;function zr(e){if(typeof Lr==`function`)return Lr(e);let t=a.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Rr==`function`?Rr(()=>{t.current=e}):An(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ir(zr,`useEffectEvent`);var Br=Object.defineProperty,Vr=(e,t)=>Br(e,`name`,{value:t,configurable:!0}),Hr=a.useInsertionEffect||An;function Ur({prop:e,defaultProp:t,onChange:n=Vr(()=>{},`onChange`),caller:r}){let[i,o,s]=Wr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,a.useCallback(t=>{if(c){let n=Gr(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}Vr(Ur,`useControllableState`);function Wr({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return Hr(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}Vr(Wr,`useUncontrolledState`);function Gr(e){return typeof e==`function`}Vr(Gr,`isFunction`);var Kr=Symbol(`RADIX:SYNC_STATE`);function qr(e,t,n,r){let{prop:i,defaultProp:o,onChange:s,caller:c}=t,l=i!==void 0,u=zr(s),d=[{...n,state:o}];r&&d.push(r);let[f,p]=a.useReducer((t,n)=>{if(n.type===Kr)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:Kr,state:i})},[i,f.state,l]),[g,p]}Vr(qr,`useControllableStateReducer`);var Jr=Object.defineProperty,Yr=(e,t)=>Jr(e,`name`,{value:t,configurable:!0}),Xr=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`}),Zr=a.forwardRef(Yr(function(e,n){return t(U.span,{...e,ref:n,style:{...Xr,...e.style}})},`VisuallyHidden`)),Qr=Object.defineProperty,$r=(e,t)=>Qr(e,`name`,{value:t,configurable:!0}),[ei,ti]=On(`Tooltip`,[cr]),ni=cr(),ri=`TooltipProvider`,ii=700,ai=`tooltip.open`,[oi,si]=ei(ri),ci=$r(e=>{let{__scopeTooltip:n,delayDuration:r=ii,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)},[]),t(oi,{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`),li=`Tooltip`,[ui,di]=ei(li),fi=$r(e=>{let{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=si(li,e.__scopeTooltip),d=ni(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]=Ur({prop:i,defaultProp:o??!1,onChange:$r(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(ai))):u.onClose(),s?.(e)},`onChange`),caller:li}),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 t(xr,{...d,children:t(ui,{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`),pi=`TooltipTrigger`,mi=a.forwardRef($r(function(e,n){let{__scopeTooltip:r,...i}=e,o=di(pi,r),s=si(pi,r),c=ni(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]),t(Sr,{asChild:!0,...c,children: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`)),hi=`TooltipPortal`,[gi,_i]=ei(hi,{forceMount:void 0}),vi=$r(e=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=e,o=di(hi,n);return t(gi,{scope:n,forceMount:r,children:t(kr,{present:r||o.open,children:t(Tr,{asChild:!0,container:a,children:i})})})},`TooltipPortal`),yi=`TooltipContent`,bi=a.forwardRef($r(function(e,n){let r=_i(yi,e.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=e,s=di(yi,e.__scopeTooltip);return t(kr,{present:i||s.open,children:s.disableHoverableContent?t(Ci,{side:a,...o,ref:n}):t(xi,{side:a,...o,ref:n})})},`TooltipContent`)),xi=a.forwardRef($r(function(e,n){let r=di(yi,e.__scopeTooltip),i=si(yi,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=Ti(r,wi(r,n.getBoundingClientRect())),a=Ei(t.getBoundingClientRect()),o=Oi([...i,...a]);l(o),p(!0)},[p]);return a.useEffect(()=>()=>m(),[m]),a.useEffect(()=>{if(u&&f){let e=$r(e=>h(e,f),`handleTriggerLeave`),t=$r(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=$r(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!Di(n,c);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),t(Ci,{...e,ref:s})},`TooltipContentHoverable`)),Si=sn(`TooltipContent`),Ci=a.forwardRef($r(function(e,r){let{__scopeTooltip:i,children:o,"aria-label":s,id:c,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=di(yi,i),p=ni(i),{onClose:m}=f;a.useEffect(()=>(document.addEventListener(ai,m),()=>document.removeEventListener(ai,m)),[m]),a.useEffect(()=>{if(f.trigger){let e=$r(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 An(()=>(h(c),()=>{h(void 0)}),[c,h]),t(M,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:n(Cr,{"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:[t(Si,{children:o}),s?t(Zr,{id:f.contentId,role:`tooltip`,children:s}):null]})})},`TooltipContentImpl`));function wi(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`)}}$r(wi,`getExitSideFromRect`);function Ti(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}$r(Ti,`getPaddedExitPoints`);function Ei(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}]}$r(Ei,`getPointsFromRect`);function Di(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}$r(Di,`isPointInPolygon`);function Oi(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)),ki(t)}$r(Oi,`getHull`);function ki(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)}$r(ki,`getHullPresorted`);var Ai=ci,ji=fi,Mi=mi,Ni=vi,Pi=bi;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=Ai,Bi=ji,Vi=Mi,Hi=a.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=Ri();return t(Ni,{container:o,children:t(Pi,{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})})});Hi.displayName=Pi.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=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 dark:hover:bg-muted/20 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)=>{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?an:`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(it,{className:`animate-spin`}),m.children]}),x=t(g,{className:B(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});W.displayName=`Button`;const Ji=a.forwardRef(({size:e,content:n,toast:r,className:i,alt:a,"aria-label":o,...s},c)=>{let[l,u]=w(!1),{t:d}=k();Gi(`CopyButton.alt`,a!==void 0,"use aria-label for the accessible name. `alt` is forwarded for one release.");let f=e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{u(!0),setTimeout(()=>u(!1),2e3),r?.toast&&r.toast({status:`success`,title:r.message||d(`misc.copiedToClipboard`),duration:2e3})}).catch(e=>{console.error(`Failed to copy text: `,e),r?.toast&&r.toast({status:`error`,title:d(`misc.failedToCopy`),duration:2e3})})},p=o??a??d(`misc.copy`);return t(W,{ref:c,className:B(i),variant:`unstyled`,size:e||`sm`,onClick:f,...s,title:p,children:l?t(L,{className:`text-success`}):t(Xe,{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(W,{onClick:a,children:[t(ut,{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 dark:hover:bg-bray-800 hover:bg-muted dark:border-border dark:hover: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(et,{className:B(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 se.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:B(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:B(fa({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:B(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=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);function Na(e){let t;return()=>(t===void 0&&(t=e()),t)}const Pa=e=>e,Fa=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Ia=(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),()=>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=e=>e*1e3,za=e=>e/1e3,Ba=(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}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=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ga=e=>t=>1-e(1-t),Ka=Ua(.33,1.53,.69,.99),qa=Ga(Ka),Ja=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=Ga(Xa),Qa=Wa(Xa),$a=Ua(.42,0,1,1),eo=Ua(0,0,.58,1),to=Ua(.42,0,.58,1),no=e=>Array.isArray(e)&&typeof e[0]!=`number`,ro=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(ro(e)){e.length;let[t,n,r,i]=e;return Ua(t,n,r,i)}return ao(e)?(io[e],`${e}`,io[e]):e},so=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function co(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(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 lo(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=so.reduce((e,t)=>(e[t]=co(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?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:so.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<so.length;t++)o[so[t]].cancel(e)},state:i,steps:o}}const{schedule:G,cancel:uo,state:fo,steps:po}=lo(typeof requestAnimationFrame<`u`?requestAnimationFrame:Pa,!0);let mo;function ho(){mo=void 0}const go={now:()=>(mo===void 0&&go.set(fo.isProcessing||ka.useManualTiming?fo.timestamp:performance.now()),mo),set:e=>{mo=e,queueMicrotask(ho)}},_o=e=>t=>typeof t==`string`&&t.startsWith(e),vo=_o(`--`),yo=_o(`var(--`),bo=e=>yo(e)?xo.test(e.split(`/*`)[0].trim()):!1,xo=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function So(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}const Co={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},wo={...Co,transform:e=>Oa(0,1,e)},To={...Co,default:1},Eo=e=>Math.round(e*1e5)/1e5,Do=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Oo(e){return e==null}const ko=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ao=(e,t)=>n=>!!(typeof n==`string`&&ko.test(n)&&n.startsWith(e)||t&&!Oo(n)&&Object.prototype.hasOwnProperty.call(n,t)),jo=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Do);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Mo=e=>Oa(0,255,e),No={...Co,transform:e=>Math.round(Mo(e))},Po={test:Ao(`rgb`,`red`),parse:jo(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+No.transform(e)+`, `+No.transform(t)+`, `+No.transform(n)+`, `+Eo(wo.transform(r))+`)`};function Fo(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 Io={test:Ao(`#`),parse:Fo,transform:Po.transform},Lo=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ro=Lo(`deg`),zo=Lo(`%`),K=Lo(`px`),Bo=Lo(`vh`),Vo=Lo(`vw`),Ho={...zo,parse:e=>zo.parse(e)/100,transform:e=>zo.transform(e*100)},Uo={test:Ao(`hsl`,`hue`),parse:jo(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+zo.transform(Eo(t))+`, `+zo.transform(Eo(n))+`, `+Eo(wo.transform(r))+`)`},q={test:e=>Po.test(e)||Io.test(e)||Uo.test(e),parse:e=>Po.test(e)?Po.parse(e):Uo.test(e)?Uo.parse(e):Io.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Po.transform(e):Uo.transform(e),getAnimatableNone:e=>{let t=q.parse(e);return t.alpha=0,q.transform(t)}},Wo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Go(e){return isNaN(e)&&typeof e==`string`&&(e.match(Do)?.length||0)+(e.match(Wo)?.length||0)>0}const Ko=`number`,qo=`color`,Jo=/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 Yo(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Jo,e=>(q.test(e)?(r.color.push(a),i.push(qo),n.push(q.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(Ko),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function Xo(e){return Yo(e).values}function Zo({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===Ko?Eo(r[a]):e===qo?q.transform(r[a]):r[a]}return i}}function Qo(e){return Zo(Yo(e))}const $o=e=>typeof e==`number`?0:q.test(e)?q.getAnimatableNone(e):e,es=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:$o(e);function ts(e){let t=Yo(e);return Zo(t)(t.values.map((e,n)=>es(e,t.split[n])))}const ns={test:Go,parse:Xo,createTransformer:Qo,getAnimatableNone:ts};function rs(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 is({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=rs(s,r,e+1/3),a=rs(s,r,e),o=rs(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function as(e,t){return n=>n>0?t:e}const J=(e,t,n)=>e+(t-e)*n,os=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},ss=[Io,Po,Uo],cs=e=>ss.find(t=>t.test(e));function ls(e){let t=cs(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Uo&&(n=is(n)),n}const us=(e,t)=>{let n=ls(e),r=ls(t);if(!n||!r)return as(e,t);let i={...n};return e=>(i.red=os(n.red,r.red,e),i.green=os(n.green,r.green,e),i.blue=os(n.blue,r.blue,e),i.alpha=J(n.alpha,r.alpha,e),Po.transform(i))},ds=new Set([`none`,`hidden`]);function fs(e,t){return ds.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ps(e,t){return n=>J(e,t,n)}function ms(e){return typeof e==`number`?ps:typeof e==`string`?bo(e)?as:q.test(e)?us:vs:Array.isArray(e)?hs:typeof e==`object`?q.test(e)?us:gs:as}function hs(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ms(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function gs(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ms(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function _s(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 vs=(e,t)=>{let n=ns.createTransformer(t),r=Yo(e),i=Yo(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?ds.has(e)&&!i.values.length||ds.has(t)&&!r.values.length?fs(e,t):Fa(hs(_s(r,i),i.values),n):(`${e}${t}`,as(e,t))};function ys(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?J(e,t,n):ms(e)(e,t)}const bs=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>G.update(t,e),stop:()=>uo(t),now:()=>fo.isProcessing?fo.timestamp:go.now()}},xs=(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)})`},Ss=2e4;function Cs(e,t=50,n=Ss,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 ws(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Cs(r),Ss);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:za(i)}}const Y={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ts(e,t){return e*Math.sqrt(1-t*t)}function Es(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const Ds=.001;function Os({duration:e=Y.duration,bounce:t=Y.bounce,velocity:n=Y.velocity,mass:r=Y.mass}){let i,a;Y.maxDuration;let o=1-t;o=Oa(Y.minDamping,Y.maxDamping,o),e=Oa(Y.minDuration,Y.maxDuration,za(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Ts(t,o),c=Math.exp(-i);return Ds-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o*o*t*t*e,c=Math.exp(-r),l=Ts(t*t,o);return(-i(t)+Ds>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Es(i,a,s);if(e=Ra(e),isNaN(c))return{stiffness:Y.stiffness,damping:Y.damping,duration:e};{let t=c*c*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}const ks=[`duration`,`bounce`],As=[`stiffness`,`damping`,`mass`];function js(e,t){return t.some(t=>e[t]!==void 0)}function Ms(e){let t={velocity:Y.velocity,stiffness:Y.stiffness,damping:Y.damping,mass:Y.mass,isResolvedFromDuration:!1,...e};if(!js(e,As)&&js(e,ks)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Oa(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Y.mass,stiffness:i,damping:a}}else{let n=Os({...e,velocity:0});t={...t,...n,mass:Y.mass},t.isResolvedFromDuration=!0}}return t}function Ns(e=Y.visualDuration,t=Y.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Ms({...n,velocity:-za(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=za(Math.sqrt(c/u)),v=h*_,y=Math.abs(g)<5;r||=y?Y.restSpeed.granular:Y.restSpeed.default,i||=y?Y.restDelta.granular:Y.restDelta.default;let b,x;if(h<1){let e=Ts(_,h),t=(m+v*g)/e,n=v*t+g*e,r=v*g-t*e,i=-1,a=0,s=0,c=c=>{if(c!==i){i=c;let l=Math.exp(-v*c),u=Math.sin(e*c),d=Math.cos(e*c);a=o-l*(t*u+g*d),s=l*(n*u+r*d)}};b=e=>(c(e),a),x=e=>(c(e),s)}else if(h===1){b=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;x=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);b=t=>{let n=Math.exp(-v*t),r=Math.min(e*t,300);return o-n*((m+v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+v*g)/e,n=v*t-g*e,r=v*g-t*e;x=t=>{let i=Math.exp(-v*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let S={calculatedDuration:p&&d||null,velocity:e=>Ra(x(e)),next:e=>{let t=b(e);if(p)s.done=e>=d;else{let n=Ra(x(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Cs(S),Ss),t=xs(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Ns.applyToOptions=e=>{let t=ws(e,100,Ns);return e.ease=t.ease,e.duration=Ra(t.duration),e.type=`keyframes`,e};function Ps({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=Ns({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 Fs(e,t,n){let r=[],i=n||ka.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]||Pa:t;a=Fa(e,a)}r.push(a)}return r}function Is(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=Fs(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=Ia(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Oa(e[0],e[a-1],t)):l}function Ls(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Ia(0,t,r);e.push(J(n,1,i))}}function Rs(e){let t=[0];return Ls(t,e.length-1),t}function zs(e,t){return e.map(e=>e*t)}function Bs(e,t){return e.map(()=>t||to).splice(0,e.length-1)}function Vs({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=no(r)?r.map(oo):oo(r),a={done:!1,value:t[0]},o=Is(zs(n&&n.length===t.length?n:Rs(t),e),t,{ease:Array.isArray(i)?i:Bs(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}function Hs(e,t,n){let r=Math.max(t-5,0);return Ba(n-e(r),t-r)}const Us=e=>e!==null;function Ws(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Us),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const Gs={decay:Ps,inertia:Ps,tween:Vs,keyframes:Vs,spring:Ns};function Ks(e){typeof e.type==`string`&&(e.type=Gs[e.type])}var qs=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}};const Js=e=>e/100;var Ys=class extends qs{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!==go.now()&&this.tick(go.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Ks(e);let{type:t=Vs,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Vs;s!==Vs&&typeof o[0]!=`number`&&(this.mixKeyframes=Fa(Js,ys(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Cs(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!==Ps&&(b.value=Ws(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 za(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+za(e)}get time(){return za(this.currentTime)}set time(e){e=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(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Hs(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(go.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=za(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=bs,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(go.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)}};function Xs(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Zs=e=>e*180/Math.PI,Qs=e=>{let t=Zs(Math.atan2(e[1],e[0]));return ec(t)},$s={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Qs,rotateZ:Qs,skewX:e=>Zs(Math.atan(e[1])),skewY:e=>Zs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ec=e=>(e%=360,e<0&&(e+=360),e),tc=Qs,nc=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),rc=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ic={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:nc,scaleY:rc,scale:e=>(nc(e)+rc(e))/2,rotateX:e=>ec(Zs(Math.atan2(e[6],e[5]))),rotateY:e=>ec(Zs(Math.atan2(-e[2],e[0]))),rotateZ:tc,rotate:tc,skewX:e=>Zs(Math.atan(e[4])),skewY:e=>Zs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ac(e){return+!!e.includes(`scale`)}function oc(e,t){if(!e||e===`none`)return ac(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=ic,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=$s,i=t}if(!i)return ac(t);let a=r[t],o=i[1].split(`,`).map(cc);return typeof a==`function`?a(o):o[a]}const sc=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return oc(n,t)};function cc(e){return parseFloat(e.trim())}const lc=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],uc=new Set([...lc,`pathRotation`]),dc=e=>e===Co||e===K,fc=new Set([`x`,`y`,`z`]),pc=lc.filter(e=>!fc.has(e));function mc(e){let t=[];return pc.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}const hc={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>oc(t,`x`),y:(e,{transform:t})=>oc(t,`y`)};hc.translateX=hc.x,hc.translateY=hc.y;const gc=new Set;let _c=!1,vc=!1,yc=!1;function bc(){if(vc){let e=Array.from(gc).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=mc(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.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)})}vc=!1,_c=!1,gc.forEach(e=>e.complete(yc)),gc.clear()}function xc(){gc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(vc=!0)})}function Sc(){yc=!0,xc(),bc(),yc=!1}var Cc=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?(gc.add(this),_c||(_c=!0,G.read(xc),G.resolveKeyframes(bc))):(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=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Xs(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),gc.delete(this)}cancel(){this.state===`scheduled`&&(gc.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const wc=e=>e.startsWith(`--`);function Tc(e,t,n){wc(t)?e.style.setProperty(t,n):e.style[t]=n}const Ec={};function Dc(e,t){let n=Na(e);return()=>Ec[t]??n()}const Oc=Dc(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),kc=Dc(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Ac=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jc={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Ac([0,.65,.55,1]),circOut:Ac([.55,0,1,.45]),backIn:Ac([.31,.01,.66,-.59]),backOut:Ac([.33,1.53,.69,.99])};function Mc(e,t){if(e)return typeof e==`function`?kc()?xs(e,t):`ease-out`:ro(e)?Ac(e):Array.isArray(e)?e.map(e=>Mc(e,t)||jc.easeOut):jc[e]}function Nc(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=Mc(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 Pc(e){return typeof e==`function`&&`applyToOptions`in e}function Fc({type:e,...t}){return Pc(e)&&kc()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Ic=class extends qs{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=Fc(e);this.animation=Nc(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Ws(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Tc(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}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 za(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+za(e)}get time(){return za(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=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,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Oc()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Pa):r(this)}};const Lc={anticipate:Ya,backInOut:Ja,circInOut:Qa};function Rc(e){return e in Lc}function zc(e){typeof e.ease==`string`&&Rc(e.ease)&&(e.ease=Lc[e.ease])}var Bc=class extends Ic{constructor(e){zc(e),Ks(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 Ys({...a,autoplay:!1}),s=Math.max(10,go.now()-this.startTime),c=Oa(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&Tc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const Vc=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(ns.test(e)||e===`0`)&&!e.startsWith(`url(`));function Hc(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 Uc(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=Vc(i,t),s=Vc(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Hc(e)||(n===`spring`||Pc(n))&&r}function Wc(e){e.duration=0,e.type=`keyframes`}const Gc=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),Kc=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function qc(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Kc.test(e[t]))return!0;return!1}const Jc=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Yc=Na(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Xc(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Yc()&&n&&(Gc.has(n)||Jc.has(n)&&qc(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Zc=class extends qs{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=go.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||Cc;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),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=go.now();let u=!0;Uc(e,i,a,o)||(u=!1,(ka.instantAnimations||!s)&&l?.(Ws(e,n,t)),e[0]=e[e.length-1],Wc(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Xc(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Bc({...d,element:p})}catch{m=new Ys(d)}else m=new Ys(d);m.finished.then(()=>{this.notifyFinished()}).catch(Pa),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Sc()),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 Qc(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 $c=e=>!isNaN(parseFloat(e)),el={current:void 0};var tl=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=go.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),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=go.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=$c(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new La);let n=this.events[e].add(t);return e===`change`?()=>{n(),G.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){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.events.change?.notify(this.current)}addDependent(e){this.dependents||=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=go.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Ba(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function nl(e,t){return new tl(e,t)}function rl(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function il(e,t){let n=e?.[t]??e?.default??e;return n===e?n:rl(n,e)}const al={type:`spring`,stiffness:500,damping:25,restSpeed:10},ol=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),sl={type:`keyframes`,duration:.8},cl={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},ll=(e,{keyframes:t})=>t.length>2?sl:uc.has(e)?e.startsWith(`scale`)?ol(t[1]):al:cl,ul=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function dl(e){for(let t in e)if(!ul.has(t))return!0;return!1}const fl=(e,t,n,r={},i,a)=>o=>{let s=il(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=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};dl(s)||Object.assign(u,ll(e,u)),u.duration&&=Ra(u.duration),u.repeatDelay&&=Ra(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Wc(u),u.delay===0&&(d=!0)),(ka.instantAnimations||ka.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Wc(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Ws(u.keyframes,s);if(e!==void 0){G.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Ys(u):new Zc(u)},pl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ml(e){let t=pl.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function hl(e,t,n=1){`${e}`;let[r,i]=ml(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Aa(e)?parseFloat(e):e}return bo(i)?hl(i,t,n+1):i}function gl(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function _l(e,t,n,r){if(typeof t==`function`){let[i,a]=gl(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=gl(r);t=t(n===void 0?e.custom:n,i,a)}return t}function vl(e,t,n){let r=e.getProps();return _l(r,t,n===void 0?r.custom:n,e)}const yl=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...lc]),bl=e=>Array.isArray(e);function xl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,nl(n))}function Sl(e){return bl(e)?e[e.length-1]||0:e}function Cl(e,t){let{transitionEnd:n={},transition:r={},...i}=vl(e,t)||{};i={...i,...n};for(let t in i)xl(e,t,Sl(i[t]))}const wl=e=>!!(e&&e.getVelocity);function Tl(e){return!!(wl(e)&&e.add)}function El(e,t){let n=e.getValue(`willChange`);if(Tl(n))return n.add(t);if(!n&&ka.WillChange){let n=new ka.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Dl(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Ol=`data-`+Dl(`framerAppearId`);function kl(e){return e.props[Ol]}const Al=typeof window<`u`;function jl({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ml(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?rl(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&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&&jl(f,t))continue;let o={delay:n,...il(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){G.update(()=>r.set(i));continue}let p=!1;if(Al&&window.MotionHandoffAnimation){let n=kl(e);if(n){let e=window.MotionHandoffAnimation(n,t,G);e!==null&&(o.startTime=e,p=!0)}}El(e,t);let m=l??e.shouldReduceMotion;r.start(fl(t,r,i,m&&yl.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>G.update(()=>{o&&Cl(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Nl(e,t,n={}){let r=vl(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Ml(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Pl(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function Pl(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(Nl(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Qc(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Fl(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Nl(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Nl(e,t,n);else{let i=typeof t==`function`?vl(e,t,n.custom):t;r=Promise.all(Ml(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}const Il={test:e=>e===`auto`,parse:e=>e},Ll=e=>t=>t.test(e),Rl=[Co,K,zo,Ro,Vo,Bo,Il],zl=e=>Rl.find(Ll(e));function Bl(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Ma(e)}const Vl=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Hl(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Do)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Vl.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const Ul=/\b([a-z-]*)\(.*?\)/gu,Wl={...ns,getAnimatableNone:e=>{let t=e.match(Ul);return t?t.map(Hl).join(` `):e}},Gl={...ns,getAnimatableNone:e=>{let t=ns.parse(e);return ns.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Kl={...Co,transform:Math.round},ql={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:Ro,pathRotation:Ro,rotateX:Ro,rotateY:Ro,rotateZ:Ro,scale:To,scaleX:To,scaleY:To,scaleZ:To,skew:Ro,skewX:Ro,skewY:Ro,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:wo,originX:Ho,originY:Ho,originZ:K,zIndex:Kl,fillOpacity:wo,strokeOpacity:wo,numOctaves:Kl},Jl={...ql,color:q,backgroundColor:q,outlineColor:q,fill:q,stroke:q,borderColor:q,borderTopColor:q,borderRightColor:q,borderBottomColor:q,borderLeftColor:q,filter:Wl,WebkitFilter:Wl,mask:Gl,WebkitMask:Gl},Yl=e=>Jl[e],Xl=new Set([Wl,Gl]);function Zl(e,t){let n=Yl(e);return Xl.has(n)||(n=ns),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ql=new Set([`auto`,`none`,`0`]);function $l(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Ql.has(t)&&Yo(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Zl(n,i)}var eu=class extends Cc{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(),bo(r))){let i=hl(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!yl.has(n)||e.length!==2)return;let[r,i]=e,a=zl(r),o=zl(i);if(So(r)!==So(i)&&hc[n]){this.needsMeasurement=!0;return}if(a!==o){if(dc(a)&&dc(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else hc[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Bl(e[t]))&&n.push(t);n.length&&$l(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=hc[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=hc[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const tu=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function nu(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 ru=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function iu(e){return ja(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}const{schedule:au,cancel:ou}=lo(queueMicrotask,!1),su={x:!1,y:!1};function cu(){return su.x||su.y}function lu(e){return e===`x`||e===`y`?su[e]?null:(su[e]=!0,()=>{su[e]=!1}):su.x||su.y?null:(su.x=su.y=!0,()=>{su.x=su.y=!1})}function uu(e,t){let n=nu(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function du(e){return!(e.pointerType===`touch`||cu())}function fu(e,t,n={}){let[r,i,a]=uu(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(!du(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 pu=(e,t)=>t?e===t||pu(e,t.parentElement):!1,mu=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,hu=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function gu(e){return hu.has(e.tagName)||e.isContentEditable===!0}const _u=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function vu(e){return _u.has(e.tagName)||e.isContentEditable===!0}const yu=new WeakSet;function bu(e){return t=>{t.key===`Enter`&&e(t)}}function xu(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const Su=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=bu(()=>{if(yu.has(n))return;xu(n,`down`);let e=bu(()=>{xu(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>xu(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Cu(e){return mu(e)&&!cu()}const wu=new WeakSet;function Tu(e,t,n={}){let[r,i,a]=uu(e,n),o=e=>{let r=e.currentTarget;if(!Cu(e)||wu.has(e))return;yu.add(r),n.stopPropagation&&wu.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),yu.has(r)&&yu.delete(r),Cu(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||pu(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),iu(e)&&(e.addEventListener(`focus`,e=>Su(e,i)),!gu(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Eu(e){return ja(e)&&`ownerSVGElement`in e}const Du=new WeakMap;let Ou;const ku=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Eu(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Au=ku(`inline`,`width`,`offsetWidth`),ju=ku(`block`,`height`,`offsetHeight`);function Mu({target:e,borderBoxSize:t}){Du.get(e)?.forEach(n=>{n(e,{get width(){return Au(e,t)},get height(){return ju(e,t)}})})}function Nu(e){e.forEach(Mu)}function Pu(){typeof ResizeObserver>`u`||(Ou=new ResizeObserver(Nu))}function Fu(e,t){Ou||Pu();let n=nu(e);return n.forEach(e=>{let n=Du.get(e);n||(n=new Set,Du.set(e,n)),n.add(t),Ou?.observe(e)}),()=>{n.forEach(e=>{let n=Du.get(e);n?.delete(t),n?.size||Ou?.unobserve(e)})}}const Iu=new Set;let Lu;function Ru(){Lu=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Iu.forEach(t=>t(e))},window.addEventListener(`resize`,Lu)}function zu(e){return Iu.add(e),Lu||Ru(),()=>{Iu.delete(e),!Iu.size&&typeof Lu==`function`&&(window.removeEventListener(`resize`,Lu),Lu=void 0)}}function Bu(e,t){return typeof e==`function`?zu(e):Fu(e,t)}const Vu={value:null,addProjectionMetrics:null};function Hu(e){return Eu(e)&&e.tagName===`svg`}const Uu=[...Rl,q,ns],Wu=e=>Uu.find(Ll(e)),Gu=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ku=()=>({x:Gu(),y:Gu()}),qu=()=>({min:0,max:0}),Ju=()=>({x:qu(),y:qu()}),Yu=new WeakMap;function Xu(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Zu(e){return typeof e==`string`||Array.isArray(e)}const Qu=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],$u=[`initial`,...Qu];function ed(e){return Xu(e.animate)||$u.some(t=>Zu(e[t]))}function td(e){return!!(ed(e)||e.variants)}function nd(e,t,n){for(let r in t){let i=t[r],a=n[r];if(wl(i))e.addValue(r,i);else if(wl(a))e.addValue(r,nl(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,nl(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const rd={current:null},id={current:!1},ad=typeof window<`u`;function od(){if(id.current=!0,ad){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>rd.current=e.matches;e.addEventListener(`change`,t),t()}else rd.current=!1}}const sd=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let cd={};function ld(e){cd=e}function ud(){return cd}var dd=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=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Cc,this.features={},this.valueSubscriptions=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=go.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,G.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=ed(t),this.isVariantNode=td(t),this.isVariantNode&&(this.variantChildren=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&&wl(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];this.current=e,Yu.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(id.current||od(),this.shouldReduceMotion=rd.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(),uo(this.notifyUpdate),uo(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??=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&&Gc.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Ic({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Ra(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=uc.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&G.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||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in cd){let t=cd[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):Ju()}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<sd.length;t++){let n=sd[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=nd(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}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}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=nl(t===null?void 0:t,{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):!Wu(n)&&ns.test(t)&&(n=Zl(e,t)),this.setBaseTarget(e,wl(n)?n.get():n)),wl(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=_l(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!wl(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}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(){au.render(this.render)}},fd=class extends dd{constructor(){super(...arguments),this.KeyframeResolver=eu}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;wl(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},pd=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function md({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function hd({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function gd(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 _d(e){return e===void 0||e===1}function vd({scale:e,scaleX:t,scaleY:n}){return!_d(e)||!_d(t)||!_d(n)}function yd(e){return vd(e)||bd(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function bd(e){return xd(e.x)||xd(e.y)}function xd(e){return e&&e!==`0%`}function Sd(e,t,n){return n+t*(e-n)}function Cd(e,t,n,r,i){return i!==void 0&&(e=Sd(e,i,r)),Sd(e,n,r)+t}function wd(e,t=0,n=1,r,i){e.min=Cd(e.min,t,n,r,i),e.max=Cd(e.max,t,n,r,i)}function Td(e,{x:t,y:n}){wd(e.x,t.translate,t.scale,t.originPoint),wd(e.y,n.translate,n.scale,n.originPoint)}const Ed=.999999999999,Dd=1.0000000000001;function Od(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&&(kd(e.x,-a.scroll.offset.x),kd(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Td(e,o)),r&&yd(a.latestValues)&&Md(e,a.latestValues,a.layout?.layoutBox))}t.x<Dd&&t.x>Ed&&(t.x=1),t.y<Dd&&t.y>Ed&&(t.y=1)}function kd(e,t){e.min+=t,e.max+=t}function Ad(e,t,n,r,i=.5){wd(e,t,n,J(e.min,e.max,i),r)}function jd(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Md(e,t,n){let r=n??e;Ad(e.x,jd(t.x,r.x),t.scaleX,t.scale,t.originX),Ad(e.y,jd(t.y,r.y),t.scaleY,t.scale,t.originY)}function Nd(e,t){return md(gd(e.getBoundingClientRect(),t))}function Pd(e,t,n){let r=Nd(e,n),{scroll:i}=t;return i&&(kd(r.x,i.offset.x),kd(r.y,i.offset.y)),r}const Fd={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Id=lc.length;function Ld(e,t,n){let r=``,i=!0;for(let a=0;a<Id;a++){let o=lc[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=ru(s,ql[o]);if(!c){i=!1;let t=Fd[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${ru(a,ql.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Rd(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(uc.has(e)){o=!0;continue}if(vo(e)){i[e]=n;continue}{let t=ru(n,ql[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Ld(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function zd(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])}function Bd(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vd={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(K.test(e))e=parseFloat(e);else return e}return`${Bd(e,t.target.x)}% ${Bd(e,t.target.y)}%`}},Hd={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=ns.parse(e);if(i.length>5)return r;let a=ns.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)}},Ud={borderRadius:{...Vd,applyTo:[...tu]},borderTopLeftRadius:Vd,borderTopRightRadius:Vd,borderBottomLeftRadius:Vd,borderBottomRightRadius:Vd,boxShadow:Hd};function Wd(e,{layout:t,layoutId:n}){return uc.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Ud[e]||e===`opacity`)}function Gd(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(wl(r[t])||i&&wl(i[t])||Wd(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Kd(e){return window.getComputedStyle(e)}var qd=class extends fd{constructor(){super(...arguments),this.type=`html`,this.renderInstance=zd}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(uc.has(t))return this.projection?.isProjecting?ac(t):sc(e,t);{let n=Kd(e),r=(vo(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Nd(e,t)}build(e,t,n){Rd(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Gd(e,t,n)}};const Jd={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Yd={offset:`strokeDashoffset`,array:`strokeDasharray`};function Xd(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Jd:Yd;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Zd=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Qd(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Rd(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 Zd)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&&Xd(d,i,a,o,!1)}const $d=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`]),ef=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function tf(e,t,n,r){zd(e,t,void 0,r);for(let n in t.attrs)e.setAttribute($d.has(n)?n:Dl(n),t.attrs[n])}function nf(e,t,n){let r=Gd(e,t,n);for(let n in e)if(wl(e[n])||wl(t[n])){let t=lc.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var rf=class extends fd{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Ju}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(uc.has(t)){let e=Yl(t);return e&&e.default||0}if(Zd.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=$d.has(t)?t:Dl(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return nf(e,t,n)}build(e,t,n){Qd(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){tf(e,t,n,r)}mount(e){this.isSVGTag=ef(e.tagName),super.mount(e)}};const af=$u.length;function of(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&of(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<af;n++){let r=$u[n],i=e.props[r];(Zu(i)||i===!1)&&(t[r]=i)}return t}function sf(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 cf=[...Qu].reverse(),lf=Qu.length;function uf(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Fl(e,t,n)))}function df(e){let t=uf(e),n=mf(),r=!0,i=!1,a=t=>(n,r)=>{let i=vl(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=of(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<lf;t++){let p=cf[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Zu(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Xu(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=ff(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=bl(t)&&bl(n)?!sf(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=vl(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Qc(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=vl(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(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=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=mf(),i=!0}}}function ff(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!sf(t,e):!1}function pf(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mf(){return{animate:pf(!0),whileInView:pf(),whileHover:pf(),whileTap:pf(),whileDrag:pf(),whileFocus:pf(),exit:pf()}}function hf(e,t){e.min=t.min,e.max=t.max}function gf(e,t){hf(e.x,t.x),hf(e.y,t.y)}function _f(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function vf(e){return e.max-e.min}function yf(e,t,n){return Math.abs(e-t)<=n}function bf(e,t,n,r=.5){e.origin=r,e.originPoint=J(t.min,t.max,e.origin),e.scale=vf(n)/vf(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 xf(e,t,n,r){bf(e.x,t.x,n.x,r?r.originX:void 0),bf(e.y,t.y,n.y,r?r.originY:void 0)}function Sf(e,t,n,r=0){e.min=(r?J(n.min,n.max,r):n.min)+t.min,e.max=e.min+vf(t)}function Cf(e,t,n,r){Sf(e.x,t.x,n.x,r?.x),Sf(e.y,t.y,n.y,r?.y)}function wf(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+vf(t)}function Tf(e,t,n,r){wf(e.x,t.x,n.x,r?.x),wf(e.y,t.y,n.y,r?.y)}function Ef(e,t,n,r,i){return e-=t,e=Sd(e,1/n,r),i!==void 0&&(e=Sd(e,1/i,r)),e}function Df(e,t=0,n=1,r=.5,i,a=e,o=e){if(zo.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=Ef(e.min,t,n,s,i),e.max=Ef(e.max,t,n,s,i)}function Of(e,t,[n,r,i],a,o){Df(e,t[n],t[r],t[i],t.scale,a,o)}const kf=[`x`,`scaleX`,`originX`],Af=[`y`,`scaleY`,`originY`];function jf(e,t,n,r){Of(e.x,t,kf,n?n.x:void 0,r?r.x:void 0),Of(e.y,t,Af,n?n.y:void 0,r?r.y:void 0)}function Mf(e){return e.translate===0&&e.scale===1}function Nf(e){return Mf(e.x)&&Mf(e.y)}function Pf(e,t){return e.min===t.min&&e.max===t.max}function Ff(e,t){return Pf(e.x,t.x)&&Pf(e.y,t.y)}function If(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Lf(e,t){return If(e.x,t.x)&&If(e.y,t.y)}function Rf(e){return vf(e.x)/vf(e.y)}function zf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Bf(e){return[e(`x`),e(`y`)]}function Vf(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 Hf=tu.length,Uf=e=>typeof e==`string`?parseFloat(e):e,Wf=e=>typeof e==`number`||K.test(e);function Gf(e,t,n,r,i,a){i?(e.opacity=J(0,n.opacity??1,qf(r)),e.opacityExit=J(t.opacity??1,0,Jf(r))):a&&(e.opacity=J(t.opacity??1,n.opacity??1,r));for(let i=0;i<Hf;i++){let a=tu[i],o=Kf(t,a),s=Kf(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Wf(o)===Wf(s)?(e[a]=Math.max(J(Uf(o),Uf(s),r),0),(zo.test(s)||zo.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=J(t.rotate||0,n.rotate||0,r))}function Kf(e,t){return e[t]===void 0?e.borderRadius:e[t]}const qf=Yf(0,.5,Za),Jf=Yf(.5,.95,Pa);function Yf(e,t,n){return r=>r<e?0:r>t?1:n(Ia(e,t,r))}function Xf(e,t,n){let r=wl(e)?e:nl(e);return r.start(fl(``,r,t,n)),r.animation}function Zf(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const Qf=(e,t)=>e.depth-t.depth;var $f=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(Qf),this.isDirty=!1,this.children.forEach(e)}};function ep(e,t){let n=go.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(uo(r),e(a-t))};return G.setup(r,!0),()=>uo(r)}function tp(e){return wl(e)?e.get():e}var np=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 rp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ip={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ap=[``,`X`,`Y`,`Z`];let op=0;function sp(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function cp(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=kl(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,G,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&cp(r)}function lp({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=op++,this.animationId=0,this.animationCommitId=0,this.children=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=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Vu.value&&(ip.nodes=ip.calculatedTargetDeltas=ip.calculatedProjections=0),this.nodes.forEach(fp),this.nodes.forEach(xp),this.nodes.forEach(Sp),this.nodes.forEach(pp),Vu.addProjectionMetrics&&Vu.addProjectionMetrics(ip)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=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 $f)}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=Eu(t)&&!Hu(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;G.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=ep(i,250),rp.hasAnimatedSinceResize&&(rp.hasAnimatedSinceResize=!1,this.nodes.forEach(bp)))})}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()||kp,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Lf(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={...il(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||bp(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(),uo(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(Cp),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&&cp(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(gp),this.nodes.forEach(hp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(_p);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(vp),this.nodes.forEach(yp),this.nodes.forEach(up),this.nodes.forEach(dp)):this.nodes.forEach(_p),this.clearAllSnapshots();let e=go.now();fo.delta=Oa(0,1e3/60,e-fo.timestamp),fo.timestamp=e,fo.isProcessing=!0,po.update.process(fo),po.preRender.process(fo),po.render.process(fo),fo.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,au.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(mp),this.sharedNodes.forEach(wp)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,G.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){G.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!vf(this.snapshot.measuredBox.x)&&!vf(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.layoutVersion++,this.layoutCorrected||=Ju(),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&&!Nf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||yd(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)),Np(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Ju();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Fp))){let{scroll:e}=this.root;e&&(kd(t.x,e.offset.x),kd(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Ju();if(gf(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&&gf(t,e),kd(t.x,i.offset.x),kd(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Ju();gf(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&&(kd(r.x,-n.scroll.offset.x),kd(r.y,-n.scroll.offset.y)),yd(n.latestValues)&&Md(r,n.latestValues,n.layout?.layoutBox)}return yd(this.latestValues)&&Md(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Ju();gf(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!yd(n.latestValues))continue;let r;n.instance&&(vd(n.latestValues)&&n.updateSnapshot(),r=Ju(),gf(r,n.measurePageBox())),jf(t,n.latestValues,n.snapshot?.layoutBox,r)}return yd(this.latestValues)&&jf(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!==fo.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=fo.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!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=Ju(),this.targetWithTransforms=Ju()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Cf(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):gf(this.target,this.layout.layoutBox),Td(this.target,this.targetDelta)):gf(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),Vu.value&&ip.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||vd(this.parent.latestValues)||bd(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.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ju(),this.relativeTargetOrigin=Ju(),Tf(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),gf(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===fo.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;gf(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Od(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=Ju());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_f(this.prevProjectionDelta.x,this.projectionDelta.x),_f(this.prevProjectionDelta.y,this.projectionDelta.y)),xf(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!zf(this.projectionDelta.x,this.prevProjectionDelta.x)||!zf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Vu.value&&ip.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=Ku(),this.projectionDelta=Ku(),this.projectionDeltaWithTransform=Ku()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Ku();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Ju(),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(Op));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):(Tp(o.x,e.x,n),Tp(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tf(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Dp(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Ff(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Ju(),gf(f,this.relativeTarget)),c&&(this.animationValues=a,Gf(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&&=(uo(this.pendingAnimation),void 0),this.pendingAnimation=G.update(()=>{rp.hasAnimatedSinceResize=!0,this.motionValue||=nl(0),this.motionValue.jump(0,!1),this.currentAnimation=Xf(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()}}),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,target:n,layout:r,latestValues:i}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Pp(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Ju();let t=vf(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=vf(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}gf(t,n),Md(t,i),xf(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new np),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&&sp(`z`,e,r,this.animationValues);for(let t=0;t<ap.length;t++)sp(`rotate${ap[t]}`,e,r,this.animationValues),sp(`skew${ap[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=tp(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=tp(t?.pointerEvents)||``),this.hasProjected&&!yd(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Vf(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 Ud){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Ud[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?tp(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(hp),this.root.sharedNodes.clear()}}}function up(e){e.updateLayout()}function dp(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`)Bf(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=vf(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;hf(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Pp(i,t.layoutBox,n)&&Bf(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=vf(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=Ku();xf(o,n,t.layoutBox);let s=Ku();a?xf(s,e.applyTransform(r,!0),t.measuredBox):xf(s,n,t.layoutBox);let c=!Nf(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=Ju();Tf(s,t.layoutBox,i.layoutBox,o);let c=Ju();Tf(c,n,a.layoutBox,o),Lf(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function fp(e){Vu.value&&ip.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 pp(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function mp(e){e.clearSnapshot()}function hp(e){e.clearMeasurements()}function gp(e){e.isLayoutDirty=!0,e.updateLayout()}function _p(e){e.isLayoutDirty=!1}function vp(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function yp(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function bp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function xp(e){e.resolveTargetDelta()}function Sp(e){e.calcProjection()}function Cp(e){e.resetSkewAndRotation()}function wp(e){e.removeLeadSnapshot()}function Tp(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 Ep(e,t,n,r){e.min=J(t.min,n.min,r),e.max=J(t.max,n.max,r)}function Dp(e,t,n,r){Ep(e.x,t.x,n.x,r),Ep(e.y,t.y,n.y,r)}function Op(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const kp={duration:.45,ease:[.4,0,.1,1]},Ap=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jp=Ap(`applewebkit/`)&&!Ap(`chrome/`)?Math.round:Pa;function Mp(e){e.min=jp(e.min),e.max=jp(e.max)}function Np(e){Mp(e.x),Mp(e.y)}function Pp(e,t,n){return e===`position`||e===`preserve-aspect`&&!yf(Rf(t),Rf(n),.2)}function Fp(e){return e!==e.root&&e.scroll?.wasRoot}const Ip=lp({attachResizeListener:(e,t)=>Zf(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Lp={current:void 0},Rp=lp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Lp.current){let e=new Ip({});e.mount(window),e.setOptions({layoutScroll:!0}),Lp.current=e}return Lp.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),zp=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Bp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Vp(...e){return t=>{let n=!1,r=e.map(e=>{let r=Bp(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():Bp(e[t],null)}}}}function Hp(...e){return a.useCallback(Vp(...e),e)}var Up=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(iu(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=iu(e)&&e.offsetWidth||0,r=iu(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 Wp({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(zp),f=Hp(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(`
189
231
  [data-motion-pop-id="${c}"] {
190
232
  position: absolute !important;
191
233
  width: ${e}px !important;
@@ -193,7 +235,7 @@ let n=p(({className:n,...r},i)=>f(Ae,{ref:i,iconNode:t,className:Se(`lucide-${Ce
193
235
  ${_}px !important;
194
236
  ${v}px !important;
195
237
  }
196
- `),()=>{l.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[n]),t(vp,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:a.cloneElement(e,{ref:f})})}const bp=({children:e,initial:n,isPresent:r,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=$i(xp),p=v(),m=C(r),h=C(i);ea(()=>{m.current=r,h.current=i});let g=!0,_=S(()=>(g=!1,{id:p,initial:n,isPresent:r,custom:o,onExitComplete:e=>{f.set(e,!0);for(let e of f.values())if(!e)return;i&&i()},register:e=>(f.set(e,!1),()=>{f.delete(e),!m.current&&!f.size&&h.current?.()})}),[r,f,i]);return s&&g&&(_={..._}),S(()=>{f.forEach((e,t)=>f.set(t,!1))},[r]),a.useEffect(()=>{!r&&!f.size&&i&&i()},[r]),e=t(yp,{pop:c===`popLayout`,isPresent:r,anchorX:l,anchorY:u,root:d,children:e}),t(ta.Provider,{value:_,children:e})};function xp(){return new Map}function Sp(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 Cp=e=>e.key||``;function wp(e){let t=[];return s.forEach(e,e=>{m(e)&&t.push(e)}),t}const Tp=({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]=Sp(c),m=S(()=>wp(n),[n]),h=c&&!f?[]:m.map(Cp),_=C(!0),v=C(m),y=$i(()=>new Map),b=C(new Set),[x,T]=w(m),[E,D]=w(m);ea(()=>{c&&!f&&!E.length&&p?.()},[f,c,E.length,p]),ea(()=>{_.current=!1,v.current=m;for(let e=0;e<E.length;e++){let t=Cp(E[e]);h.includes(t)?(y.delete(t),b.current.delete(t)):y.get(t)!==!0&&y.set(t,!1)}},[E,h.length,h.join(`-`)]);let O=[];if(m!==x){let e=[...m],t=0;for(let n of E){let r=h.indexOf(Cp(n));r===-1?(e.splice(t++,0,n),O.push(n)):t=r+O.length+1}return s===`wait`&&O.length&&(e=O),D(wp(e)),T(m),null}let{forceRender:k}=g(Qi);return t(e,{children:E.map(e=>{let n=Cp(e),g=c&&!f?!1:m===E||h.includes(n);return t(bp,{isPresent:g,initial:!_.current||i?void 0:!1,custom:r,presenceAffectsLayout:o,mode:s,root:d,onExitComplete:g?void 0:()=>{if(b.current.has(n))return;if(y.has(n))b.current.add(n),y.set(n,!0);else return;let e=!0;y.forEach(t=>{t||(e=!1)}),e&&(k?.(),D(v.current),c&&p?.(),a&&a())},anchorX:l,anchorY:u,children:e},n)})})},Ep=d({strict:!1}),Dp={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 Op=!1;function kp(){if(Op)return;let e={};for(let t in Dp)e[t]={isEnabled:e=>Dp[t].some(t=>!!e[t])};Ru(e),Op=!0}function Ap(){return kp(),zu()}function jp(e){let t=Ap();for(let n in e)t[n]={...t[n],...e[n]};Ru(t)}const Mp=d({});function Np(e,t){if(ku(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Eu(t)?t:void 0,animate:Eu(n)?n:void 0}}return e.inherit===!1?{}:t}function Pp(e){let{initial:t,animate:n}=Np(e,g(Mp));return S(()=>({initial:t,animate:n}),[Fp(t),Fp(n)])}function Fp(e){return Array.isArray(e)?e.join(` `):e}const Ip=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Lp(e,t,n){for(let r in t)!el(t[r])&&!yd(r,n)&&(e[r]=t[r])}function Rp({transformTemplate:e},t){return S(()=>{let n=Ip();return pd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function zp(e,t){let n=e.style||{},r={};return Lp(r,n,e),Object.assign(r,Rp(e,t)),r}function Bp(e,t){let n={},r=zp(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 Vp=()=>({...Ip(),attrs:{}});function Hp(e,t,n,r){let i=S(()=>{let n=Vp();return Dd(n,t,kd(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Lp(t,e.style,e),i.style={...t,...i.style}}return i}const Up=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Wp(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Up.has(e)}function Gp(e,t){return e.startsWith(`on`)?!Wp(e):t?.(e)??!Wp(e)}function Kp(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(el(e[a])||(Gp(a,r)||n===!0&&Wp(a)||!t&&!Wp(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}const qp=[`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 Jp(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(qp.indexOf(e)>-1||/[A-Z]/u.test(e))}function Yp(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Jp(e)?Hp:Bp)(t,r,i,e),u=Kp(t,typeof e==`string`,a,s),d=e===l?{}:{...u,...c,ref:n},{children:p}=t,m=S(()=>el(p)?p.get():p,[p]);return f(e,{...d,children:m})}function Xp({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Zp(n,r,i,e),renderState:t()}}function Zp(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Af(a[e]);let{initial:o,animate:s}=e,c=ku(e),l=Au(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`&&!Tu(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=qc(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 Qp=e=>(t,n)=>{let r=g(Mp),i=g(ta),a=()=>Xp(e,t,r,i);return n?a():$i(a)},$p=Qp({scrapeMotionValuesFromProps:bd,createRenderState:Ip}),em=Qp({scrapeMotionValuesFromProps:jd,createRenderState:Vp}),tm=Symbol.for(`motionComponentSymbol`);function nm(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 im(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function am(e,t,n,r,i,a){let{visualElement:o}=g(Mp),s=g(Ep),c=g(ta),l=g(mp),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`)&&om(f.current,n,i,h);let v=C(!1);b(()=>{m&&v.current&&m.update(n,c)});let y=n[il],x=C(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return ea(()=>{p.current=!0,m&&(v.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),_(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),!1),m.enteringChildren=void 0)}),m}function om(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:sm(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&im(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function sm(e){if(e)return e.options.allowProjection===!1?sm(e.parent):e.projection}function cm(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&jp(a);let s=i?i===`svg`:Jp(e),c=s?em:$p;function l(i,l){let u,d={...g(mp),...i,layoutId:lm(i)},{isStatic:f,isValidProp:p}=d,m=Pp(i),h=c(i,f);if(!f&&typeof window<`u`){um(d,a);let t=dm(d);u=t.MeasureLayout,m.visualElement=am(e,h,d,o,t.ProjectionNode,s)}return n(Mp.Provider,{value:m,children:[u&&m.visualElement?t(u,{visualElement:m.visualElement,...d}):null,Yp(e,i,nm(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[tm]=e,u}function lm({layoutId:e}){let t=g(Qi).id;return t&&e!==void 0?t+`-`+e:e}function um(e,t){g(Ep).strict}function dm(e){let{drag:t,layout:n}=Ap();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function fm(e,t){if(typeof Proxy>`u`)return cm;let n=new Map,r=(n,r)=>cm(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,cm(a,void 0,e,t)),n.get(a))})}const pm=(e,t)=>t.isSVG??Jp(e)?new Md(t):new Sd(t,{allowProjection:e!==l});var mm=class extends Hu{constructor(e){super(e),e.animationState||=zd(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Tu(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 hm=0;const gm={animation:{Feature:mm},exit:{Feature:class extends Hu{constructor(){super(...arguments),this.id=hm++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=Jc(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function _m(e){return{point:{x:e.pageX,y:e.pageY}}}const vm=e=>t=>Wl(t)&&e(t,_m(t));function ym(e,t,n,r){return Ef(e,t,vm(n),r)}const bm=({current:e})=>e?e.ownerDocument.defaultView:null,xm=(e,t)=>Math.abs(e-t);function Sm(e,t){let n=xm(e.x,t.x),r=xm(e.y,t.y);return Math.sqrt(n**2+r**2)}const Cm=new Set([`auto`,`scroll`]);var wm=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=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.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Tm(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Dm(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Sm(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=Va;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Tm(t,this.transformPagePoint),W.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{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=Dm(e.type===`pointercancel`?this.lastMoveEventInfo:Tm(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Wl(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Tm(_m(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Va;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Dm(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=da(ym(this.contextWindow,`pointermove`,this.handlePointerMove,d),ym(this.contextWindow,`pointerup`,this.handlePointerUp,d),ym(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Cm.has(e.overflowX)||Cm.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),W.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ba(this.updatePoint)}};function Tm(e,t){return t?{point:t(e.point)}:e}function Em(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Dm({point:e},t){return{point:e,delta:Em(e,km(t)),offset:Em(e,Om(t)),velocity:Am(t,.1)}}function Om(e){return e[0]}function km(e){return e[e.length-1]}function Am(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=km(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ma(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>ma(t)*2&&(r=e[1]);let a=ha(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 jm(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?q(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?q(n,e,r.max):Math.min(e,n)),e}function Mm(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 Nm(e,{top:t,left:n,bottom:r,right:i}){return{x:Mm(e.x,n,i),y:Mm(e.y,t,r)}}function Pm(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 Fm(e,t){return{x:Pm(e.x,t.x),y:Pm(e.y,t.y)}}function Im(e,t){let n=.5,r=Kd(e),i=Kd(t);return i>r?n=fa(t.min,t.max-r,e.min):r>i&&(n=fa(e.min,e.max-i,t.min)),ia(0,1,n)}function Lm(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 Rm=.35;function zm(e=Rm){return e===!1?e=0:e===!0&&(e=Rm),{x:Bm(e,`left`,`right`),y:Bm(e,`top`,`bottom`)}}function Bm(e,t,n){return{min:Vm(e,t),max:Vm(e,n)}}function Vm(e,t){return typeof e==`number`?e:e[t]||0}const Hm=new WeakMap;var Um=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=Y(),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(_m(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=zl(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),hf(e=>{let t=this.getAxisMotionValue(e).get()||0;if(ho.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Kd(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&W.update(()=>i(e,t),!1,!0),nl(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=qm(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&&W.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 wm(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:bm(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&&W.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||!Km(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=jm(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&&im(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?Nm(n.layoutBox,e):!1,this.elastic=zm(t),r!==this.constraints&&!im(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&hf(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Lm(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!im(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=ld(n,r.root,this.visualElement.getTransformPagePoint()),a=Fm(r.layout.layoutBox,i);if(t){let e=t(Wu(a));this.hasMutatedConstraints=!!e,e&&(a=Uu(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=hf(o=>{if(!Km(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 nl(this.visualElement,e),n.start(Hc(e,n,0,t,this.visualElement,!1))}stopAnimation(){hf(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(e){hf(t=>{let{drag:n}=this.getProps();if(!Km(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-q(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!im(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};hf(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Im({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),hf(t=>{if(!Km(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(q(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Hm.set(this.visualElement,this);let e=this.visualElement.current,t=ym(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Jl(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();im(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Gm(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),W.read(r);let o=Ef(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(hf(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=Rm,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Wm(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Gm(e,t,n){let r=gu(e,Wm(n)),i=gu(t,Wm(n));return()=>{r(),i()}}function Km(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qm(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Jm=class extends Hu{constructor(e){super(e),this.removeGroupControls=ua,this.removeListeners=ua,this.controls=new Um(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ua}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 Ym=e=>(t,n)=>{e&&W.update(()=>e(t,n),!1,!0)};var Xm=class extends Hu{constructor(){super(...arguments),this.removePointerDownListener=ua}onPointerDown(e){this.session=new wm(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:bm(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ym(e),onStart:Ym(t),onMove:Ym(n),onEnd:(e,t)=>{delete this.session,r&&W.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=ym(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 Zm=!1;var Qm=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),Zm&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Mf.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}),Zm=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||W.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(),Fl.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Zm=!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 $m(e){let[n,r]=Sp(),i=g(Qi);return t(Qm,{...e,layoutGroup:i,switchLayoutGroup:g(rm),isPresent:n,safeToRemove:r})}const eh={pan:{Feature:Xm},drag:{Feature:Jm,ProjectionNode:pp,MeasureLayout:$m}};function th(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&W.postRender(()=>i(t,_m(t)))}var nh=class extends Hu{mount(){let{current:e}=this.node;e&&(this.unmount=Hl(e,(e,t)=>(th(this.node,t,`Start`),e=>th(this.node,e,`End`))))}unmount(){}},rh=class extends Hu{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=da(Ef(this.node.current,`focus`,()=>this.onFocus()),Ef(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function ih(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&&W.postRender(()=>i(t,_m(t)))}var ah=class extends Hu{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=tu(e,(e,t)=>(ih(this.node,t,`Start`),(e,{success:t})=>ih(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const oh=new WeakMap,sh=new WeakMap,ch=e=>{let t=oh.get(e.target);t&&t(e)},lh=e=>{e.forEach(ch)};function uh({root:e,...t}){let n=e||document;sh.has(n)||sh.set(n,{});let r=sh.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(lh,{root:e,...t})),r[i]}function dh(e,t,n){let r=uh(t);return oh.set(e,n),r.observe(e),()=>{oh.delete(e),r.unobserve(e)}}const fh={some:0,all:1};var ph=class extends Hu{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:fh[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=dh(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(mh(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function mh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const hh={inView:{Feature:ph},tap:{Feature:ah},focus:{Feature:rh},hover:{Feature:nh}},gh={layout:{ProjectionNode:pp,MeasureLayout:$m}},_h=fm({...gm,...hh,...eh,...gh},pm);function vh({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=yh(o),b=bh(o,s,c);return n(`div`,{className:`flex items-center justify-center w-full ${i}`,children:[t(U,{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(_h.div,{...y,transition:m,className:`${b} ${a}`,children:[l&&t(`div`,{className:`absolute top-2 end-2 z-10`,children:t(U,{onClick:v,variant:`primary`,children:t(Xe,{})})}),t(`div`,{className:l?`mt-8`:``,children:r})]})})]})}function yh(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 bh(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 xh=`--tailwind-portal`;function Sh({children:e}){let n=C(null),[r,i]=w(null);return _(()=>{if(n.current){let e=n.current.ownerDocument,t=e.getElementById(xh);t||(t=e.createElement(`DIV`),t.id=xh,e.body.appendChild(t)),i(t)}},[]),r?E(e,r):t(`span`,{ref:n})}function Ch({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(Oh,{onClick:e.onClick,href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):e.href?t(Oh,{href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):t(kh,{children:n})};if(s.length<=r)return t(wh,{className:z(`w-full flex items-center`,i),children:t(Th,{children:s.map((e,r)=>n(a.Fragment,{children:[t(Eh,{children:c(e)}),r<s.length-1&&t(Ah,{children:o??t(Ne,{className:`cn-rtl-flip`})})]},`crumb-${r}`))})});let l=s.slice(-(r-1));return t(wh,{className:z(`w-full flex items-center`,i),children:n(Th,{children:[t(Eh,{children:t(jh,{})}),t(Ah,{children:o??t(Ne,{className:`cn-rtl-flip`})}),l.map((e,r)=>n(a.Fragment,{children:[t(Eh,{children:c(e)}),r<l.length-1&&t(Ah,{children:o??t(Ne,{className:`cn-rtl-flip`})})]},`crumb-${r}`))]})})}const wh=a.forwardRef(({...e},n)=>t(`nav`,{ref:n,"aria-label":`breadcrumb`,...e}));wh.displayName=`Breadcrumb`;const Th=a.forwardRef(({className:e,...n},r)=>t(`ol`,{ref:r,className:z(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted sm:gap-2.5`,e),...n}));Th.displayName=`BreadcrumbList`;const Eh=a.forwardRef(({className:e,...n},r)=>t(`li`,{ref:r,className:z(`inline-flex items-center gap-1.5 text-muted`,e),...n}));Eh.displayName=`BreadcrumbItem`;const Dh=a.forwardRef(({asChild:e,className:n,...r},i)=>t(`a`,{ref:i,className:z(`transition-colors hover:text-muted`,n),...r}));Dh.displayName=`BreadcrumbLink`;const Oh=a.forwardRef(({className:e,href:n,onClick:r,...i},a)=>t(U,{variant:`ghost`,size:`md`,ref:a,className:z(`p-0! hover:underline! hover:bg-background!`,e),onClick:e=>{e.preventDefault(),r&&r(e)},...i}));Oh.displayName=`BreadcrumbButton`;const kh=a.forwardRef(({className:e,...n},r)=>t(`span`,{ref:r,"aria-current":`page`,className:z(`font-normal text-foreground`,e),...n}));kh.displayName=`BreadcrumbPage`;const Ah=({children:e,className:n,...r})=>t(`li`,{role:`presentation`,"aria-hidden":`true`,className:z(`[&>svg]:w-3.5 [&>svg]:h-3.5`,n),...r,children:e??t(Ne,{className:`cn-rtl-flip`})});Ah.displayName=`BreadcrumbSeparator`;const jh=({className:e,...r})=>n(`span`,{role:`presentation`,"aria-hidden":`true`,className:z(`flex h-9 w-9 items-center justify-center`,e),...r,children:[t(ze,{className:`h-4 w-4`}),t(`span`,{className:`sr-only`,children:`More`})]});jh.displayName=`BreadcrumbEllipsis`;const Mh=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`rounded-xl border bg-card text-card-foreground shadow`,e),...n}));Mh.displayName=`Card`;const Nh=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`flex flex-col p-6`,e),...n}));Nh.displayName=`CardHeader`;const Ph=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`font-semibold leading-none tracking-tight`,e),...n}));Ph.displayName=`CardTitle`;const Fh=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`text-sm text-muted`,e),...n}));Fh.displayName=`CardDescription`;const Ih=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`p-6 pt-0`,e),...n}));Ih.displayName=`CardContent`;const Lh=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:z(`flex items-center p-6 pt-0`,e),...n}));Lh.displayName=`CardFooter`;var Rh=Object.defineProperty,zh=(e,t)=>Rh(e,`name`,{value:t,configurable:!0}),Bh=`Checkbox`,[Vh,Hh]=rn(Bh),[Uh,Wh]=Vh(Bh);function Gh(e){let{__scopeCheckbox:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=yr({prop:r,defaultProp:o??!1,onChange:u,caller:Bh}),[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:!eg(o)&&o,isFormControl:C,bubbleInput:v,setBubbleInput:y};return t(Uh,{scope:n,...w,children:$h(p)?p(w):i})}zh(Gh,`CheckboxProvider`);var Kh=`CheckboxTrigger`,qh=a.forwardRef(zh(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:_}=Wh(Kh,e),v=R(o,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?.form;if(e){let t=zh(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,p]),t(H.button,{type:`button`,role:`checkbox`,"aria-checked":eg(u)?`mixed`:u,"aria-required":d,"data-state":tg(u),"data-disabled":l?``:void 0,disabled:l,value:c,...i,ref:v,onKeyDown:B(n,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:B(r,e=>{h(),p(e=>eg(e)?!0:!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`CheckboxTrigger`)),Jh=a.forwardRef(zh(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 t(Gh,{__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})=>n(e,{children:[t(qh,{...m,ref:i,__scopeCheckbox:a}),r&&t(Qh,{__scopeCheckbox:a})]})})},`Checkbox`)),Yh=`CheckboxIndicator`,Xh=a.forwardRef(zh(function(e,n){let{__scopeCheckbox:r,forceMount:i,...a}=e,o=Wh(Yh,r);return t(ar,{present:i||eg(o.checked)||o.checked===!0,children:t(H.span,{"data-state":tg(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Zh=`CheckboxBubbleInput`,Qh=a.forwardRef(zh(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:_}=Wh(Zh,e),v=R(i,_),y=Nn(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=eg(l),n.call(e,!eg(l)&&l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(!eg(l)&&l);return t(H.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:B(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function $h(e){return typeof e==`function`}zh($h,`isFunction`);function eg(e){return e===`indeterminate`}zh(eg,`isIndeterminate`);function tg(e){return eg(e)?`indeterminate`:e?`checked`:`unchecked`}zh(tg,`getState`);const ng=a.forwardRef(({className:e,...n},r)=>t(Jh,{ref:r,className:z(`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(Xh,{className:z(`flex items-center justify-center text-current`),children:t(je,{className:`size-4`})})}));ng.displayName=Jh.displayName;var rg=Object.defineProperty,ig=(e,t)=>rg(e,`name`,{value:t,configurable:!0}),ag=`Collapsible`,[og,sg]=rn(ag),[cg,lg]=og(ag),ug=a.forwardRef(ig(function(e,n){let{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:s,onOpenChange:c,...l}=e,[u,d]=yr({prop:i,defaultProp:o??!1,onChange:c,caller:ag});return t(cg,{scope:r,disabled:s,contentId:V(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:t(H.div,{"data-state":gg(u),"data-disabled":s?``:void 0,...l,ref:n})})},`Collapsible`)),dg=`CollapsibleTrigger`,fg=a.forwardRef(ig(function(e,n){let{__scopeCollapsible:r,...i}=e,a=lg(dg,r);return t(H.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":gg(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...i,ref:n,onClick:B(e.onClick,a.onOpenToggle)})},`CollapsibleTrigger`)),pg=`CollapsibleContent`,mg=a.forwardRef(ig(function(e,n){let{forceMount:r,...i}=e,a=lg(pg,e.__scopeCollapsible);return t(ar,{present:r||a.open,children:({present:e})=>t(hg,{...i,ref:n,present:e})})},`CollapsibleContent`)),hg=a.forwardRef(ig(function(e,n){let{__scopeCollapsible:r,present:i,children:o,...s}=e,c=lg(pg,r),[l,u]=a.useState(i),d=a.useRef(null),f=R(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)},[]),on(()=>{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]),t(H.div,{"data-state":gg(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 gg(e){return e?`open`:`closed`}ig(gg,`getState`);var _g=ug,vg=fg,yg=mg;function bg({...e}){return t(_g,{"data-slot":`collapsible`,...e})}function xg({...e}){return t(vg,{"data-slot":`collapsible-trigger`,...e})}function Sg({...e}){return t(yg,{"data-slot":`collapsible-content`,...e})}var Cg=1,wg=.9,Tg=.8,Eg=.17,Dg=.1,Og=.999,kg=.9999,Ag=.99,jg=/[\\\/_+.#"@\[\(\{&]/,Mg=/[\\\/_+.#"@\[\(\{&]/g,Ng=/[\s-]/,Pg=/[\s-]/g;function Fg(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Cg:Ag;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=Fg(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Cg:jg.test(e.charAt(l-1))?(d*=Tg,p=e.slice(i,l-1).match(Mg),p&&i>0&&(d*=Og**+p.length)):Ng.test(e.charAt(l-1))?(d*=wg,m=e.slice(i,l-1).match(Pg),m&&i>0&&(d*=Og**+m.length)):(d*=Eg,i>0&&(d*=Og**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=kg)),(d<Dg&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Fg(e,t,n,r,l+1,a+2,o),f*Dg>d&&(d=f*Dg)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Ig(e){return e.toLowerCase().replace(Pg,` `)}function Lg(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Fg(e,t,Ig(e),Ig(t),0,0,{})}var Rg=Object.defineProperty,zg=(e,t)=>Rg(e,`name`,{value:t,configurable:!0}),Bg=`Dialog`,[Vg,Hg]=rn(Bg),[Ug,Wg]=Vg(Bg),Gg=zg(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]=yr({prop:i,defaultProp:o??!1,onChange:s,caller:Bg}),[p,m]=a.useState(0),[h,g]=a.useState(0);return t(Ug,{scope:n,triggerRef:l,contentRef:u,contentId:V(),titleId:V(),descriptionId:V(),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`),Kg=`DialogTrigger`,qg=a.forwardRef(zg(function(e,n){let{__scopeDialog:r,...i}=e,a=Wg(Kg,r),o=R(n,a.triggerRef);return t(H.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":p_(a.open),...i,ref:o,onClick:B(e.onClick,a.onOpenToggle)})},`DialogTrigger`)),Jg=`DialogPortal`,[Yg,Xg]=Vg(Jg,{forceMount:void 0}),Zg=zg(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=Wg(Jg,n);return t(Yg,{scope:n,forceMount:r,children:a.Children.map(i,e=>t(ar,{present:r||s.open,children:t(tr,{asChild:!0,container:o,children:e})}))})},`DialogPortal`),Qg=`DialogOverlay`,$g=a.forwardRef(zg(function(e,n){let r=Xg(Qg,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Wg(Qg,e.__scopeDialog);return o.modal?t(ar,{present:i||o.open,children:t(t_,{...a,ref:n})}):null},`DialogOverlay`)),e_=Nt(`DialogOverlay.RemoveScroll`),t_=a.forwardRef(zg(function(e,n){let{__scopeDialog:r,...i}=e,a=Wg(Qg,r),o=R(n,N());return t(ue,{as:e_,allowPinchZoom:!0,shards:[a.contentRef],children:t(H.div,{"data-state":p_(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),n_=`DialogContent`,r_=a.forwardRef(zg(function(e,n){let r=Xg(n_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Wg(n_,e.__scopeDialog);return t(ar,{present:i||o.open,children:o.modal?t(i_,{...a,ref:n}):t(a_,{...a,ref:n})})},`DialogContent`)),i_=a.forwardRef(zg(function(e,n){let r=Wg(n_,e.__scopeDialog),i=a.useRef(null),o=R(n,r.contentRef,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),t(o_,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:B(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:B(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:B(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),a_=a.forwardRef(zg(function(e,n){let r=Wg(n_,e.__scopeDialog),i=a.useRef(!1),o=a.useRef(!1);return t(o_,{...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`)),o_=a.forwardRef(zg(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=Wg(n_,i);return le(),t(e,{children:t(ce,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children: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":p_(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),s_=`DialogTitle`,c_=a.forwardRef(zg(function(e,n){let{__scopeDialog:r,...i}=e,a=Wg(s_,r),{setTitleCount:o}=a;return on(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(H.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),l_=`DialogDescription`,u_=a.forwardRef(zg(function(e,n){let{__scopeDialog:r,...i}=e,a=Wg(l_,r),{setDescriptionCount:o}=a;return on(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(H.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),d_=`DialogClose`,f_=a.forwardRef(zg(function(e,n){let{__scopeDialog:r,...i}=e,a=Wg(d_,r);return t(H.button,{type:`button`,...i,ref:n,onClick:B(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function p_(e){return e?`open`:`closed`}zg(p_,`getState`);var m_=`[cmdk-group=""]`,h_=`[cmdk-group-items=""]`,g_=`[cmdk-group-heading=""]`,__=`[cmdk-item=""]`,v_=`${__}:not([aria-disabled="true"])`,y_=`cmdk-item-select`,b_=`data-value`,x_=(e,t,n)=>Lg(e,t,n),S_=a.createContext(void 0),C_=()=>a.useContext(S_),w_=a.createContext(void 0),T_=()=>a.useContext(w_),E_=a.createContext(void 0),D_=a.forwardRef((e,t)=>{let n=V_(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=V_(()=>new Set),i=V_(()=>new Map),o=V_(()=>new Map),s=V_(()=>new Set),c=z_(e),{label:l,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=V(),b=V(),x=V(),S=a.useRef(null),C=W_();B_(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),B_(()=>{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,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,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??x_;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(h_);t?t.appendChild(e.parentElement===t?e:e.closest(`${h_} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${h_} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${m_}[${b_}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(b_);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=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(m_)?.querySelector(g_))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${__}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(v_)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(b_))}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(b_))}function ee(e){let t=j()?.closest(m_),n;for(;t&&!n;)t=e>0?L_(t,m_):R_(t,m_),n=t?.querySelector(v_);n?w.setState(`value`,n.getAttribute(b_)):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(H.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(y_);t.dispatchEvent(e)}}}}},a.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:q_},l),K_(e,e=>a.createElement(w_.Provider,{value:w},a.createElement(S_.Provider,{value:T},e))))}),O_=a.forwardRef((e,t)=>{let n=V(),r=a.useRef(null),i=a.useContext(E_),o=C_(),s=z_(e),c=s.current?.forceMount??i?.forceMount;B_(()=>{if(!c)return o.item(n,i?.id)},[c]);let l=U_(n,r,[e.value,e.children,r],e.keywords),u=T_(),d=H_(e=>e.value&&e.value===l.current),f=H_(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(y_,p),()=>t.removeEventListener(y_,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(H.div,{ref:At(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)}),k_=a.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=V(),c=a.useRef(null),l=a.useRef(null),u=V(),d=C_(),f=H_(e=>i||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));B_(()=>d.group(s),[]),U_(s,c,[e.value,e.heading,l]);let p=a.useMemo(()=>({id:s,forceMount:i}),[i]);return a.createElement(H.div,{ref:At(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),K_(e,e=>a.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},a.createElement(E_.Provider,{value:p},e))))}),A_=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=a.useRef(null),o=H_(e=>!e.search);return!n&&!o?null:a.createElement(H.div,{ref:At(i,t),...r,"cmdk-separator":``,role:`separator`})}),j_=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=T_(),s=H_(e=>e.search),c=H_(e=>e.selectedItemId),l=C_();return a.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),a.createElement(H.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)}})}),M_=a.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,o=a.useRef(null),s=a.useRef(null),c=H_(e=>e.selectedItemId),l=C_();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(H.div,{ref:At(o,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},K_(e,e=>a.createElement(`div`,{ref:At(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),N_=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...c}=e;return a.createElement(Gg,{open:n,onOpenChange:r},a.createElement(Zg,{container:s},a.createElement($g,{"cmdk-overlay":``,className:i}),a.createElement(r_,{"aria-label":e.label,"cmdk-dialog":``,className:o},a.createElement(D_,{ref:t,...c}))))}),P_=a.forwardRef((e,t)=>H_(e=>e.filtered.count===0)?a.createElement(H.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),F_=a.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...o}=e;return a.createElement(H.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},K_(e,e=>a.createElement(`div`,{"aria-hidden":!0},e)))}),I_=Object.assign(D_,{List:M_,Item:O_,Input:j_,Group:k_,Separator:A_,Dialog:N_,Empty:P_,Loading:F_});function L_(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function R_(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function z_(e){let t=a.useRef(e);return B_(()=>{t.current=e}),t}var B_=typeof window>`u`?a.useEffect:a.useLayoutEffect;function V_(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function H_(e){let t=T_(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function U_(e,t,n,r=[]){let i=a.useRef(),o=C_();return B_(()=>{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(b_,s),i.current=s}),i}var W_=()=>{let[e,t]=a.useState(),n=V_(()=>new Map);return B_(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function G_(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function K_({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(G_(t),{ref:t.ref},n(t.props.children)):n(t)}var q_={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function J_({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 Y_=d(!1);function X_(){return!!g(Y_)}function Z_({children:e}){return t(Y_.Provider,{value:!0,children:e})}function Q_({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(ov,{className:`z-50 fixed inset-0 bg-black/80`}),t(J_,{children:t(cv,{children:o})}),n(sv,{className:z(`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(av,{onClick:()=>f(!1),asChild:!0,autoFocus:!1,children:t(U,{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(Xe,{className:`size-4`})})})]})}),t(Z_,{children:r})]})]})}const $_=({children:e,show:r=!0,className:i,description:a,showDivider:o=!1,...s})=>r?n(lv,{className:z(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(cv,{className:`text-sm !font-normal text-muted pb-2`,children:a})]}):n(J_,{children:[t(lv,{children:e}),a&&t(cv,{children:a})]}),ev=({children:e,className:n,...r})=>t(`div`,{className:z(`text-sm max-h-[80vh] overflow-y-auto`,n),...r,children:e}),tv=({align:e=`right`,children:n,className:r,...i})=>t(`div`,{className:z(`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=Gg,rv=qg,iv=Zg,av=f_,ov=a.forwardRef(({className:e,...n},r)=>t($g,{ref:r,className:z(`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}));ov.displayName=$g.displayName;const sv=a.forwardRef(({className:e,children:r,...i},a)=>{let o=mi();return n(iv,{container:o,children:[t(ov,{}),t(r_,{ref:a,className:z(`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})]})});sv.displayName=r_.displayName;const cv=a.forwardRef(({className:e,...n},r)=>t(u_,{ref:r,className:z(`text-sm text-muted`,e),...n}));cv.displayName=u_.displayName;const lv=a.forwardRef(({className:e,...n},r)=>t(c_,{ref:r,className:z(`text-lg font-semibold leading-none tracking-tight`,e),...n}));lv.displayName=c_.displayName;const uv=a.forwardRef(({className:e,...n},r)=>t(I_,{ref:r,className:z(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...n}));uv.displayName=I_.displayName;const dv=({children:e,...n})=>t(nv,{...n,children:t(sv,{className:`shadow-lg p-0 overflow-hidden`,children:t(uv,{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})})}),fv=a.forwardRef(({className:e,...r},i)=>n(`div`,{className:`flex items-center px-3 border-b`,"cmdk-input-wrapper":``,children:[t(Ke,{className:`opacity-50 size-4 shrink-0`}),t(I_.Input,{ref:i,className:z(`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})]}));fv.displayName=I_.Input.displayName;const pv=a.forwardRef(({className:e,...n},r)=>t(I_.List,{ref:r,className:z(`overflow-y-auto overflow-x-hidden`,e),...n}));pv.displayName=I_.List.displayName;const mv=a.forwardRef((e,n)=>t(I_.Empty,{ref:n,className:`py-2 text-sm text-center`,...e}));mv.displayName=I_.Empty.displayName;const hv=a.forwardRef(({className:e,...n},r)=>t(I_.Group,{ref:r,className:z(`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}));hv.displayName=I_.Group.displayName;const gv=a.forwardRef(({className:e,...n},r)=>t(I_.Separator,{ref:r,className:z(`-mx-1 h-px bg-border`,e),...n}));gv.displayName=I_.Separator.displayName;const _v=a.forwardRef(({className:e,...n},r)=>t(I_.Item,{ref:r,className:z(`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}));_v.displayName=I_.Item.displayName;const vv=({className:e,...n})=>t(`span`,{className:z(`ms-auto text-xs tracking-widest text-muted`,e),...n});vv.displayName=`CommandShortcut`;var yv=Object.defineProperty,bv=(e,t)=>yv(e,`name`,{value:t,configurable:!0});function xv(e){let n=e+`CollectionProvider`,[r,i]=rn(n),[o,s]=r(n,{collectionRef:{current:null},itemMap:new Map}),c=bv(e=>{let{scope:n,children:r}=e,i=a.useRef(null),s=a.useRef(new Map).current;return t(o,{scope:n,itemMap:s,collectionRef:i,children:r})},`CollectionProvider`);c.displayName=n;let l=e+`CollectionSlot`,u=Nt(l),d=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=R(n,s(l,r).collectionRef);return t(u,{ref:a,children:i})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=Nt(f),h=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),l=R(n,c),u=s(f,r);return a.useEffect(()=>(u.itemMap.set(c,{ref:c,...o}),()=>void u.itemMap.delete(c))),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 bv(g,`useCollection`),[{Provider:c,Slot:d,ItemSlot:h},g,i]}bv(xv,`createCollection`);var Sv=new WeakMap,Cv=class e extends Map{static{bv(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Sv.set(this,!0)}set(e,t){return Sv.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Ev(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}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);return r===-1?this:this.insert(r,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);return r===-1?this:this.insert(r+1,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=wv(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=wv(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return wv(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=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){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,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}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 wv(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Tv(e,t);return n===-1?void 0:e[n]}bv(wv,`at`);function Tv(e,t){let n=e.length,r=Ev(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}bv(Tv,`toSafeIndex`);function Ev(e){return e!==e||e===0?0:Math.trunc(e)}bv(Ev,`toSafeInteger`);function Dv(e){let n=e+`CollectionProvider`,[r,i]=rn(n),[o,s]=r(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Cv,setItemMap:bv(()=>void 0,`setItemMap`)}),c=bv(({state:e,...n})=>e?t(u,{...n,state:e}):t(l,{...n}),`CollectionProvider`);c.displayName=n;let l=bv(e=>{let n=_();return t(u,{...e,state:n})},`CollectionInit`);l.displayName=n+`Init`;let u=bv(e=>{let{scope:n,children:r,state:i}=e,s=a.useRef(null),[c,l]=a.useState(null),u=R(s,l),[d,f]=i;return a.useEffect(()=>{if(!c)return;let e=jv(()=>{});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c]),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=Nt(d),p=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=R(n,s(d,r).collectionRef);return t(f,{ref:a,children:i})});p.displayName=d;let m=e+`CollectionItemSlot`,h=Nt(m),g=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),[l,u]=a.useState(null),d=R(n,c,u),{setItemMap:f}=s(m,r),p=a.useRef(o);Ov(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(Av):(t.set(l,{...e,element:l}),t.toSorted(Av)):t),()=>{f(e=>!l||!e.has(l)?e:(e.delete(l),new Cv(e)))}},[l,g,f]),t(h,{"data-radix-collection-item":``,ref:d,children:i})});g.displayName=m;function _(){return a.useState(new Cv)}bv(_,`useInitCollection`);function v(t){let{itemMap:n}=s(e+`CollectionConsumer`,t);return n}return bv(v,`useCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:i,useCollection:v,useInitCollection:_}]}bv(Dv,`createCollection`);function Ov(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}bv(Ov,`shallowEqual`);function kv(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}bv(kv,`isElementPreceding`);function Av(e,t){return!e[1].element||!t[1].element?0:kv(e[1].element,t[1].element)?-1:1}bv(Av,`sortByDocumentPosition`);function jv(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}bv(jv,`getChildListObserver`);var Mv=Object.defineProperty,Nv=(e,t)=>Mv(e,`name`,{value:t,configurable:!0}),Pv=!1;function Fv(){let[e,t]=a.useState(Pv);return a.useEffect(()=>{Pv||(Pv=!0,t(!0))},[]),e}Nv(Fv,`useIsHydrated`);var Iv=a.useSyncExternalStore;function Lv(){return()=>{}}Nv(Lv,`subscribe`);function Rv(){return Iv(Lv,()=>!0,()=>!1)}Nv(Rv,`useIsHydratedModern`);var zv=typeof Iv==`function`?Rv:Fv,Bv=Object.defineProperty,Vv=(e,t)=>Bv(e,`name`,{value:t,configurable:!0}),Hv=`rovingFocusGroup.onEntryFocus`,Uv={bubbles:!1,cancelable:!0},Wv=`RovingFocusGroup`,[Gv,Kv,qv]=xv(Wv),[Jv,Yv]=rn(Wv,[qv]),[Xv,Zv]=Jv(Wv),Qv=a.forwardRef(Vv(function(e,n){return t(Gv.Provider,{scope:e.__scopeRovingFocusGroup,children:t(Gv.Slot,{scope:e.__scopeRovingFocusGroup,children:t($v,{...e,ref:n})})})},`RovingFocusGroup`)),$v=a.forwardRef(Vv(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=R(n,m),g=fe(s),[_,v]=yr({prop:c,defaultProp:l??null,onChange:u,caller:Wv}),[y,b]=a.useState(!1),x=An(d),S=Kv(r),C=a.useRef(!1),[w,T]=a.useState(0);return a.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Hv,x),()=>e.removeEventListener(Hv,x)},[x]),t(Xv,{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:t(H.div,{tabIndex:y||w===0?-1:0,"data-orientation":i,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:B(e.onMouseDown,()=>{C.current=!0}),onFocus:B(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(Hv,Uv);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);ay([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}C.current=!1}),onBlur:B(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),ey=`RovingFocusGroupItem`,ty=a.forwardRef(Vv(function(e,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=V(),d=s||u,f=Zv(ey,r),p=f.currentTabStopId===d,m=Kv(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f,v=zv();return on(()=>{if(!(!v||!i))return h(),()=>g()},[v,i,h,g]),a.useEffect(()=>{if(!(v||!i))return h(),()=>g()},[v,i,h,g]),t(Gv.ItemSlot,{scope:r,id:d,focusable:i,active:o,children:t(H.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:n,onMouseDown:B(e.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:B(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:B(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=iy(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?oy(n,r+1):n.slice(r+1)}setTimeout(()=>ay(n))}}),children:typeof c==`function`?c({isCurrentTabStop:p,hasTabStop:_!=null}):c})})},`RovingFocusGroupItem`)),ny={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ry(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Vv(ry,`getDirectionAwareKey`);function iy(e,t,n){let r=ry(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ny[r]}Vv(iy,`getFocusIntent`);function ay(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Vv(ay,`focusFirst`);function oy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Vv(oy,`wrapArray`);var sy=Qv,cy=ty,ly=Object.defineProperty,X=(e,t)=>ly(e,`name`,{value:t,configurable:!0}),uy=[`Enter`,` `],dy=[`ArrowDown`,`PageUp`,`Home`],fy=[`ArrowUp`,`PageDown`,`End`],py=[...dy,...fy],my={ltr:[...uy,`ArrowRight`],rtl:[...uy,`ArrowLeft`]},hy={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},gy=`Menu`,[_y,vy,yy]=xv(gy),[by,xy]=rn(gy,[yy,Rn,Yv]),Sy=Rn(),Cy=Yv(),[wy,Ty]=by(gy),[Ey,Dy]=by(gy),Oy=X(e=>{let{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:s,modal:c=!0}=e,l=Sy(n),[u,d]=a.useState(null),f=a.useRef(!1),p=An(s),m=fe(o);return a.useEffect(()=>{let e=X(()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=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=X(()=>p(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[r,p]),t(Zn,{...l,children:t(wy,{scope:n,open:r,onOpenChange:p,content:u,onContentChange:d,children:t(Ey,{scope:n,onClose:a.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:c,children:i})})})},`Menu`),ky=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e,a=Sy(r);return t(Qn,{...a,...i,ref:n})},`MenuAnchor`)),Ay=`MenuPortal`,[jy,My]=by(Ay,{forceMount:void 0}),Ny=X(e=>{let{__scopeMenu:n,forceMount:r,children:i,container:a}=e,o=Ty(Ay,n);return t(jy,{scope:n,forceMount:r,children:t(ar,{present:r||o.open,children:t(tr,{asChild:!0,container:a,children:i})})})},`MenuPortal`),Py=`MenuContent`,[Fy,Iy]=by(Py),Ly=a.forwardRef(X(function(e,n){let r=My(Py,e.__scopeMenu),{forceMount:i=r.forceMount,...a}=e,o=Ty(Py,e.__scopeMenu),s=Dy(Py,e.__scopeMenu);return t(_y.Provider,{scope:e.__scopeMenu,children:t(ar,{present:i||o.open,children:t(_y.Slot,{scope:e.__scopeMenu,children:s.modal?t(Ry,{...a,ref:n}):t(zy,{...a,ref:n})})})})},`MenuContent`)),Ry=a.forwardRef(X(function(e,n){let r=Ty(Py,e.__scopeMenu),i=a.useRef(null),o=R(n,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),t(Vy,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:B(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentModal`)),zy=a.forwardRef(X(function(e,n){let r=Ty(Py,e.__scopeMenu);return t(Vy,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentNonModal`)),By=Nt(`MenuContent.ScrollLock`),Vy=a.forwardRef(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=Ty(Py,r),y=Dy(Py,r),b=Sy(r),x=Cy(r),S=vy(r),[C,w]=a.useState(null),T=a.useRef(null),E=R(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:By,allowPinchZoom:!0}:void 0,te=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=vb(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;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&&bb(e,A.current?.area),[]);return t(Fy,{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:t(P,{...ee,children:t(ce,{asChild:!0,trapped:o,onMountAutoFocus:B(s,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:t(M,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:t(sy,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:i,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:B(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t($n,{role:`menu`,"aria-orientation":`vertical`,"data-state":pb(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:E,style:{outline:`none`,..._.style},onKeyDown:B(_.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||!py.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);fy.includes(e.key)&&a.reverse(),gb(a)}),onBlur:B(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:B(e.onPointerMove,xb(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`)),Hy=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e;return t(H.div,{role:`group`,...i,ref:n})},`MenuGroup`)),Uy=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e;return t(H.div,{...i,ref:n})},`MenuLabel`)),Wy=`MenuItem`,Gy=`menu.itemSelect`,Ky=a.forwardRef(X(function(e,n){let{disabled:r=!1,onSelect:i,...o}=e,s=a.useRef(null),c=Dy(Wy,e.__scopeMenu),l=Iy(Wy,e.__scopeMenu),u=R(n,s),d=a.useRef(!1),f=X(()=>{let e=s.current;if(!r&&e){let t=new CustomEvent(Gy,{bubbles:!0,cancelable:!0});e.addEventListener(Gy,e=>i?.(e),{once:!0}),Dn(e,t),t.defaultPrevented?d.current=!1:c.onClose()}},`handleSelect`);return t(qy,{...o,ref:u,disabled:r,onClick:B(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:B(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:B(e.onKeyDown,e=>{r||e.target!==e.currentTarget||(l.searchRef.current===``||e.key!==` `)&&uy.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),qy=a.forwardRef(X(function(e,n){let{__scopeMenu:r,disabled:i=!1,textValue:o,...s}=e,c=Iy(Wy,r),l=Cy(r),u=a.useRef(null),d=R(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]),t(_y.ItemSlot,{scope:r,disabled:i,textValue:o??m,children:t(cy,{asChild:!0,...l,focusable:!i,children:t(H.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...s,ref:d,onPointerMove:B(e.onPointerMove,xb(e=>{i?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:B(e.onPointerLeave,xb(e=>c.onItemLeave(e))),onFocus:B(e.onFocus,()=>p(!0)),onBlur:B(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),Jy=a.forwardRef(X(function(e,n){let{checked:r=!1,onCheckedChange:i,...a}=e;return t(tb,{scope:e.__scopeMenu,checked:r,children:t(Ky,{role:`menuitemcheckbox`,"aria-checked":mb(r)?`mixed`:r,...a,ref:n,"data-state":hb(r),onSelect:B(a.onSelect,()=>i?.(mb(r)?!0:!r),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[Yy,Xy]=by(`MenuRadioGroup`,{value:void 0,onValueChange:X(()=>{},`onValueChange`)}),Zy=a.forwardRef(X(function(e,n){let{value:r,onValueChange:i,...a}=e,o=An(i);return t(Yy,{scope:e.__scopeMenu,value:r,onValueChange:o,children:t(Hy,{...a,ref:n})})},`MenuRadioGroup`)),Qy=`MenuRadioItem`,$y=a.forwardRef(X(function(e,n){let{value:r,...i}=e,a=Xy(Qy,e.__scopeMenu),o=r===a.value;return t(tb,{scope:e.__scopeMenu,checked:o,children:t(Ky,{role:`menuitemradio`,"aria-checked":o,...i,ref:n,"data-state":hb(o),onSelect:B(i.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),eb=`MenuItemIndicator`,[tb,nb]=by(eb,{checked:!1}),rb=a.forwardRef(X(function(e,n){let{__scopeMenu:r,forceMount:i,...a}=e,o=nb(eb,r);return t(ar,{present:i||mb(o.checked)||o.checked===!0,children:t(H.span,{...a,ref:n,"data-state":hb(o.checked)})})},`MenuItemIndicator`)),ib=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e;return t(H.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:n})},`MenuSeparator`)),ab=`MenuSub`,[ob,sb]=by(ab),cb=X(e=>{let{__scopeMenu:n,children:r,open:i=!1,onOpenChange:o}=e,s=Ty(ab,n),c=Sy(n),[l,u]=a.useState(null),[d,f]=a.useState(null),p=An(o);return a.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),t(Zn,{...c,children:t(wy,{scope:n,open:i,onOpenChange:p,content:d,onContentChange:f,children:t(ob,{scope:n,contentId:V(),triggerId:V(),trigger:l,onTriggerChange:u,children:r})})})},`MenuSub`),lb=`MenuSubTrigger`,ub=a.forwardRef(X(function(e,n){let r=Ty(lb,e.__scopeMenu),i=Dy(lb,e.__scopeMenu),o=sb(lb,e.__scopeMenu),s=Iy(lb,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=R(n,o.onTriggerChange);return t(ky,{asChild:!0,...d,children:t(qy,{id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":pb(r.open),...e,ref:p,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:B(e.onPointerMove,xb(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:B(e.onPointerLeave,xb(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:B(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(s.searchRef.current===``||t.key!==` `)&&my[i.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),db=`MenuSubContent`,fb=a.forwardRef(X(function(e,n){let r=My(Py,e.__scopeMenu),{forceMount:i=r.forceMount,align:o=`start`,...s}=e,c=Ty(Py,e.__scopeMenu),l=Dy(Py,e.__scopeMenu),u=sb(db,e.__scopeMenu),d=a.useRef(null),f=R(n,d);return t(_y.Provider,{scope:e.__scopeMenu,children:t(ar,{present:i||c.open,children:t(_y.Slot,{scope:e.__scopeMenu,children:t(Vy,{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:B(e.onFocusOutside,e=>{e.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:B(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:B(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=hy[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function pb(e){return e?`open`:`closed`}X(pb,`getOpenState`);function mb(e){return e===`indeterminate`}X(mb,`isIndeterminate`);function hb(e){return mb(e)?`indeterminate`:e?`checked`:`unchecked`}X(hb,`getCheckedState`);function gb(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(gb,`focusFirst`);function _b(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(_b,`wrapArray`);function vb(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=_b(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(vb,`getNextMatch`);function yb(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(yb,`isPointInPolygon`);function bb(e,t){return t?yb({x:e.clientX,y:e.clientY},t):!1}X(bb,`isPointerInGraceArea`);function xb(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(xb,`whenMouse`);var Sb=Oy,Cb=ky,wb=Ny,Tb=Ly,Eb=Hy,Db=Uy,Ob=Ky,kb=Jy,Ab=Zy,jb=$y,Mb=rb,Nb=ib,Pb=cb,Fb=ub,Ib=fb,Lb=Object.defineProperty,Rb=(e,t)=>Lb(e,`name`,{value:t,configurable:!0}),zb=`DropdownMenu`,[Bb,Vb]=rn(zb,[xy]),Hb=xy(),[Ub,Wb]=Bb(zb),Gb=Rb(e=>{let{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=Hb(n),d=a.useRef(null),[f,p]=yr({prop:o,defaultProp:s??!1,onChange:c,caller:zb});return t(Ub,{scope:n,triggerId:V(),triggerRef:d,contentId:V(),open:f,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:t(Sb,{...u,open:f,onOpenChange:p,dir:i,modal:l,children:r})})},`DropdownMenu`),Kb=`DropdownMenuTrigger`,qb=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=e,o=Wb(Kb,r),s=Hb(r),c=R(n,o.triggerRef);return t(Cb,{asChild:!0,...s,children:t(H.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:B(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:B(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Jb=Rb(e=>{let{__scopeDropdownMenu:n,...r}=e,i=Hb(n);return t(wb,{...i,...r})},`DropdownMenuPortal`),Yb=`DropdownMenuContent`,Xb=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,o=Wb(Yb,r),s=Hb(r),c=a.useRef(!1);return t(Tb,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...i,ref:n,onCloseAutoFocus:B(e.onCloseAutoFocus,e=>{c.current||o.triggerRef.current?.focus(),c.current=!1,e.preventDefault()}),onInteractOutside:B(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`)),Zb=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Hb(r);return t(Eb,{...a,...i,ref:n})},`DropdownMenuGroup`)),Qb=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Hb(r);return t(Db,{...a,...i,ref:n})},`DropdownMenuLabel`)),$b=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Hb(r);return t(Ob,{...a,...i,ref:n})},`DropdownMenuItem`)),ex=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Hb(r);return t(kb,{...a,...i,ref:n})},`DropdownMenuCheckboxItem`)),tx=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Hb(r);return t(Ab,{...a,...i,ref:n})},`DropdownMenuRadioGroup`)),nx=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Hb(r);return t(jb,{...a,...i,ref:n})},`DropdownMenuRadioItem`)),rx=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Hb(r);return t(Mb,{...a,...i,ref:n})},`DropdownMenuItemIndicator`)),ix=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Hb(r);return t(Nb,{...a,...i,ref:n})},`DropdownMenuSeparator`)),ax=Rb(e=>{let{__scopeDropdownMenu:n,children:r,open:i,onOpenChange:a,defaultOpen:o}=e,s=Hb(n),[c,l]=yr({prop:i,defaultProp:o??!1,onChange:a,caller:`DropdownMenuSub`});return t(Pb,{...s,open:c,onOpenChange:l,children:r})},`DropdownMenuSub`),ox=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Hb(r);return t(Fb,{...a,...i,ref:n})},`DropdownMenuSubTrigger`)),sx=a.forwardRef(Rb(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=Hb(r);return t(Ib,{...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`)),cx=Gb,lx=qb,ux=Jb,dx=Xb,fx=Zb,px=Qb,mx=$b,hx=ex,gx=tx,_x=nx,vx=rx,yx=ix,bx=ax,xx=ox,Sx=sx;const Cx=a.createContext(!1);function wx({...e}){return t(cx,{"data-slot":`dropdown-menu`,...e})}function Tx({...e}){return t(ux,{"data-slot":`dropdown-menu-portal`,...e})}function Ex({...e}){return t(lx,{"data-slot":`dropdown-menu-trigger`,...e})}function Dx({className:e,align:n=`start`,sideOffset:r=4,...i}){return t(ux,{children:t(dx,{"data-slot":`dropdown-menu-content`,sideOffset:r,align:n,className:z(`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 Ox({...e}){return t(fx,{"data-slot":`dropdown-menu-group`,...e})}function kx({className:e,inset:n,variant:r=`default`,...i}){return t(mx,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":r,className:z(`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 Ax({className:e,children:r,checked:i,inset:a,...o}){return n(hx,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:z(`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(vx,{children:t(je,{})})}),r]})}function jx({...e}){return t(gx,{"data-slot":`dropdown-menu-radio-group`,...e})}function Mx({className:e,children:r,inset:i,...a}){return n(_x,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:z(`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(vx,{children:t(je,{})})}),r]})}function Nx({className:e,inset:n,...r}){return t(px,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:z(`text-muted px-1.5 py-1 text-xs font-medium data-inset:ps-7`,e),...r})}function Px({className:e,...n}){return t(yx,{"data-slot":`dropdown-menu-separator`,className:z(`bg-border -mx-1 my-1 h-px`,e),...n})}function Fx({className:e,...n}){return t(`span`,{"data-slot":`dropdown-menu-shortcut`,className:z(`text-muted group-focus/dropdown-menu-item:text-muted ms-auto text-xs tracking-widest`,e),...n})}function Ix({...e}){return t(bx,{"data-slot":`dropdown-menu-sub`,...e})}function Lx({className:e,inset:r,children:i,...a}){return n(xx,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":r,className:z(`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(Ne,{className:`cn-rtl-flip ms-auto`})]})}function Rx({className:e,...n}){return t(Sx,{"data-slot":`dropdown-menu-sub-content`,className:z(`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 zx={left:`start`,center:`center`,right:`end`};function Bx({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:z(`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(Cx.Provider,{value:!0,children:r})})})]}):n(wx,{children:[t(Ex,{asChild:!0,children:t(`span`,{className:`-m-1.5 flex items-center p-1.5`,children:e})}),t(Dx,{align:zx[i],className:`w-max`,children:r})]})}function Vx({children:e,label:r}){return n(Ox,{children:[r&&t(Nx,{children:r}),e]})}function Hx({children:e,href:n,onClick:r,isDisabled:i=!1,variant:o=`default`,className:s}){let c=a.useContext(Cx),l=z(`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(kx,{className:z(`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 Ux=({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:z(n,`overflow-hidden transition-all duration-100 ease-in`),style:{height:i},children:t(`div`,{ref:r,children:e})})},Wx=(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);!Gx(i,a)&&r||Object.defineProperty(e,n,a)},Gx=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)},Kx=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},qx=(e,t)=>`/* Wrapped ${e}*/\n${t}`,Jx=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),Yx=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),Xx=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=qx.bind(null,r,t.toString());Object.defineProperty(i,"name",Yx);let{writable:a,enumerable:o,configurable:s}=Jx;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function Zx(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))Wx(e,t,r,n);return Kx(e,t),Xx(e,t,r),e}const Qx=2147483647,$x=new WeakMap,eS=new WeakMap,tS=new WeakMap;function nS(e,t){let n=e.get(t);if(n){if(n.maxAge<=Date.now()){e.delete(t);return}return n}}function rS(e,{cacheKey:t,cache:n=new Map,maxAge:r}={}){if(r===0)return e;if(typeof r==`number`&&Number.isFinite(r)){if(r>Qx)throw TypeError(`The \`maxAge\` option cannot exceed ${Qx}.`);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=nS(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>Qx)throw TypeError(`The \`maxAge\` function result cannot exceed ${Qx}.`)}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),eS.get(i)?.delete(e)},l);e.unref?.();let t=eS.get(i)??new Set;t.add(e),eS.set(i,t)}return c};return Zx(i,e,{ignoreNonConfigurable:!0}),$x.set(i,n),tS.set(i,t??(e=>e[0])),i}function iS(e){return typeof e==`string`}function aS(e,t,n){return n.indexOf(e)===t}function oS(e){return e.toLowerCase()===e}function sS(e){return e.indexOf(`,`)===-1?e:e.split(`,`)}function cS(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 cS(n)}if(e.indexOf(`@`)!==-1){var r=e.split(`@`)[0],n=r===void 0?``:r;return cS(n)}if(e.indexOf(`-`)===-1||!oS(e))return e;var i=e.split(`-`),a=i[0],o=i[1];return`${a}-${(o===void 0?``:o).toUpperCase()}`}function lS(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(sS(d))}var f=navigator.language,p=f&&sS(f);o=o.concat(c,p)}return r&&o.push(a),o.filter(iS).map(cS).filter(aS)}var uS=rS(lS,{cacheKey:JSON.stringify});function dS(e){return uS(e)[0]||null}var fS=rS(dS,{cacheKey:JSON.stringify});const pS=new Map;function mS(e){return function(t,n){let r=t||fS();pS.has(r)||pS.set(r,new Map);let i=pS.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 hS(e){let t=new Date(e);return new Date(t.setHours(12))}function gS(e){return(t,n)=>mS(e)(t,hS(n))}const _S={day:`numeric`},vS={day:`numeric`,month:`long`,year:`numeric`},yS={month:`long`},bS={month:`long`,year:`numeric`},xS={weekday:`short`},SS={weekday:`long`},CS={year:`numeric`},wS=gS(_S),TS=gS(vS),ES=gS(yS),DS=gS(bS),OS=gS(xS),kS=gS(SS),AS=gS(CS);function jS(e,t,n){return function(r,i=n){return t(e(r)+i)}}function MS(e){return function(t){return new Date(e(t).getTime()-1)}}function NS(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 PS(e){if(e instanceof Date)return e.getMonth();throw Error(`Failed to get month from date: ${e}.`)}function FS(e){if(e instanceof Date)return e.getDate();throw Error(`Failed to get year from date: ${e}.`)}function IS(e){let t=Z(e),n=t+(-t+1)%100,r=new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const LS=jS(Z,IS,-100),RS=jS(Z,IS,100),zS=MS(RS),BS=jS(Z,zS,-100),VS=NS(IS,zS);function HS(e){let t=Z(e),n=t+(-t+1)%10,r=new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const US=jS(Z,HS,-10),WS=jS(Z,HS,10),GS=MS(WS),KS=jS(Z,GS,-10),qS=NS(HS,GS);function JS(e){let t=Z(e),n=new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}const YS=jS(Z,JS,-1),XS=jS(Z,JS,1),ZS=MS(XS),QS=jS(Z,ZS,-1),$S=NS(JS,ZS);function eC(e,t){return function(n,r=t){let i=Z(n),a=PS(n)+r,o=new Date;return o.setFullYear(i,a,1),o.setHours(0,0,0,0),e(o)}}function tC(e){let t=Z(e),n=PS(e),r=new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}const nC=eC(tC,-1),rC=eC(tC,1),iC=MS(rC),aC=eC(iC,-1),oC=NS(tC,iC);function sC(e,t){return function(n,r=t){let i=Z(n),a=PS(n),o=FS(n)+r,s=new Date;return s.setFullYear(i,a,o),s.setHours(0,0,0,0),e(s)}}function cC(e){let t=Z(e),n=PS(e),r=FS(e),i=new Date;return i.setFullYear(t,n,r),i.setHours(0,0,0,0),i}const lC=MS(sC(cC,1)),uC=NS(cC,lC);function dC(e){return FS(iC(e))}const fC={GREGORY:`gregory`,HEBREW:`hebrew`,ISLAMIC:`islamic`,ISO_8601:`iso8601`},pC={gregory:[`en-CA`,`en-US`,`es-AR`,`es-BO`,`es-CL`,`es-CO`,`es-CR`,`es-DO`,`es-EC`,`es-GT`,`es-HN`,`es-MX`,`es-NI`,`es-PA`,`es-PE`,`es-PR`,`es-SV`,`es-VE`,`pt-BR`],hebrew:[`he`,`he-IL`],islamic:[`ar`,`ar-AE`,`ar-BH`,`ar-DZ`,`ar-EG`,`ar-IQ`,`ar-JO`,`ar-KW`,`ar-LY`,`ar-OM`,`ar-QA`,`ar-SA`,`ar-SD`,`ar-SY`,`ar-YE`,`dv`,`dv-MV`,`ps`,`ps-AR`]},mC=[0,1,2,3,4,5,6],hC=mC[0],gC=mC[5],_C=mC[6];function vC(e,t=fC.ISO_8601){let n=e.getDay();switch(t){case fC.ISO_8601:return(n+6)%7;case fC.ISLAMIC:return(n+1)%7;case fC.HEBREW:case fC.GREGORY:return n;default:throw Error(`Unsupported calendar type.`)}}function yC(e){return Z(IS(e))}function bC(e){return Z(HS(e))}function xC(e,t=fC.ISO_8601){let n=Z(e),r=PS(e),i=e.getDate()-vC(e,t);return new Date(n,r,i)}function SC(e,t=fC.ISO_8601){let n=t===fC.GREGORY?fC.GREGORY:fC.ISO_8601,r=xC(e,t),i=Z(e)+1,a,o;do a=new Date(i,0,n===fC.ISO_8601?4:1),o=xC(a,t),--i;while(e<o);return Math.round((r.getTime()-o.getTime())/6048e5)+1}function CC(e,t){switch(e){case`century`:return IS(t);case`decade`:return HS(t);case`year`:return JS(t);case`month`:return tC(t);case`day`:return cC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function wC(e,t){switch(e){case`century`:return LS(t);case`decade`:return US(t);case`year`:return YS(t);case`month`:return nC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function TC(e,t){switch(e){case`century`:return RS(t);case`decade`:return WS(t);case`year`:return XS(t);case`month`:return rC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function EC(e,t){switch(e){case`decade`:return US(t,-100);case`year`:return YS(t,-10);case`month`:return nC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function DC(e,t){switch(e){case`decade`:return WS(t,100);case`year`:return XS(t,10);case`month`:return rC(t,12);default:throw Error(`Invalid rangeType: ${e}`)}}function OC(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 lC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function kC(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 AC(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 jC(e,t){switch(e){case`century`:return VS(t);case`decade`:return qS(t);case`year`:return $S(t);case`month`:return oC(t);case`day`:return uC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function MC(e,t,n){let r=[t,n].sort((e,t)=>e.getTime()-t.getTime());return[CC(e,r[0]),OC(e,r[1])]}function NC(e,t,n){return n.map(n=>(t||AS)(e,n)).join(` – `)}function PC(e,t,n){return NC(e,t,VS(n))}function FC(e,t,n){return NC(e,t,qS(n))}function IC(e){return e.getDay()===new Date().getDay()}function LC(e,t=fC.ISO_8601){let n=e.getDay();switch(t){case fC.ISLAMIC:case fC.HEBREW:return n===gC||n===_C;case fC.ISO_8601:case fC.GREGORY:return n===_C||n===hC;default:throw Error(`Unsupported calendar type.`)}}const RC=`react-calendar__navigation`;function zC({activeStartDate:r,drillUp:i,formatMonthYear:a=DS,formatYear:o=AS,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=wC(C,r),O=E?EC(C,r):void 0,k=TC(C,r),A=E?DC(C,r):void 0,j=(()=>{if(D.getFullYear()<0)return!0;let e=kC(C,r);return l&&l>=e})(),M=E&&(()=>{if(O.getFullYear()<0)return!0;let e=AC(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 PC(s,o,e);case`decade`:return FC(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||fS()||void 0,view:C}):t}function ie(){let a=`${RC}__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:RC,children:[v!==null&&E?t(`button`,{"aria-label":_,className:`${RC}__arrow ${RC}__prev2-button`,disabled:M,onClick:te,type:`button`,children:v}):null,b!==null&&t(`button`,{"aria-label":y,className:`${RC}__arrow ${RC}__prev-button`,disabled:j,onClick:ee,type:`button`,children:b}),ie(),g!==null&&t(`button`,{"aria-label":h,className:`${RC}__arrow ${RC}__next-button`,disabled:N,onClick:F,type:`button`,children:g}),m!==null&&E?t(`button`,{"aria-label":p,className:`${RC}__arrow ${RC}__next2-button`,disabled:P,onClick:ne,type:`button`,children:m}):null]})}function BC(e){return`${e}%`}function VC({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?BC(100*a/r):null;return u(e,{...e.props,style:{flexBasis:BC(100/r),flexShrink:0,flexGrow:0,overflow:`hidden`,marginLeft:n,marginInlineStart:n,marginInlineEnd:0}})})})}function HC(e,t,n){return t&&t>e?t:n&&n<e?n:e}function UC(e,t){return t[0]<=e&&t[1]>=e}function WC(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function GC(e,t){return UC(e[0],t)||UC(e[1],t)}function KC(e,t,n){let r=GC(t,e),i=[];if(r){i.push(n);let r=UC(e[0],t),a=UC(e[1],t);r&&i.push(`${n}Start`),a&&i.push(`${n}End`),r&&a&&i.push(`${n}BothEnds`)}return i}function qC(e){return Array.isArray(e)?e[0]!==null&&e[1]!==null:e!==null}function JC(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=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 jC(t,n)})();if(UC(o,s)&&a.push(`${i}--now`),!t||!qC(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 jC(n,t)})();WC(c,s)?a.push(`${i}--active`):GC(c,s)&&a.push(`${i}--hasActive`);let l=KC(c,s,`${i}--range`);if(a.push(...l),r&&(Array.isArray(t)?t:[t]).length===1){let e=KC(r>c[0]?[c[0],r]:[r,c[0]],s,`${i}--hover`);a.push(...e)}return a}function YC({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:JC({date:t,dateType:i,hover:o,value:d,valueType:f}),date:t}))}return t(VC,{className:e,count:n,offset:s,wrap:!0,children:p})}function XC(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 ZC=`react-calendar__century-view__decades__decade`;function QC({classes:e=[],currentCentury:n,formatYear:r=AS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(ZC),IS(a).getFullYear()!==n&&s.push(`${ZC}--neighboringCentury`),t(XC,{...i,classes:s,maxDateTransform:GS,minDateTransform:HS,view:`century`,children:FC(o,r,a)})}function $C(e){let{activeStartDate:n,hover:r,showNeighboringCentury:i,value:a,valueType:o,...s}=e,c=yC(n),l=c+(i?119:99);return t(YC,{className:`react-calendar__century-view__decades`,dateTransform:HS,dateType:`decade`,end:l,hover:r,renderTile:({date:e,...r})=>t(QC,{...s,...r,activeStartDate:n,currentCentury:c,date:e},e.getTime()),start:c,step:10,value:a,valueType:o})}function ew(e){function n(){return t($C,{...e})}return t(`div`,{className:`react-calendar__century-view`,children:n()})}const tw=`react-calendar__decade-view__years__year`;function nw({classes:e=[],currentDecade:n,formatYear:r=AS,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(tw),HS(a).getFullYear()!==n&&s.push(`${tw}--neighboringDecade`),t(XC,{...i,classes:s,maxDateTransform:ZS,minDateTransform:JS,view:`decade`,children:r(o,a)})}function rw(e){let{activeStartDate:n,hover:r,showNeighboringDecade:i,value:a,valueType:o,...s}=e,c=bC(n),l=c+(i?11:9);return t(YC,{className:`react-calendar__decade-view__years`,dateTransform:JS,dateType:`year`,end:l,hover:r,renderTile:({date:e,...r})=>t(nw,{...s,...r,activeStartDate:n,currentDecade:c,date:e},e.getTime()),start:c,value:a,valueType:o})}function iw(e){function n(){return t(rw,{...e})}return t(`div`,{className:`react-calendar__decade-view`,children:n()})}const aw=`react-calendar__month-view__days__day`;function ow({calendarType:e,classes:n=[],currentMonthIndex:r,formatDay:i=wS,formatLongDate:a=TS,...o}){let{date:s,locale:c}=o,l=[];return n&&l.push(...n),l.push(aw),LC(s,e)&&l.push(`${aw}--weekend`),s.getMonth()!==r&&l.push(`${aw}--neighboringMonth`),t(XC,{...o,classes:l,formatAbbr:a,maxDateTransform:lC,minDateTransform:cC,view:`month`,children:i(c,s)})}function sw(e){let{activeStartDate:n,calendarType:r,hover:i,showFixedNumberOfWeeks:a,showNeighboringMonth:o,value:s,valueType:c,...l}=e,u=Z(n),d=PS(n),f=a||o,p=vC(n,r),m=f?0:p,h=(f?-p:0)+1,g=(()=>{if(a)return h+42-1;let e=dC(n);if(o){let t=new Date;return t.setFullYear(u,d,e),t.setHours(0,0,0,0),e+(7-vC(t,r)-1)}return e})();return t(YC,{className:`react-calendar__month-view__days`,count:7,dateTransform:e=>{let t=new Date;return t.setFullYear(u,d,e),cC(t)},dateType:`day`,hover:i,end:g,renderTile:({date:e,...i})=>t(ow,{...l,...i,activeStartDate:n,calendarType:r,currentMonthIndex:d,date:e},e.getTime()),offset:m,start:h,value:s,valueType:c})}const cw=`react-calendar__month-view__weekdays`,lw=`${cw}__weekday`;function uw(e){let{calendarType:n,formatShortWeekday:i=OS,formatWeekday:a=kS,locale:o,onMouseLeave:s}=e,c=tC(new Date),l=Z(c),u=PS(c),d=[];for(let e=1;e<=7;e+=1){let s=new Date(l,u,e-vC(c,n)),f=a(o,s);d.push(t(`div`,{className:r(lw,IC(s)&&`${lw}--current`,LC(s,n)&&`${lw}--weekend`),children:t(`abbr`,{"aria-label":f,title:f,children:i(o,s).replace(`.`,``)})},e))}return t(VC,{className:cw,count:7,onFocus:s,onMouseOver:s,children:d})}const dw=`react-calendar__tile`;function fw(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:dw,onClick:e=>r(a,n,e),type:`button`,children:i})}{let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`div`,{...o,className:dw,children:i})}}function pw(e){let{activeStartDate:n,calendarType:r,onClickWeekNumber:i,onMouseLeave:a,showFixedNumberOfWeeks:o}=e,s=(()=>{if(o)return 6;let e=dC(n)-(7-vC(n,r));return 1+Math.ceil(e/7)})(),c=(()=>{let e=Z(n),t=PS(n),i=FS(n),a=[];for(let n=0;n<s;n+=1)a.push(xC(new Date(e,t,i+n*7),r));return a})(),l=c.map(e=>SC(e,r));return t(VC,{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(fw,{date:r,onClickWeekNumber:i,weekNumber:e},e)})})}function mw(e){if(e){for(let[t,n]of Object.entries(pC))if(n.includes(e))return t}return fC.ISO_8601}function hw(e){let{activeStartDate:i,locale:a,onMouseLeave:o,showFixedNumberOfWeeks:s}=e,{calendarType:c=mw(a),formatShortWeekday:l,formatWeekday:u,onClickWeekNumber:d,showWeekNumbers:f,...p}=e;function m(){return t(uw,{calendarType:c,formatShortWeekday:l,formatWeekday:u,locale:a,onMouseLeave:o})}function h(){return f?t(pw,{activeStartDate:i,calendarType:c,onClickWeekNumber:d,onMouseLeave:o,showFixedNumberOfWeeks:s}):null}function g(){return t(sw,{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 gw({classes:e=[],formatMonth:n=ES,formatMonthYear:r=DS,...i}){let{date:a,locale:o}=i;return t(XC,{...i,classes:[...e,`react-calendar__year-view__months__month`],formatAbbr:r,maxDateTransform:iC,minDateTransform:tC,view:`year`,children:n(o,a)})}function _w(e){let{activeStartDate:n,hover:r,value:i,valueType:a,...o}=e,s=Z(n);return t(YC,{className:`react-calendar__year-view__months`,dateTransform:e=>{let t=new Date;return t.setFullYear(s,e,1),tC(t)},dateType:`month`,end:11,hover:r,renderTile:({date:e,...r})=>t(gw,{...o,...r,activeStartDate:n,date:e},e.getTime()),start:0,value:i,valueType:a})}function vw(e){function n(){return t(_w,{...e})}return t(`div`,{className:`react-calendar__year-view`,children:n()})}const yw=`react-calendar`,bw=[`century`,`decade`,`year`,`month`],xw=[`decade`,`year`,`month`,`day`],Sw=new Date;Sw.setFullYear(1,0,1),Sw.setHours(0,0,0,0);const Cw=new Date(864e13);function ww(e){return e instanceof Date?e:new Date(e)}function Tw(e,t){return bw.slice(bw.indexOf(e),bw.indexOf(t)+1)}function Ew(e,t,n){return Tw(t,n).indexOf(e)!==-1}function Dw(e,t,n){return e&&Ew(e,t,n)?e:n}function Ow(e){let t=bw.indexOf(e);return xw[t]}function kw(e,t){let n=Array.isArray(e)?e[t]:e;if(!n)return null;let r=ww(n);if(Number.isNaN(r.getTime()))throw Error(`Invalid date: ${e}`);return r}function Aw({value:e,minDate:t,maxDate:n,maxDetail:r},i){let a=kw(e,i);if(!a)return null;let o=Ow(r);return HC((()=>{switch(i){case 0:return CC(o,a);case 1:return OC(o,a);default:throw Error(`Invalid index value: ${i}`)}})(),t,n)}const jw=e=>Aw(e,0),Mw=e=>Aw(e,1),Nw=e=>[jw,Mw].map(t=>t(e));function Pw({maxDate:e,maxDetail:t,minDate:n,minDetail:r,value:i,view:a}){return CC(Dw(a,r,t),jw({value:i,minDate:n,maxDate:e,maxDetail:t})||new Date)}function Fw({activeStartDate:e,defaultActiveStartDate:t,defaultValue:n,defaultView:r,maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c,view:l}){let u=Dw(l,s,a),d=e||t;return d?CC(u,d):Pw({maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c||n,view:l||r})}function Iw(e){return e&&(!Array.isArray(e)||e.length===1)}function Lw(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var Rw=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=Cw,maxDetail:D=`month`,minDate:O=Sw,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),[I,je]=w(null),[Me,Ne]=w(Array.isArray(d)?d.map(e=>e===null?null:ww(e)):d==null?null:ww(d)),[Pe,Fe]=w(f),Ie=a||ke||Fw({activeStartDate:a,defaultActiveStartDate:u,defaultValue:d,defaultView:f,maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:De,view:Oe}),Le=(()=>{let e=ge&&Iw(Me)||De===void 0?Me:De;return e?Array.isArray(e)?e.map(e=>e===null?null:ww(e)):e===null?null:ww(e):null})(),Re=Ow(D),L=Dw(Oe||Pe,k,D),ze=Tw(k,D),Be=ge?I:null,Ve=ze.indexOf(L)<ze.length-1,He=ze.indexOf(L)>0,Ue=h(e=>(()=>{switch(he){case`start`:return jw;case`end`:return Mw;case`range`:return Nw;default:throw Error(`Invalid returnValue.`)}})()({maxDate:E,maxDetail:D,minDate:O,value:e}),[E,D,O,he]),We=h((e,t)=>{Ae(e);let n={action:t,activeStartDate:e,value:Le,view:L};F&&!Lw(Ie,e)&&F(n)},[Ie,F,Le,L]),Ge=h((e,t)=>{let n=(()=>{switch(L){case`century`:return ie;case`decade`:return se;case`year`:return ae;case`month`:return re;default:throw Error(`Invalid view: ${L}.`)}})();n&&n(e,t)},[re,ie,ae,se,L]),Ke=h((e,t)=>{if(!Ve)return;Ge(e,t);let n=ze[ze.indexOf(L)+1];if(!n)throw Error(`Attempted to drill down from the lowest view.`);Ae(e),Fe(n);let r={action:`drillDown`,activeStartDate:e,value:Le,view:n};F&&!Lw(Ie,e)&&F(r),ue&&L!==n&&ue(r),ce&&ce(r)},[Ie,Ve,F,Ge,ce,ue,Le,L,ze]),qe=h(()=>{if(!He)return;let e=ze[ze.indexOf(L)-1];if(!e)throw Error(`Attempted to drill up from the highest view.`);let t=CC(e,Ie);Ae(t),Fe(e);let n={action:`drillUp`,activeStartDate:t,value:Le,view:e};F&&!Lw(Ie,t)&&F(n),ue&&L!==e&&ue(n),le&&le(n)},[Ie,He,F,le,ue,Le,L,ze]),Je=h((e,t)=>{let n=Le;Ge(e,t);let r=ge&&!Iw(n),i;if(ge){if(r)i=CC(Re,e);else{if(!n)throw Error(`previousValue is required`);if(Array.isArray(n))throw Error(`previousValue must not be an array`);i=MC(Re,n,e)}}else i=Ue(e);let a=!ge||r||S?Pw({maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:i,view:L}):null;t.persist(),Ae(a),Ne(i);let s={action:`onChange`,activeStartDate:a,value:i,view:L};if(F&&!Lw(Ie,a)&&F(s),ne){if(ge){if(!Iw(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,Ue,S,E,D,O,k,F,ne,Ge,ge,Le,Re,L]);function Ye(e){je(e)}function Xe(){je(null)}y(i,()=>({activeStartDate:Ie,drillDown:Ke,drillUp:qe,onChange:Je,setActiveStartDate:We,value:Le,view:L}),[Ie,Ke,qe,Je,We,Le,L]);function Ze(e){let n={activeStartDate:e?TC(L,Ie):CC(L,Ie),hover:Be,locale:T,maxDate:E,minDate:O,onClick:Ve?Ke:Je,onMouseOver:ge?Ye:void 0,tileClassName:we,tileContent:Te,tileDisabled:Ee,value:Le,valueType:Re};switch(L){case`century`:return t(ew,{formatYear:x,showNeighboringCentury:be,...n});case`decade`:return t(iw,{formatYear:x,showNeighboringDecade:xe,...n});case`year`:return t(vw,{formatMonth:g,formatMonthYear:_,...n});case`month`:return t(hw,{calendarType:s,formatDay:p,formatLongDate:m,formatShortWeekday:v,formatWeekday:b,onClickWeekNumber:oe,onMouseLeave:ge?Xe:void 0,showFixedNumberOfWeeks:ve===void 0?_e:ve,showNeighboringMonth:Se,showWeekNumbers:Ce,...n});default:throw Error(`Invalid view: ${L}.`)}}function Qe(){return ye?t(zC,{activeStartDate:Ie,drillUp:qe,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:We,showDoubleView:_e,view:L,views:ze}):null}return n(`div`,{className:r(yw,ge&&(Array.isArray(Le)?Le:[Le]).length===1&&`${yw}--selectRange`,_e&&`${yw}--doubleView`,c),"data-testid":l,ref:C,children:[Qe(),n(`div`,{className:`${yw}__viewContainer`,onBlur:ge?Xe:void 0,onMouseLeave:ge?Xe:void 0,children:[Ze(),_e?Ze(!0):null]})]})});pe.extend(he),pe.extend(me);var Q=pe,zw=Object.defineProperty,Bw=(e,t)=>zw(e,`name`,{value:t,configurable:!0}),Vw=`Popover`,[Hw,Uw]=rn(Vw,[Rn]),Ww=Rn(),[Gw,Kw]=Hw(Vw),qw=Bw(e=>{let{__scopePopover:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,l=Ww(n),u=a.useRef(null),[d,f]=a.useState(!1),[p,m]=yr({prop:i,defaultProp:o??!1,onChange:s,caller:Vw});return t(Zn,{...l,children:t(Gw,{scope:n,contentId:V(),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`),Jw=`PopoverAnchor`,Yw=a.forwardRef(Bw(function(e,n){let{__scopePopover:r,...i}=e,o=Kw(Jw,r),s=Ww(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=o;return a.useEffect(()=>(c(),()=>l()),[c,l]),t(Qn,{...s,...i,ref:n})},`PopoverAnchor`)),Xw=`PopoverTrigger`,Zw=a.forwardRef(Bw(function(e,n){let{__scopePopover:r,...i}=e,a=Kw(Xw,r),o=Ww(r),s=R(n,a.triggerRef),c=t(H.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":uT(a.open),...i,ref:s,onClick:B(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:t(Qn,{asChild:!0,...o,children:c})},`PopoverTrigger`)),Qw=`PopoverPortal`,[$w,eT]=Hw(Qw,{forceMount:void 0}),tT=Bw(e=>{let{__scopePopover:n,forceMount:r,children:i,container:a}=e,o=Kw(Qw,n);return t($w,{scope:n,forceMount:r,children:t(ar,{present:r||o.open,children:t(tr,{asChild:!0,container:a,children:i})})})},`PopoverPortal`),nT=`PopoverContent`,rT=a.forwardRef(Bw(function(e,n){let r=eT(nT,e.__scopePopover),{forceMount:i=r.forceMount,...a}=e,o=Kw(nT,e.__scopePopover);return t(ar,{present:i||o.open,children:o.modal?t(aT,{...a,ref:n}):t(oT,{...a,ref:n})})},`PopoverContent`)),iT=Nt(`PopoverContent.RemoveScroll`),aT=a.forwardRef(Bw(function(e,n){let r=Kw(nT,e.__scopePopover),i=a.useRef(null),o=R(n,i),s=a.useRef(!1);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),t(ue,{as:iT,allowPinchZoom:!0,children:t(sT,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:B(e.onCloseAutoFocus,e=>{e.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:B(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:B(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),oT=a.forwardRef(Bw(function(e,n){let r=Kw(nT,e.__scopePopover),i=a.useRef(!1),o=a.useRef(!1);return t(sT,{...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`)),sT=a.forwardRef(Bw(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=Kw(nT,r),m=Ww(r);return le(),t(ce,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:t(M,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:t($n,{"data-state":uT(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`)),cT=`PopoverClose`,lT=a.forwardRef(Bw(function(e,n){let{__scopePopover:r,...i}=e,a=Kw(cT,r);return t(H.button,{type:`button`,...i,ref:n,onClick:B(e.onClick,()=>a.onOpenChange(!1))})},`PopoverClose`));function uT(e){return e?`open`:`closed`}Bw(uT,`getState`);var dT=qw,fT=Yw,pT=Zw,mT=tT,hT=rT,gT=lT;const _T=a.createContext(null),vT=({hover:e=!1,click:n=!1,modal:r,children:i,_open:o,onOpenChange:s})=>{let[c,l]=a.useState(o||!1);return t(_T.Provider,{value:{open:c,setOpen:l,hover:e,click:n},children:t(dT,{open:c,onOpenChange:e=>{l(e),s&&s(e)},modal:r,children:i})})};function yT(e=!1,t=()=>{},n){e&&t(n===`enter`)}const bT=a.forwardRef(({children:e,...n},r)=>{let i=a.useContext(_T);if(!i)throw Error(`PopoverTrigger must be used within a Popover`);let{setOpen:o,hover:s,click:c}=i;return t(pT,{ref:r,asChild:!0,onMouseEnter:()=>yT(s,o,`enter`),onMouseLeave:()=>yT(s,o,`leave`),onClick:()=>{c&&o(e=>!e)},...n,children:e})});bT.displayName=pT.displayName;const xT=fT,ST=a.forwardRef(({className:e,align:n=`center`,side:r=`bottom`,...i},o)=>{let s=a.useContext(_T);if(!s)throw Error(`PopoverContent must be used within a Popover`);let{setOpen:c,hover:l}=s,u=mi();return t(mT,{container:u,children:t(hT,{ref:o,align:n,side:r,onMouseEnter:()=>yT(l,c,`enter`),onMouseLeave:()=>yT(l,c,`leave`),className:z(`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})})});ST.displayName=hT.displayName;const CT=gT;CT.displayName=gT.displayName;function wT(){let e=a.useContext(_T);if(!e)throw Error(`usePopoverContext must be used within a Popover`);return{...e,close:()=>e.setOpen(!1)}}const TT=`
238
+ `),()=>{l.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[n]),t(Up,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:a.cloneElement(e,{ref:f})})}const Gp=({children:e,initial:n,isPresent:r,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=Ca(Kp),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(Wp,{pop:c===`popLayout`,isPresent:r,anchorX:l,anchorY:u,root:d,children:e}),t(Ta.Provider,{value:_,children:e})};function Kp(){return new Map}function qp(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 Jp=e=>e.key||``;function Yp(e){let t=[];return s.forEach(e,e=>{m(e)&&t.push(e)}),t}const Xp=({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]=qp(c),m=S(()=>Yp(n),[n]),h=c&&!f?[]:m.map(Jp),_=C(!0),v=C(m),y=Ca(()=>new Map),b=C(new Set),[x,T]=w(m),[E,D]=w(m);wa(()=>{c&&!f&&!E.length&&p?.()},[f,c,E.length,p]),wa(()=>{_.current=!1,v.current=m;for(let e=0;e<E.length;e++){let t=Jp(E[e]);h.includes(t)?(y.delete(t),b.current.delete(t)):y.get(t)!==!0&&y.set(t,!1)}},[E,h.length,h.join(`-`)]);let O=[];if(m!==x){let e=[...m],t=0;for(let n of E){let r=h.indexOf(Jp(n));r===-1?(e.splice(t++,0,n),O.push(n)):t=r+O.length+1}return s===`wait`&&O.length&&(e=O),D(Yp(e)),T(m),null}let{forceRender:k}=g(Sa);return t(e,{children:E.map(e=>{let n=Jp(e),g=c&&!f?!1:m===E||h.includes(n);return t(Gp,{isPresent:g,initial:!_.current||i?void 0:!1,custom:r,presenceAffectsLayout:o,mode:s,root:d,onExitComplete:g?void 0:()=>{if(b.current.has(n))return;if(y.has(n))b.current.add(n),y.set(n,!0);else return;let e=!0;y.forEach(t=>{t||(e=!1)}),e&&(k?.(),D(v.current),c&&p?.(),a&&a())},anchorX:l,anchorY:u,children:e},n)})})},Zp=d({strict:!1}),Qp={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 $p=!1;function em(){if($p)return;let e={};for(let t in Qp)e[t]={isEnabled:e=>Qp[t].some(t=>!!e[t])};ld(e),$p=!0}function tm(){return em(),ud()}function nm(e){let t=tm();for(let n in e)t[n]={...t[n],...e[n]};ld(t)}const rm=d({});function im(e,t){if(ed(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Zu(t)?t:void 0,animate:Zu(n)?n:void 0}}return e.inherit===!1?{}:t}function am(e){let{initial:t,animate:n}=im(e,g(rm));return S(()=>({initial:t,animate:n}),[om(t),om(n)])}function om(e){return Array.isArray(e)?e.join(` `):e}const sm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function cm(e,t,n){for(let r in t)!wl(t[r])&&!Wd(r,n)&&(e[r]=t[r])}function lm({transformTemplate:e},t){return S(()=>{let n=sm();return Rd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function um(e,t){let n=e.style||{},r={};return cm(r,n,e),Object.assign(r,lm(e,t)),r}function dm(e,t){let n={},r=um(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 fm=()=>({...sm(),attrs:{}});function pm(e,t,n,r){let i=S(()=>{let n=fm();return Qd(n,t,ef(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};cm(t,e.style,e),i.style={...t,...i.style}}return i}const mm=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function hm(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||mm.has(e)}function gm(e,t){return e.startsWith(`on`)?!hm(e):t?.(e)??!hm(e)}function _m(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(wl(e[a])||(gm(a,r)||n===!0&&hm(a)||!t&&!hm(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}const vm=[`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 ym(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(vm.indexOf(e)>-1||/[A-Z]/u.test(e))}function bm(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??ym(e)?pm:dm)(t,r,i,e),u=_m(t,typeof e==`string`,a,s),d=e===l?{}:{...u,...c,ref:n},{children:p}=t,m=S(()=>wl(p)?p.get():p,[p]);return f(e,{...d,children:m})}function xm({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Sm(n,r,i,e),renderState:t()}}function Sm(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=tp(a[e]);let{initial:o,animate:s}=e,c=ed(e),l=td(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`&&!Xu(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=_l(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 Cm=e=>(t,n)=>{let r=g(rm),i=g(Ta),a=()=>xm(e,t,r,i);return n?a():Ca(a)},wm=Cm({scrapeMotionValuesFromProps:Gd,createRenderState:sm}),Tm=Cm({scrapeMotionValuesFromProps:nf,createRenderState:fm}),Em=Symbol.for(`motionComponentSymbol`);function Dm(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 Om=d({});function km(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Am(e,t,n,r,i,a){let{visualElement:o}=g(rm),s=g(Zp),c=g(Ta),l=g(zp),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(Om);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&jm(f.current,n,i,h);let v=C(!1);b(()=>{m&&v.current&&m.update(n,c)});let y=n[Ol],x=C(!!y&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return 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 jm(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:Mm(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&km(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Mm(e){if(e)return e.options.allowProjection===!1?Mm(e.parent):e.projection}function Nm(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&nm(a);let s=i?i===`svg`:ym(e),c=s?Tm:wm;function l(i,l){let u,d={...g(zp),...i,layoutId:Pm(i)},{isStatic:f,isValidProp:p}=d,m=am(i),h=c(i,f);if(!f&&typeof window<`u`){Fm(d,a);let t=Im(d);u=t.MeasureLayout,m.visualElement=Am(e,h,d,o,t.ProjectionNode,s)}return n(rm.Provider,{value:m,children:[u&&m.visualElement?t(u,{visualElement:m.visualElement,...d}):null,bm(e,i,Dm(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[Em]=e,u}function Pm({layoutId:e}){let t=g(Sa).id;return t&&e!==void 0?t+`-`+e:e}function Fm(e,t){g(Zp).strict}function Im(e){let{drag:t,layout:n}=tm();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Lm(e,t){if(typeof Proxy>`u`)return Nm;let n=new Map,r=(n,r)=>Nm(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Nm(a,void 0,e,t)),n.get(a))})}const Rm=(e,t)=>t.isSVG??ym(e)?new rf(t):new qd(t,{allowProjection:e!==l});var zm=class extends pd{constructor(e){super(e),e.animationState||=df(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Xu(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 Bm=0;const Vm={animation:{Feature:zm},exit:{Feature:class extends pd{constructor(){super(...arguments),this.id=Bm++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=vl(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Hm(e){return{point:{x:e.pageX,y:e.pageY}}}const Um=e=>t=>mu(t)&&e(t,Hm(t));function Wm(e,t,n,r){return Zf(e,t,Um(n),r)}const Gm=({current:e})=>e?e.ownerDocument.defaultView:null,Km=(e,t)=>Math.abs(e-t);function qm(e,t){let n=Km(e.x,t.x),r=Km(e.y,t.y);return Math.sqrt(n**2+r**2)}const Jm=new Set([`auto`,`scroll`]);var Ym=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=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.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Xm(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Qm(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=qm(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=fo;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Xm(t,this.transformPagePoint),G.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{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=Qm(e.type===`pointercancel`?this.lastMoveEventInfo:Xm(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!mu(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Xm(Hm(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=fo;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Qm(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Fa(Wm(this.contextWindow,`pointermove`,this.handlePointerMove,d),Wm(this.contextWindow,`pointerup`,this.handlePointerUp,d),Wm(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Jm.has(e.overflowX)||Jm.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),G.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),uo(this.updatePoint)}};function Xm(e,t){return t?{point:t(e.point)}:e}function Zm(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Qm({point:e},t){return{point:e,delta:Zm(e,eh(t)),offset:Zm(e,$m(t)),velocity:th(t,.1)}}function $m(e){return e[0]}function eh(e){return e[e.length-1]}function th(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=eh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ra(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Ra(t)*2&&(r=e[1]);let a=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 nh(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 rh(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 ih(e,{top:t,left:n,bottom:r,right:i}){return{x:rh(e.x,n,i),y:rh(e.y,t,r)}}function ah(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function oh(e,t){return{x:ah(e.x,t.x),y:ah(e.y,t.y)}}function sh(e,t){let n=.5,r=vf(e),i=vf(t);return i>r?n=Ia(t.min,t.max-r,e.min):r>i&&(n=Ia(e.min,e.max-i,t.min)),Oa(0,1,n)}function ch(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 lh=.35;function uh(e=lh){return e===!1?e=0:e===!0&&(e=lh),{x:dh(e,`left`,`right`),y:dh(e,`top`,`bottom`)}}function dh(e,t,n){return{min:fh(e,t),max:fh(e,n)}}function fh(e,t){return typeof e==`number`?e:e[t]||0}const ph=new WeakMap;var mh=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=Ju(),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(Hm(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=lu(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),Bf(e=>{let t=this.getAxisMotionValue(e).get()||0;if(zo.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=vf(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&G.update(()=>i(e,t),!1,!0),El(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=vh(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&&G.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 Ym(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Gm(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&&G.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||!_h(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=nh(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&&km(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?ih(n.layoutBox,e):!1,this.elastic=uh(t),r!==this.constraints&&!km(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Bf(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=ch(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!km(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=Pd(n,r.root,this.visualElement.getTransformPagePoint()),a=oh(r.layout.layoutBox,i);if(t){let e=t(hd(a));this.hasMutatedConstraints=!!e,e&&(a=md(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Bf(o=>{if(!_h(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 El(this.visualElement,e),n.start(fl(e,n,0,t,this.visualElement,!1))}stopAnimation(){Bf(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(e){Bf(t=>{let{drag:n}=this.getProps();if(!_h(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-J(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!km(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Bf(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=sh({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Bf(t=>{if(!_h(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(J(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;ph.set(this.visualElement,this);let e=this.visualElement.current,t=Wm(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&vu(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();km(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=gh(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),G.read(r);let o=Zf(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Bf(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=lh,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function hh(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function gh(e,t,n){let r=Bu(e,hh(n)),i=Bu(t,hh(n));return()=>{r(),i()}}function _h(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function vh(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var yh=class extends pd{constructor(e){super(e),this.removeGroupControls=Pa,this.removeListeners=Pa,this.controls=new mh(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 bh=e=>(t,n)=>{e&&G.update(()=>e(t,n),!1,!0)};var xh=class extends pd{constructor(){super(...arguments),this.removePointerDownListener=Pa}onPointerDown(e){this.session=new Ym(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Gm(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:bh(e),onStart:bh(t),onMove:bh(n),onEnd:(e,t)=>{delete this.session,r&&G.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Wm(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 Sh=!1;var Ch=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),Sh&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),rp.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}),Sh=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||G.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(),au.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Sh=!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 wh(e){let[n,r]=qp(),i=g(Sa);return t(Ch,{...e,layoutGroup:i,switchLayoutGroup:g(Om),isPresent:n,safeToRemove:r})}const Th={pan:{Feature:xh},drag:{Feature:yh,ProjectionNode:Rp,MeasureLayout:wh}};function Eh(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&G.postRender(()=>i(t,Hm(t)))}var Dh=class extends pd{mount(){let{current:e}=this.node;e&&(this.unmount=fu(e,(e,t)=>(Eh(this.node,t,`Start`),e=>Eh(this.node,e,`End`))))}unmount(){}},Oh=class extends pd{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(Zf(this.node.current,`focus`,()=>this.onFocus()),Zf(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function kh(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&&G.postRender(()=>i(t,Hm(t)))}var Ah=class extends pd{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Tu(e,(e,t)=>(kh(this.node,t,`Start`),(e,{success:t})=>kh(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const jh=new WeakMap,Mh=new WeakMap,Nh=e=>{let t=jh.get(e.target);t&&t(e)},Ph=e=>{e.forEach(Nh)};function Fh({root:e,...t}){let n=e||document;Mh.has(n)||Mh.set(n,{});let r=Mh.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Ph,{root:e,...t})),r[i]}function Ih(e,t,n){let r=Fh(t);return jh.set(e,n),r.observe(e),()=>{jh.delete(e),r.unobserve(e)}}const Lh={some:0,all:1};var Rh=class extends pd{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:Lh[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=Ih(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(zh(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function zh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Bh={inView:{Feature:Rh},tap:{Feature:Ah},focus:{Feature:Oh},hover:{Feature:Dh}},Vh={layout:{ProjectionNode:Rp,MeasureLayout:wh}},Hh=Lm({...Vm,...Bh,...Th,...Vh},Rm);function Uh({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=Wh(o),b=Gh(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(Hh.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(bt,{})})}),t(`div`,{className:l?`mt-8`:``,children:r})]})})]})}function Wh(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 Gh(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 Kh=`--tailwind-portal`;function qh({children:e}){let n=C(null),[r,i]=w(null);return _(()=>{if(n.current){let e=n.current.ownerDocument,t=e.getElementById(Kh);t||(t=e.createElement(`DIV`),t.id=Kh,e.body.appendChild(t)),i(t)}},[]),r?E(e,r):t(`span`,{ref:n})}function Jh({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($h,{onClick:e.onClick,href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):e.href?t($h,{href:e.href,title:typeof e.label==`string`?e.label:void 0,children:n}):t(eg,{children:n})};if(s.length<=r)return t(Yh,{className:B(`w-full flex items-center`,i),children:t(Xh,{children:s.map((e,r)=>n(a.Fragment,{children:[t(Zh,{children:c(e)}),r<s.length-1&&t(tg,{children:o??t(Re,{className:`cn-rtl-flip`})})]},`crumb-${r}`))})});let l=s.slice(-(r-1));return t(Yh,{className:B(`w-full flex items-center`,i),children:n(Xh,{children:[t(Zh,{children:t(ng,{})}),t(tg,{children:o??t(Re,{className:`cn-rtl-flip`})}),l.map((e,r)=>n(a.Fragment,{children:[t(Zh,{children:c(e)}),r<l.length-1&&t(tg,{children:o??t(Re,{className:`cn-rtl-flip`})})]},`crumb-${r}`))]})})}const Yh=a.forwardRef(({...e},n)=>t(`nav`,{ref:n,"aria-label":`breadcrumb`,...e}));Yh.displayName=`Breadcrumb`;const Xh=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}));Xh.displayName=`BreadcrumbList`;const Zh=a.forwardRef(({className:e,...n},r)=>t(`li`,{ref:r,className:B(`inline-flex items-center gap-1.5 text-muted`,e),...n}));Zh.displayName=`BreadcrumbItem`;const Qh=a.forwardRef(({asChild:e,className:n,...r},i)=>t(`a`,{ref:i,className:B(`transition-colors hover:text-muted`,n),...r}));Qh.displayName=`BreadcrumbLink`;const $h=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}));$h.displayName=`BreadcrumbButton`;const eg=a.forwardRef(({className:e,...n},r)=>t(`span`,{ref:r,"aria-current":`page`,className:B(`font-normal text-foreground`,e),...n}));eg.displayName=`BreadcrumbPage`;const tg=({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(Re,{className:`cn-rtl-flip`})});tg.displayName=`BreadcrumbSeparator`;const ng=({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(Qe,{className:`h-4 w-4`}),t(`span`,{className:`sr-only`,children:`More`})]});ng.displayName=`BreadcrumbEllipsis`;const rg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`rounded-xl border bg-card text-card-foreground shadow`,e),...n}));rg.displayName=`Card`;const ig=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex flex-col p-6`,e),...n}));ig.displayName=`CardHeader`;const ag=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`font-semibold leading-none tracking-tight`,e),...n}));ag.displayName=`CardTitle`;const og=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`text-sm text-muted`,e),...n}));og.displayName=`CardDescription`;const sg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`p-6 pt-0`,e),...n}));sg.displayName=`CardContent`;const cg=a.forwardRef(({className:e,...n},r)=>t(`div`,{ref:r,className:B(`flex items-center p-6 pt-0`,e),...n}));cg.displayName=`CardFooter`;var lg=Object.defineProperty,ug=(e,t)=>lg(e,`name`,{value:t,configurable:!0}),dg=`Checkbox`,[fg,pg]=On(dg),[mg,hg]=fg(dg);function gg(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]=Ur({prop:r,defaultProp:o??!1,onChange:u,caller:dg}),[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:!Tg(o)&&o,isFormControl:C,bubbleInput:v,setBubbleInput:y};return t(mg,{scope:n,...w,children:wg(p)?p(w):i})}ug(gg,`CheckboxProvider`);var _g=`CheckboxTrigger`,vg=a.forwardRef(ug(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:_}=hg(_g,e),v=z(o,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?.form;if(e){let t=ug(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,p]),t(U.button,{type:`button`,role:`checkbox`,"aria-checked":Tg(u)?`mixed`:u,"aria-required":d,"data-state":Eg(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=>Tg(e)?!0:!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`CheckboxTrigger`)),yg=a.forwardRef(ug(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 t(gg,{__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})=>n(e,{children:[t(vg,{...m,ref:i,__scopeCheckbox:a}),r&&t(Cg,{__scopeCheckbox:a})]})})},`Checkbox`)),bg=`CheckboxIndicator`,xg=a.forwardRef(ug(function(e,n){let{__scopeCheckbox:r,forceMount:i,...a}=e,o=hg(bg,r);return t(kr,{present:i||Tg(o.checked)||o.checked===!0,children:t(U.span,{"data-state":Eg(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),Sg=`CheckboxBubbleInput`,Cg=a.forwardRef(ug(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:_}=hg(Sg,e),v=z(i,_),y=rr(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=Tg(l),n.call(e,!Tg(l)&&l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(!Tg(l)&&l);return 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 wg(e){return typeof e==`function`}ug(wg,`isFunction`);function Tg(e){return e===`indeterminate`}ug(Tg,`isIndeterminate`);function Eg(e){return Tg(e)?`indeterminate`:e?`checked`:`unchecked`}ug(Eg,`getState`);const Dg=a.forwardRef(({className:e,...n},r)=>t(yg,{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(xg,{className:B(`flex items-center justify-center text-current`),children:t(L,{className:`size-4`})})}));Dg.displayName=yg.displayName;var Og=Object.defineProperty,kg=(e,t)=>Og(e,`name`,{value:t,configurable:!0}),Ag=`Collapsible`,[jg,Mg]=On(Ag),[Ng,Pg]=jg(Ag),Fg=a.forwardRef(kg(function(e,n){let{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:s,onOpenChange:c,...l}=e,[u,d]=Ur({prop:i,defaultProp:o??!1,onChange:c,caller:Ag});return t(Ng,{scope:r,disabled:s,contentId:H(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:t(U.div,{"data-state":Vg(u),"data-disabled":s?``:void 0,...l,ref:n})})},`Collapsible`)),Ig=`CollapsibleTrigger`,Lg=a.forwardRef(kg(function(e,n){let{__scopeCollapsible:r,...i}=e,a=Pg(Ig,r);return t(U.button,{type:`button`,"aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":Vg(a.open),"data-disabled":a.disabled?``:void 0,disabled:a.disabled,...i,ref:n,onClick:V(e.onClick,a.onOpenToggle)})},`CollapsibleTrigger`)),Rg=`CollapsibleContent`,zg=a.forwardRef(kg(function(e,n){let{forceMount:r,...i}=e,a=Pg(Rg,e.__scopeCollapsible);return t(kr,{present:r||a.open,children:({present:e})=>t(Bg,{...i,ref:n,present:e})})},`CollapsibleContent`)),Bg=a.forwardRef(kg(function(e,n){let{__scopeCollapsible:r,present:i,children:o,...s}=e,c=Pg(Rg,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)},[]),An(()=>{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]),t(U.div,{"data-state":Vg(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 Vg(e){return e?`open`:`closed`}kg(Vg,`getState`);var Hg=Fg,Ug=Lg,Wg=zg;function Gg({...e}){return t(Hg,{"data-slot":`collapsible`,...e})}function Kg({...e}){return t(Ug,{"data-slot":`collapsible-trigger`,...e})}function qg({...e}){return t(Wg,{"data-slot":`collapsible-content`,...e})}var Jg=1,Yg=.9,Xg=.8,Zg=.17,Qg=.1,$g=.999,e_=.9999,t_=.99,n_=/[\\\/_+.#"@\[\(\{&]/,r_=/[\\\/_+.#"@\[\(\{&]/g,i_=/[\s-]/,a_=/[\s-]/g;function o_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Jg:t_;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=o_(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Jg:n_.test(e.charAt(l-1))?(d*=Xg,p=e.slice(i,l-1).match(r_),p&&i>0&&(d*=$g**+p.length)):i_.test(e.charAt(l-1))?(d*=Yg,m=e.slice(i,l-1).match(a_),m&&i>0&&(d*=$g**+m.length)):(d*=Zg,i>0&&(d*=$g**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=e_)),(d<Qg&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=o_(e,t,n,r,l+1,a+2,o),f*Qg>d&&(d=f*Qg)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function s_(e){return e.toLowerCase().replace(a_,` `)}function c_(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,o_(e,t,s_(e),s_(t),0,0,{})}var l_=Object.defineProperty,u_=(e,t)=>l_(e,`name`,{value:t,configurable:!0}),d_=`Dialog`,[f_,p_]=On(d_),[m_,h_]=f_(d_),g_=u_(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]=Ur({prop:i,defaultProp:o??!1,onChange:s,caller:d_}),[p,m]=a.useState(0),[h,g]=a.useState(0);return t(m_,{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`),__=`DialogTrigger`,v_=a.forwardRef(u_(function(e,n){let{__scopeDialog:r,...i}=e,a=h_(__,r),o=z(n,a.triggerRef);return t(U.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":R_(a.open),...i,ref:o,onClick:V(e.onClick,a.onOpenToggle)})},`DialogTrigger`)),y_=`DialogPortal`,[b_,x_]=f_(y_,{forceMount:void 0}),S_=u_(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=h_(y_,n);return t(b_,{scope:n,forceMount:r,children:a.Children.map(i,e=>t(kr,{present:r||s.open,children:t(Tr,{asChild:!0,container:o,children:e})}))})},`DialogPortal`),C_=`DialogOverlay`,w_=a.forwardRef(u_(function(e,n){let r=x_(C_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=h_(C_,e.__scopeDialog);return o.modal?t(kr,{present:i||o.open,children:t(E_,{...a,ref:n})}):null},`DialogOverlay`)),T_=rn(`DialogOverlay.RemoveScroll`),E_=a.forwardRef(u_(function(e,n){let{__scopeDialog:r,...i}=e,a=h_(C_,r),o=z(n,N());return t(ue,{as:T_,allowPinchZoom:!0,shards:[a.contentRef],children:t(U.div,{"data-state":R_(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),D_=`DialogContent`,O_=a.forwardRef(u_(function(e,n){let r=x_(D_,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=h_(D_,e.__scopeDialog);return t(kr,{present:i||o.open,children:o.modal?t(k_,{...a,ref:n}):t(A_,{...a,ref:n})})},`DialogContent`)),k_=a.forwardRef(u_(function(e,n){let r=h_(D_,e.__scopeDialog),i=a.useRef(null),o=z(n,r.contentRef,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),t(j_,{...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`)),A_=a.forwardRef(u_(function(e,n){let r=h_(D_,e.__scopeDialog),i=a.useRef(!1),o=a.useRef(!1);return t(j_,{...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`)),j_=a.forwardRef(u_(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=h_(D_,i);return le(),t(e,{children:t(ce,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children: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":R_(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),M_=`DialogTitle`,N_=a.forwardRef(u_(function(e,n){let{__scopeDialog:r,...i}=e,a=h_(M_,r),{setTitleCount:o}=a;return An(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(U.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),P_=`DialogDescription`,F_=a.forwardRef(u_(function(e,n){let{__scopeDialog:r,...i}=e,a=h_(P_,r),{setDescriptionCount:o}=a;return An(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(U.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),I_=`DialogClose`,L_=a.forwardRef(u_(function(e,n){let{__scopeDialog:r,...i}=e,a=h_(I_,r);return t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function R_(e){return e?`open`:`closed`}u_(R_,`getState`);var z_=`[cmdk-group=""]`,B_=`[cmdk-group-items=""]`,V_=`[cmdk-group-heading=""]`,H_=`[cmdk-item=""]`,U_=`${H_}:not([aria-disabled="true"])`,W_=`cmdk-item-select`,G_=`data-value`,K_=(e,t,n)=>c_(e,t,n),q_=a.createContext(void 0),J_=()=>a.useContext(q_),Y_=a.createContext(void 0),X_=()=>a.useContext(Y_),Z_=a.createContext(void 0),Q_=a.forwardRef((e,t)=>{let n=fv(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=fv(()=>new Set),i=fv(()=>new Map),o=fv(()=>new Map),s=fv(()=>new Set),c=uv(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=hv();dv(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),dv(()=>{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,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,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??K_;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(B_);t?t.appendChild(e.parentElement===t?e:e.closest(`${B_} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${B_} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${z_}[${G_}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(G_);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=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(z_)?.querySelector(V_))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${H_}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(U_)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(G_))}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(G_))}function ee(e){let t=j()?.closest(z_),n;for(;t&&!n;)t=e>0?cv(t,z_):lv(t,z_),n=t?.querySelector(U_);n?w.setState(`value`,n.getAttribute(G_)):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(W_);t.dispatchEvent(e)}}}}},a.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:vv},l),_v(e,e=>a.createElement(Y_.Provider,{value:w},a.createElement(q_.Provider,{value:T},e))))}),$_=a.forwardRef((e,t)=>{let n=H(),r=a.useRef(null),i=a.useContext(Z_),o=J_(),s=uv(e),c=s.current?.forceMount??i?.forceMount;dv(()=>{if(!c)return o.item(n,i?.id)},[c]);let l=mv(n,r,[e.value,e.children,r],e.keywords),u=X_(),d=pv(e=>e.value&&e.value===l.current),f=pv(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);a.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(W_,p),()=>t.removeEventListener(W_,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:en(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)}),ev=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=J_(),f=pv(e=>i||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));dv(()=>d.group(s),[]),mv(s,c,[e.value,e.heading,l]);let p=a.useMemo(()=>({id:s,forceMount:i}),[i]);return a.createElement(U.div,{ref:en(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),_v(e,e=>a.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},a.createElement(Z_.Provider,{value:p},e))))}),tv=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=a.useRef(null),o=pv(e=>!e.search);return!n&&!o?null:a.createElement(U.div,{ref:en(i,t),...r,"cmdk-separator":``,role:`separator`})}),nv=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=X_(),s=pv(e=>e.search),c=pv(e=>e.selectedItemId),l=J_();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)}})}),rv=a.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,o=a.useRef(null),s=a.useRef(null),c=pv(e=>e.selectedItemId),l=J_();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:en(o,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},_v(e,e=>a.createElement(`div`,{ref:en(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),iv=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...c}=e;return a.createElement(g_,{open:n,onOpenChange:r},a.createElement(S_,{container:s},a.createElement(w_,{"cmdk-overlay":``,className:i}),a.createElement(O_,{"aria-label":e.label,"cmdk-dialog":``,className:o},a.createElement(Q_,{ref:t,...c}))))}),av=a.forwardRef((e,t)=>pv(e=>e.filtered.count===0)?a.createElement(U.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ov=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},_v(e,e=>a.createElement(`div`,{"aria-hidden":!0},e)))}),sv=Object.assign(Q_,{List:rv,Item:$_,Input:nv,Group:ev,Separator:tv,Dialog:iv,Empty:av,Loading:ov});function cv(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function lv(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function uv(e){let t=a.useRef(e);return dv(()=>{t.current=e}),t}var dv=typeof window>`u`?a.useEffect:a.useLayoutEffect;function fv(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function pv(e){let t=X_(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function mv(e,t,n,r=[]){let i=a.useRef(),o=J_();return dv(()=>{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(G_,s),i.current=s}),i}var hv=()=>{let[e,t]=a.useState(),n=fv(()=>new Map);return dv(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function gv(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function _v({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(gv(t),{ref:t.ref},n(t.props.children)):n(t)}var vv={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function yv({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 bv=d(!1);function xv(){return!!g(bv)}function Sv({children:e}){return t(bv.Provider,{value:!0,children:e})}function Cv({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(Dv,{open:i,onOpenChange:e=>{(!l||e)&&f(e)},children:[c&&t(jv,{className:`z-50 fixed inset-0 bg-black/80`}),t(yv,{children:t(Nv,{children:o})}),n(Mv,{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(Av,{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(bt,{className:`size-4`})})})]})}),t(Sv,{children:r})]})]})}const wv=({children:e,show:r=!0,className:i,description:a,showDivider:o=!1,...s})=>r?n(Pv,{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(Nv,{className:`text-sm !font-normal text-muted pb-2`,children:a})]}):n(yv,{children:[t(Pv,{children:e}),a&&t(Nv,{children:a})]}),Tv=({children:e,className:n,...r})=>t(`div`,{className:B(`text-sm max-h-[80vh] overflow-y-auto`,n),...r,children:e}),Ev=({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}),Dv=g_,Ov=v_,kv=S_,Av=L_,jv=a.forwardRef(({className:e,...n},r)=>t(w_,{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}));jv.displayName=w_.displayName;const Mv=a.forwardRef(({className:e,children:r,...i},a)=>{let o=Ri();return n(kv,{container:o,children:[t(jv,{}),t(O_,{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})]})});Mv.displayName=O_.displayName;const Nv=a.forwardRef(({className:e,...n},r)=>t(F_,{ref:r,className:B(`text-sm text-muted`,e),...n}));Nv.displayName=F_.displayName;const Pv=a.forwardRef(({className:e,...n},r)=>t(N_,{ref:r,className:B(`text-lg font-semibold leading-none tracking-tight`,e),...n}));Pv.displayName=N_.displayName;const Fv=a.forwardRef(({className:e,...n},r)=>t(sv,{ref:r,className:B(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...n}));Fv.displayName=sv.displayName;const Iv=({children:e,...n})=>t(Dv,{...n,children:t(Mv,{className:`shadow-lg p-0 overflow-hidden`,children:t(Fv,{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})})}),Lv=a.forwardRef(({className:e,...r},i)=>n(`div`,{className:`flex items-center px-3 border-b`,"cmdk-input-wrapper":``,children:[t(ft,{className:`opacity-50 size-4 shrink-0`}),t(sv.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})]}));Lv.displayName=sv.Input.displayName;const Rv=a.forwardRef(({className:e,...n},r)=>t(sv.List,{ref:r,className:B(`overflow-y-auto overflow-x-hidden`,e),...n}));Rv.displayName=sv.List.displayName;const zv=a.forwardRef((e,n)=>t(sv.Empty,{ref:n,className:`py-2 text-sm text-center`,...e}));zv.displayName=sv.Empty.displayName;const Bv=a.forwardRef(({className:e,...n},r)=>t(sv.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}));Bv.displayName=sv.Group.displayName;const Vv=a.forwardRef(({className:e,...n},r)=>t(sv.Separator,{ref:r,className:B(`-mx-1 h-px bg-border`,e),...n}));Vv.displayName=sv.Separator.displayName;const Hv=a.forwardRef(({className:e,...n},r)=>t(sv.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}));Hv.displayName=sv.Item.displayName;const Uv=({className:e,...n})=>t(`span`,{className:B(`ms-auto text-xs tracking-widest text-muted`,e),...n});Uv.displayName=`CommandShortcut`;var Wv=Object.defineProperty,Gv=(e,t)=>Wv(e,`name`,{value:t,configurable:!0});function Kv(e){let n=e+`CollectionProvider`,[r,i]=On(n),[o,s]=r(n,{collectionRef:{current:null},itemMap:new Map}),c=Gv(e=>{let{scope:n,children:r}=e,i=a.useRef(null),s=a.useRef(new Map).current;return t(o,{scope:n,itemMap:s,collectionRef:i,children:r})},`CollectionProvider`);c.displayName=n;let l=e+`CollectionSlot`,u=rn(l),d=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=z(n,s(l,r).collectionRef);return t(u,{ref:a,children:i})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=rn(f),h=a.forwardRef((e,n)=>{let{scope:r,children:i,...o}=e,c=a.useRef(null),l=z(n,c),u=s(f,r);return a.useEffect(()=>(u.itemMap.set(c,{ref:c,...o}),()=>void u.itemMap.delete(c))),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 Gv(g,`useCollection`),[{Provider:c,Slot:d,ItemSlot:h},g,i]}Gv(Kv,`createCollection`);var qv=new WeakMap,Jv=class e extends Map{static{Gv(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],qv.set(this,!0)}set(e,t){return qv.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Zv(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}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);return r===-1?this:this.insert(r,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);return r===-1?this:this.insert(r+1,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=Yv(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Yv(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Yv(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=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){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,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}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 Yv(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Xv(e,t);return n===-1?void 0:e[n]}Gv(Yv,`at`);function Xv(e,t){let n=e.length,r=Zv(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Gv(Xv,`toSafeIndex`);function Zv(e){return e!==e||e===0?0:Math.trunc(e)}Gv(Zv,`toSafeInteger`);function Qv(e){let n=e+`CollectionProvider`,[r,i]=On(n),[o,s]=r(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Jv,setItemMap:Gv(()=>void 0,`setItemMap`)}),c=Gv(({state:e,...n})=>e?t(u,{...n,state:e}):t(l,{...n}),`CollectionProvider`);c.displayName=n;let l=Gv(e=>{let n=_();return t(u,{...e,state:n})},`CollectionInit`);l.displayName=n+`Init`;let u=Gv(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=ny(()=>{});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c]),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=rn(d),p=a.forwardRef((e,n)=>{let{scope:r,children:i}=e,a=z(n,s(d,r).collectionRef);return t(f,{ref:a,children:i})});p.displayName=d;let m=e+`CollectionItemSlot`,h=rn(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);$v(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(ty):(t.set(l,{...e,element:l}),t.toSorted(ty)):t),()=>{f(e=>!l||!e.has(l)?e:(e.delete(l),new Jv(e)))}},[l,g,f]),t(h,{"data-radix-collection-item":``,ref:d,children:i})});g.displayName=m;function _(){return a.useState(new Jv)}Gv(_,`useInitCollection`);function v(t){let{itemMap:n}=s(e+`CollectionConsumer`,t);return n}return Gv(v,`useCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:i,useCollection:v,useInitCollection:_}]}Gv(Qv,`createCollection`);function $v(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}Gv($v,`shallowEqual`);function ey(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Gv(ey,`isElementPreceding`);function ty(e,t){return!e[1].element||!t[1].element?0:ey(e[1].element,t[1].element)?-1:1}Gv(ty,`sortByDocumentPosition`);function ny(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Gv(ny,`getChildListObserver`);var ry=Object.defineProperty,iy=(e,t)=>ry(e,`name`,{value:t,configurable:!0}),ay=!1;function oy(){let[e,t]=a.useState(ay);return a.useEffect(()=>{ay||(ay=!0,t(!0))},[]),e}iy(oy,`useIsHydrated`);var sy=a.useSyncExternalStore;function cy(){return()=>{}}iy(cy,`subscribe`);function ly(){return sy(cy,()=>!0,()=>!1)}iy(ly,`useIsHydratedModern`);var uy=typeof sy==`function`?ly:oy,dy=Object.defineProperty,fy=(e,t)=>dy(e,`name`,{value:t,configurable:!0}),py=`rovingFocusGroup.onEntryFocus`,my={bubbles:!1,cancelable:!0},hy=`RovingFocusGroup`,[gy,_y,vy]=Kv(hy),[yy,by]=On(hy,[vy]),[xy,Sy]=yy(hy),Cy=a.forwardRef(fy(function(e,n){return t(gy.Provider,{scope:e.__scopeRovingFocusGroup,children:t(gy.Slot,{scope:e.__scopeRovingFocusGroup,children:t(wy,{...e,ref:n})})})},`RovingFocusGroup`)),wy=a.forwardRef(fy(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]=Ur({prop:c,defaultProp:l??null,onChange:u,caller:hy}),[y,b]=a.useState(!1),x=er(d),S=_y(r),C=a.useRef(!1),[w,T]=a.useState(0);return a.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(py,x),()=>e.removeEventListener(py,x)},[x]),t(xy,{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: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(py,my);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);Ay([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`)),Ty=`RovingFocusGroupItem`,Ey=a.forwardRef(fy(function(e,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=H(),d=s||u,f=Sy(Ty,r),p=f.currentTabStopId===d,m=_y(r),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f,v=uy();return An(()=>{if(v&&i)return h(),()=>g()},[v,i,h,g]),a.useEffect(()=>{if(!v&&i)return h(),()=>g()},[v,i,h,g]),t(gy.ItemSlot,{scope:r,id:d,focusable:i,active:o,children: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=ky(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?jy(n,r+1):n.slice(r+1)}setTimeout(()=>Ay(n))}}),children:typeof c==`function`?c({isCurrentTabStop:p,hasTabStop:_!=null}):c})})},`RovingFocusGroupItem`)),Dy={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Oy(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}fy(Oy,`getDirectionAwareKey`);function ky(e,t,n){let r=Oy(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Dy[r]}fy(ky,`getFocusIntent`);function Ay(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}fy(Ay,`focusFirst`);function jy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}fy(jy,`wrapArray`);var My=Cy,Ny=Ey,Py=Object.defineProperty,X=(e,t)=>Py(e,`name`,{value:t,configurable:!0}),Fy=[`Enter`,` `],Iy=[`ArrowDown`,`PageUp`,`Home`],Ly=[`ArrowUp`,`PageDown`,`End`],Ry=[...Iy,...Ly],zy={ltr:[...Fy,`ArrowRight`],rtl:[...Fy,`ArrowLeft`]},By={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Vy=`Menu`,[Hy,Uy,Wy]=Kv(Vy),[Gy,Ky]=On(Vy,[Wy,cr,by]),qy=cr(),Jy=by(),[Yy,Xy]=Gy(Vy),[Zy,Qy]=Gy(Vy),$y=X(e=>{let{__scopeMenu:n,open:r=!1,children:i,dir:o,onOpenChange:s,modal:c=!0}=e,l=qy(n),[u,d]=a.useState(null),f=a.useRef(!1),p=er(s),m=fe(o);return a.useEffect(()=>{let e=X(()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=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=X(()=>p(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[r,p]),t(xr,{...l,children:t(Yy,{scope:n,open:r,onOpenChange:p,content:u,onContentChange:d,children:t(Zy,{scope:n,onClose:a.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:c,children:i})})})},`Menu`),eb=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e,a=qy(r);return t(Sr,{...a,...i,ref:n})},`MenuAnchor`)),tb=`MenuPortal`,[nb,rb]=Gy(tb,{forceMount:void 0}),ib=X(e=>{let{__scopeMenu:n,forceMount:r,children:i,container:a}=e,o=Xy(tb,n);return t(nb,{scope:n,forceMount:r,children:t(kr,{present:r||o.open,children:t(Tr,{asChild:!0,container:a,children:i})})})},`MenuPortal`),ab=`MenuContent`,[ob,sb]=Gy(ab),cb=a.forwardRef(X(function(e,n){let r=rb(ab,e.__scopeMenu),{forceMount:i=r.forceMount,...a}=e,o=Xy(ab,e.__scopeMenu),s=Qy(ab,e.__scopeMenu);return t(Hy.Provider,{scope:e.__scopeMenu,children:t(kr,{present:i||o.open,children:t(Hy.Slot,{scope:e.__scopeMenu,children:s.modal?t(lb,{...a,ref:n}):t(ub,{...a,ref:n})})})})},`MenuContent`)),lb=a.forwardRef(X(function(e,n){let r=Xy(ab,e.__scopeMenu),i=a.useRef(null),o=z(n,i);return a.useEffect(()=>{let e=i.current;if(e)return de(e)},[]),t(fb,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentModal`)),ub=a.forwardRef(X(function(e,n){let r=Xy(ab,e.__scopeMenu);return t(fb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},`MenuRootContentNonModal`)),db=rn(`MenuContent.ScrollLock`),fb=a.forwardRef(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=Xy(ab,r),y=Qy(ab,r),b=qy(r),x=Jy(r),S=Uy(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:db,allowPinchZoom:!0}:void 0,te=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=Ub(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;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&&Gb(e,A.current?.area),[]);return t(ob,{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:t(P,{...ee,children:t(ce,{asChild:!0,trapped:o,onMountAutoFocus:V(s,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:t(M,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:t(My,{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:t(Cr,{role:`menu`,"aria-orientation":`vertical`,"data-state":Rb(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||!Ry.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);Ly.includes(e.key)&&a.reverse(),Vb(a)}),onBlur:V(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:V(e.onPointerMove,Kb(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`)),pb=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e;return t(U.div,{role:`group`,...i,ref:n})},`MenuGroup`)),mb=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e;return t(U.div,{...i,ref:n})},`MenuLabel`)),hb=`MenuItem`,gb=`menu.itemSelect`,_b=a.forwardRef(X(function(e,n){let{disabled:r=!1,onSelect:i,...o}=e,s=a.useRef(null),c=Qy(hb,e.__scopeMenu),l=sb(hb,e.__scopeMenu),u=z(n,s),d=a.useRef(!1),f=X(()=>{let e=s.current;if(!r&&e){let t=new CustomEvent(gb,{bubbles:!0,cancelable:!0});e.addEventListener(gb,e=>i?.(e),{once:!0}),Zn(e,t),t.defaultPrevented?d.current=!1:c.onClose()}},`handleSelect`);return t(vb,{...o,ref:u,disabled:r,onClick:V(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:V(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:V(e.onKeyDown,e=>{r||e.target!==e.currentTarget||(l.searchRef.current===``||e.key!==` `)&&Fy.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),vb=a.forwardRef(X(function(e,n){let{__scopeMenu:r,disabled:i=!1,textValue:o,...s}=e,c=sb(hb,r),l=Jy(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]),t(Hy.ItemSlot,{scope:r,disabled:i,textValue:o??m,children:t(Ny,{asChild:!0,...l,focusable:!i,children: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,Kb(e=>{i?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,Kb(e=>c.onItemLeave(e))),onFocus:V(e.onFocus,()=>p(!0)),onBlur:V(e.onBlur,()=>p(!1))})})})},`MenuItemImpl`)),yb=a.forwardRef(X(function(e,n){let{checked:r=!1,onCheckedChange:i,...a}=e;return t(Eb,{scope:e.__scopeMenu,checked:r,children:t(_b,{role:`menuitemcheckbox`,"aria-checked":zb(r)?`mixed`:r,...a,ref:n,"data-state":Bb(r),onSelect:V(a.onSelect,()=>i?.(zb(r)?!0:!r),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[bb,xb]=Gy(`MenuRadioGroup`,{value:void 0,onValueChange:X(()=>{},`onValueChange`)}),Sb=a.forwardRef(X(function(e,n){let{value:r,onValueChange:i,...a}=e,o=er(i);return t(bb,{scope:e.__scopeMenu,value:r,onValueChange:o,children:t(pb,{...a,ref:n})})},`MenuRadioGroup`)),Cb=`MenuRadioItem`,wb=a.forwardRef(X(function(e,n){let{value:r,...i}=e,a=xb(Cb,e.__scopeMenu),o=r===a.value;return t(Eb,{scope:e.__scopeMenu,checked:o,children:t(_b,{role:`menuitemradio`,"aria-checked":o,...i,ref:n,"data-state":Bb(o),onSelect:V(i.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Tb=`MenuItemIndicator`,[Eb,Db]=Gy(Tb,{checked:!1}),Ob=a.forwardRef(X(function(e,n){let{__scopeMenu:r,forceMount:i,...a}=e,o=Db(Tb,r);return t(kr,{present:i||zb(o.checked)||o.checked===!0,children:t(U.span,{...a,ref:n,"data-state":Bb(o.checked)})})},`MenuItemIndicator`)),kb=a.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e;return t(U.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:n})},`MenuSeparator`)),Ab=`MenuSub`,[jb,Mb]=Gy(Ab),Nb=X(e=>{let{__scopeMenu:n,children:r,open:i=!1,onOpenChange:o}=e,s=Xy(Ab,n),c=qy(n),[l,u]=a.useState(null),[d,f]=a.useState(null),p=er(o);return a.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),t(xr,{...c,children:t(Yy,{scope:n,open:i,onOpenChange:p,content:d,onContentChange:f,children:t(jb,{scope:n,contentId:H(),triggerId:H(),trigger:l,onTriggerChange:u,children:r})})})},`MenuSub`),Pb=`MenuSubTrigger`,Fb=a.forwardRef(X(function(e,n){let r=Xy(Pb,e.__scopeMenu),i=Qy(Pb,e.__scopeMenu),o=Mb(Pb,e.__scopeMenu),s=sb(Pb,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 t(eb,{asChild:!0,...d,children:t(vb,{id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":Rb(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,Kb(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,Kb(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!==` `)&&zy[i.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Ib=`MenuSubContent`,Lb=a.forwardRef(X(function(e,n){let r=rb(ab,e.__scopeMenu),{forceMount:i=r.forceMount,align:o=`start`,...s}=e,c=Xy(ab,e.__scopeMenu),l=Qy(ab,e.__scopeMenu),u=Mb(Ib,e.__scopeMenu),d=a.useRef(null),f=z(n,d);return t(Hy.Provider,{scope:e.__scopeMenu,children:t(kr,{present:i||c.open,children:t(Hy.Slot,{scope:e.__scopeMenu,children:t(fb,{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=By[l.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function Rb(e){return e?`open`:`closed`}X(Rb,`getOpenState`);function zb(e){return e===`indeterminate`}X(zb,`isIndeterminate`);function Bb(e){return zb(e)?`indeterminate`:e?`checked`:`unchecked`}X(Bb,`getCheckedState`);function Vb(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(Vb,`focusFirst`);function Hb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(Hb,`wrapArray`);function Ub(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=Hb(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(Ub,`getNextMatch`);function Wb(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(Wb,`isPointInPolygon`);function Gb(e,t){return t?Wb({x:e.clientX,y:e.clientY},t):!1}X(Gb,`isPointerInGraceArea`);function Kb(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(Kb,`whenMouse`);var qb=$y,Jb=eb,Yb=ib,Xb=cb,Zb=pb,Qb=mb,$b=_b,ex=yb,tx=Sb,nx=wb,rx=Ob,ix=kb,ax=Nb,ox=Fb,sx=Lb,cx=Object.defineProperty,lx=(e,t)=>cx(e,`name`,{value:t,configurable:!0}),ux=`DropdownMenu`,[dx,fx]=On(ux,[Ky]),px=Ky(),[mx,hx]=dx(ux),gx=lx(e=>{let{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=px(n),d=a.useRef(null),[f,p]=Ur({prop:o,defaultProp:s??!1,onChange:c,caller:ux});return t(mx,{scope:n,triggerId:H(),triggerRef:d,contentId:H(),open:f,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:t(qb,{...u,open:f,onOpenChange:p,dir:i,modal:l,children:r})})},`DropdownMenu`),_x=`DropdownMenuTrigger`,vx=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=e,o=hx(_x,r),s=px(r),c=z(n,o.triggerRef);return t(Jb,{asChild:!0,...s,children: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`)),yx=lx(e=>{let{__scopeDropdownMenu:n,...r}=e,i=px(n);return t(Yb,{...i,...r})},`DropdownMenuPortal`),bx=`DropdownMenuContent`,xx=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,o=hx(bx,r),s=px(r),c=a.useRef(!1);return t(Xb,{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`)),Sx=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=px(r);return t(Zb,{...a,...i,ref:n})},`DropdownMenuGroup`)),Cx=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=px(r);return t(Qb,{...a,...i,ref:n})},`DropdownMenuLabel`)),wx=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=px(r);return t($b,{...a,...i,ref:n})},`DropdownMenuItem`)),Tx=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=px(r);return t(ex,{...a,...i,ref:n})},`DropdownMenuCheckboxItem`)),Ex=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=px(r);return t(tx,{...a,...i,ref:n})},`DropdownMenuRadioGroup`)),Dx=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=px(r);return t(nx,{...a,...i,ref:n})},`DropdownMenuRadioItem`)),Ox=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=px(r);return t(rx,{...a,...i,ref:n})},`DropdownMenuItemIndicator`)),kx=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=px(r);return t(ix,{...a,...i,ref:n})},`DropdownMenuSeparator`)),Ax=lx(e=>{let{__scopeDropdownMenu:n,children:r,open:i,onOpenChange:a,defaultOpen:o}=e,s=px(n),[c,l]=Ur({prop:i,defaultProp:o??!1,onChange:a,caller:`DropdownMenuSub`});return t(ax,{...s,open:c,onOpenChange:l,children:r})},`DropdownMenuSub`),jx=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=px(r);return t(ox,{...a,...i,ref:n})},`DropdownMenuSubTrigger`)),Mx=a.forwardRef(lx(function(e,n){let{__scopeDropdownMenu:r,...i}=e,a=px(r);return t(sx,{...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`)),Nx=gx,Px=vx,Fx=yx,Ix=xx,Lx=Sx,Rx=Cx,zx=wx,Bx=Tx,Vx=Ex,Hx=Dx,Ux=Ox,Wx=kx,Gx=Ax,Kx=jx,qx=Mx;const Jx=a.createContext(!1);function Yx({...e}){return t(Nx,{"data-slot":`dropdown-menu`,...e})}function Xx({...e}){return t(Fx,{"data-slot":`dropdown-menu-portal`,...e})}function Zx({...e}){return t(Px,{"data-slot":`dropdown-menu-trigger`,...e})}function Qx({className:e,align:n=`start`,sideOffset:r=4,...i}){return t(Fx,{children:t(Ix,{"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 $x({...e}){return t(Lx,{"data-slot":`dropdown-menu-group`,...e})}function eS({className:e,inset:n,variant:r=`default`,...i}){return t(zx,{"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 tS({className:e,children:r,checked:i,inset:a,...o}){return n(Bx,{"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(Ux,{children:t(L,{})})}),r]})}function nS({...e}){return t(Vx,{"data-slot":`dropdown-menu-radio-group`,...e})}function rS({className:e,children:r,inset:i,...a}){return n(Hx,{"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(Ux,{children:t(L,{})})}),r]})}function iS({className:e,inset:n,...r}){return t(Rx,{"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 aS({className:e,...n}){return t(Wx,{"data-slot":`dropdown-menu-separator`,className:B(`bg-border -mx-1 my-1 h-px`,e),...n})}function oS({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 sS({...e}){return t(Gx,{"data-slot":`dropdown-menu-sub`,...e})}function cS({className:e,inset:r,children:i,...a}){return n(Kx,{"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(Re,{className:`cn-rtl-flip ms-auto`})]})}function lS({className:e,...n}){return t(qx,{"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 uS={left:`start`,center:`center`,right:`end`};function dS({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(Jx.Provider,{value:!0,children:r})})})]}):n(Yx,{children:[t(Zx,{asChild:!0,children:t(`span`,{className:`-m-1.5 flex items-center p-1.5`,children:e})}),t(Qx,{align:uS[i],className:`w-max`,children:r})]})}function fS({children:e,label:r}){return n($x,{children:[r&&t(iS,{children:r}),e]})}function pS({children:e,href:n,onClick:r,isDisabled:i=!1,variant:o=`default`,className:s}){let c=a.useContext(Jx),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(eS,{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 mS=({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})})},hS=(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);(gS(i,a)||!r)&&Object.defineProperty(e,n,a)},gS=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)},_S=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},vS=(e,t)=>`/* Wrapped ${e}*/\n${t}`,yS=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),bS=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),xS=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=vS.bind(null,r,t.toString());Object.defineProperty(i,"name",bS);let{writable:a,enumerable:o,configurable:s}=yS;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function SS(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))hS(e,t,r,n);return _S(e,t),xS(e,t,r),e}const CS=2147483647,wS=new WeakMap,TS=new WeakMap,ES=new WeakMap;function DS(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=new Map,maxAge:r}={}){if(r===0)return e;if(typeof r==`number`&&Number.isFinite(r)){if(r>CS)throw TypeError(`The \`maxAge\` option cannot exceed ${CS}.`);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=DS(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>CS)throw TypeError(`The \`maxAge\` function result cannot exceed ${CS}.`)}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),TS.get(i)?.delete(e)},l);e.unref?.();let t=TS.get(i)??new Set;t.add(e),TS.set(i,t)}return c};return SS(i,e,{ignoreNonConfigurable:!0}),wS.set(i,n),ES.set(i,t??(e=>e[0])),i}function kS(e){return typeof e==`string`}function AS(e,t,n){return n.indexOf(e)===t}function jS(e){return e.toLowerCase()===e}function MS(e){return e.indexOf(`,`)===-1?e:e.split(`,`)}function NS(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 NS(n)}if(e.indexOf(`@`)!==-1){var r=e.split(`@`)[0],n=r===void 0?``:r;return NS(n)}if(e.indexOf(`-`)===-1||!jS(e))return e;var i=e.split(`-`),a=i[0],o=i[1];return`${a}-${(o===void 0?``:o).toUpperCase()}`}function PS(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(MS(d))}var f=navigator.language,p=f&&MS(f);o=o.concat(c,p)}return r&&o.push(a),o.filter(kS).map(NS).filter(AS)}var FS=OS(PS,{cacheKey:JSON.stringify});function IS(e){return FS(e)[0]||null}var LS=OS(IS,{cacheKey:JSON.stringify});const RS=new Map;function zS(e){return function(t,n){let r=t||LS();RS.has(r)||RS.set(r,new Map);let i=RS.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 BS(e){let t=new Date(e);return new Date(t.setHours(12))}function VS(e){return(t,n)=>zS(e)(t,BS(n))}const HS={day:`numeric`},US={day:`numeric`,month:`long`,year:`numeric`},WS={month:`long`},GS={month:`long`,year:`numeric`},KS={weekday:`short`},qS={weekday:`long`},JS={year:`numeric`},YS=VS(HS),XS=VS(US),ZS=VS(WS),QS=VS(GS),$S=VS(KS),eC=VS(qS),tC=VS(JS);function nC(e,t,n){return function(r,i=n){return t(e(r)+i)}}function rC(e){return function(t){return new Date(e(t).getTime()-1)}}function iC(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 aC(e){if(e instanceof Date)return e.getMonth();throw Error(`Failed to get month from date: ${e}.`)}function oC(e){if(e instanceof Date)return e.getDate();throw Error(`Failed to get year from date: ${e}.`)}function sC(e){let t=Z(e),n=t+(-t+1)%100,r=new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const cC=nC(Z,sC,-100),lC=nC(Z,sC,100),uC=rC(lC),dC=nC(Z,uC,-100),fC=iC(sC,uC);function pC(e){let t=Z(e),n=t+(-t+1)%10,r=new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}const mC=nC(Z,pC,-10),hC=nC(Z,pC,10),gC=rC(hC),_C=nC(Z,gC,-10),vC=iC(pC,gC);function yC(e){let t=Z(e),n=new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}const bC=nC(Z,yC,-1),xC=nC(Z,yC,1),SC=rC(xC),CC=nC(Z,SC,-1),wC=iC(yC,SC);function TC(e,t){return function(n,r=t){let i=Z(n),a=aC(n)+r,o=new Date;return o.setFullYear(i,a,1),o.setHours(0,0,0,0),e(o)}}function EC(e){let t=Z(e),n=aC(e),r=new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}const DC=TC(EC,-1),OC=TC(EC,1),kC=rC(OC),AC=TC(kC,-1),jC=iC(EC,kC);function MC(e,t){return function(n,r=t){let i=Z(n),a=aC(n),o=oC(n)+r,s=new Date;return s.setFullYear(i,a,o),s.setHours(0,0,0,0),e(s)}}function NC(e){let t=Z(e),n=aC(e),r=oC(e),i=new Date;return i.setFullYear(t,n,r),i.setHours(0,0,0,0),i}const PC=rC(MC(NC,1)),FC=iC(NC,PC);function IC(e){return oC(kC(e))}const LC={GREGORY:`gregory`,HEBREW:`hebrew`,ISLAMIC:`islamic`,ISO_8601:`iso8601`},RC={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`]},zC=[0,1,2,3,4,5,6],BC=zC[0],VC=zC[5],HC=zC[6];function UC(e,t=LC.ISO_8601){let n=e.getDay();switch(t){case LC.ISO_8601:return(n+6)%7;case LC.ISLAMIC:return(n+1)%7;case LC.HEBREW:case LC.GREGORY:return n;default:throw Error(`Unsupported calendar type.`)}}function WC(e){return Z(sC(e))}function GC(e){return Z(pC(e))}function KC(e,t=LC.ISO_8601){let n=Z(e),r=aC(e),i=e.getDate()-UC(e,t);return new Date(n,r,i)}function qC(e,t=LC.ISO_8601){let n=t===LC.GREGORY?LC.GREGORY:LC.ISO_8601,r=KC(e,t),i=Z(e)+1,a,o;do a=new Date(i,0,n===LC.ISO_8601?4:1),o=KC(a,t),--i;while(e<o);return Math.round((r.getTime()-o.getTime())/6048e5)+1}function JC(e,t){switch(e){case`century`:return sC(t);case`decade`:return pC(t);case`year`:return yC(t);case`month`:return EC(t);case`day`:return NC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function YC(e,t){switch(e){case`century`:return cC(t);case`decade`:return mC(t);case`year`:return bC(t);case`month`:return DC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function XC(e,t){switch(e){case`century`:return lC(t);case`decade`:return hC(t);case`year`:return xC(t);case`month`:return OC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function ZC(e,t){switch(e){case`decade`:return mC(t,-100);case`year`:return bC(t,-10);case`month`:return DC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function QC(e,t){switch(e){case`decade`:return hC(t,100);case`year`:return xC(t,10);case`month`:return OC(t,12);default:throw Error(`Invalid rangeType: ${e}`)}}function $C(e,t){switch(e){case`century`:return uC(t);case`decade`:return gC(t);case`year`:return SC(t);case`month`:return kC(t);case`day`:return PC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function ew(e,t){switch(e){case`century`:return dC(t);case`decade`:return _C(t);case`year`:return CC(t);case`month`:return AC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function tw(e,t){switch(e){case`decade`:return _C(t,-100);case`year`:return CC(t,-10);case`month`:return AC(t,-12);default:throw Error(`Invalid rangeType: ${e}`)}}function nw(e,t){switch(e){case`century`:return fC(t);case`decade`:return vC(t);case`year`:return wC(t);case`month`:return jC(t);case`day`:return FC(t);default:throw Error(`Invalid rangeType: ${e}`)}}function rw(e,t,n){let r=[t,n].sort((e,t)=>e.getTime()-t.getTime());return[JC(e,r[0]),$C(e,r[1])]}function iw(e,t,n){return n.map(n=>(t||tC)(e,n)).join(` – `)}function aw(e,t,n){return iw(e,t,fC(n))}function ow(e,t,n){return iw(e,t,vC(n))}function sw(e){return e.getDay()===new Date().getDay()}function cw(e,t=LC.ISO_8601){let n=e.getDay();switch(t){case LC.ISLAMIC:case LC.HEBREW:return n===VC||n===HC;case LC.ISO_8601:case LC.GREGORY:return n===HC||n===BC;default:throw Error(`Unsupported calendar type.`)}}const lw=`react-calendar__navigation`;function uw({activeStartDate:r,drillUp:i,formatMonthYear:a=QS,formatYear:o=tC,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=YC(C,r),O=E?ZC(C,r):void 0,k=XC(C,r),A=E?QC(C,r):void 0,j=(()=>{if(D.getFullYear()<0)return!0;let e=ew(C,r);return l&&l>=e})(),M=E&&(()=>{if(O.getFullYear()<0)return!0;let e=tw(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 aw(s,o,e);case`decade`:return ow(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||LS()||void 0,view:C}):t}function ie(){let a=`${lw}__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:lw,children:[v!==null&&E?t(`button`,{"aria-label":_,className:`${lw}__arrow ${lw}__prev2-button`,disabled:M,onClick:te,type:`button`,children:v}):null,b!==null&&t(`button`,{"aria-label":y,className:`${lw}__arrow ${lw}__prev-button`,disabled:j,onClick:ee,type:`button`,children:b}),ie(),g!==null&&t(`button`,{"aria-label":h,className:`${lw}__arrow ${lw}__next-button`,disabled:N,onClick:F,type:`button`,children:g}),m!==null&&E?t(`button`,{"aria-label":p,className:`${lw}__arrow ${lw}__next2-button`,disabled:P,onClick:ne,type:`button`,children:m}):null]})}function dw(e){return`${e}%`}function fw({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?dw(100*a/r):null;return u(e,{...e.props,style:{flexBasis:dw(100/r),flexShrink:0,flexGrow:0,overflow:`hidden`,marginLeft:n,marginInlineStart:n,marginInlineEnd:0}})})})}function pw(e,t,n){return t&&t>e?t:n&&n<e?n:e}function mw(e,t){return t[0]<=e&&t[1]>=e}function hw(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function gw(e,t){return mw(e[0],t)||mw(e[1],t)}function _w(e,t,n){let r=gw(t,e),i=[];if(r){i.push(n);let r=mw(e[0],t),a=mw(e[1],t);r&&i.push(`${n}Start`),a&&i.push(`${n}End`),r&&a&&i.push(`${n}BothEnds`)}return i}function vw(e){return Array.isArray(e)?e[0]!==null&&e[1]!==null:e!==null}function yw(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=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 nw(t,n)})();if(mw(o,s)&&a.push(`${i}--now`),!t||!vw(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 nw(n,t)})();hw(c,s)?a.push(`${i}--active`):gw(c,s)&&a.push(`${i}--hasActive`);let l=_w(c,s,`${i}--range`);if(a.push(...l),r&&(Array.isArray(t)?t:[t]).length===1){let e=_w(r>c[0]?[c[0],r]:[r,c[0]],s,`${i}--hover`);a.push(...e)}return a}function bw({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:yw({date:t,dateType:i,hover:o,value:d,valueType:f}),date:t}))}return t(fw,{className:e,count:n,offset:s,wrap:!0,children:p})}function xw(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 Sw=`react-calendar__century-view__decades__decade`;function Cw({classes:e=[],currentCentury:n,formatYear:r=tC,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(Sw),sC(a).getFullYear()!==n&&s.push(`${Sw}--neighboringCentury`),t(xw,{...i,classes:s,maxDateTransform:gC,minDateTransform:pC,view:`century`,children:ow(o,r,a)})}function ww(e){let{activeStartDate:n,hover:r,showNeighboringCentury:i,value:a,valueType:o,...s}=e,c=WC(n),l=c+(i?119:99);return t(bw,{className:`react-calendar__century-view__decades`,dateTransform:pC,dateType:`decade`,end:l,hover:r,renderTile:({date:e,...r})=>t(Cw,{...s,...r,activeStartDate:n,currentCentury:c,date:e},e.getTime()),start:c,step:10,value:a,valueType:o})}function Tw(e){function n(){return t(ww,{...e})}return t(`div`,{className:`react-calendar__century-view`,children:n()})}const Ew=`react-calendar__decade-view__years__year`;function Dw({classes:e=[],currentDecade:n,formatYear:r=tC,...i}){let{date:a,locale:o}=i,s=[];return e&&s.push(...e),s.push(Ew),pC(a).getFullYear()!==n&&s.push(`${Ew}--neighboringDecade`),t(xw,{...i,classes:s,maxDateTransform:SC,minDateTransform:yC,view:`decade`,children:r(o,a)})}function Ow(e){let{activeStartDate:n,hover:r,showNeighboringDecade:i,value:a,valueType:o,...s}=e,c=GC(n),l=c+(i?11:9);return t(bw,{className:`react-calendar__decade-view__years`,dateTransform:yC,dateType:`year`,end:l,hover:r,renderTile:({date:e,...r})=>t(Dw,{...s,...r,activeStartDate:n,currentDecade:c,date:e},e.getTime()),start:c,value:a,valueType:o})}function kw(e){function n(){return t(Ow,{...e})}return t(`div`,{className:`react-calendar__decade-view`,children:n()})}const Aw=`react-calendar__month-view__days__day`;function jw({calendarType:e,classes:n=[],currentMonthIndex:r,formatDay:i=YS,formatLongDate:a=XS,...o}){let{date:s,locale:c}=o,l=[];return n&&l.push(...n),l.push(Aw),cw(s,e)&&l.push(`${Aw}--weekend`),s.getMonth()!==r&&l.push(`${Aw}--neighboringMonth`),t(xw,{...o,classes:l,formatAbbr:a,maxDateTransform:PC,minDateTransform:NC,view:`month`,children:i(c,s)})}function Mw(e){let{activeStartDate:n,calendarType:r,hover:i,showFixedNumberOfWeeks:a,showNeighboringMonth:o,value:s,valueType:c,...l}=e,u=Z(n),d=aC(n),f=a||o,p=UC(n,r),m=f?0:p,h=(f?-p:0)+1,g=(()=>{if(a)return h+42-1;let e=IC(n);if(o){let t=new Date;return t.setFullYear(u,d,e),t.setHours(0,0,0,0),e+(7-UC(t,r)-1)}return e})();return t(bw,{className:`react-calendar__month-view__days`,count:7,dateTransform:e=>{let t=new Date;return t.setFullYear(u,d,e),NC(t)},dateType:`day`,hover:i,end:g,renderTile:({date:e,...i})=>t(jw,{...l,...i,activeStartDate:n,calendarType:r,currentMonthIndex:d,date:e},e.getTime()),offset:m,start:h,value:s,valueType:c})}const Nw=`react-calendar__month-view__weekdays`,Pw=`${Nw}__weekday`;function Fw(e){let{calendarType:n,formatShortWeekday:i=$S,formatWeekday:a=eC,locale:o,onMouseLeave:s}=e,c=EC(new Date),l=Z(c),u=aC(c),d=[];for(let e=1;e<=7;e+=1){let s=new Date(l,u,e-UC(c,n)),f=a(o,s);d.push(t(`div`,{className:r(Pw,sw(s)&&`${Pw}--current`,cw(s,n)&&`${Pw}--weekend`),children:t(`abbr`,{"aria-label":f,title:f,children:i(o,s).replace(`.`,``)})},e))}return t(fw,{className:Nw,count:7,onFocus:s,onMouseOver:s,children:d})}const Iw=`react-calendar__tile`;function Lw(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:Iw,onClick:e=>r(a,n,e),type:`button`,children:i})}{let{date:n,onClickWeekNumber:r,weekNumber:a,...o}=e;return t(`div`,{...o,className:Iw,children:i})}}function Rw(e){let{activeStartDate:n,calendarType:r,onClickWeekNumber:i,onMouseLeave:a,showFixedNumberOfWeeks:o}=e,s=(()=>{if(o)return 6;let e=IC(n)-(7-UC(n,r));return 1+Math.ceil(e/7)})(),c=(()=>{let e=Z(n),t=aC(n),i=oC(n),a=[];for(let n=0;n<s;n+=1)a.push(KC(new Date(e,t,i+n*7),r));return a})(),l=c.map(e=>qC(e,r));return t(fw,{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(Lw,{date:r,onClickWeekNumber:i,weekNumber:e},e)})})}function zw(e){if(e){for(let[t,n]of Object.entries(RC))if(n.includes(e))return t}return LC.ISO_8601}function Bw(e){let{activeStartDate:i,locale:a,onMouseLeave:o,showFixedNumberOfWeeks:s}=e,{calendarType:c=zw(a),formatShortWeekday:l,formatWeekday:u,onClickWeekNumber:d,showWeekNumbers:f,...p}=e;function m(){return t(Fw,{calendarType:c,formatShortWeekday:l,formatWeekday:u,locale:a,onMouseLeave:o})}function h(){return f?t(Rw,{activeStartDate:i,calendarType:c,onClickWeekNumber:d,onMouseLeave:o,showFixedNumberOfWeeks:s}):null}function g(){return t(Mw,{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 Vw({classes:e=[],formatMonth:n=ZS,formatMonthYear:r=QS,...i}){let{date:a,locale:o}=i;return t(xw,{...i,classes:[...e,`react-calendar__year-view__months__month`],formatAbbr:r,maxDateTransform:kC,minDateTransform:EC,view:`year`,children:n(o,a)})}function Hw(e){let{activeStartDate:n,hover:r,value:i,valueType:a,...o}=e,s=Z(n);return t(bw,{className:`react-calendar__year-view__months`,dateTransform:e=>{let t=new Date;return t.setFullYear(s,e,1),EC(t)},dateType:`month`,end:11,hover:r,renderTile:({date:e,...r})=>t(Vw,{...o,...r,activeStartDate:n,date:e},e.getTime()),start:0,value:i,valueType:a})}function Uw(e){function n(){return t(Hw,{...e})}return t(`div`,{className:`react-calendar__year-view`,children:n()})}const Ww=`react-calendar`,Gw=[`century`,`decade`,`year`,`month`],Kw=[`decade`,`year`,`month`,`day`],qw=new Date;qw.setFullYear(1,0,1),qw.setHours(0,0,0,0);const Jw=new Date(864e13);function Yw(e){return e instanceof Date?e:new Date(e)}function Xw(e,t){return Gw.slice(Gw.indexOf(e),Gw.indexOf(t)+1)}function Zw(e,t,n){return Xw(t,n).indexOf(e)!==-1}function Qw(e,t,n){return e&&Zw(e,t,n)?e:n}function $w(e){let t=Gw.indexOf(e);return Kw[t]}function eT(e,t){let n=Array.isArray(e)?e[t]:e;if(!n)return null;let r=Yw(n);if(Number.isNaN(r.getTime()))throw Error(`Invalid date: ${e}`);return r}function tT({value:e,minDate:t,maxDate:n,maxDetail:r},i){let a=eT(e,i);if(!a)return null;let o=$w(r);return pw((()=>{switch(i){case 0:return JC(o,a);case 1:return $C(o,a);default:throw Error(`Invalid index value: ${i}`)}})(),t,n)}const nT=e=>tT(e,0),rT=e=>tT(e,1),iT=e=>[nT,rT].map(t=>t(e));function aT({maxDate:e,maxDetail:t,minDate:n,minDetail:r,value:i,view:a}){return JC(Qw(a,r,t),nT({value:i,minDate:n,maxDate:e,maxDetail:t})||new Date)}function oT({activeStartDate:e,defaultActiveStartDate:t,defaultValue:n,defaultView:r,maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c,view:l}){let u=Qw(l,s,a),d=e||t;return d?JC(u,d):aT({maxDate:i,maxDetail:a,minDate:o,minDetail:s,value:c||n,view:l||r})}function sT(e){return e&&(!Array.isArray(e)||e.length===1)}function cT(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var lT=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=Jw,maxDetail:D=`month`,minDate:O=qw,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:Yw(e)):d==null?null:Yw(d)),[I,Fe]=w(f),L=a||ke||oT({activeStartDate:a,defaultActiveStartDate:u,defaultValue:d,defaultView:f,maxDate:E,maxDetail:D,minDate:O,minDetail:k,value:De,view:Oe}),Ie=(()=>{let e=ge&&sT(Ne)||De===void 0?Ne:De;return e?Array.isArray(e)?e.map(e=>e===null?null:Yw(e)):e===null?null:Yw(e):null})(),Le=$w(D),R=Qw(Oe||I,k,D),Re=Xw(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 nT;case`end`:return rT;case`range`:return iT;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:Ie,view:R};F&&!cT(L,e)&&F(n)},[L,F,Ie,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),Fe(n);let r={action:`drillDown`,activeStartDate:e,value:Ie,view:n};F&&!cT(L,e)&&F(r),ue&&R!==n&&ue(r),ce&&ce(r)},[L,Be,F,We,ce,ue,Ie,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=JC(e,L);Ae(t),Fe(e);let n={action:`drillUp`,activeStartDate:t,value:Ie,view:e};F&&!cT(L,t)&&F(n),ue&&R!==e&&ue(n),le&&le(n)},[L,Ve,F,le,ue,Ie,R,Re]),qe=h((e,t)=>{let n=Ie;We(e,t);let r=ge&&!sT(n),i;if(ge){if(r)i=JC(Le,e);else{if(!n)throw Error(`previousValue is required`);if(Array.isArray(n))throw Error(`previousValue must not be an array`);i=rw(Le,n,e)}}else i=He(e);let a=!ge||r||S?aT({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&&!cT(L,a)&&F(s),ne){if(ge){if(!sT(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)}},[L,o,He,S,E,D,O,k,F,ne,We,ge,Ie,Le,R]);function Je(e){Me(e)}function Ye(){Me(null)}y(i,()=>({activeStartDate:L,drillDown:Ge,drillUp:Ke,onChange:qe,setActiveStartDate:Ue,value:Ie,view:R}),[L,Ge,Ke,qe,Ue,Ie,R]);function Xe(e){let n={activeStartDate:e?XC(R,L):JC(R,L),hover:ze,locale:T,maxDate:E,minDate:O,onClick:Be?Ge:qe,onMouseOver:ge?Je:void 0,tileClassName:we,tileContent:Te,tileDisabled:Ee,value:Ie,valueType:Le};switch(R){case`century`:return t(Tw,{formatYear:x,showNeighboringCentury:be,...n});case`decade`:return t(kw,{formatYear:x,showNeighboringDecade:xe,...n});case`year`:return t(Uw,{formatMonth:g,formatMonthYear:_,...n});case`month`:return t(Bw,{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(uw,{activeStartDate:L,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(Ww,ge&&(Array.isArray(Ie)?Ie:[Ie]).length===1&&`${Ww}--selectRange`,_e&&`${Ww}--doubleView`,c),"data-testid":l,ref:C,children:[Ze(),n(`div`,{className:`${Ww}__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,uT=Object.defineProperty,dT=(e,t)=>uT(e,`name`,{value:t,configurable:!0}),fT=`Popover`,[pT,mT]=On(fT,[cr]),hT=cr(),[gT,_T]=pT(fT),vT=dT(e=>{let{__scopePopover:n,children:r,open:i,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,l=hT(n),u=a.useRef(null),[d,f]=a.useState(!1),[p,m]=Ur({prop:i,defaultProp:o??!1,onChange:s,caller:fT});return t(xr,{...l,children:t(gT,{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`),yT=`PopoverAnchor`,bT=a.forwardRef(dT(function(e,n){let{__scopePopover:r,...i}=e,o=_T(yT,r),s=hT(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=o;return a.useEffect(()=>(c(),()=>l()),[c,l]),t(Sr,{...s,...i,ref:n})},`PopoverAnchor`)),xT=`PopoverTrigger`,ST=a.forwardRef(dT(function(e,n){let{__scopePopover:r,...i}=e,a=_T(xT,r),o=hT(r),s=z(n,a.triggerRef),c=t(U.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":FT(a.open),...i,ref:s,onClick:V(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:t(Sr,{asChild:!0,...o,children:c})},`PopoverTrigger`)),CT=`PopoverPortal`,[wT,TT]=pT(CT,{forceMount:void 0}),ET=dT(e=>{let{__scopePopover:n,forceMount:r,children:i,container:a}=e,o=_T(CT,n);return t(wT,{scope:n,forceMount:r,children:t(kr,{present:r||o.open,children:t(Tr,{asChild:!0,container:a,children:i})})})},`PopoverPortal`),DT=`PopoverContent`,OT=a.forwardRef(dT(function(e,n){let r=TT(DT,e.__scopePopover),{forceMount:i=r.forceMount,...a}=e,o=_T(DT,e.__scopePopover);return t(kr,{present:i||o.open,children:o.modal?t(AT,{...a,ref:n}):t(jT,{...a,ref:n})})},`PopoverContent`)),kT=rn(`PopoverContent.RemoveScroll`),AT=a.forwardRef(dT(function(e,n){let r=_T(DT,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)},[]),t(ue,{as:kT,allowPinchZoom:!0,children:t(MT,{...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`)),jT=a.forwardRef(dT(function(e,n){let r=_T(DT,e.__scopePopover),i=a.useRef(!1),o=a.useRef(!1);return t(MT,{...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`)),MT=a.forwardRef(dT(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=_T(DT,r),m=hT(r);return le(),t(ce,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:t(M,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:t(Cr,{"data-state":FT(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`)),NT=`PopoverClose`,PT=a.forwardRef(dT(function(e,n){let{__scopePopover:r,...i}=e,a=_T(NT,r);return t(U.button,{type:`button`,...i,ref:n,onClick:V(e.onClick,()=>a.onOpenChange(!1))})},`PopoverClose`));function FT(e){return e?`open`:`closed`}dT(FT,`getState`);var IT=vT,LT=bT,RT=ST,zT=ET,BT=OT,VT=PT;const HT=a.createContext(null),UT=({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(IT,{open:c,onOpenChange:e=>{l(e),s&&s(e)},modal:r,children:i})})};function WT(e=!1,t=()=>{},n){e&&t(n===`enter`)}const GT=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(RT,{ref:r,asChild:!0,onMouseEnter:()=>WT(s,o,`enter`),onMouseLeave:()=>WT(s,o,`leave`),onClick:()=>{c&&o(e=>!e)},...n,children:e})});GT.displayName=RT.displayName;const KT=LT,qT=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(zT,{container:u,children:t(BT,{ref:o,align:n,side:r,onMouseEnter:()=>WT(l,c,`enter`),onMouseLeave:()=>WT(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})})});qT.displayName=BT.displayName;const JT=VT;JT.displayName=VT.displayName;function YT(){let e=a.useContext(HT);if(!e)throw Error(`usePopoverContext must be used within a Popover`);return{...e,close:()=>e.setOpen(!1)}}const XT=`
197
239
  .calendar-wrapper .react-calendar__navigation {
198
240
  display: flex !important;
199
241
  justify-content: space-between !important;
@@ -279,12 +321,12 @@ let n=p(({className:n,...r},i)=>f(Ae,{ref:i,iconNode:t,className:Se(`lucide-${Ce
279
321
  text-align: center !important;
280
322
  }
281
323
 
282
- `,ET=({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(vT,{_open:o,onOpenChange:s,children:[t(bT,{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(ST,{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:TT}),t(Rw,{value:f,onChange:m,selectRange:!0,returnValue:`range`,maxDate:(()=>{let e=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=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(U,{variant:`ghost`,size:`sm`,onClick:()=>s(!1),children:`Cancel`}),t(U,{size:`sm`,onClick:()=>s(!1),children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:TT}),t(Rw,{value:d,onChange:m,selectRange:!1,maxDate:(()=>{let e=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=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 DT({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 OT=({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(vT,{_open:l,onOpenChange:e=>{u(e),e||setTimeout(()=>{f(``)},200)},children:[t(bT,{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(DT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})})():`${i?.length} selected`})}),t(ST,{className:`w-[300px] p-0`,children:t(Ux,{children:n(uv,{children:[t(fv,{placeholder:r,className:`h-9`,value:d,onInputCapture:e=>{f(e.currentTarget.value)},ref:p}),n(pv,{children:[t(mv,{children:m(`filter.noResultsFound`)}),t(hv,{children:i.map(e=>n(_v,{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(DT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})]},e.value))}),h?.length>0&&n(e,{children:[t(gv,{}),t(hv,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(e=>n(_v,{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(ng,{checked:!1,className:`opacity-0 group-data-[selected=true]:opacity-100`}),t(`span`,{className:`text-muted`,children:t(DT,{value:e.value||``,labelRenderer:e.labelRenderer||s,fallbackLabel:e.label})})]},e.value))})]})]})]})})})]})},kT=({filterType:e,filterValues:r,setFilterValues:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(vT,{_open:a,onOpenChange:e=>{o(e),!e&&JSON.stringify(s)!==JSON.stringify(r)&&c(r)},children:[t(bT,{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(ST,{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(Gi,{value:s,onChange:c,placeholder:`Add ${e.toLowerCase()}...`}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{size:`sm`,variant:`ghost`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})]})})]})},AT=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`}}),jT=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:z(AT({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(U,{variant:`link`,size:`icon`,type:`button`,onClick:f,className:`clear-button opacity-0 transition-opacity duration-200
324
+ `,ZT=({filterValues:r,setFilterValues:i,isRange:a=!1})=>{let[o,s]=w(!1),[c,l]=w([null,null]),{t:u}=k(),d=r[0]?Q(r[0]).toDate():void 0,f=a?[c[0]||(r[0]?Q(r[0]).toDate():null),c[1]||(r[1]?Q(r[1]).toDate():null)]:[null,null];_(()=>{a&&l([r[0]?Q(r[0]).toDate():null,r[1]?Q(r[1]).toDate():null])},[r,a]);let p=()=>a?f[0]&&f[1]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`-`}),t(`span`,{className:`font-medium`,children:Q(f[1]).format(`MMMM DD, YYYY`)})]}):f[0]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`- Select end`})]}):t(`span`,{className:`text-muted`,children:u(`filter.selectRange`)}):d?Q(d).format(`MMMM DD, YYYY`):`Pick a date`,m=e=>{if(a)Array.isArray(e)&&(l([e[0],e[1]]),e[0]&&e[1]?i([Q(e[0]).format(`YYYY-MM-DD`),Q(e[1]).format(`YYYY-MM-DD`)]):e[0]&&i([Q(e[0]).format(`YYYY-MM-DD`)]));else if(e){let t=Array.isArray(e)?e[0]:e;t&&(i([Q(t).format(`YYYY-MM-DD`)]),s(!1))}};return n(UT,{_open:o,onOpenChange:s,children:[t(GT,{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(qT,{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:XT}),t(lT,{value:f,onChange:m,selectRange:!0,returnValue:`range`,maxDate:(()=>{let e=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=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(f[0]){let e=f[0].getTime();if(f[1]){let n=f[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-info text-info font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}})]}),f[0]&&f[1]&&t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(W,{variant:`ghost`,size:`sm`,onClick:()=>s(!1),children:`Cancel`}),t(W,{size:`sm`,onClick:()=>s(!1),children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:XT}),t(lT,{value:d,onChange:m,selectRange:!1,maxDate:(()=>{let e=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=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 QT({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 $T=({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(UT,{_open:l,onOpenChange:e=>{u(e),e||setTimeout(()=>{f(``)},200)},children:[t(GT,{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(QT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})})():`${i?.length} selected`})}),t(qT,{className:`w-[300px] p-0`,children:t(mS,{children:n(Fv,{children:[t(Lv,{placeholder:r,className:`h-9`,value:d,onInputCapture:e=>{f(e.currentTarget.value)},ref:p}),n(Rv,{children:[t(zv,{children:m(`filter.noResultsFound`)}),t(Bv,{children:i.map(e=>n(Hv,{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(QT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})]},e.value))}),h?.length>0&&n(e,{children:[t(Vv,{}),t(Bv,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(e=>n(Hv,{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(Dg,{checked:!1,className:`opacity-0 group-data-[selected=true]:opacity-100`}),t(`span`,{className:`text-muted`,children:t(QT,{value:e.value||``,labelRenderer:e.labelRenderer||s,fallbackLabel:e.label})})]},e.value))})]})]})]})})})]})},eE=({filterType:e,filterValues:r,setFilterValues:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(UT,{_open:a,onOpenChange:e=>{o(e),!e&&JSON.stringify(s)!==JSON.stringify(r)&&c(r)},children:[t(GT,{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(qT,{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(W,{size:`sm`,variant:`ghost`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(W,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})]})})]})},tE=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`}}),nE=a.forwardRef(({className:e,type:r,size:i=`md`,variant:a=`default`,clearable:o=!0,onChange:s,value:c,invalid:l,...u},d)=>{let f=()=>{s?.(``)},p=e=>{s?.(e.target.value)},m=u[`aria-invalid`]??(l?!0:void 0);return n(`div`,{className:`w-full relative inline-block [&:hover_.clear-button]:opacity-100`,children:[t(`input`,{type:r,className:B(tE({size:i,variant:a}),e,o&&c?`pe-8`:``),ref:d,value:c??``,onChange:p,...u,"aria-invalid":m}),o&&c&&!u.readOnly&&!u.disabled&&t(W,{variant:`link`,size:`icon`,type:`button`,onClick:f,className:`clear-button opacity-0 transition-opacity duration-200
283
325
  absolute top-1/2 -translate-y-1/2 text-muted !hover:text-destructive cursor-pointer
284
- flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(Xe,{size:16})})]})});jT.displayName=`Input`;const MT=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(vT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(bT,{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(ST,{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(jT,{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(U,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function NT({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,_=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:TT}),t(Rw,{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=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(U,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(U,{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:TT}),t(Rw,{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=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 PT({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(_v,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(DT,{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(U,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(U,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function FT({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(Gi,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(U,{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 IT({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(jT,{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(U,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(U,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function LT(e,n,r){switch(e.type){case`date`:return t(ET,{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(MT,{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(kT,{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(OT,{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 RT({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}),LT(e,r,i),t(U,{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(Xe,{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 zT=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),BT=({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(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(WT(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(WT(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(zT.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},VT=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(zT),{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=>WT(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(mv,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(_v,{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(vT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(bT,{asChild:!0,children:n(U,{variant:`outline`,role:`combobox`,"aria-expanded":c,"aria-label":s(`filter.filter`),size:`md`,className:z(`transition group flex gap-1.5`,e),children:[t(Ve,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(ST,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(uv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(fv,{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(pv,{children:t(hv,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(NT,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(IT,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(FT,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(PT,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},HT=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(zT);return t(`div`,{className:z(e),children:t(RT,{filters:n,setFilters:r,filterGroups:i})})},UT=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(zT),{t:i}=k();return n.filter(e=>e.value?.length>0).length>0?t(U,{variant:`outline`,size:`md`,className:z(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function WT(e){return typeof e==`string`?e:e.value||``}var GT;(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`})(GT||={});const KT=p(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:z({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})});KT.displayName=`Heading`;function qT({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`?JT(e,T)===JT(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`?JT(e,T)===JT(t,T):typeof T==`function`?T(e,t):ge(e,t),me=i||[];function he(e){return e?typeof e==`string`?t=>String(JT(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(_v,{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(je,{className:`size-4`})]}):n(CT,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(je,{className:`size-4`})]})},`option-${r}`)},Se=(()=>{if(!o)return null;let e=[],t=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`,children:[t(`div`,{className:`mx-2`,children:t(Ke,{className:`size-4`})}),t(jT,{variant:`unstyled`,value:oe,onChange:se,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(uv,{className:`overflow-hidden`,children:n(pv,{className:E?`max-h-full overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(mv,{children:`No result found.`}),Se?Se.map(e=>t(hv,{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(hv,{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(qe,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),u]})})]});if(E)return t(`div`,{className:r(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(He,{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(vT,{onOpenChange:re,children:[n(`div`,{ref:F,className:r(`relative`,h),children:[t(bT,{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(He,{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(yi,{description:k,placement:`top`,asChild:!0,children:t(Ye,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?be():ye()]})]}),!d&&t(Fe,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),De&&!D&&t(U,{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(Xe,{className:`size-4`})})]}),t(ST,{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 JT(e,t){return typeof e==`object`&&e?e[t]:void 0}const YT={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 XT({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(qT,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>YT[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var ZT=Object.defineProperty,QT=a.forwardRef(((e,t)=>ZT(e,`name`,{value:t,configurable:!0}))(function(e,n){return t(H.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 $T=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),eE=a.forwardRef(({className:e,required:r,...i},a)=>n(QT,{ref:a,className:z($T(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive ms-1`,children:`*`})]}));eE.displayName=QT.displayName;function tE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(Le,{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(Ye,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Ie,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(Be,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(Be,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(Be,{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 nE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(tE,{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(U,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function rE({title:e,className:n,children:r}){return t(tE,{status:`info`,title:e,className:n,children:r})}function iE({title:e,className:n,children:r}){return t(tE,{status:`warning`,title:e,className:n,children:r})}function aE({title:e,className:n,children:r}){return t(tE,{status:`success`,title:e,className:n,children:r})}function oE({title:e,className:n,children:r}){return t(tE,{status:`default`,title:e,className:n,children:r})}function sE({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(Q_,{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(Ye,{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($_,{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(Ri,{label:l??u,children:t(jT,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(tv,{align:`right`,children:[t(U,{variant:`destructive`,onClick:v,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(U,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function cE(){return g(lE)}const lE=d(()=>{}),uE={success:Ie,error:Le,warning:Ye,info:Be},dE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function fE({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=uE[e.status]||Be,u=dE[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(Tp,{onExitComplete:r,children:i&&t(_h.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(Xe,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function pE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(lE.Provider,{value:o,children:r}),i&&t(Sh,{children:t(fE,{data:i,onClose:()=>o(null)})})]})}function mE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=cE();return t(sE,{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 hE=4,gE={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 _E(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 vE({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(wx,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(Ex,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(Me,{className:`ms-1 size-4`})]})}),t(Dx,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function yE({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=gE[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=_E(e,e=>e.name===r),h=s(`agent.moreTabs`);return n(`div`,{ref:l,className:z(`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:z(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:d,className:z(c.base,c.inactive),children:[h,t(Me,{className:c.icon})]})]}),n(`div`,{className:z(`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:z(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),p.length>0&&t(vE,{label:h,triggerClassName:z(c.base,m?c.active:c.inactive),icon:t(Me,{className:c.icon}),children:p.map(e=>t(kx,{disabled:e.disabled,onClick:()=>i(e.name),className:z(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function bE({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?Me:Pe,{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(Fi,{description:o,size:`md`})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,l&&(h?v:t(U,{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 xE=Object.defineProperty,SE=(e,t)=>xE(e,`name`,{value:t,configurable:!0}),CE=`Radio`,[wE,TE]=rn(CE),[EE,DE]=wE(CE);function OE(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:SE(()=>l?.(),`onCheck`)};return t(EE,{scope:n,...b,children:FE(f)?f(b):i})}SE(OE,`RadioProvider`);var kE=`RadioTrigger`,AE=a.forwardRef(SE(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}=DE(kE,e),m=R(i,c);return t(H.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":IE(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:m,onClick:B(n,e=>{a||(d(),l()),p&&f&&(u.current=e.isPropagationStopped(),u.current||e.stopPropagation())})})},`RadioTrigger`)),jE=`RadioIndicator`,ME=a.forwardRef(SE(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=DE(jE,r);return t(ar,{present:i||o.checked,children:t(H.span,{"data-state":IE(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),NE=`RadioBubbleInput`,PE=a.forwardRef(SE(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}=DE(NE,e),_=R(i,m),v=Nn(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 t(H.input,{type:`radio`,"aria-hidden":!0,defaultChecked:S.current,required:c,disabled:l,name:u,value:d,form:f,...r,tabIndex:-1,ref:_,onClick:B(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function FE(e){return typeof e==`function`}SE(FE,`isFunction`);function IE(e){return e?`checked`:`unchecked`}SE(IE,`getState`);var LE=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],RE=`RadioGroup`,[zE,BE]=rn(RE,[Yv,TE]),VE=Yv(),HE=TE(),[UE,WE]=zE(RE),GE=a.forwardRef(SE(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=VE(r),_=fe(f),[v,y]=yr({prop:c,defaultProp:s??null,onChange:m,caller:RE}),[b,x]=a.useState(null),S=R(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=SE(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),t(UE,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:t(sy,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:t(H.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),KE=`RadioGroupItemProvider`,qE=`RadioGroupItemTrigger`;function JE(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=WE(KE,n),c=HE(n),l=s.disabled||i;return t(OE,{...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})}SE(JE,`RadioGroupItemProvider`);var YE=a.forwardRef(SE(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=VE(r),s=HE(r),{checked:c,disabled:l}=DE(qE,s.__scopeRadio),u=a.useRef(null),d=R(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=SE(e=>{LE.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=SE(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),t(cy,{asChild:!0,...o,focusable:!l,active:c,children:t(AE,{...s,...i,ref:d,onKeyDown:B(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:B(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),XE=a.forwardRef(SE(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return t(JE,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(YE,{...c,ref:i,__scopeRadioGroup:a}),r&&t(ZE,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),ZE=a.forwardRef(SE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=HE(r);return t(PE,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),QE=a.forwardRef(SE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=HE(r);return t(ME,{...a,...i,ref:n})},`RadioGroupIndicator`));function $E({className:e,...n}){return t(XE,{"data-slot":`radio-group-item`,className:z(`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(QE,{"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 eD=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function tD({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(GE,{"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(XE,{value:o(e),className:z(`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 nD({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:z(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function rD(e){return typeof e==`number`?`${e}%`:e}function iD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:rD(e),minSize:rD(n),maxSize:rD(r),collapsedSize:rD(i),...a})}function aD({withHandle:e,className:n,...r}){return t(_e.Separator,{"data-slot":`resizable-handle`,className:z(`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(Ue,{className:`size-4 rotate-90`})})})}var oD=Object.defineProperty,sD=(e,t)=>oD(e,`name`,{value:t,configurable:!0}),cD=`horizontal`,lD=[`horizontal`,`vertical`],uD=a.forwardRef(sD(function(e,n){let{decorative:r,orientation:i=cD,...a}=e,o=dD(i)?i:cD,s=r?{role:`none`}:{"aria-orientation":o===`vertical`?o:void 0,role:`separator`};return t(H.div,{"data-orientation":o,...s,...a,ref:n})},`Separator`));function dD(e){return lD.includes(e)}sD(dD,`isValidOrientation`);var fD=uD;const pD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(fD,{ref:a,decorative:r,orientation:n,className:z(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));pD.displayName=fD.displayName;var mD=Object.defineProperty,hD=(e,t)=>mD(e,`name`,{value:t,configurable:!0});function gD(e,[t,n]){return Math.min(n,Math.max(t,e))}hD(gD,`clamp`);var _D=Object.defineProperty,vD=(e,t)=>_D(e,`name`,{value:t,configurable:!0});function yD(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])}vD(yD,`usePrevious`);var bD=Object.defineProperty,$=(e,t)=>bD(e,`name`,{value:t,configurable:!0}),xD=[`PageUp`,`PageDown`],SD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],CD={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},wD=`Slider`,[TD,ED,DD]=xv(wD),[OD,kD]=rn(wD,[DD]),[AD,jD]=OD(wD),MD=a.forwardRef($(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=$(()=>{},`onValueChange`),onValueCommit:m=$(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=a.useRef(new Set),y=a.useRef(0),b=a.useRef(!1),x=c===`horizontal`?FD:ID,[S,C]=a.useState(null),w=R(n,C),[T=[],E]=yr({prop:f,defaultProp:d,onChange:$(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=$(()=>E(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function k(e){M(e,eO(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=aO(s),a=gD(oO(Math.round((e-i)/s)*s+i,r),[i,o]);E((e=[])=>{let r=ZD(e,a,t);if(rO(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`),t(AD,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:c,form:g,children:t(TD.Provider,{scope:e.__scopeSlider,children:t(TD.Slot,{scope:e.__scopeSlider,children:t(x,{"aria-disabled":l,"data-disabled":l?``:void 0,..._,ref:w,onPointerDown:B(_.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=xD.includes(e.key)||e.shiftKey&&SD.includes(e.key)?10:1,r=y.current,a=T[r];M(sO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[ND,PD]=OD(wD,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),FD=a.forwardRef($(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=R(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=iO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),t(ND,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:t(LD,{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=CD[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),ID=a.forwardRef($(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=R(n,f),m=a.useRef(void 0),h=!o;function g(e){let t=m.current||f.current.getBoundingClientRect(),n=iO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),t(ND,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:t(LD,{"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=CD[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),LD=a.forwardRef($(function(e,n){let{__scopeSlider:r,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...u}=e,d=jD(wD,r);return t(H.span,{...u,ref:n,onKeyDown:B(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(c(e),e.preventDefault()):xD.concat(SD).includes(e.key)&&(l(e),e.preventDefault())}),onPointerDown:B(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:B(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:B(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},`SliderImpl`)),RD=`SliderTrack`,zD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=jD(RD,r);return t(H.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),BD=`SliderRange`,VD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,o=jD(BD,r),s=PD(BD,r),c=R(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>QD(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return t(H.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...i,ref:c,style:{...e.style,[s.startEdge]:d+`%`,[s.endEdge]:f+`%`}})},`SliderRange`)),[HD,UD]=OD(`SliderThumb`),WD=`SliderThumbProvider`;function GD(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=jD(WD,n),c=ED(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=Nn(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:QD(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 t(HD,{scope:n,..._,children:cO(o)?o(_):i})}$(GD,`SliderThumbProvider`);var KD=`SliderThumbTrigger`,qD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=jD(KD,r),o=PD(KD,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=UD(KD,r),f=R(n,d),p=$D(s,a.values.length),m=u?.[o.size],h=m?tO(m,l,o.direction):0;return t(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:t(TD.ItemSlot,{scope:r,children:t(H.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:B(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),JD=a.forwardRef($(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return t(GD,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>n(e,{children:[t(qD,{...s,ref:i,__scopeSlider:a}),o?t(XD,{__scopeSlider:a},r):null]})})},`SliderThumb`)),YD=`SliderBubbleInput`,XD=a.forwardRef($(function({__scopeSlider:e,...n},r){let{value:i,name:o,form:s}=UD(YD,e),c=a.useRef(null),l=R(c,r),u=yD(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]),t(H.input,{style:{display:`none`},name:o,form:s,...n,ref:l,defaultValue:i})},`SliderBubbleInput`));function ZD(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(ZD,`getNextSortedValues`);function QD(e,t,n){return gD(100/(n-t)*(e-t),[0,100])}$(QD,`convertValueToPercentage`);function $D(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$($D,`getLabel`);function eO(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)}$(eO,`getClosestValueIndex`);function tO(e,t,n){let r=e/2;return(r-iO([0,50],[0,r])(t)*n)*n}$(tO,`getThumbInBoundsOffset`);function nO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(nO,`getStepsBetweenValues`);function rO(e,t){if(t>0){let n=nO(e);return Math.min(...n)>=t}return!0}$(rO,`hasMinStepsBetweenValues`);function iO(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])}}$(iO,`linearScale`);function aO(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}$(aO,`getDecimalCount`);function oO(e,t){let n=10**t;return Math.round(e*n)/n}$(oO,`roundValue`);function sO(e,{min:t,step:n,direction:r,multiplier:i}){let a=aO(n),o=(e-t)/n,s=Math.round(o),c=oO(s*n+t,a)===oO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),oO(l*n+t,a)}$(sO,`getNextStepValue`);function cO(e){return typeof e==`function`}$(cO,`isFunction`);const lO=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(MD,{ref:p,"data-slot":`slider`,value:s,defaultValue:c,min:l,max:u,...f,className:z(`relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,e),children:[t(zD,{"data-slot":`slider-track`,className:z(`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(VD,{"data-slot":`slider-range`,className:z(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(JD,{"data-slot":`slider-thumb`,"aria-label":d,className:z(`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))]})});lO.displayName=MD.displayName;var uO=Object.defineProperty,dO=(e,t)=>uO(e,`name`,{value:t,configurable:!0}),fO=`Switch`,[pO,mO]=rn(fO),[hO,gO]=pO(fO);function _O(e){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=yr({prop:r,defaultProp:o??!1,onChange:u,caller:fO}),[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 t(hO,{scope:n,...C,children:TO(p)?p(C):i})}dO(_O,`SwitchProvider`);var vO=`SwitchTrigger`,yO=a.forwardRef(dO(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:_}=gO(vO,e),v=R(i,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=dO(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,p]),t(H.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":EO(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:v,onClick:B(n,e=>{h(),p(e=>!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`SwitchTrigger`)),bO=a.forwardRef(dO(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 t(_O,{__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})=>n(e,{children:[t(yO,{...m,ref:i,__scopeSwitch:a}),r&&t(wO,{__scopeSwitch:a})]})})},`Switch`)),xO=`SwitchThumb`,SO=a.forwardRef(dO(function(e,n){let{__scopeSwitch:r,...i}=e,a=gO(xO,r);return t(H.span,{"data-state":EO(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),CO=`SwitchBubbleInput`,wO=a.forwardRef(dO(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:_}=gO(CO,e),v=R(i,_),y=Nn(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 t(H.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:B(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function TO(e){return typeof e==`function`}dO(TO,`isFunction`);function EO(e){return e?`checked`:`unchecked`}dO(EO,`getState`);const DO={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 OO({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=DO[r],f=t(bO,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:z(`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(SO,{"data-slot":`switch-thumb`,className:z(`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:z(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}var kO=Object.defineProperty,AO=(e,t)=>kO(e,`name`,{value:t,configurable:!0}),jO=`Tabs`,[MO,NO]=rn(jO,[Yv]),PO=Yv(),[FO,IO]=MO(jO),LO=a.forwardRef(AO(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]=yr({prop:i,onChange:a,defaultProp:o??``,caller:jO});return t(FO,{scope:r,baseId:V(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:t(H.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),RO=`TabsList`,zO=a.forwardRef(AO(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=IO(RO,r),s=PO(r);return t(sy,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:t(H.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),BO=`TabsTrigger`,VO=a.forwardRef(AO(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=IO(BO,r),c=PO(r),l=WO(s.baseId,i),u=GO(s.baseId,i),d=i===s.value;return t(cy,{asChild:!0,...c,focusable:!a,active:d,children:t(H.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:B(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(i):e.preventDefault()}),onKeyDown:B(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:B(e.onFocus,()=>{let e=s.activationMode!==`manual`;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),HO=`TabsContent`,UO=a.forwardRef(AO(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=IO(HO,r),u=WO(l.baseId,i),d=GO(l.baseId,i),f=i===l.value,p=a.useRef(f);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),t(ar,{present:o||f,children:({present:r})=>t(H.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 WO(e,t){return`${e}-trigger-${t}`}AO(WO,`makeTriggerId`);function GO(e,t){return`${e}-content-${t}`}AO(GO,`makeContentId`);var KO=LO,qO=zO,JO=VO,YO=UO;const XO=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),ZO=({tabs:e,defaultValue:n,current:r,className:i,fullWidth:o,fullHeight:s,children:c,onTabChange:l,responsive:u=!1,variant:d=`tabs`,updateHash:f=!0,canChangeTab:p})=>{let m=a.useMemo(()=>e.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[e]),[h,g]=a.useState(()=>{let e=typeof r==`function`?r():r;if(e)return e;let t=window.location.hash,i=t?t.substring(1):void 0;return i&&m.some(e=>e.name===i)?i:n||m[0]?.name});a.useEffect(()=>{let e=typeof r==`function`?r():r;e&&e!==h&&g(e)},[r,h]),a.useEffect(()=>{if(r)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&m.some(e=>e.name===t)?g(t):!e&&n&&g(n)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[r,m,n]);let _=a.useCallback(e=>{if(!(e!==h&&p&&!p(e,h))){if(g(e),f&&!r){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}l&&l(e)}},[r,l,f,p,h]),v=a.useCallback(e=>{_(e)},[_]);return t(XO.Provider,{value:{tabs:m,size:o?m.length:0,current:h,setTab:v,responsive:u,variant:d,updateHash:f,canChangeTab:p},children:t(KO,{defaultValue:h||m[0]?.name,value:h,onValueChange:_,className:z(`flex-1 flex flex-col min-h-0 px-2`,s&&`h-full`,i),children:c})})},QO=({className:r,sticky:i,direction:o})=>{let{tabs:s,size:c,current:l,setTab:u,responsive:d,variant:f,updateHash:p,canChangeTab:m}=a.useContext(XO),h=c!==0,g=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(qT,{label:`Tab`,className:z(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=>{g(e.name)}})}),t(ek,{size:c,variant:f,className:z(h?`w-full`:``,i&&`sticky top-0 bg-background z-10`,o===`vertical`?`flex-col items-start border-b-0 mb-0`:`flex-row`,d?`hidden lg:flex`:``,r),children:s.map(e=>t(tk,{className:z(o===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:f,onClick:()=>g(e.name),children:e.label},e.name))})]})},$O=({className:n})=>{let{tabs:r}=a.useContext(XO);return r?t(e,{children:r.map(e=>t(nk,{value:e.name,className:n,children:e.content},e.name))}):null},ek=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(XO.Provider,{value:{size:n,variant:r},children:t(qO,{ref:a,className:z(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));ek.displayName=qO.displayName;const tk=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(XO),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(JO,{ref:o,className:z(r===`tabs`?z(`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`):z(`px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors`,`tborder border-input bg-muted shadow-xs hover:bg-muted ring-inset`,`data-[state=active]:bg-primary data-[state=active]:text-white data-[state=active]:shadow-sm`,`disabled:pointer-events-none disabled:opacity-50`),e,s?`w-1/${s}`:``),onClick:c,...i})});tk.displayName=JO.displayName;const nk=a.forwardRef(({className:e,...n},r)=>t(YO,{ref:r,className:z(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));nk.displayName=YO.displayName;const rk=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`}}),ik=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:z(rk({size:n,weight:r,className:e})),...i}));ik.displayName=`Text`;function ak({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:z(`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 ok=d({theme:`system`,setTheme:()=>null});function sk({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(e.classList.remove(`light`,`dark`),a===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(a)},[a]);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(ok.Provider,{...i,value:c,children:e})}const ck=()=>{let e=g(ok);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function lk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(U,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function uk({label:e,className:r}={}){let{setTheme:i,theme:a}=ck(),{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(lk,{current:a,option:`system`,setTheme:i,icon:t(Re,{}),alt:o(`theme.system`)}),t(lk,{current:a,option:`light`,setTheme:i,icon:t(Je,{}),alt:o(`theme.light`)}),t(lk,{current:a,option:`dark`,setTheme:i,icon:t(We,{}),alt:o(`theme.dark`)})]})]})}function dk(e,n){return{label:String(e),check:t(n?je:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function fk({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(jT,{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(dk(e,r),i)):i=dk(e,r),t(pk,{option:e,onSelect:g,layout:i,noCheck:l},`option-${n}`)})]})}function pk({option:e,onSelect:i,layout:a,noCheck:o}){return n(U,{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),onClick:()=>i(e),children:[o?null:t(`div`,{className:``,children:a.check}),t(`div`,{className:`flex-1`,children:a.label})]})}function mk({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(Tp,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(_h.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(_h.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(Ue,{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(hk,{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 hk({onClose:e}){return t(U,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(Xe,{className:`size-6`,"aria-hidden":`true`})})}function gk(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}`)}}function _k({size:e,className:i}){let a=gk(e||`md`);return 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 vk({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(_T),[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(bT,{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-foreground ring-1 ring-primary/30 rounded-md w-full transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),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(Xe,{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-foreground ring-1 ring-primary/30 rounded-md transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[e,t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(Xe,{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(ST,{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:zi(()=>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(U,{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 yk(e){return t(vT,{click:!0,children:t(vk,{...e})})}function bk({className:e,children:n,...i}){return t(`table`,{className:r(`
326
+ flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(bt,{size:16})})]})});nE.displayName=`Input`;const rE=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(UT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(GT,{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(qT,{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(nE,{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 iE({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,_=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:XT}),t(lT,{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=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:XT}),t(lT,{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=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 aE({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(Hv,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(QT,{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 oE({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(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 sE({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(nE,{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 cE(e,n,r){switch(e.type){case`date`:return t(ZT,{filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value.map(e=>e.value||``):[],isRange:e.multiple,setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t.length>0?t.map(e=>({value:e,label:Q(e).format(`LLL dd, y`)})):[]}:n))}});case`text`:return t(rE,{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(eE,{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($T,{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 lE({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}),cE(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(bt,{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 uE=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),dE=({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(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(hE(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(hE(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(uE.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},fE=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(uE),{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=>hE(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(zv,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(Hv,{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(UT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(GT,{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(nt,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(qT,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(Fv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(Lv,{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(Rv,{children:t(Bv,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(iE,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(sE,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(oE,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(aE,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},pE=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(uE);return t(`div`,{className:B(e),children:t(lE,{filters:n,setFilters:r,filterGroups:i})})},mE=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(uE),{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 hE(e){return typeof e==`string`?e:e.value||``}var gE;(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`})(gE||={});const _E=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})});_E.displayName=`Heading`;function vE({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`?yE(e,T)===yE(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`?yE(e,T)===yE(t,T):typeof T==`function`?T(e,t):ge(e,t),me=i||[];function he(e){return e?typeof e==`string`?t=>String(yE(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(Hv,{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(JT,{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=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`,children:[t(`div`,{className:`mx-2`,children:t(ft,{className:`size-4`})}),t(nE,{variant:`unstyled`,value:oe,onChange:se,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(Fv,{className:`overflow-hidden`,children:n(Rv,{className:E?`max-h-full overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(zv,{children:`No result found.`}),Se?Se.map(e=>t(Bv,{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(Bv,{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(mt,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),u]})})]});if(E)return t(`div`,{className:r(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(it,{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(UT,{onOpenChange:re,children:[n(`div`,{ref:F,className:r(`relative`,h),children:[t(GT,{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(it,{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(Ui,{description:k,placement:`top`,asChild:!0,children:t(vt,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?be():ye()]})]}),!d&&t(He,{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(bt,{className:`size-4`})})]}),t(qT,{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 yE(e,t){return typeof e==`object`&&e?e[t]:void 0}const bE={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 xE({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(vE,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>bE[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var SE=Object.defineProperty,CE=a.forwardRef(((e,t)=>SE(e,`name`,{value:t,configurable:!0}))(function(e,n){return 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 wE=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),TE=a.forwardRef(({className:e,required:r,...i},a)=>n(CE,{ref:a,className:B(wE(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive ms-1`,children:`*`})]}));TE.displayName=CE.displayName;function EE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(Ke,{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(vt,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(We,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(et,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(et,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(et,{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 DE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(EE,{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 OE({title:e,className:n,children:r}){return t(EE,{status:`info`,title:e,className:n,children:r})}function kE({title:e,className:n,children:r}){return t(EE,{status:`warning`,title:e,className:n,children:r})}function AE({title:e,className:n,children:r}){return t(EE,{status:`success`,title:e,className:n,children:r})}function jE({title:e,className:n,children:r}){return t(EE,{status:`default`,title:e,className:n,children:r})}function ME({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(Cv,{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(vt,{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(wv,{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(nE,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(Ev,{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 NE(){return g(PE)}const PE=d(()=>{}),FE={success:We,error:Ke,warning:vt,info:et},IE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function LE({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=FE[e.status]||et,u=IE[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(Xp,{onExitComplete:r,children:i&&t(Hh.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(bt,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function RE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(PE.Provider,{value:o,children:r}),i&&t(qh,{children:t(LE,{data:i,onClose:()=>o(null)})})]})}function zE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=NE();return t(ME,{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 BE=4,VE={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 UE({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(Yx,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(Zx,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(Le,{className:`ms-1 size-4`})]})}),t(Qx,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function WE({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=VE[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: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(Le,{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(UE,{label:h,triggerClassName:B(c.base,m?c.active:c.inactive),icon:t(Le,{className:c.icon}),children:p.map(e=>t(eS,{disabled:e.disabled,onClick:()=>i(e.name),className:B(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function GE({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?Le:Be,{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(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 KE=Object.defineProperty,qE=(e,t)=>KE(e,`name`,{value:t,configurable:!0}),JE=`Radio`,[YE,XE]=On(JE),[ZE,QE]=YE(JE);function $E(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:qE(()=>l?.(),`onCheck`)};return t(ZE,{scope:n,...b,children:oD(f)?f(b):i})}qE($E,`RadioProvider`);var eD=`RadioTrigger`,tD=a.forwardRef(qE(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}=QE(eD,e),m=z(i,c);return t(U.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":sD(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`)),nD=`RadioIndicator`,rD=a.forwardRef(qE(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=QE(nD,r);return t(kr,{present:i||o.checked,children:t(U.span,{"data-state":sD(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),iD=`RadioBubbleInput`,aD=a.forwardRef(qE(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}=QE(iD,e),_=z(i,m),v=rr(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 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 oD(e){return typeof e==`function`}qE(oD,`isFunction`);function sD(e){return e?`checked`:`unchecked`}qE(sD,`getState`);var cD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],lD=`RadioGroup`,[uD,dD]=On(lD,[by,XE]),fD=by(),pD=XE(),[mD,hD]=uD(lD),gD=a.forwardRef(qE(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=fD(r),_=fe(f),[v,y]=Ur({prop:c,defaultProp:s??null,onChange:m,caller:lD}),[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=qE(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),t(mD,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:t(My,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:t(U.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),_D=`RadioGroupItemProvider`,vD=`RadioGroupItemTrigger`;function yD(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=hD(_D,n),c=pD(n),l=s.disabled||i;return t($E,{...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})}qE(yD,`RadioGroupItemProvider`);var bD=a.forwardRef(qE(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=fD(r),s=pD(r),{checked:c,disabled:l}=QE(vD,s.__scopeRadio),u=a.useRef(null),d=z(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=qE(e=>{cD.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=qE(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),t(Ny,{asChild:!0,...o,focusable:!l,active:c,children:t(tD,{...s,...i,ref:d,onKeyDown:V(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:V(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),xD=a.forwardRef(qE(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return t(yD,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(bD,{...c,ref:i,__scopeRadioGroup:a}),r&&t(SD,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),SD=a.forwardRef(qE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=pD(r);return t(aD,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),CD=a.forwardRef(qE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=pD(r);return t(rD,{...a,...i,ref:n})},`RadioGroupIndicator`));function wD({className:e,...n}){return t(xD,{"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(CD,{"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 TD=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function ED({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(gD,{"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(xD,{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 DD({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 OD(e){return typeof e==`number`?`${e}%`:e}function kD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:OD(e),minSize:OD(n),maxSize:OD(r),collapsedSize:OD(i),...a})}function AD({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(ot,{className:`size-4 rotate-90`})})})}var jD=Object.defineProperty,MD=(e,t)=>jD(e,`name`,{value:t,configurable:!0}),ND=`horizontal`,PD=[`horizontal`,`vertical`],FD=a.forwardRef(MD(function(e,n){let{decorative:r,orientation:i=ND,...a}=e,o=ID(i)?i:ND,s=r?{role:`none`}:{"aria-orientation":o===`vertical`?o:void 0,role:`separator`};return t(U.div,{"data-orientation":o,...s,...a,ref:n})},`Separator`));function ID(e){return PD.includes(e)}MD(ID,`isValidOrientation`);var LD=FD;const RD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(LD,{ref:a,decorative:r,orientation:n,className:B(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));RD.displayName=LD.displayName;var zD=Object.defineProperty,BD=(e,t)=>zD(e,`name`,{value:t,configurable:!0});function VD(e,[t,n]){return Math.min(n,Math.max(t,e))}BD(VD,`clamp`);var HD=Object.defineProperty,UD=(e,t)=>HD(e,`name`,{value:t,configurable:!0});function WD(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])}UD(WD,`usePrevious`);var GD=Object.defineProperty,$=(e,t)=>GD(e,`name`,{value:t,configurable:!0}),KD=[`PageUp`,`PageDown`],qD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],JD={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},YD=`Slider`,[XD,ZD,QD]=Kv(YD),[$D,eO]=On(YD,[QD]),[tO,nO]=$D(YD),rO=a.forwardRef($(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=$(()=>{},`onValueChange`),onValueCommit:m=$(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=a.useRef(new Set),y=a.useRef(0),b=a.useRef(!1),x=c===`horizontal`?oO:sO,[S,C]=a.useState(null),w=z(n,C),[T=[],E]=Ur({prop:f,defaultProp:d,onChange:$(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=$(()=>E(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function k(e){M(e,TO(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=AO(s),a=VD(jO(Math.round((e-i)/s)*s+i,r),[i,o]);E((e=[])=>{let r=SO(e,a,t);if(OO(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`),t(tO,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:c,form:g,children:t(XD.Provider,{scope:e.__scopeSlider,children:t(XD.Slot,{scope:e.__scopeSlider,children: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=KD.includes(e.key)||e.shiftKey&&qD.includes(e.key)?10:1,r=y.current,a=T[r];M(MO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[iO,aO]=$D(YD,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),oO=a.forwardRef($(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=kO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),t(iO,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:t(cO,{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=JD[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),sO=a.forwardRef($(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=kO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),t(iO,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:t(cO,{"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=JD[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),cO=a.forwardRef($(function(e,n){let{__scopeSlider:r,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...u}=e,d=nO(YD,r);return 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()):KD.concat(qD).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`)),lO=`SliderTrack`,uO=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=nO(lO,r);return t(U.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),dO=`SliderRange`,fO=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,o=nO(dO,r),s=aO(dO,r),c=z(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>CO(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return 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`)),[pO,mO]=$D(`SliderThumb`),hO=`SliderThumbProvider`;function gO(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=nO(hO,n),c=ZD(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=rr(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:CO(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 t(pO,{scope:n,..._,children:NO(o)?o(_):i})}$(gO,`SliderThumbProvider`);var _O=`SliderThumbTrigger`,vO=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=nO(_O,r),o=aO(_O,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=mO(_O,r),f=z(n,d),p=wO(s,a.values.length),m=u?.[o.size],h=m?EO(m,l,o.direction):0;return t(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:t(XD.ItemSlot,{scope:r,children: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`)),yO=a.forwardRef($(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return t(gO,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>n(e,{children:[t(vO,{...s,ref:i,__scopeSlider:a}),o?t(xO,{__scopeSlider:a},r):null]})})},`SliderThumb`)),bO=`SliderBubbleInput`,xO=a.forwardRef($(function({__scopeSlider:e,...n},r){let{value:i,name:o,form:s}=mO(bO,e),c=a.useRef(null),l=z(c,r),u=WD(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]),t(U.input,{style:{display:`none`},name:o,form:s,...n,ref:l,defaultValue:i})},`SliderBubbleInput`));function SO(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(SO,`getNextSortedValues`);function CO(e,t,n){return VD(100/(n-t)*(e-t),[0,100])}$(CO,`convertValueToPercentage`);function wO(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(wO,`getLabel`);function TO(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)}$(TO,`getClosestValueIndex`);function EO(e,t,n){let r=e/2;return(r-kO([0,50],[0,r])(t)*n)*n}$(EO,`getThumbInBoundsOffset`);function DO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(DO,`getStepsBetweenValues`);function OO(e,t){if(t>0){let n=DO(e);return Math.min(...n)>=t}return!0}$(OO,`hasMinStepsBetweenValues`);function kO(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])}}$(kO,`linearScale`);function AO(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}$(AO,`getDecimalCount`);function jO(e,t){let n=10**t;return Math.round(e*n)/n}$(jO,`roundValue`);function MO(e,{min:t,step:n,direction:r,multiplier:i}){let a=AO(n),o=(e-t)/n,s=Math.round(o),c=jO(s*n+t,a)===jO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),jO(l*n+t,a)}$(MO,`getNextStepValue`);function NO(e){return typeof e==`function`}$(NO,`isFunction`);const PO=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(rO,{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(uO,{"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(fO,{"data-slot":`slider-range`,className:B(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(yO,{"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))]})});PO.displayName=rO.displayName;var FO=Object.defineProperty,IO=(e,t)=>FO(e,`name`,{value:t,configurable:!0}),LO=`Switch`,[RO,zO]=On(LO),[BO,VO]=RO(LO);function HO(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]=Ur({prop:r,defaultProp:o??!1,onChange:u,caller:LO}),[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 t(BO,{scope:n,...C,children:XO(p)?p(C):i})}IO(HO,`SwitchProvider`);var UO=`SwitchTrigger`,WO=a.forwardRef(IO(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:_}=VO(UO,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=IO(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,p]),t(U.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":ZO(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`)),GO=a.forwardRef(IO(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 t(HO,{__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})=>n(e,{children:[t(WO,{...m,ref:i,__scopeSwitch:a}),r&&t(YO,{__scopeSwitch:a})]})})},`Switch`)),KO=`SwitchThumb`,qO=a.forwardRef(IO(function(e,n){let{__scopeSwitch:r,...i}=e,a=VO(KO,r);return t(U.span,{"data-state":ZO(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),JO=`SwitchBubbleInput`,YO=a.forwardRef(IO(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:_}=VO(JO,e),v=z(i,_),y=rr(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 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 XO(e){return typeof e==`function`}IO(XO,`isFunction`);function ZO(e){return e?`checked`:`unchecked`}IO(ZO,`getState`);const QO={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 $O({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=QO[r],f=t(GO,{"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(qO,{"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 ek=Object.defineProperty,tk=(e,t)=>ek(e,`name`,{value:t,configurable:!0}),nk=`Tabs`,[rk,ik]=On(nk,[by]),ak=by(),[ok,sk]=rk(nk),ck=a.forwardRef(tk(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]=Ur({prop:i,onChange:a,defaultProp:o??``,caller:nk});return t(ok,{scope:r,baseId:H(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:t(U.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),lk=`TabsList`,uk=a.forwardRef(tk(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=sk(lk,r),s=ak(r);return t(My,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:t(U.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),dk=`TabsTrigger`,fk=a.forwardRef(tk(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=sk(dk,r),c=ak(r),l=hk(s.baseId,i),u=gk(s.baseId,i),d=i===s.value;return t(Ny,{asChild:!0,...c,focusable:!a,active:d,children: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`)),pk=`TabsContent`,mk=a.forwardRef(tk(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=sk(pk,r),u=hk(l.baseId,i),d=gk(l.baseId,i),f=i===l.value,p=a.useRef(f);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),t(kr,{present:o||f,children:({present:r})=>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 hk(e,t){return`${e}-trigger-${t}`}tk(hk,`makeTriggerId`);function gk(e,t){return`${e}-content-${t}`}tk(gk,`makeContentId`);var _k=ck,vk=uk,yk=fk,bk=mk;const xk=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),Sk=({tabs:e,defaultValue:n,current:r,className:i,fullWidth:o,fullHeight:s,children:c,onTabChange:l,responsive:u=!1,variant:d=`tabs`,updateHash:f=!0,canChangeTab:p})=>{let m=a.useMemo(()=>e.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[e]),[h,g]=a.useState(()=>{let e=typeof r==`function`?r():r;if(e)return e;let t=window.location.hash,i=t?t.substring(1):void 0;return i&&m.some(e=>e.name===i)?i:n||m[0]?.name});a.useEffect(()=>{let e=typeof r==`function`?r():r;e&&e!==h&&g(e)},[r,h]),a.useEffect(()=>{if(r)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&m.some(e=>e.name===t)?g(t):!e&&n&&g(n)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[r,m,n]);let _=a.useCallback(e=>{if(e===h||!p||p(e,h)){if(g(e),f&&!r){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}l&&l(e)}},[r,l,f,p,h]),v=a.useCallback(e=>{_(e)},[_]);return t(xk.Provider,{value:{tabs:m,size:o?m.length:0,current:h,setTab:v,responsive:u,variant:d,updateHash:f,canChangeTab:p},children:t(_k,{defaultValue:h||m[0]?.name,value:h,onValueChange:_,className:B(`flex-1 flex flex-col min-h-0 px-2`,s&&`h-full`,i),children:c})})},Ck=({className:r,sticky:i,direction:o})=>{let{tabs:s,size:c,current:l,setTab:u,responsive:d,variant:f,updateHash:p,canChangeTab:m}=a.useContext(xk),h=c!==0,g=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(vE,{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=>{g(e.name)}})}),t(Tk,{size:c,variant:f,className:B(h?`w-full`:``,i&&`sticky top-0 bg-background z-10`,o===`vertical`?`flex-col items-start border-b-0 mb-0`:`flex-row`,d?`hidden lg:flex`:``,r),children:s.map(e=>t(Ek,{className:B(o===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:f,onClick:()=>g(e.name),children:e.label},e.name))})]})},wk=({className:n})=>{let{tabs:r}=a.useContext(xk);return r?t(e,{children:r.map(e=>t(Dk,{value:e.name,className:n,children:e.content},e.name))}):null},Tk=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(xk.Provider,{value:{size:n,variant:r},children:t(vk,{ref:a,className:B(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));Tk.displayName=vk.displayName;const Ek=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(xk),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(yk,{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`,`tborder border-input bg-muted shadow-xs hover:bg-muted ring-inset`,`data-[state=active]:bg-primary data-[state=active]:text-white data-[state=active]:shadow-sm`,`disabled:pointer-events-none disabled:opacity-50`),e,s?`w-1/${s}`:``),onClick:c,...i})});Ek.displayName=yk.displayName;const Dk=a.forwardRef(({className:e,...n},r)=>t(bk,{ref:r,className:B(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));Dk.displayName=bk.displayName;const Ok=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`}}),kk=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:B(Ok({size:n,weight:r,className:e})),...i}));kk.displayName=`Text`;function Ak({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 jk=d({theme:`system`,setTheme:()=>null});function Mk({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(e.classList.remove(`light`,`dark`),a===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(a)},[a]);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(jk.Provider,{...i,value:c,children:e})}const Nk=()=>{let e=g(jk);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function Pk({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 Fk({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(Pk,{current:a,option:`system`,setTheme:i,icon:t(Je,{}),alt:o(`theme.system`)}),t(Pk,{current:a,option:`light`,setTheme:i,icon:t(gt,{}),alt:o(`theme.light`)}),t(Pk,{current:a,option:`dark`,setTheme:i,icon:t(ct,{}),alt:o(`theme.dark`)})]})]})}function Ik(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 Lk({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(nE,{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(Ik(e,r),i)):i=Ik(e,r),t(Rk,{option:e,onSelect:g,layout:i,noCheck:l},`option-${n}`)})]})}function Rk({option:e,onSelect:i,layout:a,noCheck:o}){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),onClick:()=>i(e),children:[o?null:t(`div`,{className:``,children:a.check}),t(`div`,{className:`flex-1`,children:a.label})]})}function zk({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(Xp,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(Hh.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(Hh.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(ot,{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(Bk,{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 Bk({onClose:e}){return t(W,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(bt,{className:`size-6`,"aria-hidden":`true`})})}function Vk(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}`)}}function Hk({size:e,className:i}){let a=Vk(e||`md`);return 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 Uk({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())),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(GT,{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-foreground ring-1 ring-primary/30 rounded-md w-full transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),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(bt,{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-foreground ring-1 ring-primary/30 rounded-md transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[e,t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(bt,{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(qT,{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:la(()=>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 Wk(e){return t(UT,{click:!0,children:t(Uk,{...e})})}function Gk({className:e,children:n,...i}){return t(`table`,{className:r(`
285
327
  divide-y divide-border
286
328
  [&>tbody]:divide-y [&>tbody]:divide-border
287
329
  [&_th]:text-start [&_th]:px-3 [&_th]:py-3.5 [&_th]:text-sm [&_th]:font-normal [&_th]:text-muted
288
330
  [&_td]:px-3 [&_td]:py-4 [&_td]:text-sm
289
- `,e),...i,children:n})}function xk({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 Sk({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 Ck({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(Sk,{columns:n},e)):i})}function wk({className:e,children:n,...i}){return t(`tr`,{className:r(`hover:bg-muted hover:cursor-pointer`,e),...i,children:n})}function Tk({scope:e=`col`,children:n,...r}){return t(`th`,{scope:e,...r,children:n})}function Ek({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 Dk=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 Ok(e){let t=o.createContext(void 0);return e.Context=t,t.Provider}var kk=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 Ak(e){let t=e.Context;if(!t)throw Error(`Context not defined for ${e.name}`);return g(t)}function jk(e){let[t,n]=w(e.value);return _(()=>e.watch(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Mk(e,t){return _(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function Nk(e,t){_(()=>e.watch(t),[e,t])}function Pk(e){let[t,n]=w(e.current);return _(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function Fk(e,t){_(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function Ik(e,t){_(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}var Lk=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=[]}},Rk=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 zk(e){let[t,n]=w(e.value);return _(()=>e.addWatcher(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function Bk(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 Vk(){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 Hk(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 Uk(e,t){let[n,r]=w(e);return _(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function Wk(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 Gk(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=Wk(e,a,o))}):t=Wk(e,a,o),()=>{n=!0,t?.()}},[e])}function Kk(e){return e instanceof Error?e:Error(String(e))}function qk(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=Kk(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 Jk(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),qk(e,t)}function Yk(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 Xk(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 Zk(){let e=C(!0);return _(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const Qk=typeof window<`u`?x:_;function $k(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]),Xk(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 eA(e,t=[]){return $k({...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 tA=class{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}};function nA(e){return new tA(w(e))}function rA(...e){return j(i(e))}function iA(e){return typeof e==`object`&&!!e&&`message`in e}function aA(e,t=`An error occurred`){return e instanceof Error?e.message:typeof e==`string`?e:iA(e)&&typeof e.message==`string`?e.message:t}function oA(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{Ux as AnimateChangeInHeight,ye as Avatar,Vi as Badge,Ch as Breadcrumbs,U as Button,Mh as Card,Ih as CardContent,Fh as CardDescription,Lh as CardFooter,Nh as CardHeader,Ph as CardTitle,xe as Center,ng as Checkbox,bg as Collapsible,Sg as CollapsibleContent,xg as CollapsibleTrigger,_t as ComboBox,uv as Command,dv as CommandDialog,mv as CommandEmpty,hv as CommandGroup,fv as CommandInput,_v as CommandItem,pv as CommandList,gv as CommandSeparator,vv as CommandShortcut,Lk as ComputedProperty,sE as ConfirmModal,wi as CopyButton,ut as DOMPopup,ET as DateCombobox,oE as DefaultBox,mE as DeleteModal,nv as Dialog,av as DialogClose,sv as DialogContent,cv as DialogDescription,ov as DialogOverlay,iv as DialogPortal,lv as DialogTitle,rv as DialogTrigger,Et as Divider,Wi as DotBadge,Ai as DropZone,Bx as Dropdown,wx as DropdownMenu,Ax as DropdownMenuCheckboxItem,Dx as DropdownMenuContent,Ox as DropdownMenuGroup,kx as DropdownMenuItem,Nx as DropdownMenuLabel,Tx as DropdownMenuPortal,jx as DropdownMenuRadioGroup,Mx as DropdownMenuRadioItem,Px as DropdownMenuSeparator,Fx as DropdownMenuShortcut,Ix as DropdownMenuSub,Rx as DropdownMenuSubContent,Lx as DropdownMenuSubTrigger,Ex as DropdownMenuTrigger,Ti as EmptyCollection,nE as ErrorBox,ki as FileUploadInput,HT as FilterBar,VT as FilterBtn,UT as FilterClear,GT as FilterOperator,BT as FilterProvider,Ri as FormItem,KT as Heading,rE as InfoBox,Fi as InfoTip,jT as Input,Gi as InputList,eE as Label,XT as LanguageSwitcher,Ki as Link,Vx as MenuGroup,Hx as MenuItem,qi as MenuList,tE as MessageBox,Q_ as Modal,ev as ModalBody,Z_ as ModalContextProvider,tv as ModalFooter,$_ as ModalTitle,lk as ModeOption,uk as ModeToggle,Zi as NumberInput,hE as OVERFLOW_TAB_GAP_PX,pt as OptionAdapter,vE as OverflowMoreMenu,yE as OverflowTabsBar,vh as Overlay,bE as Panel,vT as Popover,xT as PopoverAnchor,CT as PopoverClose,ST as PopoverContent,_T as PopoverContext,bT as PopoverTrigger,dt as Popup,st as PopupController,Sh as Portal,di as PortalContainerContext,pi as PortalContainerProvider,Dk as Property,tD as RadioGroup,eD as RadioGroupAdapter,$E as RadioGroupItem,aD as ResizableHandle,iD as ResizablePanel,nD as ResizablePanelGroup,Sk as RowSkeleton,qT as SelectBox,fk as SelectList,OT as SelectionCombobox,pD as Separator,Rk as SharedState,tA as SharedValue,mk as SidePanel,Tt as SimpleCombobox,lO as Slider,kk as Slot,Ek as SortableTableHeaderCell,_k as Spinner,kT as StringListCombobox,mt as StringOptionAdapter,ht as StringOptionAdapterWithCreate,Yi as Styles,aE as SuccessBox,be as SvgAvatar,OO as Switch,Ck as TBody,xk as THead,wk as TR,bk as Table,Tk as TableHeaderCell,ZO as Tabs,QO as TabsBar,nk as TabsContent,ek as TabsList,$O as TabsPanel,tk as TabsTrigger,yk as TagsInput,ik as Text,MT as TextCombobox,ak as Textarea,sk as ThemeProvider,ok as ThemeProviderContext,lE as ToastContext,pE as ToastProvider,gi as Tooltip,vi as TooltipContent,hi as TooltipProvider,_i as TooltipTrigger,yi as VTooltip,iE as WarningBox,Ci as buttonVariants,rA as cn,nt as computePosition,Ok as createCompositeStateProvider,aA as errorMessage,gt as getDefaultComboBoxLayout,oA as insertNewlineAtCursor,zi as onActivateKey,Bk as useClickOutside,xt as useComboboxCtrl,Ak as useCompositeState,Vk as useCopyToClipboard,Hk as useDarkMode,Uk as useDebounce,eA as useDefaultScrollableSearch,Ik as useDefineSlot,Pi as useDropZone,Gk as useEventSource,qk as useFetch,Jk as useFetchOnce,Yk as useFlag,jk as useGetCompositeStateProperty,Xk as useIntersectionObserver,Zk as useIsFirstRendering,X_ as useIsInModal,_E as useOverflowTabs,wT as usePopoverContext,lt as usePopupController,mi as usePortalContainer,Qk as useSafeLayoutEffect,$k as useScrollableSearch,Mk as useSetCompositeStateProperty,nA as useSharedValue,Pk as useSlot,ck as useTheme,cE as useToast,Nk as useWatchCompositeStateProperty,zk as useWatchSharedState,Fk as useWatchSlot};
331
+ `,e),...i,children:n})}function Kk({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 qk({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 Jk({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(qk,{columns:n},e)):i})}function Yk({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 Zk({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 Qk=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 $k(e){let t=o.createContext(void 0);return e.Context=t,t.Provider}var eA=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 tA(e){let t=e.Context;if(!t)throw Error(`Context not defined for ${e.name}`);return g(t)}function nA(e){let[t,n]=w(e.value);return _(()=>e.watch(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function rA(e,t){return _(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function iA(e,t){_(()=>e.watch(t),[e,t])}function aA(e){let[t,n]=w(e.current);return _(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function oA(e,t){_(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function sA(e,t){_(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}var cA=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=[]}},lA=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 uA(e){let[t,n]=w(e.value);return _(()=>e.addWatcher(e=>{n(typeof e==`function`?()=>e:e)}),[e]),t}function dA(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 fA(){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 pA(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 mA(e,t){let[n,r]=w(e);return _(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function hA(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 gA(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=hA(e,a,o))}):t=hA(e,a,o),()=>{n=!0,t?.()}},[e])}function _A(e){return e instanceof Error?e:Error(String(e))}function vA(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=_A(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 yA(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),vA(e,t)}function bA(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 xA(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 SA(){let e=C(!0);return _(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const CA=typeof window<`u`?x:_;function wA(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]),xA(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 TA(e,t=[]){return wA({...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 EA=class{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}};function DA(e){return new EA(w(e))}function OA(...e){return j(i(e))}function kA(e){return typeof e==`object`&&!!e&&`message`in e}function AA(e,t=`An error occurred`){return e instanceof Error?e.message:typeof e==`string`?e:kA(e)&&typeof e.message==`string`?e.message:t}function jA(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{mS as AnimateChangeInHeight,ye as Avatar,da as Badge,Jh as Breadcrumbs,W as Button,rg as Card,sg as CardContent,og as CardDescription,cg as CardFooter,ig as CardHeader,ag as CardTitle,xe as Center,Dg as Checkbox,Gg as Collapsible,qg as CollapsibleContent,Kg as CollapsibleTrigger,Vt as ComboBox,Fv as Command,Iv as CommandDialog,zv as CommandEmpty,Bv as CommandGroup,Lv as CommandInput,Hv as CommandItem,Rv as CommandList,Vv as CommandSeparator,Uv as CommandShortcut,cA as ComputedProperty,ME as ConfirmModal,Ji as CopyButton,Pt as DOMPopup,ZT as DateCombobox,jE as DefaultBox,zE as DeleteModal,Dv as Dialog,Av as DialogClose,Mv as DialogContent,Nv as DialogDescription,jv as DialogOverlay,kv as DialogPortal,Pv as DialogTitle,Ov as DialogTrigger,Xt as Divider,ma as DotBadge,ea as DropZone,dS as Dropdown,Yx as DropdownMenu,tS as DropdownMenuCheckboxItem,Qx as DropdownMenuContent,$x as DropdownMenuGroup,eS as DropdownMenuItem,iS as DropdownMenuLabel,Xx as DropdownMenuPortal,nS as DropdownMenuRadioGroup,rS as DropdownMenuRadioItem,aS as DropdownMenuSeparator,oS as DropdownMenuShortcut,sS as DropdownMenuSub,lS as DropdownMenuSubContent,cS as DropdownMenuSubTrigger,Zx as DropdownMenuTrigger,Yi as EmptyCollection,DE as ErrorBox,$i as FileUploadInput,pE as FilterBar,fE as FilterBtn,mE as FilterClear,gE as FilterOperator,dE as FilterProvider,ca as FormItem,_E as Heading,OE as InfoBox,aa as InfoTip,nE as Input,ha as InputList,TE as Label,xE as LanguageSwitcher,ga as Link,fS as MenuGroup,pS as MenuItem,_a as MenuList,EE as MessageBox,Cv as Modal,Tv as ModalBody,Sv as ModalContextProvider,Ev as ModalFooter,wv as ModalTitle,Pk as ModeOption,Fk as ModeToggle,xa as NumberInput,BE as OVERFLOW_TAB_GAP_PX,Lt as OptionAdapter,UE as OverflowMoreMenu,WE as OverflowTabsBar,Uh as Overlay,GE as Panel,UT as Popover,KT as PopoverAnchor,JT as PopoverClose,qT as PopoverContent,HT as PopoverContext,GT as PopoverTrigger,Ft as Popup,jt as PopupController,qh as Portal,Fi as PortalContainerContext,Li as PortalContainerProvider,Qk as Property,ED as RadioGroup,TD as RadioGroupAdapter,wD as RadioGroupItem,AD as ResizableHandle,kD as ResizablePanel,DD as ResizablePanelGroup,qk as RowSkeleton,vE as SelectBox,Lk as SelectList,$T as SelectionCombobox,RD as Separator,lA as SharedState,EA as SharedValue,zk as SidePanel,Yt as SimpleCombobox,PO as Slider,eA as Slot,Zk as SortableTableHeaderCell,Hk as Spinner,eE as StringListCombobox,Rt as StringOptionAdapter,zt as StringOptionAdapterWithCreate,ya as Styles,AE as SuccessBox,be as SvgAvatar,$O as Switch,Jk as TBody,Kk as THead,Yk as TR,Gk as Table,Xk as TableHeaderCell,Sk as Tabs,Ck as TabsBar,Dk as TabsContent,Tk as TabsList,wk as TabsPanel,Ek as TabsTrigger,Wk as TagsInput,kk as Text,rE as TextCombobox,Ak as Textarea,Mk as ThemeProvider,jk as ThemeProviderContext,PE as ToastContext,RE as ToastProvider,Bi as Tooltip,Hi as TooltipContent,zi as TooltipProvider,Vi as TooltipTrigger,Ui as VTooltip,kE as WarningBox,qi as buttonVariants,OA as cn,Et as computePosition,$k as createCompositeStateProvider,AA as errorMessage,Bt as getDefaultComboBoxLayout,jA as insertNewlineAtCursor,la as onActivateKey,dA as useClickOutside,Gt as useComboboxCtrl,tA as useCompositeState,fA as useCopyToClipboard,pA as useDarkMode,mA as useDebounce,TA as useDefaultScrollableSearch,sA as useDefineSlot,ia as useDropZone,gA as useEventSource,vA as useFetch,yA as useFetchOnce,bA as useFlag,nA as useGetCompositeStateProperty,xA as useIntersectionObserver,SA as useIsFirstRendering,xv as useIsInModal,HE as useOverflowTabs,YT as usePopoverContext,Nt as usePopupController,Ri as usePortalContainer,CA as useSafeLayoutEffect,wA as useScrollableSearch,rA as useSetCompositeStateProperty,DA as useSharedValue,aA as useSlot,Nk as useTheme,NE as useToast,iA as useWatchCompositeStateProperty,uA as useWatchSharedState,oA as useWatchSlot};
290
332
  //# sourceMappingURL=vertesia-ui-core.js.map