(()=>{"use strict";const e=window.wp.blocks,t=window.wp.i18n,n=window.wp.blockEditor,a=window.wp.components,r=window.React,l=function(e){var a=e.attributes,l=e.setAttributes,o=a.label,c=a.hide_label,i=a.required,u=a.instructions,s=function(){return Math.random().toString(36).substring(2,10)};return(0,r.useEffect)((function(){if(!(!1 in a)){a.field_key||l({field_key:s()});var e=a.field_key;if(Array.from(document.querySelectorAll(".fea-field-key")).filter((function(t){return t.textContent===e})).length>1){var t=s();l({field_key:t})}}}),[]),React.createElement("div",{className:"acf-field"},React.createElement("span",{hidden:!0,className:"fea-field-key"},a.field_key),React.createElement("div",{className:"acf-label"},React.createElement("label",null,!c&&React.createElement(n.RichText,{tagName:"span",onChange:function(e){return l({label:e})},withoutInteractiveFormatting:!0,placeholder:(0,t.__)("Text Field","frontend-admin"),value:o}),i&&React.createElement("span",{className:"acf-required"},"*"))),React.createElement("div",{className:"acf-input"},u&&React.createElement(n.RichText,{tagName:"p",className:"description",onChange:function(e){return l({instructions:e})},withoutInteractiveFormatting:!0,value:u}),React.createElement("div",{className:"acf-input-wrap"+(e.wrapperClass?" "+e.wrapperClass:""),style:{display:"flex",width:"100%"}},e.children)))};var o="frontend-admin";const c=function(e){var r=e.attributes,l=e.setAttributes,c=r.label,i=r.hide_label,u=r.required,s=r.instructions,d=function(e){return e.toLowerCase().replace(/[^a-z0-9 _]/g,"").replace(/\s+/g,"_")};return React.createElement(n.InspectorControls,{field_key:"fea-inspector-controls"},React.createElement(a.PanelBody,{title:(0,t.__)("General",o),initialOpen:!0},React.createElement(a.TextControl,{label:(0,t.__)("Label",o),value:c,onChange:function(e){return l({label:e})}}),React.createElement(a.ToggleControl,{label:(0,t.__)("Hide Label",o),checked:i,onChange:function(e){return l({hide_label:e})}}),"name"in r&&React.createElement(a.TextControl,{label:(0,t.__)("Name",o),value:r.name||d(c),onChange:function(e){return l({name:d(e)})}}),"field_key"in r&&React.createElement(a.TextControl,{label:(0,t.__)("Field Key",o),value:r.field_key,readOnly:!0,onChange:function(e){}}),React.createElement(a.TextareaControl,{label:(0,t.__)("Instructions",o),rows:"3",value:s,onChange:function(e){return l({instructions:e})}}),React.createElement(a.ToggleControl,{label:(0,t.__)("Required",o),checked:u,onChange:function(e){return l({required:e})}}),e.children))};var i="frontend-admin";const u=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"frontend-admin/post-excerpt-field","title":"Post Excerpt Field","description":"Displays a post excerpt field.","category":"frontend-admin","textdomain":"frontend-admin","icon":"list-view","supports":{"align":["wide"]},"usesContext":["frontend-admin/form/form_settings","frontend-admin/form/form_key"],"attributes":{"field_key":{"type":"string","default":""},"label":{"type":"string","default":"Post Excerpt"},"hide_label":{"type":"boolean","default":""},"required":{"type":"boolean","default":""},"instructions":{"type":"string","default":""},"default_value":{"type":"string","default":""},"placeholder":{"type":"string","default":""},"maxlength":{"type":"number","default":""},"rows":{"type":"number","default":""}},"editorScript":"file:../../post-excerpt/index.js"}');(0,e.registerBlockType)(u,{edit:function(e){var r=e.attributes,o=e.setAttributes,u=r.default_value,s=r.placeholder,d=r.maxlength,f=r.rows,m=(r.cols,(0,n.useBlockProps)());return React.createElement("div",m,React.createElement(c,e,React.createElement(a.TextareaControl,{label:(0,t.__)("Default Value",i),value:u,onChange:function(e){return o({default_value:e})}}),React.createElement(a.TextareaControl,{label:(0,t.__)("Placeholder",i),value:s,onChange:function(e){return o({placeholder:e})}}),React.createElement(a.TextControl,{type:"number",label:(0,t.__)("Character Limit",i),value:d,onChange:function(e){return o({maxlength:e})}}),React.createElement(a.TextControl,{type:"number",label:(0,t.__)("Rows",i),value:f,onChange:function(e){return o({rows:e})}})),React.createElement(l,e,React.createElement("textarea",{maxLength:d,placeholder:s,rows:f,value:u,onChange:function(e){o({default_value:e.target.value})}},u)))},save:function(){return null}})})();