zudoku 0.3.0-dev.2 → 0.3.0-dev.20

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 (220) hide show
  1. package/dist/app/App.js +11 -8
  2. package/dist/app/App.js.map +1 -1
  3. package/dist/config/config.d.ts +8 -15
  4. package/dist/lib/authentication/authentication.d.ts +2 -2
  5. package/dist/lib/authentication/hook.d.ts +1 -0
  6. package/dist/lib/authentication/hook.js +1 -0
  7. package/dist/lib/authentication/hook.js.map +1 -1
  8. package/dist/lib/authentication/providers/auth0.js +1 -0
  9. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  10. package/dist/lib/authentication/providers/clerk.js +2 -0
  11. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  12. package/dist/lib/authentication/providers/openid.js +2 -0
  13. package/dist/lib/authentication/providers/openid.js.map +1 -1
  14. package/dist/lib/authentication/state.d.ts +1 -0
  15. package/dist/lib/authentication/state.js +1 -0
  16. package/dist/lib/authentication/state.js.map +1 -1
  17. package/dist/lib/components/DevPortal.d.ts +2 -20
  18. package/dist/lib/components/DevPortal.js +13 -9
  19. package/dist/lib/components/DevPortal.js.map +1 -1
  20. package/dist/lib/components/Header.js +4 -4
  21. package/dist/lib/components/Header.js.map +1 -1
  22. package/dist/lib/components/Heading.d.ts +9 -4
  23. package/dist/lib/components/Heading.js +17 -2
  24. package/dist/lib/components/Heading.js.map +1 -1
  25. package/dist/lib/components/Layout.js +1 -1
  26. package/dist/lib/components/Layout.js.map +1 -1
  27. package/dist/lib/components/SyntaxHighlight.js +5 -1
  28. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  29. package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
  30. package/dist/lib/components/context/DevPortalProvider.js +2 -2
  31. package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
  32. package/dist/lib/components/index.d.ts +2 -0
  33. package/dist/lib/components/index.js +2 -0
  34. package/dist/lib/components/index.js.map +1 -1
  35. package/dist/lib/core/DevPortalContext.d.ts +33 -3
  36. package/dist/lib/core/DevPortalContext.js +8 -4
  37. package/dist/lib/core/DevPortalContext.js.map +1 -1
  38. package/dist/lib/core/plugins.d.ts +7 -4
  39. package/dist/lib/core/plugins.js +1 -0
  40. package/dist/lib/core/plugins.js.map +1 -1
  41. package/dist/lib/oas/graphql/index.js +1 -1
  42. package/dist/lib/oas/graphql/index.js.map +1 -1
  43. package/dist/lib/oas/parser/index.js +3 -1
  44. package/dist/lib/oas/parser/index.js.map +1 -1
  45. package/dist/lib/plugins/api-keys/CreateApiKey.d.ts +4 -0
  46. package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +1 -1
  47. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
  48. package/dist/lib/plugins/api-keys/SettingsApiKeys.d.ts +4 -0
  49. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +38 -0
  50. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
  51. package/dist/lib/plugins/api-keys/index.js +94 -0
  52. package/dist/lib/plugins/api-keys/index.js.map +1 -0
  53. package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
  54. package/dist/lib/plugins/markdown/MdxPage.js +5 -4
  55. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  56. package/dist/lib/plugins/markdown/generateRoutes.d.ts +2 -2
  57. package/dist/lib/plugins/markdown/generateRoutes.js +2 -2
  58. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  59. package/dist/lib/plugins/markdown/index.d.ts +4 -1
  60. package/dist/lib/plugins/markdown/index.js +2 -2
  61. package/dist/lib/plugins/markdown/index.js.map +1 -1
  62. package/dist/lib/plugins/openapi/OperationList.js +4 -3
  63. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  64. package/dist/lib/plugins/openapi/OperationListItem.js +8 -4
  65. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  66. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  67. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  68. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  69. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  70. package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +1 -1
  71. package/dist/lib/plugins/openapi/{MakeRequest.js → PlaygroundDialogWrapper.js} +4 -4
  72. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
  73. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +1 -9
  74. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  75. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
  76. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  77. package/dist/lib/plugins/openapi/SchemaListView.js +4 -26
  78. package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
  79. package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
  80. package/dist/lib/plugins/openapi/SchemaListViewItem.js +16 -0
  81. package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
  82. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
  83. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
  84. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
  85. package/dist/lib/plugins/openapi/Sidecar.js +10 -8
  86. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  87. package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
  88. package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
  89. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
  90. package/dist/lib/plugins/openapi/index.js +8 -0
  91. package/dist/lib/plugins/openapi/index.js.map +1 -1
  92. package/dist/lib/plugins/openapi/playground/Headers.d.ts +2 -3
  93. package/dist/lib/plugins/openapi/playground/Headers.js +16 -6
  94. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  95. package/dist/lib/plugins/openapi/playground/Playground.d.ts +4 -3
  96. package/dist/lib/plugins/openapi/playground/Playground.js +8 -12
  97. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  98. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -0
  99. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +10 -0
  100. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
  101. package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
  102. package/dist/lib/plugins/openapi/util/prose.js +4 -0
  103. package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
  104. package/dist/lib/plugins/openapi/worker/worker.js +25 -1
  105. package/dist/lib/plugins/openapi/worker/worker.js.map +1 -1
  106. package/dist/lib/ui/button-variants.d.ts +1 -1
  107. package/dist/lib/util/MdxComponents.js +1 -1
  108. package/dist/lib/util/MdxComponents.js.map +1 -1
  109. package/dist/lib/util/objectEntries.d.ts +4 -0
  110. package/dist/lib/util/objectEntries.js +2 -0
  111. package/dist/lib/util/objectEntries.js.map +1 -0
  112. package/dist/lib/util/renderIf.d.ts +1 -0
  113. package/dist/lib/util/renderIf.js +2 -0
  114. package/dist/lib/util/renderIf.js.map +1 -0
  115. package/dist/vite/config.js +1 -2
  116. package/dist/vite/config.js.map +1 -1
  117. package/dist/vite/config.test.js +1 -1
  118. package/dist/vite/config.test.js.map +1 -1
  119. package/dist/vite/dev-server.js +1 -1
  120. package/dist/vite/dev-server.js.map +1 -1
  121. package/dist/vite/plugin-api-keys.js +2 -2
  122. package/dist/vite/plugin-api-keys.js.map +1 -1
  123. package/dist/vite/plugin-api.js +3 -3
  124. package/dist/vite/plugin-api.js.map +1 -1
  125. package/dist/vite/plugin-docs.js +2 -2
  126. package/dist/vite/plugin-docs.js.map +1 -1
  127. package/dist/vite/plugin-docs.test.js +1 -1
  128. package/dist/vite/plugin-docs.test.js.map +1 -1
  129. package/dist/vite/plugin-redirect.js +2 -2
  130. package/dist/vite/plugin-redirect.js.map +1 -1
  131. package/lib/DevPortalProvider-CRKuwoXc.js +4123 -0
  132. package/lib/Markdown-5LmPZyLV.js +8620 -0
  133. package/lib/MdxComponents-DYD_QPVF.js +3017 -0
  134. package/lib/Select-DR3PiqjV.js +4569 -0
  135. package/lib/Spinner-DjQ2eBxC.js +181 -0
  136. package/lib/assets/{worker-BCcpCNJ7.js → worker-DGvzLstc.js} +9843 -9800
  137. package/lib/hook-FCY9-FHO.js +24 -0
  138. package/lib/index-By9bEW57.js +411 -0
  139. package/lib/{index-DNx3xWa2.js → index-PyGcnQFX.js} +13 -12
  140. package/lib/loglevel-CA34MiFn.js +152 -0
  141. package/lib/prism-csharp.min-Yizuc34Y.js +34 -0
  142. package/lib/prism-objectivec.min-BXSWqpJJ.js +1 -0
  143. package/lib/{state-oycsxkHz.js → state-Ds_OxRHP.js} +19 -18
  144. package/lib/util-voKLTRDG.js +740 -0
  145. package/lib/zudoku.auth-auth0.js +2 -1
  146. package/lib/zudoku.auth-clerk.js +10 -8
  147. package/lib/zudoku.auth-openid.js +442 -588
  148. package/lib/zudoku.components.js +283 -292
  149. package/lib/zudoku.openapi-worker.js +12 -12
  150. package/lib/zudoku.plugin-api-keys.js +292 -0
  151. package/lib/zudoku.plugin-markdown.js +255 -0
  152. package/lib/zudoku.plugin-openapi.js +6240 -0
  153. package/lib/zudoku.plugin-redirect.js +10 -0
  154. package/package.json +17 -4
  155. package/src/app/App.tsx +12 -8
  156. package/src/lib/authentication/authentication.ts +2 -5
  157. package/src/lib/authentication/hook.ts +1 -0
  158. package/src/lib/authentication/providers/auth0.tsx +1 -0
  159. package/src/lib/authentication/providers/clerk.tsx +2 -0
  160. package/src/lib/authentication/providers/openid.tsx +2 -0
  161. package/src/lib/authentication/state.ts +2 -0
  162. package/src/lib/components/DevPortal.tsx +12 -28
  163. package/src/lib/components/Header.tsx +25 -22
  164. package/src/lib/components/Heading.tsx +26 -7
  165. package/src/lib/components/Layout.tsx +2 -2
  166. package/src/lib/components/SyntaxHighlight.tsx +5 -1
  167. package/src/lib/components/context/DevPortalProvider.ts +2 -2
  168. package/src/lib/components/index.ts +3 -0
  169. package/src/lib/core/DevPortalContext.ts +42 -12
  170. package/src/lib/core/plugins.ts +10 -5
  171. package/src/lib/oas/graphql/index.ts +2 -2
  172. package/src/lib/oas/parser/index.ts +3 -1
  173. package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +2 -8
  174. package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +21 -14
  175. package/src/lib/plugins/{api-key → api-keys}/index.tsx +67 -18
  176. package/src/lib/plugins/markdown/MdxPage.tsx +50 -33
  177. package/src/lib/plugins/markdown/generateRoutes.tsx +12 -2
  178. package/src/lib/plugins/markdown/index.tsx +8 -1
  179. package/src/lib/plugins/openapi/OperationList.tsx +9 -3
  180. package/src/lib/plugins/openapi/OperationListItem.tsx +66 -41
  181. package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
  182. package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
  183. package/src/lib/plugins/openapi/{MakeRequest.tsx → PlaygroundDialogWrapper.tsx} +3 -3
  184. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -16
  185. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -1
  186. package/src/lib/plugins/openapi/SchemaListView.tsx +15 -182
  187. package/src/lib/plugins/openapi/SchemaListViewItem.tsx +110 -0
  188. package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
  189. package/src/lib/plugins/openapi/Sidecar.tsx +15 -10
  190. package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +5 -2
  191. package/src/lib/plugins/openapi/index.tsx +17 -4
  192. package/src/lib/plugins/openapi/playground/Headers.tsx +60 -33
  193. package/src/lib/plugins/openapi/playground/Playground.tsx +158 -193
  194. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +34 -0
  195. package/src/lib/plugins/openapi/util/prose.ts +7 -0
  196. package/src/lib/plugins/openapi/worker/worker.ts +27 -1
  197. package/src/lib/util/MdxComponents.tsx +1 -1
  198. package/src/lib/util/objectEntries.ts +5 -0
  199. package/src/lib/util/renderIf.ts +4 -0
  200. package/dist/lib/plugins/api-key/CreateApiKey.d.ts +0 -5
  201. package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
  202. package/dist/lib/plugins/api-key/SettingsApiKeys.d.ts +0 -5
  203. package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
  204. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
  205. package/dist/lib/plugins/api-key/index.js +0 -62
  206. package/dist/lib/plugins/api-key/index.js.map +0 -1
  207. package/dist/lib/plugins/index.d.ts +0 -4
  208. package/dist/lib/plugins/index.js +0 -5
  209. package/dist/lib/plugins/index.js.map +0 -1
  210. package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
  211. package/dist/lib/plugins/openapi/Select.js +0 -5
  212. package/dist/lib/plugins/openapi/Select.js.map +0 -1
  213. package/dist/vite/common.d.ts +0 -1
  214. package/dist/vite/common.js +0 -5
  215. package/dist/vite/common.js.map +0 -1
  216. package/lib/Spinner-7LezPqGn.js +0 -8393
  217. package/lib/clerk-Wslx_mPo.js +0 -19685
  218. package/lib/zudoku.plugins.js +0 -19857
  219. package/src/lib/plugins/index.ts +0 -4
  220. /package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +0 -0
