{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/hbGm8FfO1yg34yOx8Bdg/ZF1EmS74Qz4QXQiALdpz/TemplateUnlockedVariants.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{cloneElement}from\"react\";import{useTemplateSales,useSupabase,Tier}from\"https://framerusercontent.com/modules/dXm8rDRqd1XKlbKiAEEC/0Hj09I94t2jDx2HuEldP/SupabaseMain.js\";export default function TemplateUnlockedVariants(props){const{type}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[session,tier]=useSupabase(state=>[state.session,state.tier]);const templateSales=useTemplateSales();const state=isTemplateUnlocked(tier,type,props.templateName,props.bundleName,templateSales)?\"unlocked\":\"locked\";const layer=props[state]?.[0];if(!layer){return /*#__PURE__*/_jsx(\"div\",{style:{width:isCanvas?40:0,height:isCanvas?40:0}});}return /*#__PURE__*/cloneElement(layer,{style:{...layer.props?.style,...props.style}});}TemplateUnlockedVariants.displayName=\"Template Unlocked Variants\";addPropertyControls(TemplateUnlockedVariants,{type:{type:ControlType.Enum,defaultValue:\"template\",options:[\"template\",\"bundle\"],optionTitles:[\"Template\",\"Bundle\"],displaySegmentedControl:true},locked:{type:ControlType.ComponentInstance},unlocked:{type:ControlType.ComponentInstance},templateName:{type:ControlType.String,placeholder:\"Title Field\",hidden:props=>props.type!==\"template\"},bundleName:{type:ControlType.String,placeholder:\"Bundle's Product Name Field\"}});function isTemplateUnlocked(tier,type,templateName,bundleName,templateSales){if(type===\"bundle\"){if(!Array.isArray(templateSales)){return false;}for(const template of templateSales){if(template.product_name===bundleName){return true;}}}else{if(tier===Tier.AllAccess){return true;}if(!Array.isArray(templateSales)){return false;}for(const template of templateSales){if(template.product_name===templateName||template.product_name===bundleName){return true;}}}return false;}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TemplateUnlockedVariants\",\"slots\":[],\"annotations\":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,IAAOc,EAAK,UAAW,MAAO,GAAM,GAAG,CAAC,MAAM,QAAQX,CAAa,EAAG,MAAO,GAAO,QAAUU,KAAYV,EAAe,GAAGU,EAAS,eAAeF,GAAcE,EAAS,eAAeD,EAAY,MAAO,EAAO,CAAC,MAAO,EAAM",
  "names": ["TemplateUnlockedVariants", "props", "type", "isCanvas", "RenderTarget", "session", "tier", "useSupabase", "state", "templateSales", "useTemplateSales", "isTemplateUnlocked", "layer", "q", "p", "addPropertyControls", "ControlType", "templateName", "bundleName", "template", "Tier"]
}
