(()=>{"use strict";const e=window.wp.blocks,l=window.React,t=window.wp.i18n,a=window.wp.blockEditor,i=window.wp.components,n=JSON.parse('{"u2":"wlc-algolia/result-button"}');(0,e.registerBlockType)(n.u2,{edit:function({attributes:e,setAttributes:n}){const{label:o,linkType:r,linkFieldPath:c,hideIfEmpty:w}=e;return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(a.InspectorControls,null,(0,l.createElement)(i.PanelBody,{title:(0,t.__)("Result Button","wlc-search-integration-with-algolia"),initialOpen:!0},(0,l.createElement)(i.TextControl,{label:(0,t.__)("Label","wlc-search-integration-with-algolia"),value:o||"",onChange:e=>n({label:e})}),(0,l.createElement)(i.SelectControl,{label:(0,t.__)("Link","wlc-search-integration-with-algolia"),value:r||"permalink",options:[{label:(0,t.__)("Permalink","wlc-search-integration-with-algolia"),value:"permalink"},{label:(0,t.__)("Add to cart","wlc-search-integration-with-algolia"),value:"add_to_cart"},{label:(0,t.__)("Custom URL (field)","wlc-search-integration-with-algolia"),value:"field"}],onChange:e=>n({linkType:e})}),"field"===r?(0,l.createElement)(i.TextControl,{label:(0,t.__)("Link field path","wlc-search-integration-with-algolia"),value:c||"",onChange:e=>n({linkFieldPath:e})}):null,(0,l.createElement)(i.ToggleControl,{label:(0,t.__)("Hide if empty","wlc-search-integration-with-algolia"),checked:!1!==w,onChange:e=>n({hideIfEmpty:!!e})}))),(0,l.createElement)("div",null,(0,l.createElement)("span",{style:{display:"inline-block",padding:"6px 10px",borderRadius:10,border:"1px solid rgba(0,0,0,0.2)"}},o||(0,t.__)("Button","wlc-search-integration-with-algolia"))))},save:()=>null})})();