ivt 0.1.3 → 0.1.5

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 (170) hide show
  1. package/dist/accordion/index.mjs +1 -1
  2. package/dist/alert/index.mjs +1 -1
  3. package/dist/alert-dialog/index.mjs +1 -1
  4. package/dist/alert-dialog/index.mjs.map +1 -1
  5. package/dist/avatar/index.mjs +1 -1
  6. package/dist/avatar/index.mjs.map +1 -1
  7. package/dist/badge/index.mjs +1 -1
  8. package/dist/base/index.mjs +1 -1
  9. package/dist/base/index.mjs.map +1 -1
  10. package/dist/button/index.mjs +1 -1
  11. package/dist/calendar/index.mjs +1 -1
  12. package/dist/card/index.mjs +1 -1
  13. package/dist/checkbox/index.mjs +1 -1
  14. package/dist/checkbox/index.mjs.map +1 -1
  15. package/dist/chunks/TextWrap-qkVOkHiw.mjs +2 -0
  16. package/dist/chunks/TextWrap-qkVOkHiw.mjs.map +1 -0
  17. package/dist/chunks/accordion-DCSVhB7Z.mjs +2 -0
  18. package/dist/chunks/accordion-DCSVhB7Z.mjs.map +1 -0
  19. package/dist/chunks/{badge-Bl0X9ruG.mjs → badge-D_x3BlPA.mjs} +2 -2
  20. package/dist/chunks/{badge-Bl0X9ruG.mjs.map → badge-D_x3BlPA.mjs.map} +1 -1
  21. package/dist/chunks/{bundle-mjs-BYGwPY3j.mjs → bundle-mjs-Dthp4wMi.mjs} +1 -1
  22. package/dist/chunks/{bundle-mjs-BYGwPY3j.mjs.map → bundle-mjs-Dthp4wMi.mjs.map} +1 -1
  23. package/dist/chunks/{button-B7K2JEBG.mjs → button-KMRgpiAy.mjs} +2 -2
  24. package/dist/chunks/{button-B7K2JEBG.mjs.map → button-KMRgpiAy.mjs.map} +1 -1
  25. package/dist/chunks/{calendar-CDaopDjB.mjs → calendar-CmSMkDgI.mjs} +2 -2
  26. package/dist/chunks/{calendar-CDaopDjB.mjs.map → calendar-CmSMkDgI.mjs.map} +1 -1
  27. package/dist/chunks/check-BSduI23k.mjs +2 -0
  28. package/dist/chunks/{check-DoBi3iW5.mjs.map → check-BSduI23k.mjs.map} +1 -1
  29. package/dist/chunks/chevron-down-BjVZhjFJ.mjs +2 -0
  30. package/dist/chunks/{chevron-down-BlskY22a.mjs.map → chevron-down-BjVZhjFJ.mjs.map} +1 -1
  31. package/dist/chunks/chevron-left-DjmYjuTW.mjs +2 -0
  32. package/dist/chunks/{chevron-left-BXFDtxhQ.mjs.map → chevron-left-DjmYjuTW.mjs.map} +1 -1
  33. package/dist/chunks/chevron-right-DOvHale5.mjs +2 -0
  34. package/dist/chunks/{chevron-right-DAqTCOj7.mjs.map → chevron-right-DOvHale5.mjs.map} +1 -1
  35. package/dist/chunks/{command-DYONarI_.mjs → command-DMdzlCRK.mjs} +2 -2
  36. package/dist/chunks/{command-DYONarI_.mjs.map → command-DMdzlCRK.mjs.map} +1 -1
  37. package/dist/chunks/{createLucideIcon-CkKdyF_L.mjs → createLucideIcon-BPtXaGDX.mjs} +1 -1
  38. package/dist/chunks/{createLucideIcon-CkKdyF_L.mjs.map → createLucideIcon-BPtXaGDX.mjs.map} +1 -1
  39. package/dist/chunks/{dialog-Bs3UmyLz.mjs → dialog-DT-LxfeE.mjs} +2 -2
  40. package/dist/chunks/{dialog-Bs3UmyLz.mjs.map → dialog-DT-LxfeE.mjs.map} +1 -1
  41. package/dist/chunks/hover-card-D0WoNHd_.mjs +2 -0
  42. package/dist/chunks/hover-card-D0WoNHd_.mjs.map +1 -0
  43. package/dist/chunks/index-BE7U1lz3.mjs +2 -0
  44. package/dist/chunks/index-BE7U1lz3.mjs.map +1 -0
  45. package/dist/chunks/index-BEeVpO2_.mjs +2 -0
  46. package/dist/chunks/index-BEeVpO2_.mjs.map +1 -0
  47. package/dist/chunks/{index-BX6nSpY1.mjs → index-BOtb6ofV.mjs} +1 -1
  48. package/dist/chunks/{index-BX6nSpY1.mjs.map → index-BOtb6ofV.mjs.map} +1 -1
  49. package/dist/chunks/index-BYaJxqBC.mjs +2 -0
  50. package/dist/chunks/index-BYaJxqBC.mjs.map +1 -0
  51. package/dist/chunks/index-C8ZqoA88.mjs +2 -0
  52. package/dist/chunks/index-C8ZqoA88.mjs.map +1 -0
  53. package/dist/chunks/index-CIfe3UIG.mjs +2 -0
  54. package/dist/chunks/index-CIfe3UIG.mjs.map +1 -0
  55. package/dist/chunks/{index-qP_a6BiF.mjs → index-CVg6WODB.mjs} +2 -2
  56. package/dist/chunks/index-CVg6WODB.mjs.map +1 -0
  57. package/dist/chunks/{index-DB6P4Tz1.mjs → index-ChEz--fx.mjs} +1 -1
  58. package/dist/chunks/{index-DB6P4Tz1.mjs.map → index-ChEz--fx.mjs.map} +1 -1
  59. package/dist/chunks/index-D1WqwlXc.mjs +2 -0
  60. package/dist/chunks/index-D1WqwlXc.mjs.map +1 -0
  61. package/dist/chunks/index-DrgyjxdM.mjs +2 -0
  62. package/dist/chunks/{index-DdNjMgpV.mjs.map → index-DrgyjxdM.mjs.map} +1 -1
  63. package/dist/chunks/index-Ds-NL_xb.mjs +2 -0
  64. package/dist/chunks/index-Ds-NL_xb.mjs.map +1 -0
  65. package/dist/chunks/index-DspU1Pyo.mjs +2 -0
  66. package/dist/chunks/index-DspU1Pyo.mjs.map +1 -0
  67. package/dist/chunks/index-k-LDQli2.mjs +2 -0
  68. package/dist/chunks/index-k-LDQli2.mjs.map +1 -0
  69. package/dist/chunks/index-mlVBNiql.mjs +2 -0
  70. package/dist/chunks/index-mlVBNiql.mjs.map +1 -0
  71. package/dist/chunks/{index-XatPIL6c.mjs → index-rHca3YxT.mjs} +2 -2
  72. package/dist/chunks/{index-XatPIL6c.mjs.map → index-rHca3YxT.mjs.map} +1 -1
  73. package/dist/chunks/{input-BtSMyTkT.mjs → input-CjX7cpsJ.mjs} +2 -2
  74. package/dist/chunks/{input-BtSMyTkT.mjs.map → input-CjX7cpsJ.mjs.map} +1 -1
  75. package/dist/chunks/{label-BL5NIn0A.mjs → label-B0a5aNu2.mjs} +2 -2
  76. package/dist/chunks/label-B0a5aNu2.mjs.map +1 -0
  77. package/dist/chunks/{pagination-BiktkEzi.mjs → pagination-XvM9skZV.mjs} +2 -2
  78. package/dist/chunks/{pagination-BiktkEzi.mjs.map → pagination-XvM9skZV.mjs.map} +1 -1
  79. package/dist/chunks/popover-COG3isxJ.mjs +2 -0
  80. package/dist/chunks/popover-COG3isxJ.mjs.map +1 -0
  81. package/dist/chunks/{progress-CmBH1a8S.mjs → progress-KQNbvdmu.mjs} +2 -2
  82. package/dist/chunks/progress-KQNbvdmu.mjs.map +1 -0
  83. package/dist/chunks/scroll-area-Bof4yc1z.mjs +2 -0
  84. package/dist/chunks/scroll-area-Bof4yc1z.mjs.map +1 -0
  85. package/dist/chunks/{select-Co76oy2I.mjs → select-rpTSdR8q.mjs} +2 -2
  86. package/dist/chunks/{select-Co76oy2I.mjs.map → select-rpTSdR8q.mjs.map} +1 -1
  87. package/dist/chunks/{skeleton-cvIjllDp.mjs → skeleton-DwcR7I_w.mjs} +2 -2
  88. package/dist/chunks/{skeleton-cvIjllDp.mjs.map → skeleton-DwcR7I_w.mjs.map} +1 -1
  89. package/dist/chunks/{sortable-DaXPlC2-.mjs → sortable-BKqLwBgJ.mjs} +2 -2
  90. package/dist/chunks/{sortable-DaXPlC2-.mjs.map → sortable-BKqLwBgJ.mjs.map} +1 -1
  91. package/dist/chunks/{table-xzX2584j.mjs → table-DapXfoMY.mjs} +2 -2
  92. package/dist/chunks/{table-xzX2584j.mjs.map → table-DapXfoMY.mjs.map} +1 -1
  93. package/dist/chunks/{tslib.es6-CC_zzJ2l.mjs → tslib.es6-D-trMiel.mjs} +1 -1
  94. package/dist/chunks/{tslib.es6-CC_zzJ2l.mjs.map → tslib.es6-D-trMiel.mjs.map} +1 -1
  95. package/dist/chunks/{utils-B9uwc_lt.mjs → utils-BDlXiHS3.mjs} +2 -2
  96. package/dist/chunks/{utils-B9uwc_lt.mjs.map → utils-BDlXiHS3.mjs.map} +1 -1
  97. package/dist/chunks/x-BIoR0tgq.mjs +2 -0
  98. package/dist/chunks/{x-Bdqqbrz4.mjs.map → x-BIoR0tgq.mjs.map} +1 -1
  99. package/dist/command/index.mjs +1 -1
  100. package/dist/data-table/index.mjs +1 -1
  101. package/dist/data-table/index.mjs.map +1 -1
  102. package/dist/dialog/index.mjs +1 -1
  103. package/dist/dropdown-menu/index.mjs +1 -1
  104. package/dist/dropdown-menu/index.mjs.map +1 -1
  105. package/dist/dropzone/index.d.ts +43 -12
  106. package/dist/dropzone/index.mjs +1 -1
  107. package/dist/dropzone/index.mjs.map +1 -1
  108. package/dist/form/index.mjs +1 -1
  109. package/dist/form/index.mjs.map +1 -1
  110. package/dist/hover-card/index.mjs +1 -1
  111. package/dist/icon/index.mjs +1 -1
  112. package/dist/index.css +1 -1
  113. package/dist/input/index.mjs +1 -1
  114. package/dist/label/index.mjs +1 -1
  115. package/dist/pagination/index.mjs +1 -1
  116. package/dist/popover/index.mjs +1 -1
  117. package/dist/progress/index.mjs +1 -1
  118. package/dist/scroll-area/index.mjs +1 -1
  119. package/dist/select/index.mjs +1 -1
  120. package/dist/separator/index.mjs +1 -1
  121. package/dist/separator/index.mjs.map +1 -1
  122. package/dist/sheet/index.mjs +1 -1
  123. package/dist/sheet/index.mjs.map +1 -1
  124. package/dist/skeleton/index.mjs +1 -1
  125. package/dist/sortable/index.mjs +1 -1
  126. package/dist/table/index.mjs +1 -1
  127. package/dist/tabs/index.mjs +1 -1
  128. package/dist/tabs/index.mjs.map +1 -1
  129. package/dist/toast/index.mjs +1 -1
  130. package/dist/toast/index.mjs.map +1 -1
  131. package/dist/tooltip/index.mjs +1 -1
  132. package/dist/tooltip/index.mjs.map +1 -1
  133. package/package.json +1 -1
  134. package/dist/chunks/TextWrap-DM8p5RY0.mjs +0 -2
  135. package/dist/chunks/TextWrap-DM8p5RY0.mjs.map +0 -1
  136. package/dist/chunks/accordion-CJbwVC50.mjs +0 -2
  137. package/dist/chunks/accordion-CJbwVC50.mjs.map +0 -1
  138. package/dist/chunks/check-DoBi3iW5.mjs +0 -2
  139. package/dist/chunks/chevron-down-BlskY22a.mjs +0 -2
  140. package/dist/chunks/chevron-left-BXFDtxhQ.mjs +0 -2
  141. package/dist/chunks/chevron-right-DAqTCOj7.mjs +0 -2
  142. package/dist/chunks/hover-card-CujP4Atn.mjs +0 -2
  143. package/dist/chunks/hover-card-CujP4Atn.mjs.map +0 -1
  144. package/dist/chunks/index-BSf-atXx.mjs +0 -2
  145. package/dist/chunks/index-BSf-atXx.mjs.map +0 -1
  146. package/dist/chunks/index-CAVVTG3h.mjs +0 -2
  147. package/dist/chunks/index-CAVVTG3h.mjs.map +0 -1
  148. package/dist/chunks/index-CUXMuJ__.mjs +0 -2
  149. package/dist/chunks/index-CUXMuJ__.mjs.map +0 -1
  150. package/dist/chunks/index-Ck1fOwnt.mjs +0 -2
  151. package/dist/chunks/index-Ck1fOwnt.mjs.map +0 -1
  152. package/dist/chunks/index-DZldl4eo.mjs +0 -2
  153. package/dist/chunks/index-DZldl4eo.mjs.map +0 -1
  154. package/dist/chunks/index-DdNjMgpV.mjs +0 -2
  155. package/dist/chunks/index-Dix9fE1x.mjs +0 -2
  156. package/dist/chunks/index-Dix9fE1x.mjs.map +0 -1
  157. package/dist/chunks/index-DuMyb05s.mjs +0 -2
  158. package/dist/chunks/index-DuMyb05s.mjs.map +0 -1
  159. package/dist/chunks/index-DyUn0c26.mjs +0 -2
  160. package/dist/chunks/index-DyUn0c26.mjs.map +0 -1
  161. package/dist/chunks/index-IXx8l3RV.mjs +0 -2
  162. package/dist/chunks/index-IXx8l3RV.mjs.map +0 -1
  163. package/dist/chunks/index-qP_a6BiF.mjs.map +0 -1
  164. package/dist/chunks/label-BL5NIn0A.mjs.map +0 -1
  165. package/dist/chunks/popover-CSY_ub7s.mjs +0 -2
  166. package/dist/chunks/popover-CSY_ub7s.mjs.map +0 -1
  167. package/dist/chunks/progress-CmBH1a8S.mjs.map +0 -1
  168. package/dist/chunks/scroll-area-B-b-oQYr.mjs +0 -2
  169. package/dist/chunks/scroll-area-B-b-oQYr.mjs.map +0 -1
  170. package/dist/chunks/x-Bdqqbrz4.mjs +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../node_modules/@radix-ui/react-tabs/dist/index.mjs","../../src/components/ui/tabs/tabs.tsx"],"sourcesContent":["\"use client\";\n\n// packages/react/tabs/src/tabs.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { createRovingFocusGroupScope } from \"@radix-ui/react-roving-focus\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport * as RovingFocusGroup from \"@radix-ui/react-roving-focus\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { jsx } from \"react/jsx-runtime\";\nvar TABS_NAME = \"Tabs\";\nvar [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [\n createRovingFocusGroupScope\n]);\nvar useRovingFocusGroupScope = createRovingFocusGroupScope();\nvar [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);\nvar Tabs = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeTabs,\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation = \"horizontal\",\n dir,\n activationMode = \"automatic\",\n ...tabsProps\n } = props;\n const direction = useDirection(dir);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n defaultProp: defaultValue\n });\n return /* @__PURE__ */ jsx(\n TabsProvider,\n {\n scope: __scopeTabs,\n baseId: useId(),\n value,\n onValueChange: setValue,\n orientation,\n dir: direction,\n activationMode,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n dir: direction,\n \"data-orientation\": orientation,\n ...tabsProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\nTabs.displayName = TABS_NAME;\nvar TAB_LIST_NAME = \"TabsList\";\nvar TabsList = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTabs, loop = true, ...listProps } = props;\n const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);\n return /* @__PURE__ */ jsx(\n RovingFocusGroup.Root,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n orientation: context.orientation,\n dir: context.dir,\n loop,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"tablist\",\n \"aria-orientation\": context.orientation,\n ...listProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\nTabsList.displayName = TAB_LIST_NAME;\nvar TRIGGER_NAME = \"TabsTrigger\";\nvar TabsTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTabs, value, disabled = false, ...triggerProps } = props;\n const context = useTabsContext(TRIGGER_NAME, __scopeTabs);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);\n const triggerId = makeTriggerId(context.baseId, value);\n const contentId = makeContentId(context.baseId, value);\n const isSelected = value === context.value;\n return /* @__PURE__ */ jsx(\n RovingFocusGroup.Item,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n focusable: !disabled,\n active: isSelected,\n children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n role: \"tab\",\n \"aria-selected\": isSelected,\n \"aria-controls\": contentId,\n \"data-state\": isSelected ? \"active\" : \"inactive\",\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n id: triggerId,\n ...triggerProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onValueChange(value);\n } else {\n event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if ([\" \", \"Enter\"].includes(event.key)) context.onValueChange(value);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => {\n const isAutomaticActivation = context.activationMode !== \"manual\";\n if (!isSelected && !disabled && isAutomaticActivation) {\n context.onValueChange(value);\n }\n })\n }\n )\n }\n );\n }\n);\nTabsTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"TabsContent\";\nvar TabsContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTabs, value, forceMount, children, ...contentProps } = props;\n const context = useTabsContext(CONTENT_NAME, __scopeTabs);\n const triggerId = makeTriggerId(context.baseId, value);\n const contentId = makeContentId(context.baseId, value);\n const isSelected = value === context.value;\n const isMountAnimationPreventedRef = React.useRef(isSelected);\n React.useEffect(() => {\n const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);\n return () => cancelAnimationFrame(rAF);\n }, []);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": isSelected ? \"active\" : \"inactive\",\n \"data-orientation\": context.orientation,\n role: \"tabpanel\",\n \"aria-labelledby\": triggerId,\n hidden: !present,\n id: contentId,\n tabIndex: 0,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...props.style,\n animationDuration: isMountAnimationPreventedRef.current ? \"0s\" : void 0\n },\n children: present && children\n }\n ) });\n }\n);\nTabsContent.displayName = CONTENT_NAME;\nfunction makeTriggerId(baseId, value) {\n return `${baseId}-trigger-${value}`;\n}\nfunction makeContentId(baseId, value) {\n return `${baseId}-content-${value}`;\n}\nvar Root2 = Tabs;\nvar List = TabsList;\nvar Trigger = TabsTrigger;\nvar Content = TabsContent;\nexport {\n Content,\n List,\n Root2 as Root,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n Trigger,\n createTabsScope\n};\n//# sourceMappingURL=index.mjs.map\n","import { cn } from \"@/lib/utils\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport React from \"react\";\n\nfunction Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {\n\treturn (\n\t\t<TabsPrimitive.Root\n\t\t\tdata-slot=\"tabs\"\n\t\t\tclassName={cn(\"flex flex-col gap-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tdata-slot=\"tabs-list\"\n\t\t\tclassName={cn(\n\t\t\t\t\"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n\treturn (\n\t\t<TabsPrimitive.Trigger\n\t\t\tdata-slot=\"tabs-trigger\"\n\t\t\tclassName={cn(\n\t\t\t\t\"data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/50 inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n\treturn (\n\t\t<TabsPrimitive.Content\n\t\t\tdata-slot=\"tabs-content\"\n\t\t\tclassName={cn(\"flex-1 outline-none\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n"],"names":["TABS_NAME","createTabsContext","createTabsScope","createContextScope","createRovingFocusGroupScope","useRovingFocusGroupScope","TabsProvider","useTabsContext","Tabs","React","forwardRef","props","forwardedRef","__scopeTabs","value","valueProp","onValueChange","defaultValue","orientation","dir","activationMode","tabsProps","direction","useDirection","setValue","useControllableState","prop","onChange","defaultProp","jsx","scope","baseId","useId","children","Primitive","div","ref","displayName","TAB_LIST_NAME","TabsList","loop","listProps","context","rovingFocusGroupScope","RovingFocusGroup.Root","asChild","role","TRIGGER_NAME","TabsTrigger","disabled","triggerProps","triggerId","makeTriggerId","contentId","makeContentId","isSelected","RovingFocusGroup.Item","focusable","active","button","type","id","onMouseDown","composeEventHandlers","event","ctrlKey","preventDefault","onKeyDown","includes","key","onFocus","isAutomaticActivation","CONTENT_NAME","TabsContent","forceMount","contentProps","isMountAnimationPreventedRef","useRef","useEffect","rAF","requestAnimationFrame","current","cancelAnimationFrame","Presence","present","hidden","tabIndex","style","animationDuration","Root","List","Trigger","Content","className","createElement","TabsPrimitive","data-slot","cn"],"mappings":"8oBAiBA,IAAMA,EAAY,QAGXC,EAAmBC,GAAmBC,EAAmBH,EAAW,CACzEI,IAEIC,EAA2BD,KAW1BE,EAAcC,GAAkBN,EAAoCD,GA6BrEQ,EAAaC,EAAAC,YACjB,CAACC,EAA+BC,KAC9B,MAAMC,YACJA,EACAC,MAAOC,EAAAC,cACPA,EAAAC,aACAA,EAAAC,YACAA,EAAc,aAAAC,IACdA,EAAAC,eACAA,EAAiB,eACdC,GACDV,EACEW,EAAYC,EAAaJ,IACxBL,EAAOU,GAAYC,EAAqB,CAC7CC,KAAMX,EACNY,SAAUX,EACVY,YAAaX,IAGf,OACEY,EAACvB,EAAA,CACCwB,MAAOjB,EACPkB,OAAQC,IACRlB,QACAE,cAAeQ,EACfN,cACAC,IAAKG,EACLF,iBAEAa,SAAAJ,EAACK,EAAUC,IAAV,CACChB,IAAKG,EACL,mBAAkBJ,KACdG,EACJe,IAAKxB,KACP,IAMRJ,EAAK6B,YAAcrC,EAMnB,IAAMsC,EAAgB,WAOhBC,EAAiB9B,EA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UAAWI,EAAG,sBAAuBJ,MACjClF,GAGP,CAEA,SAAS4B,GAASsD,UAAEA,KAAclF,IACjC,OACCF,EAAAqF,cAACC,EAAkB,CAClBC,YAAU,YACVH,UAAWI,EACV,sGACAJ,MAEGlF,GAGP,CAEA,SAASqC,GAAY6C,UAAEA,KAAclF,IACpC,OACCF,EAAAqF,cAACC,EAAqB,CACrBC,YAAU,eACVH,UAAWI,EACV,ioBACAJ,MAEGlF,GAGP,CAEA,SAAS8D,GAAYoB,UAAEA,KAAclF,IACpC,OACCF,EAAAqF,cAACC,EAAqB,CACrBC,YAAU,eACVH,UAAWI,EAAG,sBAAuBJ,MACjClF,GAGP","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.mjs","sources":["../../node_modules/@radix-ui/react-tabs/dist/index.mjs","../../src/components/ui/tabs/tabs.tsx"],"sourcesContent":["\"use client\";\n\n// src/tabs.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { createRovingFocusGroupScope } from \"@radix-ui/react-roving-focus\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport * as RovingFocusGroup from \"@radix-ui/react-roving-focus\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { jsx } from \"react/jsx-runtime\";\nvar TABS_NAME = \"Tabs\";\nvar [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [\n createRovingFocusGroupScope\n]);\nvar useRovingFocusGroupScope = createRovingFocusGroupScope();\nvar [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);\nvar Tabs = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeTabs,\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation = \"horizontal\",\n dir,\n activationMode = \"automatic\",\n ...tabsProps\n } = props;\n const direction = useDirection(dir);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n defaultProp: defaultValue ?? \"\",\n caller: TABS_NAME\n });\n return /* @__PURE__ */ jsx(\n TabsProvider,\n {\n scope: __scopeTabs,\n baseId: useId(),\n value,\n onValueChange: setValue,\n orientation,\n dir: direction,\n activationMode,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n dir: direction,\n \"data-orientation\": orientation,\n ...tabsProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\nTabs.displayName = TABS_NAME;\nvar TAB_LIST_NAME = \"TabsList\";\nvar TabsList = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTabs, loop = true, ...listProps } = props;\n const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);\n return /* @__PURE__ */ jsx(\n RovingFocusGroup.Root,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n orientation: context.orientation,\n dir: context.dir,\n loop,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"tablist\",\n \"aria-orientation\": context.orientation,\n ...listProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\nTabsList.displayName = TAB_LIST_NAME;\nvar TRIGGER_NAME = \"TabsTrigger\";\nvar TabsTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTabs, value, disabled = false, ...triggerProps } = props;\n const context = useTabsContext(TRIGGER_NAME, __scopeTabs);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);\n const triggerId = makeTriggerId(context.baseId, value);\n const contentId = makeContentId(context.baseId, value);\n const isSelected = value === context.value;\n return /* @__PURE__ */ jsx(\n RovingFocusGroup.Item,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n focusable: !disabled,\n active: isSelected,\n children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n role: \"tab\",\n \"aria-selected\": isSelected,\n \"aria-controls\": contentId,\n \"data-state\": isSelected ? \"active\" : \"inactive\",\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n id: triggerId,\n ...triggerProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onValueChange(value);\n } else {\n event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if ([\" \", \"Enter\"].includes(event.key)) context.onValueChange(value);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => {\n const isAutomaticActivation = context.activationMode !== \"manual\";\n if (!isSelected && !disabled && isAutomaticActivation) {\n context.onValueChange(value);\n }\n })\n }\n )\n }\n );\n }\n);\nTabsTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"TabsContent\";\nvar TabsContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTabs, value, forceMount, children, ...contentProps } = props;\n const context = useTabsContext(CONTENT_NAME, __scopeTabs);\n const triggerId = makeTriggerId(context.baseId, value);\n const contentId = makeContentId(context.baseId, value);\n const isSelected = value === context.value;\n const isMountAnimationPreventedRef = React.useRef(isSelected);\n React.useEffect(() => {\n const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);\n return () => cancelAnimationFrame(rAF);\n }, []);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": isSelected ? \"active\" : \"inactive\",\n \"data-orientation\": context.orientation,\n role: \"tabpanel\",\n \"aria-labelledby\": triggerId,\n hidden: !present,\n id: contentId,\n tabIndex: 0,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...props.style,\n animationDuration: isMountAnimationPreventedRef.current ? \"0s\" : void 0\n },\n children: present && children\n }\n ) });\n }\n);\nTabsContent.displayName = CONTENT_NAME;\nfunction makeTriggerId(baseId, value) {\n return `${baseId}-trigger-${value}`;\n}\nfunction makeContentId(baseId, value) {\n return `${baseId}-content-${value}`;\n}\nvar Root2 = Tabs;\nvar List = TabsList;\nvar Trigger = TabsTrigger;\nvar Content = TabsContent;\nexport {\n Content,\n List,\n Root2 as Root,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n Trigger,\n createTabsScope\n};\n//# sourceMappingURL=index.mjs.map\n","import { cn } from \"@/lib/utils\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport React from \"react\";\n\nfunction Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {\n\treturn (\n\t\t<TabsPrimitive.Root\n\t\t\tdata-slot=\"tabs\"\n\t\t\tclassName={cn(\"flex flex-col gap-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tdata-slot=\"tabs-list\"\n\t\t\tclassName={cn(\n\t\t\t\t\"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n\treturn (\n\t\t<TabsPrimitive.Trigger\n\t\t\tdata-slot=\"tabs-trigger\"\n\t\t\tclassName={cn(\n\t\t\t\t\"data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/50 inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n\treturn (\n\t\t<TabsPrimitive.Content\n\t\t\tdata-slot=\"tabs-content\"\n\t\t\tclassName={cn(\"flex-1 outline-none\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n"],"names":["TABS_NAME","createTabsContext","createTabsScope","createContextScope","createRovingFocusGroupScope","useRovingFocusGroupScope","TabsProvider","useTabsContext","Tabs","React","forwardRef","props","forwardedRef","__scopeTabs","value","valueProp","onValueChange","defaultValue","orientation","dir","activationMode","tabsProps","direction","useDirection","setValue","useControllableState","prop","onChange","defaultProp","caller","jsx","scope","baseId","useId","children","Primitive","div","ref","displayName","TAB_LIST_NAME","TabsList","loop","listProps","context","rovingFocusGroupScope","RovingFocusGroup.Root","asChild","role","TRIGGER_NAME","TabsTrigger","disabled","triggerProps","triggerId","makeTriggerId","contentId","makeContentId","isSelected","RovingFocusGroup.Item","focusable","active","button","type","id","onMouseDown","composeEventHandlers","event","ctrlKey","preventDefault","onKeyDown","includes","key","onFocus","isAutomaticActivation","CONTENT_NAME","TabsContent","forceMount","contentProps","isMountAnimationPreventedRef","useRef","useEffect","rAF","requestAnimationFrame","current","cancelAnimationFrame","Presence","present","hidden","tabIndex","style","animationDuration","Root","List","Trigger","Content","className","createElement","TabsPrimitive","data-slot","cn"],"mappings":"mrBAiBA,IAAMA,EAAY,QAGXC,EAAmBC,GAAmBC,EAAmBH,EAAW,CACzEI,IAEIC,EAA2BD,KAW1BE,EAAcC,GAAkBN,EAAoCD,GA6BrEQ,EAAaC,EAAAC,YACjB,CAACC,EAA+BC,KAC9B,MAAMC,YACJA,EACAC,MAAOC,EAAAC,cACPA,EAAAC,aACAA,EAAAC,YACAA,EAAc,aAAAC,IACdA,EAAAC,eACAA,EAAiB,eACdC,GACDV,EACEW,EAAYC,EA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QAAU,UAAO,GAGlEhD,SAAAmD,GAAWnD,KAGlB,IASN,SAASmB,EAAcrB,EAAgBlB,GACrC,MAAO,GAAGkB,aAAkBlB,GAC9B,CAEA,SAASyC,EAAcvB,EAAgBlB,GACrC,MAAO,GAAGkB,aAAkBlB,GAC9B,CAVA4D,EAAYpC,YAAcmC,EAY1B,IAAMiB,EAAOlF,EACPmF,EAAOnD,EACPoD,EAAU3C,EACV4C,EAAUnB,ECtRhB,SAASlE,GAAKsF,UAAEA,KAAcnF,IAC7B,OACCF,EAAAsF,cAACC,EAAkB,CAClBC,YAAU,OACVH,UAAWI,EAAG,sBAAuBJ,MACjCnF,GAGP,CAEA,SAAS6B,GAASsD,UAAEA,KAAcnF,IACjC,OACCF,EAAAsF,cAACC,EAAkB,CAClBC,YAAU,YACVH,UAAWI,EACV,sGACAJ,MAEGnF,GAGP,CAEA,SAASsC,GAAY6C,UAAEA,KAAcnF,IACpC,OACCF,EAAAsF,cAACC,EAAqB,CACrBC,YAAU,eACVH,UAAWI,EACV,ioBACAJ,MAEGnF,GAGP,CAEA,SAAS+D,GAAYoB,UAAEA,KAAcnF,IACpC,OACCF,EAAAsF,cAACC,EAAqB,CACrBC,YAAU,eACVH,UAAWI,EAAG,sBAAuBJ,MACjCnF,GAGP","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{c as e}from"../chunks/utils-B9uwc_lt.mjs";import*as t from"react";import r from"react";import*as o from"react-dom";import{u as n,P as s,c as a}from"../chunks/index-IXx8l3RV.mjs";import{createCollection as i}from"@radix-ui/react-collection";import{c}from"../chunks/index-BX6nSpY1.mjs";import{B as d,R as u,P as l}from"../chunks/index-DZldl4eo.mjs";import{P as p,d as f}from"../chunks/index-BSf-atXx.mjs";import{u as m,a as v}from"../chunks/index-DuMyb05s.mjs";import{u as w}from"../chunks/index-DyUn0c26.mjs";import{V as h}from"../chunks/index-CUXMuJ__.mjs";import{jsx as x,jsxs as y,Fragment as g}from"react/jsx-runtime";import{cva as E}from"class-variance-authority";import{X as T}from"../chunks/x-Bdqqbrz4.mjs";import"../chunks/bundle-mjs-BYGwPY3j.mjs";import"@radix-ui/react-slot";import"../chunks/createLucideIcon-CkKdyF_L.mjs";var b="ToastProvider",[C,P,R]=i("Toast"),[N,k]=c("Toast",[R]),[D,L]=N(b),S=e=>{const{__scopeToast:r,label:o="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:i}=e,[c,d]=t.useState(null),[u,l]=t.useState(0),p=t.useRef(!1),f=t.useRef(!1);return o.trim(),x(C.Provider,{scope:r,children:x(D,{scope:r,label:o,duration:n,swipeDirection:s,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:d,onToastAdd:t.useCallback((()=>l((e=>e+1))),[]),onToastRemove:t.useCallback((()=>l((e=>e-1))),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:f,children:i})})};S.displayName=b;var _="ToastViewport",F=["F8"],A="toast.viewportPause",I="toast.viewportResume",j=t.forwardRef(((e,r)=>{const{__scopeToast:o,hotkey:s=F,label:a="Notifications ({hotkey})",...i}=e,c=L(_,o),u=P(o),l=t.useRef(null),f=t.useRef(null),m=t.useRef(null),v=t.useRef(null),w=n(r,v,c.onViewportChange),h=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=c.toastCount>0;t.useEffect((()=>{const e=e=>{0!==s.length&&s.every((t=>e[t]||e.code===t))&&v.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[s]),t.useEffect((()=>{const e=l.current,t=v.current;if(g&&e&&t){const r=()=>{if(!c.isClosePausedRef.current){const e=new CustomEvent(A);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},o=()=>{if(c.isClosePausedRef.current){const e=new CustomEvent(I);t.dispatchEvent(e),c.isClosePausedRef.current=!1}},n=t=>{!e.contains(t.relatedTarget)&&o()},s=()=>{e.contains(document.activeElement)||o()};return e.addEventListener("focusin",r),e.addEventListener("focusout",n),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",o),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",n),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",o)}}}),[g,c.isClosePausedRef]);const E=t.useCallback((({tabbingDirection:e})=>{const t=u().map((t=>{const r=t.ref.current,o=[r,...ee(r)];return"forwards"===e?o:o.reverse()}));return("forwards"===e?t.reverse():t).flat()}),[u]);return t.useEffect((()=>{const e=v.current;if(e){const t=t=>{const r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){const r=document.activeElement,o=t.shiftKey;if(t.target===e&&o)return void f.current?.focus();const n=E({tabbingDirection:o?"backwards":"forwards"}),s=n.findIndex((e=>e===r));te(n.slice(s+1))?t.preventDefault():o?f.current?.focus():m.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}}),[u,E]),y(d,{ref:l,role:"region","aria-label":a.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&x(K,{ref:f,onFocusFromOutsideViewport:()=>{te(E({tabbingDirection:"forwards"}))}}),x(C.Slot,{scope:o,children:x(p.ol,{tabIndex:-1,...i,ref:w})}),g&&x(K,{ref:m,onFocusFromOutsideViewport:()=>{te(E({tabbingDirection:"backwards"}))}})]})}));j.displayName=_;var M="ToastFocusProxy",K=t.forwardRef(((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:o,...n}=e,s=L(M,r);return x(h,{"aria-hidden":!0,tabIndex:0,...n,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&o()}})}));K.displayName=M;var O="Toast",V=t.forwardRef(((e,t)=>{const{forceMount:r,open:o,defaultOpen:n,onOpenChange:i,...c}=e,[d=!0,u]=w({prop:o,defaultProp:n,onChange:i});return x(s,{present:r||d,children:x(X,{open:d,...c,ref:t,onClose:()=>u(!1),onPause:m(e.onPause),onResume:m(e.onResume),onSwipeStart:a(e.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:a(e.onSwipeMove,(e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${r}px`)})),onSwipeCancel:a(e.onSwipeCancel,(e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")})),onSwipeEnd:a(e.onSwipeEnd,(e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${r}px`),u(!1)}))})})}));V.displayName=O;var[$,U]=N(O,{onClose(){}}),X=t.forwardRef(((e,r)=>{const{__scopeToast:s,type:i="foreground",duration:c,open:d,onClose:l,onEscapeKeyDown:f,onPause:v,onResume:w,onSwipeStart:h,onSwipeMove:E,onSwipeCancel:T,onSwipeEnd:b,...P}=e,R=L(O,s),[N,k]=t.useState(null),D=n(r,(e=>k(e))),S=t.useRef(null),_=t.useRef(null),F=c||R.duration,j=t.useRef(0),M=t.useRef(F),K=t.useRef(0),{onToastAdd:V,onToastRemove:U}=R,X=m((()=>{const e=N?.contains(document.activeElement);e&&R.viewport?.focus(),l()})),B=t.useCallback((e=>{e&&e!==1/0&&(window.clearTimeout(K.current),j.current=(new Date).getTime(),K.current=window.setTimeout(X,e))}),[X]);t.useEffect((()=>{const e=R.viewport;if(e){const t=()=>{B(M.current),w?.()},r=()=>{const e=(new Date).getTime()-j.current;M.current=M.current-e,window.clearTimeout(K.current),v?.()};return e.addEventListener(A,r),e.addEventListener(I,t),()=>{e.removeEventListener(A,r),e.removeEventListener(I,t)}}}),[R.viewport,F,v,w,B]),t.useEffect((()=>{d&&!R.isClosePausedRef.current&&B(F)}),[d,F,R.isClosePausedRef,B]),t.useEffect((()=>(V(),()=>U())),[V,U]);const H=t.useMemo((()=>N?J(N):null),[N]);return R.viewport?y(g,{children:[H&&x(q,{__scopeToast:s,role:"status","aria-live":"foreground"===i?"assertive":"polite","aria-atomic":!0,children:H}),x($,{scope:s,onClose:X,children:o.createPortal(x(C.ItemSlot,{scope:s,children:x(u,{asChild:!0,onEscapeKeyDown:a(f,(()=>{R.isFocusedToastEscapeKeyDownRef.current||X(),R.isFocusedToastEscapeKeyDownRef.current=!1})),children:x(p.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":d?"open":"closed","data-swipe-direction":R.swipeDirection,...P,ref:D,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:a(e.onKeyDown,(e=>{"Escape"===e.key&&(f?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(R.isFocusedToastEscapeKeyDownRef.current=!0,X()))})),onPointerDown:a(e.onPointerDown,(e=>{0===e.button&&(S.current={x:e.clientX,y:e.clientY})})),onPointerMove:a(e.onPointerMove,(e=>{if(!S.current)return;const t=e.clientX-S.current.x,r=e.clientY-S.current.y,o=Boolean(_.current),n=["left","right"].includes(R.swipeDirection),s=["left","up"].includes(R.swipeDirection)?Math.min:Math.max,a=n?s(0,t):0,i=n?0:s(0,r),c="touch"===e.pointerType?10:2,d={x:a,y:i},u={originalEvent:e,delta:d};o?(_.current=d,Q("toast.swipeMove",E,u,{discrete:!1})):Z(d,R.swipeDirection,c)?(_.current=d,Q("toast.swipeStart",h,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(r)>c)&&(S.current=null)})),onPointerUp:a(e.onPointerUp,(e=>{const t=_.current,r=e.target;if(r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),_.current=null,S.current=null,t){const r=e.currentTarget,o={originalEvent:e,delta:t};Z(t,R.swipeDirection,R.swipeThreshold)?Q("toast.swipeEnd",b,o,{discrete:!0}):Q("toast.swipeCancel",T,o,{discrete:!0}),r.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})})}),R.viewport)})]}):null})),q=e=>{const{__scopeToast:r,children:o,...n}=e,s=L(O,r),[a,i]=t.useState(!1),[c,d]=t.useState(!1);return function(e=()=>{}){const t=m(e);v((()=>{let e=0,r=0;return e=window.requestAnimationFrame((()=>r=window.requestAnimationFrame(t))),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(r)}}),[t])}((()=>i(!0))),t.useEffect((()=>{const e=window.setTimeout((()=>d(!0)),1e3);return()=>window.clearTimeout(e)}),[]),c?null:x(l,{asChild:!0,children:x(h,{...n,children:a&&y(g,{children:[s.label," ",o]})})})},B=t.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e;return x(p.div,{...o,ref:t})}));B.displayName="ToastTitle";var H=t.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e;return x(p.div,{...o,ref:t})}));H.displayName="ToastDescription";var W=t.forwardRef(((e,t)=>{const{altText:r,...o}=e;return r.trim()?x(G,{altText:r,asChild:!0,children:x(z,{...o,ref:t})}):null}));W.displayName="ToastAction";var Y="ToastClose",z=t.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e,n=U(Y,r);return x(G,{asChild:!0,children:x(p.button,{type:"button",...o,ref:t,onClick:a(e.onClick,n.onClose)})})}));z.displayName=Y;var G=t.forwardRef(((e,t)=>{const{__scopeToast:r,altText:o,...n}=e;return x(p.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...n,ref:t})}));function J(e){const t=[];return Array.from(e.childNodes).forEach((e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const r=e.ariaHidden||e.hidden||"none"===e.style.display,o=""===e.dataset.radixToastAnnounceExclude;if(!r)if(o){const r=e.dataset.radixToastAnnounceAlt;r&&t.push(r)}else t.push(...J(e))}})),t}function Q(e,t,r,{discrete:o}){const n=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?f(n,s):n.dispatchEvent(s)}var Z=(e,t,r=0)=>{const o=Math.abs(e.x),n=Math.abs(e.y),s=o>n;return"left"===t||"right"===t?s&&o>r:!s&&n>r};function ee(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function te(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}var re=j,oe=V,ne=B,se=H,ae=W,ie=z;const ce=S,de=({className:t,...o})=>r.createElement(re,{"data-slot":"toast-viewport",className:e("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]",t),...o}),ue=E("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive-foreground bg-destructive-foreground text-destructive border-destructive"}},defaultVariants:{variant:"default"}}),le=({className:t,variant:o,...n})=>r.createElement(oe,{"data-slot":"toast-root",className:e(ue({variant:o}),t),...n}),pe=({className:t,...o})=>r.createElement(ae,{"data-slot":"toast-action",className:e("ring-offset-background hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none disabled:opacity-50",t),...o}),fe=({className:t,...o})=>r.createElement(ie,{"data-slot":"toast-close",className:e("text-foreground/50 hover:text-foreground absolute top-2 right-2 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-2 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...o},r.createElement(T,{className:"h-4 w-4"})),me=({className:t,...o})=>r.createElement(ne,{"data-slot":"toast-title",className:e("text-sm font-semibold",t),...o}),ve=({className:t,...o})=>r.createElement(se,{"data-slot":"toast-description",className:e("text-sm opacity-90",t),...o});export{le as Toast,pe as ToastAction,fe as ToastClose,ve as ToastDescription,ce as ToastProvider,me as ToastTitle,de as ToastViewport};
1
+ import{c as e}from"../chunks/utils-BDlXiHS3.mjs";import*as t from"react";import r from"react";import*as o from"react-dom";import{u as n,P as s,c as a}from"../chunks/index-BE7U1lz3.mjs";import{createCollection as i}from"@radix-ui/react-collection";import{c}from"../chunks/index-BOtb6ofV.mjs";import{B as d,R as u,P as l}from"../chunks/index-D1WqwlXc.mjs";import{P as p,d as m}from"../chunks/index-BEeVpO2_.mjs";import{u as f}from"../chunks/index-DspU1Pyo.mjs";import{u as v}from"../chunks/index-mlVBNiql.mjs";import{u as w}from"../chunks/index-CIfe3UIG.mjs";import{V as h}from"../chunks/index-k-LDQli2.mjs";import{jsx as x,jsxs as y,Fragment as g}from"react/jsx-runtime";import{cva as E}from"class-variance-authority";import{X as T}from"../chunks/x-BIoR0tgq.mjs";import"../chunks/bundle-mjs-Dthp4wMi.mjs";import"@radix-ui/react-slot";import"../chunks/createLucideIcon-BPtXaGDX.mjs";var b="ToastProvider",[C,P,R]=i("Toast"),[N,k]=c("Toast",[R]),[D,L]=N(b),S=e=>{const{__scopeToast:r,label:o="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:i}=e,[c,d]=t.useState(null),[u,l]=t.useState(0),p=t.useRef(!1),m=t.useRef(!1);return o.trim(),x(C.Provider,{scope:r,children:x(D,{scope:r,label:o,duration:n,swipeDirection:s,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:d,onToastAdd:t.useCallback((()=>l((e=>e+1))),[]),onToastRemove:t.useCallback((()=>l((e=>e-1))),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:i})})};S.displayName=b;var _="ToastViewport",F=["F8"],j="toast.viewportPause",A="toast.viewportResume",I=t.forwardRef(((e,r)=>{const{__scopeToast:o,hotkey:s=F,label:a="Notifications ({hotkey})",...i}=e,c=L(_,o),u=P(o),l=t.useRef(null),m=t.useRef(null),f=t.useRef(null),v=t.useRef(null),w=n(r,v,c.onViewportChange),h=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=c.toastCount>0;t.useEffect((()=>{const e=e=>{0!==s.length&&s.every((t=>e[t]||e.code===t))&&v.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[s]),t.useEffect((()=>{const e=l.current,t=v.current;if(g&&e&&t){const r=()=>{if(!c.isClosePausedRef.current){const e=new CustomEvent(j);t.dispatchEvent(e),c.isClosePausedRef.current=!0}},o=()=>{if(c.isClosePausedRef.current){const e=new CustomEvent(A);t.dispatchEvent(e),c.isClosePausedRef.current=!1}},n=t=>{!e.contains(t.relatedTarget)&&o()},s=()=>{e.contains(document.activeElement)||o()};return e.addEventListener("focusin",r),e.addEventListener("focusout",n),e.addEventListener("pointermove",r),e.addEventListener("pointerleave",s),window.addEventListener("blur",r),window.addEventListener("focus",o),()=>{e.removeEventListener("focusin",r),e.removeEventListener("focusout",n),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",s),window.removeEventListener("blur",r),window.removeEventListener("focus",o)}}}),[g,c.isClosePausedRef]);const E=t.useCallback((({tabbingDirection:e})=>{const t=u().map((t=>{const r=t.ref.current,o=[r,...ee(r)];return"forwards"===e?o:o.reverse()}));return("forwards"===e?t.reverse():t).flat()}),[u]);return t.useEffect((()=>{const e=v.current;if(e){const t=t=>{const r=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!r){const r=document.activeElement,o=t.shiftKey;if(t.target===e&&o)return void m.current?.focus();const n=E({tabbingDirection:o?"backwards":"forwards"}),s=n.findIndex((e=>e===r));te(n.slice(s+1))?t.preventDefault():o?m.current?.focus():f.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}}),[u,E]),y(d,{ref:l,role:"region","aria-label":a.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&x(K,{ref:m,onFocusFromOutsideViewport:()=>{te(E({tabbingDirection:"forwards"}))}}),x(C.Slot,{scope:o,children:x(p.ol,{tabIndex:-1,...i,ref:w})}),g&&x(K,{ref:f,onFocusFromOutsideViewport:()=>{te(E({tabbingDirection:"backwards"}))}})]})}));I.displayName=_;var M="ToastFocusProxy",K=t.forwardRef(((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:o,...n}=e,s=L(M,r);return x(h,{"aria-hidden":!0,tabIndex:0,...n,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&o()}})}));K.displayName=M;var O="Toast",V=t.forwardRef(((e,t)=>{const{forceMount:r,open:o,defaultOpen:n,onOpenChange:i,...c}=e,[d,u]=v({prop:o,defaultProp:n??!0,onChange:i,caller:O});return x(s,{present:r||d,children:x(X,{open:d,...c,ref:t,onClose:()=>u(!1),onPause:f(e.onPause),onResume:f(e.onResume),onSwipeStart:a(e.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:a(e.onSwipeMove,(e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${r}px`)})),onSwipeCancel:a(e.onSwipeCancel,(e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")})),onSwipeEnd:a(e.onSwipeEnd,(e=>{const{x:t,y:r}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${r}px`),u(!1)}))})})}));V.displayName=O;var[$,U]=N(O,{onClose(){}}),X=t.forwardRef(((e,r)=>{const{__scopeToast:s,type:i="foreground",duration:c,open:d,onClose:l,onEscapeKeyDown:m,onPause:v,onResume:w,onSwipeStart:h,onSwipeMove:E,onSwipeCancel:T,onSwipeEnd:b,...P}=e,R=L(O,s),[N,k]=t.useState(null),D=n(r,(e=>k(e))),S=t.useRef(null),_=t.useRef(null),F=c||R.duration,I=t.useRef(0),M=t.useRef(F),K=t.useRef(0),{onToastAdd:V,onToastRemove:U}=R,X=f((()=>{const e=N?.contains(document.activeElement);e&&R.viewport?.focus(),l()})),B=t.useCallback((e=>{e&&e!==1/0&&(window.clearTimeout(K.current),I.current=(new Date).getTime(),K.current=window.setTimeout(X,e))}),[X]);t.useEffect((()=>{const e=R.viewport;if(e){const t=()=>{B(M.current),w?.()},r=()=>{const e=(new Date).getTime()-I.current;M.current=M.current-e,window.clearTimeout(K.current),v?.()};return e.addEventListener(j,r),e.addEventListener(A,t),()=>{e.removeEventListener(j,r),e.removeEventListener(A,t)}}}),[R.viewport,F,v,w,B]),t.useEffect((()=>{d&&!R.isClosePausedRef.current&&B(F)}),[d,F,R.isClosePausedRef,B]),t.useEffect((()=>(V(),()=>U())),[V,U]);const H=t.useMemo((()=>N?J(N):null),[N]);return R.viewport?y(g,{children:[H&&x(q,{__scopeToast:s,role:"status","aria-live":"foreground"===i?"assertive":"polite","aria-atomic":!0,children:H}),x($,{scope:s,onClose:X,children:o.createPortal(x(C.ItemSlot,{scope:s,children:x(u,{asChild:!0,onEscapeKeyDown:a(m,(()=>{R.isFocusedToastEscapeKeyDownRef.current||X(),R.isFocusedToastEscapeKeyDownRef.current=!1})),children:x(p.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":d?"open":"closed","data-swipe-direction":R.swipeDirection,...P,ref:D,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:a(e.onKeyDown,(e=>{"Escape"===e.key&&(m?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(R.isFocusedToastEscapeKeyDownRef.current=!0,X()))})),onPointerDown:a(e.onPointerDown,(e=>{0===e.button&&(S.current={x:e.clientX,y:e.clientY})})),onPointerMove:a(e.onPointerMove,(e=>{if(!S.current)return;const t=e.clientX-S.current.x,r=e.clientY-S.current.y,o=Boolean(_.current),n=["left","right"].includes(R.swipeDirection),s=["left","up"].includes(R.swipeDirection)?Math.min:Math.max,a=n?s(0,t):0,i=n?0:s(0,r),c="touch"===e.pointerType?10:2,d={x:a,y:i},u={originalEvent:e,delta:d};o?(_.current=d,Q("toast.swipeMove",E,u,{discrete:!1})):Z(d,R.swipeDirection,c)?(_.current=d,Q("toast.swipeStart",h,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(r)>c)&&(S.current=null)})),onPointerUp:a(e.onPointerUp,(e=>{const t=_.current,r=e.target;if(r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),_.current=null,S.current=null,t){const r=e.currentTarget,o={originalEvent:e,delta:t};Z(t,R.swipeDirection,R.swipeThreshold)?Q("toast.swipeEnd",b,o,{discrete:!0}):Q("toast.swipeCancel",T,o,{discrete:!0}),r.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})})}),R.viewport)})]}):null})),q=e=>{const{__scopeToast:r,children:o,...n}=e,s=L(O,r),[a,i]=t.useState(!1),[c,d]=t.useState(!1);return function(e=()=>{}){const t=f(e);w((()=>{let e=0,r=0;return e=window.requestAnimationFrame((()=>r=window.requestAnimationFrame(t))),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(r)}}),[t])}((()=>i(!0))),t.useEffect((()=>{const e=window.setTimeout((()=>d(!0)),1e3);return()=>window.clearTimeout(e)}),[]),c?null:x(l,{asChild:!0,children:x(h,{...n,children:a&&y(g,{children:[s.label," ",o]})})})},B=t.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e;return x(p.div,{...o,ref:t})}));B.displayName="ToastTitle";var H=t.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e;return x(p.div,{...o,ref:t})}));H.displayName="ToastDescription";var W=t.forwardRef(((e,t)=>{const{altText:r,...o}=e;return r.trim()?x(G,{altText:r,asChild:!0,children:x(z,{...o,ref:t})}):null}));W.displayName="ToastAction";var Y="ToastClose",z=t.forwardRef(((e,t)=>{const{__scopeToast:r,...o}=e,n=U(Y,r);return x(G,{asChild:!0,children:x(p.button,{type:"button",...o,ref:t,onClick:a(e.onClick,n.onClose)})})}));z.displayName=Y;var G=t.forwardRef(((e,t)=>{const{__scopeToast:r,altText:o,...n}=e;return x(p.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...n,ref:t})}));function J(e){const t=[];return Array.from(e.childNodes).forEach((e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const r=e.ariaHidden||e.hidden||"none"===e.style.display,o=""===e.dataset.radixToastAnnounceExclude;if(!r)if(o){const r=e.dataset.radixToastAnnounceAlt;r&&t.push(r)}else t.push(...J(e))}})),t}function Q(e,t,r,{discrete:o}){const n=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?m(n,s):n.dispatchEvent(s)}var Z=(e,t,r=0)=>{const o=Math.abs(e.x),n=Math.abs(e.y),s=o>n;return"left"===t||"right"===t?s&&o>r:!s&&n>r};function ee(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function te(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}var re=I,oe=V,ne=B,se=H,ae=W,ie=z;const ce=S,de=({className:t,...o})=>r.createElement(re,{"data-slot":"toast-viewport",className:e("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]",t),...o}),ue=E("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive-foreground bg-destructive-foreground text-destructive border-destructive"}},defaultVariants:{variant:"default"}}),le=({className:t,variant:o,...n})=>r.createElement(oe,{"data-slot":"toast-root",className:e(ue({variant:o}),t),...n}),pe=({className:t,...o})=>r.createElement(ae,{"data-slot":"toast-action",className:e("ring-offset-background hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none disabled:opacity-50",t),...o}),me=({className:t,...o})=>r.createElement(ie,{"data-slot":"toast-close",className:e("text-foreground/50 hover:text-foreground absolute top-2 right-2 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-2 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...o},r.createElement(T,{className:"h-4 w-4"})),fe=({className:t,...o})=>r.createElement(ne,{"data-slot":"toast-title",className:e("text-sm font-semibold",t),...o}),ve=({className:t,...o})=>r.createElement(se,{"data-slot":"toast-description",className:e("text-sm opacity-90",t),...o});export{le as Toast,pe as ToastAction,me as ToastClose,ve as ToastDescription,ce as ToastProvider,fe as ToastTitle,de as ToastViewport};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../node_modules/@radix-ui/react-toast/dist/index.mjs","../../src/components/ui/toast/toast.tsx"],"sourcesContent":["\"use client\";\n\n// packages/react/toast/src/toast.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport * as DismissableLayer from \"@radix-ui/react-dismissable-layer\";\nimport { Portal } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { VisuallyHidden } from \"@radix-ui/react-visually-hidden\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar PROVIDER_NAME = \"ToastProvider\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(\"Toast\");\nvar [createToastContext, createToastScope] = createContextScope(\"Toast\", [createCollectionScope]);\nvar [ToastProviderProvider, useToastProviderContext] = createToastContext(PROVIDER_NAME);\nvar ToastProvider = (props) => {\n const {\n __scopeToast,\n label = \"Notification\",\n duration = 5e3,\n swipeDirection = \"right\",\n swipeThreshold = 50,\n children\n } = props;\n const [viewport, setViewport] = React.useState(null);\n const [toastCount, setToastCount] = React.useState(0);\n const isFocusedToastEscapeKeyDownRef = React.useRef(false);\n const isClosePausedRef = React.useRef(false);\n if (!label.trim()) {\n console.error(\n `Invalid prop \\`label\\` supplied to \\`${PROVIDER_NAME}\\`. Expected non-empty \\`string\\`.`\n );\n }\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: __scopeToast, children: /* @__PURE__ */ jsx(\n ToastProviderProvider,\n {\n scope: __scopeToast,\n label,\n duration,\n swipeDirection,\n swipeThreshold,\n toastCount,\n viewport,\n onViewportChange: setViewport,\n onToastAdd: React.useCallback(() => setToastCount((prevCount) => prevCount + 1), []),\n onToastRemove: React.useCallback(() => setToastCount((prevCount) => prevCount - 1), []),\n isFocusedToastEscapeKeyDownRef,\n isClosePausedRef,\n children\n }\n ) });\n};\nToastProvider.displayName = PROVIDER_NAME;\nvar VIEWPORT_NAME = \"ToastViewport\";\nvar VIEWPORT_DEFAULT_HOTKEY = [\"F8\"];\nvar VIEWPORT_PAUSE = \"toast.viewportPause\";\nvar VIEWPORT_RESUME = \"toast.viewportResume\";\nvar ToastViewport = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeToast,\n hotkey = VIEWPORT_DEFAULT_HOTKEY,\n label = \"Notifications ({hotkey})\",\n ...viewportProps\n } = props;\n const context = useToastProviderContext(VIEWPORT_NAME, __scopeToast);\n const getItems = useCollection(__scopeToast);\n const wrapperRef = React.useRef(null);\n const headFocusProxyRef = React.useRef(null);\n const tailFocusProxyRef = React.useRef(null);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);\n const hotkeyLabel = hotkey.join(\"+\").replace(/Key/g, \"\").replace(/Digit/g, \"\");\n const hasToasts = context.toastCount > 0;\n React.useEffect(() => {\n const handleKeyDown = (event) => {\n const isHotkeyPressed = hotkey.length !== 0 && hotkey.every((key) => event[key] || event.code === key);\n if (isHotkeyPressed) ref.current?.focus();\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [hotkey]);\n React.useEffect(() => {\n const wrapper = wrapperRef.current;\n const viewport = ref.current;\n if (hasToasts && wrapper && viewport) {\n const handlePause = () => {\n if (!context.isClosePausedRef.current) {\n const pauseEvent = new CustomEvent(VIEWPORT_PAUSE);\n viewport.dispatchEvent(pauseEvent);\n context.isClosePausedRef.current = true;\n }\n };\n const handleResume = () => {\n if (context.isClosePausedRef.current) {\n const resumeEvent = new CustomEvent(VIEWPORT_RESUME);\n viewport.dispatchEvent(resumeEvent);\n context.isClosePausedRef.current = false;\n }\n };\n const handleFocusOutResume = (event) => {\n const isFocusMovingOutside = !wrapper.contains(event.relatedTarget);\n if (isFocusMovingOutside) handleResume();\n };\n const handlePointerLeaveResume = () => {\n const isFocusInside = wrapper.contains(document.activeElement);\n if (!isFocusInside) handleResume();\n };\n wrapper.addEventListener(\"focusin\", handlePause);\n wrapper.addEventListener(\"focusout\", handleFocusOutResume);\n wrapper.addEventListener(\"pointermove\", handlePause);\n wrapper.addEventListener(\"pointerleave\", handlePointerLeaveResume);\n window.addEventListener(\"blur\", handlePause);\n window.addEventListener(\"focus\", handleResume);\n return () => {\n wrapper.removeEventListener(\"focusin\", handlePause);\n wrapper.removeEventListener(\"focusout\", handleFocusOutResume);\n wrapper.removeEventListener(\"pointermove\", handlePause);\n wrapper.removeEventListener(\"pointerleave\", handlePointerLeaveResume);\n window.removeEventListener(\"blur\", handlePause);\n window.removeEventListener(\"focus\", handleResume);\n };\n }\n }, [hasToasts, context.isClosePausedRef]);\n const getSortedTabbableCandidates = React.useCallback(\n ({ tabbingDirection }) => {\n const toastItems = getItems();\n const tabbableCandidates = toastItems.map((toastItem) => {\n const toastNode = toastItem.ref.current;\n const toastTabbableCandidates = [toastNode, ...getTabbableCandidates(toastNode)];\n return tabbingDirection === \"forwards\" ? toastTabbableCandidates : toastTabbableCandidates.reverse();\n });\n return (tabbingDirection === \"forwards\" ? tabbableCandidates.reverse() : tabbableCandidates).flat();\n },\n [getItems]\n );\n React.useEffect(() => {\n const viewport = ref.current;\n if (viewport) {\n const handleKeyDown = (event) => {\n const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;\n const isTabKey = event.key === \"Tab\" && !isMetaKey;\n if (isTabKey) {\n const focusedElement = document.activeElement;\n const isTabbingBackwards = event.shiftKey;\n const targetIsViewport = event.target === viewport;\n if (targetIsViewport && isTabbingBackwards) {\n headFocusProxyRef.current?.focus();\n return;\n }\n const tabbingDirection = isTabbingBackwards ? \"backwards\" : \"forwards\";\n const sortedCandidates = getSortedTabbableCandidates({ tabbingDirection });\n const index = sortedCandidates.findIndex((candidate) => candidate === focusedElement);\n if (focusFirst(sortedCandidates.slice(index + 1))) {\n event.preventDefault();\n } else {\n isTabbingBackwards ? headFocusProxyRef.current?.focus() : tailFocusProxyRef.current?.focus();\n }\n }\n };\n viewport.addEventListener(\"keydown\", handleKeyDown);\n return () => viewport.removeEventListener(\"keydown\", handleKeyDown);\n }\n }, [getItems, getSortedTabbableCandidates]);\n return /* @__PURE__ */ jsxs(\n DismissableLayer.Branch,\n {\n ref: wrapperRef,\n role: \"region\",\n \"aria-label\": label.replace(\"{hotkey}\", hotkeyLabel),\n tabIndex: -1,\n style: { pointerEvents: hasToasts ? void 0 : \"none\" },\n children: [\n hasToasts && /* @__PURE__ */ jsx(\n FocusProxy,\n {\n ref: headFocusProxyRef,\n onFocusFromOutsideViewport: () => {\n const tabbableCandidates = getSortedTabbableCandidates({\n tabbingDirection: \"forwards\"\n });\n focusFirst(tabbableCandidates);\n }\n }\n ),\n /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeToast, children: /* @__PURE__ */ jsx(Primitive.ol, { tabIndex: -1, ...viewportProps, ref: composedRefs }) }),\n hasToasts && /* @__PURE__ */ jsx(\n FocusProxy,\n {\n ref: tailFocusProxyRef,\n onFocusFromOutsideViewport: () => {\n const tabbableCandidates = getSortedTabbableCandidates({\n tabbingDirection: \"backwards\"\n });\n focusFirst(tabbableCandidates);\n }\n }\n )\n ]\n }\n );\n }\n);\nToastViewport.displayName = VIEWPORT_NAME;\nvar FOCUS_PROXY_NAME = \"ToastFocusProxy\";\nvar FocusProxy = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, onFocusFromOutsideViewport, ...proxyProps } = props;\n const context = useToastProviderContext(FOCUS_PROXY_NAME, __scopeToast);\n return /* @__PURE__ */ jsx(\n VisuallyHidden,\n {\n \"aria-hidden\": true,\n tabIndex: 0,\n ...proxyProps,\n ref: forwardedRef,\n style: { position: \"fixed\" },\n onFocus: (event) => {\n const prevFocusedElement = event.relatedTarget;\n const isFocusFromOutsideViewport = !context.viewport?.contains(prevFocusedElement);\n if (isFocusFromOutsideViewport) onFocusFromOutsideViewport();\n }\n }\n );\n }\n);\nFocusProxy.displayName = FOCUS_PROXY_NAME;\nvar TOAST_NAME = \"Toast\";\nvar TOAST_SWIPE_START = \"toast.swipeStart\";\nvar TOAST_SWIPE_MOVE = \"toast.swipeMove\";\nvar TOAST_SWIPE_CANCEL = \"toast.swipeCancel\";\nvar TOAST_SWIPE_END = \"toast.swipeEnd\";\nvar Toast = React.forwardRef(\n (props, forwardedRef) => {\n const { forceMount, open: openProp, defaultOpen, onOpenChange, ...toastProps } = props;\n const [open = true, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || open, children: /* @__PURE__ */ jsx(\n ToastImpl,\n {\n open,\n ...toastProps,\n ref: forwardedRef,\n onClose: () => setOpen(false),\n onPause: useCallbackRef(props.onPause),\n onResume: useCallbackRef(props.onResume),\n onSwipeStart: composeEventHandlers(props.onSwipeStart, (event) => {\n event.currentTarget.setAttribute(\"data-swipe\", \"start\");\n }),\n onSwipeMove: composeEventHandlers(props.onSwipeMove, (event) => {\n const { x, y } = event.detail.delta;\n event.currentTarget.setAttribute(\"data-swipe\", \"move\");\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-move-x\", `${x}px`);\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-move-y\", `${y}px`);\n }),\n onSwipeCancel: composeEventHandlers(props.onSwipeCancel, (event) => {\n event.currentTarget.setAttribute(\"data-swipe\", \"cancel\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-y\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-end-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-end-y\");\n }),\n onSwipeEnd: composeEventHandlers(props.onSwipeEnd, (event) => {\n const { x, y } = event.detail.delta;\n event.currentTarget.setAttribute(\"data-swipe\", \"end\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-y\");\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-end-x\", `${x}px`);\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-end-y\", `${y}px`);\n setOpen(false);\n })\n }\n ) });\n }\n);\nToast.displayName = TOAST_NAME;\nvar [ToastInteractiveProvider, useToastInteractiveContext] = createToastContext(TOAST_NAME, {\n onClose() {\n }\n});\nvar ToastImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeToast,\n type = \"foreground\",\n duration: durationProp,\n open,\n onClose,\n onEscapeKeyDown,\n onPause,\n onResume,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n ...toastProps\n } = props;\n const context = useToastProviderContext(TOAST_NAME, __scopeToast);\n const [node, setNode] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const pointerStartRef = React.useRef(null);\n const swipeDeltaRef = React.useRef(null);\n const duration = durationProp || context.duration;\n const closeTimerStartTimeRef = React.useRef(0);\n const closeTimerRemainingTimeRef = React.useRef(duration);\n const closeTimerRef = React.useRef(0);\n const { onToastAdd, onToastRemove } = context;\n const handleClose = useCallbackRef(() => {\n const isFocusInToast = node?.contains(document.activeElement);\n if (isFocusInToast) context.viewport?.focus();\n onClose();\n });\n const startTimer = React.useCallback(\n (duration2) => {\n if (!duration2 || duration2 === Infinity) return;\n window.clearTimeout(closeTimerRef.current);\n closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();\n closeTimerRef.current = window.setTimeout(handleClose, duration2);\n },\n [handleClose]\n );\n React.useEffect(() => {\n const viewport = context.viewport;\n if (viewport) {\n const handleResume = () => {\n startTimer(closeTimerRemainingTimeRef.current);\n onResume?.();\n };\n const handlePause = () => {\n const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;\n closeTimerRemainingTimeRef.current = closeTimerRemainingTimeRef.current - elapsedTime;\n window.clearTimeout(closeTimerRef.current);\n onPause?.();\n };\n viewport.addEventListener(VIEWPORT_PAUSE, handlePause);\n viewport.addEventListener(VIEWPORT_RESUME, handleResume);\n return () => {\n viewport.removeEventListener(VIEWPORT_PAUSE, handlePause);\n viewport.removeEventListener(VIEWPORT_RESUME, handleResume);\n };\n }\n }, [context.viewport, duration, onPause, onResume, startTimer]);\n React.useEffect(() => {\n if (open && !context.isClosePausedRef.current) startTimer(duration);\n }, [open, duration, context.isClosePausedRef, startTimer]);\n React.useEffect(() => {\n onToastAdd();\n return () => onToastRemove();\n }, [onToastAdd, onToastRemove]);\n const announceTextContent = React.useMemo(() => {\n return node ? getAnnounceTextContent(node) : null;\n }, [node]);\n if (!context.viewport) return null;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n announceTextContent && /* @__PURE__ */ jsx(\n ToastAnnounce,\n {\n __scopeToast,\n role: \"status\",\n \"aria-live\": type === \"foreground\" ? \"assertive\" : \"polite\",\n \"aria-atomic\": true,\n children: announceTextContent\n }\n ),\n /* @__PURE__ */ jsx(ToastInteractiveProvider, { scope: __scopeToast, onClose: handleClose, children: ReactDOM.createPortal(\n /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeToast, children: /* @__PURE__ */ jsx(\n DismissableLayer.Root,\n {\n asChild: true,\n onEscapeKeyDown: composeEventHandlers(onEscapeKeyDown, () => {\n if (!context.isFocusedToastEscapeKeyDownRef.current) handleClose();\n context.isFocusedToastEscapeKeyDownRef.current = false;\n }),\n children: /* @__PURE__ */ jsx(\n Primitive.li,\n {\n role: \"status\",\n \"aria-live\": \"off\",\n \"aria-atomic\": true,\n tabIndex: 0,\n \"data-state\": open ? \"open\" : \"closed\",\n \"data-swipe-direction\": context.swipeDirection,\n ...toastProps,\n ref: composedRefs,\n style: { userSelect: \"none\", touchAction: \"none\", ...props.style },\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key !== \"Escape\") return;\n onEscapeKeyDown?.(event.nativeEvent);\n if (!event.nativeEvent.defaultPrevented) {\n context.isFocusedToastEscapeKeyDownRef.current = true;\n handleClose();\n }\n }),\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n if (event.button !== 0) return;\n pointerStartRef.current = { x: event.clientX, y: event.clientY };\n }),\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n if (!pointerStartRef.current) return;\n const x = event.clientX - pointerStartRef.current.x;\n const y = event.clientY - pointerStartRef.current.y;\n const hasSwipeMoveStarted = Boolean(swipeDeltaRef.current);\n const isHorizontalSwipe = [\"left\", \"right\"].includes(context.swipeDirection);\n const clamp = [\"left\", \"up\"].includes(context.swipeDirection) ? Math.min : Math.max;\n const clampedX = isHorizontalSwipe ? clamp(0, x) : 0;\n const clampedY = !isHorizontalSwipe ? clamp(0, y) : 0;\n const moveStartBuffer = event.pointerType === \"touch\" ? 10 : 2;\n const delta = { x: clampedX, y: clampedY };\n const eventDetail = { originalEvent: event, delta };\n if (hasSwipeMoveStarted) {\n swipeDeltaRef.current = delta;\n handleAndDispatchCustomEvent(TOAST_SWIPE_MOVE, onSwipeMove, eventDetail, {\n discrete: false\n });\n } else if (isDeltaInDirection(delta, context.swipeDirection, moveStartBuffer)) {\n swipeDeltaRef.current = delta;\n handleAndDispatchCustomEvent(TOAST_SWIPE_START, onSwipeStart, eventDetail, {\n discrete: false\n });\n event.target.setPointerCapture(event.pointerId);\n } else if (Math.abs(x) > moveStartBuffer || Math.abs(y) > moveStartBuffer) {\n pointerStartRef.current = null;\n }\n }),\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n const delta = swipeDeltaRef.current;\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n swipeDeltaRef.current = null;\n pointerStartRef.current = null;\n if (delta) {\n const toast = event.currentTarget;\n const eventDetail = { originalEvent: event, delta };\n if (isDeltaInDirection(delta, context.swipeDirection, context.swipeThreshold)) {\n handleAndDispatchCustomEvent(TOAST_SWIPE_END, onSwipeEnd, eventDetail, {\n discrete: true\n });\n } else {\n handleAndDispatchCustomEvent(\n TOAST_SWIPE_CANCEL,\n onSwipeCancel,\n eventDetail,\n {\n discrete: true\n }\n );\n }\n toast.addEventListener(\"click\", (event2) => event2.preventDefault(), {\n once: true\n });\n }\n })\n }\n )\n }\n ) }),\n context.viewport\n ) })\n ] });\n }\n);\nvar ToastAnnounce = (props) => {\n const { __scopeToast, children, ...announceProps } = props;\n const context = useToastProviderContext(TOAST_NAME, __scopeToast);\n const [renderAnnounceText, setRenderAnnounceText] = React.useState(false);\n const [isAnnounced, setIsAnnounced] = React.useState(false);\n useNextFrame(() => setRenderAnnounceText(true));\n React.useEffect(() => {\n const timer = window.setTimeout(() => setIsAnnounced(true), 1e3);\n return () => window.clearTimeout(timer);\n }, []);\n return isAnnounced ? null : /* @__PURE__ */ jsx(Portal, { asChild: true, children: /* @__PURE__ */ jsx(VisuallyHidden, { ...announceProps, children: renderAnnounceText && /* @__PURE__ */ jsxs(Fragment, { children: [\n context.label,\n \" \",\n children\n ] }) }) });\n};\nvar TITLE_NAME = \"ToastTitle\";\nvar ToastTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...titleProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...titleProps, ref: forwardedRef });\n }\n);\nToastTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"ToastDescription\";\nvar ToastDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...descriptionProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...descriptionProps, ref: forwardedRef });\n }\n);\nToastDescription.displayName = DESCRIPTION_NAME;\nvar ACTION_NAME = \"ToastAction\";\nvar ToastAction = React.forwardRef(\n (props, forwardedRef) => {\n const { altText, ...actionProps } = props;\n if (!altText.trim()) {\n console.error(\n `Invalid prop \\`altText\\` supplied to \\`${ACTION_NAME}\\`. Expected non-empty \\`string\\`.`\n );\n return null;\n }\n return /* @__PURE__ */ jsx(ToastAnnounceExclude, { altText, asChild: true, children: /* @__PURE__ */ jsx(ToastClose, { ...actionProps, ref: forwardedRef }) });\n }\n);\nToastAction.displayName = ACTION_NAME;\nvar CLOSE_NAME = \"ToastClose\";\nvar ToastClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...closeProps } = props;\n const interactiveContext = useToastInteractiveContext(CLOSE_NAME, __scopeToast);\n return /* @__PURE__ */ jsx(ToastAnnounceExclude, { asChild: true, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, interactiveContext.onClose)\n }\n ) });\n }\n);\nToastClose.displayName = CLOSE_NAME;\nvar ToastAnnounceExclude = React.forwardRef((props, forwardedRef) => {\n const { __scopeToast, altText, ...announceExcludeProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-radix-toast-announce-exclude\": \"\",\n \"data-radix-toast-announce-alt\": altText || void 0,\n ...announceExcludeProps,\n ref: forwardedRef\n }\n );\n});\nfunction getAnnounceTextContent(container) {\n const textContent = [];\n const childNodes = Array.from(container.childNodes);\n childNodes.forEach((node) => {\n if (node.nodeType === node.TEXT_NODE && node.textContent) textContent.push(node.textContent);\n if (isHTMLElement(node)) {\n const isHidden = node.ariaHidden || node.hidden || node.style.display === \"none\";\n const isExcluded = node.dataset.radixToastAnnounceExclude === \"\";\n if (!isHidden) {\n if (isExcluded) {\n const altText = node.dataset.radixToastAnnounceAlt;\n if (altText) textContent.push(altText);\n } else {\n textContent.push(...getAnnounceTextContent(node));\n }\n }\n }\n });\n return textContent;\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const currentTarget = detail.originalEvent.currentTarget;\n const event = new CustomEvent(name, { bubbles: true, cancelable: true, detail });\n if (handler) currentTarget.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(currentTarget, event);\n } else {\n currentTarget.dispatchEvent(event);\n }\n}\nvar isDeltaInDirection = (delta, direction, threshold = 0) => {\n const deltaX = Math.abs(delta.x);\n const deltaY = Math.abs(delta.y);\n const isDeltaX = deltaX > deltaY;\n if (direction === \"left\" || direction === \"right\") {\n return isDeltaX && deltaX > threshold;\n } else {\n return !isDeltaX && deltaY > threshold;\n }\n};\nfunction useNextFrame(callback = () => {\n}) {\n const fn = useCallbackRef(callback);\n useLayoutEffect(() => {\n let raf1 = 0;\n let raf2 = 0;\n raf1 = window.requestAnimationFrame(() => raf2 = window.requestAnimationFrame(fn));\n return () => {\n window.cancelAnimationFrame(raf1);\n window.cancelAnimationFrame(raf2);\n };\n }, [fn]);\n}\nfunction isHTMLElement(node) {\n return node.nodeType === node.ELEMENT_NODE;\n}\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nfunction focusFirst(candidates) {\n const previouslyFocusedElement = document.activeElement;\n return candidates.some((candidate) => {\n if (candidate === previouslyFocusedElement) return true;\n candidate.focus();\n return document.activeElement !== previouslyFocusedElement;\n });\n}\nvar Provider = ToastProvider;\nvar Viewport = ToastViewport;\nvar Root2 = Toast;\nvar Title = ToastTitle;\nvar Description = ToastDescription;\nvar Action = ToastAction;\nvar Close = ToastClose;\nexport {\n Action,\n Close,\n Description,\n Provider,\n Root2 as Root,\n Title,\n Toast,\n ToastAction,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n Viewport,\n createToastScope\n};\n//# sourceMappingURL=index.mjs.map\n","import { cn } from \"@/lib/utils\";\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport React from \"react\";\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Viewport>) => (\n\t<ToastPrimitives.Viewport\n\t\tdata-slot=\"toast-viewport\"\n\t\tclassName={cn(\n\t\t\t\"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nconst toastVariants = cva(\n\t\"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"border bg-background text-foreground\",\n\t\t\t\tdestructive:\n\t\t\t\t\t\"destructive group border-destructive-foreground bg-destructive-foreground text-destructive border-destructive\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t},\n\t},\n);\n\nconst Toast = ({\n\tclassName,\n\tvariant,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Root> & VariantProps<typeof toastVariants>) => {\n\treturn (\n\t\t<ToastPrimitives.Root\n\t\t\tdata-slot=\"toast-root\"\n\t\t\tclassName={cn(toastVariants({ variant }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nconst ToastAction = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Action>) => (\n\t<ToastPrimitives.Action\n\t\tdata-slot=\"toast-action\"\n\t\tclassName={cn(\n\t\t\t\"ring-offset-background hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none disabled:opacity-50\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nconst ToastClose = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Close>) => (\n\t<ToastPrimitives.Close\n\t\tdata-slot=\"toast-close\"\n\t\tclassName={cn(\n\t\t\t\"text-foreground/50 hover:text-foreground absolute top-2 right-2 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-2 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n\t\t\tclassName,\n\t\t)}\n\t\ttoast-close=\"\"\n\t\t{...props}\n\t>\n\t\t<X className=\"h-4 w-4\" />\n\t</ToastPrimitives.Close>\n);\n\nconst ToastTitle = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Title>) => (\n\t<ToastPrimitives.Title\n\t\tdata-slot=\"toast-title\"\n\t\tclassName={cn(\"text-sm font-semibold\", className)}\n\t\t{...props}\n\t/>\n);\n\nconst ToastDescription = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Description>) => (\n\t<ToastPrimitives.Description\n\t\tdata-slot=\"toast-description\"\n\t\tclassName={cn(\"text-sm opacity-90\", className)}\n\t\t{...props}\n\t/>\n);\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n\ttype ToastProps,\n\ttype ToastActionElement,\n\tToastProvider,\n\tToastViewport,\n\tToast,\n\tToastTitle,\n\tToastDescription,\n\tToastClose,\n\tToastAction,\n};\n"],"names":["PROVIDER_NAME","Collection","useCollection","createCollectionScope","createCollection","createToastContext","createToastScope","createContextScope","ToastProviderProvider","useToastProviderContext","ToastProvider","props","__scopeToast","label","duration","swipeDirection","swipeThreshold","children","viewport","setViewport","React","useState","toastCount","setToastCount","isFocusedToastEscapeKeyDownRef","useRef","isClosePausedRef","trim","jsx","Provider","scope","onViewportChange","onToastAdd","useCallback","prevCount","onToastRemove","displayName","VIEWPORT_NAME","VIEWPORT_DEFAULT_HOTKEY","VIEWPORT_PAUSE","VIEWPORT_RESUME","ToastViewport","forwardRef","forwardedRef","hotkey","viewportProps","context","getItems","wrapperRef","headFocusProxyRef","tailFocusProxyRef","ref","composedRefs","useComposedRefs","hotkeyLabel","join","replace","hasToasts","useEffect","handleKeyDown","event","length","every","key","code","current","focus","document","addEventListener","removeEventListener","wrapper","handlePause","pauseEvent","CustomEvent","dispatchEvent","handleResume","resumeEvent","handleFocusOutResume","contains","relatedTarget","handlePointerLeaveResume","activeElement","window","getSortedTabbableCandidates","tabbingDirection","tabbableCandidates","map","toastItem","toastNode","toastTabbableCandidates","getTabbableCandidates","reverse","flat","isMetaKey","altKey","ctrlKey","metaKey","focusedElement","isTabbingBackwards","shiftKey","target","sortedCandidates","index","findIndex","candidate","focusFirst","slice","preventDefault","jsxs","DismissableLayer.Branch","role","tabIndex","style","pointerEvents","FocusProxy","onFocusFromOutsideViewport","Slot","Primitive","ol","FOCUS_PROXY_NAME","proxyProps","VisuallyHidden","position","onFocus","prevFocusedElement","TOAST_NAME","Toast","forceMount","open","openProp","defaultOpen","onOpenChange","toastProps","setOpen","useControllableState","prop","defaultProp","onChange","Presence","present","ToastImpl","onClose","onPause","useCallbackRef","onResume","onSwipeStart","composeEventHandlers","currentTarget","setAttribute","onSwipeMove","x","y","detail","delta","setProperty","onSwipeCancel","removeProperty","onSwipeEnd","ToastInteractiveProvider","useToastInteractiveContext","type","durationProp","onEscapeKeyDown","node","setNode","pointerStartRef","swipeDeltaRef","closeTimerStartTimeRef","closeTimerRemainingTimeRef","closeTimerRef","handleClose","isFocusInToast","startTimer","Infinity","clearTimeout","Date","getTime","setTimeout","elapsedTime","announceTextContent","useMemo","getAnnounceTextContent","Fragment","ToastAnnounce","ReactDOM","createPortal","ItemSlot","DismissableLayer.Root","asChild","li","userSelect","touchAction","onKeyDown","nativeEvent","defaultPrevented","onPointerDown","button","clientX","clientY","onPointerMove","hasSwipeMoveStarted","Boolean","isHorizontalSwipe","includes","clamp","Math","min","max","clampedX","clampedY","moveStartBuffer","pointerType","eventDetail","originalEvent","handleAndDispatchCustomEvent","discrete","isDeltaInDirection","setPointerCapture","pointerId","abs","onPointerUp","hasPointerCapture","releasePointerCapture","toast","once","announceProps","renderAnnounceText","setRenderAnnounceText","isAnnounced","setIsAnnounced","callback","fn","useLayoutEffect","raf1","raf2","requestAnimationFrame","cancelAnimationFrame","useNextFrame","timer","Portal","ToastTitle","titleProps","div","ToastDescription","descriptionProps","ToastAction","altText","actionProps","ToastAnnounceExclude","ToastClose","CLOSE_NAME","closeProps","interactiveContext","onClick","announceExcludeProps","container","textContent","Array","from","childNodes","forEach","nodeType","TEXT_NODE","push","ELEMENT_NODE","isHTMLElement","isHidden","ariaHidden","hidden","display","isExcluded","dataset","radixToastAnnounceExclude","radixToastAnnounceAlt","name","handler","bubbles","cancelable","dispatchDiscreteCustomEvent","direction","threshold","deltaX","deltaY","isDeltaX","nodes","walker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","isHiddenInput","tagName","disabled","FILTER_SKIP","FILTER_ACCEPT","nextNode","currentNode","candidates","previouslyFocusedElement","some","Viewport","Root","Title","Description","Action","Close","className","ToastPrimitives","data-slot","cn","toastVariants","cva","variants","variant","default","destructive","defaultVariants","createElement","toast-close","X"],"mappings":"u0BAqBA,IAAMA,EAAgB,iBAEfC,EAAYC,EAAeC,GAAyBC,EAA+B,UAkBnFC,EAAoBC,GAAoBC,EAAmB,QAAS,CAACJ,KACrEK,EAAuBC,GAC5BJ,EAA8CL,GA2B1CU,EAA+CC,IACnD,MAAMC,aACJA,EAAAC,MACAA,EAAQ,eAAAC,SACRA,EAAW,IAAAC,eACXA,EAAiB,QAAAC,eACjBA,EAAiB,GAAAC,SACjBA,GACEN,GACGO,EAAUC,GAAqBC,EAAAC,SAAsC,OACrEC,EAAYC,GAAuBH,EAAAC,SAAS,GAC7CG,EAAuCJ,EAAAK,QAAO,GAC9CC,EAAyBN,EAAAK,QAAO,GAQtC,OANKZ,EAAMc,OAOTC,EAAC3B,EAAW4B,SAAX,CAAoBC,MAAOlB,EAC1BK,SAAAW,EAACpB,EAAA,CACCsB,MAAOlB,EACPC,QACAC,WACAC,iBACAC,iBACAM,aACAJ,WACAa,iBAAkBZ,EAClBa,WAAkBZ,EAAAa,aAAY,IAAMV,GAAeW,GAAcA,EAAY,KAAI,IACjFC,cAAqBf,EAAAa,aAAY,IAAMV,GAAeW,GAAcA,EAAY,KAAI,IACpFV,iCACAE,mBAECT,cAEL,EAIJP,EAAc0B,YAAcpC,EAM5B,IAAMqC,EAAgB,gBAChBC,EAA0B,CAAC,MAC3BC,EAAiB,sBACjBC,EAAkB,uBAkBlBC,EAAsBrB,EAAAsB,YAC1B,CAAC/B,EAAwCgC,KACvC,MAAM/B,aACJA,EAAAgC,OACAA,EAASN,EAAAzB,MACTA,EAAQ,8BACLgC,GACDlC,EACEmC,EAAUrC,EAAwB4B,EAAezB,GACjDmC,EAAW7C,EAAcU,GACzBoC,EAAmB5B,EAAAK,OAAuB,MAC1CwB,EAA0B7B,EA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ChCvS","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.mjs","sources":["../../node_modules/@radix-ui/react-toast/dist/index.mjs","../../src/components/ui/toast/toast.tsx"],"sourcesContent":["\"use client\";\n\n// src/toast.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport * as DismissableLayer from \"@radix-ui/react-dismissable-layer\";\nimport { Portal } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { VisuallyHidden } from \"@radix-ui/react-visually-hidden\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar PROVIDER_NAME = \"ToastProvider\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(\"Toast\");\nvar [createToastContext, createToastScope] = createContextScope(\"Toast\", [createCollectionScope]);\nvar [ToastProviderProvider, useToastProviderContext] = createToastContext(PROVIDER_NAME);\nvar ToastProvider = (props) => {\n const {\n __scopeToast,\n label = \"Notification\",\n duration = 5e3,\n swipeDirection = \"right\",\n swipeThreshold = 50,\n children\n } = props;\n const [viewport, setViewport] = React.useState(null);\n const [toastCount, setToastCount] = React.useState(0);\n const isFocusedToastEscapeKeyDownRef = React.useRef(false);\n const isClosePausedRef = React.useRef(false);\n if (!label.trim()) {\n console.error(\n `Invalid prop \\`label\\` supplied to \\`${PROVIDER_NAME}\\`. Expected non-empty \\`string\\`.`\n );\n }\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: __scopeToast, children: /* @__PURE__ */ jsx(\n ToastProviderProvider,\n {\n scope: __scopeToast,\n label,\n duration,\n swipeDirection,\n swipeThreshold,\n toastCount,\n viewport,\n onViewportChange: setViewport,\n onToastAdd: React.useCallback(() => setToastCount((prevCount) => prevCount + 1), []),\n onToastRemove: React.useCallback(() => setToastCount((prevCount) => prevCount - 1), []),\n isFocusedToastEscapeKeyDownRef,\n isClosePausedRef,\n children\n }\n ) });\n};\nToastProvider.displayName = PROVIDER_NAME;\nvar VIEWPORT_NAME = \"ToastViewport\";\nvar VIEWPORT_DEFAULT_HOTKEY = [\"F8\"];\nvar VIEWPORT_PAUSE = \"toast.viewportPause\";\nvar VIEWPORT_RESUME = \"toast.viewportResume\";\nvar ToastViewport = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeToast,\n hotkey = VIEWPORT_DEFAULT_HOTKEY,\n label = \"Notifications ({hotkey})\",\n ...viewportProps\n } = props;\n const context = useToastProviderContext(VIEWPORT_NAME, __scopeToast);\n const getItems = useCollection(__scopeToast);\n const wrapperRef = React.useRef(null);\n const headFocusProxyRef = React.useRef(null);\n const tailFocusProxyRef = React.useRef(null);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);\n const hotkeyLabel = hotkey.join(\"+\").replace(/Key/g, \"\").replace(/Digit/g, \"\");\n const hasToasts = context.toastCount > 0;\n React.useEffect(() => {\n const handleKeyDown = (event) => {\n const isHotkeyPressed = hotkey.length !== 0 && hotkey.every((key) => event[key] || event.code === key);\n if (isHotkeyPressed) ref.current?.focus();\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [hotkey]);\n React.useEffect(() => {\n const wrapper = wrapperRef.current;\n const viewport = ref.current;\n if (hasToasts && wrapper && viewport) {\n const handlePause = () => {\n if (!context.isClosePausedRef.current) {\n const pauseEvent = new CustomEvent(VIEWPORT_PAUSE);\n viewport.dispatchEvent(pauseEvent);\n context.isClosePausedRef.current = true;\n }\n };\n const handleResume = () => {\n if (context.isClosePausedRef.current) {\n const resumeEvent = new CustomEvent(VIEWPORT_RESUME);\n viewport.dispatchEvent(resumeEvent);\n context.isClosePausedRef.current = false;\n }\n };\n const handleFocusOutResume = (event) => {\n const isFocusMovingOutside = !wrapper.contains(event.relatedTarget);\n if (isFocusMovingOutside) handleResume();\n };\n const handlePointerLeaveResume = () => {\n const isFocusInside = wrapper.contains(document.activeElement);\n if (!isFocusInside) handleResume();\n };\n wrapper.addEventListener(\"focusin\", handlePause);\n wrapper.addEventListener(\"focusout\", handleFocusOutResume);\n wrapper.addEventListener(\"pointermove\", handlePause);\n wrapper.addEventListener(\"pointerleave\", handlePointerLeaveResume);\n window.addEventListener(\"blur\", handlePause);\n window.addEventListener(\"focus\", handleResume);\n return () => {\n wrapper.removeEventListener(\"focusin\", handlePause);\n wrapper.removeEventListener(\"focusout\", handleFocusOutResume);\n wrapper.removeEventListener(\"pointermove\", handlePause);\n wrapper.removeEventListener(\"pointerleave\", handlePointerLeaveResume);\n window.removeEventListener(\"blur\", handlePause);\n window.removeEventListener(\"focus\", handleResume);\n };\n }\n }, [hasToasts, context.isClosePausedRef]);\n const getSortedTabbableCandidates = React.useCallback(\n ({ tabbingDirection }) => {\n const toastItems = getItems();\n const tabbableCandidates = toastItems.map((toastItem) => {\n const toastNode = toastItem.ref.current;\n const toastTabbableCandidates = [toastNode, ...getTabbableCandidates(toastNode)];\n return tabbingDirection === \"forwards\" ? toastTabbableCandidates : toastTabbableCandidates.reverse();\n });\n return (tabbingDirection === \"forwards\" ? tabbableCandidates.reverse() : tabbableCandidates).flat();\n },\n [getItems]\n );\n React.useEffect(() => {\n const viewport = ref.current;\n if (viewport) {\n const handleKeyDown = (event) => {\n const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;\n const isTabKey = event.key === \"Tab\" && !isMetaKey;\n if (isTabKey) {\n const focusedElement = document.activeElement;\n const isTabbingBackwards = event.shiftKey;\n const targetIsViewport = event.target === viewport;\n if (targetIsViewport && isTabbingBackwards) {\n headFocusProxyRef.current?.focus();\n return;\n }\n const tabbingDirection = isTabbingBackwards ? \"backwards\" : \"forwards\";\n const sortedCandidates = getSortedTabbableCandidates({ tabbingDirection });\n const index = sortedCandidates.findIndex((candidate) => candidate === focusedElement);\n if (focusFirst(sortedCandidates.slice(index + 1))) {\n event.preventDefault();\n } else {\n isTabbingBackwards ? headFocusProxyRef.current?.focus() : tailFocusProxyRef.current?.focus();\n }\n }\n };\n viewport.addEventListener(\"keydown\", handleKeyDown);\n return () => viewport.removeEventListener(\"keydown\", handleKeyDown);\n }\n }, [getItems, getSortedTabbableCandidates]);\n return /* @__PURE__ */ jsxs(\n DismissableLayer.Branch,\n {\n ref: wrapperRef,\n role: \"region\",\n \"aria-label\": label.replace(\"{hotkey}\", hotkeyLabel),\n tabIndex: -1,\n style: { pointerEvents: hasToasts ? void 0 : \"none\" },\n children: [\n hasToasts && /* @__PURE__ */ jsx(\n FocusProxy,\n {\n ref: headFocusProxyRef,\n onFocusFromOutsideViewport: () => {\n const tabbableCandidates = getSortedTabbableCandidates({\n tabbingDirection: \"forwards\"\n });\n focusFirst(tabbableCandidates);\n }\n }\n ),\n /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeToast, children: /* @__PURE__ */ jsx(Primitive.ol, { tabIndex: -1, ...viewportProps, ref: composedRefs }) }),\n hasToasts && /* @__PURE__ */ jsx(\n FocusProxy,\n {\n ref: tailFocusProxyRef,\n onFocusFromOutsideViewport: () => {\n const tabbableCandidates = getSortedTabbableCandidates({\n tabbingDirection: \"backwards\"\n });\n focusFirst(tabbableCandidates);\n }\n }\n )\n ]\n }\n );\n }\n);\nToastViewport.displayName = VIEWPORT_NAME;\nvar FOCUS_PROXY_NAME = \"ToastFocusProxy\";\nvar FocusProxy = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, onFocusFromOutsideViewport, ...proxyProps } = props;\n const context = useToastProviderContext(FOCUS_PROXY_NAME, __scopeToast);\n return /* @__PURE__ */ jsx(\n VisuallyHidden,\n {\n \"aria-hidden\": true,\n tabIndex: 0,\n ...proxyProps,\n ref: forwardedRef,\n style: { position: \"fixed\" },\n onFocus: (event) => {\n const prevFocusedElement = event.relatedTarget;\n const isFocusFromOutsideViewport = !context.viewport?.contains(prevFocusedElement);\n if (isFocusFromOutsideViewport) onFocusFromOutsideViewport();\n }\n }\n );\n }\n);\nFocusProxy.displayName = FOCUS_PROXY_NAME;\nvar TOAST_NAME = \"Toast\";\nvar TOAST_SWIPE_START = \"toast.swipeStart\";\nvar TOAST_SWIPE_MOVE = \"toast.swipeMove\";\nvar TOAST_SWIPE_CANCEL = \"toast.swipeCancel\";\nvar TOAST_SWIPE_END = \"toast.swipeEnd\";\nvar Toast = React.forwardRef(\n (props, forwardedRef) => {\n const { forceMount, open: openProp, defaultOpen, onOpenChange, ...toastProps } = props;\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? true,\n onChange: onOpenChange,\n caller: TOAST_NAME\n });\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || open, children: /* @__PURE__ */ jsx(\n ToastImpl,\n {\n open,\n ...toastProps,\n ref: forwardedRef,\n onClose: () => setOpen(false),\n onPause: useCallbackRef(props.onPause),\n onResume: useCallbackRef(props.onResume),\n onSwipeStart: composeEventHandlers(props.onSwipeStart, (event) => {\n event.currentTarget.setAttribute(\"data-swipe\", \"start\");\n }),\n onSwipeMove: composeEventHandlers(props.onSwipeMove, (event) => {\n const { x, y } = event.detail.delta;\n event.currentTarget.setAttribute(\"data-swipe\", \"move\");\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-move-x\", `${x}px`);\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-move-y\", `${y}px`);\n }),\n onSwipeCancel: composeEventHandlers(props.onSwipeCancel, (event) => {\n event.currentTarget.setAttribute(\"data-swipe\", \"cancel\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-y\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-end-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-end-y\");\n }),\n onSwipeEnd: composeEventHandlers(props.onSwipeEnd, (event) => {\n const { x, y } = event.detail.delta;\n event.currentTarget.setAttribute(\"data-swipe\", \"end\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-x\");\n event.currentTarget.style.removeProperty(\"--radix-toast-swipe-move-y\");\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-end-x\", `${x}px`);\n event.currentTarget.style.setProperty(\"--radix-toast-swipe-end-y\", `${y}px`);\n setOpen(false);\n })\n }\n ) });\n }\n);\nToast.displayName = TOAST_NAME;\nvar [ToastInteractiveProvider, useToastInteractiveContext] = createToastContext(TOAST_NAME, {\n onClose() {\n }\n});\nvar ToastImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeToast,\n type = \"foreground\",\n duration: durationProp,\n open,\n onClose,\n onEscapeKeyDown,\n onPause,\n onResume,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n ...toastProps\n } = props;\n const context = useToastProviderContext(TOAST_NAME, __scopeToast);\n const [node, setNode] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const pointerStartRef = React.useRef(null);\n const swipeDeltaRef = React.useRef(null);\n const duration = durationProp || context.duration;\n const closeTimerStartTimeRef = React.useRef(0);\n const closeTimerRemainingTimeRef = React.useRef(duration);\n const closeTimerRef = React.useRef(0);\n const { onToastAdd, onToastRemove } = context;\n const handleClose = useCallbackRef(() => {\n const isFocusInToast = node?.contains(document.activeElement);\n if (isFocusInToast) context.viewport?.focus();\n onClose();\n });\n const startTimer = React.useCallback(\n (duration2) => {\n if (!duration2 || duration2 === Infinity) return;\n window.clearTimeout(closeTimerRef.current);\n closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();\n closeTimerRef.current = window.setTimeout(handleClose, duration2);\n },\n [handleClose]\n );\n React.useEffect(() => {\n const viewport = context.viewport;\n if (viewport) {\n const handleResume = () => {\n startTimer(closeTimerRemainingTimeRef.current);\n onResume?.();\n };\n const handlePause = () => {\n const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;\n closeTimerRemainingTimeRef.current = closeTimerRemainingTimeRef.current - elapsedTime;\n window.clearTimeout(closeTimerRef.current);\n onPause?.();\n };\n viewport.addEventListener(VIEWPORT_PAUSE, handlePause);\n viewport.addEventListener(VIEWPORT_RESUME, handleResume);\n return () => {\n viewport.removeEventListener(VIEWPORT_PAUSE, handlePause);\n viewport.removeEventListener(VIEWPORT_RESUME, handleResume);\n };\n }\n }, [context.viewport, duration, onPause, onResume, startTimer]);\n React.useEffect(() => {\n if (open && !context.isClosePausedRef.current) startTimer(duration);\n }, [open, duration, context.isClosePausedRef, startTimer]);\n React.useEffect(() => {\n onToastAdd();\n return () => onToastRemove();\n }, [onToastAdd, onToastRemove]);\n const announceTextContent = React.useMemo(() => {\n return node ? getAnnounceTextContent(node) : null;\n }, [node]);\n if (!context.viewport) return null;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n announceTextContent && /* @__PURE__ */ jsx(\n ToastAnnounce,\n {\n __scopeToast,\n role: \"status\",\n \"aria-live\": type === \"foreground\" ? \"assertive\" : \"polite\",\n \"aria-atomic\": true,\n children: announceTextContent\n }\n ),\n /* @__PURE__ */ jsx(ToastInteractiveProvider, { scope: __scopeToast, onClose: handleClose, children: ReactDOM.createPortal(\n /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeToast, children: /* @__PURE__ */ jsx(\n DismissableLayer.Root,\n {\n asChild: true,\n onEscapeKeyDown: composeEventHandlers(onEscapeKeyDown, () => {\n if (!context.isFocusedToastEscapeKeyDownRef.current) handleClose();\n context.isFocusedToastEscapeKeyDownRef.current = false;\n }),\n children: /* @__PURE__ */ jsx(\n Primitive.li,\n {\n role: \"status\",\n \"aria-live\": \"off\",\n \"aria-atomic\": true,\n tabIndex: 0,\n \"data-state\": open ? \"open\" : \"closed\",\n \"data-swipe-direction\": context.swipeDirection,\n ...toastProps,\n ref: composedRefs,\n style: { userSelect: \"none\", touchAction: \"none\", ...props.style },\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key !== \"Escape\") return;\n onEscapeKeyDown?.(event.nativeEvent);\n if (!event.nativeEvent.defaultPrevented) {\n context.isFocusedToastEscapeKeyDownRef.current = true;\n handleClose();\n }\n }),\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n if (event.button !== 0) return;\n pointerStartRef.current = { x: event.clientX, y: event.clientY };\n }),\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n if (!pointerStartRef.current) return;\n const x = event.clientX - pointerStartRef.current.x;\n const y = event.clientY - pointerStartRef.current.y;\n const hasSwipeMoveStarted = Boolean(swipeDeltaRef.current);\n const isHorizontalSwipe = [\"left\", \"right\"].includes(context.swipeDirection);\n const clamp = [\"left\", \"up\"].includes(context.swipeDirection) ? Math.min : Math.max;\n const clampedX = isHorizontalSwipe ? clamp(0, x) : 0;\n const clampedY = !isHorizontalSwipe ? clamp(0, y) : 0;\n const moveStartBuffer = event.pointerType === \"touch\" ? 10 : 2;\n const delta = { x: clampedX, y: clampedY };\n const eventDetail = { originalEvent: event, delta };\n if (hasSwipeMoveStarted) {\n swipeDeltaRef.current = delta;\n handleAndDispatchCustomEvent(TOAST_SWIPE_MOVE, onSwipeMove, eventDetail, {\n discrete: false\n });\n } else if (isDeltaInDirection(delta, context.swipeDirection, moveStartBuffer)) {\n swipeDeltaRef.current = delta;\n handleAndDispatchCustomEvent(TOAST_SWIPE_START, onSwipeStart, eventDetail, {\n discrete: false\n });\n event.target.setPointerCapture(event.pointerId);\n } else if (Math.abs(x) > moveStartBuffer || Math.abs(y) > moveStartBuffer) {\n pointerStartRef.current = null;\n }\n }),\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n const delta = swipeDeltaRef.current;\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n swipeDeltaRef.current = null;\n pointerStartRef.current = null;\n if (delta) {\n const toast = event.currentTarget;\n const eventDetail = { originalEvent: event, delta };\n if (isDeltaInDirection(delta, context.swipeDirection, context.swipeThreshold)) {\n handleAndDispatchCustomEvent(TOAST_SWIPE_END, onSwipeEnd, eventDetail, {\n discrete: true\n });\n } else {\n handleAndDispatchCustomEvent(\n TOAST_SWIPE_CANCEL,\n onSwipeCancel,\n eventDetail,\n {\n discrete: true\n }\n );\n }\n toast.addEventListener(\"click\", (event2) => event2.preventDefault(), {\n once: true\n });\n }\n })\n }\n )\n }\n ) }),\n context.viewport\n ) })\n ] });\n }\n);\nvar ToastAnnounce = (props) => {\n const { __scopeToast, children, ...announceProps } = props;\n const context = useToastProviderContext(TOAST_NAME, __scopeToast);\n const [renderAnnounceText, setRenderAnnounceText] = React.useState(false);\n const [isAnnounced, setIsAnnounced] = React.useState(false);\n useNextFrame(() => setRenderAnnounceText(true));\n React.useEffect(() => {\n const timer = window.setTimeout(() => setIsAnnounced(true), 1e3);\n return () => window.clearTimeout(timer);\n }, []);\n return isAnnounced ? null : /* @__PURE__ */ jsx(Portal, { asChild: true, children: /* @__PURE__ */ jsx(VisuallyHidden, { ...announceProps, children: renderAnnounceText && /* @__PURE__ */ jsxs(Fragment, { children: [\n context.label,\n \" \",\n children\n ] }) }) });\n};\nvar TITLE_NAME = \"ToastTitle\";\nvar ToastTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...titleProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...titleProps, ref: forwardedRef });\n }\n);\nToastTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"ToastDescription\";\nvar ToastDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...descriptionProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...descriptionProps, ref: forwardedRef });\n }\n);\nToastDescription.displayName = DESCRIPTION_NAME;\nvar ACTION_NAME = \"ToastAction\";\nvar ToastAction = React.forwardRef(\n (props, forwardedRef) => {\n const { altText, ...actionProps } = props;\n if (!altText.trim()) {\n console.error(\n `Invalid prop \\`altText\\` supplied to \\`${ACTION_NAME}\\`. Expected non-empty \\`string\\`.`\n );\n return null;\n }\n return /* @__PURE__ */ jsx(ToastAnnounceExclude, { altText, asChild: true, children: /* @__PURE__ */ jsx(ToastClose, { ...actionProps, ref: forwardedRef }) });\n }\n);\nToastAction.displayName = ACTION_NAME;\nvar CLOSE_NAME = \"ToastClose\";\nvar ToastClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeToast, ...closeProps } = props;\n const interactiveContext = useToastInteractiveContext(CLOSE_NAME, __scopeToast);\n return /* @__PURE__ */ jsx(ToastAnnounceExclude, { asChild: true, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, interactiveContext.onClose)\n }\n ) });\n }\n);\nToastClose.displayName = CLOSE_NAME;\nvar ToastAnnounceExclude = React.forwardRef((props, forwardedRef) => {\n const { __scopeToast, altText, ...announceExcludeProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-radix-toast-announce-exclude\": \"\",\n \"data-radix-toast-announce-alt\": altText || void 0,\n ...announceExcludeProps,\n ref: forwardedRef\n }\n );\n});\nfunction getAnnounceTextContent(container) {\n const textContent = [];\n const childNodes = Array.from(container.childNodes);\n childNodes.forEach((node) => {\n if (node.nodeType === node.TEXT_NODE && node.textContent) textContent.push(node.textContent);\n if (isHTMLElement(node)) {\n const isHidden = node.ariaHidden || node.hidden || node.style.display === \"none\";\n const isExcluded = node.dataset.radixToastAnnounceExclude === \"\";\n if (!isHidden) {\n if (isExcluded) {\n const altText = node.dataset.radixToastAnnounceAlt;\n if (altText) textContent.push(altText);\n } else {\n textContent.push(...getAnnounceTextContent(node));\n }\n }\n }\n });\n return textContent;\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const currentTarget = detail.originalEvent.currentTarget;\n const event = new CustomEvent(name, { bubbles: true, cancelable: true, detail });\n if (handler) currentTarget.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(currentTarget, event);\n } else {\n currentTarget.dispatchEvent(event);\n }\n}\nvar isDeltaInDirection = (delta, direction, threshold = 0) => {\n const deltaX = Math.abs(delta.x);\n const deltaY = Math.abs(delta.y);\n const isDeltaX = deltaX > deltaY;\n if (direction === \"left\" || direction === \"right\") {\n return isDeltaX && deltaX > threshold;\n } else {\n return !isDeltaX && deltaY > threshold;\n }\n};\nfunction useNextFrame(callback = () => {\n}) {\n const fn = useCallbackRef(callback);\n useLayoutEffect(() => {\n let raf1 = 0;\n let raf2 = 0;\n raf1 = window.requestAnimationFrame(() => raf2 = window.requestAnimationFrame(fn));\n return () => {\n window.cancelAnimationFrame(raf1);\n window.cancelAnimationFrame(raf2);\n };\n }, [fn]);\n}\nfunction isHTMLElement(node) {\n return node.nodeType === node.ELEMENT_NODE;\n}\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nfunction focusFirst(candidates) {\n const previouslyFocusedElement = document.activeElement;\n return candidates.some((candidate) => {\n if (candidate === previouslyFocusedElement) return true;\n candidate.focus();\n return document.activeElement !== previouslyFocusedElement;\n });\n}\nvar Provider = ToastProvider;\nvar Viewport = ToastViewport;\nvar Root2 = Toast;\nvar Title = ToastTitle;\nvar Description = ToastDescription;\nvar Action = ToastAction;\nvar Close = ToastClose;\nexport {\n Action,\n Close,\n Description,\n Provider,\n Root2 as Root,\n Title,\n Toast,\n ToastAction,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n Viewport,\n createToastScope\n};\n//# sourceMappingURL=index.mjs.map\n","import { cn } from \"@/lib/utils\";\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport React from \"react\";\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Viewport>) => (\n\t<ToastPrimitives.Viewport\n\t\tdata-slot=\"toast-viewport\"\n\t\tclassName={cn(\n\t\t\t\"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nconst toastVariants = cva(\n\t\"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"border bg-background text-foreground\",\n\t\t\t\tdestructive:\n\t\t\t\t\t\"destructive group border-destructive-foreground bg-destructive-foreground text-destructive border-destructive\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t},\n\t},\n);\n\nconst Toast = ({\n\tclassName,\n\tvariant,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Root> & VariantProps<typeof toastVariants>) => {\n\treturn (\n\t\t<ToastPrimitives.Root\n\t\t\tdata-slot=\"toast-root\"\n\t\t\tclassName={cn(toastVariants({ variant }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nconst ToastAction = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Action>) => (\n\t<ToastPrimitives.Action\n\t\tdata-slot=\"toast-action\"\n\t\tclassName={cn(\n\t\t\t\"ring-offset-background hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none disabled:opacity-50\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\nconst ToastClose = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Close>) => (\n\t<ToastPrimitives.Close\n\t\tdata-slot=\"toast-close\"\n\t\tclassName={cn(\n\t\t\t\"text-foreground/50 hover:text-foreground absolute top-2 right-2 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-2 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n\t\t\tclassName,\n\t\t)}\n\t\ttoast-close=\"\"\n\t\t{...props}\n\t>\n\t\t<X className=\"h-4 w-4\" />\n\t</ToastPrimitives.Close>\n);\n\nconst ToastTitle = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Title>) => (\n\t<ToastPrimitives.Title\n\t\tdata-slot=\"toast-title\"\n\t\tclassName={cn(\"text-sm font-semibold\", className)}\n\t\t{...props}\n\t/>\n);\n\nconst ToastDescription = ({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof ToastPrimitives.Description>) => (\n\t<ToastPrimitives.Description\n\t\tdata-slot=\"toast-description\"\n\t\tclassName={cn(\"text-sm opacity-90\", className)}\n\t\t{...props}\n\t/>\n);\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n\ttype ToastProps,\n\ttype ToastActionElement,\n\tToastProvider,\n\tToastViewport,\n\tToast,\n\tToastTitle,\n\tToastDescription,\n\tToastClose,\n\tToastAction,\n};\n"],"names":["PROVIDER_NAME","Collection","useCollection","createCollectionScope","createCollection","createToastContext","createToastScope","createContextScope","ToastProviderProvider","useToastProviderContext","ToastProvider","props","__scopeToast","label","duration","swipeDirection","swipeThreshold","children","viewport","setViewport","React","useState","toastCount","setToastCount","isFocusedToastEscapeKeyDownRef","useRef","isClosePausedRef","trim","jsx","Provider","scope","onViewportChange","onToastAdd","useCallback","prevCount","onToastRemove","displayName","VIEWPORT_NAME","VIEWPORT_DEFAULT_HOTKEY","VIEWPORT_PAUSE","VIEWPORT_RESUME","ToastViewport","forwardRef","forwardedRef","hotkey","viewportProps","context","getItems","wrapperRef","headFocusProxyRef","tailFocusProxyRef","ref","composedRefs","useComposedRefs","hotkeyLabel","join","replace","hasToasts","useEffect","handleKeyDown","event","length","every","key","code","current","focus","document","addEventListener","removeEventListener","wrapper","handlePause","pauseEvent","CustomEvent","dispatchEvent","handleResume","resumeEvent","handleFocusOutResume","contains","relatedTarget","handlePointerLeaveResume","activeElement","window","getSortedTabbableCandidates","tabbingDirection","tabbableCandidates","map","toastItem","toastNode","toastTabbableCandidates","getTabbableCandidates","reverse","flat","isMetaKey","altKey","ctrlKey","metaKey","focusedElement","isTabbingBackwards","shiftKey","target","sortedCandidates","index","findIndex","candidate","focusFirst","slice","preventDefault","jsxs","DismissableLayer.Branch","role","tabIndex","style","pointerEvents","FocusProxy","onFocusFromOutsideViewport","Slot","Primitive","ol","FOCUS_PROXY_NAME","proxyProps","VisuallyHidden","position","onFocus","prevFocusedElement","TOAST_NAME","Toast","forceMount","open","openProp","defaultOpen","onOpenChange","toastProps","setOpen","useControllableState","prop","defaultProp","onChange","caller","Presence","present","ToastImpl","onClose","onPause","useCallbackRef","onResume","onSwipeStart","composeEventHandlers","currentTarget","setAttribute","onSwipeMove","x","y","detail","delta","setProperty","onSwipeCancel","removeProperty","onSwipeEnd","ToastInteractiveProvider","useToastInteractiveContext","type","durationProp","onEscapeKeyDown","node","setNode","pointerStartRef","swipeDeltaRef","closeTimerStartTimeRef","closeTimerRemainingTimeRef","closeTimerRef","handleClose","isFocusInToast","startTimer","Infinity","clearTimeout","Date","getTime","setTimeout","elapsedTime","announceTextContent","useMemo","getAnnounceTextContent","Fragment","ToastAnnounce","ReactDOM","createPortal","ItemSlot","DismissableLayer.Root","asChild","li","userSelect","touchAction","onKeyDown","nativeEvent","defaultPrevented","onPointerDown","button","clientX","clientY","onPointerMove","hasSwipeMoveStarted","Boolean","isHorizontalSwipe","includes","clamp","Math","min","max","clampedX","clampedY","moveStartBuffer","pointerType","eventDetail","originalEvent","handleAndDispatchCustomEvent","discrete","isDeltaInDirection","setPointerCapture","pointerId","abs","onPointerUp","hasPointerCapture","releasePointerCapture","toast","once","announceProps","renderAnnounceText","setRenderAnnounceText","isAnnounced","setIsAnnounced","callback","fn","useLayoutEffect","raf1","raf2","requestAnimationFrame","cancelAnimationFrame","useNextFrame","timer","Portal","ToastTitle","titleProps","div","ToastDescription","descriptionProps","ToastAction","altText","actionProps","ToastAnnounceExclude","ToastClose","CLOSE_NAME","closeProps","interactiveContext","onClick","announceExcludeProps","container","textContent","Array","from","childNodes","forEach","nodeType","TEXT_NODE","push","ELEMENT_NODE","isHTMLElement","isHidden","ariaHidden","hidden","display","isExcluded","dataset","radixToastAnnounceExclude","radixToastAnnounceAlt","name","handler","bubbles","cancelable","dispatchDiscreteCustomEvent","direction","threshold","deltaX","deltaY","isDeltaX","nodes","walker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","isHiddenInput","tagName","disabled","FILTER_SKIP","FILTER_ACCEPT","nextNode","currentNode","candidates","previouslyFocusedElement","some","Viewport","Root","Title","Description","Action","Close","className","ToastPrimitives","data-slot","cn","toastVariants","cva","variants","variant","default","destructive","defaultVariants","createElement","toast-close","X"],"mappings":"i3BAqBA,IAAMA,EAAgB,iBAEfC,EAAYC,EAAeC,GAAyBC,EAA+B,UAkBnFC,EAAoBC,GAAoBC,EAAmB,QAAS,CAACJ,KACrEK,EAAuBC,GAC5BJ,EAA8CL,GA2B1CU,EAA+CC,IACnD,MAAMC,aACJA,EAAAC,MACAA,EAAQ,eAAAC,SACRA,EAAW,IAAAC,eACXA,EAAiB,QAAAC,eACjBA,EAAiB,GAAAC,SACjBA,GACEN,GACGO,EAAUC,GAAqBC,EAAAC,SAAsC,OACrEC,EAAYC,GAAuBH,EAAAC,SAAS,GAC7CG,EAAuCJ,EAAAK,QAAO,GAC9CC,EAAyBN,EAAAK,QAAO,GAQtC,OANKZ,EAAMc,OAOTC,EAAC3B,EAAW4B,SAAX,CAAoBC,MAAOlB,EAC1BK,SAAAW,EAACpB,EAAA,CACCsB,MAAOlB,EACPC,QACAC,WACAC,iBACAC,iBACAM,aACAJ,WACAa,iBAAkBZ,EAClBa,WAAkBZ,EAAAa,aAAY,IAAMV,GAAeW,GAAcA,EAAY,KAAI,IACjFC,cAAqBf,EAAAa,aAAY,IAAMV,GAAeW,GAAcA,EAAY,KAAI,IACpFV,iCACAE,mBAECT,cAEL,EAIJP,EAAc0B,YAAcpC,EAM5B,IAAMqC,EAAgB,gBAChBC,EAA0B,CAAC,MAC3BC,EAAiB,sBACjBC,EAAkB,uBAkBlBC,EAAsBrB,EAAAsB,YAC1B,CAAC/B,EAAwCgC,KACvC,MAAM/B,aACJA,EAAAgC,OACAA,EAASN,EAAAzB,MACTA,EAAQ,8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G,wBAAyBH,MACnCxS,IAIAyO,GAAmB,EACxB+D,eACGxS,KAEHS,EAACgS,cAAAA,GAA2B,CAC3BC,YAAU,oBACVF,UAAWG,EAAG,qBAAsBH,MAChCxS","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{c as e}from"../chunks/utils-B9uwc_lt.mjs";import*as t from"react";import n from"react";import{u as o,c as r,P as i}from"../chunks/index-IXx8l3RV.mjs";import{c as a}from"../chunks/index-BX6nSpY1.mjs";import{P as s,D as c}from"../chunks/index-DZldl4eo.mjs";import{u as l}from"../chunks/index-DdNjMgpV.mjs";import{c as u,R as d,A as p,C as f,a as m}from"../chunks/index-Ck1fOwnt.mjs";import{P as h}from"../chunks/index-BSf-atXx.mjs";import{createSlottable as g}from"@radix-ui/react-slot";import{u as x}from"../chunks/index-DyUn0c26.mjs";import{R as y}from"../chunks/index-CUXMuJ__.mjs";import{jsx as v,jsxs as b}from"react/jsx-runtime";import"../chunks/bundle-mjs-BYGwPY3j.mjs";import"../chunks/index-DuMyb05s.mjs";import"react-dom";import"../chunks/index-XatPIL6c.mjs";var[w,C]=a("Tooltip",[u]),T=u(),E="TooltipProvider",k=700,R="tooltip.open",[_,D]=w(E),P=e=>{const{__scopeTooltip:n,delayDuration:o=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,s=t.useRef(!0),c=t.useRef(!1),l=t.useRef(0);return t.useEffect((()=>{const e=l.current;return()=>window.clearTimeout(e)}),[]),v(_,{scope:n,isOpenDelayedRef:s,delayDuration:o,onOpen:t.useCallback((()=>{window.clearTimeout(l.current),s.current=!1}),[]),onClose:t.useCallback((()=>{window.clearTimeout(l.current),l.current=window.setTimeout((()=>s.current=!0),r)}),[r]),isPointerInTransitRef:c,onPointerInTransitChange:t.useCallback((e=>{c.current=e}),[]),disableHoverableContent:i,children:a})};P.displayName=E;var L="Tooltip",[O,j]=w(L),M=e=>{const{__scopeTooltip:n,children:o,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,u=D(L,e.__scopeTooltip),p=T(n),[f,m]=t.useState(null),h=l(),g=t.useRef(0),y=s??u.disableHoverableContent,b=c??u.delayDuration,w=t.useRef(!1),[C=!1,E]=x({prop:r,defaultProp:i,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(R))):u.onClose(),a?.(e)}}),k=t.useMemo((()=>C?w.current?"delayed-open":"instant-open":"closed"),[C]),_=t.useCallback((()=>{window.clearTimeout(g.current),g.current=0,w.current=!1,E(!0)}),[E]),P=t.useCallback((()=>{window.clearTimeout(g.current),g.current=0,E(!1)}),[E]),j=t.useCallback((()=>{window.clearTimeout(g.current),g.current=window.setTimeout((()=>{w.current=!0,E(!0),g.current=0}),b)}),[b,E]);return t.useEffect((()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)}),[]),v(d,{...p,children:v(O,{scope:n,contentId:h,open:C,stateAttribute:k,trigger:f,onTriggerChange:m,onTriggerEnter:t.useCallback((()=>{u.isOpenDelayedRef.current?j():_()}),[u.isOpenDelayedRef,j,_]),onTriggerLeave:t.useCallback((()=>{y?P():(window.clearTimeout(g.current),g.current=0)}),[P,y]),onOpen:_,onClose:P,disableHoverableContent:y,children:o})})};M.displayName=L;var I="TooltipTrigger",N=t.forwardRef(((e,n)=>{const{__scopeTooltip:i,...a}=e,s=j(I,i),c=D(I,i),l=T(i),u=t.useRef(null),d=o(n,u,s.onTriggerChange),f=t.useRef(!1),m=t.useRef(!1),g=t.useCallback((()=>f.current=!1),[]);return t.useEffect((()=>()=>document.removeEventListener("pointerup",g)),[g]),v(p,{asChild:!0,...l,children:v(h.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...a,ref:d,onPointerMove:r(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(m.current||c.isPointerInTransitRef.current||(s.onTriggerEnter(),m.current=!0))})),onPointerLeave:r(e.onPointerLeave,(()=>{s.onTriggerLeave(),m.current=!1})),onPointerDown:r(e.onPointerDown,(()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",g,{once:!0})})),onFocus:r(e.onFocus,(()=>{f.current||s.onOpen()})),onBlur:r(e.onBlur,s.onClose),onClick:r(e.onClick,s.onClose)})})}));N.displayName=I;var H="TooltipPortal",[A,B]=w(H,{forceMount:void 0}),F=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,a=j(H,t);return v(A,{scope:t,forceMount:n,children:v(i,{present:n||a.open,children:v(s,{asChild:!0,container:r,children:o})})})};F.displayName=H;var z="TooltipContent",K=t.forwardRef(((e,t)=>{const n=B(z,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...a}=e,s=j(z,e.__scopeTooltip);return v(i,{present:o||s.open,children:s.disableHoverableContent?v(G,{side:r,...a,ref:t}):v(S,{side:r,...a,ref:t})})})),S=t.forwardRef(((e,n)=>{const r=j(z,e.__scopeTooltip),i=D(z,e.__scopeTooltip),a=t.useRef(null),s=o(n,a),[c,l]=t.useState(null),{trigger:u,onClose:d}=r,p=a.current,{onPointerInTransitChange:f}=i,m=t.useCallback((()=>{l(null),f(!1)}),[f]),h=t.useCallback(((e,t)=>{const n=e.currentTarget,o={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return o}(o,function(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}(o,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(o.y-n.y)>=(e.y-n.y)*(o.x-n.x)))break;t.pop()}t.push(o)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const o=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x)))break;n.pop()}n.push(o)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}(t.getBoundingClientRect())]);l(i),f(!0)}),[f]);return t.useEffect((()=>()=>m()),[m]),t.useEffect((()=>{if(u&&p){const e=e=>h(e,p),t=e=>h(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}}),[u,p,h,m]),t.useEffect((()=>{if(c){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=u?.contains(t)||p?.contains(t),r=!function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e].x,s=t[e].y,c=t[i].x,l=t[i].y;s>o!=l>o&&n<(c-a)*(o-s)/(l-s)+a&&(r=!r)}return r}(n,c);o?m():r&&(m(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,p,c,d,m]),v(G,{...e,ref:s})})),[X,Y]=w(L,{isInside:!1}),q=g("TooltipContent"),G=t.forwardRef(((e,n)=>{const{__scopeTooltip:o,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=e,u=j(z,o),d=T(o),{onClose:p}=u;return t.useEffect((()=>(document.addEventListener(R,p),()=>document.removeEventListener(R,p))),[p]),t.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,p]),v(c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:b(f,{"data-state":u.stateAttribute,...d,...l,ref:n,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v(q,{children:r}),v(X,{scope:o,isInside:!0,children:v(y,{id:u.contentId,role:"tooltip",children:i||r})})]})})}));K.displayName=z;var J="TooltipArrow";t.forwardRef(((e,t)=>{const{__scopeTooltip:n,...o}=e,r=T(n);return Y(J,n).isInside?null:v(m,{...r,...o,ref:t})})).displayName=J;var Q=P,U=M,V=N,W=F,Z=K;function $({delayDuration:e=700,...t}){return n.createElement(Q,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function ee({...e}){return n.createElement($,null,n.createElement(U,{"data-slot":"tooltip",...e}))}function te({...e}){return n.createElement(V,{"data-slot":"tooltip-trigger",...e})}function ne({className:t,sideOffset:o=0,children:r,...i}){return n.createElement(W,null,n.createElement(Z,{"data-slot":"tooltip-content",sideOffset:o,className:e("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-sm shadow-md drop-shadow",t),...i},r))}export{ee as Tooltip,ne as TooltipContent,$ as TooltipProvider,te as TooltipTrigger};
1
+ import{c as e}from"../chunks/utils-BDlXiHS3.mjs";import*as t from"react";import n from"react";import{u as o,c as r,P as i}from"../chunks/index-BE7U1lz3.mjs";import{c as a}from"../chunks/index-BOtb6ofV.mjs";import{P as s,D as c}from"../chunks/index-D1WqwlXc.mjs";import{u as l}from"../chunks/index-DrgyjxdM.mjs";import{c as u,R as d,A as p,C as f,a as m}from"../chunks/index-C8ZqoA88.mjs";import{P as h}from"../chunks/index-BEeVpO2_.mjs";import{createSlottable as g}from"@radix-ui/react-slot";import{u as x}from"../chunks/index-mlVBNiql.mjs";import{R as y}from"../chunks/index-k-LDQli2.mjs";import{jsx as v,jsxs as b}from"react/jsx-runtime";import"../chunks/bundle-mjs-Dthp4wMi.mjs";import"../chunks/index-CIfe3UIG.mjs";import"../chunks/index-DspU1Pyo.mjs";import"react-dom";import"../chunks/index-rHca3YxT.mjs";var[w,C]=a("Tooltip",[u]),T=u(),E="TooltipProvider",k=700,R="tooltip.open",[_,D]=w(E),P=e=>{const{__scopeTooltip:n,delayDuration:o=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,s=t.useRef(!0),c=t.useRef(!1),l=t.useRef(0);return t.useEffect((()=>{const e=l.current;return()=>window.clearTimeout(e)}),[]),v(_,{scope:n,isOpenDelayedRef:s,delayDuration:o,onOpen:t.useCallback((()=>{window.clearTimeout(l.current),s.current=!1}),[]),onClose:t.useCallback((()=>{window.clearTimeout(l.current),l.current=window.setTimeout((()=>s.current=!0),r)}),[r]),isPointerInTransitRef:c,onPointerInTransitChange:t.useCallback((e=>{c.current=e}),[]),disableHoverableContent:i,children:a})};P.displayName=E;var L="Tooltip",[j,O]=w(L),M=e=>{const{__scopeTooltip:n,children:o,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,u=D(L,e.__scopeTooltip),p=T(n),[f,m]=t.useState(null),h=l(),g=t.useRef(0),y=s??u.disableHoverableContent,b=c??u.delayDuration,w=t.useRef(!1),[C,E]=x({prop:r,defaultProp:i??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(R))):u.onClose(),a?.(e)},caller:L}),k=t.useMemo((()=>C?w.current?"delayed-open":"instant-open":"closed"),[C]),_=t.useCallback((()=>{window.clearTimeout(g.current),g.current=0,w.current=!1,E(!0)}),[E]),P=t.useCallback((()=>{window.clearTimeout(g.current),g.current=0,E(!1)}),[E]),O=t.useCallback((()=>{window.clearTimeout(g.current),g.current=window.setTimeout((()=>{w.current=!0,E(!0),g.current=0}),b)}),[b,E]);return t.useEffect((()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)}),[]),v(d,{...p,children:v(j,{scope:n,contentId:h,open:C,stateAttribute:k,trigger:f,onTriggerChange:m,onTriggerEnter:t.useCallback((()=>{u.isOpenDelayedRef.current?O():_()}),[u.isOpenDelayedRef,O,_]),onTriggerLeave:t.useCallback((()=>{y?P():(window.clearTimeout(g.current),g.current=0)}),[P,y]),onOpen:_,onClose:P,disableHoverableContent:y,children:o})})};M.displayName=L;var I="TooltipTrigger",N=t.forwardRef(((e,n)=>{const{__scopeTooltip:i,...a}=e,s=O(I,i),c=D(I,i),l=T(i),u=t.useRef(null),d=o(n,u,s.onTriggerChange),f=t.useRef(!1),m=t.useRef(!1),g=t.useCallback((()=>f.current=!1),[]);return t.useEffect((()=>()=>document.removeEventListener("pointerup",g)),[g]),v(p,{asChild:!0,...l,children:v(h.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...a,ref:d,onPointerMove:r(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(m.current||c.isPointerInTransitRef.current||(s.onTriggerEnter(),m.current=!0))})),onPointerLeave:r(e.onPointerLeave,(()=>{s.onTriggerLeave(),m.current=!1})),onPointerDown:r(e.onPointerDown,(()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",g,{once:!0})})),onFocus:r(e.onFocus,(()=>{f.current||s.onOpen()})),onBlur:r(e.onBlur,s.onClose),onClick:r(e.onClick,s.onClose)})})}));N.displayName=I;var H="TooltipPortal",[A,B]=w(H,{forceMount:void 0}),z=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,a=O(H,t);return v(A,{scope:t,forceMount:n,children:v(i,{present:n||a.open,children:v(s,{asChild:!0,container:r,children:o})})})};z.displayName=H;var F="TooltipContent",K=t.forwardRef(((e,t)=>{const n=B(F,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...a}=e,s=O(F,e.__scopeTooltip);return v(i,{present:o||s.open,children:s.disableHoverableContent?v(q,{side:r,...a,ref:t}):v(S,{side:r,...a,ref:t})})})),S=t.forwardRef(((e,n)=>{const r=O(F,e.__scopeTooltip),i=D(F,e.__scopeTooltip),a=t.useRef(null),s=o(n,a),[c,l]=t.useState(null),{trigger:u,onClose:d}=r,p=a.current,{onPointerInTransitChange:f}=i,m=t.useCallback((()=>{l(null),f(!1)}),[f]),h=t.useCallback(((e,t)=>{const n=e.currentTarget,o={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return o}(o,function(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}(o,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(o.y-n.y)>=(e.y-n.y)*(o.x-n.x)))break;t.pop()}t.push(o)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const o=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x)))break;n.pop()}n.push(o)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}(t.getBoundingClientRect())]);l(i),f(!0)}),[f]);return t.useEffect((()=>()=>m()),[m]),t.useEffect((()=>{if(u&&p){const e=e=>h(e,p),t=e=>h(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}}),[u,p,h,m]),t.useEffect((()=>{if(c){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=u?.contains(t)||p?.contains(t),r=!function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e],s=t[i],c=a.x,l=a.y,u=s.x,d=s.y;l>o!=d>o&&n<(u-c)*(o-l)/(d-l)+c&&(r=!r)}return r}(n,c);o?m():r&&(m(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,p,c,d,m]),v(q,{...e,ref:s})})),[X,Y]=w(L,{isInside:!1}),G=g("TooltipContent"),q=t.forwardRef(((e,n)=>{const{__scopeTooltip:o,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=e,u=O(F,o),d=T(o),{onClose:p}=u;return t.useEffect((()=>(document.addEventListener(R,p),()=>document.removeEventListener(R,p))),[p]),t.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,p]),v(c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:b(f,{"data-state":u.stateAttribute,...d,...l,ref:n,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v(G,{children:r}),v(X,{scope:o,isInside:!0,children:v(y,{id:u.contentId,role:"tooltip",children:i||r})})]})})}));K.displayName=F;var J="TooltipArrow";t.forwardRef(((e,t)=>{const{__scopeTooltip:n,...o}=e,r=T(n);return Y(J,n).isInside?null:v(m,{...r,...o,ref:t})})).displayName=J;var Q=P,U=M,V=N,W=z,Z=K;function $({delayDuration:e=700,...t}){return n.createElement(Q,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function ee({...e}){return n.createElement($,null,n.createElement(U,{"data-slot":"tooltip",...e}))}function te({...e}){return n.createElement(V,{"data-slot":"tooltip-trigger",...e})}function ne({className:t,sideOffset:o=0,children:r,...i}){return n.createElement(W,null,n.createElement(Z,{"data-slot":"tooltip-content",sideOffset:o,className:e("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-sm shadow-md drop-shadow",t),...i},r))}export{ee as Tooltip,ne as TooltipContent,$ as TooltipProvider,te as TooltipTrigger};
2
2
  //# sourceMappingURL=index.mjs.map