{"version":3,"file":"LemonSqueezy.BPIHKSP3.mjs","names":[],"sources":["https:/framerusercontent.com/modules/1mkt2plloPEOvoe16UUK/EUmeSZzQepu1cHilAvr7/LemonSqueezy.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useEffect}from\"react\";/**\n *\n * LEMON SQUEEZY\n * By Benjamin\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 100\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */ export default function LemonSqueezy(props){const{styleOptions,hoverOptions}=props;const{backgroundColor,color,borderRadius,padding,paddingPerSide,paddingTop,paddingRight,paddingBottom,paddingLeft}=styleOptions;const paddingValue=paddingPerSide?`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`:`${padding}px`;/* Only load the lemon script if you want an Overlay\n     * Otherwise, do not include—also, only load it once\n     * whenever you have multiple instances on your page.\n     */ useConditionalScript(!props.isRedirect,\"https://app.lemonsqueezy.com/js/lemon.js\",\"lemon-squeezy-framer-component\");return /*#__PURE__*/ _jsx(motion.a,{href:props.url,className:props.isRedirect?\"\":\"lemonsqueezy-button\",target:props.isRedirect?\"_blank\":\"_self\",style:{fontSize:16,lineHeight:1,fontFamily:\"Inter\",fontWeight:500,...props.style,...buttonStyles,...props.fontControl,padding:paddingValue,color:color,backgroundColor:backgroundColor,borderRadius:borderRadius,userSelect:\"none\",placeContent:flexAlignSwitch(props.fontControl),whiteSpace:\"nowrap\"},whileHover:{scale:hoverOptions===null||hoverOptions===void 0?void 0:hoverOptions.hoverScale,backgroundColor:hoverOptions===null||hoverOptions===void 0?void 0:hoverOptions.hoverBackgroundColor,color:hoverOptions===null||hoverOptions===void 0?void 0:hoverOptions.hoverColor},transition:props.hoverTransition,children:props.text});};LemonSqueezy.displayName=\"Lemon Squeezy\";addPropertyControls(LemonSqueezy,{text:{title:\"Text\",type:ControlType.String,defaultValue:\"Buy Now\"},url:{title:\"Link\",type:ControlType.String,defaultValue:\"https://makelemonade.lemonsqueezy.com/checkout/buy/0929c351-abb3-49f7-a671-ba15406517dd\"},isRedirect:{title:\"Type\",type:ControlType.Boolean,enabledTitle:\"Link\",disabledTitle:\"Overlay\",defaultValue:true},fontControl:{type:ControlType.Font,title:\"Font\",controls:\"extended\"},styleOptions:{type:ControlType.Object,title:\"Styles\",buttonTitle:\"Button, Font\",controls:{backgroundColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#40F\"},color:{type:ControlType.Color,defaultValue:\"#FFF\"},borderRadius:{type:ControlType.Number,title:\"Radius\",displayStepper:true,defaultValue:50},padding:{title:\"Padding\",type:ControlType.FusedNumber,toggleKey:\"paddingPerSide\",toggleTitles:[\"Padding\",\"Padding per side\"],defaultValue:10,valueKeys:[\"paddingTop\",\"paddingRight\",\"paddingBottom\",\"paddingLeft\",],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0}}},hoverOptions:{type:ControlType.Object,title:\"Hover\",buttonTitle:\"Effect\",optional:true,description:\"Learn more about the Checkout options [here](https://docs.lemonsqueezy.com/help/checkout/checkout-overlay)\",controls:{hoverScale:{type:ControlType.Number,title:\"Scale\",min:0,max:10,displayStepper:true,step:.01,defaultValue:1.1},hoverBackgroundColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#111\",optional:true},hoverColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FFF\",optional:true},hoverTransition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{type:\"spring\",stiffness:400,damping:30}}}}});const buttonStyles={display:\"flex\",placeItems:\"center\",placeContent:\"center\",textDecoration:\"none\"};/* Use external script conditionally */ const useConditionalScript=(condition,url,id)=>{useEffect(()=>{if(!condition)return;if(document.querySelector(`#${id}`))return;const script=document.createElement(\"script\");script.src=url;script.id=id;script.defer=true;script.onload=()=>{var ref;if(window.LemonSqueezy)return;(ref=window.createLemonSqueezy)===null||ref===void 0?void 0:ref.call(window);};document.body.appendChild(script);},[url,id,condition]);};/* Match flex content alignment with text align */ const flexAlignSwitch=fontControlStyles=>{if(fontControlStyles.textAlign===\"left\"){return\"flex-start\";}if(fontControlStyles.textAlign===\"right\"){return\"flex-end\";}return\"center\";};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LemonSqueezy\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicHeight\":\"100\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"200\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LemonSqueezy.map"],"mappings":"0XAUI,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,eAAa,gBAAc,EAAW,CAAC,kBAAgB,QAAM,eAAa,UAAQ,iBAAe,aAAW,eAAa,gBAAc,eAAa,EAAmB,EAAa,EAAe,GAAG,EAAW,KAAK,EAAa,KAAK,EAAc,KAAK,EAAY,IAAI,GAAG,EAAQ,IAGhN,OAApH,EAAqB,CAAC,EAAM,WAAW,2CAA2C,iCAAiC,CAAsB,EAAK,EAAO,EAAE,CAAC,KAAK,EAAM,IAAI,UAAU,EAAM,WAAW,GAAG,sBAAsB,OAAO,EAAM,WAAW,SAAS,QAAQ,MAAM,CAAC,SAAS,GAAG,WAAW,EAAE,WAAW,QAAQ,WAAW,IAAI,GAAG,EAAM,MAAM,GAAG,EAAa,GAAG,EAAM,YAAY,QAAQ,EAAmB,QAAsB,kBAA6B,eAAa,WAAW,OAAO,aAAa,EAAgB,EAAM,YAAY,CAAC,WAAW,SAAS,CAAC,WAAW,CAAC,MAAM,GAA+D,WAAW,gBAAgB,GAA+D,qBAAqB,MAAM,GAA+D,WAAW,CAAC,WAAW,EAAM,gBAAgB,SAAS,EAAM,KAAK,CAAC,4BAbh1B,IAAoD,IAAkC,IAA6B,CAaguB,EAAa,YAAY,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