@@ -0,0 +1,4569 @@
1
+ var sn = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var cr = (e, r, t) => r.has(e) || sn("Cannot " + t);
5
+ var te = (e, r, t) => (cr(e, r, "read from private field"), t ? t.call(e) : r.get(e)), it = (e, r, t) => r.has(e) ? sn("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, t), at = (e, r, t, n) => (cr(e, r, "write to private field"), n ? n.call(e, t) : r.set(e, t), t), ct = (e, r, t) => (cr(e, r, "access private method"), t);
6
+ import * as h from "react";
7
+ import j, { useLayoutEffect as Rs, useEffect as Ps, useState as Ts } from "react";
8
+ import { h as Os, S as Ht, c as Br, u as le, b as Je, P as oe, d as ce, i as Fs, g as be, e as Wr, a as an } from "./index-By9bEW57.js";
9
+ import { c as Ln, S as Ns, C as Ds, j as cn, n as jn, y as Ms, E as ks, F as Is, q as Vs, l as ke, G as Ls } from "./DevPortalProvider-CRKuwoXc.js";
10
+ import { j as P } from "./index-PyGcnQFX.js";
11
+ import * as Hr from "react-dom";
12
+ import js from "react-dom";
13
+ /**
14
+ * @license lucide-react v0.378.0 - ISC
15
+ *
16
+ * This source code is licensed under the ISC license.
17
+ * See the LICENSE file in the root directory of this source tree.
18
+ */
19
+ const Bn = Ln("ChevronDown", [
20
+ ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
21
+ ]);
22
+ /**
23
+ * @license lucide-react v0.378.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */
28
+ const Bs = Ln("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
29
+ var Ue, $e, fe, De, Me, Vt, Pr, Vn, Ws = (Vn = class extends Ns {
30
+ constructor(t, n) {
31
+ super();
32
+ it(this, Me);
33
+ it(this, Ue);
34
+ it(this, $e);
35
+ it(this, fe);
36
+ it(this, De);
37
+ at(this, Ue, t), this.setOptions(n), this.bindMethods(), ct(this, Me, Vt).call(this);
38
+ }
39
+ bindMethods() {
40
+ this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
41
+ }
42
+ setOptions(t) {
43
+ var o;
44
+ const n = this.options;
45
+ this.options = te(this, Ue).defaultMutationOptions(t), Ds(this.options, n) || te(this, Ue).getMutationCache().notify({
46
+ type: "observerOptionsUpdated",
47
+ mutation: te(this, fe),
48
+ observer: this
49
+ }), n != null && n.mutationKey && this.options.mutationKey && cn(n.mutationKey) !== cn(this.options.mutationKey) ? this.reset() : ((o = te(this, fe)) == null ? void 0 : o.state.status) === "pending" && te(this, fe).setOptions(this.options);
50
+ }
51
+ onUnsubscribe() {
52
+ var t;
53
+ this.hasListeners() || (t = te(this, fe)) == null || t.removeObserver(this);
54
+ }
55
+ onMutationUpdate(t) {
56
+ ct(this, Me, Vt).call(this), ct(this, Me, Pr).call(this, t);
57
+ }
58
+ getCurrentResult() {
59
+ return te(this, $e);
60
+ }
61
+ reset() {
62
+ var t;
63
+ (t = te(this, fe)) == null || t.removeObserver(this), at(this, fe, void 0), ct(this, Me, Vt).call(this), ct(this, Me, Pr).call(this);
64
+ }
65
+ mutate(t, n) {
66
+ var o;
67
+ return at(this, De, n), (o = te(this, fe)) == null || o.removeObserver(this), at(this, fe, te(this, Ue).getMutationCache().build(te(this, Ue), this.options)), te(this, fe).addObserver(this), te(this, fe).execute(t);
68
+ }
69
+ }, Ue = new WeakMap(), $e = new WeakMap(), fe = new WeakMap(), De = new WeakMap(), Me = new WeakSet(), Vt = function() {
70
+ var n;
71
+ const t = ((n = te(this, fe)) == null ? void 0 : n.state) ?? Os();
72
+ at(this, $e, {
73
+ ...t,
74
+ isPending: t.status === "pending",
75
+ isSuccess: t.status === "success",
76
+ isError: t.status === "error",
77
+ isIdle: t.status === "idle",
78
+ mutate: this.mutate,
79
+ reset: this.reset
80
+ });
81
+ }, Pr = function(t) {
82
+ jn.batch(() => {
83
+ var n, o, s, i, a, c, u, f;
84
+ if (te(this, De) && this.hasListeners()) {
85
+ const d = te(this, $e).variables, g = te(this, $e).context;
86
+ (t == null ? void 0 : t.type) === "success" ? ((o = (n = te(this, De)).onSuccess) == null || o.call(n, t.data, d, g), (i = (s = te(this, De)).onSettled) == null || i.call(s, t.data, null, d, g)) : (t == null ? void 0 : t.type) === "error" && ((c = (a = te(this, De)).onError) == null || c.call(a, t.error, d, g), (f = (u = te(this, De)).onSettled) == null || f.call(
87
+ u,
88
+ void 0,
89
+ t.error,
90
+ d,
91
+ g
92
+ ));
93
+ }
94
+ this.listeners.forEach((d) => {
95
+ d(te(this, $e));
96
+ });
97
+ });
98
+ }, Vn);
99
+ function rl(e, r) {
100
+ const t = Ms(), [n] = h.useState(
101
+ () => new Ws(
102
+ t,
103
+ e
104
+ )
105
+ );
106
+ h.useEffect(() => {
107
+ n.setOptions(e);
108
+ }, [n, e]);
109
+ const o = h.useSyncExternalStore(
110
+ h.useCallback(
111
+ (i) => n.subscribe(jn.batchCalls(i)),
112
+ [n]
113
+ ),
114
+ () => n.getCurrentResult(),
115
+ () => n.getCurrentResult()
116
+ ), s = h.useCallback(
117
+ (i, a) => {
118
+ n.mutate(i, a).catch(ks);
119
+ },
120
+ [n]
121
+ );
122
+ if (o.error && Is(n.options.throwOnError, [o.error]))
123
+ throw o.error;
124
+ return { ...o, mutate: s, mutateAsync: o.mutate };
125
+ }
126
+ const Hs = Vs(
127
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
128
+ {
129
+ variants: {
130
+ variant: {
131
+ default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
132
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
133
+ outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
134
+ secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
135
+ ghost: "hover:bg-accent hover:text-accent-foreground",
136
+ link: "text-primary underline-offset-4 hover:underline"
137
+ },
138
+ size: {
139
+ default: "h-9 px-4 py-2",
140
+ sm: "h-8 rounded-md px-3 text-xs",
141
+ lg: "h-10 rounded-md px-8",
142
+ icon: "h-9 w-9"
143
+ }
144
+ },
145
+ defaultVariants: {
146
+ variant: "default",
147
+ size: "default"
148
+ }
149
+ }
150
+ ), Us = h.forwardRef(
151
+ ({ className: e, variant: r, size: t, asChild: n = !1, ...o }, s) => {
152
+ const i = n ? Ht : "button";
153
+ return /* @__PURE__ */ P.jsx(
154
+ i,
155
+ {
156
+ className: ke(Hs({ variant: r, size: t, className: e })),
157
+ ref: s,
158
+ ...o
159
+ }
160
+ );
161
+ }
162
+ );
163
+ Us.displayName = "Button";
164
+ var Rt = (e) => e.type === "checkbox", ht = (e) => e instanceof Date, de = (e) => e == null;
165
+ const Wn = (e) => typeof e == "object";
166
+ var ae = (e) => !de(e) && !Array.isArray(e) && Wn(e) && !ht(e), Hn = (e) => ae(e) && e.target ? Rt(e.target) ? e.target.checked : e.target.value : e, $s = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Un = (e, r) => e.has($s(r)), zs = (e) => {
167
+ const r = e.constructor && e.constructor.prototype;
168
+ return ae(r) && r.hasOwnProperty("isPrototypeOf");
169
+ }, Ur = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
170
+ function ie(e) {
171
+ let r;
172
+ const t = Array.isArray(e);
173
+ if (e instanceof Date)
174
+ r = new Date(e);
175
+ else if (e instanceof Set)
176
+ r = new Set(e);
177
+ else if (!(Ur && (e instanceof Blob || e instanceof FileList)) && (t || ae(e)))
178
+ if (r = t ? [] : {}, !t && !zs(e))
179
+ r = e;
180
+ else
181
+ for (const n in e)
182
+ e.hasOwnProperty(n) && (r[n] = ie(e[n]));
183
+ else
184
+ return e;
185
+ return r;
186
+ }
187
+ var Pt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Q = (e) => e === void 0, O = (e, r, t) => {
188
+ if (!r || !ae(e))
189
+ return t;
190
+ const n = Pt(r.split(/[,[\].]+?/)).reduce((o, s) => de(o) ? o : o[s], e);
191
+ return Q(n) || n === e ? Q(e[r]) ? t : e[r] : n;
192
+ }, _e = (e) => typeof e == "boolean", $r = (e) => /^\w*$/.test(e), $n = (e) => Pt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), G = (e, r, t) => {
193
+ let n = -1;
194
+ const o = $r(r) ? [r] : $n(r), s = o.length, i = s - 1;
195
+ for (; ++n < s; ) {
196
+ const a = o[n];
197
+ let c = t;
198
+ if (n !== i) {
199
+ const u = e[a];
200
+ c = ae(u) || Array.isArray(u) ? u : isNaN(+o[n + 1]) ? {} : [];
201
+ }
202
+ if (a === "__proto__")
203
+ return;
204
+ e[a] = c, e = e[a];
205
+ }
206
+ return e;
207
+ };
208
+ const Ut = {
209
+ BLUR: "blur",
210
+ FOCUS_OUT: "focusout",
211
+ CHANGE: "change"
212
+ }, xe = {
213
+ onBlur: "onBlur",
214
+ onChange: "onChange",
215
+ onSubmit: "onSubmit",
216
+ onTouched: "onTouched",
217
+ all: "all"
218
+ }, Fe = {
219
+ max: "max",
220
+ min: "min",
221
+ maxLength: "maxLength",
222
+ minLength: "minLength",
223
+ pattern: "pattern",
224
+ required: "required",
225
+ validate: "validate"
226
+ }, zn = j.createContext(null), Jt = () => j.useContext(zn), nl = (e) => {
227
+ const { children: r, ...t } = e;
228
+ return j.createElement(zn.Provider, { value: t }, r);
229
+ };
230
+ var Kn = (e, r, t, n = !0) => {
231
+ const o = {
232
+ defaultValues: r._defaultValues
233
+ };
234
+ for (const s in e)
235
+ Object.defineProperty(o, s, {
236
+ get: () => {
237
+ const i = s;
238
+ return r._proxyFormState[i] !== xe.all && (r._proxyFormState[i] = !n || xe.all), t && (t[i] = !0), e[i];
239
+ }
240
+ });
241
+ return o;
242
+ }, he = (e) => ae(e) && !Object.keys(e).length, Yn = (e, r, t, n) => {
243
+ t(e);
244
+ const { name: o, ...s } = e;
245
+ return he(s) || Object.keys(s).length >= Object.keys(r).length || Object.keys(s).find((i) => r[i] === (!n || xe.all));
246
+ }, pe = (e) => Array.isArray(e) ? e : [e], qn = (e, r, t) => !e || !r || e === r || pe(e).some((n) => n && (t ? n === r : n.startsWith(r) || r.startsWith(n)));
247
+ function er(e) {
248
+ const r = j.useRef(e);
249
+ r.current = e, j.useEffect(() => {
250
+ const t = !e.disabled && r.current.subject && r.current.subject.subscribe({
251
+ next: r.current.next
252
+ });
253
+ return () => {
254
+ t && t.unsubscribe();
255
+ };
256
+ }, [e.disabled]);
257
+ }
258
+ function Ks(e) {
259
+ const r = Jt(), { control: t = r.control, disabled: n, name: o, exact: s } = e || {}, [i, a] = j.useState(t._formState), c = j.useRef(!0), u = j.useRef({
260
+ isDirty: !1,
261
+ isLoading: !1,
262
+ dirtyFields: !1,
263
+ touchedFields: !1,
264
+ validatingFields: !1,
265
+ isValidating: !1,
266
+ isValid: !1,
267
+ errors: !1
268
+ }), f = j.useRef(o);
269
+ return f.current = o, er({
270
+ disabled: n,
271
+ next: (d) => c.current && qn(f.current, d.name, s) && Yn(d, u.current, t._updateFormState) && a({
272
+ ...t._formState,
273
+ ...d
274
+ }),
275
+ subject: t._subjects.state
276
+ }), j.useEffect(() => (c.current = !0, u.current.isValid && t._updateValid(!0), () => {
277
+ c.current = !1;
278
+ }), [t]), Kn(i, t, u.current, !1);
279
+ }
280
+ var Pe = (e) => typeof e == "string", Xn = (e, r, t, n, o) => Pe(e) ? (n && r.watch.add(e), O(t, e, o)) : Array.isArray(e) ? e.map((s) => (n && r.watch.add(s), O(t, s))) : (n && (r.watchAll = !0), t);
281
+ function Ys(e) {
282
+ const r = Jt(), { control: t = r.control, name: n, defaultValue: o, disabled: s, exact: i } = e || {}, a = j.useRef(n);
283
+ a.current = n, er({
284
+ disabled: s,
285
+ subject: t._subjects.values,
286
+ next: (f) => {
287
+ qn(a.current, f.name, i) && u(ie(Xn(a.current, t._names, f.values || t._formValues, !1, o)));
288
+ }
289
+ });
290
+ const [c, u] = j.useState(t._getWatch(n, o));
291
+ return j.useEffect(() => t._removeUnmounted()), c;
292
+ }
293
+ function qs(e) {
294
+ const r = Jt(), { name: t, disabled: n, control: o = r.control, shouldUnregister: s } = e, i = Un(o._names.array, t), a = Ys({
295
+ control: o,
296
+ name: t,
297
+ defaultValue: O(o._formValues, t, O(o._defaultValues, t, e.defaultValue)),
298
+ exact: !0
299
+ }), c = Ks({
300
+ control: o,
301
+ name: t
302
+ }), u = j.useRef(o.register(t, {
303
+ ...e.rules,
304
+ value: a,
305
+ ..._e(e.disabled) ? { disabled: e.disabled } : {}
306
+ }));
307
+ return j.useEffect(() => {
308
+ const f = o._options.shouldUnregister || s, d = (g, x) => {
309
+ const y = O(o._fields, g);
310
+ y && y._f && (y._f.mount = x);
311
+ };
312
+ if (d(t, !0), f) {
313
+ const g = ie(O(o._options.defaultValues, t));
314
+ G(o._defaultValues, t, g), Q(O(o._formValues, t)) && G(o._formValues, t, g);
315
+ }
316
+ return () => {
317
+ (i ? f && !o._state.action : f) ? o.unregister(t) : d(t, !1);
318
+ };
319
+ }, [t, o, i, s]), j.useEffect(() => {
320
+ O(o._fields, t) && o._updateDisabledField({
321
+ disabled: n,
322
+ fields: o._fields,
323
+ name: t,
324
+ value: O(o._fields, t)._f.value
325
+ });
326
+ }, [n, t, o]), {
327
+ field: {
328
+ name: t,
329
+ value: a,
330
+ ..._e(n) || c.disabled ? { disabled: c.disabled || n } : {},
331
+ onChange: j.useCallback((f) => u.current.onChange({
332
+ target: {
333
+ value: Hn(f),
334
+ name: t
335
+ },
336
+ type: Ut.CHANGE
337
+ }), [t]),
338
+ onBlur: j.useCallback(() => u.current.onBlur({
339
+ target: {
340
+ value: O(o._formValues, t),
341
+ name: t
342
+ },
343
+ type: Ut.BLUR
344
+ }), [t, o]),
345
+ ref: (f) => {
346
+ const d = O(o._fields, t);
347
+ d && f && (d._f.ref = {
348
+ focus: () => f.focus(),
349
+ select: () => f.select(),
350
+ setCustomValidity: (g) => f.setCustomValidity(g),
351
+ reportValidity: () => f.reportValidity()
352
+ });
353
+ }
354
+ },
355
+ formState: c,
356
+ fieldState: Object.defineProperties({}, {
357
+ invalid: {
358
+ enumerable: !0,
359
+ get: () => !!O(c.errors, t)
360
+ },
361
+ isDirty: {
362
+ enumerable: !0,
363
+ get: () => !!O(c.dirtyFields, t)
364
+ },
365
+ isTouched: {
366
+ enumerable: !0,
367
+ get: () => !!O(c.touchedFields, t)
368
+ },
369
+ isValidating: {
370
+ enumerable: !0,
371
+ get: () => !!O(c.validatingFields, t)
372
+ },
373
+ error: {
374
+ enumerable: !0,
375
+ get: () => O(c.errors, t)
376
+ }
377
+ })
378
+ };
379
+ }
380
+ const ol = (e) => e.render(qs(e));
381
+ var Xs = (e, r, t, n, o) => r ? {
382
+ ...t[e],
383
+ types: {
384
+ ...t[e] && t[e].types ? t[e].types : {},
385
+ [n]: o || !0
386
+ }
387
+ } : {}, We = () => {
388
+ const e = typeof performance > "u" ? Date.now() : performance.now() * 1e3;
389
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r) => {
390
+ const t = (Math.random() * 16 + e) % 16 | 0;
391
+ return (r == "x" ? t : t & 3 | 8).toString(16);
392
+ });
393
+ }, lr = (e, r, t = {}) => t.shouldFocus || Q(t.shouldFocus) ? t.focusName || `${e}.${Q(t.focusIndex) ? r : t.focusIndex}.` : "", Ct = (e) => ({
394
+ isOnSubmit: !e || e === xe.onSubmit,
395
+ isOnBlur: e === xe.onBlur,
396
+ isOnChange: e === xe.onChange,
397
+ isOnAll: e === xe.all,
398
+ isOnTouch: e === xe.onTouched
399
+ }), Tr = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
400
+ const pt = (e, r, t, n) => {
401
+ for (const o of t || Object.keys(e)) {
402
+ const s = O(e, o);
403
+ if (s) {
404
+ const { _f: i, ...a } = s;
405
+ if (i) {
406
+ if (i.refs && i.refs[0] && r(i.refs[0], o) && !n)
407
+ break;
408
+ if (i.ref && r(i.ref, i.name) && !n)
409
+ break;
410
+ pt(a, r);
411
+ } else ae(a) && pt(a, r);
412
+ }
413
+ }
414
+ };
415
+ var Gn = (e, r, t) => {
416
+ const n = pe(O(e, t));
417
+ return G(n, "root", r[t]), G(e, t, n), e;
418
+ }, zr = (e) => e.type === "file", ze = (e) => typeof e == "function", $t = (e) => {
419
+ if (!Ur)
420
+ return !1;
421
+ const r = e ? e.ownerDocument : 0;
422
+ return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
423
+ }, Lt = (e) => Pe(e), Kr = (e) => e.type === "radio", zt = (e) => e instanceof RegExp;
424
+ const ln = {
425
+ value: !1,
426
+ isValid: !1
427
+ }, un = { value: !0, isValid: !0 };
428
+ var Zn = (e) => {
429
+ if (Array.isArray(e)) {
430
+ if (e.length > 1) {
431
+ const r = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
432
+ return { value: r, isValid: !!r.length };
433
+ }
434
+ return e[0].checked && !e[0].disabled ? (
435
+ // @ts-expect-error expected to work in the browser
436
+ e[0].attributes && !Q(e[0].attributes.value) ? Q(e[0].value) || e[0].value === "" ? un : { value: e[0].value, isValid: !0 } : un
437
+ ) : ln;
438
+ }
439
+ return ln;
440
+ };
441
+ const dn = {
442
+ isValid: !1,
443
+ value: null
444
+ };
445
+ var Qn = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disabled ? {
446
+ isValid: !0,
447
+ value: t.value
448
+ } : r, dn) : dn;
449
+ function fn(e, r, t = "validate") {
450
+ if (Lt(e) || Array.isArray(e) && e.every(Lt) || _e(e) && !e)
451
+ return {
452
+ type: t,
453
+ message: Lt(e) ? e : "",
454
+ ref: r
455
+ };
456
+ }
457
+ var lt = (e) => ae(e) && !zt(e) ? e : {
458
+ value: e,
459
+ message: ""
460
+ }, Or = async (e, r, t, n, o) => {
461
+ const { ref: s, refs: i, required: a, maxLength: c, minLength: u, min: f, max: d, pattern: g, validate: x, name: y, valueAsNumber: p, mount: S, disabled: b } = e._f, v = O(r, y);
462
+ if (!S || b)
463
+ return {};
464
+ const C = i ? i[0] : s, R = (D) => {
465
+ n && C.reportValidity && (C.setCustomValidity(_e(D) ? "" : D || ""), C.reportValidity());
466
+ }, w = {}, A = Kr(s), _ = Rt(s), M = A || _, H = (p || zr(s)) && Q(s.value) && Q(v) || $t(s) && s.value === "" || v === "" || Array.isArray(v) && !v.length, U = Xs.bind(null, y, t, w), J = (D, I, B, V = Fe.maxLength, $ = Fe.minLength) => {
467
+ const L = D ? I : B;
468
+ w[y] = {
469
+ type: D ? V : $,
470
+ message: L,
471
+ ref: s,
472
+ ...U(D ? V : $, L)
473
+ };
474
+ };
475
+ if (o ? !Array.isArray(v) || !v.length : a && (!M && (H || de(v)) || _e(v) && !v || _ && !Zn(i).isValid || A && !Qn(i).isValid)) {
476
+ const { value: D, message: I } = Lt(a) ? { value: !!a, message: a } : lt(a);
477
+ if (D && (w[y] = {
478
+ type: Fe.required,
479
+ message: I,
480
+ ref: C,
481
+ ...U(Fe.required, I)
482
+ }, !t))
483
+ return R(I), w;
484
+ }
485
+ if (!H && (!de(f) || !de(d))) {
486
+ let D, I;
487
+ const B = lt(d), V = lt(f);
488
+ if (!de(v) && !isNaN(v)) {
489
+ const $ = s.valueAsNumber || v && +v;
490
+ de(B.value) || (D = $ > B.value), de(V.value) || (I = $ < V.value);
491
+ } else {
492
+ const $ = s.valueAsDate || new Date(v), L = (Se) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + Se), Z = s.type == "time", ee = s.type == "week";
493
+ Pe(B.value) && v && (D = Z ? L(v) > L(B.value) : ee ? v > B.value : $ > new Date(B.value)), Pe(V.value) && v && (I = Z ? L(v) < L(V.value) : ee ? v < V.value : $ < new Date(V.value));
494
+ }
495
+ if ((D || I) && (J(!!D, B.message, V.message, Fe.max, Fe.min), !t))
496
+ return R(w[y].message), w;
497
+ }
498
+ if ((c || u) && !H && (Pe(v) || o && Array.isArray(v))) {
499
+ const D = lt(c), I = lt(u), B = !de(D.value) && v.length > +D.value, V = !de(I.value) && v.length < +I.value;
500
+ if ((B || V) && (J(B, D.message, I.message), !t))
501
+ return R(w[y].message), w;
502
+ }
503
+ if (g && !H && Pe(v)) {
504
+ const { value: D, message: I } = lt(g);
505
+ if (zt(D) && !v.match(D) && (w[y] = {
506
+ type: Fe.pattern,
507
+ message: I,
508
+ ref: s,
509
+ ...U(Fe.pattern, I)
510
+ }, !t))
511
+ return R(I), w;
512
+ }
513
+ if (x) {
514
+ if (ze(x)) {
515
+ const D = await x(v, r), I = fn(D, C);
516
+ if (I && (w[y] = {
517
+ ...I,
518
+ ...U(Fe.validate, I.message)
519
+ }, !t))
520
+ return R(I.message), w;
521
+ } else if (ae(x)) {
522
+ let D = {};
523
+ for (const I in x) {
524
+ if (!he(D) && !t)
525
+ break;
526
+ const B = fn(await x[I](v, r), C, I);
527
+ B && (D = {
528
+ ...B,
529
+ ...U(I, B.message)
530
+ }, R(B.message), t && (w[y] = D));
531
+ }
532
+ if (!he(D) && (w[y] = {
533
+ ref: C,
534
+ ...D
535
+ }, !t))
536
+ return w;
537
+ }
538
+ }
539
+ return R(!0), w;
540
+ }, ur = (e, r) => [
541
+ ...e,
542
+ ...pe(r)
543
+ ], dr = (e) => Array.isArray(e) ? e.map(() => {
544
+ }) : void 0;
545
+ function fr(e, r, t) {
546
+ return [
547
+ ...e.slice(0, r),
548
+ ...pe(t),
549
+ ...e.slice(r)
550
+ ];
551
+ }
552
+ var hr = (e, r, t) => Array.isArray(e) ? (Q(e[t]) && (e[t] = void 0), e.splice(t, 0, e.splice(r, 1)[0]), e) : [], pr = (e, r) => [
553
+ ...pe(r),
554
+ ...pe(e)
555
+ ];
556
+ function Gs(e, r) {
557
+ let t = 0;
558
+ const n = [...e];
559
+ for (const o of r)
560
+ n.splice(o - t, 1), t++;
561
+ return Pt(n).length ? n : [];
562
+ }
563
+ var mr = (e, r) => Q(r) ? [] : Gs(e, pe(r).sort((t, n) => t - n)), vr = (e, r, t) => {
564
+ [e[r], e[t]] = [e[t], e[r]];
565
+ };
566
+ function Zs(e, r) {
567
+ const t = r.slice(0, -1).length;
568
+ let n = 0;
569
+ for (; n < t; )
570
+ e = Q(e) ? n++ : e[r[n++]];
571
+ return e;
572
+ }
573
+ function Qs(e) {
574
+ for (const r in e)
575
+ if (e.hasOwnProperty(r) && !Q(e[r]))
576
+ return !1;
577
+ return !0;
578
+ }
579
+ function ne(e, r) {
580
+ const t = Array.isArray(r) ? r : $r(r) ? [r] : $n(r), n = t.length === 1 ? e : Zs(e, t), o = t.length - 1, s = t[o];
581
+ return n && delete n[s], o !== 0 && (ae(n) && he(n) || Array.isArray(n) && Qs(n)) && ne(e, t.slice(0, -1)), e;
582
+ }
583
+ var hn = (e, r, t) => (e[r] = t, e);
584
+ function sl(e) {
585
+ const r = Jt(), { control: t = r.control, name: n, keyName: o = "id", shouldUnregister: s } = e, [i, a] = j.useState(t._getFieldArray(n)), c = j.useRef(t._getFieldArray(n).map(We)), u = j.useRef(i), f = j.useRef(n), d = j.useRef(!1);
586
+ f.current = n, u.current = i, t._names.array.add(n), e.rules && t.register(n, e.rules), er({
587
+ next: ({ values: w, name: A }) => {
588
+ if (A === f.current || !A) {
589
+ const _ = O(w, f.current);
590
+ Array.isArray(_) && (a(_), c.current = _.map(We));
591
+ }
592
+ },
593
+ subject: t._subjects.array
594
+ });
595
+ const g = j.useCallback((w) => {
596
+ d.current = !0, t._updateFieldArray(n, w);
597
+ }, [t, n]), x = (w, A) => {
598
+ const _ = pe(ie(w)), M = ur(t._getFieldArray(n), _);
599
+ t._names.focus = lr(n, M.length - 1, A), c.current = ur(c.current, _.map(We)), g(M), a(M), t._updateFieldArray(n, M, ur, {
600
+ argA: dr(w)
601
+ });
602
+ }, y = (w, A) => {
603
+ const _ = pe(ie(w)), M = pr(t._getFieldArray(n), _);
604
+ t._names.focus = lr(n, 0, A), c.current = pr(c.current, _.map(We)), g(M), a(M), t._updateFieldArray(n, M, pr, {
605
+ argA: dr(w)
606
+ });
607
+ }, p = (w) => {
608
+ const A = mr(t._getFieldArray(n), w);
609
+ c.current = mr(c.current, w), g(A), a(A), t._updateFieldArray(n, A, mr, {
610
+ argA: w
611
+ });
612
+ }, S = (w, A, _) => {
613
+ const M = pe(ie(A)), H = fr(t._getFieldArray(n), w, M);
614
+ t._names.focus = lr(n, w, _), c.current = fr(c.current, w, M.map(We)), g(H), a(H), t._updateFieldArray(n, H, fr, {
615
+ argA: w,
616
+ argB: dr(A)
617
+ });
618
+ }, b = (w, A) => {
619
+ const _ = t._getFieldArray(n);
620
+ vr(_, w, A), vr(c.current, w, A), g(_), a(_), t._updateFieldArray(n, _, vr, {
621
+ argA: w,
622
+ argB: A
623
+ }, !1);
624
+ }, v = (w, A) => {
625
+ const _ = t._getFieldArray(n);
626
+ hr(_, w, A), hr(c.current, w, A), g(_), a(_), t._updateFieldArray(n, _, hr, {
627
+ argA: w,
628
+ argB: A
629
+ }, !1);
630
+ }, C = (w, A) => {
631
+ const _ = ie(A), M = hn(t._getFieldArray(n), w, _);
632
+ c.current = [...M].map((H, U) => !H || U === w ? We() : c.current[U]), g(M), a([...M]), t._updateFieldArray(n, M, hn, {
633
+ argA: w,
634
+ argB: _
635
+ }, !0, !1);
636
+ }, R = (w) => {
637
+ const A = pe(ie(w));
638
+ c.current = A.map(We), g([...A]), a([...A]), t._updateFieldArray(n, [...A], (_) => _, {}, !0, !1);
639
+ };
640
+ return j.useEffect(() => {
641
+ if (t._state.action = !1, Tr(n, t._names) && t._subjects.state.next({
642
+ ...t._formState
643
+ }), d.current && (!Ct(t._options.mode).isOnSubmit || t._formState.isSubmitted))
644
+ if (t._options.resolver)
645
+ t._executeSchema([n]).then((w) => {
646
+ const A = O(w.errors, n), _ = O(t._formState.errors, n);
647
+ (_ ? !A && _.type || A && (_.type !== A.type || _.message !== A.message) : A && A.type) && (A ? G(t._formState.errors, n, A) : ne(t._formState.errors, n), t._subjects.state.next({
648
+ errors: t._formState.errors
649
+ }));
650
+ });
651
+ else {
652
+ const w = O(t._fields, n);
653
+ w && w._f && !(Ct(t._options.reValidateMode).isOnSubmit && Ct(t._options.mode).isOnSubmit) && Or(w, t._formValues, t._options.criteriaMode === xe.all, t._options.shouldUseNativeValidation, !0).then((A) => !he(A) && t._subjects.state.next({
654
+ errors: Gn(t._formState.errors, A, n)
655
+ }));
656
+ }
657
+ t._subjects.values.next({
658
+ name: n,
659
+ values: { ...t._formValues }
660
+ }), t._names.focus && pt(t._fields, (w, A) => {
661
+ if (t._names.focus && A.startsWith(t._names.focus) && w.focus)
662
+ return w.focus(), 1;
663
+ }), t._names.focus = "", t._updateValid(), d.current = !1;
664
+ }, [i, n, t]), j.useEffect(() => (!O(t._formValues, n) && t._updateFieldArray(n), () => {
665
+ (t._options.shouldUnregister || s) && t.unregister(n);
666
+ }), [n, t, o, s]), {
667
+ swap: j.useCallback(b, [g, n, t]),
668
+ move: j.useCallback(v, [g, n, t]),
669
+ prepend: j.useCallback(y, [g, n, t]),
670
+ append: j.useCallback(x, [g, n, t]),
671
+ remove: j.useCallback(p, [g, n, t]),
672
+ insert: j.useCallback(S, [g, n, t]),
673
+ update: j.useCallback(C, [g, n, t]),
674
+ replace: j.useCallback(R, [g, n, t]),
675
+ fields: j.useMemo(() => i.map((w, A) => ({
676
+ ...w,
677
+ [o]: c.current[A] || We()
678
+ })), [i, o])
679
+ };
680
+ }
681
+ var gr = () => {
682
+ let e = [];
683
+ return {
684
+ get observers() {
685
+ return e;
686
+ },
687
+ next: (o) => {
688
+ for (const s of e)
689
+ s.next && s.next(o);
690
+ },
691
+ subscribe: (o) => (e.push(o), {
692
+ unsubscribe: () => {
693
+ e = e.filter((s) => s !== o);
694
+ }
695
+ }),
696
+ unsubscribe: () => {
697
+ e = [];
698
+ }
699
+ };
700
+ }, Kt = (e) => de(e) || !Wn(e);
701
+ function Qe(e, r) {
702
+ if (Kt(e) || Kt(r))
703
+ return e === r;
704
+ if (ht(e) && ht(r))
705
+ return e.getTime() === r.getTime();
706
+ const t = Object.keys(e), n = Object.keys(r);
707
+ if (t.length !== n.length)
708
+ return !1;
709
+ for (const o of t) {
710
+ const s = e[o];
711
+ if (!n.includes(o))
712
+ return !1;
713
+ if (o !== "ref") {
714
+ const i = r[o];
715
+ if (ht(s) && ht(i) || ae(s) && ae(i) || Array.isArray(s) && Array.isArray(i) ? !Qe(s, i) : s !== i)
716
+ return !1;
717
+ }
718
+ }
719
+ return !0;
720
+ }
721
+ var Jn = (e) => e.type === "select-multiple", Js = (e) => Kr(e) || Rt(e), yr = (e) => $t(e) && e.isConnected, eo = (e) => {
722
+ for (const r in e)
723
+ if (ze(e[r]))
724
+ return !0;
725
+ return !1;
726
+ };
727
+ function Yt(e, r = {}) {
728
+ const t = Array.isArray(e);
729
+ if (ae(e) || t)
730
+ for (const n in e)
731
+ Array.isArray(e[n]) || ae(e[n]) && !eo(e[n]) ? (r[n] = Array.isArray(e[n]) ? [] : {}, Yt(e[n], r[n])) : de(e[n]) || (r[n] = !0);
732
+ return r;
733
+ }
734
+ function to(e, r, t) {
735
+ const n = Array.isArray(e);
736
+ if (ae(e) || n)
737
+ for (const o in e)
738
+ Array.isArray(e[o]) || ae(e[o]) && !eo(e[o]) ? Q(r) || Kt(t[o]) ? t[o] = Array.isArray(e[o]) ? Yt(e[o], []) : { ...Yt(e[o]) } : to(e[o], de(r) ? {} : r[o], t[o]) : t[o] = !Qe(e[o], r[o]);
739
+ return t;
740
+ }
741
+ var Ft = (e, r) => to(e, r, Yt(r)), ro = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => Q(e) ? e : r ? e === "" ? NaN : e && +e : t && Pe(e) ? new Date(e) : n ? n(e) : e;
742
+ function wr(e) {
743
+ const r = e.ref;
744
+ if (!(e.refs ? e.refs.every((t) => t.disabled) : r.disabled))
745
+ return zr(r) ? r.files : Kr(r) ? Qn(e.refs).value : Jn(r) ? [...r.selectedOptions].map(({ value: t }) => t) : Rt(r) ? Zn(e.refs).value : ro(Q(r.value) ? e.ref.value : r.value, e);
746
+ }
747
+ var ei = (e, r, t, n) => {
748
+ const o = {};
749
+ for (const s of e) {
750
+ const i = O(r, s);
751
+ i && G(o, s, i._f);
752
+ }
753
+ return {
754
+ criteriaMode: t,
755
+ names: [...e],
756
+ fields: o,
757
+ shouldUseNativeValidation: n
758
+ };
759
+ }, St = (e) => Q(e) ? e : zt(e) ? e.source : ae(e) ? zt(e.value) ? e.value.source : e.value : e, ti = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
760
+ function pn(e, r, t) {
761
+ const n = O(e, t);
762
+ if (n || $r(t))
763
+ return {
764
+ error: n,
765
+ name: t
766
+ };
767
+ const o = t.split(".");
768
+ for (; o.length; ) {
769
+ const s = o.join("."), i = O(r, s), a = O(e, s);
770
+ if (i && !Array.isArray(i) && t !== s)
771
+ return { name: t };
772
+ if (a && a.type)
773
+ return {
774
+ name: s,
775
+ error: a
776
+ };
777
+ o.pop();
778
+ }
779
+ return {
780
+ name: t
781
+ };
782
+ }
783
+ var ri = (e, r, t, n, o) => o.isOnAll ? !1 : !t && o.isOnTouch ? !(r || e) : (t ? n.isOnBlur : o.isOnBlur) ? !e : (t ? n.isOnChange : o.isOnChange) ? e : !0, ni = (e, r) => !Pt(O(e, r)).length && ne(e, r);
784
+ const oi = {
785
+ mode: xe.onSubmit,
786
+ reValidateMode: xe.onChange,
787
+ shouldFocusError: !0
788
+ };
789
+ function si(e = {}) {
790
+ let r = {
791
+ ...oi,
792
+ ...e
793
+ }, t = {
794
+ submitCount: 0,
795
+ isDirty: !1,
796
+ isLoading: ze(r.defaultValues),
797
+ isValidating: !1,
798
+ isSubmitted: !1,
799
+ isSubmitting: !1,
800
+ isSubmitSuccessful: !1,
801
+ isValid: !1,
802
+ touchedFields: {},
803
+ dirtyFields: {},
804
+ validatingFields: {},
805
+ errors: r.errors || {},
806
+ disabled: r.disabled || !1
807
+ }, n = {}, o = ae(r.defaultValues) || ae(r.values) ? ie(r.defaultValues || r.values) || {} : {}, s = r.shouldUnregister ? {} : ie(o), i = {
808
+ action: !1,
809
+ mount: !1,
810
+ watch: !1
811
+ }, a = {
812
+ mount: /* @__PURE__ */ new Set(),
813
+ unMount: /* @__PURE__ */ new Set(),
814
+ array: /* @__PURE__ */ new Set(),
815
+ watch: /* @__PURE__ */ new Set()
816
+ }, c, u = 0;
817
+ const f = {
818
+ isDirty: !1,
819
+ dirtyFields: !1,
820
+ validatingFields: !1,
821
+ touchedFields: !1,
822
+ isValidating: !1,
823
+ isValid: !1,
824
+ errors: !1
825
+ }, d = {
826
+ values: gr(),
827
+ array: gr(),
828
+ state: gr()
829
+ }, g = Ct(r.mode), x = Ct(r.reValidateMode), y = r.criteriaMode === xe.all, p = (l) => (m) => {
830
+ clearTimeout(u), u = setTimeout(l, m);
831
+ }, S = async (l) => {
832
+ if (f.isValid || l) {
833
+ const m = r.resolver ? he((await M()).errors) : await U(n, !0);
834
+ m !== t.isValid && d.state.next({
835
+ isValid: m
836
+ });
837
+ }
838
+ }, b = (l, m) => {
839
+ (f.isValidating || f.validatingFields) && ((l || Array.from(a.mount)).forEach((E) => {
840
+ E && (m ? G(t.validatingFields, E, m) : ne(t.validatingFields, E));
841
+ }), d.state.next({
842
+ validatingFields: t.validatingFields,
843
+ isValidating: !he(t.validatingFields)
844
+ }));
845
+ }, v = (l, m = [], E, N, F = !0, T = !0) => {
846
+ if (N && E) {
847
+ if (i.action = !0, T && Array.isArray(O(n, l))) {
848
+ const k = E(O(n, l), N.argA, N.argB);
849
+ F && G(n, l, k);
850
+ }
851
+ if (T && Array.isArray(O(t.errors, l))) {
852
+ const k = E(O(t.errors, l), N.argA, N.argB);
853
+ F && G(t.errors, l, k), ni(t.errors, l);
854
+ }
855
+ if (f.touchedFields && T && Array.isArray(O(t.touchedFields, l))) {
856
+ const k = E(O(t.touchedFields, l), N.argA, N.argB);
857
+ F && G(t.touchedFields, l, k);
858
+ }
859
+ f.dirtyFields && (t.dirtyFields = Ft(o, s)), d.state.next({
860
+ name: l,
861
+ isDirty: D(l, m),
862
+ dirtyFields: t.dirtyFields,
863
+ errors: t.errors,
864
+ isValid: t.isValid
865
+ });
866
+ } else
867
+ G(s, l, m);
868
+ }, C = (l, m) => {
869
+ G(t.errors, l, m), d.state.next({
870
+ errors: t.errors
871
+ });
872
+ }, R = (l) => {
873
+ t.errors = l, d.state.next({
874
+ errors: t.errors,
875
+ isValid: !1
876
+ });
877
+ }, w = (l, m, E, N) => {
878
+ const F = O(n, l);
879
+ if (F) {
880
+ const T = O(s, l, Q(E) ? O(o, l) : E);
881
+ Q(T) || N && N.defaultChecked || m ? G(s, l, m ? T : wr(F._f)) : V(l, T), i.mount && S();
882
+ }
883
+ }, A = (l, m, E, N, F) => {
884
+ let T = !1, k = !1;
885
+ const Y = {
886
+ name: l
887
+ }, re = !!(O(n, l) && O(n, l)._f && O(n, l)._f.disabled);
888
+ if (!E || N) {
889
+ f.isDirty && (k = t.isDirty, t.isDirty = Y.isDirty = D(), T = k !== Y.isDirty);
890
+ const ve = re || Qe(O(o, l), m);
891
+ k = !!(!re && O(t.dirtyFields, l)), ve || re ? ne(t.dirtyFields, l) : G(t.dirtyFields, l, !0), Y.dirtyFields = t.dirtyFields, T = T || f.dirtyFields && k !== !ve;
892
+ }
893
+ if (E) {
894
+ const ve = O(t.touchedFields, l);
895
+ ve || (G(t.touchedFields, l, E), Y.touchedFields = t.touchedFields, T = T || f.touchedFields && ve !== E);
896
+ }
897
+ return T && F && d.state.next(Y), T ? Y : {};
898
+ }, _ = (l, m, E, N) => {
899
+ const F = O(t.errors, l), T = f.isValid && _e(m) && t.isValid !== m;
900
+ if (e.delayError && E ? (c = p(() => C(l, E)), c(e.delayError)) : (clearTimeout(u), c = null, E ? G(t.errors, l, E) : ne(t.errors, l)), (E ? !Qe(F, E) : F) || !he(N) || T) {
901
+ const k = {
902
+ ...N,
903
+ ...T && _e(m) ? { isValid: m } : {},
904
+ errors: t.errors,
905
+ name: l
906
+ };
907
+ t = {
908
+ ...t,
909
+ ...k
910
+ }, d.state.next(k);
911
+ }
912
+ }, M = async (l) => {
913
+ b(l, !0);
914
+ const m = await r.resolver(s, r.context, ei(l || a.mount, n, r.criteriaMode, r.shouldUseNativeValidation));
915
+ return b(l), m;
916
+ }, H = async (l) => {
917
+ const { errors: m } = await M(l);
918
+ if (l)
919
+ for (const E of l) {
920
+ const N = O(m, E);
921
+ N ? G(t.errors, E, N) : ne(t.errors, E);
922
+ }
923
+ else
924
+ t.errors = m;
925
+ return m;
926
+ }, U = async (l, m, E = {
927
+ valid: !0
928
+ }) => {
929
+ for (const N in l) {
930
+ const F = l[N];
931
+ if (F) {
932
+ const { _f: T, ...k } = F;
933
+ if (T) {
934
+ const Y = a.array.has(T.name);
935
+ b([N], !0);
936
+ const re = await Or(F, s, y, r.shouldUseNativeValidation && !m, Y);
937
+ if (b([N]), re[T.name] && (E.valid = !1, m))
938
+ break;
939
+ !m && (O(re, T.name) ? Y ? Gn(t.errors, re, T.name) : G(t.errors, T.name, re[T.name]) : ne(t.errors, T.name));
940
+ }
941
+ k && await U(k, m, E);
942
+ }
943
+ }
944
+ return E.valid;
945
+ }, J = () => {
946
+ for (const l of a.unMount) {
947
+ const m = O(n, l);
948
+ m && (m._f.refs ? m._f.refs.every((E) => !yr(E)) : !yr(m._f.ref)) && Ce(l);
949
+ }
950
+ a.unMount = /* @__PURE__ */ new Set();
951
+ }, D = (l, m) => (l && m && G(s, l, m), !Qe(we(), o)), I = (l, m, E) => Xn(l, a, {
952
+ ...i.mount ? s : Q(m) ? o : Pe(l) ? { [l]: m } : m
953
+ }, E, m), B = (l) => Pt(O(i.mount ? s : o, l, e.shouldUnregister ? O(o, l, []) : [])), V = (l, m, E = {}) => {
954
+ const N = O(n, l);
955
+ let F = m;
956
+ if (N) {
957
+ const T = N._f;
958
+ T && (!T.disabled && G(s, l, ro(m, T)), F = $t(T.ref) && de(m) ? "" : m, Jn(T.ref) ? [...T.ref.options].forEach((k) => k.selected = F.includes(k.value)) : T.refs ? Rt(T.ref) ? T.refs.length > 1 ? T.refs.forEach((k) => (!k.defaultChecked || !k.disabled) && (k.checked = Array.isArray(F) ? !!F.find((Y) => Y === k.value) : F === k.value)) : T.refs[0] && (T.refs[0].checked = !!F) : T.refs.forEach((k) => k.checked = k.value === F) : zr(T.ref) ? T.ref.value = "" : (T.ref.value = F, T.ref.type || d.values.next({
959
+ name: l,
960
+ values: { ...s }
961
+ })));
962
+ }
963
+ (E.shouldDirty || E.shouldTouch) && A(l, F, E.shouldTouch, E.shouldDirty, !0), E.shouldValidate && Se(l);
964
+ }, $ = (l, m, E) => {
965
+ for (const N in m) {
966
+ const F = m[N], T = `${l}.${N}`, k = O(n, T);
967
+ (a.array.has(l) || !Kt(F) || k && !k._f) && !ht(F) ? $(T, F, E) : V(T, F, E);
968
+ }
969
+ }, L = (l, m, E = {}) => {
970
+ const N = O(n, l), F = a.array.has(l), T = ie(m);
971
+ G(s, l, T), F ? (d.array.next({
972
+ name: l,
973
+ values: { ...s }
974
+ }), (f.isDirty || f.dirtyFields) && E.shouldDirty && d.state.next({
975
+ name: l,
976
+ dirtyFields: Ft(o, s),
977
+ isDirty: D(l, T)
978
+ })) : N && !N._f && !de(T) ? $(l, T, E) : V(l, T, E), Tr(l, a) && d.state.next({ ...t }), d.values.next({
979
+ name: i.mount ? l : void 0,
980
+ values: { ...s }
981
+ });
982
+ }, Z = async (l) => {
983
+ i.mount = !0;
984
+ const m = l.target;
985
+ let E = m.name, N = !0;
986
+ const F = O(n, E), T = () => m.type ? wr(F._f) : Hn(l), k = (Y) => {
987
+ N = Number.isNaN(Y) || Y === O(s, E, Y);
988
+ };
989
+ if (F) {
990
+ let Y, re;
991
+ const ve = T(), st = l.type === Ut.BLUR || l.type === Ut.FOCUS_OUT, Cs = !ti(F._f) && !r.resolver && !O(t.errors, E) && !F._f.deps || ri(st, O(t.touchedFields, E), t.isSubmitted, x, g), ir = Tr(E, a, st);
992
+ G(s, E, ve), st ? (F._f.onBlur && F._f.onBlur(l), c && c(0)) : F._f.onChange && F._f.onChange(l);
993
+ const ar = A(E, ve, st, !1), As = !he(ar) || ir;
994
+ if (!st && d.values.next({
995
+ name: E,
996
+ type: l.type,
997
+ values: { ...s }
998
+ }), Cs)
999
+ return f.isValid && S(), As && d.state.next({ name: E, ...ir ? {} : ar });
1000
+ if (!st && ir && d.state.next({ ...t }), r.resolver) {
1001
+ const { errors: nn } = await M([E]);
1002
+ if (k(ve), N) {
1003
+ const _s = pn(t.errors, n, E), on = pn(nn, n, _s.name || E);
1004
+ Y = on.error, E = on.name, re = he(nn);
1005
+ }
1006
+ } else
1007
+ b([E], !0), Y = (await Or(F, s, y, r.shouldUseNativeValidation))[E], b([E]), k(ve), N && (Y ? re = !1 : f.isValid && (re = await U(n, !0)));
1008
+ N && (F._f.deps && Se(F._f.deps), _(E, re, Y, ar));
1009
+ }
1010
+ }, ee = (l, m) => {
1011
+ if (O(t.errors, m) && l.focus)
1012
+ return l.focus(), 1;
1013
+ }, Se = async (l, m = {}) => {
1014
+ let E, N;
1015
+ const F = pe(l);
1016
+ if (r.resolver) {
1017
+ const T = await H(Q(l) ? l : F);
1018
+ E = he(T), N = l ? !F.some((k) => O(T, k)) : E;
1019
+ } else l ? (N = (await Promise.all(F.map(async (T) => {
1020
+ const k = O(n, T);
1021
+ return await U(k && k._f ? { [T]: k } : k);
1022
+ }))).every(Boolean), !(!N && !t.isValid) && S()) : N = E = await U(n);
1023
+ return d.state.next({
1024
+ ...!Pe(l) || f.isValid && E !== t.isValid ? {} : { name: l },
1025
+ ...r.resolver || !l ? { isValid: E } : {},
1026
+ errors: t.errors
1027
+ }), m.shouldFocus && !N && pt(n, ee, l ? F : a.mount), N;
1028
+ }, we = (l) => {
1029
+ const m = {
1030
+ ...i.mount ? s : o
1031
+ };
1032
+ return Q(l) ? m : Pe(l) ? O(m, l) : l.map((E) => O(m, E));
1033
+ }, je = (l, m) => ({
1034
+ invalid: !!O((m || t).errors, l),
1035
+ isDirty: !!O((m || t).dirtyFields, l),
1036
+ error: O((m || t).errors, l),
1037
+ isValidating: !!O(t.validatingFields, l),
1038
+ isTouched: !!O((m || t).touchedFields, l)
1039
+ }), Ze = (l) => {
1040
+ l && pe(l).forEach((m) => ne(t.errors, m)), d.state.next({
1041
+ errors: l ? t.errors : {}
1042
+ });
1043
+ }, Ee = (l, m, E) => {
1044
+ const N = (O(n, l, { _f: {} })._f || {}).ref, F = O(t.errors, l) || {}, { ref: T, message: k, type: Y, ...re } = F;
1045
+ G(t.errors, l, {
1046
+ ...re,
1047
+ ...m,
1048
+ ref: N
1049
+ }), d.state.next({
1050
+ name: l,
1051
+ errors: t.errors,
1052
+ isValid: !1
1053
+ }), E && E.shouldFocus && N && N.focus && N.focus();
1054
+ }, Be = (l, m) => ze(l) ? d.values.subscribe({
1055
+ next: (E) => l(I(void 0, m), E)
1056
+ }) : I(l, m, !0), Ce = (l, m = {}) => {
1057
+ for (const E of l ? pe(l) : a.mount)
1058
+ a.mount.delete(E), a.array.delete(E), m.keepValue || (ne(n, E), ne(s, E)), !m.keepError && ne(t.errors, E), !m.keepDirty && ne(t.dirtyFields, E), !m.keepTouched && ne(t.touchedFields, E), !m.keepIsValidating && ne(t.validatingFields, E), !r.shouldUnregister && !m.keepDefaultValue && ne(o, E);
1059
+ d.values.next({
1060
+ values: { ...s }
1061
+ }), d.state.next({
1062
+ ...t,
1063
+ ...m.keepDirty ? { isDirty: D() } : {}
1064
+ }), !m.keepIsValid && S();
1065
+ }, W = ({ disabled: l, name: m, field: E, fields: N, value: F }) => {
1066
+ if (_e(l) && i.mount || l) {
1067
+ const T = l ? void 0 : Q(F) ? wr(E ? E._f : O(N, m)._f) : F;
1068
+ G(s, m, T), A(m, T, !1, !1, !0);
1069
+ }
1070
+ }, q = (l, m = {}) => {
1071
+ let E = O(n, l);
1072
+ const N = _e(m.disabled);
1073
+ return G(n, l, {
1074
+ ...E || {},
1075
+ _f: {
1076
+ ...E && E._f ? E._f : { ref: { name: l } },
1077
+ name: l,
1078
+ mount: !0,
1079
+ ...m
1080
+ }
1081
+ }), a.mount.add(l), E ? W({
1082
+ field: E,
1083
+ disabled: m.disabled,
1084
+ name: l,
1085
+ value: m.value
1086
+ }) : w(l, !0, m.value), {
1087
+ ...N ? { disabled: m.disabled } : {},
1088
+ ...r.progressive ? {
1089
+ required: !!m.required,
1090
+ min: St(m.min),
1091
+ max: St(m.max),
1092
+ minLength: St(m.minLength),
1093
+ maxLength: St(m.maxLength),
1094
+ pattern: St(m.pattern)
1095
+ } : {},
1096
+ name: l,
1097
+ onChange: Z,
1098
+ onBlur: Z,
1099
+ ref: (F) => {
1100
+ if (F) {
1101
+ q(l, m), E = O(n, l);
1102
+ const T = Q(F.value) && F.querySelectorAll && F.querySelectorAll("input,select,textarea")[0] || F, k = Js(T), Y = E._f.refs || [];
1103
+ if (k ? Y.find((re) => re === T) : T === E._f.ref)
1104
+ return;
1105
+ G(n, l, {
1106
+ _f: {
1107
+ ...E._f,
1108
+ ...k ? {
1109
+ refs: [
1110
+ ...Y.filter(yr),
1111
+ T,
1112
+ ...Array.isArray(O(o, l)) ? [{}] : []
1113
+ ],
1114
+ ref: { type: T.type, name: l }
1115
+ } : { ref: T }
1116
+ }
1117
+ }), w(l, !1, void 0, T);
1118
+ } else
1119
+ E = O(n, l, {}), E._f && (E._f.mount = !1), (r.shouldUnregister || m.shouldUnregister) && !(Un(a.array, l) && i.action) && a.unMount.add(l);
1120
+ }
1121
+ };
1122
+ }, se = () => r.shouldFocusError && pt(n, ee, a.mount), X = (l) => {
1123
+ _e(l) && (d.state.next({ disabled: l }), pt(n, (m, E) => {
1124
+ const N = O(n, E);
1125
+ N && (m.disabled = N._f.disabled || l, Array.isArray(N._f.refs) && N._f.refs.forEach((F) => {
1126
+ F.disabled = N._f.disabled || l;
1127
+ }));
1128
+ }, 0, !1));
1129
+ }, z = (l, m) => async (E) => {
1130
+ let N;
1131
+ E && (E.preventDefault && E.preventDefault(), E.persist && E.persist());
1132
+ let F = ie(s);
1133
+ if (d.state.next({
1134
+ isSubmitting: !0
1135
+ }), r.resolver) {
1136
+ const { errors: T, values: k } = await M();
1137
+ t.errors = T, F = k;
1138
+ } else
1139
+ await U(n);
1140
+ if (ne(t.errors, "root"), he(t.errors)) {
1141
+ d.state.next({
1142
+ errors: {}
1143
+ });
1144
+ try {
1145
+ await l(F, E);
1146
+ } catch (T) {
1147
+ N = T;
1148
+ }
1149
+ } else
1150
+ m && await m({ ...t.errors }, E), se(), setTimeout(se);
1151
+ if (d.state.next({
1152
+ isSubmitted: !0,
1153
+ isSubmitting: !1,
1154
+ isSubmitSuccessful: he(t.errors) && !N,
1155
+ submitCount: t.submitCount + 1,
1156
+ errors: t.errors
1157
+ }), N)
1158
+ throw N;
1159
+ }, K = (l, m = {}) => {
1160
+ O(n, l) && (Q(m.defaultValue) ? L(l, ie(O(o, l))) : (L(l, m.defaultValue), G(o, l, ie(m.defaultValue))), m.keepTouched || ne(t.touchedFields, l), m.keepDirty || (ne(t.dirtyFields, l), t.isDirty = m.defaultValue ? D(l, ie(O(o, l))) : D()), m.keepError || (ne(t.errors, l), f.isValid && S()), d.state.next({ ...t }));
1161
+ }, ue = (l, m = {}) => {
1162
+ const E = l ? ie(l) : o, N = ie(E), F = he(l), T = F ? o : N;
1163
+ if (m.keepDefaultValues || (o = E), !m.keepValues) {
1164
+ if (m.keepDirtyValues)
1165
+ for (const k of a.mount)
1166
+ O(t.dirtyFields, k) ? G(T, k, O(s, k)) : L(k, O(T, k));
1167
+ else {
1168
+ if (Ur && Q(l))
1169
+ for (const k of a.mount) {
1170
+ const Y = O(n, k);
1171
+ if (Y && Y._f) {
1172
+ const re = Array.isArray(Y._f.refs) ? Y._f.refs[0] : Y._f.ref;
1173
+ if ($t(re)) {
1174
+ const ve = re.closest("form");
1175
+ if (ve) {
1176
+ ve.reset();
1177
+ break;
1178
+ }
1179
+ }
1180
+ }
1181
+ }
1182
+ n = {};
1183
+ }
1184
+ s = e.shouldUnregister ? m.keepDefaultValues ? ie(o) : {} : ie(T), d.array.next({
1185
+ values: { ...T }
1186
+ }), d.values.next({
1187
+ values: { ...T }
1188
+ });
1189
+ }
1190
+ a = {
1191
+ mount: m.keepDirtyValues ? a.mount : /* @__PURE__ */ new Set(),
1192
+ unMount: /* @__PURE__ */ new Set(),
1193
+ array: /* @__PURE__ */ new Set(),
1194
+ watch: /* @__PURE__ */ new Set(),
1195
+ watchAll: !1,
1196
+ focus: ""
1197
+ }, i.mount = !f.isValid || !!m.keepIsValid || !!m.keepDirtyValues, i.watch = !!e.shouldUnregister, d.state.next({
1198
+ submitCount: m.keepSubmitCount ? t.submitCount : 0,
1199
+ isDirty: F ? !1 : m.keepDirty ? t.isDirty : !!(m.keepDefaultValues && !Qe(l, o)),
1200
+ isSubmitted: m.keepIsSubmitted ? t.isSubmitted : !1,
1201
+ dirtyFields: F ? {} : m.keepDirtyValues ? m.keepDefaultValues && s ? Ft(o, s) : t.dirtyFields : m.keepDefaultValues && l ? Ft(o, l) : m.keepDirty ? t.dirtyFields : {},
1202
+ touchedFields: m.keepTouched ? t.touchedFields : {},
1203
+ errors: m.keepErrors ? t.errors : {},
1204
+ isSubmitSuccessful: m.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
1205
+ isSubmitting: !1
1206
+ });
1207
+ }, me = (l, m) => ue(ze(l) ? l(s) : l, m);
1208
+ return {
1209
+ control: {
1210
+ register: q,
1211
+ unregister: Ce,
1212
+ getFieldState: je,
1213
+ handleSubmit: z,
1214
+ setError: Ee,
1215
+ _executeSchema: M,
1216
+ _getWatch: I,
1217
+ _getDirty: D,
1218
+ _updateValid: S,
1219
+ _removeUnmounted: J,
1220
+ _updateFieldArray: v,
1221
+ _updateDisabledField: W,
1222
+ _getFieldArray: B,
1223
+ _reset: ue,
1224
+ _resetDefaultValues: () => ze(r.defaultValues) && r.defaultValues().then((l) => {
1225
+ me(l, r.resetOptions), d.state.next({
1226
+ isLoading: !1
1227
+ });
1228
+ }),
1229
+ _updateFormState: (l) => {
1230
+ t = {
1231
+ ...t,
1232
+ ...l
1233
+ };
1234
+ },
1235
+ _disableForm: X,
1236
+ _subjects: d,
1237
+ _proxyFormState: f,
1238
+ _setErrors: R,
1239
+ get _fields() {
1240
+ return n;
1241
+ },
1242
+ get _formValues() {
1243
+ return s;
1244
+ },
1245
+ get _state() {
1246
+ return i;
1247
+ },
1248
+ set _state(l) {
1249
+ i = l;
1250
+ },
1251
+ get _defaultValues() {
1252
+ return o;
1253
+ },
1254
+ get _names() {
1255
+ return a;
1256
+ },
1257
+ set _names(l) {
1258
+ a = l;
1259
+ },
1260
+ get _formState() {
1261
+ return t;
1262
+ },
1263
+ set _formState(l) {
1264
+ t = l;
1265
+ },
1266
+ get _options() {
1267
+ return r;
1268
+ },
1269
+ set _options(l) {
1270
+ r = {
1271
+ ...r,
1272
+ ...l
1273
+ };
1274
+ }
1275
+ },
1276
+ trigger: Se,
1277
+ register: q,
1278
+ handleSubmit: z,
1279
+ watch: Be,
1280
+ setValue: L,
1281
+ getValues: we,
1282
+ reset: me,
1283
+ resetField: K,
1284
+ clearErrors: Ze,
1285
+ unregister: Ce,
1286
+ setError: Ee,
1287
+ setFocus: (l, m = {}) => {
1288
+ const E = O(n, l), N = E && E._f;
1289
+ if (N) {
1290
+ const F = N.refs ? N.refs[0] : N.ref;
1291
+ F.focus && (F.focus(), m.shouldSelect && F.select());
1292
+ }
1293
+ },
1294
+ getFieldState: je
1295
+ };
1296
+ }
1297
+ function il(e = {}) {
1298
+ const r = j.useRef(), t = j.useRef(), [n, o] = j.useState({
1299
+ isDirty: !1,
1300
+ isValidating: !1,
1301
+ isLoading: ze(e.defaultValues),
1302
+ isSubmitted: !1,
1303
+ isSubmitting: !1,
1304
+ isSubmitSuccessful: !1,
1305
+ isValid: !1,
1306
+ submitCount: 0,
1307
+ dirtyFields: {},
1308
+ touchedFields: {},
1309
+ validatingFields: {},
1310
+ errors: e.errors || {},
1311
+ disabled: e.disabled || !1,
1312
+ defaultValues: ze(e.defaultValues) ? void 0 : e.defaultValues
1313
+ });
1314
+ r.current || (r.current = {
1315
+ ...si(e),
1316
+ formState: n
1317
+ });
1318
+ const s = r.current.control;
1319
+ return s._options = e, er({
1320
+ subject: s._subjects.state,
1321
+ next: (i) => {
1322
+ Yn(i, s._proxyFormState, s._updateFormState, !0) && o({ ...s._formState });
1323
+ }
1324
+ }), j.useEffect(() => s._disableForm(e.disabled), [s, e.disabled]), j.useEffect(() => {
1325
+ if (s._proxyFormState.isDirty) {
1326
+ const i = s._getDirty();
1327
+ i !== n.isDirty && s._subjects.state.next({
1328
+ isDirty: i
1329
+ });
1330
+ }
1331
+ }, [s, n.isDirty]), j.useEffect(() => {
1332
+ e.values && !Qe(e.values, t.current) ? (s._reset(e.values, s._options.resetOptions), t.current = e.values, o((i) => ({ ...i }))) : s._resetDefaultValues();
1333
+ }, [e.values, s]), j.useEffect(() => {
1334
+ e.errors && s._setErrors(e.errors);
1335
+ }, [e.errors, s]), j.useEffect(() => {
1336
+ s._state.mount || (s._updateValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
1337
+ }), j.useEffect(() => {
1338
+ e.shouldUnregister && s._subjects.values.next({
1339
+ values: s._getWatch()
1340
+ });
1341
+ }, [e.shouldUnregister, s]), r.current.formState = Kn(n, s), r.current;
1342
+ }
1343
+ function mn(e, [r, t]) {
1344
+ return Math.min(t, Math.max(r, e));
1345
+ }
1346
+ function ii(e) {
1347
+ const r = e + "CollectionProvider", [t, n] = Br(r), [o, s] = t(
1348
+ r,
1349
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
1350
+ ), i = (x) => {
1351
+ const { scope: y, children: p } = x, S = j.useRef(null), b = j.useRef(/* @__PURE__ */ new Map()).current;
1352
+ return /* @__PURE__ */ P.jsx(o, { scope: y, itemMap: b, collectionRef: S, children: p });
1353
+ };
1354
+ i.displayName = r;
1355
+ const a = e + "CollectionSlot", c = j.forwardRef(
1356
+ (x, y) => {
1357
+ const { scope: p, children: S } = x, b = s(a, p), v = le(y, b.collectionRef);
1358
+ return /* @__PURE__ */ P.jsx(Ht, { ref: v, children: S });
1359
+ }
1360
+ );
1361
+ c.displayName = a;
1362
+ const u = e + "CollectionItemSlot", f = "data-radix-collection-item", d = j.forwardRef(
1363
+ (x, y) => {
1364
+ const { scope: p, children: S, ...b } = x, v = j.useRef(null), C = le(y, v), R = s(u, p);
1365
+ return j.useEffect(() => (R.itemMap.set(v, { ref: v, ...b }), () => void R.itemMap.delete(v))), /* @__PURE__ */ P.jsx(Ht, { [f]: "", ref: C, children: S });
1366
+ }
1367
+ );
1368
+ d.displayName = u;
1369
+ function g(x) {
1370
+ const y = s(e + "CollectionConsumer", x);
1371
+ return j.useCallback(() => {
1372
+ const S = y.collectionRef.current;
1373
+ if (!S) return [];
1374
+ const b = Array.from(S.querySelectorAll(`[${f}]`));
1375
+ return Array.from(y.itemMap.values()).sort(
1376
+ (R, w) => b.indexOf(R.ref.current) - b.indexOf(w.ref.current)
1377
+ );
1378
+ }, [y.collectionRef, y.itemMap]);
1379
+ }
1380
+ return [
1381
+ { Provider: i, Slot: c, ItemSlot: d },
1382
+ g,
1383
+ n
1384
+ ];
1385
+ }
1386
+ var ai = h.createContext(void 0);
1387
+ function ci(e) {
1388
+ const r = h.useContext(ai);
1389
+ return e || r || "ltr";
1390
+ }
1391
+ function li(e, r = globalThis == null ? void 0 : globalThis.document) {
1392
+ const t = Je(e);
1393
+ h.useEffect(() => {
1394
+ const n = (o) => {
1395
+ o.key === "Escape" && t(o);
1396
+ };
1397
+ return r.addEventListener("keydown", n, { capture: !0 }), () => r.removeEventListener("keydown", n, { capture: !0 });
1398
+ }, [t, r]);
1399
+ }
1400
+ var ui = "DismissableLayer", Fr = "dismissableLayer.update", di = "dismissableLayer.pointerDownOutside", fi = "dismissableLayer.focusOutside", vn, no = h.createContext({
1401
+ layers: /* @__PURE__ */ new Set(),
1402
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
1403
+ branches: /* @__PURE__ */ new Set()
1404
+ }), oo = h.forwardRef(
1405
+ (e, r) => {
1406
+ const {
1407
+ disableOutsidePointerEvents: t = !1,
1408
+ onEscapeKeyDown: n,
1409
+ onPointerDownOutside: o,
1410
+ onFocusOutside: s,
1411
+ onInteractOutside: i,
1412
+ onDismiss: a,
1413
+ ...c
1414
+ } = e, u = h.useContext(no), [f, d] = h.useState(null), g = (f == null ? void 0 : f.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, x] = h.useState({}), y = le(r, (_) => d(_)), p = Array.from(u.layers), [S] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), b = p.indexOf(S), v = f ? p.indexOf(f) : -1, C = u.layersWithOutsidePointerEventsDisabled.size > 0, R = v >= b, w = mi((_) => {
1415
+ const M = _.target, H = [...u.branches].some((U) => U.contains(M));
1416
+ !R || H || (o == null || o(_), i == null || i(_), _.defaultPrevented || a == null || a());
1417
+ }, g), A = vi((_) => {
1418
+ const M = _.target;
1419
+ [...u.branches].some((U) => U.contains(M)) || (s == null || s(_), i == null || i(_), _.defaultPrevented || a == null || a());
1420
+ }, g);
1421
+ return li((_) => {
1422
+ v === u.layers.size - 1 && (n == null || n(_), !_.defaultPrevented && a && (_.preventDefault(), a()));
1423
+ }, g), h.useEffect(() => {
1424
+ if (f)
1425
+ return t && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (vn = g.body.style.pointerEvents, g.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(f)), u.layers.add(f), gn(), () => {
1426
+ t && u.layersWithOutsidePointerEventsDisabled.size === 1 && (g.body.style.pointerEvents = vn);
1427
+ };
1428
+ }, [f, g, t, u]), h.useEffect(() => () => {
1429
+ f && (u.layers.delete(f), u.layersWithOutsidePointerEventsDisabled.delete(f), gn());
1430
+ }, [f, u]), h.useEffect(() => {
1431
+ const _ = () => x({});
1432
+ return document.addEventListener(Fr, _), () => document.removeEventListener(Fr, _);
1433
+ }, []), /* @__PURE__ */ P.jsx(
1434
+ oe.div,
1435
+ {
1436
+ ...c,
1437
+ ref: y,
1438
+ style: {
1439
+ pointerEvents: C ? R ? "auto" : "none" : void 0,
1440
+ ...e.style
1441
+ },
1442
+ onFocusCapture: ce(e.onFocusCapture, A.onFocusCapture),
1443
+ onBlurCapture: ce(e.onBlurCapture, A.onBlurCapture),
1444
+ onPointerDownCapture: ce(
1445
+ e.onPointerDownCapture,
1446
+ w.onPointerDownCapture
1447
+ )
1448
+ }
1449
+ );
1450
+ }
1451
+ );
1452
+ oo.displayName = ui;
1453
+ var hi = "DismissableLayerBranch", pi = h.forwardRef((e, r) => {
1454
+ const t = h.useContext(no), n = h.useRef(null), o = le(r, n);
1455
+ return h.useEffect(() => {
1456
+ const s = n.current;
1457
+ if (s)
1458
+ return t.branches.add(s), () => {
1459
+ t.branches.delete(s);
1460
+ };
1461
+ }, [t.branches]), /* @__PURE__ */ P.jsx(oe.div, { ...e, ref: o });
1462
+ });
1463
+ pi.displayName = hi;
1464
+ function mi(e, r = globalThis == null ? void 0 : globalThis.document) {
1465
+ const t = Je(e), n = h.useRef(!1), o = h.useRef(() => {
1466
+ });
1467
+ return h.useEffect(() => {
1468
+ const s = (a) => {
1469
+ if (a.target && !n.current) {
1470
+ let c = function() {
1471
+ so(
1472
+ di,
1473
+ t,
1474
+ u,
1475
+ { discrete: !0 }
1476
+ );
1477
+ };
1478
+ const u = { originalEvent: a };
1479
+ a.pointerType === "touch" ? (r.removeEventListener("click", o.current), o.current = c, r.addEventListener("click", o.current, { once: !0 })) : c();
1480
+ } else
1481
+ r.removeEventListener("click", o.current);
1482
+ n.current = !1;
1483
+ }, i = window.setTimeout(() => {
1484
+ r.addEventListener("pointerdown", s);
1485
+ }, 0);
1486
+ return () => {
1487
+ window.clearTimeout(i), r.removeEventListener("pointerdown", s), r.removeEventListener("click", o.current);
1488
+ };
1489
+ }, [r, t]), {
1490
+ // ensures we check React component tree (not just DOM tree)
1491
+ onPointerDownCapture: () => n.current = !0
1492
+ };
1493
+ }
1494
+ function vi(e, r = globalThis == null ? void 0 : globalThis.document) {
1495
+ const t = Je(e), n = h.useRef(!1);
1496
+ return h.useEffect(() => {
1497
+ const o = (s) => {
1498
+ s.target && !n.current && so(fi, t, { originalEvent: s }, {
1499
+ discrete: !1
1500
+ });
1501
+ };
1502
+ return r.addEventListener("focusin", o), () => r.removeEventListener("focusin", o);
1503
+ }, [r, t]), {
1504
+ onFocusCapture: () => n.current = !0,
1505
+ onBlurCapture: () => n.current = !1
1506
+ };
1507
+ }
1508
+ function gn() {
1509
+ const e = new CustomEvent(Fr);
1510
+ document.dispatchEvent(e);
1511
+ }
1512
+ function so(e, r, t, { discrete: n }) {
1513
+ const o = t.originalEvent.target, s = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: t });
1514
+ r && o.addEventListener(e, r, { once: !0 }), n ? Fs(o, s) : o.dispatchEvent(s);
1515
+ }
1516
+ var xr = 0;
1517
+ function gi() {
1518
+ h.useEffect(() => {
1519
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
1520
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? yn()), document.body.insertAdjacentElement("beforeend", e[1] ?? yn()), xr++, () => {
1521
+ xr === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((r) => r.remove()), xr--;
1522
+ };
1523
+ }, []);
1524
+ }
1525
+ function yn() {
1526
+ const e = document.createElement("span");
1527
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", e;
1528
+ }
1529
+ var br = "focusScope.autoFocusOnMount", Sr = "focusScope.autoFocusOnUnmount", wn = { bubbles: !1, cancelable: !0 }, yi = "FocusScope", io = h.forwardRef((e, r) => {
1530
+ const {
1531
+ loop: t = !1,
1532
+ trapped: n = !1,
1533
+ onMountAutoFocus: o,
1534
+ onUnmountAutoFocus: s,
1535
+ ...i
1536
+ } = e, [a, c] = h.useState(null), u = Je(o), f = Je(s), d = h.useRef(null), g = le(r, (p) => c(p)), x = h.useRef({
1537
+ paused: !1,
1538
+ pause() {
1539
+ this.paused = !0;
1540
+ },
1541
+ resume() {
1542
+ this.paused = !1;
1543
+ }
1544
+ }).current;
1545
+ h.useEffect(() => {
1546
+ if (n) {
1547
+ let p = function(C) {
1548
+ if (x.paused || !a) return;
1549
+ const R = C.target;
1550
+ a.contains(R) ? d.current = R : He(d.current, { select: !0 });
1551
+ }, S = function(C) {
1552
+ if (x.paused || !a) return;
1553
+ const R = C.relatedTarget;
1554
+ R !== null && (a.contains(R) || He(d.current, { select: !0 }));
1555
+ }, b = function(C) {
1556
+ if (document.activeElement === document.body)
1557
+ for (const w of C)
1558
+ w.removedNodes.length > 0 && He(a);
1559
+ };
1560
+ document.addEventListener("focusin", p), document.addEventListener("focusout", S);
1561
+ const v = new MutationObserver(b);
1562
+ return a && v.observe(a, { childList: !0, subtree: !0 }), () => {
1563
+ document.removeEventListener("focusin", p), document.removeEventListener("focusout", S), v.disconnect();
1564
+ };
1565
+ }
1566
+ }, [n, a, x.paused]), h.useEffect(() => {
1567
+ if (a) {
1568
+ bn.add(x);
1569
+ const p = document.activeElement;
1570
+ if (!a.contains(p)) {
1571
+ const b = new CustomEvent(br, wn);
1572
+ a.addEventListener(br, u), a.dispatchEvent(b), b.defaultPrevented || (wi(Ci(ao(a)), { select: !0 }), document.activeElement === p && He(a));
1573
+ }
1574
+ return () => {
1575
+ a.removeEventListener(br, u), setTimeout(() => {
1576
+ const b = new CustomEvent(Sr, wn);
1577
+ a.addEventListener(Sr, f), a.dispatchEvent(b), b.defaultPrevented || He(p ?? document.body, { select: !0 }), a.removeEventListener(Sr, f), bn.remove(x);
1578
+ }, 0);
1579
+ };
1580
+ }
1581
+ }, [a, u, f, x]);
1582
+ const y = h.useCallback(
1583
+ (p) => {
1584
+ if (!t && !n || x.paused) return;
1585
+ const S = p.key === "Tab" && !p.altKey && !p.ctrlKey && !p.metaKey, b = document.activeElement;
1586
+ if (S && b) {
1587
+ const v = p.currentTarget, [C, R] = xi(v);
1588
+ C && R ? !p.shiftKey && b === R ? (p.preventDefault(), t && He(C, { select: !0 })) : p.shiftKey && b === C && (p.preventDefault(), t && He(R, { select: !0 })) : b === v && p.preventDefault();
1589
+ }
1590
+ },
1591
+ [t, n, x.paused]
1592
+ );
1593
+ return /* @__PURE__ */ P.jsx(oe.div, { tabIndex: -1, ...i, ref: g, onKeyDown: y });
1594
+ });
1595
+ io.displayName = yi;
1596
+ function wi(e, { select: r = !1 } = {}) {
1597
+ const t = document.activeElement;
1598
+ for (const n of e)
1599
+ if (He(n, { select: r }), document.activeElement !== t) return;
1600
+ }
1601
+ function xi(e) {
1602
+ const r = ao(e), t = xn(r, e), n = xn(r.reverse(), e);
1603
+ return [t, n];
1604
+ }
1605
+ function ao(e) {
1606
+ const r = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
1607
+ acceptNode: (n) => {
1608
+ const o = n.tagName === "INPUT" && n.type === "hidden";
1609
+ return n.disabled || n.hidden || o ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
1610
+ }
1611
+ });
1612
+ for (; t.nextNode(); ) r.push(t.currentNode);
1613
+ return r;
1614
+ }
1615
+ function xn(e, r) {
1616
+ for (const t of e)
1617
+ if (!bi(t, { upTo: r })) return t;
1618
+ }
1619
+ function bi(e, { upTo: r }) {
1620
+ if (getComputedStyle(e).visibility === "hidden") return !0;
1621
+ for (; e; ) {
1622
+ if (r !== void 0 && e === r) return !1;
1623
+ if (getComputedStyle(e).display === "none") return !0;
1624
+ e = e.parentElement;
1625
+ }
1626
+ return !1;
1627
+ }
1628
+ function Si(e) {
1629
+ return e instanceof HTMLInputElement && "select" in e;
1630
+ }
1631
+ function He(e, { select: r = !1 } = {}) {
1632
+ if (e && e.focus) {
1633
+ const t = document.activeElement;
1634
+ e.focus({ preventScroll: !0 }), e !== t && Si(e) && r && e.select();
1635
+ }
1636
+ }
1637
+ var bn = Ei();
1638
+ function Ei() {
1639
+ let e = [];
1640
+ return {
1641
+ add(r) {
1642
+ const t = e[0];
1643
+ r !== t && (t == null || t.pause()), e = Sn(e, r), e.unshift(r);
1644
+ },
1645
+ remove(r) {
1646
+ var t;
1647
+ e = Sn(e, r), (t = e[0]) == null || t.resume();
1648
+ }
1649
+ };
1650
+ }
1651
+ function Sn(e, r) {
1652
+ const t = [...e], n = t.indexOf(r);
1653
+ return n !== -1 && t.splice(n, 1), t;
1654
+ }
1655
+ function Ci(e) {
1656
+ return e.filter((r) => r.tagName !== "A");
1657
+ }
1658
+ const Ai = ["top", "right", "bottom", "left"], Ke = Math.min, ge = Math.max, qt = Math.round, Nt = Math.floor, Ye = (e) => ({
1659
+ x: e,
1660
+ y: e
1661
+ }), _i = {
1662
+ left: "right",
1663
+ right: "left",
1664
+ bottom: "top",
1665
+ top: "bottom"
1666
+ }, Ri = {
1667
+ start: "end",
1668
+ end: "start"
1669
+ };
1670
+ function Nr(e, r, t) {
1671
+ return ge(e, Ke(r, t));
1672
+ }
1673
+ function Ie(e, r) {
1674
+ return typeof e == "function" ? e(r) : e;
1675
+ }
1676
+ function Ve(e) {
1677
+ return e.split("-")[0];
1678
+ }
1679
+ function yt(e) {
1680
+ return e.split("-")[1];
1681
+ }
1682
+ function Yr(e) {
1683
+ return e === "x" ? "y" : "x";
1684
+ }
1685
+ function qr(e) {
1686
+ return e === "y" ? "height" : "width";
1687
+ }
1688
+ function wt(e) {
1689
+ return ["top", "bottom"].includes(Ve(e)) ? "y" : "x";
1690
+ }
1691
+ function Xr(e) {
1692
+ return Yr(wt(e));
1693
+ }
1694
+ function Pi(e, r, t) {
1695
+ t === void 0 && (t = !1);
1696
+ const n = yt(e), o = Xr(e), s = qr(o);
1697
+ let i = o === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
1698
+ return r.reference[s] > r.floating[s] && (i = Xt(i)), [i, Xt(i)];
1699
+ }
1700
+ function Ti(e) {
1701
+ const r = Xt(e);
1702
+ return [Dr(e), r, Dr(r)];
1703
+ }
1704
+ function Dr(e) {
1705
+ return e.replace(/start|end/g, (r) => Ri[r]);
1706
+ }
1707
+ function Oi(e, r, t) {
1708
+ const n = ["left", "right"], o = ["right", "left"], s = ["top", "bottom"], i = ["bottom", "top"];
1709
+ switch (e) {
1710
+ case "top":
1711
+ case "bottom":
1712
+ return t ? r ? o : n : r ? n : o;
1713
+ case "left":
1714
+ case "right":
1715
+ return r ? s : i;
1716
+ default:
1717
+ return [];
1718
+ }
1719
+ }
1720
+ function Fi(e, r, t, n) {
1721
+ const o = yt(e);
1722
+ let s = Oi(Ve(e), t === "start", n);
1723
+ return o && (s = s.map((i) => i + "-" + o), r && (s = s.concat(s.map(Dr)))), s;
1724
+ }
1725
+ function Xt(e) {
1726
+ return e.replace(/left|right|bottom|top/g, (r) => _i[r]);
1727
+ }
1728
+ function Ni(e) {
1729
+ return {
1730
+ top: 0,
1731
+ right: 0,
1732
+ bottom: 0,
1733
+ left: 0,
1734
+ ...e
1735
+ };
1736
+ }
1737
+ function co(e) {
1738
+ return typeof e != "number" ? Ni(e) : {
1739
+ top: e,
1740
+ right: e,
1741
+ bottom: e,
1742
+ left: e
1743
+ };
1744
+ }
1745
+ function Gt(e) {
1746
+ const {
1747
+ x: r,
1748
+ y: t,
1749
+ width: n,
1750
+ height: o
1751
+ } = e;
1752
+ return {
1753
+ width: n,
1754
+ height: o,
1755
+ top: t,
1756
+ left: r,
1757
+ right: r + n,
1758
+ bottom: t + o,
1759
+ x: r,
1760
+ y: t
1761
+ };
1762
+ }
1763
+ function En(e, r, t) {
1764
+ let {
1765
+ reference: n,
1766
+ floating: o
1767
+ } = e;
1768
+ const s = wt(r), i = Xr(r), a = qr(i), c = Ve(r), u = s === "y", f = n.x + n.width / 2 - o.width / 2, d = n.y + n.height / 2 - o.height / 2, g = n[a] / 2 - o[a] / 2;
1769
+ let x;
1770
+ switch (c) {
1771
+ case "top":
1772
+ x = {
1773
+ x: f,
1774
+ y: n.y - o.height
1775
+ };
1776
+ break;
1777
+ case "bottom":
1778
+ x = {
1779
+ x: f,
1780
+ y: n.y + n.height
1781
+ };
1782
+ break;
1783
+ case "right":
1784
+ x = {
1785
+ x: n.x + n.width,
1786
+ y: d
1787
+ };
1788
+ break;
1789
+ case "left":
1790
+ x = {
1791
+ x: n.x - o.width,
1792
+ y: d
1793
+ };
1794
+ break;
1795
+ default:
1796
+ x = {
1797
+ x: n.x,
1798
+ y: n.y
1799
+ };
1800
+ }
1801
+ switch (yt(r)) {
1802
+ case "start":
1803
+ x[i] -= g * (t && u ? -1 : 1);
1804
+ break;
1805
+ case "end":
1806
+ x[i] += g * (t && u ? -1 : 1);
1807
+ break;
1808
+ }
1809
+ return x;
1810
+ }
1811
+ const Di = async (e, r, t) => {
1812
+ const {
1813
+ placement: n = "bottom",
1814
+ strategy: o = "absolute",
1815
+ middleware: s = [],
1816
+ platform: i
1817
+ } = t, a = s.filter(Boolean), c = await (i.isRTL == null ? void 0 : i.isRTL(r));
1818
+ let u = await i.getElementRects({
1819
+ reference: e,
1820
+ floating: r,
1821
+ strategy: o
1822
+ }), {
1823
+ x: f,
1824
+ y: d
1825
+ } = En(u, n, c), g = n, x = {}, y = 0;
1826
+ for (let p = 0; p < a.length; p++) {
1827
+ const {
1828
+ name: S,
1829
+ fn: b
1830
+ } = a[p], {
1831
+ x: v,
1832
+ y: C,
1833
+ data: R,
1834
+ reset: w
1835
+ } = await b({
1836
+ x: f,
1837
+ y: d,
1838
+ initialPlacement: n,
1839
+ placement: g,
1840
+ strategy: o,
1841
+ middlewareData: x,
1842
+ rects: u,
1843
+ platform: i,
1844
+ elements: {
1845
+ reference: e,
1846
+ floating: r
1847
+ }
1848
+ });
1849
+ f = v ?? f, d = C ?? d, x = {
1850
+ ...x,
1851
+ [S]: {
1852
+ ...x[S],
1853
+ ...R
1854
+ }
1855
+ }, w && y <= 50 && (y++, typeof w == "object" && (w.placement && (g = w.placement), w.rects && (u = w.rects === !0 ? await i.getElementRects({
1856
+ reference: e,
1857
+ floating: r,
1858
+ strategy: o
1859
+ }) : w.rects), {
1860
+ x: f,
1861
+ y: d
1862
+ } = En(u, g, c)), p = -1);
1863
+ }
1864
+ return {
1865
+ x: f,
1866
+ y: d,
1867
+ placement: g,
1868
+ strategy: o,
1869
+ middlewareData: x
1870
+ };
1871
+ };
1872
+ async function At(e, r) {
1873
+ var t;
1874
+ r === void 0 && (r = {});
1875
+ const {
1876
+ x: n,
1877
+ y: o,
1878
+ platform: s,
1879
+ rects: i,
1880
+ elements: a,
1881
+ strategy: c
1882
+ } = e, {
1883
+ boundary: u = "clippingAncestors",
1884
+ rootBoundary: f = "viewport",
1885
+ elementContext: d = "floating",
1886
+ altBoundary: g = !1,
1887
+ padding: x = 0
1888
+ } = Ie(r, e), y = co(x), S = a[g ? d === "floating" ? "reference" : "floating" : d], b = Gt(await s.getClippingRect({
1889
+ element: (t = await (s.isElement == null ? void 0 : s.isElement(S))) == null || t ? S : S.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(a.floating)),
1890
+ boundary: u,
1891
+ rootBoundary: f,
1892
+ strategy: c
1893
+ })), v = d === "floating" ? {
1894
+ x: n,
1895
+ y: o,
1896
+ width: i.floating.width,
1897
+ height: i.floating.height
1898
+ } : i.reference, C = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a.floating)), R = await (s.isElement == null ? void 0 : s.isElement(C)) ? await (s.getScale == null ? void 0 : s.getScale(C)) || {
1899
+ x: 1,
1900
+ y: 1
1901
+ } : {
1902
+ x: 1,
1903
+ y: 1
1904
+ }, w = Gt(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
1905
+ elements: a,
1906
+ rect: v,
1907
+ offsetParent: C,
1908
+ strategy: c
1909
+ }) : v);
1910
+ return {
1911
+ top: (b.top - w.top + y.top) / R.y,
1912
+ bottom: (w.bottom - b.bottom + y.bottom) / R.y,
1913
+ left: (b.left - w.left + y.left) / R.x,
1914
+ right: (w.right - b.right + y.right) / R.x
1915
+ };
1916
+ }
1917
+ const Mi = (e) => ({
1918
+ name: "arrow",
1919
+ options: e,
1920
+ async fn(r) {
1921
+ const {
1922
+ x: t,
1923
+ y: n,
1924
+ placement: o,
1925
+ rects: s,
1926
+ platform: i,
1927
+ elements: a,
1928
+ middlewareData: c
1929
+ } = r, {
1930
+ element: u,
1931
+ padding: f = 0
1932
+ } = Ie(e, r) || {};
1933
+ if (u == null)
1934
+ return {};
1935
+ const d = co(f), g = {
1936
+ x: t,
1937
+ y: n
1938
+ }, x = Xr(o), y = qr(x), p = await i.getDimensions(u), S = x === "y", b = S ? "top" : "left", v = S ? "bottom" : "right", C = S ? "clientHeight" : "clientWidth", R = s.reference[y] + s.reference[x] - g[x] - s.floating[y], w = g[x] - s.reference[x], A = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
1939
+ let _ = A ? A[C] : 0;
1940
+ (!_ || !await (i.isElement == null ? void 0 : i.isElement(A))) && (_ = a.floating[C] || s.floating[y]);
1941
+ const M = R / 2 - w / 2, H = _ / 2 - p[y] / 2 - 1, U = Ke(d[b], H), J = Ke(d[v], H), D = U, I = _ - p[y] - J, B = _ / 2 - p[y] / 2 + M, V = Nr(D, B, I), $ = !c.arrow && yt(o) != null && B !== V && s.reference[y] / 2 - (B < D ? U : J) - p[y] / 2 < 0, L = $ ? B < D ? B - D : B - I : 0;
1942
+ return {
1943
+ [x]: g[x] + L,
1944
+ data: {
1945
+ [x]: V,
1946
+ centerOffset: B - V - L,
1947
+ ...$ && {
1948
+ alignmentOffset: L
1949
+ }
1950
+ },
1951
+ reset: $
1952
+ };
1953
+ }
1954
+ }), ki = function(e) {
1955
+ return e === void 0 && (e = {}), {
1956
+ name: "flip",
1957
+ options: e,
1958
+ async fn(r) {
1959
+ var t, n;
1960
+ const {
1961
+ placement: o,
1962
+ middlewareData: s,
1963
+ rects: i,
1964
+ initialPlacement: a,
1965
+ platform: c,
1966
+ elements: u
1967
+ } = r, {
1968
+ mainAxis: f = !0,
1969
+ crossAxis: d = !0,
1970
+ fallbackPlacements: g,
1971
+ fallbackStrategy: x = "bestFit",
1972
+ fallbackAxisSideDirection: y = "none",
1973
+ flipAlignment: p = !0,
1974
+ ...S
1975
+ } = Ie(e, r);
1976
+ if ((t = s.arrow) != null && t.alignmentOffset)
1977
+ return {};
1978
+ const b = Ve(o), v = Ve(a) === a, C = await (c.isRTL == null ? void 0 : c.isRTL(u.floating)), R = g || (v || !p ? [Xt(a)] : Ti(a));
1979
+ !g && y !== "none" && R.push(...Fi(a, p, y, C));
1980
+ const w = [a, ...R], A = await At(r, S), _ = [];
1981
+ let M = ((n = s.flip) == null ? void 0 : n.overflows) || [];
1982
+ if (f && _.push(A[b]), d) {
1983
+ const D = Pi(o, i, C);
1984
+ _.push(A[D[0]], A[D[1]]);
1985
+ }
1986
+ if (M = [...M, {
1987
+ placement: o,
1988
+ overflows: _
1989
+ }], !_.every((D) => D <= 0)) {
1990
+ var H, U;
1991
+ const D = (((H = s.flip) == null ? void 0 : H.index) || 0) + 1, I = w[D];
1992
+ if (I)
1993
+ return {
1994
+ data: {
1995
+ index: D,
1996
+ overflows: M
1997
+ },
1998
+ reset: {
1999
+ placement: I
2000
+ }
2001
+ };
2002
+ let B = (U = M.filter((V) => V.overflows[0] <= 0).sort((V, $) => V.overflows[1] - $.overflows[1])[0]) == null ? void 0 : U.placement;
2003
+ if (!B)
2004
+ switch (x) {
2005
+ case "bestFit": {
2006
+ var J;
2007
+ const V = (J = M.map(($) => [$.placement, $.overflows.filter((L) => L > 0).reduce((L, Z) => L + Z, 0)]).sort(($, L) => $[1] - L[1])[0]) == null ? void 0 : J[0];
2008
+ V && (B = V);
2009
+ break;
2010
+ }
2011
+ case "initialPlacement":
2012
+ B = a;
2013
+ break;
2014
+ }
2015
+ if (o !== B)
2016
+ return {
2017
+ reset: {
2018
+ placement: B
2019
+ }
2020
+ };
2021
+ }
2022
+ return {};
2023
+ }
2024
+ };
2025
+ };
2026
+ function Cn(e, r) {
2027
+ return {
2028
+ top: e.top - r.height,
2029
+ right: e.right - r.width,
2030
+ bottom: e.bottom - r.height,
2031
+ left: e.left - r.width
2032
+ };
2033
+ }
2034
+ function An(e) {
2035
+ return Ai.some((r) => e[r] >= 0);
2036
+ }
2037
+ const Ii = function(e) {
2038
+ return e === void 0 && (e = {}), {
2039
+ name: "hide",
2040
+ options: e,
2041
+ async fn(r) {
2042
+ const {
2043
+ rects: t
2044
+ } = r, {
2045
+ strategy: n = "referenceHidden",
2046
+ ...o
2047
+ } = Ie(e, r);
2048
+ switch (n) {
2049
+ case "referenceHidden": {
2050
+ const s = await At(r, {
2051
+ ...o,
2052
+ elementContext: "reference"
2053
+ }), i = Cn(s, t.reference);
2054
+ return {
2055
+ data: {
2056
+ referenceHiddenOffsets: i,
2057
+ referenceHidden: An(i)
2058
+ }
2059
+ };
2060
+ }
2061
+ case "escaped": {
2062
+ const s = await At(r, {
2063
+ ...o,
2064
+ altBoundary: !0
2065
+ }), i = Cn(s, t.floating);
2066
+ return {
2067
+ data: {
2068
+ escapedOffsets: i,
2069
+ escaped: An(i)
2070
+ }
2071
+ };
2072
+ }
2073
+ default:
2074
+ return {};
2075
+ }
2076
+ }
2077
+ };
2078
+ };
2079
+ async function Vi(e, r) {
2080
+ const {
2081
+ placement: t,
2082
+ platform: n,
2083
+ elements: o
2084
+ } = e, s = await (n.isRTL == null ? void 0 : n.isRTL(o.floating)), i = Ve(t), a = yt(t), c = wt(t) === "y", u = ["left", "top"].includes(i) ? -1 : 1, f = s && c ? -1 : 1, d = Ie(r, e);
2085
+ let {
2086
+ mainAxis: g,
2087
+ crossAxis: x,
2088
+ alignmentAxis: y
2089
+ } = typeof d == "number" ? {
2090
+ mainAxis: d,
2091
+ crossAxis: 0,
2092
+ alignmentAxis: null
2093
+ } : {
2094
+ mainAxis: 0,
2095
+ crossAxis: 0,
2096
+ alignmentAxis: null,
2097
+ ...d
2098
+ };
2099
+ return a && typeof y == "number" && (x = a === "end" ? y * -1 : y), c ? {
2100
+ x: x * f,
2101
+ y: g * u
2102
+ } : {
2103
+ x: g * u,
2104
+ y: x * f
2105
+ };
2106
+ }
2107
+ const Li = function(e) {
2108
+ return e === void 0 && (e = 0), {
2109
+ name: "offset",
2110
+ options: e,
2111
+ async fn(r) {
2112
+ var t, n;
2113
+ const {
2114
+ x: o,
2115
+ y: s,
2116
+ placement: i,
2117
+ middlewareData: a
2118
+ } = r, c = await Vi(r, e);
2119
+ return i === ((t = a.offset) == null ? void 0 : t.placement) && (n = a.arrow) != null && n.alignmentOffset ? {} : {
2120
+ x: o + c.x,
2121
+ y: s + c.y,
2122
+ data: {
2123
+ ...c,
2124
+ placement: i
2125
+ }
2126
+ };
2127
+ }
2128
+ };
2129
+ }, ji = function(e) {
2130
+ return e === void 0 && (e = {}), {
2131
+ name: "shift",
2132
+ options: e,
2133
+ async fn(r) {
2134
+ const {
2135
+ x: t,
2136
+ y: n,
2137
+ placement: o
2138
+ } = r, {
2139
+ mainAxis: s = !0,
2140
+ crossAxis: i = !1,
2141
+ limiter: a = {
2142
+ fn: (S) => {
2143
+ let {
2144
+ x: b,
2145
+ y: v
2146
+ } = S;
2147
+ return {
2148
+ x: b,
2149
+ y: v
2150
+ };
2151
+ }
2152
+ },
2153
+ ...c
2154
+ } = Ie(e, r), u = {
2155
+ x: t,
2156
+ y: n
2157
+ }, f = await At(r, c), d = wt(Ve(o)), g = Yr(d);
2158
+ let x = u[g], y = u[d];
2159
+ if (s) {
2160
+ const S = g === "y" ? "top" : "left", b = g === "y" ? "bottom" : "right", v = x + f[S], C = x - f[b];
2161
+ x = Nr(v, x, C);
2162
+ }
2163
+ if (i) {
2164
+ const S = d === "y" ? "top" : "left", b = d === "y" ? "bottom" : "right", v = y + f[S], C = y - f[b];
2165
+ y = Nr(v, y, C);
2166
+ }
2167
+ const p = a.fn({
2168
+ ...r,
2169
+ [g]: x,
2170
+ [d]: y
2171
+ });
2172
+ return {
2173
+ ...p,
2174
+ data: {
2175
+ x: p.x - t,
2176
+ y: p.y - n
2177
+ }
2178
+ };
2179
+ }
2180
+ };
2181
+ }, Bi = function(e) {
2182
+ return e === void 0 && (e = {}), {
2183
+ options: e,
2184
+ fn(r) {
2185
+ const {
2186
+ x: t,
2187
+ y: n,
2188
+ placement: o,
2189
+ rects: s,
2190
+ middlewareData: i
2191
+ } = r, {
2192
+ offset: a = 0,
2193
+ mainAxis: c = !0,
2194
+ crossAxis: u = !0
2195
+ } = Ie(e, r), f = {
2196
+ x: t,
2197
+ y: n
2198
+ }, d = wt(o), g = Yr(d);
2199
+ let x = f[g], y = f[d];
2200
+ const p = Ie(a, r), S = typeof p == "number" ? {
2201
+ mainAxis: p,
2202
+ crossAxis: 0
2203
+ } : {
2204
+ mainAxis: 0,
2205
+ crossAxis: 0,
2206
+ ...p
2207
+ };
2208
+ if (c) {
2209
+ const C = g === "y" ? "height" : "width", R = s.reference[g] - s.floating[C] + S.mainAxis, w = s.reference[g] + s.reference[C] - S.mainAxis;
2210
+ x < R ? x = R : x > w && (x = w);
2211
+ }
2212
+ if (u) {
2213
+ var b, v;
2214
+ const C = g === "y" ? "width" : "height", R = ["top", "left"].includes(Ve(o)), w = s.reference[d] - s.floating[C] + (R && ((b = i.offset) == null ? void 0 : b[d]) || 0) + (R ? 0 : S.crossAxis), A = s.reference[d] + s.reference[C] + (R ? 0 : ((v = i.offset) == null ? void 0 : v[d]) || 0) - (R ? S.crossAxis : 0);
2215
+ y < w ? y = w : y > A && (y = A);
2216
+ }
2217
+ return {
2218
+ [g]: x,
2219
+ [d]: y
2220
+ };
2221
+ }
2222
+ };
2223
+ }, Wi = function(e) {
2224
+ return e === void 0 && (e = {}), {
2225
+ name: "size",
2226
+ options: e,
2227
+ async fn(r) {
2228
+ const {
2229
+ placement: t,
2230
+ rects: n,
2231
+ platform: o,
2232
+ elements: s
2233
+ } = r, {
2234
+ apply: i = () => {
2235
+ },
2236
+ ...a
2237
+ } = Ie(e, r), c = await At(r, a), u = Ve(t), f = yt(t), d = wt(t) === "y", {
2238
+ width: g,
2239
+ height: x
2240
+ } = n.floating;
2241
+ let y, p;
2242
+ u === "top" || u === "bottom" ? (y = u, p = f === (await (o.isRTL == null ? void 0 : o.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (p = u, y = f === "end" ? "top" : "bottom");
2243
+ const S = x - c[y], b = g - c[p], v = !r.middlewareData.shift;
2244
+ let C = S, R = b;
2245
+ if (d) {
2246
+ const A = g - c.left - c.right;
2247
+ R = f || v ? Ke(b, A) : A;
2248
+ } else {
2249
+ const A = x - c.top - c.bottom;
2250
+ C = f || v ? Ke(S, A) : A;
2251
+ }
2252
+ if (v && !f) {
2253
+ const A = ge(c.left, 0), _ = ge(c.right, 0), M = ge(c.top, 0), H = ge(c.bottom, 0);
2254
+ d ? R = g - 2 * (A !== 0 || _ !== 0 ? A + _ : ge(c.left, c.right)) : C = x - 2 * (M !== 0 || H !== 0 ? M + H : ge(c.top, c.bottom));
2255
+ }
2256
+ await i({
2257
+ ...r,
2258
+ availableWidth: R,
2259
+ availableHeight: C
2260
+ });
2261
+ const w = await o.getDimensions(s.floating);
2262
+ return g !== w.width || x !== w.height ? {
2263
+ reset: {
2264
+ rects: !0
2265
+ }
2266
+ } : {};
2267
+ }
2268
+ };
2269
+ };
2270
+ function xt(e) {
2271
+ return lo(e) ? (e.nodeName || "").toLowerCase() : "#document";
2272
+ }
2273
+ function ye(e) {
2274
+ var r;
2275
+ return (e == null || (r = e.ownerDocument) == null ? void 0 : r.defaultView) || window;
2276
+ }
2277
+ function Le(e) {
2278
+ var r;
2279
+ return (r = (lo(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : r.documentElement;
2280
+ }
2281
+ function lo(e) {
2282
+ return e instanceof Node || e instanceof ye(e).Node;
2283
+ }
2284
+ function Te(e) {
2285
+ return e instanceof Element || e instanceof ye(e).Element;
2286
+ }
2287
+ function Oe(e) {
2288
+ return e instanceof HTMLElement || e instanceof ye(e).HTMLElement;
2289
+ }
2290
+ function _n(e) {
2291
+ return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ye(e).ShadowRoot;
2292
+ }
2293
+ function Tt(e) {
2294
+ const {
2295
+ overflow: r,
2296
+ overflowX: t,
2297
+ overflowY: n,
2298
+ display: o
2299
+ } = Ae(e);
2300
+ return /auto|scroll|overlay|hidden|clip/.test(r + n + t) && !["inline", "contents"].includes(o);
2301
+ }
2302
+ function Hi(e) {
2303
+ return ["table", "td", "th"].includes(xt(e));
2304
+ }
2305
+ function Gr(e) {
2306
+ const r = Zr(), t = Ae(e);
2307
+ return t.transform !== "none" || t.perspective !== "none" || (t.containerType ? t.containerType !== "normal" : !1) || !r && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !r && (t.filter ? t.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((n) => (t.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (t.contain || "").includes(n));
2308
+ }
2309
+ function Ui(e) {
2310
+ let r = qe(e);
2311
+ for (; Oe(r) && !gt(r); ) {
2312
+ if (Gr(r))
2313
+ return r;
2314
+ r = qe(r);
2315
+ }
2316
+ return null;
2317
+ }
2318
+ function Zr() {
2319
+ return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
2320
+ }
2321
+ function gt(e) {
2322
+ return ["html", "body", "#document"].includes(xt(e));
2323
+ }
2324
+ function Ae(e) {
2325
+ return ye(e).getComputedStyle(e);
2326
+ }
2327
+ function tr(e) {
2328
+ return Te(e) ? {
2329
+ scrollLeft: e.scrollLeft,
2330
+ scrollTop: e.scrollTop
2331
+ } : {
2332
+ scrollLeft: e.pageXOffset,
2333
+ scrollTop: e.pageYOffset
2334
+ };
2335
+ }
2336
+ function qe(e) {
2337
+ if (xt(e) === "html")
2338
+ return e;
2339
+ const r = (
2340
+ // Step into the shadow DOM of the parent of a slotted node.
2341
+ e.assignedSlot || // DOM Element detected.
2342
+ e.parentNode || // ShadowRoot detected.
2343
+ _n(e) && e.host || // Fallback.
2344
+ Le(e)
2345
+ );
2346
+ return _n(r) ? r.host : r;
2347
+ }
2348
+ function uo(e) {
2349
+ const r = qe(e);
2350
+ return gt(r) ? e.ownerDocument ? e.ownerDocument.body : e.body : Oe(r) && Tt(r) ? r : uo(r);
2351
+ }
2352
+ function _t(e, r, t) {
2353
+ var n;
2354
+ r === void 0 && (r = []), t === void 0 && (t = !0);
2355
+ const o = uo(e), s = o === ((n = e.ownerDocument) == null ? void 0 : n.body), i = ye(o);
2356
+ return s ? r.concat(i, i.visualViewport || [], Tt(o) ? o : [], i.frameElement && t ? _t(i.frameElement) : []) : r.concat(o, _t(o, [], t));
2357
+ }
2358
+ function fo(e) {
2359
+ const r = Ae(e);
2360
+ let t = parseFloat(r.width) || 0, n = parseFloat(r.height) || 0;
2361
+ const o = Oe(e), s = o ? e.offsetWidth : t, i = o ? e.offsetHeight : n, a = qt(t) !== s || qt(n) !== i;
2362
+ return a && (t = s, n = i), {
2363
+ width: t,
2364
+ height: n,
2365
+ $: a
2366
+ };
2367
+ }
2368
+ function Qr(e) {
2369
+ return Te(e) ? e : e.contextElement;
2370
+ }
2371
+ function mt(e) {
2372
+ const r = Qr(e);
2373
+ if (!Oe(r))
2374
+ return Ye(1);
2375
+ const t = r.getBoundingClientRect(), {
2376
+ width: n,
2377
+ height: o,
2378
+ $: s
2379
+ } = fo(r);
2380
+ let i = (s ? qt(t.width) : t.width) / n, a = (s ? qt(t.height) : t.height) / o;
2381
+ return (!i || !Number.isFinite(i)) && (i = 1), (!a || !Number.isFinite(a)) && (a = 1), {
2382
+ x: i,
2383
+ y: a
2384
+ };
2385
+ }
2386
+ const $i = /* @__PURE__ */ Ye(0);
2387
+ function ho(e) {
2388
+ const r = ye(e);
2389
+ return !Zr() || !r.visualViewport ? $i : {
2390
+ x: r.visualViewport.offsetLeft,
2391
+ y: r.visualViewport.offsetTop
2392
+ };
2393
+ }
2394
+ function zi(e, r, t) {
2395
+ return r === void 0 && (r = !1), !t || r && t !== ye(e) ? !1 : r;
2396
+ }
2397
+ function et(e, r, t, n) {
2398
+ r === void 0 && (r = !1), t === void 0 && (t = !1);
2399
+ const o = e.getBoundingClientRect(), s = Qr(e);
2400
+ let i = Ye(1);
2401
+ r && (n ? Te(n) && (i = mt(n)) : i = mt(e));
2402
+ const a = zi(s, t, n) ? ho(s) : Ye(0);
2403
+ let c = (o.left + a.x) / i.x, u = (o.top + a.y) / i.y, f = o.width / i.x, d = o.height / i.y;
2404
+ if (s) {
2405
+ const g = ye(s), x = n && Te(n) ? ye(n) : n;
2406
+ let y = g, p = y.frameElement;
2407
+ for (; p && n && x !== y; ) {
2408
+ const S = mt(p), b = p.getBoundingClientRect(), v = Ae(p), C = b.left + (p.clientLeft + parseFloat(v.paddingLeft)) * S.x, R = b.top + (p.clientTop + parseFloat(v.paddingTop)) * S.y;
2409
+ c *= S.x, u *= S.y, f *= S.x, d *= S.y, c += C, u += R, y = ye(p), p = y.frameElement;
2410
+ }
2411
+ }
2412
+ return Gt({
2413
+ width: f,
2414
+ height: d,
2415
+ x: c,
2416
+ y: u
2417
+ });
2418
+ }
2419
+ const Ki = [":popover-open", ":modal"];
2420
+ function Jr(e) {
2421
+ return Ki.some((r) => {
2422
+ try {
2423
+ return e.matches(r);
2424
+ } catch {
2425
+ return !1;
2426
+ }
2427
+ });
2428
+ }
2429
+ function Yi(e) {
2430
+ let {
2431
+ elements: r,
2432
+ rect: t,
2433
+ offsetParent: n,
2434
+ strategy: o
2435
+ } = e;
2436
+ const s = o === "fixed", i = Le(n), a = r ? Jr(r.floating) : !1;
2437
+ if (n === i || a && s)
2438
+ return t;
2439
+ let c = {
2440
+ scrollLeft: 0,
2441
+ scrollTop: 0
2442
+ }, u = Ye(1);
2443
+ const f = Ye(0), d = Oe(n);
2444
+ if ((d || !d && !s) && ((xt(n) !== "body" || Tt(i)) && (c = tr(n)), Oe(n))) {
2445
+ const g = et(n);
2446
+ u = mt(n), f.x = g.x + n.clientLeft, f.y = g.y + n.clientTop;
2447
+ }
2448
+ return {
2449
+ width: t.width * u.x,
2450
+ height: t.height * u.y,
2451
+ x: t.x * u.x - c.scrollLeft * u.x + f.x,
2452
+ y: t.y * u.y - c.scrollTop * u.y + f.y
2453
+ };
2454
+ }
2455
+ function qi(e) {
2456
+ return Array.from(e.getClientRects());
2457
+ }
2458
+ function po(e) {
2459
+ return et(Le(e)).left + tr(e).scrollLeft;
2460
+ }
2461
+ function Xi(e) {
2462
+ const r = Le(e), t = tr(e), n = e.ownerDocument.body, o = ge(r.scrollWidth, r.clientWidth, n.scrollWidth, n.clientWidth), s = ge(r.scrollHeight, r.clientHeight, n.scrollHeight, n.clientHeight);
2463
+ let i = -t.scrollLeft + po(e);
2464
+ const a = -t.scrollTop;
2465
+ return Ae(n).direction === "rtl" && (i += ge(r.clientWidth, n.clientWidth) - o), {
2466
+ width: o,
2467
+ height: s,
2468
+ x: i,
2469
+ y: a
2470
+ };
2471
+ }
2472
+ function Gi(e, r) {
2473
+ const t = ye(e), n = Le(e), o = t.visualViewport;
2474
+ let s = n.clientWidth, i = n.clientHeight, a = 0, c = 0;
2475
+ if (o) {
2476
+ s = o.width, i = o.height;
2477
+ const u = Zr();
2478
+ (!u || u && r === "fixed") && (a = o.offsetLeft, c = o.offsetTop);
2479
+ }
2480
+ return {
2481
+ width: s,
2482
+ height: i,
2483
+ x: a,
2484
+ y: c
2485
+ };
2486
+ }
2487
+ function Zi(e, r) {
2488
+ const t = et(e, !0, r === "fixed"), n = t.top + e.clientTop, o = t.left + e.clientLeft, s = Oe(e) ? mt(e) : Ye(1), i = e.clientWidth * s.x, a = e.clientHeight * s.y, c = o * s.x, u = n * s.y;
2489
+ return {
2490
+ width: i,
2491
+ height: a,
2492
+ x: c,
2493
+ y: u
2494
+ };
2495
+ }
2496
+ function Rn(e, r, t) {
2497
+ let n;
2498
+ if (r === "viewport")
2499
+ n = Gi(e, t);
2500
+ else if (r === "document")
2501
+ n = Xi(Le(e));
2502
+ else if (Te(r))
2503
+ n = Zi(r, t);
2504
+ else {
2505
+ const o = ho(e);
2506
+ n = {
2507
+ ...r,
2508
+ x: r.x - o.x,
2509
+ y: r.y - o.y
2510
+ };
2511
+ }
2512
+ return Gt(n);
2513
+ }
2514
+ function mo(e, r) {
2515
+ const t = qe(e);
2516
+ return t === r || !Te(t) || gt(t) ? !1 : Ae(t).position === "fixed" || mo(t, r);
2517
+ }
2518
+ function Qi(e, r) {
2519
+ const t = r.get(e);
2520
+ if (t)
2521
+ return t;
2522
+ let n = _t(e, [], !1).filter((a) => Te(a) && xt(a) !== "body"), o = null;
2523
+ const s = Ae(e).position === "fixed";
2524
+ let i = s ? qe(e) : e;
2525
+ for (; Te(i) && !gt(i); ) {
2526
+ const a = Ae(i), c = Gr(i);
2527
+ !c && a.position === "fixed" && (o = null), (s ? !c && !o : !c && a.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || Tt(i) && !c && mo(e, i)) ? n = n.filter((f) => f !== i) : o = a, i = qe(i);
2528
+ }
2529
+ return r.set(e, n), n;
2530
+ }
2531
+ function Ji(e) {
2532
+ let {
2533
+ element: r,
2534
+ boundary: t,
2535
+ rootBoundary: n,
2536
+ strategy: o
2537
+ } = e;
2538
+ const i = [...t === "clippingAncestors" ? Jr(r) ? [] : Qi(r, this._c) : [].concat(t), n], a = i[0], c = i.reduce((u, f) => {
2539
+ const d = Rn(r, f, o);
2540
+ return u.top = ge(d.top, u.top), u.right = Ke(d.right, u.right), u.bottom = Ke(d.bottom, u.bottom), u.left = ge(d.left, u.left), u;
2541
+ }, Rn(r, a, o));
2542
+ return {
2543
+ width: c.right - c.left,
2544
+ height: c.bottom - c.top,
2545
+ x: c.left,
2546
+ y: c.top
2547
+ };
2548
+ }
2549
+ function ea(e) {
2550
+ const {
2551
+ width: r,
2552
+ height: t
2553
+ } = fo(e);
2554
+ return {
2555
+ width: r,
2556
+ height: t
2557
+ };
2558
+ }
2559
+ function ta(e, r, t) {
2560
+ const n = Oe(r), o = Le(r), s = t === "fixed", i = et(e, !0, s, r);
2561
+ let a = {
2562
+ scrollLeft: 0,
2563
+ scrollTop: 0
2564
+ };
2565
+ const c = Ye(0);
2566
+ if (n || !n && !s)
2567
+ if ((xt(r) !== "body" || Tt(o)) && (a = tr(r)), n) {
2568
+ const d = et(r, !0, s, r);
2569
+ c.x = d.x + r.clientLeft, c.y = d.y + r.clientTop;
2570
+ } else o && (c.x = po(o));
2571
+ const u = i.left + a.scrollLeft - c.x, f = i.top + a.scrollTop - c.y;
2572
+ return {
2573
+ x: u,
2574
+ y: f,
2575
+ width: i.width,
2576
+ height: i.height
2577
+ };
2578
+ }
2579
+ function Er(e) {
2580
+ return Ae(e).position === "static";
2581
+ }
2582
+ function Pn(e, r) {
2583
+ return !Oe(e) || Ae(e).position === "fixed" ? null : r ? r(e) : e.offsetParent;
2584
+ }
2585
+ function vo(e, r) {
2586
+ const t = ye(e);
2587
+ if (Jr(e))
2588
+ return t;
2589
+ if (!Oe(e)) {
2590
+ let o = qe(e);
2591
+ for (; o && !gt(o); ) {
2592
+ if (Te(o) && !Er(o))
2593
+ return o;
2594
+ o = qe(o);
2595
+ }
2596
+ return t;
2597
+ }
2598
+ let n = Pn(e, r);
2599
+ for (; n && Hi(n) && Er(n); )
2600
+ n = Pn(n, r);
2601
+ return n && gt(n) && Er(n) && !Gr(n) ? t : n || Ui(e) || t;
2602
+ }
2603
+ const ra = async function(e) {
2604
+ const r = this.getOffsetParent || vo, t = this.getDimensions, n = await t(e.floating);
2605
+ return {
2606
+ reference: ta(e.reference, await r(e.floating), e.strategy),
2607
+ floating: {
2608
+ x: 0,
2609
+ y: 0,
2610
+ width: n.width,
2611
+ height: n.height
2612
+ }
2613
+ };
2614
+ };
2615
+ function na(e) {
2616
+ return Ae(e).direction === "rtl";
2617
+ }
2618
+ const oa = {
2619
+ convertOffsetParentRelativeRectToViewportRelativeRect: Yi,
2620
+ getDocumentElement: Le,
2621
+ getClippingRect: Ji,
2622
+ getOffsetParent: vo,
2623
+ getElementRects: ra,
2624
+ getClientRects: qi,
2625
+ getDimensions: ea,
2626
+ getScale: mt,
2627
+ isElement: Te,
2628
+ isRTL: na
2629
+ };
2630
+ function sa(e, r) {
2631
+ let t = null, n;
2632
+ const o = Le(e);
2633
+ function s() {
2634
+ var a;
2635
+ clearTimeout(n), (a = t) == null || a.disconnect(), t = null;
2636
+ }
2637
+ function i(a, c) {
2638
+ a === void 0 && (a = !1), c === void 0 && (c = 1), s();
2639
+ const {
2640
+ left: u,
2641
+ top: f,
2642
+ width: d,
2643
+ height: g
2644
+ } = e.getBoundingClientRect();
2645
+ if (a || r(), !d || !g)
2646
+ return;
2647
+ const x = Nt(f), y = Nt(o.clientWidth - (u + d)), p = Nt(o.clientHeight - (f + g)), S = Nt(u), v = {
2648
+ rootMargin: -x + "px " + -y + "px " + -p + "px " + -S + "px",
2649
+ threshold: ge(0, Ke(1, c)) || 1
2650
+ };
2651
+ let C = !0;
2652
+ function R(w) {
2653
+ const A = w[0].intersectionRatio;
2654
+ if (A !== c) {
2655
+ if (!C)
2656
+ return i();
2657
+ A ? i(!1, A) : n = setTimeout(() => {
2658
+ i(!1, 1e-7);
2659
+ }, 1e3);
2660
+ }
2661
+ C = !1;
2662
+ }
2663
+ try {
2664
+ t = new IntersectionObserver(R, {
2665
+ ...v,
2666
+ // Handle <iframe>s
2667
+ root: o.ownerDocument
2668
+ });
2669
+ } catch {
2670
+ t = new IntersectionObserver(R, v);
2671
+ }
2672
+ t.observe(e);
2673
+ }
2674
+ return i(!0), s;
2675
+ }
2676
+ function ia(e, r, t, n) {
2677
+ n === void 0 && (n = {});
2678
+ const {
2679
+ ancestorScroll: o = !0,
2680
+ ancestorResize: s = !0,
2681
+ elementResize: i = typeof ResizeObserver == "function",
2682
+ layoutShift: a = typeof IntersectionObserver == "function",
2683
+ animationFrame: c = !1
2684
+ } = n, u = Qr(e), f = o || s ? [...u ? _t(u) : [], ..._t(r)] : [];
2685
+ f.forEach((b) => {
2686
+ o && b.addEventListener("scroll", t, {
2687
+ passive: !0
2688
+ }), s && b.addEventListener("resize", t);
2689
+ });
2690
+ const d = u && a ? sa(u, t) : null;
2691
+ let g = -1, x = null;
2692
+ i && (x = new ResizeObserver((b) => {
2693
+ let [v] = b;
2694
+ v && v.target === u && x && (x.unobserve(r), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
2695
+ var C;
2696
+ (C = x) == null || C.observe(r);
2697
+ })), t();
2698
+ }), u && !c && x.observe(u), x.observe(r));
2699
+ let y, p = c ? et(e) : null;
2700
+ c && S();
2701
+ function S() {
2702
+ const b = et(e);
2703
+ p && (b.x !== p.x || b.y !== p.y || b.width !== p.width || b.height !== p.height) && t(), p = b, y = requestAnimationFrame(S);
2704
+ }
2705
+ return t(), () => {
2706
+ var b;
2707
+ f.forEach((v) => {
2708
+ o && v.removeEventListener("scroll", t), s && v.removeEventListener("resize", t);
2709
+ }), d == null || d(), (b = x) == null || b.disconnect(), x = null, c && cancelAnimationFrame(y);
2710
+ };
2711
+ }
2712
+ const aa = Li, ca = ji, la = ki, ua = Wi, da = Ii, Tn = Mi, fa = Bi, ha = (e, r, t) => {
2713
+ const n = /* @__PURE__ */ new Map(), o = {
2714
+ platform: oa,
2715
+ ...t
2716
+ }, s = {
2717
+ ...o.platform,
2718
+ _c: n
2719
+ };
2720
+ return Di(e, r, {
2721
+ ...o,
2722
+ platform: s
2723
+ });
2724
+ }, pa = (e) => {
2725
+ function r(t) {
2726
+ return {}.hasOwnProperty.call(t, "current");
2727
+ }
2728
+ return {
2729
+ name: "arrow",
2730
+ options: e,
2731
+ fn(t) {
2732
+ const {
2733
+ element: n,
2734
+ padding: o
2735
+ } = typeof e == "function" ? e(t) : e;
2736
+ return n && r(n) ? n.current != null ? Tn({
2737
+ element: n.current,
2738
+ padding: o
2739
+ }).fn(t) : {} : n ? Tn({
2740
+ element: n,
2741
+ padding: o
2742
+ }).fn(t) : {};
2743
+ }
2744
+ };
2745
+ };
2746
+ var jt = typeof document < "u" ? Rs : Ps;
2747
+ function Zt(e, r) {
2748
+ if (e === r)
2749
+ return !0;
2750
+ if (typeof e != typeof r)
2751
+ return !1;
2752
+ if (typeof e == "function" && e.toString() === r.toString())
2753
+ return !0;
2754
+ let t, n, o;
2755
+ if (e && r && typeof e == "object") {
2756
+ if (Array.isArray(e)) {
2757
+ if (t = e.length, t !== r.length) return !1;
2758
+ for (n = t; n-- !== 0; )
2759
+ if (!Zt(e[n], r[n]))
2760
+ return !1;
2761
+ return !0;
2762
+ }
2763
+ if (o = Object.keys(e), t = o.length, t !== Object.keys(r).length)
2764
+ return !1;
2765
+ for (n = t; n-- !== 0; )
2766
+ if (!{}.hasOwnProperty.call(r, o[n]))
2767
+ return !1;
2768
+ for (n = t; n-- !== 0; ) {
2769
+ const s = o[n];
2770
+ if (!(s === "_owner" && e.$$typeof) && !Zt(e[s], r[s]))
2771
+ return !1;
2772
+ }
2773
+ return !0;
2774
+ }
2775
+ return e !== e && r !== r;
2776
+ }
2777
+ function go(e) {
2778
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
2779
+ }
2780
+ function On(e, r) {
2781
+ const t = go(e);
2782
+ return Math.round(r * t) / t;
2783
+ }
2784
+ function Fn(e) {
2785
+ const r = h.useRef(e);
2786
+ return jt(() => {
2787
+ r.current = e;
2788
+ }), r;
2789
+ }
2790
+ function ma(e) {
2791
+ e === void 0 && (e = {});
2792
+ const {
2793
+ placement: r = "bottom",
2794
+ strategy: t = "absolute",
2795
+ middleware: n = [],
2796
+ platform: o,
2797
+ elements: {
2798
+ reference: s,
2799
+ floating: i
2800
+ } = {},
2801
+ transform: a = !0,
2802
+ whileElementsMounted: c,
2803
+ open: u
2804
+ } = e, [f, d] = h.useState({
2805
+ x: 0,
2806
+ y: 0,
2807
+ strategy: t,
2808
+ placement: r,
2809
+ middlewareData: {},
2810
+ isPositioned: !1
2811
+ }), [g, x] = h.useState(n);
2812
+ Zt(g, n) || x(n);
2813
+ const [y, p] = h.useState(null), [S, b] = h.useState(null), v = h.useCallback((L) => {
2814
+ L !== A.current && (A.current = L, p(L));
2815
+ }, []), C = h.useCallback((L) => {
2816
+ L !== _.current && (_.current = L, b(L));
2817
+ }, []), R = s || y, w = i || S, A = h.useRef(null), _ = h.useRef(null), M = h.useRef(f), H = c != null, U = Fn(c), J = Fn(o), D = h.useCallback(() => {
2818
+ if (!A.current || !_.current)
2819
+ return;
2820
+ const L = {
2821
+ placement: r,
2822
+ strategy: t,
2823
+ middleware: g
2824
+ };
2825
+ J.current && (L.platform = J.current), ha(A.current, _.current, L).then((Z) => {
2826
+ const ee = {
2827
+ ...Z,
2828
+ isPositioned: !0
2829
+ };
2830
+ I.current && !Zt(M.current, ee) && (M.current = ee, Hr.flushSync(() => {
2831
+ d(ee);
2832
+ }));
2833
+ });
2834
+ }, [g, r, t, J]);
2835
+ jt(() => {
2836
+ u === !1 && M.current.isPositioned && (M.current.isPositioned = !1, d((L) => ({
2837
+ ...L,
2838
+ isPositioned: !1
2839
+ })));
2840
+ }, [u]);
2841
+ const I = h.useRef(!1);
2842
+ jt(() => (I.current = !0, () => {
2843
+ I.current = !1;
2844
+ }), []), jt(() => {
2845
+ if (R && (A.current = R), w && (_.current = w), R && w) {
2846
+ if (U.current)
2847
+ return U.current(R, w, D);
2848
+ D();
2849
+ }
2850
+ }, [R, w, D, U, H]);
2851
+ const B = h.useMemo(() => ({
2852
+ reference: A,
2853
+ floating: _,
2854
+ setReference: v,
2855
+ setFloating: C
2856
+ }), [v, C]), V = h.useMemo(() => ({
2857
+ reference: R,
2858
+ floating: w
2859
+ }), [R, w]), $ = h.useMemo(() => {
2860
+ const L = {
2861
+ position: t,
2862
+ left: 0,
2863
+ top: 0
2864
+ };
2865
+ if (!V.floating)
2866
+ return L;
2867
+ const Z = On(V.floating, f.x), ee = On(V.floating, f.y);
2868
+ return a ? {
2869
+ ...L,
2870
+ transform: "translate(" + Z + "px, " + ee + "px)",
2871
+ ...go(V.floating) >= 1.5 && {
2872
+ willChange: "transform"
2873
+ }
2874
+ } : {
2875
+ position: t,
2876
+ left: Z,
2877
+ top: ee
2878
+ };
2879
+ }, [t, a, V.floating, f.x, f.y]);
2880
+ return h.useMemo(() => ({
2881
+ ...f,
2882
+ update: D,
2883
+ refs: B,
2884
+ elements: V,
2885
+ floatingStyles: $
2886
+ }), [f, D, B, V, $]);
2887
+ }
2888
+ var va = "Arrow", yo = h.forwardRef((e, r) => {
2889
+ const { children: t, width: n = 10, height: o = 5, ...s } = e;
2890
+ return /* @__PURE__ */ P.jsx(
2891
+ oe.svg,
2892
+ {
2893
+ ...s,
2894
+ ref: r,
2895
+ width: n,
2896
+ height: o,
2897
+ viewBox: "0 0 30 10",
2898
+ preserveAspectRatio: "none",
2899
+ children: e.asChild ? t : /* @__PURE__ */ P.jsx("polygon", { points: "0,0 30,0 15,10" })
2900
+ }
2901
+ );
2902
+ });
2903
+ yo.displayName = va;
2904
+ var ga = yo;
2905
+ function ya(e) {
2906
+ const [r, t] = h.useState(void 0);
2907
+ return be(() => {
2908
+ if (e) {
2909
+ t({ width: e.offsetWidth, height: e.offsetHeight });
2910
+ const n = new ResizeObserver((o) => {
2911
+ if (!Array.isArray(o) || !o.length)
2912
+ return;
2913
+ const s = o[0];
2914
+ let i, a;
2915
+ if ("borderBoxSize" in s) {
2916
+ const c = s.borderBoxSize, u = Array.isArray(c) ? c[0] : c;
2917
+ i = u.inlineSize, a = u.blockSize;
2918
+ } else
2919
+ i = e.offsetWidth, a = e.offsetHeight;
2920
+ t({ width: i, height: a });
2921
+ });
2922
+ return n.observe(e, { box: "border-box" }), () => n.unobserve(e);
2923
+ } else
2924
+ t(void 0);
2925
+ }, [e]), r;
2926
+ }
2927
+ var en = "Popper", [wo, xo] = Br(en), [wa, bo] = wo(en), So = (e) => {
2928
+ const { __scopePopper: r, children: t } = e, [n, o] = h.useState(null);
2929
+ return /* @__PURE__ */ P.jsx(wa, { scope: r, anchor: n, onAnchorChange: o, children: t });
2930
+ };
2931
+ So.displayName = en;
2932
+ var Eo = "PopperAnchor", Co = h.forwardRef(
2933
+ (e, r) => {
2934
+ const { __scopePopper: t, virtualRef: n, ...o } = e, s = bo(Eo, t), i = h.useRef(null), a = le(r, i);
2935
+ return h.useEffect(() => {
2936
+ s.onAnchorChange((n == null ? void 0 : n.current) || i.current);
2937
+ }), n ? null : /* @__PURE__ */ P.jsx(oe.div, { ...o, ref: a });
2938
+ }
2939
+ );
2940
+ Co.displayName = Eo;
2941
+ var tn = "PopperContent", [xa, ba] = wo(tn), Ao = h.forwardRef(
2942
+ (e, r) => {
2943
+ var W, q, se, X, z, K;
2944
+ const {
2945
+ __scopePopper: t,
2946
+ side: n = "bottom",
2947
+ sideOffset: o = 0,
2948
+ align: s = "center",
2949
+ alignOffset: i = 0,
2950
+ arrowPadding: a = 0,
2951
+ avoidCollisions: c = !0,
2952
+ collisionBoundary: u = [],
2953
+ collisionPadding: f = 0,
2954
+ sticky: d = "partial",
2955
+ hideWhenDetached: g = !1,
2956
+ updatePositionStrategy: x = "optimized",
2957
+ onPlaced: y,
2958
+ ...p
2959
+ } = e, S = bo(tn, t), [b, v] = h.useState(null), C = le(r, (ue) => v(ue)), [R, w] = h.useState(null), A = ya(R), _ = (A == null ? void 0 : A.width) ?? 0, M = (A == null ? void 0 : A.height) ?? 0, H = n + (s !== "center" ? "-" + s : ""), U = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f }, J = Array.isArray(u) ? u : [u], D = J.length > 0, I = {
2960
+ padding: U,
2961
+ boundary: J.filter(Ea),
2962
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
2963
+ altBoundary: D
2964
+ }, { refs: B, floatingStyles: V, placement: $, isPositioned: L, middlewareData: Z } = ma({
2965
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
2966
+ strategy: "fixed",
2967
+ placement: H,
2968
+ whileElementsMounted: (...ue) => ia(...ue, {
2969
+ animationFrame: x === "always"
2970
+ }),
2971
+ elements: {
2972
+ reference: S.anchor
2973
+ },
2974
+ middleware: [
2975
+ aa({ mainAxis: o + M, alignmentAxis: i }),
2976
+ c && ca({
2977
+ mainAxis: !0,
2978
+ crossAxis: !1,
2979
+ limiter: d === "partial" ? fa() : void 0,
2980
+ ...I
2981
+ }),
2982
+ c && la({ ...I }),
2983
+ ua({
2984
+ ...I,
2985
+ apply: ({ elements: ue, rects: me, availableWidth: rt, availableHeight: nt }) => {
2986
+ const { width: ot, height: l } = me.reference, m = ue.floating.style;
2987
+ m.setProperty("--radix-popper-available-width", `${rt}px`), m.setProperty("--radix-popper-available-height", `${nt}px`), m.setProperty("--radix-popper-anchor-width", `${ot}px`), m.setProperty("--radix-popper-anchor-height", `${l}px`);
2988
+ }
2989
+ }),
2990
+ R && pa({ element: R, padding: a }),
2991
+ Ca({ arrowWidth: _, arrowHeight: M }),
2992
+ g && da({ strategy: "referenceHidden", ...I })
2993
+ ]
2994
+ }), [ee, Se] = Po($), we = Je(y);
2995
+ be(() => {
2996
+ L && (we == null || we());
2997
+ }, [L, we]);
2998
+ const je = (W = Z.arrow) == null ? void 0 : W.x, Ze = (q = Z.arrow) == null ? void 0 : q.y, Ee = ((se = Z.arrow) == null ? void 0 : se.centerOffset) !== 0, [Be, Ce] = h.useState();
2999
+ return be(() => {
3000
+ b && Ce(window.getComputedStyle(b).zIndex);
3001
+ }, [b]), /* @__PURE__ */ P.jsx(
3002
+ "div",
3003
+ {
3004
+ ref: B.setFloating,
3005
+ "data-radix-popper-content-wrapper": "",
3006
+ style: {
3007
+ ...V,
3008
+ transform: L ? V.transform : "translate(0, -200%)",
3009
+ // keep off the page when measuring
3010
+ minWidth: "max-content",
3011
+ zIndex: Be,
3012
+ "--radix-popper-transform-origin": [
3013
+ (X = Z.transformOrigin) == null ? void 0 : X.x,
3014
+ (z = Z.transformOrigin) == null ? void 0 : z.y
3015
+ ].join(" "),
3016
+ // hide the content if using the hide middleware and should be hidden
3017
+ // set visibility to hidden and disable pointer events so the UI behaves
3018
+ // as if the PopperContent isn't there at all
3019
+ ...((K = Z.hide) == null ? void 0 : K.referenceHidden) && {
3020
+ visibility: "hidden",
3021
+ pointerEvents: "none"
3022
+ }
3023
+ },
3024
+ dir: e.dir,
3025
+ children: /* @__PURE__ */ P.jsx(
3026
+ xa,
3027
+ {
3028
+ scope: t,
3029
+ placedSide: ee,
3030
+ onArrowChange: w,
3031
+ arrowX: je,
3032
+ arrowY: Ze,
3033
+ shouldHideArrow: Ee,
3034
+ children: /* @__PURE__ */ P.jsx(
3035
+ oe.div,
3036
+ {
3037
+ "data-side": ee,
3038
+ "data-align": Se,
3039
+ ...p,
3040
+ ref: C,
3041
+ style: {
3042
+ ...p.style,
3043
+ // if the PopperContent hasn't been placed yet (not all measurements done)
3044
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
3045
+ animation: L ? void 0 : "none"
3046
+ }
3047
+ }
3048
+ )
3049
+ }
3050
+ )
3051
+ }
3052
+ );
3053
+ }
3054
+ );
3055
+ Ao.displayName = tn;
3056
+ var _o = "PopperArrow", Sa = {
3057
+ top: "bottom",
3058
+ right: "left",
3059
+ bottom: "top",
3060
+ left: "right"
3061
+ }, Ro = h.forwardRef(function(r, t) {
3062
+ const { __scopePopper: n, ...o } = r, s = ba(_o, n), i = Sa[s.placedSide];
3063
+ return (
3064
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
3065
+ // doesn't report size as we'd expect on SVG elements.
3066
+ // it reports their bounding box which is effectively the largest path inside the SVG.
3067
+ /* @__PURE__ */ P.jsx(
3068
+ "span",
3069
+ {
3070
+ ref: s.onArrowChange,
3071
+ style: {
3072
+ position: "absolute",
3073
+ left: s.arrowX,
3074
+ top: s.arrowY,
3075
+ [i]: 0,
3076
+ transformOrigin: {
3077
+ top: "",
3078
+ right: "0 0",
3079
+ bottom: "center 0",
3080
+ left: "100% 0"
3081
+ }[s.placedSide],
3082
+ transform: {
3083
+ top: "translateY(100%)",
3084
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
3085
+ bottom: "rotate(180deg)",
3086
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
3087
+ }[s.placedSide],
3088
+ visibility: s.shouldHideArrow ? "hidden" : void 0
3089
+ },
3090
+ children: /* @__PURE__ */ P.jsx(
3091
+ ga,
3092
+ {
3093
+ ...o,
3094
+ ref: t,
3095
+ style: {
3096
+ ...o.style,
3097
+ // ensures the element can be measured correctly (mostly for if SVG)
3098
+ display: "block"
3099
+ }
3100
+ }
3101
+ )
3102
+ }
3103
+ )
3104
+ );
3105
+ });
3106
+ Ro.displayName = _o;
3107
+ function Ea(e) {
3108
+ return e !== null;
3109
+ }
3110
+ var Ca = (e) => ({
3111
+ name: "transformOrigin",
3112
+ options: e,
3113
+ fn(r) {
3114
+ var S, b, v;
3115
+ const { placement: t, rects: n, middlewareData: o } = r, i = ((S = o.arrow) == null ? void 0 : S.centerOffset) !== 0, a = i ? 0 : e.arrowWidth, c = i ? 0 : e.arrowHeight, [u, f] = Po(t), d = { start: "0%", center: "50%", end: "100%" }[f], g = (((b = o.arrow) == null ? void 0 : b.x) ?? 0) + a / 2, x = (((v = o.arrow) == null ? void 0 : v.y) ?? 0) + c / 2;
3116
+ let y = "", p = "";
3117
+ return u === "bottom" ? (y = i ? d : `${g}px`, p = `${-c}px`) : u === "top" ? (y = i ? d : `${g}px`, p = `${n.floating.height + c}px`) : u === "right" ? (y = `${-c}px`, p = i ? d : `${x}px`) : u === "left" && (y = `${n.floating.width + c}px`, p = i ? d : `${x}px`), { data: { x: y, y: p } };
3118
+ }
3119
+ });
3120
+ function Po(e) {
3121
+ const [r, t = "center"] = e.split("-");
3122
+ return [r, t];
3123
+ }
3124
+ var Aa = So, _a = Co, Ra = Ao, Pa = Ro, Ta = "Portal", To = h.forwardRef((e, r) => {
3125
+ var a;
3126
+ const { container: t, ...n } = e, [o, s] = h.useState(!1);
3127
+ be(() => s(!0), []);
3128
+ const i = t || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
3129
+ return i ? js.createPortal(/* @__PURE__ */ P.jsx(oe.div, { ...n, ref: r }), i) : null;
3130
+ });
3131
+ To.displayName = Ta;
3132
+ function Oa(e) {
3133
+ const r = h.useRef({ value: e, previous: e });
3134
+ return h.useMemo(() => (r.current.value !== e && (r.current.previous = r.current.value, r.current.value = e), r.current.previous), [e]);
3135
+ }
3136
+ var Fa = "VisuallyHidden", Oo = h.forwardRef(
3137
+ (e, r) => /* @__PURE__ */ P.jsx(
3138
+ oe.span,
3139
+ {
3140
+ ...e,
3141
+ ref: r,
3142
+ style: {
3143
+ // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
3144
+ position: "absolute",
3145
+ border: 0,
3146
+ width: 1,
3147
+ height: 1,
3148
+ padding: 0,
3149
+ margin: -1,
3150
+ overflow: "hidden",
3151
+ clip: "rect(0, 0, 0, 0)",
3152
+ whiteSpace: "nowrap",
3153
+ wordWrap: "normal",
3154
+ ...e.style
3155
+ }
3156
+ }
3157
+ )
3158
+ );
3159
+ Oo.displayName = Fa;
3160
+ var Na = function(e) {
3161
+ if (typeof document > "u")
3162
+ return null;
3163
+ var r = Array.isArray(e) ? e[0] : e;
3164
+ return r.ownerDocument.body;
3165
+ }, ut = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), Mt = {}, Cr = 0, Fo = function(e) {
3166
+ return e && (e.host || Fo(e.parentNode));
3167
+ }, Da = function(e, r) {
3168
+ return r.map(function(t) {
3169
+ if (e.contains(t))
3170
+ return t;
3171
+ var n = Fo(t);
3172
+ return n && e.contains(n) ? n : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
3173
+ }).filter(function(t) {
3174
+ return !!t;
3175
+ });
3176
+ }, Ma = function(e, r, t, n) {
3177
+ var o = Da(r, Array.isArray(e) ? e : [e]);
3178
+ Mt[t] || (Mt[t] = /* @__PURE__ */ new WeakMap());
3179
+ var s = Mt[t], i = [], a = /* @__PURE__ */ new Set(), c = new Set(o), u = function(d) {
3180
+ !d || a.has(d) || (a.add(d), u(d.parentNode));
3181
+ };
3182
+ o.forEach(u);
3183
+ var f = function(d) {
3184
+ !d || c.has(d) || Array.prototype.forEach.call(d.children, function(g) {
3185
+ if (a.has(g))
3186
+ f(g);
3187
+ else
3188
+ try {
3189
+ var x = g.getAttribute(n), y = x !== null && x !== "false", p = (ut.get(g) || 0) + 1, S = (s.get(g) || 0) + 1;
3190
+ ut.set(g, p), s.set(g, S), i.push(g), p === 1 && y && Dt.set(g, !0), S === 1 && g.setAttribute(t, "true"), y || g.setAttribute(n, "true");
3191
+ } catch (b) {
3192
+ console.error("aria-hidden: cannot operate on ", g, b);
3193
+ }
3194
+ });
3195
+ };
3196
+ return f(r), a.clear(), Cr++, function() {
3197
+ i.forEach(function(d) {
3198
+ var g = ut.get(d) - 1, x = s.get(d) - 1;
3199
+ ut.set(d, g), s.set(d, x), g || (Dt.has(d) || d.removeAttribute(n), Dt.delete(d)), x || d.removeAttribute(t);
3200
+ }), Cr--, Cr || (ut = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), Mt = {});
3201
+ };
3202
+ }, ka = function(e, r, t) {
3203
+ t === void 0 && (t = "data-aria-hidden");
3204
+ var n = Array.from(Array.isArray(e) ? e : [e]), o = Na(e);
3205
+ return o ? (n.push.apply(n, Array.from(o.querySelectorAll("[aria-live]"))), Ma(n, o, t, "aria-hidden")) : function() {
3206
+ return null;
3207
+ };
3208
+ }, Re = function() {
3209
+ return Re = Object.assign || function(r) {
3210
+ for (var t, n = 1, o = arguments.length; n < o; n++) {
3211
+ t = arguments[n];
3212
+ for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && (r[s] = t[s]);
3213
+ }
3214
+ return r;
3215
+ }, Re.apply(this, arguments);
3216
+ };
3217
+ function No(e, r) {
3218
+ var t = {};
3219
+ for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
3220
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
3221
+ for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++)
3222
+ r.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (t[n[o]] = e[n[o]]);
3223
+ return t;
3224
+ }
3225
+ function Ia(e, r, t) {
3226
+ if (t || arguments.length === 2) for (var n = 0, o = r.length, s; n < o; n++)
3227
+ (s || !(n in r)) && (s || (s = Array.prototype.slice.call(r, 0, n)), s[n] = r[n]);
3228
+ return e.concat(s || Array.prototype.slice.call(r));
3229
+ }
3230
+ var Bt = "right-scroll-bar-position", Wt = "width-before-scroll-bar", Va = "with-scroll-bars-hidden", La = "--removed-body-scroll-bar-size";
3231
+ function Ar(e, r) {
3232
+ return typeof e == "function" ? e(r) : e && (e.current = r), e;
3233
+ }
3234
+ function ja(e, r) {
3235
+ var t = Ts(function() {
3236
+ return {
3237
+ // value
3238
+ value: e,
3239
+ // last callback
3240
+ callback: r,
3241
+ // "memoized" public interface
3242
+ facade: {
3243
+ get current() {
3244
+ return t.value;
3245
+ },
3246
+ set current(n) {
3247
+ var o = t.value;
3248
+ o !== n && (t.value = n, t.callback(n, o));
3249
+ }
3250
+ }
3251
+ };
3252
+ })[0];
3253
+ return t.callback = r, t.facade;
3254
+ }
3255
+ var Ba = typeof window < "u" ? h.useLayoutEffect : h.useEffect, Nn = /* @__PURE__ */ new WeakMap();
3256
+ function Wa(e, r) {
3257
+ var t = ja(null, function(n) {
3258
+ return e.forEach(function(o) {
3259
+ return Ar(o, n);
3260
+ });
3261
+ });
3262
+ return Ba(function() {
3263
+ var n = Nn.get(t);
3264
+ if (n) {
3265
+ var o = new Set(n), s = new Set(e), i = t.current;
3266
+ o.forEach(function(a) {
3267
+ s.has(a) || Ar(a, null);
3268
+ }), s.forEach(function(a) {
3269
+ o.has(a) || Ar(a, i);
3270
+ });
3271
+ }
3272
+ Nn.set(t, e);
3273
+ }, [e]), t;
3274
+ }
3275
+ function Ha(e) {
3276
+ return e;
3277
+ }
3278
+ function Ua(e, r) {
3279
+ r === void 0 && (r = Ha);
3280
+ var t = [], n = !1, o = {
3281
+ read: function() {
3282
+ if (n)
3283
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
3284
+ return t.length ? t[t.length - 1] : e;
3285
+ },
3286
+ useMedium: function(s) {
3287
+ var i = r(s, n);
3288
+ return t.push(i), function() {
3289
+ t = t.filter(function(a) {
3290
+ return a !== i;
3291
+ });
3292
+ };
3293
+ },
3294
+ assignSyncMedium: function(s) {
3295
+ for (n = !0; t.length; ) {
3296
+ var i = t;
3297
+ t = [], i.forEach(s);
3298
+ }
3299
+ t = {
3300
+ push: function(a) {
3301
+ return s(a);
3302
+ },
3303
+ filter: function() {
3304
+ return t;
3305
+ }
3306
+ };
3307
+ },
3308
+ assignMedium: function(s) {
3309
+ n = !0;
3310
+ var i = [];
3311
+ if (t.length) {
3312
+ var a = t;
3313
+ t = [], a.forEach(s), i = t;
3314
+ }
3315
+ var c = function() {
3316
+ var f = i;
3317
+ i = [], f.forEach(s);
3318
+ }, u = function() {
3319
+ return Promise.resolve().then(c);
3320
+ };
3321
+ u(), t = {
3322
+ push: function(f) {
3323
+ i.push(f), u();
3324
+ },
3325
+ filter: function(f) {
3326
+ return i = i.filter(f), t;
3327
+ }
3328
+ };
3329
+ }
3330
+ };
3331
+ return o;
3332
+ }
3333
+ function $a(e) {
3334
+ e === void 0 && (e = {});
3335
+ var r = Ua(null);
3336
+ return r.options = Re({ async: !0, ssr: !1 }, e), r;
3337
+ }
3338
+ var Do = function(e) {
3339
+ var r = e.sideCar, t = No(e, ["sideCar"]);
3340
+ if (!r)
3341
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
3342
+ var n = r.read();
3343
+ if (!n)
3344
+ throw new Error("Sidecar medium not found");
3345
+ return h.createElement(n, Re({}, t));
3346
+ };
3347
+ Do.isSideCarExport = !0;
3348
+ function za(e, r) {
3349
+ return e.useMedium(r), Do;
3350
+ }
3351
+ var Mo = $a(), _r = function() {
3352
+ }, rr = h.forwardRef(function(e, r) {
3353
+ var t = h.useRef(null), n = h.useState({
3354
+ onScrollCapture: _r,
3355
+ onWheelCapture: _r,
3356
+ onTouchMoveCapture: _r
3357
+ }), o = n[0], s = n[1], i = e.forwardProps, a = e.children, c = e.className, u = e.removeScrollBar, f = e.enabled, d = e.shards, g = e.sideCar, x = e.noIsolation, y = e.inert, p = e.allowPinchZoom, S = e.as, b = S === void 0 ? "div" : S, v = e.gapMode, C = No(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), R = g, w = Wa([t, r]), A = Re(Re({}, C), o);
3358
+ return h.createElement(
3359
+ h.Fragment,
3360
+ null,
3361
+ f && h.createElement(R, { sideCar: Mo, removeScrollBar: u, shards: d, noIsolation: x, inert: y, setCallbacks: s, allowPinchZoom: !!p, lockRef: t, gapMode: v }),
3362
+ i ? h.cloneElement(h.Children.only(a), Re(Re({}, A), { ref: w })) : h.createElement(b, Re({}, A, { className: c, ref: w }), a)
3363
+ );
3364
+ });
3365
+ rr.defaultProps = {
3366
+ enabled: !0,
3367
+ removeScrollBar: !0,
3368
+ inert: !1
3369
+ };
3370
+ rr.classNames = {
3371
+ fullWidth: Wt,
3372
+ zeroRight: Bt
3373
+ };
3374
+ var Ka = function() {
3375
+ if (typeof __webpack_nonce__ < "u")
3376
+ return __webpack_nonce__;
3377
+ };
3378
+ function Ya() {
3379
+ if (!document)
3380
+ return null;
3381
+ var e = document.createElement("style");
3382
+ e.type = "text/css";
3383
+ var r = Ka();
3384
+ return r && e.setAttribute("nonce", r), e;
3385
+ }
3386
+ function qa(e, r) {
3387
+ e.styleSheet ? e.styleSheet.cssText = r : e.appendChild(document.createTextNode(r));
3388
+ }
3389
+ function Xa(e) {
3390
+ var r = document.head || document.getElementsByTagName("head")[0];
3391
+ r.appendChild(e);
3392
+ }
3393
+ var Ga = function() {
3394
+ var e = 0, r = null;
3395
+ return {
3396
+ add: function(t) {
3397
+ e == 0 && (r = Ya()) && (qa(r, t), Xa(r)), e++;
3398
+ },
3399
+ remove: function() {
3400
+ e--, !e && r && (r.parentNode && r.parentNode.removeChild(r), r = null);
3401
+ }
3402
+ };
3403
+ }, Za = function() {
3404
+ var e = Ga();
3405
+ return function(r, t) {
3406
+ h.useEffect(function() {
3407
+ return e.add(r), function() {
3408
+ e.remove();
3409
+ };
3410
+ }, [r && t]);
3411
+ };
3412
+ }, ko = function() {
3413
+ var e = Za(), r = function(t) {
3414
+ var n = t.styles, o = t.dynamic;
3415
+ return e(n, o), null;
3416
+ };
3417
+ return r;
3418
+ }, Qa = {
3419
+ left: 0,
3420
+ top: 0,
3421
+ right: 0,
3422
+ gap: 0
3423
+ }, Rr = function(e) {
3424
+ return parseInt(e || "", 10) || 0;
3425
+ }, Ja = function(e) {
3426
+ var r = window.getComputedStyle(document.body), t = r[e === "padding" ? "paddingLeft" : "marginLeft"], n = r[e === "padding" ? "paddingTop" : "marginTop"], o = r[e === "padding" ? "paddingRight" : "marginRight"];
3427
+ return [Rr(t), Rr(n), Rr(o)];
3428
+ }, ec = function(e) {
3429
+ if (e === void 0 && (e = "margin"), typeof window > "u")
3430
+ return Qa;
3431
+ var r = Ja(e), t = document.documentElement.clientWidth, n = window.innerWidth;
3432
+ return {
3433
+ left: r[0],
3434
+ top: r[1],
3435
+ right: r[2],
3436
+ gap: Math.max(0, n - t + r[2] - r[0])
3437
+ };
3438
+ }, tc = ko(), vt = "data-scroll-locked", rc = function(e, r, t, n) {
3439
+ var o = e.left, s = e.top, i = e.right, a = e.gap;
3440
+ return t === void 0 && (t = "margin"), `
3441
+ .`.concat(Va, ` {
3442
+ overflow: hidden `).concat(n, `;
3443
+ padding-right: `).concat(a, "px ").concat(n, `;
3444
+ }
3445
+ body[`).concat(vt, `] {
3446
+ overflow: hidden `).concat(n, `;
3447
+ overscroll-behavior: contain;
3448
+ `).concat([
3449
+ r && "position: relative ".concat(n, ";"),
3450
+ t === "margin" && `
3451
+ padding-left: `.concat(o, `px;
3452
+ padding-top: `).concat(s, `px;
3453
+ padding-right: `).concat(i, `px;
3454
+ margin-left:0;
3455
+ margin-top:0;
3456
+ margin-right: `).concat(a, "px ").concat(n, `;
3457
+ `),
3458
+ t === "padding" && "padding-right: ".concat(a, "px ").concat(n, ";")
3459
+ ].filter(Boolean).join(""), `
3460
+ }
3461
+
3462
+ .`).concat(Bt, ` {
3463
+ right: `).concat(a, "px ").concat(n, `;
3464
+ }
3465
+
3466
+ .`).concat(Wt, ` {
3467
+ margin-right: `).concat(a, "px ").concat(n, `;
3468
+ }
3469
+
3470
+ .`).concat(Bt, " .").concat(Bt, ` {
3471
+ right: 0 `).concat(n, `;
3472
+ }
3473
+
3474
+ .`).concat(Wt, " .").concat(Wt, ` {
3475
+ margin-right: 0 `).concat(n, `;
3476
+ }
3477
+
3478
+ body[`).concat(vt, `] {
3479
+ `).concat(La, ": ").concat(a, `px;
3480
+ }
3481
+ `);
3482
+ }, Dn = function() {
3483
+ var e = parseInt(document.body.getAttribute(vt) || "0", 10);
3484
+ return isFinite(e) ? e : 0;
3485
+ }, nc = function() {
3486
+ h.useEffect(function() {
3487
+ return document.body.setAttribute(vt, (Dn() + 1).toString()), function() {
3488
+ var e = Dn() - 1;
3489
+ e <= 0 ? document.body.removeAttribute(vt) : document.body.setAttribute(vt, e.toString());
3490
+ };
3491
+ }, []);
3492
+ }, oc = function(e) {
3493
+ var r = e.noRelative, t = e.noImportant, n = e.gapMode, o = n === void 0 ? "margin" : n;
3494
+ nc();
3495
+ var s = h.useMemo(function() {
3496
+ return ec(o);
3497
+ }, [o]);
3498
+ return h.createElement(tc, { styles: rc(s, !r, o, t ? "" : "!important") });
3499
+ }, Mr = !1;
3500
+ if (typeof window < "u")
3501
+ try {
3502
+ var kt = Object.defineProperty({}, "passive", {
3503
+ get: function() {
3504
+ return Mr = !0, !0;
3505
+ }
3506
+ });
3507
+ window.addEventListener("test", kt, kt), window.removeEventListener("test", kt, kt);
3508
+ } catch {
3509
+ Mr = !1;
3510
+ }
3511
+ var dt = Mr ? { passive: !1 } : !1, sc = function(e) {
3512
+ return e.tagName === "TEXTAREA";
3513
+ }, Io = function(e, r) {
3514
+ var t = window.getComputedStyle(e);
3515
+ return (
3516
+ // not-not-scrollable
3517
+ t[r] !== "hidden" && // contains scroll inside self
3518
+ !(t.overflowY === t.overflowX && !sc(e) && t[r] === "visible")
3519
+ );
3520
+ }, ic = function(e) {
3521
+ return Io(e, "overflowY");
3522
+ }, ac = function(e) {
3523
+ return Io(e, "overflowX");
3524
+ }, Mn = function(e, r) {
3525
+ var t = r.ownerDocument, n = r;
3526
+ do {
3527
+ typeof ShadowRoot < "u" && n instanceof ShadowRoot && (n = n.host);
3528
+ var o = Vo(e, n);
3529
+ if (o) {
3530
+ var s = Lo(e, n), i = s[1], a = s[2];
3531
+ if (i > a)
3532
+ return !0;
3533
+ }
3534
+ n = n.parentNode;
3535
+ } while (n && n !== t.body);
3536
+ return !1;
3537
+ }, cc = function(e) {
3538
+ var r = e.scrollTop, t = e.scrollHeight, n = e.clientHeight;
3539
+ return [
3540
+ r,
3541
+ t,
3542
+ n
3543
+ ];
3544
+ }, lc = function(e) {
3545
+ var r = e.scrollLeft, t = e.scrollWidth, n = e.clientWidth;
3546
+ return [
3547
+ r,
3548
+ t,
3549
+ n
3550
+ ];
3551
+ }, Vo = function(e, r) {
3552
+ return e === "v" ? ic(r) : ac(r);
3553
+ }, Lo = function(e, r) {
3554
+ return e === "v" ? cc(r) : lc(r);
3555
+ }, uc = function(e, r) {
3556
+ return e === "h" && r === "rtl" ? -1 : 1;
3557
+ }, dc = function(e, r, t, n, o) {
3558
+ var s = uc(e, window.getComputedStyle(r).direction), i = s * n, a = t.target, c = r.contains(a), u = !1, f = i > 0, d = 0, g = 0;
3559
+ do {
3560
+ var x = Lo(e, a), y = x[0], p = x[1], S = x[2], b = p - S - s * y;
3561
+ (y || b) && Vo(e, a) && (d += b, g += y), a instanceof ShadowRoot ? a = a.host : a = a.parentNode;
3562
+ } while (
3563
+ // portaled content
3564
+ !c && a !== document.body || // self content
3565
+ c && (r.contains(a) || r === a)
3566
+ );
3567
+ return (f && (Math.abs(d) < 1 || !o) || !f && (Math.abs(g) < 1 || !o)) && (u = !0), u;
3568
+ }, It = function(e) {
3569
+ return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
3570
+ }, kn = function(e) {
3571
+ return [e.deltaX, e.deltaY];
3572
+ }, In = function(e) {
3573
+ return e && "current" in e ? e.current : e;
3574
+ }, fc = function(e, r) {
3575
+ return e[0] === r[0] && e[1] === r[1];
3576
+ }, hc = function(e) {
3577
+ return `
3578
+ .block-interactivity-`.concat(e, ` {pointer-events: none;}
3579
+ .allow-interactivity-`).concat(e, ` {pointer-events: all;}
3580
+ `);
3581
+ }, pc = 0, ft = [];
3582
+ function mc(e) {
3583
+ var r = h.useRef([]), t = h.useRef([0, 0]), n = h.useRef(), o = h.useState(pc++)[0], s = h.useState(ko)[0], i = h.useRef(e);
3584
+ h.useEffect(function() {
3585
+ i.current = e;
3586
+ }, [e]), h.useEffect(function() {
3587
+ if (e.inert) {
3588
+ document.body.classList.add("block-interactivity-".concat(o));
3589
+ var p = Ia([e.lockRef.current], (e.shards || []).map(In), !0).filter(Boolean);
3590
+ return p.forEach(function(S) {
3591
+ return S.classList.add("allow-interactivity-".concat(o));
3592
+ }), function() {
3593
+ document.body.classList.remove("block-interactivity-".concat(o)), p.forEach(function(S) {
3594
+ return S.classList.remove("allow-interactivity-".concat(o));
3595
+ });
3596
+ };
3597
+ }
3598
+ }, [e.inert, e.lockRef.current, e.shards]);
3599
+ var a = h.useCallback(function(p, S) {
3600
+ if ("touches" in p && p.touches.length === 2)
3601
+ return !i.current.allowPinchZoom;
3602
+ var b = It(p), v = t.current, C = "deltaX" in p ? p.deltaX : v[0] - b[0], R = "deltaY" in p ? p.deltaY : v[1] - b[1], w, A = p.target, _ = Math.abs(C) > Math.abs(R) ? "h" : "v";
3603
+ if ("touches" in p && _ === "h" && A.type === "range")
3604
+ return !1;
3605
+ var M = Mn(_, A);
3606
+ if (!M)
3607
+ return !0;
3608
+ if (M ? w = _ : (w = _ === "v" ? "h" : "v", M = Mn(_, A)), !M)
3609
+ return !1;
3610
+ if (!n.current && "changedTouches" in p && (C || R) && (n.current = w), !w)
3611
+ return !0;
3612
+ var H = n.current || w;
3613
+ return dc(H, S, p, H === "h" ? C : R, !0);
3614
+ }, []), c = h.useCallback(function(p) {
3615
+ var S = p;
3616
+ if (!(!ft.length || ft[ft.length - 1] !== s)) {
3617
+ var b = "deltaY" in S ? kn(S) : It(S), v = r.current.filter(function(w) {
3618
+ return w.name === S.type && (w.target === S.target || S.target === w.shadowParent) && fc(w.delta, b);
3619
+ })[0];
3620
+ if (v && v.should) {
3621
+ S.cancelable && S.preventDefault();
3622
+ return;
3623
+ }
3624
+ if (!v) {
3625
+ var C = (i.current.shards || []).map(In).filter(Boolean).filter(function(w) {
3626
+ return w.contains(S.target);
3627
+ }), R = C.length > 0 ? a(S, C[0]) : !i.current.noIsolation;
3628
+ R && S.cancelable && S.preventDefault();
3629
+ }
3630
+ }
3631
+ }, []), u = h.useCallback(function(p, S, b, v) {
3632
+ var C = { name: p, delta: S, target: b, should: v, shadowParent: vc(b) };
3633
+ r.current.push(C), setTimeout(function() {
3634
+ r.current = r.current.filter(function(R) {
3635
+ return R !== C;
3636
+ });
3637
+ }, 1);
3638
+ }, []), f = h.useCallback(function(p) {
3639
+ t.current = It(p), n.current = void 0;
3640
+ }, []), d = h.useCallback(function(p) {
3641
+ u(p.type, kn(p), p.target, a(p, e.lockRef.current));
3642
+ }, []), g = h.useCallback(function(p) {
3643
+ u(p.type, It(p), p.target, a(p, e.lockRef.current));
3644
+ }, []);
3645
+ h.useEffect(function() {
3646
+ return ft.push(s), e.setCallbacks({
3647
+ onScrollCapture: d,
3648
+ onWheelCapture: d,
3649
+ onTouchMoveCapture: g
3650
+ }), document.addEventListener("wheel", c, dt), document.addEventListener("touchmove", c, dt), document.addEventListener("touchstart", f, dt), function() {
3651
+ ft = ft.filter(function(p) {
3652
+ return p !== s;
3653
+ }), document.removeEventListener("wheel", c, dt), document.removeEventListener("touchmove", c, dt), document.removeEventListener("touchstart", f, dt);
3654
+ };
3655
+ }, []);
3656
+ var x = e.removeScrollBar, y = e.inert;
3657
+ return h.createElement(
3658
+ h.Fragment,
3659
+ null,
3660
+ y ? h.createElement(s, { styles: hc(o) }) : null,
3661
+ x ? h.createElement(oc, { gapMode: e.gapMode }) : null
3662
+ );
3663
+ }
3664
+ function vc(e) {
3665
+ for (var r = null; e !== null; )
3666
+ e instanceof ShadowRoot && (r = e.host, e = e.host), e = e.parentNode;
3667
+ return r;
3668
+ }
3669
+ const gc = za(Mo, mc);
3670
+ var jo = h.forwardRef(function(e, r) {
3671
+ return h.createElement(rr, Re({}, e, { ref: r, sideCar: gc }));
3672
+ });
3673
+ jo.classNames = rr.classNames;
3674
+ var yc = [" ", "Enter", "ArrowUp", "ArrowDown"], wc = [" ", "Enter"], Ot = "Select", [nr, or, xc] = ii(Ot), [bt, al] = Br(Ot, [
3675
+ xc,
3676
+ xo
3677
+ ]), sr = xo(), [bc, Xe] = bt(Ot), [Sc, Ec] = bt(Ot), Bo = (e) => {
3678
+ const {
3679
+ __scopeSelect: r,
3680
+ children: t,
3681
+ open: n,
3682
+ defaultOpen: o,
3683
+ onOpenChange: s,
3684
+ value: i,
3685
+ defaultValue: a,
3686
+ onValueChange: c,
3687
+ dir: u,
3688
+ name: f,
3689
+ autoComplete: d,
3690
+ disabled: g,
3691
+ required: x
3692
+ } = e, y = sr(r), [p, S] = h.useState(null), [b, v] = h.useState(null), [C, R] = h.useState(!1), w = ci(u), [A = !1, _] = an({
3693
+ prop: n,
3694
+ defaultProp: o,
3695
+ onChange: s
3696
+ }), [M, H] = an({
3697
+ prop: i,
3698
+ defaultProp: a,
3699
+ onChange: c
3700
+ }), U = h.useRef(null), J = p ? !!p.closest("form") : !0, [D, I] = h.useState(/* @__PURE__ */ new Set()), B = Array.from(D).map((V) => V.props.value).join(";");
3701
+ return /* @__PURE__ */ P.jsx(Aa, { ...y, children: /* @__PURE__ */ P.jsxs(
3702
+ bc,
3703
+ {
3704
+ required: x,
3705
+ scope: r,
3706
+ trigger: p,
3707
+ onTriggerChange: S,
3708
+ valueNode: b,
3709
+ onValueNodeChange: v,
3710
+ valueNodeHasChildren: C,
3711
+ onValueNodeHasChildrenChange: R,
3712
+ contentId: Wr(),
3713
+ value: M,
3714
+ onValueChange: H,
3715
+ open: A,
3716
+ onOpenChange: _,
3717
+ dir: w,
3718
+ triggerPointerDownPosRef: U,
3719
+ disabled: g,
3720
+ children: [
3721
+ /* @__PURE__ */ P.jsx(nr.Provider, { scope: r, children: /* @__PURE__ */ P.jsx(
3722
+ Sc,
3723
+ {
3724
+ scope: e.__scopeSelect,
3725
+ onNativeOptionAdd: h.useCallback((V) => {
3726
+ I(($) => new Set($).add(V));
3727
+ }, []),
3728
+ onNativeOptionRemove: h.useCallback((V) => {
3729
+ I(($) => {
3730
+ const L = new Set($);
3731
+ return L.delete(V), L;
3732
+ });
3733
+ }, []),
3734
+ children: t
3735
+ }
3736
+ ) }),
3737
+ J ? /* @__PURE__ */ P.jsxs(
3738
+ fs,
3739
+ {
3740
+ "aria-hidden": !0,
3741
+ required: x,
3742
+ tabIndex: -1,
3743
+ name: f,
3744
+ autoComplete: d,
3745
+ value: M,
3746
+ onChange: (V) => H(V.target.value),
3747
+ disabled: g,
3748
+ children: [
3749
+ M === void 0 ? /* @__PURE__ */ P.jsx("option", { value: "" }) : null,
3750
+ Array.from(D)
3751
+ ]
3752
+ },
3753
+ B
3754
+ ) : null
3755
+ ]
3756
+ }
3757
+ ) });
3758
+ };
3759
+ Bo.displayName = Ot;
3760
+ var Wo = "SelectTrigger", Ho = h.forwardRef(
3761
+ (e, r) => {
3762
+ const { __scopeSelect: t, disabled: n = !1, ...o } = e, s = sr(t), i = Xe(Wo, t), a = i.disabled || n, c = le(r, i.onTriggerChange), u = or(t), [f, d, g] = hs((y) => {
3763
+ const p = u().filter((v) => !v.disabled), S = p.find((v) => v.value === i.value), b = ps(p, y, S);
3764
+ b !== void 0 && i.onValueChange(b.value);
3765
+ }), x = () => {
3766
+ a || (i.onOpenChange(!0), g());
3767
+ };
3768
+ return /* @__PURE__ */ P.jsx(_a, { asChild: !0, ...s, children: /* @__PURE__ */ P.jsx(
3769
+ oe.button,
3770
+ {
3771
+ type: "button",
3772
+ role: "combobox",
3773
+ "aria-controls": i.contentId,
3774
+ "aria-expanded": i.open,
3775
+ "aria-required": i.required,
3776
+ "aria-autocomplete": "none",
3777
+ dir: i.dir,
3778
+ "data-state": i.open ? "open" : "closed",
3779
+ disabled: a,
3780
+ "data-disabled": a ? "" : void 0,
3781
+ "data-placeholder": ds(i.value) ? "" : void 0,
3782
+ ...o,
3783
+ ref: c,
3784
+ onClick: ce(o.onClick, (y) => {
3785
+ y.currentTarget.focus();
3786
+ }),
3787
+ onPointerDown: ce(o.onPointerDown, (y) => {
3788
+ const p = y.target;
3789
+ p.hasPointerCapture(y.pointerId) && p.releasePointerCapture(y.pointerId), y.button === 0 && y.ctrlKey === !1 && (x(), i.triggerPointerDownPosRef.current = {
3790
+ x: Math.round(y.pageX),
3791
+ y: Math.round(y.pageY)
3792
+ }, y.preventDefault());
3793
+ }),
3794
+ onKeyDown: ce(o.onKeyDown, (y) => {
3795
+ const p = f.current !== "";
3796
+ !(y.ctrlKey || y.altKey || y.metaKey) && y.key.length === 1 && d(y.key), !(p && y.key === " ") && yc.includes(y.key) && (x(), y.preventDefault());
3797
+ })
3798
+ }
3799
+ ) });
3800
+ }
3801
+ );
3802
+ Ho.displayName = Wo;
3803
+ var Uo = "SelectValue", $o = h.forwardRef(
3804
+ (e, r) => {
3805
+ const { __scopeSelect: t, className: n, style: o, children: s, placeholder: i = "", ...a } = e, c = Xe(Uo, t), { onValueNodeHasChildrenChange: u } = c, f = s !== void 0, d = le(r, c.onValueNodeChange);
3806
+ return be(() => {
3807
+ u(f);
3808
+ }, [u, f]), /* @__PURE__ */ P.jsx(
3809
+ oe.span,
3810
+ {
3811
+ ...a,
3812
+ ref: d,
3813
+ style: { pointerEvents: "none" },
3814
+ children: ds(c.value) ? /* @__PURE__ */ P.jsx(P.Fragment, { children: i }) : s
3815
+ }
3816
+ );
3817
+ }
3818
+ );
3819
+ $o.displayName = Uo;
3820
+ var Cc = "SelectIcon", zo = h.forwardRef(
3821
+ (e, r) => {
3822
+ const { __scopeSelect: t, children: n, ...o } = e;
3823
+ return /* @__PURE__ */ P.jsx(oe.span, { "aria-hidden": !0, ...o, ref: r, children: n || "▼" });
3824
+ }
3825
+ );
3826
+ zo.displayName = Cc;
3827
+ var Ac = "SelectPortal", Ko = (e) => /* @__PURE__ */ P.jsx(To, { asChild: !0, ...e });
3828
+ Ko.displayName = Ac;
3829
+ var tt = "SelectContent", Yo = h.forwardRef(
3830
+ (e, r) => {
3831
+ const t = Xe(tt, e.__scopeSelect), [n, o] = h.useState();
3832
+ if (be(() => {
3833
+ o(new DocumentFragment());
3834
+ }, []), !t.open) {
3835
+ const s = n;
3836
+ return s ? Hr.createPortal(
3837
+ /* @__PURE__ */ P.jsx(qo, { scope: e.__scopeSelect, children: /* @__PURE__ */ P.jsx(nr.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ P.jsx("div", { children: e.children }) }) }),
3838
+ s
3839
+ ) : null;
3840
+ }
3841
+ return /* @__PURE__ */ P.jsx(Xo, { ...e, ref: r });
3842
+ }
3843
+ );
3844
+ Yo.displayName = tt;
3845
+ var Ne = 10, [qo, Ge] = bt(tt), _c = "SelectContentImpl", Xo = h.forwardRef(
3846
+ (e, r) => {
3847
+ const {
3848
+ __scopeSelect: t,
3849
+ position: n = "item-aligned",
3850
+ onCloseAutoFocus: o,
3851
+ onEscapeKeyDown: s,
3852
+ onPointerDownOutside: i,
3853
+ //
3854
+ // PopperContent props
3855
+ side: a,
3856
+ sideOffset: c,
3857
+ align: u,
3858
+ alignOffset: f,
3859
+ arrowPadding: d,
3860
+ collisionBoundary: g,
3861
+ collisionPadding: x,
3862
+ sticky: y,
3863
+ hideWhenDetached: p,
3864
+ avoidCollisions: S,
3865
+ //
3866
+ ...b
3867
+ } = e, v = Xe(tt, t), [C, R] = h.useState(null), [w, A] = h.useState(null), _ = le(r, (W) => R(W)), [M, H] = h.useState(null), [U, J] = h.useState(
3868
+ null
3869
+ ), D = or(t), [I, B] = h.useState(!1), V = h.useRef(!1);
3870
+ h.useEffect(() => {
3871
+ if (C) return ka(C);
3872
+ }, [C]), gi();
3873
+ const $ = h.useCallback(
3874
+ (W) => {
3875
+ const [q, ...se] = D().map((K) => K.ref.current), [X] = se.slice(-1), z = document.activeElement;
3876
+ for (const K of W)
3877
+ if (K === z || (K == null || K.scrollIntoView({ block: "nearest" }), K === q && w && (w.scrollTop = 0), K === X && w && (w.scrollTop = w.scrollHeight), K == null || K.focus(), document.activeElement !== z)) return;
3878
+ },
3879
+ [D, w]
3880
+ ), L = h.useCallback(
3881
+ () => $([M, C]),
3882
+ [$, M, C]
3883
+ );
3884
+ h.useEffect(() => {
3885
+ I && L();
3886
+ }, [I, L]);
3887
+ const { onOpenChange: Z, triggerPointerDownPosRef: ee } = v;
3888
+ h.useEffect(() => {
3889
+ if (C) {
3890
+ let W = { x: 0, y: 0 };
3891
+ const q = (X) => {
3892
+ var z, K;
3893
+ W = {
3894
+ x: Math.abs(Math.round(X.pageX) - (((z = ee.current) == null ? void 0 : z.x) ?? 0)),
3895
+ y: Math.abs(Math.round(X.pageY) - (((K = ee.current) == null ? void 0 : K.y) ?? 0))
3896
+ };
3897
+ }, se = (X) => {
3898
+ W.x <= 10 && W.y <= 10 ? X.preventDefault() : C.contains(X.target) || Z(!1), document.removeEventListener("pointermove", q), ee.current = null;
3899
+ };
3900
+ return ee.current !== null && (document.addEventListener("pointermove", q), document.addEventListener("pointerup", se, { capture: !0, once: !0 })), () => {
3901
+ document.removeEventListener("pointermove", q), document.removeEventListener("pointerup", se, { capture: !0 });
3902
+ };
3903
+ }
3904
+ }, [C, Z, ee]), h.useEffect(() => {
3905
+ const W = () => Z(!1);
3906
+ return window.addEventListener("blur", W), window.addEventListener("resize", W), () => {
3907
+ window.removeEventListener("blur", W), window.removeEventListener("resize", W);
3908
+ };
3909
+ }, [Z]);
3910
+ const [Se, we] = hs((W) => {
3911
+ const q = D().filter((z) => !z.disabled), se = q.find((z) => z.ref.current === document.activeElement), X = ps(q, W, se);
3912
+ X && setTimeout(() => X.ref.current.focus());
3913
+ }), je = h.useCallback(
3914
+ (W, q, se) => {
3915
+ const X = !V.current && !se;
3916
+ (v.value !== void 0 && v.value === q || X) && (H(W), X && (V.current = !0));
3917
+ },
3918
+ [v.value]
3919
+ ), Ze = h.useCallback(() => C == null ? void 0 : C.focus(), [C]), Ee = h.useCallback(
3920
+ (W, q, se) => {
3921
+ const X = !V.current && !se;
3922
+ (v.value !== void 0 && v.value === q || X) && J(W);
3923
+ },
3924
+ [v.value]
3925
+ ), Be = n === "popper" ? kr : Go, Ce = Be === kr ? {
3926
+ side: a,
3927
+ sideOffset: c,
3928
+ align: u,
3929
+ alignOffset: f,
3930
+ arrowPadding: d,
3931
+ collisionBoundary: g,
3932
+ collisionPadding: x,
3933
+ sticky: y,
3934
+ hideWhenDetached: p,
3935
+ avoidCollisions: S
3936
+ } : {};
3937
+ return /* @__PURE__ */ P.jsx(
3938
+ qo,
3939
+ {
3940
+ scope: t,
3941
+ content: C,
3942
+ viewport: w,
3943
+ onViewportChange: A,
3944
+ itemRefCallback: je,
3945
+ selectedItem: M,
3946
+ onItemLeave: Ze,
3947
+ itemTextRefCallback: Ee,
3948
+ focusSelectedItem: L,
3949
+ selectedItemText: U,
3950
+ position: n,
3951
+ isPositioned: I,
3952
+ searchRef: Se,
3953
+ children: /* @__PURE__ */ P.jsx(jo, { as: Ht, allowPinchZoom: !0, children: /* @__PURE__ */ P.jsx(
3954
+ io,
3955
+ {
3956
+ asChild: !0,
3957
+ trapped: v.open,
3958
+ onMountAutoFocus: (W) => {
3959
+ W.preventDefault();
3960
+ },
3961
+ onUnmountAutoFocus: ce(o, (W) => {
3962
+ var q;
3963
+ (q = v.trigger) == null || q.focus({ preventScroll: !0 }), W.preventDefault();
3964
+ }),
3965
+ children: /* @__PURE__ */ P.jsx(
3966
+ oo,
3967
+ {
3968
+ asChild: !0,
3969
+ disableOutsidePointerEvents: !0,
3970
+ onEscapeKeyDown: s,
3971
+ onPointerDownOutside: i,
3972
+ onFocusOutside: (W) => W.preventDefault(),
3973
+ onDismiss: () => v.onOpenChange(!1),
3974
+ children: /* @__PURE__ */ P.jsx(
3975
+ Be,
3976
+ {
3977
+ role: "listbox",
3978
+ id: v.contentId,
3979
+ "data-state": v.open ? "open" : "closed",
3980
+ dir: v.dir,
3981
+ onContextMenu: (W) => W.preventDefault(),
3982
+ ...b,
3983
+ ...Ce,
3984
+ onPlaced: () => B(!0),
3985
+ ref: _,
3986
+ style: {
3987
+ // flex layout so we can place the scroll buttons properly
3988
+ display: "flex",
3989
+ flexDirection: "column",
3990
+ // reset the outline by default as the content MAY get focused
3991
+ outline: "none",
3992
+ ...b.style
3993
+ },
3994
+ onKeyDown: ce(b.onKeyDown, (W) => {
3995
+ const q = W.ctrlKey || W.altKey || W.metaKey;
3996
+ if (W.key === "Tab" && W.preventDefault(), !q && W.key.length === 1 && we(W.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(W.key)) {
3997
+ let X = D().filter((z) => !z.disabled).map((z) => z.ref.current);
3998
+ if (["ArrowUp", "End"].includes(W.key) && (X = X.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(W.key)) {
3999
+ const z = W.target, K = X.indexOf(z);
4000
+ X = X.slice(K + 1);
4001
+ }
4002
+ setTimeout(() => $(X)), W.preventDefault();
4003
+ }
4004
+ })
4005
+ }
4006
+ )
4007
+ }
4008
+ )
4009
+ }
4010
+ ) })
4011
+ }
4012
+ );
4013
+ }
4014
+ );
4015
+ Xo.displayName = _c;
4016
+ var Rc = "SelectItemAlignedPosition", Go = h.forwardRef((e, r) => {
4017
+ const { __scopeSelect: t, onPlaced: n, ...o } = e, s = Xe(tt, t), i = Ge(tt, t), [a, c] = h.useState(null), [u, f] = h.useState(null), d = le(r, (_) => f(_)), g = or(t), x = h.useRef(!1), y = h.useRef(!0), { viewport: p, selectedItem: S, selectedItemText: b, focusSelectedItem: v } = i, C = h.useCallback(() => {
4018
+ if (s.trigger && s.valueNode && a && u && p && S && b) {
4019
+ const _ = s.trigger.getBoundingClientRect(), M = u.getBoundingClientRect(), H = s.valueNode.getBoundingClientRect(), U = b.getBoundingClientRect();
4020
+ if (s.dir !== "rtl") {
4021
+ const z = U.left - M.left, K = H.left - z, ue = _.left - K, me = _.width + ue, rt = Math.max(me, M.width), nt = window.innerWidth - Ne, ot = mn(K, [Ne, nt - rt]);
4022
+ a.style.minWidth = me + "px", a.style.left = ot + "px";
4023
+ } else {
4024
+ const z = M.right - U.right, K = window.innerWidth - H.right - z, ue = window.innerWidth - _.right - K, me = _.width + ue, rt = Math.max(me, M.width), nt = window.innerWidth - Ne, ot = mn(K, [Ne, nt - rt]);
4025
+ a.style.minWidth = me + "px", a.style.right = ot + "px";
4026
+ }
4027
+ const J = g(), D = window.innerHeight - Ne * 2, I = p.scrollHeight, B = window.getComputedStyle(u), V = parseInt(B.borderTopWidth, 10), $ = parseInt(B.paddingTop, 10), L = parseInt(B.borderBottomWidth, 10), Z = parseInt(B.paddingBottom, 10), ee = V + $ + I + Z + L, Se = Math.min(S.offsetHeight * 5, ee), we = window.getComputedStyle(p), je = parseInt(we.paddingTop, 10), Ze = parseInt(we.paddingBottom, 10), Ee = _.top + _.height / 2 - Ne, Be = D - Ee, Ce = S.offsetHeight / 2, W = S.offsetTop + Ce, q = V + $ + W, se = ee - q;
4028
+ if (q <= Ee) {
4029
+ const z = S === J[J.length - 1].ref.current;
4030
+ a.style.bottom = "0px";
4031
+ const K = u.clientHeight - p.offsetTop - p.offsetHeight, ue = Math.max(
4032
+ Be,
4033
+ Ce + // viewport might have padding bottom, include it to avoid a scrollable viewport
4034
+ (z ? Ze : 0) + K + L
4035
+ ), me = q + ue;
4036
+ a.style.height = me + "px";
4037
+ } else {
4038
+ const z = S === J[0].ref.current;
4039
+ a.style.top = "0px";
4040
+ const ue = Math.max(
4041
+ Ee,
4042
+ V + p.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
4043
+ (z ? je : 0) + Ce
4044
+ ) + se;
4045
+ a.style.height = ue + "px", p.scrollTop = q - Ee + p.offsetTop;
4046
+ }
4047
+ a.style.margin = `${Ne}px 0`, a.style.minHeight = Se + "px", a.style.maxHeight = D + "px", n == null || n(), requestAnimationFrame(() => x.current = !0);
4048
+ }
4049
+ }, [
4050
+ g,
4051
+ s.trigger,
4052
+ s.valueNode,
4053
+ a,
4054
+ u,
4055
+ p,
4056
+ S,
4057
+ b,
4058
+ s.dir,
4059
+ n
4060
+ ]);
4061
+ be(() => C(), [C]);
4062
+ const [R, w] = h.useState();
4063
+ be(() => {
4064
+ u && w(window.getComputedStyle(u).zIndex);
4065
+ }, [u]);
4066
+ const A = h.useCallback(
4067
+ (_) => {
4068
+ _ && y.current === !0 && (C(), v == null || v(), y.current = !1);
4069
+ },
4070
+ [C, v]
4071
+ );
4072
+ return /* @__PURE__ */ P.jsx(
4073
+ Tc,
4074
+ {
4075
+ scope: t,
4076
+ contentWrapper: a,
4077
+ shouldExpandOnScrollRef: x,
4078
+ onScrollButtonChange: A,
4079
+ children: /* @__PURE__ */ P.jsx(
4080
+ "div",
4081
+ {
4082
+ ref: c,
4083
+ style: {
4084
+ display: "flex",
4085
+ flexDirection: "column",
4086
+ position: "fixed",
4087
+ zIndex: R
4088
+ },
4089
+ children: /* @__PURE__ */ P.jsx(
4090
+ oe.div,
4091
+ {
4092
+ ...o,
4093
+ ref: d,
4094
+ style: {
4095
+ // When we get the height of the content, it includes borders. If we were to set
4096
+ // the height without having `boxSizing: 'border-box'` it would be too big.
4097
+ boxSizing: "border-box",
4098
+ // We need to ensure the content doesn't get taller than the wrapper
4099
+ maxHeight: "100%",
4100
+ ...o.style
4101
+ }
4102
+ }
4103
+ )
4104
+ }
4105
+ )
4106
+ }
4107
+ );
4108
+ });
4109
+ Go.displayName = Rc;
4110
+ var Pc = "SelectPopperPosition", kr = h.forwardRef((e, r) => {
4111
+ const {
4112
+ __scopeSelect: t,
4113
+ align: n = "start",
4114
+ collisionPadding: o = Ne,
4115
+ ...s
4116
+ } = e, i = sr(t);
4117
+ return /* @__PURE__ */ P.jsx(
4118
+ Ra,
4119
+ {
4120
+ ...i,
4121
+ ...s,
4122
+ ref: r,
4123
+ align: n,
4124
+ collisionPadding: o,
4125
+ style: {
4126
+ // Ensure border-box for floating-ui calculations
4127
+ boxSizing: "border-box",
4128
+ ...s.style,
4129
+ "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
4130
+ "--radix-select-content-available-width": "var(--radix-popper-available-width)",
4131
+ "--radix-select-content-available-height": "var(--radix-popper-available-height)",
4132
+ "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
4133
+ "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
4134
+ }
4135
+ }
4136
+ );
4137
+ });
4138
+ kr.displayName = Pc;
4139
+ var [Tc, rn] = bt(tt, {}), Ir = "SelectViewport", Zo = h.forwardRef(
4140
+ (e, r) => {
4141
+ const { __scopeSelect: t, nonce: n, ...o } = e, s = Ge(Ir, t), i = rn(Ir, t), a = le(r, s.onViewportChange), c = h.useRef(0);
4142
+ return /* @__PURE__ */ P.jsxs(P.Fragment, { children: [
4143
+ /* @__PURE__ */ P.jsx(
4144
+ "style",
4145
+ {
4146
+ dangerouslySetInnerHTML: {
4147
+ __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
4148
+ },
4149
+ nonce: n
4150
+ }
4151
+ ),
4152
+ /* @__PURE__ */ P.jsx(nr.Slot, { scope: t, children: /* @__PURE__ */ P.jsx(
4153
+ oe.div,
4154
+ {
4155
+ "data-radix-select-viewport": "",
4156
+ role: "presentation",
4157
+ ...o,
4158
+ ref: a,
4159
+ style: {
4160
+ // we use position: 'relative' here on the `viewport` so that when we call
4161
+ // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
4162
+ // (independent of the scrollUpButton).
4163
+ position: "relative",
4164
+ flex: 1,
4165
+ overflow: "auto",
4166
+ ...o.style
4167
+ },
4168
+ onScroll: ce(o.onScroll, (u) => {
4169
+ const f = u.currentTarget, { contentWrapper: d, shouldExpandOnScrollRef: g } = i;
4170
+ if (g != null && g.current && d) {
4171
+ const x = Math.abs(c.current - f.scrollTop);
4172
+ if (x > 0) {
4173
+ const y = window.innerHeight - Ne * 2, p = parseFloat(d.style.minHeight), S = parseFloat(d.style.height), b = Math.max(p, S);
4174
+ if (b < y) {
4175
+ const v = b + x, C = Math.min(y, v), R = v - C;
4176
+ d.style.height = C + "px", d.style.bottom === "0px" && (f.scrollTop = R > 0 ? R : 0, d.style.justifyContent = "flex-end");
4177
+ }
4178
+ }
4179
+ }
4180
+ c.current = f.scrollTop;
4181
+ })
4182
+ }
4183
+ ) })
4184
+ ] });
4185
+ }
4186
+ );
4187
+ Zo.displayName = Ir;
4188
+ var Qo = "SelectGroup", [Oc, Fc] = bt(Qo), Jo = h.forwardRef(
4189
+ (e, r) => {
4190
+ const { __scopeSelect: t, ...n } = e, o = Wr();
4191
+ return /* @__PURE__ */ P.jsx(Oc, { scope: t, id: o, children: /* @__PURE__ */ P.jsx(oe.div, { role: "group", "aria-labelledby": o, ...n, ref: r }) });
4192
+ }
4193
+ );
4194
+ Jo.displayName = Qo;
4195
+ var es = "SelectLabel", ts = h.forwardRef(
4196
+ (e, r) => {
4197
+ const { __scopeSelect: t, ...n } = e, o = Fc(es, t);
4198
+ return /* @__PURE__ */ P.jsx(oe.div, { id: o.id, ...n, ref: r });
4199
+ }
4200
+ );
4201
+ ts.displayName = es;
4202
+ var Qt = "SelectItem", [Nc, rs] = bt(Qt), ns = h.forwardRef(
4203
+ (e, r) => {
4204
+ const {
4205
+ __scopeSelect: t,
4206
+ value: n,
4207
+ disabled: o = !1,
4208
+ textValue: s,
4209
+ ...i
4210
+ } = e, a = Xe(Qt, t), c = Ge(Qt, t), u = a.value === n, [f, d] = h.useState(s ?? ""), [g, x] = h.useState(!1), y = le(
4211
+ r,
4212
+ (b) => {
4213
+ var v;
4214
+ return (v = c.itemRefCallback) == null ? void 0 : v.call(c, b, n, o);
4215
+ }
4216
+ ), p = Wr(), S = () => {
4217
+ o || (a.onValueChange(n), a.onOpenChange(!1));
4218
+ };
4219
+ if (n === "")
4220
+ throw new Error(
4221
+ "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
4222
+ );
4223
+ return /* @__PURE__ */ P.jsx(
4224
+ Nc,
4225
+ {
4226
+ scope: t,
4227
+ value: n,
4228
+ disabled: o,
4229
+ textId: p,
4230
+ isSelected: u,
4231
+ onItemTextChange: h.useCallback((b) => {
4232
+ d((v) => v || ((b == null ? void 0 : b.textContent) ?? "").trim());
4233
+ }, []),
4234
+ children: /* @__PURE__ */ P.jsx(
4235
+ nr.ItemSlot,
4236
+ {
4237
+ scope: t,
4238
+ value: n,
4239
+ disabled: o,
4240
+ textValue: f,
4241
+ children: /* @__PURE__ */ P.jsx(
4242
+ oe.div,
4243
+ {
4244
+ role: "option",
4245
+ "aria-labelledby": p,
4246
+ "data-highlighted": g ? "" : void 0,
4247
+ "aria-selected": u && g,
4248
+ "data-state": u ? "checked" : "unchecked",
4249
+ "aria-disabled": o || void 0,
4250
+ "data-disabled": o ? "" : void 0,
4251
+ tabIndex: o ? void 0 : -1,
4252
+ ...i,
4253
+ ref: y,
4254
+ onFocus: ce(i.onFocus, () => x(!0)),
4255
+ onBlur: ce(i.onBlur, () => x(!1)),
4256
+ onPointerUp: ce(i.onPointerUp, S),
4257
+ onPointerMove: ce(i.onPointerMove, (b) => {
4258
+ var v;
4259
+ o ? (v = c.onItemLeave) == null || v.call(c) : b.currentTarget.focus({ preventScroll: !0 });
4260
+ }),
4261
+ onPointerLeave: ce(i.onPointerLeave, (b) => {
4262
+ var v;
4263
+ b.currentTarget === document.activeElement && ((v = c.onItemLeave) == null || v.call(c));
4264
+ }),
4265
+ onKeyDown: ce(i.onKeyDown, (b) => {
4266
+ var C;
4267
+ ((C = c.searchRef) == null ? void 0 : C.current) !== "" && b.key === " " || (wc.includes(b.key) && S(), b.key === " " && b.preventDefault());
4268
+ })
4269
+ }
4270
+ )
4271
+ }
4272
+ )
4273
+ }
4274
+ );
4275
+ }
4276
+ );
4277
+ ns.displayName = Qt;
4278
+ var Et = "SelectItemText", os = h.forwardRef(
4279
+ (e, r) => {
4280
+ const { __scopeSelect: t, className: n, style: o, ...s } = e, i = Xe(Et, t), a = Ge(Et, t), c = rs(Et, t), u = Ec(Et, t), [f, d] = h.useState(null), g = le(
4281
+ r,
4282
+ (b) => d(b),
4283
+ c.onItemTextChange,
4284
+ (b) => {
4285
+ var v;
4286
+ return (v = a.itemTextRefCallback) == null ? void 0 : v.call(a, b, c.value, c.disabled);
4287
+ }
4288
+ ), x = f == null ? void 0 : f.textContent, y = h.useMemo(
4289
+ () => /* @__PURE__ */ P.jsx("option", { value: c.value, disabled: c.disabled, children: x }, c.value),
4290
+ [c.disabled, c.value, x]
4291
+ ), { onNativeOptionAdd: p, onNativeOptionRemove: S } = u;
4292
+ return be(() => (p(y), () => S(y)), [p, S, y]), /* @__PURE__ */ P.jsxs(P.Fragment, { children: [
4293
+ /* @__PURE__ */ P.jsx(oe.span, { id: c.textId, ...s, ref: g }),
4294
+ c.isSelected && i.valueNode && !i.valueNodeHasChildren ? Hr.createPortal(s.children, i.valueNode) : null
4295
+ ] });
4296
+ }
4297
+ );
4298
+ os.displayName = Et;
4299
+ var ss = "SelectItemIndicator", is = h.forwardRef(
4300
+ (e, r) => {
4301
+ const { __scopeSelect: t, ...n } = e;
4302
+ return rs(ss, t).isSelected ? /* @__PURE__ */ P.jsx(oe.span, { "aria-hidden": !0, ...n, ref: r }) : null;
4303
+ }
4304
+ );
4305
+ is.displayName = ss;
4306
+ var Vr = "SelectScrollUpButton", as = h.forwardRef((e, r) => {
4307
+ const t = Ge(Vr, e.__scopeSelect), n = rn(Vr, e.__scopeSelect), [o, s] = h.useState(!1), i = le(r, n.onScrollButtonChange);
4308
+ return be(() => {
4309
+ if (t.viewport && t.isPositioned) {
4310
+ let a = function() {
4311
+ const u = c.scrollTop > 0;
4312
+ s(u);
4313
+ };
4314
+ const c = t.viewport;
4315
+ return a(), c.addEventListener("scroll", a), () => c.removeEventListener("scroll", a);
4316
+ }
4317
+ }, [t.viewport, t.isPositioned]), o ? /* @__PURE__ */ P.jsx(
4318
+ ls,
4319
+ {
4320
+ ...e,
4321
+ ref: i,
4322
+ onAutoScroll: () => {
4323
+ const { viewport: a, selectedItem: c } = t;
4324
+ a && c && (a.scrollTop = a.scrollTop - c.offsetHeight);
4325
+ }
4326
+ }
4327
+ ) : null;
4328
+ });
4329
+ as.displayName = Vr;
4330
+ var Lr = "SelectScrollDownButton", cs = h.forwardRef((e, r) => {
4331
+ const t = Ge(Lr, e.__scopeSelect), n = rn(Lr, e.__scopeSelect), [o, s] = h.useState(!1), i = le(r, n.onScrollButtonChange);
4332
+ return be(() => {
4333
+ if (t.viewport && t.isPositioned) {
4334
+ let a = function() {
4335
+ const u = c.scrollHeight - c.clientHeight, f = Math.ceil(c.scrollTop) < u;
4336
+ s(f);
4337
+ };
4338
+ const c = t.viewport;
4339
+ return a(), c.addEventListener("scroll", a), () => c.removeEventListener("scroll", a);
4340
+ }
4341
+ }, [t.viewport, t.isPositioned]), o ? /* @__PURE__ */ P.jsx(
4342
+ ls,
4343
+ {
4344
+ ...e,
4345
+ ref: i,
4346
+ onAutoScroll: () => {
4347
+ const { viewport: a, selectedItem: c } = t;
4348
+ a && c && (a.scrollTop = a.scrollTop + c.offsetHeight);
4349
+ }
4350
+ }
4351
+ ) : null;
4352
+ });
4353
+ cs.displayName = Lr;
4354
+ var ls = h.forwardRef((e, r) => {
4355
+ const { __scopeSelect: t, onAutoScroll: n, ...o } = e, s = Ge("SelectScrollButton", t), i = h.useRef(null), a = or(t), c = h.useCallback(() => {
4356
+ i.current !== null && (window.clearInterval(i.current), i.current = null);
4357
+ }, []);
4358
+ return h.useEffect(() => () => c(), [c]), be(() => {
4359
+ var f;
4360
+ const u = a().find((d) => d.ref.current === document.activeElement);
4361
+ (f = u == null ? void 0 : u.ref.current) == null || f.scrollIntoView({ block: "nearest" });
4362
+ }, [a]), /* @__PURE__ */ P.jsx(
4363
+ oe.div,
4364
+ {
4365
+ "aria-hidden": !0,
4366
+ ...o,
4367
+ ref: r,
4368
+ style: { flexShrink: 0, ...o.style },
4369
+ onPointerDown: ce(o.onPointerDown, () => {
4370
+ i.current === null && (i.current = window.setInterval(n, 50));
4371
+ }),
4372
+ onPointerMove: ce(o.onPointerMove, () => {
4373
+ var u;
4374
+ (u = s.onItemLeave) == null || u.call(s), i.current === null && (i.current = window.setInterval(n, 50));
4375
+ }),
4376
+ onPointerLeave: ce(o.onPointerLeave, () => {
4377
+ c();
4378
+ })
4379
+ }
4380
+ );
4381
+ }), Dc = "SelectSeparator", us = h.forwardRef(
4382
+ (e, r) => {
4383
+ const { __scopeSelect: t, ...n } = e;
4384
+ return /* @__PURE__ */ P.jsx(oe.div, { "aria-hidden": !0, ...n, ref: r });
4385
+ }
4386
+ );
4387
+ us.displayName = Dc;
4388
+ var jr = "SelectArrow", Mc = h.forwardRef(
4389
+ (e, r) => {
4390
+ const { __scopeSelect: t, ...n } = e, o = sr(t), s = Xe(jr, t), i = Ge(jr, t);
4391
+ return s.open && i.position === "popper" ? /* @__PURE__ */ P.jsx(Pa, { ...o, ...n, ref: r }) : null;
4392
+ }
4393
+ );
4394
+ Mc.displayName = jr;
4395
+ function ds(e) {
4396
+ return e === "" || e === void 0;
4397
+ }
4398
+ var fs = h.forwardRef(
4399
+ (e, r) => {
4400
+ const { value: t, ...n } = e, o = h.useRef(null), s = le(r, o), i = Oa(t);
4401
+ return h.useEffect(() => {
4402
+ const a = o.current, c = window.HTMLSelectElement.prototype, f = Object.getOwnPropertyDescriptor(
4403
+ c,
4404
+ "value"
4405
+ ).set;
4406
+ if (i !== t && f) {
4407
+ const d = new Event("change", { bubbles: !0 });
4408
+ f.call(a, t), a.dispatchEvent(d);
4409
+ }
4410
+ }, [i, t]), /* @__PURE__ */ P.jsx(Oo, { asChild: !0, children: /* @__PURE__ */ P.jsx("select", { ...n, ref: s, defaultValue: t }) });
4411
+ }
4412
+ );
4413
+ fs.displayName = "BubbleSelect";
4414
+ function hs(e) {
4415
+ const r = Je(e), t = h.useRef(""), n = h.useRef(0), o = h.useCallback(
4416
+ (i) => {
4417
+ const a = t.current + i;
4418
+ r(a), function c(u) {
4419
+ t.current = u, window.clearTimeout(n.current), u !== "" && (n.current = window.setTimeout(() => c(""), 1e3));
4420
+ }(a);
4421
+ },
4422
+ [r]
4423
+ ), s = h.useCallback(() => {
4424
+ t.current = "", window.clearTimeout(n.current);
4425
+ }, []);
4426
+ return h.useEffect(() => () => window.clearTimeout(n.current), []), [t, o, s];
4427
+ }
4428
+ function ps(e, r, t) {
4429
+ const o = r.length > 1 && Array.from(r).every((u) => u === r[0]) ? r[0] : r, s = t ? e.indexOf(t) : -1;
4430
+ let i = kc(e, Math.max(s, 0));
4431
+ o.length === 1 && (i = i.filter((u) => u !== t));
4432
+ const c = i.find(
4433
+ (u) => u.textValue.toLowerCase().startsWith(o.toLowerCase())
4434
+ );
4435
+ return c !== t ? c : void 0;
4436
+ }
4437
+ function kc(e, r) {
4438
+ return e.map((t, n) => e[(r + n) % e.length]);
4439
+ }
4440
+ var Ic = Bo, ms = Ho, Vc = $o, Lc = zo, jc = Ko, vs = Yo, Bc = Zo, Wc = Jo, gs = ts, ys = ns, Hc = os, Uc = is, ws = as, xs = cs, bs = us;
4441
+ const cl = Ic, ll = Wc, ul = Vc, $c = h.forwardRef(({ className: e, children: r, ...t }, n) => /* @__PURE__ */ P.jsxs(
4442
+ ms,
4443
+ {
4444
+ ref: n,
4445
+ className: ke(
4446
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
4447
+ e
4448
+ ),
4449
+ ...t,
4450
+ children: [
4451
+ /* @__PURE__ */ P.jsx("span", { className: "truncate", children: r }),
4452
+ /* @__PURE__ */ P.jsx(Lc, { asChild: !0, children: /* @__PURE__ */ P.jsx(Bn, { className: "flex-shrink-0 h-4 w-4 opacity-50" }) })
4453
+ ]
4454
+ }
4455
+ ));
4456
+ $c.displayName = ms.displayName;
4457
+ const Ss = h.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ P.jsx(
4458
+ ws,
4459
+ {
4460
+ ref: t,
4461
+ className: ke(
4462
+ "flex cursor-default items-center justify-center py-1",
4463
+ e
4464
+ ),
4465
+ ...r,
4466
+ children: /* @__PURE__ */ P.jsx(Bs, { className: "h-4 w-4" })
4467
+ }
4468
+ ));
4469
+ Ss.displayName = ws.displayName;
4470
+ const Es = h.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ P.jsx(
4471
+ xs,
4472
+ {
4473
+ ref: t,
4474
+ className: ke(
4475
+ "flex cursor-default items-center justify-center py-1",
4476
+ e
4477
+ ),
4478
+ ...r,
4479
+ children: /* @__PURE__ */ P.jsx(Bn, { className: "h-4 w-4" })
4480
+ }
4481
+ ));
4482
+ Es.displayName = xs.displayName;
4483
+ const zc = h.forwardRef(({ className: e, children: r, position: t = "popper", ...n }, o) => /* @__PURE__ */ P.jsx(jc, { children: /* @__PURE__ */ P.jsxs(
4484
+ vs,
4485
+ {
4486
+ ref: o,
4487
+ className: ke(
4488
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",
4489
+ t === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
4490
+ e
4491
+ ),
4492
+ position: t,
4493
+ ...n,
4494
+ children: [
4495
+ /* @__PURE__ */ P.jsx(Ss, {}),
4496
+ /* @__PURE__ */ P.jsx(
4497
+ Bc,
4498
+ {
4499
+ className: ke(
4500
+ "p-1",
4501
+ t === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
4502
+ ),
4503
+ children: r
4504
+ }
4505
+ ),
4506
+ /* @__PURE__ */ P.jsx(Es, {})
4507
+ ]
4508
+ }
4509
+ ) }));
4510
+ zc.displayName = vs.displayName;
4511
+ const Kc = h.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ P.jsx(
4512
+ gs,
4513
+ {
4514
+ ref: t,
4515
+ className: ke("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
4516
+ ...r
4517
+ }
4518
+ ));
4519
+ Kc.displayName = gs.displayName;
4520
+ const Yc = h.forwardRef(({ className: e, children: r, ...t }, n) => /* @__PURE__ */ P.jsxs(
4521
+ ys,
4522
+ {
4523
+ ref: n,
4524
+ className: ke(
4525
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
4526
+ e
4527
+ ),
4528
+ ...t,
4529
+ children: [
4530
+ /* @__PURE__ */ P.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ P.jsx(Uc, { children: /* @__PURE__ */ P.jsx(Ls, { className: "h-4 w-4" }) }) }),
4531
+ /* @__PURE__ */ P.jsx(Hc, { children: r })
4532
+ ]
4533
+ }
4534
+ ));
4535
+ Yc.displayName = ys.displayName;
4536
+ const qc = h.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ P.jsx(
4537
+ bs,
4538
+ {
4539
+ ref: t,
4540
+ className: ke("-mx-1 my-1 h-px bg-muted", e),
4541
+ ...r
4542
+ }
4543
+ ));
4544
+ qc.displayName = bs.displayName;
4545
+ export {
4546
+ Us as B,
4547
+ ol as C,
4548
+ oo as D,
4549
+ io as F,
4550
+ To as P,
4551
+ jo as R,
4552
+ cl as S,
4553
+ Oo as V,
4554
+ rl as a,
4555
+ $c as b,
4556
+ ul as c,
4557
+ zc as d,
4558
+ ll as e,
4559
+ Yc as f,
4560
+ ii as g,
4561
+ ci as h,
4562
+ ka as i,
4563
+ gi as j,
4564
+ sl as k,
4565
+ Ys as l,
4566
+ Jt as m,
4567
+ nl as n,
4568
+ il as u
4569
+ };