!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},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=25)}([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.data}()},function(e,t){!function(){e.exports=this.wp.components}()},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.compose}()},function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(4),i=n.n(r),o=n(2);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}
/**
 * Builds new meta for use when saving post data.
 *
 * @since   3.1.3
 * @package Genesis\JS
 * @author  StudioPress
 * @license GPL-2.0-or-later
 */
function c(e,t){var n=Object(o.select)("core/editor").getEditedPostAttribute("meta");return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Object.keys(n).filter((function(e){return e.startsWith("_genesis")})).reduce((function(e,t){return e[t]=n[t],null===e[t]&&(e[t]=!1),e}),{}),i()({},e,t))}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},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){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 r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(15);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&&r(e,t)}},function(e,t,n){var r=n(16),i=n(10);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){!function(){e.exports=this.wp.a11y}()},function(e,t){!function(){e.exports=this.lodash}()},,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(0),i=n(1),o=n(5),s=n(2),c=n(3),a=n(6),u=n(4),l=n.n(u),p=n(11),f=n.n(p),b=n(12),g=n.n(b),d=n(10),m=n.n(d),O=n(13),y=n.n(O),h=n(14),j=n.n(h),_=n(9),v=n.n(_),P=n(17),S=n(8),w=n.n(S),x=n(18);
/**
 * Provides a GenesisImageToggleInfo component that displays the state
 * of the “display Singular Images” checkbox for the current post type.
 *
 * Offers a link to either disable or enable Singular Images site-wide
 * for the current post type. The goal is to reduce the need to leave
 * the editor and visit the Customizer to turn Singular Image on or off.
 *
 * @since   3.1.0
 * @package Genesis\JS
 * @author  StudioPress
 * @license GPL-2.0-or-later
 */
var E=function(e){y()(n,e);var t=function(e){function t(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,r=v()(e);if(t()){var i=v()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return j()(this,n)}}(n);function n(e){var r;return f()(this,n),(r=t.call(this,e)).updateSingularImagesSetting=r.updateSingularImagesSetting.bind(m()(r)),r.state={typesWithSingularImagesEnabled:[],currentUserCanEditThemeOptions:!1,updating:!1},r}return g()(n,[{key:"componentDidMount",value:function(){var e=this;w()({path:"/genesis/v1/singular-images"}).then((function(t){e.setState({typesWithSingularImagesEnabled:t})})),w()({path:"/wp/v2/users/me?context=edit"}).then((function(t){t.capabilities.edit_theme_options&&e.setState({currentUserCanEditThemeOptions:t.capabilities.edit_theme_options})}))}},{key:"postTypeHasSingularImagesDisabled",value:function(){return!this.state.typesWithSingularImagesEnabled.includes(this.props.currentPostType)}},{key:"updateSingularImagesSetting",value:function(e){var t=this;this.setState({updating:!0});var n={path:"/genesis/v1/singular-images",method:"PUT",data:l()({},this.props.currentPostType,e)};return w()(n).then((function(e){t.setState({updating:!1,typesWithSingularImagesEnabled:e});var n=Object(i.sprintf)(Object(i.__)("Featured images now enabled on %s.","genesis"),t.props.currentPostTypeLabel);t.postTypeHasSingularImagesDisabled()&&(n=Object(i.sprintf)(Object(i.__)("Featured images now disabled on %s.","genesis"),t.props.currentPostTypeLabel)),Object(P.speak)(n,"assertive")})),!1}},{key:"render",value:function(){var e=this;if(!this.state.currentUserCanEditThemeOptions)return"";if(this.state.updating){var t=Object(i.sprintf)(Object(i.__)("Disabling images on %s...","genesis"),this.props.currentPostTypeLabel);return this.postTypeHasSingularImagesDisabled()&&(t=Object(i.sprintf)(Object(i.__)("Enabling images on %s...","genesis"),this.props.currentPostTypeLabel)),Object(r.createElement)("p",null,Object(r.createElement)("span",null,t),Object(r.createElement)(c.Spinner,null))}var n="genesis-sidebar-label-enabled",o=Object(i.sprintf)(Object(i.__)("Featured images are enabled on %s. ","genesis"),this.props.currentPostTypeLabel),s=Object(i.sprintf)(Object(i.__)("Disable featured images on all %s?"),this.props.currentPostTypeLabel),a=Object(i.__)("Disable images.","genesis"),u=0;return this.postTypeHasSingularImagesDisabled()&&(n="genesis-sidebar-label-disabled",o=Object(i.sprintf)(Object(i.__)("Featured images are disabled on %s.","genesis"),this.props.currentPostTypeLabel),s=Object(i.sprintf)(Object(i.__)("Enable featured images on all %s"),this.props.currentPostTypeLabel),a=Object(i.__)("Enable images.","genesis"),u=1),Object(r.createElement)("p",{className:n},o+" ",Object(r.createElement)("button",{className:"genesis-sidebar-text-button",onClick:function(){return e.updateSingularImagesSetting(u)},"aria-label":s},a))}}]),n}(r.Component),T=Object(o.compose)([Object(s.withSelect)((function(){var e=Object(s.select)("core/editor").getCurrentPostType(),t=Object(s.select)("core").getPostType(e);return{currentPostType:e,currentPostTypeLabel:Object(x.get)(t,"name",Object(i.__)("Entries","genesis"))}}))])(E),I=n(7);var D=Object(o.compose)([Object(s.withSelect)((function(){return{hideFeaturedImage:Object(s.select)("core/editor").getEditedPostAttribute("meta")._genesis_hide_singular_image}})),Object(s.withDispatch)((function(e){return{onUpdate:function(t){e("core/editor").editPost({meta:Object(I.a)("_genesis_hide_singular_image",!!t)})}}}))])((
/**
 * Adds a “hide featured image” checkbox to Genesis Block Editor sidebar in an
 * Image panel. Unchecked by default.
 *
 * If checked and the post is updated or published,
 * `_genesis_hide_singular_image` is set to true in post meta.
 *
 * @since   3.1.0
 * @package Genesis\JS
 * @author  StudioPress
 * @license GPL-2.0-or-later
 */
function(e){var t=e.hideFeaturedImage,n=void 0!==t&&t,o=e.onUpdate;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(c.Fill,{name:"GenesisSidebar"},Object(r.createElement)(c.PanelBody,{initialOpen:!0,title:Object(i.__)("Images","genesis")},Object(r.createElement)(c.PanelRow,null,Object(r.createElement)(c.CheckboxControl,{label:Object(i.__)("Hide Featured Image","genesis"),checked:!!n,onChange:function(){return o(!n)}})),Object(r.createElement)(c.PanelRow,null,Object(r.createElement)(T,null)))))}));Object(a.registerPlugin)("genesis-image-toggle",{render:D})}]);