{"version":3,"file":"WhatsAppButton.DarliBfp.mjs","names":["React.useMemo"],"sources":["https:/framerusercontent.com/modules/nK6qMrvoaWJNqiKiYd1Y/5kGpUhee93vYavZHt3Ka/WhatsAppButton.js"],"sourcesContent":["// Make a button when pressed take to the whatsapp number.\n// This button will also give a default message in whatsapp to send.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";function sanitizePhoneNumber(input){// Keep digits only (WhatsApp wa.me expects international format without + or spaces)\nreturn(input||\"\").replace(/\\D/g,\"\");}function buildWhatsAppUrl(phoneNumber,message){const phone=sanitizePhoneNumber(phoneNumber);const text=encodeURIComponent(message||\"\");// If phone is empty, fall back to general WhatsApp chat with message\nif(!phone)return`https://wa.me/?text=${text}`;return`https://wa.me/${phone}?text=${text}`;}/**\n * WhatsApp Button\n *\n * @framerIntrinsicWidth 220\n * @framerIntrinsicHeight 48\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function WhatsAppButton(props){const{phoneNumber,message,label,ariaLabel,openInNewTab,backgroundColor,textColor,borderColor,borderWidth,radius,padding,gap,showIcon,icon,iconSize,font,style}=props;const href=React.useMemo(()=>buildWhatsAppUrl(phoneNumber,message),[phoneNumber,message]);const isFixedWidth=!!style&&style.width===\"100%\";return /*#__PURE__*/_jsxs(\"a\",{href:href,target:openInNewTab?\"_blank\":undefined,rel:openInNewTab?\"noopener noreferrer\":undefined,\"aria-label\":ariaLabel||label,style:{...style,position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",gap,padding,borderRadius:radius,background:backgroundColor,color:textColor,borderStyle:\"solid\",borderColor,borderWidth,textDecoration:\"none\",cursor:\"pointer\",userSelect:\"none\",WebkitTapHighlightColor:\"transparent\",...isFixedWidth?null:{width:\"max-content\"},...font},onClick:e=>{// In Canvas/SSR environments, do nothing special.\n// In the browser, allow default navigation.\nif(typeof window===\"undefined\")return;// If phone number is invalid, still navigate to WhatsApp with just the message.\n// No preventDefault.\n},children:[showIcon&&/*#__PURE__*/_jsx(SvgIcon,{name:icon,size:iconSize,color:\"currentColor\"}),/*#__PURE__*/_jsx(\"span\",{style:{minWidth:\"max-content\"},children:label})]});}function SvgIcon({name,size,color}){const common={width:size,height:size,viewBox:\"0 0 256 256\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",style:{flex:\"0 0 auto\",display:\"block\"},\"aria-hidden\":true,focusable:false};if(name===\"ArrowRight\"){return /*#__PURE__*/_jsx(\"svg\",{...common,viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M5 12h12m0 0-5-5m5 5-5 5\",stroke:color,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})});}if(name===\"PaperPlaneTilt\"){return /*#__PURE__*/_jsx(\"svg\",{...common,viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M3 11.5 21 3l-8.5 18-2.5-7L3 11.5Z\",stroke:color,strokeWidth:\"2\",strokeLinejoin:\"round\",fill:\"none\"})});}if(name===\"ChatCircleText\"){return /*#__PURE__*/_jsxs(\"svg\",{...common,viewBox:\"0 0 24 24\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M12 21a9 9 0 1 0-4.9-1.4L3 21l1.4-4.1A9 9 0 0 0 12 21Z\",stroke:color,strokeWidth:\"2\",strokeLinejoin:\"round\",fill:\"none\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M8 10h8M8 14h5\",stroke:color,strokeWidth:\"2\",strokeLinecap:\"round\"})]});}// Default: WhatsappLogo\nreturn /*#__PURE__*/_jsx(\"svg\",{...common,viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M20.52 3.48A11.86 11.86 0 0 0 12.06 0C5.46 0 .12 5.34.12 11.94c0 2.1.54 4.14 1.56 5.94L0 24l6.3-1.62a11.9 11.9 0 0 0 5.7 1.44h.06c6.6 0 11.94-5.34 11.94-11.94 0-3.18-1.26-6.18-3.48-8.4Zm-8.52 18.3h-.06a9.9 9.9 0 0 1-5.04-1.38l-.36-.24-3.72.96.99-3.63-.24-.39a9.93 9.93 0 0 1-1.53-5.25C2.04 6.42 6.54 1.92 12.06 1.92c2.64 0 5.13 1.02 6.99 2.88a9.8 9.8 0 0 1 2.88 6.99c0 5.52-4.5 9.99-9.93 9.99Zm5.76-7.68c-.3-.15-1.77-.87-2.04-.96-.27-.09-.48-.15-.69.15-.21.3-.78.96-.96 1.17-.18.21-.36.24-.66.09-.3-.15-1.29-.48-2.46-1.53-.9-.81-1.5-1.8-1.68-2.1-.18-.3-.02-.46.13-.61.14-.14.3-.36.45-.54.15-.18.2-.3.3-.51.1-.21.05-.39-.02-.54-.08-.15-.69-1.65-.95-2.25-.25-.6-.5-.51-.69-.51h-.6c-.21 0-.54.08-.83.39-.29.3-1.08 1.05-1.08 2.55 0 1.5 1.11 2.94 1.26 3.15.15.21 2.19 3.33 5.31 4.68.74.32 1.32.51 1.77.65.74.24 1.41.21 1.95.13.6-.09 1.77-.72 2.01-1.41.24-.69.24-1.29.17-1.41-.07-.12-.27-.2-.57-.36Z\",fill:color})});}addPropertyControls(WhatsAppButton,{phoneNumber:{type:ControlType.String,title:\"Phone\",defaultValue:\"15551234567\",placeholder:\"e.g. 15551234567\"},message:{type:ControlType.String,title:\"Message\",defaultValue:\"Hi! I'm interested — can you help?\",displayTextArea:true},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Chat on WhatsApp\"},ariaLabel:{type:ControlType.String,title:\"Aria Label\",defaultValue:\"Open WhatsApp chat\"},openInNewTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},showIcon:{type:ControlType.Boolean,title:\"Icon\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},icon:{type:ControlType.Enum,title:\"Icon Name\",defaultValue:\"WhatsappLogo\",options:[\"WhatsappLogo\",\"ChatCircleText\",\"PaperPlaneTilt\",\"ArrowRight\"],hidden:({showIcon})=>!showIcon},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:18,min:10,max:48,step:1,unit:\"px\",hidden:({showIcon})=>!showIcon},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#000000\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#EEEEEE\"},borderWidth:{type:ControlType.Number,title:\"Border W\",defaultValue:1,min:0,max:10,step:1,unit:\"px\"},radius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"12px\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"12px 16px\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:10,min:0,max:32,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WhatsAppButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"220\",\"framerIntrinsicHeight\":\"48\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WhatsAppButton.map"],"mappings":"wLAEyI,SAAS,EAAoB,EAAM,CAC5K,OAAO,GAAO,GAAA,CAAI,QAAQ,MAAM,EAAE,CAAE,CAAC,SAAS,EAAiB,EAAY,EAAQ,CAAC,IAAM,EAAM,EAAoB,CAAW,EAAQ,EAAK,mBAAmB,GAAS,EAAE,EAC5H,OAA1C,EAAgD,iBAAiB,EAAM,QAAQ,IAAnE,uBAAuB,GAAmD,CAQvF,SAAwB,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