{"version":3,"file":"Examples_1.DxXU9Apy.mjs","names":[],"sources":["https:/framerusercontent.com/modules/rfMnn2tRs6np85SGIb8T/ZCElhlXQnXNp98XgpMx2/utils.js","https:/framerusercontent.com/modules/MmCDjzxOQP7k7Vhi9swx/WGGPKLm2nmxsBiMjy83b/Examples_1.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";const utmContentsObj={// <utm content value> :[<button title>, <link content>]\nredeem_cta:[\"Get 29% off monthly\",\"Get 29% off annual\",\"Redeem now\"],signup_cta:[\"Sign Up For Viki\",\"Sign up for free\"],join_cta:[\"Join Viki\"],watch_cta:[\"Watch Now\"]};const utmCampaignObj={};export function getUrlWithUTMParams(link,content,isNav){if(!link){return\"\";}const path=window.location.pathname.split(\"/\").join(\"\");const utmCampaign=utmCampaignObj[path]||path;let utm_content=content?Object.keys(utmContentsObj).find(key=>utmContentsObj[key].includes(content)):undefined;let utm_content_value=utm_content+(isNav?\"_nav\":\"\");const modifiedURL=(link.includes(\"?\")?`${link}&utm_source=framer&utm_campaign=${utmCampaign}`:`${link}?utm_source=framer&utm_campaign=${utmCampaign}`)+(utm_content?`&utm_content=${utm_content_value}`:\"\");return modifiedURL;}//eventType: string\n//eventProperies: object, eg:{\"property1\":\"value1\"}\nexport const sendAmplitudeEvent=(eventType,eventProperties)=>{if(window.amplitude){window.amplitude.logEvent(eventType,{\"[Amplitude] Page Domain\":window.location.hostname,\"[Amplitude] Page Location\":window.location.href,\"[Amplitude] Page Path\":window.location.pathname,...eventProperties});}else{console.log(`[Amplitude]:Error sending ${eventType} event, amplitude not found`);}};function AmplitudeEventFuncTemplate(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>{sendAmplitudeEvent(\"[Amplitude] <Event Name>\",{// can add more event properties here in the following format\n\"[Amplitude] event_property_name\":\"<event_property_value>\"});if(props.onClick){props.onClick();}}});};}export function getLinkPropName(props){// props.link ?? props.cTALink ?? props.href ?? props.url\nconst possiblePropNames=[\"link\",\"cTALink\",\"href\",\"url\"];// possiblePropNames.forEach((propName) => {\n//     if (props[propName]) {\n//         // console.log(propName)\n//         return propName\n//     }\n// })\nreturn possiblePropNames.find(item=>Object.keys(props).includes(item));// return undefined\n}export function getKDramaTitle(){}\nexport const __FramerMetadata__ = {\"exports\":{\"sendAmplitudeEvent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getLinkPropName\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getUrlWithUTMParams\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getKDramaTitle\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./utils.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";import{getLinkPropName,getUrlWithUTMParams,sendAmplitudeEvent}from\"https://framerusercontent.com/modules/rfMnn2tRs6np85SGIb8T/ZCElhlXQnXNp98XgpMx2/utils.js\";// Learn more: https://www.framer.com/docs/guides/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function withRotate(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,animate:{rotate:90},transition:{duration:2}});};}export function withHover(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,whileHover:{scale:1.05}});};}export function withRandomColor(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});};}export function SeeProps(Component){return props=>{// console.log(props)\nreturn /*#__PURE__*/_jsx(Component,{...props});};}// AMPLITUDE CODE OVERRIDES\n// Reusable function for buttons to send amplitude event\n// [Amplitude] Title is the <button text>, for buttons in nav bar there will be with a `Nav` suffix\nexport function AmplitudeTrackButton(Component){return props=>{var _props_link,_ref,_ref1;// console.log(props)\nconst link=(_ref1=(_ref=(_props_link=props.link)!==null&&_props_link!==void 0?_props_link:props.cTALink)!==null&&_ref!==void 0?_ref:props.href)!==null&&_ref1!==void 0?_ref1:props.url;return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>{sendAmplitudeEvent(\"[Amplitude] Button Clicked\",{// button: title\n...props.title&&{\"[Amplitude] Title\":props.title},...props.editTitle&&{\"[Amplitude] Title\":props.editTitle+\" Nav\"},...link&&{\"[Amplitude] Link\":link}});if(props.onClick){props.onClick();}}});};}// Reusable function for links to send amplitude event\nexport function AmplitudeTrackLink(Component){return props=>{var _props_link,_ref,_ref1;// console.log(props)\\\nconst link=(_ref1=(_ref=(_props_link=props.link)!==null&&_props_link!==void 0?_props_link:props.cTALink)!==null&&_ref!==void 0?_ref:props.href)!==null&&_ref1!==void 0?_ref1:props.url;return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>{sendAmplitudeEvent(\"[Amplitude] Link Clicked\",{// link: content\n...props.content&&{\"[Amplitude] Content\":props.content},...link&&{\"[Amplitude] Link\":link}});if(props.onClick){props.onClick();}}});};}export function SendUTMParams(Component){return props=>{var _props_title;const content=(_props_title=props.title)!==null&&_props_title!==void 0?_props_title:props.content;const modifiedURL=getUrlWithUTMParams(props.link,content);return /*#__PURE__*/_jsx(Component,{...props,link:modifiedURL});};}// Reusable function for buttons to send amplitude event with utm params\nexport function AmplitudeTrackButtonWithUTMParams(Component){return props=>{// console.log(props)\nconst isNav=!!props.cTALink;const linkPropName=getLinkPropName(props);const link=props[linkPropName];var _props_title;const modifiedURL=getUrlWithUTMParams(link,(_props_title=props.title)!==null&&_props_title!==void 0?_props_title:props.editTitle,isNav);return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>{sendAmplitudeEvent(\"[Amplitude] Button Clicked\",{// button: title\n...props.title&&{\"[Amplitude] Title\":props.title},...props.editTitle&&{\"[Amplitude] Title\":props.editTitle+\" Nav\"},...link&&{\"[Amplitude] Link\":link}});if(props.onClick){props.onClick();}},...link&&{[linkPropName]:modifiedURL}});};}// Reusable function for links to send amplitude  event with utm params\nexport function AmplitudeTrackLinkWithUTMParams(Component){return props=>{var _props_link,_ref,_ref1;const link=(_ref1=(_ref=(_props_link=props.link)!==null&&_props_link!==void 0?_props_link:props.cTALink)!==null&&_ref!==void 0?_ref:props.href)!==null&&_ref1!==void 0?_ref1:props.url;const modifiedURL=getUrlWithUTMParams(link,props.content||\"\");return /*#__PURE__*/_jsx(Component,{...props,link:modifiedURL,href:modifiedURL,onClick:()=>{sendAmplitudeEvent(\"[Amplitude] Link Clicked\",{// link: content\n...props.content&&{\"[Amplitude] Content\":props.content},...link&&{\"[Amplitude] Link\":link}});if(props.onClick){props.onClick();}}});};}export function SendAmplitudeEvent(Component){return props=>{// console.log(props)\nreturn /*#__PURE__*/_jsx(Component,{...props,onClick:()=>{sendAmplitudeEvent(\"[Amplitude] Button Clicked\",{// button: title\n...props.title&&{\"[Amplitude] Title\":props.title}});if(props.onClick){props.onClick();}}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"SendUTMParams\":{\"type\":\"reactHoc\",\"name\":\"SendUTMParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SeeProps\":{\"type\":\"reactHoc\",\"name\":\"SeeProps\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"AmplitudeTrackButtonWithUTMParams\":{\"type\":\"reactHoc\",\"name\":\"AmplitudeTrackButtonWithUTMParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"AmplitudeTrackButton\":{\"type\":\"reactHoc\",\"name\":\"AmplitudeTrackButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"AmplitudeTrackLink\":{\"type\":\"reactHoc\",\"name\":\"AmplitudeTrackLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SendAmplitudeEvent\":{\"type\":\"reactHoc\",\"name\":\"SendAmplitudeEvent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"AmplitudeTrackLinkWithUTMParams\":{\"type\":\"reactHoc\",\"name\":\"AmplitudeTrackLinkWithUTMParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples_1.map"],"mappings":"6QACgM,SAAgB,EAAoB,EAAK,EAAQ,EAAM,CAAC,GAAG,CAAC,EAAM,MAAM,GAAI,IAAM,EAAK,EAAO,SAAS,SAAS,MAAM,KAAK,KAAK,IAAU,EAAY,EAAe,IAAO,EAAS,EAAY,EAAQ,OAAO,KAAK,GAAgB,KAAK,GAAK,EAAe,GAAK,SAAS,IAAU,IAAA,GAAc,EAAkB,GAAa,EAAM,OAAO,IAAU,GAAa,EAAK,SAAS,KAAK,GAAG,EAAK,kCAAkC,IAAc,GAAG,EAAK,kCAAkC,MAAgB,EAAY,gBAAgB,IAAoB,IAAI,OAAO,CAAa,CAG7oB,SAAgB,EAAgB,EAAM,CAC7I,IAAM,EAAkB,CAAC,OAAO,UAAU,OAAO,MAAM,CAMvD,OAAO,EAAkB,KAAK,GAAM,OAAO,KAAK,GAAO,SAAS,GAC/D,6BAZgD,EAAe,CAChE,WAAW,CAAC,sBAAsB,qBAAqB,aAAa,CAAC,WAAW,CAAC,mBAAmB,mBAAmB,CAAC,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,YAAY,CAAC,CAAO,EAAe,EAAE,CAElL,GAAoB,EAAU,IAAkB,CAAI,EAAO,UAAW,EAAO,UAAU,SAAS,EAAU,CAAC,0BAA0B,EAAO,SAAS,SAAS,4BAA4B,EAAO,SAAS,KAAK,wBAAwB,EAAO,SAAS,SAAS,GAAG,EAAgB,EAAQ,QAAQ,IAA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