{"version":3,"file":"MenuAvailabilityNote.BlU9nywJ.mjs","names":["useState","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/InA3MTzRgh6xRdPv0heT/d2RX3VtcWaflsDwmTZtQ/MenuAvailabilityNote.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useCallback,useEffect,useMemo,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const UPDATE_INTERVAL_DAYS=3;/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function MenuAvailabilityNote(props){const{color,fontSize,lineHeight,maxWidth,sentenceText,boldPrefixText,style}=props;const[formattedDate,setFormattedDate]=useState(\"\");const getMostRecentPeriodStart=useCallback(()=>{const now=new Date;const startOfToday=new Date(now.getFullYear(),now.getMonth(),now.getDate());// Fixed reference point (Jan 1, 1970) so the 3-day grid is\n// consistent for every visitor, regardless of when they load the page.\nconst epoch=new Date(1970,0,1);const daysSinceEpoch=Math.floor((startOfToday.getTime()-epoch.getTime())/864e5);const daysSincePeriodStart=daysSinceEpoch%UPDATE_INTERVAL_DAYS;const periodStart=new Date(startOfToday);periodStart.setDate(startOfToday.getDate()-daysSincePeriodStart);return new Intl.DateTimeFormat(\"en-US\",{month:\"long\",day:\"numeric\",year:\"numeric\"}).format(periodStart);},[]);const fallbackDate=useMemo(()=>{return getMostRecentPeriodStart();},[getMostRecentPeriodStart]);useEffect(()=>{if(typeof window!==\"undefined\"){const nextFormattedDate=getMostRecentPeriodStart();startTransition(()=>{setFormattedDate(nextFormattedDate);});}else{startTransition(()=>{setFormattedDate(fallbackDate);});}},[fallbackDate,getMostRecentPeriodStart]);const displayDate=formattedDate||fallbackDate;const hasSentence=sentenceText.trim().length>0;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",display:\"flex\",justifyContent:\"center\",...style},children:/*#__PURE__*/_jsxs(\"p\",{style:{margin:0,width:\"100%\",maxWidth,textAlign:\"center\",fontFamily:\"Inter, sans-serif\",fontStyle:\"italic\",color,fontSize,lineHeight:`${lineHeight}px`,background:\"transparent\",border:\"none\"},children:[hasSentence?sentenceText:null,hasSentence?/*#__PURE__*/_jsx(\"br\",{}):null,/*#__PURE__*/_jsxs(\"strong\",{children:[boldPrefixText,\" \",displayDate,\".\"]})]})});}addPropertyControls(MenuAvailabilityNote,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#555\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:15,min:10,max:40,step:1},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:24,min:12,max:60,step:1},maxWidth:{type:ControlType.Number,title:\"Max Width\",defaultValue:560,min:200,max:1400,step:1},sentenceText:{type:ControlType.String,title:\"Sentence\",defaultValue:\"May these offerings assist on your journey.\"},boldPrefixText:{type:ControlType.String,title:\"Prefix\",defaultValue:\"Menu current as of\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MenuAvailabilityNote\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MenuAvailabilityNote.map"],"mappings":"2NAGG,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,QAAM,WAAS,aAAW,WAAS,eAAa,iBAAe,SAAO,EAAW,CAAC,EAAc,GAAkBA,EAAS,EAAE,EAAQ,EAAyBC,MAAgB,CAAC,IAAM,EAAI,IAAI,KAAW,EAAa,IAAI,KAAK,EAAI,YAAY,EAAE,EAAI,SAAS,EAAE,EAAI,QAAQ,CAAC,EAEnU,EAAM,IAAI,KAAK,KAAK,EAAE,CAAC,EAAwF,EAAjE,KAAK,OAAO,EAAa,QAAQ,EAAE,EAAM,QAAQ,GAAG,KAA+C,EAAE,EAA2B,EAAY,IAAI,KAAK,CAAY,E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