{"version":3,"file":"ModalScrollFix.CAvo_2yR.mjs","names":["React.forwardRef","useRef"],"sources":["https:/framerusercontent.com/modules/wbL0GysLpUpZOLelXsKU/7IhRlKXIvqCTv7OUjGRe/q95pf4lLL.js","https:/framerusercontent.com/modules/v6W1exbEi28LLduEJJUf/e7rnFH6y6zLCZQxoo0HM/ModalScrollFix.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 1.5 16.5 C 0.672 16.5 0 15.828 0 15 L 0 1.5 C 0 0.672 0.672 0 1.5 0 L 15 0 C 15.828 0 16.5 0.672 16.5 1.5 L 16.5 15 C 16.5 15.828 15.828 16.5 15 16.5 Z\" fill-opacity=\"var(--1m6trwb, 0)\" fill=\"var(--21h8s6, rgb(0, 0, 0))\" height=\"16.5px\" id=\"LjE0Ycn76\" transform=\"translate(3.75 3.75)\" width=\"16.5px\"/><path d=\"M 13.5 0 L 0 13.5\" fill=\"var(--21h8s6, rgb(0, 0, 0))\" height=\"13.5px\" id=\"oSDwjLCvX\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(5.25 5.25)\" width=\"13.5px\"/><path d=\"M 13.5 13.5 L 0 0\" fill=\"var(--21h8s6, rgb(0, 0, 0))\" height=\"13.5px\" id=\"H9XwXWiXU\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(5.25 5.25)\" width=\"13.5px\"/></svg>';const getProps=({alpha,color,height,id,width,width1,...props})=>{return{...props,ezTt3ayMo:color??props.ezTt3ayMo??\"rgb(0, 0, 0)\",lschgej4H:width1??props.lschgej4H??1.5,qxTvv_EBh:alpha??props.qxTvv_EBh};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,ezTt3ayMo,lschgej4H,qxTvv_EBh,...restProps}=getProps(props);const href=useSVGTemplate(\"2202960551\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-AhL2C\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m6trwb\":qxTvv_EBh,\"--21h8s6\":ezTt3ayMo,\"--pgex8v\":lschgej4H,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-AhL2C { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"ezTt3ayMo\":\"color\",\"lschgej4H\":\"width1\",\"qxTvv_EBh\":\"alpha\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"X\",\"color\":{\"type\":\"variable\",\"value\":\"21h8s6\"},\"set\":{\"localId\":\"vectorSet/NGVKdicsm\",\"id\":\"NGVKdicsm\",\"moduleId\":\"omX0gWFPqDwhaiWwf6ab\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-AhL2C\");Icon.displayName=\"X\";export default Icon;addPropertyControls(Icon,{ezTt3ayMo:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},lschgej4H:{defaultValue:1.5,displayStepper:true,hidden:false,max:6,min:0,step:.5,title:\"Width\",type:ControlType.Number},qxTvv_EBh:{defaultValue:0,displayStepper:true,hidden:false,max:1,min:0,step:.1,title:\"Alpha\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerImmutableVariables\":\"true\",\"framerDisableUnlink\":\"true\",\"framerVector\":\"{\\\"name\\\":\\\"X\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"21h8s6\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/NGVKdicsm\\\",\\\"id\\\":\\\"NGVKdicsm\\\",\\\"moduleId\\\":\\\"omX0gWFPqDwhaiWwf6ab\\\"}}\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"24\",\"framerIntrinsicHeight\":\"24\",\"framerContractVersion\":\"1\",\"framerVariables\":\"{\\\"ezTt3ayMo\\\":\\\"color\\\",\\\"lschgej4H\\\":\\\"width1\\\",\\\"qxTvv_EBh\\\":\\\"alpha\\\"}\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef}from\"react\";/**\n * Modal helper (Ask modal, photo lightbox). Place one inside the scrollable modal card.\n * - Marks the modal's scroll layers with data-lenis-prevent so wheel and\n *   trackpad scrolling reach the modal while Lenis smooth scroll runs.\n * - Stops scroll chaining to the page behind (overscroll-behavior: contain).\n * - Gives the card role=\"dialog\" and aria-modal, moves focus into it,\n *   keeps Tab inside it, closes on Escape (by pressing the button labelled\n *   \"Close\") and returns focus to the button that opened it. Keys pressed inside\n *   a picker or sheet opened from the modal (rendered outside the card) are left to it.\n * - Hides the site chat bubble while the modal is open, so it never covers Send.\n * Renders an invisible 1px box.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */const CHAT_SELECTORS=\"chat-widget, #lc_text-widget, .lc_text-widget, [id^='lc_text-widget'], [class*='lc_text-widget']\";const FOCUSABLE=\"a[href], button:not([disabled]), input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])\";export default function ModalScrollFix(props){const ref=useRef(null);const label=props.label||\"Ask about this space\";useEffect(()=>{if(typeof window===\"undefined\"||!ref.current)return;let card=null;let root=null;let el=ref.current.parentElement;while(el&&el!==document.body){const cs=window.getComputedStyle(el);if(/(auto|scroll)/.test(cs.overflowY)){el.setAttribute(\"data-lenis-prevent\",\"\");el.style.overscrollBehavior=\"contain\";if(!card)card=el;}if(cs.position===\"fixed\"){el.setAttribute(\"data-lenis-prevent\",\"\");if(!root)root=el;}el=el.parentElement;}const shown=()=>!!root&&root.getClientRects().length>0;if(card){card.setAttribute(\"role\",\"dialog\");card.setAttribute(\"aria-modal\",\"true\");card.setAttribute(\"aria-label\",label);if(!card.hasAttribute(\"tabindex\"))card.setAttribute(\"tabindex\",\"-1\");}const style=document.createElement(\"style\");style.setAttribute(\"data-ask-modal\",\"\");style.textContent=CHAT_SELECTORS+\" { display: none !important; }\";document.head.appendChild(style);const opener=document.activeElement;const focusTimer=window.setTimeout(()=>{if(shown()&&card)card.focus({preventScroll:true});},60);const fireClose=btn=>{const opts={bubbles:true,cancelable:true,isPrimary:true,button:0,pointerId:1,pointerType:\"mouse\"};try{btn.dispatchEvent(new PointerEvent(\"pointerdown\",opts));btn.dispatchEvent(new PointerEvent(\"pointerup\",opts));}catch(e){}btn.click();};// a11y (2.1.1): one Escape must close the dialog. If the overlay is still up 150ms later, press\n// Close once more; while a close is in flight, extra Escapes are swallowed so they cannot reach\n// anything behind the dialog.\nlet closing=false;const timers=[];const pressClose=()=>{if(!root||closing)return;const btn=root.querySelector(\"[aria-label='Close']\");if(!btn)return;closing=true;fireClose(btn);timers.push(window.setTimeout(()=>{if(shown()&&root){const again=root.querySelector(\"[aria-label='Close']\");if(again)fireClose(again);}},150));timers.push(window.setTimeout(()=>{closing=false;},450));};const onKey=e=>{if(closing&&e.key===\"Escape\"){e.preventDefault();return;}if(!shown()||!card)return;if(e.defaultPrevented)return;// A picker, popover or sheet opened from inside this modal (e.g. the Where picker) is\n// rendered outside the card. Let it handle its own keys (Esc, Tab).\nconst t=e.target;const inner=t&&typeof t.closest===\"function\"?t.closest(\"[role='dialog'], [role='listbox']\"):null;if(inner&&inner!==card&&!card.contains(inner))return;if(e.key===\"Escape\"){e.preventDefault();pressClose();return;}if(e.key!==\"Tab\")return;const items=Array.from(card.querySelectorAll(FOCUSABLE)).filter(n=>n.getClientRects().length>0);if(!items.length)return;const first=items[0];const last=items[items.length-1];const active=document.activeElement;if(!active||!card.contains(active)){e.preventDefault();first.focus();}else if(e.shiftKey&&(active===first||active===card)){e.preventDefault();last.focus();}else if(!e.shiftKey&&active===last){e.preventDefault();first.focus();}};document.addEventListener(\"keydown\",onKey);return()=>{window.clearTimeout(focusTimer);timers.forEach(t=>window.clearTimeout(t));document.removeEventListener(\"keydown\",onKey);style.remove();if(opener&&document.contains(opener)&&typeof opener.focus===\"function\"){try{opener.focus({preventScroll:true});}catch(e){}}};},[label]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,\"aria-hidden\":\"true\",style:{position:\"relative\",width:1,height:1,pointerEvents:\"none\",...props.style}});}addPropertyControls(ModalScrollFix,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Ask about this space\",description:\"What screen readers call the dialog.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ModalScrollFix\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1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