(()=>{"use strict";const e=window.wp.blocks,a=window.wp.blockEditor,l=window.wp.components,t=window.wp.i18n,s=JSON.parse('{"UU":"gateway/column"}'),n=window.ReactJSXRuntime,o=["gateway/field-text","gateway/field-image","gateway/field-date","gateway/field-link","gateway/field-badge"];(0,e.registerBlockType)(s.UU,{edit:({attributes:e,setAttributes:s})=>{const{label:i,fieldKey:d}=e,r=(0,a.useBlockProps)({className:"gateway-column"});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.InspectorControls,{children:(0,n.jsxs)(l.PanelBody,{title:(0,t.__)("Column Settings","gateway"),children:[(0,n.jsx)(l.TextControl,{label:(0,t.__)("Label","gateway"),value:i,onChange:e=>s({label:e}),help:(0,t.__)("Column header text (used in heading rows).","gateway")}),(0,n.jsx)(l.TextControl,{label:(0,t.__)("Field Key","gateway"),value:d,onChange:e=>s({fieldKey:e}),help:(0,t.__)('The record property to display (e.g. "id", "title", "status").',"gateway")})]})}),(0,n.jsxs)("div",{...r,children:[i&&(0,n.jsx)("span",{className:"gateway-column__label",children:i}),(0,n.jsx)(a.InnerBlocks,{allowedBlocks:o,templateLock:!1})]})]})},save:({attributes:e})=>{const{label:l,fieldKey:t}=e;return(0,n.jsxs)("div",{...a.useBlockProps.save({className:"gateway-column"}),"data-field-key":t||void 0,children:[l&&(0,n.jsx)("span",{className:"gateway-column__label",children:l}),(0,n.jsx)(a.InnerBlocks.Content,{})]})}})})();