(()=>{"use strict";const e=window.ReactJSXRuntime,{__}=wp.i18n,{registerBlockType:t}=wp.blocks,{RichText:a,MediaUpload:n,InspectorControls:l,InnerBlocks:i}=wp.blockEditor,{Button:o,PanelBody:s,SelectControl:c}=wp.components;t("xgate/my-custom-block",{title:__("My Custom Block","xgate"),icon:"smiley",category:"xgate-blocks",attributes:{title:{type:"string"},subtitle:{type:"string"},content:{type:"string"},imageUrl:{type:"string"},imageId:{type:"number"},variant:{type:"string",default:"content-center"}},edit:function(t){const{attributes:i,setAttributes:r,className:g}=t,{title:u,subtitle:d,content:x,imageUrl:m,variant:p}=i;return(0,e.jsxs)("div",{className:g,children:[(0,e.jsx)(l,{children:(0,e.jsx)(s,{title:__("Block Settings","xgate"),children:(0,e.jsx)(c,{label:__("Content Variant","xgate"),value:p,options:[{label:__("Center Content","xgate"),value:"content-center"},{label:__("Half Width Content","xgate"),value:"content-half"},{label:__("30% / 70% Split","xgate"),value:"content-30"},{label:__("70% / 30% Split","xgate"),value:"content-70"}],onChange:e=>{r({variant:e})}})})}),(0,e.jsx)(a,{tagName:"h1",placeholder:__("Add Title","xgate"),value:u,onChange:e=>{r({title:e})}}),(0,e.jsx)(a,{tagName:"h2",placeholder:__("Add Subtitle","xgate"),value:d,onChange:e=>{r({subtitle:e})}}),(0,e.jsx)(a,{tagName:"p",placeholder:__("Add content","xgate"),value:x,onChange:e=>{r({content:e})}}),(0,e.jsx)(n,{onSelect:e=>{r({imageUrl:e.url,imageId:e.id})},allowedTypes:["image"],value:t.attributes.imageId,render:({open:t})=>(0,e.jsx)(o,{className:"button button-large",onClick:t,children:m?(0,e.jsx)("img",{src:m,width:"50",heigh:"50",alt:__("Selected Image","xgate")}):__("Choose an image","xgate")})})]})},save:function(){return null}})})();