{"version":3,"file":"Templates.Cv0Td4JC.mjs","names":[],"sources":["https:/framer.com/m/GoToMarket-Erpt.js@hA8MMwWG46zkCbJljD9W","https:/framerusercontent.com/modules/Zjk3yhZGNzjpWogZHkta/85aVs97peiXEnYTXdH2a/Templates.js"],"sourcesContent":["export const GoToMarket={enableCookies(){if(!window.dataLayer)return;window.dataLayer.push({event:\"cookieConsentAllow\",cookieConsent:\"allow\"});},trackEvent(data,cb){if(!data.category||!data.action||!window.dataLayer){return;}window.dataLayer.push({event:\"eventTracking\",trackingEventCategory:data.category,trackingEventAction:data.action,trackingEventLabel:data.label||\"\",trackingEventValue:data.value||\"\",nonInteraction:data.nonInteraction||false,eventCallback:cb});},trackConversion(data){if(!data.id||!data.label||!window.dataLayer){return;}window.dataLayer.push({event:\"conversionTracking\",trackingConversionId:data.id,trackingConversionLabel:data.label,trackingConversionValue:data.value,trackingConversionOrderId:data.orderId,trackingConversionCurrency:data.currency});}};\nexport const __FramerMetadata__ = {\"exports\":{\"GoToMarket\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"EventCategory\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GoToMarket.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{GoToMarket}from\"https://framer.com/m/GoToMarket-Erpt.js@hA8MMwWG46zkCbJljD9W\";import Templates from\"https://framerusercontent.com/modules/tMqBKhK5fPZK60P005NV/mZIwfiPx3rQr1HuR9xqR/KepDSY1eF.js\";// import TemplateCreators from \"../collection/mwrRQMatp\"\nimport{useRouter,useQueryData}from\"framer\";export function withTracking(Component){return props=>{const isFreeTemplate=!props.label||isNaN(props.label);const handleClick=()=>{GoToMarket.trackEvent({action:\"use\",category:\"Templates\",label:isFreeTemplate?\"Free\":\"Premium\"});};const linkWithParam=new URL(props.link);if(isFreeTemplate){linkWithParam.searchParams.append(\"duplicateType\",\"siteTemplate\");}return /*#__PURE__*/_jsx(Component,{...props,link:linkWithParam.href,onClick:handleClick,label:isFreeTemplate?\"Use for Free\":`Purchase for $${parseInt(props.label)}`});};}export function withViewportHeight(Component){// Set height to 80vh\nreturn props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{minHeight:\"80vh\"}});};}export function withPagesCount(Component){return({pages,...rest})=>{// Split pages by \",\"\nconst pagesArray=pages.split(\",\");// Get pages length\nconst pagesCount=pagesArray.length;const router=useRouter();const route=router.getRoute(router.currentRouteId);return /*#__PURE__*/_jsx(Component,{...rest,pages:pagesCount});};}export function withLogging(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props});};}const useStore=createStore({activeSection:\"Description\"});export function withDescriptionActiveState(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,variant:store.activeSection===\"Description\"?\"Large Active\":\"Large\",onClick:()=>setStore({activeSection:\"Description\"})});};}export function withFeaturesActiveState(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,variant:store.activeSection===\"Features\"?\"Large Active\":\"Large\",onClick:()=>setStore({activeSection:\"Features\"})});};}export function withSupportActiveState(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,variant:store.activeSection===\"Support\"?\"Large Active\":\"Large\",onClick:()=>setStore({activeSection:\"Support\"})});};}export function withDescriptionVisibility(Component){return props=>{const[store]=useStore();return store.activeSection===\"Description\"?/*#__PURE__*/_jsx(Component,{...props}):null;};}export function withFeaturesVisibility(Component){return props=>{const[store]=useStore();return store.activeSection===\"Features\"?/*#__PURE__*/_jsx(Component,{...props,hidden:false}):null;};}export function withSupportVisibility(Component){return props=>{const[store]=useStore();return store.activeSection===\"Support\"?/*#__PURE__*/_jsx(Component,{...props,hidden:false}):null;};}function getTemplateCategoryCount({category,free,featured,author}){const categoriesKey=\"aJRm2tjBA\";const priceKey=\"LZxxE3ltn\";const featuredKey=\"GICnMHZxs\";const authorKey=\"QbVvjfx8t\";const categoryWhereClause={arguments:[{name:\"aJRm2tjBA\",type:\"Identifier\"},{type:\"LiteralValue\",value:category}],functionName:\"CONTAINS\",type:\"FunctionCall\"};const authorWhereClause={left:{name:\"QbVvjfx8t\",type:\"Identifier\"},operator:\"==\",right:{type:\"LiteralValue\",value:author},type:\"BinaryOperation\"};const freeWhereClause={operator:\"not\",type:\"UnaryOperation\",value:{left:{left:{name:\"LZxxE3ltn\",type:\"Identifier\"},operator:\"!=\",right:{type:\"LiteralValue\",value:null},type:\"BinaryOperation\"},operator:\"and\",right:{left:{name:\"LZxxE3ltn\",type:\"Identifier\"},operator:\"!=\",right:{type:\"LiteralValue\",value:\"\"},type:\"BinaryOperation\"},type:\"BinaryOperation\"}};const featuredWhereClause={name:\"GICnMHZxs\",type:\"Identifier\"};const andWhereClauses=(clause1,clause2)=>({left:clause1,operator:\"and\",right:clause2,type:\"BinaryOperation\"});let whereClause;if(category){whereClause=categoryWhereClause;}if(author){whereClause=whereClause?andWhereClauses(whereClause,authorWhereClause):authorWhereClause;}if(free){whereClause=whereClause?andWhereClauses(whereClause,freeWhereClause):freeWhereClause;}if(featured){whereClause=whereClause?andWhereClauses(whereClause,featuredWhereClause):featuredWhereClause;}const filteredTemplates=useQueryData({select:[],from:{type:\"Collection\",data:Templates},where:whereClause});return`${filteredTemplates.length}`;}export function withCategoryCount(Component){return props=>{const count=getTemplateCategoryCount({category:props.category,free:props.free});return /*#__PURE__*/_jsx(Component,{...props,count:count});};}export function withCatgegoryFreeCount(Component){return props=>{const count=getTemplateCategoryCount({category:props.category,free:true});return /*#__PURE__*/_jsx(Component,{...props,count:count});};}export function withAuthorCount(Component){return props=>{const count=getTemplateCategoryCount({author:props.author});return /*#__PURE__*/_jsx(Component,{...props,count:count});};}export function sidebarTopic(Component){return props=>{const isActive=props.topic===props.pageTopic;const isFeatured=props.topic===\"Featured\";const count=getTemplateCategoryCount({category:isFeatured?null:props.topic,featured:isFeatured});return /*#__PURE__*/_jsx(Component,{...props,variant:isActive?\"Open\":\"Closed\",count:props.count||count});};}const useCategoryStore=createStore({previewUrl:\"\"});export function withPreviewUrlSetter(Component){return props=>{const[_,setStore]=useCategoryStore();function setPreviewUrl(index){setStore({previewUrl:props.previewLink});}return /*#__PURE__*/_jsx(Component,{...props,onClick:setPreviewUrl});};}export function withPreviewUrl(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,preview:props.link});};}export function withPreviewUrlFromStore(Component){return props=>{const[{previewUrl}]=useCategoryStore();return /*#__PURE__*/_jsx(Component,{...props,preview:previewUrl,link:previewUrl});};}/*\nexport function withAuthorVariant(Component): ComponentType {\n    return (props) => {\n        const nameKey = \"cnajZUAp_\"\n\n        const authors = useQueryData({\n            select: [],\n            from: {\n                type: \"Collection\",\n                data: TemplateCreators,\n            },\n            where: {\n                left: { name: \"cnajZUAp_\", type: \"Identifier\" },\n                operator: \"==\",\n                right: { type: \"LiteralValue\", value: props.author },\n                type: \"BinaryOperation\",\n            },\n        })\n\n        const isTopCreator = authors.length > 0\n\n        return (\n            <Component {...props} variant={isTopCreator ? \"Top\" : \"Regular\"} />\n        )\n    }\n}\n*/\nexport const __FramerMetadata__ = {\"exports\":{\"withTracking\":{\"type\":\"reactHoc\",\"name\":\"withTracking\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPreviewUrlFromStore\":{\"type\":\"reactHoc\",\"name\":\"withPreviewUrlFromStore\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCategoryCount\":{\"type\":\"reactHoc\",\"name\":\"withCategoryCount\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDescriptionVisibility\":{\"type\":\"reactHoc\",\"name\":\"withDescriptionVisibility\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAuthorCount\":{\"type\":\"reactHoc\",\"name\":\"withAuthorCount\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPagesCount\":{\"type\":\"reactHoc\",\"name\":\"withPagesCount\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDescriptionActiveState\":{\"type\":\"reactHoc\",\"name\":\"withDescriptionActiveState\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFeaturesVisibility\":{\"type\":\"reactHoc\",\"name\":\"withFeaturesVisibility\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"sidebarTopic\":{\"type\":\"reactHoc\",\"name\":\"sidebarTopic\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSupportActiveState\":{\"type\":\"reactHoc\",\"name\":\"withSupportActiveState\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLogging\":{\"type\":\"reactHoc\",\"name\":\"withLogging\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPreviewUrlSetter\":{\"type\":\"reactHoc\",\"name\":\"withPreviewUrlSetter\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withViewportHeight\":{\"type\":\"reactHoc\",\"name\":\"withViewportHeight\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSupportVisibility\":{\"type\":\"reactHoc\",\"name\":\"withSupportVisibility\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPreviewUrl\":{\"type\":\"reactHoc\",\"name\":\"withPreviewUrl\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCatgegoryFreeCount\":{\"type\":\"reactHoc\",\"name\":\"withCatgegoryFreeCount\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFeaturesActiveState\":{\"type\":\"reactHoc\",\"name\":\"withFeaturesActiveState\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Templates.map"],"mappings":"gUAEsC,MCE0kI,SAAS,EAAqB,EAAU,CAAC,MAAO,CAAA,GAAO,CAAC,GAAK,CAAC,EAAE,EAAS,CAAC,GAAkB,CAAC,SAAS,EAAc,EAAM,CAAC,EAAS,CAAC,WAAW,EAAM,WAAY,EAAC,AAAE,OAAoB,GAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,CAAc,EAAC,AAAE,CAAE,CAAO,SAAS,EAAe,EAAU,CAAC,MAAO,CAAA,GAA4B,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,EAAM,IAAK,EAAC,AAAI,kBAAha,AAJ3jI,GAA2C,IAAqE,IAAqF,IAAoH,CACzT,GAA2C,CAGoP,EAAS,EAAY,CAAC,cAAc,aAAc,EAAC,CAAyuH,EAAiB,EAAY,CAAC,WAAW,EAAG,EAAC"}