{"version":3,"file":"Once_Only_Promo_Popup.CPU92sJZ.mjs","names":["useState","useRef","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/Z18JNHqsIAGRfw2R43tW/V962VthFGR8EfzA00VwQ/Once_Only_Promo_Popup.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useCallback,useEffect,useMemo,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function OnceOnlyPromoPopup(props){const{storageKey,headline,offerNight,offerWeek,dateRange,note,image={src:\"https://assets.buckysolutions.com/clients/bryn-mawr-ocean-resort/bryn-mawr-email-insert.png\",alt:\"Bryn Mawr Ocean Resort limited-time stay offer\"},showImage,phone,email,website,cTALabel,cTALink,delayMs,ctaLabel,ctaHref,accentRed,accentYellow,cardRadius,showDelayMs,previewInEditor=true}=props;const isStaticRenderer=useIsStaticRenderer();const[isVisible,setIsVisible]=useState(false);const timeoutRef=useRef(null);const resolvedCtaLabel=cTALabel??ctaLabel??\"Reserve your spot today\";const resolvedCtaHref=cTALink??ctaHref??\"tel:9044713353\";const resolvedDelayMs=delayMs??showDelayMs??0;const shouldPersistSeen=!isStaticRenderer;const isSquare=cardRadius===0;const ctaRadius=isSquare?0:14;const imageRadius=isSquare?0:Math.max(10,cardRadius-8);const markSeen=useCallback(()=>{if(typeof window!==\"undefined\"){try{window.localStorage.setItem(storageKey,Date.now().toString());}catch{// Ignore storage failures\n}}},[storageKey]);const dismiss=useCallback(()=>{if(shouldPersistSeen)markSeen();startTransition(()=>setIsVisible(false));},[markSeen,shouldPersistSeen]);useEffect(()=>{if(typeof window===\"undefined\")return;if(isStaticRenderer){if(previewInEditor){const delay=Math.max(0,resolvedDelayMs);timeoutRef.current=window.setTimeout(()=>{startTransition(()=>setIsVisible(true));},delay);}else{startTransition(()=>setIsVisible(false));}return()=>{if(typeof window!==\"undefined\"&&timeoutRef.current!==null){window.clearTimeout(timeoutRef.current);}};}let hasSeen=false;try{// UPDATE: Check if 3 hours (10,800,000 ms) have passed\nconst storedValue=window.localStorage.getItem(storageKey);if(storedValue){const lastSeenTime=parseInt(storedValue,10);const threeHoursInMs=3*60*60*1e3// 3 hours\n;if(!isNaN(lastSeenTime)&&Date.now()-lastSeenTime<threeHoursInMs){hasSeen=true// Less than 3 hours have passed, keep hidden\n;}}}catch{hasSeen=false;}if(!hasSeen){const delay=Math.max(0,resolvedDelayMs);timeoutRef.current=window.setTimeout(()=>{startTransition(()=>setIsVisible(true));},delay);}return()=>{if(typeof window!==\"undefined\"&&timeoutRef.current!==null){window.clearTimeout(timeoutRef.current);}};},[isStaticRenderer,previewInEditor,resolvedDelayMs,storageKey]);useEffect(()=>{if(!isVisible||typeof window===\"undefined\")return;const onKeyDown=event=>{if(event.key===\"Escape\")dismiss();};window.addEventListener(\"keydown\",onKeyDown);return()=>window.removeEventListener(\"keydown\",onKeyDown);},[dismiss,isVisible]);const resolvedHeaderTitle=useMemo(()=>{const normalized=headline.trim().toLowerCase();if(normalized===\"stay steps from the ocean\"||normalized===\"stay on the ocean from $59/night*\"||normalized===\"wow! stay on the ocean\"){return\"WOW! STAY ON THE OCEAN\";}return headline;},[headline]);const supportingText=useMemo(()=>`Available ${dateRange} on selected sites. ${note}`,[dateRange,note]);const backdropStyle=useMemo(()=>({position:\"fixed\",inset:0,background:\"rgba(17, 24, 28, 0.46)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"16px\",zIndex:2147483646,WebkitOverflowScrolling:\"touch\"}),[]);if(!isVisible)return null;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(\"div\",{style:backdropStyle,onClick:dismiss,\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsxs(\"section\",{role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":\"once-only-promo-title\",\"aria-describedby\":\"once-only-promo-description\",onClick:event=>event.stopPropagation(),style:{width:\"min(460px, calc(100vw - 32px))\",maxHeight:\"calc(100dvh - 32px)\",overflowY:\"auto\",WebkitOverflowScrolling:\"touch\",background:\"#FFFFFF\",color:\"#111111\",borderRadius:cardRadius,border:\"2px solid #000000\",boxShadow:\"0 20px 52px rgba(0,0,0,0.18)\",fontFamily:'\"Lexend\", \"Inter\", \"Avenir Next\", \"Segoe UI\", \"Helvetica Neue\", Arial, sans-serif',position:\"relative\",padding:0,boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:dismiss,\"aria-label\":\"Close promotional popup\",style:{position:\"absolute\",top:8,right:8,width:44,height:44,borderRadius:0,border:\"none\",background:\"transparent\",color:\"#000000\",fontSize:28,lineHeight:1,cursor:\"pointer\",zIndex:2,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",touchAction:\"manipulation\"},children:\"\\xd7\"}),/*#__PURE__*/_jsxs(\"div\",{style:{background:accentRed||\"#e60000\",color:accentYellow||\"#ffff00\",padding:\"18px 18px 14px\",borderTopLeftRadius:cardRadius,borderTopRightRadius:cardRadius,textAlign:\"center\"},children:[/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontSize:12,fontWeight:700,textTransform:\"uppercase\",letterSpacing:\"0.06em\",fontFamily:'\"Lexend\", Impact, \"Arial Black\", \"Inter\", sans-serif'},children:resolvedHeaderTitle}),/*#__PURE__*/_jsx(\"p\",{style:{margin:\"8px 0 0\",fontSize:\"clamp(30px, 8vw, 54px)\",lineHeight:1,fontWeight:800,fontFamily:'\"Lexend\", Impact, \"Arial Black\", \"Inter\", sans-serif'},children:offerNight}),/*#__PURE__*/_jsx(\"p\",{style:{margin:\"2px 0 0\",fontSize:\"clamp(24px, 6.5vw, 42px)\",lineHeight:1.05,fontWeight:800,fontFamily:'\"Lexend\", Impact, \"Arial Black\", \"Inter\", sans-serif'},children:offerWeek})]}),/*#__PURE__*/_jsxs(\"div\",{style:{padding:\"18px\"},children:[showImage?/*#__PURE__*/_jsx(\"img\",{...image,alt:image.alt||\"Bryn Mawr Ocean Resort promotional graphic\",style:{width:\"100%\",height:\"auto\",display:\"block\",borderRadius:imageRadius,border:\"1px solid #CCCCCC\",marginBottom:14}}):null,/*#__PURE__*/_jsx(\"p\",{id:\"once-only-promo-description\",style:{margin:\"0\",fontSize:15,lineHeight:1.45,color:\"#000000\",fontWeight:600},children:supportingText}),/*#__PURE__*/_jsx(\"a\",{href:resolvedCtaHref,onClick:dismiss,\"aria-label\":resolvedCtaLabel,style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",textAlign:\"center\",textDecoration:\"none\",background:accentRed||\"#e60000\",color:accentYellow||\"#ffff00\",padding:\"14px 18px\",borderRadius:ctaRadius,fontSize:17,fontWeight:800,marginTop:16,minHeight:48,lineHeight:1.2,boxSizing:\"border-box\",fontFamily:'\"Lexend\", Impact, \"Arial Black\", \"Inter\", sans-serif'},children:resolvedCtaLabel}),/*#__PURE__*/_jsx(\"p\",{style:{margin:\"10px 0 0\",fontSize:10.5,lineHeight:1.45,color:\"#4A4A4A\"},children:\"*A holiday event surcharge of $25/night applies to Labor Day and Thanksgiving holiday periods.\"})]})]})})});}addPropertyControls(OnceOnlyPromoPopup,{storageKey:{type:ControlType.String,title:\"Storage Key\",defaultValue:\"bryn-mawr-ocean-stay-promo-2026-08\"},headline:{type:ControlType.String,title:\"Headline\",defaultValue:\"Stay on the ocean from $59/night*\"},offerNight:{type:ControlType.String,title:\"Offer Night\",defaultValue:\"$59/night*\"},offerWeek:{type:ControlType.String,title:\"Offer Week\",defaultValue:\"$399/week*\"},dateRange:{type:ControlType.String,title:\"Date Range\",defaultValue:\"Aug. 1 thru Nov. 30\"},note:{type:ControlType.String,title:\"Note\",defaultValue:\"Call for availability.\"},image:{type:ControlType.ResponsiveImage,title:\"Image\"},showImage:{type:ControlType.Boolean,title:\"Show Image\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},phone:{type:ControlType.String,title:\"Phone\",defaultValue:\"904-471-3353\"},email:{type:ControlType.String,title:\"Email\",defaultValue:\"rentals@brynmawroceanresort.net\"},website:{type:ControlType.String,title:\"Website\",defaultValue:\"brynmawroceanresort.net\"},ctaLabel:{type:ControlType.String,title:\"CTA Label\",defaultValue:\"Reserve your spot today\"},ctaHref:{type:ControlType.Link,title:\"CTA Link\",defaultValue:\"tel:9044713353\"},cTALabel:{type:ControlType.String,title:\"cTA Label\",defaultValue:\"Reserve your spot today\"},cTALink:{type:ControlType.Link,title:\"cTA Link\",defaultValue:\"tel:9044713353\"},accentRed:{type:ControlType.Color,title:\"Accent Red\",defaultValue:\"#C82323\"},accentYellow:{type:ControlType.Color,title:\"Accent Yellow\",defaultValue:\"#FFD447\"},cardRadius:{type:ControlType.Number,title:\"Card Radius\",defaultValue:20,min:0,max:48,step:1},showDelayMs:{type:ControlType.Number,title:\"Delay (ms)\",defaultValue:0,min:0,max:1e4,step:50},delayMs:{type:ControlType.Number,title:\"delay Ms\",defaultValue:0,min:0,max:1e4,step:50},previewInEditor:{type:ControlType.Boolean,title:\"Preview In Editor\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"OnceOnlyPromoPopup\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Once_Only_Promo_Popup.map"],"mappings":"qOAGG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,aAAW,WAAS,aAAW,YAAU,YAAU,OAAK,QAAM,CAAC,IAAI,8FAA8F,IAAI,gDAAgD,EAAE,YAAU,QAAM,QAAM,UAAQ,WAAS,UAAQ,UAAQ,WAAS,UAAQ,YAAU,eAAa,aAAW,cAAY,kBAAgB,IAAM,EAAY,EAAi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