{"version":3,"file":"ShareOnFacebook.DD3dcs9A.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/7JOszn06VBvBoDduhLyd/vLoZGOENhAq6ecL6Eyu1/OpenGraphMetadata.js","https:/framerusercontent.com/modules/wstFb6aEPBBkaGNZ4DRZ/qifL8H1AJFAAFaRKsG6e/ShareOnFacebook.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function OpenGraphMetadata({title=\"\",description=\"\",image=\"\",slug=\"\"}){useEffect(()=>{function setMeta(property,content){if(!content||content===\"undefined\"||content===\"\")return;let element=document.querySelector(`meta[property=\"${property}\"]`);if(!element){element=document.createElement(\"meta\");element.setAttribute(\"property\",property);document.head.appendChild(element);}element.setAttribute(\"content\",content);}// Oppdater Open Graph-metadataene med riktige verdier\nsetMeta(\"og:title\",title||\"Standard tittel\");setMeta(\"og:description\",description||\"Standard beskrivelse\");setMeta(\"og:image\",image||\"https://www.legedom.no/default-image.jpg\");setMeta(\"og:url\",slug?`https://www.legedom.no/${slug}`:\"https://www.legedom.no/\");setMeta(\"og:type\",\"article\");console.log(\"✅ Open Graph metadata oppdatert!\",{title,description,image,slug});},[title,description,image,slug]);return /*#__PURE__*/_jsx(\"div\",{style:{display:\"none\"},children:\"OpenGraphMetadata aktiv!\"});}// 📌 Property Controls for å koble til CMS i Framer\naddPropertyControls(OpenGraphMetadata,{title:{type:ControlType.String,title:\"Title\"},description:{type:ControlType.String,title:\"Description\"},image:{type:ControlType.String,title:\"Image URL\"},slug:{type:ControlType.String,title:\"Slug\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"OpenGraphMetadata\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OpenGraphMetadata.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export default function ShareOnFacebook({slug}){const[currentUrl,setCurrentUrl]=useState(\"https://legedom.no/\");useEffect(()=>{if(typeof window!==\"undefined\"){setCurrentUrl(window.location.href);}},[]);const shareUrl=slug?`https://legedom.no/${slug}`:currentUrl;return /*#__PURE__*/_jsx(\"button\",{onClick:()=>{if(typeof window!==\"undefined\"){window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`,\"_blank\");}},style:{padding:\"10px 15px\",backgroundColor:\"#1877F2\",color:\"white\",border:\"none\",borderRadius:\"5px\",cursor:\"pointer\",fontWeight:\"bold\",fontSize:\"18px\"},children:\"Del p\\xe5 Facebook\"});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShareOnFacebook\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShareOnFacebook.map"],"mappings":"2LAA4H,SAAwB,EAAkB,CAAC,QAAM,GAAG,cAAY,GAAG,QAAM,GAAG,OAAK,IAAI,CACgM,OAD/L,MAAc,CAAC,SAAS,EAAQ,EAAS,EAAQ,CAAC,GAAG,CAAC,GAAS,IAAU,aAAa,IAAU,GAAG,OAAO,IAAI,EAAQ,SAAS,cAAc,kBAAkB,EAAS,GAAG,EAAM,IAAS,EAAQ,SAAS,cAAc,MAAM,EAAE,EAAQ,aAAa,WAAW,CAAQ,EAAE,SAAS,KAAK,YAAY,CAAO,GAAG,EAAQ,aAAa,UAAU,CAAO,CAAE,CACziB,EAAQ,WAAW,GAAO,iBAAiB,EAAE,EAAQ,iBAAiB,GAAa,sBAAsB,EAAE,EAAQ,WAAW,GAAO,0CAA0C,EAAE,EAAQ,SAAS,EAAK,0BAA0B,IAAO,yBAAyB,EAAE,EAAQ,UAAU,SAAS,EAAE,QAAQ,IAAI,mCAAmC,CAAC,QAAM,cAAY,QAAM,MAAI,CAAC,CAAE,EAAE,CAAC,EAAM,E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