(function(){var e,c,r,l,a,n,s,o,t,i;e=wp.element.createElement,c=wp.blocks.registerBlockType,r=wp.blockEditor.InspectorControls,l=wp.blockEditor.useBlockProps,a=wp.components.SelectControl,n=wp.components.Placeholder,s=wp.components.PanelBody,o=wp.components.Icon,t=wp.i18n.__,i=(window.celerSearchBlock||{}).views||[],c("celersearch/search",{edit:function(c){var h,p,w=c.attributes,u=c.setAttributes,v=l(),b=w.view,m=function(e){for(var c=0;c<i.length;c++)if(i[c].id===e)return i[c].name;return""}(b),k=e(r,null,e(s,{title:t("View Settings","celersearch")},e(a,{label:t("Search View","celersearch"),value:b,options:(h=[{label:t("— Select a view —","celersearch"),value:0}],i.forEach(function(e){h.push({label:e.name,value:e.id})}),h),onChange:function(e){u({view:parseInt(e,10)||0})}})));return p=b?e("div",{className:"celersearch-block-preview"},e(o,{icon:"search",size:20,className:"celersearch-block-preview__icon"}),e("span",{className:"celersearch-block-preview__label"},t("CelerSearch:","celersearch")," ",e("strong",{className:"celersearch-block-preview__name"},m||"#"+b))):e(n,{icon:"search",label:t("CelerSearch","celersearch"),instructions:t("Select a search view from the block settings panel.","celersearch")}),e("div",v,k,p)},save:function(){return null}});
})();
