(()=>{"use strict";var e={n:n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return e.d(t,{a:t}),t},d:(n,t)=>{for(var i in t)e.o(t,i)&&!e.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:t[i]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n)};const n=window.wp.blocks,t=window.React,i=window.wp.blockEditor,a=window.wp.serverSideRender;var o=e.n(a);const r=window.wp.components,l=window.wp.i18n;function c({attributes:e,setAttributes:n}){const{placeholder:i,buttonText:a,customClass:o}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.PanelBody,{title:(0,l.__)("Search form","cine-movie-engine"),initialOpen:!0},(0,t.createElement)(r.TextControl,{label:(0,l.__)("Placeholder","cine-movie-engine"),value:i,onChange:e=>n({placeholder:e||""}),placeholder:(0,l.__)("Search movies & TV series…","cine-movie-engine"),help:(0,l.__)("Shown inside the search field when empty. Leave blank to use the plugin default.","cine-movie-engine")}),(0,t.createElement)(r.TextControl,{label:(0,l.__)("Button label","cine-movie-engine"),value:a,onChange:e=>n({buttonText:e||""}),placeholder:(0,l.__)("Search","cine-movie-engine"),help:(0,l.__)("Text next to the search icon on the submit button. Leave blank for the default.","cine-movie-engine")})),(0,t.createElement)(r.PanelBody,{title:(0,l.__)("Advanced","cine-movie-engine"),initialOpen:!1},(0,t.createElement)(r.TextControl,{label:(0,l.__)("Extra CSS class","cine-movie-engine"),value:o,onChange:e=>n({customClass:e||""}),help:(0,l.__)("Added to the search bar wrapper element.","cine-movie-engine")})))}const s=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"cine-movie-engine/search-bar","title":"Movie Engine Search Bar","category":"movie-engine","icon":"search","description":"Search movies and TV series (submits to your site search).","keywords":["search","movie","movie engine"],"textdomain":"cine-movie-engine","attributes":{"placeholder":{"type":"string","default":""},"buttonText":{"type":"string","default":""},"customClass":{"type":"string","default":""}},"supports":{"html":false,"customClassName":false,"align":["wide","full"]}}');(0,n.registerBlockType)(s,{edit:function({attributes:e,setAttributes:n}){const a=(0,i.useBlockProps)({className:"movie-engine-search-bar-block-editor"});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(i.InspectorControls,null,(0,t.createElement)(c,{attributes:e,setAttributes:n})),(0,t.createElement)("div",{...a},(0,t.createElement)("div",{className:"movie-engine-search-bar-block-editor__preview movie-engine-plugin"},(0,t.createElement)(o(),{block:"cine-movie-engine/search-bar",attributes:e,LoadingResponsePlaceholder:()=>(0,t.createElement)("p",{className:"movie-engine-search-bar-block-editor__preview-loading"},(0,t.createElement)(r.Spinner,null),(0,l.__)("Loading preview…","cine-movie-engine")),ErrorResponsePlaceholder:()=>(0,t.createElement)("p",{className:"movie-engine-search-bar-block-editor__preview-loading"},(0,l.__)("Preview unavailable. Check the front end or try saving the page.","cine-movie-engine"))}))))},save:()=>null})})();