{"version":3,"file":"StickyBookBar.BNLxtCei.mjs","names":["useState","__esmMin","init_ssg_sandbox_shims","window","_e","init_jsx_runtime","c","init_npm_react_18_3_1","ce","RenderTarget","addPropertyControls","ControlType","init_framer_DKtAEkcX","StickyBookBar","props","inCanvas","visible","setVisible","mq","frame","update","y","vh","doc","pastHero","showAfter","nearEnd","hideNearBottom","overlay","menuOpen","active","typing","schedule","observer","shown","label","textColor","accent","init_StickyBookBar"],"sources":["https:/framerusercontent.com/modules/43B3PLoT6lsm7StuDXQC/rszxeDb21G7xTpQ5vIBA/StickyBookBar.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Slim phone-only booking bar. Stays hidden until the visitor scrolls past\n * the first screen, hides while the mobile menu is open, near the footer,\n * and while a form field has focus. Place it on a fixed-position layer that\n * is visible on the Phone breakpoint only.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function StickyBookBar(props){const{label=\"BOOK A TATTOO\",href=\"/book\",showAfter=.9,hideNearBottom=700,background=\"#12110F\",textColor=\"#F3F0E6\",accent=\"#9B7336\"}=props;const inCanvas=RenderTarget.current()===RenderTarget.canvas;const[visible,setVisible]=useState(false);useEffect(()=>{if(typeof window===\"undefined\"||inCanvas)return;const mq=window.matchMedia(\"(max-width: 809.98px)\");let frame=0;const update=()=>{frame=0;const y=window.scrollY||document.documentElement.scrollTop||0;const vh=window.innerHeight||0;const doc=Math.max(document.documentElement.scrollHeight,document.body?document.body.scrollHeight:0);const pastHero=y>vh*showAfter;const nearEnd=doc-(y+vh)<hideNearBottom;const overlay=document.getElementById(\"overlay\");const menuOpen=!!overlay&&overlay.childElementCount>0;const active=document.activeElement;const typing=!!active&&/^(INPUT|TEXTAREA|SELECT)$/.test(active.tagName);setVisible(mq.matches&&pastHero&&!nearEnd&&!menuOpen&&!typing);};const schedule=()=>{if(!frame)frame=window.requestAnimationFrame(update);};update();window.addEventListener(\"scroll\",schedule,{passive:true});window.addEventListener(\"resize\",schedule);document.addEventListener(\"focusin\",schedule);document.addEventListener(\"focusout\",schedule);mq.addEventListener(\"change\",schedule);let observer;const overlay=document.getElementById(\"overlay\");if(overlay&&typeof MutationObserver!==\"undefined\"){observer=new MutationObserver(schedule);observer.observe(overlay,{childList:true});}return()=>{if(frame)window.cancelAnimationFrame(frame);window.removeEventListener(\"scroll\",schedule);window.removeEventListener(\"resize\",schedule);document.removeEventListener(\"focusin\",schedule);document.removeEventListener(\"focusout\",schedule);mq.removeEventListener(\"change\",schedule);if(observer)observer.disconnect();};},[showAfter,hideNearBottom,inCanvas]);const shown=inCanvas||visible;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"flex-end\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"a\",{href:href,\"aria-label\":label,tabIndex:shown?0:-1,\"aria-hidden\":shown?undefined:true,style:{pointerEvents:shown?\"auto\":\"none\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxSizing:\"border-box\",width:\"100%\",minHeight:52,paddingBottom:\"env(safe-area-inset-bottom, 0px)\",background,color:textColor,borderTop:`1px solid ${accent}`,fontFamily:'\"Bebas Neue\", \"Inter\", sans-serif',fontSize:16,letterSpacing:\"0.14em\",lineHeight:1,textDecoration:\"none\",opacity:shown?1:0,transform:shown?\"translateY(0)\":\"translateY(100%)\",visibility:shown?\"visible\":\"hidden\",transition:shown?\"opacity 220ms ease, transform 220ms ease\":\"opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms\",WebkitTapHighlightColor:\"transparent\"},children:label})});}addPropertyControls(StickyBookBar,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"BOOK A TATTOO\"},href:{type:ControlType.String,title:\"Link\",defaultValue:\"/book\"},showAfter:{type:ControlType.Number,title:\"Show After\",defaultValue:.9,min:.2,max:3,step:.1,description:\"Screens scrolled before the bar appears.\"},hideNearBottom:{type:ControlType.Number,title:\"Hide Near End\",defaultValue:700,min:0,max:1600,step:10,unit:\"px\",description:\"Hides the bar this close to the page end (footer).\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#12110F\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#F3F0E6\"},accent:{type:ControlType.Color,title:\"Rule\",defaultValue:\"#9B7336\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StickyBookBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StickyBookBar.map"],"mappings":"A,uMAQG,SAAwBa,EAAc,EAAM,CAAC,GAAK,CAAC,QAAM,gBAAgB,OAAK,QAAQ,YAAU,GAAG,iBAAe,IAAI,aAAW,UAAU,YAAU,UAAU,SAAO,WAAWC,EAAYC,EAASN,EAAa,QAAQ,IAAIA,EAAa,OAAY,CAACO,EAAQC,GAAYjB,EAAS,EAAK,EAAEQ,MAAc,CAAC,GAAUL,IAAS,QAAaY,EAAS,OAAO,IAAMG,EAAGf,EAAO,WAAW,uBAAuB,EAAMgB,EAAM,EAAQC,MAAW,CAAC,EAAM,EAAE,IAAMC,EAAElB,EAAO,SAAS,SAAS,gBAAgB,WAAW,EAAQmB,EAAGnB,EAAO,aAAa,EAAQoB,EAAI,KAAK,IAAI,SAAS,gBAAgB,aAAa,SAAS,KAAK,SAAS,KAAK,aAAa,CAAC,EAAQC,EAASH,EAAEC,EAAGG,EAAgBC,EAAQH,GAAKF,EAAEC,GAAIK,EAAqBC,EAAQ,SAAS,eAAe,SAAS,EAAQC,EAAS,CAAC,CAACD,GAASA,EAAQ,kBAAkB,EAAQE,EAAO,SAAS,cAAoBC,EAAO,CAAC,CAACD,GAAQ,4BAA4B,KAAKA,EAAO,OAAO,EAAEb,EAA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