(()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,l=window.wp.blocks,n=window.wp.components,r=window.wp.blockEditor,o=window.wp.i18n,s=window.wp.serverSideRender;var i=e.n(s);const c=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"llms/checkout","title":"Checkout","category":"llms-blocks","description":"Outputs the checkout page for purchasing courses and memberships in LifterLMS.","textdomain":"lifterlms","attributes":{"cols":{"type":"integer","default":1},"llms_visibility":{"type":"string"},"llms_visibility_in":{"type":"string"},"llms_visibility_posts":{"type":"string"}},"supports":{"align":["wide","full"]},"editorScript":"file:./index.js"}'),a=window.wp.primitives;var m;const p=null!==(m=n.BaseControl.VisualLabel)&&void 0!==m?m:(0,t.createElement)(t.Fragment,null);(0,l.registerBlockType)(c,{icon:()=>(0,t.createElement)(a.SVG,{className:"llms-block-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},(0,t.createElement)(a.Path,{d:"M0 24C0 10.7 10.7 0 24 0H69.5c22 0 41.5 12.8 50.6 32h411c26.3 0 45.5 25 38.6 50.4l-41 152.3c-8.5 31.4-37 53.3-69.5 53.3H170.7l5.4 28.5c2.2 11.3 12.1 19.5 23.6 19.5H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H199.7c-34.6 0-64.3-24.6-70.7-58.5L77.4 54.5c-.7-3.8-4-6.5-7.9-6.5H24C10.7 48 0 37.3 0 24zM128 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm336-48a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"})),edit:e=>{const{attributes:l,setAttributes:s}=e,a=(0,r.useBlockProps)(),m={1:(0,o.__)("One","lifterlms"),2:(0,o.__)("Two","lifterlms")},u=(0,t.useMemo)((()=>(0,t.createElement)(i(),{block:c.name,attributes:l,LoadingResponsePlaceholder:()=>(0,t.createElement)(n.Spinner,null),ErrorResponsePlaceholder:()=>(0,t.createElement)("p",{className:"llms-block-error"},(0,o.__)("There was an error loading the content. This block will not be displayed.","lifterlms")),EmptyResponsePlaceholder:()=>(0,t.createElement)("p",{className:"llms-block-empty"},(0,o.__)("Checkout not available. This block will not be displayed.","lifterlms"))})),[l]);return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.InspectorControls,null,(0,t.createElement)(n.PanelBody,{title:(0,o.__)("Checkout Settings","lifterlms")},(0,t.createElement)(n.PanelRow,null,(0,t.createElement)(n.BaseControl,{help:(0,o.__)("Determines the number of columns on the checkout screen. 1 or 2 are the only acceptable values.","lifterlms")},(0,t.createElement)(n.Flex,{direction:"column"},(0,t.createElement)(p,null,(0,o.__)("Number of Columns","lifterlms")),(0,t.createElement)(n.ButtonGroup,null,Object.keys(m).map((e=>(0,t.createElement)(n.Button,{key:e,isPrimary:e===l.cols,onClick:()=>s({cols:e})},m[e]))))))))),(0,t.createElement)("div",a,(0,t.createElement)(n.Disabled,null,u)))}})})();