@fluentui/react-popover 0.0.0-nightly-20230222-0421.1 → 0.0.0-nightly-20230223-2115.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/.swcrc +33 -0
 - package/CHANGELOG.json +44 -23
 - package/CHANGELOG.md +24 -14
 - package/lib/Popover.js.map +1 -1
 - package/lib/PopoverSurface.js.map +1 -1
 - package/lib/PopoverTrigger.js.map +1 -1
 - package/lib/components/Popover/Popover.js +1 -0
 - package/lib/components/Popover/Popover.js.map +1 -1
 - package/lib/components/Popover/Popover.types.js +1 -1
 - package/lib/components/Popover/Popover.types.js.map +1 -1
 - package/lib/components/Popover/constants.js +1 -2
 - package/lib/components/Popover/constants.js.map +1 -1
 - package/lib/components/Popover/index.js.map +1 -1
 - package/lib/components/Popover/renderPopover.js.map +1 -1
 - package/lib/components/Popover/usePopover.js +5 -8
 - package/lib/components/Popover/usePopover.js.map +1 -1
 - package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
 - package/lib/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
 - package/lib/components/PopoverSurface/index.js.map +1 -1
 - package/lib/components/PopoverSurface/renderPopoverSurface.js +2 -3
 - package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
 - package/lib/components/PopoverSurface/usePopoverSurface.js +5 -3
 - package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
 - package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
 - package/lib/components/PopoverTrigger/PopoverTrigger.js +1 -0
 - package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
 - package/lib/components/PopoverTrigger/PopoverTrigger.types.js +1 -1
 - package/lib/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
 - package/lib/components/PopoverTrigger/index.js.map +1 -1
 - package/lib/components/PopoverTrigger/renderPopoverTrigger.js +1 -2
 - package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
 - package/lib/components/PopoverTrigger/usePopoverTrigger.js +1 -0
 - package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
 - package/lib/index.js.map +1 -1
 - package/lib/popoverContext.js +4 -1
 - package/lib/popoverContext.js.map +1 -1
 - package/lib-commonjs/Popover.js +5 -4
 - package/lib-commonjs/Popover.js.map +1 -1
 - package/lib-commonjs/PopoverSurface.js +5 -4
 - package/lib-commonjs/PopoverSurface.js.map +1 -1
 - package/lib-commonjs/PopoverTrigger.js +5 -4
 - package/lib-commonjs/PopoverTrigger.js.map +1 -1
 - package/lib-commonjs/components/Popover/Popover.js +14 -13
 - package/lib-commonjs/components/Popover/Popover.js.map +1 -1
 - package/lib-commonjs/components/Popover/Popover.types.js +5 -2
 - package/lib-commonjs/components/Popover/Popover.types.js.map +1 -1
 - package/lib-commonjs/components/Popover/constants.js +10 -8
 - package/lib-commonjs/components/Popover/constants.js.map +1 -1
 - package/lib-commonjs/components/Popover/index.js +8 -7
 - package/lib-commonjs/components/Popover/index.js.map +1 -1
 - package/lib-commonjs/components/Popover/renderPopover.js +31 -47
 - package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
 - package/lib-commonjs/components/Popover/usePopover.js +176 -173
 - package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +16 -15
 - package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js +3 -2
 - package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/index.js +9 -8
 - package/lib-commonjs/components/PopoverSurface/index.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +25 -28
 - package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +70 -80
 - package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
 - package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +243 -113
 - package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
 - package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +15 -14
 - package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
 - package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js +5 -2
 - package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
 - package/lib-commonjs/components/PopoverTrigger/index.js +8 -7
 - package/lib-commonjs/components/PopoverTrigger/index.js.map +1 -1
 - package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +12 -11
 - package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
 - package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +71 -80
 - package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
 - package/lib-commonjs/index.js +30 -92
 - package/lib-commonjs/index.js.map +1 -1
 - package/lib-commonjs/popoverContext.js +37 -25
 - package/lib-commonjs/popoverContext.js.map +1 -1
 - package/package.json +13 -13
 
| 
         @@ -1,187 +1,190 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            "use strict";
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
2 
     | 
    
         
             
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
      
 3 
     | 
    
         
            +
                value: true
         
     | 
| 
       5 
4 
     | 
    
         
             
            });
         
     | 
| 
       6 
     | 
    
         
            -
            exports 
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
            const  
     | 
| 
       11 
     | 
    
         
            -
            const  
     | 
| 
       12 
     | 
    
         
            -
            const  
     | 
| 
       13 
     | 
    
         
            -
            const  
     | 
| 
       14 
     | 
    
         
            -
            const  
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
              
     | 
| 
       17 
     | 
    
         
            -
              
     | 
| 
       18 
     | 
    
         
            -
              
     | 
| 
       19 
     | 
    
         
            -
              
     | 
| 
       20 
     | 
    
         
            -
              
     | 
| 
       21 
     | 
    
         
            -
              
     | 
| 
       22 
     | 
    
         
            -
              
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
              const initialState = {
         
     | 
| 
       27 
     | 
    
         
            -
                size: 'medium',
         
     | 
| 
       28 
     | 
    
         
            -
                contextTarget,
         
     | 
| 
       29 
     | 
    
         
            -
                setContextTarget,
         
     | 
| 
       30 
     | 
    
         
            -
                ...props
         
     | 
| 
       31 
     | 
    
         
            -
              };
         
     | 
| 
       32 
     | 
    
         
            -
              const children = React.Children.toArray(props.children);
         
     | 
| 
       33 
     | 
    
         
            -
              if (process.env.NODE_ENV !== 'production') {
         
     | 
| 
       34 
     | 
    
         
            -
                if (children.length === 0) {
         
     | 
| 
       35 
     | 
    
         
            -
                  // eslint-disable-next-line no-console
         
     | 
| 
       36 
     | 
    
         
            -
                  console.warn('Popover must contain at least one child');
         
     | 
| 
       37 
     | 
    
         
            -
                }
         
     | 
| 
       38 
     | 
    
         
            -
                if (children.length > 2) {
         
     | 
| 
       39 
     | 
    
         
            -
                  // eslint-disable-next-line no-console
         
     | 
| 
       40 
     | 
    
         
            -
                  console.warn('Popover must contain at most two children');
         
     | 
| 
       41 
     | 
    
         
            -
                }
         
     | 
| 
       42 
     | 
    
         
            -
              }
         
     | 
| 
       43 
     | 
    
         
            -
              let popoverTrigger = undefined;
         
     | 
| 
       44 
     | 
    
         
            -
              let popoverSurface = undefined;
         
     | 
| 
       45 
     | 
    
         
            -
              if (children.length === 2) {
         
     | 
| 
       46 
     | 
    
         
            -
                popoverTrigger = children[0];
         
     | 
| 
       47 
     | 
    
         
            -
                popoverSurface = children[1];
         
     | 
| 
       48 
     | 
    
         
            -
              } else if (children.length === 1) {
         
     | 
| 
       49 
     | 
    
         
            -
                popoverSurface = children[0];
         
     | 
| 
       50 
     | 
    
         
            -
              }
         
     | 
| 
       51 
     | 
    
         
            -
              const [open, setOpenState] = useOpenState(initialState);
         
     | 
| 
       52 
     | 
    
         
            -
              const setOpenTimeoutRef = React.useRef(0);
         
     | 
