{"version":3,"file":"FocusTrap.B_e-b_GL.mjs","names":["Phosphor","React.useContext","React.useMemo","React.Fragment","useRef","React.useId","useRef","_Fragment","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/hxJcfZa68nxebtmUW1NI/h7rd48uk42jenRZSBrGA/oJMyYBl80.js","https:/framerusercontent.com/modules/msg8q6T7ckRXmQtw0pvc/PETbW1SSkhc6Zc0L6zA4/FocusTrap.js"],"sourcesContent":["// Generated by Framer (7c2f7bf)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addFonts,addPropertyControls,ComponentViewportProvider,ControlType,cx,getFonts,SmartComponentScopedContainer,useActiveVariantCallback,useComponentViewport,useLocaleInfo,useVariantState,withCSS}from\"framer\";import{LayoutGroup,motion,MotionConfigContext}from\"framer-motion\";import*as React from\"react\";import{useRef}from\"react\";import{Icon as Phosphor}from\"https://framerusercontent.com/modules/tYScH7LTqUtz5KUaUAYP/p8dptk4UIND8hbFWz9V7/Phosphor.js\";const PhosphorFonts=getFonts(Phosphor);const enabledGestures={ica5mwMM1:{hover:true}};const serializationHash=\"framer-o56PD\";const variantClassNames={ica5mwMM1:\"framer-v-14dni72\"};function addPropertyOverrides(overrides,...variants){const nextOverrides={};variants?.forEach(variant=>variant&&Object.assign(nextOverrides,overrides[variant]));return nextOverrides;}const UL2LZLyOk=undefined;const Evuv90BeA=undefined;const PBYrF605j=undefined;const a6vQmLKOa=undefined;const transition1={delay:0,duration:.2,ease:[.44,0,.56,1],type:\"tween\"};const Transition=({value,children})=>{const config=React.useContext(MotionConfigContext);const transition=value??config.transition;const contextValue=React.useMemo(()=>({...config,transition}),[JSON.stringify(transition)]);return /*#__PURE__*/_jsx(MotionConfigContext.Provider,{value:contextValue,children:children});};const Variants=motion.create(React.Fragment);const getProps=({backgroundColour,click,height,hoverColour,iconColour,id,width,...props})=>{return{...props,a6vQmLKOa:iconColour??props.a6vQmLKOa??\"var(--token-0ef30a2a-b613-421f-995f-c517c770cb33, rgb(135, 143, 154))\",Evuv90BeA:click??props.Evuv90BeA,PBYrF605j:hoverColour??props.PBYrF605j??\"var(--token-743a2b81-d38b-472c-9bcd-547c368f8d0d, rgb(245, 245, 245))\",UL2LZLyOk:backgroundColour??props.UL2LZLyOk??\"rgba(245, 245, 245, 0)\"};};const createLayoutDependency=(props,variants)=>{if(props.layoutDependency)return variants.join(\"-\")+props.layoutDependency;return variants.join(\"-\");};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const fallbackRef=useRef(null);const refBinding=ref??fallbackRef;const defaultLayoutId=React.useId();const{activeLocale,setLocale}=useLocaleInfo();const componentViewport=useComponentViewport();const{style,className,layoutId,variant,Evuv90BeA,a6vQmLKOa,UL2LZLyOk,PBYrF605j,...restProps}=getProps(props);const{baseVariant,classNames,clearLoadingGesture,gestureHandlers,gestureVariant,isLoading,setGestureState,setVariant,variants}=useVariantState({defaultVariant:\"ica5mwMM1\",enabledGestures,ref:refBinding,variant,variantClassNames});const layoutDependency=createLayoutDependency(props,variants);const{activeVariantCallback,delay}=useActiveVariantCallback(baseVariant);const onTapmx2m1n=activeVariantCallback(async(...args)=>{setGestureState({isPressed:false});if(Evuv90BeA){const res=await Evuv90BeA(...args);if(res===false)return false;}});const sharedStyleClassNames=[];const scopingClassNames=cx(serializationHash,...sharedStyleClassNames);return /*#__PURE__*/_jsx(LayoutGroup,{id:layoutId??defaultLayoutId,children:/*#__PURE__*/_jsx(Variants,{animate:variants,initial:false,children:/*#__PURE__*/_jsx(Transition,{value:transition1,children:/*#__PURE__*/_jsx(motion.button,{...restProps,...gestureHandlers,\"aria-label\":\"Close modal\",className:cx(scopingClassNames,\"framer-14dni72\",className,classNames),\"data-framer-name\":\"Variant 1\",\"data-highlight\":true,\"data-reset\":\"button\",layoutDependency:layoutDependency,layoutId:\"ica5mwMM1\",onTap:onTapmx2m1n,ref:refBinding,style:{backdropFilter:\"blur(4px)\",backgroundColor:UL2LZLyOk,borderBottomLeftRadius:999,borderBottomRightRadius:999,borderTopLeftRadius:999,borderTopRightRadius:999,WebkitBackdropFilter:\"blur(4px)\",...style},tabIndex:0,variants:{\"ica5mwMM1-hover\":{backgroundColor:PBYrF605j}},...addPropertyOverrides({\"ica5mwMM1-hover\":{\"data-framer-name\":undefined}},baseVariant,gestureVariant),children:/*#__PURE__*/_jsx(ComponentViewportProvider,{children:/*#__PURE__*/_jsx(SmartComponentScopedContainer,{className:\"framer-1je30v6-container\",isAuthoredByUser:true,isModuleExternal:true,layoutDependency:layoutDependency,layoutId:\"vqZ0R1Phf-container\",nodeId:\"vqZ0R1Phf\",rendersWithMotion:true,scopeId:\"oJMyYBl80\",children:/*#__PURE__*/_jsx(Phosphor,{color:a6vQmLKOa,height:\"100%\",iconSearch:\"House\",iconSelection:\"X\",id:\"vqZ0R1Phf\",layoutId:\"vqZ0R1Phf\",mirrored:false,selectByList:true,style:{height:\"100%\",width:\"100%\"},weight:\"bold\",width:\"100%\"})})})})})})});});const css=[\"@supports (aspect-ratio: 1) { body { --framer-aspect-ratio-supported: auto; } }\",\".framer-o56PD.framer-132y6tl, .framer-o56PD .framer-132y6tl { display: block; }\",\".framer-o56PD.framer-14dni72 { align-content: center; align-items: center; cursor: pointer; display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; height: min-content; justify-content: center; overflow: hidden; padding: 8px; position: relative; width: min-content; will-change: var(--framer-will-change-override, transform); }\",\".framer-o56PD .framer-1je30v6-container { flex: none; height: 20px; position: relative; width: 20px; }\"];/**\n * This is a generated Framer component.\n * @framerIntrinsicHeight 36\n * @framerIntrinsicWidth 36\n * @framerCanvasComponentVariantDetails {\"propertyName\":\"variant\",\"data\":{\"default\":{\"layout\":[\"auto\",\"auto\"]},\"lQzgJHOZt\":{\"layout\":[\"auto\",\"auto\"]}}}\n * @framerVariables {\"Evuv90BeA\":\"click\",\"a6vQmLKOa\":\"iconColour\",\"UL2LZLyOk\":\"backgroundColour\",\"PBYrF605j\":\"hoverColour\"}\n * @framerImmutableVariables true\n * @framerDisplayContentsDiv false\n * @framerAutoSizeImages true\n * @framerComponentViewportWidth true\n * @framerColorSyntax true\n */const FrameroJMyYBl80=withCSS(Component,css,\"framer-o56PD\");export default FrameroJMyYBl80;FrameroJMyYBl80.displayName=\"Button/Close\";FrameroJMyYBl80.defaultProps={height:36,width:36};addPropertyControls(FrameroJMyYBl80,{Evuv90BeA:{title:\"Click\",type:ControlType.EventHandler},a6vQmLKOa:{defaultValue:'var(--token-0ef30a2a-b613-421f-995f-c517c770cb33, rgb(135, 143, 154)) /* {\"name\":\"Grey 50\"} */',title:\"Icon colour\",type:ControlType.Color},UL2LZLyOk:{defaultValue:\"rgba(245, 245, 245, 0)\",title:\"Background colour\",type:ControlType.Color},PBYrF605j:{defaultValue:'var(--token-743a2b81-d38b-472c-9bcd-547c368f8d0d, rgb(245, 245, 245)) /* {\"name\":\"Grey 10\"} */',title:\"Hover colour\",type:ControlType.Color}});addFonts(FrameroJMyYBl80,[{explicitInter:true,fonts:[]},...PhosphorFonts],{supportsExplicitInterCodegen:true});\nexport const __FramerMetadata__ = {\"exports\":{\"Props\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"FrameroJMyYBl80\",\"slots\":[],\"annotations\":{\"framerCanvasComponentVariantDetails\":\"{\\\"propertyName\\\":\\\"variant\\\",\\\"data\\\":{\\\"default\\\":{\\\"layout\\\":[\\\"auto\\\",\\\"auto\\\"]},\\\"lQzgJHOZt\\\":{\\\"layout\\\":[\\\"auto\\\",\\\"auto\\\"]}}}\",\"framerAutoSizeImages\":\"true\",\"framerDisplayContentsDiv\":\"false\",\"framerImmutableVariables\":\"true\",\"framerVariables\":\"{\\\"Evuv90BeA\\\":\\\"click\\\",\\\"a6vQmLKOa\\\":\\\"iconColour\\\",\\\"UL2LZLyOk\\\":\\\"backgroundColour\\\",\\\"PBYrF605j\\\":\\\"hoverColour\\\"}\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"36\",\"framerIntrinsicHeight\":\"36\",\"framerComponentViewportWidth\":\"true\",\"framerColorSyntax\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./oJMyYBl80.map","import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";let previouslyFocused=null;export function useFocusTrap(visible){const ref=useRef(null);const startTrap=useRef(null);const endTrap=useRef(null);useEffect(()=>{if(!visible||!ref.current)return;previouslyFocused=document.activeElement;const container=ref.current;const focusable=Array.from(container.querySelectorAll(\"a[href], area[href], input:not([disabled]), select:not([disabled]), \"+\"textarea:not([disabled]), button:not([disabled]), iframe, object, embed, \"+'[tabindex]:not([tabindex=\"-1\"]), [contenteditable]')).filter(el=>!el.hasAttribute(\"disabled\")&&!el.getAttribute(\"aria-hidden\"));if(focusable.length>0){focusable[0].focus();}const handleTrapFocus=e=>{if(!container.contains(e.target)){// If focus somehow escaped, bring it back\nif(focusable.length>0)focusable[0].focus();}};document.addEventListener(\"focus\",handleTrapFocus,true);return()=>{document.removeEventListener(\"focus\",handleTrapFocus,true);if(previouslyFocused)previouslyFocused.focus();};},[visible]);return{ref,children:/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{ref:startTrap,tabIndex:0,style:{width:0,height:0,overflow:\"hidden\",position:\"absolute\"},onFocus:()=>{const focusable=ref.current?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])');if(focusable&&focusable.length>0){focusable[focusable.length-1].focus();}}}),/*#__PURE__*/_jsx(\"div\",{ref:ref}),/*#__PURE__*/_jsx(\"div\",{ref:endTrap,tabIndex:0,style:{width:0,height:0,overflow:\"hidden\",position:\"absolute\"},onFocus:()=>{const focusable=ref.current?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])');if(focusable&&focusable.length>0){focusable[0].focus();}}})]})};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withuseFocusTrap(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...useFocusTrap(props)});};}withuseFocusTrap.displayName=\"useFocusTrap\";\nexport const __FramerMetadata__ = {\"exports\":{\"withuseFocusTrap\":{\"type\":\"reactHoc\",\"name\":\"withuseFocusTrap\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useFocusTrap\":{\"type\":\"override\",\"name\":\"useFocusTrap\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FocusTrap.map"],"mappings":"kaACsqB,SAAS,EAAqB,EAAU,GAAG,EAAS,CAAC,IAAM,EAAc,EAAE,CAAsF,OAArF,GAAU,QAAQ,GAAS,GAAS,OAAO,OAAO,EAAc,EAAU,GAAS,CAAC,CAAQ,yCAAnyB,IAAqN,IAAkE,IAA4B,IAAoJ,CAAM,EAAc,EAASA,EAAS,CAAO,EAAgB,CAAC,UAAU,CAAC,MAAM,GAAK,CAAC,CAAO,EAAkB,eAAqB,EAAkB,CAAC,UAAU,mBAAmB,CAAsS,EAAY,CAAC,MAAM,EAAE,SAAS,GAAG,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,KAAK,QAAQ,CAAO,GAAY,CAAC,QAAM,cAAY,CAAC,IAAM,EAAOC,EAAiB,EAAoB,CAAO,EAAW,GAAO,EAAO,WAAiB,EAAaC,OAAmB,CAAC,GAAG,EAAO,aAAW,EAAE,CAAC,KAAK,UAAU,EAAW,CAAC,CAAC,CAAC,OAAoB,EAAK,EAAoB,SAAS,CAAC,MAAM,EAAsB,WAAS,CAAC,EAAS,EAAS,EAAO,OAAOC,EAAe,CAAO,GAAU,CAAC,mBAAiB,QAAM,SAAO,cAAY,aAAW,KAAG,QAAM,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAY,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