(()=>{"use strict";var e={n:o=>{var n=o&&o.__esModule?()=>o.default:()=>o;return e.d(n,{a:n}),n},d:(o,n)=>{for(var t in n)e.o(n,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:n[t]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.React,n=window.wp.blocks,t=window.wp.element,r=(0,t.forwardRef)(function({icon:e,size:o=24,...n},r){return(0,t.cloneElement)(e,{width:o,height:o,...n,ref:r})}),a=window.wp.components,c=window.wp.serverSideRender;var l=e.n(c);const i=window.wp.i18n,s=window.wp.blockEditor,m=window.wp.data,b={from:[{type:"block",blocks:["core/navigation-link"],transform:()=>(0,n.createBlock)("fibosearch/search-nav",{inheritPluginSettings:!1,layout:"icon"})},{type:"block",blocks:["core/search"],transform:()=>(0,n.createBlock)("fibosearch/search-nav",{inheritPluginSettings:!1,layout:"icon"})}],to:[{type:"block",blocks:["core/search"],transform:()=>(0,n.createBlock)("core/search",{showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"})},{type:"block",blocks:["core/navigation-link"],transform:()=>(0,n.createBlock)("core/navigation-link")}]},d=window.wp.primitives,w=(0,o.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 88.000000 88.000000",fill:"none"},(0,o.createElement)("g",{transform:"translate(0.000000,88.000000) scale(0.100000,-0.100000)"},(0,o.createElement)("path",{stroke:"none",fill:"#040404",fillRule:"evenodd",d:"M434 840 c-22 -5 -58 -16 -80 -26 l-39 -17 66 -8 c153 -17 271 -131\n286 -277 l6 -55 15 29 c24 45 28 165 8 219 -22 57 -92 119 -151 134 -49 12\n-53 12 -111 1z"}),(0,o.createElement)("path",{stroke:"none",fill:"#7c3b7c",fillRule:"evenodd",d:"M766 725 c4 -11 18 -49 31 -85 61 -162 4 -334 -132 -400 -61 -30\n-168 -25 -238 9 l-49 24 -99 -99 c-54 -54 -97 -99 -95 -101 2 -2 39 12 82 30\n74 31 81 32 117 20 176 -60 367 19 451 185 54 106 54 215 2 326 -25 53 -84\n129 -70 91z"}),(0,o.createElement)("path",{stroke:"none",fill:"#7c3b7c",fillRule:"evenodd",d:"M265 711 c-62 -29 -102 -77 -119 -146 -20 -75 -20 -113 0 -191 l15\n-62 -46 -84 c-26 -46 -58 -103 -72 -128 -21 -37 -1 -21 120 100 l146 144 -6\n58 c-7 71 8 111 52 138 53 33 98 27 149 -20 23 -22 51 -58 61 -80 10 -22 21\n-40 25 -40 14 0 20 80 10 126 -15 65 -33 97 -81 137 -75 65 -177 84 -254 48z"})));(0,n.registerBlockType)("fibosearch/search-nav",{edit:function(e){const{deviceType:n}=(0,m.useSelect)(e=>{let o="";const n=e("core/editor");return"object"==typeof n&&"function"==typeof n.getDeviceType?o=n.getDeviceType():"object"==typeof editPost&&"function"===editPost.__experimentalGetPreviewDeviceType&&(o=editPost.__experimentalGetPreviewDeviceType()),{deviceTypeTmp:o}},[]),t=(0,s.useBlockProps)({className:`wp-block-fibosearch-search__device-preview-${n.toLowerCase()}`}),{attributes:r}=e,{attributes:{darkenedBackground:c,mobileOverlay:b,inheritPluginSettings:d,layout:w,iconColor:h},name:p,setAttributes:u}=e;return(0,o.createElement)("div",{...t},(0,o.createElement)(s.InspectorControls,{key:"inspector"},(0,o.createElement)(a.PanelBody,{title:(0,i.__)("Settings","ajax-search-for-woocommerce"),initialOpen:!1},(0,o.createElement)(a.ToggleControl,{label:(0,i.__)("Inherit global plugin settings","ajax-search-for-woocommerce"),checked:d,onChange:()=>u({inheritPluginSettings:!d}),__nextHasNoMarginBottom:!0}),d?null:(0,o.createElement)(a.SelectControl,{label:(0,i.__)("Layout","ajax-search-for-woocommerce"),value:w,options:[{label:(0,i.__)("Search bar","ajax-search-for-woocommerce"),value:"classic"},{label:(0,i.__)("Search icon","ajax-search-for-woocommerce"),value:"icon"},{label:(0,i.__)("Icon on mobile, search bar on desktop","ajax-search-for-woocommerce"),value:"icon-flexible"},{label:(0,i.__)("Icon on desktop, search bar on mobile","ajax-search-for-woocommerce"),value:"icon-flexible-inv"}],onChange:e=>{u({layout:e}),"icon"!==e&&"icon-flexible"!==e&&"icon-flexible-inv"!==e||u({mobileOverlay:!0})},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),d?null:(0,o.createElement)(a.ToggleControl,{label:(0,i.__)("Darkened background","ajax-search-for-woocommerce"),checked:c,onChange:()=>u({darkenedBackground:!c}),__nextHasNoMarginBottom:!0}),d?null:(0,o.createElement)(a.ToggleControl,{label:(0,i.__)("Overlay on mobile","ajax-search-for-woocommerce"),checked:b,onChange:()=>u({mobileOverlay:!b}),help:b?(0,i.__)("The search will open in overlay on mobile","ajax-search-for-woocommerce"):"",__nextHasNoMarginBottom:!0}),d||"classic"===w?null:(0,o.createElement)(s.PanelColorSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:(0,i.__)("Color","ajax-search-for-woocommerce"),initialOpen:!1,colorSettings:[{value:h,onChange:e=>{u({iconColor:e})},label:(0,i.__)("Icon","ajax-search-for-woocommerce")}]}))),(0,o.createElement)(a.Disabled,null,(0,o.createElement)(l(),{block:p,attributes:r})))},icon:{src:(0,o.createElement)(r,{icon:w})},save:()=>{},transforms:b})})();