{"version":3,"file":"DateVisibilityToggle.C5Py8vbj.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/ETk8ff263HQYNeygRko2/5VIkiwzb0iyQtlScOslW/DateVisibilityToggle.js"],"sourcesContent":["// Date-based visibility container. Content fills parent.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Date-based Visibility Container\n * Shows slotted children if set date is before/after today. Container fills size, and children fill the container.\n *\n * @framerIntrinsicWidth 120\n * @framerIntrinsicHeight 40\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function DateVisibilityToggle(props){const{comparisonType,date,children,background,textColor,borderRadius,font,style}=props;const isVisible=useMemo(()=>{if(!date)return false;const today=new Date;today.setHours(0,0,0,0);const target=new Date(date);if(isNaN(target.getTime()))return false;if(comparisonType===\"before\"){return target<today;}else{return target>today;}},[date,comparisonType]);if(!isVisible&&(props.style?.width===undefined||props.style?.height===undefined)){// Render a minimum-size placeholder to keep the component selectable\nreturn /*#__PURE__*/_jsx(\"div\",{style:{minWidth:5,minHeight:5}});}if(!isVisible)return null;return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",minWidth:5,minHeight:5,display:\"flex\",alignItems:\"stretch\",justifyContent:\"stretch\",background,color:textColor,borderRadius,overflow:\"hidden\",padding:0,...font},children:/*#__PURE__*/_jsx(\"div\",{style:{flex:1,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"stretch\",justifyContent:\"stretch\"},children:children})});}addPropertyControls(DateVisibilityToggle,{comparisonType:{type:ControlType.Enum,title:\"Show If\",options:[\"before\",\"after\"],optionTitles:[\"Date is before today\",\"Date is after today\"],defaultValue:\"after\"},date:{type:ControlType.Date,title:\"Date\",displayTime:false},children:{type:ControlType.Slot,title:\"Content\",maxCount:10},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DateVisibilityToggle\",\"slots\":[\"children\"],\"annotations\":{\"framerIntrinsicWidth\":\"120\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"40\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DateVisibilityToggle.map"],"mappings":"0KASG,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,iBAAe,OAAK,WAAS,aAAW,YAAU,eAAa,OAAK,SAAO,EAAY,EAAUA,MAAY,CAAC,GAAG,CAAC,EAAK,MAAO,GAAM,IAAM,EAAM,IAAI,KAAK,EAAM,SAAS,EAAE,EAAE,EAAE,CAAC,EAAE,IAAM,EAAO,IAAI,KAAK,CAAI,EAAkG,OAA7F,MAAM,EAAO,QAAQ,CAAC,EAAS,GAAS,IAAiB,SAAiB,EAAO,EAAmB,EAAO,CAAO,EAAE,CAAC,EAAK,CAAc,CAAC,EAC1T,MAD+T,CAAC,IAAY,EAAM,OAAO,QAAQ,IAAA,IAAW,EAAM,OAAO,SAAS,IAAA,IAC1c,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EAAO,EAA0C,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,OAAO,OAAO,SAAS,EAAE,UAAU,EAAE,QAAQ,OAAO,WAAW,UAAU,eAAe,UAAU,aAAW,MAAM,EAAU,eAAa,SAAS,SAAS,QA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