| 
       53 
     | 
    
         
            -
              const setOpen = react_utilities_1.useEventCallback((e, shouldOpen) => {
         
     | 
| 
       54 
     | 
    
         
            -
                var _a;
         
     | 
| 
       55 
     | 
    
         
            -
                clearTimeout(setOpenTimeoutRef.current);
         
     | 
| 
       56 
     | 
    
         
            -
                if (!(e instanceof Event) && e.persist) {
         
     | 
| 
       57 
     | 
    
         
            -
                  // < React 17 still uses pooled synthetic events
         
     | 
| 
       58 
     | 
    
         
            -
                  e.persist();
         
     | 
| 
       59 
     | 
    
         
            -
                }
         
     | 
| 
       60 
     | 
    
         
            -
                if (e.type === 'mouseleave') {
         
     | 
| 
       61 
     | 
    
         
            -
                  // FIXME leaking Node timeout type
         
     | 
| 
       62 
     | 
    
         
            -
                  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
         
     | 
| 
       63 
     | 
    
         
            -
                  // @ts-ignore
         
     | 
| 
       64 
     | 
    
         
            -
                  setOpenTimeoutRef.current = setTimeout(() => {
         
     | 
| 
       65 
     | 
    
         
            -
                    setOpenState(e, shouldOpen);
         
     | 
| 
       66 
     | 
    
         
            -
                  }, (_a = props.mouseLeaveDelay) !== null && _a !== void 0 ? _a : 500);
         
     | 
| 
       67 
     | 
    
         
            -
                } else {
         
     | 
| 
       68 
     | 
    
         
            -
                  setOpenState(e, shouldOpen);
         
     | 
| 
       69 
     | 
    
         
            -
                }
         
     | 
| 
       70 
     | 
    
         
            -
              });
         
     | 
| 
       71 
     | 
    
         
            -
              // Clear timeout on unmount
         
     | 
| 
       72 
     | 
    
         
            -
              // Setting state after a component unmounts can cause memory leaks
         
     | 
