@clicktap/ui 1.1.1 → 2.0.3

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 (51) hide show
  1. package/components/Accordion/Accordion.d.ts +76 -2
  2. package/components/Accordion/Accordion.js +1 -1
  3. package/components/Accordion/index.d.ts +2 -3
  4. package/components/Accordion/index.js +1 -1
  5. package/components/Badge/Badge.js +1 -1
  6. package/components/Badge/Badge.types.d.ts +27 -2
  7. package/components/Badge/index.js +1 -1
  8. package/components/Collapsible/Collapsible.js +1 -1
  9. package/components/Collection/CollectionFilters/CollectionFilters.js +1 -1
  10. package/components/Collection/CollectionFilters/index.js +1 -1
  11. package/components/Collection/index.js +1 -1
  12. package/components/ContextMenu/ContextMenu.js +1 -1
  13. package/components/DialogTrigger/DialogTrigger.d.ts +18 -10
  14. package/components/DialogTrigger/DialogTrigger.js +1 -1
  15. package/components/DialogTrigger/index.js +1 -1
  16. package/components/Drawer/Drawer.js +1 -1
  17. package/components/Menu/Menu.js +1 -1
  18. package/components/Meter/Meter.js +1 -1
  19. package/components/NumberTicker/DigitResolver.js +1 -1
  20. package/components/NumberTicker/NumberTicker.js +1 -1
  21. package/components/Pagination/Pagination.d.ts +27 -2
  22. package/components/Pagination/Pagination.js +1 -1
  23. package/components/Pagination/index.js +1 -1
  24. package/components/Progressbar/LinearProgressbar.js +1 -1
  25. package/components/Tabs/Tab.js +1 -1
  26. package/components/Tooltip/Tooltip.d.ts +9 -1
  27. package/components/Tooltip/Tooltip.js +1 -1
  28. package/components/Tooltip/Tooltip.types.d.ts +21 -2
  29. package/components/Tooltip/index.js +1 -1
  30. package/components/UploadImage/UploadImage.js +1 -1
  31. package/docs/migrations/2026/08/ui-2026-08-14-zod-error-map.md +104 -0
  32. package/docs/migrations/2026/08/ui-2026-08-21-graphql-client-string-documents.md +45 -0
  33. package/docs/migrations/2026/08/ui-2026-08-21-graphql-peer-covered.md +26 -0
  34. package/docs/migrations/2026/08/ui-2026-08-21-heroui-removed.md +54 -0
  35. package/docs/migrations/2026/08/ui-2026-08-21-lazymotion-m-components.md +54 -0
  36. package/docs/migrations/2026/08/ui-2026-08-21-modal-triggers-wired-explicitly.md +43 -0
  37. package/docs/migrations/2026/08/ui-2026-08-21-next-image-fallback-keeps-fill.md +38 -0
  38. package/docs/migrations/2026/08/ui-2026-08-22-accordion-divider-between-items.md +30 -0
  39. package/docs/migrations/2026/08/ui-2026-08-22-accordion-divider-class-ownership.md +14 -0
  40. package/docs/migrations/2026/08/ui-2026-08-22-react-aria-moves-as-one-version-set.md +46 -0
  41. package/docs/migrations/index.json +117 -2
  42. package/next/Image.js +1 -1
  43. package/package.json +10 -38
  44. package/utils/createAuthAwareGraphqlClient.d.ts +104 -16
  45. package/utils/createAuthAwareGraphqlClient.js +1 -56
  46. package/utils/zod/configureZodErrorMap.d.ts +115 -0
  47. package/utils/zod/configureZodErrorMap.js +1 -0
  48. package/utils/zod/index.d.ts +1 -0
  49. package/utils/zod/index.js +1 -0
  50. package/utils/zod.d.ts +1 -0
  51. package/utils/zod.js +1 -0
@@ -1,4 +1,78 @@
1
- import { AccordionProps } from '@heroui/accordion';
2
- export declare function Accordion({ children, variant, isCompact, className, itemClasses, ...props }: AccordionProps): import("react/jsx-runtime").JSX.Element;
1
+ import { ComponentType, ReactNode } from 'react';
2
+ /**
3
+ * Native accordion on react-aria-components Disclosure (CTAP-1383).
4
+ *
5
+ * Previously a styled wrapper around @heroui/accordion — the ONLY
6
+ * initially-rendered @heroui consumer (the PLP filter sidebar), which pulled
7
+ * the whole @heroui system + theme (~25 KiB gz) into every page's initial JS.
8
+ * react-aria-components is already this library's base, so the rewrite costs
9
+ * nothing new. API-compatible with the call sites this repo uses:
10
+ * selectionMode / defaultSelectedKeys ("all" included), per-item title,
11
+ * subtitle, startContent, indicator (component, receives nothing, rotates on
12
+ * open), classNames slots, showDivider (an <hr> between items — consumers
13
+ * hide it with [&_hr]:hidden), onPress, and the `data-open` attribute on
14
+ * heading/trigger/indicator that consumers style with data-[open=true]:.
15
+ * Height animates with the CSS grid-rows trick — no animation runtime.
16
+ */
17
+ type ItemSlotClassNames = {
18
+ base?: string;
19
+ heading?: string;
20
+ trigger?: string;
21
+ titleWrapper?: string;
22
+ title?: string;
23
+ subtitle?: string;
24
+ startContent?: string;
25
+ content?: string;
26
+ indicator?: string;
27
+ };
28
+ /** What an indicator component receives — heroui's contract, kept. */
29
+ export type AccordionItemIndicatorProps = {
30
+ isOpen?: boolean;
31
+ };
32
+ export type AccordionItemProps = {
33
+ children?: ReactNode;
34
+ title?: ReactNode;
35
+ subtitle?: ReactNode;
36
+ startContent?: ReactNode;
37
+ indicator?: ComponentType<AccordionItemIndicatorProps> | ReactNode;
38
+ hideIndicator?: boolean;
39
+ disableIndicatorAnimation?: boolean;
40
+ isDisabled?: boolean;
41
+ textValue?: string;
42
+ 'aria-label'?: string;
43
+ classNames?: ItemSlotClassNames;
44
+ onPress?: () => void;
45
+ };
46
+ export type AccordionProps = {
47
+ children?: ReactNode;
48
+ selectionMode?: 'single' | 'multiple';
49
+ defaultSelectedKeys?: 'all' | Iterable<string>;
50
+ /** heroui alias for defaultSelectedKeys. */
51
+ defaultExpandedKeys?: 'all' | Iterable<string>;
52
+ /** Controlled expanded keys. */
53
+ selectedKeys?: 'all' | Iterable<string>;
54
+ onSelectionChange?: (keys: Set<string>) => void;
55
+ disallowEmptySelection?: boolean;
56
+ keepContentMounted?: boolean;
57
+ /** Hide every item's indicator (heroui group-level prop). */
58
+ hideIndicator?: boolean;
59
+ showDivider?: boolean;
60
+ dividerProps?: {
61
+ className?: string;
62
+ };
63
+ /** Accepted for heroui compatibility; not rendered. */
64
+ title?: ReactNode;
65
+ variant?: 'light' | 'bordered' | 'shadow' | 'splitted';
66
+ isCompact?: boolean;
67
+ className?: string;
68
+ itemClasses?: ItemSlotClassNames;
69
+ };
70
+ /**
71
+ * Configuration carrier — never rendered directly; {@link Accordion} reads
72
+ * its props off the element. Mirrors the heroui usage pattern so call sites
73
+ * did not change.
74
+ */
75
+ export declare function AccordionItem(_props: AccordionItemProps): null;
76
+ export declare function Accordion({ children, selectionMode, defaultSelectedKeys, defaultExpandedKeys, selectedKeys, onSelectionChange, disallowEmptySelection, hideIndicator: groupHideIndicator, showDivider, dividerProps, variant, isCompact, className, itemClasses, }: AccordionProps): import("react/jsx-runtime").JSX.Element;
3
77
  export default Accordion;
4
78
  export declare function AccordionItemArrow(): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as d}from"react/jsx-runtime";import{Accordion as u}from"@heroui/accordion";import{cn as r}from"../../utils/cn.js";import{DownArrow as i}from"../Icon/DownArrow.js";function a({children:n,variant:o,isCompact:t,className:l,itemClasses:e,...b}){return d(u,{variant:o,isCompact:t,dividerProps:{className:r("my-2 border-solid border-border-subtle",o==="shadow"&&"border-border")},className:r("px-0",o==="bordered"&&["px-4 py-4 rounded-xl border-2 border-border-subtle"],o==="shadow"&&["px-4 py-4 rounded-xl bg-surface-subtle shadow-slate-200 border border-border-subtle"],l),itemClasses:{base:r("w-full py-2",'data-[disabled="true"]:pointer-events-none data-[disabled="true"]:opacity-50',o==="bordered"&&["rounded-xl py-0"],o==="splitted"&&["flex flex-col bg-surface-subtle rounded-xl border border-border-subtle"],t&&"py-0",e?.base),trigger:r("w-full h-full flex items-center gap-3 py-0 appearance-none cursor-pointer select-none","focus-visible:outline-2 focus-visible:outline focus-visible:outline-slate-100","bg-transparent text-inherit",t&&["py-2"],e?.trigger),title:r("text-xl font-semibold",t&&"text-base",e?.title),subtitle:r("text-base",t&&"text-sm",e?.subtitle),titleWrapper:r("text-left",e?.titleWrapper),startContent:r("shrink-0",e?.startContent),content:r([t?"py-1":"py-2"],e?.content),indicator:e?.indicator,heading:e?.heading},...b,children:n})}function x(){return d(i,{className:"w-4 h-4"})}export{a as Accordion,x as AccordionItemArrow,a as default};
