vendor: 4,705 bytes, line 1
1import{c as e,n as t,t as n}from"./jsx-runtime-DQYatRE7.js";import{o as r}from"./button-Dzg4CpG5.js";import{a as i,b as a,c as o,d as s,g as c,h as l,i as u,n as d,o as f,p,r as m,t as h,y as g}from"./es2015-BXShVKHj.js";import{a as _,i as v,n as y,r as b,t as x}from"./dist-B3mtkg9n.js";var S=e(t(),1),C=e(n(),1),w=`Popover`,[T,ee]=g(w,[_]),E=_(),[D,O]=T(w),k=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=E(t),u=S.useRef(null),[d,f]=S.useState(!1),[p,m]=l({prop:r,defaultProp:i??!1,onChange:a,caller:w});return(0,C.jsx)(v,{...s,children:(0,C.jsx)(D,{scope:t,contentId:c(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:S.useCallback(()=>f(!0),[]),onCustomAnchorRemove:S.useCallback(()=>f(!1),[]),modal:o,children:n})})};k.displayName=w;var A=`PopoverAnchor`,j=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(A,n),a=E(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return S.useEffect(()=>(o(),()=>s()),[o,s]),(0,C.jsx)(x,{...a,...r,ref:t})});j.displayName=A;var M=`PopoverTrigger`,N=S.forwardRef((e,t)=>{let{__scopePopover:n,...i}=e,o=O(M,n),c=E(n),l=r(t,o.triggerRef),u=(0,C.jsx)(s.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":o.open,"aria-controls":o.contentId,"data-state":J(o.open),...i,ref:l,onClick:a(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?u:(0,C.jsx)(x,{asChild:!0,...c,children:u})});N.displayName=M;var P=`PopoverPortal`,[F,I]=T(P,{forceMount:void 0}),L=e=>{let{__scopePopover:t,forceMount:n,children:r,container:a}=e,o=O(P,t);return(0,C.jsx)(F,{scope:t,forceMount:n,children:(0,C.jsx)(u,{present:n||o.open,children:(0,C.jsx)(i,{asChild:!0,container:a,children:r})})})};L.displayName=P;var R=`PopoverContent`,z=S.forwardRef((e,t)=>{let n=I(R,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=O(R,e.__scopePopover);return(0,C.jsx)(u,{present:r||a.open,children:a.modal?(0,C.jsx)(V,{...i,ref:t}):(0,C.jsx)(H,{...i,ref:t})})});z.displayName=R;var B=p(`PopoverContent.RemoveScroll`),V=S.forwardRef((e,t)=>{let n=O(R,e.__scopePopover),i=S.useRef(null),o=r(t,i),s=S.useRef(!1);return S.useEffect(()=>{let e=i.current;if(e)return h(e)},[]),(0,C.jsx)(d,{as:B,allowPinchZoom:!0,children:(0,C.jsx)(U,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:a(e.onCloseAutoFocus,e=>{e.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:a(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:a(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),H=S.forwardRef((e,t)=>{let n=O(R,e.__scopePopover),r=S.useRef(!1),i=S.useRef(!1);return(0,C.jsx)(U,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),U=S.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...p}=e,h=O(R,n),g=E(n);return m(),(0,C.jsx)(f,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,C.jsx)(o,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:(0,C.jsx)(b,{"data-state":J(h.open),role:`dialog`,id:h.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),W=`PopoverClose`,G=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(W,n);return(0,C.jsx)(s.button,{type:`button`,...r,ref:t,onClick:a(e.onClick,()=>i.onOpenChange(!1))})});G.displayName=W;var K=`PopoverArrow`,q=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=E(n);return(0,C.jsx)(y,{...i,...r,ref:t})});q.displayName=K;function J(e){return e?`open`:`closed`}var Y=k,X=j,Z=N,Q=L,$=z;export{Z as a,Y as i,$ as n,Q as r,X as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.