@uifn/svelte 0.0.1

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 (154) hide show
  1. package/README.md +70 -0
  2. package/dist/index.js +4249 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/index.mjs +4122 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/package.json +64 -0
  7. package/src/Accordion.svelte +56 -0
  8. package/src/AccordionContent.svelte +23 -0
  9. package/src/AccordionItem.svelte +37 -0
  10. package/src/AccordionTrigger.svelte +35 -0
  11. package/src/AlertDialog.svelte +46 -0
  12. package/src/AlertDialogAction.svelte +22 -0
  13. package/src/AlertDialogCancel.svelte +22 -0
  14. package/src/AlertDialogContent.svelte +50 -0
  15. package/src/AlertDialogDescription.svelte +15 -0
  16. package/src/AlertDialogOverlay.svelte +20 -0
  17. package/src/AlertDialogPortal.svelte +18 -0
  18. package/src/AlertDialogTitle.svelte +15 -0
  19. package/src/AlertDialogTrigger.svelte +31 -0
  20. package/src/Avatar.svelte +35 -0
  21. package/src/AvatarFallback.svelte +32 -0
  22. package/src/AvatarImage.svelte +53 -0
  23. package/src/Badge.svelte +19 -0
  24. package/src/Checkbox.svelte +95 -0
  25. package/src/CheckboxIndicator.svelte +24 -0
  26. package/src/Collapsible.svelte +83 -0
  27. package/src/CollapsibleContent.svelte +22 -0
  28. package/src/CollapsibleTrigger.svelte +31 -0
  29. package/src/Combobox.svelte +118 -0
  30. package/src/ComboboxContent.svelte +51 -0
  31. package/src/ComboboxGroup.svelte +11 -0
  32. package/src/ComboboxInput.svelte +55 -0
  33. package/src/ComboboxItem.svelte +41 -0
  34. package/src/ComboboxItemIndicator.svelte +21 -0
  35. package/src/ComboboxLabel.svelte +11 -0
  36. package/src/ComboboxSeparator.svelte +8 -0
  37. package/src/ComboboxTrigger.svelte +43 -0
  38. package/src/ContextMenu.svelte +38 -0
  39. package/src/ContextMenuContent.svelte +33 -0
  40. package/src/ContextMenuItem.svelte +50 -0
  41. package/src/ContextMenuTrigger.svelte +30 -0
  42. package/src/Dialog.svelte +62 -0
  43. package/src/DialogClose.svelte +26 -0
  44. package/src/DialogContent.svelte +41 -0
  45. package/src/DialogDescription.svelte +19 -0
  46. package/src/DialogOverlay.svelte +28 -0
  47. package/src/DialogPortal.svelte +18 -0
  48. package/src/DialogTitle.svelte +19 -0
  49. package/src/DialogTrigger.svelte +30 -0
  50. package/src/DropdownMenu.svelte +47 -0
  51. package/src/DropdownMenuContent.svelte +60 -0
  52. package/src/DropdownMenuItem.svelte +50 -0
  53. package/src/DropdownMenuLabel.svelte +16 -0
  54. package/src/DropdownMenuSeparator.svelte +14 -0
  55. package/src/DropdownMenuTrigger.svelte +45 -0
  56. package/src/HoverCard.svelte +100 -0
  57. package/src/HoverCardContent.svelte +61 -0
  58. package/src/HoverCardTrigger.svelte +51 -0
  59. package/src/Label.svelte +24 -0
  60. package/src/MenuBar.svelte +59 -0
  61. package/src/MenuBarContent.svelte +49 -0
  62. package/src/MenuBarMenu.svelte +23 -0
  63. package/src/MenuBarTrigger.svelte +51 -0
  64. package/src/Popover.svelte +50 -0
  65. package/src/PopoverContent.svelte +53 -0
  66. package/src/PopoverTrigger.svelte +35 -0
  67. package/src/Progress.svelte +46 -0
  68. package/src/RadioGroup.svelte +64 -0
  69. package/src/RadioGroupIndicator.svelte +24 -0
  70. package/src/RadioGroupItem.svelte +64 -0
  71. package/src/ScrollArea.svelte +29 -0
  72. package/src/ScrollAreaCorner.svelte +12 -0
  73. package/src/ScrollAreaScrollbar.svelte +22 -0
  74. package/src/ScrollAreaThumb.svelte +12 -0
  75. package/src/ScrollAreaViewport.svelte +26 -0
  76. package/src/Select.svelte +89 -0
  77. package/src/SelectContent.svelte +59 -0
  78. package/src/SelectGroup.svelte +11 -0
  79. package/src/SelectItem.svelte +52 -0
  80. package/src/SelectItemIndicator.svelte +21 -0
  81. package/src/SelectLabel.svelte +11 -0
  82. package/src/SelectSeparator.svelte +8 -0
  83. package/src/SelectTrigger.svelte +40 -0
  84. package/src/SelectValue.svelte +19 -0
  85. package/src/SelectViewport.svelte +15 -0
  86. package/src/Separator.svelte +17 -0
  87. package/src/Slider.svelte +79 -0
  88. package/src/SliderRange.svelte +26 -0
  89. package/src/SliderThumb.svelte +47 -0
  90. package/src/SliderTrack.svelte +21 -0
  91. package/src/Switch.svelte +84 -0
  92. package/src/SwitchThumb.svelte +21 -0
  93. package/src/Tabs.svelte +53 -0
  94. package/src/TabsContent.svelte +32 -0
  95. package/src/TabsList.svelte +22 -0
  96. package/src/TabsTrigger.svelte +64 -0
  97. package/src/Toast.svelte +89 -0
  98. package/src/ToastAction.svelte +17 -0
  99. package/src/ToastClose.svelte +25 -0
  100. package/src/ToastDescription.svelte +15 -0
  101. package/src/ToastProvider.svelte +8 -0
  102. package/src/ToastTitle.svelte +15 -0
  103. package/src/ToastViewport.svelte +21 -0
  104. package/src/Toggle.svelte +55 -0
  105. package/src/ToggleGroup.svelte +71 -0
  106. package/src/ToggleGroupItem.svelte +52 -0
  107. package/src/Toolbar.svelte +28 -0
  108. package/src/ToolbarButton.svelte +15 -0
  109. package/src/ToolbarLink.svelte +16 -0
  110. package/src/ToolbarSeparator.svelte +23 -0
  111. package/src/Tooltip.svelte +72 -0
  112. package/src/TooltipContent.svelte +47 -0
  113. package/src/TooltipTrigger.svelte +54 -0
  114. package/src/VirtualizedList.svelte +71 -0
  115. package/src/accordion.test.ts +33 -0
  116. package/src/alert-dialog.test.ts +24 -0
  117. package/src/checkbox.test.ts +30 -0
  118. package/src/combobox.test.ts +24 -0
  119. package/src/context-menu.test.ts +20 -0
  120. package/src/dialog.test.ts +26 -0
  121. package/src/dropdown-menu.test.ts +20 -0
  122. package/src/index.ts +240 -0
  123. package/src/internal/focus-trap.ts +68 -0
  124. package/src/internal/portal.ts +21 -0
  125. package/src/internal/position.ts +132 -0
  126. package/src/popover.test.ts +20 -0
  127. package/src/progress.test.ts +17 -0
  128. package/src/radio-group.test.ts +22 -0
  129. package/src/scroll-area.test.ts +13 -0
  130. package/src/select.test.ts +23 -0
  131. package/src/slider.test.ts +16 -0
  132. package/src/svelte-shims.d.ts +4 -0
  133. package/src/switch.test.ts +32 -0
  134. package/src/tabs.test.ts +28 -0
  135. package/src/test/setup.ts +11 -0
  136. package/src/testing/AccordionTest.svelte +19 -0
  137. package/src/testing/AlertDialogTest.svelte +26 -0
  138. package/src/testing/ComboboxTest.svelte +21 -0
  139. package/src/testing/ContextMenuTest.svelte +16 -0
  140. package/src/testing/DialogTest.svelte +22 -0
  141. package/src/testing/DropdownMenuTest.svelte +20 -0
  142. package/src/testing/PopoverTest.svelte +12 -0
  143. package/src/testing/RadioGroupTest.svelte +12 -0
  144. package/src/testing/ScrollAreaTest.svelte +17 -0
  145. package/src/testing/SelectTest.svelte +29 -0
  146. package/src/testing/SliderTest.svelte +15 -0
  147. package/src/testing/TabsTest.svelte +17 -0
  148. package/src/testing/ToastTest.svelte +19 -0
  149. package/src/testing/ToolbarTest.svelte +12 -0
  150. package/src/testing/TooltipTest.svelte +12 -0
  151. package/src/toast.test.ts +40 -0
  152. package/src/toggle.test.ts +20 -0
  153. package/src/toolbar.test.ts +16 -0
  154. package/src/tooltip.test.ts +32 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,4122 @@
