{"version":3,"file":"SummarizeWithAI.7kMEcdud.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/1N7gxlIEwAcOP4Is43l2/JhNnKV72zQZLAKfLabNm/SummarizeWithAI.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useEffect,useState,startTransition}from\"react\";const ASSISTANTS=[{name:\"ChatGPT\",icon:\"https://framerusercontent.com/images/N3vyg67MlwWuNhV7tkjGfX0cw.webp\",alt:\"ChatGPT\",build:p=>`https://chatgpt.com/?hints=search&q=${p}`},{name:\"Claude\",icon:\"https://framerusercontent.com/images/tU5zgRvOedqSG1Oc2HpyuQqJPiE.webp\",alt:\"Claude\",build:p=>`https://claude.ai/new?q=${p}`},{name:\"Gemini\",icon:\"https://framerusercontent.com/images/IuhQ6wGkAst4012TwGjb4VJ4mSU.png\",alt:\"Google Gemini\",build:p=>`https://www.google.com/search?udm=50&q=${p}`},{name:\"Grok\",icon:\"https://framerusercontent.com/images/5VrD5ljzIrlASx7O9VvpIdU5rUQ.png\",alt:\"Grok\",build:p=>`https://grok.com/?q=${p}`},{name:\"Perplexity\",icon:\"https://framerusercontent.com/images/vIe2bTrXIJ7R8kTNgOgn6dzApLY.webp\",alt:\"Perplexity\",build:p=>`https://www.perplexity.ai/search?q=${p}`}];/**\n * Summarize With AI\n *\n * A row of one-click links that hand the current page URL to an AI assistant\n * with a \"summarize this\" prompt. The URL is read from the browser at runtime,\n * so the same instance works on every CMS detail page without per-item setup.\n *\n * @framerIntrinsicWidth 640\n * @framerIntrinsicHeight 72\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function SummarizeWithAI(props){const{label=\"Summarize this page with your favourite AI assistant\",promptPrefix=\"Summarize the content at\",fallbackUrl=\"https://www.onclarity.com/blog\",font,textColor=\"#030201\",background=\"#FFFFFF\",borderColor=\"rgba(210, 209, 208, 0.5)\",circleBackground=\"#FFFFFF\",radius=\"12px\",circleSize=36,iconSize=18}=props;const isStatic=useIsStaticRenderer();const[pageUrl,setPageUrl]=useState(fallbackUrl);useEffect(()=>{if(isStatic)return;if(typeof window===\"undefined\")return;const{origin,pathname}=window.location;// Drop query and hash so the prompt carries a clean canonical URL.\nconst clean=`${origin}${pathname}`.replace(/\\/$/,\"\");startTransition(()=>setPageUrl(clean));},[isStatic]);const prompt=encodeURIComponent(`${promptPrefix} ${pageUrl}`);const isFillWidth=props?.style?.width===\"100%\";return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,position:\"relative\",boxSizing:\"border-box\",display:\"flex\",flexDirection:\"row\",flexWrap:\"wrap\",alignItems:\"center\",justifyContent:\"space-between\",gap:16,padding:\"16px 20px\",background,border:`1px solid ${borderColor}`,borderRadius:radius,boxShadow:\"0px 1px 2px 0px rgba(3, 2, 1, 0.04)\",...isFillWidth?null:{minWidth:\"max-content\"}},children:[/*#__PURE__*/_jsx(\"span\",{style:{flex:\"1 1 200px\",margin:0,color:textColor,// Site default; anything picked in the Font control wins.\nfontFamily:\"'Instrument Sans', sans-serif\",...font},children:label}),/*#__PURE__*/_jsx(\"div\",{style:{flex:\"0 0 auto\",display:\"flex\",flexDirection:\"row\",alignItems:\"center\",gap:8},children:ASSISTANTS.map(assistant=>/*#__PURE__*/_jsx(\"a\",{href:assistant.build(prompt),target:\"_blank\",rel:\"noopener\",title:`Summarize with ${assistant.name}`,\"aria-label\":`Summarize with ${assistant.name}`,style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:circleSize,height:circleSize,flex:\"0 0 auto\",borderRadius:circleSize,background:circleBackground,border:`1px solid ${borderColor}`,textDecoration:\"none\",cursor:\"pointer\"},children:/*#__PURE__*/_jsx(\"img\",{src:assistant.icon,alt:assistant.alt,width:iconSize,height:iconSize,style:{width:iconSize,height:iconSize,objectFit:\"contain\",display:\"block\"}})},assistant.name))})]});}addPropertyControls(SummarizeWithAI,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Summarize this page with your favourite AI assistant\"},promptPrefix:{type:ControlType.String,title:\"Prompt\",defaultValue:\"Summarize the content at\",description:\"The page URL is appended to this sentence.\"},fallbackUrl:{type:ControlType.String,title:\"Fallback URL\",defaultValue:\"https://www.onclarity.com/blog\",description:\"Used on the canvas, before the browser URL is known.\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.4em\",textAlign:\"left\"}},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#030201\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},circleBackground:{type:ControlType.Color,title:\"Button Fill\",defaultValue:\"#FFFFFF\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"rgba(210, 209, 208, 0.5)\"},radius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"12px\"},circleSize:{type:ControlType.Number,title:\"Button Size\",defaultValue:36,min:24,max:56,step:1,unit:\"px\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:18,min:12,max:32,step:1,unit:\"px\"}});SummarizeWithAI.displayName=\"Summarize With AI\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SummarizeWithAI\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"72\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"640\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SummarizeWithAI.map"],"mappings":"sNAYG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,QAAM,uDAAuD,eAAa,2BAA2B,cAAY,iCAAiC,OAAK,YAAU,UAAU,aAAW,UAAU,cAAY,2BAA2B,mBAAiB,UAAU,SAAO,OA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