import{jsxs as i,jsx as e}from"react/jsx-runtime";import{useRenderMode as t,filterToolbarPreview as s}from"@gem-sdk/core";import{createStyle as o}from"@gem-sdk/system";import{ProductSubscriptionContent as r}from"./components/ProductSubscriptionContent.js";import{OneTimePurchaseTooltip as n}from"./components/OneTimePurchaseTooltip.js";import{useProductSubscriptionContentData as l}from"./hooks/useProductSubscriptionContentData.js";let m=({styles:m,setting:p,builderProps:c,builderAttrs:d,style:a,children:u})=>{let{isEditMode:y}=t(),f=o({...a}),b=l({setting:p,styles:m,builderProps:c});return b.visibility.isOneTimeHidden||b.visibility.hasNoSellingPlanOptions||b.isDynamicProduct?i("div",{...d,style:f,children:[y&&e(n,{ref:b.componentRef,setting:p}),s(u,!0)]}):b.visibility.isOnetimeOnly&&!y?"":i("div",{...d,style:f,children:[e("div",{ref:b.componentRef,dir:b.direction,"data-selling-type":p?.sellingType,id:b.componentId,className:b.wrapperClasses,style:b.subscriptionWrapperStyles,children:e(r,{data:b,setting:p,styles:m,builderProps:c})}),s(u,!0)]})};export{m as default};
