(()=>{"use strict";const e=window.wp.blocks,t=window.wp.blockEditor,s=window.wp.components,a=window.wp.i18n,i=JSON.parse('{"UU":"gateway/field-text"}'),l=window.ReactJSXRuntime;(0,e.registerBlockType)(i.UU,{edit:({attributes:e,setAttributes:i})=>{const{fieldKey:n}=e,o=(0,t.useBlockProps)({className:"gateway-field-text"});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.InspectorControls,{children:(0,l.jsx)(s.PanelBody,{title:(0,a.__)("Field Text Settings","gateway"),children:(0,l.jsx)(s.TextControl,{label:(0,a.__)("Field Key","gateway"),value:n,onChange:e=>i({fieldKey:e}),help:(0,a.__)('The record property to display (e.g. "title", "status").',"gateway")})})}),(0,l.jsx)("span",{...o,children:n?(0,l.jsx)("em",{children:`{ ${n} }`}):(0,l.jsx)("em",{children:(0,a.__)("(no field key set)","gateway")})})]})},save:({attributes:e})=>{const{fieldKey:s}=e;return(0,l.jsx)("span",{...t.useBlockProps.save({className:"gateway-field-text"}),"data-wp-text":s?`context.record.${s}`:void 0})}})})();