!function(){"use strict";var e=window.wp.escapeHtml,o=window.wp.element;const t=o.createElement,r={};r.teamPro=t("img",{src:(0,e.escapeAttribute)(sp_logo_carousel_free_g.path+"admin/GutenbergBlock/assets/logo-carousel.svg")});var l=r,s=window.wp.i18n;const a=o.createElement;var c=t=>{let{attributes:{shortcode:r},shortCodeList:l,shortcodeUpdate:c}=t;return(0,o.createElement)(o.Fragment,null,a("div",{className:"splcf-gutenberg-shortcode editor-styles-wrapper"},a("select",{className:"splcf-shortcode-selector",onChange:e=>c(e),value:(0,e.escapeAttribute)(r)},a("option",{value:(0,e.escapeAttribute)("0")},(0,e.escapeHTML)((0,s.__)("-- Select a carousel (shortcode) --","logo-carousel-free"))),l.map((o=>{var t=o.title.length>30?o.title.substring(0,25)+".... #("+o.id+")":o.title+" #("+o.id+")";return a("option",{value:(0,e.escapeAttribute)(o.id.toString()),key:(0,e.escapeAttribute)(o.id.toString())},(0,e.escapeHTML)(t))})))))},n=window.wp.blocks,i=window.wp.components,u=window.wp.blockEditor;const p=wp.serverSideRender,d=o.createElement;(0,n.registerBlockType)("sp-logo-carousel-pro/shortcode",{title:(0,s.__)("Logo Carousel","logo-carousel-free"),description:(0,s.__)("Use Logo Carousel Pro to insert a carousel (shortcode) in your page.","logo-carousel-free"),icon:l.teamPro,category:"common",supports:{html:!1},edit:t=>{const{attributes:r,setAttributes:l}=t;var a=sp_logo_carousel_free_g.shortCodeList;let n=e=>{let o=!1,t=setInterval((function(){let r=jQuery("#logo-carousel-free-"+e).parents().attr("id");document.getElementById(r)&&(jQuery("#lcp-preloader-"+e).css({opacity:0,display:"none"}),jQuery("#lcp-preloader-"+e).animate({opacity:1},600),jQuery.getScript(sp_logo_carousel_free_g.loadScript),o=!0,r=""),o&&clearInterval(t),0==e&&clearInterval(t)}),100)},g=e=>{l({shortcode:e.target.value});let o=e.target.value;n(o)};if(jQuery(".logo-carousel-free-area:not(.splc-logo-carousel-loaded)").length>0){let o=(0,e.escapeAttribute)(r.shortcode);n(o)}return r.preview?d("div",{},d("img",{src:(0,e.escapeAttribute)(sp_logo_carousel_free_g.path+"admin/GutenbergBlock/assets/logo-carousel-block-preview.svg")})):0===a.length?(0,o.createElement)(o.Fragment,null,d("div",{className:"components-placeholder components-placeholder is-large"},d("div",{className:"components-placeholder__label"},d("img",{className:"block-editor-block-icon",src:(0,e.escapeAttribute)(sp_logo_carousel_free_g.path+"admin/GutenbergBlock/assets/logo-carousel.svg")}),(0,e.escapeHTML)((0,s.__)("Logo Carousel","logo-carousel-free"))),d("div",{className:"components-placeholder__instructions"},(0,e.escapeHTML)((0,s.__)("No logo carousel found. ","logo-carousel-free")),d("a",{href:(0,e.escapeAttribute)(sp_logo_carousel_free_g.url)},(0,e.escapeHTML)((0,s.__)("Create a carousel (shortcode) now!","logo-carousel-free")))))):r.shortcode&&0!=r.shortcode?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.InspectorControls,null,(0,o.createElement)(i.PanelBody,{title:"Select a carousel (shortcode)"},(0,o.createElement)(i.PanelRow,null,(0,o.createElement)(c,{attributes:r,shortCodeList:a,shortcodeUpdate:g})))),(0,o.createElement)(p,{block:"sp-logo-carousel-pro/shortcode",attributes:r})):(0,o.createElement)(o.Fragment,null,(0,o.createElement)(u.InspectorControls,null,(0,o.createElement)(i.PanelBody,{title:"Select a carousel (shortcode)"},(0,o.createElement)(i.PanelRow,null,(0,o.createElement)(c,{attributes:r,shortCodeList:a,shortcodeUpdate:g})))),d("div",{className:"components-placeholder components-placeholder is-large"},d("div",{className:"components-placeholder__label"},d("img",{className:"block-editor-block-icon",src:(0,e.escapeAttribute)(sp_logo_carousel_free_g.path+"admin/GutenbergBlock/assets/logo-carousel.svg")}),(0,e.escapeHTML)((0,s.__)("Logo Carousel","logo-carousel-free"))),d("div",{className:"components-placeholder__instructions"},(0,e.escapeHTML)((0,s.__)("Select a carousel (shortcode)","logo-carousel-free"))),(0,o.createElement)(c,{attributes:r,shortCodeList:a,shortcodeUpdate:g})))},save(){return null}})}();