1
+ "use client";import{jsx as e,jsxs as d,Fragment as O}from"react/jsx-runtime";import{Children as V,isValidElement as _,Fragment as $}from"react";import{DisclosureGroup as q,Disclosure as H,Button as J,DisclosurePanel as L}from"react-aria-components";import{cn as r}from"../../utils/cn.js";import{DownArrow as x}from"../Icon/DownArrow.js";function Z(p){return null}function E({children:p,selectionMode:y="single",defaultSelectedKeys:N,defaultExpandedKeys:w,selectedKeys:k,onSelectionChange:A,disallowEmptySelection:I=!1,hideIndicator:v=!1,showDivider:S=!0,dividerProps:D,variant:i,isCompact:s,className:F,itemClasses:n}){const c=V.toArray(p).filter(_),K=c.map((t,l)=>String(t.key??l)),b=t=>t==="all"?K:t?[...t].map(String):void 0,j=b(N??w)??[],P=b(k);return e(q,{allowsMultipleExpanded:y==="multiple",defaultExpandedKeys:j,expandedKeys:P,onExpandedChange:t=>{const l=new Set([...t].map(String));I&&l.size===0||A?.(l)},className:r("px-0",i==="bordered"&&["px-4 py-4 rounded-xl border-2 border-border-subtle"],i==="shadow"&&["px-4 py-4 rounded-xl bg-surface-subtle shadow-slate-200 border border-border-subtle"],F),children:c.map((t,l)=>{const h=String(t.key??l),{title:W,subtitle:f,startContent:m,indicator:u,hideIndicator:z,disableIndicatorAnimation:g,isDisabled:B,classNames:o,onPress:G,children:M}=t.props;return d($,{children:[e(H,{id:h,isDisabled:B,className:r("w-full py-2","data-disabled:pointer-events-none data-disabled:opacity-50",i==="bordered"&&["rounded-xl py-0"],i==="splitted"&&["flex flex-col bg-surface-subtle rounded-xl border border-border-subtle"],s&&"py-0",n?.base,o?.base),children:({isExpanded:a})=>d(O,{children:[e("h2",{"data-open":a||void 0,className:r(n?.heading,o?.heading),children:d(J,{slot:"trigger","data-open":a||void 0,onPress:G,"aria-label":t.props["aria-label"],className:r("w-full h-full flex items-center gap-3 py-0 appearance-none cursor-pointer select-none","border-0 focus-visible:outline-2 focus-visible:outline focus-visible:outline-slate-100","bg-transparent text-inherit",s&&["py-2"],n?.trigger,o?.trigger),children:[m!=null&&e("span",{className:r("shrink-0",n?.startContent,o?.startContent),children:m}),d("span",{className:r("flex-1 text-left",n?.titleWrapper,o?.titleWrapper),children:[e("span",{className:r("block text-xl font-semibold",s&&"text-base",n?.title,o?.title),children:W}),f!=null&&e("span",{className:r("block text-base",s&&"text-sm",n?.subtitle,o?.subtitle),children:f})]}),z||v?null:e("span",{"aria-hidden":"true","data-open":a||void 0,className:r("shrink-0",!g&&"transition-transform duration-200",!g&&a&&"-rotate-180",n?.indicator,o?.indicator),children:typeof u=="function"?e(u,{isOpen:a}):u??e(x,{className:"w-4 h-4"})})]})}),e("div",{className:r("grid transition-[grid-template-rows] duration-200 ease-in-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:e("div",{className:"overflow-hidden min-h-0",children:e(L,{className:r(s?"py-1":"py-2",n?.content,o?.content),children:M})})})]})}),S&&l<c.length-1&&e("hr",{className:r("border-solid border-b-0 border-x-0",D?.className??["my-2 border-border-subtle",i==="shadow"&&"border-border"])})]},h)})})}function C(){return e(x,{className:"w-4 h-4"})}export{E as Accordion,Z as AccordionItem,C as AccordionItemArrow,E as default};
@@ -1,3 +1,2 @@
1
- export { Accordion, AccordionItemArrow } from './Accordion';
2
- export { AccordionItem } from '@heroui/accordion';
3
- export type { AccordionProps } from '@heroui/accordion';
1
+ export { Accordion, AccordionItem, AccordionItemArrow } from './Accordion';
2
+ export type { AccordionProps, AccordionItemProps, AccordionItemIndicatorProps, } from './Accordion';
@@ -1 +1 @@
1
- import{Accordion as i,AccordionItemArrow as p}from"./Accordion.js";import{AccordionItem as A}from"@heroui/accordion";import"react/jsx-runtime";import"../../utils/cn.js";import"../Icon/DownArrow.js";export{i as Accordion,A as AccordionItem,p as AccordionItemArrow};
1
+ import{Accordion as A,AccordionItem as d,AccordionItemArrow as e}from"./Accordion.js";import"react/jsx-runtime";import"react";import"react-aria-components";import"../../utils/cn.js";import"../Icon/DownArrow.js";export{A as Accordion,d as AccordionItem,e as AccordionItemArrow};
@@ -1 +1 @@
1
- "use client";import{jsx as a}from"react/jsx-runtime";import{useId as y}from"react";import{AnimatePresence as V,motion as z}from"framer-motion";import{Badge as C}from"@heroui/badge";import{cn as n}from"../../utils/cn.js";const B={hidden:{opacity:0,scale:0},show:{opacity:1,scale:1}};function P({children:h,isInvisible:l,disableAnimation:d,placement:t="top-right",shape:r="rectangle",className:f,classNames:g,showOutline:b=!1,content:o,isDot:s,isOneChar:x,size:i="md",variant:e="solid",...c}){const m=y(),p=d?{duration:0}:{type:"spring",bounce:.3},_=String(o)?.length===1||x,w={sm:"text-xs",md:"text-sm",lg:"text-sm"},u=_?{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[i]:{sm:"min-w-4 h-4",md:"min-w-5 h-5",lg:"min-w-6 h-6"}[i];return a(C,{...c,size:i,variant:e,isInvisible:l,isDot:s,classNames:{base:n("relative","inline-flex shrink-0",g?.base),badge:n("p-0","border-0","absolute z-10",[t==="top-right"&&r==="rectangle"&&"top-0.5 right-px",t==="top-right"&&r==="circle"&&"top-1 right-1",t==="bottom-right"&&r==="rectangle"&&"bottom-0.5 right-px",t==="bottom-right"&&r==="circle"&&"bottom-1 right-1",t==="top-left"&&r==="rectangle"&&"top-0.5 left-px",t==="top-left"&&r==="circle"&&"top-1 left-1",t==="bottom-left"&&r==="rectangle"&&"bottom-0.5 left-px",t==="bottom-left"&&r==="circle"&&"bottom-1 left-1"],[t==="top-right"&&"translate-x-1/2 -translate-y-1/2",t==="bottom-right"&&"translate-x-1/2 translate-y-1/2",t==="bottom-left"&&"-translate-x-1/2 translate-y-1/2",t==="top-left"&&"-translate-x-1/2 -translate-y-1/2"],g?.badge)},content:a(V,{children:!l&&a(z.span,{layout:!0,variants:B,initial:d?"show":"hidden",transition:p,animate:"show",exit:"hidden",className:n("flex flex-wrap","place-content-center","z-10","box-border","rounded-full","py-0 px-1","font-normal text-fg","select-none","whitespace-normal",e==="faded"?"text-slate-800":"text-white",!o||s?"w-3.5 h-3.5":u,typeof o=="string"&&o.length>1||s?"text-xs":w[i],[e==="solid"&&"bg-surface-inverse-hover",e==="shadow"&&"bg-surface-inverse-hover",e==="flat"&&"bg-surface-inverse-hover/55",e==="faded"&&"bg-white"],[e==="faded"&&"border-2 border-solid border-surface-inverse-hover",b&&e!=="faded"&&"border-2 border-solid border-white"],e==="shadow"&&"shadow-[0_0_0_0_rgba(0,0,0,0),_0_0_0_0_rgba(0,0,0,0),_0_10px_15px_-3px_rgba(30,41,59,0.3),_0_4px_6px_-4px_rgba(30,41,59,0.3)]",f),children:o},`badge-${m}`)}),children:h})}export{P as Badge,P as default};
1
+ "use client";import{jsxs as V,jsx as n}from"react/jsx-runtime";import{useId as v}from"react";import{AnimatePresence as z,m as C}from"framer-motion";import{cn as a}from"../../utils/cn.js";const S={hidden:{opacity:0,scale:0},show:{opacity:1,scale:1}};function P({children:h,isInvisible:f,disableAnimation:l,placement:t="top-right",shape:e="rectangle",className:g,classNames:d,showOutline:c=!1,content:o,isDot:i,isOneChar:x,size:s="md",variant:r="solid",...b}){const m=v(),u=l?{duration:0}:{type:"spring",bounce:.3},w=String(o)?.length===1||x,p={sm:"text-xs",md:"text-sm",lg:"text-sm"},y=w?{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[s]:{sm:"min-w-4 h-4",md:"min-w-5 h-5",lg:"min-w-6 h-6"}[s];return V("div",{...b,className:a("relative","inline-flex shrink-0",g,d?.base),children:[h,n("span",{className:a("p-0","border-0","absolute z-10","flex",[t==="top-right"&&e==="rectangle"&&"top-0.5 right-px",t==="top-right"&&e==="circle"&&"top-1 right-1",t==="bottom-right"&&e==="rectangle"&&"bottom-0.5 right-px",t==="bottom-right"&&e==="circle"&&"bottom-1 right-1",t==="top-left"&&e==="rectangle"&&"top-0.5 left-px",t==="top-left"&&e==="circle"&&"top-1 left-1",t==="bottom-left"&&e==="rectangle"&&"bottom-0.5 left-px",t==="bottom-left"&&e==="circle"&&"bottom-1 left-1"],[t==="top-right"&&"translate-x-1/2 -translate-y-1/2",t==="bottom-right"&&"translate-x-1/2 translate-y-1/2",t==="bottom-left"&&"-translate-x-1/2 translate-y-1/2",t==="top-left"&&"-translate-x-1/2 -translate-y-1/2"],d?.badge),children:n(z,{children:!f&&n(C.span,{layout:!0,variants:S,initial:l?"show":"hidden",transition:u,animate:"show",exit:"hidden",className:a("flex flex-wrap","place-content-center","z-10","box-border","rounded-full","py-0 px-1","font-normal text-fg","select-none","whitespace-normal",r==="faded"?"text-slate-800":"text-white",!o||i?"w-3.5 h-3.5":y,typeof o=="string"&&o.length>1||i?"text-xs":p[s],[r==="solid"&&"bg-surface-inverse-hover",r==="shadow"&&"bg-surface-inverse-hover",r==="flat"&&"bg-surface-inverse-hover/55",r==="faded"&&"bg-white"],[r==="faded"&&"border-2 border-solid border-surface-inverse-hover",c&&r!=="faded"&&"border-2 border-solid border-white"]),children:!i&&o},`badge-${m}`)})})]})}export{P as Badge,P as default};
@@ -1,2 +1,27 @@
1
- import { BadgeProps as NextBadgeProps } from '@heroui/badge';
2
- export type BadgeProps = Omit<NextBadgeProps, 'color | disableOutline'>;
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * Structural props (CTAP-1383): previously `Omit<@heroui/badge Props, ...>`.
4
+ * The heroui component only contributed two wrapper elements while every
5
+ * visual class already lived here — importing it cost the whole @heroui
6
+ * system (~25 KiB gz) in the initial bundle of every page via the header's
7
+ * cart badge. Same prop names and defaults as before.
8
+ */
9
+ export type BadgeProps = Omit<HTMLAttributes<HTMLDivElement>, 'content'> & {
10
+ children?: ReactNode;
11
+ /** Badge content (count, dot, node). */
12
+ content?: ReactNode;
13
+ /** Hide the badge bubble (children stay rendered). */
14
+ isInvisible?: boolean;
15
+ disableAnimation?: boolean;
16
+ placement?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
17
+ shape?: 'rectangle' | 'circle';
18
+ classNames?: {
19
+ base?: string;
20
+ badge?: string;
21
+ };
22
+ showOutline?: boolean;
23
+ isDot?: boolean;
24
+ isOneChar?: boolean;
25
+ size?: 'sm' | 'md' | 'lg';
26
+ variant?: 'solid' | 'shadow' | 'flat' | 'faded';
27
+ };
@@ -1 +1 @@
1
- import{Badge as a}from"./Badge.js";import"react/jsx-runtime";import"react";import"framer-motion";import"@heroui/badge";import"../../utils/cn.js";export{a as Badge};
1
+ import{Badge as e}from"./Badge.js";import"react/jsx-runtime";import"react";import"framer-motion";import"../../utils/cn.js";export{e as Badge};
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import{useContext as p}from"react";import{motion as a}from"framer-motion";import{CollapsibleTriggerStateContext as l}from"./CollapsibleTrigger.js";import{cn as m}from"../../utils/cn.js";import"react-aria-components";import"@react-stately/utils";import"@react-aria/interactions";function g({children:i,className:t}){const{isOpen:e,id:o,defaultOpen:n}=p(l);return r(a.div,{className:m("w-full overflow-hidden",t),id:o,variants:{hidden:{height:"0px",opacity:0},visible:{height:"auto",opacity:1}},initial:n?"visible":"hidden",animate:e?"visible":"hidden",transition:{type:"spring",bounce:0},children:i})}export{g as Collapsible,g as default};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{useContext as p}from"react";import{m as a}from"framer-motion";import{CollapsibleTriggerStateContext as l}from"./CollapsibleTrigger.js";import{cn as m}from"../../utils/cn.js";import"react-aria-components";import"@react-stately/utils";import"@react-aria/interactions";function g({children:i,className:t}){const{isOpen:e,id:o,defaultOpen:r}=p(l);return n(a.div,{className:m("w-full overflow-hidden",t),id:o,variants:{hidden:{height:"0px",opacity:0},visible:{height:"auto",opacity:1}},initial:r?"visible":"hidden",animate:e?"visible":"hidden",transition:{type:"spring",bounce:0},children:i})}export{g as Collapsible,g as default};
@@ -1 +1 @@
1
- "use client";import{jsxs as l,Fragment as h,jsx as e}from"react/jsx-runtime";import{useMemo as b,Suspense as x,useState as v}from"react";import{Accordion as g}from"../../Accordion/Accordion.js";import{AccordionItem as w}from"@heroui/accordion";import{Button as f}from"../../Button/Button.js";import"../../../utils/cn.js";import{ModalOverlay as y}from"../../ModalOverlay/ModalOverlay.js";import{Modal as N}from"../../Modal/Modal.js";import{Drawer as k}from"../../Drawer/Drawer.js";import{Cross as C}from"../../Icon/Cross.js";import{CrossSmall as A}from"../../Icon/CrossSmall.js";import{Search as D}from"../../Icon/Search.js";import{FilterRenderer as I}from"../FilterRenderer/FilterRenderer.js";import{mergeFilters as S}from"../../../utils/collection/mergeFilters.js";import{FilterAccordionTitle as j}from"../FilterAccordionTitle/FilterAccordionTitle.js";import{EmptyResults as L}from"../EmptyResults/EmptyResults.js";import"../../Icon/DownArrow.js";import"react-aria-components";import"framer-motion";import"../../../utils/env.js";import"../../../utils/swatch.js";import"../FilterRenderer/Renderer/Option.js";import"../../Checkbox/Checkbox.js";import"../FilterRenderer/Renderer/useOptionFilterToggle.js";import"../FilterRenderer/Renderer/Swatch.js";import"../FilterRenderer/Renderer/Swatch/SwatchColor.js";import"../../Icon/CheckIcon.js";import"../../../utils/color.js";import"../FilterRenderer/Renderer/Swatch/SwatchImage.js";import"../FilterRenderer/Renderer/Swatch/SwatchText.js";import"../FilterRenderer/Renderer/Boolean.js";import"../../RadioGroup/RadioGroup.js";import"../../Radio/Radio.js";import"../FilterRenderer/Renderer/Range.js";function M(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function V({value:a,onChange:r}){const[o,c]=v(a),m=()=>{r(o.trim())};return l("div",{className:"relative",children:[e("input",{type:"search",value:o,onChange:i=>c(i.target.value),onKeyDown:i=>{i.key==="Enter"&&(i.preventDefault(),m())},onBlur:m,placeholder:"Search products...","aria-label":"Search products",autoComplete:"off",className:"w-full h-9 pl-8 pr-8 rounded-md border border-border bg-white text-sm text-fg placeholder:text-fg-subtle focus:outline-none focus:border-border-emphasis [&::-webkit-search-cancel-button]:hidden"}),o&&e("button",{type:"button",onClick:()=>{c(""),r("")},"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 p-0.5 rounded-full hover:bg-surface-subtle transition-colors",children:e(A,{})}),e("span",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 [&>svg]:w-full [&>svg]:h-full text-fg-subtle",children:e(D,{})})]})}function pe({availableFilters:a,appliedFilters:r,onFilterChange:o,showMobileFilters:c,setShowMobileFilters:m,searchQuery:s,onSearchChange:n,totalItems:i}){const u=b(()=>S(r,a).filter(t=>t.includeInFilters!==!1),[r,a]),d=n&&e(V,{value:s??"",onChange:n},s),p=()=>u.length>0&&e(g,{selectionMode:"multiple",defaultSelectedKeys:"all",className:"pt-2 mt-3",showDivider:!1,itemClasses:{base:"py-1",title:"text-sm font-medium leading-7",trigger:"py-2 border-b border-gray-200",indicator:'data-[open="true"]:rotate-180',content:"pt-2 pb-3"},children:u.map(t=>e(w,{textValue:t.label,title:e(j,{filter:t,appliedFilters:r,onFilterChange:o}),disableIndicatorAnimation:!0,indicator:M,children:e("div",{className:"pt-2",children:e(I,{filter:t,onFilterChange:o,appliedFilters:r,variant:"sidebar"})})},t.code))});return l(h,{children:[l("div",{className:"hidden lg:flex lg:flex-col lg:basis-[16.5rem] lg:shrink-0",children:[d,p(),r.length>0&&e("button",{type:"button",className:"text-sm text-fg-muted hover:text-slate-700 transition-colors mt-4 mb-8",onClick:()=>o([]),children:"Clear all filters"})]}),e("div",{className:"lg:hidden",children:e(x,{children:e(y,{isOpen:c,onOpenChange:t=>m(t),isDismissable:!0,children:e(N,{children:e(k,{size:"30rem",direction:"left","aria-label":"Filters",className:"p-5",children:({close:t})=>l("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[l("div",{className:"flex items-center w-full justify-between",children:[e("span",{className:"text-xl font-bold text-slate-800",children:"Filters"}),e(f,{variant:"ghost","aria-label":"Close",onPress:()=>t(),className:"justify-start size-auto p-0",children:e(C,{})})]}),l("div",{className:"flex flex-col flex-1 overflow-x-hidden overflow-y-auto [scrollbar-width:none] [-webkit-overflow-scrolling:touch] [&::-webkit-scrollbar]:hidden",children:[d&&e("div",{className:"mt-3",children:d}),p(),i===0&&e(L,{searchQuery:s,hasFilters:r.length>0,onClearFilters:()=>o([]),onClearSearch:s&&n?()=>n(""):void 0})]}),l("div",{className:"shrink-0 pt-3 flex flex-col gap-3 border-t border-gray-200",children:[r.length>0&&e("button",{type:"button",className:"text-sm py-2 text-fg-muted hover:text-slate-700 transition-colors",onClick:()=>o([]),children:"Clear all"}),e(f,{className:"w-full py-6 text-base rounded-xl",variant:"primary",onPress:()=>t(),children:"View Results"})]})]})})})})})})]})}export{pe as CollectionFilters};
1
+ "use client";import{jsxs as o,Fragment as h,jsx as e}from"react/jsx-runtime";import{useMemo as b,Suspense as x,useState as v}from"react";import{Accordion as g,AccordionItem as w}from"../../Accordion/Accordion.js";import{Button as f}from"../../Button/Button.js";import"../../../utils/cn.js";import{ModalOverlay as y}from"../../ModalOverlay/ModalOverlay.js";import{Modal as N}from"../../Modal/Modal.js";import{Drawer as k}from"../../Drawer/Drawer.js";import{Cross as C}from"../../Icon/Cross.js";import{CrossSmall as A}from"../../Icon/CrossSmall.js";import{Search as D}from"../../Icon/Search.js";import{FilterRenderer as I}from"../FilterRenderer/FilterRenderer.js";import{mergeFilters as S}from"../../../utils/collection/mergeFilters.js";import{FilterAccordionTitle as j}from"../FilterAccordionTitle/FilterAccordionTitle.js";import{EmptyResults as L}from"../EmptyResults/EmptyResults.js";import"react-aria-components";import"../../Icon/DownArrow.js";import"framer-motion";import"../../../utils/env.js";import"../../../utils/swatch.js";import"../FilterRenderer/Renderer/Option.js";import"../../Checkbox/Checkbox.js";import"../FilterRenderer/Renderer/useOptionFilterToggle.js";import"../FilterRenderer/Renderer/Swatch.js";import"../FilterRenderer/Renderer/Swatch/SwatchColor.js";import"../../Icon/CheckIcon.js";import"../../../utils/color.js";import"../FilterRenderer/Renderer/Swatch/SwatchImage.js";import"../FilterRenderer/Renderer/Swatch/SwatchText.js";import"../FilterRenderer/Renderer/Boolean.js";import"../../RadioGroup/RadioGroup.js";import"../../Radio/Radio.js";import"../FilterRenderer/Renderer/Range.js";function M(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function V({value:a,onChange:r}){const[l,c]=v(a),m=()=>{r(l.trim())};return o("div",{className:"relative",children:[e("input",{type:"search",value:l,onChange:i=>c(i.target.value),onKeyDown:i=>{i.key==="Enter"&&(i.preventDefault(),m())},onBlur:m,placeholder:"Search products...","aria-label":"Search products",autoComplete:"off",className:"w-full h-9 pl-8 pr-8 rounded-md border border-border bg-white text-sm text-fg placeholder:text-fg-subtle focus:outline-none focus:border-border-emphasis [&::-webkit-search-cancel-button]:hidden"}),l&&e("button",{type:"button",onClick:()=>{c(""),r("")},"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 p-0.5 rounded-full hover:bg-surface-subtle transition-colors",children:e(A,{})}),e("span",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 [&>svg]:w-full [&>svg]:h-full text-fg-subtle",children:e(D,{})})]})}function ue({availableFilters:a,appliedFilters:r,onFilterChange:l,showMobileFilters:c,setShowMobileFilters:m,searchQuery:s,onSearchChange:n,totalItems:i}){const u=b(()=>S(r,a).filter(t=>t.includeInFilters!==!1),[r,a]),d=n&&e(V,{value:s??"",onChange:n},s),p=()=>u.length>0&&e(g,{selectionMode:"multiple",defaultSelectedKeys:"all",className:"pt-2 mt-3",showDivider:!1,itemClasses:{base:"py-1",title:"text-sm font-medium leading-7",trigger:"py-2 border-b border-gray-200",indicator:'data-[open="true"]:rotate-180',content:"pt-2 pb-3"},children:u.map(t=>e(w,{textValue:t.label,title:e(j,{filter:t,appliedFilters:r,onFilterChange:l}),disableIndicatorAnimation:!0,indicator:M,children:e("div",{className:"pt-2",children:e(I,{filter:t,onFilterChange:l,appliedFilters:r,variant:"sidebar"})})},t.code))});return o(h,{children:[o("div",{className:"hidden lg:flex lg:flex-col lg:basis-[16.5rem] lg:shrink-0",children:[d,p(),r.length>0&&e("button",{type:"button",className:"text-sm text-fg-muted hover:text-slate-700 transition-colors mt-4 mb-8",onClick:()=>l([]),children:"Clear all filters"})]}),e("div",{className:"lg:hidden",children:e(x,{children:e(y,{isOpen:c,onOpenChange:t=>m(t),isDismissable:!0,children:e(N,{children:e(k,{size:"30rem",direction:"left","aria-label":"Filters",className:"p-5",children:({close:t})=>o("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[o("div",{className:"flex items-center w-full justify-between",children:[e("span",{className:"text-xl font-bold text-slate-800",children:"Filters"}),e(f,{variant:"ghost","aria-label":"Close",onPress:()=>t(),className:"justify-start size-auto p-0",children:e(C,{})})]}),o("div",{className:"flex flex-col flex-1 overflow-x-hidden overflow-y-auto [scrollbar-width:none] [-webkit-overflow-scrolling:touch] [&::-webkit-scrollbar]:hidden",children:[d&&e("div",{className:"mt-3",children:d}),p(),i===0&&e(L,{searchQuery:s,hasFilters:r.length>0,onClearFilters:()=>l([]),onClearSearch:s&&n?()=>n(""):void 0})]}),o("div",{className:"shrink-0 pt-3 flex flex-col gap-3 border-t border-gray-200",children:[r.length>0&&e("button",{type:"button",className:"text-sm py-2 text-fg-muted hover:text-slate-700 transition-colors",onClick:()=>l([]),children:"Clear all"}),e(f,{className:"w-full py-6 text-base rounded-xl",variant:"primary",onPress:()=>t(),children:"View Results"})]})]})})})})})})]})}export{ue as CollectionFilters};
@@ -1 +1 @@
1
- import{CollectionFilters as K}from"./CollectionFilters.js";import"react/jsx-runtime";import"react";import"../../Accordion/Accordion.js";import"@heroui/accordion";import"../../../utils/cn.js";import"../../Icon/DownArrow.js";import"../../Button/Button.js";import"react-aria-components";import"../../ModalOverlay/ModalOverlay.js";import"framer-motion";import"../../Modal/Modal.js";import"../../Drawer/Drawer.js";import"../../Icon/Cross.js";import"../../Icon/CrossSmall.js";import"../../Icon/Search.js";import"../FilterRenderer/FilterRenderer.js";import"../../../utils/env.js";import"../../../utils/swatch.js";import"../FilterRenderer/Renderer/Option.js";import"../../Checkbox/Checkbox.js";import"../FilterRenderer/Renderer/useOptionFilterToggle.js";import"../FilterRenderer/Renderer/Swatch.js";import"../FilterRenderer/Renderer/Swatch/SwatchColor.js";import"../../Icon/CheckIcon.js";import"../../../utils/color.js";import"../FilterRenderer/Renderer/Swatch/SwatchImage.js";import"../FilterRenderer/Renderer/Swatch/SwatchText.js";import"../FilterRenderer/Renderer/Boolean.js";import"../../RadioGroup/RadioGroup.js";import"../../Radio/Radio.js";import"../FilterRenderer/Renderer/Range.js";import"../../../utils/collection/mergeFilters.js";import"../FilterAccordionTitle/FilterAccordionTitle.js";import"../EmptyResults/EmptyResults.js";export{K as CollectionFilters};
1
+ import{CollectionFilters as J}from"./CollectionFilters.js";import"react/jsx-runtime";import"react";import"../../Accordion/Accordion.js";import"react-aria-components";import"../../../utils/cn.js";import"../../Icon/DownArrow.js";import"../../Button/Button.js";import"../../ModalOverlay/ModalOverlay.js";import"framer-motion";import"../../Modal/Modal.js";import"../../Drawer/Drawer.js";import"../../Icon/Cross.js";import"../../Icon/CrossSmall.js";import"../../Icon/Search.js";import"../FilterRenderer/FilterRenderer.js";import"../../../utils/env.js";import"../../../utils/swatch.js";import"../FilterRenderer/Renderer/Option.js";import"../../Checkbox/Checkbox.js";import"../FilterRenderer/Renderer/useOptionFilterToggle.js";import"../FilterRenderer/Renderer/Swatch.js";import"../FilterRenderer/Renderer/Swatch/SwatchColor.js";import"../../Icon/CheckIcon.js";import"../../../utils/color.js";import"../FilterRenderer/Renderer/Swatch/SwatchImage.js";import"../FilterRenderer/Renderer/Swatch/SwatchText.js";import"../FilterRenderer/Renderer/Boolean.js";import"../../RadioGroup/RadioGroup.js";import"../../Radio/Radio.js";import"../FilterRenderer/Renderer/Range.js";import"../../../utils/collection/mergeFilters.js";import"../FilterAccordionTitle/FilterAccordionTitle.js";import"../EmptyResults/EmptyResults.js";export{J as CollectionFilters};
@@ -1 +1 @@
1
- import{AttributeDataProvider as U,useAttributeData as V}from"./AttributeDataProvider/AttributeDataProvider.js";import{EmptyResults as X}from"./EmptyResults/EmptyResults.js";import{ProductPrice as Z}from"./ProductPrice/ProductPrice.js";import{FilterRenderer as $}from"./FilterRenderer/FilterRenderer.js";import{CollectionFilterChips as or}from"./CollectionFilterChips/CollectionFilterChips.js";import{FilterAccordionTitle as ir}from"./FilterAccordionTitle/FilterAccordionTitle.js";import{ProductCardSwatches as mr}from"./ProductCardSwatches/ProductCardSwatches.js";import{CollectionFilters as lr}from"./CollectionFilters/CollectionFilters.js";import{CollectionToolbar as fr}from"./CollectionToolbar/CollectionToolbar.js";import"react/jsx-runtime";import"react";import"../../utils/env.js";import"../../utils/swatch.js";import"./FilterRenderer/Renderer/Option.js";import"../Checkbox/Checkbox.js";import"react-aria-components";import"../../utils/cn.js";import"./FilterRenderer/Renderer/useOptionFilterToggle.js";import"./FilterRenderer/Renderer/Swatch.js";import"./FilterRenderer/Renderer/Swatch/SwatchColor.js";import"../Icon/CheckIcon.js";import"../../utils/color.js";import"./FilterRenderer/Renderer/Swatch/SwatchImage.js";import"./FilterRenderer/Renderer/Swatch/SwatchText.js";import"./FilterRenderer/Renderer/Boolean.js";import"../RadioGroup/RadioGroup.js";import"../Radio/Radio.js";import"./FilterRenderer/Renderer/Range.js";import"../Button/Button.js";import"../Icon/CrossSmall.js";import"../../utils/collection/getAppliedFilterChips.js";import"../../utils/collection/removeFilterChip.js";import"../Accordion/Accordion.js";import"@heroui/accordion";import"../Icon/DownArrow.js";import"../ModalOverlay/ModalOverlay.js";import"framer-motion";import"../Modal/Modal.js";import"../Drawer/Drawer.js";import"../Icon/Cross.js";import"../Icon/Search.js";import"../../utils/collection/mergeFilters.js";import"../Select/Option.js";import"react-stately";import"../Select/Select.js";import"../Select/ButtonSelect.js";import"react-aria";import"@react-aria/interactions";import"../Select/parts.js";import"../Select/ComboBoxSelect.js";import"../Loader/Pulse.js";import"../Select/MultiButtonSelect.js";import"../Icon/FilterIcon.js";export{U as AttributeDataProvider,or as CollectionFilterChips,lr as CollectionFilters,fr as CollectionToolbar,X as EmptyResults,ir as FilterAccordionTitle,$ as FilterRenderer,mr as ProductCardSwatches,Z as ProductPrice,V as useAttributeData};
1
+ import{AttributeDataProvider as Q,useAttributeData as U}from"./AttributeDataProvider/AttributeDataProvider.js";import{EmptyResults as W}from"./EmptyResults/EmptyResults.js";import{ProductPrice as Y}from"./ProductPrice/ProductPrice.js";import{FilterRenderer as _}from"./FilterRenderer/FilterRenderer.js";import{CollectionFilterChips as rr}from"./CollectionFilterChips/CollectionFilterChips.js";import{FilterAccordionTitle as tr}from"./FilterAccordionTitle/FilterAccordionTitle.js";import{ProductCardSwatches as pr}from"./ProductCardSwatches/ProductCardSwatches.js";import{CollectionFilters as er}from"./CollectionFilters/CollectionFilters.js";import{CollectionToolbar as cr}from"./CollectionToolbar/CollectionToolbar.js";import"react/jsx-runtime";import"react";import"../../utils/env.js";import"../../utils/swatch.js";import"./FilterRenderer/Renderer/Option.js";import"../Checkbox/Checkbox.js";import"react-aria-components";import"../../utils/cn.js";import"./FilterRenderer/Renderer/useOptionFilterToggle.js";import"./FilterRenderer/Renderer/Swatch.js";import"./FilterRenderer/Renderer/Swatch/SwatchColor.js";import"../Icon/CheckIcon.js";import"../../utils/color.js";import"./FilterRenderer/Renderer/Swatch/SwatchImage.js";import"./FilterRenderer/Renderer/Swatch/SwatchText.js";import"./FilterRenderer/Renderer/Boolean.js";import"../RadioGroup/RadioGroup.js";import"../Radio/Radio.js";import"./FilterRenderer/Renderer/Range.js";import"../Button/Button.js";import"../Icon/CrossSmall.js";import"../../utils/collection/getAppliedFilterChips.js";import"../../utils/collection/removeFilterChip.js";import"../Accordion/Accordion.js";import"../Icon/DownArrow.js";import"../ModalOverlay/ModalOverlay.js";import"framer-motion";import"../Modal/Modal.js";import"../Drawer/Drawer.js";import"../Icon/Cross.js";import"../Icon/Search.js";import"../../utils/collection/mergeFilters.js";import"../Select/Option.js";import"react-stately";import"../Select/Select.js";import"../Select/ButtonSelect.js";import"react-aria";import"@react-aria/interactions";import"../Select/parts.js";import"../Select/ComboBoxSelect.js";import"../Loader/Pulse.js";import"../Select/MultiButtonSelect.js";import"../Icon/FilterIcon.js";export{Q as AttributeDataProvider,rr as CollectionFilterChips,er as CollectionFilters,cr as CollectionToolbar,W as EmptyResults,tr as FilterAccordionTitle,_ as FilterRenderer,pr as ProductCardSwatches,Y as ProductPrice,U as useAttributeData};
@@ -1 +1 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import{Popover as b,Menu as f}from"react-aria-components";import{forwardRef as _}from"react";import{motion as v}from"framer-motion";import{cn as t}from"../../utils/cn.js";const c=_(({style:e,...o},r)=>{const i=typeof e=="function"?e(o):e;return n(b,{...o,ref:r,style:i})});let d=null;function w(){return typeof window>"u"?null:(d||(d=v.create(c)),d)}const s=w();function C({children:e,key:o,onAction:r,setAnimation:i,animation:a="hidden",className:x,classNames:u,...m}){const p=t("px-0 py-1.5","shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1),0_4px_6px_-4px_rgba(0,0,0,0.1)]","rounded-md","w-56","bg-white","border border-solid border-border",x);return s?n(s,{className:p,isExiting:a==="hidden",onAnimationComplete:h=>{i(l=>h==="hidden"&&l==="hidden"?"unmounted":l)},variants:{hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},initial:"hidden",animate:a,...m,children:n(f,{className:t("outline-none",u?.menu),onAction:r,children:e})},o):n(c,{className:p,...m,children:n(f,{className:t("outline-none",u?.menu),onAction:r,children:e})},o)}export{C as ContextMenu,C as default};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{Popover as b,Menu as f}from"react-aria-components";import{forwardRef as _}from"react";import{m as v}from"framer-motion";import{cn as t}from"../../utils/cn.js";const c=_(({style:e,...o},r)=>{const i=typeof e=="function"?e(o):e;return n(b,{...o,ref:r,style:i})});let d=null;function w(){return typeof window>"u"?null:(d||(d=v.create(c)),d)}const s=w();function C({children:e,key:o,onAction:r,setAnimation:i,animation:a="hidden",className:x,classNames:u,...m}){const p=t("px-0 py-1.5","shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1),0_4px_6px_-4px_rgba(0,0,0,0.1)]","rounded-md","w-56","bg-white","border border-solid border-border",x);return s?n(s,{className:p,isExiting:a==="hidden",onAnimationComplete:h=>{i(l=>h==="hidden"&&l==="hidden"?"unmounted":l)},variants:{hidden:{opacity:0,y:-10},visible:{opacity:1,y:0}},initial:"hidden",animate:a,...m,children:n(f,{className:t("outline-none",u?.menu),onAction:r,children:e})},o):n(c,{className:p,...m,children:n(f,{className:t("outline-none",u?.menu),onAction:r,children:e})},o)}export{C as ContextMenu,C as default};
@@ -13,17 +13,25 @@ export declare const useDialogTrigger: () => {
13
13
  onOpenChange: (isOpen: boolean) => void;
14
14
  };