1
+ import 'svelte/internal/disclose-version';
2
+ import * as $106 from 'svelte/internal/client';
3
+ import { setContext, getContext, onMount } from 'svelte';
4
+ import { createAccordion } from '@uifn/core/primitives/accordion';
5
+ import { createCheckbox } from '@uifn/core/primitives/checkbox';
6
+ import { createSwitch } from '@uifn/core/primitives/switch';
7
+ import { createToggle } from '@uifn/core/primitives/toggle';
8
+ import { createRadioGroup } from '@uifn/core/primitives/radio-group';
9
+ import '@uifn/core/primitives/collapsible';
10
+ import { createAvatar } from '@uifn/core/primitives/avatar';
11
+ import { createProgress } from '@uifn/core/primitives/progress';
12
+ import { createSlider } from '@uifn/core/primitives/slider';
13
+ import { createSelect } from '@uifn/core/primitives/select';
14
+ import { createCombobox } from '@uifn/core/primitives/combobox';
15
+ import { createDialog } from '@uifn/core/primitives/dialog';
16
+ import { createAlertDialog } from '@uifn/core/primitives/alert-dialog';
17
+ import { createPopover } from '@uifn/core/primitives/popover';
18
+ import { createHoverCard } from '@uifn/core/primitives/hover-card';
19
+ import { createTooltip } from '@uifn/core/primitives/tooltip';
20
+ import { createDropdownMenu } from '@uifn/core/primitives/dropdown-menu';
21
+ import { createContextMenu } from '@uifn/core/primitives/context-menu';
22
+ import { createMenuBar } from '@uifn/core/primitives/menu-bar';
23
+ import { createToast } from '@uifn/core/primitives/toast';
24
+ import { createToggleGroup } from '@uifn/core/primitives/toggle-group';
25
+
26
+ // src/Accordion.svelte
27
+ var root = $106.from_html(`<div><!></div>`);
28
+ function Accordion($$anchor, $$props) {
29
+ $106.push($$props, true);
30
+ let type = $106.prop($$props, "type", 3, "single"), collapsible = $106.prop($$props, "collapsible", 3, false), disabled = $106.prop($$props, "disabled", 3, false), rest = $106.rest_props($$props, [
31
+ "$$slots",
32
+ "$$events",
33
+ "$$legacy",
34
+ "type",
35
+ "value",
36
+ "defaultValue",
37
+ "collapsible",
38
+ "disabled",
39
+ "onValueChange",
40
+ "children",
41
+ "class"
42
+ ]);
43
+ function createReactiveAccordion(options) {
44
+ const machine = createAccordion(options);
45
+ let state33 = $106.state($106.proxy(machine.state));
46
+ $106.user_effect(() => {
47
+ return machine.subscribe((newState) => {
48
+ $106.set(state33, newState, true);
49
+ });
50
+ });
51
+ return {
52
+ get value() {
53
+ return $106.get(state33).value;
54
+ },
55
+ get type() {
56
+ return type();
57
+ },
58
+ // Use closure or state?
59
+ get collapsible() {
60
+ return collapsible();
61
+ },
62
+ get disabled() {
63
+ return disabled();
64
+ },
65
+ toggleItem: machine.actions.toggleItem,
66
+ setValue: machine.actions.setValue
67
+ };
68
+ }
69
+ const accordion = createReactiveAccordion({
70
+ type: type(),
71
+ value: $$props.value,
72
+ defaultValue: $$props.defaultValue,
73
+ collapsible: collapsible(),
74
+ disabled: disabled(),
75
+ onValueChange: $$props.onValueChange
76
+ });
77
+ setContext("accordion", accordion);
78
+ var div = root();
79
+ $106.attribute_effect(div, () => ({
80
+ class: $$props.class,
81
+ "data-orientation": "vertical",
82
+ ...rest
83
+ }));
84
+ var node = $106.child(div);
85
+ $106.snippet(node, () => $$props.children ?? $106.noop);
86
+ $106.reset(div);
87
+ $106.append($$anchor, div);
88
+ $106.pop();
89
+ }
90
+ var root2 = $106.from_html(`<div><!></div>`);
91
+ function AccordionItem($$anchor, $$props) {
92
+ $106.push($$props, true);
93
+ let disabled = $106.prop($$props, "disabled", 3, false), rest = $106.rest_props($$props, [
94
+ "$$slots",
95
+ "$$events",
96
+ "$$legacy",
97
+ "value",
98
+ "disabled",
99
+ "children",
100
+ "class"
101
+ ]);
102
+ const accordion = getContext("accordion");
103
+ let open = $106.derived(() => accordion.type === "single" ? accordion.value === $$props.value : accordion.value.includes($$props.value));
104
+ let itemDisabled = $106.derived(() => accordion.disabled || disabled());
105
+ setContext("accordion-item", {
106
+ value: $$props.value,
107
+ get open() {
108
+ return $106.get(open);
109
+ },
110
+ get disabled() {
111
+ return $106.get(itemDisabled);
112
+ }
113
+ });
114
+ var div = root2();
115
+ $106.attribute_effect(div, () => ({
116
+ class: $$props.class,
117
+ "data-state": $106.get(open) ? "open" : "closed",
118
+ "data-disabled": $106.get(itemDisabled) ? "" : void 0,
119
+ ...rest
120
+ }));
121
+ var node = $106.child(div);
122
+ $106.snippet(node, () => $$props.children ?? $106.noop);
123
+ $106.reset(div);
124
+ $106.append($$anchor, div);
125
+ $106.pop();
126
+ }
127
+ var root3 = $106.from_html(`<h3 style="margin: 0"><button><!></button></h3>`);
128
+ function AccordionTrigger($$anchor, $$props) {
129
+ $106.push($$props, true);
130
+ let rest = $106.rest_props($$props, [
131
+ "$$slots",
132
+ "$$events",
133
+ "$$legacy",
134
+ "children",
135
+ "class",
136
+ "onClick"
137
+ ]);
138
+ const item = getContext("accordion-item");
139
+ const accordion = getContext("accordion");
140
+ function handleClick(e) {
141
+ if (item.disabled) return;
142
+ accordion.toggleItem(item.value);
143
+ $$props.onClick?.(e);
144
+ }
145
+ var h3 = root3();
146
+ var button = $106.child(h3);
147
+ $106.attribute_effect(button, () => ({
148
+ type: "button",
149
+ class: $$props.class,
150
+ "aria-expanded": item.open,
151
+ "aria-disabled": item.disabled,
152
+ "data-state": item.open ? "open" : "closed",
153
+ "data-disabled": item.disabled ? "" : void 0,
154
+ onclick: handleClick,
155
+ ...rest
156
+ }));
157
+ var node = $106.child(button);
158
+ $106.snippet(node, () => $$props.children ?? $106.noop);
159
+ $106.reset(button);
160
+ $106.reset(h3);
161
+ $106.append($$anchor, h3);
162
+ $106.pop();
163
+ }
164
+ var root4 = $106.from_html(`<div><!></div>`);
165
+ function AccordionContent($$anchor, $$props) {
166
+ $106.push($$props, true);
167
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "class"]);
168
+ const item = getContext("accordion-item");
169
+ var div = root4();
170
+ $106.attribute_effect(div, () => ({
171
+ class: $$props.class,
172
+ role: "region",
173
+ "data-state": item.open ? "open" : "closed",
174
+ "data-disabled": item.disabled ? "" : void 0,
175
+ hidden: !item.open,
176
+ ...rest
177
+ }));
178
+ var node = $106.child(div);
179
+ $106.snippet(node, () => $$props.children ?? $106.noop);
180
+ $106.reset(div);
181
+ $106.append($$anchor, div);
182
+ $106.pop();
183
+ }
184
+ var root_1 = $106.from_html(`<input type="checkbox" aria-hidden="true" hidden="" style="transform: translateX(-100%); position: absolute; pointer-events: none; opacity: 0; margin: 0;"/>`);
185
+ var root5 = $106.from_html(`<button><!></button> <!>`, 1);
186
+ function Checkbox($$anchor, $$props) {
187
+ $106.push($$props, true);
188
+ let disabled = $106.prop($$props, "disabled", 3, false), required = $106.prop($$props, "required", 3, false), rest = $106.rest_props($$props, [
189
+ "$$slots",
190
+ "$$events",
191
+ "$$legacy",
192
+ "checked",
193
+ "defaultChecked",
194
+ "disabled",
195
+ "required",
196
+ "name",
197
+ "value",
198
+ "onCheckedChange",
199
+ "children",
200
+ "class"
201
+ ]);
202
+ const machine = createCheckbox({
203
+ checked: $$props.checked,
204
+ defaultChecked: $$props.defaultChecked,
205
+ disabled: disabled(),
206
+ required: required(),
207
+ onCheckedChange: $$props.onCheckedChange
208
+ });
209
+ let state33 = $106.state($106.proxy(machine.state));
210
+ $106.user_effect(() => {
211
+ return machine.subscribe((newState) => {
212
+ $106.set(state33, newState, true);
213
+ });
214
+ });
215
+ function handleClick(e) {
216
+ if (disabled()) return;
217
+ machine.actions.toggle();
218
+ }
219
+ function handleKeyDown(e) {
220
+ if (disabled()) return;
221
+ if (e.key === "Enter") {
222
+ e.preventDefault();
223
+ }
224
+ }
225
+ setContext("checkbox", {
226
+ get checked() {
227
+ return $106.get(state33).checked;
228
+ },
229
+ get disabled() {
230
+ return $106.get(state33).disabled;
231
+ }
232
+ });
233
+ var fragment = root5();
234
+ var button = $106.first_child(fragment);
235
+ $106.attribute_effect(button, () => ({
236
+ type: "button",
237
+ role: "checkbox",
238
+ "aria-checked": $106.get(state33).checked === "indeterminate" ? "mixed" : $106.get(state33).checked,
239
+ "aria-required": required(),
240
+ "data-state": $106.get(state33).checked === "indeterminate" ? "indeterminate" : $106.get(state33).checked ? "checked" : "unchecked",
241
+ "data-disabled": disabled() ? "" : void 0,
242
+ disabled: disabled(),
243
+ value: $$props.value,
244
+ onclick: handleClick,
245
+ onkeydown: handleKeyDown,
246
+ class: $$props.class,
247
+ ...rest
248
+ }));
249
+ var node = $106.child(button);
250
+ $106.snippet(node, () => $$props.children ?? $106.noop);
251
+ $106.reset(button);
252
+ var node_1 = $106.sibling(button, 2);
253
+ {
254
+ var consequent = ($$anchor2) => {
255
+ var input = root_1();
256
+ $106.remove_input_defaults(input);
257
+ $106.template_effect(() => {
258
+ $106.set_checked(input, $106.get(state33).checked === true);
259
+ $106.set_attribute(input, "name", $$props.name);
260
+ $106.set_value(input, $$props.value);
261
+ input.required = required();
262
+ });
263
+ $106.append($$anchor2, input);
264
+ };
265
+ $106.if(node_1, ($$render) => {
266
+ if ($$props.name && $106.get(state33).checked) $$render(consequent);
267
+ });
268
+ }
269
+ $106.append($$anchor, fragment);
270
+ $106.pop();
271
+ }
272
+ var root_12 = $106.from_html(`<span><!></span>`);
273
+ function CheckboxIndicator($$anchor, $$props) {
274
+ $106.push($$props, true);
275
+ let forceMount = $106.prop($$props, "forceMount", 3, false), rest = $106.rest_props($$props, [
276
+ "$$slots",
277
+ "$$events",
278
+ "$$legacy",
279
+ "forceMount",
280
+ "children",
281
+ "class"
282
+ ]);
283
+ const checkbox = getContext("checkbox");
284
+ var fragment = $106.comment();
285
+ var node = $106.first_child(fragment);
286
+ {
287
+ var consequent = ($$anchor2) => {
288
+ var span = root_12();
289
+ $106.attribute_effect(span, () => ({
290
+ "data-state": checkbox.checked === "indeterminate" ? "indeterminate" : checkbox.checked ? "checked" : "unchecked",
291
+ "data-disabled": checkbox.disabled ? "" : void 0,
292
+ class: $$props.class,
293
+ ...rest
294
+ }));
295
+ var node_1 = $106.child(span);
296
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
297
+ $106.reset(span);
298
+ $106.append($$anchor2, span);
299
+ };
300
+ $106.if(node, ($$render) => {
301
+ if (forceMount() || checkbox.checked) $$render(consequent);
302
+ });
303
+ }
304
+ $106.append($$anchor, fragment);
305
+ $106.pop();
306
+ }
307
+ var root_13 = $106.from_html(`<input type="checkbox" aria-hidden="true" hidden="" checked style="transform: translateX(-100%); position: absolute; pointer-events: none; opacity: 0; margin: 0;"/>`);
308
+ var root6 = $106.from_html(`<button><!></button> <!>`, 1);
309
+ function Switch($$anchor, $$props) {
310
+ $106.push($$props, true);
311
+ let disabled = $106.prop($$props, "disabled", 3, false), required = $106.prop($$props, "required", 3, false), rest = $106.rest_props($$props, [
312
+ "$$slots",
313
+ "$$events",
314
+ "$$legacy",
315
+ "checked",
316
+ "defaultChecked",
317
+ "disabled",
318
+ "required",
319
+ "name",
320
+ "value",
321
+ "onCheckedChange",
322
+ "children",
323
+ "class"
324
+ ]);
325
+ const machine = createSwitch({
326
+ checked: $$props.checked,
327
+ defaultChecked: $$props.defaultChecked,
328
+ disabled: disabled(),
329
+ required: required(),
330
+ onCheckedChange: $$props.onCheckedChange
331
+ });
332
+ let state33 = $106.state($106.proxy(machine.state));
333
+ $106.user_effect(() => {
334
+ return machine.subscribe((newState) => {
335
+ $106.set(state33, newState, true);
336
+ });
337
+ });
338
+ function handleClick() {
339
+ if (disabled()) return;
340
+ machine.actions.toggle();
341
+ }
342
+ setContext("switch", {
343
+ get checked() {
344
+ return $106.get(state33).checked;
345
+ },
346
+ get disabled() {
347
+ return $106.get(state33).disabled;
348
+ }
349
+ });
350
+ var fragment = root6();
351
+ var button = $106.first_child(fragment);
352
+ $106.attribute_effect(button, () => ({
353
+ type: "button",
354
+ role: "switch",
355
+ "aria-checked": $106.get(state33).checked,
356
+ "aria-required": required(),
357
+ "data-state": $106.get(state33).checked ? "checked" : "unchecked",
358
+ "data-disabled": disabled() ? "" : void 0,
359
+ disabled: disabled(),
360
+ value: $$props.value,
361
+ onclick: handleClick,
362
+ class: $$props.class,
363
+ ...rest
364
+ }));
365
+ var node = $106.child(button);
366
+ $106.snippet(node, () => $$props.children ?? $106.noop);
367
+ $106.reset(button);
368
+ var node_1 = $106.sibling(button, 2);
369
+ {
370
+ var consequent = ($$anchor2) => {
371
+ var input = root_13();
372
+ $106.remove_input_defaults(input);
373
+ $106.template_effect(() => {
374
+ $106.set_attribute(input, "name", $$props.name);
375
+ $106.set_value(input, $$props.value);
376
+ input.required = required();
377
+ });
378
+ $106.append($$anchor2, input);
379
+ };
380
+ $106.if(node_1, ($$render) => {
381
+ if ($$props.name && $106.get(state33).checked) $$render(consequent);
382
+ });
383
+ }
384
+ $106.append($$anchor, fragment);
385
+ $106.pop();
386
+ }
387
+ var root7 = $106.from_html(`<span><!></span>`);
388
+ function SwitchThumb($$anchor, $$props) {
389
+ $106.push($$props, true);
390
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "class"]);
391
+ const switchContext = getContext("switch");
392
+ var span = root7();
393
+ $106.attribute_effect(span, () => ({
394
+ "data-state": switchContext.checked ? "checked" : "unchecked",
395
+ "data-disabled": switchContext.disabled ? "" : void 0,
396
+ class: $$props.class,
397
+ ...rest
398
+ }));
399
+ var node = $106.child(span);
400
+ $106.snippet(node, () => $$props.children ?? $106.noop);
401
+ $106.reset(span);
402
+ $106.append($$anchor, span);
403
+ $106.pop();
404
+ }
405
+ var root8 = $106.from_html(`<button><!></button>`);
406
+ function Toggle($$anchor, $$props) {
407
+ $106.push($$props, true);
408
+ let disabled = $106.prop($$props, "disabled", 3, false), rest = $106.rest_props($$props, [
409
+ "$$slots",
410
+ "$$events",
411
+ "$$legacy",
412
+ "pressed",
413
+ "defaultPressed",
414
+ "disabled",
415
+ "onPressedChange",
416
+ "children",
417
+ "class"
418
+ ]);
419
+ const machine = createToggle({
420
+ pressed: $$props.pressed,
421
+ defaultPressed: $$props.defaultPressed,
422
+ disabled: disabled(),
423
+ onPressedChange: $$props.onPressedChange
424
+ });
425
+ let state33 = $106.state($106.proxy(machine.state));
426
+ $106.user_effect(() => {
427
+ return machine.subscribe((newState) => {
428
+ $106.set(state33, newState, true);
429
+ });
430
+ });
431
+ function handleClick() {
432
+ if (disabled()) return;
433
+ machine.actions.toggle();
434
+ }
435
+ var button = root8();
436
+ $106.attribute_effect(button, () => ({
437
+ type: "button",
438
+ "aria-pressed": $106.get(state33).pressed,
439
+ "data-state": $106.get(state33).pressed ? "on" : "off",
440
+ "data-disabled": disabled() ? "" : void 0,
441
+ disabled: disabled(),
442
+ onclick: handleClick,
443
+ class: $$props.class,
444
+ ...rest
445
+ }));
446
+ var node = $106.child(button);
447
+ $106.snippet(node, () => $$props.children ?? $106.noop);
448
+ $106.reset(button);
449
+ $106.append($$anchor, button);
450
+ $106.pop();
451
+ }
452
+ var root9 = $106.from_html(`<div><!></div>`);
453
+ function RadioGroup($$anchor, $$props) {
454
+ $106.push($$props, true);
455
+ let disabled = $106.prop($$props, "disabled", 3, false), required = $106.prop($$props, "required", 3, false), orientation = $106.prop($$props, "orientation", 3, "vertical"), rest = $106.rest_props($$props, [
456
+ "$$slots",
457
+ "$$events",
458
+ "$$legacy",
459
+ "value",
460
+ "defaultValue",
461
+ "disabled",
462
+ "required",
463
+ "name",
464
+ "orientation",
465
+ "onValueChange",
466
+ "children",
467
+ "class"
468
+ ]);
469
+ const machine = createRadioGroup({
470
+ value: $$props.value,
471
+ defaultValue: $$props.defaultValue,
472
+ disabled: disabled(),
473
+ required: required(),
474
+ orientation: orientation(),
475
+ onValueChange: $$props.onValueChange
476
+ });
477
+ let state33 = $106.state($106.proxy(machine.state));
478
+ $106.user_effect(() => {
479
+ return machine.subscribe((newState) => {
480
+ $106.set(state33, newState, true);
481
+ });
482
+ });
483
+ setContext("radio-group", {
484
+ get value() {
485
+ return $106.get(state33).value;
486
+ },
487
+ get disabled() {
488
+ return $106.get(state33).disabled;
489
+ },
490
+ get name() {
491
+ return $$props.name;
492
+ },
493
+ setValue: machine.actions.setValue
494
+ });
495
+ var div = root9();
496
+ $106.attribute_effect(div, () => ({
497
+ role: "radiogroup",
498
+ "aria-required": required(),
499
+ "aria-orientation": orientation(),
500
+ "data-disabled": disabled() ? "" : void 0,
501
+ class: $$props.class,
502
+ ...rest
503
+ }));
504
+ var node = $106.child(div);
505
+ $106.snippet(node, () => $$props.children ?? $106.noop);
506
+ $106.reset(div);
507
+ $106.append($$anchor, div);
508
+ $106.pop();
509
+ }
510
+ var root_14 = $106.from_html(`<input type="radio" aria-hidden="true" hidden="" checked style="transform: translateX(-100%); position: absolute; pointer-events: none; opacity: 0; margin: 0;" tabindex="-1"/>`);
511
+ var root10 = $106.from_html(`<button><!></button> <!>`, 1);
512
+ function RadioGroupItem($$anchor, $$props) {
513
+ $106.push($$props, true);
514
+ let disabled = $106.prop($$props, "disabled", 3, false), rest = $106.rest_props($$props, [
515
+ "$$slots",
516
+ "$$events",
517
+ "$$legacy",
518
+ "value",
519
+ "disabled",
520
+ "children",
521
+ "class"
522
+ ]);
523
+ const group = getContext("radio-group");
524
+ let checked = $106.derived(() => group.value === $$props.value);
525
+ let itemDisabled = $106.derived(() => group.disabled || disabled());
526
+ function handleClick() {
527
+ if ($106.get(itemDisabled)) return;
528
+ group.setValue($$props.value);
529
+ }
530
+ function handleKeyDown(e) {
531
+ if ($106.get(itemDisabled)) return;
532
+ if (e.key === " ") {
533
+ e.preventDefault();
534
+ group.setValue($$props.value);
535
+ }
536
+ }
537
+ setContext("radio-group-item", { checked: $106.get(checked), disabled: $106.get(itemDisabled) });
538
+ var fragment = root10();
539
+ var button = $106.first_child(fragment);
540
+ $106.attribute_effect(button, () => ({
541
+ type: "button",
542
+ role: "radio",
543
+ "aria-checked": $106.get(checked),
544
+ "data-state": $106.get(checked) ? "checked" : "unchecked",
545
+ "data-disabled": $106.get(itemDisabled) ? "" : void 0,
546
+ disabled: $106.get(itemDisabled),
547
+ value: $$props.value,
548
+ tabindex: $106.get(checked) ? 0 : -1,
549
+ onclick: handleClick,
550
+ onkeydown: handleKeyDown,
551
+ class: $$props.class,
552
+ ...rest
553
+ }));
554
+ var node = $106.child(button);
555
+ $106.snippet(node, () => $$props.children ?? $106.noop);
556
+ $106.reset(button);
557
+ var node_1 = $106.sibling(button, 2);
558
+ {
559
+ var consequent = ($$anchor2) => {
560
+ var input = root_14();
561
+ $106.remove_input_defaults(input);
562
+ $106.template_effect(() => {
563
+ $106.set_attribute(input, "name", group.name);
564
+ $106.set_value(input, $$props.value);
565
+ });
566
+ $106.append($$anchor2, input);
567
+ };
568
+ $106.if(node_1, ($$render) => {
569
+ if (group.name && $106.get(checked)) $$render(consequent);
570
+ });
571
+ }
572
+ $106.append($$anchor, fragment);
573
+ $106.pop();
574
+ }
575
+ var root_15 = $106.from_html(`<span><!></span>`);
576
+ function RadioGroupIndicator($$anchor, $$props) {
577
+ $106.push($$props, true);
578
+ let forceMount = $106.prop($$props, "forceMount", 3, false), rest = $106.rest_props($$props, [
579
+ "$$slots",
580
+ "$$events",
581
+ "$$legacy",
582
+ "forceMount",
583
+ "children",
584
+ "class"
585
+ ]);
586
+ const item = getContext("radio-group-item");
587
+ var fragment = $106.comment();
588
+ var node = $106.first_child(fragment);
589
+ {
590
+ var consequent = ($$anchor2) => {
591
+ var span = root_15();
592
+ $106.attribute_effect(span, () => ({
593
+ "data-state": item.checked ? "checked" : "unchecked",
594
+ "data-disabled": item.disabled ? "" : void 0,
595
+ class: $$props.class,
596
+ ...rest
597
+ }));
598
+ var node_1 = $106.child(span);
599
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
600
+ $106.reset(span);
601
+ $106.append($$anchor2, span);
602
+ };
603
+ $106.if(node, ($$render) => {
604
+ if (forceMount() || item.checked) $$render(consequent);
605
+ });
606
+ }
607
+ $106.append($$anchor, fragment);
608
+ $106.pop();
609
+ }
610
+ var root11 = $106.from_html(`<label><!></label>`);
611
+ function Label($$anchor, $$props) {
612
+ let rest = $106.rest_props($$props, [
613
+ "$$slots",
614
+ "$$events",
615
+ "$$legacy",
616
+ "for",
617
+ "children",
618
+ "class"
619
+ ]);
620
+ function handleMouseDown(event) {
621
+ if (!event.defaultPrevented && event.detail > 1) {
622
+ event.preventDefault();
623
+ }
624
+ }
625
+ var label = root11();
626
+ $106.attribute_effect(label, () => ({
627
+ for: $$props.for,
628
+ onmousedown: handleMouseDown,
629
+ class: $$props.class,
630
+ ...rest
631
+ }));
632
+ var node = $106.child(label);
633
+ $106.snippet(node, () => $$props.children ?? $106.noop);
634
+ $106.reset(label);
635
+ $106.append($$anchor, label);
636
+ }
637
+ var root12 = $106.from_html(`<div></div>`);
638
+ function Separator($$anchor, $$props) {
639
+ let orientation = $106.prop($$props, "orientation", 3, "horizontal"), decorative = $106.prop($$props, "decorative", 3, false), rest = $106.rest_props($$props, [
640
+ "$$slots",
641
+ "$$events",
642
+ "$$legacy",
643
+ "orientation",
644
+ "decorative",
645
+ "class"
646
+ ]);
647
+ var div = root12();
648
+ $106.attribute_effect(div, () => ({
649
+ role: decorative() ? "none" : "separator",
650
+ "aria-orientation": decorative() ? void 0 : orientation(),
651
+ "data-orientation": orientation(),
652
+ class: $$props.class,
653
+ ...rest
654
+ }));
655
+ $106.append($$anchor, div);
656
+ }
657
+ var root13 = $106.from_html(`<span><!></span>`);
658
+ function Badge($$anchor, $$props) {
659
+ let variant = $106.prop($$props, "variant", 3, "default"), rest = $106.rest_props($$props, [
660
+ "$$slots",
661
+ "$$events",
662
+ "$$legacy",
663
+ "variant",
664
+ "children",
665
+ "class"
666
+ ]);
667
+ var span = root13();
668
+ $106.attribute_effect(span, () => ({
669
+ role: "status",
670
+ "data-variant": variant(),
671
+ class: $$props.class,
672
+ style: "display: inline-flex; align-items: center; border-radius: 9999px; padding: 2px 8px; font-size: 12px; font-weight: 600;",
673
+ ...rest
674
+ }));
675
+ var node = $106.child(span);
676
+ $106.snippet(node, () => $$props.children ?? $106.noop);
677
+ $106.reset(span);
678
+ $106.append($$anchor, span);
679
+ }
680
+ var root14 = $106.from_html(`<div><!></div>`);
681
+ function Collapsible($$anchor, $$props) {
682
+ $106.push($$props, true);
683
+ let defaultOpen = $106.prop($$props, "defaultOpen", 3, false), disabled = $106.prop($$props, "disabled", 3, false), rest = $106.rest_props($$props, [
684
+ "$$slots",
685
+ "$$events",
686
+ "$$legacy",
687
+ "open",
688
+ "defaultOpen",
689
+ "disabled",
690
+ "onOpenChange",
691
+ "children",
692
+ "class"
693
+ ]);
694
+ let _open = $106.state($106.proxy(defaultOpen()));
695
+ let isOpen = $106.derived(() => $$props.open !== void 0 ? $$props.open : $106.get(_open));
696
+ function setOpen(value) {
697
+ if ($$props.open === void 0) {
698
+ $106.set(_open, value, true);
699
+ }
700
+ $$props.onOpenChange?.(value);
701
+ }
702
+ function toggle() {
703
+ if (disabled()) return;
704
+ setOpen(!$106.get(isOpen));
705
+ }
706
+ setContext("collapsible", {
707
+ get open() {
708
+ return $106.get(isOpen);
709
+ },
710
+ get disabled() {
711
+ return disabled();
712
+ },
713
+ toggle
714
+ });
715
+ var div = root14();
716
+ $106.attribute_effect(div, () => ({
717
+ "data-state": $106.get(isOpen) ? "open" : "closed",
718
+ "data-disabled": disabled() ? "" : void 0,
719
+ class: $$props.class,
720
+ ...rest
721
+ }));
722
+ var node = $106.child(div);
723
+ $106.snippet(node, () => $$props.children ?? $106.noop);
724
+ $106.reset(div);
725
+ $106.append($$anchor, div);
726
+ $106.pop();
727
+ }
728
+ var root15 = $106.from_html(`<button><!></button>`);
729
+ function CollapsibleTrigger($$anchor, $$props) {
730
+ $106.push($$props, true);
731
+ let rest = $106.rest_props($$props, [
732
+ "$$slots",
733
+ "$$events",
734
+ "$$legacy",
735
+ "children",
736
+ "class",
737
+ "onClick"
738
+ ]);
739
+ const context = getContext("collapsible");
740
+ function handleClick(e) {
741
+ context.toggle();
742
+ $$props.onClick?.(e);
743
+ }
744
+ var button = root15();
745
+ $106.attribute_effect(button, () => ({
746
+ type: "button",
747
+ "aria-expanded": context.open,
748
+ "data-state": context.open ? "open" : "closed",
749
+ "data-disabled": context.disabled ? "" : void 0,
750
+ disabled: context.disabled,
751
+ onclick: handleClick,
752
+ class: $$props.class,
753
+ ...rest
754
+ }));
755
+ var node = $106.child(button);
756
+ $106.snippet(node, () => $$props.children ?? $106.noop);
757
+ $106.reset(button);
758
+ $106.append($$anchor, button);
759
+ $106.pop();
760
+ }
761
+ var root16 = $106.from_html(`<div><!></div>`);
762
+ function CollapsibleContent($$anchor, $$props) {
763
+ $106.push($$props, true);
764
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "class"]);
765
+ const context = getContext("collapsible");
766
+ var div = root16();
767
+ $106.attribute_effect(div, () => ({
768
+ "data-state": context.open ? "open" : "closed",
769
+ "data-disabled": context.disabled ? "" : void 0,
770
+ hidden: !context.open,
771
+ class: $$props.class,
772
+ ...rest
773
+ }));
774
+ var node = $106.child(div);
775
+ $106.snippet(node, () => $$props.children ?? $106.noop);
776
+ $106.reset(div);
777
+ $106.append($$anchor, div);
778
+ $106.pop();
779
+ }
780
+ var root17 = $106.from_html(`<div><!></div>`);
781
+ function Tabs($$anchor, $$props) {
782
+ $106.push($$props, true);
783
+ let orientation = $106.prop($$props, "orientation", 3, "horizontal"), activationMode = $106.prop($$props, "activationMode", 3, "automatic"), rest = $106.rest_props($$props, [
784
+ "$$slots",
785
+ "$$events",
786
+ "$$legacy",
787
+ "value",
788
+ "defaultValue",
789
+ "onValueChange",
790
+ "orientation",
791
+ "activationMode",
792
+ "children",
793
+ "class"
794
+ ]);
795
+ let _value = $106.state($106.proxy($$props.defaultValue ?? ""));
796
+ let value = $106.derived(() => $$props.value !== void 0 ? $$props.value : $106.get(_value));
797
+ function setValue(val) {
798
+ if ($$props.value === void 0) {
799
+ $106.set(_value, val, true);
800
+ }
801
+ $$props.onValueChange?.(val);
802
+ }
803
+ const baseId = `tabs-${Math.random().toString(36).substr(2, 9)}`;
804
+ setContext("tabs", {
805
+ get value() {
806
+ return $106.get(value);
807
+ },
808
+ setValue,
809
+ orientation: orientation(),
810
+ activationMode: activationMode(),
811
+ baseId
812
+ });
813
+ var div = root17();
814
+ $106.attribute_effect(div, () => ({
815
+ "data-orientation": orientation(),
816
+ class: $$props.class,
817
+ ...rest
818
+ }));
819
+ var node = $106.child(div);
820
+ $106.snippet(node, () => $$props.children ?? $106.noop);
821
+ $106.reset(div);
822
+ $106.append($$anchor, div);
823
+ $106.pop();
824
+ }
825
+ var root18 = $106.from_html(`<div><!></div>`);
826
+ function TabsList($$anchor, $$props) {
827
+ $106.push($$props, true);
828
+ $106.prop($$props, "loop", 3, true); let rest = $106.rest_props($$props, [
829
+ "$$slots",
830
+ "$$events",
831
+ "$$legacy",
832
+ "loop",
833
+ "children",
834
+ "class"
835
+ ]);
836
+ const context = getContext("tabs");
837
+ var div = root18();
838
+ $106.attribute_effect(div, () => ({
839
+ role: "tablist",
840
+ "aria-orientation": context.orientation,
841
+ class: $$props.class,
842
+ ...rest
843
+ }));
844
+ var node = $106.child(div);
845
+ $106.snippet(node, () => $$props.children ?? $106.noop);
846
+ $106.reset(div);
847
+ $106.append($$anchor, div);
848
+ $106.pop();
849
+ }
850
+ var root19 = $106.from_html(`<button><!></button>`);
851
+ function TabsTrigger($$anchor, $$props) {
852
+ $106.push($$props, true);
853
+ let disabled = $106.prop($$props, "disabled", 3, false), rest = $106.rest_props($$props, [
854
+ "$$slots",
855
+ "$$events",
856
+ "$$legacy",
857
+ "value",
858
+ "disabled",
859
+ "children",
860
+ "class",
861
+ "onClick",
862
+ "onFocus",
863
+ "onKeyDown"
864
+ ]);
865
+ const context = getContext("tabs");
866
+ let isSelected = $106.derived(() => context.value === $$props.value);
867
+ let triggerId = `${context.baseId}-trigger-${$$props.value}`;
868
+ let contentId = `${context.baseId}-content-${$$props.value}`;
869
+ function handleClick(e) {
870
+ if (!disabled()) {
871
+ context.setValue($$props.value);
872
+ }
873
+ $$props.onClick?.(e);
874
+ }
875
+ function handleFocus(e) {
876
+ if (!disabled() && context.activationMode === "automatic") {
877
+ context.setValue($$props.value);
878
+ }
879
+ $$props.onFocus?.(e);
880
+ }
881
+ function handleKeyDown(e) {
882
+ if (disabled()) return;
883
+ if (e.key === " " || e.key === "Enter") {
884
+ e.preventDefault();
885
+ context.setValue($$props.value);
886
+ }
887
+ $$props.onKeyDown?.(e);
888
+ }
889
+ var button = root19();
890
+ $106.attribute_effect(button, () => ({
891
+ type: "button",
892
+ role: "tab",
893
+ "aria-selected": $106.get(isSelected),
894
+ "aria-controls": contentId,
895
+ id: triggerId,
896
+ "data-state": $106.get(isSelected) ? "active" : "inactive",
897
+ "data-disabled": disabled() ? "" : void 0,
898
+ disabled: disabled(),
899
+ tabindex: $106.get(isSelected) ? 0 : -1,
900
+ onclick: handleClick,
901
+ onfocus: handleFocus,
902
+ onkeydown: handleKeyDown,
903
+ class: $$props.class,
904
+ ...rest
905
+ }));
906
+ var node = $106.child(button);
907
+ $106.snippet(node, () => $$props.children ?? $106.noop);
908
+ $106.reset(button);
909
+ $106.append($$anchor, button);
910
+ $106.pop();
911
+ }
912
+ var root_16 = $106.from_html(`<div><!></div>`);
913
+ function TabsContent($$anchor, $$props) {
914
+ $106.push($$props, true);
915
+ let rest = $106.rest_props($$props, [
916
+ "$$slots",
917
+ "$$events",
918
+ "$$legacy",
919
+ "value",
920
+ "children",
921
+ "class"
922
+ ]);
923
+ const context = getContext("tabs");
924
+ let isSelected = $106.derived(() => context.value === $$props.value);
925
+ let triggerId = `${context.baseId}-trigger-${$$props.value}`;
926
+ let contentId = `${context.baseId}-content-${$$props.value}`;
927
+ var fragment = $106.comment();
928
+ var node = $106.first_child(fragment);
929
+ {
930
+ var consequent = ($$anchor2) => {
931
+ var div = root_16();
932
+ $106.attribute_effect(div, () => ({
933
+ role: "tabpanel",
934
+ id: contentId,
935
+ "aria-labelledby": triggerId,
936
+ "data-state": "active",
937
+ "data-orientation": context.orientation,
938
+ tabindex: "0",
939
+ class: $$props.class,
940
+ ...rest
941
+ }));
942
+ var node_1 = $106.child(div);
943
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
944
+ $106.reset(div);
945
+ $106.append($$anchor2, div);
946
+ };
947
+ $106.if(node, ($$render) => {
948
+ if ($106.get(isSelected)) $$render(consequent);
949
+ });
950
+ }
951
+ $106.append($$anchor, fragment);
952
+ $106.pop();
953
+ }
954
+ var root20 = $106.from_html(`<span><!></span>`);
955
+ function Avatar($$anchor, $$props) {
956
+ $106.push($$props, true);
957
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "class"]);
958
+ const machine = createAvatar();
959
+ let state33 = $106.state($106.proxy(machine.state));
960
+ $106.user_effect(() => {
961
+ return machine.subscribe((newState) => {
962
+ $106.set(state33, newState, true);
963
+ });
964
+ });
965
+ setContext("avatar", {
966
+ get status() {
967
+ return $106.get(state33).status;
968
+ },
969
+ setLoading: machine.actions.setLoading,
970
+ setLoaded: machine.actions.setLoaded,
971
+ setError: machine.actions.setError
972
+ });
973
+ var span = root20();
974
+ $106.attribute_effect(span, () => ({
975
+ class: $$props.class,
976
+ "data-state": $106.get(state33).status,
977
+ ...rest
978
+ }));
979
+ var node = $106.child(span);
980
+ $106.snippet(node, () => $$props.children ?? $106.noop);
981
+ $106.reset(span);
982
+ $106.append($$anchor, span);
983
+ $106.pop();
984
+ }
985
+ var root_17 = $106.from_html(`<img/>`);
986
+ function AvatarImage($$anchor, $$props) {
987
+ $106.push($$props, true);
988
+ let rest = $106.rest_props($$props, [
989
+ "$$slots",
990
+ "$$events",
991
+ "$$legacy",
992
+ "src",
993
+ "alt",
994
+ "onLoadingStatusChange",
995
+ "class"
996
+ ]);
997
+ const context = getContext("avatar");
998
+ let loadingStatus = $106.state("idle");
999
+ $106.user_effect(() => {
1000
+ if (!$$props.src) {
1001
+ $106.set(loadingStatus, "error");
1002
+ return;
1003
+ }
1004
+ $106.set(loadingStatus, "loading");
1005
+ context.setLoading();
1006
+ const image = new Image();
1007
+ image.src = $$props.src;
1008
+ image.onload = () => {
1009
+ $106.set(loadingStatus, "loaded");
1010
+ context.setLoaded();
1011
+ };
1012
+ image.onerror = () => {
1013
+ $106.set(loadingStatus, "error");
1014
+ context.setError();
1015
+ };
1016
+ });
1017
+ $106.user_effect(() => {
1018
+ $$props.onLoadingStatusChange?.($106.get(loadingStatus));
1019
+ });
1020
+ var fragment = $106.comment();
1021
+ var node = $106.first_child(fragment);
1022
+ {
1023
+ var consequent = ($$anchor2) => {
1024
+ var img = root_17();
1025
+ $106.attribute_effect(img, () => ({
1026
+ src: $$props.src,
1027
+ alt: $$props.alt,
1028
+ "data-state": "loaded",
1029
+ class: $$props.class,
1030
+ ...rest
1031
+ }));
1032
+ $106.replay_events(img);
1033
+ $106.append($$anchor2, img);
1034
+ };
1035
+ $106.if(node, ($$render) => {
1036
+ if ($106.get(loadingStatus) === "loaded") $$render(consequent);
1037
+ });
1038
+ }
1039
+ $106.append($$anchor, fragment);
1040
+ $106.pop();
1041
+ }
1042
+ var root_18 = $106.from_html(`<span><!></span>`);
1043
+ function AvatarFallback($$anchor, $$props) {
1044
+ $106.push($$props, true);
1045
+ let rest = $106.rest_props($$props, [
1046
+ "$$slots",
1047
+ "$$events",
1048
+ "$$legacy",
1049
+ "delayMs",
1050
+ "children",
1051
+ "class"
1052
+ ]);
1053
+ const context = getContext("avatar");
1054
+ let canRender = $106.state($$props.delayMs === void 0);
1055
+ onMount(() => {
1056
+ if ($$props.delayMs !== void 0) {
1057
+ const timer = setTimeout(
1058
+ () => {
1059
+ $106.set(canRender, true);
1060
+ },
1061
+ $$props.delayMs
1062
+ );
1063
+ return () => clearTimeout(timer);
1064
+ }
1065
+ });
1066
+ var fragment = $106.comment();
1067
+ var node = $106.first_child(fragment);
1068
+ {
1069
+ var consequent = ($$anchor2) => {
1070
+ var span = root_18();
1071
+ $106.attribute_effect(span, () => ({ class: $$props.class, ...rest }));
1072
+ var node_1 = $106.child(span);
1073
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
1074
+ $106.reset(span);
1075
+ $106.append($$anchor2, span);
1076
+ };
1077
+ $106.if(node, ($$render) => {
1078
+ if ($106.get(canRender) && context.status !== "loaded") $$render(consequent);
1079
+ });
1080
+ }
1081
+ $106.append($$anchor, fragment);
1082
+ $106.pop();
1083
+ }
1084
+ var root21 = $106.from_html(`<div><!></div>`);
1085
+ function Progress($$anchor, $$props) {
1086
+ $106.push($$props, true);
1087
+ let max = $106.prop($$props, "max", 3, 100), rest = $106.rest_props($$props, [
1088
+ "$$slots",
1089
+ "$$events",
1090
+ "$$legacy",
1091
+ "value",
1092
+ "max",
1093
+ "children",
1094
+ "class"
1095
+ ]);
1096
+ const machine = createProgress({ value: $$props.value, max: max() });
1097
+ let state33 = $106.state($106.proxy(machine.state));
1098
+ $106.user_effect(() => {
1099
+ return machine.subscribe((newState) => {
1100
+ $106.set(state33, newState, true);
1101
+ });
1102
+ });
1103
+ $106.user_effect(() => {
1104
+ machine.setValue($$props.value !== void 0 ? $$props.value : null);
1105
+ });
1106
+ setContext("progress", {
1107
+ get value() {
1108
+ return $106.get(state33).value;
1109
+ },
1110
+ get max() {
1111
+ return $106.get(state33).max;
1112
+ }
1113
+ });
1114
+ var div = root21();
1115
+ $106.attribute_effect(
1116
+ div,
1117
+ ($0) => ({
1118
+ role: "progressbar",
1119
+ "aria-valuemax": max(),
1120
+ "aria-valuemin": 0,
1121
+ "aria-valuenow": $106.get(state33).value ?? void 0,
1122
+ "aria-valuetext": $0,
1123
+ "data-state": $106.get(state33).value === null ? "indeterminate" : "loading",
1124
+ "data-value": $106.get(state33).value,
1125
+ "data-max": max(),
1126
+ class: $$props.class,
1127
+ ...rest
1128
+ }),
1129
+ [
1130
+ () => $106.get(state33).value === null ? "Indeterminate" : `${Math.round($106.get(state33).value / max() * 100)}%`
1131
+ ]
1132
+ );
1133
+ var node = $106.child(div);
1134
+ $106.snippet(node, () => $$props.children ?? $106.noop);
1135
+ $106.reset(div);
1136
+ $106.append($$anchor, div);
1137
+ $106.pop();
1138
+ }
1139
+ var root22 = $106.from_html(`<span><!></span>`);
1140
+ function Slider($$anchor, $$props) {
1141
+ $106.push($$props, true);
1142
+ let min = $106.prop($$props, "min", 3, 0), max = $106.prop($$props, "max", 3, 100), step = $106.prop($$props, "step", 3, 1), disabled = $106.prop($$props, "disabled", 3, false), orientation = $106.prop($$props, "orientation", 3, "horizontal"), rest = $106.rest_props($$props, [
1143
+ "$$slots",
1144
+ "$$events",
1145
+ "$$legacy",
1146
+ "value",
1147
+ "defaultValue",
1148
+ "min",
1149
+ "max",
1150
+ "step",
1151
+ "disabled",
1152
+ "orientation",
1153
+ "onValueChange",
1154
+ "children",
1155
+ "class"
1156
+ ]);
1157
+ const machine = createSlider({
1158
+ value: $$props.value,
1159
+ defaultValue: $$props.defaultValue,
1160
+ min: min(),
1161
+ max: max(),
1162
+ step: step(),
1163
+ disabled: disabled(),
1164
+ orientation: orientation(),
1165
+ onValueChange: $$props.onValueChange
1166
+ });
1167
+ let state33 = $106.state($106.proxy(machine.state));
1168
+ $106.user_effect(() => {
1169
+ return machine.subscribe((newState) => {
1170
+ $106.set(state33, newState, true);
1171
+ });
1172
+ });
1173
+ function updateThumb(index, val) {
1174
+ const nextValues = [...$106.get(state33).value];
1175
+ nextValues[index] = val;
1176
+ machine.actions.setValue(nextValues);
1177
+ }
1178
+ setContext("slider", {
1179
+ get value() {
1180
+ return $106.get(state33).value;
1181
+ },
1182
+ get min() {
1183
+ return min();
1184
+ },
1185
+ get max() {
1186
+ return max();
1187
+ },
1188
+ get step() {
1189
+ return step();
1190
+ },
1191
+ get orientation() {
1192
+ return orientation();
1193
+ },
1194
+ get disabled() {
1195
+ return $106.get(state33).disabled;
1196
+ },
1197
+ updateThumb
1198
+ });
1199
+ var span = root22();
1200
+ $106.attribute_effect(span, () => ({
1201
+ role: "group",
1202
+ dir: "ltr",
1203
+ "data-orientation": orientation(),
1204
+ "data-disabled": disabled() ? "" : void 0,
1205
+ style: `position: relative; display: flex; align-items: center; user-select: none; touch-action: none; ${orientation() === "horizontal" ? "width: 100%; height: 20px;" : "flex-direction: column; width: 20px; height: 100%;"}`,
1206
+ class: $$props.class,
1207
+ ...rest
1208
+ }));
1209
+ var node = $106.child(span);
1210
+ $106.snippet(node, () => $$props.children ?? $106.noop);
1211
+ $106.reset(span);
1212
+ $106.template_effect(() => span.dir = span.dir);
1213
+ $106.append($$anchor, span);
1214
+ $106.pop();
1215
+ }
1216
+ var root23 = $106.from_html(`<span><!></span>`);
1217
+ function SliderTrack($$anchor, $$props) {
1218
+ $106.push($$props, true);
1219
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "class"]);
1220
+ const context = getContext("slider");
1221
+ var span = root23();
1222
+ $106.attribute_effect(span, () => ({
1223
+ "data-orientation": context.orientation,
1224
+ "data-disabled": context.disabled ? "" : void 0,
1225
+ style: `position: relative; flex-grow: 1; border-radius: 9999px; background-color: #ddd; ${context.orientation === "horizontal" ? "height: 3px;" : "width: 3px;"}`,
1226
+ class: $$props.class,
1227
+ ...rest
1228
+ }));
1229
+ var node = $106.child(span);
1230
+ $106.snippet(node, () => $$props.children ?? $106.noop);
1231
+ $106.reset(span);
1232
+ $106.append($$anchor, span);
1233
+ $106.pop();
1234
+ }
1235
+ var root24 = $106.from_html(`<span></span>`);
1236
+ function SliderRange($$anchor, $$props) {
1237
+ $106.push($$props, true);
1238
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "class"]);
1239
+ const context = getContext("slider");
1240
+ let percentage = $106.derived(() => ((context.value[0] ?? 0) - context.min) / (context.max - context.min) * 100);
1241
+ var span = root24();
1242
+ $106.attribute_effect(span, () => ({
1243
+ "data-orientation": context.orientation,
1244
+ "data-disabled": context.disabled ? "" : void 0,
1245
+ style: `position: absolute; background-color: black; border-radius: 9999px; height: 100%; ${context.orientation === "horizontal" ? `width: ${$106.get(percentage)}%;` : `height: ${$106.get(percentage)}%; bottom: 0;`}`,
1246
+ class: $$props.class,
1247
+ ...rest
1248
+ }));
1249
+ $106.append($$anchor, span);
1250
+ $106.pop();
1251
+ }
1252
+ var root25 = $106.from_html(`<span></span>`);
1253
+ function SliderThumb($$anchor, $$props) {
1254
+ $106.push($$props, true);
1255
+ let index = $106.prop($$props, "index", 3, 0), rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "index", "class"]);
1256
+ const context = getContext("slider");
1257
+ let value = $106.derived(() => context.value[index()] ?? context.min);
1258
+ let percent = $106.derived(() => ($106.get(value) - context.min) / (context.max - context.min) * 100);
1259
+ function handleKeyDown(e) {
1260
+ if (context.disabled) return;
1261
+ let nextValue = $106.get(value);
1262
+ if (e.key === "ArrowRight" || e.key === "ArrowUp") {
1263
+ nextValue = Math.min(context.max, $106.get(value) + context.step);
1264
+ } else if (e.key === "ArrowLeft" || e.key === "ArrowDown") {
1265
+ nextValue = Math.max(context.min, $106.get(value) - context.step);
1266
+ } else if (e.key === "Home") {
1267
+ nextValue = context.min;
1268
+ } else if (e.key === "End") {
1269
+ nextValue = context.max;
1270
+ } else {
1271
+ return;
1272
+ }
1273
+ e.preventDefault();
1274
+ context.updateThumb(index(), nextValue);
1275
+ }
1276
+ var span = root25();
1277
+ $106.attribute_effect(span, () => ({
1278
+ role: "slider",
1279
+ "aria-valuemin": context.min,
1280
+ "aria-valuemax": context.max,
1281
+ "aria-valuenow": $106.get(value),
1282
+ "aria-orientation": context.orientation,
1283
+ "data-orientation": context.orientation,
1284
+ "data-disabled": context.disabled ? "" : void 0,
1285
+ tabindex: context.disabled ? void 0 : 0,
1286
+ onkeydown: handleKeyDown,
1287
+ style: `display: block; width: 20px; height: 20px; border-radius: 10px; background-color: white; box-shadow: 0 2px 10px black; position: absolute; transform: translate(-50%, -50%); ${context.orientation === "horizontal" ? `left: ${$106.get(percent)}%; top: 50%;` : `bottom: ${$106.get(percent)}%; left: 50%;`}`,
1288
+ class: $$props.class,
1289
+ ...rest
1290
+ }));
1291
+ $106.append($$anchor, span);
1292
+ $106.pop();
1293
+ }
1294
+ var root26 = $106.from_html(`<!> <input type="hidden"/>`, 1);
1295
+ function Select($$anchor, $$props) {
1296
+ $106.push($$props, true);
1297
+ let disabled = $106.prop($$props, "disabled", 3, false), required = $106.prop($$props, "required", 3, false);
1298
+ const machine = createSelect({
1299
+ value: $$props.value,
1300
+ defaultValue: $$props.defaultValue,
1301
+ onValueChange: $$props.onValueChange,
1302
+ open: $$props.open,
1303
+ defaultOpen: $$props.defaultOpen,
1304
+ onOpenChange: $$props.onOpenChange,
1305
+ disabled: disabled(),
1306
+ required: required()
1307
+ });
1308
+ let state33 = $106.state($106.proxy(machine.state));
1309
+ let triggerElement = $106.state(null);
1310
+ $106.user_effect(() => {
1311
+ return machine.subscribe((newState) => {
1312
+ $106.set(state33, newState, true);
1313
+ });
1314
+ });
1315
+ let value = $106.derived(() => $$props.value !== void 0 ? $$props.value : $106.get(state33).value);
1316
+ let isOpen = $106.derived(() => $$props.open !== void 0 ? $$props.open : $106.get(state33).open);
1317
+ function setValue(val) {
1318
+ if ($$props.value !== void 0) {
1319
+ $$props.onValueChange?.(val);
1320
+ } else {
1321
+ machine.actions.setValue(val);
1322
+ }
1323
+ setOpen(false);
1324
+ }
1325
+ function setOpen(val) {
1326
+ if ($$props.open !== void 0) {
1327
+ $$props.onOpenChange?.(val);
1328
+ } else {
1329
+ machine.actions.setOpen(val);
1330
+ }
1331
+ }
1332
+ function registerTrigger(el) {
1333
+ $106.set(triggerElement, el, true);
1334
+ }
1335
+ setContext("select", {
1336
+ get value() {
1337
+ return $106.get(value);
1338
+ },
1339
+ get open() {
1340
+ return $106.get(isOpen);
1341
+ },
1342
+ get disabled() {
1343
+ return disabled();
1344
+ },
1345
+ get trigger() {
1346
+ return $106.get(triggerElement);
1347
+ },
1348
+ setValue,
1349
+ setOpen,
1350
+ registerTrigger
1351
+ });
1352
+ var fragment = root26();
1353
+ var node = $106.first_child(fragment);
1354
+ $106.snippet(node, () => $$props.children ?? $106.noop);
1355
+ var input = $106.sibling(node, 2);
1356
+ $106.remove_input_defaults(input);
1357
+ $106.template_effect(() => {
1358
+ $106.set_attribute(input, "name", $$props.name);
1359
+ $106.set_value(input, $106.get(value));
1360
+ input.required = required();
1361
+ input.disabled = disabled();
1362
+ });
1363
+ $106.append($$anchor, fragment);
1364
+ $106.pop();
1365
+ }
1366
+ var root27 = $106.from_html(`<button><!></button>`);
1367
+ function SelectTrigger($$anchor, $$props) {
1368
+ $106.push($$props, true);
1369
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
1370
+ const ctx = getContext("select");
1371
+ let el;
1372
+ onMount(() => {
1373
+ if (el) ctx.registerTrigger(el);
1374
+ });
1375
+ function handleClick(e) {
1376
+ if (ctx.disabled) return;
1377
+ if ($$props.onclick) $$props.onclick(e);
1378
+ if (!e.defaultPrevented) {
1379
+ ctx.setOpen(!ctx.open);
1380
+ }
1381
+ }
1382
+ var button = root27();
1383
+ $106.attribute_effect(button, () => ({
1384
+ type: "button",
1385
+ role: "combobox",
1386
+ "aria-controls": "select-content",
1387
+ "aria-expanded": ctx.open,
1388
+ "aria-required": ctx.required,
1389
+ "aria-disabled": ctx.disabled,
1390
+ "data-state": ctx.open ? "open" : "closed",
1391
+ "data-disabled": ctx.disabled ? "" : void 0,
1392
+ ...rest,
1393
+ onclick: handleClick
1394
+ }));
1395
+ var node = $106.child(button);
1396
+ $106.snippet(node, () => $$props.children ?? $106.noop);
1397
+ $106.reset(button);
1398
+ $106.bind_this(button, ($$value) => el = $$value, () => el);
1399
+ $106.append($$anchor, button);
1400
+ $106.pop();
1401
+ }
1402
+ var root28 = $106.from_html(`<span><!></span>`);
1403
+ function SelectValue($$anchor, $$props) {
1404
+ $106.push($$props, true);
1405
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "placeholder"]);
1406
+ const ctx = getContext("select");
1407
+ var span = root28();
1408
+ $106.attribute_effect(span, () => ({ ...rest, [$106.STYLE]: { "pointer-events": "none" } }));
1409
+ var node = $106.child(span);
1410
+ {
1411
+ var consequent = ($$anchor2) => {
1412
+ var text4 = $106.text();
1413
+ $106.template_effect(() => $106.set_text(text4, $$props.placeholder));
1414
+ $106.append($$anchor2, text4);
1415
+ };
1416
+ var alternate = ($$anchor2) => {
1417
+ var text_1 = $106.text();
1418
+ $106.template_effect(() => $106.set_text(text_1, ctx.value));
1419
+ $106.append($$anchor2, text_1);
1420
+ };
1421
+ $106.if(node, ($$render) => {
1422
+ if (ctx.value === "" && $$props.placeholder) $$render(consequent);
1423
+ else $$render(alternate, false);
1424
+ });
1425
+ }
1426
+ $106.reset(span);
1427
+ $106.append($$anchor, span);
1428
+ $106.pop();
1429
+ }
1430
+
1431
+ // src/internal/portal.ts
1432
+ function portal(node, target = "body") {
1433
+ let targetNode = null;
1434
+ function update(newTarget) {
1435
+ targetNode = typeof newTarget === "string" ? document.querySelector(newTarget) : newTarget;
1436
+ if (targetNode) {
1437
+ targetNode.appendChild(node);
1438
+ }
1439
+ }
1440
+ update(target);
1441
+ return {
1442
+ update,
1443
+ destroy() {
1444
+ if (node.parentNode) {
1445
+ node.parentNode.removeChild(node);
1446
+ }
1447
+ }
1448
+ };
1449
+ }
1450
+
1451
+ // src/internal/position.ts
1452
+ function position(node, options) {
1453
+ let { trigger, side = "bottom", align = "center", sideOffset = 0, alignOffset = 0, collisionDetection = true } = options;
1454
+ function updatePosition() {
1455
+ if (!trigger || !node) return;
1456
+ const triggerRect = trigger.getBoundingClientRect();
1457
+ const contentRect = node.getBoundingClientRect();
1458
+ const viewportWidth = window.innerWidth;
1459
+ const viewportHeight = window.innerHeight;
1460
+ const scrollX = window.scrollX;
1461
+ const scrollY = window.scrollY;
1462
+ let finalSide = side;
1463
+ const calculatePos = (s) => {
1464
+ let t = 0;
1465
+ let l = 0;
1466
+ switch (s) {
1467
+ case "top":
1468
+ t = triggerRect.top + scrollY - contentRect.height - sideOffset;
1469
+ break;
1470
+ case "bottom":
1471
+ t = triggerRect.bottom + scrollY + sideOffset;
1472
+ break;
1473
+ case "left":
1474
+ l = triggerRect.left + scrollX - contentRect.width - sideOffset;
1475
+ break;
1476
+ case "right":
1477
+ l = triggerRect.right + scrollX + sideOffset;
1478
+ break;
1479
+ }
1480
+ if (s === "top" || s === "bottom") {
1481
+ switch (align) {
1482
+ case "start":
1483
+ l = triggerRect.left + scrollX + alignOffset;
1484
+ break;
1485
+ case "center":
1486
+ l = triggerRect.left + scrollX + triggerRect.width / 2 - contentRect.width / 2;
1487
+ break;
1488
+ case "end":
1489
+ l = triggerRect.right + scrollX - contentRect.width - alignOffset;
1490
+ break;
1491
+ }
1492
+ } else {
1493
+ switch (align) {
1494
+ case "start":
1495
+ t = triggerRect.top + scrollY + alignOffset;
1496
+ break;
1497
+ case "center":
1498
+ t = triggerRect.top + scrollY + triggerRect.height / 2 - contentRect.height / 2;
1499
+ break;
1500
+ case "end":
1501
+ t = triggerRect.bottom + scrollY - contentRect.height - alignOffset;
1502
+ break;
1503
+ }
1504
+ }
1505
+ return { top: t, left: l };
1506
+ };
1507
+ let pos = calculatePos(side);
1508
+ if (collisionDetection) {
1509
+ const overflowsBottom = side === "bottom" && pos.top + contentRect.height - scrollY > viewportHeight;
1510
+ const overflowsTop = side === "top" && pos.top - scrollY < 0;
1511
+ if (overflowsBottom) {
1512
+ const flippedPos = calculatePos("top");
1513
+ if (flippedPos.top - scrollY >= 0) {
1514
+ pos = flippedPos;
1515
+ finalSide = "top";
1516
+ }
1517
+ } else if (overflowsTop) {
1518
+ const flippedPos = calculatePos("bottom");
1519
+ if (flippedPos.top + contentRect.height - scrollY <= viewportHeight) {
1520
+ pos = flippedPos;
1521
+ finalSide = "bottom";
1522
+ }
1523
+ }
1524
+ }
1525
+ if (pos.left - scrollX < 0) pos.left = scrollX + 5;
1526
+ if (pos.left + contentRect.width - scrollX > viewportWidth) pos.left = scrollX + viewportWidth - contentRect.width - 5;
1527
+ if (finalSide === "left" || finalSide === "right") {
1528
+ if (pos.top - scrollY < 0) pos.top = scrollY + 5;
1529
+ if (pos.top + contentRect.height - scrollY > viewportHeight) pos.top = scrollY + viewportHeight - contentRect.height - 5;
1530
+ }
1531
+ node.style.position = "absolute";
1532
+ node.style.top = `${Math.round(pos.top)}px`;
1533
+ node.style.left = `${Math.round(pos.left)}px`;
1534
+ node.setAttribute("data-side", finalSide);
1535
+ node.setAttribute("data-align", align);
1536
+ }
1537
+ updatePosition();
1538
+ window.addEventListener("resize", updatePosition);
1539
+ window.addEventListener("scroll", updatePosition, true);
1540
+ return {
1541
+ update(newOptions) {
1542
+ trigger = newOptions.trigger;
1543
+ side = newOptions.side || "bottom";
1544
+ align = newOptions.align || "center";
1545
+ sideOffset = newOptions.sideOffset || 0;
1546
+ alignOffset = newOptions.alignOffset || 0;
1547
+ collisionDetection = newOptions.collisionDetection ?? true;
1548
+ updatePosition();
1549
+ },
1550
+ destroy() {
1551
+ window.removeEventListener("resize", updatePosition);
1552
+ window.removeEventListener("scroll", updatePosition, true);
1553
+ }
1554
+ };
1555
+ }
1556
+
1557
+ // src/internal/focus-trap.ts
1558
+ var FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
1559
+ function focusTrap(node, options = { active: true, returnFocus: true }) {
1560
+ let previousFocus = null;
1561
+ let active = options.active;
1562
+ function activate() {
1563
+ if (active) {
1564
+ previousFocus = document.activeElement;
1565
+ const focusable = node.querySelectorAll(FOCUSABLE_SELECTOR);
1566
+ if (focusable.length > 0) {
1567
+ focusable[0].focus();
1568
+ } else {
1569
+ node.focus();
1570
+ }
1571
+ document.addEventListener("keydown", handleKeyDown);
1572
+ }
1573
+ }
1574
+ function deactivate() {
1575
+ document.removeEventListener("keydown", handleKeyDown);
1576
+ if (options.returnFocus && previousFocus) {
1577
+ previousFocus.focus();
1578
+ }
1579
+ }
1580
+ function handleKeyDown(e) {
1581
+ if (!active) return;
1582
+ if (e.key !== "Tab") return;
1583
+ const focusable = Array.from(node.querySelectorAll(FOCUSABLE_SELECTOR));
1584
+ if (focusable.length === 0) return;
1585
+ const first = focusable[0];
1586
+ const last = focusable[focusable.length - 1];
1587
+ if (e.shiftKey) {
1588
+ if (document.activeElement === first) {
1589
+ last.focus();
1590
+ e.preventDefault();
1591
+ }
1592
+ } else {
1593
+ if (document.activeElement === last) {
1594
+ first.focus();
1595
+ e.preventDefault();
1596
+ }
1597
+ }
1598
+ }
1599
+ if (active) activate();
1600
+ return {
1601
+ update(newOptions) {
1602
+ const wasActive = active;
1603
+ active = newOptions.active;
1604
+ options = newOptions;
1605
+ if (!wasActive && active) {
1606
+ activate();
1607
+ } else if (wasActive && !active) {
1608
+ deactivate();
1609
+ }
1610
+ },
1611
+ destroy() {
1612
+ if (active) deactivate();
1613
+ }
1614
+ };
1615
+ }
1616
+
1617
+ // src/SelectContent.svelte
1618
+ var root_19 = $106.from_html(`<div><div><!></div></div>`);
1619
+ function SelectContent($$anchor, $$props) {
1620
+ $106.push($$props, true);
1621
+ let side = $106.prop($$props, "side", 3, "bottom"), align = $106.prop($$props, "align", 3, "start"), sideOffset = $106.prop($$props, "sideOffset", 3, 0), alignOffset = $106.prop($$props, "alignOffset", 3, 0); $106.prop($$props, "position", 3, "item-aligned"); let rest = $106.rest_props($$props, [
1622
+ "$$slots",
1623
+ "$$events",
1624
+ "$$legacy",
1625
+ "children",
1626
+ "side",
1627
+ "align",
1628
+ "sideOffset",
1629
+ "alignOffset",
1630
+ "position"
1631
+ ]);
1632
+ const ctx = getContext("select");
1633
+ function handleKeyDown(e) {
1634
+ if (e.key === "Escape") {
1635
+ e.preventDefault();
1636
+ ctx.setOpen(false);
1637
+ }
1638
+ }
1639
+ var fragment = $106.comment();
1640
+ var node = $106.first_child(fragment);
1641
+ {
1642
+ var consequent = ($$anchor2) => {
1643
+ var div = root_19();
1644
+ var div_1 = $106.child(div);
1645
+ $106.attribute_effect(div_1, () => ({
1646
+ role: "listbox",
1647
+ id: "select-content",
1648
+ "data-state": ctx.open ? "open" : "closed",
1649
+ style: "z-index: 50; background-color: white; border: 1px solid #ccc; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); min-width: 100px;",
1650
+ ...rest,
1651
+ onkeydown: handleKeyDown,
1652
+ tabindex: "-1"
1653
+ }));
1654
+ var node_1 = $106.child(div_1);
1655
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
1656
+ $106.reset(div_1);
1657
+ $106.action(div_1, ($$node, $$action_arg) => position?.($$node, $$action_arg), () => ({
1658
+ trigger: ctx.trigger,
1659
+ side: side(),
1660
+ align: align(),
1661
+ sideOffset: sideOffset(),
1662
+ alignOffset: alignOffset()
1663
+ }));
1664
+ $106.action(div_1, ($$node, $$action_arg) => focusTrap?.($$node, $$action_arg), () => ({ active: true, returnFocus: true }));
1665
+ $106.reset(div);
1666
+ $106.action(div, ($$node) => portal?.($$node));
1667
+ $106.append($$anchor2, div);
1668
+ };
1669
+ $106.if(node, ($$render) => {
1670
+ if (ctx.open) $$render(consequent);
1671
+ });
1672
+ }
1673
+ $106.append($$anchor, fragment);
1674
+ $106.pop();
1675
+ }
1676
+ var root29 = $106.from_html(`<div><!></div>`);
1677
+ function SelectViewport($$anchor, $$props) {
1678
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
1679
+ var div = root29();
1680
+ $106.attribute_effect(div, () => ({ ...rest, [$106.STYLE]: { padding: "5px", overflow: "auto" } }));
1681
+ var node = $106.child(div);
1682
+ $106.snippet(node, () => $$props.children ?? $106.noop);
1683
+ $106.reset(div);
1684
+ $106.append($$anchor, div);
1685
+ }
1686
+ var root30 = $106.from_html(`<div><!></div>`);
1687
+ function SelectItem($$anchor, $$props) {
1688
+ $106.push($$props, true);
1689
+ let disabled = $106.prop($$props, "disabled", 3, false), rest = $106.rest_props($$props, [
1690
+ "$$slots",
1691
+ "$$events",
1692
+ "$$legacy",
1693
+ "value",
1694
+ "disabled",
1695
+ "children"
1696
+ ]);
1697
+ const ctx = getContext("select");
1698
+ let isSelected = $106.derived(() => ctx.value === $$props.value);
1699
+ function handleClick(e) {
1700
+ if (disabled()) return;
1701
+ if ($$props.onclick) $$props.onclick(e);
1702
+ if (!e.defaultPrevented) {
1703
+ ctx.setValue($$props.value);
1704
+ }
1705
+ }
1706
+ function handleKeyDown(e) {
1707
+ if (disabled()) return;
1708
+ if (e.key === "Enter" || e.key === " ") {
1709
+ e.preventDefault();
1710
+ ctx.setValue($$props.value);
1711
+ }
1712
+ }
1713
+ setContext("select-item", {
1714
+ get isSelected() {
1715
+ return $106.get(isSelected);
1716
+ }
1717
+ });
1718
+ var div = root30();
1719
+ $106.attribute_effect(div, () => ({
1720
+ role: "option",
1721
+ "aria-selected": $106.get(isSelected),
1722
+ "aria-disabled": disabled(),
1723
+ "data-state": $106.get(isSelected) ? "checked" : "unchecked",
1724
+ "data-disabled": disabled() ? "" : void 0,
1725
+ tabindex: disabled() ? -1 : 0,
1726
+ ...rest,
1727
+ onclick: handleClick,
1728
+ onkeydown: handleKeyDown,
1729
+ [$106.STYLE]: {
1730
+ cursor: disabled() ? "not-allowed" : "pointer",
1731
+ padding: "5px 10px",
1732
+ outline: "none"
1733
+ }
1734
+ }));
1735
+ var node = $106.child(div);
1736
+ $106.snippet(node, () => $$props.children ?? $106.noop);
1737
+ $106.reset(div);
1738
+ $106.append($$anchor, div);
1739
+ $106.pop();
1740
+ }
1741
+ var root_110 = $106.from_html(`<span><!></span>`);
1742
+ function SelectItemIndicator($$anchor, $$props) {
1743
+ $106.push($$props, true);
1744
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
1745
+ const itemCtx = getContext("select-item");
1746
+ var fragment = $106.comment();
1747
+ var node = $106.first_child(fragment);
1748
+ {
1749
+ var consequent_1 = ($$anchor2) => {
1750
+ var span = root_110();
1751
+ $106.attribute_effect(span, () => ({ "aria-hidden": "true", ...rest }));
1752
+ var node_1 = $106.child(span);
1753
+ {
1754
+ var consequent = ($$anchor3) => {
1755
+ var fragment_1 = $106.comment();
1756
+ var node_2 = $106.first_child(fragment_1);
1757
+ $106.snippet(node_2, () => $$props.children);
1758
+ $106.append($$anchor3, fragment_1);
1759
+ };
1760
+ var alternate = ($$anchor3) => {
1761
+ var text4 = $106.text("\u2713");
1762
+ $106.append($$anchor3, text4);
1763
+ };
1764
+ $106.if(node_1, ($$render) => {
1765
+ if ($$props.children) $$render(consequent);
1766
+ else $$render(alternate, false);
1767
+ });
1768
+ }
1769
+ $106.reset(span);
1770
+ $106.append($$anchor2, span);
1771
+ };
1772
+ $106.if(node, ($$render) => {
1773
+ if (itemCtx?.isSelected) $$render(consequent_1);
1774
+ });
1775
+ }
1776
+ $106.append($$anchor, fragment);
1777
+ $106.pop();
1778
+ }
1779
+ var root31 = $106.from_html(`<div><!></div>`);
1780
+ function SelectGroup($$anchor, $$props) {
1781
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
1782
+ var div = root31();
1783
+ $106.attribute_effect(div, () => ({ role: "group", ...rest }));
1784
+ var node = $106.child(div);
1785
+ $106.snippet(node, () => $$props.children ?? $106.noop);
1786
+ $106.reset(div);
1787
+ $106.append($$anchor, div);
1788
+ }
1789
+ var root32 = $106.from_html(`<div><!></div>`);
1790
+ function SelectLabel($$anchor, $$props) {
1791
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
1792
+ var div = root32();
1793
+ $106.attribute_effect(div, () => ({
1794
+ ...rest,
1795
+ [$106.STYLE]: { padding: "5px 10px", "font-size": "12px", color: "#666" }
1796
+ }));
1797
+ var node = $106.child(div);
1798
+ $106.snippet(node, () => $$props.children ?? $106.noop);
1799
+ $106.reset(div);
1800
+ $106.append($$anchor, div);
1801
+ }
1802
+ var root33 = $106.from_html(`<div></div>`);
1803
+ function SelectSeparator($$anchor, $$props) {
1804
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy"]);
1805
+ var div = root33();
1806
+ $106.attribute_effect(div, () => ({
1807
+ ...rest,
1808
+ [$106.STYLE]: { height: "1px", "background-color": "#eee", margin: "5px 0" }
1809
+ }));
1810
+ $106.append($$anchor, div);
1811
+ }
1812
+ var root34 = $106.from_html(`<!> <input type="hidden"/>`, 1);
1813
+ function Combobox($$anchor, $$props) {
1814
+ $106.push($$props, true);
1815
+ let disabled = $106.prop($$props, "disabled", 3, false);
1816
+ const machine = createCombobox({
1817
+ value: $$props.value,
1818
+ defaultValue: $$props.defaultValue,
1819
+ inputValue: $$props.inputValue,
1820
+ defaultInputValue: $$props.defaultInputValue,
1821
+ onValueChange: $$props.onValueChange,
1822
+ onInputValueChange: $$props.onInputValueChange,
1823
+ open: $$props.open,
1824
+ defaultOpen: $$props.defaultOpen,
1825
+ onOpenChange: $$props.onOpenChange,
1826
+ disabled: disabled()
1827
+ });
1828
+ let state33 = $106.state($106.proxy(machine.state));
1829
+ let triggerElement = $106.state(null);
1830
+ let inputElement = $106.state(null);
1831
+ $106.user_effect(() => {
1832
+ return machine.subscribe((newState) => {
1833
+ $106.set(state33, newState, true);
1834
+ });
1835
+ });
1836
+ let value = $106.derived(() => $$props.value !== void 0 ? $$props.value : $106.get(state33).value);
1837
+ let inputValue = $106.derived(() => $$props.inputValue !== void 0 ? $$props.inputValue : $106.get(state33).inputValue);
1838
+ let isOpen = $106.derived(() => $$props.open !== void 0 ? $$props.open : $106.get(state33).open);
1839
+ function setValue(val) {
1840
+ if ($$props.value !== void 0) {
1841
+ $$props.onValueChange?.(val);
1842
+ } else {
1843
+ machine.actions.setValue(val);
1844
+ }
1845
+ setInputValue(val);
1846
+ setOpen(false);
1847
+ }
1848
+ function setInputValue(val) {
1849
+ if ($$props.inputValue !== void 0) {
1850
+ $$props.onInputValueChange?.(val);
1851
+ } else {
1852
+ machine.actions.setInputValue(val);
1853
+ }
1854
+ if (val && !$106.get(isOpen)) {
1855
+ setOpen(true);
1856
+ }
1857
+ }
1858
+ function setOpen(val) {
1859
+ if ($$props.open !== void 0) {
1860
+ $$props.onOpenChange?.(val);
1861
+ } else {
1862
+ machine.actions.setOpen(val);
1863
+ }
1864
+ }
1865
+ function registerTrigger(el) {
1866
+ $106.set(triggerElement, el, true);
1867
+ }
1868
+ function registerInput(el) {
1869
+ $106.set(inputElement, el, true);
1870
+ }
1871
+ setContext("combobox", {
1872
+ get value() {
1873
+ return $106.get(value);
1874
+ },
1875
+ get inputValue() {
1876
+ return $106.get(inputValue);
1877
+ },
1878
+ get open() {
1879
+ return $106.get(isOpen);
1880
+ },
1881
+ get disabled() {
1882
+ return disabled();
1883
+ },
1884
+ get trigger() {
1885
+ return $106.get(triggerElement);
1886
+ },
1887
+ get input() {
1888
+ return $106.get(inputElement);
1889
+ },
1890
+ setValue,
1891
+ setInputValue,
1892
+ setOpen,
1893
+ registerTrigger,
1894
+ registerInput
1895
+ });
1896
+ var fragment = root34();
1897
+ var node = $106.first_child(fragment);
1898
+ $106.snippet(node, () => $$props.children ?? $106.noop);
1899
+ var input = $106.sibling(node, 2);
1900
+ $106.remove_input_defaults(input);
1901
+ $106.template_effect(() => {
1902
+ $106.set_attribute(input, "name", $$props.name);
1903
+ $106.set_value(input, $106.get(value));
1904
+ input.disabled = disabled();
1905
+ });
1906
+ $106.append($$anchor, fragment);
1907
+ $106.pop();
1908
+ }
1909
+ var root35 = $106.from_html(`<input/>`);
1910
+ function ComboboxInput($$anchor, $$props) {
1911
+ $106.push($$props, true);
1912
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
1913
+ const ctx = getContext("combobox");
1914
+ let el;
1915
+ onMount(() => {
1916
+ if (el) ctx.registerInput(el);
1917
+ });
1918
+ function handleInput(e) {
1919
+ const target = e.target;
1920
+ ctx.setInputValue(target.value);
1921
+ }
1922
+ function handleKeyDown(e) {
1923
+ if (e.key === "ArrowDown") {
1924
+ e.preventDefault();
1925
+ if (!ctx.open) ctx.setOpen(true);
1926
+ } else if (e.key === "Escape") {
1927
+ if (ctx.open) {
1928
+ e.preventDefault();
1929
+ ctx.setOpen(false);
1930
+ }
1931
+ }
1932
+ }
1933
+ function handleClick() {
1934
+ if (!ctx.open) ctx.setOpen(true);
1935
+ }
1936
+ var input = root35();
1937
+ $106.attribute_effect(
1938
+ input,
1939
+ () => ({
1940
+ type: "text",
1941
+ role: "combobox",
1942
+ "aria-autocomplete": "list",
1943
+ "aria-expanded": ctx.open,
1944
+ "aria-controls": "combobox-content",
1945
+ "aria-disabled": ctx.disabled,
1946
+ "data-state": ctx.open ? "open" : "closed",
1947
+ disabled: ctx.disabled,
1948
+ value: ctx.inputValue,
1949
+ ...rest,
1950
+ oninput: handleInput,
1951
+ onkeydown: handleKeyDown,
1952
+ onclick: handleClick
1953
+ }),
1954
+ void 0,
1955
+ void 0,
1956
+ void 0,
1957
+ void 0,
1958
+ true
1959
+ );
1960
+ $106.bind_this(input, ($$value) => el = $$value, () => el);
1961
+ $106.append($$anchor, input);
1962
+ $106.pop();
1963
+ }
1964
+ var root36 = $106.from_html(`<button><!></button>`);
1965
+ function ComboboxTrigger($$anchor, $$props) {
1966
+ $106.push($$props, true);
1967
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
1968
+ const ctx = getContext("combobox");
1969
+ let el;
1970
+ onMount(() => {
1971
+ if (el) ctx.registerTrigger(el);
1972
+ });
1973
+ function handleClick(e) {
1974
+ if (ctx.disabled) return;
1975
+ if ($$props.onclick) $$props.onclick(e);
1976
+ if (!e.defaultPrevented) {
1977
+ ctx.setOpen(!ctx.open);
1978
+ if (!ctx.open) {
1979
+ ctx.input?.focus();
1980
+ }
1981
+ }
1982
+ }
1983
+ var button = root36();
1984
+ $106.attribute_effect(button, () => ({
1985
+ type: "button",
1986
+ "aria-haspopup": "listbox",
1987
+ "aria-expanded": ctx.open,
1988
+ "aria-controls": "combobox-content",
1989
+ "data-state": ctx.open ? "open" : "closed",
1990
+ "data-disabled": ctx.disabled ? "" : void 0,
1991
+ disabled: ctx.disabled,
1992
+ tabindex: "-1",
1993
+ ...rest,
1994
+ onclick: handleClick
1995
+ }));
1996
+ var node = $106.child(button);
1997
+ $106.snippet(node, () => $$props.children ?? $106.noop);
1998
+ $106.reset(button);
1999
+ $106.bind_this(button, ($$value) => el = $$value, () => el);
2000
+ $106.append($$anchor, button);
2001
+ $106.pop();
2002
+ }
2003
+ var root_111 = $106.from_html(`<div><div><!></div></div>`);
2004
+ function ComboboxContent($$anchor, $$props) {
2005
+ $106.push($$props, true);
2006
+ let side = $106.prop($$props, "side", 3, "bottom"), align = $106.prop($$props, "align", 3, "start"), sideOffset = $106.prop($$props, "sideOffset", 3, 0), alignOffset = $106.prop($$props, "alignOffset", 3, 0), rest = $106.rest_props($$props, [
2007
+ "$$slots",
2008
+ "$$events",
2009
+ "$$legacy",
2010
+ "children",
2011
+ "side",
2012
+ "align",
2013
+ "sideOffset",
2014
+ "alignOffset"
2015
+ ]);
2016
+ const ctx = getContext("combobox");
2017
+ let anchor = $106.derived(() => ctx.input || ctx.trigger);
2018
+ var fragment = $106.comment();
2019
+ var node = $106.first_child(fragment);
2020
+ {
2021
+ var consequent = ($$anchor2) => {
2022
+ var div = root_111();
2023
+ var div_1 = $106.child(div);
2024
+ $106.attribute_effect(div_1, () => ({
2025
+ role: "listbox",
2026
+ id: "combobox-content",
2027
+ "data-state": ctx.open ? "open" : "closed",
2028
+ style: "z-index: 50; background-color: white; border: 1px solid #ccc; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); min-width: 100px; max-height: 300px; overflow-y: auto;",
2029
+ ...rest
2030
+ }));
2031
+ var node_1 = $106.child(div_1);
2032
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
2033
+ $106.reset(div_1);
2034
+ $106.action(div_1, ($$node, $$action_arg) => position?.($$node, $$action_arg), () => ({
2035
+ trigger: $106.get(anchor),
2036
+ side: side(),
2037
+ align: align(),
2038
+ sideOffset: sideOffset(),
2039
+ alignOffset: alignOffset()
2040
+ }));
2041
+ $106.reset(div);
2042
+ $106.action(div, ($$node) => portal?.($$node));
2043
+ $106.append($$anchor2, div);
2044
+ };
2045
+ $106.if(node, ($$render) => {
2046
+ if (ctx.open && $106.get(anchor)) $$render(consequent);
2047
+ });
2048
+ }
2049
+ $106.append($$anchor, fragment);
2050
+ $106.pop();
2051
+ }
2052
+ var root37 = $106.from_html(`<div><!></div>`);
2053
+ function ComboboxItem($$anchor, $$props) {
2054
+ $106.push($$props, true);
2055
+ let disabled = $106.prop($$props, "disabled", 3, false), rest = $106.rest_props($$props, [
2056
+ "$$slots",
2057
+ "$$events",
2058
+ "$$legacy",
2059
+ "value",
2060
+ "disabled",
2061
+ "children"
2062
+ ]);
2063
+ const ctx = getContext("combobox");
2064
+ let isSelected = $106.derived(() => ctx.value === $$props.value);
2065
+ function handleClick(e) {
2066
+ if (disabled()) return;
2067
+ if ($$props.onclick) $$props.onclick(e);
2068
+ if (!e.defaultPrevented) {
2069
+ ctx.setValue($$props.value);
2070
+ }
2071
+ }
2072
+ setContext("combobox-item", {
2073
+ get isSelected() {
2074
+ return $106.get(isSelected);
2075
+ }
2076
+ });
2077
+ var div = root37();
2078
+ $106.attribute_effect(div, () => ({
2079
+ role: "option",
2080
+ "aria-selected": $106.get(isSelected),
2081
+ "aria-disabled": disabled(),
2082
+ "data-state": $106.get(isSelected) ? "checked" : "unchecked",
2083
+ "data-disabled": disabled() ? "" : void 0,
2084
+ ...rest,
2085
+ onclick: handleClick,
2086
+ [$106.STYLE]: {
2087
+ cursor: disabled() ? "not-allowed" : "pointer",
2088
+ padding: "5px 10px"
2089
+ }
2090
+ }));
2091
+ var node = $106.child(div);
2092
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2093
+ $106.reset(div);
2094
+ $106.append($$anchor, div);
2095
+ $106.pop();
2096
+ }
2097
+ var root_112 = $106.from_html(`<span><!></span>`);
2098
+ function ComboboxItemIndicator($$anchor, $$props) {
2099
+ $106.push($$props, true);
2100
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
2101
+ const itemCtx = getContext("combobox-item");
2102
+ var fragment = $106.comment();
2103
+ var node = $106.first_child(fragment);
2104
+ {
2105
+ var consequent_1 = ($$anchor2) => {
2106
+ var span = root_112();
2107
+ $106.attribute_effect(span, () => ({ "aria-hidden": "true", ...rest }));
2108
+ var node_1 = $106.child(span);
2109
+ {
2110
+ var consequent = ($$anchor3) => {
2111
+ var fragment_1 = $106.comment();
2112
+ var node_2 = $106.first_child(fragment_1);
2113
+ $106.snippet(node_2, () => $$props.children);
2114
+ $106.append($$anchor3, fragment_1);
2115
+ };
2116
+ var alternate = ($$anchor3) => {
2117
+ var text4 = $106.text("\u2713");
2118
+ $106.append($$anchor3, text4);
2119
+ };
2120
+ $106.if(node_1, ($$render) => {
2121
+ if ($$props.children) $$render(consequent);
2122
+ else $$render(alternate, false);
2123
+ });
2124
+ }
2125
+ $106.reset(span);
2126
+ $106.append($$anchor2, span);
2127
+ };
2128
+ $106.if(node, ($$render) => {
2129
+ if (itemCtx?.isSelected) $$render(consequent_1);
2130
+ });
2131
+ }
2132
+ $106.append($$anchor, fragment);
2133
+ $106.pop();
2134
+ }
2135
+ var root38 = $106.from_html(`<div><!></div>`);
2136
+ function ComboboxGroup($$anchor, $$props) {
2137
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
2138
+ var div = root38();
2139
+ $106.attribute_effect(div, () => ({ role: "group", ...rest }));
2140
+ var node = $106.child(div);
2141
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2142
+ $106.reset(div);
2143
+ $106.append($$anchor, div);
2144
+ }
2145
+ var root39 = $106.from_html(`<div><!></div>`);
2146
+ function ComboboxLabel($$anchor, $$props) {
2147
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
2148
+ var div = root39();
2149
+ $106.attribute_effect(div, () => ({
2150
+ ...rest,
2151
+ [$106.STYLE]: { padding: "5px 10px", "font-size": "12px", color: "#666" }
2152
+ }));
2153
+ var node = $106.child(div);
2154
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2155
+ $106.reset(div);
2156
+ $106.append($$anchor, div);
2157
+ }
2158
+ var root40 = $106.from_html(`<div></div>`);
2159
+ function ComboboxSeparator($$anchor, $$props) {
2160
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy"]);
2161
+ var div = root40();
2162
+ $106.attribute_effect(div, () => ({
2163
+ ...rest,
2164
+ [$106.STYLE]: { height: "1px", "background-color": "#eee", margin: "5px 0" }
2165
+ }));
2166
+ $106.append($$anchor, div);
2167
+ }
2168
+ function Dialog($$anchor, $$props) {
2169
+ $106.push($$props, true);
2170
+ let modal = $106.prop($$props, "modal", 3, true);
2171
+ const machine = createDialog({
2172
+ open: $$props.open,
2173
+ defaultOpen: $$props.defaultOpen,
2174
+ onOpenChange: $$props.onOpenChange
2175
+ });
2176
+ let state33 = $106.state($106.proxy(machine.state));
2177
+ $106.user_effect(() => {
2178
+ return machine.subscribe((newState) => {
2179
+ $106.set(state33, newState, true);
2180
+ });
2181
+ });
2182
+ $106.user_effect(() => {
2183
+ if ($$props.open !== void 0 && $$props.open !== $106.get(state33).open) ;
2184
+ });
2185
+ function setOpen(val) {
2186
+ if ($$props.open !== void 0) {
2187
+ $$props.onOpenChange?.(val);
2188
+ } else {
2189
+ machine.actions.setOpen(val);
2190
+ }
2191
+ }
2192
+ let isOpen = $106.derived(() => $$props.open !== void 0 ? $$props.open : $106.get(state33).open);
2193
+ const baseId = `dialog-${Math.random().toString(36).substr(2, 9)}`;
2194
+ setContext("dialog", {
2195
+ get open() {
2196
+ return $106.get(isOpen);
2197
+ },
2198
+ get modal() {
2199
+ return modal();
2200
+ },
2201
+ setOpen,
2202
+ baseId
2203
+ });
2204
+ var fragment = $106.comment();
2205
+ var node = $106.first_child(fragment);
2206
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2207
+ $106.append($$anchor, fragment);
2208
+ $106.pop();
2209
+ }
2210
+ var root41 = $106.from_html(`<button><!></button>`);
2211
+ function DialogTrigger($$anchor, $$props) {
2212
+ $106.push($$props, true);
2213
+ let rest = $106.rest_props($$props, [
2214
+ "$$slots",
2215
+ "$$events",
2216
+ "$$legacy",
2217
+ "children",
2218
+ "class",
2219
+ "onClick"
2220
+ ]);
2221
+ const context = getContext("dialog");
2222
+ function handleClick(e) {
2223
+ context.setOpen(true);
2224
+ $$props.onClick?.(e);
2225
+ }
2226
+ var button = root41();
2227
+ $106.attribute_effect(button, () => ({
2228
+ type: "button",
2229
+ "aria-haspopup": "dialog",
2230
+ "aria-expanded": context.open,
2231
+ "data-state": context.open ? "open" : "closed",
2232
+ onclick: handleClick,
2233
+ class: $$props.class,
2234
+ ...rest
2235
+ }));
2236
+ var node = $106.child(button);
2237
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2238
+ $106.reset(button);
2239
+ $106.append($$anchor, button);
2240
+ $106.pop();
2241
+ }
2242
+ var root_113 = $106.from_html(`<div><!></div>`);
2243
+ function DialogPortal($$anchor, $$props) {
2244
+ $106.push($$props, true);
2245
+ let container = $106.prop($$props, "container", 3, "body");
2246
+ const context = getContext("dialog");
2247
+ var fragment = $106.comment();
2248
+ var node = $106.first_child(fragment);
2249
+ {
2250
+ var consequent = ($$anchor2) => {
2251
+ var div = root_113();
2252
+ var node_1 = $106.child(div);
2253
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
2254
+ $106.reset(div);
2255
+ $106.action(div, ($$node, $$action_arg) => portal?.($$node, $$action_arg), container);
2256
+ $106.append($$anchor2, div);
2257
+ };
2258
+ $106.if(node, ($$render) => {
2259
+ if (context.open) $$render(consequent);
2260
+ });
2261
+ }
2262
+ $106.append($$anchor, fragment);
2263
+ $106.pop();
2264
+ }
2265
+ var root42 = $106.from_html(`<div></div>`);
2266
+ function DialogOverlay($$anchor, $$props) {
2267
+ $106.push($$props, true);
2268
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "class", "onClick"]);
2269
+ const context = getContext("dialog");
2270
+ function handleClick(e) {
2271
+ if (context.modal) {
2272
+ context.setOpen(false);
2273
+ }
2274
+ $$props.onClick?.(e);
2275
+ }
2276
+ var div = root42();
2277
+ $106.attribute_effect(div, () => ({
2278
+ "data-state": context.open ? "open" : "closed",
2279
+ onclick: handleClick,
2280
+ class: $$props.class,
2281
+ style: "position: fixed; inset: 0; z-index: 50; background-color: rgba(0,0,0,0.5);",
2282
+ ...rest
2283
+ }));
2284
+ $106.append($$anchor, div);
2285
+ $106.pop();
2286
+ }
2287
+ var root43 = $106.from_html(`<div><!></div>`);
2288
+ function DialogContent($$anchor, $$props) {
2289
+ $106.push($$props, true);
2290
+ let rest = $106.rest_props($$props, [
2291
+ "$$slots",
2292
+ "$$events",
2293
+ "$$legacy",
2294
+ "children",
2295
+ "class",
2296
+ "onEscapeKeyDown"
2297
+ ]);
2298
+ const context = getContext("dialog");
2299
+ function handleKeyDown(e) {
2300
+ if (e.key === "Escape") {
2301
+ $$props.onEscapeKeyDown?.(e);
2302
+ if (!e.defaultPrevented) {
2303
+ context.setOpen(false);
2304
+ }
2305
+ }
2306
+ }
2307
+ onMount(() => {
2308
+ window.addEventListener("keydown", handleKeyDown);
2309
+ return () => window.removeEventListener("keydown", handleKeyDown);
2310
+ });
2311
+ var div = root43();
2312
+ $106.attribute_effect(div, () => ({
2313
+ role: "dialog",
2314
+ "aria-modal": context.modal,
2315
+ "aria-labelledby": context.baseId + "-title",
2316
+ "aria-describedby": context.baseId + "-desc",
2317
+ "data-state": context.open ? "open" : "closed",
2318
+ class: $$props.class,
2319
+ style: "position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 51; background-color: white; padding: 20px; border-radius: 4px;",
2320
+ ...rest
2321
+ }));
2322
+ var node = $106.child(div);
2323
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2324
+ $106.reset(div);
2325
+ $106.action(div, ($$node, $$action_arg) => focusTrap?.($$node, $$action_arg), () => ({ active: context.open && context.modal }));
2326
+ $106.append($$anchor, div);
2327
+ $106.pop();
2328
+ }
2329
+ var root44 = $106.from_html(`<button><!></button>`);
2330
+ function DialogClose($$anchor, $$props) {
2331
+ $106.push($$props, true);
2332
+ let rest = $106.rest_props($$props, [
2333
+ "$$slots",
2334
+ "$$events",
2335
+ "$$legacy",
2336
+ "children",
2337
+ "class",
2338
+ "onClick"
2339
+ ]);
2340
+ const context = getContext("dialog");
2341
+ function handleClick(e) {
2342
+ context.setOpen(false);
2343
+ $$props.onClick?.(e);
2344
+ }
2345
+ var button = root44();
2346
+ $106.attribute_effect(button, () => ({
2347
+ type: "button",
2348
+ onclick: handleClick,
2349
+ class: $$props.class,
2350
+ ...rest
2351
+ }));
2352
+ var node = $106.child(button);
2353
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2354
+ $106.reset(button);
2355
+ $106.append($$anchor, button);
2356
+ $106.pop();
2357
+ }
2358
+ function AlertDialog($$anchor, $$props) {
2359
+ $106.push($$props, true);
2360
+ const machine = createAlertDialog({
2361
+ open: $$props.open,
2362
+ defaultOpen: $$props.defaultOpen,
2363
+ onOpenChange: $$props.onOpenChange
2364
+ });
2365
+ let state33 = $106.state($106.proxy(machine.state));
2366
+ $106.user_effect(() => {
2367
+ return machine.subscribe((newState) => {
2368
+ $106.set(state33, newState, true);
2369
+ });
2370
+ });
2371
+ function setOpen(val) {
2372
+ if ($$props.open !== void 0) {
2373
+ $$props.onOpenChange?.(val);
2374
+ } else {
2375
+ machine.setOpen(val);
2376
+ }
2377
+ }
2378
+ let isOpen = $106.derived(() => $$props.open !== void 0 ? $$props.open : $106.get(state33).open);
2379
+ const baseId = `alert-dialog-${Math.random().toString(36).substr(2, 9)}`;
2380
+ setContext("alert-dialog", {
2381
+ get open() {
2382
+ return $106.get(isOpen);
2383
+ },
2384
+ setOpen,
2385
+ baseId
2386
+ });
2387
+ var fragment = $106.comment();
2388
+ var node = $106.first_child(fragment);
2389
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2390
+ $106.append($$anchor, fragment);
2391
+ $106.pop();
2392
+ }
2393
+ var root45 = $106.from_html(`<button><!></button>`);
2394
+ function AlertDialogTrigger($$anchor, $$props) {
2395
+ $106.push($$props, true);
2396
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
2397
+ const ctx = getContext("alert-dialog");
2398
+ function handleClick(e) {
2399
+ if ($$props.onclick) $$props.onclick(e);
2400
+ if (!e.defaultPrevented) {
2401
+ ctx.setOpen(true);
2402
+ }
2403
+ }
2404
+ var button = root45();
2405
+ $106.attribute_effect(button, () => ({
2406
+ type: "button",
2407
+ "aria-haspopup": "dialog",
2408
+ "aria-expanded": ctx.open,
2409
+ "aria-controls": ctx.open ? `${ctx.baseId}-content` : void 0,
2410
+ "data-state": ctx.open ? "open" : "closed",
2411
+ ...rest,
2412
+ onclick: handleClick
2413
+ }));
2414
+ var node = $106.child(button);
2415
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2416
+ $106.reset(button);
2417
+ $106.append($$anchor, button);
2418
+ $106.pop();
2419
+ }
2420
+ var root_114 = $106.from_html(`<div><!></div>`);
2421
+ function AlertDialogPortal($$anchor, $$props) {
2422
+ $106.push($$props, true);
2423
+ const ctx = getContext("alert-dialog");
2424
+ var fragment = $106.comment();
2425
+ var node = $106.first_child(fragment);
2426
+ {
2427
+ var consequent = ($$anchor2) => {
2428
+ var div = root_114();
2429
+ var node_1 = $106.child(div);
2430
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
2431
+ $106.reset(div);
2432
+ $106.action(div, ($$node, $$action_arg) => portal?.($$node, $$action_arg), () => $$props.container);
2433
+ $106.append($$anchor2, div);
2434
+ };
2435
+ $106.if(node, ($$render) => {
2436
+ if (ctx.open) $$render(consequent);
2437
+ });
2438
+ }
2439
+ $106.append($$anchor, fragment);
2440
+ $106.pop();
2441
+ }
2442
+ var root46 = $106.from_html(`<div><!></div>`);
2443
+ function AlertDialogOverlay($$anchor, $$props) {
2444
+ $106.push($$props, true);
2445
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
2446
+ const ctx = getContext("alert-dialog");
2447
+ var div = root46();
2448
+ $106.attribute_effect(div, () => ({
2449
+ "data-state": ctx.open ? "open" : "closed",
2450
+ "aria-hidden": "true",
2451
+ style: "position: fixed; inset: 0; z-index: 50; background-color: rgba(0,0,0,0.5);",
2452
+ ...rest
2453
+ }));
2454
+ var node = $106.child(div);
2455
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2456
+ $106.reset(div);
2457
+ $106.append($$anchor, div);
2458
+ $106.pop();
2459
+ }
2460
+ var root47 = $106.from_html(`<div><!></div>`);
2461
+ function AlertDialogContent($$anchor, $$props) {
2462
+ $106.push($$props, true);
2463
+ let rest = $106.rest_props($$props, [
2464
+ "$$slots",
2465
+ "$$events",
2466
+ "$$legacy",
2467
+ "children",
2468
+ "onOpenAutoFocus",
2469
+ "onCloseAutoFocus",
2470
+ "onEscapeKeyDown"
2471
+ ]);
2472
+ const ctx = getContext("alert-dialog");
2473
+ function handleKeyDown(e) {
2474
+ if (e.key === "Escape") {
2475
+ $$props.onEscapeKeyDown?.(e);
2476
+ if (!e.defaultPrevented) {
2477
+ ctx.setOpen(false);
2478
+ }
2479
+ }
2480
+ }
2481
+ var div = root47();
2482
+ $106.attribute_effect(div, () => ({
2483
+ role: "alertdialog",
2484
+ id: `${ctx.baseId}-content`,
2485
+ "aria-labelledby": `${ctx.baseId}-title`,
2486
+ "aria-describedby": `${ctx.baseId}-description`,
2487
+ "aria-modal": "true",
2488
+ "data-state": ctx.open ? "open" : "closed",
2489
+ style: "position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 51;",
2490
+ ...rest,
2491
+ onkeydown: handleKeyDown,
2492
+ tabindex: "-1"
2493
+ }));
2494
+ var node = $106.child(div);
2495
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2496
+ $106.reset(div);
2497
+ $106.action(div, ($$node, $$action_arg) => focusTrap?.($$node, $$action_arg), () => ({ active: ctx.open, returnFocus: true }));
2498
+ $106.append($$anchor, div);
2499
+ $106.pop();
2500
+ }
2501
+ var root48 = $106.from_html(`<h2><!></h2>`);
2502
+ function AlertDialogTitle($$anchor, $$props) {
2503
+ $106.push($$props, true);
2504
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
2505
+ const ctx = getContext("alert-dialog");
2506
+ var h2 = root48();
2507
+ $106.attribute_effect(h2, () => ({ id: `${ctx.baseId}-title`, ...rest }));
2508
+ var node = $106.child(h2);
2509
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2510
+ $106.reset(h2);
2511
+ $106.append($$anchor, h2);
2512
+ $106.pop();
2513
+ }
2514
+ var root49 = $106.from_html(`<p><!></p>`);
2515
+ function AlertDialogDescription($$anchor, $$props) {
2516
+ $106.push($$props, true);
2517
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
2518
+ const ctx = getContext("alert-dialog");
2519
+ var p = root49();
2520
+ $106.attribute_effect(p, () => ({ id: `${ctx.baseId}-description`, ...rest }));
2521
+ var node = $106.child(p);
2522
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2523
+ $106.reset(p);
2524
+ $106.append($$anchor, p);
2525
+ $106.pop();
2526
+ }
2527
+ var root50 = $106.from_html(`<button><!></button>`);
2528
+ function AlertDialogAction($$anchor, $$props) {
2529
+ $106.push($$props, true);
2530
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
2531
+ const ctx = getContext("alert-dialog");
2532
+ function handleClick(e) {
2533
+ if ($$props.onclick) $$props.onclick(e);
2534
+ if (!e.defaultPrevented) {
2535
+ ctx.setOpen(false);
2536
+ }
2537
+ }
2538
+ var button = root50();
2539
+ $106.attribute_effect(button, () => ({ type: "button", ...rest, onclick: handleClick }));
2540
+ var node = $106.child(button);
2541
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2542
+ $106.reset(button);
2543
+ $106.append($$anchor, button);
2544
+ $106.pop();
2545
+ }
2546
+ var root51 = $106.from_html(`<button><!></button>`);
2547
+ function AlertDialogCancel($$anchor, $$props) {
2548
+ $106.push($$props, true);
2549
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
2550
+ const ctx = getContext("alert-dialog");
2551
+ function handleClick(e) {
2552
+ if ($$props.onclick) $$props.onclick(e);
2553
+ if (!e.defaultPrevented) {
2554
+ ctx.setOpen(false);
2555
+ }
2556
+ }
2557
+ var button = root51();
2558
+ $106.attribute_effect(button, () => ({ type: "button", ...rest, onclick: handleClick }));
2559
+ var node = $106.child(button);
2560
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2561
+ $106.reset(button);
2562
+ $106.append($$anchor, button);
2563
+ $106.pop();
2564
+ }
2565
+ function Popover($$anchor, $$props) {
2566
+ $106.push($$props, true);
2567
+ let defaultOpen = $106.prop($$props, "defaultOpen", 3, false), modal = $106.prop($$props, "modal", 3, false);
2568
+ const machine = createPopover({
2569
+ open: $$props.open,
2570
+ defaultOpen: defaultOpen(),
2571
+ onOpenChange: $$props.onOpenChange
2572
+ });
2573
+ let state33 = $106.state($106.proxy(machine.state));
2574
+ $106.user_effect(() => {
2575
+ return machine.subscribe((newState) => {
2576
+ $106.set(state33, newState, true);
2577
+ });
2578
+ });
2579
+ function setOpen(val) {
2580
+ if ($$props.open !== void 0) {
2581
+ $$props.onOpenChange?.(val);
2582
+ } else {
2583
+ machine.actions.setOpen(val);
2584
+ }
2585
+ }
2586
+ let isOpen = $106.derived(() => $$props.open !== void 0 ? $$props.open : $106.get(state33).open);
2587
+ let triggerElement = $106.state(void 0);
2588
+ setContext("popover", {
2589
+ get open() {
2590
+ return $106.get(isOpen);
2591
+ },
2592
+ get modal() {
2593
+ return modal();
2594
+ },
2595
+ get triggerElement() {
2596
+ return $106.get(triggerElement);
2597
+ },
2598
+ setOpen,
2599
+ setTriggerElement: (el) => {
2600
+ $106.set(triggerElement, el, true);
2601
+ }
2602
+ });
2603
+ var fragment = $106.comment();
2604
+ var node = $106.first_child(fragment);
2605
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2606
+ $106.append($$anchor, fragment);
2607
+ $106.pop();
2608
+ }
2609
+ var root52 = $106.from_html(`<button><!></button>`);
2610
+ function PopoverTrigger($$anchor, $$props) {
2611
+ $106.push($$props, true);
2612
+ let rest = $106.rest_props($$props, [
2613
+ "$$slots",
2614
+ "$$events",
2615
+ "$$legacy",
2616
+ "children",
2617
+ "class",
2618
+ "onClick"
2619
+ ]);
2620
+ const context = getContext("popover");
2621
+ let ref = $106.state(void 0);
2622
+ onMount(() => {
2623
+ if ($106.get(ref)) context.setTriggerElement($106.get(ref));
2624
+ });
2625
+ function handleClick(e) {
2626
+ context.setOpen(!context.open);
2627
+ $$props.onClick?.(e);
2628
+ }
2629
+ var button = root52();
2630
+ $106.attribute_effect(button, () => ({
2631
+ type: "button",
2632
+ "aria-haspopup": "dialog",
2633
+ "aria-expanded": context.open,
2634
+ "data-state": context.open ? "open" : "closed",
2635
+ onclick: handleClick,
2636
+ class: $$props.class,
2637
+ ...rest
2638
+ }));
2639
+ var node = $106.child(button);
2640
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2641
+ $106.reset(button);
2642
+ $106.bind_this(button, ($$value) => $106.set(ref, $$value), () => $106.get(ref));
2643
+ $106.append($$anchor, button);
2644
+ $106.pop();
2645
+ }
2646
+ var root_115 = $106.from_html(`<div><!></div>`);
2647
+ function PopoverContent($$anchor, $$props) {
2648
+ $106.push($$props, true);
2649
+ let side = $106.prop($$props, "side", 3, "bottom"), align = $106.prop($$props, "align", 3, "center"), sideOffset = $106.prop($$props, "sideOffset", 3, 5), alignOffset = $106.prop($$props, "alignOffset", 3, 0), rest = $106.rest_props($$props, [
2650
+ "$$slots",
2651
+ "$$events",
2652
+ "$$legacy",
2653
+ "side",
2654
+ "align",
2655
+ "sideOffset",
2656
+ "alignOffset",
2657
+ "children",
2658
+ "class"
2659
+ ]);
2660
+ const context = getContext("popover");
2661
+ var fragment = $106.comment();
2662
+ var node = $106.first_child(fragment);
2663
+ {
2664
+ var consequent = ($$anchor2) => {
2665
+ var div = root_115();
2666
+ $106.attribute_effect(div, () => ({
2667
+ "data-state": "open",
2668
+ class: $$props.class,
2669
+ style: "z-index: 50; background-color: white; border: 1px solid #ccc; border-radius: 4px; padding: 10px;",
2670
+ ...rest
2671
+ }));
2672
+ var node_1 = $106.child(div);
2673
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
2674
+ $106.reset(div);
2675
+ $106.action(div, ($$node, $$action_arg) => portal?.($$node, $$action_arg), () => "body");
2676
+ $106.action(div, ($$node, $$action_arg) => position?.($$node, $$action_arg), () => ({
2677
+ trigger: context.triggerElement,
2678
+ side: side(),
2679
+ align: align(),
2680
+ sideOffset: sideOffset(),
2681
+ alignOffset: alignOffset()
2682
+ }));
2683
+ $106.append($$anchor2, div);
2684
+ };
2685
+ $106.if(node, ($$render) => {
2686
+ if (context.open) $$render(consequent);
2687
+ });
2688
+ }
2689
+ $106.append($$anchor, fragment);
2690
+ $106.pop();
2691
+ }
2692
+ function HoverCard($$anchor, $$props) {
2693
+ $106.push($$props, true);
2694
+ let openDelay = $106.prop($$props, "openDelay", 3, 700), closeDelay = $106.prop($$props, "closeDelay", 3, 300);
2695
+ const machine = createHoverCard({
2696
+ defaultOpen: $$props.defaultOpen,
2697
+ onOpenChange: $$props.onOpenChange
2698
+ });
2699
+ let state33 = $106.state($106.proxy(machine.state));
2700
+ let triggerElement = $106.state(null);
2701
+ $106.user_effect(() => {
2702
+ return machine.subscribe((newState) => {
2703
+ $106.set(state33, newState, true);
2704
+ });
2705
+ });
2706
+ let isOpen = $106.derived(() => $$props.open !== void 0 ? $$props.open : $106.get(state33).open);
2707
+ let openTimer;
2708
+ let closeTimer;
2709
+ function setOpen(val) {
2710
+ if ($$props.open !== void 0) {
2711
+ $$props.onOpenChange?.(val);
2712
+ } else {
2713
+ machine.actions.setOpen(val);
2714
+ }
2715
+ }
2716
+ function openWithDelay() {
2717
+ clearTimeout(closeTimer);
2718
+ clearTimeout(openTimer);
2719
+ if (openDelay() <= 0) {
2720
+ setOpen(true);
2721
+ } else {
2722
+ openTimer = setTimeout(
2723
+ () => {
2724
+ setOpen(true);
2725
+ },
2726
+ openDelay()
2727
+ );
2728
+ }
2729
+ }
2730
+ function closeWithDelay() {
2731
+ clearTimeout(openTimer);
2732
+ clearTimeout(closeTimer);
2733
+ if (closeDelay() <= 0) {
2734
+ setOpen(false);
2735
+ } else {
2736
+ closeTimer = setTimeout(
2737
+ () => {
2738
+ setOpen(false);
2739
+ },
2740
+ closeDelay()
2741
+ );
2742
+ }
2743
+ }
2744
+ function cancelClose() {
2745
+ clearTimeout(closeTimer);
2746
+ }
2747
+ function registerTrigger(el) {
2748
+ $106.set(triggerElement, el, true);
2749
+ }
2750
+ setContext("hover-card", {
2751
+ get open() {
2752
+ return $106.get(isOpen);
2753
+ },
2754
+ get trigger() {
2755
+ return $106.get(triggerElement);
2756
+ },
2757
+ openWithDelay,
2758
+ closeWithDelay,
2759
+ cancelClose,
2760
+ registerTrigger
2761
+ });
2762
+ $106.user_effect(() => {
2763
+ return () => {
2764
+ clearTimeout(openTimer);
2765
+ clearTimeout(closeTimer);
2766
+ };
2767
+ });
2768
+ var fragment = $106.comment();
2769
+ var node = $106.first_child(fragment);
2770
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2771
+ $106.append($$anchor, fragment);
2772
+ $106.pop();
2773
+ }
2774
+ var root53 = $106.from_html(`<a><!></a>`);
2775
+ function HoverCardTrigger($$anchor, $$props) {
2776
+ $106.push($$props, true);
2777
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "asChild"]);
2778
+ const ctx = getContext("hover-card");
2779
+ let el;
2780
+ onMount(() => {
2781
+ if (el) ctx.registerTrigger(el);
2782
+ });
2783
+ function handleMouseEnter(e) {
2784
+ $$props.onmouseenter?.(e);
2785
+ ctx.openWithDelay();
2786
+ }
2787
+ function handleMouseLeave(e) {
2788
+ $$props.onmouseleave?.(e);
2789
+ ctx.closeWithDelay();
2790
+ }
2791
+ function handleFocus(e) {
2792
+ $$props.onfocus?.(e);
2793
+ ctx.openWithDelay();
2794
+ }
2795
+ function handleBlur(e) {
2796
+ $$props.onblur?.(e);
2797
+ ctx.closeWithDelay();
2798
+ }
2799
+ var a = root53();
2800
+ $106.attribute_effect(a, () => ({
2801
+ href: $$props.href || "#",
2802
+ "data-state": ctx.open ? "open" : "closed",
2803
+ ...rest,
2804
+ onmouseenter: handleMouseEnter,
2805
+ onmouseleave: handleMouseLeave,
2806
+ onfocus: handleFocus,
2807
+ onblur: handleBlur
2808
+ }));
2809
+ var node = $106.child(a);
2810
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2811
+ $106.reset(a);
2812
+ $106.bind_this(a, ($$value) => el = $$value, () => el);
2813
+ $106.append($$anchor, a);
2814
+ $106.pop();
2815
+ }
2816
+ var root_116 = $106.from_html(`<div><div><!></div></div>`);
2817
+ function HoverCardContent($$anchor, $$props) {
2818
+ $106.push($$props, true);
2819
+ let side = $106.prop($$props, "side", 3, "bottom"), align = $106.prop($$props, "align", 3, "center"), sideOffset = $106.prop($$props, "sideOffset", 3, 5), alignOffset = $106.prop($$props, "alignOffset", 3, 0), collisionDetection = $106.prop($$props, "collisionDetection", 3, true), rest = $106.rest_props($$props, [
2820
+ "$$slots",
2821
+ "$$events",
2822
+ "$$legacy",
2823
+ "children",
2824
+ "side",
2825
+ "align",
2826
+ "sideOffset",
2827
+ "alignOffset",
2828
+ "collisionDetection"
2829
+ ]);
2830
+ const ctx = getContext("hover-card");
2831
+ function handleMouseEnter(e) {
2832
+ $$props.onmouseenter?.(e);
2833
+ ctx.cancelClose();
2834
+ }
2835
+ function handleMouseLeave(e) {
2836
+ $$props.onmouseleave?.(e);
2837
+ ctx.closeWithDelay();
2838
+ }
2839
+ var fragment = $106.comment();
2840
+ var node = $106.first_child(fragment);
2841
+ {
2842
+ var consequent = ($$anchor2) => {
2843
+ var div = root_116();
2844
+ var div_1 = $106.child(div);
2845
+ $106.attribute_effect(div_1, () => ({
2846
+ "data-state": ctx.open ? "open" : "closed",
2847
+ "data-side": side(),
2848
+ "data-align": align(),
2849
+ style: "z-index: 50; background-color: white; border: 1px solid #eee; border-radius: 4px; padding: 10px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);",
2850
+ ...rest,
2851
+ onmouseenter: handleMouseEnter,
2852
+ onmouseleave: handleMouseLeave
2853
+ }));
2854
+ var node_1 = $106.child(div_1);
2855
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
2856
+ $106.reset(div_1);
2857
+ $106.action(div_1, ($$node, $$action_arg) => position?.($$node, $$action_arg), () => ({
2858
+ trigger: ctx.trigger,
2859
+ side: side(),
2860
+ align: align(),
2861
+ sideOffset: sideOffset(),
2862
+ alignOffset: alignOffset(),
2863
+ collisionDetection: collisionDetection()
2864
+ }));
2865
+ $106.reset(div);
2866
+ $106.action(div, ($$node) => portal?.($$node));
2867
+ $106.append($$anchor2, div);
2868
+ };
2869
+ $106.if(node, ($$render) => {
2870
+ if (ctx.open && ctx.trigger) $$render(consequent);
2871
+ });
2872
+ }
2873
+ $106.append($$anchor, fragment);
2874
+ $106.pop();
2875
+ }
2876
+ function Tooltip($$anchor, $$props) {
2877
+ $106.push($$props, true);
2878
+ let defaultOpen = $106.prop($$props, "defaultOpen", 3, false), delayDuration = $106.prop($$props, "delayDuration", 3, 700);
2879
+ const machine = createTooltip({
2880
+ open: $$props.open,
2881
+ defaultOpen: defaultOpen(),
2882
+ onOpenChange: $$props.onOpenChange
2883
+ });
2884
+ let state33 = $106.state($106.proxy(machine.state));
2885
+ let triggerElement = $106.state(void 0);
2886
+ let timeout;
2887
+ $106.user_effect(() => {
2888
+ return machine.subscribe((newState) => {
2889
+ $106.set(state33, newState, true);
2890
+ });
2891
+ });
2892
+ function handleOpen() {
2893
+ if (timeout) clearTimeout(timeout);
2894
+ if (delayDuration() <= 0) {
2895
+ setOpen(true);
2896
+ } else {
2897
+ timeout = setTimeout(
2898
+ () => {
2899
+ setOpen(true);
2900
+ },
2901
+ delayDuration()
2902
+ );
2903
+ }
2904
+ }
2905
+ function handleClose() {
2906
+ if (timeout) clearTimeout(timeout);
2907
+ setOpen(false);
2908
+ }
2909
+ function setOpen(val) {
2910
+ if ($$props.open !== void 0) {
2911
+ $$props.onOpenChange?.(val);
2912
+ } else {
2913
+ machine.actions.setOpen(val);
2914
+ }
2915
+ }
2916
+ let isOpen = $106.derived(() => $$props.open !== void 0 ? $$props.open : $106.get(state33).open);
2917
+ setContext("tooltip", {
2918
+ get open() {
2919
+ return $106.get(isOpen);
2920
+ },
2921
+ get triggerElement() {
2922
+ return $106.get(triggerElement);
2923
+ },
2924
+ setTriggerElement: (el) => {
2925
+ $106.set(triggerElement, el, true);
2926
+ },
2927
+ handleOpen,
2928
+ handleClose
2929
+ });
2930
+ var fragment = $106.comment();
2931
+ var node = $106.first_child(fragment);
2932
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2933
+ $106.append($$anchor, fragment);
2934
+ $106.pop();
2935
+ }
2936
+ var root54 = $106.from_html(`<button><!></button>`);
2937
+ function TooltipTrigger($$anchor, $$props) {
2938
+ $106.push($$props, true);
2939
+ let rest = $106.rest_props($$props, [
2940
+ "$$slots",
2941
+ "$$events",
2942
+ "$$legacy",
2943
+ "children",
2944
+ "class",
2945
+ "onMouseEnter",
2946
+ "onMouseLeave",
2947
+ "onFocus",
2948
+ "onBlur"
2949
+ ]);
2950
+ const context = getContext("tooltip");
2951
+ let ref = $106.state(void 0);
2952
+ onMount(() => {
2953
+ if ($106.get(ref)) context.setTriggerElement($106.get(ref));
2954
+ });
2955
+ function handleMouseEnter(e) {
2956
+ context.handleOpen();
2957
+ $$props.onMouseEnter?.(e);
2958
+ }
2959
+ function handleMouseLeave(e) {
2960
+ context.handleClose();
2961
+ $$props.onMouseLeave?.(e);
2962
+ }
2963
+ function handleFocus(e) {
2964
+ context.handleOpen();
2965
+ $$props.onFocus?.(e);
2966
+ }
2967
+ function handleBlur(e) {
2968
+ context.handleClose();
2969
+ $$props.onBlur?.(e);
2970
+ }
2971
+ var button = root54();
2972
+ $106.attribute_effect(button, () => ({
2973
+ type: "button",
2974
+ "data-state": context.open ? "delayed-open" : "closed",
2975
+ onmouseenter: handleMouseEnter,
2976
+ onmouseleave: handleMouseLeave,
2977
+ onfocus: handleFocus,
2978
+ onblur: handleBlur,
2979
+ class: $$props.class,
2980
+ ...rest
2981
+ }));
2982
+ var node = $106.child(button);
2983
+ $106.snippet(node, () => $$props.children ?? $106.noop);
2984
+ $106.reset(button);
2985
+ $106.bind_this(button, ($$value) => $106.set(ref, $$value), () => $106.get(ref));
2986
+ $106.append($$anchor, button);
2987
+ $106.pop();
2988
+ }
2989
+ var root_117 = $106.from_html(`<div><!></div>`);
2990
+ function TooltipContent($$anchor, $$props) {
2991
+ $106.push($$props, true);
2992
+ let side = $106.prop($$props, "side", 3, "top"), align = $106.prop($$props, "align", 3, "center"), sideOffset = $106.prop($$props, "sideOffset", 3, 5), alignOffset = $106.prop($$props, "alignOffset", 3, 0), rest = $106.rest_props($$props, [
2993
+ "$$slots",
2994
+ "$$events",
2995
+ "$$legacy",
2996
+ "side",
2997
+ "align",
2998
+ "sideOffset",
2999
+ "alignOffset",
3000
+ "children",
3001
+ "class"
3002
+ ]);
3003
+ const context = getContext("tooltip");
3004
+ var fragment = $106.comment();
3005
+ var node = $106.first_child(fragment);
3006
+ {
3007
+ var consequent = ($$anchor2) => {
3008
+ var div = root_117();
3009
+ $106.attribute_effect(div, () => ({
3010
+ role: "tooltip",
3011
+ "data-state": "delayed-open",
3012
+ class: $$props.class,
3013
+ style: "z-index: 60; pointer-events: none; background-color: black; color: white; border-radius: 4px; padding: 5px 10px; font-size: 12px;",
3014
+ ...rest
3015
+ }));
3016
+ var node_1 = $106.child(div);
3017
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
3018
+ $106.reset(div);
3019
+ $106.action(div, ($$node, $$action_arg) => portal?.($$node, $$action_arg), () => "body");
3020
+ $106.action(div, ($$node, $$action_arg) => position?.($$node, $$action_arg), () => ({
3021
+ trigger: context.triggerElement,
3022
+ side: side(),
3023
+ align: align(),
3024
+ sideOffset: sideOffset(),
3025
+ alignOffset: alignOffset()
3026
+ }));
3027
+ $106.append($$anchor2, div);
3028
+ };
3029
+ $106.if(node, ($$render) => {
3030
+ if (context.open) $$render(consequent);
3031
+ });
3032
+ }
3033
+ $106.append($$anchor, fragment);
3034
+ $106.pop();
3035
+ }
3036
+ function DropdownMenu($$anchor, $$props) {
3037
+ $106.push($$props, true);
3038
+ let defaultOpen = $106.prop($$props, "defaultOpen", 3, false);
3039
+ const machine = createDropdownMenu({
3040
+ open: $$props.open,
3041
+ defaultOpen: defaultOpen(),
3042
+ onOpenChange: $$props.onOpenChange
3043
+ });
3044
+ let state33 = $106.state($106.proxy(machine.state));
3045
+ let triggerElement = $106.state(void 0);
3046
+ $106.user_effect(() => {
3047
+ return machine.subscribe((newState) => {
3048
+ $106.set(state33, newState, true);
3049
+ });
3050
+ });
3051
+ function setOpen(val) {
3052
+ if ($$props.open !== void 0) {
3053
+ $$props.onOpenChange?.(val);
3054
+ } else {
3055
+ machine.actions.setOpen(val);
3056
+ }
3057
+ }
3058
+ let isOpen = $106.derived(() => $$props.open !== void 0 ? $$props.open : $106.get(state33).open);
3059
+ setContext("dropdown-menu", {
3060
+ get open() {
3061
+ return $106.get(isOpen);
3062
+ },
3063
+ get triggerElement() {
3064
+ return $106.get(triggerElement);
3065
+ },
3066
+ setOpen,
3067
+ setTriggerElement: (el) => {
3068
+ $106.set(triggerElement, el, true);
3069
+ }
3070
+ });
3071
+ var fragment = $106.comment();
3072
+ var node = $106.first_child(fragment);
3073
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3074
+ $106.append($$anchor, fragment);
3075
+ $106.pop();
3076
+ }
3077
+ var root55 = $106.from_html(`<button><!></button>`);
3078
+ function DropdownMenuTrigger($$anchor, $$props) {
3079
+ $106.push($$props, true);
3080
+ let rest = $106.rest_props($$props, [
3081
+ "$$slots",
3082
+ "$$events",
3083
+ "$$legacy",
3084
+ "children",
3085
+ "class",
3086
+ "onClick",
3087
+ "onKeyDown"
3088
+ ]);
3089
+ const context = getContext("dropdown-menu");
3090
+ let ref = $106.state(void 0);
3091
+ onMount(() => {
3092
+ if ($106.get(ref)) context.setTriggerElement($106.get(ref));
3093
+ });
3094
+ function handleClick(e) {
3095
+ context.setOpen(!context.open);
3096
+ $$props.onClick?.(e);
3097
+ }
3098
+ function handleKeyDown(e) {
3099
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
3100
+ e.preventDefault();
3101
+ if (!context.open) context.setOpen(true);
3102
+ }
3103
+ $$props.onKeyDown?.(e);
3104
+ }
3105
+ var button = root55();
3106
+ $106.attribute_effect(button, () => ({
3107
+ type: "button",
3108
+ "aria-haspopup": "menu",
3109
+ "aria-expanded": context.open,
3110
+ "data-state": context.open ? "open" : "closed",
3111
+ onclick: handleClick,
3112
+ onkeydown: handleKeyDown,
3113
+ class: $$props.class,
3114
+ ...rest
3115
+ }));
3116
+ var node = $106.child(button);
3117
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3118
+ $106.reset(button);
3119
+ $106.bind_this(button, ($$value) => $106.set(ref, $$value), () => $106.get(ref));
3120
+ $106.append($$anchor, button);
3121
+ $106.pop();
3122
+ }
3123
+ var root_118 = $106.from_html(`<div><!></div>`);
3124
+ function DropdownMenuContent($$anchor, $$props) {
3125
+ $106.push($$props, true);
3126
+ let side = $106.prop($$props, "side", 3, "bottom"), align = $106.prop($$props, "align", 3, "center"), sideOffset = $106.prop($$props, "sideOffset", 3, 5), alignOffset = $106.prop($$props, "alignOffset", 3, 0), rest = $106.rest_props($$props, [
3127
+ "$$slots",
3128
+ "$$events",
3129
+ "$$legacy",
3130
+ "side",
3131
+ "align",
3132
+ "sideOffset",
3133
+ "alignOffset",
3134
+ "children",
3135
+ "class"
3136
+ ]);
3137
+ const context = getContext("dropdown-menu");
3138
+ function handleKeyDown(e) {
3139
+ if (e.key === "Escape") {
3140
+ context.setOpen(false);
3141
+ }
3142
+ }
3143
+ onMount(() => {
3144
+ });
3145
+ var fragment = $106.comment();
3146
+ var node = $106.first_child(fragment);
3147
+ {
3148
+ var consequent = ($$anchor2) => {
3149
+ var div = root_118();
3150
+ $106.attribute_effect(div, () => ({
3151
+ role: "menu",
3152
+ "data-state": "open",
3153
+ onkeydown: handleKeyDown,
3154
+ class: $$props.class,
3155
+ style: "z-index: 50; background-color: white; border: 1px solid #ccc; border-radius: 4px; padding: 5px 0; min-width: 150px;",
3156
+ ...rest
3157
+ }));
3158
+ var node_1 = $106.child(div);
3159
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
3160
+ $106.reset(div);
3161
+ $106.action(div, ($$node, $$action_arg) => portal?.($$node, $$action_arg), () => "body");
3162
+ $106.action(div, ($$node, $$action_arg) => position?.($$node, $$action_arg), () => ({
3163
+ trigger: context.triggerElement,
3164
+ side: side(),
3165
+ align: align(),
3166
+ sideOffset: sideOffset(),
3167
+ alignOffset: alignOffset()
3168
+ }));
3169
+ $106.append($$anchor2, div);
3170
+ };
3171
+ $106.if(node, ($$render) => {
3172
+ if (context.open) $$render(consequent);
3173
+ });
3174
+ }
3175
+ $106.append($$anchor, fragment);
3176
+ $106.pop();
3177
+ }
3178
+ var root56 = $106.from_html(`<div><!></div>`);
3179
+ function DropdownMenuItem($$anchor, $$props) {
3180
+ $106.push($$props, true);
3181
+ let disabled = $106.prop($$props, "disabled", 3, false), rest = $106.rest_props($$props, [
3182
+ "$$slots",
3183
+ "$$events",
3184
+ "$$legacy",
3185
+ "disabled",
3186
+ "onSelect",
3187
+ "onClick",
3188
+ "children",
3189
+ "class"
3190
+ ]);
3191
+ const context = getContext("dropdown-menu");
3192
+ function handleSelect(e) {
3193
+ if (disabled()) return;
3194
+ $$props.onSelect?.(e);
3195
+ if (!e.defaultPrevented) {
3196
+ context.setOpen(false);
3197
+ }
3198
+ }
3199
+ function handleClick(e) {
3200
+ if (disabled()) return;
3201
+ handleSelect(e);
3202
+ $$props.onClick?.(e);
3203
+ }
3204
+ function handleKeyDown(e) {
3205
+ if (disabled()) return;
3206
+ if (e.key === "Enter" || e.key === " ") {
3207
+ e.preventDefault();
3208
+ handleSelect(e);
3209
+ }
3210
+ }
3211
+ var div = root56();
3212
+ $106.attribute_effect(div, () => ({
3213
+ role: "menuitem",
3214
+ "aria-disabled": disabled(),
3215
+ tabindex: disabled() ? -1 : 0,
3216
+ "data-disabled": disabled() ? "" : void 0,
3217
+ onclick: handleClick,
3218
+ onkeydown: handleKeyDown,
3219
+ class: $$props.class,
3220
+ style: `padding: 5px 10px; cursor: ${disabled() ? "not-allowed" : "pointer"}; opacity: ${disabled() ? 0.5 : 1}; outline: none;`,
3221
+ ...rest
3222
+ }));
3223
+ var node = $106.child(div);
3224
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3225
+ $106.reset(div);
3226
+ $106.append($$anchor, div);
3227
+ $106.pop();
3228
+ }
3229
+ var root57 = $106.from_html(`<div><!></div>`);
3230
+ function DropdownMenuLabel($$anchor, $$props) {
3231
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "class"]);
3232
+ var div = root57();
3233
+ $106.attribute_effect(div, () => ({
3234
+ class: $$props.class,
3235
+ style: "padding: 5px 10px; font-size: 12px; color: #666; font-weight: bold;",
3236
+ ...rest
3237
+ }));
3238
+ var node = $106.child(div);
3239
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3240
+ $106.reset(div);
3241
+ $106.append($$anchor, div);
3242
+ }
3243
+ var root58 = $106.from_html(`<div></div>`);
3244
+ function DropdownMenuSeparator($$anchor, $$props) {
3245
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "class"]);
3246
+ var div = root58();
3247
+ $106.attribute_effect(div, () => ({
3248
+ role: "separator",
3249
+ class: $$props.class,
3250
+ style: "height: 1px; background-color: #eee; margin: 5px 0;",
3251
+ ...rest
3252
+ }));
3253
+ $106.append($$anchor, div);
3254
+ }
3255
+ function ContextMenu($$anchor, $$props) {
3256
+ $106.push($$props, true);
3257
+ const machine = createContextMenu({ onOpenChange: $$props.onOpenChange });
3258
+ let state33 = $106.state($106.proxy(machine.state));
3259
+ let point = $106.state($106.proxy({ x: 0, y: 0 }));
3260
+ $106.user_effect(() => {
3261
+ return machine.subscribe((newState) => {
3262
+ $106.set(state33, newState, true);
3263
+ });
3264
+ });
3265
+ function setOpen(val) {
3266
+ machine.actions.setOpen(val);
3267
+ }
3268
+ setContext("context-menu", {
3269
+ get open() {
3270
+ return $106.get(state33).open;
3271
+ },
3272
+ get point() {
3273
+ return $106.get(point);
3274
+ },
3275
+ setOpen,
3276
+ setPoint: (p) => {
3277
+ $106.set(point, p, true);
3278
+ }
3279
+ });
3280
+ var fragment = $106.comment();
3281
+ var node = $106.first_child(fragment);
3282
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3283
+ $106.append($$anchor, fragment);
3284
+ $106.pop();
3285
+ }
3286
+ var root59 = $106.from_html(`<div><!></div>`);
3287
+ function ContextMenuTrigger($$anchor, $$props) {
3288
+ $106.push($$props, true);
3289
+ let rest = $106.rest_props($$props, [
3290
+ "$$slots",
3291
+ "$$events",
3292
+ "$$legacy",
3293
+ "children",
3294
+ "class",
3295
+ "onContextMenu"
3296
+ ]);
3297
+ const context = getContext("context-menu");
3298
+ function handleContextMenu(e) {
3299
+ $$props.onContextMenu?.(e);
3300
+ if (!e.defaultPrevented) {
3301
+ e.preventDefault();
3302
+ context.setPoint({ x: e.clientX, y: e.clientY });
3303
+ context.setOpen(true);
3304
+ }
3305
+ }
3306
+ var div = root59();
3307
+ $106.attribute_effect(div, () => ({
3308
+ oncontextmenu: handleContextMenu,
3309
+ class: $$props.class,
3310
+ style: "display: contents;",
3311
+ ...rest
3312
+ }));
3313
+ var node = $106.child(div);
3314
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3315
+ $106.reset(div);
3316
+ $106.append($$anchor, div);
3317
+ $106.pop();
3318
+ }
3319
+ var root_119 = $106.from_html(`<div><!></div>`);
3320
+ function ContextMenuContent($$anchor, $$props) {
3321
+ $106.push($$props, true);
3322
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "class"]);
3323
+ const context = getContext("context-menu");
3324
+ function handleKeyDown(e) {
3325
+ if (e.key === "Escape") {
3326
+ context.setOpen(false);
3327
+ }
3328
+ }
3329
+ var fragment = $106.comment();
3330
+ var node = $106.first_child(fragment);
3331
+ {
3332
+ var consequent = ($$anchor2) => {
3333
+ var div = root_119();
3334
+ $106.attribute_effect(div, () => ({
3335
+ role: "menu",
3336
+ "data-state": "open",
3337
+ onkeydown: handleKeyDown,
3338
+ class: $$props.class,
3339
+ style: `z-index: 50; position: fixed; left: ${context.point.x ?? ""}px; top: ${context.point.y ?? ""}px; background-color: white; border: 1px solid #ccc; border-radius: 4px; padding: 5px 0; min-width: 150px;`,
3340
+ ...rest
3341
+ }));
3342
+ var node_1 = $106.child(div);
3343
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
3344
+ $106.reset(div);
3345
+ $106.action(div, ($$node, $$action_arg) => portal?.($$node, $$action_arg), () => "body");
3346
+ $106.append($$anchor2, div);
3347
+ };
3348
+ $106.if(node, ($$render) => {
3349
+ if (context.open) $$render(consequent);
3350
+ });
3351
+ }
3352
+ $106.append($$anchor, fragment);
3353
+ $106.pop();
3354
+ }
3355
+ var root60 = $106.from_html(`<div><!></div>`);
3356
+ function ContextMenuItem($$anchor, $$props) {
3357
+ $106.push($$props, true);
3358
+ let disabled = $106.prop($$props, "disabled", 3, false), rest = $106.rest_props($$props, [
3359
+ "$$slots",
3360
+ "$$events",
3361
+ "$$legacy",
3362
+ "disabled",
3363
+ "onSelect",
3364
+ "onClick",
3365
+ "children",
3366
+ "class"
3367
+ ]);
3368
+ const context = getContext("context-menu");
3369
+ function handleSelect(e) {
3370
+ if (disabled()) return;
3371
+ $$props.onSelect?.(e);
3372
+ if (!e.defaultPrevented) {
3373
+ context.setOpen(false);
3374
+ }
3375
+ }
3376
+ function handleClick(e) {
3377
+ if (disabled()) return;
3378
+ handleSelect(e);
3379
+ $$props.onClick?.(e);
3380
+ }
3381
+ function handleKeyDown(e) {
3382
+ if (disabled()) return;
3383
+ if (e.key === "Enter" || e.key === " ") {
3384
+ e.preventDefault();
3385
+ handleSelect(e);
3386
+ }
3387
+ }
3388
+ var div = root60();
3389
+ $106.attribute_effect(div, () => ({
3390
+ role: "menuitem",
3391
+ "aria-disabled": disabled(),
3392
+ tabindex: disabled() ? -1 : 0,
3393
+ "data-disabled": disabled() ? "" : void 0,
3394
+ onclick: handleClick,
3395
+ onkeydown: handleKeyDown,
3396
+ class: $$props.class,
3397
+ style: `padding: 5px 10px; cursor: ${disabled() ? "not-allowed" : "pointer"}; opacity: ${disabled() ? 0.5 : 1}; outline: none;`,
3398
+ ...rest
3399
+ }));
3400
+ var node = $106.child(div);
3401
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3402
+ $106.reset(div);
3403
+ $106.append($$anchor, div);
3404
+ $106.pop();
3405
+ }
3406
+ var root61 = $106.from_html(`<div><!></div>`);
3407
+ function Toolbar($$anchor, $$props) {
3408
+ $106.push($$props, true);
3409
+ let orientation = $106.prop($$props, "orientation", 3, "horizontal"), rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "orientation", "children"]);
3410
+ setContext("toolbar", {
3411
+ get orientation() {
3412
+ return orientation();
3413
+ }
3414
+ });
3415
+ var div = root61();
3416
+ $106.attribute_effect(div, () => ({
3417
+ role: "toolbar",
3418
+ "aria-orientation": orientation(),
3419
+ "data-orientation": orientation(),
3420
+ ...rest,
3421
+ [$106.STYLE]: {
3422
+ display: "flex",
3423
+ padding: "5px",
3424
+ gap: "5px",
3425
+ "flex-direction": orientation() === "horizontal" ? "row" : "column"
3426
+ }
3427
+ }));
3428
+ var node = $106.child(div);
3429
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3430
+ $106.reset(div);
3431
+ $106.append($$anchor, div);
3432
+ $106.pop();
3433
+ }
3434
+ var root62 = $106.from_html(`<button><!></button>`);
3435
+ function ToolbarButton($$anchor, $$props) {
3436
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
3437
+ var button = root62();
3438
+ $106.attribute_effect(button, () => ({ type: "button", ...rest, [$106.STYLE]: { padding: "4px 8px" } }));
3439
+ var node = $106.child(button);
3440
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3441
+ $106.reset(button);
3442
+ $106.append($$anchor, button);
3443
+ }
3444
+ var root63 = $106.from_html(`<a><!></a>`);
3445
+ function ToolbarLink($$anchor, $$props) {
3446
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children"]);
3447
+ var a = root63();
3448
+ $106.attribute_effect(a, () => ({
3449
+ ...rest,
3450
+ [$106.STYLE]: {
3451
+ padding: "4px 8px",
3452
+ "text-decoration": "none",
3453
+ color: "inherit"
3454
+ }
3455
+ }));
3456
+ var node = $106.child(a);
3457
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3458
+ $106.reset(a);
3459
+ $106.append($$anchor, a);
3460
+ }
3461
+ var root64 = $106.from_html(`<div></div>`);
3462
+ function ToolbarSeparator($$anchor, $$props) {
3463
+ $106.push($$props, true);
3464
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy"]);
3465
+ const ctx = getContext("toolbar");
3466
+ let orientation = $106.derived(() => ctx?.orientation === "horizontal" ? "vertical" : "horizontal");
3467
+ var div = root64();
3468
+ $106.attribute_effect(div, () => ({
3469
+ role: "separator",
3470
+ "aria-orientation": $106.get(orientation),
3471
+ ...rest,
3472
+ [$106.STYLE]: {
3473
+ "background-color": "#eee",
3474
+ width: $106.get(orientation) === "vertical" ? "1px" : "100%",
3475
+ height: $106.get(orientation) === "vertical" ? "100%" : "1px",
3476
+ margin: "0 5px"
3477
+ }
3478
+ }));
3479
+ $106.append($$anchor, div);
3480
+ $106.pop();
3481
+ }
3482
+ var root65 = $106.from_html(`<div><!></div>`);
3483
+ function MenuBar($$anchor, $$props) {
3484
+ $106.push($$props, true);
3485
+ let defaultValue = $106.prop($$props, "defaultValue", 3, ""), rest = $106.rest_props($$props, [
3486
+ "$$slots",
3487
+ "$$events",
3488
+ "$$legacy",
3489
+ "value",
3490
+ "defaultValue",
3491
+ "onValueChange",
3492
+ "children",
3493
+ "class"
3494
+ ]);
3495
+ const machine = createMenuBar({
3496
+ value: $$props.value,
3497
+ defaultValue: defaultValue(),
3498
+ onValueChange: $$props.onValueChange
3499
+ });
3500
+ let state33 = $106.state($106.proxy(machine.state));
3501
+ $106.user_effect(() => {
3502
+ return machine.subscribe((newState) => {
3503
+ $106.set(state33, newState, true);
3504
+ });
3505
+ });
3506
+ function setValue(val) {
3507
+ if ($$props.value !== void 0) {
3508
+ $$props.onValueChange?.(val);
3509
+ } else {
3510
+ machine.actions.setValue(val);
3511
+ }
3512
+ }
3513
+ let currentValue = $106.derived(() => $$props.value !== void 0 ? $$props.value : $106.get(state33).value);
3514
+ setContext("menubar", {
3515
+ get value() {
3516
+ return $106.get(currentValue);
3517
+ },
3518
+ get autoSelect() {
3519
+ return !!$106.get(currentValue);
3520
+ },
3521
+ setValue
3522
+ });
3523
+ var div = root65();
3524
+ $106.attribute_effect(div, () => ({ role: "menubar", class: $$props.class, ...rest }));
3525
+ var node = $106.child(div);
3526
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3527
+ $106.reset(div);
3528
+ $106.append($$anchor, div);
3529
+ $106.pop();
3530
+ }
3531
+ function MenuBarMenu($$anchor, $$props) {
3532
+ $106.push($$props, true);
3533
+ const context = getContext("menubar");
3534
+ let open = $106.derived(() => context.value === $$props.value);
3535
+ let triggerElement = $106.state(void 0);
3536
+ setContext("menubar-menu", {
3537
+ get value() {
3538
+ return $$props.value;
3539
+ },
3540
+ get open() {
3541
+ return $106.get(open);
3542
+ },
3543
+ get triggerElement() {
3544
+ return $106.get(triggerElement);
3545
+ },
3546
+ setTriggerElement: (el) => {
3547
+ $106.set(triggerElement, el, true);
3548
+ }
3549
+ });
3550
+ var fragment = $106.comment();
3551
+ var node = $106.first_child(fragment);
3552
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3553
+ $106.append($$anchor, fragment);
3554
+ $106.pop();
3555
+ }
3556
+ var root66 = $106.from_html(`<button><!></button>`);
3557
+ function MenuBarTrigger($$anchor, $$props) {
3558
+ $106.push($$props, true);
3559
+ let rest = $106.rest_props($$props, [
3560
+ "$$slots",
3561
+ "$$events",
3562
+ "$$legacy",
3563
+ "children",
3564
+ "class",
3565
+ "onClick",
3566
+ "onMouseEnter"
3567
+ ]);
3568
+ const menubar = getContext("menubar");
3569
+ const menu = getContext("menubar-menu");
3570
+ let ref = $106.state(void 0);
3571
+ onMount(() => {
3572
+ if ($106.get(ref)) menu.setTriggerElement($106.get(ref));
3573
+ });
3574
+ function handleClick(e) {
3575
+ if (menu.open) {
3576
+ menubar.setValue("");
3577
+ } else {
3578
+ menubar.setValue(menu.value);
3579
+ }
3580
+ $$props.onClick?.(e);
3581
+ }
3582
+ function handleMouseEnter(e) {
3583
+ if (menubar.autoSelect && !menu.open) {
3584
+ menubar.setValue(menu.value);
3585
+ }
3586
+ $$props.onMouseEnter?.(e);
3587
+ }
3588
+ var button = root66();
3589
+ $106.attribute_effect(button, () => ({
3590
+ type: "button",
3591
+ role: "menuitem",
3592
+ "aria-haspopup": "menu",
3593
+ "aria-expanded": menu.open,
3594
+ "data-state": menu.open ? "open" : "closed",
3595
+ onclick: handleClick,
3596
+ onmouseenter: handleMouseEnter,
3597
+ class: $$props.class,
3598
+ ...rest
3599
+ }));
3600
+ var node = $106.child(button);
3601
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3602
+ $106.reset(button);
3603
+ $106.bind_this(button, ($$value) => $106.set(ref, $$value), () => $106.get(ref));
3604
+ $106.append($$anchor, button);
3605
+ $106.pop();
3606
+ }
3607
+ var root_120 = $106.from_html(`<div><!></div>`);
3608
+ function MenuBarContent($$anchor, $$props) {
3609
+ $106.push($$props, true);
3610
+ let side = $106.prop($$props, "side", 3, "bottom"), align = $106.prop($$props, "align", 3, "start"), sideOffset = $106.prop($$props, "sideOffset", 3, 5), alignOffset = $106.prop($$props, "alignOffset", 3, 0), rest = $106.rest_props($$props, [
3611
+ "$$slots",
3612
+ "$$events",
3613
+ "$$legacy",
3614
+ "side",
3615
+ "align",
3616
+ "sideOffset",
3617
+ "alignOffset",
3618
+ "children",
3619
+ "class"
3620
+ ]);
3621
+ getContext("menubar");
3622
+ const menu = getContext("menubar-menu");
3623
+ var fragment = $106.comment();
3624
+ var node = $106.first_child(fragment);
3625
+ {
3626
+ var consequent = ($$anchor2) => {
3627
+ var div = root_120();
3628
+ $106.attribute_effect(div, () => ({
3629
+ role: "menu",
3630
+ "data-state": "open",
3631
+ class: $$props.class,
3632
+ style: "z-index: 50; background-color: white; border: 1px solid #ccc; border-radius: 4px; padding: 5px 0; min-width: 150px;",
3633
+ ...rest
3634
+ }));
3635
+ var node_1 = $106.child(div);
3636
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
3637
+ $106.reset(div);
3638
+ $106.action(div, ($$node, $$action_arg) => portal?.($$node, $$action_arg), () => "body");
3639
+ $106.action(div, ($$node, $$action_arg) => position?.($$node, $$action_arg), () => ({
3640
+ trigger: menu.triggerElement,
3641
+ side: side(),
3642
+ align: align(),
3643
+ sideOffset: sideOffset(),
3644
+ alignOffset: alignOffset()
3645
+ }));
3646
+ $106.append($$anchor2, div);
3647
+ };
3648
+ $106.if(node, ($$render) => {
3649
+ if (menu.open) $$render(consequent);
3650
+ });
3651
+ }
3652
+ $106.append($$anchor, fragment);
3653
+ $106.pop();
3654
+ }
3655
+ var root_121 = $106.from_html(`<li><!></li>`);
3656
+ function Toast($$anchor, $$props) {
3657
+ $106.push($$props, true);
3658
+ let defaultOpen = $106.prop($$props, "defaultOpen", 3, true), duration = $106.prop($$props, "duration", 3, 5e3), rest = $106.rest_props($$props, [
3659
+ "$$slots",
3660
+ "$$events",
3661
+ "$$legacy",
3662
+ "open",
3663
+ "defaultOpen",
3664
+ "onOpenChange",
3665
+ "duration",
3666
+ "children",
3667
+ "class"
3668
+ ]);
3669
+ const machine = createToast({
3670
+ open: $$props.open,
3671
+ defaultOpen: defaultOpen(),
3672
+ onOpenChange: $$props.onOpenChange
3673
+ });
3674
+ let state33 = $106.state($106.proxy(machine.state));
3675
+ let timer;
3676
+ $106.user_effect(() => {
3677
+ return machine.subscribe((newState) => {
3678
+ $106.set(state33, newState, true);
3679
+ });
3680
+ });
3681
+ function startTimer() {
3682
+ if (!duration() || duration() === Infinity) return;
3683
+ stopTimer();
3684
+ timer = setTimeout(
3685
+ () => {
3686
+ setOpen(false);
3687
+ },
3688
+ duration()
3689
+ );
3690
+ }
3691
+ function stopTimer() {
3692
+ if (timer) clearTimeout(timer);
3693
+ }
3694
+ function setOpen(val) {
3695
+ if ($$props.open !== void 0) {
3696
+ $$props.onOpenChange?.(val);
3697
+ } else {
3698
+ machine.actions.setOpen(val);
3699
+ }
3700
+ }
3701
+ let isOpen = $106.derived(() => $$props.open !== void 0 ? $$props.open : $106.get(state33).open);
3702
+ $106.user_effect(() => {
3703
+ if ($106.get(isOpen)) startTimer();
3704
+ else stopTimer();
3705
+ });
3706
+ setContext("toast", {
3707
+ get open() {
3708
+ return $106.get(isOpen);
3709
+ },
3710
+ setOpen,
3711
+ startTimer,
3712
+ stopTimer
3713
+ });
3714
+ var fragment = $106.comment();
3715
+ var node = $106.first_child(fragment);
3716
+ {
3717
+ var consequent = ($$anchor2) => {
3718
+ var li = root_121();
3719
+ $106.attribute_effect(li, () => ({
3720
+ role: "status",
3721
+ "aria-live": "polite",
3722
+ "aria-atomic": "true",
3723
+ "data-state": "open",
3724
+ onmouseenter: stopTimer,
3725
+ onmouseleave: startTimer,
3726
+ class: $$props.class,
3727
+ style: "background-color: white; border-radius: 6px; box-shadow: 0 10px 38px -10px rgba(22, 23, 24, 0.35); padding: 15px; display: grid; grid-template-areas: 'title action' 'description action'; grid-template-columns: auto max-content; column-gap: 15px; align-items: center;",
3728
+ ...rest
3729
+ }));
3730
+ var node_1 = $106.child(li);
3731
+ $106.snippet(node_1, () => $$props.children ?? $106.noop);
3732
+ $106.reset(li);
3733
+ $106.append($$anchor2, li);
3734
+ };
3735
+ $106.if(node, ($$render) => {
3736
+ if ($106.get(isOpen)) $$render(consequent);
3737
+ });
3738
+ }
3739
+ $106.append($$anchor, fragment);
3740
+ $106.pop();
3741
+ }
3742
+ function ToastProvider($$anchor, $$props) {
3743
+ var fragment = $106.comment();
3744
+ var node = $106.first_child(fragment);
3745
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3746
+ $106.append($$anchor, fragment);
3747
+ }
3748
+ var root67 = $106.from_html(`<div><ol><!></ol></div>`);
3749
+ function ToastViewport($$anchor, $$props) {
3750
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "class", "children"]);
3751
+ var div = root67();
3752
+ var ol = $106.child(div);
3753
+ $106.attribute_effect(ol, () => ({
3754
+ role: "region",
3755
+ "aria-label": "Notifications",
3756
+ class: $$props.class,
3757
+ style: "position: fixed; bottom: 0; right: 0; display: flex; flexDirection: column; padding: 25px; gap: 10px; width: 390px; maxWidth: 100vw; margin: 0; listStyle: none; zIndex: 2147483647; outline: none;",
3758
+ ...rest
3759
+ }));
3760
+ var node = $106.child(ol);
3761
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3762
+ $106.reset(ol);
3763
+ $106.reset(div);
3764
+ $106.action(div, ($$node, $$action_arg) => portal?.($$node, $$action_arg), () => "body");
3765
+ $106.append($$anchor, div);
3766
+ }
3767
+ var root68 = $106.from_html(`<div><!></div>`);
3768
+ function ToastTitle($$anchor, $$props) {
3769
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "class"]);
3770
+ var div = root68();
3771
+ $106.attribute_effect(div, () => ({
3772
+ class: $$props.class,
3773
+ style: "grid-area: title; margin-bottom: 5px; font-weight: 500;",
3774
+ ...rest
3775
+ }));
3776
+ var node = $106.child(div);
3777
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3778
+ $106.reset(div);
3779
+ $106.append($$anchor, div);
3780
+ }
3781
+ var root69 = $106.from_html(`<div><!></div>`);
3782
+ function ToastDescription($$anchor, $$props) {
3783
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "class"]);
3784
+ var div = root69();
3785
+ $106.attribute_effect(div, () => ({
3786
+ class: $$props.class,
3787
+ style: "grid-area: description; margin: 0; opacity: 0.8; font-size: 13px;",
3788
+ ...rest
3789
+ }));
3790
+ var node = $106.child(div);
3791
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3792
+ $106.reset(div);
3793
+ $106.append($$anchor, div);
3794
+ }
3795
+ var root70 = $106.from_html(`<button><!></button>`);
3796
+ function ToastAction($$anchor, $$props) {
3797
+ let rest = $106.rest_props($$props, [
3798
+ "$$slots",
3799
+ "$$events",
3800
+ "$$legacy",
3801
+ "altText",
3802
+ "children",
3803
+ "class"
3804
+ ]);
3805
+ var button = root70();
3806
+ $106.attribute_effect(button, () => ({
3807
+ type: "button",
3808
+ class: $$props.class,
3809
+ style: "grid-area: action;",
3810
+ ...rest
3811
+ }));
3812
+ var node = $106.child(button);
3813
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3814
+ $106.reset(button);
3815
+ $106.append($$anchor, button);
3816
+ }
3817
+ var root71 = $106.from_html(`<button><!></button>`);
3818
+ function ToastClose($$anchor, $$props) {
3819
+ $106.push($$props, true);
3820
+ let rest = $106.rest_props($$props, [
3821
+ "$$slots",
3822
+ "$$events",
3823
+ "$$legacy",
3824
+ "children",
3825
+ "class",
3826
+ "onClick"
3827
+ ]);
3828
+ const context = getContext("toast");
3829
+ function handleClick(e) {
3830
+ context.setOpen(false);
3831
+ $$props.onClick?.(e);
3832
+ }
3833
+ var button = root71();
3834
+ $106.attribute_effect(button, () => ({
3835
+ type: "button",
3836
+ onclick: handleClick,
3837
+ class: $$props.class,
3838
+ ...rest
3839
+ }));
3840
+ var node = $106.child(button);
3841
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3842
+ $106.reset(button);
3843
+ $106.append($$anchor, button);
3844
+ $106.pop();
3845
+ }
3846
+ var root72 = $106.from_html(`<div><!></div>`);
3847
+ function ScrollArea($$anchor, $$props) {
3848
+ $106.push($$props, true);
3849
+ $106.prop($$props, "type", 3, "hover"); $106.prop($$props, "scrollHideDelay", 3, 600); let rest = $106.rest_props($$props, [
3850
+ "$$slots",
3851
+ "$$events",
3852
+ "$$legacy",
3853
+ "type",
3854
+ "scrollHideDelay",
3855
+ "children",
3856
+ "class"
3857
+ ]);
3858
+ let viewportElement = $106.state(void 0);
3859
+ setContext("scroll-area", {
3860
+ get viewport() {
3861
+ return $106.get(viewportElement);
3862
+ },
3863
+ setViewport: (el) => {
3864
+ $106.set(viewportElement, el, true);
3865
+ }
3866
+ });
3867
+ var div = root72();
3868
+ $106.attribute_effect(div, () => ({
3869
+ dir: "ltr",
3870
+ "data-uifn-scroll-area": "",
3871
+ class: $$props.class,
3872
+ style: "position: relative; overflow: hidden;",
3873
+ ...rest
3874
+ }));
3875
+ var node = $106.child(div);
3876
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3877
+ $106.reset(div);
3878
+ $106.template_effect(() => div.dir = div.dir);
3879
+ $106.append($$anchor, div);
3880
+ $106.pop();
3881
+ }
3882
+ var root73 = $106.from_html(`<div><!></div>`);
3883
+ function ScrollAreaViewport($$anchor, $$props) {
3884
+ $106.push($$props, true);
3885
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "class"]);
3886
+ const context = getContext("scroll-area");
3887
+ let ref = $106.state(void 0);
3888
+ onMount(() => {
3889
+ if ($106.get(ref)) context.setViewport($106.get(ref));
3890
+ });
3891
+ var div = root73();
3892
+ $106.attribute_effect(div, () => ({
3893
+ "data-uifn-scroll-area-viewport": "",
3894
+ class: $$props.class,
3895
+ style: "width: 100%; height: 100%; border-radius: inherit; overflow: scroll;",
3896
+ ...rest
3897
+ }));
3898
+ var node = $106.child(div);
3899
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3900
+ $106.reset(div);
3901
+ $106.bind_this(div, ($$value) => $106.set(ref, $$value), () => $106.get(ref));
3902
+ $106.append($$anchor, div);
3903
+ $106.pop();
3904
+ }
3905
+ var root74 = $106.from_html(`<div><!></div>`);
3906
+ function ScrollAreaScrollbar($$anchor, $$props) {
3907
+ $106.push($$props, true);
3908
+ let orientation = $106.prop($$props, "orientation", 3, "vertical"), rest = $106.rest_props($$props, [
3909
+ "$$slots",
3910
+ "$$events",
3911
+ "$$legacy",
3912
+ "orientation",
3913
+ "children",
3914
+ "class"
3915
+ ]);
3916
+ getContext("scroll-area");
3917
+ var div = root74();
3918
+ $106.attribute_effect(div, () => ({
3919
+ role: "scrollbar",
3920
+ "data-orientation": orientation(),
3921
+ class: $$props.class,
3922
+ style: `display: flex; user-select: none; touch-action: none; transition: background 160ms ease-out; position: absolute; ${orientation() === "vertical" ? "right: 0; width: 10px; height: 100%;" : "bottom: 0; height: 10px; width: 100%;"}`,
3923
+ ...rest
3924
+ }));
3925
+ var node = $106.child(div);
3926
+ $106.snippet(node, () => $$props.children ?? $106.noop);
3927
+ $106.reset(div);
3928
+ $106.append($$anchor, div);
3929
+ $106.pop();
3930
+ }
3931
+ var root75 = $106.from_html(`<div></div>`);
3932
+ function ScrollAreaThumb($$anchor, $$props) {
3933
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "class"]);
3934
+ var div = root75();
3935
+ $106.attribute_effect(div, () => ({
3936
+ class: $$props.class,
3937
+ style: "flex: 1; background: rgba(0,0,0,0.3); border-radius: 10px; position: relative;",
3938
+ ...rest
3939
+ }));
3940
+ $106.append($$anchor, div);
3941
+ }
3942
+ var root76 = $106.from_html(`<div></div>`);
3943
+ function ScrollAreaCorner($$anchor, $$props) {
3944
+ let rest = $106.rest_props($$props, ["$$slots", "$$events", "$$legacy", "class"]);
3945
+ var div = root76();
3946
+ $106.attribute_effect(div, () => ({
3947
+ class: $$props.class,
3948
+ style: "position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; background: transparent;",
3949
+ ...rest
3950
+ }));
3951
+ $106.append($$anchor, div);
3952
+ }
3953
+ var root77 = $106.from_html(`<div><!></div>`);
3954
+ function ToggleGroup($$anchor, $$props) {
3955
+ $106.push($$props, true);
3956
+ let type = $106.prop($$props, "type", 3, "single"), disabled = $106.prop($$props, "disabled", 3, false), orientation = $106.prop($$props, "orientation", 3, "horizontal"), rovingFocus = $106.prop($$props, "rovingFocus", 3, true), rest = $106.rest_props($$props, [
3957
+ "$$slots",
3958
+ "$$events",
3959
+ "$$legacy",
3960
+ "type",
3961
+ "value",
3962
+ "defaultValue",
3963
+ "disabled",
3964
+ "onValueChange",
3965
+ "orientation",
3966
+ "rovingFocus",
3967
+ "children",
3968
+ "class"
3969
+ ]);
3970
+ const machine = createToggleGroup({
3971
+ type: type(),
3972
+ value: $$props.value,
3973
+ defaultValue: $$props.defaultValue,
3974
+ disabled: disabled(),
3975
+ onValueChange: $$props.onValueChange
3976
+ });
3977
+ let state33 = $106.state($106.proxy(machine.state));
3978
+ $106.user_effect(() => {
3979
+ return machine.subscribe((newState) => {
3980
+ $106.set(state33, newState, true);
3981
+ });
3982
+ });
3983
+ $106.user_effect(() => {
3984
+ if ($$props.value !== void 0 && $$props.value !== $106.get(state33).value) {
3985
+ machine.actions.setValue($$props.value);
3986
+ }
3987
+ });
3988
+ setContext("toggle-group", {
3989
+ get value() {
3990
+ return $106.get(state33).value;
3991
+ },
3992
+ get type() {
3993
+ return type();
3994
+ },
3995
+ get disabled() {
3996
+ return disabled();
3997
+ },
3998
+ get rovingFocus() {
3999
+ return rovingFocus();
4000
+ },
4001
+ get orientation() {
4002
+ return orientation();
4003
+ },
4004
+ toggleItem: machine.actions.toggleItem
4005
+ });
4006
+ var div = root77();
4007
+ $106.attribute_effect(div, () => ({
4008
+ role: "group",
4009
+ "data-orientation": orientation(),
4010
+ class: $$props.class,
4011
+ ...rest
4012
+ }));
4013
+ var node = $106.child(div);
4014
+ $106.snippet(node, () => $$props.children ?? $106.noop);
4015
+ $106.reset(div);
4016
+ $106.append($$anchor, div);
4017
+ $106.pop();
4018
+ }
4019
+ var root78 = $106.from_html(`<button><!></button>`);
4020
+ function ToggleGroupItem($$anchor, $$props) {
4021
+ $106.push($$props, true);
4022
+ let disabled = $106.prop($$props, "disabled", 3, false), rest = $106.rest_props($$props, [
4023
+ "$$slots",
4024
+ "$$events",
4025
+ "$$legacy",
4026
+ "value",
4027
+ "disabled",
4028
+ "children",
4029
+ "class"
4030
+ ]);
4031
+ const context = getContext("toggle-group");
4032
+ let pressed = $106.derived(() => context.type === "single" ? context.value === $$props.value : context.value.includes($$props.value));
4033
+ let isDisabled = $106.derived(() => context.disabled || disabled());
4034
+ function handleClick() {
4035
+ if ($106.get(isDisabled)) return;
4036
+ context.toggleItem($$props.value);
4037
+ }
4038
+ function handleKeyDown(e) {
4039
+ if ($106.get(isDisabled)) return;
4040
+ if (e.key === "Enter" || e.key === " ") {
4041
+ e.preventDefault();
4042
+ context.toggleItem($$props.value);
4043
+ }
4044
+ }
4045
+ var button = root78();
4046
+ $106.attribute_effect(button, () => ({
4047
+ type: "button",
4048
+ role: context.type === "single" ? "radio" : "button",
4049
+ "aria-checked": context.type === "single" ? $106.get(pressed) : void 0,
4050
+ "aria-pressed": context.type === "multiple" ? $106.get(pressed) : void 0,
4051
+ "data-state": $106.get(pressed) ? "on" : "off",
4052
+ "data-disabled": $106.get(isDisabled) ? "" : void 0,
4053
+ disabled: $106.get(isDisabled),
4054
+ tabindex: context.rovingFocus ? $106.get(pressed) ? 0 : -1 : 0,
4055
+ onclick: handleClick,
4056
+ onkeydown: handleKeyDown,
4057
+ class: $$props.class,
4058
+ ...rest
4059
+ }));
4060
+ var node = $106.child(button);
4061
+ $106.snippet(node, () => $$props.children ?? $106.noop);
4062
+ $106.reset(button);
4063
+ $106.append($$anchor, button);
4064
+ $106.pop();
4065
+ }
4066
+ var root_122 = $106.from_html(`<div><!></div>`);
4067
+ var root79 = $106.from_html(`<div><div></div></div>`);
4068
+ function VirtualizedList($$anchor, $$props) {
4069
+ $106.push($$props, true);
4070
+ let overscan = $106.prop($$props, "overscan", 3, 3), rest = $106.rest_props($$props, [
4071
+ "$$slots",
4072
+ "$$events",
4073
+ "$$legacy",
4074
+ "items",
4075
+ "itemHeight",
4076
+ "children",
4077
+ "height",
4078
+ "overscan",
4079
+ "class",
4080
+ "style",
4081
+ "onscroll"
4082
+ ]);
4083
+ let scrollTop = $106.state(0);
4084
+ let container;
4085
+ let totalHeight = $106.derived(() => $$props.items.length * $$props.itemHeight);
4086
+ let viewportHeight = $106.derived(() => typeof $$props.height === "number" ? $$props.height : 300);
4087
+ let startIndex = $106.derived(() => Math.max(0, Math.floor($106.get(scrollTop) / $$props.itemHeight) - overscan()));
4088
+ let endIndex = $106.derived(() => Math.min($$props.items.length, Math.ceil(($106.get(scrollTop) + $106.get(viewportHeight)) / $$props.itemHeight) + overscan()));
4089
+ let visibleItems = $106.derived(() => $$props.items.slice($106.get(startIndex), $106.get(endIndex)).map((item, i) => ({ item, index: $106.get(startIndex) + i })));
4090
+ function handleScroll(e) {
4091
+ $106.set(scrollTop, e.target.scrollTop, true);
4092
+ $$props.onscroll?.(e);
4093
+ }
4094
+ var div = root79();
4095
+ $106.attribute_effect(div, () => ({
4096
+ onscroll: handleScroll,
4097
+ class: $$props.class,
4098
+ style: `height: ${(typeof $$props.height === "number" ? $$props.height + "px" : $$props.height) ?? ""}; overflow-y: auto; position: relative; ${$$props.style ?? ""}`,
4099
+ ...rest
4100
+ }));
4101
+ var div_1 = $106.child(div);
4102
+ $106.each(div_1, 21, () => $106.get(visibleItems), ({ item, index }) => index, ($$anchor2, $$item) => {
4103
+ let item = () => $106.get($$item).item;
4104
+ let index = () => $106.get($$item).index;
4105
+ var div_2 = root_122();
4106
+ var node = $106.child(div_2);
4107
+ $106.snippet(node, () => $$props.children, item, index);
4108
+ $106.reset(div_2);
4109
+ $106.template_effect(() => $106.set_style(div_2, `position: absolute; top: 0; left: 0; width: 100%; height: ${$$props.itemHeight ?? ""}px; transform: translateY(${index() * $$props.itemHeight}px);`));
4110
+ $106.append($$anchor2, div_2);
4111
+ });
4112
+ $106.reset(div_1);
4113
+ $106.reset(div);
4114
+ $106.bind_this(div, ($$value) => container = $$value, () => container);
4115
+ $106.template_effect(() => $106.set_style(div_1, `height: ${$106.get(totalHeight) ?? ""}px; position: relative;`));
4116
+ $106.append($$anchor, div);
4117
+ $106.pop();
4118
+ }
4119
+
4120
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Checkbox, CheckboxIndicator, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxItemIndicator, ComboboxLabel, ComboboxSeparator, ComboboxTrigger, ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogOverlay, DialogPortal, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, HoverCard, HoverCardContent, HoverCardTrigger, Label, MenuBar, MenuBarContent, MenuBarMenu, MenuBarTrigger, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupIndicator, RadioGroupItem, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Select, SelectContent, SelectGroup, SelectItem, SelectItemIndicator, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SelectViewport, Separator, Slider, SliderRange, SliderThumb, SliderTrack, Switch, SwitchThumb, Tabs, TabsContent, TabsList, TabsTrigger, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, ToolbarButton, ToolbarLink, ToolbarSeparator, Tooltip, TooltipContent, TooltipTrigger, VirtualizedList };
4121
+ //# sourceMappingURL=index.mjs.map
4122
+ //# sourceMappingURL=index.mjs.map