ivt 0.2.9 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/index.mjs +1 -1
- package/dist/alert/index.mjs +1 -1
- package/dist/alert-dialog/index.mjs +1 -1
- package/dist/avatar/index.mjs +1 -1
- package/dist/badge/index.d.ts +2 -1
- package/dist/badge/index.mjs +1 -1
- package/dist/base/index.mjs +1 -1
- package/dist/base/index.mjs.map +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/calendar/index.mjs +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/chart/index.mjs +1 -1
- package/dist/checkbox/index.mjs +1 -1
- package/dist/chunks/{_commonjsHelpers-Bjj-JKBe.mjs → _commonjsHelpers-6qLFzZa5.mjs} +1 -1
- package/dist/chunks/_commonjsHelpers-6qLFzZa5.mjs.map +1 -0
- package/dist/chunks/{accordion-Dl9OR3bi.mjs → accordion-CdshDFZC.mjs} +2 -2
- package/dist/chunks/{accordion-Dl9OR3bi.mjs.map → accordion-CdshDFZC.mjs.map} +1 -1
- package/dist/chunks/badge-BYqshEmA.mjs +2 -0
- package/dist/chunks/badge-BYqshEmA.mjs.map +1 -0
- package/dist/chunks/{bundle-mjs-DRUwh-0R.mjs → bundle-mjs-9BXytT_r.mjs} +1 -1
- package/dist/chunks/{bundle-mjs-DRUwh-0R.mjs.map → bundle-mjs-9BXytT_r.mjs.map} +1 -1
- package/dist/chunks/{button-Dhe5fFAk.mjs → button-DrFZXJ7z.mjs} +2 -2
- package/dist/chunks/{button-Dhe5fFAk.mjs.map → button-DrFZXJ7z.mjs.map} +1 -1
- package/dist/chunks/{calendar-CvUHWFGI.mjs → calendar-BY6t8wdJ.mjs} +2 -2
- package/dist/chunks/{calendar-CvUHWFGI.mjs.map → calendar-BY6t8wdJ.mjs.map} +1 -1
- package/dist/chunks/check-CimnOyD7.mjs +2 -0
- package/dist/chunks/{check-CTdDPXjk.mjs.map → check-CimnOyD7.mjs.map} +1 -1
- package/dist/chunks/chevron-down-D3fvbjxE.mjs +2 -0
- package/dist/chunks/{chevron-down-DDHw_qmV.mjs.map → chevron-down-D3fvbjxE.mjs.map} +1 -1
- package/dist/chunks/chevron-left-CrN7DlXg.mjs +2 -0
- package/dist/chunks/{chevron-left-CjUEKmgQ.mjs.map → chevron-left-CrN7DlXg.mjs.map} +1 -1
- package/dist/chunks/chevron-right-BMSCuDGK.mjs +2 -0
- package/dist/chunks/{chevron-right-BaRUY2Lm.mjs.map → chevron-right-BMSCuDGK.mjs.map} +1 -1
- package/dist/chunks/chevrons-up-down-DBgvRkZm.mjs +2 -0
- package/dist/chunks/chevrons-up-down-DBgvRkZm.mjs.map +1 -0
- package/dist/chunks/circle-CGqt18Bd.mjs +2 -0
- package/dist/chunks/{circle-B6AT9LZB.mjs.map → circle-CGqt18Bd.mjs.map} +1 -1
- package/dist/chunks/{command-B20MmNTS.mjs → command-C6ON-ciq.mjs} +2 -2
- package/dist/chunks/{command-B20MmNTS.mjs.map → command-C6ON-ciq.mjs.map} +1 -1
- package/dist/chunks/{createLucideIcon-Bub0IDlo.mjs → createLucideIcon-L-tld2uc.mjs} +1 -1
- package/dist/chunks/{createLucideIcon-Bub0IDlo.mjs.map → createLucideIcon-L-tld2uc.mjs.map} +1 -1
- package/dist/chunks/{dialog-DvFOk-pv.mjs → dialog-36eqHzT3.mjs} +2 -2
- package/dist/chunks/{dialog-DvFOk-pv.mjs.map → dialog-36eqHzT3.mjs.map} +1 -1
- package/dist/chunks/{hover-card-D8uFTCNm.mjs → hover-card-Cnd58du6.mjs} +2 -2
- package/dist/chunks/{hover-card-D8uFTCNm.mjs.map → hover-card-Cnd58du6.mjs.map} +1 -1
- package/dist/chunks/{index-Bv09gbbz.mjs → index-B4QsDzeM.mjs} +1 -1
- package/dist/chunks/{index-Bv09gbbz.mjs.map → index-B4QsDzeM.mjs.map} +1 -1
- package/dist/chunks/{index-B7nzlBcT.mjs → index-BdpYc58_.mjs} +2 -2
- package/dist/chunks/{index-B7nzlBcT.mjs.map → index-BdpYc58_.mjs.map} +1 -1
- package/dist/chunks/{index-DBp_Gx1M.mjs → index-CCcl327A.mjs} +1 -1
- package/dist/chunks/{index-DBp_Gx1M.mjs.map → index-CCcl327A.mjs.map} +1 -1
- package/dist/chunks/{index-DZgHf-gI.mjs → index-CLtWFQL5.mjs} +1 -1
- package/dist/chunks/{index-DZgHf-gI.mjs.map → index-CLtWFQL5.mjs.map} +1 -1
- package/dist/chunks/{index-DmBXPUeL.mjs → index-COvW87ew.mjs} +1 -1
- package/dist/chunks/{index-DmBXPUeL.mjs.map → index-COvW87ew.mjs.map} +1 -1
- package/dist/chunks/{index-ZCQr-O7f.mjs → index-CRxQlsb9.mjs} +2 -2
- package/dist/chunks/{index-ZCQr-O7f.mjs.map → index-CRxQlsb9.mjs.map} +1 -1
- package/dist/chunks/{index-Bt73Afz2.mjs → index-CU_y1XAz.mjs} +1 -1
- package/dist/chunks/{index-Bt73Afz2.mjs.map → index-CU_y1XAz.mjs.map} +1 -1
- package/dist/chunks/{index-Cu6LwID6.mjs → index-CXszXOf_.mjs} +1 -1
- package/dist/chunks/{index-Cu6LwID6.mjs.map → index-CXszXOf_.mjs.map} +1 -1
- package/dist/chunks/{index-CaYe_hNP.mjs → index-CdJCOoFA.mjs} +1 -1
- package/dist/chunks/{index-CaYe_hNP.mjs.map → index-CdJCOoFA.mjs.map} +1 -1
- package/dist/chunks/{index-DheYAHt3.mjs → index-Cpq7N5Ej.mjs} +1 -1
- package/dist/chunks/{index-DheYAHt3.mjs.map → index-Cpq7N5Ej.mjs.map} +1 -1
- package/dist/chunks/{index-VuwFoF4R.mjs → index-CybgQKpz.mjs} +2 -2
- package/dist/chunks/{index-VuwFoF4R.mjs.map → index-CybgQKpz.mjs.map} +1 -1
- package/dist/chunks/{index-C4C3l5WF.mjs → index-D2sZp5OP.mjs} +2 -2
- package/dist/chunks/{index-C4C3l5WF.mjs.map → index-D2sZp5OP.mjs.map} +1 -1
- package/dist/chunks/{index-Bo9g9ZHj.mjs → index-DOyt-JEx.mjs} +2 -2
- package/dist/chunks/{index-Bo9g9ZHj.mjs.map → index-DOyt-JEx.mjs.map} +1 -1
- package/dist/chunks/{index-BOWDavn2.mjs → index-DUNcuWJE.mjs} +2 -2
- package/dist/chunks/{index-BOWDavn2.mjs.map → index-DUNcuWJE.mjs.map} +1 -1
- package/dist/chunks/{index-czDftnY4.mjs → index-DZHMFdr0.mjs} +2 -2
- package/dist/chunks/{index-czDftnY4.mjs.map → index-DZHMFdr0.mjs.map} +1 -1
- package/dist/chunks/{index-0ahJ1Q21.mjs → index-LvOFIVGz.mjs} +2 -2
- package/dist/chunks/{index-0ahJ1Q21.mjs.map → index-LvOFIVGz.mjs.map} +1 -1
- package/dist/chunks/{index-CzTsDkbO.mjs → index-lvPXnk5F.mjs} +2 -2
- package/dist/chunks/{index-CzTsDkbO.mjs.map → index-lvPXnk5F.mjs.map} +1 -1
- package/dist/chunks/{index-gfwlB8lL.mjs → index-vmPXTidH.mjs} +2 -2
- package/dist/chunks/{index-gfwlB8lL.mjs.map → index-vmPXTidH.mjs.map} +1 -1
- package/dist/chunks/{index-DuDVR7ID.mjs → index-w9bxia3O.mjs} +1 -1
- package/dist/chunks/{index-DuDVR7ID.mjs.map → index-w9bxia3O.mjs.map} +1 -1
- package/dist/chunks/{index-GOFmxCuq.mjs → index-xew3kygQ.mjs} +2 -2
- package/dist/chunks/{index-GOFmxCuq.mjs.map → index-xew3kygQ.mjs.map} +1 -1
- package/dist/chunks/{input-DnILT0JB.mjs → input-85UFztMJ.mjs} +2 -2
- package/dist/chunks/{input-DnILT0JB.mjs.map → input-85UFztMJ.mjs.map} +1 -1
- package/dist/chunks/{label-C4MbS7O2.mjs → label-CICFzZIt.mjs} +2 -2
- package/dist/chunks/{label-C4MbS7O2.mjs.map → label-CICFzZIt.mjs.map} +1 -1
- package/dist/chunks/{pagination-BvnQsAX6.mjs → pagination-CReDQes6.mjs} +2 -2
- package/dist/chunks/{pagination-BvnQsAX6.mjs.map → pagination-CReDQes6.mjs.map} +1 -1
- package/dist/chunks/{popover-CLYjD1Mz.mjs → popover-Cn2ZTvKd.mjs} +2 -2
- package/dist/chunks/{popover-CLYjD1Mz.mjs.map → popover-Cn2ZTvKd.mjs.map} +1 -1
- package/dist/chunks/{progress-B7e979vj.mjs → progress-CSxQH6-f.mjs} +2 -2
- package/dist/chunks/{progress-B7e979vj.mjs.map → progress-CSxQH6-f.mjs.map} +1 -1
- package/dist/chunks/{scroll-area-DeP5Jei7.mjs → scroll-area-CvCz7cL_.mjs} +2 -2
- package/dist/chunks/{scroll-area-DeP5Jei7.mjs.map → scroll-area-CvCz7cL_.mjs.map} +1 -1
- package/dist/chunks/select-BR6_N_Yo.mjs +2 -0
- package/dist/chunks/select-BR6_N_Yo.mjs.map +1 -0
- package/dist/chunks/{separator-DbIrm4r-.mjs → separator-BB6-E9Z1.mjs} +2 -2
- package/dist/chunks/{separator-DbIrm4r-.mjs.map → separator-BB6-E9Z1.mjs.map} +1 -1
- package/dist/chunks/{skeleton-j85jApz0.mjs → skeleton-XPWWiaac.mjs} +2 -2
- package/dist/chunks/{skeleton-j85jApz0.mjs.map → skeleton-XPWWiaac.mjs.map} +1 -1
- package/dist/chunks/{sortable-D6tXnjgL.mjs → sortable-CqPFGn8Q.mjs} +2 -2
- package/dist/chunks/{sortable-D6tXnjgL.mjs.map → sortable-CqPFGn8Q.mjs.map} +1 -1
- package/dist/chunks/{table-BsrKQPpM.mjs → table-LQIHzPHi.mjs} +2 -2
- package/dist/chunks/{table-BsrKQPpM.mjs.map → table-LQIHzPHi.mjs.map} +1 -1
- package/dist/chunks/{toggle-DFi2H45K.mjs → toggle-Co72WXGd.mjs} +2 -2
- package/dist/chunks/{toggle-DFi2H45K.mjs.map → toggle-Co72WXGd.mjs.map} +1 -1
- package/dist/chunks/tooltip-qX2HjdJP.mjs +2 -0
- package/dist/chunks/tooltip-qX2HjdJP.mjs.map +1 -0
- package/dist/chunks/{tslib.es6-mR5Ag05r.mjs → tslib.es6-cMGqxriw.mjs} +1 -1
- package/dist/chunks/{tslib.es6-mR5Ag05r.mjs.map → tslib.es6-cMGqxriw.mjs.map} +1 -1
- package/dist/chunks/{utils-C1EKaz-p.mjs → utils-BctauAA9.mjs} +2 -2
- package/dist/chunks/{utils-C1EKaz-p.mjs.map → utils-BctauAA9.mjs.map} +1 -1
- package/dist/chunks/x-BNLl0E-E.mjs +2 -0
- package/dist/chunks/{x-B1PdcxpA.mjs.map → x-BNLl0E-E.mjs.map} +1 -1
- package/dist/combobox/index.mjs +1 -1
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.mjs +1 -1
- package/dist/data-table/index.mjs +1 -1
- package/dist/dialog/index.mjs +1 -1
- package/dist/dropdown-menu/index.mjs +1 -1
- package/dist/dropzone/index.mjs +1 -1
- package/dist/form/index.mjs +1 -1
- package/dist/hover-card/index.mjs +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/input/index.mjs +1 -1
- package/dist/ivt.css +1 -1
- package/dist/label/index.mjs +1 -1
- package/dist/menubar/index.mjs +1 -1
- package/dist/multi-select/index.d.ts +5 -1
- package/dist/multi-select/index.mjs +1 -1
- package/dist/multi-select/index.mjs.map +1 -1
- package/dist/pagination/index.mjs +1 -1
- package/dist/popover/index.mjs +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/radio-group/index.mjs +1 -1
- package/dist/scroll-area/index.mjs +1 -1
- package/dist/select/index.d.ts +13 -11
- package/dist/select/index.mjs +1 -1
- package/dist/separator/index.mjs +1 -1
- package/dist/sheet/index.mjs +1 -1
- package/dist/skeleton/index.mjs +1 -1
- package/dist/sortable/index.mjs +1 -1
- package/dist/table/index.mjs +1 -1
- package/dist/tabs/index.mjs +1 -1
- package/dist/textarea/index.mjs +1 -1
- package/dist/toast/index.mjs +1 -1
- package/dist/toggle/index.mjs +1 -1
- package/dist/toggle-group/index.mjs +1 -1
- package/dist/tooltip/index.mjs +1 -1
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/chunks/_commonjsHelpers-Bjj-JKBe.mjs.map +0 -1
- package/dist/chunks/badge-CPhxsSVZ.mjs +0 -2
- package/dist/chunks/badge-CPhxsSVZ.mjs.map +0 -1
- package/dist/chunks/check-CTdDPXjk.mjs +0 -2
- package/dist/chunks/chevron-down-DDHw_qmV.mjs +0 -2
- package/dist/chunks/chevron-left-CjUEKmgQ.mjs +0 -2
- package/dist/chunks/chevron-right-BaRUY2Lm.mjs +0 -2
- package/dist/chunks/circle-B6AT9LZB.mjs +0 -2
- package/dist/chunks/select-BdrpNh7G.mjs +0 -2
- package/dist/chunks/select-BdrpNh7G.mjs.map +0 -1
- package/dist/chunks/x-B1PdcxpA.mjs +0 -2
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{c as o}from"./index-
|
2
|
-
//# sourceMappingURL=index-
|
1
|
+
import*as e from"react";import{c as o}from"./index-CdJCOoFA.mjs";import{u as t}from"./index-COvW87ew.mjs";import{c as n,a as r}from"./index-CCcl327A.mjs";import{u as a}from"./index-CRxQlsb9.mjs";import{u as i}from"./index-CybgQKpz.mjs";import{P as s,D as c}from"./index-xew3kygQ.mjs";import{h as l,R as d,u,F as p}from"./index-lvPXnk5F.mjs";import{P as f}from"./index-BdpYc58_.mjs";import{P as m}from"./index-w9bxia3O.mjs";import{createSlot as g}from"@radix-ui/react-slot";import{jsx as D,jsxs as h,Fragment as v}from"react/jsx-runtime";var R="Dialog",[_,y]=n(R),[b,C]=_(R),I=o=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:c,modal:l=!0}=o,d=e.useRef(null),u=e.useRef(null),[p,f]=i({prop:r,defaultProp:s??!1,onChange:c,caller:R});return D(b,{scope:t,triggerRef:d,contentRef:u,contentId:a(),titleId:a(),descriptionId:a(),open:p,onOpenChange:f,onOpenToggle:e.useCallback(()=>f(e=>!e),[f]),modal:l,children:n})};I.displayName=R;var O="DialogTrigger",w=e.forwardRef((e,n)=>{const{__scopeDialog:r,...a}=e,i=C(O,r),s=t(n,i.triggerRef);return D(m.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Z(i.open),...a,ref:s,onClick:o(e.onClick,i.onOpenToggle)})});w.displayName=O;var F="DialogPortal",[x,N]=_(F,{forceMount:void 0}),P=o=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=o,i=C(F,t);return D(x,{scope:t,forceMount:n,children:e.Children.map(r,e=>D(f,{present:n||i.open,children:D(s,{asChild:!0,container:a,children:e})}))})};P.displayName=F;var E="DialogOverlay",j=e.forwardRef((e,o)=>{const t=N(E,e.__scopeDialog),{forceMount:n=t.forceMount,...r}=e,a=C(E,e.__scopeDialog);return a.modal?D(f,{present:n||a.open,children:D(M,{...r,ref:o})}):null});j.displayName=E;var A=g("DialogOverlay.RemoveScroll"),M=e.forwardRef((e,o)=>{const{__scopeDialog:t,...n}=e,r=C(E,t);return D(d,{as:A,allowPinchZoom:!0,shards:[r.contentRef],children:D(m.div,{"data-state":Z(r.open),...n,ref:o,style:{pointerEvents:"auto",...n.style}})})}),T="DialogContent",k=e.forwardRef((e,o)=>{const t=N(T,e.__scopeDialog),{forceMount:n=t.forceMount,...r}=e,a=C(T,e.__scopeDialog);return D(f,{present:n||a.open,children:a.modal?D($,{...r,ref:o}):D(W,{...r,ref:o})})});k.displayName=T;var $=e.forwardRef((n,r)=>{const a=C(T,n.__scopeDialog),i=e.useRef(null),s=t(r,a.contentRef,i);return e.useEffect(()=>{const e=i.current;if(e)return l(e)},[]),D(S,{...n,ref:s,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:o(n.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:o(n.onPointerDownOutside,e=>{const o=e.detail.originalEvent,t=0===o.button&&!0===o.ctrlKey;(2===o.button||t)&&e.preventDefault()}),onFocusOutside:o(n.onFocusOutside,e=>e.preventDefault())})}),W=e.forwardRef((o,t)=>{const n=C(T,o.__scopeDialog),r=e.useRef(!1),a=e.useRef(!1);return D(S,{...o,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{o.onCloseAutoFocus?.(e),e.defaultPrevented||(r.current||n.triggerRef.current?.focus(),e.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:e=>{o.onInteractOutside?.(e),e.defaultPrevented||(r.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const t=e.target,i=n.triggerRef.current?.contains(t);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),S=e.forwardRef((o,n)=>{const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=o,d=C(T,r),f=e.useRef(null),m=t(n,f);return u(),h(v,{children:[D(p,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:D(c,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Z(d.open),...l,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),h(v,{children:[D(L,{titleId:d.titleId}),D(Q,{contentRef:f,descriptionId:d.descriptionId})]})]})}),B="DialogTitle",q=e.forwardRef((e,o)=>{const{__scopeDialog:t,...n}=e,r=C(B,t);return D(m.h2,{id:r.titleId,...n,ref:o})});q.displayName=B;var H="DialogDescription",K=e.forwardRef((e,o)=>{const{__scopeDialog:t,...n}=e,r=C(H,t);return D(m.p,{id:r.descriptionId,...n,ref:o})});K.displayName=H;var U="DialogClose",V=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=C(U,n);return D(m.button,{type:"button",...r,ref:t,onClick:o(e.onClick,()=>a.onOpenChange(!1))})});function Z(e){return e?"open":"closed"}V.displayName=U;var z="DialogTitleWarning",[G,J]=r(z,{contentName:T,titleName:B,docsSlug:"dialog"}),L=({titleId:o})=>{const t=J(z),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return e.useEffect(()=>{if(o){document.getElementById(o)}},[n,o]),null},Q=({contentRef:o,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${J("DialogDescriptionWarning").contentName}}.`;return e.useEffect(()=>{const e=o.current?.getAttribute("aria-describedby");if(t&&e){document.getElementById(t)}},[n,o,t]),null},X=I,Y=w,ee=P,oe=j,te=k,ne=q,re=K,ae=V;export{ae as C,re as D,oe as O,ee as P,X as R,ne as T,G as W,te as a,Y as b,y as c};
|
2
|
+
//# sourceMappingURL=index-DUNcuWJE.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-BOWDavn2.mjs","sources":["../../node_modules/@radix-ui/react-dialog/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContext, createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar Slot = createSlot(\"DialogOverlay.RemoveScroll\");\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: forwardedRef,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n useFocusGuards();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: composedRefs,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ),\n /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })\n ] })\n ] });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar TITLE_WARNING_NAME = \"DialogTitleWarning\";\nvar [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"dialog\"\n});\nvar TitleWarning = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n return null;\n};\nvar DESCRIPTION_WARNING_NAME = \"DialogDescriptionWarning\";\nvar DescriptionWarning = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute(\"aria-describedby\");\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n return null;\n};\nvar Root = Dialog;\nvar Trigger = DialogTrigger;\nvar Portal = DialogPortal;\nvar Overlay = DialogOverlay;\nvar Content = DialogContent;\nvar Title = DialogTitle;\nvar Description = DialogDescription;\nvar Close = DialogClose;\nexport {\n Close,\n Content,\n Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DIALOG_NAME","createDialogContext","createDialogScope","createContextScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","open","openProp","defaultOpen","onOpenChange","modal","triggerRef","React","useRef","contentRef","setOpen","useControllableState","prop","defaultProp","onChange","caller","jsx","scope","contentId","useId","titleId","descriptionId","onOpenToggle","useCallback","prevOpen","displayName","TRIGGER_NAME","DialogTrigger","forwardRef","forwardedRef","triggerProps","context","composedTriggerRef","useComposedRefs","Primitive","button","type","getState","ref","onClick","composeEventHandlers","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","DialogPortal","container","Children","map","child","Presence","present","PortalPrimitive","asChild","OVERLAY_NAME","DialogOverlay","portalContext","overlayProps","DialogOverlayImpl","Slot","createSlot","RemoveScroll","as","allowPinchZoom","shards","div","style","pointerEvents","CONTENT_NAME","DialogContent","contentProps","DialogContentModal","DialogContentNonModal","composedRefs","useEffect","content","current","hideOthers","DialogContentImpl","trapFocus","disableOutsidePointerEvents","onCloseAutoFocus","event","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","ctrlKey","onFocusOutside","hasInteractedOutsideRef","hasPointerDownOutsideRef","defaultPrevented","onInteractOutside","target","targetIsTrigger","contains","onOpenAutoFocus","useFocusGuards","jsxs","Fragment","FocusScope","loop","trapped","onMountAutoFocus","onUnmountAutoFocus","DismissableLayer","role","id","onDismiss","TitleWarning","DescriptionWarning","TITLE_NAME","DialogTitle","titleProps","h2","DESCRIPTION_NAME","DialogDescription","descriptionProps","p","CLOSE_NAME","DialogClose","closeProps","TITLE_WARNING_NAME","WarningProvider","useWarningContext","createContext","contentName","titleName","docsSlug","titleWarningContext","MESSAGE","document","getElementById","describedById","getAttribute","Root","Trigger","Portal","Overlay","Content","Title","Description","Close"],"mappings":"yhBAsBA,IAAMA,EAAc,UAGbC,EAAqBC,GAAqBC,EAAmBH,IAc7DI,EAAgBC,GAAoBJ,EAAwCD,GAU7EM,EAAiCC,IACrC,MAAMC,cACJA,EAAAC,SACAA,EACAC,KAAMC,EAAAC,YACNA,EAAAC,aACAA,EAAAC,MACAA,GAAQ,GACNP,EACEQ,EAAmBC,EAAAC,OAA0B,MAC7CC,EAAmBF,EAAAC,OAA6B,OAC/CP,EAAMS,GAAWC,EAAqB,CAC3CC,KAAMV,EACNW,YAAaV,IAAe,EAC5BW,SAAUV,EACVW,OAAQxB,IAGV,OACEyB,EAACrB,EAAA,CACCsB,MAAOlB,EACPO,aACAG,aACAS,UAAWC,IACXC,QAASD,IACTE,cAAeF,IACflB,OACAG,aAAcM,EACdY,aAAoBf,EAAAgB,YAAY,IAAMb,EAASc,IAAcA,GAAW,CAACd,IACzEL,QAECL,cAKPH,EAAO4B,YAAclC,EAMrB,IAAMmC,EAAe,gBAMfC,EAAsBpB,EAAAqB,WAC1B,CAAC9B,EAAwC+B,KACvC,MAAM9B,cAAEA,KAAkB+B,GAAiBhC,EACrCiC,EAAUnC,EAAiB8B,EAAc3B,GACzCiC,EAAqBC,EAAgBJ,EAAcE,EAAQzB,YACjE,OACEU,EAACkB,EAAUC,OAAV,CACCC,KAAK,SACL,gBAAc,SACd,gBAAeL,EAAQ9B,KACvB,gBAAe8B,EAAQb,UACvB,aAAYmB,EAASN,EAAQ9B,SACzB6B,EACJQ,IAAKN,EACLO,QAASC,EAAqB1C,EAAMyC,QAASR,EAAQT,kBAM7DK,EAAcF,YAAcC,EAM5B,IAAMe,EAAc,gBAGbC,EAAgBC,GAAoBnD,EAAwCiD,EAAa,CAC9FG,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C3E,MACM+G,EAAU,6EADkBN,EARH,4BASwFE,gBAWvH,OATMzH,EAAAmE,UAAU,KACd,MAAM6D,EAAgB9H,EAAWmE,SAAS4D,aAAa,oBAEvD,GAAInH,GAAiBkH,EAAe,CACXF,SAASC,eAAejH,EAEjD,GACC,CAAC+G,EAAS3H,EAAYY,IAElB,MAGHoH,EAAO5I,EACP6I,EAAU/G,EACVgH,GAAS9F,EACT+F,GAAUrF,EACVsF,GAAUxE,EACVyE,GAAQ5B,EACR6B,GAAczB,EACd0B,GAAQtB","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index-DUNcuWJE.mjs","sources":["../../node_modules/@radix-ui/react-dialog/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContext, createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar Slot = createSlot(\"DialogOverlay.RemoveScroll\");\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: forwardedRef,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n useFocusGuards();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: composedRefs,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ),\n /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })\n ] })\n ] });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar TITLE_WARNING_NAME = \"DialogTitleWarning\";\nvar [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"dialog\"\n});\nvar TitleWarning = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n return null;\n};\nvar DESCRIPTION_WARNING_NAME = \"DialogDescriptionWarning\";\nvar DescriptionWarning = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute(\"aria-describedby\");\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n return null;\n};\nvar Root = Dialog;\nvar Trigger = DialogTrigger;\nvar Portal = DialogPortal;\nvar Overlay = DialogOverlay;\nvar Content = DialogContent;\nvar Title = DialogTitle;\nvar Description = DialogDescription;\nvar Close = DialogClose;\nexport {\n Close,\n Content,\n Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DIALOG_NAME","createDialogContext","createDialogScope","createContextScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","open","openProp","defaultOpen","onOpenChange","modal","triggerRef","React","useRef","contentRef","setOpen","useControllableState","prop","defaultProp","onChange","caller","jsx","scope","contentId","useId","titleId","descriptionId","onOpenToggle","useCallback","prevOpen","displayName","TRIGGER_NAME","DialogTrigger","forwardRef","forwardedRef","triggerProps","context","composedTriggerRef","useComposedRefs","Primitive","button","type","getState","ref","onClick","composeEventHandlers","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","DialogPortal","container","Children","map","child","Presence","present","PortalPrimitive","asChild","OVERLAY_NAME","DialogOverlay","portalContext","overlayProps","DialogOverlayImpl","Slot","createSlot","RemoveScroll","as","allowPinchZoom","shards","div","style","pointerEvents","CONTENT_NAME","DialogContent","contentProps","DialogContentModal","DialogContentNonModal","composedRefs","useEffect","content","current","hideOthers","DialogContentImpl","trapFocus","disableOutsidePointerEvents","onCloseAutoFocus","event","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","ctrlKey","onFocusOutside","hasInteractedOutsideRef","hasPointerDownOutsideRef","defaultPrevented","onInteractOutside","target","targetIsTrigger","contains","onOpenAutoFocus","useFocusGuards","jsxs","Fragment","FocusScope","loop","trapped","onMountAutoFocus","onUnmountAutoFocus","DismissableLayer","role","id","onDismiss","TitleWarning","DescriptionWarning","TITLE_NAME","DialogTitle","titleProps","h2","DESCRIPTION_NAME","DialogDescription","descriptionProps","p","CLOSE_NAME","DialogClose","closeProps","TITLE_WARNING_NAME","WarningProvider","useWarningContext","createContext","contentName","titleName","docsSlug","titleWarningContext","MESSAGE","document","getElementById","describedById","getAttribute","Root","Trigger","Portal","Overlay","Content","Title","Description","Close"],"mappings":"yh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CAAC+G,EAAS3H,EAAYY,IAElB,MAGHoH,EAAO5I,EACP6I,EAAU/G,EACVgH,GAAS9F,EACT+F,GAAUrF,EACVsF,GAAUxE,EACVyE,GAAQ5B,EACR6B,GAAczB,EACd0B,GAAQtB","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{c as n}from"./index-CaYe_hNP.mjs";import{createCollection as t}from"@radix-ui/react-collection";import{u as r,c as o}from"./index-DmBXPUeL.mjs";import{c as a}from"./index-DBp_Gx1M.mjs";import{u as c}from"./index-Bt73Afz2.mjs";import{P as s,D as u}from"./index-GOFmxCuq.mjs";import{h as i,u as l,R as d,F as f}from"./index-CzTsDkbO.mjs";import{u as p}from"./index-ZCQr-O7f.mjs";import{c as m,R as h,A as v,C as g,a as _}from"./index-Bo9g9ZHj.mjs";import{P as w}from"./index-B7nzlBcT.mjs";import{P as M,d as C}from"./index-DuDVR7ID.mjs";import{c as y,I as b,R}from"./index-0ahJ1Q21.mjs";import{createSlot as P}from"@radix-ui/react-slot";import{u as k}from"./index-Cu6LwID6.mjs";import{jsx as x}from"react/jsx-runtime";var D=["Enter"," "],E=["ArrowUp","PageDown","End"],O=["ArrowDown","PageUp","Home",...E],I={ltr:[...D,"ArrowRight"],rtl:[...D,"ArrowLeft"]},S={ltr:["ArrowLeft"],rtl:["ArrowRight"]},T="Menu",[F,L,K]=t(T),[A,N]=a(T,[K,m,y]),j=m(),G=y(),[V,U]=A(T),[B,X]=A(T),Y=n=>{const{__scopeMenu:t,open:r=!1,children:o,dir:a,onOpenChange:s,modal:u=!0}=n,i=j(t),[l,d]=e.useState(null),f=e.useRef(!1),p=k(s),m=c(a);return e.useEffect(()=>{const e=()=>{f.current=!0,document.addEventListener("pointerdown",n,{capture:!0,once:!0}),document.addEventListener("pointermove",n,{capture:!0,once:!0})},n=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",n,{capture:!0}),document.removeEventListener("pointermove",n,{capture:!0})}},[]),x(h,{...i,children:x(V,{scope:t,open:r,onOpenChange:p,content:l,onContentChange:d,children:x(B,{scope:t,onClose:e.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:u,children:o})})})};Y.displayName=T;var z=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e,o=j(t);return x(v,{...o,...r,ref:n})});z.displayName="MenuAnchor";var H="MenuPortal",[W,Z]=A(H,{forceMount:void 0}),q=e=>{const{__scopeMenu:n,forceMount:t,children:r,container:o}=e,a=U(H,n);return x(W,{scope:n,forceMount:t,children:x(w,{present:t||a.open,children:x(s,{asChild:!0,container:o,children:r})})})};q.displayName=H;var J="MenuContent",[Q,$]=A(J),ee=e.forwardRef((e,n)=>{const t=Z(J,e.__scopeMenu),{forceMount:r=t.forceMount,...o}=e,a=U(J,e.__scopeMenu),c=X(J,e.__scopeMenu);return x(F.Provider,{scope:e.__scopeMenu,children:x(w,{present:r||a.open,children:x(F.Slot,{scope:e.__scopeMenu,children:c.modal?x(ne,{...o,ref:n}):x(te,{...o,ref:n})})})})}),ne=e.forwardRef((t,o)=>{const a=U(J,t.__scopeMenu),c=e.useRef(null),s=r(o,c);return e.useEffect(()=>{const e=c.current;if(e)return i(e)},[]),x(oe,{...t,ref:s,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:n(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),te=e.forwardRef((e,n)=>{const t=U(J,e.__scopeMenu);return x(oe,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),re=P("MenuContent.ScrollLock"),oe=e.forwardRef((t,o)=>{const{__scopeMenu:a,loop:c=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:p,disableOutsidePointerEvents:m,onEntryFocus:h,onEscapeKeyDown:v,onPointerDownOutside:_,onFocusOutside:w,onInteractOutside:M,onDismiss:C,disableOutsideScroll:y,...b}=t,P=U(J,a),k=X(J,a),D=j(a),I=G(a),S=L(a),[T,F]=e.useState(null),K=e.useRef(null),A=r(o,K,P.onContentChange),N=e.useRef(0),V=e.useRef(""),B=e.useRef(0),Y=e.useRef(null),z=e.useRef("right"),H=e.useRef(0),W=y?d:e.Fragment,Z=y?{as:re,allowPinchZoom:!0}:void 0,q=e=>{const n=V.current+e,t=S().filter(e=>!e.disabled),r=document.activeElement,o=t.find(e=>e.ref.current===r)?.textValue,a=function(e,n,t){const r=n.length>1&&Array.from(n).every(e=>e===n[0]),o=r?n[0]:n,a=t?e.indexOf(t):-1;let c=(s=e,u=Math.max(a,0),s.map((e,n)=>s[(u+n)%s.length]));var s,u;1===o.length&&(c=c.filter(e=>e!==t));const i=c.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return i!==t?i:void 0}(t.map(e=>e.textValue),n,o),c=t.find(e=>e.textValue===a)?.ref.current;!function e(n){V.current=n,window.clearTimeout(N.current),""!==n&&(N.current=window.setTimeout(()=>e(""),1e3))}(n),c&&setTimeout(()=>c.focus())};e.useEffect(()=>()=>window.clearTimeout(N.current),[]),l();const $=e.useCallback(e=>z.current===Y.current?.side&&function(e,n){if(!n)return!1;const t={x:e.clientX,y:e.clientY};return function(e,n){const{x:t,y:r}=e;let o=!1;for(let e=0,a=n.length-1;e<n.length;a=e++){const c=n[e],s=n[a],u=c.x,i=c.y,l=s.x,d=s.y;i>r!=d>r&&t<(l-u)*(r-i)/(d-i)+u&&(o=!o)}return o}(t,n)}(e,Y.current?.area),[]);return x(Q,{scope:a,searchRef:V,onItemEnter:e.useCallback(e=>{$(e)&&e.preventDefault()},[$]),onItemLeave:e.useCallback(e=>{$(e)||(K.current?.focus(),F(null))},[$]),onTriggerLeave:e.useCallback(e=>{$(e)&&e.preventDefault()},[$]),pointerGraceTimerRef:B,onPointerGraceIntentChange:e.useCallback(e=>{Y.current=e},[]),children:x(W,{...Z,children:x(f,{asChild:!0,trapped:s,onMountAutoFocus:n(i,e=>{e.preventDefault(),K.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:x(u,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:v,onPointerDownOutside:_,onFocusOutside:w,onInteractOutside:M,onDismiss:C,children:x(R,{asChild:!0,...I,dir:k.dir,orientation:"vertical",loop:c,currentTabStopId:T,onCurrentTabStopIdChange:F,onEntryFocus:n(h,e=>{k.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:x(g,{role:"menu","aria-orientation":"vertical","data-state":Se(P.open),"data-radix-menu-content":"",dir:k.dir,...D,...b,ref:A,style:{outline:"none",...b.style},onKeyDown:n(b.onKeyDown,e=>{const n=e.target.closest("[data-radix-menu-content]")===e.currentTarget,t=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;n&&("Tab"===e.key&&e.preventDefault(),!t&&r&&q(e.key));const o=K.current;if(e.target!==o)return;if(!O.includes(e.key))return;e.preventDefault();const a=S().filter(e=>!e.disabled).map(e=>e.ref.current);E.includes(e.key)&&a.reverse(),function(e){const n=document.activeElement;for(const t of e){if(t===n)return;if(t.focus(),document.activeElement!==n)return}}(a)}),onBlur:n(t.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),V.current="")}),onPointerMove:n(t.onPointerMove,Le(e=>{const n=e.target,t=H.current!==e.clientX;if(e.currentTarget.contains(n)&&t){const n=e.clientX>H.current?"right":"left";z.current=n,H.current=e.clientX}}))})})})})})})});ee.displayName=J;var ae=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{role:"group",...r,ref:n})});ae.displayName="MenuGroup";var ce=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{...r,ref:n})});ce.displayName="MenuLabel";var se="MenuItem",ue="menu.itemSelect",ie=e.forwardRef((t,o)=>{const{disabled:a=!1,onSelect:c,...s}=t,u=e.useRef(null),i=X(se,t.__scopeMenu),l=$(se,t.__scopeMenu),d=r(o,u),f=e.useRef(!1);return x(le,{...s,ref:d,disabled:a,onClick:n(t.onClick,()=>{const e=u.current;if(!a&&e){const n=new CustomEvent(ue,{bubbles:!0,cancelable:!0});e.addEventListener(ue,e=>c?.(e),{once:!0}),C(e,n),n.defaultPrevented?f.current=!1:i.onClose()}}),onPointerDown:e=>{t.onPointerDown?.(e),f.current=!0},onPointerUp:n(t.onPointerUp,e=>{f.current||e.currentTarget?.click()}),onKeyDown:n(t.onKeyDown,e=>{const n=""!==l.searchRef.current;a||n&&" "===e.key||D.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ie.displayName=se;var le=e.forwardRef((t,o)=>{const{__scopeMenu:a,disabled:c=!1,textValue:s,...u}=t,i=$(se,a),l=G(a),d=e.useRef(null),f=r(o,d),[p,m]=e.useState(!1),[h,v]=e.useState("");return e.useEffect(()=>{const e=d.current;e&&v((e.textContent??"").trim())},[u.children]),x(F.ItemSlot,{scope:a,disabled:c,textValue:s??h,children:x(b,{asChild:!0,...l,focusable:!c,children:x(M.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...u,ref:f,onPointerMove:n(t.onPointerMove,Le(e=>{if(c)i.onItemLeave(e);else if(i.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:n(t.onPointerLeave,Le(e=>i.onItemLeave(e))),onFocus:n(t.onFocus,()=>m(!0)),onBlur:n(t.onBlur,()=>m(!1))})})})}),de=e.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:o,...a}=e;return x(we,{scope:e.__scopeMenu,checked:r,children:x(ie,{role:"menuitemcheckbox","aria-checked":Te(r)?"mixed":r,...a,ref:t,"data-state":Fe(r),onSelect:n(a.onSelect,()=>o?.(!!Te(r)||!r),{checkForDefaultPrevented:!1})})})});de.displayName="MenuCheckboxItem";var fe="MenuRadioGroup",[pe,me]=A(fe,{value:void 0,onValueChange:()=>{}}),he=e.forwardRef((e,n)=>{const{value:t,onValueChange:r,...o}=e,a=k(r);return x(pe,{scope:e.__scopeMenu,value:t,onValueChange:a,children:x(ae,{...o,ref:n})})});he.displayName=fe;var ve="MenuRadioItem",ge=e.forwardRef((e,t)=>{const{value:r,...o}=e,a=me(ve,e.__scopeMenu),c=r===a.value;return x(we,{scope:e.__scopeMenu,checked:c,children:x(ie,{role:"menuitemradio","aria-checked":c,...o,ref:t,"data-state":Fe(c),onSelect:n(o.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ge.displayName=ve;var _e="MenuItemIndicator",[we,Me]=A(_e,{checked:!1}),Ce=e.forwardRef((e,n)=>{const{__scopeMenu:t,forceMount:r,...o}=e,a=Me(_e,t);return x(w,{present:r||Te(a.checked)||!0===a.checked,children:x(M.span,{...o,ref:n,"data-state":Fe(a.checked)})})});Ce.displayName=_e;var ye=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})});ye.displayName="MenuSeparator";var be=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e,o=j(t);return x(_,{...o,...r,ref:n})});be.displayName="MenuArrow";var Re="MenuSub",[Pe,ke]=A(Re),xe=n=>{const{__scopeMenu:t,children:r,open:o=!1,onOpenChange:a}=n,c=U(Re,t),s=j(t),[u,i]=e.useState(null),[l,d]=e.useState(null),f=k(a);return e.useEffect(()=>(!1===c.open&&f(!1),()=>f(!1)),[c.open,f]),x(h,{...s,children:x(V,{scope:t,open:o,onOpenChange:f,content:l,onContentChange:d,children:x(Pe,{scope:t,contentId:p(),triggerId:p(),trigger:u,onTriggerChange:i,children:r})})})};xe.displayName=Re;var De="MenuSubTrigger",Ee=e.forwardRef((t,r)=>{const a=U(De,t.__scopeMenu),c=X(De,t.__scopeMenu),s=ke(De,t.__scopeMenu),u=$(De,t.__scopeMenu),i=e.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:d}=u,f={__scopeMenu:t.__scopeMenu},p=e.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return e.useEffect(()=>p,[p]),e.useEffect(()=>{const e=l.current;return()=>{window.clearTimeout(e),d(null)}},[l,d]),x(z,{asChild:!0,...f,children:x(le,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":s.contentId,"data-state":Se(a.open),...t,ref:o(r,s.onTriggerChange),onClick:e=>{t.onClick?.(e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:n(t.onPointerMove,Le(e=>{u.onItemEnter(e),e.defaultPrevented||t.disabled||a.open||i.current||(u.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{a.onOpenChange(!0),p()},100))})),onPointerLeave:n(t.onPointerLeave,Le(e=>{p();const n=a.content?.getBoundingClientRect();if(n){const t=a.content?.dataset.side,r="right"===t,o=r?-5:5,c=n[r?"left":"right"],s=n[r?"right":"left"];u.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:n.top},{x:s,y:n.top},{x:s,y:n.bottom},{x:c,y:n.bottom}],side:t}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(e),e.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:n(t.onKeyDown,e=>{const n=""!==u.searchRef.current;t.disabled||n&&" "===e.key||I[c.dir].includes(e.key)&&(a.onOpenChange(!0),a.content?.focus(),e.preventDefault())})})})});Ee.displayName=De;var Oe="MenuSubContent",Ie=e.forwardRef((t,o)=>{const a=Z(J,t.__scopeMenu),{forceMount:c=a.forceMount,...s}=t,u=U(J,t.__scopeMenu),i=X(J,t.__scopeMenu),l=ke(Oe,t.__scopeMenu),d=e.useRef(null),f=r(o,d);return x(F.Provider,{scope:t.__scopeMenu,children:x(w,{present:c||u.open,children:x(F.Slot,{scope:t.__scopeMenu,children:x(oe,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:f,align:"start",side:"rtl"===i.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{i.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:n(t.onFocusOutside,e=>{e.target!==l.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:n(t.onEscapeKeyDown,e=>{i.onClose(),e.preventDefault()}),onKeyDown:n(t.onKeyDown,e=>{const n=e.currentTarget.contains(e.target),t=S[i.dir].includes(e.key);n&&t&&(u.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});function Se(e){return e?"open":"closed"}function Te(e){return"indeterminate"===e}function Fe(e){return Te(e)?"indeterminate":e?"checked":"unchecked"}function Le(e){return n=>"mouse"===n.pointerType?e(n):void 0}Ie.displayName=Oe;var Ke=Y,Ae=z,Ne=q,je=ee,Ge=ae,Ve=ce,Ue=ie,Be=de,Xe=he,Ye=ge,ze=Ce,He=ye,We=be,Ze=xe,qe=Ee,Je=Ie;export{Ae as A,je as C,Ge as G,Ue as I,Ve as L,Ne as P,Ke as R,He as S,Be as a,ze as b,N as c,Xe as d,Ye as e,Ze as f,qe as g,Je as h,We as i};
|
2
|
-
//# sourceMappingURL=index-
|
1
|
+
import*as e from"react";import{c as n}from"./index-CdJCOoFA.mjs";import{createCollection as t}from"@radix-ui/react-collection";import{u as r,c as o}from"./index-COvW87ew.mjs";import{c as a}from"./index-CCcl327A.mjs";import{u as c}from"./index-CU_y1XAz.mjs";import{P as s,D as u}from"./index-xew3kygQ.mjs";import{h as i,u as l,R as d,F as f}from"./index-lvPXnk5F.mjs";import{u as p}from"./index-CRxQlsb9.mjs";import{c as m,R as h,A as v,C as g,a as _}from"./index-DOyt-JEx.mjs";import{P as w}from"./index-BdpYc58_.mjs";import{P as M,d as C}from"./index-w9bxia3O.mjs";import{c as y,I as b,R}from"./index-LvOFIVGz.mjs";import{createSlot as P}from"@radix-ui/react-slot";import{u as k}from"./index-CXszXOf_.mjs";import{jsx as x}from"react/jsx-runtime";var D=["Enter"," "],E=["ArrowUp","PageDown","End"],O=["ArrowDown","PageUp","Home",...E],I={ltr:[...D,"ArrowRight"],rtl:[...D,"ArrowLeft"]},S={ltr:["ArrowLeft"],rtl:["ArrowRight"]},T="Menu",[F,L,K]=t(T),[A,N]=a(T,[K,m,y]),j=m(),G=y(),[V,U]=A(T),[B,X]=A(T),Y=n=>{const{__scopeMenu:t,open:r=!1,children:o,dir:a,onOpenChange:s,modal:u=!0}=n,i=j(t),[l,d]=e.useState(null),f=e.useRef(!1),p=k(s),m=c(a);return e.useEffect(()=>{const e=()=>{f.current=!0,document.addEventListener("pointerdown",n,{capture:!0,once:!0}),document.addEventListener("pointermove",n,{capture:!0,once:!0})},n=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",n,{capture:!0}),document.removeEventListener("pointermove",n,{capture:!0})}},[]),x(h,{...i,children:x(V,{scope:t,open:r,onOpenChange:p,content:l,onContentChange:d,children:x(B,{scope:t,onClose:e.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:u,children:o})})})};Y.displayName=T;var z=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e,o=j(t);return x(v,{...o,...r,ref:n})});z.displayName="MenuAnchor";var H="MenuPortal",[W,Z]=A(H,{forceMount:void 0}),q=e=>{const{__scopeMenu:n,forceMount:t,children:r,container:o}=e,a=U(H,n);return x(W,{scope:n,forceMount:t,children:x(w,{present:t||a.open,children:x(s,{asChild:!0,container:o,children:r})})})};q.displayName=H;var J="MenuContent",[Q,$]=A(J),ee=e.forwardRef((e,n)=>{const t=Z(J,e.__scopeMenu),{forceMount:r=t.forceMount,...o}=e,a=U(J,e.__scopeMenu),c=X(J,e.__scopeMenu);return x(F.Provider,{scope:e.__scopeMenu,children:x(w,{present:r||a.open,children:x(F.Slot,{scope:e.__scopeMenu,children:c.modal?x(ne,{...o,ref:n}):x(te,{...o,ref:n})})})})}),ne=e.forwardRef((t,o)=>{const a=U(J,t.__scopeMenu),c=e.useRef(null),s=r(o,c);return e.useEffect(()=>{const e=c.current;if(e)return i(e)},[]),x(oe,{...t,ref:s,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:n(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),te=e.forwardRef((e,n)=>{const t=U(J,e.__scopeMenu);return x(oe,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),re=P("MenuContent.ScrollLock"),oe=e.forwardRef((t,o)=>{const{__scopeMenu:a,loop:c=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:p,disableOutsidePointerEvents:m,onEntryFocus:h,onEscapeKeyDown:v,onPointerDownOutside:_,onFocusOutside:w,onInteractOutside:M,onDismiss:C,disableOutsideScroll:y,...b}=t,P=U(J,a),k=X(J,a),D=j(a),I=G(a),S=L(a),[T,F]=e.useState(null),K=e.useRef(null),A=r(o,K,P.onContentChange),N=e.useRef(0),V=e.useRef(""),B=e.useRef(0),Y=e.useRef(null),z=e.useRef("right"),H=e.useRef(0),W=y?d:e.Fragment,Z=y?{as:re,allowPinchZoom:!0}:void 0,q=e=>{const n=V.current+e,t=S().filter(e=>!e.disabled),r=document.activeElement,o=t.find(e=>e.ref.current===r)?.textValue,a=function(e,n,t){const r=n.length>1&&Array.from(n).every(e=>e===n[0]),o=r?n[0]:n,a=t?e.indexOf(t):-1;let c=(s=e,u=Math.max(a,0),s.map((e,n)=>s[(u+n)%s.length]));var s,u;1===o.length&&(c=c.filter(e=>e!==t));const i=c.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return i!==t?i:void 0}(t.map(e=>e.textValue),n,o),c=t.find(e=>e.textValue===a)?.ref.current;!function e(n){V.current=n,window.clearTimeout(N.current),""!==n&&(N.current=window.setTimeout(()=>e(""),1e3))}(n),c&&setTimeout(()=>c.focus())};e.useEffect(()=>()=>window.clearTimeout(N.current),[]),l();const $=e.useCallback(e=>z.current===Y.current?.side&&function(e,n){if(!n)return!1;const t={x:e.clientX,y:e.clientY};return function(e,n){const{x:t,y:r}=e;let o=!1;for(let e=0,a=n.length-1;e<n.length;a=e++){const c=n[e],s=n[a],u=c.x,i=c.y,l=s.x,d=s.y;i>r!=d>r&&t<(l-u)*(r-i)/(d-i)+u&&(o=!o)}return o}(t,n)}(e,Y.current?.area),[]);return x(Q,{scope:a,searchRef:V,onItemEnter:e.useCallback(e=>{$(e)&&e.preventDefault()},[$]),onItemLeave:e.useCallback(e=>{$(e)||(K.current?.focus(),F(null))},[$]),onTriggerLeave:e.useCallback(e=>{$(e)&&e.preventDefault()},[$]),pointerGraceTimerRef:B,onPointerGraceIntentChange:e.useCallback(e=>{Y.current=e},[]),children:x(W,{...Z,children:x(f,{asChild:!0,trapped:s,onMountAutoFocus:n(i,e=>{e.preventDefault(),K.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:x(u,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:v,onPointerDownOutside:_,onFocusOutside:w,onInteractOutside:M,onDismiss:C,children:x(R,{asChild:!0,...I,dir:k.dir,orientation:"vertical",loop:c,currentTabStopId:T,onCurrentTabStopIdChange:F,onEntryFocus:n(h,e=>{k.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:x(g,{role:"menu","aria-orientation":"vertical","data-state":Se(P.open),"data-radix-menu-content":"",dir:k.dir,...D,...b,ref:A,style:{outline:"none",...b.style},onKeyDown:n(b.onKeyDown,e=>{const n=e.target.closest("[data-radix-menu-content]")===e.currentTarget,t=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;n&&("Tab"===e.key&&e.preventDefault(),!t&&r&&q(e.key));const o=K.current;if(e.target!==o)return;if(!O.includes(e.key))return;e.preventDefault();const a=S().filter(e=>!e.disabled).map(e=>e.ref.current);E.includes(e.key)&&a.reverse(),function(e){const n=document.activeElement;for(const t of e){if(t===n)return;if(t.focus(),document.activeElement!==n)return}}(a)}),onBlur:n(t.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),V.current="")}),onPointerMove:n(t.onPointerMove,Le(e=>{const n=e.target,t=H.current!==e.clientX;if(e.currentTarget.contains(n)&&t){const n=e.clientX>H.current?"right":"left";z.current=n,H.current=e.clientX}}))})})})})})})});ee.displayName=J;var ae=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{role:"group",...r,ref:n})});ae.displayName="MenuGroup";var ce=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{...r,ref:n})});ce.displayName="MenuLabel";var se="MenuItem",ue="menu.itemSelect",ie=e.forwardRef((t,o)=>{const{disabled:a=!1,onSelect:c,...s}=t,u=e.useRef(null),i=X(se,t.__scopeMenu),l=$(se,t.__scopeMenu),d=r(o,u),f=e.useRef(!1);return x(le,{...s,ref:d,disabled:a,onClick:n(t.onClick,()=>{const e=u.current;if(!a&&e){const n=new CustomEvent(ue,{bubbles:!0,cancelable:!0});e.addEventListener(ue,e=>c?.(e),{once:!0}),C(e,n),n.defaultPrevented?f.current=!1:i.onClose()}}),onPointerDown:e=>{t.onPointerDown?.(e),f.current=!0},onPointerUp:n(t.onPointerUp,e=>{f.current||e.currentTarget?.click()}),onKeyDown:n(t.onKeyDown,e=>{const n=""!==l.searchRef.current;a||n&&" "===e.key||D.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ie.displayName=se;var le=e.forwardRef((t,o)=>{const{__scopeMenu:a,disabled:c=!1,textValue:s,...u}=t,i=$(se,a),l=G(a),d=e.useRef(null),f=r(o,d),[p,m]=e.useState(!1),[h,v]=e.useState("");return e.useEffect(()=>{const e=d.current;e&&v((e.textContent??"").trim())},[u.children]),x(F.ItemSlot,{scope:a,disabled:c,textValue:s??h,children:x(b,{asChild:!0,...l,focusable:!c,children:x(M.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...u,ref:f,onPointerMove:n(t.onPointerMove,Le(e=>{if(c)i.onItemLeave(e);else if(i.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:n(t.onPointerLeave,Le(e=>i.onItemLeave(e))),onFocus:n(t.onFocus,()=>m(!0)),onBlur:n(t.onBlur,()=>m(!1))})})})}),de=e.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:o,...a}=e;return x(we,{scope:e.__scopeMenu,checked:r,children:x(ie,{role:"menuitemcheckbox","aria-checked":Te(r)?"mixed":r,...a,ref:t,"data-state":Fe(r),onSelect:n(a.onSelect,()=>o?.(!!Te(r)||!r),{checkForDefaultPrevented:!1})})})});de.displayName="MenuCheckboxItem";var fe="MenuRadioGroup",[pe,me]=A(fe,{value:void 0,onValueChange:()=>{}}),he=e.forwardRef((e,n)=>{const{value:t,onValueChange:r,...o}=e,a=k(r);return x(pe,{scope:e.__scopeMenu,value:t,onValueChange:a,children:x(ae,{...o,ref:n})})});he.displayName=fe;var ve="MenuRadioItem",ge=e.forwardRef((e,t)=>{const{value:r,...o}=e,a=me(ve,e.__scopeMenu),c=r===a.value;return x(we,{scope:e.__scopeMenu,checked:c,children:x(ie,{role:"menuitemradio","aria-checked":c,...o,ref:t,"data-state":Fe(c),onSelect:n(o.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ge.displayName=ve;var _e="MenuItemIndicator",[we,Me]=A(_e,{checked:!1}),Ce=e.forwardRef((e,n)=>{const{__scopeMenu:t,forceMount:r,...o}=e,a=Me(_e,t);return x(w,{present:r||Te(a.checked)||!0===a.checked,children:x(M.span,{...o,ref:n,"data-state":Fe(a.checked)})})});Ce.displayName=_e;var ye=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e;return x(M.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})});ye.displayName="MenuSeparator";var be=e.forwardRef((e,n)=>{const{__scopeMenu:t,...r}=e,o=j(t);return x(_,{...o,...r,ref:n})});be.displayName="MenuArrow";var Re="MenuSub",[Pe,ke]=A(Re),xe=n=>{const{__scopeMenu:t,children:r,open:o=!1,onOpenChange:a}=n,c=U(Re,t),s=j(t),[u,i]=e.useState(null),[l,d]=e.useState(null),f=k(a);return e.useEffect(()=>(!1===c.open&&f(!1),()=>f(!1)),[c.open,f]),x(h,{...s,children:x(V,{scope:t,open:o,onOpenChange:f,content:l,onContentChange:d,children:x(Pe,{scope:t,contentId:p(),triggerId:p(),trigger:u,onTriggerChange:i,children:r})})})};xe.displayName=Re;var De="MenuSubTrigger",Ee=e.forwardRef((t,r)=>{const a=U(De,t.__scopeMenu),c=X(De,t.__scopeMenu),s=ke(De,t.__scopeMenu),u=$(De,t.__scopeMenu),i=e.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:d}=u,f={__scopeMenu:t.__scopeMenu},p=e.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return e.useEffect(()=>p,[p]),e.useEffect(()=>{const e=l.current;return()=>{window.clearTimeout(e),d(null)}},[l,d]),x(z,{asChild:!0,...f,children:x(le,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":s.contentId,"data-state":Se(a.open),...t,ref:o(r,s.onTriggerChange),onClick:e=>{t.onClick?.(e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:n(t.onPointerMove,Le(e=>{u.onItemEnter(e),e.defaultPrevented||t.disabled||a.open||i.current||(u.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{a.onOpenChange(!0),p()},100))})),onPointerLeave:n(t.onPointerLeave,Le(e=>{p();const n=a.content?.getBoundingClientRect();if(n){const t=a.content?.dataset.side,r="right"===t,o=r?-5:5,c=n[r?"left":"right"],s=n[r?"right":"left"];u.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:n.top},{x:s,y:n.top},{x:s,y:n.bottom},{x:c,y:n.bottom}],side:t}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(e),e.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:n(t.onKeyDown,e=>{const n=""!==u.searchRef.current;t.disabled||n&&" "===e.key||I[c.dir].includes(e.key)&&(a.onOpenChange(!0),a.content?.focus(),e.preventDefault())})})})});Ee.displayName=De;var Oe="MenuSubContent",Ie=e.forwardRef((t,o)=>{const a=Z(J,t.__scopeMenu),{forceMount:c=a.forceMount,...s}=t,u=U(J,t.__scopeMenu),i=X(J,t.__scopeMenu),l=ke(Oe,t.__scopeMenu),d=e.useRef(null),f=r(o,d);return x(F.Provider,{scope:t.__scopeMenu,children:x(w,{present:c||u.open,children:x(F.Slot,{scope:t.__scopeMenu,children:x(oe,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:f,align:"start",side:"rtl"===i.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{i.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:n(t.onFocusOutside,e=>{e.target!==l.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:n(t.onEscapeKeyDown,e=>{i.onClose(),e.preventDefault()}),onKeyDown:n(t.onKeyDown,e=>{const n=e.currentTarget.contains(e.target),t=S[i.dir].includes(e.key);n&&t&&(u.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});function Se(e){return e?"open":"closed"}function Te(e){return"indeterminate"===e}function Fe(e){return Te(e)?"indeterminate":e?"checked":"unchecked"}function Le(e){return n=>"mouse"===n.pointerType?e(n):void 0}Ie.displayName=Oe;var Ke=Y,Ae=z,Ne=q,je=ee,Ge=ae,Ve=ce,Ue=ie,Be=de,Xe=he,Ye=ge,ze=Ce,He=ye,We=be,Ze=xe,qe=Ee,Je=Ie;export{Ae as A,je as C,Ge as G,Ue as I,Ve as L,Ne as P,Ke as R,He as S,Be as a,ze as b,N as c,Xe as d,Ye as e,Ze as f,qe as g,Je as h,We as i};
|
2
|
+
//# sourceMappingURL=index-DZHMFdr0.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-czDftnY4.mjs","sources":["../../node_modules/@radix-ui/react-menu/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/menu.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs, composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport * as RovingFocusGroup from \"@radix-ui/react-roving-focus\";\nimport { createRovingFocusGroupScope } from \"@radix-ui/react-roving-focus\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SELECTION_KEYS = [\"Enter\", \" \"];\nvar FIRST_KEYS = [\"ArrowDown\", \"PageUp\", \"Home\"];\nvar LAST_KEYS = [\"ArrowUp\", \"PageDown\", \"End\"];\nvar FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nvar SUB_OPEN_KEYS = {\n ltr: [...SELECTION_KEYS, \"ArrowRight\"],\n rtl: [...SELECTION_KEYS, \"ArrowLeft\"]\n};\nvar SUB_CLOSE_KEYS = {\n ltr: [\"ArrowLeft\"],\n rtl: [\"ArrowRight\"]\n};\nvar MENU_NAME = \"Menu\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);\nvar [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [\n createCollectionScope,\n createPopperScope,\n createRovingFocusGroupScope\n]);\nvar usePopperScope = createPopperScope();\nvar useRovingFocusGroupScope = createRovingFocusGroupScope();\nvar [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);\nvar [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);\nvar Menu = (props) => {\n const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;\n const popperScope = usePopperScope(__scopeMenu);\n const [content, setContent] = React.useState(null);\n const isUsingKeyboardRef = React.useRef(false);\n const handleOpenChange = useCallbackRef(onOpenChange);\n const direction = useDirection(dir);\n React.useEffect(() => {\n const handleKeyDown = () => {\n isUsingKeyboardRef.current = true;\n document.addEventListener(\"pointerdown\", handlePointer, { capture: true, once: true });\n document.addEventListener(\"pointermove\", handlePointer, { capture: true, once: true });\n };\n const handlePointer = () => isUsingKeyboardRef.current = false;\n document.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n document.removeEventListener(\"pointerdown\", handlePointer, { capture: true });\n document.removeEventListener(\"pointermove\", handlePointer, { capture: true });\n };\n }, []);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuRootProvider,\n {\n scope: __scopeMenu,\n onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]),\n isUsingKeyboardRef,\n dir: direction,\n modal,\n children\n }\n )\n }\n ) });\n};\nMenu.displayName = MENU_NAME;\nvar ANCHOR_NAME = \"MenuAnchor\";\nvar MenuAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...anchorProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nMenuAnchor.displayName = ANCHOR_NAME;\nvar PORTAL_NAME = \"MenuPortal\";\nvar [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar MenuPortal = (props) => {\n const { __scopeMenu, forceMount, children, container } = props;\n const context = useMenuContext(PORTAL_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nMenuPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"MenuContent\";\nvar [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME);\nvar MenuContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });\n }\n);\nvar MenuRootContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const content = ref.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: context.open,\n disableOutsideScroll: true,\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n ),\n onDismiss: () => context.onOpenChange(false)\n }\n );\n }\n);\nvar MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n onDismiss: () => context.onOpenChange(false)\n }\n );\n});\nvar Slot = createSlot(\"MenuContent.ScrollLock\");\nvar MenuContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeMenu,\n loop = false,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEntryFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n disableOutsideScroll,\n ...contentProps\n } = props;\n const context = useMenuContext(CONTENT_NAME, __scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const getItems = useCollection(__scopeMenu);\n const [currentItemId, setCurrentItemId] = React.useState(null);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n const timerRef = React.useRef(0);\n const searchRef = React.useRef(\"\");\n const pointerGraceTimerRef = React.useRef(0);\n const pointerGraceIntentRef = React.useRef(null);\n const pointerDirRef = React.useRef(\"right\");\n const lastPointerXRef = React.useRef(0);\n const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment;\n const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;\n const handleTypeaheadSearch = (key) => {\n const search = searchRef.current + key;\n const items = getItems().filter((item) => !item.disabled);\n const currentItem = document.activeElement;\n const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;\n const values = items.map((item) => item.textValue);\n const nextMatch = getNextMatch(values, search, currentMatch);\n const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n (function updateSearch(value) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = window.setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n if (newItem) {\n setTimeout(() => newItem.focus());\n }\n };\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n useFocusGuards();\n const isPointerMovingToSubmenu = React.useCallback((event) => {\n const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentProvider,\n {\n scope: __scopeMenu,\n searchRef,\n onItemEnter: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n onItemLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) return;\n contentRef.current?.focus();\n setCurrentItemId(null);\n },\n [isPointerMovingToSubmenu]\n ),\n onTriggerLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n pointerGraceTimerRef,\n onPointerGraceIntentChange: React.useCallback((intent) => {\n pointerGraceIntentRef.current = intent;\n }, []),\n children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n trapped: trapFocus,\n onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {\n event.preventDefault();\n contentRef.current?.focus({ preventScroll: true });\n }),\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n children: /* @__PURE__ */ jsx(\n RovingFocusGroup.Root,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n dir: rootContext.dir,\n orientation: \"vertical\",\n loop,\n currentTabStopId: currentItemId,\n onCurrentTabStopIdChange: setCurrentItemId,\n onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {\n if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n }),\n preventScrollOnEntryFocus: true,\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n role: \"menu\",\n \"aria-orientation\": \"vertical\",\n \"data-state\": getOpenState(context.open),\n \"data-radix-menu-content\": \"\",\n dir: rootContext.dir,\n ...popperScope,\n ...contentProps,\n ref: composedRefs,\n style: { outline: \"none\", ...contentProps.style },\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const target = event.target;\n const isKeyDownInside = target.closest(\"[data-radix-menu-content]\") === event.currentTarget;\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n const isCharacterKey = event.key.length === 1;\n if (isKeyDownInside) {\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n }\n const content = contentRef.current;\n if (event.target !== content) return;\n if (!FIRST_LAST_KEYS.includes(event.key)) return;\n event.preventDefault();\n const items = getItems().filter((item) => !item.disabled);\n const candidateNodes = items.map((item) => item.ref.current);\n if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n focusFirst(candidateNodes);\n }),\n onBlur: composeEventHandlers(props.onBlur, (event) => {\n if (!event.currentTarget.contains(event.target)) {\n window.clearTimeout(timerRef.current);\n searchRef.current = \"\";\n }\n }),\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n const target = event.target;\n const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n if (event.currentTarget.contains(target) && pointerXHasChanged) {\n const newDir = event.clientX > lastPointerXRef.current ? \"right\" : \"left\";\n pointerDirRef.current = newDir;\n lastPointerXRef.current = event.clientX;\n }\n })\n )\n }\n )\n }\n )\n }\n )\n }\n ) })\n }\n );\n }\n);\nMenuContent.displayName = CONTENT_NAME;\nvar GROUP_NAME = \"MenuGroup\";\nvar MenuGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...groupProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { role: \"group\", ...groupProps, ref: forwardedRef });\n }\n);\nMenuGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"MenuLabel\";\nvar MenuLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...labelProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });\n }\n);\nMenuLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"MenuItem\";\nvar ITEM_SELECT = \"menu.itemSelect\";\nvar MenuItem = React.forwardRef(\n (props, forwardedRef) => {\n const { disabled = false, onSelect, ...itemProps } = props;\n const ref = React.useRef(null);\n const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = React.useRef(false);\n const handleSelect = () => {\n const menuItem = ref.current;\n if (!disabled && menuItem) {\n const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });\n menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });\n dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n if (itemSelectEvent.defaultPrevented) {\n isPointerDownRef.current = false;\n } else {\n rootContext.onClose();\n }\n }\n };\n return /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n ...itemProps,\n ref: composedRefs,\n disabled,\n onClick: composeEventHandlers(props.onClick, handleSelect),\n onPointerDown: (event) => {\n props.onPointerDown?.(event);\n isPointerDownRef.current = true;\n },\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n if (!isPointerDownRef.current) event.currentTarget?.click();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (disabled || isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) {\n event.currentTarget.click();\n event.preventDefault();\n }\n })\n }\n );\n }\n);\nMenuItem.displayName = ITEM_NAME;\nvar MenuItemImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;\n const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [isFocused, setIsFocused] = React.useState(false);\n const [textContent, setTextContent] = React.useState(\"\");\n React.useEffect(() => {\n const menuItem = ref.current;\n if (menuItem) {\n setTextContent((menuItem.textContent ?? \"\").trim());\n }\n }, [itemProps.children]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeMenu,\n disabled,\n textValue: textValue ?? textContent,\n children: /* @__PURE__ */ jsx(RovingFocusGroup.Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"menuitem\",\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n ...itemProps,\n ref: composedRefs,\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n if (disabled) {\n contentContext.onItemLeave(event);\n } else {\n contentContext.onItemEnter(event);\n if (!event.defaultPrevented) {\n const item = event.currentTarget;\n item.focus({ preventScroll: true });\n }\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => contentContext.onItemLeave(event))\n ),\n onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))\n }\n ) })\n }\n );\n }\n);\nvar CHECKBOX_ITEM_NAME = \"MenuCheckboxItem\";\nvar MenuCheckboxItem = React.forwardRef(\n (props, forwardedRef) => {\n const { checked = false, onCheckedChange, ...checkboxItemProps } = props;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemcheckbox\",\n \"aria-checked\": isIndeterminate(checked) ? \"mixed\" : checked,\n ...checkboxItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n checkboxItemProps.onSelect,\n () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\nvar RADIO_GROUP_NAME = \"MenuRadioGroup\";\nvar [RadioGroupProvider, useRadioGroupContext] = createMenuContext(\n RADIO_GROUP_NAME,\n { value: void 0, onValueChange: () => {\n } }\n);\nvar MenuRadioGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { value, onValueChange, ...groupProps } = props;\n const handleValueChange = useCallbackRef(onValueChange);\n return /* @__PURE__ */ jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });\n }\n);\nMenuRadioGroup.displayName = RADIO_GROUP_NAME;\nvar RADIO_ITEM_NAME = \"MenuRadioItem\";\nvar MenuRadioItem = React.forwardRef(\n (props, forwardedRef) => {\n const { value, ...radioItemProps } = props;\n const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);\n const checked = value === context.value;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemradio\",\n \"aria-checked\": checked,\n ...radioItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n radioItemProps.onSelect,\n () => context.onValueChange?.(value),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuRadioItem.displayName = RADIO_ITEM_NAME;\nvar ITEM_INDICATOR_NAME = \"MenuItemIndicator\";\nvar [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(\n ITEM_INDICATOR_NAME,\n { checked: false }\n);\nvar MenuItemIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;\n const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(\n Presence,\n {\n present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...itemIndicatorProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(indicatorContext.checked)\n }\n )\n }\n );\n }\n);\nMenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\nvar SEPARATOR_NAME = \"MenuSeparator\";\nvar MenuSeparator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...separatorProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"separator\",\n \"aria-orientation\": \"horizontal\",\n ...separatorProps,\n ref: forwardedRef\n }\n );\n }\n);\nMenuSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"MenuArrow\";\nvar MenuArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nMenuArrow.displayName = ARROW_NAME;\nvar SUB_NAME = \"MenuSub\";\nvar [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);\nvar MenuSub = (props) => {\n const { __scopeMenu, children, open = false, onOpenChange } = props;\n const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const [trigger, setTrigger] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const handleOpenChange = useCallbackRef(onOpenChange);\n React.useEffect(() => {\n if (parentMenuContext.open === false) handleOpenChange(false);\n return () => handleOpenChange(false);\n }, [parentMenuContext.open, handleOpenChange]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuSubProvider,\n {\n scope: __scopeMenu,\n contentId: useId(),\n triggerId: useId(),\n trigger,\n onTriggerChange: setTrigger,\n children\n }\n )\n }\n ) });\n};\nMenuSub.displayName = SUB_NAME;\nvar SUB_TRIGGER_NAME = \"MenuSubTrigger\";\nvar MenuSubTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const openTimerRef = React.useRef(null);\n const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n const scope = { __scopeMenu: props.__scopeMenu };\n const clearOpenTimer = React.useCallback(() => {\n if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }, []);\n React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n React.useEffect(() => {\n const pointerGraceTimer = pointerGraceTimerRef.current;\n return () => {\n window.clearTimeout(pointerGraceTimer);\n onPointerGraceIntentChange(null);\n };\n }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n return /* @__PURE__ */ jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n id: subContext.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": subContext.contentId,\n \"data-state\": getOpenState(context.open),\n ...props,\n ref: composeRefs(forwardedRef, subContext.onTriggerChange),\n onClick: (event) => {\n props.onClick?.(event);\n if (props.disabled || event.defaultPrevented) return;\n event.currentTarget.focus();\n if (!context.open) context.onOpenChange(true);\n },\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n contentContext.onItemEnter(event);\n if (event.defaultPrevented) return;\n if (!props.disabled && !context.open && !openTimerRef.current) {\n contentContext.onPointerGraceIntentChange(null);\n openTimerRef.current = window.setTimeout(() => {\n context.onOpenChange(true);\n clearOpenTimer();\n }, 100);\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => {\n clearOpenTimer();\n const contentRect = context.content?.getBoundingClientRect();\n if (contentRect) {\n const side = context.content?.dataset.side;\n const rightSide = side === \"right\";\n const bleed = rightSide ? -5 : 5;\n const contentNearEdge = contentRect[rightSide ? \"left\" : \"right\"];\n const contentFarEdge = contentRect[rightSide ? \"right\" : \"left\"];\n contentContext.onPointerGraceIntentChange({\n area: [\n // Apply a bleed on clientX to ensure that our exit point is\n // consistently within polygon bounds\n { x: event.clientX + bleed, y: event.clientY },\n { x: contentNearEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.bottom },\n { x: contentNearEdge, y: contentRect.bottom }\n ],\n side\n });\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300\n );\n } else {\n contentContext.onTriggerLeave(event);\n if (event.defaultPrevented) return;\n contentContext.onPointerGraceIntentChange(null);\n }\n })\n ),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (props.disabled || isTypingAhead && event.key === \" \") return;\n if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n context.onOpenChange(true);\n context.content?.focus();\n event.preventDefault();\n }\n })\n }\n ) });\n }\n);\nMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\nvar SUB_CONTENT_NAME = \"MenuSubContent\";\nvar MenuSubContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...subContentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n id: subContext.contentId,\n \"aria-labelledby\": subContext.triggerId,\n ...subContentProps,\n ref: composedRefs,\n align: \"start\",\n side: rootContext.dir === \"rtl\" ? \"left\" : \"right\",\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n trapFocus: false,\n onOpenAutoFocus: (event) => {\n if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();\n event.preventDefault();\n },\n onCloseAutoFocus: (event) => event.preventDefault(),\n onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {\n if (event.target !== subContext.trigger) context.onOpenChange(false);\n }),\n onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => {\n rootContext.onClose();\n event.preventDefault();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isKeyDownInside = event.currentTarget.contains(event.target);\n const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n if (isKeyDownInside && isCloseKey) {\n context.onOpenChange(false);\n subContext.trigger?.focus();\n event.preventDefault();\n }\n })\n }\n ) }) }) });\n }\n);\nMenuSubContent.displayName = SUB_CONTENT_NAME;\nfunction getOpenState(open) {\n return open ? \"open\" : \"closed\";\n}\nfunction isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nfunction getCheckedState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nfunction focusFirst(candidates) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nfunction getNextMatch(values, search, currentMatch) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find(\n (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextMatch !== currentMatch ? nextMatch : void 0;\n}\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const ii = polygon[i];\n const jj = polygon[j];\n const xi = ii.x;\n const yi = ii.y;\n const xj = jj.x;\n const yj = jj.y;\n const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\nfunction isPointerInGraceArea(event, area) {\n if (!area) return false;\n const cursorPos = { x: event.clientX, y: event.clientY };\n return isPointInPolygon(cursorPos, area);\n}\nfunction whenMouse(handler) {\n return (event) => event.pointerType === \"mouse\" ? handler(event) : void 0;\n}\nvar Root3 = Menu;\nvar Anchor2 = MenuAnchor;\nvar Portal = MenuPortal;\nvar Content2 = MenuContent;\nvar Group = MenuGroup;\nvar Label = MenuLabel;\nvar Item2 = MenuItem;\nvar CheckboxItem = MenuCheckboxItem;\nvar RadioGroup = MenuRadioGroup;\nvar RadioItem = MenuRadioItem;\nvar ItemIndicator = MenuItemIndicator;\nvar Separator = MenuSeparator;\nvar Arrow2 = MenuArrow;\nvar Sub = MenuSub;\nvar SubTrigger = MenuSubTrigger;\nvar SubContent = MenuSubContent;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n CheckboxItem,\n Content2 as Content,\n Group,\n Item2 as Item,\n ItemIndicator,\n Label,\n Menu,\n MenuAnchor,\n MenuArrow,\n MenuCheckboxItem,\n MenuContent,\n MenuGroup,\n MenuItem,\n MenuItemIndicator,\n MenuLabel,\n MenuPortal,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSeparator,\n MenuSub,\n MenuSubContent,\n MenuSubTrigger,\n Portal,\n RadioGroup,\n RadioItem,\n Root3 as Root,\n Separator,\n Sub,\n SubContent,\n SubTrigger,\n createMenuScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["SELECTION_KEYS","LAST_KEYS","FIRST_LAST_KEYS","SUB_OPEN_KEYS","ltr","rtl","SUB_CLOSE_KEYS","MENU_NAME","Collection","useCollection","createCollectionScope","createCollection","createMenuContext","createMenuScope","createContextScope","createPopperScope","createRovingFocusGroupScope","usePopperScope","useRovingFocusGroupScope","MenuProvider","useMenuContext","MenuRootProvider","useMenuRootContext","Menu","props","__scopeMenu","open","children","dir","onOpenChange","modal","popperScope","content","setContent","React","useState","isUsingKeyboardRef","useRef","handleOpenChange","useCallbackRef","direction","useDirection","useEffect","handleKeyDown","current","document","addEventListener","handlePointer","capture","once","removeEventListener","jsx","PopperPrimitive.Root","scope","onContentChange","onClose","useCallback","displayName","MenuAnchor","forwardRef","forwardedRef","anchorProps","PopperPrimitive.Anchor","ref","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","MenuPortal","container","context","Presence","present","PortalPrimitive","asChild","CONTENT_NAME","MenuContentProvider","useMenuContentContext","MenuContent","portalContext","contentProps","rootContext","Provider","Slot","MenuRootContentModal","MenuRootContentNonModal","composedRefs","useComposedRefs","hideOthers","MenuContentImpl","trapFocus","disableOutsidePointerEvents","disableOutsideScroll","onFocusOutside","composeEventHandlers","event","preventDefault","checkForDefaultPrevented","onDismiss","createSlot","loop","onOpenAutoFocus","onCloseAutoFocus","onEntryFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside","rovingFocusGroupScope","getItems","currentItemId","setCurrentItemId","contentRef","timerRef","searchRef","pointerGraceTimerRef","pointerGraceIntentRef","pointerDirRef","lastPointerXRef","ScrollLockWrapper","RemoveScroll","Fragment","scrollLockWrapperProps","as","allowPinchZoom","handleTypeaheadSearch","key","search","items","filter","item","disabled","currentItem","activeElement","currentMatch","find","textValue","nextMatch","values","isRepeated","length","Array","from","every","char","normalizedSearch","currentMatchIndex","indexOf","wrappedValues","array","startIndex","Math","max","map","_","index","v","value","toLowerCase","startsWith","getNextMatch","newItem","updateSearch","window","clearTimeout","setTimeout","focus","useFocusGuards","isPointerMovingToSubmenu","side","area","cursorPos","x","clientX","y","clientY","point","polygon","inside","i","j","ii","jj","xi","yi","xj","yj","isPointInPolygon","isPointerInGraceArea","onItemEnter","onItemLeave","onTriggerLeave","onPointerGraceIntentChange","intent","FocusScope","trapped","onMountAutoFocus","preventScroll","onUnmountAutoFocus","DismissableLayer","RovingFocusGroup.Root","orientation","currentTabStopId","onCurrentTabStopIdChange","preventScrollOnEntryFocus","PopperPrimitive.Content","role","getOpenState","style","outline","onKeyDown","isKeyDownInside","target","closest","currentTarget","isModifierKey","ctrlKey","altKey","metaKey","isCharacterKey","includes","candidateNodes","reverse","candidates","PREVIOUSLY_FOCUSED_ELEMENT","candidate","focusFirst","onBlur","contains","onPointerMove","whenMouse","pointerXHasChanged","newDir","MenuGroup","groupProps","Primitive","div","MenuLabel","labelProps","ITEM_NAME","ITEM_SELECT","MenuItem","onSelect","itemProps","contentContext","isPointerDownRef","MenuItemImpl","onClick","menuItem","itemSelectEvent","CustomEvent","bubbles","cancelable","dispatchDiscreteCustomEvent","defaultPrevented","onPointerDown","onPointerUp","click","isTypingAhead","isFocused","setIsFocused","textContent","setTextContent","trim","ItemSlot","RovingFocusGroup.Item","focusable","onPointerLeave","onFocus","MenuCheckboxItem","checked","onCheckedChange","checkboxItemProps","ItemIndicatorProvider","isIndeterminate","getCheckedState","RADIO_GROUP_NAME","RadioGroupProvider","useRadioGroupContext","onValueChange","MenuRadioGroup","handleValueChange","RADIO_ITEM_NAME","MenuRadioItem","radioItemProps","ITEM_INDICATOR_NAME","useItemIndicatorContext","MenuItemIndicator","itemIndicatorProps","indicatorContext","span","MenuSeparator","separatorProps","MenuArrow","arrowProps","PopperPrimitive.Arrow","SUB_NAME","MenuSubProvider","useMenuSubContext","MenuSub","parentMenuContext","trigger","setTrigger","contentId","useId","triggerId","onTriggerChange","SUB_TRIGGER_NAME","MenuSubTrigger","subContext","openTimerRef","clearOpenTimer","pointerGraceTimer","id","composeRefs","contentRect","getBoundingClientRect","dataset","rightSide","bleed","contentNearEdge","contentFarEdge","top","bottom","SUB_CONTENT_NAME","MenuSubContent","subContentProps","align","isCloseKey","handler","pointerType","Root","Anchor","Portal","Content","Group","Label","Item","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow","Sub","SubTrigger","SubContent"],"mappings":"2uBA0BA,IAAMA,EAAiB,CAAC,QAAS,KAE3BC,EAAY,CAAC,UAAW,WAAY,OACpCC,EAAkB,CAFJ,YAAa,SAAU,UAEAD,GACrCE,EAA6C,CACjDC,IAAK,IAAIJ,EAAgB,cACzBK,IAAK,IAAIL,EAAgB,cAErBM,EAA8C,CAClDF,IAAK,CAAC,aACNC,IAAK,CAAC,eAOFE,EAAY,QAGXC,EAAYC,EAAeC,GAAyBC,EAGzDJ,IAGKK,EAAmBC,GAAmBC,EAAmBP,EAAW,CACzEG,EACAK,EACAC,IAEIC,EAAiBF,IACjBG,EAA2BF,KAS1BG,EAAcC,GAAkBR,EAAoCL,IASpEc,EAAkBC,GAAsBV,EAAwCL,GAUjFgB,EAA6BC,IACjC,MAAMC,YAAEA,EAAAC,KAAaA,GAAO,EAAAC,SAAOA,EAAAC,IAAUA,EAAAC,aAAKA,EAAAC,MAAcA,GAAQ,GAASN,EAC3EO,EAAcd,EAAeQ,IAC5BO,EAASC,GAAoBC,EAAAC,SAAoC,MAClEC,EAA2BF,EAAAG,QAAO,GAClCC,EAAmBC,EAAeV,GAClCW,EAAYC,EAAab,GAmB/B,OAjBMM,EAAAQ,UAAU,KAGd,MAAMC,EAAgB,KACpBP,EAAmBQ,SAAU,EAC7BC,SAASC,iBAAiB,cAAeC,EAAe,CAAEC,SAAS,EAAMC,MAAM,IAC/EJ,SAASC,iBAAiB,cAAeC,EAAe,CAAEC,SAAS,EAAMC,MAAM,KAE3EF,EAAgB,IAAOX,EAAmBQ,SAAU,EAE1D,OADAC,SAASC,iBAAiB,UAAWH,EAAe,C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7BC,sBAAsB,EACtBF,WAAW,EACXW,gBAAkBN,IAEZd,EAAY7C,mBAAmBQ,SAASmB,EAAInB,SAASyH,QACzDtE,EAAMC,kBAIRM,iBAAmBP,GAAUA,EAAMC,iBACnCH,eAAgBC,EAAqBtE,EAAMqE,eAAiBE,IAGtDA,EAAMoH,SAAWiG,EAAWR,SAAStO,EAAQzC,cAAa,KAEhE2E,gBAAiBV,EAAqBtE,EAAMgF,gBAAkBT,IAC5Dd,EAAY1B,UAEZwC,EAAMC,mBAERiH,UAAWnH,EAAqBtE,EAAMyL,UAAYlH,IAEhD,MAAMmH,EAAkBnH,EAAMsH,cAAcc,SAASpI,EAAMoH,QACrDoH,EAAajU,EAAe2E,EAAYrD,KAAK+L,SAAS5H,EAAM8B,KAC9DqF,GAAmBqH,IACrBjQ,EAAQzC,cAAa,GAErBuR,EAAWR,SAASvI,QAEpBtE,EAAMC,8BAexB,SAAS8G,GAAapL,GACpB,OAAOA,EAAO,OAAS,QACzB,CAEA,SAASuP,GAAgBJ,GACvB,MAAmB,kBAAZA,CACT,CAEA,SAASK,GAAgBL,GACvB,OAAOI,GAAgBJ,GAAW,gBAAkBA,EAAU,UAAY,WAC5E,CAkFA,SAASxC,GAAamG,GACpB,OAAQzO,GAAiC,UAAtBA,EAAM0O,YAA0BD,EAAQzO,QAAS,CACtE,CAlGAqO,GAAe3Q,YAAc0Q,GAoG7B,IAAMO,GAAOnT,EACPoT,GAASjR,EACTkR,GAASxQ,EACTyQ,GAAU/P,GACVgQ,GAAQtG,GACRuG,GAAQnG,GACRoG,GAAOhG,GACPiG,GAAerE,GACfsE,GAAa3D,GACb4D,GAAYzD,GACZ0D,GAAgBtD,GAChBuD,GAAYnD,GACZoD,GAAQlD,GACRmD,GAAM7C,GACN8C,GAAarC,GACbsC,GAAarB","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index-DZHMFdr0.mjs","sources":["../../node_modules/@radix-ui/react-menu/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/menu.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs, composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport * as RovingFocusGroup from \"@radix-ui/react-roving-focus\";\nimport { createRovingFocusGroupScope } from \"@radix-ui/react-roving-focus\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SELECTION_KEYS = [\"Enter\", \" \"];\nvar FIRST_KEYS = [\"ArrowDown\", \"PageUp\", \"Home\"];\nvar LAST_KEYS = [\"ArrowUp\", \"PageDown\", \"End\"];\nvar FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nvar SUB_OPEN_KEYS = {\n ltr: [...SELECTION_KEYS, \"ArrowRight\"],\n rtl: [...SELECTION_KEYS, \"ArrowLeft\"]\n};\nvar SUB_CLOSE_KEYS = {\n ltr: [\"ArrowLeft\"],\n rtl: [\"ArrowRight\"]\n};\nvar MENU_NAME = \"Menu\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);\nvar [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [\n createCollectionScope,\n createPopperScope,\n createRovingFocusGroupScope\n]);\nvar usePopperScope = createPopperScope();\nvar useRovingFocusGroupScope = createRovingFocusGroupScope();\nvar [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);\nvar [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);\nvar Menu = (props) => {\n const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;\n const popperScope = usePopperScope(__scopeMenu);\n const [content, setContent] = React.useState(null);\n const isUsingKeyboardRef = React.useRef(false);\n const handleOpenChange = useCallbackRef(onOpenChange);\n const direction = useDirection(dir);\n React.useEffect(() => {\n const handleKeyDown = () => {\n isUsingKeyboardRef.current = true;\n document.addEventListener(\"pointerdown\", handlePointer, { capture: true, once: true });\n document.addEventListener(\"pointermove\", handlePointer, { capture: true, once: true });\n };\n const handlePointer = () => isUsingKeyboardRef.current = false;\n document.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n document.removeEventListener(\"pointerdown\", handlePointer, { capture: true });\n document.removeEventListener(\"pointermove\", handlePointer, { capture: true });\n };\n }, []);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuRootProvider,\n {\n scope: __scopeMenu,\n onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]),\n isUsingKeyboardRef,\n dir: direction,\n modal,\n children\n }\n )\n }\n ) });\n};\nMenu.displayName = MENU_NAME;\nvar ANCHOR_NAME = \"MenuAnchor\";\nvar MenuAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...anchorProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nMenuAnchor.displayName = ANCHOR_NAME;\nvar PORTAL_NAME = \"MenuPortal\";\nvar [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar MenuPortal = (props) => {\n const { __scopeMenu, forceMount, children, container } = props;\n const context = useMenuContext(PORTAL_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nMenuPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"MenuContent\";\nvar [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME);\nvar MenuContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });\n }\n);\nvar MenuRootContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const content = ref.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: context.open,\n disableOutsideScroll: true,\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n ),\n onDismiss: () => context.onOpenChange(false)\n }\n );\n }\n);\nvar MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n onDismiss: () => context.onOpenChange(false)\n }\n );\n});\nvar Slot = createSlot(\"MenuContent.ScrollLock\");\nvar MenuContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeMenu,\n loop = false,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEntryFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n disableOutsideScroll,\n ...contentProps\n } = props;\n const context = useMenuContext(CONTENT_NAME, __scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const getItems = useCollection(__scopeMenu);\n const [currentItemId, setCurrentItemId] = React.useState(null);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n const timerRef = React.useRef(0);\n const searchRef = React.useRef(\"\");\n const pointerGraceTimerRef = React.useRef(0);\n const pointerGraceIntentRef = React.useRef(null);\n const pointerDirRef = React.useRef(\"right\");\n const lastPointerXRef = React.useRef(0);\n const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment;\n const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;\n const handleTypeaheadSearch = (key) => {\n const search = searchRef.current + key;\n const items = getItems().filter((item) => !item.disabled);\n const currentItem = document.activeElement;\n const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;\n const values = items.map((item) => item.textValue);\n const nextMatch = getNextMatch(values, search, currentMatch);\n const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n (function updateSearch(value) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = window.setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n if (newItem) {\n setTimeout(() => newItem.focus());\n }\n };\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n useFocusGuards();\n const isPointerMovingToSubmenu = React.useCallback((event) => {\n const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentProvider,\n {\n scope: __scopeMenu,\n searchRef,\n onItemEnter: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n onItemLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) return;\n contentRef.current?.focus();\n setCurrentItemId(null);\n },\n [isPointerMovingToSubmenu]\n ),\n onTriggerLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n pointerGraceTimerRef,\n onPointerGraceIntentChange: React.useCallback((intent) => {\n pointerGraceIntentRef.current = intent;\n }, []),\n children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n trapped: trapFocus,\n onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {\n event.preventDefault();\n contentRef.current?.focus({ preventScroll: true });\n }),\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n children: /* @__PURE__ */ jsx(\n RovingFocusGroup.Root,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n dir: rootContext.dir,\n orientation: \"vertical\",\n loop,\n currentTabStopId: currentItemId,\n onCurrentTabStopIdChange: setCurrentItemId,\n onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {\n if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n }),\n preventScrollOnEntryFocus: true,\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n role: \"menu\",\n \"aria-orientation\": \"vertical\",\n \"data-state\": getOpenState(context.open),\n \"data-radix-menu-content\": \"\",\n dir: rootContext.dir,\n ...popperScope,\n ...contentProps,\n ref: composedRefs,\n style: { outline: \"none\", ...contentProps.style },\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const target = event.target;\n const isKeyDownInside = target.closest(\"[data-radix-menu-content]\") === event.currentTarget;\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n const isCharacterKey = event.key.length === 1;\n if (isKeyDownInside) {\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n }\n const content = contentRef.current;\n if (event.target !== content) return;\n if (!FIRST_LAST_KEYS.includes(event.key)) return;\n event.preventDefault();\n const items = getItems().filter((item) => !item.disabled);\n const candidateNodes = items.map((item) => item.ref.current);\n if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n focusFirst(candidateNodes);\n }),\n onBlur: composeEventHandlers(props.onBlur, (event) => {\n if (!event.currentTarget.contains(event.target)) {\n window.clearTimeout(timerRef.current);\n searchRef.current = \"\";\n }\n }),\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n const target = event.target;\n const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n if (event.currentTarget.contains(target) && pointerXHasChanged) {\n const newDir = event.clientX > lastPointerXRef.current ? \"right\" : \"left\";\n pointerDirRef.current = newDir;\n lastPointerXRef.current = event.clientX;\n }\n })\n )\n }\n )\n }\n )\n }\n )\n }\n ) })\n }\n );\n }\n);\nMenuContent.displayName = CONTENT_NAME;\nvar GROUP_NAME = \"MenuGroup\";\nvar MenuGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...groupProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { role: \"group\", ...groupProps, ref: forwardedRef });\n }\n);\nMenuGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"MenuLabel\";\nvar MenuLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...labelProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });\n }\n);\nMenuLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"MenuItem\";\nvar ITEM_SELECT = \"menu.itemSelect\";\nvar MenuItem = React.forwardRef(\n (props, forwardedRef) => {\n const { disabled = false, onSelect, ...itemProps } = props;\n const ref = React.useRef(null);\n const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = React.useRef(false);\n const handleSelect = () => {\n const menuItem = ref.current;\n if (!disabled && menuItem) {\n const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });\n menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });\n dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n if (itemSelectEvent.defaultPrevented) {\n isPointerDownRef.current = false;\n } else {\n rootContext.onClose();\n }\n }\n };\n return /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n ...itemProps,\n ref: composedRefs,\n disabled,\n onClick: composeEventHandlers(props.onClick, handleSelect),\n onPointerDown: (event) => {\n props.onPointerDown?.(event);\n isPointerDownRef.current = true;\n },\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n if (!isPointerDownRef.current) event.currentTarget?.click();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (disabled || isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) {\n event.currentTarget.click();\n event.preventDefault();\n }\n })\n }\n );\n }\n);\nMenuItem.displayName = ITEM_NAME;\nvar MenuItemImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;\n const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [isFocused, setIsFocused] = React.useState(false);\n const [textContent, setTextContent] = React.useState(\"\");\n React.useEffect(() => {\n const menuItem = ref.current;\n if (menuItem) {\n setTextContent((menuItem.textContent ?? \"\").trim());\n }\n }, [itemProps.children]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeMenu,\n disabled,\n textValue: textValue ?? textContent,\n children: /* @__PURE__ */ jsx(RovingFocusGroup.Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"menuitem\",\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n ...itemProps,\n ref: composedRefs,\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n if (disabled) {\n contentContext.onItemLeave(event);\n } else {\n contentContext.onItemEnter(event);\n if (!event.defaultPrevented) {\n const item = event.currentTarget;\n item.focus({ preventScroll: true });\n }\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => contentContext.onItemLeave(event))\n ),\n onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))\n }\n ) })\n }\n );\n }\n);\nvar CHECKBOX_ITEM_NAME = \"MenuCheckboxItem\";\nvar MenuCheckboxItem = React.forwardRef(\n (props, forwardedRef) => {\n const { checked = false, onCheckedChange, ...checkboxItemProps } = props;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemcheckbox\",\n \"aria-checked\": isIndeterminate(checked) ? \"mixed\" : checked,\n ...checkboxItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n checkboxItemProps.onSelect,\n () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\nvar RADIO_GROUP_NAME = \"MenuRadioGroup\";\nvar [RadioGroupProvider, useRadioGroupContext] = createMenuContext(\n RADIO_GROUP_NAME,\n { value: void 0, onValueChange: () => {\n } }\n);\nvar MenuRadioGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { value, onValueChange, ...groupProps } = props;\n const handleValueChange = useCallbackRef(onValueChange);\n return /* @__PURE__ */ jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });\n }\n);\nMenuRadioGroup.displayName = RADIO_GROUP_NAME;\nvar RADIO_ITEM_NAME = \"MenuRadioItem\";\nvar MenuRadioItem = React.forwardRef(\n (props, forwardedRef) => {\n const { value, ...radioItemProps } = props;\n const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);\n const checked = value === context.value;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemradio\",\n \"aria-checked\": checked,\n ...radioItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n radioItemProps.onSelect,\n () => context.onValueChange?.(value),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuRadioItem.displayName = RADIO_ITEM_NAME;\nvar ITEM_INDICATOR_NAME = \"MenuItemIndicator\";\nvar [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(\n ITEM_INDICATOR_NAME,\n { checked: false }\n);\nvar MenuItemIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;\n const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(\n Presence,\n {\n present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...itemIndicatorProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(indicatorContext.checked)\n }\n )\n }\n );\n }\n);\nMenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\nvar SEPARATOR_NAME = \"MenuSeparator\";\nvar MenuSeparator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...separatorProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"separator\",\n \"aria-orientation\": \"horizontal\",\n ...separatorProps,\n ref: forwardedRef\n }\n );\n }\n);\nMenuSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"MenuArrow\";\nvar MenuArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nMenuArrow.displayName = ARROW_NAME;\nvar SUB_NAME = \"MenuSub\";\nvar [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);\nvar MenuSub = (props) => {\n const { __scopeMenu, children, open = false, onOpenChange } = props;\n const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const [trigger, setTrigger] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const handleOpenChange = useCallbackRef(onOpenChange);\n React.useEffect(() => {\n if (parentMenuContext.open === false) handleOpenChange(false);\n return () => handleOpenChange(false);\n }, [parentMenuContext.open, handleOpenChange]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuSubProvider,\n {\n scope: __scopeMenu,\n contentId: useId(),\n triggerId: useId(),\n trigger,\n onTriggerChange: setTrigger,\n children\n }\n )\n }\n ) });\n};\nMenuSub.displayName = SUB_NAME;\nvar SUB_TRIGGER_NAME = \"MenuSubTrigger\";\nvar MenuSubTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const openTimerRef = React.useRef(null);\n const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n const scope = { __scopeMenu: props.__scopeMenu };\n const clearOpenTimer = React.useCallback(() => {\n if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }, []);\n React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n React.useEffect(() => {\n const pointerGraceTimer = pointerGraceTimerRef.current;\n return () => {\n window.clearTimeout(pointerGraceTimer);\n onPointerGraceIntentChange(null);\n };\n }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n return /* @__PURE__ */ jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n id: subContext.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": subContext.contentId,\n \"data-state\": getOpenState(context.open),\n ...props,\n ref: composeRefs(forwardedRef, subContext.onTriggerChange),\n onClick: (event) => {\n props.onClick?.(event);\n if (props.disabled || event.defaultPrevented) return;\n event.currentTarget.focus();\n if (!context.open) context.onOpenChange(true);\n },\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n contentContext.onItemEnter(event);\n if (event.defaultPrevented) return;\n if (!props.disabled && !context.open && !openTimerRef.current) {\n contentContext.onPointerGraceIntentChange(null);\n openTimerRef.current = window.setTimeout(() => {\n context.onOpenChange(true);\n clearOpenTimer();\n }, 100);\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => {\n clearOpenTimer();\n const contentRect = context.content?.getBoundingClientRect();\n if (contentRect) {\n const side = context.content?.dataset.side;\n const rightSide = side === \"right\";\n const bleed = rightSide ? -5 : 5;\n const contentNearEdge = contentRect[rightSide ? \"left\" : \"right\"];\n const contentFarEdge = contentRect[rightSide ? \"right\" : \"left\"];\n contentContext.onPointerGraceIntentChange({\n area: [\n // Apply a bleed on clientX to ensure that our exit point is\n // consistently within polygon bounds\n { x: event.clientX + bleed, y: event.clientY },\n { x: contentNearEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.bottom },\n { x: contentNearEdge, y: contentRect.bottom }\n ],\n side\n });\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300\n );\n } else {\n contentContext.onTriggerLeave(event);\n if (event.defaultPrevented) return;\n contentContext.onPointerGraceIntentChange(null);\n }\n })\n ),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (props.disabled || isTypingAhead && event.key === \" \") return;\n if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n context.onOpenChange(true);\n context.content?.focus();\n event.preventDefault();\n }\n })\n }\n ) });\n }\n);\nMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\nvar SUB_CONTENT_NAME = \"MenuSubContent\";\nvar MenuSubContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...subContentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n id: subContext.contentId,\n \"aria-labelledby\": subContext.triggerId,\n ...subContentProps,\n ref: composedRefs,\n align: \"start\",\n side: rootContext.dir === \"rtl\" ? \"left\" : \"right\",\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n trapFocus: false,\n onOpenAutoFocus: (event) => {\n if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();\n event.preventDefault();\n },\n onCloseAutoFocus: (event) => event.preventDefault(),\n onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {\n if (event.target !== subContext.trigger) context.onOpenChange(false);\n }),\n onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => {\n rootContext.onClose();\n event.preventDefault();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isKeyDownInside = event.currentTarget.contains(event.target);\n const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n if (isKeyDownInside && isCloseKey) {\n context.onOpenChange(false);\n subContext.trigger?.focus();\n event.preventDefault();\n }\n })\n }\n ) }) }) });\n }\n);\nMenuSubContent.displayName = SUB_CONTENT_NAME;\nfunction getOpenState(open) {\n return open ? \"open\" : \"closed\";\n}\nfunction isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nfunction getCheckedState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nfunction focusFirst(candidates) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nfunction getNextMatch(values, search, currentMatch) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find(\n (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextMatch !== currentMatch ? nextMatch : void 0;\n}\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const ii = polygon[i];\n const jj = polygon[j];\n const xi = ii.x;\n const yi = ii.y;\n const xj = jj.x;\n const yj = jj.y;\n const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\nfunction isPointerInGraceArea(event, area) {\n if (!area) return false;\n const cursorPos = { x: event.clientX, y: event.clientY };\n return isPointInPolygon(cursorPos, area);\n}\nfunction whenMouse(handler) {\n return (event) => event.pointerType === \"mouse\" ? handler(event) : void 0;\n}\nvar Root3 = Menu;\nvar Anchor2 = MenuAnchor;\nvar Portal = MenuPortal;\nvar Content2 = MenuContent;\nvar Group = MenuGroup;\nvar Label = MenuLabel;\nvar Item2 = MenuItem;\nvar CheckboxItem = MenuCheckboxItem;\nvar RadioGroup = MenuRadioGroup;\nvar RadioItem = MenuRadioItem;\nvar ItemIndicator = MenuItemIndicator;\nvar Separator = MenuSeparator;\nvar Arrow2 = MenuArrow;\nvar Sub = MenuSub;\nvar SubTrigger = MenuSubTrigger;\nvar SubContent = MenuSubContent;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n CheckboxItem,\n Content2 as Content,\n Group,\n Item2 as Item,\n ItemIndicator,\n Label,\n Menu,\n MenuAnchor,\n MenuArrow,\n MenuCheckboxItem,\n MenuContent,\n MenuGroup,\n MenuItem,\n MenuItemIndicator,\n MenuLabel,\n MenuPortal,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSeparator,\n MenuSub,\n MenuSubContent,\n MenuSubTrigger,\n Portal,\n RadioGroup,\n RadioItem,\n Root3 as Root,\n Separator,\n Sub,\n SubContent,\n SubTrigger,\n createMenuScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["SELECTION_KEYS","LAST_KEYS","FIRST_LAST_KEYS","SUB_OPEN_KEYS","ltr","rtl","SUB_CLOSE_KEYS","MENU_NAME","Collection","useCollection","createCollectionScope","createCollection","createMenuContext","createMenuScope","createContextScope","createPopperScope","createRovingFocusGroupScope","usePopperScope","useRovingFocusGroupScope","MenuProvider","useMenuContext","MenuRootProvider","useMenuRootContext","Menu","props","__scopeMenu","open","children","dir","onOpenChange","modal","popperScope","content","setContent","React","useState","isUsingKeyboardRef","useRef","handleOpenChange","useCallbackRef","direction","useDirection","useEffect","handleKeyDown","current","document","addEventListener","handlePointer","capture","once","removeEventListener","jsx","PopperPrimitive.Root","scope","onContentChange","onClose","useCallback","displayName","MenuAnchor","forwardRef","forwardedRef","anchorProps","PopperPrimitive.Anchor","ref","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","MenuPortal","container","context","Presence","present","PortalPrimitive","asChild","CONTENT_NAME","MenuContentProvider","useMenuContentContext","MenuContent","portalContext","contentProps","rootContext","Provider","Slot","MenuRootContentModal","MenuRootContentNonModal","composedRefs","useComposedRefs","hideOthers","MenuContentImpl","trapFocus","disableOutsidePointerEvents","disableOutsideScroll","onFocusOutside","composeEventHandlers","event","preventDefault","checkForDefaultPrevented","onDismiss","createSlot","loop","onOpenAutoFocus","onCloseAutoFocus","onEntryFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside","rovingFocusGroupScope","getItems","currentItemId","setCurrentItemId","contentRef","timerRef","searchRef","pointerGraceTimerRef","pointerGraceIntentRef","pointerDirRef","lastPointerXRef","ScrollLockWrapper","RemoveScroll","Fragment","scrollLockWrapperProps","as","allowPinchZoom","handleTypeaheadSearch","key","search","items","filter","item","disabled","currentItem","activeElement","currentMatch","find","textValue","nextMatch","values","isRepeated","length","Array","from","every","char","normalizedSearch","currentMatchIndex","indexOf","wrappedValues","array","startIndex","Math","max","map","_","index","v","value","toLowerCase","startsWith","getNextMatch","newItem","updateSearch","window","clearTimeout","setTimeout","focus","useFocusGuards","isPointerMovingToSubmenu","side","area","cursorPos","x","clientX","y","clientY","point","polygon","inside","i","j","ii","jj","xi","yi","xj","yj","isPointInPolygon","isPointerInGraceArea","onItemEnter","onItemLeave","onTriggerLeave","onPointerGraceIntentChange","intent","FocusScope","trapped","onMountAutoFocus","preventScroll","onUnmountAutoFocus","DismissableLayer","RovingFocusGroup.Root","orientation","currentTabStopId","onCurrentTabStopIdChange","preventScrollOnEntryFocus","PopperPrimitive.Content","role","getOpenState","style","outline","onKeyDown","isKeyDownInside","target","closest","currentTarget","isModifierKey","ctrlKey","altKey","metaKey","isCharacterKey","includes","candidateNodes","reverse","candidates","PREVIOUSLY_FOCUSED_ELEMENT","candidate","focusFirst","onBlur","contains","onPointerMove","whenMouse","pointerXHasChanged","newDir","MenuGroup","groupProps","Primitive","div","MenuLabel","labelProps","ITEM_NAME","ITEM_SELECT","MenuItem","onSelect","itemProps","contentContext","isPointerDownRef","MenuItemImpl","onClick","menuItem","itemSelectEvent","CustomEvent","bubbles","cancelable","dispatchDiscreteCustomEvent","defaultPrevented","onPointerDown","onPointerUp","click","isTypingAhead","isFocused","setIsFocused","textContent","setTextContent","trim","ItemSlot","RovingFocusGroup.Item","focusable","onPointerLeave","onFocus","MenuCheckboxItem","checked","onCheckedChange","checkboxItemProps","ItemIndicatorProvider","isIndeterminate","getCheckedState","RADIO_GROUP_NAME","RadioGroupProvider","useRadioGroupContext","onValueChange","MenuRadioGroup","handleValueChange","RADIO_ITEM_NAME","MenuRadioItem","radioItemProps","ITEM_INDICATOR_NAME","useItemIndicatorContext","MenuItemIndicator","itemIndicatorProps","indicatorContext","span","MenuSeparator","separatorProps","MenuArrow","arrowProps","PopperPrimitive.Arrow","SUB_NAME","MenuSubProvider","useMenuSubContext","MenuSub","parentMenuContext","trigger","setTrigger","contentId","useId","triggerId","onTriggerChange","SUB_TRIGGER_NAME","MenuSubTrigger","subContext","openTimerRef","clearOpenTimer","pointerGraceTimer","id","composeRefs","contentRect","getBoundingClientRect","dataset","rightSide","bleed","contentNearEdge","contentFarEdge","top","bottom","SUB_CONTENT_NAME","MenuSubContent","subContentProps","align","isCloseKey","handler","pointerType","Root","Anchor","Portal","Content","Group","Label","Item","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow","Sub","SubTrigger","SubContent"],"mappings":"2uBA0BA,IAAMA,EAAiB,CAAC,QAAS,KAE3BC,EAAY,CAAC,UAAW,WAAY,OACpCC,EAAkB,CAFJ,YAAa,SAAU,UAEAD,GACrCE,EAA6C,CACjDC,IAAK,IAAIJ,EAAgB,cACzBK,IAAK,IAAIL,EAAgB,cAErBM,E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2E,EAAYrD,KAAK+L,SAAS5H,EAAM8B,KAC9DqF,GAAmBqH,IACrBjQ,EAAQzC,cAAa,GAErBuR,EAAWR,SAASvI,QAEpBtE,EAAMC,8BAexB,SAAS8G,GAAapL,GACpB,OAAOA,EAAO,OAAS,QACzB,CAEA,SAASuP,GAAgBJ,GACvB,MAAmB,kBAAZA,CACT,CAEA,SAASK,GAAgBL,GACvB,OAAOI,GAAgBJ,GAAW,gBAAkBA,EAAU,UAAY,WAC5E,CAkFA,SAASxC,GAAamG,GACpB,OAAQzO,GAAiC,UAAtBA,EAAM0O,YAA0BD,EAAQzO,QAAS,CACtE,CAlGAqO,GAAe3Q,YAAc0Q,GAoG7B,IAAMO,GAAOnT,EACPoT,GAASjR,EACTkR,GAASxQ,EACTyQ,GAAU/P,GACVgQ,GAAQtG,GACRuG,GAAQnG,GACRoG,GAAOhG,GACPiG,GAAerE,GACfsE,GAAa3D,GACb4D,GAAYzD,GACZ0D,GAAgBtD,GAChBuD,GAAYnD,GACZoD,GAAQlD,GACRmD,GAAM7C,GACN8C,GAAarC,GACbsC,GAAarB","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{c as o}from"./index-
|
2
|
-
//# sourceMappingURL=index-
|
1
|
+
import*as e from"react";import{c as o}from"./index-CdJCOoFA.mjs";import{createCollection as r}from"@radix-ui/react-collection";import{u as t}from"./index-COvW87ew.mjs";import{c as n}from"./index-CCcl327A.mjs";import{u as a}from"./index-CRxQlsb9.mjs";import{P as i}from"./index-w9bxia3O.mjs";import{u as s}from"./index-CXszXOf_.mjs";import{u}from"./index-CybgQKpz.mjs";import{u as c}from"./index-CU_y1XAz.mjs";import{jsx as l}from"react/jsx-runtime";var f="rovingFocusGroup.onEntryFocus",p={bubbles:!1,cancelable:!0},d="RovingFocusGroup",[m,v,b]=r(d),[w,g]=n(d,[b]),[F,I]=w(d),h=e.forwardRef((e,o)=>l(m.Provider,{scope:e.__scopeRovingFocusGroup,children:l(m.Slot,{scope:e.__scopeRovingFocusGroup,children:l(R,{...e,ref:o})})}));h.displayName=d;var R=e.forwardRef((r,n)=>{const{__scopeRovingFocusGroup:a,orientation:m,loop:b=!1,dir:w,currentTabStopId:g,defaultCurrentTabStopId:I,onCurrentTabStopIdChange:h,onEntryFocus:R,preventScrollOnEntryFocus:x=!1,...y}=r,S=e.useRef(null),A=t(n,S),E=c(w),[D,C]=u({prop:g,defaultProp:I??null,onChange:h,caller:d}),[j,_]=e.useState(!1),G=s(R),K=v(a),k=e.useRef(!1),[L,P]=e.useState(0);return e.useEffect(()=>{const e=S.current;if(e)return e.addEventListener(f,G),()=>e.removeEventListener(f,G)},[G]),l(F,{scope:a,orientation:m,dir:E,loop:b,currentTabStopId:D,onItemFocus:e.useCallback(e=>C(e),[C]),onItemShiftTab:e.useCallback(()=>_(!0),[]),onFocusableItemAdd:e.useCallback(()=>P(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>P(e=>e-1),[]),children:l(i.div,{tabIndex:j||0===L?-1:0,"data-orientation":m,...y,ref:A,style:{outline:"none",...r.style},onMouseDown:o(r.onMouseDown,()=>{k.current=!0}),onFocus:o(r.onFocus,e=>{const o=!k.current;if(e.target===e.currentTarget&&o&&!j){const o=new CustomEvent(f,p);if(e.currentTarget.dispatchEvent(o),!o.defaultPrevented){const e=K().filter(e=>e.focusable);T([e.find(e=>e.active),e.find(e=>e.id===D),...e].filter(Boolean).map(e=>e.ref.current),x)}}k.current=!1}),onBlur:o(r.onBlur,()=>_(!1))})})}),x="RovingFocusGroupItem",y=e.forwardRef((r,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:u=!1,tabStopId:c,children:f,...p}=r,d=a(),b=c||d,w=I(x,n),g=w.currentTabStopId===b,F=v(n),{onFocusableItemAdd:h,onFocusableItemRemove:R,currentTabStopId:y}=w;return e.useEffect(()=>{if(s)return h(),()=>R()},[s,h,R]),l(m.ItemSlot,{scope:n,id:b,focusable:s,active:u,children:l(i.span,{tabIndex:g?0:-1,"data-orientation":w.orientation,...p,ref:t,onMouseDown:o(r.onMouseDown,e=>{s?w.onItemFocus(b):e.preventDefault()}),onFocus:o(r.onFocus,()=>w.onItemFocus(b)),onKeyDown:o(r.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void w.onItemShiftTab();if(e.target!==e.currentTarget)return;const o=function(e,o,r){const t=function(e,o){return"rtl"!==o?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===o&&["ArrowLeft","ArrowRight"].includes(t)||"horizontal"===o&&["ArrowUp","ArrowDown"].includes(t)?void 0:S[t]}(e,w.orientation,w.dir);if(void 0!==o){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=F().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===o)n.reverse();else if("prev"===o||"next"===o){"prev"===o&&n.reverse();const a=n.indexOf(e.currentTarget);n=w.loop?(t=a+1,(r=n).map((e,o)=>r[(t+o)%r.length])):n.slice(a+1)}setTimeout(()=>T(n))}var r,t}),children:"function"==typeof f?f({isCurrentTabStop:g,hasTabStop:null!=y}):f})})});y.displayName=x;var S={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function T(e,o=!1){const r=document.activeElement;for(const t of e){if(t===r)return;if(t.focus({preventScroll:o}),document.activeElement!==r)return}}var A=h,E=y;export{E as I,A as R,g as c};
|
2
|
+
//# sourceMappingURL=index-LvOFIVGz.mjs.map
|