{"version":3,"file":"WhatsAppButton.CFo7INPf.mjs","names":[],"sources":["https:/framerusercontent.com/modules/2HoSF2z8kc8aJzIlwmkJ/ljnJMXpJUcGOpHJdScYO/WhatsAppButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";// Your WhatsApp number, used by every button on the site unless a button sets its own Phone.\n// International format, digits only (country code + number).\nconst DEFAULT_PHONE=\"351912000412\";// Builds a wa.me link. Strips spaces, dashes, brackets and a leading \"+\" or \"00\" from the number.\nfunction buildLink(phone,message){const digits=(phone||DEFAULT_PHONE).replace(/[^\\d]/g,\"\").replace(/^00/,\"\");const text=message?`?text=${encodeURIComponent(message)}`:\"\";return`https://wa.me/${digits}${text}`;}function ChatIcon({size,color}){return /*#__PURE__*/_jsxs(\"svg\",{width:size,height:size,viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",style:{flexShrink:0,display:\"block\"},children:[/*#__PURE__*/_jsx(\"path\",{d:\"M12 2.6a9.4 9.4 0 0 0-8.1 14.2L2.6 21.4l4.7-1.2A9.4 9.4 0 1 0 12 2.6z\",fill:\"none\",stroke:color,strokeWidth:1.7,strokeLinejoin:\"round\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M8.7 7.3c.2-.4.5-.5.8-.5h.6c.2 0 .4.1.5.4l.8 1.9c.1.2 0 .5-.1.7l-.6.7c-.1.2-.1.4 0 .6.6 1.1 1.5 2 2.6 2.6.2.1.4.1.6 0l.7-.6c.2-.2.5-.2.7-.1l1.9.8c.3.1.4.3.4.5v.6c0 .3-.1.6-.5.8-.6.4-1.3.5-2 .4-3.2-.6-5.6-3-6.2-6.2-.1-.7 0-1.4.4-2z\",fill:color})]});}/**\n * WhatsApp Button. Bind \"Message\" to a CMS field so each retreat or date prefills its own text.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function WhatsAppButton(props){const{phone=\"\",message=\"\",label=\"Ask on WhatsApp\",showLabel=true,background=\"#1F211B\",hoverBackground=\"#B5603F\",color=\"#F6F3EC\",font,radius=100,paddingX=22,paddingY=14,iconSize=18,newTab=true,style}=props;const href=buildLink(phone,message);const iconOnly=!showLabel;// Framer passes width \"100%\" when the instance is set to fill or a fixed width.\nconst fill=style?.width===\"100%\";return /*#__PURE__*/_jsxs(\"a\",{href:href,target:newTab?\"_blank\":undefined,rel:\"noopener noreferrer\",\"aria-label\":iconOnly?label:undefined,className:\"qwa-btn\",style:{...style,position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",gap:10,boxSizing:\"border-box\",padding:iconOnly?paddingY:`${paddingY}px ${paddingX}px`,borderRadius:radius,background,color,textDecoration:\"none\",cursor:\"pointer\",whiteSpace:\"nowrap\",width:fill?\"100%\":undefined,minWidth:\"max-content\",transition:\"background-color 0.2s ease\",[\"--qwa-hover\"]:hoverBackground},children:[/*#__PURE__*/_jsx(\"style\",{children:`.qwa-btn:hover{background-color:var(--qwa-hover)!important}.qwa-btn:focus-visible{outline:2px solid var(--qwa-hover);outline-offset:3px}`}),/*#__PURE__*/_jsx(ChatIcon,{size:iconSize,color:color}),showLabel&&/*#__PURE__*/_jsx(\"span\",{style:{fontSize:15,lineHeight:1.2,fontWeight:500,...font,color},children:label})]});}addPropertyControls(WhatsAppButton,{phone:{type:ControlType.String,title:\"Phone\",defaultValue:\"\",placeholder:\"Country code + number\",description:\"Leave empty to use the site-wide number set at the top of this code file.\"},message:{type:ControlType.String,title:\"Message\",defaultValue:\"Hi, I'd like to ask about your retreats.\",displayTextArea:true},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Ask on WhatsApp\"},showLabel:{type:ControlType.Boolean,title:\"Show Label\",defaultValue:true},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#1F211B\"},hoverBackground:{type:ControlType.Color,title:\"Hover\",defaultValue:\"#B5603F\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#F6F3EC\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",lineHeight:\"1.2em\"},hidden:p=>p.showLabel===false},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:100,min:0,max:100,unit:\"px\"},paddingX:{type:ControlType.Number,title:\"Padding X\",defaultValue:22,min:0,max:60,unit:\"px\"},paddingY:{type:ControlType.Number,title:\"Padding Y\",defaultValue:14,min:0,max:40,unit:\"px\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:18,min:12,max:40,unit:\"px\"},newTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WhatsAppButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WhatsAppButton.map"],"mappings":"mKAGA,SAAS,EAAU,EAAM,EAAQ,CAAyI,MAAM,kBAAhI,GAAO,EAAA,CAAe,QAAQ,SAAS,EAAE,CAAC,CAAC,QAAQ,MAAM,EAA6F,IAA9E,EAAQ,SAAS,mBAAmB,CAAO,IAAI,IAA0C,CAAC,SAAS,EAAS,CAAC,OAAK,SAAO,CAAC,OAAoB,EAAM,MAAM,CAAC,MAAM,EAAK,OAAO,EAAK,QAAQ,YAAY,cAAc,OAAO,MAAM,CAAC,WAAW,EAAE,QAAQ,OAAO,EAAE,SAAS,CAAc,EAAK,OAAO,CAAC,EAAE,wEAAwE,KAAK,OAAO,OAAO,EAAM,YAAY,IAAI,eAAe,OAAO,CAAC,EAAe,EAAK,OAAO,CAAC,EAAE,yOAAyO,KAAK,CAAK,CAAC,CAAC,CAAC,CAAC,CAAE,CAK1zB,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,GAAG,UAAQ,GAAG,QAAM,kBAAkB,YAAU,GAAK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