| 
       73 
     | 
    
         
            -
              React.useEffect(() => {
         
     | 
| 
       74 
     | 
    
         
            -
                return () => {
         
     | 
| 
       75 
     | 
    
         
            -
                  clearTimeout(setOpenTimeoutRef.current);
         
     | 
| 
      
 5 
     | 
    
         
            +
            Object.defineProperty(exports, "usePopover_unstable", {
         
     | 
| 
      
 6 
     | 
    
         
            +
                enumerable: true,
         
     | 
| 
      
 7 
     | 
    
         
            +
                get: ()=>usePopover_unstable
         
     | 
| 
      
 8 
     | 
    
         
            +
            });
         
     | 
| 
      
 9 
     | 
    
         
            +
            const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
         
     | 
| 
      
 10 
     | 
    
         
            +
            const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
         
     | 
| 
      
 11 
     | 
    
         
            +
            const _reactUtilities = require("@fluentui/react-utilities");
         
     | 
| 
      
 12 
     | 
    
         
            +
            const _reactSharedContexts = require("@fluentui/react-shared-contexts");
         
     | 
| 
      
 13 
     | 
    
         
            +
            const _reactPositioning = require("@fluentui/react-positioning");
         
     | 
| 
      
 14 
     | 
    
         
            +
            const _reactPortal = require("@fluentui/react-portal");
         
     | 
| 
      
 15 
     | 
    
         
            +
            const _reactTabster = require("@fluentui/react-tabster");
         
     | 
| 
      
 16 
     | 
    
         
            +
            const _index = require("../PopoverSurface/index");
         
     | 
| 
      
 17 
     | 
    
         
            +
            const _constants = require("./constants");
         
     | 
| 
      
 18 
     | 
    
         
            +
            const usePopover_unstable = (props)=>{
         
     | 
| 
      
 19 
     | 
    
         
            +
                const [contextTarget, setContextTarget] = (0, _reactPositioning.usePositioningMouseTarget)();
         
     | 
| 
      
 20 
     | 
    
         
            +
                const initialState = {
         
     | 
| 
      
 21 
     | 
    
         
            +
                    size: 'medium',
         
     | 
| 
      
 22 
     | 
    
         
            +
                    contextTarget,
         
     | 
| 
      
 23 
     | 
    
         
            +
                    setContextTarget,
         
     | 
| 
      
 24 
     | 
    
         
            +
                    ...props
         
     | 
| 
       76 
25 
     | 
    
         
             
                };
         
     | 
| 
       77 
     | 
    
         
            -
             
     | 
| 
       78 
     | 
    
         
            -
             
     | 
| 
       79 
     | 
    
         
            -
             
     | 
| 
       80 
     | 
    
         
            -
             
     | 
| 
       81 
     | 
    
         
            -
             
     | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
       84 
     | 
    
         
            -
             
     | 
| 
       85 
     | 
    
         
            -
             
     | 
| 
       86 
     | 
    
         
            -
             
     | 
| 
       87 
     | 
    
         
            -
                element: targetDocument,
         
     | 
| 
       88 
     | 
    
         
            -
                callback: ev => setOpen(ev, false),
         
     | 
| 
       89 
     | 
    
         
            -
                refs: [positioningRefs.triggerRef, positioningRefs.contentRef],
         
     | 
| 
       90 
     | 
    
         
            -
                disabled: !open
         
     | 
| 
       91 
     | 
    
         
            -
              });
         
     | 
| 
       92 
     | 
    
         
            -
              // only close on scroll for context, or when closeOnScroll is specified
         
     | 
| 
       93 
     | 
    
         
            -
              const closeOnScroll = initialState.openOnContext || initialState.closeOnScroll;
         
     | 
| 
       94 
     | 
    
         
            -
              react_utilities_1.useOnScrollOutside({
         
     | 
| 
       95 
     | 
    
         
            -
                contains: react_portal_1.elementContains,
         
     | 
| 
       96 
     | 
    
         
            -
                element: targetDocument,
         
     | 
| 
       97 
     | 
    
         
            -
                callback: ev => setOpen(ev, false),
         
     | 
| 
       98 
     | 
    
         
            -
                refs: [positioningRefs.triggerRef, positioningRefs.contentRef],
         
     | 
| 
       99 
     | 
    
         
            -
                disabled: !open || !closeOnScroll
         
     | 
| 
       100 
     | 
    
         
            -
              });
         
     | 
| 
       101 
     | 
    
         
            -
              const {
         
     | 
| 
       102 
     | 
    
         
            -
                findFirstFocusable
         
     | 
| 
       103 
     | 
    
         
            -
              } = react_tabster_1.useFocusFinders();
         
     | 
| 
       104 
     | 
    
         
            -
              React.useEffect(() => {
         
     | 
| 
       105 
     | 
    
         
            -
                var _a;
         
     | 
| 
       106 
     | 
    
         
            -
                if (props.unstable_disableAutoFocus) {
         
     | 
| 
       107 
     | 
    
         
            -
                  return;
         
     | 
| 
      
 26 
     | 
    
         
            +
                const children = _react.Children.toArray(props.children);
         
     | 
| 
      
 27 
     | 
    
         
            +
                if (process.env.NODE_ENV !== 'production') {
         
     | 
| 
      
 28 
     | 
    
         
            +
                    if (children.length === 0) {
         
     | 
| 
      
 29 
     | 
    
         
            +
                        // eslint-disable-next-line no-console
         
     | 
| 
      
 30 
     | 
    
         
            +
                        console.warn('Popover must contain at least one child');
         
     | 
| 
      
 31 
     | 
    
         
            +
                    }
         
     | 
| 
      
 32 
     | 
    
         
            +
                    if (children.length > 2) {
         
     | 
| 
      
 33 
     | 
    
         
            +
                        // eslint-disable-next-line no-console
         
     | 
| 
      
 34 
     | 
    
         
            +
                        console.warn('Popover must contain at most two children');
         
     | 
| 
      
 35 
     | 
    
         
            +
                    }
         
     | 
| 
       108 
36 
     | 
    
         
             
                }
         
     | 
| 
       109 
     | 
    
         
            -
                 
     | 
| 
       110 
     | 
    
         
            -
             
     | 
| 
       111 
     | 
    
         
            -
             
     | 
| 
       112 
     | 
    
         
            -
             
     | 
| 
      
 37 
     | 
    
         
            +
                let popoverTrigger = undefined;
         
     | 
| 
      
 38 
     | 
    
         
            +
                let popoverSurface = undefined;
         
     | 
| 
      
 39 
     | 
    
         
            +
                if (children.length === 2) {
         
     | 
| 
      
 40 
     | 
    
         
            +
                    popoverTrigger = children[0];
         
     | 
| 
      
 41 
     | 
    
         
            +
                    popoverSurface = children[1];
         
     | 
| 
      
 42 
     | 
    
         
            +
                } else if (children.length === 1) {
         
     | 
| 
      
 43 
     | 
    
         
            +
                    popoverSurface = children[0];
         
     | 
| 
       113 
44 
     | 
    
         
             
                }
         
     | 
| 
       114 
     | 
    
         
            -
             
     | 
| 
       115 
     | 
    
         
            -
             
     | 
| 
       116 
     | 
    
         
            -
                 
     | 
| 
       117 
     | 
    
         
            -
             
     | 
| 
       118 
     | 
    
         
            -
             
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
             
     | 
| 
       121 
     | 
    
         
            -
             
     | 
| 
       122 
     | 
    
         
            -
             
     | 
| 
       123 
     | 
    
         
            -
             
     | 
| 
       124 
     | 
    
         
            -
             
     | 
| 
       125 
     | 
    
         
            -
             
     | 
| 
       126 
     | 
    
         
            -
             
     | 
| 
      
 45 
     | 
    
         
            +
                const [open, setOpenState] = useOpenState(initialState);
         
     | 
| 
      
 46 
     | 
    
         
            +
                const setOpenTimeoutRef = _react.useRef(0);
         
     | 
| 
      
 47 
     | 
    
         
            +
                const setOpen = (0, _reactUtilities.useEventCallback)((e, shouldOpen)=>{
         
     | 
| 
      
 48 
     | 
    
         
            +
                    clearTimeout(setOpenTimeoutRef.current);
         
     | 
| 
      
 49 
     | 
    
         
            +
                    if (!(e instanceof Event) && e.persist) {
         
     | 
| 
      
 50 
     | 
    
         
            +
                        // < React 17 still uses pooled synthetic events
         
     | 
| 
      
 51 
     | 
    
         
            +
                        e.persist();
         
     | 
| 
      
 52 
     | 
    
         
            +
                    }
         
     | 
| 
      
 53 
     | 
    
         
            +
                    if (e.type === 'mouseleave') {
         
     | 
| 
      
 54 
     | 
    
         
            +
                        // FIXME leaking Node timeout type
         
     | 
| 
      
 55 
     | 
    
         
            +
                        // eslint-disable-next-line @typescript-eslint/ban-ts-comment
         
     | 
| 
      
 56 
     | 
    
         
            +
                        // @ts-ignore
         
     | 
| 
      
 57 
     | 
    
         
            +
                        setOpenTimeoutRef.current = setTimeout(()=>{
         
     | 
| 
      
 58 
     | 
    
         
            +
                            setOpenState(e, shouldOpen);
         
     | 
| 
      
 59 
     | 
    
         
            +
                        }, props.mouseLeaveDelay ?? 500);
         
     | 
| 
      
 60 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 61 
     | 
    
         
            +
                        setOpenState(e, shouldOpen);
         
     | 
| 
      
 62 
     | 
    
         
            +
                    }
         
     | 
| 
      
 63 
     | 
    
         
            +
                });
         
     | 
| 
      
 64 
     | 
    
         
            +
                // Clear timeout on unmount
         
     | 
| 
      
 65 
     | 
    
         
            +
                // Setting state after a component unmounts can cause memory leaks
         
     | 
| 
      
 66 
     | 
    
         
            +
                _react.useEffect(()=>{
         
     | 
| 
      
 67 
     | 
    
         
            +
                    return ()=>{
         
     | 
| 
      
 68 
     | 
    
         
            +
                        clearTimeout(setOpenTimeoutRef.current);
         
     | 
| 
      
 69 
     | 
    
         
            +
                    };
         
     | 
| 
      
 70 
     | 
    
         
            +
                }, []);
         
     | 
| 
      
 71 
     | 
    
         
            +
                const toggleOpen = _react.useCallback((e)=>{
         
     | 
| 
      
 72 
     | 
    
         
            +
                    setOpen(e, !open);
         
     | 
| 
      
 73 
     | 
    
         
            +
                }, [
         
     | 
| 
      
 74 
     | 
    
         
            +
                    setOpen,
         
     | 
| 
      
 75 
     | 
    
         
            +
                    open
         
     | 
| 
      
 76 
     | 
    
         
            +
                ]);
         
     | 
| 
      
 77 
     | 
    
         
            +
                const positioningRefs = usePopoverRefs(initialState);
         
     | 
| 
      
 78 
     | 
    
         
            +
                const { targetDocument  } = (0, _reactSharedContexts.useFluent_unstable)();
         
     | 
| 
      
 79 
     | 
    
         
            +
                (0, _reactUtilities.useOnClickOutside)({
         
     | 
| 
      
 80 
     | 
    
         
            +
                    contains: _reactPortal.elementContains,
         
     | 
| 
      
 81 
     | 
    
         
            +
                    element: targetDocument,
         
     | 
| 
      
 82 
     | 
    
         
            +
                    callback: (ev)=>setOpen(ev, false),
         
     | 
| 
      
 83 
     | 
    
         
            +
                    refs: [
         
     | 
| 
      
 84 
     | 
    
         
            +
                        positioningRefs.triggerRef,
         
     | 
| 
      
 85 
     | 
    
         
            +
                        positioningRefs.contentRef
         
     | 
| 
      
 86 
     | 
    
         
            +
                    ],
         
     | 
| 
      
 87 
     | 
    
         
            +
                    disabled: !open
         
     | 
| 
      
 88 
     | 
    
         
            +
                });
         
     | 
| 
      
 89 
     | 
    
         
            +
                // only close on scroll for context, or when closeOnScroll is specified
         
     | 
| 
      
 90 
     | 
    
         
            +
                const closeOnScroll = initialState.openOnContext || initialState.closeOnScroll;
         
     | 
| 
      
 91 
     | 
    
         
            +
                (0, _reactUtilities.useOnScrollOutside)({
         
     | 
| 
      
 92 
     | 
    
         
            +
                    contains: _reactPortal.elementContains,
         
     | 
| 
      
 93 
     | 
    
         
            +
                    element: targetDocument,
         
     | 
| 
      
 94 
     | 
    
         
            +
                    callback: (ev)=>setOpen(ev, false),
         
     | 
| 
      
 95 
     | 
    
         
            +
                    refs: [
         
     | 
| 
      
 96 
     | 
    
         
            +
                        positioningRefs.triggerRef,
         
     | 
| 
      
 97 
     | 
    
         
            +
                        positioningRefs.contentRef
         
     | 
| 
      
 98 
     | 
    
         
            +
                    ],
         
     | 
| 
      
 99 
     | 
    
         
            +
                    disabled: !open || !closeOnScroll
         
     | 
| 
      
 100 
     | 
    
         
            +
                });
         
     | 
| 
      
 101 
     | 
    
         
            +
                const { findFirstFocusable  } = (0, _reactTabster.useFocusFinders)();
         
     | 
| 
      
 102 
     | 
    
         
            +
                _react.useEffect(()=>{
         
     | 
| 
      
 103 
     | 
    
         
            +
                    if (props.unstable_disableAutoFocus) {
         
     | 
| 
      
 104 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 105 
     | 
    
         
            +
                    }
         
     | 
| 
      
 106 
     | 
    
         
            +
                    if (open && positioningRefs.contentRef.current) {
         
     | 
| 
      
 107 
     | 
    
         
            +
                        const containerTabIndex = positioningRefs.contentRef.current.getAttribute('tabIndex') ?? undefined;
         
     | 
| 
      
 108 
     | 
    
         
            +
                        const firstFocusable = isNaN(containerTabIndex) ? findFirstFocusable(positioningRefs.contentRef.current) : positioningRefs.contentRef.current;
         
     | 
| 
      
 109 
     | 
    
         
            +
                        firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
         
     | 
| 
      
 110 
     | 
    
         
            +
                    }
         
     | 
| 
      
 111 
     | 
    
         
            +
                }, [
         
     | 
| 
      
 112 
     | 
    
         
            +
                    findFirstFocusable,
         
     | 
| 
      
 113 
     | 
    
         
            +
                    open,
         
     | 
| 
      
 114 
     | 
    
         
            +
                    positioningRefs.contentRef,
         
     | 
| 
      
 115 
     | 
    
         
            +
                    props.unstable_disableAutoFocus
         
     | 
| 
      
 116 
     | 
    
         
            +
                ]);
         
     | 
| 
      
 117 
     | 
    
         
            +
                return {
         
     | 
| 
      
 118 
     | 
    
         
            +
                    ...initialState,
         
     | 
| 
      
 119 
     | 
    
         
            +
                    ...positioningRefs,
         
     | 
| 
      
 120 
     | 
    
         
            +
                    popoverTrigger,
         
     | 
| 
      
 121 
     | 
    
         
            +
                    popoverSurface,
         
     | 
| 
      
 122 
     | 
    
         
            +
                    open,
         
     | 
| 
      
 123 
     | 
    
         
            +
                    setOpen,
         
     | 
| 
      
 124 
     | 
    
         
            +
                    toggleOpen,
         
     | 
| 
      
 125 
     | 
    
         
            +
                    setContextTarget,
         
     | 
| 
      
 126 
     | 
    
         
            +
                    contextTarget,
         
     | 
| 
      
 127 
     | 
    
         
            +
                    inline: props.inline ?? false
         
     | 
| 
      
 128 
     | 
    
         
            +
                };
         
     | 
| 
       127 
129 
     | 
    
         
             
            };
         
     | 
| 
       128 
     | 
    
         
            -
            exports.usePopover_unstable = usePopover_unstable;
         
     | 
| 
       129 
130 
     | 
    
         
             
            /**
         
     | 
| 
       130 
131 
     | 
    
         
             
             * Creates and manages the Popover open state
         
     | 
| 
       131 
     | 
    
         
            -
             */
         
     | 
| 
       132 
     | 
    
         
            -
             
     | 
| 
       133 
     | 
    
         
            -
             
     | 
| 
       134 
     | 
    
         
            -
             
     | 
| 
       135 
     | 
    
         
            -
                return (_a = state.onOpenChange) === null || _a === void 0 ? void 0 : _a.call(state, e, data);
         
     | 
| 
       136 
     | 
    
         
            -
              });
         
     | 
| 
       137 
     | 
    
         
            -
              const [open, setOpenState] = react_utilities_1.useControllableState({
         
     | 
| 
       138 
     | 
    
         
            -
                state: state.open,
         
     | 
| 
       139 
     | 
    
         
            -
                defaultState: state.defaultOpen,
         
     | 
| 
       140 
     | 
    
         
            -
                initialState: false
         
     | 
| 
       141 
     | 
    
         
            -
              });
         
     | 
| 
       142 
     | 
    
         
            -
              state.open = open !== undefined ? open : state.open;
         
     | 
| 
       143 
     | 
    
         
            -
              const setContextTarget = state.setContextTarget;
         
     | 
| 
       144 
     | 
    
         
            -
              const setOpen = React.useCallback((e, shouldOpen) => {
         
     | 
| 
       145 
     | 
    
         
            -
                if (shouldOpen && e.type === 'contextmenu') {
         
     | 
| 
       146 
     | 
    
         
            -
                  setContextTarget(e);
         
     | 
| 
       147 
     | 
    
         
            -
                }
         
     | 
| 
       148 
     | 
    
         
            -
                if (!shouldOpen) {
         
     | 
| 
       149 
     | 
    
         
            -
                  setContextTarget(undefined);
         
     | 
| 
       150 
     | 
    
         
            -
                }
         
     | 
| 
       151 
     | 
    
         
            -
                setOpenState(shouldOpen);
         
     | 
| 
       152 
     | 
    
         
            -
                onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(e, {
         
     | 
| 
       153 
     | 
    
         
            -
                  open: shouldOpen
         
     | 
| 
      
 132 
     | 
    
         
            +
             */ function useOpenState(state) {
         
     | 
| 
      
 133 
     | 
    
         
            +
                const onOpenChange = (0, _reactUtilities.useEventCallback)((e, data)=>{
         
     | 
| 
      
 134 
     | 
    
         
            +
                    var _state_onOpenChange;
         
     | 
| 
      
 135 
     | 
    
         
            +
                    return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);
         
     | 
| 
       154 
136 
     | 
    
         
             
                });
         
     | 
| 
       155 
     | 
    
         
            -
             
     | 
| 
       156 
     | 
    
         
            -
             
     | 
| 
      
 137 
     | 
    
         
            +
                const [open, setOpenState] = (0, _reactUtilities.useControllableState)({
         
     | 
| 
      
 138 
     | 
    
         
            +
                    state: state.open,
         
     | 
| 
      
 139 
     | 
    
         
            +
                    defaultState: state.defaultOpen,
         
     | 
| 
      
 140 
     | 
    
         
            +
                    initialState: false
         
     | 
| 
      
 141 
     | 
    
         
            +
                });
         
     | 
| 
      
 142 
     | 
    
         
            +
                state.open = open !== undefined ? open : state.open;
         
     | 
| 
      
 143 
     | 
    
         
            +
                const setContextTarget = state.setContextTarget;
         
     | 
| 
      
 144 
     | 
    
         
            +
                const setOpen = _react.useCallback((e, shouldOpen)=>{
         
     | 
| 
      
 145 
     | 
    
         
            +
                    if (shouldOpen && e.type === 'contextmenu') {
         
     | 
| 
      
 146 
     | 
    
         
            +
                        setContextTarget(e);
         
     | 
| 
      
 147 
     | 
    
         
            +
                    }
         
     | 
| 
      
 148 
     | 
    
         
            +
                    if (!shouldOpen) {
         
     | 
| 
      
 149 
     | 
    
         
            +
                        setContextTarget(undefined);
         
     | 
| 
      
 150 
     | 
    
         
            +
                    }
         
     | 
| 
      
 151 
     | 
    
         
            +
                    setOpenState(shouldOpen);
         
     | 
| 
      
 152 
     | 
    
         
            +
                    onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(e, {
         
     | 
| 
      
 153 
     | 
    
         
            +
                        open: shouldOpen
         
     | 
| 
      
 154 
     | 
    
         
            +
                    });
         
     | 
| 
      
 155 
     | 
    
         
            +
                }, [
         
     | 
| 
      
 156 
     | 
    
         
            +
                    setOpenState,
         
     | 
| 
      
 157 
     | 
    
         
            +
                    onOpenChange,
         
     | 
| 
      
 158 
     | 
    
         
            +
                    setContextTarget
         
     | 
| 
      
 159 
     | 
    
         
            +
                ]);
         
     | 
| 
      
 160 
     | 
    
         
            +
                return [
         
     | 
| 
      
 161 
     | 
    
         
            +
                    open,
         
     | 
| 
      
 162 
     | 
    
         
            +
                    setOpen
         
     | 
| 
      
 163 
     | 
    
         
            +
                ];
         
     | 
| 
       157 
164 
     | 
    
         
             
            }
         
     | 
| 
       158 
165 
     | 
    
         
             
            /**
         
     | 
| 
       159 
166 
     | 
    
         
             
             * Creates and sets the necessary trigger, target and content refs used by Popover
         
     | 
| 
       160 
     | 
    
         
            -
             */
         
     | 
| 
       161 
     | 
    
         
            -
             
     | 
| 
       162 
     | 
    
         
            -
             
     | 
| 
       163 
     | 
    
         
            -
             
     | 
| 
       164 
     | 
    
         
            -
             
     | 
| 
       165 
     | 
    
         
            -
             
     | 
| 
       166 
     | 
    
         
            -
             
     | 
| 
       167 
     | 
    
         
            -
                 
     | 
| 
       168 
     | 
    
         
            -
             
     | 
| 
       169 
     | 
    
         
            -
             
     | 
| 
       170 
     | 
    
         
            -
             
     | 
| 
       171 
     | 
    
         
            -
                 
     | 
| 
       172 
     | 
    
         
            -
             
     | 
| 
       173 
     | 
    
         
            -
             
     | 
| 
       174 
     | 
    
         
            -
                 
     | 
| 
       175 
     | 
    
         
            -
              }
         
     | 
| 
       176 
     | 
    
         
            -
             
     | 
| 
       177 
     | 
    
         
            -
             
     | 
| 
       178 
     | 
    
         
            -
             
     | 
| 
       179 
     | 
    
         
            -
             
     | 
| 
       180 
     | 
    
         
            -
             
     | 
| 
       181 
     | 
    
         
            -
             
     | 
| 
       182 
     | 
    
         
            -
             
     | 
| 
       183 
     | 
    
         
            -
                contentRef,
         
     | 
| 
       184 
     | 
    
         
            -
                arrowRef
         
     | 
| 
       185 
     | 
    
         
            -
              };
         
     | 
| 
       186 
     | 
    
         
            -
            }
         
     | 
| 
      
 167 
     | 
    
         
            +
             */ function usePopoverRefs(state) {
         
     | 
| 
      
 168 
     | 
    
         
            +
                const positioningOptions = {
         
     | 
| 
      
 169 
     | 
    
         
            +
                    position: 'above',
         
     | 
| 
      
 170 
     | 
    
         
            +
                    align: 'center',
         
     | 
| 
      
 171 
     | 
    
         
            +
                    arrowPadding: 2 * _constants.popoverSurfaceBorderRadius,
         
     | 
| 
      
 172 
     | 
    
         
            +
                    target: state.openOnContext ? state.contextTarget : undefined,
         
     | 
| 
      
 173 
     | 
    
         
            +
                    ...(0, _reactPositioning.resolvePositioningShorthand)(state.positioning)
         
     | 
| 
      
 174 
     | 
    
         
            +
                };
         
     | 
| 
      
 175 
     | 
    
         
            +
                // no reason to render arrow when covering the target
         
     | 
| 
      
 176 
     | 
    
         
            +
                if (positioningOptions.coverTarget) {
         
     | 
| 
      
 177 
     | 
    
         
            +
                    state.withArrow = false;
         
     | 
| 
      
 178 
     | 
    
         
            +
                }
         
     | 
| 
      
 179 
     | 
    
         
            +
                if (state.withArrow) {
         
     | 
| 
      
 180 
     | 
    
         
            +
                    positioningOptions.offset = (0, _reactPositioning.mergeArrowOffset)(positioningOptions.offset, _index.arrowHeights[state.size]);
         
     | 
| 
      
 181 
     | 
    
         
            +
                }
         
     | 
| 
      
 182 
     | 
    
         
            +
                const { targetRef: triggerRef , containerRef: contentRef , arrowRef  } = (0, _reactPositioning.usePositioning)(positioningOptions);
         
     | 
| 
      
 183 
     | 
    
         
            +
                return {
         
     | 
| 
      
 184 
     | 
    
         
            +
                    triggerRef,
         
     | 
| 
      
 185 
     | 
    
         
            +
                    contentRef,
         
     | 
| 
      
 186 
     | 
    
         
            +
                    arrowRef
         
     | 
| 
      
 187 
     | 
    
         
            +
                };
         
     | 
| 
      
 188 
     | 
    
         
            +
            } //# sourceMappingURL=usePopover.js.map
         
     | 
| 
      
 189 
     | 
    
         
            +
             
     | 
| 
       187 
190 
     | 
    
         
             
            //# sourceMappingURL=usePopover.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"mappings":";;;;;;AAAA;AACA;AAMA;AACA;AAMA;AACA;AACA;AAEA;AAEA;;;;;;;;AAQO,MAAMA,mBAAmB,GAAIC,KAAmB,IAAkB;;EACvE,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGC,6CAAyB,EAAE;EACrE,MAAMC,YAAY,GAAG;IACnBC,IAAI,EAAE,QAAQ;IACdJ,aAAa;IACbC,gBAAgB;IAChB,GAAGF;GACK;EAEV,MAAMM,QAAQ,GAAGC,KAA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UAAU;IAAEgC,YAAY,EAAE/B,UAAU;IAAEgC;EAAQ,CAAE,GAAG9E,kCAAc,CAACiE,kBAAkB,CAAC;EAExG,OAAO;IACLpB,UAAU;IACVC,UAAU;IACVgC;GACQ;AACZ","names":["usePopover_unstable","props","contextTarget","setContextTarget","react_positioning_1","initialState","size","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeoutRef","useRef","setOpen","react_utilities_1","e","shouldOpen","clearTimeout","current","Event","persist","type","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","react_shared_contexts_1","contains","react_portal_1","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","findFirstFocusable","react_tabster_1","unstable_disableAutoFocus","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","inline","exports","state","onOpenChange","data","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","constants_1","target","positioning","coverTarget","withArrow","offset","index_1","targetRef","containerRef","arrowRef"],"sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-popover/src/components/Popover/usePopover.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n  useControllableState,\n  useEventCallback,\n  useOnClickOutside,\n  useOnScrollOutside,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n  usePositioning,\n  resolvePositioningShorthand,\n  mergeArrowOffset,\n  usePositioningMouseTarget,\n} from '@fluentui/react-positioning';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport type { OpenPopoverEvents, PopoverProps, PopoverState } from './Popover.types';\nimport { popoverSurfaceBorderRadius } from './constants';\n\n/**\n * Create the state required to render Popover.\n *\n * The returned state can be modified with hooks such as usePopoverStyles,\n * before being passed to renderPopover_unstable.\n *\n * @param props - props from this instance of Popover\n */\nexport const usePopover_unstable = (props: PopoverProps): PopoverState => {\n  const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n  const initialState = {\n    size: 'medium',\n    contextTarget,\n    setContextTarget,\n    ...props,\n  } as const;\n\n  const children = React.Children.toArray(props.children) as React.ReactElement[];\n\n  if (process.env.NODE_ENV !== 'production') {\n    if (children.length === 0) {\n      // eslint-disable-next-line no-console\n      console.warn('Popover must contain at least one child');\n    }\n\n    if (children.length > 2) {\n      // eslint-disable-next-line no-console\n      console.warn('Popover must contain at most two children');\n    }\n  }\n\n  let popoverTrigger: React.ReactElement | undefined = undefined;\n  let popoverSurface: React.ReactElement | undefined = undefined;\n  if (children.length === 2) {\n    popoverTrigger = children[0];\n    popoverSurface = children[1];\n  } else if (children.length === 1) {\n    popoverSurface = children[0];\n  }\n\n  const [open, setOpenState] = useOpenState(initialState);\n\n  const setOpenTimeoutRef = React.useRef(0);\n\n  const setOpen = useEventCallback((e: OpenPopoverEvents, shouldOpen: boolean) => {\n    clearTimeout(setOpenTimeoutRef.current);\n    if (!(e instanceof Event) && e.persist) {\n      // < React 17 still uses pooled synthetic events\n      e.persist();\n    }\n\n    if (e.type === 'mouseleave') {\n      // FIXME leaking Node timeout type\n      // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n      // @ts-ignore\n      setOpenTimeoutRef.current = setTimeout(() => {\n        setOpenState(e, shouldOpen);\n      }, props.mouseLeaveDelay ?? 500);\n    } else {\n      setOpenState(e, shouldOpen);\n    }\n  });\n\n  // Clear timeout on unmount\n  // Setting state after a component unmounts can cause memory leaks\n  React.useEffect(() => {\n    return () => {\n      clearTimeout(setOpenTimeoutRef.current);\n    };\n  }, []);\n\n  const toggleOpen = React.useCallback<PopoverState['toggleOpen']>(\n    e => {\n      setOpen(e, !open);\n    },\n    [setOpen, open],\n  );\n\n  const positioningRefs = usePopoverRefs(initialState);\n\n  const { targetDocument } = useFluent();\n  useOnClickOutside({\n    contains: elementContains,\n    element: targetDocument,\n    callback: ev => setOpen(ev, false),\n    refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n    disabled: !open,\n  });\n\n  // only close on scroll for context, or when closeOnScroll is specified\n  const closeOnScroll = initialState.openOnContext || initialState.closeOnScroll;\n  useOnScrollOutside({\n    contains: elementContains,\n    element: targetDocument,\n    callback: ev => setOpen(ev, false),\n    refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n    disabled: !open || !closeOnScroll,\n  });\n\n  const { findFirstFocusable } = useFocusFinders();\n\n  React.useEffect(() => {\n    if (props.unstable_disableAutoFocus) {\n      return;\n    }\n\n    if (open && positioningRefs.contentRef.current) {\n      const containerTabIndex = positioningRefs.contentRef.current.getAttribute('tabIndex') ?? undefined;\n      const firstFocusable = isNaN(containerTabIndex)\n        ? findFirstFocusable(positioningRefs.contentRef.current)\n        : positioningRefs.contentRef.current;\n      firstFocusable?.focus();\n    }\n  }, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n\n  return {\n    ...initialState,\n    ...positioningRefs,\n    popoverTrigger,\n    popoverSurface,\n    open,\n    setOpen,\n    toggleOpen,\n    setContextTarget,\n    contextTarget,\n    inline: props.inline ?? false,\n  };\n};\n\n/**\n * Creates and manages the Popover open state\n */\nfunction useOpenState(\n  state: Pick<PopoverState, 'setContextTarget' | 'onOpenChange'> & Pick<PopoverProps, 'open' | 'defaultOpen'>,\n) {\n  const onOpenChange: PopoverState['onOpenChange'] = useEventCallback((e, data) => state.onOpenChange?.(e, data));\n\n  const [open, setOpenState] = useControllableState({\n    state: state.open,\n    defaultState: state.defaultOpen,\n    initialState: false,\n  });\n  state.open = open !== undefined ? open : state.open;\n  const setContextTarget = state.setContextTarget;\n\n  const setOpen = React.useCallback(\n    (e: OpenPopoverEvents, shouldOpen: boolean) => {\n      if (shouldOpen && e.type === 'contextmenu') {\n        setContextTarget(e as React.MouseEvent);\n      }\n\n      if (!shouldOpen) {\n        setContextTarget(undefined);\n      }\n\n      setOpenState(shouldOpen);\n      onOpenChange?.(e, { open: shouldOpen });\n    },\n    [setOpenState, onOpenChange, setContextTarget],\n  );\n\n  return [open, setOpen] as const;\n}\n\n/**\n * Creates and sets the necessary trigger, target and content refs used by Popover\n */\nfunction usePopoverRefs(\n  state: Pick<PopoverState, 'size' | 'contextTarget'> &\n    Pick<PopoverProps, 'positioning' | 'openOnContext' | 'withArrow'>,\n) {\n  const positioningOptions = {\n    position: 'above' as const,\n    align: 'center' as const,\n    arrowPadding: 2 * popoverSurfaceBorderRadius,\n    target: state.openOnContext ? state.contextTarget : undefined,\n    ...resolvePositioningShorthand(state.positioning),\n  };\n\n  // no reason to render arrow when covering the target\n  if (positioningOptions.coverTarget) {\n    state.withArrow = false;\n  }\n\n  if (state.withArrow) {\n    positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeights[state.size]);\n  }\n\n  const { targetRef: triggerRef, containerRef: contentRef, arrowRef } = usePositioning(positioningOptions);\n\n  return {\n    triggerRef,\n    contentRef,\n    arrowRef,\n  } as const;\n}\n"]}
         
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"sources":["../../../lib/components/Popover/usePopover.js"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useEventCallback, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { usePositioning, resolvePositioningShorthand, mergeArrowOffset, usePositioningMouseTarget } from '@fluentui/react-positioning';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport { popoverSurfaceBorderRadius } from './constants';\n/**\n * Create the state required to render Popover.\n *\n * The returned state can be modified with hooks such as usePopoverStyles,\n * before being passed to renderPopover_unstable.\n *\n * @param props - props from this instance of Popover\n */\nexport const usePopover_unstable = props => {\n  const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n  const initialState = {\n    size: 'medium',\n    contextTarget,\n    setContextTarget,\n    ...props\n  };\n  const children = React.Children.toArray(props.children);\n  if (process.env.NODE_ENV !== 'production') {\n    if (children.length === 0) {\n      // eslint-disable-next-line no-console\n      console.warn('Popover must contain at least one child');\n    }\n    if (children.length > 2) {\n      // eslint-disable-next-line no-console\n      console.warn('Popover must contain at most two children');\n    }\n  }\n  let popoverTrigger = undefined;\n  let popoverSurface = undefined;\n  if (children.length === 2) {\n    popoverTrigger = children[0];\n    popoverSurface = children[1];\n  } else if (children.length === 1) {\n    popoverSurface = children[0];\n  }\n  const [open, setOpenState] = useOpenState(initialState);\n  const setOpenTimeoutRef = React.useRef(0);\n  const setOpen = useEventCallback((e, shouldOpen) => {\n    clearTimeout(setOpenTimeoutRef.current);\n    if (!(e instanceof Event) && e.persist) {\n      // < React 17 still uses pooled synthetic events\n      e.persist();\n    }\n    if (e.type === 'mouseleave') {\n      // FIXME leaking Node timeout type\n      // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n      // @ts-ignore\n      setOpenTimeoutRef.current = setTimeout(() => {\n        setOpenState(e, shouldOpen);\n      }, props.mouseLeaveDelay ?? 500);\n    } else {\n      setOpenState(e, shouldOpen);\n    }\n  });\n  // Clear timeout on unmount\n  // Setting state after a component unmounts can cause memory leaks\n  React.useEffect(() => {\n    return () => {\n      clearTimeout(setOpenTimeoutRef.current);\n    };\n  }, []);\n  const toggleOpen = React.useCallback(e => {\n    setOpen(e, !open);\n  }, [setOpen, open]);\n  const positioningRefs = usePopoverRefs(initialState);\n  const {\n    targetDocument\n  } = useFluent();\n  useOnClickOutside({\n    contains: elementContains,\n    element: targetDocument,\n    callback: ev => setOpen(ev, false),\n    refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n    disabled: !open\n  });\n  // only close on scroll for context, or when closeOnScroll is specified\n  const closeOnScroll = initialState.openOnContext || initialState.closeOnScroll;\n  useOnScrollOutside({\n    contains: elementContains,\n    element: targetDocument,\n    callback: ev => setOpen(ev, false),\n    refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n    disabled: !open || !closeOnScroll\n  });\n  const {\n    findFirstFocusable\n  } = useFocusFinders();\n  React.useEffect(() => {\n    if (props.unstable_disableAutoFocus) {\n      return;\n    }\n    if (open && positioningRefs.contentRef.current) {\n      const containerTabIndex = positioningRefs.contentRef.current.getAttribute('tabIndex') ?? undefined;\n      const firstFocusable = isNaN(containerTabIndex) ? findFirstFocusable(positioningRefs.contentRef.current) : positioningRefs.contentRef.current;\n      firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n    }\n  }, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n  return {\n    ...initialState,\n    ...positioningRefs,\n    popoverTrigger,\n    popoverSurface,\n    open,\n    setOpen,\n    toggleOpen,\n    setContextTarget,\n    contextTarget,\n    inline: props.inline ?? false\n  };\n};\n/**\n * Creates and manages the Popover open state\n */\nfunction useOpenState(state) {\n  const onOpenChange = useEventCallback((e, data) => {\n    var _state_onOpenChange;\n    return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);\n  });\n  const [open, setOpenState] = useControllableState({\n    state: state.open,\n    defaultState: state.defaultOpen,\n    initialState: false\n  });\n  state.open = open !== undefined ? open : state.open;\n  const setContextTarget = state.setContextTarget;\n  const setOpen = React.useCallback((e, shouldOpen) => {\n    if (shouldOpen && e.type === 'contextmenu') {\n      setContextTarget(e);\n    }\n    if (!shouldOpen) {\n      setContextTarget(undefined);\n    }\n    setOpenState(shouldOpen);\n    onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(e, {\n      open: shouldOpen\n    });\n  }, [setOpenState, onOpenChange, setContextTarget]);\n  return [open, setOpen];\n}\n/**\n * Creates and sets the necessary trigger, target and content refs used by Popover\n */\nfunction usePopoverRefs(state) {\n  const positioningOptions = {\n    position: 'above',\n    align: 'center',\n    arrowPadding: 2 * popoverSurfaceBorderRadius,\n    target: state.openOnContext ? state.contextTarget : undefined,\n    ...resolvePositioningShorthand(state.positioning)\n  };\n  // no reason to render arrow when covering the target\n  if (positioningOptions.coverTarget) {\n    state.withArrow = false;\n  }\n  if (state.withArrow) {\n    positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeights[state.size]);\n  }\n  const {\n    targetRef: triggerRef,\n    containerRef: contentRef,\n    arrowRef\n  } = usePositioning(positioningOptions);\n  return {\n    triggerRef,\n    contentRef,\n    arrowRef\n  };\n}\n//# sourceMappingURL=usePopover.js.map"],"names":["usePopover_unstable","props","contextTarget","setContextTarget","usePositioningMouseTarget","initialState","size","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeoutRef","useRef","setOpen","useEventCallback","e","shouldOpen","clearTimeout","current","Event","persist","type","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","useFluent","useOnClickOutside","contains","elementContains","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","useOnScrollOutside","findFirstFocusable","useFocusFinders","unstable_disableAutoFocus","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","inline","state","onOpenChange","data","_state_onOpenChange","call","useControllableState","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","popoverSurfaceBorderRadius","target","resolvePositioningShorthand","positioning","coverTarget","withArrow","offset","mergeArrowOffset","arrowHeights","targetRef","containerRef","arrowRef","usePositioning"],"mappings":";;;;+BAgBaA;;aAAAA;;;6DAhBU;gCACuE;qCAC9C;kCACyD;6BACzE;8BACA;uBACH;2BACc;AASpC,MAAMA,sBAAsBC,CAAAA,QAAS;IAC1C,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,IAAAA,2CAAyB;IACnE,MAAMC,eAAe;QACnBC,MAAM;QACNJ;QACAC;QACA,GAAGF,KAAK;IACV;IACA,MAAMM,WAAWC,OAAMC,QAAQ,CAACC,OAAO,CAACT,MAAMM,QAAQ;IACtD,IAAII,QA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B,EAACd,MAAMe,WAAW,CAAC;IACnD;IACA,qDAAqD;IACrD,IAAIP,mBAAmBQ,WAAW,EAAE;QAClChB,MAAMiB,SAAS,GAAG,KAAK;IACzB,CAAC;IACD,IAAIjB,MAAMiB,SAAS,EAAE;QACnBT,mBAAmBU,MAAM,GAAGC,IAAAA,kCAAgB,EAACX,mBAAmBU,MAAM,EAAEE,mBAAY,CAACpB,MAAM3D,IAAI,CAAC;IAClG,CAAC;IACD,MAAM,EACJgF,WAAWpC,WAAU,EACrBqC,cAAcpC,WAAU,EACxBqC,SAAQ,EACT,GAAGC,IAAAA,gCAAc,EAAChB;IACnB,OAAO;QACLvB;QACAC;QACAqC;IACF;AACF,EACA,sCAAsC"}
         
     | 
| 
         @@ -1,20 +1,21 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            "use strict";
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
2 
     | 
    
         
             
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
      
 3 
     | 
    
         
            +
                value: true
         
     | 
| 
      
 4 
     | 
    
         
            +
            });
         
     | 
| 
      
 5 
     | 
    
         
            +
            Object.defineProperty(exports, "PopoverSurface", {
         
     | 
| 
      
 6 
     | 
    
         
            +
                enumerable: true,
         
     | 
| 
      
 7 
     | 
    
         
            +
                get: ()=>PopoverSurface
         
     | 
| 
       5 
8 
     | 
    
         
             
            });
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
            const  
     | 
| 
       8 
     | 
    
         
            -
            const  
     | 
| 
       9 
     | 
    
         
            -
            const  
     | 
| 
       10 
     | 
    
         
            -
            const  
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
              
     | 
| 
       13 
     | 
    
         
            -
              
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
              const state = usePopoverSurface_1.usePopoverSurface_unstable(props, ref);
         
     | 
| 
       16 
     | 
    
         
            -
              usePopoverSurfaceStyles_1.usePopoverSurfaceStyles_unstable(state);
         
     | 
| 
       17 
     | 
    
         
            -
              return renderPopoverSurface_1.renderPopoverSurface_unstable(state);
         
     | 
| 
      
 9 
     | 
    
         
            +
            const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
         
     | 
| 
      
 10 
     | 
    
         
            +
            const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
         
     | 
| 
      
 11 
     | 
    
         
            +
            const _usePopoverSurface = require("./usePopoverSurface");
         
     | 
| 
      
 12 
     | 
    
         
            +
            const _renderPopoverSurface = require("./renderPopoverSurface");
         
     | 
| 
      
 13 
     | 
    
         
            +
            const _usePopoverSurfaceStyles = require("./usePopoverSurfaceStyles");
         
     | 
| 
      
 14 
     | 
    
         
            +
            const PopoverSurface = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
         
     | 
| 
      
 15 
     | 
    
         
            +
                const state = (0, _usePopoverSurface.usePopoverSurface_unstable)(props, ref);
         
     | 
| 
      
 16 
     | 
    
         
            +
                (0, _usePopoverSurfaceStyles.usePopoverSurfaceStyles_unstable)(state);
         
     | 
| 
      
 17 
     | 
    
         
            +
                return (0, _renderPopoverSurface.renderPopoverSurface_unstable)(state);
         
     | 
| 
       18 
18 
     | 
    
         
             
            });
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
      
 19 
     | 
    
         
            +
            PopoverSurface.displayName = 'PopoverSurface'; //# sourceMappingURL=PopoverSurface.js.map
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
       20 
21 
     | 
    
         
             
            //# sourceMappingURL=PopoverSurface.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"sources":["../../../lib/components/PopoverSurface/PopoverSurface.js"],"sourcesContent":["import * as React from 'react';\nimport { usePopoverSurface_unstable } from './usePopoverSurface';\nimport { renderPopoverSurface_unstable } from './renderPopoverSurface';\nimport { usePopoverSurfaceStyles_unstable } from './usePopoverSurfaceStyles';\n/**\n * PopoverSurface component renders react children in a positioned box\n */\nexport const PopoverSurface = /*#__PURE__*/React.forwardRef((props, ref) => {\n  const state = usePopoverSurface_unstable(props, ref);\n  usePopoverSurfaceStyles_unstable(state);\n  return renderPopoverSurface_unstable(state);\n});\nPopoverSurface.displayName = 'PopoverSurface';\n//# sourceMappingURL=PopoverSurface.js.map"],"names":["PopoverSurface","React","forwardRef","props","ref","state","usePopoverSurface_unstable","usePopoverSurfaceStyles_unstable","renderPopoverSurface_unstable","displayName"],"mappings":";;;;+BAOaA;;aAAAA;;;6DAPU;mCACoB;sCACG;yCACG;AAI1C,MAAMA,iBAAiB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAC1E,MAAMC,QAAQC,IAAAA,6CAA0B,EAACH,OAAOC;IAChDG,IAAAA,yDAAgC,EAACF;IACjC,OAAOG,IAAAA,mDAA6B,EAACH;AACvC;AACAL,eAAeS,WAAW,GAAG,kBAC7B,0CAA0C"}
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"sources":["../../../lib/components/PopoverSurface/PopoverSurface.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=PopoverSurface.types.js.map"],"names":[],"mappings":";;;;CACA,gDAAgD"}
         
     | 
| 
         @@ -1,12 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            "use strict";
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
2 
     | 
    
         
             
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
      
 3 
     | 
    
         
            +
                value: true
         
     | 
| 
       5 
4 
     | 
    
         
             
            });
         
     | 
