text: !function(e){var t={};function n(l){if(t[l])return t[l].exports;var a=t[l]={i:l,l:!1,exports:{}};return e[l].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(l,a,function(t){return e[t]}.bind(null,a));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=22)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t,n){e.exports=n(16)()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e){e.exports=JSON.parse('{"a":{"bannerSlider":"bannerSlider","postGridSlider":"postGridSlider","featuredProductBannerSlider":"featuredProductBannerSlider"}}')},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}e.exports=function(e,t,l){return t&&n(e.prototype,t),l&&n(e,l),e}},function(e,t,n){var l=n(18),a=n(8);e.exports=function(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?a(e):t}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var l=n(19);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){!function(){e.exports=this.wp["wp.i18n"]}()},function(e,t,n){"use strict";var l=n(17);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,r){if(r!==l){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=l=function(e){return n(e)}:e.exports=l=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},l(t)}e.exports=l},function(e,t){function n(t,l){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,l)}e.exports=n},function(e,t){!function(){e.exports=this.wp.compose}()},,function(e,t,n){"use strict";n.r(t);var l=n(0),a=(n(15),n(5)),o=n(7),r=n.n(o),c={postType:{type:"string",default:"posts"},gridType:{type:"string",default:void 0},isSinglePost:{type:"boolean",default:!1},singlePostId:{type:"string",default:void 0},selectedTerm:{type:"string",default:void 0},selectedTermTaxonomy:{type:"string",default:void 0},isTaxonomySlider:{type:"boolean",default:!1},filterPostByTaxonomy:{type:"boolean",default:!1},sliderFadeTransition:{type:"boolean",default:!1},sliderControls:{type:"boolean",default:!0},isSlideInfinite:{type:"boolean",default:!0},enableCenterMode:{type:"boolean",default:!1},slidesToShow:{type:"number",default:1},slidesToShowInMobile:{type:"number",default:1},slidesToShowInTablet:{type:"number",default:1},slidesToShowInLaptop:{type:"number",default:1}},s=n(1),i=n(3),b=n.n(i),u=function(e){var t=e.placeholderLabel,n=e.className,a=e.gridTypeLabel;return Object(l.createElement)("div",{className:"wpgl-components-placeholder".concat(n)},Object(l.createElement)("div",{className:"components-placeholder__label"},Object(l.createElement)("div",{className:"label__container"},Object(l.createElement)("div",{className:"wpgllabel"},Object(l.createElement)("img",{className:"wpgl__brand--image",width:"100",height:"100",src:images_data.logo_url}),Object(l.createElement)("label",{className:"wpgllabel__text"}," ",Object(s.__)("WPGL")," "),Object(l.createElement)("label",{className:"wpgllabel__text wpgllabel__text--dark"}," ",t," ")))),a)};u.propTypes={placeholderLabel:b.a.string,className:b.a.string,gridTypeLabel:b.a.node},u.defaultProps={placeholderLabel:"Grid",className:"",gridTypeLabel:""};var p=u,m=n(14),g=n.n(m),d=n(6),O=n(4),f=n(2),j=n(9),_=n.n(j),y=n(10),h=n.n(y),v=n(11),E=n.n(v),w=n(12),T=n.n(w),C=n(8),S=n.n(C),k=n(13),P=n.n(k),N=function(e){function t(e){var n;return _()(this,t),(n=E()(this,T()(t).call(this,e))).state={postSelection:[{label:"Select post",value:0}],value:0},n.getPostType=n.getPostType.bind(S()(n)),n}return P()(t,e),h()(t,[{key:"getPostType",value:function(){var e=this;r()({path:"/wp/v2/types"}).then((function(t){var n=Object.keys(t).map((function(e){return{label:t[e].name,value:t[e].slug}}));e.setState({postSelection:n},(function(){var t=e.props.attributes.postType,n=e.state.postSelection;!t&&n&&n[0]&&e.props.setAttributes({postType:n[0].value})}))})).catch((function(e){return console.log(e)}))}},{key:"componentDidMount",value:function(){this.getPostType()}},{key:"render",value:function(){var e=this,t=this.state,n=t.postSelection,a=(t.value,this.props.attributes.postType);return Object(l.createElement)(f.SelectControl,{label:Object(s.__)("Select Post type"),value:a,options:n,onChange:function(t){e.props.setAttributes({postType:t})}})}}]),t}(l.Component),x=function(e){function t(e){var n;return _()(this,t),(n=E()(this,T()(t).call(this,e))).state={categorySelection:[{label:"Select Category",value:0}],value:0},n.getPostCategoryTerms=n.getPostCategoryTerms.bind(S()(n)),n}return P()(t,e),h()(t,[{key:"getPostCategoryTerms",value:function(){var e=this,t=this.props.attributes.postType;r()({path:"wpgl/v2/taxonomies/".concat(t)}).then((function(t){var n=t.map((function(e){return{label:e.name,value:e.slug,taxonomy:e.taxonomy}}));e.setState({categorySelection:n},(function(){var t=e.props.attributes,n=t.selectedTerm,l=t.selectedTermTaxonomy,a=e.state.categorySelection;a&&a[0]&&(n||e.props.setAttributes({selectedTerm:a[0].value}),l||e.props.setAttributes({selectedTermTaxonomy:a[0].taxonomy}))}))})).catch((function(e){return console.log(e)}))}},{key:"componentDidMount",value:function(){this.getPostCategoryTerms()}},{key:"componentDidUpdate",value:function(e){var t=e.attributes.postType;this.props.attributes.postType!==t&&this.getPostCategoryTerms()}},{key:"render",value:function(){var e=this,t=this.state,n=t.categorySelection,a=(t.value,this.props.attributes),o=a.selectedTerm;a.selectedTermTaxonomy;return Object(l.createElement)(f.SelectControl,{label:Object(s.__)("Select category"),value:o,options:n,onChange:function(t){var l=n.findIndex((function(e){return e.value===t}));e.props.setAttributes({selectedTermTaxonomy:n[l].taxonomy}),e.props.setAttributes({selectedTerm:t})}})}}]),t}(l.Component),I=(n(20),function(e){return Object(l.useEffect)((function(){e.attributes.gridType||e.setAttributes({gridType:d.a.bannerSlider})}),[]),Object(l.createElement)(f.SelectControl,{label:Object(s.__)("Select grid style"),value:e.attributes.gridType,options:[{label:"Banner Slider",value:d.a.bannerSlider},{label:"Post Grid Slider",value:d.a.postGridSlider},{label:"Featured Product Slider",value:d.a.featuredProductBannerSlider}],onChange:function(t){e.setAttributes({gridType:t})}})}),B=function(e){function t(e){var n;return _()(this,t),(n=E()(this,T()(t).call(this,e))).state={singlePostSelection:[{label:"No posts to select",value:0}],value:0},n.getPosts=n.getPosts.bind(S()(n)),n}return P()(t,e),h()(t,[{key:"getPosts",value:function(){var e=this,t=this.props.attributes.postType;r()({path:"wpgl/v2/types/".concat(t)}).then((function(t){var n=Object.keys(t).map((function(e){return{label:t[e].post_title,value:t[e].ID}}));n.unshift({label:"Select Posts",value:0}),e.setState({singlePostSelection:n})})).catch((function(e){return console.log(e)}))}},{key:"componentDidMount",value:function(){this.getPosts()}},{key:"componentDidUpdate",value:function(e){var t=e.attributes.singlePostId;this.props.attributes.singlePostId!==t&&this.getPosts()}},{key:"render",value:function(){var e=this,t=this.state.singlePostSelection,n=this.props.attributes.singlePostId;console.log("after save",n);return Object(l.createElement)(f.SelectControl,{label:"Select particular post",value:n,options:t,onChange:function(t){console.log("onchange",t),e.props.setAttributes({singlePostId:t})}})}}]),t}(l.Component),R=function(e){var t=e.gridType,n=e.sliderFadeTransition,a=e.sliderControls,o=e.enableCenterMode,r=e.isSlideInfinite,c=e.slidesToShow,i=e.slidesToShowInMobile,b=e.slidesToShowInTablet,u=e.slidesToShowInLaptop,p=e.setAttributes;return Object(l.createElement)(l.Fragment,null,t&&(t===d.a.bannerSlider||t===d.a.postGridSlider||t===d.a.featuredProductBannerSlider)&&Object(l.createElement)(f.PanelBody,{title:Object(s.__)("Slider settings"),icon:"tide",className:"wpgl-slider-controls",initialOpen:!1},Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ToggleControl,{label:"Fade in transition",help:Object(s.__)("Select to enable fade transition for slider instead of slide transitions","wpgl"),checked:n,onChange:function(){p({sliderFadeTransition:!n})}})),Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ToggleControl,{label:"Enable slider controls",help:Object(s.__)("Select to enable slider previous and next buttons.","wpgl"),checked:a,onChange:function(){p({sliderControls:!a})}})),Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ToggleControl,{label:"Scroll slides infinitely",help:Object(s.__)("Select to enable infinite slides in the slider.","wpgl"),checked:r,onChange:function(e){p({isSlideInfinite:e})}})),Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ToggleControl,{label:"Enable Center Mode",help:Object(s.__)("Select to enable center mode for slides. Helpful for slides to get center slide attention.","wpgl"),checked:o,onChange:function(e){p({enableCenterMode:e})}})),Object(l.createElement)(f.RangeControl,{label:"Slides to Show",value:c,onChange:function(e){p({slidesToShow:e})},min:1,max:7,step:.1}),Object(l.createElement)("label",{className:"wpgl-inspector-controls__label label--big"},Object(s.__)("Responsive Settings")),Object(l.createElement)(f.RangeControl,{label:"Slides to show in mobile",value:i,onChange:function(e){p({slidesToShowInMobile:e})},min:1,max:5,step:.1}),Object(l.createElement)(f.RangeControl,{label:"Slides to show in tablet",value:b,onChange:function(e){p({slidesToShowInTablet:e})},min:1,max:3}),Object(l.createElement)(f.RangeControl,{label:"Slides to show in laptop",value:u,onChange:function(e){p({slidesToShowInLaptop:e})},min:1,max:7,step:.1})))},A=function(e){var t=e.attributes,n=t.isSinglePost,a=t.postType,o=t.gridType,r=t.sliderFadeTransition,c=t.sliderControls,i=t.isTaxonomySlider,b=t.filterPostByTaxonomy,u=t.slidesToShow,p=t.isSlideInfinite,m=t.enableCenterMode,j=t.slidesToShowInMobile,_=t.slidesToShowInTablet,y=t.slidesToShowInLaptop;t.selectedTerm,t.selectedTermTaxonomy;Object(l.useEffect)((function(){"banner"===a&&e.setAttributes({postType:"banner",isSinglePost:!0,gridType:d.a.bannerSlider}),o===d.a.featuredProductBannerSlider&&e.setAttributes(g()({postType:"product",filterPostByTaxonomy:!0,selectedTerm:"featured",selectedTermTaxonomy:"product_visibility"},"filterPostByTaxonomy",!1))}),[a]);var h="banner"===a,v=o===d.a.featuredProductBannerSlider;return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(O.InspectorControls,null,Object(l.createElement)(f.PanelBody,{title:Object(s.__)("Post settings"),icon:"welcome-write-blog",initialOpen:!0},Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(N,e)),!h&&!i&&!v&&Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ToggleControl,{label:"Display single post",help:Object(s.__)("Select to choose only one post from the post type. Highly effective for Banner type sliders","wpgl"),checked:n,onChange:function(){e.setAttributes({isSinglePost:!n})}})),!h&&!n&&!v&&Object(l.createElement)(l.Fragment,null,!i&&Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ToggleControl,{label:"Filter Posts by taxonomy",help:Object(s.__)("Select to filter posts by taxonomy. Posts categorised with selected term will be displayed here.","wpgl"),checked:b,onChange:function(){e.setAttributes({filterPostByTaxonomy:!b})}})),Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ToggleControl,{label:"Show Taxonomy Grid",help:Object(s.__)("Select to show taxonomies as grid instead. If enabled the front will display selected taxonomy grid rather posts.","wpgl"),checked:i,onChange:function(){e.setAttributes({isTaxonomySlider:!i})}}))),a&&n&&Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(B,e)),!h&&Object(l.createElement)(l.Fragment,null,!n&&!v&&Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(x,e)),Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(I,e)))),Object(l.createElement)(R,{gridType:o,sliderControls:c,isSlideInfinite:p,enableCenterMode:m,sliderFadeTransition:r,slidesToShow:u,slidesToShowInMobile:j,slidesToShowInTablet:_,slidesToShowInLaptop:y,setAttributes:e.setAttributes})))};A.propTypes={isSinglePost:b.a.bool,postType:b.a.string,gridType:b.a.string,sliderFadeTransition:b.a.bool,sliderControls:b.a.bool,isTaxonomySlider:b.a.bool},A.defaultProps={isSinglePost:!1,postType:null,gridType:null,sliderFadeTransition:!1,sliderControls:!0,isTaxonomySlider:!1};var L=A,U=function(e){return Object(l.createElement)("div",null,Object(l.createElement)(L,e),Object(l.createElement)("div",{className:"wpgl-components__wrapper"},Object(l.createElement)(p,{placeholderLabel:Object(s.__)("POSTGRID"),gridTypeLabel:Object(l.createElement)("div",{className:"components-placeholder__label"},Object(l.createElement)("div",{className:"wpgl__grid--type"},Object(l.createElement)("label",{className:"wpgllabel__text wpgllabel__text--dark"}," ",e.attributes.gridType," ")))})))};Object(a.registerBlockType)("wpgl-gutenberg-block/grid",{title:"WPGL Grids",icon:"grid-view",category:"wpgl-blocks",attributes:c,edit:function(e){return Object(l.createElement)(U,e)},save:function(e){return null}});var F=function(e){var t=e.enableButton,n=e.buttonUrl,a=e.buttonText,o=e.setAttributes,r=e.buttonTarget,c=function(){o({enableButton:!t})};return Object(l.createElement)("div",null,Object(l.createElement)(l.Fragment,null,Object(l.createElement)(O.InspectorControls,null,Object(l.createElement)("label",{className:"wpgl-inspector-controls__label label--big"},Object(s.__)("Button settings")),Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ToggleControl,{label:"Is external link ?",help:Object(s.__)("Enable if the button is an external url.","autumn"),checked:r,onChange:function(){console.log(r),o({buttonTarget:!r})}})))),t?Object(l.createElement)("div",{className:"wpgl-components-placeholder wpgl-bannercta-settings"},Object(l.createElement)("div",{className:"components-placeholder__label"},Object(l.createElement)("span",{className:"wpgllabel"},Object(s.__)("Banner button"))),Object(l.createElement)("div",{className:"components-placeholder__button"},Object(l.createElement)("a",{href:n||"",target:r?"_blank":"",className:"btn btn-solid wpgl__button"}," ",a||"Button"," ")),Object(l.createElement)("div",{className:"components-placeholder__button"},Object(l.createElement)(f.IconButton,{className:"button button-small button-primary wpgl-button edit-button",label:Object(s.__)("Add image","wpglblocks"),icon:"edit",onClick:c}))):Object(l.createElement)("div",{className:"wpgl-components-placeholder wpgl-bannercta-settings"},Object(l.createElement)("div",{className:"components-placeholder__label"},Object(l.createElement)("span",{className:"wpgllabel"},Object(s.__)("Banner button link"))),Object(l.createElement)("div",{className:"wpgl__group"},Object(l.createElement)(f.TextControl,{type:"text",className:"input input__value",onChange:function(e){o({buttonUrl:e})},value:n||"",placeholder:"Add link to button"}),Object(l.createElement)(f.TextControl,{type:"text",className:"input input__value",onChange:function(e){o({buttonText:e})},value:a||"",placeholder:"Add button text"}),Object(l.createElement)(f.Button,{onClick:c,className:"button button-type",title:Object(s.__)("Create Button")},Object(l.createElement)("span",{className:"dashicons dashicons-yes-alt"})))))};F.propTypes={enableButton:b.a.bool,buttonUrl:b.a.string,buttonText:b.a.string,buttonTarget:b.a.bool,setAttributes:b.a.func},F.defaultProps={enableButton:!1,buttonUrl:"",buttonText:"",buttonTarget:!1,setAttributes:""};var M=F,D=function(e){e.bannerType;var t=e.setAttributes;return Object(l.createElement)("div",{className:"wpgl-components-placeholder wpgl-block-banner-select"},Object(l.createElement)("div",{className:"components-placeholder__label"},Object(l.createElement)("div",{className:"label__container"},Object(l.createElement)("div",{className:"wpgllabel"},Object(l.createElement)("img",{className:"wpgl__brand--image",width:"100",height:"100",src:images_data.logo_url}),Object(l.createElement)("label",{className:"wpgllabel__text"}," ",Object(s.__)("WPGL")," "),Object(l.createElement)("label",{className:"wpgllabel__text wpgllabel__text--dark"}," ",Object(s.__)("Banner")," ")))),Object(l.createElement)("div",{className:"components-placeholder__buttons"},Object(l.createElement)("div",{onClick:function(e){t({bannerType:"bgTypeImage"})},className:"wpglbutton"},Object(l.createElement)("span",{className:"dashicons dashicons-format-gallery"}),Object(l.createElement)("label",{className:"wpglbutton__text"},Object(s.__)("Background with image"))),Object(l.createElement)("div",{onClick:function(e){t({bannerType:"bgTypeColor"})},className:"wpglbutton"},Object(l.createElement)("span",{className:"dashicons dashicons-art"}),Object(l.createElement)("label",{className:"wpglbutton__text"},Object(s.__)("Background with color")))))};D.propTypes={bannerType:b.a.string},D.defaultProps={bannerType:null};var G=D,W=function(e){var t=e.headingType,n=e.headingContent,a=e.setAttributes,o=function(e){a({headingType:e})};return Object(l.createElement)("div",null,t?Object(l.createElement)("div",null,t&&Object(l.createElement)("div",{className:"wpgl-components-placeholder wpgl-heading-settings"},Object(l.createElement)("div",{className:"components-placeholder__label"},Object(l.createElement)("span",{className:"wpgllabel"},Object(s.__)("Banner Title"))),Object(l.createElement)(O.RichText,{tagName:t,placeholder:Object(s.__)("Enter title...","wpglblocks"),keepPlaceholderOnFocus:!0,value:n,onChange:function(e){a({headingContent:e})}}),Object(l.createElement)("div",{className:"components-placeholder__button"},Object(l.createElement)(f.IconButton,{className:"button button-small button-primary wpgl-button edit-button",label:Object(s.__)("Select heading styles","wpglblocks"),icon:"edit",onClick:function(){return o("")}})))):Object(l.createElement)("div",{className:"wpgl-components-placeholder wpgl-heading-settings"},Object(l.createElement)("div",{className:"components-placeholder__label"},Object(l.createElement)("span",{className:"wpgllabel"},Object(s.__)("Select heading type"))),Object(l.createElement)("div",{className:"components-placeholder__group"},Object(l.createElement)("button",{onClick:function(){return o("h1")},className:"btn"}," h1 "),Object(l.createElement)("button",{onClick:function(){return o("h2")},className:"btn"}," h2 "),Object(l.createElement)("button",{onClick:function(){return o("h3")},className:"btn"}," h3 "))))};W.propTypes={headingType:b.a.string,headingContent:b.a.string,setAttributes:b.a.func},W.defaultProps={headingType:null,headingContent:null};var H=W,q=function(e){var t=e.captionContent,n=e.setAttributes;return Object(l.createElement)("div",{className:"wpgl-components-placeholder wpgl-caption-settings"},Object(l.createElement)("div",{className:"components-placeholder__label"},Object(l.createElement)("span",{className:"wpgllabel"},Object(s.__)("Banner caption"))),Object(l.createElement)(O.RichText,{format:"string",tagName:"p",placeholder:Object(s.__)("Enter caption...","wpglblocks"),value:t,onChange:function(e){n({captionContent:e})},keepPlaceholderOnFocus:!0}))};q.propTypes={captionContent:b.a.string,setAttributes:b.a.func},q.defaultProps={captionContent:null};var z=q,J=function(e){var t=e.containerImgURL,n=e.setAttributes;return Object(l.createElement)("div",{className:"banner__image"},Object(l.createElement)("div",{className:"dropzone-simulation"},t?Object(l.createElement)("img",{className:"img-responsive",src:t}):Object(l.createElement)("img",{className:"img-responsive",src:"https://picsum.photos/800/400"}),Object(l.createElement)(O.MediaUploadCheck,null,Object(l.createElement)(O.MediaUpload,{onSelect:function(e){n({containerImgURL:e.url})},allowedTypes:["image"],render:function(e){var n=e.open;return Object(l.createElement)("div",{className:"upload-controls"},t?Object(l.createElement)(f.IconButton,{className:"button button-large button-primary wpgl-button add-button",label:Object(s.__)("Edit image","wpglblocks"),icon:"edit",onClick:n}):Object(l.createElement)(f.IconButton,{className:"button button-large button-primary wpgl-button edit-button",label:Object(s.__)("Add image","wpglblocks"),icon:"plus",onClick:n}))}}))))};J.propTypes={containerImgURL:b.a.string,setAttributes:b.a.func},J.defaultProps={containerImgURL:null};var V=J,Y=function(e){var t=e.isForegroundImage,n=e.foregroundImgURL,a=e.containerBackgroundColor,o=e.bannerType,r=e.setAttributes,c=(e.buttonTarget,function(){r({foregroundImgURL:null})});return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(O.InspectorControls,null,Object(l.createElement)(f.PanelBody,{className:"wpgl-banner-controls",title:Object(s.__)("Banner settings")},Object(l.createElement)("label",{className:"wpgl-inspector-controls__label label--big"},Object(s.__)("Image settings")),Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ToggleControl,{label:"Add image in banner",help:Object(s.__)("Render image on top of this banner.","autumn"),checked:t,onChange:function(){r({isForegroundImage:!t,foregroundImgURL:null})}})),t&&Object(l.createElement)(f.PanelRow,null,Object(l.createElement)("label",{className:"wpgl-inspector-controls__label"},Object(s.__)("Select image")),Object(l.createElement)(O.MediaUploadCheck,null,Object(l.createElement)(O.MediaUpload,{onSelect:function(e){r({foregroundImgURL:e.url})},allowedTypes:["image"],value:"",render:function(e){var t=e.open;return Object(l.createElement)("div",null,n?Object(l.createElement)(f.IconButton,{className:"ab-container-inspector-media",label:Object(s.__)("Remove Image"),icon:"dismiss",onClick:c},Object(s.__)("Remove")):Object(l.createElement)(f.IconButton,{className:"ab-container-inspector-media",label:Object(s.__)("Edit image"),icon:"format-image",onClick:t},Object(s.__)("Select Image")))}}))),t&&n&&!!n.length&&Object(l.createElement)(f.PanelRow,null,Object(l.createElement)("div",{className:"wpgl__image-preview"},Object(l.createElement)("img",{width:"150px",height:"150px",src:n}))),"bgTypeColor"===o&&Object(l.createElement)("div",{className:"wpgl-inspector-controls__colorpicker"},Object(l.createElement)("label",{className:"wpgl-inspector-controls__label label--big"},Object(s.__)("Background color")),Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ColorPicker,{color:a,onChangeComplete:function(e){r({containerBackgroundColor:e.hex})},disableAlpha:!0}))))))};Y.propTypes={isForegroundImage:b.a.bool,bannerType:b.a.string,foregroundImgURL:b.a.string,containerBackgroundColor:b.a.string},Y.defaultProps={isForegroundImage:!1,bannerType:null,foregroundImgURL:null,containerBackgroundColor:"#000"};var K=Y,Q=function(e){var t=e.buttonUrl,n=e.buttonText,a=e.buttonTarget;return Object(l.createElement)("div",{className:"c-site-button"},Object(l.createElement)("a",{target:a&&"_blank",rel:a&&"noopener noreferrer",alt:n,className:"c-button wpgl-banner-cta",href:t||""},Object(l.createElement)("span",{class:"c-arrow-button"},Object(l.createElement)("span",{class:"c-button__text"},n),Object(l.createElement)("span",{class:"c-arrow-button__inner"},Object(l.createElement)("span",{class:"c-arrow-button__line c-arrow-button__line--right-arrow"})))))};Q.propTypes={buttonUrl:b.a.string,buttonText:b.a.string,buttonTarget:b.a.bool},Q.defaultProps={buttonUrl:"",buttonText:"",buttonTarget:!1};var X=Q,Z=function(e){var t=e.attributes,n=t.containerImgURL,a=t.containerBackgroundColor,o=t.isForegroundImage,r=t.foregroundImgURL,c=t.bannerType,s=(t.className,t.headingType),i=t.headingContent,b=t.captionContent,u=t.buttonUrl,p=t.buttonText,m=t.buttonTarget,g=t.enableButton;return Object(l.createElement)("div",{className:"wpgl-banner",style:"bgTypeImage"===c?{backgroundImage:"url(".concat(n,")")}:{backgroundColor:"".concat(a)},"data-banner-type":c},Object(l.createElement)("div",{className:"container-fluid"},Object(l.createElement)("div",{className:"row wrapper-container","data-wpgl-image":n},Object(l.createElement)("div",{className:"col-lg-6 col-md-7"},Object(l.createElement)("div",{className:"c-banner__content wrapper__container wpgl__content"},Object(l.createElement)("div",{className:"c-banner__counter"},Object(l.createElement)("label",{"aria-label":"current slide",className:"c-banner__counter-text c-banner__counter-current"}),Object(l.createElement)("span",{className:"c-banner__counter-text c-banner__counter-divider"}," / "),Object(l.createElement)("label",{"aria-label":"total slides",className:"c-banner__counter-text c-banner__counter-total"})),Object(l.createElement)("div",{className:"c-banner__heading wrapper__container__inner"},Object(l.createElement)(O.RichText.Content,{className:"c-banner__heading-text wpgl-banner-title","data-heading-type":s,tagName:s,value:i})),Object(l.createElement)("div",{className:"c-banner__description wrapper__container__inner"},Object(l.createElement)(O.RichText.Content,{className:"wpgl-banner-caption",tagName:"p",value:b})),!!g&&Object(l.createElement)(X,{buttonUrl:u,buttonText:p,buttonTarget:m}))),o&&Object(l.createElement)("div",{className:"col-lg-6 col-md-5"},Object(l.createElement)("div",{className:"c-banner__picture"},Object(l.createElement)("img",{src:r,className:"c-banner-picture__image wpgl__image"}))))))};Z.propTypes={},Z.defaultProps={};var $=Z,ee={containerImgURL:{selector:".wrapper-container",source:"attribute",attribute:"data-wpgl-image"},containerBackgroundColor:{type:"string",default:"#1D2308"},isForegroundImage:{type:"boolean",default:!1},foregroundImgURL:{type:"string",default:""},bgBannerClass:{type:"object",attribute:"class",selector:".wpgl-banner"},bannerType:{selector:".wpgl-banner",source:"attribute",attribute:"data-banner-type"},headingType:{type:"string",selector:".wpgl-banner-title",attribute:"data-heading-type"},headingContent:{type:"string",selector:".wpgl-banner-title",source:"text"},captionContent:{type:"string",selector:".wpgl-banner-caption",source:"html"},enableButton:{type:"boolean",default:!1},buttonUrl:{type:"string",selector:".wpgl-banner-cta",source:"attribute",attribute:"href"},buttonText:{type:"string",source:"text",selector:".wpgl-banner-cta"},buttonTarget:{type:"boolean",default:!1}};Object(a.registerBlockType)("wpgl-gutenberg-block/banner",{title:Object(s.__)("WPGL banners","wpglblocks"),icon:"images-alt2",category:"wpgl-blocks",attributes:ee,edit:function(e){var t=e.attributes,n=t.containerImgURL,a=t.containerBackgroundColor,o=t.isForegroundImage,r=t.foregroundImgURL,c=t.bannerType,i=t.headingType,b=t.headingContent,u=t.captionContent,m=t.enableButton,g=t.buttonUrl,d=t.buttonText,O=t.buttonTarget;return Object(l.createElement)("div",null,c?Object(l.createElement)("div",null,Object(l.createElement)(K,{bannerType:c,isForegroundImage:o,foregroundImgURL:r,containerBackgroundColor:a,buttonTarget:O,setAttributes:e.setAttributes}),Object(l.createElement)("div",{className:"wpgl-components__wrapper"},Object(l.createElement)(p,{placeholderLabel:Object(s.__)("Banner"),className:" placeholder--small wpgl-block-banner-select"}),"bgTypeImage"===c&&Object(l.createElement)("div",{className:"wpgl banner"},Object(l.createElement)(V,{containerImgURL:n,setAttributes:e.setAttributes})),Object(l.createElement)("div",{className:"wrapperDiv"},Object(l.createElement)(H,{headingType:i,headingContent:b,setAttributes:e.setAttributes})),Object(l.createElement)("div",{className:"wrapperDiv"},Object(l.createElement)(z,{captionContent:u,setAttributes:e.setAttributes})),Object(l.createElement)("div",{className:"wrapperDiv"},Object(l.createElement)(M,{enableButton:m,buttonUrl:g,buttonText:d,setAttributes:e.setAttributes,buttonTarget:O})))):Object(l.createElement)(G,{bannerType:c,setAttributes:e.setAttributes}))},save:function(e){return Object(l.createElement)($,e)}});var te={enableButton:{type:"boolean",default:!1},buttonUrl:{type:"string",selector:".wpgl-banner-cta",source:"attribute",attribute:"href"},buttonText:{type:"string",source:"text",selector:".wpgl-banner-cta"},buttonTarget:{type:"boolean",default:!1}};Object(a.registerBlockType)("wpgl-gutenberg-block/button",{title:Object(s.__)("WPGL button","wpglblocks"),icon:"external",category:"wpgl-blocks",attributes:te,edit:function(e){var t=e.attributes,n=t.enableButton,a=t.buttonUrl,o=t.buttonText,r=t.buttonTarget;return Object(l.createElement)("div",{className:"wrapperDiv"},Object(l.createElement)(M,{enableButton:n,buttonUrl:a,buttonText:o,setAttributes:e.setAttributes,buttonTarget:r}))},save:function(e){var t=e.attributes,n=t.buttonUrl,a=t.buttonText,o=t.buttonTarget;return Object(l.createElement)(X,{buttonUrl:n,buttonText:a,buttonTarget:o})}}),Object(a.registerBlockType)("wpgl-gutenberg-block/breadcrumb",{title:Object(s.__)("Wpgl Breadcrumb","wpgl-blocks"),icon:"external",category:"wpgl-blocks",keywords:[Object(s.__)("page breadcrumb — WPGL Block"),Object(s.__)("Memorres creative"),Object(s.__)("create-guten-block")],attributes:{},edit:function(e){return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(p,{placeholderLabel:Object(s.__)("Page Breadcrumb"),className:" placeholder--small wpgl-block-banner-select"}))},save:function(e){return null}}),Object(a.registerBlockType)("wpgl-gutenberg-block/latestposts",{title:Object(s.__)("Wpgl latest posts","wpgl-blocks"),icon:"external",category:"wpgl-blocks",keywords:[Object(s.__)("Wpgl latest posts — WPGL Block"),Object(s.__)("Memorres creative"),Object(s.__)("create-guten-block")],attributes:{},edit:function(e){return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(p,{placeholderLabel:Object(s.__)("Latest posts"),className:" placeholder--small wpgl-block-banner-select"}))},save:function(e){return null}});var ne={isOverlay:{type:"boolean",default:!1},containerImgID:{type:"string",default:""},containerImgURL:{type:"string",default:""},containerImgAlt:{type:"string",default:""},containerBackgroundColor:{type:"string",default:""},innerContainerBackgroundColor:{type:"string",default:""},setColor:{type:"string",default:""},enableRowStretch:{type:"boolean",default:!1}};function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,l)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(n,!0).forEach((function(t){g()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object(a.registerBlockType)("wpgl-gutenberg-block/container",{title:Object(s.__)("WPGL Container","autumn"),icon:"desktop",category:"wpgl-blocks",keywords:[Object(s.__)("container - WPGL Block"),Object(s.__)("Memorres creative"),Object(s.__)("create-guten-block")],attributes:ne,edit:function(e){var t=e.attributes,n=t.isOverlay,a=t.enableRowStretch,o=(t.contentAlignment,t.containerImgID,t.containerImgAlt,t.containerImgURL),r=t.containerBackgroundColor,c=(t.innerContainerBackgroundColor,function(){e.setAttributes({containerImgID:null,containerImgURL:null,containerImgAlt:null})});return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(O.InspectorControls,null,Object(l.createElement)(f.PanelBody,{title:Object(s.__)("Container Settings")},Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ToggleControl,{label:Object(s.__)("Stretch row content "),help:Object(s.__)("Enable to stretch row content overriding the padding of container"),checked:a,onChange:function(t){return e.setAttributes({enableRowStretch:t})}}))),Object(l.createElement)(f.PanelBody,{title:Object(s.__)("Background Options"),initialOpen:!1},Object(l.createElement)(f.PanelRow,null,Object(l.createElement)("label",{className:"wpgl-inspector-controls__label"},Object(s.__)("Select BG image")),Object(l.createElement)(O.MediaUploadCheck,null,Object(l.createElement)(O.MediaUpload,{onSelect:function(t){e.setAttributes({containerImgID:t.id,containerImgURL:t.url,containerImgAlt:t.alt})},allowedTypes:["image"],value:"",render:function(e){var t=e.open;return Object(l.createElement)("div",null,o?Object(l.createElement)(f.IconButton,{className:"ab-container-inspector-media",label:Object(s.__)("Remove Image"),icon:"dismiss",onClick:c},Object(s.__)("Remove")):Object(l.createElement)(f.IconButton,{className:"ab-container-inspector-media",label:Object(s.__)("Edit image"),icon:"format-image",onClick:t},Object(s.__)("Select Image")))}}))),o&&!!o.length&&Object(l.createElement)(f.PanelRow,null,Object(l.createElement)("div",{className:"wpgl-components__img--preview"},Object(l.createElement)("img",{width:"200px",height:"200px",src:o}))),Object(l.createElement)(f.PanelRow,null,Object(l.createElement)(f.ToggleControl,{label:"Add Image Overlay",help:n?"This adds overlay on main background image. Color is managed from css.":"",checked:n,onChange:function(t){return e.setAttributes({isOverlay:t})}})),!o&&Object(l.createElement)(O.PanelColorSettings,{title:Object(s.__)("Container Background Color"),initialOpen:!1,colorSettings:[{value:r,label:Object(s.__)("Background Color"),onChange:function(t){e.setAttributes({containerBackgroundColor:t})}}]}))),Object(l.createElement)("div",{className:"wpgl-components__wrapper wpgl-components__wrapper--hasbg"},Object(l.createElement)(p,{placeholderLabel:Object(s.__)("Container"),className:" placeholder--small wpgl-block-banner-select"}),Object(l.createElement)("div",{className:"wrapperDiv"},Object(l.createElement)(O.InnerBlocks,null))))},save:function(e){var t=e.attributes,n=(t.isOverlay,t.enableRowStretch),a=t.containerImgURL,o=t.containerBackgroundColor,r=(t.innerContainerBackgroundColor,a?{backgroundImage:"url(".concat(a,")")}:""),c=o?{backgroundColor:o}:"",s=n?"stretch-content":"";return Object(l.createElement)("section",{className:"o-section",style:ae({},r,{},c)},Object(l.createElement)("div",{className:"container-fluid ".concat(s)},Object(l.createElement)(O.InnerBlocks.Content,null)))}})}]);