{"version":3,"file":"TourModal.CpEtXY2K.mjs","names":["React.useState","React.useRef","React.useCallback","_Fragment","_jsxs"],"sources":["https:/framerusercontent.com/modules/4PX9mAhOFvI9uhTv6Kw9/X1xdUlzAOkuPa8Zla5Ex/TourModal.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType}from\"framer\";/**\n * TourModal — opens matching links in a full-screen iframe instead of\n * navigating away.\n *\n * The trigger is an ordinary link, so if this component ever fails to load\n * every trigger still works: it just opens the tour directly.\n *\n * Renders a 1x1 marker inline; the overlay is portalled to document.body so\n * it escapes the `overflow: clip` wrappers Framer puts around sections.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n */const PAPER=\"#f2f0ee\";const BRASS=\"#c3915c\";const SANS='\"DIN 2014\", \"Inter\", system-ui, -apple-system, sans-serif';const MONO='\"Source Code Pro\", ui-monospace, SFMono-Regular, Menlo, monospace';/**\n * Title for the modal. Framer will not put `aria-label` on a text node, so\n * the useful name is usually the heading of the card the trigger sits in —\n * the trigger itself only ever says \"3D TOUR\".\n */function labelFor(a){const aria=a.getAttribute(\"aria-label\");if(aria)return aria.trim();let up=a.parentElement;for(let i=0;i<6&&up;i++){const heads=up.querySelectorAll(\"h1, h2, h3, h4\");for(let k=0;k<heads.length;k++){const t=(heads[k].textContent||\"\").trim();if(t&&t.length<80)return t;}up=up.parentElement;}const own=(a.textContent||\"\").trim();const stripped=own.replace(/^\\[\\s*/,\"\").replace(/\\s*\\]$/,\"\");return stripped&&!/^3D TOUR$/i.test(stripped)?stripped:\"Virtual tour\";}export default function TourModal(props){const{match,backdropOpacity}=props;const dim=Math.max(0,Math.min(1,Number(backdropOpacity??.8)));const[tour,setTour]=React.useState(null);const[narrow,setNarrow]=React.useState(false);const lastFocus=React.useRef(null);const closeRef=React.useRef(null);const dialogRef=React.useRef(null);const open=tour!==null;const close=React.useCallback(()=>setTour(null),[]);/* Viewport ------------------------------------------------------- */React.useEffect(()=>{if(typeof window===\"undefined\")return;const mq=window.matchMedia(\"(max-width: 700px)\");const sync=()=>setNarrow(mq.matches);sync();mq.addEventListener(\"change\",sync);return()=>mq.removeEventListener(\"change\",sync);},[]);/* Intercept clicks on matching links ------------------------------ */React.useEffect(()=>{if(typeof document===\"undefined\")return;const needle=(match||\"\").trim();if(!needle)return;const paint=()=>{const links=document.querySelectorAll(\"a[href]\");for(let i=0;i<links.length;i++){if((links[i].getAttribute(\"href\")||\"\").includes(needle)){links[i].style.cursor=\"pointer\";}}};const onClick=e=>{// let modified clicks through so \"open in new tab\" still works\nif(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0)return;const t=e.target;if(!t||typeof t.closest!==\"function\")return;const a=t.closest(\"a[href]\");if(!a)return;const href=a.getAttribute(\"href\")||\"\";if(!href.includes(needle))return;e.preventDefault();e.stopPropagation();lastFocus.current=document.activeElement;setTour({url:href,title:labelFor(a)});};paint();const late=window.setTimeout(paint,800);const obs=new MutationObserver(()=>paint());obs.observe(document.body,{childList:true,subtree:true});document.addEventListener(\"click\",onClick,true);return()=>{window.clearTimeout(late);obs.disconnect();document.removeEventListener(\"click\",onClick,true);};},[match]);/* Keys + focus trap ------------------------------------------------ */React.useEffect(()=>{if(!open||typeof document===\"undefined\")return;const onKey=e=>{if(e.key===\"Escape\"){e.preventDefault();close();return;}if(e.key!==\"Tab\")return;const box=dialogRef.current;if(!box)return;const items=Array.from(box.querySelectorAll(\"button, a[href]\")).filter(n=>n.offsetParent!==null);if(!items.length)return;const first=items[0];const last=items[items.length-1];if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus();}else if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus();}};document.addEventListener(\"keydown\",onKey);return()=>document.removeEventListener(\"keydown\",onKey);},[open,close]);/* Scroll lock ------------------------------------------------------ */React.useEffect(()=>{if(!open||typeof document===\"undefined\")return;const body=document.body;const html=document.documentElement;const pb=body.style.overflow;const ph=html.style.overflow;body.style.overflow=\"hidden\";html.style.overflow=\"hidden\";return()=>{body.style.overflow=pb;html.style.overflow=ph;};},[open]);/* Focus in, focus back --------------------------------------------- */React.useEffect(()=>{if(typeof document===\"undefined\")return;if(open){const t=window.setTimeout(()=>closeRef.current?.focus(),0);return()=>window.clearTimeout(t);}const back=lastFocus.current;if(back&&typeof back.focus===\"function\")back.focus();},[open]);if(typeof document===\"undefined\")return null;const marker=/*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1,opacity:0,pointerEvents:\"none\"},\"aria-hidden\":\"true\"});if(!open||!tour)return marker;const ctrl={display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:8,height:44,padding:\"0 16px\",borderRadius:999,border:\"1px solid rgba(242,240,238,0.22)\",background:\"rgba(29,25,13,0.55)\",color:PAPER,fontFamily:MONO,fontSize:12,letterSpacing:\"0.08em\",textDecoration:\"none\",cursor:\"pointer\",WebkitTapHighlightColor:\"transparent\"};const overlay=/*#__PURE__*/_jsxs(\"div\",{ref:dialogRef,role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":tour.title+\" virtual tour\",onClick:close,style:{position:\"fixed\",inset:0,zIndex:2147483e3,display:\"flex\",flexDirection:\"column\",gap:narrow?10:14,padding:narrow?\"12px\":\"20px 24px 24px\",background:`rgba(29,25,13,${dim})`,WebkitBackdropFilter:\"blur(8px)\",backdropFilter:\"blur(8px)\",boxSizing:\"border-box\",height:\"100vh\"},children:[/*#__PURE__*/_jsxs(\"div\",{onClick:e=>e.stopPropagation(),style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:12,flexShrink:0},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:SANS,fontSize:narrow?14:16,color:PAPER,overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\"},children:tour.title}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:10,flexShrink:0},children:[!narrow&&/*#__PURE__*/_jsx(\"a\",{href:tour.url,target:\"_blank\",rel:\"noopener noreferrer\",style:{...ctrl,color:BRASS},children:\"OPEN IN NEW TAB\"}),/*#__PURE__*/_jsx(\"button\",{ref:closeRef,type:\"button\",\"aria-label\":\"Close virtual tour\",onClick:close,style:{...ctrl,width:44,padding:0},children:/*#__PURE__*/_jsxs(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.6\",strokeLinecap:\"round\",\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"line\",{x1:\"5\",y1:\"5\",x2:\"19\",y2:\"19\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"19\",y1:\"5\",x2:\"5\",y2:\"19\"})]})})]})]}),/*#__PURE__*/_jsx(\"iframe\",{src:tour.url,title:tour.title+\" virtual tour\",onClick:e=>e.stopPropagation(),allow:\"fullscreen; xr-spatial-tracking; gyroscope; accelerometer; magnetometer; camera\",allowFullScreen:true,style:{flex:1,width:\"100%\",border:0,borderRadius:narrow?8:10,background:\"rgba(0,0,0,0.35)\",minHeight:0}},tour.url)]});return /*#__PURE__*/_jsxs(_Fragment,{children:[marker,/*#__PURE__*/createPortal(overlay,document.body)]});}TourModal.defaultProps={match:\"tour.seenic.io\",backdropOpacity:.8};addPropertyControls(TourModal,{match:{type:ControlType.String,title:\"Match\",defaultValue:\"tour.seenic.io\",description:\"Links whose href contains this open in the modal.\"},backdropOpacity:{type:ControlType.Number,title:\"Backdrop\",defaultValue:.8,min:0,max:1,step:.02,displayStepper:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TourModal\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TourModal.map"],"mappings":"+NAkBG,SAAS,EAAS,EA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