{"version":3,"file":"CurrentDate.Crie_Db4.mjs","names":["useState","titleInput","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/GDuM1v9vQNoKR4jLJuBn/9t3VXA7v4ashnNvrDgEh/CurrentDate.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export const withCurrentDate=()=>{const formatDate=date=>{const months=[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"];const day=date.getDate();const month=months[date.getMonth()]// Use the months array to get the month name\n;const year=date.getFullYear();return`${month} ${day}, ${year}`;};return{text:formatDate(new Date)};};export function withTitleFromInput(Component){return props=>{const[title,setTitle]=useState(\"Untitled Article\");useEffect(()=>{const handleTitleChange=()=>{const titleInput=document.querySelector('[name=\"Title Input\"]');if(titleInput){// Check if the input value is empty and set title accordingly\nconst inputValue=titleInput.firstChild.value;setTitle(inputValue?inputValue:\"Untitled Article\");}};const titleInput=document.querySelector('[name=\"Title Input\"]');titleInput===null||titleInput===void 0?void 0:titleInput.addEventListener(\"input\",handleTitleChange);return()=>{titleInput===null||titleInput===void 0?void 0:titleInput.removeEventListener(\"input\",handleTitleChange);};},[]);return /*#__PURE__*/_jsx(Component,{...props,text:title});};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withwithCurrentDate(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...withCurrentDate(props)});};}withwithCurrentDate.displayName=\"withCurrentDate\";\nexport const __FramerMetadata__ = {\"exports\":{\"withCurrentDate\":{\"type\":\"override\",\"name\":\"withCurrentDate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withwithCurrentDate\":{\"type\":\"reactHoc\",\"name\":\"withwithCurrentDate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTitleFromInput\":{\"type\":\"reactHoc\",\"name\":\"withTitleFromInput\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CurrentDate.map"],"mappings":"iQACsG,SAAgB,EAAmB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAS,mBAAmB,CAC8K,OAD7K,MAAc,CAAC,IAAM,MAAsB,CAAC,IAAMC,EAAW,SAAS,cAAc,uBAAuB,CAAC,GAAGA,EAAW,CAChV,IAAM,EAAWA,EAAW,WAAW,MAAM,EAAS,GAAsB,mBAAmB,GAAU,EAAW,SAAS,cAAc,uBAAuB,CAAsG,OAArG,GAAyD,iBAAiB,QAAQ,EAAkB,KAAW,CAAC,GAAyD,oBAAoB,QAAQ,EAAkB,GAAK,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,KAAK,EAAM,CAAC,EAAuJ,SAAgB,EAAoB,EAAE,CAAC,MAAO,KAAQ,EAA+BC,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAgB,EAAM,CAAC,CAAC,qBAFztB,IAAsC,IAEkgB,CAFrf,OACtB,CAAC,MAD2D,GAAM,CAAC,IAAM,EAAO,CAAC,UAAU,WAAW,QAAQ,QAAQ,MAAM,OAAO,OAAO,SAAS,YAAY,UAAU,WAAW,WAAW,CAAO,EAAI,EAAK,SAAS,CAAO,EAAM,EAAO,EAAK,UAAU,EAC5T,EAAK,EAAK,aAAa,CAAC,MAAM,GAAG,EAAM,GAAG,EAAI,IAAI,MAAgC,IAAI,KAAK,CAAC,EACqqB,EAAoB,YAAY"}