| 
       6 
     | 
    
         
            -
            const  
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
      
 5 
     | 
    
         
            +
            const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
         
     | 
| 
      
 6 
     | 
    
         
            +
            _exportStar(require("./PopoverSurface"), exports);
         
     | 
| 
      
 7 
     | 
    
         
            +
            _exportStar(require("./PopoverSurface.types"), exports);
         
     | 
| 
      
 8 
     | 
    
         
            +
            _exportStar(require("./renderPopoverSurface"), exports);
         
     | 
| 
      
 9 
     | 
    
         
            +
            _exportStar(require("./usePopoverSurface"), exports);
         
     | 
| 
      
 10 
     | 
    
         
            +
            _exportStar(require("./usePopoverSurfaceStyles"), exports);
         
     | 
| 
      
 11 
     | 
    
         
            +
             //# sourceMappingURL=index.js.map
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
       12 
13 
     | 
    
         
             
            //# sourceMappingURL=index.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"sources":["../../../lib/components/PopoverSurface/index.js"],"sourcesContent":["export * from './PopoverSurface';\nexport * from './PopoverSurface.types';\nexport * from './renderPopoverSurface';\nexport * from './usePopoverSurface';\nexport * from './usePopoverSurfaceStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
         
     | 
| 
         @@ -1,32 +1,29 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            "use strict";
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
2 
     | 
    
         
             
            Object.defineProperty(exports, "__esModule", {
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
      
 3 
     | 
    
         
            +
                value: true
         
     | 
| 
      
 4 
     | 
    
         
            +
            });
         
     | 
