"use strict";var e=require("react/jsx-runtime"),n=require("./ProductSubscriptionOptions.js"),i=require("./SellingPlanLabel.js"),s=require("./SubscriptionRadio.js"),t=require("../../../constants/index.js"),r=require("../helpers/handleContainerKeyDown.js");exports.ProductSubscriptionContent=({data:o,setting:l,styles:a,builderProps:d})=>{let{visibility:c,productId:u,renderType:p,radioGroupName:S,direction:h,containerClasses:b,subscriptionStyles:g,selectedValue:y,sellingPlanOptions:j,handleSellingPlanChange:P,onSelectType:m}=o,x=p===t.SubscriptionEnum.SUBSCRIPTION&&(c.selectedType===t.SubscriptionEnum.ONE_TIME&&c.requiresSellingPlan||c.selectedType===p);return e.jsxs(e.Fragment,{children:[c.shouldShowRadio&&e.jsx(s.SubscriptionRadio,{id:`${d?.uid??""}-${u}-${p}-radio`,name:S,value:p,checked:c.selectedType===p,className:"!gp-items-start",onChange:e=>{e.target.checked&&m(p)}}),e.jsxs("div",{"data-component-container":!0,className:b,style:g,onClick:()=>m(p),onKeyDown:e=>r.handleContainerKeyDown({event:e,type:p,shouldShowRadio:c.shouldShowRadio,selectedType:c.selectedType,onSelectType:m}),role:"button",tabIndex:0,children:[e.jsx(i.SellingPlanLabel,{setting:l,styles:a,id:`label-${d?.uid??""}-${u}-${p}-radio`}),x&&e.jsx(n.ProductSubscriptionOptions,{direction:h,setting:l,styles:a,builderProps:d,productId:u,sellingPlanOptions:j,selectedValue:y,onSellingPlanChange:P})]})]})};
