{"version":3,"file":"PreferredSourceButton.ZDgeIw2K.mjs","names":["__esmMin","window","init_npm_react_18_3_1","init_ssg_sandbox_shims","init_jsx_runtime","c","p","ce","RenderTarget","init_framer_BisrWwwE","addPropertyControls","ControlType","PreferredSourceButton","props","target","isStatic","SCRIPT_SRC","script","w","preferredSource","theme","lang","wrapper","style","align","isDark","attrs","init_PreferredSourceButton"],"sources":["https:/framerusercontent.com/modules/oqHZK4y1nIkqvPFq0Cmz/eBgshnL0dJHD5ShQGJUq/PreferredSourceButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect}from\"react\";// Google's publisher script. It scans the page for elements tagged with\n// [google-add-preferred-source-btn] and renders the official button into a\n// shadow root on each one, marking it data-initialized=\"true\".\n// https://developers.google.com/search/docs/appearance/preferred-sources\nconst SCRIPT_SRC=\"https://news.google.com/swg/js/v1/publisher.js\";/**\n * Google Preferred Source\n *\n * Renders Google's official \"Add to Preferred Sources\" button, which lets\n * readers pick coclimbing.com as a preferred source in Google Search.\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 40\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function PreferredSourceButton(props){const{theme,lang,align,style}=props;const target=RenderTarget.current();const isStatic=target===RenderTarget.canvas||target===RenderTarget.thumbnail||target===RenderTarget.export;useEffect(()=>{if(isStatic)return;if(typeof window===\"undefined\"||typeof document===\"undefined\")return;// Load the script once per page load.\nif(!document.querySelector('script[src=\"'+SCRIPT_SRC+'\"]')){const script=document.createElement(\"script\");script.async=true;script.src=SCRIPT_SRC;document.head.appendChild(script);}// Google only scans for buttons when the script first runs, so a button\n// mounted later — after Framer's client-side navigation — would never\n// render. Pushing to the callback queue on every mount re-runs the scan.\n// Buttons already marked data-initialized are skipped, so this is safe\n// to call repeatedly.\nconst w=window;w.PREFERRED_SOURCE=w.PREFERRED_SOURCE||[];w.PREFERRED_SOURCE.push(preferredSource=>{preferredSource.init();});},[isStatic,theme,lang]);const wrapper={...style,position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:align,minWidth:\"max-content\",minHeight:40};// The canvas has no Google script, so stand in a same-sized pill to lay out against.\nif(isStatic){const isDark=theme===\"dark\";return /*#__PURE__*/_jsx(\"div\",{style:wrapper,children:/*#__PURE__*/_jsxs(\"div\",{style:{display:\"inline-flex\",alignItems:\"center\",gap:10,height:40,minWidth:140,padding:\"0 16px\",borderRadius:20,boxSizing:\"border-box\",background:isDark?\"#131314\":\"#ffffff\",border:\"1px solid \"+(isDark?\"#8e918f\":\"#747775\"),color:isDark?\"#e3e3e3\":\"#1f1f1f\",fontFamily:\"Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",fontSize:14,lineHeight:\"normal\",whiteSpace:\"nowrap\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{width:18,height:18,borderRadius:\"50%\",flexShrink:0,background:\"conic-gradient(#ea4335 0deg 90deg, #fbbc04 90deg 180deg, #34a853 180deg 270deg, #4285f4 270deg 360deg)\"}}),\"Add to Preferred Sources\"]})});}// Dashed attributes are passed through a spread so TypeScript stays happy.\nconst attrs={\"google-add-preferred-source-btn\":\"\",\"data-theme\":theme};if(lang)attrs[\"data-lang\"]=lang;return /*#__PURE__*/_jsx(\"div\",{style:wrapper,children:/*#__PURE__*/_jsx(\"div\",{...attrs})});}addPropertyControls(PreferredSourceButton,{theme:{type:ControlType.Enum,title:\"Theme\",defaultValue:\"light\",options:[\"light\",\"dark\"],optionTitles:[\"Light\",\"Dark\"],displaySegmentedControl:true},lang:{type:ControlType.String,title:\"Language\",defaultValue:\"\",placeholder:\"Auto\",description:\"Leave blank to match the reader's language.\"},align:{type:ControlType.Enum,title:\"Align\",defaultValue:\"flex-start\",options:[\"flex-start\",\"center\",\"flex-end\"],optionTitles:[\"Left\",\"Center\",\"Right\"],displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PreferredSourceButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"40\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"200\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PreferredSourceButton.map"],"mappings":"A,uMAeG,SAAwBY,EAAsB,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,QAAM,SAAOC,EAAYC,EAAON,EAAa,QAAQ,EAAQO,EAASD,IAASN,EAAa,QAAQM,IAASN,EAAa,WAAWM,IAASN,EAAa,OAAOD,MAAc,CAAoB,GAAhBQ,GAA0Bd,IAAS,QAAa,OAAO,SAAW,IAAY,OAC3U,GAAG,CAAC,SAAS,cAAc,eAAee,EAAW,IAAI,EAAE,CAAC,IAAMC,EAAO,SAAS,cAAc,QAAQ,EAAE,EAAO,MAAM,GAAK,EAAO,IAAID,EAAW,SAAS,KAAK,YAAYC,CAAM,CAAE,CAKpL,IAAMC,EAAEjB,EAAO,EAAE,iBAAiBiB,EAAE,kBAAkB,CAAC,EAAEA,EAAE,iBAAiB,KAAK,GAAiB,CAACC,EAAgB,KAAK,CAAE,CAAC,CAAE,EAAE,CAACJ,EAASK,EAAMC,CAAI,CAAC,EAAE,IAAMC,EAAQ,CAAC,GAAGC,EAAM,SAAS,WAAW,QAAQ,OAAO,WAAW,SAAS,eAAeC,EAAM,SAAS,cAAc,UAAU,EAAE,EAC7R,GAAGT,EAAS,CAAC,IAAMU,EAAOL,IAAQ,OAAO,MAAoB,gBAAK,MAAM,CAAC,MAAME,EAAQ,SAAsB,gBAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,cAAc,WAAW,SAAS,IAAI,GAAG,OAAO,GAAG,SAAS,IAAI,QAAQ,SAAS,aAAa,GAAG,UAAU,aAAa,WAAWG,EAAO,UAAU,UAAU,OAAO,cAAcA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