{"version":3,"file":"LinkButton.BASbfAho.mjs","names":["e"],"sources":["https:/framerusercontent.com/modules/k97O0IJPzWMRFXRDLJXs/Re8mGchUEbQY9TAbhCVP/HOC.js","https:/framerusercontent.com/modules/zXZr7g9DnMeJkwBpv6Xb/ayx2z1ywTxAIQ89C1jyj/LinkButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";// Learn more: https://www.framer.com/developers/overrides/\nconst checkIsBEInstalled=()=>{return document.documentElement.hasAttribute(\"data-be-installed\")||!!window.installedExtension;};const getCurrentExtensionVersion=()=>{return document?.body?.dataset?.linerExtensionVersion||undefined;};const checkIsMobile=()=>{const windowUserAgent=window.navigator?.userAgent;const isMobile=Boolean(windowUserAgent.match(/Android|Mobile|iP(hone|od|ad)|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/));return isMobile;};const getDomain=url=>{const regex=/^https?\\:\\/\\/([^\\/?#]+)(?:[\\/?#]|$)/i//eslint-disable-line\n;const urlMatches=url.match(regex);const domain=urlMatches&&urlMatches[1];if(domain?.startsWith(\"www.\")){return domain.slice(4);}return domain||\"\";};const getAmpEventPage=()=>{if(window.location.pathname.includes(\"/news\")){return\"news\";}else if(window.location.pathname.includes(\"/learn\")){return\"learn\";}return\"home\";};const getAmpDefaultProps=()=>{return{liner_service:\"web\",is_be_installed:checkIsBEInstalled(),is_mobile:checkIsMobile(),url:window.location.href,url_domain:getDomain(window.location.href),liner_extension_version:getCurrentExtensionVersion(),event_page:getAmpEventPage()};};const ampLogEvent=(eventName,props)=>{try{window.amplitude.track(eventName,{...getAmpDefaultProps(),...props});}catch(e){console.error(e);}};export function withHover(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,whileHover:{scale:1.05}});};}export function withContentClick(Component){return({onClick,...restProps})=>{const onClickComponent=e=>{try{const section=window.location.pathname.includes(\"/news\")?\"news\":\"learn\";const contentTitle=e.target.closest(\"a\").querySelector(\"h2\").textContent.trim();ampLogEvent(`click_${section}_content_list`,{content_title:contentTitle});if(onClick){onClick();}}catch(e){console.error(e);}};return /*#__PURE__*/_jsx(Component,{...restProps,onClick:onClickComponent});};}export function withCTAEvent(Component){return({onClick,...restProps})=>{const onClickCTA=e=>{try{const section=window.location.pathname.includes(\"/news\")?\"news\":\"learn\";const buttonTitle=e.target.textContent.trim();const contentTitle=document.querySelector(\"h1\").textContent.trim();ampLogEvent(`click_${section}_content_to_liner_button`,{content_title:contentTitle,button_title:buttonTitle});if(onClick){onClick();}}catch(e){console.error(e);}};return /*#__PURE__*/_jsx(Component,{...restProps,onClick:onClickCTA});};}export function withNoFollow(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,rel:\"nofollow noopener\"});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCTAEvent\":{\"type\":\"reactHoc\",\"name\":\"withCTAEvent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNoFollow\":{\"type\":\"reactHoc\",\"name\":\"withNoFollow\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withContentClick\":{\"type\":\"reactHoc\",\"name\":\"withContentClick\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HOC.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/components/auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function LinkButton(props){const onClick=()=>{const url=new URL(props.link);try{if(url.hostname.includes(\"getliner.com\")){url.searchParams.set(\"ampDeviceId\",window.amplitude.getDeviceId());url.searchParams.set(\"ampSessionId\",window.amplitude.getSessionId());}}catch(e){console.error(e);}window.open(url,\"_blank\");};return /*#__PURE__*/_jsx(\"button\",{style:{display:\"flex\",width:\"170px\",alignItems:\"center\",justifyContent:\"center\",padding:\"14px 16px\",border:\"none\",fontFamily:\"Inter\",fontWeight:700,fontSize:\"16px\",lineHeight:\"120%\",cursor:\"pointer\",backgroundColor:props.backgroundColor,borderRadius:props.borderRadius,color:props.color},type:\"button\",onClick:onClick,children:props.text});}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\naddPropertyControls(LinkButton,{backgroundColor:{type:ControlType.Color,defaultValue:\"#14371B\",optional:true},borderRadius:{type:ControlType.BorderRadius,defaultValue:\"8px\",title:\"Radius\"},link:{type:ControlType.Link},color:{type:ControlType.Color,defaultValue:\"fff\"},text:{type:ControlType.String}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LinkButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LinkButton.map"],"mappings":"qKAE8yC,SAAgB,EAAa,EAAU,CAAC,OAAO,CAAC,UAAQ,GAAG,KAAa,CAAC,IAAM,EAAW,GAAG,CAAC,GAAG,CAAC,IAAM,EAAQ,EAAO,SAAS,SAAS,SAAS,QAAQ,CAAC,OAAO,QAAc,EAAY,EAAE,OAAO,YAAY,MAAM,CAAO,EAAa,SAAS,cAAc,KAAK,CAAC,YAAY,MAAM,CAAC,EAAY,SAAS,EAAQ,0BAA0B,CAAC,cAAc,EAAa,aAAa,EAAY,CAAC,CAAI,GAAS,GAAS,OAASA,EAAE,CAAC,QAAQ,MAAMA,EAAE,GAAI,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAU,QAAQ,EAAW,CAAC,qCAFtwD,CACrC,MAA+B,SAAS,gBAAgB,aAAa,oBAAoB,EAAE,CAAC,CAAC,EAAO,mBAA2B,MAAuC,UAAU,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