{"version":3,"file":"ShareButton.CtjWZCIX.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/7cdo1ebZBVQsyzaaYuRp/vQhUvK6X7DDnKRMRq8wh/ShareButton.js"],"sourcesContent":["// Share Button that shares the current webpage link\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Share Button\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function ShareButton(props){const{label,icon,background,color,borderRadius,font,style}=props;const[copied,setCopied]=useState(false);function handleShare(){if(typeof window===\"undefined\")return;const url=window.location.href;if(navigator.share){navigator.share({url}).catch(()=>{});}else if(navigator.clipboard){navigator.clipboard.writeText(url).then(()=>{startTransition(()=>setCopied(true));setTimeout(()=>startTransition(()=>setCopied(false)),1200);});}else{// fallback\nconst input=document.createElement(\"input\");input.value=url;document.body.appendChild(input);input.select();document.execCommand(\"copy\");document.body.removeChild(input);startTransition(()=>setCopied(true));setTimeout(()=>startTransition(()=>setCopied(false)),1200);}}if(RenderTarget.current()===RenderTarget.thumbnail)return null;return /*#__PURE__*/_jsxs(\"button\",{type:\"button\",\"aria-label\":\"Share this page\",onClick:handleShare,style:{...style,display:\"flex\",alignItems:\"center\",gap:10,background,color,border:\"none\",borderRadius,padding:\"12px 24px\",cursor:\"pointer\",boxShadow:\"0 2px 8px rgba(0,0,0,0.06)\",transition:\"background 0.15s, color 0.15s\",...font},children:[icon&&/*#__PURE__*/_jsx(\"span\",{style:{fontSize:20,lineHeight:1},children:icon}),/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:600},children:copied?\"Copied!\":label})]});}addPropertyControls(ShareButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Share\"},icon:{type:ControlType.String,title:\"Icon\",defaultValue:\"🔗\",placeholder:\"Emoji or leave blank\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#111\"},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#fff\"},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:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShareButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShareButton.map"],"mappings":"qNAMG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,aAAW,QAAM,eAAa,OAAK,SAAO,EAAW,CAAC,EAAO,GAAWA,EAAS,GAAM,CAAC,SAAS,GAAa,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAI,EAAO,SAAS,KAAK,GAAG,EAAU,MAAO,EAAU,MAAM,CAAC,MAAI,CAAC,CAAC,UAAU,GAAG,SAAU,EAAU,UAAW,EAAU,UAAU,UAAU,EAAI,CAAC,SAAS,CAAC,MAAoB,EAAU,GAAK,CAAC,CAAC,eAAeC,MAAoB,EAAU,GAAM,CAAC,CAAC,KAAK,EAAG,KAAM,CAC/d,IAAM,EAAM,SAAS,cAAc,QAAQ,CAAC,EAAM,MAAM,EAAI,SAAS,KAAK,YAAY,EAAM,CAAC,EAAM,QAAQ,CAAC,SAAS,YAAY,OAAO,CAAC,SAAS,KAAK,YAAY,EAAM,CAAC,MAAoB,EAAU,GAAK,CAAC,CAAC,eAAeA,MAAoB,EAAU,GAAM,CAAC,CAAC,KAAK,EAAkE,OAA5D,EAAa,SAAS,GAAG,EAAa,UAAiB,KAAyB,EAAM,SAAS,CAAC,KAAK,SAAS,aAAa,kBAAkB,QAAQ,EAAY,MAAM,CAAC,GAA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