| 
      
 5 
     | 
    
         
            +
            Object.defineProperty(exports, "renderPopoverSurface_unstable", {
         
     | 
| 
      
 6 
     | 
    
         
            +
                enumerable: true,
         
     | 
| 
      
 7 
     | 
    
         
            +
                get: ()=>renderPopoverSurface_unstable
         
     | 
| 
       5 
8 
     | 
    
         
             
            });
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
            const  
     | 
| 
       8 
     | 
    
         
            -
            const  
     | 
| 
       9 
     | 
    
         
            -
            const  
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
              
     | 
| 
       12 
     | 
    
         
            -
              
     | 
| 
       13 
     | 
    
         
            -
            const  
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
                 
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
              }
         
     | 
| 
       27 
     | 
    
         
            -
              return React.createElement(react_portal_1.Portal, {
         
     | 
| 
       28 
     | 
    
         
            -
                mountNode: state.mountNode
         
     | 
| 
       29 
     | 
    
         
            -
              }, surface);
         
     | 
| 
       30 
     | 
    
         
            -
            };
         
     | 
| 
       31 
     | 
    
         
            -
            exports.renderPopoverSurface_unstable = renderPopoverSurface_unstable;
         
     | 
| 
      
 9 
     | 
    
         
            +
            const _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
         
     | 