15
15
  /**
16
- * Thin wrapper over react-aria's DialogTrigger, kept as the package's stable import point.
16
+ * The package's stable trigger. Owns an overlay-trigger state, provides it on
17
+ * react-aria's `OverlayTriggerStateContext` (which ModalOverlay — ours and
18
+ * react-aria's — reads), and wires the FIRST child element's `onPress` to
19
+ * toggle it.
17
20
  *
18
- * Deliberately NO module-scoped context here. The previous version mirrored the open state into
19
- * its own `createContext` for the overlay's enter/exit animation — and a module-scoped context
20
- * only works when every consumer resolves the SAME package instance. With two @clicktap/ui copies
21
- * installed (an ordinary pnpm-workspace version skew), the trigger wrote into one context copy
22
- * while the overlay read the other's default, so every trigger-driven modal mounted at
23
- * `opacity: 0` with zero errors (CTAP-1210, reported by noco). The animation state now lives in
24
- * ModalOverlay itself, derived from react-aria's `OverlayTriggerStateContext` — the one context
25
- * that is reliably shared, because everything fails loudly if react-aria-components itself is
26
- * duplicated.
21
+ * Deliberately NOT a wrapper over react-aria-components' DialogTrigger: RAC
22
+ * wires its trigger through `PressResponderContext`, and in this app's
23
+ * production bundles that registration silently never reaches the Button —
24
+ * pure-context triggers render an inert button (no aria attrs applied, press
25
+ * never toggles state; every account modal was dead) while an explicit
26
+ * `onPress` prop on the same Button works everywhere (FilterButton,
27
+ * RegionSelectAction, AddToCart). Until that press-responder failure is
28
+ * root-caused (CTAP-1383 follow-up), this component injects the explicit
29
+ * `onPress` itself, which is the mechanism the rest of the app already
30
+ * proves out.
31
+ *
32
+ * A consumer-supplied `onPress` on the trigger child still runs (chained
33
+ * before the toggle), so controlled usages that mirror open state into their
34
+ * own `isOpen` keep working unchanged.
27
35
  */
28
36
  export declare function DialogTrigger(props: DialogTriggerProps): import("react/jsx-runtime").JSX.Element;
