{"version":3,"file":"LayerSwitch.CsS7SLA7.mjs","names":[],"sources":["https:/framerusercontent.com/modules/mfwsVVw4L9ZhH8zGdnGv/I31AfZj0CKyWxRVFTeE5/LayerSwitch.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,withCSS,RenderTarget}from\"framer\";import{styleLayer,EmptyState,hasProducts,fetchUserData}from\"https://framerusercontent.com/modules/diyk5889JEo4mM5y5sJr/k488EAt1FhWtVFD0n6vD/ThentyShared.js\";function LayerSwitchComponent({productIdsType,productIds,textProductIds,lockedLayer,unlockedLayer,style}){const{loggedIn}=fetchUserData();const isCanvas=RenderTarget.current()===RenderTarget.canvas;const unlockedElement=unlockedLayer?.[0];const lockedElement=lockedLayer?.[0];const finalProductIds=productIdsType===\"text\"?typeof textProductIds===\"string\"?textProductIds.split(\",\").map(id=>id.trim()):[]:productIds;const hasProductsResult=hasProducts(finalProductIds);const canAccess=finalProductIds.length===0?loggedIn:hasProductsResult;const layer=canAccess?unlockedElement:lockedElement;if(isCanvas&&!unlockedElement&&!lockedElement){return /*#__PURE__*/_jsx(EmptyState,{title:\"Connect locked and unlocked layers\",subtitle:\"Connect layers from outside the breakpoint for the locked and unlocked states.\"});}return layer?styleLayer(layer,style):/*#__PURE__*/_jsx(\"div\",{className:\"thenty-hide-element\"});}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n *\n * @framerDisableUnlink\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 300\n */const LayerSwitch=withCSS(LayerSwitchComponent,[\".thenty-hide-element { display: none; }\",\"div:has(> .thenty-hide-element) { display: none; }\"],\"thenty\");export default LayerSwitch;LayerSwitch.displayName=\"Thenty Layer Switch\";addPropertyControls(LayerSwitch,{productIdsType:{type:ControlType.Enum,defaultValue:\"array\",options:[\"text\",\"array\"],optionTitles:[\"Text\",\"List\"],displaySegmentedControl:true,title:\"Type\"},productIds:{type:ControlType.Array,title:\"Product IDs\",propertyControl:{type:ControlType.String,placeholder:\"Thenty Product ID\",defaultValue:\"\"},hidden:props=>props.productIdsType!==\"array\"},textProductIds:{type:ControlType.String,defaultValue:\"\",placeholder:\"Product IDs\",title:\"Product IDs\",description:\"Comma-separated list of product IDs\",hidden:props=>props.productIdsType!==\"text\"},lockedLayer:{type:ControlType.ComponentInstance,title:\"Locked\"},unlockedLayer:{type:ControlType.ComponentInstance,title:\"Unlocked\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LayerSwitch\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicHeight\":\"300\",\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"*\",\"framerIntrinsicWidth\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"kPAAiR,SAAS,EAAqB,CAAC,iBAAe,aAAW,iBAAe,cAAY,gBAAc,SAAO,CAAC,GAAK,CAAC,YAAU,GAAe,CAAO,EAAS,EAAa,SAAS,GAAG,EAAa,OAAa,EAAgB,IAAgB,GAAS,EAAc,IAAc,GAAS,EAAgB,IAAiB,OAAO,OAAO,GAAiB,SAAS,EAAe,MAAM,IAAI,CAAC,IAAI,GAAI,EAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EAAiB,EAAkB,EAAY,EAAgB,CAA6E,GAA5D,EAAgB,SAAS,EAAE,EAAS,GAAwC,EAAgB,EAA0O,OAAzN,GAAU,CAAC,GAAiB,CAAC,EAAmC,EAAK,EAAW,CAAC,MAAM,qCAAqC,SAAS,iFAAiF,CAAC,CAAS,EAAM,EAAW,EAAM,EAAM,CAAc,EAAK,MAAM,CAAC,UAAU,sBAAsB,CAAC,sBAA9mC,IAAyE,IAA6J,CAQxQ,EAAY,EAAQ,EAAqB,CAAC,0CAA0C,qDAAqD,CAAC,SAAS,GAAgB,EAAY,EAAY,YAAY,sBAAsB,EAAoB,EAAY,C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