| 
      
 10 
     | 
    
         
            +
            const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
         
     | 
| 
      
 11 
     | 
    
         
            +
            const _extends = require("@swc/helpers/lib/_extends.js").default;
         
     | 
| 
      
 12 
     | 
    
         
            +
            const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
         
     | 
| 
      
 13 
     | 
    
         
            +
            const _reactPortal = require("@fluentui/react-portal");
         
     | 
| 
      
 14 
     | 
    
         
            +
            const _reactUtilities = require("@fluentui/react-utilities");
         
     | 
| 
      
 15 
     | 
    
         
            +
            const renderPopoverSurface_unstable = (state)=>{
         
     | 
| 
      
 16 
     | 
    
         
            +
                const { slots , slotProps  } = (0, _reactUtilities.getSlots)(state);
         
     | 
| 
      
 17 
     | 
    
         
            +
                const surface = /*#__PURE__*/ _react.createElement(slots.root, _extends({}, slotProps.root), state.withArrow && /*#__PURE__*/ _react.createElement("div", {
         
     | 
| 
      
 18 
     | 
    
         
            +
                    ref: state.arrowRef,
         
     | 
| 
      
 19 
     | 
    
         
            +
                    className: state.arrowClassName
         
     | 
| 
      
 20 
     | 
    
         
            +
                }), slotProps.root.children);
         
     | 
| 
      
 21 
     | 
    
         
            +
                if (state.inline) {
         
     | 
| 
      
 22 
     | 
    
         
            +
                    return surface;
         
     | 
| 
      
 23 
     | 
    
         
            +
                }
         
     | 
| 
      
 24 
     | 
    
         
            +
                return /*#__PURE__*/ _react.createElement(_reactPortal.Portal, {
         
     | 
| 
      
 25 
     | 
    
         
            +
                    mountNode: state.mountNode
         
     | 
| 
      
 26 
     | 
    
         
            +
                }, surface);
         
     | 
| 
      
 27 
     | 
    
         
            +
            }; //# sourceMappingURL=renderPopoverSurface.js.map
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
       32 