29
37
  export default DialogTrigger;
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import{useContext as i}from"react";import{DialogTrigger as n,OverlayTriggerStateContext as o}from"react-aria-components";const m=()=>{const e=i(o);return{animation:e?.isOpen?"visible":"unmounted",setAnimation:()=>{},onOpenChange:t=>e?.setOpen(t)}};function u(e){return r(n,{...e})}export{u as DialogTrigger,u as default,m as useDialogTrigger};
1
+ "use client";import{jsxs as a}from"react/jsx-runtime";import{Children as g,isValidElement as l,cloneElement as m,useContext as u}from"react";import{OverlayTriggerStateContext as n}from"react-aria-components";import{useOverlayTriggerState as c}from"react-stately";const O=()=>{const e=u(n);return{animation:e?.isOpen?"visible":"unmounted",setAnimation:()=>{},onOpenChange:r=>e?.setOpen(r)}};function T(e){const r=c(e),[t,...o]=g.toArray(e.children),i=l(t)?m(t,{onPress:s=>{t.props.onPress?.(s),r.toggle()}}):t;return a(n.Provider,{value:r,children:[i,o]})}export{T as DialogTrigger,T as default,O as useDialogTrigger};
@@ -1 +1 @@
1
- import{DialogTrigger as m,useDialogTrigger as p}from"./DialogTrigger.js";import"react/jsx-runtime";import"react";import"react-aria-components";export{m as DialogTrigger,p as useDialogTrigger};
1
+ import{DialogTrigger as t,useDialogTrigger as e}from"./DialogTrigger.js";import"react/jsx-runtime";import"react";import"react-aria-components";import"react-stately";export{t as DialogTrigger,e as useDialogTrigger};
@@ -1 +1 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import{forwardRef as u}from"react";import{Dialog as f}from"react-aria-components";import{motion as b}from"framer-motion";import{cn as m}from"../../utils/cn.js";const p={top:{hidden:{y:"-100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},bottom:{hidden:{y:"100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},right:{hidden:{x:"100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}},left:{hidden:{x:"-100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}}},l=u(({style:e,size:t="20rem",...o},r)=>{const a=typeof e=="function"?e(o):{...e,"--drawer-size":`${t}`};return n(f,{...o,ref:r,style:a})});let i=null;function w(){return typeof window>"u"?null:(i||(i=b.create(l)),i)}const d=w();function c({direction:e="right",children:t,className:o,animationVariants:r,...a}){const s={className:m("fixed p-8 bg-white","outline-none focus:outline-none focus-visible:outline-none","border-solid border-border-subtle","max-w-full max-h-[var(--visual-viewport-height)]",e==="top"&&"top-0 left-0 right-0 bottom-auto border-b shadow-[0_8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",e==="right"&&"top-0 left-auto bottom-0 right-0 border-l shadow-[-8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",e==="bottom"&&"bottom-0 left-0 right-0 top-auto border-t shadow-[0_-8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",e==="left"&&"top-0 bottom-0 left-0 right-auto border-r shadow-[8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",o),"data-direction":e,...a};return d?n(d,{variants:r||p[e],...s,children:t}):n(l,{...s,children:t})}export{c as Drawer,c as default};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{forwardRef as u}from"react";import{Dialog as f}from"react-aria-components";import{m as b}from"framer-motion";import{cn as m}from"../../utils/cn.js";const p={top:{hidden:{y:"-100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},bottom:{hidden:{y:"100%",transition:{ease:"easeIn"}},visible:{y:0,transition:{ease:"easeOut"}}},right:{hidden:{x:"100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}},left:{hidden:{x:"-100%",transition:{ease:"easeIn"}},visible:{x:0,transition:{ease:"easeOut"}}}},l=u(({style:e,size:t="20rem",...o},r)=>{const a=typeof e=="function"?e(o):{...e,"--drawer-size":`${t}`};return n(f,{...o,ref:r,style:a})});let i=null;function w(){return typeof window>"u"?null:(i||(i=b.create(l)),i)}const d=w();function c({direction:e="right",children:t,className:o,animationVariants:r,...a}){const s={className:m("fixed p-8 bg-white","outline-none focus:outline-none focus-visible:outline-none","border-solid border-border-subtle","max-w-full max-h-[var(--visual-viewport-height)]",e==="top"&&"top-0 left-0 right-0 bottom-auto border-b shadow-[0_8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",e==="right"&&"top-0 left-auto bottom-0 right-0 border-l shadow-[-8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",e==="bottom"&&"bottom-0 left-0 right-0 top-auto border-t shadow-[0_-8px_24px_rgba(0,0,0,0.1)] h-[var(--drawer-size)]",e==="left"&&"top-0 bottom-0 left-0 right-auto border-r shadow-[8px_0_24px_rgba(0,0,0,0.1)] w-[var(--drawer-size)]",o),"data-direction":e,...a};return d?n(d,{variants:r||p[e],...s,children:t}):n(l,{...s,children:t})}export{c as Drawer,c as default};
@@ -1 +1 @@
1
- "use client";import{jsxs as Be,jsx as oe,Fragment as $t}from"react/jsx-runtime";import*as v from"react";import{useLayoutEffect as vt,useState as Nt,useRef as Wt,useId as Vt,cloneElement as Bt}from"react";import{motion as Ht}from"framer-motion";import*as Kt from"react-dom";function Te(){return typeof window<"u"}function ae(e){return wt(e)?(e.nodeName||"").toLowerCase():"#document"}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function J(e){var t;return(t=(wt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wt(e){return Te()?e instanceof Node||e instanceof K(e).Node:!1}function N(e){return Te()?e instanceof Element||e instanceof K(e).Element:!1}function X(e){return Te()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function He(e){return!Te()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}function Me(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=j(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function Xt(e){return/^(table|td|th)$/.test(ae(e))}function Se(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Ut=/transform|translate|scale|rotate|perspective|filter/,jt=/paint|layout|strict|content/,ne=e=>!!e&&e!=="none";let Ie;function je(e){const t=N(e)?j(e):e;return ne(t.transform)||ne(t.translate)||ne(t.scale)||ne(t.rotate)||ne(t.perspective)||!Le()&&(ne(t.backdropFilter)||ne(t.filter))||Ut.test(t.willChange||"")||jt.test(t.contain||"")}function Yt(e){let t=te(e);for(;X(t)&&!Z(t);){if(je(t))return t;if(Se(t))return null;t=te(t)}return null}function Le(){return Ie==null&&(Ie=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ie}function Z(e){return/^(html|body|#document)$/.test(ae(e))}function j(e){return K(e).getComputedStyle(e)}function Ae(e){return N(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function te(e){if(ae(e)==="html")return e;const t=e.assignedSlot||e.parentNode||He(e)&&e.host||J(e);return He(t)?t.host:t}function yt(e){const t=te(e);return Z(t)?(e.ownerDocument||e).body:X(t)&&Me(t)?t:yt(t)}function ee(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=yt(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=K(r);if(s){const c=Ke(i);return t.concat(i,i.visualViewport||[],Me(r)?r:[],c&&n?ee(c):[])}else return t.concat(r,ee(r,[],n))}function Ke(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ue=Math.min,ie=Math.max,Ee=Math.round,we=Math.floor,G=e=>({x:e,y:e}),zt={left:"right",right:"left",bottom:"top",top:"bottom"};function Rt(e,t,n){return ie(e,ue(t,n))}function he(e,t){return typeof e=="function"?e(t):e}function fe(e){return e.split("-")[0]}function ve(e){return e.split("-")[1]}function xt(e){return e==="x"?"y":"x"}function Ye(e){return e==="y"?"height":"width"}function Q(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ze(e){return xt(Q(e))}function qt(e,t,n){n===void 0&&(n=!1);const o=ve(e),r=ze(e),s=Ye(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Ce(i)),[i,Ce(i)]}function Gt(e){const t=Ce(e);return[Xe(e),t,Xe(t)]}function Xe(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const et=["left","right"],tt=["right","left"],Jt=["top","bottom"],Qt=["bottom","top"];function Zt(e,t,n){switch(e){case"top":case"bottom":return n?t?tt:et:t?et:tt;case"left":case"right":return t?Jt:Qt;default:return[]}}function en(e,t,n,o){const r=ve(e);let s=Zt(fe(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Xe)))),s}function Ce(e){const t=fe(e);return zt[t]+e.slice(t.length)}function tn(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function bt(e){return typeof e!="number"?tn(e):{top:e,right:e,bottom:e,left:e}}function Oe(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function nn(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function on(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function rn(){return/apple/i.test(navigator.vendor)}function sn(){return nn().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function cn(){return on().includes("jsdom/")}const nt="data-floating-ui-focusable",ln="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ot(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function me(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&He(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function ce(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Fe(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function un(e){return e.matches("html,body")}function re(e){return e?.ownerDocument||document}function Et(e){return X(e)&&e.matches(ln)}function fn(e){if(!e||cn())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function an(e){return e?e.hasAttribute(nt)?e:e.querySelector("["+nt+"]")||e:null}function Re(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var s;return r.parentId===t&&(!n||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...Re(e,r.id,n)])}function dn(e){return"nativeEvent"in e}function ge(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var mn=typeof document<"u",gn=function(){},z=mn?vt:gn;const pn={...v};function ye(e){const t=v.useRef(e);return z(()=>{t.current=e}),t}const hn=pn.useInsertionEffect,vn=hn||(e=>e());function Y(e){const t=v.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return vn(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function rt(e,t,n){let{reference:o,floating:r}=e;const s=Q(t),i=ze(t),c=Ye(i),u=fe(t),f=s==="y",g=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let l;switch(u){case"top":l={x:g,y:o.y-r.height};break;case"bottom":l={x:g,y:o.y+o.height};break;case"right":l={x:o.x+o.width,y:m};break;case"left":l={x:o.x-r.width,y:m};break;default:l={x:o.x,y:o.y}}const p=ve(t);return p&&(l[i]+=d*(p==="end"?1:-1)*(n&&f?-1:1)),l}async function wn(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:d=!1,padding:l=0}=he(t,e),p=bt(l),y=c[d?m==="floating"?"reference":"floating":m],w=Oe(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:g,strategy:u})),x=m==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),E=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},M=Oe(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:T,strategy:u}):x);return{top:(w.top-M.top+p.top)/E.y,bottom:(M.bottom-w.bottom+p.bottom)/E.y,left:(w.left-M.left+p.left)/E.x,right:(M.right-w.right+p.right)/E.x}}const yn=50,Rn=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:wn},u=await(i.isRTL==null?void 0:i.isRTL(t));let f=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:g,y:m}=rt(f,o,u),d=o,l=0;const p={};for(let a=0;a<s.length;a++){const y=s[a];if(!y)continue;const{name:w,fn:x}=y,{x:T,y:E,data:M,reset:C}=await x({x:g,y:m,initialPlacement:o,placement:d,strategy:r,middlewareData:p,rects:f,platform:c,elements:{reference:e,floating:t}});g=T??g,m=E??m,p[w]={...p[w],...M},C&&l<yn&&(l++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(f=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):C.rects),{x:g,y:m}=rt(f,d,u)),a=-1)}return{x:g,y:m,placement:d,strategy:r,middlewareData:p}},xn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:u}=t,{element:f,padding:g=0}=he(e,t)||{};if(f==null)return{};const m=bt(g),d={x:n,y:o},l=ze(r),p=Ye(l),a=await i.getDimensions(f),y=l==="y",w=y?"top":"left",x=y?"bottom":"right",T=y?"clientHeight":"clientWidth",E=s.reference[p]+s.reference[l]-d[l]-s.floating[p],M=d[l]-s.reference[l],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let P=C?C[T]:0;(!P||!await(i.isElement==null?void 0:i.isElement(C)))&&(P=c.floating[T]||s.floating[p]);const S=E/2-M/2,$=P/2-a[p]/2-1,I=ue(m[w],$),W=ue(m[x],$),_=P-a[p]-W,F=P/2-a[p]/2+S,R=Rt(I,F,_),L=!u.arrow&&ve(r)!=null&&F!==R&&s.reference[p]/2-(F<I?I:W)-a[p]/2<0,A=L?F<I?F-I:F-_:0;return{[l]:d[l]+A,data:{[l]:R,centerOffset:F-R-A,...L&&{alignmentOffset:A}},reset:L}}}),bn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:u,elements:f}=t,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:d,fallbackStrategy:l="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:a=!0,...y}=he(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=fe(r),x=Q(c),T=fe(c)===c,E=await(u.isRTL==null?void 0:u.isRTL(f.floating)),M=d||(T||!a?[Ce(c)]:Gt(c)),C=p!=="none";!d&&C&&M.push(...en(c,a,p,E));const P=[c,...M],S=await u.detectOverflow(t,y),$=[];let I=((o=s.flip)==null?void 0:o.overflows)||[];if(g&&$.push(S[w]),m){const R=qt(r,i,E);$.push(S[R[0]],S[R[1]])}if(I=[...I,{placement:r,overflows:$}],!$.every(R=>R<=0)){var W,_;const R=(((W=s.flip)==null?void 0:W.index)||0)+1,L=P[R];if(L&&(!(m==="alignment"?x!==Q(L):!1)||I.every(h=>Q(h.placement)===x?h.overflows[0]>0:!0)))return{data:{index:R,overflows:I},reset:{placement:L}};let A=(_=I.filter(b=>b.overflows[0]<=0).sort((b,h)=>b.overflows[1]-h.overflows[1])[0])==null?void 0:_.placement;if(!A)switch(l){case"bestFit":{var F;const b=(F=I.filter(h=>{if(C){const O=Q(h.placement);return O===x||O==="y"}return!0}).map(h=>[h.placement,h.overflows.filter(O=>O>0).reduce((O,D)=>O+D,0)]).sort((h,O)=>h[1]-O[1])[0])==null?void 0:F[0];b&&(A=b);break}case"initialPlacement":A=c;break}if(r!==A)return{reset:{placement:A}}}return{}}}},En=new Set(["left","top"]);async function Cn(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=fe(n),c=ve(n),u=Q(n)==="y",f=En.has(i)?-1:1,g=s&&u?-1:1,m=he(t,e);let{mainAxis:d,crossAxis:l,alignmentAxis:p}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof p=="number"&&(l=c==="end"?p*-1:p),u?{x:l*g,y:d*f}:{x:d*f,y:l*g}}const On=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,u=await Cn(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+u.x,y:s+u.y,data:{...u,placement:i}}}}},Pn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:u={fn:x=>{let{x:T,y:E}=x;return{x:T,y:E}}},...f}=he(e,t),g={x:n,y:o},m=await s.detectOverflow(t,f),d=Q(r),l=xt(d);let p=g[l],a=g[d];const y=(x,T)=>Rt(T+m[x==="y"?"top":"left"],T,T-m[x==="y"?"bottom":"right"]);i&&(p=y(l,p)),c&&(a=y(d,a));const w=u.fn({...t,[l]:p,[d]:a});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[l]:i,[d]:c}}}}}};function Ct(e){const t=j(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=X(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=Ee(n)!==s||Ee(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function qe(e){return N(e)?e:e.contextElement}function le(e){const t=qe(e);if(!X(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Ct(t);let i=(s?Ee(n.width):n.width)/o,c=(s?Ee(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Tn=G(0);function Ot(e){const t=K(e);return!Le()||!t.visualViewport?Tn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===K(e)}function se(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=qe(e);let i=G(1);t&&(o?N(o)&&(i=le(o)):i=le(e));const c=Mn(s,n,o)?Ot(s):G(0);let u=(r.left+c.x)/i.x,f=(r.top+c.y)/i.y,g=r.width/i.x,m=r.height/i.y;if(s&&o){const d=K(s),l=N(o)?K(o):o;let p=d,a=Ke(p);for(;a&&l!==p;){const y=le(a),w=a.getBoundingClientRect(),x=j(a),T=w.left+(a.clientLeft+parseFloat(x.paddingLeft))*y.x,E=w.top+(a.clientTop+parseFloat(x.paddingTop))*y.y;u*=y.x,f*=y.y,g*=y.x,m*=y.y,u+=T,f+=E,p=K(a),a=Ke(p)}}return Oe({width:g,height:m,x:u,y:f})}function De(e,t){const n=Ae(e).scrollLeft;return t?t.left+n:se(J(e)).left+n}function Pt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-De(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Sn(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=J(o),c=t?Se(t.floating):!1;if(o===i||c&&s)return n;let u={scrollLeft:0,scrollTop:0},f=G(1);const g=G(0),m=X(o);if((m||!s)&&((ae(o)!=="body"||Me(i))&&(u=Ae(o)),m)){const l=se(o);f=le(o),g.x=l.x+o.clientLeft,g.y=l.y+o.clientTop}const d=i&&!m&&!s?Pt(i,u):G(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+g.x+d.x,y:n.y*f.y-u.scrollTop*f.y+g.y+d.y}}function Ln(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function An(e){const t=Ae(e),n=e.ownerDocument.body,o=ie(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=ie(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+De(e);const i=-t.scrollTop;return j(n).direction==="rtl"&&(s+=ie(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:s,y:i}}const Dn=25;function kn(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=K(e),s=J(e),i=r.visualViewport;let c=s.clientWidth,u=s.clientHeight,f=0,g=0;if(i){const d=!Le()||t==="fixed";o?d||(f=-i.offsetLeft,g=-i.offsetTop):(c=i.width,u=i.height,d&&(f=i.offsetLeft,g=i.offsetTop))}if(De(s)<=0){const d=s.ownerDocument,l=d.body,p=getComputedStyle(l),a=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,y=Math.abs(s.clientWidth-l.clientWidth-a),w=getComputedStyle(s).scrollbarGutter==="stable both-edges"?y/2:y;w<=Dn&&(c-=w)}return{width:c,height:u,x:f,y:g}}function In(e,t){const n=se(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=le(e),i=e.clientWidth*s.x,c=e.clientHeight*s.y,u=r*s.x,f=o*s.y;return{width:i,height:c,x:u,y:f}}function it(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=kn(e,n,t);else if(t==="document")o=An(J(e));else if(N(t))o=In(t,n);else{const r=Ot(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Oe(o)}function Fn(e,t){const n=t.get(e);if(n)return n;let o=ee(e,[],!1).filter(c=>N(c)&&ae(c)!=="body"),r=null;const s=j(e).position==="fixed";let i=s?te(e):e;for(;N(i)&&!Z(i);){const c=j(i),u=je(i),f=r?r.position:s?"fixed":"";!u&&(f==="fixed"||f==="absolute"&&c.position==="static")?o=o.filter(m=>m!==i):r=c,i=te(i)}return t.set(e,o),o}function _n(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Se(t)?[]:Fn(t,this._c):[].concat(n),o],c=it(t,i[0],r);let u=c.top,f=c.right,g=c.bottom,m=c.left;for(let d=1;d<i.length;d++){const l=it(t,i[d],r);u=ie(l.top,u),f=ue(l.right,f),g=ue(l.bottom,g),m=ie(l.left,m)}return{width:f-m,height:g-u,x:m,y:u}}function $n(e){const{width:t,height:n}=Ct(e);return{width:t,height:n}}function Nn(e,t,n){const o=X(t),r=J(t),s=n==="fixed",i=se(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=G(0);if((o||!s)&&((ae(t)!=="body"||Me(r))&&(c=Ae(t)),o)){const d=se(t,!0,s,t);u.x=d.x+t.clientLeft,u.y=d.y+t.clientTop}!o&&r&&(u.x=De(r));const f=r&&!o&&!s?Pt(r,c):G(0),g=i.left+c.scrollLeft-u.x-f.x,m=i.top+c.scrollTop-u.y-f.y;return{x:g,y:m,width:i.width,height:i.height}}function _e(e){return j(e).position==="static"}function st(e,t){if(!X(e)||j(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return J(e)===n&&(n=n.ownerDocument.body),n}function Tt(e,t){const n=K(e);if(Se(e))return n;if(!X(e)){let r=te(e);for(;r&&!Z(r);){if(N(r)&&!_e(r))return r;r=te(r)}return n}let o=st(e,t);for(;o&&Xt(o)&&_e(o);)o=st(o,t);return o&&Z(o)&&_e(o)&&!je(o)?n:o||Yt(e)||n}const Wn=async function(e){const t=this.getOffsetParent||Tt,n=this.getDimensions,o=await n(e.floating);return{reference:Nn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Vn(e){return j(e).direction==="rtl"}const Bn={convertOffsetParentRelativeRectToViewportRelativeRect:Sn,getDocumentElement:J,getClippingRect:_n,getOffsetParent:Tt,getElementRects:Wn,getClientRects:Ln,getDimensions:$n,getScale:le,isElement:N,isRTL:Vn};function Mt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hn(e,t,n){let o=null,r;const s=J(e);function i(){var g;clearTimeout(r),(g=o)==null||g.disconnect(),o=null}function c(g,m){g===void 0&&(g=!1),m===void 0&&(m=1),i();const d=e.getBoundingClientRect(),{left:l,top:p,width:a,height:y}=d;if(g||t(),!a||!y)return;const w=we(p),x=we(s.clientWidth-(l+a)),T=we(s.clientHeight-(p+y)),E=we(l),C={rootMargin:-w+"px "+-x+"px "+-T+"px "+-E+"px",threshold:ie(0,ue(1,m))||1};let P=!0;function S($){const I=$[0].intersectionRatio;if(!Mt(d,e.getBoundingClientRect()))return c();if(I!==m){if(!P)return c();I?c(!1,I):r=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{o=new IntersectionObserver(S,{...C,root:s.ownerDocument})}catch{o=new IntersectionObserver(S,C)}o.observe(e)}const u=K(e),f=()=>c(n);return u.addEventListener("resize",f),c(!0),()=>{u.removeEventListener("resize",f),i()}}function Kn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,f=qe(e),g=r||s?[...f?ee(f):[],...t?ee(t):[]]:[];g.forEach(w=>{r&&w.addEventListener("scroll",n),s&&w.addEventListener("resize",n)});const m=f&&c?Hn(f,n,s):null;let d=-1,l=null;i&&(l=new ResizeObserver(w=>{let[x]=w;x&&x.target===f&&l&&t&&(l.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var T;(T=l)==null||T.observe(t)})),n()}),f&&!u&&l.observe(f),t&&l.observe(t));let p,a=u?se(e):null;u&&y();function y(){const w=se(e);a&&!Mt(a,w)&&n(),a=w,p=requestAnimationFrame(y)}return n(),()=>{var w;g.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),m?.(),(w=l)==null||w.disconnect(),l=null,u&&cancelAnimationFrame(p)}}const Xn=On,Un=Pn,jn=bn,ct=xn,Yn=(e,t,n)=>{const o=new Map,r=n??{},s={...Bn,...r.platform,_c:o};return Rn(e,t,{...r,platform:s})};var zn=typeof document<"u",qn=function(){},xe=zn?vt:qn;function Pe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Pe(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Pe(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function St(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lt(e,t){const n=St(e);return Math.round(t*n)/n}function $e(e){const t=v.useRef(e);return xe(()=>{t.current=e}),t}function Gn(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:u,open:f}=e,[g,m]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,l]=v.useState(o);Pe(d,o)||l(o);const[p,a]=v.useState(null),[y,w]=v.useState(null),x=v.useCallback(h=>{h!==C.current&&(C.current=h,a(h))},[]),T=v.useCallback(h=>{h!==P.current&&(P.current=h,w(h))},[]),E=s||p,M=i||y,C=v.useRef(null),P=v.useRef(null),S=v.useRef(g),$=u!=null,I=$e(u),W=$e(r),_=$e(f),F=v.useCallback(()=>{if(!C.current||!P.current)return;const h={placement:t,strategy:n,middleware:d};W.current&&(h.platform=W.current),Yn(C.current,P.current,h).then(O=>{const D={...O,isPositioned:_.current!==!1};R.current&&!Pe(S.current,D)&&(S.current=D,Kt.flushSync(()=>{m(D)}))})},[d,t,n,W,_]);xe(()=>{f===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,m(h=>({...h,isPositioned:!1})))},[f]);const R=v.useRef(!1);xe(()=>(R.current=!0,()=>{R.current=!1}),[]),xe(()=>{if(E&&(C.current=E),M&&(P.current=M),E&&M){if(I.current)return I.current(E,M,F);F()}},[E,M,F,I,$]);const L=v.useMemo(()=>({reference:C,floating:P,setReference:x,setFloating:T}),[x,T]),A=v.useMemo(()=>({reference:E,floating:M}),[E,M]),b=v.useMemo(()=>{const h={position:n,left:0,top:0};if(!A.floating)return h;const O=lt(A.floating,g.x),D=lt(A.floating,g.y);return c?{...h,transform:"translate("+O+"px, "+D+"px)",...St(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:D}},[n,c,A.floating,g.x,g.y]);return v.useMemo(()=>({...g,update:F,refs:L,elements:A,floatingStyles:b}),[g,F,L,A,b])}const Jn=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?ct({element:o.current,padding:r}).fn(n):{}:o?ct({element:o,padding:r}).fn(n):{}}}},Qn=(e,t)=>{const n=Xn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zn=(e,t)=>{const n=Un(e);return{name:n.name,fn:n.fn,options:[e,t]}},eo=(e,t)=>{const n=jn(e);return{name:n.name,fn:n.fn,options:[e,t]}},to=(e,t)=>{const n=Jn(e);return{name:n.name,fn:n.fn,options:[e,t]}},no="data-floating-ui-focusable",ut="active",ft="selected",oo={...v};let at=!1,ro=0;const dt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ro++;function io(){const[e,t]=v.useState(()=>at?dt():void 0);return z(()=>{e==null&&t(dt())},[]),v.useEffect(()=>{at=!0},[]),e}const so=oo.useId,Ge=so||io;let pe;process.env.NODE_ENV!=="production"&&(pe=new Set);function co(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=pe)!=null&&e.has(r))){var s;(s=pe)==null||s.add(r),console.warn(r)}}function lo(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=pe)!=null&&e.has(r))){var s;(s=pe)==null||s.add(r),console.error(r)}}const uo=v.forwardRef(function(t,n){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:s,shift:i}},width:c=14,height:u=7,tipRadius:f=0,strokeWidth:g=0,staticOffset:m,stroke:d,d:l,style:{transform:p,...a}={},...y}=t;process.env.NODE_ENV!=="production"&&(n||co("The `ref` prop is required for `FloatingArrow`."));const w=Ge(),[x,T]=v.useState(!1);if(z(()=>{if(!r)return;j(r).direction==="rtl"&&T(!0)},[r]),!r)return null;const[E,M]=o.split("-"),C=E==="top"||E==="bottom";let P=m;(C&&i!=null&&i.x||!C&&i!=null&&i.y)&&(P=null);const S=g*2,$=S/2,I=c/2*(f/-8+1),W=u/2*f/4,_=!!l,F=P&&M==="end"?"bottom":"top";let R=P&&M==="end"?"right":"left";P&&x&&(R=M==="end"?"left":"right");const L=s?.x!=null?P||s.x:"",A=s?.y!=null?P||s.y:"",b=l||"M0,0"+(" H"+c)+(" L"+(c-I)+","+(u-W))+(" Q"+c/2+","+u+" "+I+","+(u-W))+" Z",h={top:_?"rotate(180deg)":"",left:_?"rotate(90deg)":"rotate(-90deg)",bottom:_?"":"rotate(180deg)",right:_?"rotate(-90deg)":"rotate(90deg)"}[E];return Be("svg",{...y,"aria-hidden":!0,ref:n,width:_?c:c+S,height:c,viewBox:"0 0 "+c+" "+(u>c?u:c),style:{position:"absolute",pointerEvents:"none",[R]:L,[F]:A,[E]:C||_?"100%":"calc(100% - "+S/2+"px)",transform:[h,p].filter(O=>!!O).join(" "),...a},children:[S>0&&oe("path",{clipPath:"url(#"+w+")",fill:"none",stroke:d,strokeWidth:S+(l?0:1),d:b}),oe("path",{stroke:S&&!l?y.fill:"none",d:b}),oe("clipPath",{id:w,children:oe("rect",{x:-$,y:$*(_?-1:1),width:c+S,height:c})})]})});function fo(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;(o=e.get(t))==null||o.delete(n)}}}const ao=v.createContext(null),mo=v.createContext(null),Je=()=>{var e;return((e=v.useContext(ao))==null?void 0:e.id)||null},Qe=()=>v.useContext(mo);function Ze(e){return"data-floating-ui-"+e}function U(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const mt=Ze("safe-polygon");function be(e,t,n){if(n&&!ge(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function Ne(e){return typeof e=="function"?e():e}function go(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:s,elements:i}=e,{enabled:c=!0,delay:u=0,handleClose:f=null,mouseOnly:g=!1,restMs:m=0,move:d=!0}=t,l=Qe(),p=Je(),a=ye(f),y=ye(u),w=ye(n),x=ye(m),T=v.useRef(),E=v.useRef(-1),M=v.useRef(),C=v.useRef(-1),P=v.useRef(!0),S=v.useRef(!1),$=v.useRef(()=>{}),I=v.useRef(!1),W=Y(()=>{var b;const h=(b=r.current.openEvent)==null?void 0:b.type;return h?.includes("mouse")&&h!=="mousedown"});v.useEffect(()=>{if(!c)return;function b(h){let{open:O}=h;O||(U(E),U(C),P.current=!0,I.current=!1)}return s.on("openchange",b),()=>{s.off("openchange",b)}},[c,s]),v.useEffect(()=>{if(!c||!a.current||!n)return;function b(O){W()&&o(!1,O,"hover")}const h=re(i.floating).documentElement;return h.addEventListener("mouseleave",b),()=>{h.removeEventListener("mouseleave",b)}},[i.floating,n,o,c,a,W]);const _=v.useCallback(function(b,h,O){h===void 0&&(h=!0),O===void 0&&(O="hover");const D=be(y.current,"close",T.current);D&&!M.current?(U(E),E.current=window.setTimeout(()=>o(!1,b,O),D)):h&&(U(E),o(!1,b,O))},[y,o]),F=Y(()=>{$.current(),M.current=void 0}),R=Y(()=>{if(S.current){const b=re(i.floating).body;b.style.pointerEvents="",b.removeAttribute(mt),S.current=!1}}),L=Y(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);v.useEffect(()=>{if(!c)return;function b(k){if(U(E),P.current=!1,g&&!ge(T.current)||Ne(x.current)>0&&!be(y.current,"open"))return;const V=be(y.current,"open",T.current);V?E.current=window.setTimeout(()=>{w.current||o(!0,k,"hover")},V):n||o(!0,k,"hover")}function h(k){if(L()){R();return}$.current();const V=re(i.floating);if(U(C),I.current=!1,a.current&&r.current.floatingContext){n||U(E),M.current=a.current({...r.current.floatingContext,tree:l,x:k.clientX,y:k.clientY,onClose(){R(),F(),L()||_(k,!0,"safe-polygon")}});const H=M.current;V.addEventListener("mousemove",H),$.current=()=>{V.removeEventListener("mousemove",H)};return}(T.current!=="touch"||!me(i.floating,k.relatedTarget))&&_(k)}function O(k){L()||r.current.floatingContext&&(a.current==null||a.current({...r.current.floatingContext,tree:l,x:k.clientX,y:k.clientY,onClose(){R(),F(),L()||_(k)}})(k))}function D(){U(E)}function B(k){L()||_(k,!1)}if(N(i.domReference)){const k=i.domReference,V=i.floating;return n&&k.addEventListener("mouseleave",O),d&&k.addEventListener("mousemove",b,{once:!0}),k.addEventListener("mouseenter",b),k.addEventListener("mouseleave",h),V&&(V.addEventListener("mouseleave",O),V.addEventListener("mouseenter",D),V.addEventListener("mouseleave",B)),()=>{n&&k.removeEventListener("mouseleave",O),d&&k.removeEventListener("mousemove",b),k.removeEventListener("mouseenter",b),k.removeEventListener("mouseleave",h),V&&(V.removeEventListener("mouseleave",O),V.removeEventListener("mouseenter",D),V.removeEventListener("mouseleave",B))}}},[i,c,e,g,d,_,F,R,o,n,w,l,y,a,r,L,x]),z(()=>{var b;if(c&&n&&(b=a.current)!=null&&(b=b.__options)!=null&&b.blockPointerEvents&&W()){S.current=!0;const O=i.floating;if(N(i.domReference)&&O){var h;const D=re(i.floating).body;D.setAttribute(mt,"");const B=i.domReference,k=l==null||(h=l.nodesRef.current.find(V=>V.id===p))==null||(h=h.context)==null?void 0:h.elements.floating;return k&&(k.style.pointerEvents=""),D.style.pointerEvents="none",B.style.pointerEvents="auto",O.style.pointerEvents="auto",()=>{D.style.pointerEvents="",B.style.pointerEvents="",O.style.pointerEvents=""}}}},[c,n,p,i,l,a,W]),z(()=>{n||(T.current=void 0,I.current=!1,F(),R())},[n,F,R]),v.useEffect(()=>()=>{F(),U(E),U(C),R()},[c,i.domReference,F,R]);const A=v.useMemo(()=>{function b(h){T.current=h.pointerType}return{onPointerDown:b,onPointerEnter:b,onMouseMove(h){const{nativeEvent:O}=h;function D(){!P.current&&!w.current&&o(!0,O,"hover")}g&&!ge(T.current)||n||Ne(x.current)===0||I.current&&h.movementX**2+h.movementY**2<2||(U(C),T.current==="touch"?D():(I.current=!0,C.current=window.setTimeout(D,Ne(x.current))))}}},[g,o,n,w,x]);return v.useMemo(()=>c?{reference:A}:{},[c,A])}const Ue=()=>{},po=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ue,setState:Ue,isInstantPhase:!1}),ho=()=>v.useContext(po);function vo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,floatingId:r}=e,{id:s,enabled:i=!0}=t,c=s??r,u=ho(),{currentId:f,setCurrentId:g,initialDelay:m,setState:d,timeoutMs:l}=u;return z(()=>{i&&f&&(d({delay:{open:1,close:be(m,"close")}}),f!==c&&o(!1))},[i,c,o,d,f,m]),z(()=>{function p(){o(!1),d({delay:m,currentId:null})}if(i&&f&&!n&&f===c){if(l){const a=window.setTimeout(p,l);return()=>{clearTimeout(a)}}p()}},[i,n,d,f,c,o,m,l]),z(()=>{i&&(g===Ue||!n||g(c))},[i,n,g,c]),u}function gt(e){return X(e.target)&&e.target.tagName==="BUTTON"}function wo(e){return X(e.target)&&e.target.tagName==="A"}function pt(e){return Et(e)}function yo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:s}}=e,{enabled:i=!0,event:c="click",toggle:u=!0,ignoreMouse:f=!1,keyboardHandlers:g=!0,stickIfOpen:m=!0}=t,d=v.useRef(),l=v.useRef(!1),p=v.useMemo(()=>({onPointerDown(a){d.current=a.pointerType},onMouseDown(a){const y=d.current;a.button===0&&c!=="click"&&(ge(y,!0)&&f||(n&&u&&(!(r.current.openEvent&&m)||r.current.openEvent.type==="mousedown")?o(!1,a.nativeEvent,"click"):(a.preventDefault(),o(!0,a.nativeEvent,"click"))))},onClick(a){const y=d.current;if(c==="mousedown"&&d.current){d.current=void 0;return}ge(y,!0)&&f||(n&&u&&(!(r.current.openEvent&&m)||r.current.openEvent.type==="click")?o(!1,a.nativeEvent,"click"):o(!0,a.nativeEvent,"click"))},onKeyDown(a){d.current=void 0,!(a.defaultPrevented||!g||gt(a))&&(a.key===" "&&!pt(s)&&(a.preventDefault(),l.current=!0),!wo(a)&&a.key==="Enter"&&o(!(n&&u),a.nativeEvent,"click"))},onKeyUp(a){a.defaultPrevented||!g||gt(a)||pt(s)||a.key===" "&&l.current&&(l.current=!1,o(!(n&&u),a.nativeEvent,"click"))}}),[r,s,c,f,g,o,n,m,u]);return v.useMemo(()=>i?{reference:p}:{},[i,p])}const Ro={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},xo={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ht=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function bo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:s}=e,{enabled:i=!0,escapeKey:c=!0,outsidePress:u=!0,outsidePressEvent:f="pointerdown",referencePress:g=!1,referencePressEvent:m="pointerdown",ancestorScroll:d=!1,bubbles:l,capture:p}=t,a=Qe(),y=Y(typeof u=="function"?u:()=>!1),w=typeof u=="function"?y:u,x=v.useRef(!1),{escapeKey:T,outsidePress:E}=ht(l),{escapeKey:M,outsidePress:C}=ht(p),P=v.useRef(!1),S=Y(R=>{var L;if(!n||!i||!c||R.key!=="Escape"||P.current)return;const A=(L=s.current.floatingContext)==null?void 0:L.nodeId,b=a?Re(a.nodesRef.current,A):[];if(!T&&(R.stopPropagation(),b.length>0)){let h=!0;if(b.forEach(O=>{var D;if((D=O.context)!=null&&D.open&&!O.context.dataRef.current.__escapeKeyBubbles){h=!1;return}}),!h)return}o(!1,dn(R)?R.nativeEvent:R,"escape-key")}),$=Y(R=>{var L;const A=()=>{var b;S(R),(b=ce(R))==null||b.removeEventListener("keydown",A)};(L=ce(R))==null||L.addEventListener("keydown",A)}),I=Y(R=>{var L;const A=s.current.insideReactTree;s.current.insideReactTree=!1;const b=x.current;if(x.current=!1,f==="click"&&b||A||typeof w=="function"&&!w(R))return;const h=ce(R),O="["+Ze("inert")+"]",D=re(r.floating).querySelectorAll(O);let B=N(h)?h:null;for(;B&&!Z(B);){const H=te(B);if(Z(H)||!N(H))break;B=H}if(D.length&&N(h)&&!un(h)&&!me(h,r.floating)&&Array.from(D).every(H=>!me(B,H)))return;if(X(h)&&F){const H=Z(h),q=j(h),de=/auto|scroll/,Lt=H||de.test(q.overflowX),At=H||de.test(q.overflowY),Dt=Lt&&h.clientWidth>0&&h.scrollWidth>h.clientWidth,kt=At&&h.clientHeight>0&&h.scrollHeight>h.clientHeight,It=q.direction==="rtl",Ft=kt&&(It?R.offsetX<=h.offsetWidth-h.clientWidth:R.offsetX>h.clientWidth),_t=Dt&&R.offsetY>h.clientHeight;if(Ft||_t)return}const k=(L=s.current.floatingContext)==null?void 0:L.nodeId,V=a&&Re(a.nodesRef.current,k).some(H=>{var q;return Fe(R,(q=H.context)==null?void 0:q.elements.floating)});if(Fe(R,r.floating)||Fe(R,r.domReference)||V)return;const ke=a?Re(a.nodesRef.current,k):[];if(ke.length>0){let H=!0;if(ke.forEach(q=>{var de;if((de=q.context)!=null&&de.open&&!q.context.dataRef.current.__outsidePressBubbles){H=!1;return}}),!H)return}o(!1,R,"outside-press")}),W=Y(R=>{var L;const A=()=>{var b;I(R),(b=ce(R))==null||b.removeEventListener(f,A)};(L=ce(R))==null||L.addEventListener(f,A)});v.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=E;let R=-1;function L(D){o(!1,D,"ancestor-scroll")}function A(){window.clearTimeout(R),P.current=!0}function b(){R=window.setTimeout(()=>{P.current=!1},Le()?5:0)}const h=re(r.floating);c&&(h.addEventListener("keydown",M?$:S,M),h.addEventListener("compositionstart",A),h.addEventListener("compositionend",b)),w&&h.addEventListener(f,C?W:I,C);let O=[];return d&&(N(r.domReference)&&(O=ee(r.domReference)),N(r.floating)&&(O=O.concat(ee(r.floating))),!N(r.reference)&&r.reference&&r.reference.contextElement&&(O=O.concat(ee(r.reference.contextElement)))),O=O.filter(D=>{var B;return D!==((B=h.defaultView)==null?void 0:B.visualViewport)}),O.forEach(D=>{D.addEventListener("scroll",L)}),()=>{c&&(h.removeEventListener("keydown",M?$:S,M),h.removeEventListener("compositionstart",A),h.removeEventListener("compositionend",b)),w&&h.removeEventListener(f,C?W:I,C),O.forEach(D=>{D.removeEventListener("scroll",L)}),window.clearTimeout(R)}},[s,r,c,w,f,n,o,d,i,T,E,S,M,$,I,C,W]),v.useEffect(()=>{s.current.insideReactTree=!1},[s,w,f]);const _=v.useMemo(()=>({onKeyDown:S,...g&&{[Ro[m]]:R=>{o(!1,R.nativeEvent,"reference-press")},...m!=="click"&&{onClick(R){o(!1,R.nativeEvent,"reference-press")}}}}),[S,o,g,m]),F=v.useMemo(()=>{function R(L){L.button===0&&(x.current=!0)}return{onKeyDown:S,onMouseDown:R,onMouseUp:R,[xo[f]]:()=>{s.current.insideReactTree=!0}}},[S,f,s]);return v.useMemo(()=>i?{reference:_,floating:F}:{},[i,_,F])}function Eo(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=Ge(),s=v.useRef({}),[i]=v.useState(()=>fo()),c=Je()!=null;if(process.env.NODE_ENV!=="production"){const l=o.reference;l&&!N(l)&&lo("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[u,f]=v.useState(o.reference),g=Y((l,p,a)=>{s.current.openEvent=l?p:void 0,i.emit("openchange",{open:l,event:p,reason:a,nested:c}),n?.(l,p,a)}),m=v.useMemo(()=>({setPositionReference:f}),[]),d=v.useMemo(()=>({reference:u||o.reference||null,floating:o.floating||null,domReference:o.reference}),[u,o.reference,o.floating]);return v.useMemo(()=>({dataRef:s,open:t,onOpenChange:g,elements:d,events:i,floatingId:r,refs:m}),[t,g,d,i,r,m])}function Co(e){var t,n;let{elements:o,...r}=e===void 0?{}:e;const{nodeId:s}=r,i=Eo({...r,elements:{reference:(t=o?.reference)!=null?t:null,floating:(n=o?.floating)!=null?n:null}}),c=r.rootContext||i,u=c.elements,[f,g]=v.useState(null),[m,d]=v.useState(null),p=u?.domReference||f,a=v.useRef(null),y=Qe();z(()=>{p&&(a.current=p)},[p]);const w=Gn({...r,elements:{...u,...m&&{reference:m}}}),x=v.useCallback(P=>{const S=N(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;d(S),w.refs.setReference(S)},[w.refs]),T=v.useCallback(P=>{(N(P)||P===null)&&(a.current=P,g(P)),(N(w.refs.reference.current)||w.refs.reference.current===null||P!==null&&!N(P))&&w.refs.setReference(P)},[w.refs]),E=v.useMemo(()=>({...w.refs,setReference:T,setPositionReference:x,domReference:a}),[w.refs,T,x]),M=v.useMemo(()=>({...w.elements,domReference:p}),[w.elements,p]),C=v.useMemo(()=>({...w,...c,refs:E,elements:M,nodeId:s}),[w,E,M,s,c]);return z(()=>{c.dataRef.current.floatingContext=C;const P=y?.nodesRef.current.find(S=>S.id===s);P&&(P.context=C)}),v.useMemo(()=>({...w,context:C,refs:E,elements:M}),[w,E,M,C])}function We(){return sn()&&rn()}function Oo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,events:r,dataRef:s,elements:i}=e,{enabled:c=!0,visibleOnly:u=!0}=t,f=v.useRef(!1),g=v.useRef(-1),m=v.useRef(!0);v.useEffect(()=>{if(!c)return;const l=K(i.domReference);function p(){!n&&X(i.domReference)&&i.domReference===ot(re(i.domReference))&&(f.current=!0)}function a(){m.current=!0}function y(){m.current=!1}return l.addEventListener("blur",p),We()&&(l.addEventListener("keydown",a,!0),l.addEventListener("pointerdown",y,!0)),()=>{l.removeEventListener("blur",p),We()&&(l.removeEventListener("keydown",a,!0),l.removeEventListener("pointerdown",y,!0))}},[i.domReference,n,c]),v.useEffect(()=>{if(!c)return;function l(p){let{reason:a}=p;(a==="reference-press"||a==="escape-key")&&(f.current=!0)}return r.on("openchange",l),()=>{r.off("openchange",l)}},[r,c]),v.useEffect(()=>()=>{U(g)},[]);const d=v.useMemo(()=>({onMouseLeave(){f.current=!1},onFocus(l){if(f.current)return;const p=ce(l.nativeEvent);if(u&&N(p)){if(We()&&!l.relatedTarget){if(!m.current&&!Et(p))return}else if(!fn(p))return}o(!0,l.nativeEvent,"focus")},onBlur(l){f.current=!1;const p=l.relatedTarget,a=l.nativeEvent,y=N(p)&&p.hasAttribute(Ze("focus-guard"))&&p.getAttribute("data-type")==="outside";g.current=window.setTimeout(()=>{var w;const x=ot(i.domReference?i.domReference.ownerDocument:document);!p&&x===i.domReference||me((w=s.current.floatingContext)==null?void 0:w.refs.floating.current,x)||me(i.domReference,x)||y||o(!1,a,"focus")})}}),[s,i.domReference,o,u]);return v.useMemo(()=>c?{reference:d}:{},[c,d])}function Ve(e,t,n){const o=new Map,r=n==="item";let s=e;if(r&&e){const{[ut]:i,[ft]:c,...u}=e;s=u}return{...n==="floating"&&{tabIndex:-1,[no]:""},...s,...t.map(i=>{const c=i?i[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(u=>{let[f,g]=u;if(!(r&&[ut,ft].includes(f)))if(f.indexOf("on")===0){if(o.has(f)||o.set(f,[]),typeof g=="function"){var m;(m=o.get(f))==null||m.push(g),i[f]=function(){for(var d,l=arguments.length,p=new Array(l),a=0;a<l;a++)p[a]=arguments[a];return(d=o.get(f))==null?void 0:d.map(y=>y(...p)).find(y=>y!==void 0)}}}else i[f]=g}),i),{})}}function Po(e){e===void 0&&(e=[]);const t=e.map(c=>c?.reference),n=e.map(c=>c?.floating),o=e.map(c=>c?.item),r=v.useCallback(c=>Ve(c,e,"reference"),t),s=v.useCallback(c=>Ve(c,e,"floating"),n),i=v.useCallback(c=>Ve(c,e,"item"),o);return v.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}const To=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Mo(e,t){var n,o;t===void 0&&(t={});const{open:r,elements:s,floatingId:i}=e,{enabled:c=!0,role:u="dialog"}=t,f=Ge(),g=((n=s.domReference)==null?void 0:n.id)||f,m=v.useMemo(()=>{var x;return((x=an(s.floating))==null?void 0:x.id)||i},[s.floating,i]),d=(o=To.get(u))!=null?o:u,p=Je()!=null,a=v.useMemo(()=>d==="tooltip"||u==="label"?{["aria-"+(u==="label"?"labelledby":"describedby")]:r?m:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":r?m:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:g},...d==="menu"&&p&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[d,m,p,r,g,u]),y=v.useMemo(()=>{const x={id:m,...d&&{role:d}};return d==="tooltip"||u==="label"?x:{...x,...d==="menu"&&{"aria-labelledby":g}}},[d,m,g,u]),w=v.useCallback(x=>{let{active:T,selected:E}=x;const M={role:"option",...T&&{id:m+"-fui-option"}};switch(u){case"select":case"combobox":return{...M,"aria-selected":E}}return{}},[m,u]);return v.useMemo(()=>c?{reference:a,floating:y,item:w}:{},[c,a,y,w])}function Do({closeDelay:e=300,offset:t=20,openDelay:n=0,placement:o="bottom-start",slots:r,trigger:s=["hover","focus"],withArrow:i=!0,arrow:c,role:u="dialog",visible:f={},hidden:g={},floatingOptions:m={},isOpen:d,onOpenChange:l}){const[p,a]=Nt(!1),y=Wt(null),w=Vt(),{x,y:T,strategy:E,refs:M,context:C}=Co({placement:o,middleware:[Qn(t),eo(),Zn(),to({element:y})],open:d||p,onOpenChange:l||a,whileElementsMounted:Kn,...m}),P=bo(C),S=Mo(C,{role:u}),{delay:$}=vo(C,{id:w}),W=go(C,{delay:$||{open:n,close:e}}),_=Oo(C),F=yo(C),R=[s.find(k=>k==="hover")?W:void 0,s.find(k=>k==="click")?F:void 0,s.find(k=>k==="focus")?_:void 0,P,S],{getReferenceProps:L,getFloatingProps:A}=Po(R),{onClick:b,...h}=L(),O=String((r?.content?.props).className).includes("pressable")?{onPress:b}:{onClick:b},D=r?.content?Bt(r.content,{...r.content.props,ref:M.setReference,...h,...O}):oe("div",{ref:M.setReference,...L(),children:"Menu Action"}),B=r?.submenu?Be(Ht.nav,{ref:M.setFloating,style:{position:E,top:T??0,left:x??0,width:"max-content",zIndex:50},...A(),variants:{hidden:g,visible:f},initial:"hidden",animate:d||p?"visible":"hidden",children:[i&&oe(uo,{ref:y,context:C,...c}),r.submenu]}):oe("nav",{children:"Submenu"});return Be($t,{children:[D,B]})}export{Do as Menu,Do as default};
1
+ "use client";import{jsxs as Be,jsx as oe,Fragment as $t}from"react/jsx-runtime";import*as v from"react";import{useLayoutEffect as vt,useState as Nt,useRef as Wt,useId as Vt,cloneElement as Bt}from"react";import{m as Ht}from"framer-motion";import*as Kt from"react-dom";function Te(){return typeof window<"u"}function ae(e){return wt(e)?(e.nodeName||"").toLowerCase():"#document"}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function J(e){var t;return(t=(wt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wt(e){return Te()?e instanceof Node||e instanceof K(e).Node:!1}function N(e){return Te()?e instanceof Element||e instanceof K(e).Element:!1}function X(e){return Te()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function He(e){return!Te()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}function Me(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=j(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function Xt(e){return/^(table|td|th)$/.test(ae(e))}function Se(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Ut=/transform|translate|scale|rotate|perspective|filter/,jt=/paint|layout|strict|content/,ne=e=>!!e&&e!=="none";let Ie;function je(e){const t=N(e)?j(e):e;return ne(t.transform)||ne(t.translate)||ne(t.scale)||ne(t.rotate)||ne(t.perspective)||!Le()&&(ne(t.backdropFilter)||ne(t.filter))||Ut.test(t.willChange||"")||jt.test(t.contain||"")}function Yt(e){let t=te(e);for(;X(t)&&!Z(t);){if(je(t))return t;if(Se(t))return null;t=te(t)}return null}function Le(){return Ie==null&&(Ie=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ie}function Z(e){return/^(html|body|#document)$/.test(ae(e))}function j(e){return K(e).getComputedStyle(e)}function Ae(e){return N(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function te(e){if(ae(e)==="html")return e;const t=e.assignedSlot||e.parentNode||He(e)&&e.host||J(e);return He(t)?t.host:t}function yt(e){const t=te(e);return Z(t)?(e.ownerDocument||e).body:X(t)&&Me(t)?t:yt(t)}function ee(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=yt(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=K(r);if(s){const c=Ke(i);return t.concat(i,i.visualViewport||[],Me(r)?r:[],c&&n?ee(c):[])}else return t.concat(r,ee(r,[],n))}function Ke(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ue=Math.min,ie=Math.max,Ee=Math.round,we=Math.floor,G=e=>({x:e,y:e}),zt={left:"right",right:"left",bottom:"top",top:"bottom"};function Rt(e,t,n){return ie(e,ue(t,n))}function he(e,t){return typeof e=="function"?e(t):e}function fe(e){return e.split("-")[0]}function ve(e){return e.split("-")[1]}function xt(e){return e==="x"?"y":"x"}function Ye(e){return e==="y"?"height":"width"}function Q(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ze(e){return xt(Q(e))}function qt(e,t,n){n===void 0&&(n=!1);const o=ve(e),r=ze(e),s=Ye(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Ce(i)),[i,Ce(i)]}function Gt(e){const t=Ce(e);return[Xe(e),t,Xe(t)]}function Xe(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const et=["left","right"],tt=["right","left"],Jt=["top","bottom"],Qt=["bottom","top"];function Zt(e,t,n){switch(e){case"top":case"bottom":return n?t?tt:et:t?et:tt;case"left":case"right":return t?Jt:Qt;default:return[]}}function en(e,t,n,o){const r=ve(e);let s=Zt(fe(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Xe)))),s}function Ce(e){const t=fe(e);return zt[t]+e.slice(t.length)}function tn(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function bt(e){return typeof e!="number"?tn(e):{top:e,right:e,bottom:e,left:e}}function Oe(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function nn(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function on(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function rn(){return/apple/i.test(navigator.vendor)}function sn(){return nn().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function cn(){return on().includes("jsdom/")}const nt="data-floating-ui-focusable",ln="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ot(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function me(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&He(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function ce(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Fe(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function un(e){return e.matches("html,body")}function re(e){return e?.ownerDocument||document}function Et(e){return X(e)&&e.matches(ln)}function fn(e){if(!e||cn())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function an(e){return e?e.hasAttribute(nt)?e:e.querySelector("["+nt+"]")||e:null}function Re(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var s;return r.parentId===t&&(!n||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...Re(e,r.id,n)])}function dn(e){return"nativeEvent"in e}function ge(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var mn=typeof document<"u",gn=function(){},z=mn?vt:gn;const pn={...v};function ye(e){const t=v.useRef(e);return z(()=>{t.current=e}),t}const hn=pn.useInsertionEffect,vn=hn||(e=>e());function Y(e){const t=v.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return vn(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function rt(e,t,n){let{reference:o,floating:r}=e;const s=Q(t),i=ze(t),c=Ye(i),u=fe(t),f=s==="y",g=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let l;switch(u){case"top":l={x:g,y:o.y-r.height};break;case"bottom":l={x:g,y:o.y+o.height};break;case"right":l={x:o.x+o.width,y:m};break;case"left":l={x:o.x-r.width,y:m};break;default:l={x:o.x,y:o.y}}const p=ve(t);return p&&(l[i]+=d*(p==="end"?1:-1)*(n&&f?-1:1)),l}async function wn(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:d=!1,padding:l=0}=he(t,e),p=bt(l),y=c[d?m==="floating"?"reference":"floating":m],w=Oe(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:g,strategy:u})),x=m==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),E=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},M=Oe(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:T,strategy:u}):x);return{top:(w.top-M.top+p.top)/E.y,bottom:(M.bottom-w.bottom+p.bottom)/E.y,left:(w.left-M.left+p.left)/E.x,right:(M.right-w.right+p.right)/E.x}}const yn=50,Rn=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:wn},u=await(i.isRTL==null?void 0:i.isRTL(t));let f=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:g,y:m}=rt(f,o,u),d=o,l=0;const p={};for(let a=0;a<s.length;a++){const y=s[a];if(!y)continue;const{name:w,fn:x}=y,{x:T,y:E,data:M,reset:C}=await x({x:g,y:m,initialPlacement:o,placement:d,strategy:r,middlewareData:p,rects:f,platform:c,elements:{reference:e,floating:t}});g=T??g,m=E??m,p[w]={...p[w],...M},C&&l<yn&&(l++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(f=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):C.rects),{x:g,y:m}=rt(f,d,u)),a=-1)}return{x:g,y:m,placement:d,strategy:r,middlewareData:p}},xn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:u}=t,{element:f,padding:g=0}=he(e,t)||{};if(f==null)return{};const m=bt(g),d={x:n,y:o},l=ze(r),p=Ye(l),a=await i.getDimensions(f),y=l==="y",w=y?"top":"left",x=y?"bottom":"right",T=y?"clientHeight":"clientWidth",E=s.reference[p]+s.reference[l]-d[l]-s.floating[p],M=d[l]-s.reference[l],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let P=C?C[T]:0;(!P||!await(i.isElement==null?void 0:i.isElement(C)))&&(P=c.floating[T]||s.floating[p]);const S=E/2-M/2,$=P/2-a[p]/2-1,I=ue(m[w],$),W=ue(m[x],$),_=P-a[p]-W,F=P/2-a[p]/2+S,R=Rt(I,F,_),L=!u.arrow&&ve(r)!=null&&F!==R&&s.reference[p]/2-(F<I?I:W)-a[p]/2<0,A=L?F<I?F-I:F-_:0;return{[l]:d[l]+A,data:{[l]:R,centerOffset:F-R-A,...L&&{alignmentOffset:A}},reset:L}}}),bn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:u,elements:f}=t,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:d,fallbackStrategy:l="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:a=!0,...y}=he(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=fe(r),x=Q(c),T=fe(c)===c,E=await(u.isRTL==null?void 0:u.isRTL(f.floating)),M=d||(T||!a?[Ce(c)]:Gt(c)),C=p!=="none";!d&&C&&M.push(...en(c,a,p,E));const P=[c,...M],S=await u.detectOverflow(t,y),$=[];let I=((o=s.flip)==null?void 0:o.overflows)||[];if(g&&$.push(S[w]),m){const R=qt(r,i,E);$.push(S[R[0]],S[R[1]])}if(I=[...I,{placement:r,overflows:$}],!$.every(R=>R<=0)){var W,_;const R=(((W=s.flip)==null?void 0:W.index)||0)+1,L=P[R];if(L&&(!(m==="alignment"?x!==Q(L):!1)||I.every(h=>Q(h.placement)===x?h.overflows[0]>0:!0)))return{data:{index:R,overflows:I},reset:{placement:L}};let A=(_=I.filter(b=>b.overflows[0]<=0).sort((b,h)=>b.overflows[1]-h.overflows[1])[0])==null?void 0:_.placement;if(!A)switch(l){case"bestFit":{var F;const b=(F=I.filter(h=>{if(C){const O=Q(h.placement);return O===x||O==="y"}return!0}).map(h=>[h.placement,h.overflows.filter(O=>O>0).reduce((O,D)=>O+D,0)]).sort((h,O)=>h[1]-O[1])[0])==null?void 0:F[0];b&&(A=b);break}case"initialPlacement":A=c;break}if(r!==A)return{reset:{placement:A}}}return{}}}},En=new Set(["left","top"]);async function Cn(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=fe(n),c=ve(n),u=Q(n)==="y",f=En.has(i)?-1:1,g=s&&u?-1:1,m=he(t,e);let{mainAxis:d,crossAxis:l,alignmentAxis:p}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof p=="number"&&(l=c==="end"?p*-1:p),u?{x:l*g,y:d*f}:{x:d*f,y:l*g}}const On=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,u=await Cn(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+u.x,y:s+u.y,data:{...u,placement:i}}}}},Pn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:u={fn:x=>{let{x:T,y:E}=x;return{x:T,y:E}}},...f}=he(e,t),g={x:n,y:o},m=await s.detectOverflow(t,f),d=Q(r),l=xt(d);let p=g[l],a=g[d];const y=(x,T)=>Rt(T+m[x==="y"?"top":"left"],T,T-m[x==="y"?"bottom":"right"]);i&&(p=y(l,p)),c&&(a=y(d,a));const w=u.fn({...t,[l]:p,[d]:a});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[l]:i,[d]:c}}}}}};function Ct(e){const t=j(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=X(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=Ee(n)!==s||Ee(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function qe(e){return N(e)?e:e.contextElement}function le(e){const t=qe(e);if(!X(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Ct(t);let i=(s?Ee(n.width):n.width)/o,c=(s?Ee(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Tn=G(0);function Ot(e){const t=K(e);return!Le()||!t.visualViewport?Tn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===K(e)}function se(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=qe(e);let i=G(1);t&&(o?N(o)&&(i=le(o)):i=le(e));const c=Mn(s,n,o)?Ot(s):G(0);let u=(r.left+c.x)/i.x,f=(r.top+c.y)/i.y,g=r.width/i.x,m=r.height/i.y;if(s&&o){const d=K(s),l=N(o)?K(o):o;let p=d,a=Ke(p);for(;a&&l!==p;){const y=le(a),w=a.getBoundingClientRect(),x=j(a),T=w.left+(a.clientLeft+parseFloat(x.paddingLeft))*y.x,E=w.top+(a.clientTop+parseFloat(x.paddingTop))*y.y;u*=y.x,f*=y.y,g*=y.x,m*=y.y,u+=T,f+=E,p=K(a),a=Ke(p)}}return Oe({width:g,height:m,x:u,y:f})}function De(e,t){const n=Ae(e).scrollLeft;return t?t.left+n:se(J(e)).left+n}function Pt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-De(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Sn(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=J(o),c=t?Se(t.floating):!1;if(o===i||c&&s)return n;let u={scrollLeft:0,scrollTop:0},f=G(1);const g=G(0),m=X(o);if((m||!s)&&((ae(o)!=="body"||Me(i))&&(u=Ae(o)),m)){const l=se(o);f=le(o),g.x=l.x+o.clientLeft,g.y=l.y+o.clientTop}const d=i&&!m&&!s?Pt(i,u):G(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+g.x+d.x,y:n.y*f.y-u.scrollTop*f.y+g.y+d.y}}function Ln(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function An(e){const t=Ae(e),n=e.ownerDocument.body,o=ie(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=ie(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+De(e);const i=-t.scrollTop;return j(n).direction==="rtl"&&(s+=ie(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:s,y:i}}const Dn=25;function kn(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=K(e),s=J(e),i=r.visualViewport;let c=s.clientWidth,u=s.clientHeight,f=0,g=0;if(i){const d=!Le()||t==="fixed";o?d||(f=-i.offsetLeft,g=-i.offsetTop):(c=i.width,u=i.height,d&&(f=i.offsetLeft,g=i.offsetTop))}if(De(s)<=0){const d=s.ownerDocument,l=d.body,p=getComputedStyle(l),a=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,y=Math.abs(s.clientWidth-l.clientWidth-a),w=getComputedStyle(s).scrollbarGutter==="stable both-edges"?y/2:y;w<=Dn&&(c-=w)}return{width:c,height:u,x:f,y:g}}function In(e,t){const n=se(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=le(e),i=e.clientWidth*s.x,c=e.clientHeight*s.y,u=r*s.x,f=o*s.y;return{width:i,height:c,x:u,y:f}}function it(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=kn(e,n,t);else if(t==="document")o=An(J(e));else if(N(t))o=In(t,n);else{const r=Ot(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Oe(o)}function Fn(e,t){const n=t.get(e);if(n)return n;let o=ee(e,[],!1).filter(c=>N(c)&&ae(c)!=="body"),r=null;const s=j(e).position==="fixed";let i=s?te(e):e;for(;N(i)&&!Z(i);){const c=j(i),u=je(i),f=r?r.position:s?"fixed":"";!u&&(f==="fixed"||f==="absolute"&&c.position==="static")?o=o.filter(m=>m!==i):r=c,i=te(i)}return t.set(e,o),o}function _n(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Se(t)?[]:Fn(t,this._c):[].concat(n),o],c=it(t,i[0],r);let u=c.top,f=c.right,g=c.bottom,m=c.left;for(let d=1;d<i.length;d++){const l=it(t,i[d],r);u=ie(l.top,u),f=ue(l.right,f),g=ue(l.bottom,g),m=ie(l.left,m)}return{width:f-m,height:g-u,x:m,y:u}}function $n(e){const{width:t,height:n}=Ct(e);return{width:t,height:n}}function Nn(e,t,n){const o=X(t),r=J(t),s=n==="fixed",i=se(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=G(0);if((o||!s)&&((ae(t)!=="body"||Me(r))&&(c=Ae(t)),o)){const d=se(t,!0,s,t);u.x=d.x+t.clientLeft,u.y=d.y+t.clientTop}!o&&r&&(u.x=De(r));const f=r&&!o&&!s?Pt(r,c):G(0),g=i.left+c.scrollLeft-u.x-f.x,m=i.top+c.scrollTop-u.y-f.y;return{x:g,y:m,width:i.width,height:i.height}}function _e(e){return j(e).position==="static"}function st(e,t){if(!X(e)||j(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return J(e)===n&&(n=n.ownerDocument.body),n}function Tt(e,t){const n=K(e);if(Se(e))return n;if(!X(e)){let r=te(e);for(;r&&!Z(r);){if(N(r)&&!_e(r))return r;r=te(r)}return n}let o=st(e,t);for(;o&&Xt(o)&&_e(o);)o=st(o,t);return o&&Z(o)&&_e(o)&&!je(o)?n:o||Yt(e)||n}const Wn=async function(e){const t=this.getOffsetParent||Tt,n=this.getDimensions,o=await n(e.floating);return{reference:Nn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Vn(e){return j(e).direction==="rtl"}const Bn={convertOffsetParentRelativeRectToViewportRelativeRect:Sn,getDocumentElement:J,getClippingRect:_n,getOffsetParent:Tt,getElementRects:Wn,getClientRects:Ln,getDimensions:$n,getScale:le,isElement:N,isRTL:Vn};function Mt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hn(e,t,n){let o=null,r;const s=J(e);function i(){var g;clearTimeout(r),(g=o)==null||g.disconnect(),o=null}function c(g,m){g===void 0&&(g=!1),m===void 0&&(m=1),i();const d=e.getBoundingClientRect(),{left:l,top:p,width:a,height:y}=d;if(g||t(),!a||!y)return;const w=we(p),x=we(s.clientWidth-(l+a)),T=we(s.clientHeight-(p+y)),E=we(l),C={rootMargin:-w+"px "+-x+"px "+-T+"px "+-E+"px",threshold:ie(0,ue(1,m))||1};let P=!0;function S($){const I=$[0].intersectionRatio;if(!Mt(d,e.getBoundingClientRect()))return c();if(I!==m){if(!P)return c();I?c(!1,I):r=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{o=new IntersectionObserver(S,{...C,root:s.ownerDocument})}catch{o=new IntersectionObserver(S,C)}o.observe(e)}const u=K(e),f=()=>c(n);return u.addEventListener("resize",f),c(!0),()=>{u.removeEventListener("resize",f),i()}}function Kn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,f=qe(e),g=r||s?[...f?ee(f):[],...t?ee(t):[]]:[];g.forEach(w=>{r&&w.addEventListener("scroll",n),s&&w.addEventListener("resize",n)});const m=f&&c?Hn(f,n,s):null;let d=-1,l=null;i&&(l=new ResizeObserver(w=>{let[x]=w;x&&x.target===f&&l&&t&&(l.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var T;(T=l)==null||T.observe(t)})),n()}),f&&!u&&l.observe(f),t&&l.observe(t));let p,a=u?se(e):null;u&&y();function y(){const w=se(e);a&&!Mt(a,w)&&n(),a=w,p=requestAnimationFrame(y)}return n(),()=>{var w;g.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),m?.(),(w=l)==null||w.disconnect(),l=null,u&&cancelAnimationFrame(p)}}const Xn=On,Un=Pn,jn=bn,ct=xn,Yn=(e,t,n)=>{const o=new Map,r=n??{},s={...Bn,...r.platform,_c:o};return Rn(e,t,{...r,platform:s})};var zn=typeof document<"u",qn=function(){},xe=zn?vt:qn;function Pe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Pe(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Pe(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function St(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lt(e,t){const n=St(e);return Math.round(t*n)/n}function $e(e){const t=v.useRef(e);return xe(()=>{t.current=e}),t}function Gn(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:u,open:f}=e,[g,m]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,l]=v.useState(o);Pe(d,o)||l(o);const[p,a]=v.useState(null),[y,w]=v.useState(null),x=v.useCallback(h=>{h!==C.current&&(C.current=h,a(h))},[]),T=v.useCallback(h=>{h!==P.current&&(P.current=h,w(h))},[]),E=s||p,M=i||y,C=v.useRef(null),P=v.useRef(null),S=v.useRef(g),$=u!=null,I=$e(u),W=$e(r),_=$e(f),F=v.useCallback(()=>{if(!C.current||!P.current)return;const h={placement:t,strategy:n,middleware:d};W.current&&(h.platform=W.current),Yn(C.current,P.current,h).then(O=>{const D={...O,isPositioned:_.current!==!1};R.current&&!Pe(S.current,D)&&(S.current=D,Kt.flushSync(()=>{m(D)}))})},[d,t,n,W,_]);xe(()=>{f===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,m(h=>({...h,isPositioned:!1})))},[f]);const R=v.useRef(!1);xe(()=>(R.current=!0,()=>{R.current=!1}),[]),xe(()=>{if(E&&(C.current=E),M&&(P.current=M),E&&M){if(I.current)return I.current(E,M,F);F()}},[E,M,F,I,$]);const L=v.useMemo(()=>({reference:C,floating:P,setReference:x,setFloating:T}),[x,T]),A=v.useMemo(()=>({reference:E,floating:M}),[E,M]),b=v.useMemo(()=>{const h={position:n,left:0,top:0};if(!A.floating)return h;const O=lt(A.floating,g.x),D=lt(A.floating,g.y);return c?{...h,transform:"translate("+O+"px, "+D+"px)",...St(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:D}},[n,c,A.floating,g.x,g.y]);return v.useMemo(()=>({...g,update:F,refs:L,elements:A,floatingStyles:b}),[g,F,L,A,b])}const Jn=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?ct({element:o.current,padding:r}).fn(n):{}:o?ct({element:o,padding:r}).fn(n):{}}}},Qn=(e,t)=>{const n=Xn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zn=(e,t)=>{const n=Un(e);return{name:n.name,fn:n.fn,options:[e,t]}},eo=(e,t)=>{const n=jn(e);return{name:n.name,fn:n.fn,options:[e,t]}},to=(e,t)=>{const n=Jn(e);return{name:n.name,fn:n.fn,options:[e,t]}},no="data-floating-ui-focusable",ut="active",ft="selected",oo={...v};let at=!1,ro=0;const dt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ro++;function io(){const[e,t]=v.useState(()=>at?dt():void 0);return z(()=>{e==null&&t(dt())},[]),v.useEffect(()=>{at=!0},[]),e}const so=oo.useId,Ge=so||io;let pe;process.env.NODE_ENV!=="production"&&(pe=new Set);function co(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=pe)!=null&&e.has(r))){var s;(s=pe)==null||s.add(r),console.warn(r)}}function lo(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=pe)!=null&&e.has(r))){var s;(s=pe)==null||s.add(r),console.error(r)}}const uo=v.forwardRef(function(t,n){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:s,shift:i}},width:c=14,height:u=7,tipRadius:f=0,strokeWidth:g=0,staticOffset:m,stroke:d,d:l,style:{transform:p,...a}={},...y}=t;process.env.NODE_ENV!=="production"&&(n||co("The `ref` prop is required for `FloatingArrow`."));const w=Ge(),[x,T]=v.useState(!1);if(z(()=>{if(!r)return;j(r).direction==="rtl"&&T(!0)},[r]),!r)return null;const[E,M]=o.split("-"),C=E==="top"||E==="bottom";let P=m;(C&&i!=null&&i.x||!C&&i!=null&&i.y)&&(P=null);const S=g*2,$=S/2,I=c/2*(f/-8+1),W=u/2*f/4,_=!!l,F=P&&M==="end"?"bottom":"top";let R=P&&M==="end"?"right":"left";P&&x&&(R=M==="end"?"left":"right");const L=s?.x!=null?P||s.x:"",A=s?.y!=null?P||s.y:"",b=l||"M0,0"+(" H"+c)+(" L"+(c-I)+","+(u-W))+(" Q"+c/2+","+u+" "+I+","+(u-W))+" Z",h={top:_?"rotate(180deg)":"",left:_?"rotate(90deg)":"rotate(-90deg)",bottom:_?"":"rotate(180deg)",right:_?"rotate(-90deg)":"rotate(90deg)"}[E];return Be("svg",{...y,"aria-hidden":!0,ref:n,width:_?c:c+S,height:c,viewBox:"0 0 "+c+" "+(u>c?u:c),style:{position:"absolute",pointerEvents:"none",[R]:L,[F]:A,[E]:C||_?"100%":"calc(100% - "+S/2+"px)",transform:[h,p].filter(O=>!!O).join(" "),...a},children:[S>0&&oe("path",{clipPath:"url(#"+w+")",fill:"none",stroke:d,strokeWidth:S+(l?0:1),d:b}),oe("path",{stroke:S&&!l?y.fill:"none",d:b}),oe("clipPath",{id:w,children:oe("rect",{x:-$,y:$*(_?-1:1),width:c+S,height:c})})]})});function fo(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;(o=e.get(t))==null||o.delete(n)}}}const ao=v.createContext(null),mo=v.createContext(null),Je=()=>{var e;return((e=v.useContext(ao))==null?void 0:e.id)||null},Qe=()=>v.useContext(mo);function Ze(e){return"data-floating-ui-"+e}function U(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const mt=Ze("safe-polygon");function be(e,t,n){if(n&&!ge(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function Ne(e){return typeof e=="function"?e():e}function go(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:s,elements:i}=e,{enabled:c=!0,delay:u=0,handleClose:f=null,mouseOnly:g=!1,restMs:m=0,move:d=!0}=t,l=Qe(),p=Je(),a=ye(f),y=ye(u),w=ye(n),x=ye(m),T=v.useRef(),E=v.useRef(-1),M=v.useRef(),C=v.useRef(-1),P=v.useRef(!0),S=v.useRef(!1),$=v.useRef(()=>{}),I=v.useRef(!1),W=Y(()=>{var b;const h=(b=r.current.openEvent)==null?void 0:b.type;return h?.includes("mouse")&&h!=="mousedown"});v.useEffect(()=>{if(!c)return;function b(h){let{open:O}=h;O||(U(E),U(C),P.current=!0,I.current=!1)}return s.on("openchange",b),()=>{s.off("openchange",b)}},[c,s]),v.useEffect(()=>{if(!c||!a.current||!n)return;function b(O){W()&&o(!1,O,"hover")}const h=re(i.floating).documentElement;return h.addEventListener("mouseleave",b),()=>{h.removeEventListener("mouseleave",b)}},[i.floating,n,o,c,a,W]);const _=v.useCallback(function(b,h,O){h===void 0&&(h=!0),O===void 0&&(O="hover");const D=be(y.current,"close",T.current);D&&!M.current?(U(E),E.current=window.setTimeout(()=>o(!1,b,O),D)):h&&(U(E),o(!1,b,O))},[y,o]),F=Y(()=>{$.current(),M.current=void 0}),R=Y(()=>{if(S.current){const b=re(i.floating).body;b.style.pointerEvents="",b.removeAttribute(mt),S.current=!1}}),L=Y(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);v.useEffect(()=>{if(!c)return;function b(k){if(U(E),P.current=!1,g&&!ge(T.current)||Ne(x.current)>0&&!be(y.current,"open"))return;const V=be(y.current,"open",T.current);V?E.current=window.setTimeout(()=>{w.current||o(!0,k,"hover")},V):n||o(!0,k,"hover")}function h(k){if(L()){R();return}$.current();const V=re(i.floating);if(U(C),I.current=!1,a.current&&r.current.floatingContext){n||U(E),M.current=a.current({...r.current.floatingContext,tree:l,x:k.clientX,y:k.clientY,onClose(){R(),F(),L()||_(k,!0,"safe-polygon")}});const H=M.current;V.addEventListener("mousemove",H),$.current=()=>{V.removeEventListener("mousemove",H)};return}(T.current!=="touch"||!me(i.floating,k.relatedTarget))&&_(k)}function O(k){L()||r.current.floatingContext&&(a.current==null||a.current({...r.current.floatingContext,tree:l,x:k.clientX,y:k.clientY,onClose(){R(),F(),L()||_(k)}})(k))}function D(){U(E)}function B(k){L()||_(k,!1)}if(N(i.domReference)){const k=i.domReference,V=i.floating;return n&&k.addEventListener("mouseleave",O),d&&k.addEventListener("mousemove",b,{once:!0}),k.addEventListener("mouseenter",b),k.addEventListener("mouseleave",h),V&&(V.addEventListener("mouseleave",O),V.addEventListener("mouseenter",D),V.addEventListener("mouseleave",B)),()=>{n&&k.removeEventListener("mouseleave",O),d&&k.removeEventListener("mousemove",b),k.removeEventListener("mouseenter",b),k.removeEventListener("mouseleave",h),V&&(V.removeEventListener("mouseleave",O),V.removeEventListener("mouseenter",D),V.removeEventListener("mouseleave",B))}}},[i,c,e,g,d,_,F,R,o,n,w,l,y,a,r,L,x]),z(()=>{var b;if(c&&n&&(b=a.current)!=null&&(b=b.__options)!=null&&b.blockPointerEvents&&W()){S.current=!0;const O=i.floating;if(N(i.domReference)&&O){var h;const D=re(i.floating).body;D.setAttribute(mt,"");const B=i.domReference,k=l==null||(h=l.nodesRef.current.find(V=>V.id===p))==null||(h=h.context)==null?void 0:h.elements.floating;return k&&(k.style.pointerEvents=""),D.style.pointerEvents="none",B.style.pointerEvents="auto",O.style.pointerEvents="auto",()=>{D.style.pointerEvents="",B.style.pointerEvents="",O.style.pointerEvents=""}}}},[c,n,p,i,l,a,W]),z(()=>{n||(T.current=void 0,I.current=!1,F(),R())},[n,F,R]),v.useEffect(()=>()=>{F(),U(E),U(C),R()},[c,i.domReference,F,R]);const A=v.useMemo(()=>{function b(h){T.current=h.pointerType}return{onPointerDown:b,onPointerEnter:b,onMouseMove(h){const{nativeEvent:O}=h;function D(){!P.current&&!w.current&&o(!0,O,"hover")}g&&!ge(T.current)||n||Ne(x.current)===0||I.current&&h.movementX**2+h.movementY**2<2||(U(C),T.current==="touch"?D():(I.current=!0,C.current=window.setTimeout(D,Ne(x.current))))}}},[g,o,n,w,x]);return v.useMemo(()=>c?{reference:A}:{},[c,A])}const Ue=()=>{},po=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ue,setState:Ue,isInstantPhase:!1}),ho=()=>v.useContext(po);function vo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,floatingId:r}=e,{id:s,enabled:i=!0}=t,c=s??r,u=ho(),{currentId:f,setCurrentId:g,initialDelay:m,setState:d,timeoutMs:l}=u;return z(()=>{i&&f&&(d({delay:{open:1,close:be(m,"close")}}),f!==c&&o(!1))},[i,c,o,d,f,m]),z(()=>{function p(){o(!1),d({delay:m,currentId:null})}if(i&&f&&!n&&f===c){if(l){const a=window.setTimeout(p,l);return()=>{clearTimeout(a)}}p()}},[i,n,d,f,c,o,m,l]),z(()=>{i&&(g===Ue||!n||g(c))},[i,n,g,c]),u}function gt(e){return X(e.target)&&e.target.tagName==="BUTTON"}function wo(e){return X(e.target)&&e.target.tagName==="A"}function pt(e){return Et(e)}function yo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:s}}=e,{enabled:i=!0,event:c="click",toggle:u=!0,ignoreMouse:f=!1,keyboardHandlers:g=!0,stickIfOpen:m=!0}=t,d=v.useRef(),l=v.useRef(!1),p=v.useMemo(()=>({onPointerDown(a){d.current=a.pointerType},onMouseDown(a){const y=d.current;a.button===0&&c!=="click"&&(ge(y,!0)&&f||(n&&u&&(!(r.current.openEvent&&m)||r.current.openEvent.type==="mousedown")?o(!1,a.nativeEvent,"click"):(a.preventDefault(),o(!0,a.nativeEvent,"click"))))},onClick(a){const y=d.current;if(c==="mousedown"&&d.current){d.current=void 0;return}ge(y,!0)&&f||(n&&u&&(!(r.current.openEvent&&m)||r.current.openEvent.type==="click")?o(!1,a.nativeEvent,"click"):o(!0,a.nativeEvent,"click"))},onKeyDown(a){d.current=void 0,!(a.defaultPrevented||!g||gt(a))&&(a.key===" "&&!pt(s)&&(a.preventDefault(),l.current=!0),!wo(a)&&a.key==="Enter"&&o(!(n&&u),a.nativeEvent,"click"))},onKeyUp(a){a.defaultPrevented||!g||gt(a)||pt(s)||a.key===" "&&l.current&&(l.current=!1,o(!(n&&u),a.nativeEvent,"click"))}}),[r,s,c,f,g,o,n,m,u]);return v.useMemo(()=>i?{reference:p}:{},[i,p])}const Ro={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},xo={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ht=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function bo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:s}=e,{enabled:i=!0,escapeKey:c=!0,outsidePress:u=!0,outsidePressEvent:f="pointerdown",referencePress:g=!1,referencePressEvent:m="pointerdown",ancestorScroll:d=!1,bubbles:l,capture:p}=t,a=Qe(),y=Y(typeof u=="function"?u:()=>!1),w=typeof u=="function"?y:u,x=v.useRef(!1),{escapeKey:T,outsidePress:E}=ht(l),{escapeKey:M,outsidePress:C}=ht(p),P=v.useRef(!1),S=Y(R=>{var L;if(!n||!i||!c||R.key!=="Escape"||P.current)return;const A=(L=s.current.floatingContext)==null?void 0:L.nodeId,b=a?Re(a.nodesRef.current,A):[];if(!T&&(R.stopPropagation(),b.length>0)){let h=!0;if(b.forEach(O=>{var D;if((D=O.context)!=null&&D.open&&!O.context.dataRef.current.__escapeKeyBubbles){h=!1;return}}),!h)return}o(!1,dn(R)?R.nativeEvent:R,"escape-key")}),$=Y(R=>{var L;const A=()=>{var b;S(R),(b=ce(R))==null||b.removeEventListener("keydown",A)};(L=ce(R))==null||L.addEventListener("keydown",A)}),I=Y(R=>{var L;const A=s.current.insideReactTree;s.current.insideReactTree=!1;const b=x.current;if(x.current=!1,f==="click"&&b||A||typeof w=="function"&&!w(R))return;const h=ce(R),O="["+Ze("inert")+"]",D=re(r.floating).querySelectorAll(O);let B=N(h)?h:null;for(;B&&!Z(B);){const H=te(B);if(Z(H)||!N(H))break;B=H}if(D.length&&N(h)&&!un(h)&&!me(h,r.floating)&&Array.from(D).every(H=>!me(B,H)))return;if(X(h)&&F){const H=Z(h),q=j(h),de=/auto|scroll/,Lt=H||de.test(q.overflowX),At=H||de.test(q.overflowY),Dt=Lt&&h.clientWidth>0&&h.scrollWidth>h.clientWidth,kt=At&&h.clientHeight>0&&h.scrollHeight>h.clientHeight,It=q.direction==="rtl",Ft=kt&&(It?R.offsetX<=h.offsetWidth-h.clientWidth:R.offsetX>h.clientWidth),_t=Dt&&R.offsetY>h.clientHeight;if(Ft||_t)return}const k=(L=s.current.floatingContext)==null?void 0:L.nodeId,V=a&&Re(a.nodesRef.current,k).some(H=>{var q;return Fe(R,(q=H.context)==null?void 0:q.elements.floating)});if(Fe(R,r.floating)||Fe(R,r.domReference)||V)return;const ke=a?Re(a.nodesRef.current,k):[];if(ke.length>0){let H=!0;if(ke.forEach(q=>{var de;if((de=q.context)!=null&&de.open&&!q.context.dataRef.current.__outsidePressBubbles){H=!1;return}}),!H)return}o(!1,R,"outside-press")}),W=Y(R=>{var L;const A=()=>{var b;I(R),(b=ce(R))==null||b.removeEventListener(f,A)};(L=ce(R))==null||L.addEventListener(f,A)});v.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=E;let R=-1;function L(D){o(!1,D,"ancestor-scroll")}function A(){window.clearTimeout(R),P.current=!0}function b(){R=window.setTimeout(()=>{P.current=!1},Le()?5:0)}const h=re(r.floating);c&&(h.addEventListener("keydown",M?$:S,M),h.addEventListener("compositionstart",A),h.addEventListener("compositionend",b)),w&&h.addEventListener(f,C?W:I,C);let O=[];return d&&(N(r.domReference)&&(O=ee(r.domReference)),N(r.floating)&&(O=O.concat(ee(r.floating))),!N(r.reference)&&r.reference&&r.reference.contextElement&&(O=O.concat(ee(r.reference.contextElement)))),O=O.filter(D=>{var B;return D!==((B=h.defaultView)==null?void 0:B.visualViewport)}),O.forEach(D=>{D.addEventListener("scroll",L)}),()=>{c&&(h.removeEventListener("keydown",M?$:S,M),h.removeEventListener("compositionstart",A),h.removeEventListener("compositionend",b)),w&&h.removeEventListener(f,C?W:I,C),O.forEach(D=>{D.removeEventListener("scroll",L)}),window.clearTimeout(R)}},[s,r,c,w,f,n,o,d,i,T,E,S,M,$,I,C,W]),v.useEffect(()=>{s.current.insideReactTree=!1},[s,w,f]);const _=v.useMemo(()=>({onKeyDown:S,...g&&{[Ro[m]]:R=>{o(!1,R.nativeEvent,"reference-press")},...m!=="click"&&{onClick(R){o(!1,R.nativeEvent,"reference-press")}}}}),[S,o,g,m]),F=v.useMemo(()=>{function R(L){L.button===0&&(x.current=!0)}return{onKeyDown:S,onMouseDown:R,onMouseUp:R,[xo[f]]:()=>{s.current.insideReactTree=!0}}},[S,f,s]);return v.useMemo(()=>i?{reference:_,floating:F}:{},[i,_,F])}function Eo(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=Ge(),s=v.useRef({}),[i]=v.useState(()=>fo()),c=Je()!=null;if(process.env.NODE_ENV!=="production"){const l=o.reference;l&&!N(l)&&lo("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[u,f]=v.useState(o.reference),g=Y((l,p,a)=>{s.current.openEvent=l?p:void 0,i.emit("openchange",{open:l,event:p,reason:a,nested:c}),n?.(l,p,a)}),m=v.useMemo(()=>({setPositionReference:f}),[]),d=v.useMemo(()=>({reference:u||o.reference||null,floating:o.floating||null,domReference:o.reference}),[u,o.reference,o.floating]);return v.useMemo(()=>({dataRef:s,open:t,onOpenChange:g,elements:d,events:i,floatingId:r,refs:m}),[t,g,d,i,r,m])}function Co(e){var t,n;let{elements:o,...r}=e===void 0?{}:e;const{nodeId:s}=r,i=Eo({...r,elements:{reference:(t=o?.reference)!=null?t:null,floating:(n=o?.floating)!=null?n:null}}),c=r.rootContext||i,u=c.elements,[f,g]=v.useState(null),[m,d]=v.useState(null),p=u?.domReference||f,a=v.useRef(null),y=Qe();z(()=>{p&&(a.current=p)},[p]);const w=Gn({...r,elements:{...u,...m&&{reference:m}}}),x=v.useCallback(P=>{const S=N(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;d(S),w.refs.setReference(S)},[w.refs]),T=v.useCallback(P=>{(N(P)||P===null)&&(a.current=P,g(P)),(N(w.refs.reference.current)||w.refs.reference.current===null||P!==null&&!N(P))&&w.refs.setReference(P)},[w.refs]),E=v.useMemo(()=>({...w.refs,setReference:T,setPositionReference:x,domReference:a}),[w.refs,T,x]),M=v.useMemo(()=>({...w.elements,domReference:p}),[w.elements,p]),C=v.useMemo(()=>({...w,...c,refs:E,elements:M,nodeId:s}),[w,E,M,s,c]);return z(()=>{c.dataRef.current.floatingContext=C;const P=y?.nodesRef.current.find(S=>S.id===s);P&&(P.context=C)}),v.useMemo(()=>({...w,context:C,refs:E,elements:M}),[w,E,M,C])}function We(){return sn()&&rn()}function Oo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,events:r,dataRef:s,elements:i}=e,{enabled:c=!0,visibleOnly:u=!0}=t,f=v.useRef(!1),g=v.useRef(-1),m=v.useRef(!0);v.useEffect(()=>{if(!c)return;const l=K(i.domReference);function p(){!n&&X(i.domReference)&&i.domReference===ot(re(i.domReference))&&(f.current=!0)}function a(){m.current=!0}function y(){m.current=!1}return l.addEventListener("blur",p),We()&&(l.addEventListener("keydown",a,!0),l.addEventListener("pointerdown",y,!0)),()=>{l.removeEventListener("blur",p),We()&&(l.removeEventListener("keydown",a,!0),l.removeEventListener("pointerdown",y,!0))}},[i.domReference,n,c]),v.useEffect(()=>{if(!c)return;function l(p){let{reason:a}=p;(a==="reference-press"||a==="escape-key")&&(f.current=!0)}return r.on("openchange",l),()=>{r.off("openchange",l)}},[r,c]),v.useEffect(()=>()=>{U(g)},[]);const d=v.useMemo(()=>({onMouseLeave(){f.current=!1},onFocus(l){if(f.current)return;const p=ce(l.nativeEvent);if(u&&N(p)){if(We()&&!l.relatedTarget){if(!m.current&&!Et(p))return}else if(!fn(p))return}o(!0,l.nativeEvent,"focus")},onBlur(l){f.current=!1;const p=l.relatedTarget,a=l.nativeEvent,y=N(p)&&p.hasAttribute(Ze("focus-guard"))&&p.getAttribute("data-type")==="outside";g.current=window.setTimeout(()=>{var w;const x=ot(i.domReference?i.domReference.ownerDocument:document);!p&&x===i.domReference||me((w=s.current.floatingContext)==null?void 0:w.refs.floating.current,x)||me(i.domReference,x)||y||o(!1,a,"focus")})}}),[s,i.domReference,o,u]);return v.useMemo(()=>c?{reference:d}:{},[c,d])}function Ve(e,t,n){const o=new Map,r=n==="item";let s=e;if(r&&e){const{[ut]:i,[ft]:c,...u}=e;s=u}return{...n==="floating"&&{tabIndex:-1,[no]:""},...s,...t.map(i=>{const c=i?i[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(u=>{let[f,g]=u;if(!(r&&[ut,ft].includes(f)))if(f.indexOf("on")===0){if(o.has(f)||o.set(f,[]),typeof g=="function"){var m;(m=o.get(f))==null||m.push(g),i[f]=function(){for(var d,l=arguments.length,p=new Array(l),a=0;a<l;a++)p[a]=arguments[a];return(d=o.get(f))==null?void 0:d.map(y=>y(...p)).find(y=>y!==void 0)}}}else i[f]=g}),i),{})}}function Po(e){e===void 0&&(e=[]);const t=e.map(c=>c?.reference),n=e.map(c=>c?.floating),o=e.map(c=>c?.item),r=v.useCallback(c=>Ve(c,e,"reference"),t),s=v.useCallback(c=>Ve(c,e,"floating"),n),i=v.useCallback(c=>Ve(c,e,"item"),o);return v.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}const To=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Mo(e,t){var n,o;t===void 0&&(t={});const{open:r,elements:s,floatingId:i}=e,{enabled:c=!0,role:u="dialog"}=t,f=Ge(),g=((n=s.domReference)==null?void 0:n.id)||f,m=v.useMemo(()=>{var x;return((x=an(s.floating))==null?void 0:x.id)||i},[s.floating,i]),d=(o=To.get(u))!=null?o:u,p=Je()!=null,a=v.useMemo(()=>d==="tooltip"||u==="label"?{["aria-"+(u==="label"?"labelledby":"describedby")]:r?m:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":r?m:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:g},...d==="menu"&&p&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[d,m,p,r,g,u]),y=v.useMemo(()=>{const x={id:m,...d&&{role:d}};return d==="tooltip"||u==="label"?x:{...x,...d==="menu"&&{"aria-labelledby":g}}},[d,m,g,u]),w=v.useCallback(x=>{let{active:T,selected:E}=x;const M={role:"option",...T&&{id:m+"-fui-option"}};switch(u){case"select":case"combobox":return{...M,"aria-selected":E}}return{}},[m,u]);return v.useMemo(()=>c?{reference:a,floating:y,item:w}:{},[c,a,y,w])}function Do({closeDelay:e=300,offset:t=20,openDelay:n=0,placement:o="bottom-start",slots:r,trigger:s=["hover","focus"],withArrow:i=!0,arrow:c,role:u="dialog",visible:f={},hidden:g={},floatingOptions:m={},isOpen:d,onOpenChange:l}){const[p,a]=Nt(!1),y=Wt(null),w=Vt(),{x,y:T,strategy:E,refs:M,context:C}=Co({placement:o,middleware:[Qn(t),eo(),Zn(),to({element:y})],open:d||p,onOpenChange:l||a,whileElementsMounted:Kn,...m}),P=bo(C),S=Mo(C,{role:u}),{delay:$}=vo(C,{id:w}),W=go(C,{delay:$||{open:n,close:e}}),_=Oo(C),F=yo(C),R=[s.find(k=>k==="hover")?W:void 0,s.find(k=>k==="click")?F:void 0,s.find(k=>k==="focus")?_:void 0,P,S],{getReferenceProps:L,getFloatingProps:A}=Po(R),{onClick:b,...h}=L(),O=String((r?.content?.props).className).includes("pressable")?{onPress:b}:{onClick:b},D=r?.content?Bt(r.content,{...r.content.props,ref:M.setReference,...h,...O}):oe("div",{ref:M.setReference,...L(),children:"Menu Action"}),B=r?.submenu?Be(Ht.nav,{ref:M.setFloating,style:{position:E,top:T??0,left:x??0,width:"max-content",zIndex:50},...A(),variants:{hidden:g,visible:f},initial:"hidden",animate:d||p?"visible":"hidden",children:[i&&oe(uo,{ref:y,context:C,...c}),r.submenu]}):oe("nav",{children:"Submenu"});return Be($t,{children:[D,B]})}export{Do as Menu,Do as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as f}from"react/jsx-runtime";import{Meter as p,Label as h}from"react-aria-components";import{motion as x}from"framer-motion";import{cn as e}from"../../utils/cn.js";function w({label:i,showValue:l=!0,value:n=0,minValue:o=0,maxValue:s=100,formatOptions:c={style:"percent"},className:d,classNames:r,...m}){return t(p,{className:e("flex flex-col gap-2",d),value:n,minValue:o,maxValue:s,formatOptions:c,...m,children:({percentage:a,valueText:u})=>f("div",{className:e("flex justify-between items-center gap-4",r?.labelWrapper),children:[i&&t(h,{className:e("text-sm",r?.label),children:i}),t("div",{className:e("flex-auto h-2.5 rounded-md bg-slate-300 forced-color-adjust-none overflow-hidden",r?.trackWrapepr),children:t(x.div,{className:e("h-full bg-surface-inverse-hover",r?.track),initial:{width:`${a}%`},animate:{width:`${a}%`},transition:{type:"spring",bounce:0}})}),l&&t("span",{className:e("text-sm tabular-nums ml-auto",r?.value),children:u})]})})}export{w as Meter,w as default};
1
+ "use client";import{jsx as t,jsxs as f}from"react/jsx-runtime";import{Meter as p,Label as h}from"react-aria-components";import{m as x}from"framer-motion";import{cn as e}from"../../utils/cn.js";function w({label:a,showValue:l=!0,value:n=0,minValue:o=0,maxValue:s=100,formatOptions:c={style:"percent"},className:d,classNames:r,...m}){return t(p,{className:e("flex flex-col gap-2",d),value:n,minValue:o,maxValue:s,formatOptions:c,...m,children:({percentage:i,valueText:u})=>f("div",{className:e("flex justify-between items-center gap-4",r?.labelWrapper),children:[a&&t(h,{className:e("text-sm",r?.label),children:a}),t("div",{className:e("flex-auto h-2.5 rounded-md bg-slate-300 forced-color-adjust-none overflow-hidden",r?.trackWrapepr),children:t(x.div,{className:e("h-full bg-surface-inverse-hover",r?.track),initial:{width:`${i}%`},animate:{width:`${i}%`},transition:{type:"spring",bounce:0}})}),l&&t("span",{className:e("text-sm tabular-nums ml-auto",r?.value),children:u})]})})}export{w as Meter,w as default};
@@ -1 +1 @@
1
- "use client";import{jsxs as h,jsx as e,Fragment as d}from"react/jsx-runtime";import{memo as p,useState as b,useCallback as f,useId as x,useMemo as g}from"react";import{motion as s}from"framer-motion";import N from"./hooks/useColumnTransition.js";const k=/^-?\d*\.?\d+$/;function $({digit:i,tickerMotionProps:l,transition:m,updateTransition:n}){const[o,r]=b(0),a=f(t=>{t!==null&&r(t.clientHeight*parseInt(i,10))},[i]);return h("span",{className:"relative h-auto block",ref:a,"aria-hidden":!0,children:[e(s.span,{className:"absolute block bottom-0 h-[1000%]",initial:{x:0,y:o},animate:{x:0,y:o},transition:{...m},onAnimationComplete:n,style:{fontFeatureSettings:"tnum"},children:[9,8,7,6,5,4,3,2,1,0].map(t=>e(s.span,{className:"block text-[inherit] leading-[inherit] tabular-nums",...l,children:t},t))}),e(s.span,{className:"block text-[inherit] leading-[inherit] invisible","aria-hidden":!0,children:"0"})]})}const y=p($);function R({delta:i,digits:l,isNegative:m,tickerMotionProps:n,...o}){const r=x(),a=g(()=>typeof n=="function"?n({delta:i}):n,[i,n]),t=N({...o});return h(d,{children:[m&&e(s.span,{className:"block text-[inherit] leading-[inherit] tabular-nums","aria-hidden":!0,...a,children:"-"}),l.map((c,u)=>k.test(c)?e(y,{digit:c,tickerMotionProps:a,...t},`${r}_${u}`):e(s.span,{className:"block text-[inherit] leading-[inherit] tabular-nums","aria-hidden":!0,...a,children:c},`${r}_${u}`))]})}export{R as DigitResolver,R as default};
1
+ "use client";import{jsxs as h,jsx as n,Fragment as d}from"react/jsx-runtime";import{memo as p,useState as b,useCallback as f,useId as x,useMemo as g}from"react";import{m as s}from"framer-motion";import N from"./hooks/useColumnTransition.js";const k=/^-?\d*\.?\d+$/;function $({digit:i,tickerMotionProps:l,transition:m,updateTransition:e}){const[o,r]=b(0),a=f(t=>{t!==null&&r(t.clientHeight*parseInt(i,10))},[i]);return h("span",{className:"relative h-auto block",ref:a,"aria-hidden":!0,children:[n(s.span,{className:"absolute block bottom-0 h-[1000%]",initial:{x:0,y:o},animate:{x:0,y:o},transition:{...m},onAnimationComplete:e,style:{fontFeatureSettings:"tnum"},children:[9,8,7,6,5,4,3,2,1,0].map(t=>n(s.span,{className:"block text-[inherit] leading-[inherit] tabular-nums",...l,children:t},t))}),n(s.span,{className:"block text-[inherit] leading-[inherit] invisible","aria-hidden":!0,children:"0"})]})}const y=p($);function R({delta:i,digits:l,isNegative:m,tickerMotionProps:e,...o}){const r=x(),a=g(()=>typeof e=="function"?e({delta:i}):e,[i,e]),t=N({...o});return h(d,{children:[m&&n(s.span,{className:"block text-[inherit] leading-[inherit] tabular-nums","aria-hidden":!0,...a,children:"-"}),l.map((c,u)=>k.test(c)?n(y,{digit:c,tickerMotionProps:a,...t},`${r}_${u}`):n(s.span,{className:"block text-[inherit] leading-[inherit] tabular-nums","aria-hidden":!0,...a,children:c},`${r}_${u}`))]})}export{R as DigitResolver,R as default};
@@ -1 +1 @@
1
- "use client";import{jsxs as c,jsx as d}from"react/jsx-runtime";import{motion as x}from"framer-motion";import{cn as N}from"../../utils/cn.js";import h from"./hooks/useNumberDelta.js";import w from"./hooks/useNumberTicker.js";import{DigitResolver as b}from"./DigitResolver.js";import"react";import"./hooks/useColumnTransition.js";function T({value:t,asLocal:r,localeConfig:o,precision:i,slots:e,skipFirstAnimation:m,transition:n,tickerMotionProps:a,className:s,...u}){const{digits:f,isNegative:l}=w({value:t,asLocal:r,localeConfig:o,precision:i}),p=h(t);return c(x.span,{className:N("flex h-auto flex-row flex-nowrap overflow-hidden relative text-[inherit]",s),"aria-valuenow":t,layout:!0,layoutRoot:!0,...u,children:[e?.startContent,d(b,{isNegative:l,digits:f,tickerMotionProps:a,skipFirstAnimation:m,transition:n,delta:p}),e?.endContent]})}export{T as NumberTicker,T as default};
1
+ "use client";import{jsxs as c,jsx as d}from"react/jsx-runtime";import{m as x}from"framer-motion";import{cn as N}from"../../utils/cn.js";import h from"./hooks/useNumberDelta.js";import w from"./hooks/useNumberTicker.js";import{DigitResolver as b}from"./DigitResolver.js";import"react";import"./hooks/useColumnTransition.js";function T({value:t,asLocal:r,localeConfig:o,precision:i,slots:e,skipFirstAnimation:m,transition:n,tickerMotionProps:a,className:s,...u}){const{digits:f,isNegative:l}=w({value:t,asLocal:r,localeConfig:o,precision:i}),p=h(t);return c(x.span,{className:N("flex h-auto flex-row flex-nowrap overflow-hidden relative text-[inherit]",s),"aria-valuenow":t,layout:!0,layoutRoot:!0,...u,children:[e?.startContent,d(b,{isNegative:l,digits:f,tickerMotionProps:a,skipFirstAnimation:m,transition:n,delta:p}),e?.endContent]})}export{T as NumberTicker,T as default};