(()=>{"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,o=window.wp.serverSideRender;var l=e.n(o);const a=window.wp.components,r=window.wp.i18n;function c({attributes:e,setAttributes:n}){const{placeholder:i,showIcon:o,customClass:l}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(a.PanelBody,{title:(0,r.__)("Live search","cine-movie-engine"),initialOpen:!0},(0,t.createElement)(a.TextControl,{label:(0,r.__)("Placeholder","cine-movie-engine"),value:i,onChange:e=>n({placeholder:e||""}),placeholder:(0,r.__)("Search movies & TV series…","cine-movie-engine"),help:(0,r.__)("Shown when the field is empty. Leave blank to use the plugin default text.","cine-movie-engine")}),(0,t.createElement)(a.ToggleControl,{label:(0,r.__)("Show search icon","cine-movie-engine"),checked:!1!==o,onChange:e=>n({showIcon:e})})),(0,t.createElement)(a.PanelBody,{title:(0,r.__)("Advanced","cine-movie-engine"),initialOpen:!1},(0,t.createElement)(a.TextControl,{label:(0,r.__)("Extra CSS class","cine-movie-engine"),value:l,onChange:e=>n({customClass:e||""}),help:(0,r.__)("Added to the live search wrapper element.","cine-movie-engine")})))}const s=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"cine-movie-engine/live-search","title":"Movie Engine Live Search","category":"movie-engine","icon":"search","description":"AJAX live search field with dropdown results (same as [movie_engine_live_search]).","keywords":["search","live","ajax","movie engine"],"textdomain":"cine-movie-engine","attributes":{"placeholder":{"type":"string","default":""},"showIcon":{"type":"boolean","default":true},"customClass":{"type":"string","default":""}},"supports":{"html":false,"customClassName":false,"align":["wide","full"]}}');(0,n.registerBlockType)(s,{edit:function({attributes:e,setAttributes:n}){const o=(0,i.useBlockProps)({className:"movie-engine-live-search-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",{...o},(0,t.createElement)("div",{className:"movie-engine-live-search-block-editor__preview movie-engine-plugin"},(0,t.createElement)(l(),{block:"cine-movie-engine/live-search",attributes:e,LoadingResponsePlaceholder:()=>(0,t.createElement)("p",{className:"movie-engine-live-search-block-editor__preview-loading"},(0,t.createElement)(a.Spinner,null),(0,r.__)("Loading preview…","cine-movie-engine")),ErrorResponsePlaceholder:()=>(0,t.createElement)("p",{className:"movie-engine-live-search-block-editor__preview-loading"},(0,r.__)("Preview unavailable. Check the front end or try saving the page.","cine-movie-engine"))}))))},save:()=>null})})();