{"version":3,"file":"CopyURLButton.BF_Xw85e.mjs","names":["useState","useCallback"],"sources":["https:/framerusercontent.com/modules/CpxyJIRMx4pLx73eXqTi/oyKBusoBls6TJ1VKvPYz/CopyURLButton.js"],"sourcesContent":["// CopyURLButton: A clickable pill that copies a URL to the clipboard with a copy icon and \"Copied!\" feedback state\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useCallback}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * CopyURLButton\n *\n * @framerIntrinsicWidth 320\n * @framerIntrinsicHeight 48\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CopyURLButton(props){const{url,label,background,textColor,copiedBackground,copiedTextColor,copiedLabel,borderRadius,fontSize,fontWeight,paddingY,paddingX,iconSize,gap,style}=props;const[copied,setCopied]=useState(false);const[hovered,setHovered]=useState(false);const handleCopy=useCallback(async()=>{const textToCopy=url;// Modern clipboard API\ntry{if(typeof navigator!==\"undefined\"&&navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(textToCopy);setCopied(true);setTimeout(()=>setCopied(false),2e3);return;}}catch(e){// fall through to legacy method\n}// Legacy fallback for older browsers / insecure contexts\ntry{const textArea=document.createElement(\"textarea\");textArea.value=textToCopy;textArea.style.position=\"fixed\";textArea.style.left=\"-9999px\";textArea.style.top=\"0\";document.body.appendChild(textArea);textArea.focus();textArea.select();document.execCommand(\"copy\");document.body.removeChild(textArea);setCopied(true);setTimeout(()=>setCopied(false),2e3);}catch(e){// copy failed silently\n}},[url]);const isActive=copied;const bg=isActive?copiedBackground:background;const txt=isActive?copiedTextColor:textColor;const buttonStyle={display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",gap:`${gap}px`,padding:`${paddingY}px ${paddingX}px`,borderRadius:`${borderRadius}px`,background:bg,color:txt,fontSize:`${fontSize}px`,fontWeight:fontWeight,cursor:\"pointer\",border:\"none\",outline:\"none\",transition:\"all 0.25s cubic-bezier(.4,0,.2,1)\",fontFamily:\"inherit\",whiteSpace:\"nowrap\",userSelect:\"none\",transform:hovered&&!isActive?\"translateY(-1px)\":\"none\",boxShadow:hovered&&!isActive?\"0 8px 24px rgba(0,0,0,0.18)\":\"0 2px 8px rgba(0,0,0,0.06)\",...style};const copyIcon=/*#__PURE__*/_jsxs(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",style:{flexShrink:0},children:[/*#__PURE__*/_jsx(\"rect\",{x:\"9\",y:\"9\",width:\"13\",height:\"13\",rx:\"2\",ry:\"2\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"})]});const checkIcon=/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2.5\",strokeLinecap:\"round\",strokeLinejoin:\"round\",style:{flexShrink:0},children:/*#__PURE__*/_jsx(\"polyline\",{points:\"20 6 9 17 4 12\"})});return /*#__PURE__*/_jsxs(\"button\",{type:\"button\",onClick:handleCopy,onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),style:buttonStyle,\"aria-label\":`Copy ${url} to clipboard`,children:[/*#__PURE__*/_jsx(\"span\",{children:isActive?copiedLabel:label}),isActive?checkIcon:copyIcon]});}addPropertyControls(CopyURLButton,{url:{type:ControlType.String,title:\"URL\",defaultValue:\"https://mcp.tripsy.app/mcp\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"https://mcp.tripsy.app/mcp\"},copiedLabel:{type:ControlType.String,title:\"Copied Label\",defaultValue:\"Copied!\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#2B2B2C\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},copiedBackground:{type:ControlType.Color,title:\"Copied BG\",defaultValue:\"#FF7733\"},copiedTextColor:{type:ControlType.Color,title:\"Copied Text\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:100,min:0,max:100,step:1},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:10,max:32,step:1},fontWeight:{type:ControlType.Number,title:\"Font Weight\",defaultValue:600,min:300,max:900,step:100},paddingY:{type:ControlType.Number,title:\"Padding Y\",defaultValue:14,min:0,max:32,step:1},paddingX:{type:ControlType.Number,title:\"Padding X\",defaultValue:24,min:0,max:48,step:1},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:18,min:10,max:32,step:1},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:12,min:0,max:24,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyURLButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"320\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"48\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CopyURLButton.map"],"mappings":"6MASG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,MAAI,QAAM,aAAW,YAAU,mBAAiB,kBAAgB,cAAY,eAAa,WAAS,aAAW,WAAS,WAAS,WAAS,MAAI,SAAO,EAAW,CAAC,EAAO,GAAWA,EAAS,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAAQ,EAAWC,EAAY,SAAS,CAAC,IAAM,EAAW,EACzV,GAAG,CAAC,GAAU,IAAY,QAAa,EAAU,WAAW,EAAO,gBAAgB,CAAC,MAAM,EAAU,UAAU,UAAU,CAAU,EAAE,EAAU,EAAI,EAAE,eAAe,EAAU,EAAK,EAAE,GAAG,EAAE,MAAO,CAAC,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