{"version":3,"file":"SiteExtras.DMdNCLY4.mjs","names":["React.useState","React.useRef","React.useMemo","__esmMin","init_ssg_sandbox_shims","_e","pe","c","J","init_jsx_runtime","ce","init_npm_react_18_3_1","de","window","mergeRefs","a","b","node","withCollapseWhenHidden","gen","setGen","boxRef","setRef","ref","el","expanded","heightAtClick","visible","onClick","io","e","entries","h","wasAbove","g","now","Component","props","ensureCss","STYLE_ID","CSS","withHidePlaceholderOnFocus","init_SiteExtras"],"sources":["https:/framerusercontent.com/modules/FWrGSsQsN3a678sEjsWL/3X3KEEtLngcQAIVKCKr0/SiteExtras.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{forwardRef}from\"react\";// Small site helpers\n// ------------------\n// withCollapseWhenHidden\n//   Put on the layer that holds the show dates list (+ its \"More dates\"\n//   button). After \"More dates\" has been clicked and the list has grown,\n//   the list goes back to the short version as soon as it scrolls out\n//   of sight.\n//\n// withHidePlaceholderOnFocus\n//   Put on the booking form. The grey example text in a box disappears\n//   as soon as that box is clicked into (before typing), and comes back\n//   if the box is left empty.\nfunction mergeRefs(a,b){return node=>{for(const r of[a,b]){if(typeof r===\"function\")r(node);else if(r)r.current=node;}};}export function withCollapseWhenHidden(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[gen,setGen]=React.useState(0);const boxRef=React.useRef(null);const setRef=React.useMemo(()=>mergeRefs(ref,boxRef),[ref]);React.useEffect(()=>{const el=boxRef.current;if(!el||typeof IntersectionObserver===\"undefined\")return;let expanded=false;let heightAtClick=0;let visible=true;const onClick=()=>{if(!expanded)heightAtClick=el.offsetHeight;expanded=true;};el.addEventListener(\"click\",onClick,true);const io=new IntersectionObserver(entries=>{const e=entries[entries.length-1];visible=e.isIntersecting;if(visible||!expanded)return;const h=el.offsetHeight;if(h<=heightAtClick+2)return;// The list is out of sight and was made longer: shrink it.\nconst wasAbove=e.boundingClientRect.bottom<=0;setGen(g=>g+1);if(wasAbove){// Keep the page from jumping when the list above us\n// gets shorter.\nrequestAnimationFrame(()=>requestAnimationFrame(()=>{const now=boxRef.current;if(!now)return;window.scrollBy(0,now.offsetHeight-h);}));}});io.observe(el);return()=>{io.disconnect();el.removeEventListener(\"click\",onClick,true);};},[gen]);return /*#__PURE__*/_jsx(Component,{...props,ref:setRef},gen);});}const STYLE_ID=\"hide-placeholder-on-focus-css\";const CSS=[\"input:focus::placeholder, textarea:focus::placeholder { color: transparent !important; opacity: 0 !important; }\",\"input:focus::-webkit-input-placeholder, textarea:focus::-webkit-input-placeholder { color: transparent !important; opacity: 0 !important; }\"].join(\"\\n\");function ensureCss(){if(typeof document===\"undefined\")return;let el=document.getElementById(STYLE_ID);if(!el){el=document.createElement(\"style\");el.id=STYLE_ID;document.head.appendChild(el);}if(el.textContent!==CSS)el.textContent=CSS;}export function withHidePlaceholderOnFocus(Component){return /*#__PURE__*/forwardRef((props,ref)=>{React.useEffect(()=>{ensureCss();},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withCollapseWhenHidden\":{\"type\":\"reactHoc\",\"name\":\"withCollapseWhenHidden\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHidePlaceholderOnFocus\":{\"type\":\"reactHoc\",\"name\":\"withHidePlaceholderOnFocus\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SiteExtras.map"],"mappings":"A,4JAYA,SAASc,EAAU,EAAE,EAAE,CAAC,MAAO,IAAM,CAAC,IAAI,IAAM,IAAI,CAACC,EAAEC,CAAC,EAAM,OAAO,GAAI,WAAW,EAAEC,CAAI,EAAU,IAAE,EAAE,QAAQA,EAAM,CAAE,CAAC,SAAgBC,EAAuB,EAAU,CAAC,MAAoB,iBAAY,EAAM,IAAM,CAAC,GAAK,CAACC,EAAIC,GAAQpB,EAAe,CAAC,EAAQqB,EAAOpB,EAAa,IAAI,EAAQqB,EAAOpB,MAAk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