29 
     | 
    
         
             
            //# sourceMappingURL=renderPopoverSurface.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3," 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"sources":["../../../lib/components/PopoverSurface/renderPopoverSurface.js"],"sourcesContent":["import _extends from \"@swc/helpers/src/_extends.mjs\";\nimport * as React from 'react';\nimport { Portal } from '@fluentui/react-portal';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of PopoverSurface\n */\nexport const renderPopoverSurface_unstable = state => {\n  const {\n    slots,\n    slotProps\n  } = getSlots(state);\n  const surface = /*#__PURE__*/React.createElement(slots.root, _extends({}, slotProps.root), state.withArrow && /*#__PURE__*/React.createElement(\"div\", {\n    ref: state.arrowRef,\n    className: state.arrowClassName\n  }), slotProps.root.children);\n  if (state.inline) {\n    return surface;\n  }\n  return /*#__PURE__*/React.createElement(Portal, {\n    mountNode: state.mountNode\n  }, surface);\n};\n//# sourceMappingURL=renderPopoverSurface.js.map"],"names":["renderPopoverSurface_unstable","state","slots","slotProps","getSlots","surface","React","createElement","root","_extends","withArrow","ref","arrowRef","className","arrowClassName","children","inline","Portal","mountNode"],"mappings":";;;;+BAOaA;;aAAAA;;;;yBAPQ;6DACE;6BACA;gCACE;AAIlB,MAAMA,gCAAgCC,CAAAA,QAAS;IACpD,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,MAAMI,UAAU,WAAW,GAAEC,OAAMC,aAAa,CAACL,MAAMM,IAAI,EAAEC,SAAS,CAAC,GAAGN,UAAUK,IAAI,GAAGP,MAAMS,SAAS,IAAI,WAAW,GAAEJ,OAAMC,aAAa,CAAC,OAAO;QACpJI,KAAKV,MAAMW,QAAQ;QACnBC,WAAWZ,MAAMa,cAAc;IACjC,IAAIX,UAAUK,IAAI,CAACO,QAAQ;IAC3B,IAAId,MAAMe,MAAM,EAAE;QAChB,OAAOX;IACT,CAAC;IACD,OAAO,WAAW,GAAEC,OAAMC,aAAa,CAACU,mBAAM,EAAE;QAC9CC,WAAWjB,MAAMiB,SAAS;IAC5B,GAAGb;AACL,GACA,gDAAgD"}
         
     |