{"version":3,"file":"AccessibleFAQ.F-w8mG4w.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/P0VVnvsFbhq5MLQXdqNP/nWciydcHwKc87btrO3zL/AccessibleFAQ.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef,useState}from\"react\";// Applied only to the question row of the shared Brand FAQ accordion.\n// Framer shares this assignment between variants; read the visible +/- state.\nexport function withFAQKeyboard(Component){return /*#__PURE__*/forwardRef((props,forwardedRef)=>{const element=useRef(null);const[focused,setFocused]=useState(false);useEffect(()=>{const node=element.current;if(!node)return;const sync=()=>{const control=node.matches(\"button\")?node:node.querySelector(\"button\");if(!control)return;// Framer's motion wrapper must not become a second tab stop.\nif(node!==control&&node.tabIndex===0)node.tabIndex=-1;let wrapper=control.parentElement;for(let depth=0;wrapper&&depth<3;depth++,wrapper=wrapper.parentElement){if(wrapper.querySelectorAll(\"button\").length!==1)break;if(wrapper.tabIndex===0)wrapper.tabIndex=-1;}// The question text and +/- icon are labels, not separate controls.\n// Keep real interactive descendants untouched.\ncontrol.querySelectorAll('div[data-framer-component-type=\"RichTextContainer\"][tabindex]').forEach(label=>{if(!label.hasAttribute(\"role\")&&!label.hasAttribute(\"contenteditable\")&&Number(label.getAttribute(\"tabindex\"))>=0){label.setAttribute(\"tabindex\",\"-1\");}});const text=(control.textContent||\"\").trim();control.setAttribute(\"aria-expanded\",/[-−]$/.test(text)?\"true\":\"false\");control.setAttribute(\"aria-label\",text.replace(/\\s*[+−-]\\s*$/,\"\").trim());};sync();const observer=new MutationObserver(sync);observer.observe(node.parentElement||node,{childList:true,characterData:true,subtree:true,attributes:true,attributeFilter:[\"tabindex\"]});return()=>observer.disconnect();});const activate=event=>{if(props.onTap)props.onTap(event);else if(props.onClick)props.onClick(event);else event.currentTarget.click();};return /*#__PURE__*/_jsx(Component,{...props,ref:node=>{element.current=node;if(typeof forwardedRef===\"function\")forwardedRef(node);else if(forwardedRef)forwardedRef.current=node;},onKeyDownCapture:event=>{if(event.key===\"Enter\"||event.key===\" \"){event.preventDefault();event.stopPropagation();if(event.key===\"Enter\"&&!event.repeat)activate(event);}else props.onKeyDownCapture?.(event);},onKeyUpCapture:event=>{if(event.key===\"Enter\"||event.key===\" \"){event.preventDefault();event.stopPropagation();if(event.key===\" \")activate(event);}else props.onKeyUpCapture?.(event);},onFocus:event=>{setFocused(true);props.onFocus?.(event);},onBlur:event=>{setFocused(false);props.onBlur?.(event);},style:{...props.style,outline:focused?\"3px solid #2563EB\":props.style?.outline,outlineOffset:focused?-3:props.style?.outlineOffset}});});}// Read the rendered answer; Framer omits icon-layer names in preview.\n// Use one assignment for both variants so shared overrides cannot lie about state.\nexport function withAcquisitionFAQKeyboard(Component){return /*#__PURE__*/forwardRef((props,forwardedRef)=>{const element=useRef(null);const[focused,setFocused]=useState(false);useEffect(()=>{const root=element.current;if(!root)return;const control=root.matches(\"button\")?root:root.querySelector(\"button\");if(!control)return;const expanded=()=>{const container=control.parentElement;if(!container||container.querySelectorAll(\"button\").length!==1)return null;const view=control.ownerDocument.defaultView;if(!view)return null;const answers=Array.from(container.children).filter(node=>node!==control&&node.getAttribute(\"data-framer-component-type\")===\"RichTextContainer\"&&(node.textContent||\"\").trim().length>0);return answers.some(answer=>{if(!answer.getClientRects().length||answer.getBoundingClientRect().height<=0)return false;for(let node=answer;node;node=node.parentElement){const style=view.getComputedStyle(node);if(style.display===\"none\"||style.visibility===\"hidden\"||Number(style.opacity)===0)return false;if(node===container)break;}return true;});};const sync=()=>{if(root!==control&&root.tabIndex===0)root.tabIndex=-1;const state=expanded();if(state===null)control.removeAttribute(\"aria-expanded\");else control.setAttribute(\"aria-expanded\",state?\"true\":\"false\");control.setAttribute(\"aria-label\",(control.textContent||\"\").trim());};sync();const observer=new MutationObserver(sync);observer.observe(control.parentElement||root,{childList:true,characterData:true,subtree:true,attributes:true,attributeFilter:[\"style\",\"class\",\"hidden\",\"tabindex\"]});return()=>{observer.disconnect();};});const activate=event=>{if(props.onTap)props.onTap(event);else if(props.onClick)props.onClick(event);else event.currentTarget.click();};return /*#__PURE__*/_jsx(Component,{...props,role:\"button\",tabIndex:0,ref:node=>{element.current=node;if(typeof forwardedRef===\"function\")forwardedRef(node);else if(forwardedRef)forwardedRef.current=node;},onKeyDownCapture:event=>{if(event.key===\"Enter\"||event.key===\" \"){event.preventDefault();event.stopPropagation();if(event.key===\"Enter\"&&!event.repeat)activate(event);}else props.onKeyDownCapture?.(event);},onKeyUpCapture:event=>{if(event.key===\"Enter\"||event.key===\" \"){event.preventDefault();event.stopPropagation();if(event.key===\" \")activate(event);}else props.onKeyUpCapture?.(event);},onFocus:event=>{setFocused(true);props.onFocus?.(event);},onBlur:event=>{setFocused(false);props.onBlur?.(event);},style:{...props.style,outline:focused?\"3px solid #2563EB\":props.style?.outline,outlineOffset:focused?-3:props.style?.outlineOffset}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withAcquisitionFAQKeyboard\":{\"type\":\"reactHoc\",\"name\":\"withAcquisitionFAQKeyboard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFAQKeyboard\":{\"type\":\"reactHoc\",\"name\":\"withFAQKeyboard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AccessibleFAQ.map"],"mappings":"uIAEA,SAAgB,EAAgB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAe,CAAC,IAAM,EAAQA,EAAO,IAAI,EAAO,CAAC,EAAQ,GAAYC,EAAS,EAAK,EAAE,MAAc,CAAC,IAAM,EAAK,EAAQ,QAAQ,GAAG,CAAC,EAAK,OAAO,IAAM,MAAS,CAAC,IAAM,EAAQ,EAAK,QAAQ,QAAQ,EAAE,EAAK,EAAK,cAAc,QAAQ,EAAE,GAAG,CAAC,EAAQ,OAChU,IAAO,GAAS,EAAK,WAAW,IAAE,EAAK,SAAS,IAAG,IAAI,EAAQ,EAAQ,cAAc,IAAI,I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