{"version":3,"file":"CustomId.BPzWvte8.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/B1Qa1eXUthQV4B7JivHU/YlwPCX5SLpFGWchQMEHJ/CustomId.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";export function withDynamicID(Component){return props=>{// props.slug là giá trị lấy từ CMS Field \"Slug\"\nconst currentSlug=props.slug||\"default-post\";return /*#__PURE__*/_jsx(Component,{...props,id:currentSlug,\"data-cms-slug\":currentSlug});};}export function withCustomMargin(Component){return props=>{const ref=useRef(null);const[height,setHeight]=useState(0);useEffect(()=>{if(!ref.current)return;const updateHeight=()=>{if(!ref.current)return;setHeight(ref.current.offsetHeight);};updateHeight();const observer=new ResizeObserver(()=>{updateHeight();});observer.observe(ref.current);return()=>{observer.disconnect();};},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,className:props.className?`${props.className} custom_margin`:\"custom_margin\",style:{...props.style,marginBottom:`-${height}px`}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withDynamicID\":{\"type\":\"reactHoc\",\"name\":\"withDynamicID\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCustomMargin\":{\"type\":\"reactHoc\",\"name\":\"withCustomMargin\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomId.map"],"mappings":"2HAAwF,SAAgB,EAAc,EAAU,CAAC,MAAO,IAAO,CAC/I,IAAM,EAAY,EAAM,MAAM,eAAe,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,GAAG,EAAY,gBAAgB,CAAW,CAAC,CAAE,CAAE,CAAC,SAAgB,EAAiB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAIA,EAAO,IAAI,EAAO,CAAC,EAAO,GAAWC,EAAS,CAAC,EAA4Q,OAA1Q,MAAc,CAAC,GAAG,CAAC,EAAI,QAAQ,OAAO,IAAM,MAAiB,CAAK,EAAI,SAAe,EAAU,EAAI,QAAQ,YAAY,CAAE,EAAE,EAAa,EAAE,IAAM,EAAS,IAAI,mBAAmB,CAAC,EAAa,CAAE,CAAC,EAAgC,OAA9B,EAAS,QAAQ,EAAI,OAAO,MAAY,CAAC,EAAS,WAAW,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAU,MAAI,UAAU,EAAM,UAAU,GAAG,EAAM,UAAU,gBAAgB,gBAAgB,MAAM,CAAC,GAAG,EAAM,MAAM,aAAa,IAAI,EAAO,GAAG,CAAC,CAAC,CAAE,CAAE,iBADzpB,IAA6C"}