From 8a73e63bdad805428360867dcf3afbbfbfbdb3c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valenti=CC=81n=20Garci=CC=81a?= Date: Thu, 6 Apr 2023 19:33:22 -0600 Subject: [PATCH 01/20] Delay updateEditorSettings to bypass the override --- src/assets/blocks/block-controls.js | 2195 +- src/assets/blocks/block-controls.js.map | 2 +- src/assets/blocks/blocks.js | 31870 +++++++++++++++++++++- src/assets/blocks/blocks.js.map | 2 +- src/assets/blocks/custom-styles.js | 235 +- src/assets/blocks/custom-styles.js.map | 2 +- src/assets/blocks/editor.js | 224 +- src/assets/blocks/editor.js.map | 2 +- src/assets/blocks/frontend.js | 11796 +++++++- src/assets/blocks/frontend.js.map | 2 +- src/assets/blocks/post-sidebar.js | 323 +- src/assets/blocks/post-sidebar.js.map | 2 +- src/assets/blocks/pro-ad.js | 195 +- src/assets/blocks/pro-ad.js.map | 2 +- src/assets/js/editor.jsx | 141 +- 15 files changed, 46836 insertions(+), 157 deletions(-) diff --git a/src/assets/blocks/block-controls.js b/src/assets/blocks/block-controls.js index 8956dbf3b..18feddfdc 100644 --- a/src/assets/blocks/block-controls.js +++ b/src/assets/blocks/block-controls.js @@ -1,7 +1,2196 @@ -!function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},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=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";var a,r=function(){function e(e,t){for(var n=0;n0?advgb_block_controls_vars.controls:[]},A=function(e){return void 0!==e&&e},B=function(e){var t=O(),n=0,a=[];return Object.keys(t).forEach((function(e){A(advgb_block_controls_vars.controls[e])&&a.push(e)})),a.forEach((function(t){D(e,t,"enabled")&&n++})),n>0},P=function(){var e=O(),t=0;return Object.keys(e).map((function(e){A(advgb_block_controls_vars.controls[e])&&t++})),t>0},D=function(e,t,n){if(!(!!(void 0===e||!e.length)||!e.some((function(e){return e.control===t})))){var a=e.findIndex((function(e){return e.control===t}));return!(a<0)&&[].concat(d(e))[a][n]}return null};"undefined"!=typeof advgb_block_controls_vars&&void 0!==advgb_block_controls_vars.non_supported&&advgb_block_controls_vars.non_supported.length>0&&(S=[].concat(d(S),d(advgb_block_controls_vars.non_supported)),S=[].concat(d(new Set(S)))),h("blocks.registerBlockType","advgb/blockControls",(function(e){return!S.includes(e.name)&&P()&&(e.attributes=o(e.attributes,{advgbBlockControls:{type:"array",items:{type:"object"},default:[]}})),e})),h("editor.BlockEdit","advgb/addBlockControls",E((function(e){return function(t){function n(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t=n.__proto__||Object.getPrototypeOf(n)).call.apply(t,[this].concat(d(e))));return a.state={taxModOptions:[],termOptions:[],searchTermWord:"",initArchive:!0,updateTaxLabels:!1},a.isPost=a.isPost.bind(a),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,t),r(n,[{key:"getTermSlugs",value:function(e){var t=this,n=(this.getTaxonomies(),[]);return e.forEach((function(e){var a=t.getTaxonomies(),r=a.findIndex((function(t){return t.slug===e}));a[r].terms.forEach((function(e){n.push(e.slug)}))})),n}},{key:"getTaxonomies",value:function(){return void 0!==advgb_block_controls_vars.taxonomies&&advgb_block_controls_vars.taxonomies.length>0?advgb_block_controls_vars.taxonomies:[]}},{key:"getUserRoles",value:function(){return void 0!==advgb_block_controls_vars.user_roles&&advgb_block_controls_vars.user_roles.length>0?advgb_block_controls_vars.user_roles:[]}},{key:"getTerms",value:function(e){var t=this,n=(this.getTaxonomies(),[]);return e.forEach((function(e){var a=t.getTaxonomies(),r=a.findIndex((function(t){return t.slug===e}));a[r].terms.forEach((function(e){n.push({slug:e.slug,title:e.title+" ("+a[r].title+")"})}))})),n}},{key:"getPages",value:function(){return void 0!==advgb_block_controls_vars.page&&advgb_block_controls_vars.page.length>0?advgb_block_controls_vars.page:[]}},{key:"changeControlKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=this.props,r=a.attributes,l=a.setAttributes,c=r.advgbBlockControls,i={control:"schedule",enabled:!0,dateFrom:null,dateTo:null,recurring:!1},s={control:"user_role",enabled:!0,roles:[],approach:"public"},g={control:"archive",enabled:!0,taxonomies:[],approach:"exclude"},m={control:"page",enabled:!0,pages:[],approach:"exclude"},h=!(void 0===c||!c.length),v=!(!h||!c.some((function(t){return t.control===e})));if(v){var b=c.findIndex((function(t){return t.control===e}));if(b<0)return!1;var p=[].concat(d(c)),f=p[b];p[b]="boolean"==typeof f[t]?o({},p[b],u({},t,!f[t])):o({},p[b],u({},t,n)),l({advgbBlockControls:p})}else if(h&&!v)switch(e){case"schedule":l({advgbBlockControls:[].concat(d(c),[i])});break;case"user_role":l({advgbBlockControls:[].concat(d(c),[s])});break;case"archive":l({advgbBlockControls:[].concat(d(c),[g])});break;case"page":l({advgbBlockControls:[].concat(d(c),[m])})}else switch(e){case"schedule":l({advgbBlockControls:[i]});break;case"user_role":l({advgbBlockControls:[s]});break;case"archive":l({advgbBlockControls:[g]});break;case"page":l({advgbBlockControls:[m]})}}},{key:"changeArchiveControl",value:function(e,t){var n=this,a=this.props,r=a.attributes,l=a.setAttributes,c=r.advgbBlockControls,i=[],s=c.findIndex((function(e){return"archive"===e.control}));if(s<0)return!1;var g=[].concat(d(c));if("taxonomies"===e)t.forEach((function(e){var t=g[s].taxonomies.findIndex((function(t){return t.tax===e}));if(-1===t)i.push({tax:e,terms:[],all:!0});else{var n=g[s].taxonomies[t].terms.length?g[s].taxonomies[t].terms:[];n.length;i.push({tax:e,terms:n,all:!n.length})}})),g[s]=o({},g[s],u({},"taxonomies",i)),l({advgbBlockControls:g});else if("terms"===e){var m={},h=this.currentArchiveControl("taxonomies");t.forEach((function(e){var t=n.state.termOptions.find((function(t){return t.slug===e}));void 0===m[t.tax]&&(m[t.tax]=[]);g[s].taxonomies.findIndex((function(e){return e.tax===t.tax}));h.includes(t.tax)&&m[t.tax].push(e)})),Object.keys(m).forEach((function(e){var t=g[s].taxonomies.findIndex((function(t){return t.tax===e}));t>=0&&(g[s].taxonomies[t]={tax:e,terms:m[e],all:!m[e].length})})),h.forEach((function(e){if(!Object.keys(m).includes(e)){var t=g[s].taxonomies.findIndex((function(t){return t.tax===e}));t>=0&&(g[s].taxonomies[t]={tax:e,terms:[],all:!0})}})),l({advgbBlockControls:g})}}},{key:"currentArchiveControl",value:function(e){var t=this.props,n=t.attributes,a=(t.setAttributes,n.advgbBlockControls),r=[],o=D(a,"archive","taxonomies").length?D(a,"archive","taxonomies"):[];return"taxonomies"===e?o.forEach((function(e){r.push(e.tax)})):"terms"===e&&o.forEach((function(e){e.terms.forEach((function(e){r.push(e)}))})),r}},{key:"taxonomiesChanged",value:function(){var e=this,t=this.props.attributes.advgbBlockControls,n=D(t,"archive","terms")?D(t,"archive","terms"):[],a=D(t,"archive","taxonomies")?D(t,"archive","taxonomies"):[];if(n.length){var r=[];n.forEach((function(t){var n=e.state.termOptions.findIndex((function(e){return e.slug===t}));a.includes(e.state.termOptions[n].tax)&&r.push(e.state.termOptions[n].slug)})),this.changeControlKey("archive","terms",r)}this.setState({termOptions:this.state.termOptions.filter((function(t){return e.currentArchiveControl("taxonomies").includes(t.tax)}))}),this.modifyTaxLabels()}},{key:"initArchiveControl",value:function(){var e=this;this.props.attributes.advgbBlockControls;wp.apiFetch({path:wp.url.addQueryArgs("advgb/v1/terms",{taxonomies:this.currentArchiveControl("taxonomies"),ids:this.currentArchiveControl("terms")})}).then((function(t){e.modifyTaxLabels(),e.setState({termOptions:t,initArchive:!1,updateTaxLabels:!1})}))}},{key:"iniTaxLabels",value:function(){var e=[];return this.getTaxonomies().forEach((function(t){e.push({slug:t.slug,title:v(b("All %s terms","advanced-gutenberg"),t.title),singular:t.title})})),e}},{key:"modifyTaxLabels",value:function(){var e=this.props.attributes.advgbBlockControls,t=D(e,"archive","taxonomies").length?D(e,"archive","taxonomies"):[],n=[].concat(d(this.state.taxModOptions));n.forEach((function(e,a){var r=t.find((function(t){return e.slug===t.tax})),l=o({},n[a]);l.title=v(void 0!==r&&r.terms.length?b("Selected %s terms","advanced-gutenberg"):b("All %s terms","advanced-gutenberg"),l.singular),n[a]=l})),this.setState({taxModOptions:n,updateTaxLabels:!1})}},{key:"searchTerms",value:function(){var e=this,t=this.state,n=t.termOptions,a=t.searchTermWord;this.props.attributes.advgbBlockControls;wp.apiFetch({path:wp.url.addQueryArgs("advgb/v1/terms",{search:a,taxonomies:this.currentArchiveControl("taxonomies")})}).then((function(t){var a=[].concat(d(n),d(t));a=Array.from(new Set(a.map((function(e){return e.slug})))).map((function(e){return a.find((function(t){return t.slug===e}))})),e.setState({termOptions:a})}))}},{key:"isPost",value:function(){return wp.data.select("core/editor")&&wp.data.select("core/editor").getCurrentPostId()}},{key:"getTimezoneLabel",value:function(){return void 0!==advgbBlocks.timezone&&advgbBlocks.timezone.length?advgbBlocks.timezone.replace(/_/g," "):b("WordPress settings timezone","advanced-gutenberg")}},{key:"getTimezoneSlug",value:function(){return void 0!==advgbBlocks.timezone&&advgbBlocks.timezone.length?advgbBlocks.timezone:"UTC"}},{key:"componentDidMount",value:function(){this.setState({taxModOptions:this.iniTaxLabels()})}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,a=n.attributes,r=n.isSelected,o=n.name,l=a.advgbBlockControls,c=e.attributes.advgbBlockControls,i=this.state,s=i.searchTermWord,u=i.initArchive,d=t.searchTermWord;!this.isPost()&&!S.includes(o)&&r&&u&&A(advgb_block_controls_vars.controls.archive)&&D(l,"archive","enabled")&&this.currentArchiveControl("taxonomies").length&&this.currentArchiveControl("terms").length&&this.initArchiveControl(),s!==d&&s.length>2&&this.searchTerms(),!this.isPost()&&A(advgb_block_controls_vars.controls.archive)&&D(l,"archive","enabled")&&(D(c,"archive","taxonomies")!==D(l,"archive","taxonomies")||this.state.updateTaxLabels)&&this.taxonomiesChanged()}},{key:"render",value:function(){var t=this,n=this.props,a=n.attributes,r=(n.setAttributes,a.advgbBlockControls);return[this.props.isSelected&&!S.includes(this.props.name)&&P()&&React.createElement(y,{key:"advgb-bc-controls"},React.createElement(k,{title:b("Block Controls","advanced-gutenberg"),icon:"visibility",initialOpen:!1,className:B(r)?"advgb-feature-icon-active":""},A(advgb_block_controls_vars.controls.schedule)&&React.createElement(w,null,React.createElement(C,{label:b("Schedule","advanced-gutenberg"),help:D(r,"schedule","enabled")?b("Choose when to start showing and/or stop showing this block.","advanced-gutenberg"):"",checked:D(r,"schedule","enabled"),onChange:function(){return t.changeControlKey("schedule","enabled")}}),D(r,"schedule","enabled")&&React.createElement(w,null,React.createElement("div",{style:{marginBottom:30}},React.createElement(i.AdvDateTimeControl,{buttonLabel:b("Now","advanced-gutenberg"),dateLabel:b("Start showing","advanced-gutenberg"),date:D(r,"schedule","dateFrom"),onChangeDate:function(e){return t.changeControlKey("schedule","dateFrom",e)},onDateClear:function(){return t.changeControlKey("schedule","dateFrom",null)},onInvalidDate:!1}),React.createElement(i.AdvDateTimeControl,{buttonLabel:b("Never","advanced-gutenberg"),dateLabel:b("Stop showing","advanced-gutenberg"),date:D(r,"schedule","dateTo")?D(r,"schedule","dateTo"):null,onChangeDate:function(e){return t.changeControlKey("schedule","dateTo",e)},onDateClear:function(){return t.changeControlKey("schedule","dateTo",null)},onInvalidDate:function(e){if(D(r,"schedule","dateFrom")){var t=new Date(e.getTime());t.setHours(0,0,0,0);var n=new Date(D(r,"schedule","dateFrom"));return n.setHours(0,0,0,0),t.getTime()D(r,"schedule","dateTo")&&React.createElement(_,{className:"advgb-notice-sidebar",status:"warning",isDismissible:!1},b('"Stop showing" date should be after "Start showing" date!',"advanced-gutenberg")),D(r,"schedule","dateFrom")&&D(r,"schedule","dateTo")&&React.createElement(C,{label:b("Recurring","advanced-gutenberg"),checked:D(r,"schedule","recurring"),onChange:function(){return t.changeControlKey("schedule","recurring")},help:b("If Recurring is enabled, this block will be displayed every year between the selected dates.","advanced-gutenberg")}),React.createElement(i.AdvDaysControl,{label:b("On these days (optional)","advanced-gutenberg"),days:D(r,"schedule","days")?D(r,"schedule","days"):[],onChangeDays:function(e){return t.changeControlKey("schedule","days",e)}}),React.createElement("label",{style:{marginBottom:8,display:"block"}},b("Between these times (optional)","advanced-gutenberg")),React.createElement(i.AdvTimeControl,{label:b("From","advanced-gutenberg"),currentTime:D(r,"schedule","timeFrom")?D(r,"schedule","timeFrom"):null,onChangeTime:function(e){return t.changeControlKey("schedule","timeFrom",e)},onTimeClear:function(){return t.changeControlKey("schedule","timeFrom",null)}}),React.createElement(i.AdvTimeControl,{label:b("To","advanced-gutenberg"),currentTime:D(r,"schedule","timeTo")||null,onChangeTime:function(e){return t.changeControlKey("schedule","timeTo",e)},onTimeClear:function(){return t.changeControlKey("schedule","timeTo",null)}}),D(r,"schedule","timeFrom")&&D(r,"schedule","timeTo")&&"01/01/2020T"+D(r,"schedule","timeFrom")>="01/01/2020T"+D(r,"schedule","timeTo")&&React.createElement(_,{className:"advgb-notice-sidebar",status:"warning",isDismissible:!1},b('"To" time should be after "From" time!',"advanced-gutenberg")),(D(r,"schedule","timeFrom")&&!D(r,"schedule","timeTo")||!D(r,"schedule","timeFrom")&&D(r,"schedule","timeTo"))&&React.createElement(_,{className:"advgb-notice-sidebar",status:"warning",isDismissible:!1},b('Please choose "From" time and "To" time.',"advanced-gutenberg")),React.createElement(i.AdvTimezoneControl,{label:b("Timezone","advanced-gutenberg"),defaultTimezone:this.getTimezoneLabel(),value:D(r,"schedule","timezone")?D(r,"schedule","timezone"):this.getTimezoneSlug(),onChangeTimezone:function(e){return t.changeControlKey("schedule","timezone",e)}})))),A(advgb_block_controls_vars.controls.user_role)&&React.createElement(w,null,React.createElement(C,{label:b("User roles","advanced-gutenberg"),help:D(r,"user_role","enabled")?b("Choose which users can see this block.","advanced-gutenberg"):"",checked:D(r,"user_role","enabled"),onChange:function(){return t.changeControlKey("user_role","enabled")}}),D(r,"user_role","enabled")&&React.createElement(w,null,React.createElement("div",{className:"advgb-revert-mb"},React.createElement(T,{value:D(r,"user_role","approach"),options:[{value:"public",label:b("Show to everyone","advanced-gutenberg")},{value:"hidden",label:b("Hide from everyone","advanced-gutenberg")},{value:"login",label:b("Show to logged in users","advanced-gutenberg")},{value:"logout",label:b("Show to logged out users","advanced-gutenberg")},{value:"include",label:b("Show to the selected user roles","advanced-gutenberg")},{value:"exclude",label:b("Hide from the selected user roles","advanced-gutenberg")}],onChange:function(e){return t.changeControlKey("user_role","approach",e)}})),("include"===D(r,"user_role","approach")||"exclude"===D(r,"user_role","approach"))&&React.createElement(w,null,React.createElement(x,{multiple:!0,label:b("Select user roles","advanced-gutenberg"),placeholder:b("Search","advanced-gutenberg"),suggestions:(0,s.getOptionSuggestions)(this.getUserRoles()),maxSuggestions:10,value:(0,s.getOptionTitles)(D(r,"user_role","roles")?D(r,"user_role","roles"):[],this.getUserRoles()),onChange:function(e){t.changeControlKey("user_role","roles",(0,s.getOptionSlugs)(e,t.getUserRoles()))},__experimentalExpandOnFocus:!0}),("include"===D(r,"user_role","approach")||"exclude"===D(r,"user_role","approach"))&&!D(r,"user_role","roles").length&&React.createElement(_,{className:"advgb-notice-sidebar",status:"warning",isDismissible:!1,style:{marginBottom:30}},b("Please select at least one user role.","advanced-gutenberg"))))),!this.isPost()&&React.createElement(w,null,A(advgb_block_controls_vars.controls.archive)&&React.createElement(w,null,React.createElement(C,{label:b("Term archives","advanced-gutenberg"),help:D(r,"archive","enabled")?b("Choose on which taxonomies and terms archive pages your blocks can be displayed.","advanced-gutenberg"):"",checked:D(r,"archive","enabled"),onChange:function(){return t.changeControlKey("archive","enabled")}}),D(r,"archive","enabled")&&React.createElement(w,null,React.createElement("div",{className:"advgb-revert-mb--disabled",style:{marginBottom:20}},React.createElement(T,{value:D(r,"archive","approach"),options:[{value:"include",label:b("Show for selected terms","advanced-gutenberg")},{value:"exclude",label:b("Hide for selected terms","advanced-gutenberg")}],onChange:function(e){return t.changeControlKey("archive","approach",e)}})),React.createElement(x,{multiple:!0,label:b("Select taxonomies","advanced-gutenberg"),placeholder:b("Search taxonomies","advanced-gutenberg"),suggestions:(0,s.getOptionSuggestions)(this.state.taxModOptions||this.getTaxonomies()),maxSuggestions:10,value:(0,s.getOptionTitles)(this.currentArchiveControl("taxonomies"),this.state.taxModOptions||this.getTaxonomies()),onChange:function(e){t.changeArchiveControl("taxonomies",(0,s.getOptionSlugs)(e,t.state.taxModOptions||t.getTaxonomies()))},__experimentalExpandOnFocus:!0}),D(r,"archive","taxonomies").length>0&&React.createElement(w,null,React.createElement(x,{multiple:!0,label:b("Filter terms","advanced-gutenberg"),placeholder:b("Search terms","advanced-gutenberg"),suggestions:(0,s.getOptionSuggestions)(this.state.termOptions),maxSuggestions:10,value:(0,s.getOptionTitles)(this.currentArchiveControl("terms"),this.state.termOptions),onChange:function(e){t.changeArchiveControl("terms",(0,s.getOptionSlugs)(e,t.state.termOptions)),t.setState({updateTaxLabels:!0})},onInputChange:function(e){t.setState({searchTermWord:e})},__experimentalShowHowTo:!1}),React.createElement("div",{className:"advgb-revert-mb--disabled components-form-token-field__help",style:{marginBottom:20}},b("Use this filter to apply only to some terms.","advanced-gutenberg"))))),A(advgb_block_controls_vars.controls.page)&&React.createElement(w,null,React.createElement(C,{label:b("Pages","advanced-gutenberg"),help:D(r,"page","enabled")?b("Choose in which pages this block can be displayed.","advanced-gutenberg"):"",checked:D(r,"page","enabled"),onChange:function(){return t.changeControlKey("page","enabled")}}),D(r,"page","enabled")&&React.createElement(w,null,React.createElement("div",{className:"advgb-revert-mb"},React.createElement(T,{value:D(r,"page","approach"),options:[{value:"include",label:b("Show on the selected pages","advanced-gutenberg")},{value:"exclude",label:b("Hide on the selected pages","advanced-gutenberg")}],onChange:function(e){return t.changeControlKey("page","approach",e)}})),("include"===D(r,"page","approach")||"exclude"===D(r,"page","approach"))&&React.createElement(x,{multiple:!0,label:b("Select pages","advanced-gutenberg"),placeholder:b("Search","advanced-gutenberg"),suggestions:(0,s.getOptionSuggestions)(this.getPages()),maxSuggestions:10,value:(0,s.getOptionTitles)(D(r,"page","pages")?D(r,"page","pages"):[],this.getPages()),onChange:function(e){t.changeControlKey("page","pages",(0,s.getOptionSlugs)(e,t.getPages()))},__experimentalExpandOnFocus:!0})))))),React.createElement(e,o({key:"block-edit-advgb-dates"},this.props))]}}]),n}(R)}),"withEditControls")),h("editor.BlockListBlock","advgb/loadBackendBlockControls",E((function(e){return function(t){if(!S.includes(t.name)&&p(t.name,"advgb/blockControls",!0)&&P()){var n=t.attributes.advgbBlockControls,a=!1===t.isSelected&&B(n)?"advgb-bc-editor-preview":"";return React.createElement(e,o({},t,{className:(0,c.default)(t.className,a),advgbBlockControls:""+n}))}return React.createElement(e,t)}}),"withAttributes"))}}(wp.i18n,wp.hooks,wp.blocks,wp.blockEditor,wp.components,wp.compose,wp.element)},function(e,t,n){var a; -/*! +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./node_modules/classnames/index.js": +/*!******************************************!*\ + !*** ./node_modules/classnames/index.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t11?"pm":"am",onInit:!1})}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,a=(n.onChangeTime,n.currentTime,this.state),r=a.hours,o=a.minutes,l=a.meridian,i=t.hours,s=t.minutes,u=t.meridian;if(r!==i||o!==s||l!==u){if(!r&&!o)return;r&&!o&&this.setState({minutes:"00"}),o&&!r&&this.setState({hours:"01"});var d=this.appendZero(c.default.to24Hour({hour:parseInt(r),meridiem:l}))+":"+o+":00";this.props.onChangeTime(d)}}},{key:"appendZero",value:function(e){if(!isNaN(e)){var t=parseInt(e);return t>9?t:"0"+t}}},{key:"render",value:function(){var e=this,t=this.state,n=(t.onChangeTime,t.currentTime,t.hours),a=t.minutes,r=t.meridian;return React.createElement(C,null,React.createElement("div",{className:"advgb-advtime-control"},React.createElement("label",null,this.props.label),React.createElement("div",{className:"advgb-advtime-hours-minutes"},React.createElement("input",{type:"text",value:n?this.appendZero(c.default.to12Hour(parseInt(n)).hour):"",onChange:function(t){var n=Math.max(1,Math.min(12,Number(t.target.value)));e.setState({hours:e.appendZero(n)})},onKeyDown:function(t){var n=Number(t.target.value);"ArrowUp"===t.key&&n<12?e.setState({hours:e.appendZero(n+1)}):"ArrowDown"===t.key&&n>1&&e.setState({hours:e.appendZero(n-1)})},placeholder:"--"}),React.createElement("span",null,":"),React.createElement("input",{type:"text",value:a||"",onChange:function(t){var n=Math.max(0,Math.min(59,Number(t.target.value)));e.setState({minutes:e.appendZero(n)})},onKeyDown:function(t){var n=Number(t.target.value);"ArrowUp"===t.key&&n<59?e.setState({minutes:e.appendZero(n+1)}):"ArrowDown"===t.key&&n>0&&e.setState({minutes:e.appendZero(n-1)})},placeholder:"--"})),React.createElement(u,{className:"advgb-advtime-meridian"},React.createElement(d,{variant:null===r||"am"===r?"primary":"secondary",onClick:function(){e.setState({meridian:"am"})},disabled:!n||!a},x("AM","advanced-gutenberg")),React.createElement(d,{variant:"pm"===r?"primary":"secondary",onClick:function(){e.setState({meridian:"pm"})},disabled:!n||!a},x("PM","advanced-gutenberg"))),n&&a&&React.createElement(d,{className:"advgb-advtime-remove-icon",icon:"no-alt",onClick:function(){e.props.onTimeClear(),e.setState({hours:null,minutes:null,meridian:"am"})}})))}}]),t}(y);t.default=R},function(e,t,n){"use strict";e.exports={to12Hour:function(e){var t=e<12?"am":"pm";return{hour:(e+11)%12+1,meridiem:t,meridian:t}},to24Hour:function(e){return("am"===(e.meridiem||e.meridian)?0:12)+e.hour%12}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.getOptionSuggestions=function(e){return e.map((function(e){return e.title}))},t.getOptionTitles=function(e,t){var n=[];return null!==t&&(n=e.map((function(e){var n=t.find((function(t){return t.slug===e}));return void 0!==n&&n?n.title:e}))),n},t.getOptionSlugs=function(e,t){var n=[];return e.map((function(e){var a=t.find((function(t){return t.title===e}));void 0!==a&&n.push(a.slug)})),n}}]); +*/ +/* global define */ + +(function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + var nativeCodeString = '[native code]'; + + function classNames() { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg)) { + if (arg.length) { + var inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } + } else if (argType === 'object') { + if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { + classes.push(arg.toString()); + continue; + } + + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } + } + + return classes.join(' '); + } + + if ( true && module.exports) { + classNames.default = classNames; + module.exports = classNames; + } else if (true) { + // register as 'classnames', consistent with npm package name + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { + return classNames; + }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}()); + + +/***/ }), + +/***/ "./node_modules/hour-convert/index.js": +/*!********************************************!*\ + !*** ./node_modules/hour-convert/index.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + + /** + * Convert 24-hour time to 12-hour format. + * + * @param {number} hour Hour to convert (0-23) + * @return {object} { hour, meridiem } (meridian is also returned for backwards compatibility) + */ + to12Hour: function to12Hour(hour) { + var meridiem = hour < 12 ? 'am' : 'pm'; + return { + hour: ((hour + 11) % 12 + 1), + meridiem: meridiem, + meridian: meridiem + }; + }, + + /** + * Convert 12-hour time to 24-hour format. + * + * @param {object} time Time object + * @param {number} time.hour Hour to convert (1-12) + * @param {string} time.meridiem Hour meridiem (am/pm). 'time.meridian' is + * supported for backwards compatibility. + * @return {number} + */ + to24Hour: function to24Hour(time) { + var meridiem = time.meridiem || time.meridian; + return (meridiem === 'am' ? 0 : 12) + (time.hour % 12); + } +}; + + +/***/ }), + +/***/ "./src/assets/blocks/0-adv-components/datetime.jsx": +/*!*********************************************************!*\ + !*** ./src/assets/blocks/0-adv-components/datetime.jsx ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +exports.AdvDateTimeControl = AdvDateTimeControl; +exports.AdvDaysControl = AdvDaysControl; +exports.AdvTimeControl = AdvTimeControl; +exports.AdvTimezoneControl = AdvTimezoneControl; + +var _hourConvert = __webpack_require__(/*! hour-convert */ "./node_modules/hour-convert/index.js"); + +var _hourConvert2 = _interopRequireDefault(_hourConvert); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +var _wp$components = wp.components, + ButtonGroup = _wp$components.ButtonGroup, + Button = _wp$components.Button, + DateTimePicker = _wp$components.DateTimePicker, + TextControl = _wp$components.TextControl, + CheckboxControl = _wp$components.CheckboxControl, + Popover = _wp$components.Popover, + Tooltip = _wp$components.Tooltip, + SelectControl = _wp$components.SelectControl, + Icon = _wp$components.Icon; +var _wp$element = wp.element, + Component = _wp$element.Component, + Fragment = _wp$element.Fragment, + useState = _wp$element.useState; +var _wp$i18n = wp.i18n, + __ = _wp$i18n.__, + _x = _wp$i18n._x; +var applyFilters = wp.hooks.applyFilters; +function AdvDateTimeControl(props) { + var _useState = useState(false), + _useState2 = _slicedToArray(_useState, 2), + popupState = _useState2[0], + setPopupState = _useState2[1]; + + var togglePopup = function togglePopup() { + setPopupState(!popupState); + }; + + var buttonLabel = props.buttonLabel, + dateLabel = props.dateLabel, + date = props.date, + onChangeDate = props.onChangeDate, + onDateClear = props.onDateClear, + onInvalidDate = props.onInvalidDate; + + + return React.createElement( + Fragment, + null, + React.createElement( + "div", + { className: "advgb-advcalendar-control" }, + React.createElement( + "label", + null, + dateLabel + ), + React.createElement( + "div", + null, + React.createElement( + Button, + { + isLink: true, + icon: "calendar", + onClick: togglePopup + }, + React.createElement( + Tooltip, + { text: __('Change date', 'advanced-gutenberg') }, + React.createElement( + "span", + null, + date ? moment(date).format("MMMM DD YYYY, h:mm a") : buttonLabel + ) + ) + ), + date && React.createElement(Button, { + icon: "no-alt", + className: "advgb-advcalendar-remove-icon", + onClick: function onClick() { + return onDateClear(); + } + }) + ) + ), + popupState && React.createElement( + Popover, + { + className: "advgb-advcalendar-popover", + onClose: setPopupState.bind(null, false), + resize: false + }, + React.createElement( + "label", + { className: "advgb-advcalendar-popover-label" }, + dateLabel, + React.createElement(Button, { + icon: "no-alt", + className: "advgb-advcalendar-remove-icon", + onClick: togglePopup + }) + ), + React.createElement(DateTimePicker, { + currentDate: date, + onChange: onChangeDate, + is12Hour: true, + isInvalidDate: onInvalidDate + }) + ) + ); +} + +function AdvDaysControl(props) { + var allDays = [{ slug: 0, label: _x('S', 'Sunday first letter', 'advanced-gutenberg') }, // Sunday + { slug: 1, label: __('M', 'advanced-gutenberg') }, // Monday + { slug: 2, label: _x('T', 'Tuesday first letter', 'advanced-gutenberg') }, // Tuesday + { slug: 3, label: __('W', 'advanced-gutenberg') }, // Wednesday + { slug: 4, label: _x('T', 'Thursday first letter', 'advanced-gutenberg') }, // Thursday + { slug: 5, label: __('F', 'advanced-gutenberg') }, // Friday + { slug: 6, label: _x('S', 'Saturday first letter', 'advanced-gutenberg') // Saturday + }]; + + var label = props.label, + days = props.days, + onChangeDays = props.onChangeDays; + + // Use a single state variable to store the selected days + + var _useState3 = useState(days), + _useState4 = _slicedToArray(_useState3, 2), + selectedDays = _useState4[0], + setSelectedDays = _useState4[1]; + + /** + * Check if the day is selected or not + * + * @since 3.1.2 + * + * @param {string} Day slug e.g. 'u' for Sunday, 't' for Tuesday + * + * @return {bool} + */ + + + function isDaySelected(slug) { + return selectedDays.some(function (el) { + return el === slug; + }); + } + + /** + * Update the selected days state when a checkbox is changed + * + * @since 3.1.2 + * + * @param {string} Day slug e.g. 'u' for Sunday, 't' for Tuesday + * + * @return {void} + */ + function onChangeDay(slug) { + + // Check if the day is already selected + var isSelected = isDaySelected(slug); + + // Create a new array with the updated selection + var updatedDays = void 0; + if (isSelected) { + // Remove the day from the selected days + updatedDays = selectedDays.filter(function (el) { + return el !== slug; + }); + } else { + // Add the day to the selected days + var findDay = allDays.find(function (el) { + return el.slug === slug; + }); + updatedDays = [].concat(_toConsumableArray(selectedDays), [findDay.slug]); + } + + // Remove duplicates + var uniqueDays = [].concat(_toConsumableArray(new Set(updatedDays))); + + // Update the selected days state + setSelectedDays(uniqueDays); + + // Call the onChangeDays prop to notify the parent component of the change + if (onChangeDays) { + onChangeDays(updatedDays); + } + } + + return React.createElement( + Fragment, + null, + React.createElement( + "div", + { className: "advgb-checkbox-wrapper" }, + React.createElement( + "label", + null, + label + ), + React.createElement( + "div", + { className: "advgb-checkbox-inline" }, + allDays.map(function (day) { + return React.createElement(CheckboxControl, { + label: day.label, + checked: isDaySelected(day.slug), + onChange: function onChange() { + return onChangeDay(day.slug); + } + }); + }) + ) + ) + ); +} + +var AdvTimeClass = function (_Component) { + _inherits(AdvTimeClass, _Component); + + function AdvTimeClass(props) { + _classCallCheck(this, AdvTimeClass); + + var _this = _possibleConstructorReturn(this, (AdvTimeClass.__proto__ || Object.getPrototypeOf(AdvTimeClass)).call(this, props)); + + _this.state = { + onChangeTime: null, + currentTime: _this.props.currentTime || null, + hours: null, + minutes: null, + meridian: 'am', + onInit: true + }; + return _this; + } + + _createClass(AdvTimeClass, [{ + key: "componentWillMount", + value: function componentWillMount() { + var _state = this.state, + onChangeTime = _state.onChangeTime, + currentTime = _state.currentTime, + onInit = _state.onInit; + + + if (this.props.onChangeTime !== onChangeTime) { + this.setState({ + onChangeTime: this.props.onChangeTime + }); + } + + if (this.props.currentTime !== currentTime) { + this.setState({ + currentTime: this.props.currentTime + }); + } + + // Init + if (currentTime && currentTime.includes(':') && onInit) { + this.setState({ + hours: currentTime.split(':')[0], + minutes: currentTime.split(':')[1], + meridian: parseInt(currentTime.split(':')[0]) > 11 ? 'pm' : 'am', // We set > 11 because PM starts from 12:00:00 + onInit: false + }); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + var _props = this.props, + onChangeTime = _props.onChangeTime, + currentTime = _props.currentTime; + var _state2 = this.state, + hours = _state2.hours, + minutes = _state2.minutes, + meridian = _state2.meridian; + var prevHours = prevState.hours, + prevMinutes = prevState.minutes, + prevMeridian = prevState.meridian; + + + if (hours !== prevHours || minutes !== prevMinutes || meridian !== prevMeridian) { + + // When clearing time + if (!hours && !minutes) { + return; + } + + // Default minutes when hours selected + if (hours && !minutes) { + this.setState({ + minutes: '00' + }); + } + + // Default hours when minutes selected + if (minutes && !hours) { + this.setState({ + hours: '01' + }); + } + + /* Convert 12-hours to 24-hours. + * e.g. 12:00 AM becomes 00:00:00 + * 12:00 PM becomes 12:00:00 + * 01:00 PM becomes 13:00:00 + */ + var savedTime = this.appendZero(_hourConvert2.default.to24Hour({ + hour: parseInt(hours), + meridiem: meridian + })) + ":" + minutes + ":00"; + + // Value saved in source/attribute + this.props.onChangeTime(savedTime); + } + } + + /** + * Append zero to one digit numbers. e.g. 9 becomes '09' + * + * @since 3.1.2 + * + * @param {string value Hours or minutes + * + * @return {string} + */ + + }, { + key: "appendZero", + value: function appendZero(value) { + if (isNaN(value)) { + return; + } + + var res = parseInt(value); + + return res > 9 ? res : "0" + res; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _state3 = this.state, + onChangeTime = _state3.onChangeTime, + currentTime = _state3.currentTime, + hours = _state3.hours, + minutes = _state3.minutes, + meridian = _state3.meridian; + + // Make sure hours are valid. 01: min, 12: max + + var handleChangeHours = function handleChangeHours(event) { + var value = Math.max(1, Math.min(12, Number(event.target.value))); + _this2.setState({ + hours: _this2.appendZero(value) + }); + }; + + // Allow to use up/down keys for hours + var handleKeyDownHours = function handleKeyDownHours(event) { + var value = Number(event.target.value); + if (event.key === 'ArrowUp' && value < 12) { + _this2.setState({ + hours: _this2.appendZero(value + 1) + }); + } else if (event.key === 'ArrowDown' && value > 1) { + _this2.setState({ + hours: _this2.appendZero(value - 1) + }); + } + }; + + // Make sure minutes are valid. 01: min, 59: max + var handleChangeMinutes = function handleChangeMinutes(event) { + var value = Math.max(0, Math.min(59, Number(event.target.value))); + _this2.setState({ + minutes: _this2.appendZero(value) + }); + }; + + // Allow to use up/down keys for minutes + var handleKeyDownMinutes = function handleKeyDownMinutes(event) { + var value = Number(event.target.value); + if (event.key === 'ArrowUp' && value < 59) { + _this2.setState({ + minutes: _this2.appendZero(value + 1) + }); + } else if (event.key === 'ArrowDown' && value > 0) { + _this2.setState({ + minutes: _this2.appendZero(value - 1) + }); + } + }; + + return React.createElement( + Fragment, + null, + React.createElement( + "div", + { className: "advgb-advtime-control" }, + React.createElement( + "label", + null, + this.props.label + ), + React.createElement( + "div", + { className: "advgb-advtime-hours-minutes" }, + React.createElement("input", { + type: "text", + value: hours ? this.appendZero(_hourConvert2.default.to12Hour(parseInt(hours)).hour) : '', + onChange: handleChangeHours, + onKeyDown: handleKeyDownHours, + placeholder: "--" + }), + React.createElement( + "span", + null, + ":" + ), + React.createElement("input", { + type: "text", + value: minutes ? minutes : '', + onChange: handleChangeMinutes, + onKeyDown: handleKeyDownMinutes, + placeholder: "--" + }) + ), + React.createElement( + ButtonGroup, + { className: "advgb-advtime-meridian" }, + React.createElement( + Button, + { + variant: meridian === null || meridian === 'am' ? 'primary' : 'secondary', + onClick: function onClick() { + _this2.setState({ + meridian: 'am' + }); + }, + disabled: hours && minutes ? false : true + }, + __('AM', 'advanced-gutenberg') + ), + React.createElement( + Button, + { + variant: meridian === 'pm' ? 'primary' : 'secondary', + onClick: function onClick() { + _this2.setState({ + meridian: 'pm' + }); + }, + disabled: hours && minutes ? false : true + }, + __('PM', 'advanced-gutenberg') + ) + ), + hours && minutes && React.createElement(Button, { + className: "advgb-advtime-remove-icon", + icon: "no-alt", + onClick: function onClick() { + _this2.props.onTimeClear(); + _this2.setState({ + hours: null, + minutes: null, + meridian: 'am' + }); + } + }) + ) + ); + } + }]); + + return AdvTimeClass; +}(Component); + +exports.default = AdvTimeClass; +function AdvTimeControl(props) { + var label = props.label, + currentTime = props.currentTime, + onChangeTime = props.onChangeTime, + onTimeClear = props.onTimeClear; + + + return React.createElement(AdvTimeClass, { + label: label, + currentTime: currentTime, + onChangeTime: onChangeTime, + onTimeClear: onTimeClear + }); +} + +function AdvTimezoneControl(props) { + var label = props.label, + defaultTimezone = props.defaultTimezone; + + + return React.createElement( + Fragment, + null, + applyFilters('advgb.timezoneControl', React.createElement( + Fragment, + null, + React.createElement( + "div", + { style: { marginTop: 10, marginBottom: 30 } }, + React.createElement( + "div", + { style: { marginBottom: 6 } }, + label, + React.createElement( + "span", + { style: { float: 'right', marginRight: 5 } }, + React.createElement(Icon, { icon: "lock" }), + React.createElement( + "a", + { href: "https://publishpress.com/links/blocks", + "class": "advgb-pro-ad-btn", + target: "_blank" }, + __('Upgrade to Pro', 'advanced-gutenberg') + ) + ) + ), + React.createElement(SelectControl, { + value: defaultTimezone, + options: [{ + label: defaultTimezone, + value: defaultTimezone + }], + disabled: true + }) + ) + ), props) + ); +} + +/***/ }), + +/***/ "./src/assets/blocks/0-adv-components/utils.jsx": +/*!******************************************************!*\ + !*** ./src/assets/blocks/0-adv-components/utils.jsx ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Generate option title suggestions + * + * @since 3.1.1 + * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}] + * + * @return {array} Option slugs. e.g. ['subscriber','new_customer'] + */ +var getOptionSuggestions = exports.getOptionSuggestions = function getOptionSuggestions(options) { + return options.map(function (item) { + return item.title; + }); +}; + +/** + * Match option slugs with its option titles + * to display as field value (but NOT saved!). + * + * @since 3.1.1 + * @param slugs Option slugs. e.g. ['subscriber','new_customer'] or [82, 92] + * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}] + * + * @return {array} Option titles. e.g. ['Subscriber','New Customer'] + */ +var getOptionTitles = exports.getOptionTitles = function getOptionTitles(slugs, options) { + var field_value = []; + + if (options !== null) { + field_value = slugs.map(function (option_slug) { + var find_option = options.find(function (item) { + return item.slug === option_slug; + }); + if (find_option === undefined || !find_option) { + return option_slug; // It should return false but creates empty selections + } + return find_option.title; + }); + } + + return field_value; +}; + +/** + * Match option titles with its slugs, and save slugs + * + * @since 3.1.1 + * @param slugs Option slugs. e.g. ['subscriber','new_customer'] + * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}] + * + * @return {array} Option slugs. e.g. ['subscriber','new_customer'] + */ +var getOptionSlugs = exports.getOptionSlugs = function getOptionSlugs(slugs, options) { + var slugs_array = []; + + slugs.map(function (option_title) { + var matching_slug = options.find(function (item) { + return item.title === option_title; + }); + if (matching_slug !== undefined) { + slugs_array.push(matching_slug.slug); + } + }); + + return slugs_array; +}; + +/***/ }), + +/***/ "./src/assets/blocks/block-controls/block-controls.jsx": +/*!*************************************************************!*\ + !*** ./src/assets/blocks/block-controls/block-controls.jsx ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _classnames = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _datetime = __webpack_require__(/*! ../0-adv-components/datetime.jsx */ "./src/assets/blocks/0-adv-components/datetime.jsx"); + +var _utils = __webpack_require__(/*! ../0-adv-components/utils.jsx */ "./src/assets/blocks/0-adv-components/utils.jsx"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +(function (wpI18n, wpHooks, wpBlocks, wpBlockEditor, wpComponents, wpCompose, wpElement) { + wpBlockEditor = wp.blockEditor || wp.editor; + var addFilter = wpHooks.addFilter; + var sprintf = wpI18n.sprintf, + __ = wpI18n.__; + var hasBlockSupport = wpBlocks.hasBlockSupport; + var _wpBlockEditor = wpBlockEditor, + InspectorControls = _wpBlockEditor.InspectorControls, + BlockControls = _wpBlockEditor.BlockControls; + var DateTimePicker = wpComponents.DateTimePicker, + ToggleControl = wpComponents.ToggleControl, + PanelBody = wpComponents.PanelBody, + Notice = wpComponents.Notice, + FormTokenField = wpComponents.FormTokenField, + SelectControl = wpComponents.SelectControl; + var createHigherOrderComponent = wpCompose.createHigherOrderComponent; + var Component = wpElement.Component, + Fragment = wpElement.Fragment; + + // do not show this feature if disabled. + + if (!parseInt(advgbBlocks.block_controls)) return; + + // Blocks that are not supported + var NON_SUPPORTED_BLOCKS = ['core/freeform', 'core/legacy-widget', 'core/widget-area', 'core/column', 'advgb/tab', 'advgb/column']; + + var getGlobalControls = function getGlobalControls() { + return typeof advgb_block_controls_vars.controls !== 'undefined' && Object.keys(advgb_block_controls_vars.controls).length > 0 ? advgb_block_controls_vars.controls : []; + }; + + /** + * Check if a control is enabled + * + * @since 3.1.0 + * @param {string} control The use case block control. e.g. 'schedule' + * + * @return {bool} + */ + var isControlEnabled = function isControlEnabled(control) { + return typeof control !== 'undefined' && control; + }; + + /** + * Check if at least one control is enabled per block instance + * + * @since 3.1.1 + * @param {string} controlAttrs Controls attributes. e.g. advgbBlockControls or props.attributes @TODO Figure out a way to NOT require controlAttrs as param due is the same always + * + * @return {bool} + */ + var isAnyControlEnabledBlock = function isAnyControlEnabledBlock(controlAttrs) { + var globalControls = getGlobalControls(); + var counter = 0; + var blockControls = []; // Controls enabled in block instance + + // Get enabled global controls (in Settings) + Object.keys(globalControls).forEach(function (item) { + if (isControlEnabled(advgb_block_controls_vars.controls[item])) { + blockControls.push(item); + } + }); + + // Get counter for enabled controls in block instance + blockControls.forEach(function (item) { + if (currentControlKey(controlAttrs, item, 'enabled')) { + counter++; + } + }); + + return counter > 0 ? true : false; + }; + + /** + * Check if at least one control is enabled globally (in Settings) + * + * @since 3.1.0 + * + * @return {bool} + */ + var isAnyControlEnabledGlobal = function isAnyControlEnabledGlobal() { + var globalControls = getGlobalControls(); + var counter = 0; + + Object.keys(globalControls).map(function (item) { + if (isControlEnabled(advgb_block_controls_vars.controls[item])) { + counter++; + } + }); + + return counter > 0 ? true : false; + }; + + /** + * Return single controls array attribute value + * + * @since 3.1.0 + * @param {string} controlAttrs Controls attributes. e.g. advgbBlockControls or props.attributes @TODO Figure out a way to NOT require controlAttrs as param due is the same always + * @param {string} control The use case block control. e.g. 'schedule' + * @param {string} key The control key to check. e.g. 'enabled' + * + * @return {mixed} + */ + var currentControlKey = function currentControlKey(controlAttrs, control, key) { + + // Check if advgbBlockControls attribute exists + var controlsAdded = typeof controlAttrs !== 'undefined' && controlAttrs.length ? true : false; + // Check if control exists in advgbBlockControls array + var controlExists = controlsAdded && controlAttrs.some(function (element) { + return element.control === control; + }) ? true : false; + + if (controlExists) { + var itemIndex = controlAttrs.findIndex(function (element) { + return element.control === control; + }); + + // No control found (this check seems not necessary but is here to prevent an unlikely error) + if (itemIndex < 0) { + return false; + } + + var newArray = [].concat(_toConsumableArray(controlAttrs)); + var obj = newArray[itemIndex]; + + return obj[key]; + } + + return null; + }; + + // Add non supported blocks according to Block controls + if (typeof advgb_block_controls_vars !== 'undefined' && typeof advgb_block_controls_vars.non_supported !== 'undefined' && advgb_block_controls_vars.non_supported.length > 0) { + // Merge dynamically disabled blocks + NON_SUPPORTED_BLOCKS = [].concat(_toConsumableArray(NON_SUPPORTED_BLOCKS), _toConsumableArray(advgb_block_controls_vars.non_supported)); + // Remove duplicated values + NON_SUPPORTED_BLOCKS = [].concat(_toConsumableArray(new Set(NON_SUPPORTED_BLOCKS))); + } + + // Register block controls to blocks attributes + addFilter('blocks.registerBlockType', 'advgb/blockControls', function (settings) { + if (!NON_SUPPORTED_BLOCKS.includes(settings.name) && isAnyControlEnabledGlobal()) { + settings.attributes = _extends(settings.attributes, { + advgbBlockControls: { + type: 'array', + items: { + type: 'object' + }, + default: [] + } + }); + } + + return settings; + }); + + var withEditControls = createHigherOrderComponent(function (BlockEdit) { + + return function (_Component) { + _inherits(BlockControlsEdit, _Component); + + function BlockControlsEdit(props) { + var _ref; + + _classCallCheck(this, BlockControlsEdit); + + var _this = _possibleConstructorReturn(this, (_ref = BlockControlsEdit.__proto__ || Object.getPrototypeOf(BlockControlsEdit)).call.apply(_ref, [this].concat(_toConsumableArray(props)))); + + _this.state = { + taxModOptions: [], // Store modified taxonomy options to decide if selected tax is for "all terms" or "selected terms" + termOptions: [], // Store term options with slug (id) and title + searchTermWord: '', // Updated when searching terms + initArchive: true, // When true, trigger initArchiveControl() + updateTaxLabels: false // When true, update taxonomy option labels + }; + + _this.isPost = _this.isPost.bind(_this); + return _this; + } + + /** + * Get filtered term slugs based on selected taxonomies + * + * @since 3.1.1 + * @param {array} taxonomies Array of taxonomies slugs + * + * @return {array} + */ + + + _createClass(BlockControlsEdit, [{ + key: "getTermSlugs", + value: function getTermSlugs(taxonomies) { + var _this2 = this; + + var allTaxonomies = this.getTaxonomies(); + var terms = []; + + taxonomies.forEach(function (tax) { + var allTaxonomies = _this2.getTaxonomies(); + var itemIndex = allTaxonomies.findIndex(function (element) { + return element.slug === tax; + }); + + allTaxonomies[itemIndex].terms.forEach(function (term) { + terms.push(term.slug); + }); + }); + + return terms; + } + + /** + * Get taxonomies + * + * @since 3.1.1 + * + * @return {array} + */ + + }, { + key: "getTaxonomies", + value: function getTaxonomies() { + return typeof advgb_block_controls_vars.taxonomies !== 'undefined' && advgb_block_controls_vars.taxonomies.length > 0 ? advgb_block_controls_vars.taxonomies : []; + } + + /** + * Get all the available user roles from the site + * + * @since 3.1.0 + * + * @return {array} + */ + + }, { + key: "getUserRoles", + value: function getUserRoles() { + return typeof advgb_block_controls_vars.user_roles !== 'undefined' && advgb_block_controls_vars.user_roles.length > 0 ? advgb_block_controls_vars.user_roles : []; + } + + /** + * Get filtered terms based on selected taxonomies + * + * @since 3.1.1 + * @param {array} taxonomies Taxonomies slugs + * + * @return {array} + */ + + }, { + key: "getTerms", + value: function getTerms(taxonomies) { + var _this3 = this; + + var allTaxonomies = this.getTaxonomies(); + var terms = []; + + taxonomies.forEach(function (tax) { + var allTaxonomies = _this3.getTaxonomies(); + var itemIndex = allTaxonomies.findIndex(function (element) { + return element.slug === tax; + }); + + allTaxonomies[itemIndex].terms.forEach(function (term) { + terms.push({ + slug: term.slug, + title: term.title + " (" + allTaxonomies[itemIndex].title + ")" + }); + }); + }); + + return terms; + } + + /** + * Get pages + * + * @since 3.1.1 + * + * @return {array} + */ + + }, { + key: "getPages", + value: function getPages() { + return typeof advgb_block_controls_vars.page !== 'undefined' && advgb_block_controls_vars.page.length > 0 ? advgb_block_controls_vars.page : []; + } + + /** + * Update advgbBlockControls attribute when a key value changes + * + * @since 2.14.0 + * @param {string} control The use case block control. e.g. 'schedule' + * @param {string} key The control key to modify. e.g. 'enabled' + * @param {string} value The control key value (not required for boolean keys) + * + * @return {void} + */ + + }, { + key: "changeControlKey", + value: function changeControlKey(control, key) { + var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + var _props = this.props, + attributes = _props.attributes, + setAttributes = _props.setAttributes; + var advgbBlockControls = attributes.advgbBlockControls; + + // Control objects to add when enabled for the first time + + var scheduleControl = { + control: 'schedule', + enabled: true, + dateFrom: null, + dateTo: null, + recurring: false + }; + var userRoleControl = { + control: 'user_role', + enabled: true, + roles: [], + approach: 'public' + }; + var archiveControl = { + control: 'archive', + enabled: true, + taxonomies: [], + approach: 'exclude' + }; + var pageControl = { + control: 'page', + enabled: true, + pages: [], + approach: 'exclude' + }; + + // Check if advgbBlockControls attribute exists + var controlsAdded = typeof advgbBlockControls !== 'undefined' && advgbBlockControls.length ? true : false; + // Check if control exists in advgbBlockControls array + var controlExists = controlsAdded && advgbBlockControls.some(function (element) { + return element.control === control; + }) ? true : false; + + if (controlExists) { + var itemIndex = advgbBlockControls.findIndex(function (element) { + return element.control === control; + }); + + // No control found (this check seems not necessary but is here to prevent an unlikely error) + if (itemIndex < 0) { + return false; + } + + var newArray = [].concat(_toConsumableArray(advgbBlockControls)); + var obj = newArray[itemIndex]; + + newArray[itemIndex] = typeof obj[key] === 'boolean' ? _extends({}, newArray[itemIndex], _defineProperty({}, key, !obj[key])) : _extends({}, newArray[itemIndex], _defineProperty({}, key, value)); + + setAttributes({ + advgbBlockControls: newArray + }); + } else if (controlsAdded && !controlExists) { + + // Add a new control object when other controls already exists + switch (control) { + case 'schedule': + setAttributes({ + advgbBlockControls: [].concat(_toConsumableArray(advgbBlockControls), [scheduleControl]) + }); + break; + + case 'user_role': + setAttributes({ + advgbBlockControls: [].concat(_toConsumableArray(advgbBlockControls), [userRoleControl]) + }); + break; + + case 'archive': + setAttributes({ + advgbBlockControls: [].concat(_toConsumableArray(advgbBlockControls), [archiveControl]) + }); + break; + + case 'page': + setAttributes({ + advgbBlockControls: [].concat(_toConsumableArray(advgbBlockControls), [pageControl]) + }); + break; + } + } else { + // Add the first control object attribute + switch (control) { + case 'schedule': + setAttributes({ + advgbBlockControls: [scheduleControl] + }); + break; + + case 'user_role': + setAttributes({ + advgbBlockControls: [userRoleControl] + }); + break; + + case 'archive': + setAttributes({ + advgbBlockControls: [archiveControl] + }); + break; + + case 'page': + setAttributes({ + advgbBlockControls: [pageControl] + }); + break; + } + } + } + + /** + * Update archive control in advgbBlockControls attribute when taxonomies value changes + * + * @since 3.1.2 + * + * @param {string} topic 'taxonomies' or 'terms' + * @param {string} slugs The taxonomy slugs or term ids to insert/modify. e.g. ['category','post_tag'] or [82,161,99] or ['all_'] + * + * @return {void} + */ + + }, { + key: "changeArchiveControl", + value: function changeArchiveControl(topic, slugs) { + var _this4 = this; + + var _props2 = this.props, + attributes = _props2.attributes, + setAttributes = _props2.setAttributes; + var advgbBlockControls = attributes.advgbBlockControls; + + + var taxArray = []; + var controlIndex = advgbBlockControls.findIndex(function (element) { + return element.control === 'archive'; + }); + + // No control found (this check seems not necessary but is here to prevent an unlikely error) + if (controlIndex < 0) { + return false; + } + + var newArray = [].concat(_toConsumableArray(advgbBlockControls)); + + if (topic === 'taxonomies') { + + // Check each taxonomy and its terms + slugs.forEach(function (item) { + + // Get terms from current taxonomy (item) + var taxIndex = newArray[controlIndex].taxonomies.findIndex(function (element) { + return element.tax === item; + }); + + if (taxIndex === -1) { + + // The last selected taxonomy + taxArray.push({ + tax: item, + terms: [], + all: true + }); + } else { + + // Existing taxonomy + var terms = newArray[controlIndex].taxonomies[taxIndex].terms.length ? newArray[controlIndex].taxonomies[taxIndex].terms : []; + var approach = terms.length ? 'select' : 'all'; + + taxArray.push({ + tax: item, + terms: terms, + all: terms.length ? false : true + }); + } + }); + + newArray[controlIndex] = _extends({}, newArray[controlIndex], _defineProperty({}, 'taxonomies', taxArray)); + + setAttributes({ + advgbBlockControls: newArray + }); + } else if (topic === 'terms') { + + var terms = {}; + var taxonomies = this.currentArchiveControl('taxonomies'); + + // Check each term id (item). slug means the id + slugs.forEach(function (item) { + + // Find the current term in termOptions state to use its tax later + var option = _this4.state.termOptions.find(function (el) { + return el.slug === item; + }); + + if (terms[option.tax] === undefined) { + terms[option.tax] = []; + } + + // Get taxonomy from current term (item) + var taxIndex = newArray[controlIndex].taxonomies.findIndex(function (element) { + return element.tax === option.tax; + }); + + /* Taxonomy for this term is selected? Is a bit reduntant but let's make sure + * Then include the term. + */ + if (taxonomies.includes(option.tax)) { + terms[option.tax].push(item); + } + }); + + // Update taxonomies with at least one term selected + Object.keys(terms).forEach(function (tax) { + + // Get taxonomy from current tax + var taxIndex = newArray[controlIndex].taxonomies.findIndex(function (element) { + return element.tax === tax; + }); + + if (taxIndex >= 0) { + newArray[controlIndex].taxonomies[taxIndex] = { + tax: tax, + terms: terms[tax], + all: terms[tax].length ? false : true + }; + } + }); + + // Include taxonomies with no terms selected (empty terms[option.tax] array) + taxonomies.forEach(function (tax) { + if (!Object.keys(terms).includes(tax)) { + + // Get taxonomy from current tax + var taxIndex = newArray[controlIndex].taxonomies.findIndex(function (element) { + return element.tax === tax; + }); + + if (taxIndex >= 0) { + newArray[controlIndex].taxonomies[taxIndex] = { + tax: tax, + terms: [], + all: true + }; + } + } + }); + + setAttributes({ + advgbBlockControls: newArray + }); + } else { + // Nothing to do here + } + } + + /** + * Return merged taxonomies or terms + * + * @since 3.1.2 + * + * @param {string} topic 'taxonomies' or 'terms' + * + * @return {array} An single array with all the selected terms or taxonomies ['category','post_tag'] or [99,182,42] + */ + + }, { + key: "currentArchiveControl", + value: function currentArchiveControl(topic) { + var _props3 = this.props, + attributes = _props3.attributes, + setAttributes = _props3.setAttributes; + var advgbBlockControls = attributes.advgbBlockControls; + + + var result = []; + + /* Get all the taxonomy objects. + * e.g. + * [ + * { "tax": "post_tag", "terms": [220,221]}, + * { "tax": "category", "terms": []} + * ] + */ + var taxonomies = currentControlKey(advgbBlockControls, 'archive', 'taxonomies').length ? currentControlKey(advgbBlockControls, 'archive', 'taxonomies') : []; + + if (topic === 'taxonomies') { + + taxonomies.forEach(function (item) { + result.push(item.tax); + }); + } else if (topic === 'terms') { + + taxonomies.forEach(function (item) { + item.terms.forEach(function (el) { + result.push(el); // term id + }); + }); + } else { + // Nothing to do here + } + + return result; + } + + /** + * Execute when taxonomy selection changes + * + * @since 3.1.1 + * + * @return {void} + */ + + }, { + key: "taxonomiesChanged", + value: function taxonomiesChanged() { + var _this5 = this; + + var attributes = this.props.attributes; + var advgbBlockControls = attributes.advgbBlockControls; + + + var currentTerms = !!currentControlKey(advgbBlockControls, 'archive', 'terms') ? currentControlKey(advgbBlockControls, 'archive', 'terms') : []; + var taxonomies = !!currentControlKey(advgbBlockControls, 'archive', 'taxonomies') ? currentControlKey(advgbBlockControls, 'archive', 'taxonomies') : []; + + if (currentTerms.length) { + + var result = []; + currentTerms.forEach(function (slug) { + var itemIndex = _this5.state.termOptions.findIndex(function (item) { + return item.slug === slug; + }); + + /* Get only the terms that belongs to selected taxonomies + * and skip the ones that belongs to the deleted taxonomy + */ + if (taxonomies.includes(_this5.state.termOptions[itemIndex].tax)) { + result.push(_this5.state.termOptions[itemIndex].slug); + } + }); + + this.changeControlKey('archive', 'terms', result); + } + + /* Remove term options from non-selected taxonomies. + * Case scenario: the terms from the last removed taxonomy. + */ + this.setState({ + termOptions: this.state.termOptions.filter(function (item) { + return _this5.currentArchiveControl('taxonomies').includes(item.tax); + }) + }); + + // Update tax label options to "All terms" or "Selected terms" + this.modifyTaxLabels(); + } + + /** + * Get selected terms on first load + * + * @since 3.1.1 + * + * @return {void} + */ + + }, { + key: "initArchiveControl", + value: function initArchiveControl() { + var _this6 = this; + + var advgbBlockControls = this.props.attributes.advgbBlockControls; + + + wp.apiFetch({ + path: wp.url.addQueryArgs('advgb/v1/terms', { + taxonomies: this.currentArchiveControl('taxonomies'), + ids: this.currentArchiveControl('terms') + }) + }).then(function (list) { + + // Update tax label options to "All terms" or "Selected terms" + _this6.modifyTaxLabels(); + + _this6.setState({ + termOptions: list, + initArchive: false, + updateTaxLabels: false + }); + }); + } + + /** + * Initial taxonomy labels to allow "All terms" "Selected terms" visual indicator + * + * @since 3.1.2 + * + * @return {array} + */ + + }, { + key: "iniTaxLabels", + value: function iniTaxLabels() { + + var result = []; + this.getTaxonomies().forEach(function (item) { + /* Item example + * { + * "slug": "category", + * "title": "All Category terms", + * "singular": "Category" + * } + */ + result.push({ + slug: item.slug, + title: sprintf(__('All %s terms', 'advanced-gutenberg'), item.title), + singular: item.title + + }); + }); + + return result; + } + + /** + * Modify taxonomy labels. Very similar to iniTaxLabels() + * + * @since 3.1.2 + * + * @return {array} + */ + + }, { + key: "modifyTaxLabels", + value: function modifyTaxLabels() { + var advgbBlockControls = this.props.attributes.advgbBlockControls; + + /* Get all selected taxonomy objects. + * e.g. + * [ + * { "tax": "post_tag", "terms": [220,221]}, + * { "tax": "category", "terms": []} + * ] + */ + + var taxonomies = currentControlKey(advgbBlockControls, 'archive', 'taxonomies').length ? currentControlKey(advgbBlockControls, 'archive', 'taxonomies') : []; + + // Copy whole state + var options = [].concat(_toConsumableArray(this.state.taxModOptions)); + + options.forEach(function (item, index) { + var tax = taxonomies.find(function (el) { + return item.slug === el.tax; + }); + + // Copy option to modify + var option = _extends({}, options[index]); + // Update title value + option.title = sprintf(tax === undefined || !tax.terms.length ? __('All %s terms', 'advanced-gutenberg') : __('Selected %s terms', 'advanced-gutenberg'), option.singular); + // Add option back to the state + options[index] = option; + }); + + // Save + this.setState({ + taxModOptions: options, + updateTaxLabels: false + }); + } + + /** + * Search terms based on search + * + * @since 3.1.1 + * + * @return {void} + */ + + }, { + key: "searchTerms", + value: function searchTerms() { + var _this7 = this; + + var _state = this.state, + termOptions = _state.termOptions, + searchTermWord = _state.searchTermWord; + var advgbBlockControls = this.props.attributes.advgbBlockControls; + + + wp.apiFetch({ + /*/ To get taxonomies + path: wp.url.addQueryArgs( 'wp/v2/taxonomies', { context: 'edit' } )*/ + + path: wp.url.addQueryArgs('advgb/v1/terms', { + search: searchTermWord, + taxonomies: this.currentArchiveControl('taxonomies') + }) + + }).then(function (list) { + + /*/ To get taxonomies + Object.keys(list).forEach( (item) => { + options.push( { + label: list[item].name, + value: list[item].slug + } ); + });*/ + + // Merge selected terms with results from fetch + var options = [].concat(_toConsumableArray(termOptions), _toConsumableArray(list)); + + // Remove duplicated values + options = Array.from(new Set(options.map(function (a) { + return a.slug; + }))).map(function (slug) { + return options.find(function (a) { + return a.slug === slug; + }); + }); + + _this7.setState({ + termOptions: options + }); + }); + } + + /** + * Check if we're in post edit screen + * + * @since 3.1.2 + * + * @return {bool} + */ + + }, { + key: "isPost", + value: function isPost() { + return wp.data.select('core/editor') && wp.data.select('core/editor').getCurrentPostId(); + } + + /** + * Get the timezone label from site settings stored in advgbBlocks object + * + * @since 3.1.4 + * + * @return {bool} + */ + + }, { + key: "getTimezoneLabel", + value: function getTimezoneLabel() { + return typeof advgbBlocks.timezone !== 'undefined' && advgbBlocks.timezone.length ? advgbBlocks.timezone.replace(/_/g, ' ') : __('WordPress settings timezone', 'advanced-gutenberg'); + } + + /** + * Get the timezone slug from site settings stored in advgbBlocks object + * + * @since 3.1.4 + * + * @return {bool} + */ + + }, { + key: "getTimezoneSlug", + value: function getTimezoneSlug() { + return typeof advgbBlocks.timezone !== 'undefined' && advgbBlocks.timezone.length ? advgbBlocks.timezone : 'UTC'; + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + this.setState({ + taxModOptions: this.iniTaxLabels() + }); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + var _props4 = this.props, + attributes = _props4.attributes, + isSelected = _props4.isSelected, + name = _props4.name; + var advgbBlockControls = attributes.advgbBlockControls; + var prevBlockControls = prevProps.attributes.advgbBlockControls; + var _state2 = this.state, + searchTermWord = _state2.searchTermWord, + initArchive = _state2.initArchive; + var prevTermWord = prevState.searchTermWord; + + // Get human readable selected terms on block selection the first time + + if (!this.isPost() && !NON_SUPPORTED_BLOCKS.includes(name) && isSelected && initArchive && isControlEnabled(advgb_block_controls_vars.controls.archive) && currentControlKey(advgbBlockControls, 'archive', 'enabled') && this.currentArchiveControl('taxonomies').length && this.currentArchiveControl('terms').length) { + this.initArchiveControl(); + } + + // Search terms + if (searchTermWord !== prevTermWord && searchTermWord.length > 2) { + this.searchTerms(); + } + + // Update available terms and remove terms which taxonomy has been removed + if (!this.isPost() && isControlEnabled(advgb_block_controls_vars.controls.archive) && currentControlKey(advgbBlockControls, 'archive', 'enabled') && (currentControlKey(prevBlockControls, 'archive', 'taxonomies') !== currentControlKey(advgbBlockControls, 'archive', 'taxonomies') // This trigger works when taxo changes, but not terms + || this.state.updateTaxLabels // Trigger when terms changes + )) { + this.taxonomiesChanged(); + } + } + }, { + key: "render", + value: function render() { + var _this8 = this; + + var _props5 = this.props, + attributes = _props5.attributes, + setAttributes = _props5.setAttributes; + var advgbBlockControls = attributes.advgbBlockControls; + + + return [this.props.isSelected && !NON_SUPPORTED_BLOCKS.includes(this.props.name) && isAnyControlEnabledGlobal() && React.createElement( + InspectorControls, + { key: "advgb-bc-controls" }, + React.createElement( + PanelBody, + { + title: __('Block Controls', 'advanced-gutenberg'), + icon: "visibility", + initialOpen: false, + className: isAnyControlEnabledBlock(advgbBlockControls) ? 'advgb-feature-icon-active' : '' + }, + isControlEnabled(advgb_block_controls_vars.controls.schedule) && React.createElement( + Fragment, + null, + React.createElement(ToggleControl, { + label: __('Schedule', 'advanced-gutenberg'), + help: currentControlKey(advgbBlockControls, 'schedule', 'enabled') ? __('Choose when to start showing and/or stop showing this block.', 'advanced-gutenberg') : '', + checked: currentControlKey(advgbBlockControls, 'schedule', 'enabled'), + onChange: function onChange() { + return _this8.changeControlKey('schedule', 'enabled'); + } + }), + currentControlKey(advgbBlockControls, 'schedule', 'enabled') && React.createElement( + Fragment, + null, + React.createElement( + "div", + { style: { marginBottom: 30 } }, + React.createElement(_datetime.AdvDateTimeControl, { + buttonLabel: __('Now', 'advanced-gutenberg'), + dateLabel: __('Start showing', 'advanced-gutenberg'), + date: currentControlKey(advgbBlockControls, 'schedule', 'dateFrom'), + onChangeDate: function onChangeDate(newDate) { + return _this8.changeControlKey('schedule', 'dateFrom', newDate); + }, + onDateClear: function onDateClear() { + return _this8.changeControlKey('schedule', 'dateFrom', null); + }, + onInvalidDate: false + }), + React.createElement(_datetime.AdvDateTimeControl, { + buttonLabel: __('Never', 'advanced-gutenberg'), + dateLabel: __('Stop showing', 'advanced-gutenberg'), + date: !!currentControlKey(advgbBlockControls, 'schedule', 'dateTo') ? currentControlKey(advgbBlockControls, 'schedule', 'dateTo') : null, + onChangeDate: function onChangeDate(newDate) { + return _this8.changeControlKey('schedule', 'dateTo', newDate); + }, + onDateClear: function onDateClear() { + return _this8.changeControlKey('schedule', 'dateTo', null); + }, + onInvalidDate: function onInvalidDate(date) { + // Disable all dates before dateFrom + if (currentControlKey(advgbBlockControls, 'schedule', 'dateFrom')) { + var thisDate = new Date(date.getTime()); + thisDate.setHours(0, 0, 0, 0); + var fromDate = new Date(currentControlKey(advgbBlockControls, 'schedule', 'dateFrom')); + fromDate.setHours(0, 0, 0, 0); + return thisDate.getTime() < fromDate.getTime(); + } + } + }), + currentControlKey(advgbBlockControls, 'schedule', 'dateFrom') > currentControlKey(advgbBlockControls, 'schedule', 'dateTo') && React.createElement( + Notice, + { + className: "advgb-notice-sidebar", + status: "warning", + isDismissible: false + }, + __('"Stop showing" date should be after "Start showing" date!', 'advanced-gutenberg') + ), + currentControlKey(advgbBlockControls, 'schedule', 'dateFrom') && currentControlKey(advgbBlockControls, 'schedule', 'dateTo') && React.createElement(ToggleControl, { + label: __('Recurring', 'advanced-gutenberg'), + checked: currentControlKey(advgbBlockControls, 'schedule', 'recurring'), + onChange: function onChange() { + return _this8.changeControlKey('schedule', 'recurring'); + }, + help: __('If Recurring is enabled, this block will be displayed every year between the selected dates.', 'advanced-gutenberg') + }), + React.createElement(_datetime.AdvDaysControl, { + label: __('On these days (optional)', 'advanced-gutenberg'), + days: !!currentControlKey(advgbBlockControls, 'schedule', 'days') ? currentControlKey(advgbBlockControls, 'schedule', 'days') : [], + onChangeDays: function onChangeDays(value) { + return _this8.changeControlKey('schedule', 'days', value); + } + }), + React.createElement( + "label", + { style: { marginBottom: 8, display: 'block' } }, + __('Between these times (optional)', 'advanced-gutenberg') + ), + React.createElement(_datetime.AdvTimeControl, { + label: __('From', 'advanced-gutenberg'), + currentTime: !!currentControlKey(advgbBlockControls, 'schedule', 'timeFrom') ? currentControlKey(advgbBlockControls, 'schedule', 'timeFrom') : null, + onChangeTime: function onChangeTime(newTime) { + return _this8.changeControlKey('schedule', 'timeFrom', newTime); + }, + onTimeClear: function onTimeClear() { + return _this8.changeControlKey('schedule', 'timeFrom', null); + } + }), + React.createElement(_datetime.AdvTimeControl, { + label: __('To', 'advanced-gutenberg'), + currentTime: currentControlKey(advgbBlockControls, 'schedule', 'timeTo') || null, + onChangeTime: function onChangeTime(newTime) { + return _this8.changeControlKey('schedule', 'timeTo', newTime); + }, + onTimeClear: function onTimeClear() { + return _this8.changeControlKey('schedule', 'timeTo', null); + } + }), + currentControlKey(advgbBlockControls, 'schedule', 'timeFrom') && currentControlKey(advgbBlockControls, 'schedule', 'timeTo') && '01/01/2020T' + currentControlKey( // We append a dummy date to make a datetime comparison + advgbBlockControls, 'schedule', 'timeFrom') >= '01/01/2020T' + currentControlKey( // We append a dummy date to make a datetime comparison + advgbBlockControls, 'schedule', 'timeTo') && React.createElement( + Notice, + { + className: "advgb-notice-sidebar", + status: "warning", + isDismissible: false + }, + __('"To" time should be after "From" time!', 'advanced-gutenberg') + ), + (currentControlKey(advgbBlockControls, 'schedule', 'timeFrom') && !currentControlKey(advgbBlockControls, 'schedule', 'timeTo') || !currentControlKey(advgbBlockControls, 'schedule', 'timeFrom') && currentControlKey(advgbBlockControls, 'schedule', 'timeTo')) && React.createElement( + Notice, + { + className: "advgb-notice-sidebar", + status: "warning", + isDismissible: false + }, + __('Please choose "From" time and "To" time.', 'advanced-gutenberg') + ), + React.createElement(_datetime.AdvTimezoneControl, { + label: __('Timezone', 'advanced-gutenberg'), + defaultTimezone: this.getTimezoneLabel(), + value: currentControlKey(advgbBlockControls, 'schedule', 'timezone') ? currentControlKey(advgbBlockControls, 'schedule', 'timezone') : this.getTimezoneSlug(), + onChangeTimezone: function onChangeTimezone(value) { + return _this8.changeControlKey('schedule', 'timezone', value); + } + }) + ) + ) + ), + isControlEnabled(advgb_block_controls_vars.controls.user_role) && React.createElement( + Fragment, + null, + React.createElement(ToggleControl, { + label: __('User roles', 'advanced-gutenberg'), + help: currentControlKey(advgbBlockControls, 'user_role', 'enabled') ? __('Choose which users can see this block.', 'advanced-gutenberg') : '', + checked: currentControlKey(advgbBlockControls, 'user_role', 'enabled'), + onChange: function onChange() { + return _this8.changeControlKey('user_role', 'enabled'); + } + }), + currentControlKey(advgbBlockControls, 'user_role', 'enabled') && React.createElement( + Fragment, + null, + React.createElement( + "div", + { className: "advgb-revert-mb" }, + React.createElement(SelectControl, { + value: currentControlKey(advgbBlockControls, 'user_role', 'approach'), + options: [{ + value: 'public', + label: __('Show to everyone', 'advanced-gutenberg') + }, { + value: 'hidden', + label: __('Hide from everyone', 'advanced-gutenberg') + }, { + value: 'login', + label: __('Show to logged in users', 'advanced-gutenberg') + }, { + value: 'logout', + label: __('Show to logged out users', 'advanced-gutenberg') + }, { + value: 'include', + label: __('Show to the selected user roles', 'advanced-gutenberg') + }, { + value: 'exclude', + label: __('Hide from the selected user roles', 'advanced-gutenberg') + }], + onChange: function onChange(value) { + return _this8.changeControlKey('user_role', 'approach', value); + } + }) + ), + (currentControlKey(advgbBlockControls, 'user_role', 'approach') === 'include' || currentControlKey(advgbBlockControls, 'user_role', 'approach') === 'exclude') && React.createElement( + Fragment, + null, + React.createElement(FormTokenField, { + multiple: true, + label: __('Select user roles', 'advanced-gutenberg'), + placeholder: __('Search', 'advanced-gutenberg'), + suggestions: (0, _utils.getOptionSuggestions)(this.getUserRoles()), + maxSuggestions: 10, + value: (0, _utils.getOptionTitles)(!!currentControlKey(advgbBlockControls, 'user_role', 'roles') ? currentControlKey(advgbBlockControls, 'user_role', 'roles') : [], this.getUserRoles()), + onChange: function onChange(value) { + _this8.changeControlKey('user_role', 'roles', (0, _utils.getOptionSlugs)(value, _this8.getUserRoles())); + }, + __experimentalExpandOnFocus: true + }), + (currentControlKey(advgbBlockControls, 'user_role', 'approach') === 'include' || currentControlKey(advgbBlockControls, 'user_role', 'approach') === 'exclude') && !currentControlKey(advgbBlockControls, 'user_role', 'roles').length && React.createElement( + Notice, + { + className: "advgb-notice-sidebar", + status: "warning", + isDismissible: false, + style: { marginBottom: 30 } + }, + __('Please select at least one user role.', 'advanced-gutenberg') + ) + ) + ) + ), + !this.isPost() && // Disabled in post edit + React.createElement( + Fragment, + null, + isControlEnabled(advgb_block_controls_vars.controls.archive) && React.createElement( + Fragment, + null, + React.createElement(ToggleControl, { + label: __('Term archives', 'advanced-gutenberg'), + help: currentControlKey(advgbBlockControls, 'archive', 'enabled') ? __('Choose on which taxonomies and terms archive pages your blocks can be displayed.', 'advanced-gutenberg') : '', + checked: currentControlKey(advgbBlockControls, 'archive', 'enabled'), + onChange: function onChange() { + return _this8.changeControlKey('archive', 'enabled'); + } + }), + currentControlKey(advgbBlockControls, 'archive', 'enabled') && React.createElement( + Fragment, + null, + React.createElement( + "div", + { className: "advgb-revert-mb--disabled", style: { marginBottom: 20 } }, + React.createElement(SelectControl, { + value: currentControlKey(advgbBlockControls, 'archive', 'approach'), + options: [{ + value: 'include', + label: __('Show for selected terms', 'advanced-gutenberg') + }, { + value: 'exclude', + label: __('Hide for selected terms', 'advanced-gutenberg') + }], + onChange: function onChange(value) { + return _this8.changeControlKey('archive', 'approach', value); + } + }) + ), + React.createElement(FormTokenField, { + multiple: true, + label: __('Select taxonomies', 'advanced-gutenberg'), + placeholder: __('Search taxonomies', 'advanced-gutenberg'), + suggestions: (0, _utils.getOptionSuggestions)(this.state.taxModOptions || this.getTaxonomies()), + maxSuggestions: 10, + value: (0, _utils.getOptionTitles)(this.currentArchiveControl('taxonomies'), this.state.taxModOptions || this.getTaxonomies()), + onChange: function onChange(value) { + _this8.changeArchiveControl('taxonomies', (0, _utils.getOptionSlugs)(value, _this8.state.taxModOptions || _this8.getTaxonomies())); + }, + __experimentalExpandOnFocus: true + }), + currentControlKey(advgbBlockControls, 'archive', 'taxonomies').length > 0 && React.createElement( + Fragment, + null, + React.createElement(FormTokenField, { + multiple: true, + label: __('Filter terms', 'advanced-gutenberg'), + placeholder: __('Search terms', 'advanced-gutenberg'), + suggestions: (0, _utils.getOptionSuggestions)(this.state.termOptions), + maxSuggestions: 10, + value: (0, _utils.getOptionTitles)(this.currentArchiveControl('terms'), this.state.termOptions), + onChange: function onChange(value) { + _this8.changeArchiveControl('terms', (0, _utils.getOptionSlugs)(value, _this8.state.termOptions)); + _this8.setState({ + updateTaxLabels: true + }); + }, + onInputChange: function onInputChange(value) { + _this8.setState({ + searchTermWord: value + }); + }, + __experimentalShowHowTo: false + }), + React.createElement( + "div", + { className: "advgb-revert-mb--disabled components-form-token-field__help", + style: { marginBottom: 20 } }, + __('Use this filter to apply only to some terms.', 'advanced-gutenberg') + ) + ) + ) + ), + isControlEnabled(advgb_block_controls_vars.controls.page) && React.createElement( + Fragment, + null, + React.createElement(ToggleControl, { + label: __('Pages', 'advanced-gutenberg'), + help: currentControlKey(advgbBlockControls, 'page', 'enabled') ? __('Choose in which pages this block can be displayed.', 'advanced-gutenberg') : '', + checked: currentControlKey(advgbBlockControls, 'page', 'enabled'), + onChange: function onChange() { + return _this8.changeControlKey('page', 'enabled'); + } + }), + currentControlKey(advgbBlockControls, 'page', 'enabled') && React.createElement( + Fragment, + null, + React.createElement( + "div", + { className: "advgb-revert-mb" }, + React.createElement(SelectControl, { + value: currentControlKey(advgbBlockControls, 'page', 'approach'), + options: [{ + value: 'include', + label: __('Show on the selected pages', 'advanced-gutenberg') + }, { + value: 'exclude', + label: __('Hide on the selected pages', 'advanced-gutenberg') + }], + onChange: function onChange(value) { + return _this8.changeControlKey('page', 'approach', value); + } + }) + ), + (currentControlKey(advgbBlockControls, 'page', 'approach') === 'include' || currentControlKey(advgbBlockControls, 'page', 'approach') === 'exclude') && React.createElement(FormTokenField, { + multiple: true, + label: __('Select pages', 'advanced-gutenberg'), + placeholder: __('Search', 'advanced-gutenberg'), + suggestions: (0, _utils.getOptionSuggestions)(this.getPages()), + maxSuggestions: 10, + value: (0, _utils.getOptionTitles)(!!currentControlKey(advgbBlockControls, 'page', 'pages') ? currentControlKey(advgbBlockControls, 'page', 'pages') : [], this.getPages()), + onChange: function onChange(value) { + _this8.changeControlKey('page', 'pages', (0, _utils.getOptionSlugs)(value, _this8.getPages())); + }, + __experimentalExpandOnFocus: true + }) + ) + ) + ) + ) + ), React.createElement(BlockEdit, _extends({ key: "block-edit-advgb-dates" }, this.props))]; + } + }]); + + return BlockControlsEdit; + }(Component); + }, 'withEditControls'); + + // Add option to add controls for supported blocks + addFilter('editor.BlockEdit', 'advgb/addBlockControls', withEditControls); + + var withAttributes = createHigherOrderComponent(function (BlockListBlock) { + return function (props) { + if (!NON_SUPPORTED_BLOCKS.includes(props.name) && hasBlockSupport(props.name, 'advgb/blockControls', true) && isAnyControlEnabledGlobal()) { + var advgbBlockControls = props.attributes.advgbBlockControls; + + var advgbBcClass = props.isSelected === false && isAnyControlEnabledBlock(advgbBlockControls) ? 'advgb-bc-editor-preview' : ''; + + return React.createElement(BlockListBlock, _extends({}, props, { className: (0, _classnames2.default)(props.className, advgbBcClass), advgbBlockControls: "" + advgbBlockControls })); + } + + return React.createElement(BlockListBlock, props); + }; + }, 'withAttributes'); + + // Apply attributes and CSS classes on backend + addFilter('editor.BlockListBlock', 'advgb/loadBackendBlockControls', withAttributes); +})(wp.i18n, wp.hooks, wp.blocks, wp.blockEditor, wp.components, wp.compose, wp.element); + +/***/ }), + +/***/ 0: +/*!*******************************************************************!*\ + !*** multi ./src/assets/blocks/block-controls/block-controls.jsx ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./src/assets/blocks/block-controls/block-controls.jsx */"./src/assets/blocks/block-controls/block-controls.jsx"); + + +/***/ }) + +/******/ }); //# sourceMappingURL=block-controls.js.map \ No newline at end of file diff --git a/src/assets/blocks/block-controls.js.map b/src/assets/blocks/block-controls.js.map index def11f0f6..d566dde61 100644 --- a/src/assets/blocks/block-controls.js.map +++ b/src/assets/blocks/block-controls.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/assets/blocks/block-controls/block-controls.jsx","webpack:///./node_modules/classnames/index.js","webpack:///./src/assets/blocks/0-adv-components/datetime.jsx","webpack:///./node_modules/hour-convert/index.js","webpack:///./src/assets/blocks/0-adv-components/utils.jsx"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","wpI18n","wpHooks","wpBlocks","wpBlockEditor","wpComponents","wpCompose","wpElement","wp","blockEditor","editor","addFilter","sprintf","__","hasBlockSupport","InspectorControls","ToggleControl","BlockControls","DateTimePicker","PanelBody","Notice","FormTokenField","SelectControl","createHigherOrderComponent","Component","Fragment","parseInt","advgbBlocks","block_controls","NON_SUPPORTED_BLOCKS","getGlobalControls","advgb_block_controls_vars","controls","keys","length","isControlEnabled","control","isAnyControlEnabledBlock","controlAttrs","globalControls","counter","blockControls","forEach","item","push","currentControlKey","isAnyControlEnabledGlobal","map","some","element","itemIndex","findIndex","newArray","non_supported","Set","settings","includes","attributes","advgbBlockControls","type","items","default","BlockEdit","props","state","taxModOptions","termOptions","searchTermWord","initArchive","updateTaxLabels","isPost","taxonomies","terms","this","getTaxonomies","tax","allTaxonomies","slug","term","user_roles","title","page","setAttributes","scheduleControl","enabled","dateFrom","dateTo","recurring","userRoleControl","roles","approach","archiveControl","pageControl","pages","controlsAdded","controlExists","obj","topic","slugs","taxArray","controlIndex","taxIndex","all","currentArchiveControl","option","find","el","undefined","result","currentTerms","changeControlKey","setState","filter","modifyTaxLabels","apiFetch","path","url","addQueryArgs","ids","then","list","singular","options","index","search","Array","from","a","data","select","getCurrentPostId","timezone","replace","iniTaxLabels","prevProps","prevState","isSelected","prevBlockControls","prevTermWord","archive","initArchiveControl","searchTerms","taxonomiesChanged","icon","initialOpen","className","schedule","label","help","checked","onChange","style","marginBottom","AdvDateTimeControl","buttonLabel","dateLabel","date","onChangeDate","newDate","onDateClear","onInvalidDate","thisDate","Date","getTime","setHours","fromDate","status","isDismissible","AdvDaysControl","days","onChangeDays","display","AdvTimeControl","currentTime","onChangeTime","newTime","onTimeClear","AdvTimezoneControl","defaultTimezone","getTimezoneLabel","getTimezoneSlug","onChangeTimezone","user_role","multiple","placeholder","suggestions","getOptionSuggestions","getUserRoles","maxSuggestions","getOptionTitles","getOptionSlugs","__experimentalExpandOnFocus","changeArchiveControl","onInputChange","__experimentalShowHowTo","getPages","BlockListBlock","advgbBcClass","i18n","hooks","blocks","components","compose","hasOwn","classNames","classes","arguments","arg","argType","isArray","inner","apply","toString","join","useState","popupState","setPopupState","togglePopup","Button","isLink","onClick","Tooltip","text","moment","format","Popover","onClose","resize","currentDate","is12Hour","isInvalidDate","allDays","_x","selectedDays","setSelectedDays","isDaySelected","day","CheckboxControl","updatedDays","findDay","uniqueDays","onChangeDay","AdvTimeClass","applyFilters","marginTop","float","marginRight","Icon","href","class","target","disabled","ButtonGroup","TextControl","hours","minutes","meridian","onInit","split","prevHours","prevMinutes","prevMeridian","savedTime","appendZero","hourConvert","to24Hour","hour","meridiem","isNaN","res","to12Hour","event","Math","max","min","Number","onKeyDown","variant","time","field_value","option_slug","find_option","slugs_array","option_title","matching_slug"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,O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ACE,IAAMC,EAAgBlK,EAAQjB,MAAM,SAAE9D,GAClC,OAAOA,EAAKqC,QAAU2M,UAEHhL,IAAlBiL,GACDF,EAAY9O,KAAMgP,EAAc/M,SAKrC6M","file":"block-controls.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import classnames from 'classnames';\nimport { AdvDateTimeControl, AdvDaysControl, AdvTimeControl, AdvTimezoneControl } from \"../0-adv-components/datetime.jsx\";\nimport {\n getOptionSuggestions,\n getOptionTitles,\n getOptionSlugs\n} from \"../0-adv-components/utils.jsx\";\n\n(function ( wpI18n, wpHooks, wpBlocks, wpBlockEditor, wpComponents, wpCompose, wpElement ) {\n wpBlockEditor = wp.blockEditor || wp.editor;\n const { addFilter } = wpHooks;\n const { sprintf, __ } = wpI18n;\n const { hasBlockSupport } = wpBlocks;\n const { InspectorControls, BlockControls } = wpBlockEditor;\n const { DateTimePicker, ToggleControl, PanelBody, Notice, FormTokenField, SelectControl } = wpComponents;\n const { createHigherOrderComponent } = wpCompose;\n const { Component, Fragment } = wpElement;\n\n // do not show this feature if disabled.\n if( !parseInt(advgbBlocks.block_controls) ) return;\n\n // Blocks that are not supported\n let NON_SUPPORTED_BLOCKS = [\n 'core/freeform',\n 'core/legacy-widget',\n 'core/widget-area',\n 'core/column',\n 'advgb/tab',\n 'advgb/column'\n ];\n\n const getGlobalControls = function () {\n return typeof advgb_block_controls_vars.controls !== 'undefined'\n && Object.keys(advgb_block_controls_vars.controls).length > 0\n ? advgb_block_controls_vars.controls\n : [];\n }\n\n /**\n * Check if a control is enabled\n *\n * @since 3.1.0\n * @param {string} control The use case block control. e.g. 'schedule'\n *\n * @return {bool}\n */\n const isControlEnabled = function( control ) {\n return typeof control !== 'undefined' && control;\n }\n\n /**\n * Check if at least one control is enabled per block instance\n *\n * @since 3.1.1\n * @param {string} controlAttrs Controls attributes. e.g. advgbBlockControls or props.attributes @TODO Figure out a way to NOT require controlAttrs as param due is the same always\n *\n * @return {bool}\n */\n const isAnyControlEnabledBlock = function( controlAttrs ) {\n const globalControls = getGlobalControls();\n let counter = 0;\n let blockControls = []; // Controls enabled in block instance\n\n // Get enabled global controls (in Settings)\n Object.keys(globalControls).forEach( (item) => {\n if( isControlEnabled( advgb_block_controls_vars.controls[item] ) ) {\n blockControls.push(item);\n }\n } );\n\n // Get counter for enabled controls in block instance\n blockControls.forEach( (item) => {\n if( currentControlKey( controlAttrs, item, 'enabled' ) ) {\n counter++;\n }\n } );\n\n return counter > 0 ? true : false;\n }\n\n /**\n * Check if at least one control is enabled globally (in Settings)\n *\n * @since 3.1.0\n *\n * @return {bool}\n */\n const isAnyControlEnabledGlobal = function() {\n const globalControls = getGlobalControls();\n let counter = 0;\n\n Object.keys(globalControls).map( (item) => {\n if( isControlEnabled( advgb_block_controls_vars.controls[item] ) ) {\n counter++;\n }\n } );\n\n return counter > 0 ? true : false;\n }\n\n /**\n * Return single controls array attribute value\n *\n * @since 3.1.0\n * @param {string} controlAttrs Controls attributes. e.g. advgbBlockControls or props.attributes @TODO Figure out a way to NOT require controlAttrs as param due is the same always\n * @param {string} control The use case block control. e.g. 'schedule'\n * @param {string} key The control key to check. e.g. 'enabled'\n *\n * @return {mixed}\n */\n const currentControlKey = function( controlAttrs, control, key ) {\n\n // Check if advgbBlockControls attribute exists\n const controlsAdded = typeof controlAttrs !== 'undefined' && controlAttrs.length\n ? true\n : false;\n // Check if control exists in advgbBlockControls array\n const controlExists = controlsAdded\n && controlAttrs.some( (element) => element.control === control )\n ? true\n : false;\n\n if( controlExists ) {\n const itemIndex = controlAttrs.findIndex(element => element.control === control);\n\n // No control found (this check seems not necessary but is here to prevent an unlikely error)\n if( itemIndex < 0 ) {\n return false;\n }\n\n let newArray = [...controlAttrs];\n const obj = newArray[itemIndex];\n\n return obj[key];\n }\n\n return null;\n }\n\n // Add non supported blocks according to Block controls\n if( typeof advgb_block_controls_vars !== 'undefined'\n && typeof advgb_block_controls_vars.non_supported !== 'undefined'\n && advgb_block_controls_vars.non_supported.length > 0\n ) {\n // Merge dynamically disabled blocks\n NON_SUPPORTED_BLOCKS = [...NON_SUPPORTED_BLOCKS, ...advgb_block_controls_vars.non_supported];\n // Remove duplicated values\n NON_SUPPORTED_BLOCKS = [...new Set(NON_SUPPORTED_BLOCKS)];\n }\n\n // Register block controls to blocks attributes\n addFilter( 'blocks.registerBlockType', 'advgb/blockControls', function ( settings ) {\n if ( ! NON_SUPPORTED_BLOCKS.includes( settings.name ) && isAnyControlEnabledGlobal() ) {\n settings.attributes = Object.assign( settings.attributes, {\n advgbBlockControls: {\n type: 'array',\n items: {\n type: 'object'\n },\n default: []\n }\n } );\n }\n\n return settings;\n } );\n\n const withEditControls = createHigherOrderComponent( ( BlockEdit ) => {\n\n return class BlockControlsEdit extends Component {\n\n constructor(props) {\n super(...props);\n\n this.state = {\n taxModOptions: [], // Store modified taxonomy options to decide if selected tax is for \"all terms\" or \"selected terms\"\n termOptions: [], // Store term options with slug (id) and title\n searchTermWord: '', // Updated when searching terms\n initArchive: true, // When true, trigger initArchiveControl()\n updateTaxLabels: false // When true, update taxonomy option labels\n }\n\n this.isPost = this.isPost.bind(this);\n }\n\n /**\n * Get filtered term slugs based on selected taxonomies\n *\n * @since 3.1.1\n * @param {array} taxonomies Array of taxonomies slugs\n *\n * @return {array}\n */\n getTermSlugs( taxonomies ) {\n const allTaxonomies = this.getTaxonomies();\n let terms = [];\n\n taxonomies.forEach( ( tax ) => {\n const allTaxonomies = this.getTaxonomies();\n const itemIndex = allTaxonomies.findIndex( ( element ) => element.slug === tax );\n\n allTaxonomies[itemIndex].terms.forEach( ( term ) => {\n terms.push( term.slug );\n } );\n } );\n\n return terms;\n }\n\n /**\n * Get taxonomies\n *\n * @since 3.1.1\n *\n * @return {array}\n */\n getTaxonomies() {\n return typeof advgb_block_controls_vars.taxonomies !== 'undefined'\n && advgb_block_controls_vars.taxonomies.length > 0\n ? advgb_block_controls_vars.taxonomies\n : [];\n }\n\n /**\n * Get all the available user roles from the site\n *\n * @since 3.1.0\n *\n * @return {array}\n */\n getUserRoles() {\n return typeof advgb_block_controls_vars.user_roles !== 'undefined'\n && advgb_block_controls_vars.user_roles.length > 0\n ? advgb_block_controls_vars.user_roles\n : [];\n }\n\n /**\n * Get filtered terms based on selected taxonomies\n *\n * @since 3.1.1\n * @param {array} taxonomies Taxonomies slugs\n *\n * @return {array}\n */\n getTerms( taxonomies ) {\n const allTaxonomies = this.getTaxonomies();\n let terms = [];\n\n taxonomies.forEach( ( tax ) => {\n const allTaxonomies = this.getTaxonomies();\n const itemIndex = allTaxonomies.findIndex( ( element ) => element.slug === tax );\n\n allTaxonomies[itemIndex].terms.forEach( ( term ) => {\n terms.push( {\n slug: term.slug,\n title: `${term.title} (${allTaxonomies[itemIndex].title})`\n } );\n } );\n } );\n\n return terms;\n }\n\n /**\n * Get pages\n *\n * @since 3.1.1\n *\n * @return {array}\n */\n getPages() {\n return typeof advgb_block_controls_vars.page !== 'undefined'\n && advgb_block_controls_vars.page.length > 0\n ? advgb_block_controls_vars.page\n : [];\n }\n\n /**\n * Update advgbBlockControls attribute when a key value changes\n *\n * @since 2.14.0\n * @param {string} control The use case block control. e.g. 'schedule'\n * @param {string} key The control key to modify. e.g. 'enabled'\n * @param {string} value The control key value (not required for boolean keys)\n *\n * @return {void}\n */\n changeControlKey( control, key, value = '' ) {\n const { attributes, setAttributes } = this.props;\n const { advgbBlockControls } = attributes;\n\n // Control objects to add when enabled for the first time\n const scheduleControl = {\n control: 'schedule',\n enabled: true,\n dateFrom: null,\n dateTo: null,\n recurring: false\n };\n const userRoleControl = {\n control: 'user_role',\n enabled: true,\n roles: [],\n approach: 'public'\n };\n const archiveControl = {\n control: 'archive',\n enabled: true,\n taxonomies: [],\n approach: 'exclude'\n };\n const pageControl = {\n control: 'page',\n enabled: true,\n pages: [],\n approach: 'exclude'\n };\n\n // Check if advgbBlockControls attribute exists\n const controlsAdded = typeof advgbBlockControls !== 'undefined' && advgbBlockControls.length\n ? true\n : false;\n // Check if control exists in advgbBlockControls array\n const controlExists = controlsAdded &&\n advgbBlockControls.some( (element) => element.control === control )\n ? true\n : false;\n\n if( controlExists ) {\n const itemIndex = advgbBlockControls.findIndex(element => element.control === control);\n\n // No control found (this check seems not necessary but is here to prevent an unlikely error)\n if( itemIndex < 0 ) {\n return false;\n }\n\n let newArray = [...advgbBlockControls];\n const obj = newArray[itemIndex];\n\n newArray[itemIndex] = typeof obj[key] === 'boolean'\n ? { ...newArray[itemIndex], [key]: !obj[key] }\n : { ...newArray[itemIndex], [key]: value }\n\n setAttributes( {\n advgbBlockControls: newArray\n } );\n } else if( controlsAdded && ! controlExists ) {\n\n // Add a new control object when other controls already exists\n switch( control ) {\n case 'schedule':\n setAttributes( {\n advgbBlockControls: [\n ...advgbBlockControls,\n scheduleControl\n ]\n } );\n break;\n\n case 'user_role':\n setAttributes( {\n advgbBlockControls: [\n ...advgbBlockControls,\n userRoleControl\n ]\n } );\n break;\n\n case 'archive':\n setAttributes( {\n advgbBlockControls: [\n ...advgbBlockControls,\n archiveControl\n ]\n } );\n break;\n\n case 'page':\n setAttributes( {\n advgbBlockControls: [\n ...advgbBlockControls,\n pageControl\n ]\n } );\n break;\n }\n } else {\n // Add the first control object attribute\n switch( control ) {\n case 'schedule':\n setAttributes( {\n advgbBlockControls: [ scheduleControl ]\n } );\n break;\n\n case 'user_role':\n setAttributes( {\n advgbBlockControls: [ userRoleControl ]\n } );\n break;\n\n case 'archive':\n setAttributes( {\n advgbBlockControls: [ archiveControl ]\n } );\n break;\n\n case 'page':\n setAttributes( {\n advgbBlockControls: [ pageControl ]\n } );\n break;\n }\n }\n }\n\n /**\n * Update archive control in advgbBlockControls attribute when taxonomies value changes\n *\n * @since 3.1.2\n *\n * @param {string} topic 'taxonomies' or 'terms'\n * @param {string} slugs The taxonomy slugs or term ids to insert/modify. e.g. ['category','post_tag'] or [82,161,99] or ['all_']\n *\n * @return {void}\n */\n changeArchiveControl( topic, slugs ) {\n const { attributes, setAttributes } = this.props;\n const { advgbBlockControls } = attributes;\n\n let taxArray = [];\n const controlIndex = advgbBlockControls.findIndex(element => element.control === 'archive');\n\n // No control found (this check seems not necessary but is here to prevent an unlikely error)\n if( controlIndex < 0 ) {\n return false;\n }\n\n let newArray = [...advgbBlockControls];\n\n if( topic === 'taxonomies' ) {\n\n // Check each taxonomy and its terms\n slugs.forEach( (item) => {\n\n // Get terms from current taxonomy (item)\n const taxIndex = newArray[controlIndex].taxonomies.findIndex(element => element.tax === item);\n\n if( taxIndex === -1 ) {\n\n // The last selected taxonomy\n taxArray.push( {\n tax: item,\n terms: [],\n all: true\n } );\n\n } else {\n\n // Existing taxonomy\n const terms = newArray[controlIndex].taxonomies[taxIndex].terms.length\n ? newArray[controlIndex].taxonomies[taxIndex].terms\n : [];\n const approach = terms.length ? 'select' : 'all';\n\n taxArray.push( {\n tax: item,\n terms: terms,\n all: terms.length ? false : true\n } );\n }\n } );\n\n newArray[controlIndex] = { ...newArray[controlIndex], ['taxonomies']: taxArray }\n\n setAttributes( {\n advgbBlockControls: newArray\n } );\n\n } else if( topic === 'terms' ) {\n\n let terms = {};\n const taxonomies = this.currentArchiveControl( 'taxonomies' );\n\n // Check each term id (item). slug means the id\n slugs.forEach( ( item ) => {\n\n // Find the current term in termOptions state to use its tax later\n const option = this.state.termOptions.find( el => el.slug === item);\n\n if( terms[option.tax] === undefined ) {\n terms[option.tax] = [];\n }\n\n // Get taxonomy from current term (item)\n const taxIndex = newArray[controlIndex].taxonomies.findIndex( element => element.tax === option.tax);\n\n /* Taxonomy for this term is selected? Is a bit reduntant but let's make sure\n * Then include the term.\n */\n if( taxonomies.includes( option.tax ) ) {\n terms[option.tax].push( item );\n }\n\n } );\n\n // Update taxonomies with at least one term selected\n Object.keys( terms ).forEach( (tax) => {\n\n // Get taxonomy from current tax\n const taxIndex = newArray[controlIndex].taxonomies.findIndex( element => element.tax === tax);\n\n if( taxIndex >= 0 ) {\n newArray[controlIndex].taxonomies[taxIndex] = {\n tax: tax,\n terms: terms[tax],\n all: terms[tax].length ? false : true\n };\n }\n } );\n\n // Include taxonomies with no terms selected (empty terms[option.tax] array)\n taxonomies.forEach( ( tax ) => {\n if( ! Object.keys( terms ).includes( tax ) ) {\n\n // Get taxonomy from current tax\n const taxIndex = newArray[controlIndex].taxonomies.findIndex( element => element.tax === tax);\n\n if( taxIndex >= 0 ) {\n newArray[controlIndex].taxonomies[taxIndex] = {\n tax: tax,\n terms: [],\n all: true\n };\n }\n }\n } );\n\n setAttributes( {\n advgbBlockControls: newArray\n } );\n\n } else {\n // Nothing to do here\n }\n }\n\n /**\n * Return merged taxonomies or terms\n *\n * @since 3.1.2\n *\n * @param {string} topic 'taxonomies' or 'terms'\n *\n * @return {array} An single array with all the selected terms or taxonomies ['category','post_tag'] or [99,182,42]\n */\n currentArchiveControl( topic ) {\n const { attributes, setAttributes } = this.props;\n const { advgbBlockControls } = attributes;\n\n let result = [];\n\n /* Get all the taxonomy objects.\n * e.g.\n * [\n * { \"tax\": \"post_tag\", \"terms\": [220,221]},\n * { \"tax\": \"category\", \"terms\": []}\n * ]\n */\n const taxonomies = currentControlKey( advgbBlockControls, 'archive', 'taxonomies' ).length\n ? currentControlKey( advgbBlockControls, 'archive', 'taxonomies' )\n : [];\n\n if( topic === 'taxonomies' ) {\n\n taxonomies.forEach( (item) => {\n result.push(item.tax);\n } );\n\n } else if( topic === 'terms' ) {\n\n taxonomies.forEach( (item) => {\n item.terms.forEach( ( el ) => {\n result.push( el ); // term id\n } );\n } );\n\n } else {\n // Nothing to do here\n }\n\n return result;\n }\n\n /**\n * Execute when taxonomy selection changes\n *\n * @since 3.1.1\n *\n * @return {void}\n */\n taxonomiesChanged() {\n const { attributes } = this.props;\n const { advgbBlockControls } = attributes;\n\n const currentTerms = !! currentControlKey( advgbBlockControls, 'archive', 'terms' )\n ? currentControlKey( advgbBlockControls, 'archive', 'terms' )\n : [];\n const taxonomies = !! currentControlKey( advgbBlockControls, 'archive', 'taxonomies' )\n ? currentControlKey( advgbBlockControls, 'archive', 'taxonomies' )\n : [];\n\n if( currentTerms.length ) {\n\n let result = [];\n currentTerms.forEach( ( slug ) => {\n const itemIndex = this.state.termOptions.findIndex( ( item ) => item.slug === slug );\n\n /* Get only the terms that belongs to selected taxonomies\n * and skip the ones that belongs to the deleted taxonomy\n */\n if( taxonomies.includes( this.state.termOptions[itemIndex].tax ) ) {\n result.push( this.state.termOptions[itemIndex].slug );\n }\n } );\n\n this.changeControlKey(\n 'archive',\n 'terms',\n result\n );\n }\n\n /* Remove term options from non-selected taxonomies.\n * Case scenario: the terms from the last removed taxonomy.\n */\n this.setState( {\n termOptions: this.state.termOptions.filter( (item) => {\n return this.currentArchiveControl( 'taxonomies' ).includes( item.tax );\n } )\n } );\n\n // Update tax label options to \"All terms\" or \"Selected terms\"\n this.modifyTaxLabels();\n }\n\n /**\n * Get selected terms on first load\n *\n * @since 3.1.1\n *\n * @return {void}\n */\n initArchiveControl() {\n const { advgbBlockControls } = this.props.attributes;\n\n wp.apiFetch( {\n path: wp.url.addQueryArgs(\n 'advgb/v1/terms',\n {\n taxonomies: this.currentArchiveControl( 'taxonomies' ),\n ids: this.currentArchiveControl( 'terms' )\n }\n )\n } ).then( ( list ) => {\n\n // Update tax label options to \"All terms\" or \"Selected terms\"\n this.modifyTaxLabels();\n\n this.setState( {\n termOptions: list,\n initArchive: false,\n updateTaxLabels: false\n } );\n } );\n\n\n }\n\n /**\n * Initial taxonomy labels to allow \"All terms\" \"Selected terms\" visual indicator\n *\n * @since 3.1.2\n *\n * @return {array}\n */\n iniTaxLabels() {\n\n let result = [];\n this.getTaxonomies().forEach( (item) => {\n /* Item example\n * {\n * \"slug\": \"category\",\n * \"title\": \"All Category terms\",\n * \"singular\": \"Category\"\n * }\n */\n result.push( {\n slug: item.slug,\n title: sprintf(\n __( 'All %s terms', 'advanced-gutenberg' ),\n item.title\n ),\n singular: item.title\n\n } );\n } );\n\n return result;\n }\n\n /**\n * Modify taxonomy labels. Very similar to iniTaxLabels()\n *\n * @since 3.1.2\n *\n * @return {array}\n */\n modifyTaxLabels() {\n const { advgbBlockControls } = this.props.attributes;\n\n /* Get all selected taxonomy objects.\n * e.g.\n * [\n * { \"tax\": \"post_tag\", \"terms\": [220,221]},\n * { \"tax\": \"category\", \"terms\": []}\n * ]\n */\n const taxonomies = currentControlKey( advgbBlockControls, 'archive', 'taxonomies' ).length\n ? currentControlKey( advgbBlockControls, 'archive', 'taxonomies' )\n : [];\n\n // Copy whole state\n let options = [...this.state.taxModOptions];\n\n options.forEach( (item, index) => {\n const tax = taxonomies.find( el => item.slug === el.tax );\n\n // Copy option to modify\n let option = { ...options[index] };\n // Update title value\n option.title = sprintf(\n tax === undefined || ! tax.terms.length\n ? __( 'All %s terms', 'advanced-gutenberg' )\n : __( 'Selected %s terms', 'advanced-gutenberg' ),\n option.singular\n );\n // Add option back to the state\n options[index] = option;\n } );\n\n // Save\n this.setState( {\n taxModOptions: options,\n updateTaxLabels: false\n } );\n }\n\n /**\n * Search terms based on search\n *\n * @since 3.1.1\n *\n * @return {void}\n */\n searchTerms() {\n const { termOptions, searchTermWord } = this.state;\n const { advgbBlockControls } = this.props.attributes;\n\n wp.apiFetch( {\n /*/ To get taxonomies\n path: wp.url.addQueryArgs( 'wp/v2/taxonomies', { context: 'edit' } )*/\n\n path: wp.url.addQueryArgs(\n 'advgb/v1/terms',\n {\n search: searchTermWord,\n taxonomies: this.currentArchiveControl( 'taxonomies' )\n }\n )\n\n } ).then( ( list ) => {\n\n /*/ To get taxonomies\n Object.keys(list).forEach( (item) => {\n options.push( {\n label: list[item].name,\n value: list[item].slug\n } );\n });*/\n\n // Merge selected terms with results from fetch\n let options = [ ...termOptions, ...list ];\n\n // Remove duplicated values\n options = Array.from( new Set( options.map( a => a.slug ) ) )\n .map( slug => {\n return options.find( a => a.slug === slug )\n });\n\n this.setState( {\n termOptions: options\n } );\n } );\n }\n\n /**\n * Check if we're in post edit screen\n *\n * @since 3.1.2\n *\n * @return {bool}\n */\n isPost() {\n return wp.data.select('core/editor') && wp.data.select('core/editor').getCurrentPostId();\n }\n\n /**\n * Get the timezone label from site settings stored in advgbBlocks object\n *\n * @since 3.1.4\n *\n * @return {bool}\n */\n getTimezoneLabel() {\n return typeof advgbBlocks.timezone !== 'undefined' && advgbBlocks.timezone.length\n ? advgbBlocks.timezone.replace(/_/g, ' ')\n : __( 'WordPress settings timezone', 'advanced-gutenberg' )\n }\n\n /**\n * Get the timezone slug from site settings stored in advgbBlocks object\n *\n * @since 3.1.4\n *\n * @return {bool}\n */\n getTimezoneSlug() {\n return typeof advgbBlocks.timezone !== 'undefined' && advgbBlocks.timezone.length\n ? advgbBlocks.timezone\n : 'UTC'\n }\n\n componentDidMount() {\n this.setState( {\n taxModOptions: this.iniTaxLabels()\n } );\n }\n\n componentDidUpdate(prevProps, prevState) {\n const { attributes, isSelected, name } = this.props;\n const { advgbBlockControls } = attributes;\n const { advgbBlockControls: prevBlockControls } = prevProps.attributes;\n const { searchTermWord, initArchive } = this.state;\n const { searchTermWord: prevTermWord } = prevState;\n\n // Get human readable selected terms on block selection the first time\n if( ! this.isPost()\n && ! NON_SUPPORTED_BLOCKS.includes( name )\n && isSelected\n && initArchive\n && isControlEnabled( advgb_block_controls_vars.controls.archive )\n && currentControlKey( advgbBlockControls, 'archive', 'enabled' )\n && this.currentArchiveControl( 'taxonomies' ).length\n && this.currentArchiveControl( 'terms' ).length\n ) {\n this.initArchiveControl();\n }\n\n // Search terms\n if( searchTermWord !== prevTermWord && searchTermWord.length > 2 ) {\n this.searchTerms();\n }\n\n // Update available terms and remove terms which taxonomy has been removed\n if( ! this.isPost()\n && isControlEnabled( advgb_block_controls_vars.controls.archive )\n && currentControlKey( advgbBlockControls, 'archive', 'enabled' )\n && (\n currentControlKey( prevBlockControls, 'archive', 'taxonomies' ) !== currentControlKey( advgbBlockControls, 'archive', 'taxonomies' ) // This trigger works when taxo changes, but not terms\n || this.state.updateTaxLabels // Trigger when terms changes\n )\n ) {\n this.taxonomiesChanged();\n }\n }\n\n render() {\n const { attributes, setAttributes } = this.props;\n const { advgbBlockControls } = attributes;\n\n return ( [\n this.props.isSelected && ( ! NON_SUPPORTED_BLOCKS.includes( this.props.name ) )\n && isAnyControlEnabledGlobal() &&\n \n \n { isControlEnabled( advgb_block_controls_vars.controls.schedule ) && (\n \n this.changeControlKey( 'schedule', 'enabled' ) }\n />\n { currentControlKey( advgbBlockControls, 'schedule', 'enabled' ) && (\n \n
\n this.changeControlKey( 'schedule', 'dateFrom', newDate ) }\n onDateClear={ () => this.changeControlKey( 'schedule', 'dateFrom', null ) }\n onInvalidDate={ false }\n />\n this.changeControlKey( 'schedule', 'dateTo', newDate ) }\n onDateClear={ () => this.changeControlKey( 'schedule', 'dateTo', null ) }\n onInvalidDate={ ( date ) => {\n // Disable all dates before dateFrom\n if( currentControlKey( advgbBlockControls, 'schedule', 'dateFrom' ) ) {\n let thisDate = new Date(date.getTime());\n thisDate.setHours(0, 0, 0, 0);\n let fromDate = new Date( currentControlKey( advgbBlockControls, 'schedule', 'dateFrom' ) );\n fromDate.setHours(0, 0, 0, 0);\n return thisDate.getTime() < fromDate.getTime();\n }\n } }\n />\n { ( currentControlKey( advgbBlockControls, 'schedule', 'dateFrom' ) > currentControlKey( advgbBlockControls, 'schedule', 'dateTo' ) ) &&\n \n { __( '\"Stop showing\" date should be after \"Start showing\" date!', 'advanced-gutenberg' ) }\n \n }\n { currentControlKey( advgbBlockControls, 'schedule', 'dateFrom' ) && currentControlKey( advgbBlockControls, 'schedule', 'dateTo' ) &&\n this.changeControlKey( 'schedule', 'recurring' ) }\n help={ __( 'If Recurring is enabled, this block will be displayed every year between the selected dates.', 'advanced-gutenberg' ) }\n />\n }\n this.changeControlKey( 'schedule', 'days', value ) }\n />\n \n this.changeControlKey(\n 'schedule',\n 'timeFrom',\n newTime\n )\n }\n onTimeClear={ () => this.changeControlKey( 'schedule', 'timeFrom', null ) }\n />\n this.changeControlKey(\n 'schedule',\n 'timeTo',\n newTime\n )\n }\n onTimeClear={ () => this.changeControlKey( 'schedule', 'timeTo', null ) }\n />\n { (\n currentControlKey( advgbBlockControls, 'schedule', 'timeFrom' )\n && currentControlKey( advgbBlockControls, 'schedule', 'timeTo' )\n && (\n '01/01/2020T' + currentControlKey( // We append a dummy date to make a datetime comparison\n advgbBlockControls, 'schedule', 'timeFrom'\n ) >= '01/01/2020T' + currentControlKey( // We append a dummy date to make a datetime comparison\n advgbBlockControls, 'schedule', 'timeTo'\n )\n )\n ) &&\n \n { __( '\"To\" time should be after \"From\" time!', 'advanced-gutenberg' ) }\n \n }\n { (\n (\n currentControlKey( advgbBlockControls, 'schedule', 'timeFrom' )\n && ! currentControlKey( advgbBlockControls, 'schedule', 'timeTo' )\n ) || (\n ! currentControlKey( advgbBlockControls, 'schedule', 'timeFrom' )\n && currentControlKey( advgbBlockControls, 'schedule', 'timeTo' )\n )\n ) &&\n \n { __( 'Please choose \"From\" time and \"To\" time.', 'advanced-gutenberg' ) }\n \n }\n this.changeControlKey( 'schedule', 'timezone', value ) }\n />\n
\n
\n ) }\n
\n ) }\n { isControlEnabled( advgb_block_controls_vars.controls.user_role ) && (\n \n this.changeControlKey( 'user_role', 'enabled' ) }\n />\n { currentControlKey( advgbBlockControls, 'user_role', 'enabled' ) && (\n \n
\n this.changeControlKey( 'user_role', 'approach', value ) }\n />\n
\n { ( currentControlKey( advgbBlockControls, 'user_role', 'approach' ) === 'include' ||\n currentControlKey( advgbBlockControls, 'user_role', 'approach' ) === 'exclude'\n ) && (\n \n {\n this.changeControlKey( 'user_role', 'roles', getOptionSlugs( value, this.getUserRoles() ) )\n } }\n __experimentalExpandOnFocus\n />\n { ( currentControlKey( advgbBlockControls, 'user_role', 'approach' ) === 'include' ||\n currentControlKey( advgbBlockControls, 'user_role', 'approach' ) === 'exclude'\n )\n && ! currentControlKey( advgbBlockControls, 'user_role', 'roles' ).length && (\n \n {\n __(\n 'Please select at least one user role.',\n 'advanced-gutenberg'\n )\n }\n \n ) }\n \n ) }\n
\n ) }\n
\n ) }\n { ! this.isPost() && ( // Disabled in post edit\n \n { isControlEnabled( advgb_block_controls_vars.controls.archive ) && (\n \n this.changeControlKey( 'archive', 'enabled' ) }\n />\n { currentControlKey( advgbBlockControls, 'archive', 'enabled' ) && (\n \n
\n this.changeControlKey( 'archive', 'approach', value ) }\n />\n
\n {\n this.changeArchiveControl(\n 'taxonomies',\n getOptionSlugs( value, this.state.taxModOptions || this.getTaxonomies() )\n );\n } }\n __experimentalExpandOnFocus\n />\n { ( currentControlKey( advgbBlockControls, 'archive', 'taxonomies' ).length > 0 ) && (\n \n {\n this.changeArchiveControl(\n 'terms',\n getOptionSlugs(\n value,\n this.state.termOptions\n )\n );\n this.setState( {\n updateTaxLabels: true\n } );\n } }\n onInputChange={ ( value ) => {\n this.setState( {\n searchTermWord: value\n } );\n } }\n __experimentalShowHowTo={ false }\n />\n
\n { __(\n 'Use this filter to apply only to some terms.',\n 'advanced-gutenberg'\n ) }\n
\n
\n ) }\n
\n ) }\n
\n ) }\n\n { isControlEnabled( advgb_block_controls_vars.controls.page ) && (\n \n this.changeControlKey( 'page', 'enabled' ) }\n />\n { currentControlKey( advgbBlockControls, 'page', 'enabled' ) && (\n \n
\n this.changeControlKey( 'page', 'approach', value ) }\n />\n
\n { ( currentControlKey( advgbBlockControls, 'page', 'approach' ) === 'include' ||\n currentControlKey( advgbBlockControls, 'page', 'approach' ) === 'exclude'\n ) && (\n {\n this.changeControlKey( 'page', 'pages', getOptionSlugs( value, this.getPages() ) )\n } }\n __experimentalExpandOnFocus\n />\n ) }\n
\n ) }\n
\n ) }\n
\n ) }\n \n
,\n ,\n ] )\n }\n }\n }, 'withEditControls' );\n\n // Add option to add controls for supported blocks\n addFilter( 'editor.BlockEdit', 'advgb/addBlockControls', withEditControls );\n\n const withAttributes = createHigherOrderComponent( ( BlockListBlock ) => {\n return ( props ) => {\n if ( ( !NON_SUPPORTED_BLOCKS.includes( props.name ) ) && hasBlockSupport( props.name, 'advgb/blockControls', true ) && isAnyControlEnabledGlobal() ) {\n const { advgbBlockControls } = props.attributes;\n const advgbBcClass = props.isSelected === false\n && isAnyControlEnabledBlock( advgbBlockControls )\n ? 'advgb-bc-editor-preview' : '';\n\n return ;\n }\n\n return ;\n };\n }, 'withAttributes' );\n\n // Apply attributes and CSS classes on backend\n addFilter( 'editor.BlockListBlock', 'advgb/loadBackendBlockControls', withAttributes );\n\n})( wp.i18n, wp.hooks, wp.blocks, wp.blockEditor, wp.components, wp.compose, wp.element );\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import hourConvert from 'hour-convert';\n\nconst { ButtonGroup, Button, DateTimePicker, TextControl, CheckboxControl, Popover, Tooltip, SelectControl, Icon } = wp.components;\nconst { Component, Fragment, useState } = wp.element;\nconst { __, _x } = wp.i18n;\nconst { applyFilters } = wp.hooks;\n\nexport function AdvDateTimeControl(props) {\n const [popupState, setPopupState] = useState( false );\n const togglePopup = () => {\n setPopupState( ! popupState );\n };\n\n const {\n buttonLabel,\n dateLabel,\n date,\n onChangeDate,\n onDateClear,\n onInvalidDate\n } = props;\n\n return (\n \n
\n \n
\n \n \n \n { date ? moment( date ).format( \"MMMM DD YYYY, h:mm a\" ) : buttonLabel }\n \n \n \n { date &&\n \t\t\t\t onDateClear() }\n \t\t\t\t/>\n \t\t\t}\n
\n
\n { popupState &&\n \n \n \n \n }\n
\n\n )\n}\n\nexport function AdvDaysControl(props) {\n const allDays = [\n { slug: 0, label: _x( 'S', 'Sunday first letter', 'advanced-gutenberg' ) }, // Sunday\n { slug: 1, label: __( 'M', 'advanced-gutenberg' ) }, // Monday\n { slug: 2, label: _x( 'T', 'Tuesday first letter', 'advanced-gutenberg' ) }, // Tuesday\n { slug: 3, label: __( 'W', 'advanced-gutenberg' ) }, // Wednesday\n { slug: 4, label: _x( 'T', 'Thursday first letter', 'advanced-gutenberg' ) }, // Thursday\n { slug: 5, label: __( 'F', 'advanced-gutenberg' ) }, // Friday\n { slug: 6, label: _x( 'S', 'Saturday first letter', 'advanced-gutenberg' ) } // Saturday\n ];\n\n const {\n label,\n days,\n onChangeDays\n } = props;\n\n // Use a single state variable to store the selected days\n const [ selectedDays, setSelectedDays ] = useState( days );\n\n /**\n * Check if the day is selected or not\n *\n * @since 3.1.2\n *\n * @param {string} Day slug e.g. 'u' for Sunday, 't' for Tuesday\n *\n * @return {bool}\n */\n function isDaySelected( slug ) {\n return selectedDays.some( el => el === slug );\n }\n\n /**\n * Update the selected days state when a checkbox is changed\n *\n * @since 3.1.2\n *\n * @param {string} Day slug e.g. 'u' for Sunday, 't' for Tuesday\n *\n * @return {void}\n */\n function onChangeDay( slug ) {\n\n // Check if the day is already selected\n const isSelected = isDaySelected( slug );\n\n // Create a new array with the updated selection\n let updatedDays;\n if ( isSelected ) {\n // Remove the day from the selected days\n updatedDays = selectedDays.filter( el => el !== slug );\n } else {\n // Add the day to the selected days\n const findDay = allDays.find( el => el.slug === slug );\n updatedDays = [ ...selectedDays, findDay.slug ];\n }\n\n // Remove duplicates\n const uniqueDays = [ ...new Set( updatedDays ) ];\n\n // Update the selected days state\n setSelectedDays( uniqueDays );\n\n // Call the onChangeDays prop to notify the parent component of the change\n if ( onChangeDays ) {\n onChangeDays( updatedDays );\n }\n }\n\n return (\n \n
\n \n
\n { allDays.map( day => (\n onChangeDay( day.slug ) }\n />\n ) ) }\n
\n
\n
\n )\n}\n\nclass AdvTimeClass extends Component {\n\n constructor(props) {\n super(props);\n this.state = {\n onChangeTime: null,\n currentTime: this.props.currentTime || null,\n hours: null,\n minutes: null,\n meridian: 'am',\n onInit: true\n };\n }\n\n componentWillMount() {\n const { onChangeTime, currentTime, onInit } = this.state;\n\n if( this.props.onChangeTime !== onChangeTime ) {\n this.setState( {\n onChangeTime: this.props.onChangeTime,\n } );\n }\n\n if( this.props.currentTime !== currentTime ) {\n this.setState( {\n currentTime: this.props.currentTime,\n } );\n }\n\n // Init\n if( currentTime && currentTime.includes(':') && onInit ) {\n this.setState( {\n hours: currentTime.split(':')[0],\n minutes: currentTime.split(':')[1],\n meridian: parseInt( currentTime.split(':')[0] ) > 11 ? 'pm' : 'am', // We set > 11 because PM starts from 12:00:00\n onInit: false\n } );\n }\n }\n\n componentDidUpdate(prevProps, prevState) {\n const { onChangeTime, currentTime } = this.props;\n const { hours, minutes, meridian } = this.state;\n const { hours: prevHours, minutes: prevMinutes, meridian: prevMeridian } = prevState;\n\n if( hours !== prevHours || minutes !== prevMinutes || meridian !== prevMeridian ) {\n\n // When clearing time\n if( ! hours && ! minutes ) {\n return;\n }\n\n // Default minutes when hours selected\n if( hours && ! minutes ) {\n this.setState( {\n minutes: '00'\n } );\n }\n\n // Default hours when minutes selected\n if( minutes && ! hours ) {\n this.setState( {\n hours: '01'\n } );\n }\n\n /* Convert 12-hours to 24-hours.\n * e.g. 12:00 AM becomes 00:00:00\n * 12:00 PM becomes 12:00:00\n * 01:00 PM becomes 13:00:00\n */\n const savedTime = `${this.appendZero(\n hourConvert.to24Hour( {\n hour: parseInt( hours ),\n meridiem: meridian\n } )\n )}:${minutes}:00`;\n\n // Value saved in source/attribute\n this.props.onChangeTime( savedTime );\n }\n }\n\n /**\n * Append zero to one digit numbers. e.g. 9 becomes '09'\n *\n * @since 3.1.2\n *\n * @param {string value Hours or minutes\n *\n * @return {string}\n */\n appendZero( value ) {\n if( isNaN( value ) ) {\n return;\n }\n\n const res = parseInt( value );\n\n return res > 9 ? res : `0${res}`;\n }\n\n render() {\n const { onChangeTime, currentTime, hours, minutes, meridian } = this.state;\n\n // Make sure hours are valid. 01: min, 12: max\n const handleChangeHours = event => {\n const value = Math.max( 1, Math.min( 12, Number( event.target.value ) ) );\n this.setState( {\n hours: this.appendZero( value )\n } );\n };\n\n // Allow to use up/down keys for hours\n const handleKeyDownHours = event => {\n const value = Number( event.target.value );\n if( event.key === 'ArrowUp' && value < 12 ) {\n this.setState( {\n hours: this.appendZero( value + 1 )\n } );\n } else if ( event.key === 'ArrowDown' && value > 1 ) {\n this.setState( {\n hours: this.appendZero( value - 1 )\n } );\n }\n };\n\n // Make sure minutes are valid. 01: min, 59: max\n const handleChangeMinutes = event => {\n const value = Math.max( 0, Math.min( 59, Number( event.target.value ) ) );\n this.setState( {\n minutes: this.appendZero( value )\n } );\n };\n\n // Allow to use up/down keys for minutes\n const handleKeyDownMinutes = event => {\n const value = Number( event.target.value );\n if( event.key === 'ArrowUp' && value < 59 ) {\n this.setState( {\n minutes: this.appendZero( value + 1 )\n } );\n } else if ( event.key === 'ArrowDown' && value > 0 ) {\n this.setState( {\n minutes: this.appendZero( value - 1 )\n } );\n }\n };\n\n return (\n \n
\n \n
\n \n :\n \n
\n \n {\n this.setState( {\n meridian: 'am'\n } );\n } }\n disabled={ hours && minutes ? false : true }\n >\n { __( 'AM', 'advanced-gutenberg' ) }\n \n {\n this.setState( {\n meridian: 'pm'\n } );\n } }\n disabled={ hours && minutes ? false : true }\n >\n { __( 'PM', 'advanced-gutenberg' ) }\n \n \n { hours && minutes &&\n \t\t\t\t {\n this.props.onTimeClear();\n this.setState( {\n hours: null,\n minutes: null,\n meridian: 'am'\n } );\n }\n }\n \t\t\t\t/>\n \t\t\t}\n
\n
\n )\n }\n}\nexport default AdvTimeClass;\n\nexport function AdvTimeControl(props) {\n const { label, currentTime, onChangeTime, onTimeClear } = props;\n\n return(\n \n );\n}\n\nexport function AdvTimezoneControl(props) {\n const { label, defaultTimezone } = props;\n\n return (\n \n { applyFilters( 'advgb.timezoneControl',\n \n
\n \n \n
\n
,\n props\n ) }\n
\n )\n}\n","'use strict';\n\nmodule.exports = {\n\n /**\n * Convert 24-hour time to 12-hour format.\n *\n * @param {number} hour Hour to convert (0-23)\n * @return {object} { hour, meridiem } (meridian is also returned for backwards compatibility)\n */\n to12Hour: function to12Hour(hour) {\n var meridiem = hour < 12 ? 'am' : 'pm';\n return {\n hour: ((hour + 11) % 12 + 1),\n meridiem: meridiem,\n meridian: meridiem\n };\n },\n\n /**\n * Convert 12-hour time to 24-hour format.\n *\n * @param {object} time Time object\n * @param {number} time.hour Hour to convert (1-12)\n * @param {string} time.meridiem Hour meridiem (am/pm). 'time.meridian' is\n * supported for backwards compatibility.\n * @return {number}\n */\n to24Hour: function to24Hour(time) {\n var meridiem = time.meridiem || time.meridian;\n return (meridiem === 'am' ? 0 : 12) + (time.hour % 12);\n }\n};\n","/**\n * Generate option title suggestions\n *\n * @since 3.1.1\n * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}]\n *\n * @return {array} Option slugs. e.g. ['subscriber','new_customer']\n */\nexport const getOptionSuggestions = function( options ) {\n return options.map( ( item ) => item.title );\n}\n\n/**\n * Match option slugs with its option titles\n * to display as field value (but NOT saved!).\n *\n * @since 3.1.1\n * @param slugs Option slugs. e.g. ['subscriber','new_customer'] or [82, 92]\n * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}]\n *\n * @return {array} Option titles. e.g. ['Subscriber','New Customer']\n */\nexport const getOptionTitles = function( slugs, options ) {\n let field_value = [];\n\n if ( options !== null ) {\n field_value = slugs.map( ( option_slug ) => {\n let find_option = options.find( ( item ) => {\n return item.slug === option_slug;\n } );\n if ( find_option === undefined || ! find_option ) {\n return option_slug; // It should return false but creates empty selections\n }\n return find_option.title;\n } );\n }\n\n return field_value;\n}\n\n/**\n * Match option titles with its slugs, and save slugs\n *\n * @since 3.1.1\n * @param slugs Option slugs. e.g. ['subscriber','new_customer']\n * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}]\n *\n * @return {array} Option slugs. e.g. ['subscriber','new_customer']\n */\nexport const getOptionSlugs = function( slugs, options ) {\n let slugs_array = [];\n\n slugs.map(\n ( option_title ) => {\n const matching_slug = options.find( ( item ) => {\n return item.title === option_title;\n } );\n if ( matching_slug !== undefined ) {\n slugs_array.push( matching_slug.slug );\n }\n }\n )\n\n return slugs_array;\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/classnames/index.js","webpack:///./node_modules/hour-convert/index.js","webpack:///./src/assets/blocks/0-adv-components/datetime.jsx","webpack:///./src/assets/blocks/0-adv-components/utils.jsx","webpack:///./src/assets/blocks/block-controls/block-controls.jsx"],"names":["AdvDateTimeControl","AdvDaysControl","AdvTimeControl","AdvTimezoneControl","wp","components","ButtonGroup","Button","DateTimePicker","TextControl","CheckboxControl","Popover","Tooltip","SelectControl","Icon","element","Component","Fragment","useState","i18n","__","_x","applyFilters","hooks","props","popupState","setPopupState","togglePopup","buttonLabel","dateLabel","date","onChangeDate","onDateClear","onInvalidDate","moment","format","bind","allDays","slug","label","days","onChangeDays","selectedDays","setSelectedDays","isDaySelected","some","el","onChangeDay","isSelected","updatedDays","filter","findDay","find","uniqueDays","Set","map","day","AdvTimeClass","state","onChangeTime","currentTime","hours","minutes","meridian","onInit","setState","includes","split","parseInt","prevProps","prevState","prevHours","prevMinutes","prevMeridian","savedTime","appendZero","hourConvert","to24Hour","hour","meridiem","value","isNaN","res","handleChangeHours","Math","max","min","Number","event","target","handleKeyDownHours","key","handleChangeMinutes","handleKeyDownMinutes","to12Hour","onTimeClear","defaultTimezone","marginTop","marginBottom","float","marginRight","getOptionSuggestions","options","item","title","getOptionTitles","slugs","field_value","option_slug","find_option","undefined","getOptionSlugs","slugs_array","option_title","matching_slug","push","wpI18n","wpHooks","wpBlocks","wpBlockEditor","wpComponents","wpCompose","wpElement","blockEditor","editor","addFilter","sprintf","hasBlockSupport","InspectorControls","BlockControls","ToggleControl","PanelBody","Notice","FormTokenField","createHigherOrderComponent","advgbBlocks","block_controls","NON_SUPPORTED_BLOCKS","getGlobalControls","advgb_block_controls_vars","controls","Object","keys","length","isControlEnabled","control","isAnyControlEnabledBlock","controlAttrs","globalControls","counter","blockControls","forEach","currentControlKey","isAnyControlEnabledGlobal","controlsAdded","controlExists","itemIndex","findIndex","newArray","obj","non_supported","settings","name","attributes","advgbBlockControls","type","items","default","withEditControls","BlockEdit","taxModOptions","termOptions","searchTermWord","initArchive","updateTaxLabels","isPost","taxonomies","allTaxonomies","getTaxonomies","terms","tax","term","user_roles","page","setAttributes","scheduleControl","enabled","dateFrom","dateTo","recurring","userRoleControl","roles","approach","archiveControl","pageControl","pages","topic","taxArray","controlIndex","taxIndex","all","currentArchiveControl","option","result","currentTerms","changeControlKey","modifyTaxLabels","apiFetch","path","url","addQueryArgs","ids","then","list","singular","index","search","Array","from","a","data","select","getCurrentPostId","timezone","replace","iniTaxLabels","prevBlockControls","prevTermWord","archive","initArchiveControl","searchTerms","taxonomiesChanged","schedule","newDate","thisDate","Date","getTime","setHours","fromDate","display","newTime","getTimezoneLabel","getTimezoneSlug","user_role","getUserRoles","changeArchiveControl","getPages","withAttributes","BlockListBlock","advgbBcClass","className","blocks","compose"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;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,eAAejO,MAAMwB,UAAN,KAAqB,KAArB,IACdkG,yBAA0BkB,kBAA1B,CADc,GAEX,yBAFW,GAEiB,EAFtC;;AAIA,uBAAO,oBAAC,cAAD,eAAqB5I,KAArB,IAA6B,WAAY,0BAAYA,MAAMkO,SAAlB,EAA6BD,YAA7B,CAAzC,EAAuF,yBAAyBrF,kBAAhH,IAAP;AACH;;AAED,mBAAO,oBAAC,cAAD,EAAqB5I,KAArB,CAAP;AACH,SAXD;AAYH,KAbsB,EAapB,gBAboB,CAAvB;;AAeA;AACAqG,cAAW,uBAAX,EAAoC,gCAApC,EAAsE0H,cAAtE;AAEH,CAnzCD,EAmzCInP,GAAGe,IAnzCP,EAmzCaf,GAAGmB,KAnzChB,EAmzCuBnB,GAAGuP,MAnzC1B,EAmzCkCvP,GAAGuH,WAnzCrC,EAmzCkDvH,GAAGC,UAnzCrD,EAmzCiED,GAAGwP,OAnzCpE,EAmzC6ExP,GAAGW,OAnzChF,E","file":"block-controls.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","'use strict';\n\nmodule.exports = {\n\n /**\n * Convert 24-hour time to 12-hour format.\n *\n * @param {number} hour Hour to convert (0-23)\n * @return {object} { hour, meridiem } (meridian is also returned for backwards compatibility)\n */\n to12Hour: function to12Hour(hour) {\n var meridiem = hour < 12 ? 'am' : 'pm';\n return {\n hour: ((hour + 11) % 12 + 1),\n meridiem: meridiem,\n meridian: meridiem\n };\n },\n\n /**\n * Convert 12-hour time to 24-hour format.\n *\n * @param {object} time Time object\n * @param {number} time.hour Hour to convert (1-12)\n * @param {string} time.meridiem Hour meridiem (am/pm). 'time.meridian' is\n * supported for backwards compatibility.\n * @return {number}\n */\n to24Hour: function to24Hour(time) {\n var meridiem = time.meridiem || time.meridian;\n return (meridiem === 'am' ? 0 : 12) + (time.hour % 12);\n }\n};\n","import hourConvert from 'hour-convert';\n\nconst { ButtonGroup, Button, DateTimePicker, TextControl, CheckboxControl, Popover, Tooltip, SelectControl, Icon } = wp.components;\nconst { Component, Fragment, useState } = wp.element;\nconst { __, _x } = wp.i18n;\nconst { applyFilters } = wp.hooks;\n\nexport function AdvDateTimeControl(props) {\n const [popupState, setPopupState] = useState( false );\n const togglePopup = () => {\n setPopupState( ! popupState );\n };\n\n const {\n buttonLabel,\n dateLabel,\n date,\n onChangeDate,\n onDateClear,\n onInvalidDate\n } = props;\n\n return (\n \n
\n \n
\n \n \n \n { date ? moment( date ).format( \"MMMM DD YYYY, h:mm a\" ) : buttonLabel }\n \n \n \n { date &&\n \t\t\t\t onDateClear() }\n \t\t\t\t/>\n \t\t\t}\n
\n
\n { popupState &&\n \n \n \n \n }\n
\n\n )\n}\n\nexport function AdvDaysControl(props) {\n const allDays = [\n { slug: 0, label: _x( 'S', 'Sunday first letter', 'advanced-gutenberg' ) }, // Sunday\n { slug: 1, label: __( 'M', 'advanced-gutenberg' ) }, // Monday\n { slug: 2, label: _x( 'T', 'Tuesday first letter', 'advanced-gutenberg' ) }, // Tuesday\n { slug: 3, label: __( 'W', 'advanced-gutenberg' ) }, // Wednesday\n { slug: 4, label: _x( 'T', 'Thursday first letter', 'advanced-gutenberg' ) }, // Thursday\n { slug: 5, label: __( 'F', 'advanced-gutenberg' ) }, // Friday\n { slug: 6, label: _x( 'S', 'Saturday first letter', 'advanced-gutenberg' ) } // Saturday\n ];\n\n const {\n label,\n days,\n onChangeDays\n } = props;\n\n // Use a single state variable to store the selected days\n const [ selectedDays, setSelectedDays ] = useState( days );\n\n /**\n * Check if the day is selected or not\n *\n * @since 3.1.2\n *\n * @param {string} Day slug e.g. 'u' for Sunday, 't' for Tuesday\n *\n * @return {bool}\n */\n function isDaySelected( slug ) {\n return selectedDays.some( el => el === slug );\n }\n\n /**\n * Update the selected days state when a checkbox is changed\n *\n * @since 3.1.2\n *\n * @param {string} Day slug e.g. 'u' for Sunday, 't' for Tuesday\n *\n * @return {void}\n */\n function onChangeDay( slug ) {\n\n // Check if the day is already selected\n const isSelected = isDaySelected( slug );\n\n // Create a new array with the updated selection\n let updatedDays;\n if ( isSelected ) {\n // Remove the day from the selected days\n updatedDays = selectedDays.filter( el => el !== slug );\n } else {\n // Add the day to the selected days\n const findDay = allDays.find( el => el.slug === slug );\n updatedDays = [ ...selectedDays, findDay.slug ];\n }\n\n // Remove duplicates\n const uniqueDays = [ ...new Set( updatedDays ) ];\n\n // Update the selected days state\n setSelectedDays( uniqueDays );\n\n // Call the onChangeDays prop to notify the parent component of the change\n if ( onChangeDays ) {\n onChangeDays( updatedDays );\n }\n }\n\n return (\n \n
\n \n
\n { allDays.map( day => (\n onChangeDay( day.slug ) }\n />\n ) ) }\n
\n
\n
\n )\n}\n\nclass AdvTimeClass extends Component {\n\n constructor(props) {\n super(props);\n this.state = {\n onChangeTime: null,\n currentTime: this.props.currentTime || null,\n hours: null,\n minutes: null,\n meridian: 'am',\n onInit: true\n };\n }\n\n componentWillMount() {\n const { onChangeTime, currentTime, onInit } = this.state;\n\n if( this.props.onChangeTime !== onChangeTime ) {\n this.setState( {\n onChangeTime: this.props.onChangeTime,\n } );\n }\n\n if( this.props.currentTime !== currentTime ) {\n this.setState( {\n currentTime: this.props.currentTime,\n } );\n }\n\n // Init\n if( currentTime && currentTime.includes(':') && onInit ) {\n this.setState( {\n hours: currentTime.split(':')[0],\n minutes: currentTime.split(':')[1],\n meridian: parseInt( currentTime.split(':')[0] ) > 11 ? 'pm' : 'am', // We set > 11 because PM starts from 12:00:00\n onInit: false\n } );\n }\n }\n\n componentDidUpdate(prevProps, prevState) {\n const { onChangeTime, currentTime } = this.props;\n const { hours, minutes, meridian } = this.state;\n const { hours: prevHours, minutes: prevMinutes, meridian: prevMeridian } = prevState;\n\n if( hours !== prevHours || minutes !== prevMinutes || meridian !== prevMeridian ) {\n\n // When clearing time\n if( ! hours && ! minutes ) {\n return;\n }\n\n // Default minutes when hours selected\n if( hours && ! minutes ) {\n this.setState( {\n minutes: '00'\n } );\n }\n\n // Default hours when minutes selected\n if( minutes && ! hours ) {\n this.setState( {\n hours: '01'\n } );\n }\n\n /* Convert 12-hours to 24-hours.\n * e.g. 12:00 AM becomes 00:00:00\n * 12:00 PM becomes 12:00:00\n * 01:00 PM becomes 13:00:00\n */\n const savedTime = `${this.appendZero(\n hourConvert.to24Hour( {\n hour: parseInt( hours ),\n meridiem: meridian\n } )\n )}:${minutes}:00`;\n\n // Value saved in source/attribute\n this.props.onChangeTime( savedTime );\n }\n }\n\n /**\n * Append zero to one digit numbers. e.g. 9 becomes '09'\n *\n * @since 3.1.2\n *\n * @param {string value Hours or minutes\n *\n * @return {string}\n */\n appendZero( value ) {\n if( isNaN( value ) ) {\n return;\n }\n\n const res = parseInt( value );\n\n return res > 9 ? res : `0${res}`;\n }\n\n render() {\n const { onChangeTime, currentTime, hours, minutes, meridian } = this.state;\n\n // Make sure hours are valid. 01: min, 12: max\n const handleChangeHours = event => {\n const value = Math.max( 1, Math.min( 12, Number( event.target.value ) ) );\n this.setState( {\n hours: this.appendZero( value )\n } );\n };\n\n // Allow to use up/down keys for hours\n const handleKeyDownHours = event => {\n const value = Number( event.target.value );\n if( event.key === 'ArrowUp' && value < 12 ) {\n this.setState( {\n hours: this.appendZero( value + 1 )\n } );\n } else if ( event.key === 'ArrowDown' && value > 1 ) {\n this.setState( {\n hours: this.appendZero( value - 1 )\n } );\n }\n };\n\n // Make sure minutes are valid. 01: min, 59: max\n const handleChangeMinutes = event => {\n const value = Math.max( 0, Math.min( 59, Number( event.target.value ) ) );\n this.setState( {\n minutes: this.appendZero( value )\n } );\n };\n\n // Allow to use up/down keys for minutes\n const handleKeyDownMinutes = event => {\n const value = Number( event.target.value );\n if( event.key === 'ArrowUp' && value < 59 ) {\n this.setState( {\n minutes: this.appendZero( value + 1 )\n } );\n } else if ( event.key === 'ArrowDown' && value > 0 ) {\n this.setState( {\n minutes: this.appendZero( value - 1 )\n } );\n }\n };\n\n return (\n \n
\n \n
\n \n :\n \n
\n \n {\n this.setState( {\n meridian: 'am'\n } );\n } }\n disabled={ hours && minutes ? false : true }\n >\n { __( 'AM', 'advanced-gutenberg' ) }\n \n {\n this.setState( {\n meridian: 'pm'\n } );\n } }\n disabled={ hours && minutes ? false : true }\n >\n { __( 'PM', 'advanced-gutenberg' ) }\n \n \n { hours && minutes &&\n \t\t\t\t {\n this.props.onTimeClear();\n this.setState( {\n hours: null,\n minutes: null,\n meridian: 'am'\n } );\n }\n }\n \t\t\t\t/>\n \t\t\t}\n
\n
\n )\n }\n}\nexport default AdvTimeClass;\n\nexport function AdvTimeControl(props) {\n const { label, currentTime, onChangeTime, onTimeClear } = props;\n\n return(\n \n );\n}\n\nexport function AdvTimezoneControl(props) {\n const { label, defaultTimezone } = props;\n\n return (\n \n { applyFilters( 'advgb.timezoneControl',\n \n
\n \n \n
\n
,\n props\n ) }\n
\n )\n}\n","/**\n * Generate option title suggestions\n *\n * @since 3.1.1\n * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}]\n *\n * @return {array} Option slugs. e.g. ['subscriber','new_customer']\n */\nexport const getOptionSuggestions = function( options ) {\n return options.map( ( item ) => item.title );\n}\n\n/**\n * Match option slugs with its option titles\n * to display as field value (but NOT saved!).\n *\n * @since 3.1.1\n * @param slugs Option slugs. e.g. ['subscriber','new_customer'] or [82, 92]\n * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}]\n *\n * @return {array} Option titles. e.g. ['Subscriber','New Customer']\n */\nexport const getOptionTitles = function( slugs, options ) {\n let field_value = [];\n\n if ( options !== null ) {\n field_value = slugs.map( ( option_slug ) => {\n let find_option = options.find( ( item ) => {\n return item.slug === option_slug;\n } );\n if ( find_option === undefined || ! find_option ) {\n return option_slug; // It should return false but creates empty selections\n }\n return find_option.title;\n } );\n }\n\n return field_value;\n}\n\n/**\n * Match option titles with its slugs, and save slugs\n *\n * @since 3.1.1\n * @param slugs Option slugs. e.g. ['subscriber','new_customer']\n * @param options Available options as objects with slug and title. e.g. [{slug: 'subscriber', title: 'Subscriber'}, {slug: 'new_customer', title: 'New Customer'}]\n *\n * @return {array} Option slugs. e.g. ['subscriber','new_customer']\n */\nexport const getOptionSlugs = function( slugs, options ) {\n let slugs_array = [];\n\n slugs.map(\n ( option_title ) => {\n const matching_slug = options.find( ( item ) => {\n return item.title === option_title;\n } );\n if ( matching_slug !== undefined ) {\n slugs_array.push( matching_slug.slug );\n }\n }\n )\n\n return slugs_array;\n}\n","import classnames from 'classnames';\nimport { AdvDateTimeControl, AdvDaysControl, AdvTimeControl, AdvTimezoneControl } from \"../0-adv-components/datetime.jsx\";\nimport {\n getOptionSuggestions,\n getOptionTitles,\n getOptionSlugs\n} from \"../0-adv-components/utils.jsx\";\n\n(function ( wpI18n, wpHooks, wpBlocks, wpBlockEditor, wpComponents, wpCompose, wpElement ) {\n wpBlockEditor = wp.blockEditor || wp.editor;\n const { addFilter } = wpHooks;\n const { sprintf, __ } = wpI18n;\n const { hasBlockSupport } = wpBlocks;\n const { InspectorControls, BlockControls } = wpBlockEditor;\n const { DateTimePicker, ToggleControl, PanelBody, Notice, FormTokenField, SelectControl } = wpComponents;\n const { createHigherOrderComponent } = wpCompose;\n const { Component, Fragment } = wpElement;\n\n // do not show this feature if disabled.\n if( !parseInt(advgbBlocks.block_controls) ) return;\n\n // Blocks that are not supported\n let NON_SUPPORTED_BLOCKS = [\n 'core/freeform',\n 'core/legacy-widget',\n 'core/widget-area',\n 'core/column',\n 'advgb/tab',\n 'advgb/column'\n ];\n\n const getGlobalControls = function () {\n return typeof advgb_block_controls_vars.controls !== 'undefined'\n && Object.keys(advgb_block_controls_vars.controls).length > 0\n ? advgb_block_controls_vars.controls\n : [];\n }\n\n /**\n * Check if a control is enabled\n *\n * @since 3.1.0\n * @param {string} control The use case block control. e.g. 'schedule'\n *\n * @return {bool}\n */\n const isControlEnabled = function( control ) {\n return typeof control !== 'undefined' && control;\n }\n\n /**\n * Check if at least one control is enabled per block instance\n *\n * @since 3.1.1\n * @param {string} controlAttrs Controls attributes. e.g. advgbBlockControls or props.attributes @TODO Figure out a way to NOT require controlAttrs as param due is the same always\n *\n * @return {bool}\n */\n const isAnyControlEnabledBlock = function( controlAttrs ) {\n const globalControls = getGlobalControls();\n let counter = 0;\n let blockControls = []; // Controls enabled in block instance\n\n // Get enabled global controls (in Settings)\n Object.keys(globalControls).forEach( (item) => {\n if( isControlEnabled( advgb_block_controls_vars.controls[item] ) ) {\n blockControls.push(item);\n }\n } );\n\n // Get counter for enabled controls in block instance\n blockControls.forEach( (item) => {\n if( currentControlKey( controlAttrs, item, 'enabled' ) ) {\n counter++;\n }\n } );\n\n return counter > 0 ? true : false;\n }\n\n /**\n * Check if at least one control is enabled globally (in Settings)\n *\n * @since 3.1.0\n *\n * @return {bool}\n */\n const isAnyControlEnabledGlobal = function() {\n const globalControls = getGlobalControls();\n let counter = 0;\n\n Object.keys(globalControls).map( (item) => {\n if( isControlEnabled( advgb_block_controls_vars.controls[item] ) ) {\n counter++;\n }\n } );\n\n return counter > 0 ? true : false;\n }\n\n /**\n * Return single controls array attribute value\n *\n * @since 3.1.0\n * @param {string} controlAttrs Controls attributes. e.g. advgbBlockControls or props.attributes @TODO Figure out a way to NOT require controlAttrs as param due is the same always\n * @param {string} control The use case block control. e.g. 'schedule'\n * @param {string} key The control key to check. e.g. 'enabled'\n *\n * @return {mixed}\n */\n const currentControlKey = function( controlAttrs, control, key ) {\n\n // Check if advgbBlockControls attribute exists\n const controlsAdded = typeof controlAttrs !== 'undefined' && controlAttrs.length\n ? true\n : false;\n // Check if control exists in advgbBlockControls array\n const controlExists = controlsAdded\n && controlAttrs.some( (element) => element.control === control )\n ? true\n : false;\n\n if( controlExists ) {\n const itemIndex = controlAttrs.findIndex(element => element.control === control);\n\n // No control found (this check seems not necessary but is here to prevent an unlikely error)\n if( itemIndex < 0 ) {\n return false;\n }\n\n let newArray = [...controlAttrs];\n const obj = newArray[itemIndex];\n\n return obj[key];\n }\n\n return null;\n }\n\n // Add non supported blocks according to Block controls\n if( typeof advgb_block_controls_vars !== 'undefined'\n && typeof advgb_block_controls_vars.non_supported !== 'undefined'\n && advgb_block_controls_vars.non_supported.length > 0\n ) {\n // Merge dynamically disabled blocks\n NON_SUPPORTED_BLOCKS = [...NON_SUPPORTED_BLOCKS, ...advgb_block_controls_vars.non_supported];\n // Remove duplicated values\n NON_SUPPORTED_BLOCKS = [...new Set(NON_SUPPORTED_BLOCKS)];\n }\n\n // Register block controls to blocks attributes\n addFilter( 'blocks.registerBlockType', 'advgb/blockControls', function ( settings ) {\n if ( ! NON_SUPPORTED_BLOCKS.includes( settings.name ) && isAnyControlEnabledGlobal() ) {\n settings.attributes = Object.assign( settings.attributes, {\n advgbBlockControls: {\n type: 'array',\n items: {\n type: 'object'\n },\n default: []\n }\n } );\n }\n\n return settings;\n } );\n\n const withEditControls = createHigherOrderComponent( ( BlockEdit ) => {\n\n return class BlockControlsEdit extends Component {\n\n constructor(props) {\n super(...props);\n\n this.state = {\n taxModOptions: [], // Store modified taxonomy options to decide if selected tax is for \"all terms\" or \"selected terms\"\n termOptions: [], // Store term options with slug (id) and title\n searchTermWord: '', // Updated when searching terms\n initArchive: true, // When true, trigger initArchiveControl()\n updateTaxLabels: false // When true, update taxonomy option labels\n }\n\n this.isPost = this.isPost.bind(this);\n }\n\n /**\n * Get filtered term slugs based on selected taxonomies\n *\n * @since 3.1.1\n * @param {array} taxonomies Array of taxonomies slugs\n *\n * @return {array}\n */\n getTermSlugs( taxonomies ) {\n const allTaxonomies = this.getTaxonomies();\n let terms = [];\n\n taxonomies.forEach( ( tax ) => {\n const allTaxonomies = this.getTaxonomies();\n const itemIndex = allTaxonomies.findIndex( ( element ) => element.slug === tax );\n\n allTaxonomies[itemIndex].terms.forEach( ( term ) => {\n terms.push( term.slug );\n } );\n } );\n\n return terms;\n }\n\n /**\n * Get taxonomies\n *\n * @since 3.1.1\n *\n * @return {array}\n */\n getTaxonomies() {\n return typeof advgb_block_controls_vars.taxonomies !== 'undefined'\n && advgb_block_controls_vars.taxonomies.length > 0\n ? advgb_block_controls_vars.taxonomies\n : [];\n }\n\n /**\n * Get all the available user roles from the site\n *\n * @since 3.1.0\n *\n * @return {array}\n */\n getUserRoles() {\n return typeof advgb_block_controls_vars.user_roles !== 'undefined'\n && advgb_block_controls_vars.user_roles.length > 0\n ? advgb_block_controls_vars.user_roles\n : [];\n }\n\n /**\n * Get filtered terms based on selected taxonomies\n *\n * @since 3.1.1\n * @param {array} taxonomies Taxonomies slugs\n *\n * @return {array}\n */\n getTerms( taxonomies ) {\n const allTaxonomies = this.getTaxonomies();\n let terms = [];\n\n taxonomies.forEach( ( tax ) => {\n const allTaxonomies = this.getTaxonomies();\n const itemIndex = allTaxonomies.findIndex( ( element ) => element.slug === tax );\n\n allTaxonomies[itemIndex].terms.forEach( ( term ) => {\n terms.push( {\n slug: term.slug,\n title: `${term.title} (${allTaxonomies[itemIndex].title})`\n } );\n } );\n } );\n\n return terms;\n }\n\n /**\n * Get pages\n *\n * @since 3.1.1\n *\n * @return {array}\n */\n getPages() {\n return typeof advgb_block_controls_vars.page !== 'undefined'\n && advgb_block_controls_vars.page.length > 0\n ? advgb_block_controls_vars.page\n : [];\n }\n\n /**\n * Update advgbBlockControls attribute when a key value changes\n *\n * @since 2.14.0\n * @param {string} control The use case block control. e.g. 'schedule'\n * @param {string} key The control key to modify. e.g. 'enabled'\n * @param {string} value The control key value (not required for boolean keys)\n *\n * @return {void}\n */\n changeControlKey( control, key, value = '' ) {\n const { attributes, setAttributes } = this.props;\n const { advgbBlockControls } = attributes;\n\n // Control objects to add when enabled for the first time\n const scheduleControl = {\n control: 'schedule',\n enabled: true,\n dateFrom: null,\n dateTo: null,\n recurring: false\n };\n const userRoleControl = {\n control: 'user_role',\n enabled: true,\n roles: [],\n approach: 'public'\n };\n const archiveControl = {\n control: 'archive',\n enabled: true,\n taxonomies: [],\n approach: 'exclude'\n };\n const pageControl = {\n control: 'page',\n enabled: true,\n pages: [],\n approach: 'exclude'\n };\n\n // Check if advgbBlockControls attribute exists\n const controlsAdded = typeof advgbBlockControls !== 'undefined' && advgbBlockControls.length\n ? true\n : false;\n // Check if control exists in advgbBlockControls array\n const controlExists = controlsAdded &&\n advgbBlockControls.some( (element) => element.control === control )\n ? true\n : false;\n\n if( controlExists ) {\n const itemIndex = advgbBlockControls.findIndex(element => element.control === control);\n\n // No control found (this check seems not necessary but is here to prevent an unlikely error)\n if( itemIndex < 0 ) {\n return false;\n }\n\n let newArray = [...advgbBlockControls];\n const obj = newArray[itemIndex];\n\n newArray[itemIndex] = typeof obj[key] === 'boolean'\n ? { ...newArray[itemIndex], [key]: !obj[key] }\n : { ...newArray[itemIndex], [key]: value }\n\n setAttributes( {\n advgbBlockControls: newArray\n } );\n } else if( controlsAdded && ! controlExists ) {\n\n // Add a new control object when other controls already exists\n switch( control ) {\n case 'schedule':\n setAttributes( {\n advgbBlockControls: [\n ...advgbBlockControls,\n scheduleControl\n ]\n } );\n break;\n\n case 'user_role':\n setAttributes( {\n advgbBlockControls: [\n ...advgbBlockControls,\n userRoleControl\n ]\n } );\n break;\n\n case 'archive':\n setAttributes( {\n advgbBlockControls: [\n ...advgbBlockControls,\n archiveControl\n ]\n } );\n break;\n\n case 'page':\n setAttributes( {\n advgbBlockControls: [\n ...advgbBlockControls,\n pageControl\n ]\n } );\n break;\n }\n } else {\n // Add the first control object attribute\n switch( control ) {\n case 'schedule':\n setAttributes( {\n advgbBlockControls: [ scheduleControl ]\n } );\n break;\n\n case 'user_role':\n setAttributes( {\n advgbBlockControls: [ userRoleControl ]\n } );\n break;\n\n case 'archive':\n setAttributes( {\n advgbBlockControls: [ archiveControl ]\n } );\n break;\n\n case 'page':\n setAttributes( {\n advgbBlockControls: [ pageControl ]\n } );\n break;\n }\n }\n }\n\n /**\n * Update archive control in advgbBlockControls attribute when taxonomies value changes\n *\n * @since 3.1.2\n *\n * @param {string} topic 'taxonomies' or 'terms'\n * @param {string} slugs The taxonomy slugs or term ids to insert/modify. e.g. ['category','post_tag'] or [82,161,99] or ['all_']\n *\n * @return {void}\n */\n changeArchiveControl( topic, slugs ) {\n const { attributes, setAttributes } = this.props;\n const { advgbBlockControls } = attributes;\n\n let taxArray = [];\n const controlIndex = advgbBlockControls.findIndex(element => element.control === 'archive');\n\n // No control found (this check seems not necessary but is here to prevent an unlikely error)\n if( controlIndex < 0 ) {\n return false;\n }\n\n let newArray = [...advgbBlockControls];\n\n if( topic === 'taxonomies' ) {\n\n // Check each taxonomy and its terms\n slugs.forEach( (item) => {\n\n // Get terms from current taxonomy (item)\n const taxIndex = newArray[controlIndex].taxonomies.findIndex(element => element.tax === item);\n\n if( taxIndex === -1 ) {\n\n // The last selected taxonomy\n taxArray.push( {\n tax: item,\n terms: [],\n all: true\n } );\n\n } else {\n\n // Existing taxonomy\n const terms = newArray[controlIndex].taxonomies[taxIndex].terms.length\n ? newArray[controlIndex].taxonomies[taxIndex].terms\n : [];\n const approach = terms.length ? 'select' : 'all';\n\n taxArray.push( {\n tax: item,\n terms: terms,\n all: terms.length ? false : true\n } );\n }\n } );\n\n newArray[controlIndex] = { ...newArray[controlIndex], ['taxonomies']: taxArray }\n\n setAttributes( {\n advgbBlockControls: newArray\n } );\n\n } else if( topic === 'terms' ) {\n\n let terms = {};\n const taxonomies = this.currentArchiveControl( 'taxonomies' );\n\n // Check each term id (item). slug means the id\n slugs.forEach( ( item ) => {\n\n // Find the current term in termOptions state to use its tax later\n const option = this.state.termOptions.find( el => el.slug === item);\n\n if( terms[option.tax] === undefined ) {\n terms[option.tax] = [];\n }\n\n // Get taxonomy from current term (item)\n const taxIndex = newArray[controlIndex].taxonomies.findIndex( element => element.tax === option.tax);\n\n /* Taxonomy for this term is selected? Is a bit reduntant but let's make sure\n * Then include the term.\n */\n if( taxonomies.includes( option.tax ) ) {\n terms[option.tax].push( item );\n }\n\n } );\n\n // Update taxonomies with at least one term selected\n Object.keys( terms ).forEach( (tax) => {\n\n // Get taxonomy from current tax\n const taxIndex = newArray[controlIndex].taxonomies.findIndex( element => element.tax === tax);\n\n if( taxIndex >= 0 ) {\n newArray[controlIndex].taxonomies[taxIndex] = {\n tax: tax,\n terms: terms[tax],\n all: terms[tax].length ? false : true\n };\n }\n } );\n\n // Include taxonomies with no terms selected (empty terms[option.tax] array)\n taxonomies.forEach( ( tax ) => {\n if( ! Object.keys( terms ).includes( tax ) ) {\n\n // Get taxonomy from current tax\n const taxIndex = newArray[controlIndex].taxonomies.findIndex( element => element.tax === tax);\n\n if( taxIndex >= 0 ) {\n newArray[controlIndex].taxonomies[taxIndex] = {\n tax: tax,\n terms: [],\n all: true\n };\n }\n }\n } );\n\n setAttributes( {\n advgbBlockControls: newArray\n } );\n\n } else {\n // Nothing to do here\n }\n }\n\n /**\n * Return merged taxonomies or terms\n *\n * @since 3.1.2\n *\n * @param {string} topic 'taxonomies' or 'terms'\n *\n * @return {array} An single array with all the selected terms or taxonomies ['category','post_tag'] or [99,182,42]\n */\n currentArchiveControl( topic ) {\n const { attributes, setAttributes } = this.props;\n const { advgbBlockControls } = attributes;\n\n let result = [];\n\n /* Get all the taxonomy objects.\n * e.g.\n * [\n * { \"tax\": \"post_tag\", \"terms\": [220,221]},\n * { \"tax\": \"category\", \"terms\": []}\n * ]\n */\n const taxonomies = currentControlKey( advgbBlockControls, 'archive', 'taxonomies' ).length\n ? currentControlKey( advgbBlockControls, 'archive', 'taxonomies' )\n : [];\n\n if( topic === 'taxonomies' ) {\n\n taxonomies.forEach( (item) => {\n result.push(item.tax);\n } );\n\n } else if( topic === 'terms' ) {\n\n taxonomies.forEach( (item) => {\n item.terms.forEach( ( el ) => {\n result.push( el ); // term id\n } );\n } );\n\n } else {\n // Nothing to do here\n }\n\n return result;\n }\n\n /**\n * Execute when taxonomy selection changes\n *\n * @since 3.1.1\n *\n * @return {void}\n */\n taxonomiesChanged() {\n const { attributes } = this.props;\n const { advgbBlockControls } = attributes;\n\n const currentTerms = !! currentControlKey( advgbBlockControls, 'archive', 'terms' )\n ? currentControlKey( advgbBlockControls, 'archive', 'terms' )\n : [];\n const taxonomies = !! currentControlKey( advgbBlockControls, 'archive', 'taxonomies' )\n ? currentControlKey( advgbBlockControls, 'archive', 'taxonomies' )\n : [];\n\n if( currentTerms.length ) {\n\n let result = [];\n currentTerms.forEach( ( slug ) => {\n const itemIndex = this.state.termOptions.findIndex( ( item ) => item.slug === slug );\n\n /* Get only the terms that belongs to selected taxonomies\n * and skip the ones that belongs to the deleted taxonomy\n */\n if( taxonomies.includes( this.state.termOptions[itemIndex].tax ) ) {\n result.push( this.state.termOptions[itemIndex].slug );\n }\n } );\n\n this.changeControlKey(\n 'archive',\n 'terms',\n result\n );\n }\n\n /* Remove term options from non-selected taxonomies.\n * Case scenario: the terms from the last removed taxonomy.\n */\n this.setState( {\n termOptions: this.state.termOptions.filter( (item) => {\n return this.currentArchiveControl( 'taxonomies' ).includes( item.tax );\n } )\n } );\n\n // Update tax label options to \"All terms\" or \"Selected terms\"\n this.modifyTaxLabels();\n }\n\n /**\n * Get selected terms on first load\n *\n * @since 3.1.1\n *\n * @return {void}\n */\n initArchiveControl() {\n const { advgbBlockControls } = this.props.attributes;\n\n wp.apiFetch( {\n path: wp.url.addQueryArgs(\n 'advgb/v1/terms',\n {\n taxonomies: this.currentArchiveControl( 'taxonomies' ),\n ids: this.currentArchiveControl( 'terms' )\n }\n )\n } ).then( ( list ) => {\n\n // Update tax label options to \"All terms\" or \"Selected terms\"\n this.modifyTaxLabels();\n\n this.setState( {\n termOptions: list,\n initArchive: false,\n updateTaxLabels: false\n } );\n } );\n\n\n }\n\n /**\n * Initial taxonomy labels to allow \"All terms\" \"Selected terms\" visual indicator\n *\n * @since 3.1.2\n *\n * @return {array}\n */\n iniTaxLabels() {\n\n let result = [];\n this.getTaxonomies().forEach( (item) => {\n /* Item example\n * {\n * \"slug\": \"category\",\n * \"title\": \"All Category terms\",\n * \"singular\": \"Category\"\n * }\n */\n result.push( {\n slug: item.slug,\n title: sprintf(\n __( 'All %s terms', 'advanced-gutenberg' ),\n item.title\n ),\n singular: item.title\n\n } );\n } );\n\n return result;\n }\n\n /**\n * Modify taxonomy labels. Very similar to iniTaxLabels()\n *\n * @since 3.1.2\n *\n * @return {array}\n */\n modifyTaxLabels() {\n const { advgbBlockControls } = this.props.attributes;\n\n /* Get all selected taxonomy objects.\n * e.g.\n * [\n * { \"tax\": \"post_tag\", \"terms\": [220,221]},\n * { \"tax\": \"category\", \"terms\": []}\n * ]\n */\n const taxonomies = currentControlKey( advgbBlockControls, 'archive', 'taxonomies' ).length\n ? currentControlKey( advgbBlockControls, 'archive', 'taxonomies' )\n : [];\n\n // Copy whole state\n let options = [...this.state.taxModOptions];\n\n options.forEach( (item, index) => {\n const tax = taxonomies.find( el => item.slug === el.tax );\n\n // Copy option to modify\n let option = { ...options[index] };\n // Update title value\n option.title = sprintf(\n tax === undefined || ! tax.terms.length\n ? __( 'All %s terms', 'advanced-gutenberg' )\n : __( 'Selected %s terms', 'advanced-gutenberg' ),\n option.singular\n );\n // Add option back to the state\n options[index] = option;\n } );\n\n // Save\n this.setState( {\n taxModOptions: options,\n updateTaxLabels: false\n } );\n }\n\n /**\n * Search terms based on search\n *\n * @since 3.1.1\n *\n * @return {void}\n */\n searchTerms() {\n const { termOptions, searchTermWord } = this.state;\n const { advgbBlockControls } = this.props.attributes;\n\n wp.apiFetch( {\n /*/ To get taxonomies\n path: wp.url.addQueryArgs( 'wp/v2/taxonomies', { context: 'edit' } )*/\n\n path: wp.url.addQueryArgs(\n 'advgb/v1/terms',\n {\n search: searchTermWord,\n taxonomies: this.currentArchiveControl( 'taxonomies' )\n }\n )\n\n } ).then( ( list ) => {\n\n /*/ To get taxonomies\n Object.keys(list).forEach( (item) => {\n options.push( {\n label: list[item].name,\n value: list[item].slug\n } );\n });*/\n\n // Merge selected terms with results from fetch\n let options = [ ...termOptions, ...list ];\n\n // Remove duplicated values\n options = Array.from( new Set( options.map( a => a.slug ) ) )\n .map( slug => {\n return options.find( a => a.slug === slug )\n });\n\n this.setState( {\n termOptions: options\n } );\n } );\n }\n\n /**\n * Check if we're in post edit screen\n *\n * @since 3.1.2\n *\n * @return {bool}\n */\n isPost() {\n return wp.data.select('core/editor') && wp.data.select('core/editor').getCurrentPostId();\n }\n\n /**\n * Get the timezone label from site settings stored in advgbBlocks object\n *\n * @since 3.1.4\n *\n * @return {bool}\n */\n getTimezoneLabel() {\n return typeof advgbBlocks.timezone !== 'undefined' && advgbBlocks.timezone.length\n ? advgbBlocks.timezone.replace(/_/g, ' ')\n : __( 'WordPress settings timezone', 'advanced-gutenberg' )\n }\n\n /**\n * Get the timezone slug from site settings stored in advgbBlocks object\n *\n * @since 3.1.4\n *\n * @return {bool}\n */\n getTimezoneSlug() {\n return typeof advgbBlocks.timezone !== 'undefined' && advgbBlocks.timezone.length\n ? advgbBlocks.timezone\n : 'UTC'\n }\n\n componentDidMount() {\n this.setState( {\n taxModOptions: this.iniTaxLabels()\n } );\n }\n\n componentDidUpdate(prevProps, prevState) {\n const { attributes, isSelected, name } = this.props;\n const { advgbBlockControls } = attributes;\n const { advgbBlockControls: prevBlockControls } = prevProps.attributes;\n const { searchTermWord, initArchive } = this.state;\n const { searchTermWord: prevTermWord } = prevState;\n\n // Get human readable selected terms on block selection the first time\n if( ! this.isPost()\n && ! NON_SUPPORTED_BLOCKS.includes( name )\n && isSelected\n && initArchive\n && isControlEnabled( advgb_block_controls_vars.controls.archive )\n && currentControlKey( advgbBlockControls, 'archive', 'enabled' )\n && this.currentArchiveControl( 'taxonomies' ).length\n && this.currentArchiveControl( 'terms' ).length\n ) {\n this.initArchiveControl();\n }\n\n // Search terms\n if( searchTermWord !== prevTermWord && searchTermWord.length > 2 ) {\n this.searchTerms();\n }\n\n // Update available terms and remove terms which taxonomy has been removed\n if( ! this.isPost()\n && isControlEnabled( advgb_block_controls_vars.controls.archive )\n && currentControlKey( advgbBlockControls, 'archive', 'enabled' )\n && (\n currentControlKey( prevBlockControls, 'archive', 'taxonomies' ) !== currentControlKey( advgbBlockControls, 'archive', 'taxonomies' ) // This trigger works when taxo changes, but not terms\n || this.state.updateTaxLabels // Trigger when terms changes\n )\n ) {\n this.taxonomiesChanged();\n }\n }\n\n render() {\n const { attributes, setAttributes } = this.props;\n const { advgbBlockControls } = attributes;\n\n return ( [\n this.props.isSelected && ( ! NON_SUPPORTED_BLOCKS.includes( this.props.name ) )\n && isAnyControlEnabledGlobal() &&\n \n \n { isControlEnabled( advgb_block_controls_vars.controls.schedule ) && (\n \n this.changeControlKey( 'schedule', 'enabled' ) }\n />\n { currentControlKey( advgbBlockControls, 'schedule', 'enabled' ) && (\n \n
\n this.changeControlKey( 'schedule', 'dateFrom', newDate ) }\n onDateClear={ () => this.changeControlKey( 'schedule', 'dateFrom', null ) }\n onInvalidDate={ false }\n />\n this.changeControlKey( 'schedule', 'dateTo', newDate ) }\n onDateClear={ () => this.changeControlKey( 'schedule', 'dateTo', null ) }\n onInvalidDate={ ( date ) => {\n // Disable all dates before dateFrom\n if( currentControlKey( advgbBlockControls, 'schedule', 'dateFrom' ) ) {\n let thisDate = new Date(date.getTime());\n thisDate.setHours(0, 0, 0, 0);\n let fromDate = new Date( currentControlKey( advgbBlockControls, 'schedule', 'dateFrom' ) );\n fromDate.setHours(0, 0, 0, 0);\n return thisDate.getTime() < fromDate.getTime();\n }\n } }\n />\n { ( currentControlKey( advgbBlockControls, 'schedule', 'dateFrom' ) > currentControlKey( advgbBlockControls, 'schedule', 'dateTo' ) ) &&\n \n { __( '\"Stop showing\" date should be after \"Start showing\" date!', 'advanced-gutenberg' ) }\n \n }\n { currentControlKey( advgbBlockControls, 'schedule', 'dateFrom' ) && currentControlKey( advgbBlockControls, 'schedule', 'dateTo' ) &&\n this.changeControlKey( 'schedule', 'recurring' ) }\n help={ __( 'If Recurring is enabled, this block will be displayed every year between the selected dates.', 'advanced-gutenberg' ) }\n />\n }\n this.changeControlKey( 'schedule', 'days', value ) }\n />\n \n this.changeControlKey(\n 'schedule',\n 'timeFrom',\n newTime\n )\n }\n onTimeClear={ () => this.changeControlKey( 'schedule', 'timeFrom', null ) }\n />\n this.changeControlKey(\n 'schedule',\n 'timeTo',\n newTime\n )\n }\n onTimeClear={ () => this.changeControlKey( 'schedule', 'timeTo', null ) }\n />\n { (\n currentControlKey( advgbBlockControls, 'schedule', 'timeFrom' )\n && currentControlKey( advgbBlockControls, 'schedule', 'timeTo' )\n && (\n '01/01/2020T' + currentControlKey( // We append a dummy date to make a datetime comparison\n advgbBlockControls, 'schedule', 'timeFrom'\n ) >= '01/01/2020T' + currentControlKey( // We append a dummy date to make a datetime comparison\n advgbBlockControls, 'schedule', 'timeTo'\n )\n )\n ) &&\n \n { __( '\"To\" time should be after \"From\" time!', 'advanced-gutenberg' ) }\n \n }\n { (\n (\n currentControlKey( advgbBlockControls, 'schedule', 'timeFrom' )\n && ! currentControlKey( advgbBlockControls, 'schedule', 'timeTo' )\n ) || (\n ! currentControlKey( advgbBlockControls, 'schedule', 'timeFrom' )\n && currentControlKey( advgbBlockControls, 'schedule', 'timeTo' )\n )\n ) &&\n \n { __( 'Please choose \"From\" time and \"To\" time.', 'advanced-gutenberg' ) }\n \n }\n this.changeControlKey( 'schedule', 'timezone', value ) }\n />\n
\n
\n ) }\n
\n ) }\n { isControlEnabled( advgb_block_controls_vars.controls.user_role ) && (\n \n this.changeControlKey( 'user_role', 'enabled' ) }\n />\n { currentControlKey( advgbBlockControls, 'user_role', 'enabled' ) && (\n \n
\n this.changeControlKey( 'user_role', 'approach', value ) }\n />\n
\n { ( currentControlKey( advgbBlockControls, 'user_role', 'approach' ) === 'include' ||\n currentControlKey( advgbBlockControls, 'user_role', 'approach' ) === 'exclude'\n ) && (\n \n {\n this.changeControlKey( 'user_role', 'roles', getOptionSlugs( value, this.getUserRoles() ) )\n } }\n __experimentalExpandOnFocus\n />\n { ( currentControlKey( advgbBlockControls, 'user_role', 'approach' ) === 'include' ||\n currentControlKey( advgbBlockControls, 'user_role', 'approach' ) === 'exclude'\n )\n && ! currentControlKey( advgbBlockControls, 'user_role', 'roles' ).length && (\n \n {\n __(\n 'Please select at least one user role.',\n 'advanced-gutenberg'\n )\n }\n \n ) }\n \n ) }\n
\n ) }\n
\n ) }\n { ! this.isPost() && ( // Disabled in post edit\n \n { isControlEnabled( advgb_block_controls_vars.controls.archive ) && (\n \n this.changeControlKey( 'archive', 'enabled' ) }\n />\n { currentControlKey( advgbBlockControls, 'archive', 'enabled' ) && (\n \n
\n this.changeControlKey( 'archive', 'approach', value ) }\n />\n
\n {\n this.changeArchiveControl(\n 'taxonomies',\n getOptionSlugs( value, this.state.taxModOptions || this.getTaxonomies() )\n );\n } }\n __experimentalExpandOnFocus\n />\n { ( currentControlKey( advgbBlockControls, 'archive', 'taxonomies' ).length > 0 ) && (\n \n {\n this.changeArchiveControl(\n 'terms',\n getOptionSlugs(\n value,\n this.state.termOptions\n )\n );\n this.setState( {\n updateTaxLabels: true\n } );\n } }\n onInputChange={ ( value ) => {\n this.setState( {\n searchTermWord: value\n } );\n } }\n __experimentalShowHowTo={ false }\n />\n
\n { __(\n 'Use this filter to apply only to some terms.',\n 'advanced-gutenberg'\n ) }\n
\n
\n ) }\n
\n ) }\n
\n ) }\n\n { isControlEnabled( advgb_block_controls_vars.controls.page ) && (\n \n this.changeControlKey( 'page', 'enabled' ) }\n />\n { currentControlKey( advgbBlockControls, 'page', 'enabled' ) && (\n \n
\n this.changeControlKey( 'page', 'approach', value ) }\n />\n
\n { ( currentControlKey( advgbBlockControls, 'page', 'approach' ) === 'include' ||\n currentControlKey( advgbBlockControls, 'page', 'approach' ) === 'exclude'\n ) && (\n {\n this.changeControlKey( 'page', 'pages', getOptionSlugs( value, this.getPages() ) )\n } }\n __experimentalExpandOnFocus\n />\n ) }\n
\n ) }\n
\n ) }\n
\n ) }\n \n
,\n ,\n ] )\n }\n }\n }, 'withEditControls' );\n\n // Add option to add controls for supported blocks\n addFilter( 'editor.BlockEdit', 'advgb/addBlockControls', withEditControls );\n\n const withAttributes = createHigherOrderComponent( ( BlockListBlock ) => {\n return ( props ) => {\n if ( ( !NON_SUPPORTED_BLOCKS.includes( props.name ) ) && hasBlockSupport( props.name, 'advgb/blockControls', true ) && isAnyControlEnabledGlobal() ) {\n const { advgbBlockControls } = props.attributes;\n const advgbBcClass = props.isSelected === false\n && isAnyControlEnabledBlock( advgbBlockControls )\n ? 'advgb-bc-editor-preview' : '';\n\n return ;\n }\n\n return ;\n };\n }, 'withAttributes' );\n\n // Apply attributes and CSS classes on backend\n addFilter( 'editor.BlockListBlock', 'advgb/loadBackendBlockControls', withAttributes );\n\n})( wp.i18n, wp.hooks, wp.blocks, wp.blockEditor, wp.components, wp.compose, wp.element );\n"],"sourceRoot":""} \ No newline at end of file diff --git a/src/assets/blocks/blocks.js b/src/assets/blocks/blocks.js index abf277c4c..22bd60455 100644 --- a/src/assets/blocks/blocks.js +++ b/src/assets/blocks/blocks.js @@ -1,15 +1,31869 @@ -!function(e){var t={};function a(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=6)}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdvColorControl=function(e){var t=wp.components,a=t.ColorIndicator,n=t.BaseControl,r=(wp.blockEditor||wp.editor).ColorPalette,o=n.VisualLabel?n.VisualLabel:"span",l=e.label,c=e.value,i=e.onChange;return React.createElement(n,{className:"editor-color-palette-control block-editor-color-palette-control"},React.createElement(o,{className:"components-base-control__label"},l,c&&React.createElement(a,{colorValue:c})),React.createElement(r,{className:"editor-color-palette-control__color-palette block-editor-color-palette-control__color-palette",value:c,onChange:i}))}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a-1})).map((function(t,a){var r=["material-icons",""!==o&&"-"+o].filter(Boolean).join("");return React.createElement("div",{className:"advgb-icon-item",key:a},React.createElement("span",{onClick:function(){e.setState({selectedIcon:t})},className:t===n&&"active",title:t},React.createElement("i",{className:r},t)))})))),React.createElement("div",{className:"popup-footer"},React.createElement("button",{disabled:""===n,className:i,onClick:function(){e.props.onSelectIcon(n),e.props.onSelectIconTheme(o),e.props.closePopup()}},r("Apply","advanced-gutenberg")))))))}}]),t}(l);t.default=u},function(e,t,a){var n=a(3),r=/-([a-z])/g,o=/^--[a-zA-Z0-9-]+$|^[^-]+$/;var l=n.version.split(".")[0]>=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:l,camelCase:function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");return o.test(e)?e:e.toLowerCase().replace(r,(function(e,t){return t.toUpperCase()}))},invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var a,n,r="function"==typeof t,o={},l={};for(a in e)n=e[a],r&&(o=t(a,n))&&2===o.length?l[o[0]]=o[1]:"string"==typeof n&&(l[n]=a);return l},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}}},function(e,t,a){"use strict";e.exports=a(26)},function(e,t,a){for(var n,r=a(30).CASE_SENSITIVE_TAG_NAMES,o={},l=0,c=r.length;l=0||Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}(e,["label","noOptionLabel","categoriesList","selectedCategoryId","onChange"]),d=b(n);return React.createElement(i,r({label:t,noOptionLabel:a,onChange:l},{tree:d,selectedId:o},c))}var p=void 0!==advgbBlocks.pp_series_post_types?advgbBlocks.pp_series_post_types:["post"];t.default=function(e){var t=e.categoriesList,a=e.selectedCategoryId,r=e.numberOfItems,l=e.order,c=e.orderBy,i=e.postType,u=e.maxItems,g=void 0===u?100:u,b=e.minItems,v=void 0===b?1:b,f=e.onCategoryChange,h=e.onNumberOfItemsChange,y=e.onOrderChange,A=e.onOrderByChange,E=[{label:o("Created: Newest to oldest","advanced-gutenberg"),value:"date/desc"},{label:o("Created: Oldest to newest","advanced-gutenberg"),value:"date/asc"},{label:o("A → Z","advanced-gutenberg"),value:"title/asc"},{label:o("Z → A","advanced-gutenberg"),value:"title/desc"},{label:o("Author","advanced-gutenberg")+" "+o("A → Z","advanced-gutenberg"),value:"author/asc"},{label:o("Author","advanced-gutenberg")+" "+o("Z → A","advanced-gutenberg"),value:"author/desc"},{label:o("Modified: Newest to oldest","advanced-gutenberg"),value:"modified/desc"},{label:o("Modified: Oldest to newest","advanced-gutenberg"),value:"modified/asc"},{label:o("Post ID Descending","advanced-gutenberg"),value:"id/desc"},{label:o("Post ID Ascending","advanced-gutenberg"),value:"id/asc"}];return"post"!==i&&"page"!==i||(E=_.union(E,[{label:o("Randomize","advanced-gutenberg"),value:"rand/asc"}])),"post"===i&&(E=_.union(E,[{label:o("Comments, decreasing order","advanced-gutenberg"),value:"comment_count/desc"},{label:o("Comments, increasing order","advanced-gutenberg"),value:"comment_count/asc"}])),void 0!==advgbBlocks.pp_series_active&&parseInt(advgbBlocks.pp_series_active)&&p.includes(i)&&(E=_.union(E,[{label:o("Series order","advanced-gutenberg"),value:"series_order/asc"}])),[y&&A&&React.createElement(d,{key:"query-controls-order-select",label:o("Order by","advanced-gutenberg"),value:c+"/"+l,options:E,onChange:function(e){var t=e.split("/"),a=n(t,2),r=a[0],o=a[1];o!==l&&y(o),r!==c&&A(r)}}),t&&f&&React.createElement(m,{key:"query-controls-category-select",categoriesList:t,label:o("Category","advanced-gutenberg"),noOptionLabel:o("All","advanced-gutenberg"),selectedCategoryId:a,onChange:f}),h&&React.createElement(s,{key:"query-controls-range-control",label:o("Number of items","advanced-gutenberg"),value:r,onChange:h,min:v,max:g,required:!0})]},t.AuthorSelect=function(e){var t=e.label,a=e.noOptionLabel,n=e.authorList,o=e.selectedAuthorId,l=e.onChange,c=b(n);return React.createElement(i,r({label:t,noOptionLabel:a,onChange:l},{tree:c,selectedId:o}))}},function(e,t,a){a(0),a(7),a(1),a(9),a(10),a(11),a(12),a(13),a(14),a(15),a(16),a(31),a(32),a(33),a(34),a(35),a(36),a(37),a(38),a(39),a(40),a(41),a(42),a(43),a(44),a(45),a(46),a(5),a(47),a(48),a(49),a(51),a(52),e.exports=a(53)},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a11?"pm":"am",onInit:!1})}},{key:"componentDidUpdate",value:function(e,t){var a=this.props,n=(a.onChangeTime,a.currentTime,this.state),r=n.hours,o=n.minutes,l=n.meridian,i=t.hours,d=t.minutes,s=t.meridian;if(r!==i||o!==d||l!==s){if(!r&&!o)return;r&&!o&&this.setState({minutes:"00"}),o&&!r&&this.setState({hours:"01"});var u=this.appendZero(c.default.to24Hour({hour:parseInt(r),meridiem:l}))+":"+o+":00";this.props.onChangeTime(u)}}},{key:"appendZero",value:function(e){if(!isNaN(e)){var t=parseInt(e);return t>9?t:"0"+t}}},{key:"render",value:function(){var e=this,t=this.state,a=(t.onChangeTime,t.currentTime,t.hours),n=t.minutes,r=t.meridian;return React.createElement(A,null,React.createElement("div",{className:"advgb-advtime-control"},React.createElement("label",null,this.props.label),React.createElement("div",{className:"advgb-advtime-hours-minutes"},React.createElement("input",{type:"text",value:a?this.appendZero(c.default.to12Hour(parseInt(a)).hour):"",onChange:function(t){var a=Math.max(1,Math.min(12,Number(t.target.value)));e.setState({hours:e.appendZero(a)})},onKeyDown:function(t){var a=Number(t.target.value);"ArrowUp"===t.key&&a<12?e.setState({hours:e.appendZero(a+1)}):"ArrowDown"===t.key&&a>1&&e.setState({hours:e.appendZero(a-1)})},placeholder:"--"}),React.createElement("span",null,":"),React.createElement("input",{type:"text",value:n||"",onChange:function(t){var a=Math.max(0,Math.min(59,Number(t.target.value)));e.setState({minutes:e.appendZero(a)})},onKeyDown:function(t){var a=Number(t.target.value);"ArrowUp"===t.key&&a<59?e.setState({minutes:e.appendZero(a+1)}):"ArrowDown"===t.key&&a>0&&e.setState({minutes:e.appendZero(a-1)})},placeholder:"--"})),React.createElement(s,{className:"advgb-advtime-meridian"},React.createElement(u,{variant:null===r||"am"===r?"primary":"secondary",onClick:function(){e.setState({meridian:"am"})},disabled:!a||!n},R("AM","advanced-gutenberg")),React.createElement(u,{variant:"pm"===r?"primary":"secondary",onClick:function(){e.setState({meridian:"pm"})},disabled:!a||!n},R("PM","advanced-gutenberg"))),a&&n&&React.createElement(u,{className:"advgb-advtime-remove-icon",icon:"no-alt",onClick:function(){e.props.onTimeClear(),e.setState({hours:null,minutes:null,meridian:"am"})}})))}}]),t}(y);t.default=x},function(e,t,a){"use strict";e.exports={to12Hour:function(e){var t=e<12?"am":"pm";return{hour:(e+11)%12+1,meridiem:t,meridian:t}},to24Hour:function(e){return("am"===(e.meridiem||e.meridian)?0:12)+e.hour%12}}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.getOptionSuggestions=function(e){return e.map((function(e){return e.title}))},t.getOptionTitles=function(e,t){var a=[];return null!==t&&(a=e.map((function(e){var a=t.find((function(t){return t.slug===e}));return void 0!==a&&a?a.title:e}))),a},t.getOptionSlugs=function(e,t){var a=[];return e.map((function(e){var n=t.find((function(t){return t.title===e}));void 0!==n&&a.push(n.slug)})),a}},function(e,t,a){"use strict";var n=Object.assign||function(e){for(var t=1;t-1,ie=i.indexOf("-outlined")>-1,de=i.indexOf("-squared-outline")>-1,se=[{label:g("Background Color","advanced-gutenberg"),value:W,onChange:function(e){return r({hoverBgColor:void 0===e?"#2196f3":e})}},{label:g("Text Color","advanced-gutenberg"),value:U,onChange:function(e){return r({hoverTextColor:void 0===e?"#fff":e})}},{label:g("Shadow Color","advanced-gutenberg"),value:Z,onChange:function(e){return r({hoverShadowColor:void 0===e?"#ccc":e})}}];de?(se.shift(),T="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAABoCAYAAADYQu11AAAE1ElEQVR4nO3d4VHrOhCG4T13bgO0EErYlHAoIZSQlEBKgBJICaSEnBJQCaSFlHDPiLuZ8YhVbDkOTLLvM8OfYBJs9FnSWjYCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAmH5Nudeq+h/tCJhOSmmSjP7D3wS4ff9eaA8nHSkAAU06OqZHBwIg6EAABB0IgKADARB0IACCDgRA0IEACDoQAEEHAiDoQAAEHQiAoAMBEHQgAIIOBEDQgQAIOhAAQQcCIOhAAAQdCICgAwEQdCCASz0F9toMfeLmQUReRGSfUtrWNlLVnYj8Ll5+SCn9OfEzTyLyXLy8Tim92PdnIvJx5nH9k1J6UNVXEVme+V59+5P3X+1zZsW387FLIrJJKR2GfFjxPwP29vn7YhvvR/Mx637+2v6GoRD0NnfHMKpqbqiPZWOLzgL+bCGvWdjXs6pu7IQ2KPAmB/dNRObRj/dQDN3Hyw15p6p317oDU1PVHPBdT8hLucf/sBNEC1XVt2s6Pj+JoFfkf4XT/bLeIxVbzyYYAt8Emw48jdyXOztptpwgsoVNedCDoftAKaWkqmvrsboW3zHnsynCl/+AU5m7f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Hbl9X5XfjfHNIwc85votrsPX4PyJID1AO4CcHME2yZCfwPY4R799AWfXhXrUSnDKyd58Da6D7d3DYBVAPoB3AaAbwGYxTcBWT8aS8QNif3tPofda5I4ZfUX9x4DdSKLiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIjUG4D/AWML67DzayWbAAAAAElFTkSuQmCC";var ue=["material-icons",""!==ne&&"-"+ne].filter(Boolean).join("");return le?React.createElement("img",{alt:g("Advanced Button","advanced-gutenberg"),width:"100%",src:T}):React.createElement(m,null,React.createElement("span",{className:i+" align"+u,style:{display:"inline-block"}},React.createElement("span",{className:"wp-block-advgb-button_link "+s,rel:S(n)},$&&React.createElement("i",{className:ue},ee),React.createElement(y,{tagName:"span",placeholder:g("Add text…","advanced-gutenberg"),value:v,onChange:function(e){return r({text:e})},allowedFormats:["core/bold","core/italic","core/strikethrough"],isSelected:o,keepPlaceholderOnFocus:!0}))),React.createElement("style",null,"."+s+" {\n font-size: "+P+"px;\n color: "+I+" !important;\n background-color: "+f+" !important;\n margin: "+N+"px "+O+"px "+H+"px "+D+"px;\n padding: "+z+"px "+L+"px "+j+"px "+M+"px;\n border-width: "+Q+"px !important;\n border-color: "+V+" !important;\n border-radius: "+F+"px !important;\n border-style: "+X+" "+("none"!==X&&"!important")+";\n }\n ."+s+":hover {\n color: "+U+" !important;\n background-color: "+W+" !important;\n box-shadow: "+q+"px "+G+"px "+Y+"px "+K+"px "+Z+";\n transition: all "+_+"s ease;\n opacity: "+J/100+"\n }\n ."+s+" i {\n font-size: "+te+"px;\n float: "+re+";\n }",ae&&"."+s+" i {\n color: "+ae+";\n }","left"===re&&"."+s+" i {\n margin-right: "+oe+"px;\n }","right"===re&&"."+s+" i {\n margin-left: "+oe+"px;\n }","1"!==advgbBlocks.advgb_pro&&"."+s+" i {\n display: none !important;\n }"),d?React.createElement(c.IconListPopupHook,{content:"iconpopup",closePopup:function(){d&&e.togglePopup()},onSelectIcon:this.handleIcon,onSelectIconTheme:this.handleIconTheme,selectedIcon:ee,selectedIconTheme:ne}):null,React.createElement(h,null,React.createElement(w,{title:g("Button link","advanced-gutenberg")},React.createElement(C,{label:[g("Link URL","advanced-gutenberg"),b&&React.createElement("a",{href:b||"#",key:"link_url",target:"_blank",style:{float:"right"}},g("Preview","advanced-gutenberg"))]},React.createElement(E,{value:b,onChange:function(e){return r({url:e})},autoFocus:!1,isFullWidth:!0,hasBorder:!0})),React.createElement(k,{label:g("Open in new tab","advanced-gutenberg"),checked:!!p,onChange:function(){return r({urlOpenNewTab:!n.urlOpenNewTab})}})),React.createElement(w,{title:g("Text/Color","advanced-gutenberg")},React.createElement(R,{label:g("Text size","advanced-gutenberg"),value:P||"",onChange:function(e){return r({textSize:e})},min:10,max:100,beforeIcon:"editor-textcolor",allowReset:!0}),!ie&&React.createElement(l.AdvColorControl,{label:g("Background Color","advanced-gutenberg"),value:f,onChange:function(e){return r({bgColor:e})}}),React.createElement(l.AdvColorControl,{label:g("Text Color","advanced-gutenberg"),value:I,onChange:function(e){return r({textColor:e})}})),React.createElement(w,{title:g("Border","advanced-gutenberg"),initialOpen:!1},!ce&&React.createElement(R,{label:g("Border radius","advanced-gutenberg"),value:F||"",onChange:function(e){return r({borderRadius:e})},min:0,max:100}),React.createElement(x,{label:g("Border style","advanced-gutenberg"),value:X,options:t,onChange:function(e){return r({borderStyle:e})}}),"none"!==X&&React.createElement(m,null,React.createElement(A,{title:g("Border Color","advanced-gutenberg"),initialOpen:!1,colorSettings:[{label:g("Border Color","advanced-gutenberg"),value:V,onChange:function(e){return r({borderColor:void 0===e?"#2196f3":e})}}]}),React.createElement(R,{label:g("Border width","advanced-gutenberg"),value:Q||"",onChange:function(e){return r({borderWidth:e})},min:0,max:100}))),React.createElement(w,{title:g("Margin","advanced-gutenberg"),initialOpen:!1},React.createElement(R,{label:g("Margin top","advanced-gutenberg"),value:N||"",onChange:function(e){return r({marginTop:e})},min:0,max:100}),React.createElement(R,{label:g("Margin right","advanced-gutenberg"),value:O||"",onChange:function(e){return r({marginRight:e})},min:0,max:100}),React.createElement(R,{label:g("Margin bottom","advanced-gutenberg"),value:H||"",onChange:function(e){return r({marginBottom:e})},min:0,max:100}),React.createElement(R,{label:g("Margin left","advanced-gutenberg"),value:D||"",onChange:function(e){return r({marginLeft:e})},min:0,max:100})),React.createElement(w,{title:g("Padding","advanced-gutenberg"),initialOpen:!1},React.createElement(R,{label:g("Padding top","advanced-gutenberg"),value:z||"",onChange:function(e){return r({paddingTop:e})},min:0,max:100}),React.createElement(R,{label:g("Padding right","advanced-gutenberg"),value:L||"",onChange:function(e){return r({paddingRight:e})},min:0,max:100}),React.createElement(R,{label:g("Padding bottom","advanced-gutenberg"),value:j||"",onChange:function(e){return r({paddingBottom:e})},min:0,max:100}),React.createElement(R,{label:g("Padding left","advanced-gutenberg"),value:M||"",onChange:function(e){return r({paddingLeft:e})},min:0,max:100})),React.createElement(w,{title:g("Hover","advanced-gutenberg"),initialOpen:!1},React.createElement(A,{title:g("Color Settings","advanced-gutenberg"),initialOpen:!1,colorSettings:se}),React.createElement(w,{title:g("Shadow","advanced-gutenberg"),initialOpen:!1},React.createElement(R,{label:g("Opacity (%)","advanced-gutenberg"),value:J,onChange:function(e){return r({hoverOpacity:e})},min:0,max:100}),React.createElement(R,{label:g("Transition speed (ms)","advanced-gutenberg"),value:_||"",onChange:function(e){return r({transitionSpeed:e})},min:0,max:3e3}),React.createElement(R,{label:g("Shadow H offset","advanced-gutenberg"),value:q||"",onChange:function(e){return r({hoverShadowH:e})},min:-50,max:50}),React.createElement(R,{label:g("Shadow V offset","advanced-gutenberg"),value:G||"",onChange:function(e){return r({hoverShadowV:e})},min:-50,max:50}),React.createElement(R,{label:g("Shadow blur","advanced-gutenberg"),value:Y||"",onChange:function(e){return r({hoverShadowBlur:e})},min:0,max:50}),React.createElement(R,{label:g("Shadow spread","advanced-gutenberg"),value:K||"",onChange:function(e){return r({hoverShadowSpread:e})},min:0,max:50}))),"1"===advgbBlocks.advgb_pro&&React.createElement(m,null,React.createElement(w,{title:g("Icon","advanced-gutenberg"),initialOpen:!1,className:"advgb-pro-icon"},React.createElement(k,{label:g("Display icon","advanced-gutenberg"),checked:$,onChange:function(){return r({iconDisplay:!$})},className:"advgb-child-toggle"}),$&&React.createElement(m,null,React.createElement(C,{label:g("Icon Library (Material Icon)","advanced-gutenberg")},React.createElement(B,{className:"button button-large advgb-browse-icon-btn",onClick:function(){d||e.togglePopup()}},g("Icon Selection","advanced-gutenberg"))),React.createElement(R,{label:g("Icon Size (px)","advanced-gutenberg"),value:te,min:1,max:200,onChange:function(e){return r({iconSize:e})}}),React.createElement(l.AdvColorControl,{label:g("Icon Color","advanced-gutenberg"),value:ae,onChange:function(e){return r({iconColor:e})}}),React.createElement(x,{label:g("Icon Position","advanced-gutenberg"),value:re,options:[{label:g("Left","advanced-gutenberg"),value:"left"},{label:g("Right","advanced-gutenberg"),value:"right"}],onChange:function(e){return r({iconPosition:e})}}),React.createElement(R,{label:g("Icon Spacing (px)","advanced-gutenberg"),value:oe,min:0,max:100,help:g("Spacing between icon and text","advanced-gutenberg"),onChange:function(e){return r({iconSpacing:e})}}))))))}}]),t}(b),P=React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"2 2 22 22"},React.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),React.createElement("path",{d:"M19 7H5c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zm0 8H5V9h14v6z"})),N={id:{type:"string"},url:{type:"string"},urlOpenNewTab:{type:"boolean",default:!0},title:{type:"string"},text:{selector:"a",default:"PUSH THE BUTTON"},bgColor:{type:"string"},textColor:{type:"string"},textSize:{type:"number",default:18},marginTop:{type:"number",default:0},marginRight:{type:"number",default:0},marginBottom:{type:"number",default:0},marginLeft:{type:"number",default:0},paddingTop:{type:"number",default:10},paddingRight:{type:"number",default:30},paddingBottom:{type:"number",default:10},paddingLeft:{type:"number",default:30},borderWidth:{type:"number",default:1},borderColor:{type:"string"},borderStyle:{type:"string",default:"none"},borderRadius:{type:"number",default:50},hoverTextColor:{type:"string"},hoverBgColor:{type:"string"},hoverShadowColor:{type:"string",default:"#ccc"},hoverShadowH:{type:"number",default:1},hoverShadowV:{type:"number",default:1},hoverShadowBlur:{type:"number",default:12},hoverShadowSpread:{type:"number",default:0},hoverOpacity:{type:"number",default:100},transitionSpeed:{type:"number",default:200},align:{type:"string",default:"none"},iconDisplay:{type:"boolean",default:!1},icon:{type:"string",default:"insert_link"},iconSize:{type:"number",default:30},iconColor:{type:"string"},iconTheme:{type:"string",default:"outlined"},iconPosition:{type:"string",default:"left"},iconSpacing:{type:"number",default:7},noreferrer:{type:"boolean",default:!0},nofollow:{type:"boolean",default:!1},changed:{type:"boolean",default:!1},isPreview:{type:"boolean",default:!1}};p("advgb/button",{title:g("Button - PublishPress","advanced-gutenberg"),description:g("Button block with more options and styles.","advanced-gutenberg"),icon:{src:P,foreground:"undefined"!=typeof advgbBlocks?advgbBlocks.color:void 0},category:"advgb-category",keywords:[g("button","advanced-gutenberg"),g("advanced button","advanced-gutenberg"),g("link","advanced-gutenberg")],attributes:N,example:{attributes:{isPreview:!0}},transforms:{from:[{type:"block",blocks:["core/button"],transform:function(e){return v("advgb/button",n({},e,{bgColor:e.color}))}}],to:[{type:"block",blocks:["core/button"],transform:function(e){return v("core/button",n({},e,{color:e.bgColor}))}}]},styles:[{name:"default",label:g("Default","advanced-gutenberg"),isDefault:!0},{name:"outlined",label:g("Outlined","advanced-gutenberg")},{name:"squared",label:g("Squared","advanced-gutenberg")},{name:"squared-outline",label:g("Squared Outline","advanced-gutenberg")}],supports:{anchor:!0,align:["right","left","center","full"]},edit:I,save:function(e){var t=e.attributes,a=t.id,n=t.align,r=t.url,o=t.urlOpenNewTab,l=t.title,c=t.text,i=t.iconDisplay,d=t.icon,s=(t.iconSize,t.iconColor,t.iconTheme),u=(t.iconPosition,t.iconSpacing,t.noreferrer,t.nofollow,["material-icons",""!==s&&"-"+s].filter(Boolean).join(""));return React.createElement("div",{className:"align"+n},React.createElement("a",{className:"wp-block-advgb-button_link "+a,href:r||"#",title:l,target:o?"_blank":"_self",rel:"noopener "+S(t)},i&&React.createElement("i",{className:u},d),React.createElement(y.Content,{tagName:"span",value:c})))},getEditWrapperProps:function(e){var t=e.align,a={"data-resized":!0};return"left"!==t&&"right"!==t&&"center"!==t||(a["data-align"]=t),a},deprecated:[{attributes:n({},N,{text:{source:"children",selector:"a",default:"PUSH THE BUTTON"}}),supports:{anchor:!0,align:["right","left","center","full"]},save:function(e){var t=e.attributes,a=t.id,n=t.align,r=t.url,o=t.urlOpenNewTab,l=t.title,c=t.text;t.icon,t.iconSize,t.iconColor,t.iconTheme;return React.createElement("div",{className:"align"+n},React.createElement(y.Content,{tagName:"a",className:"wp-block-advgb-button_link "+a,href:r||"#",title:l,target:o?"_blank":"_self",value:c,rel:"noopener noreferrer"}))}},{attributes:n({},N,{transitionSpeed:{type:"number",default:.2}}),migrate:function(e){var t=1e3*e.transitionSpeed;return n({},e,{transitionSpeed:t})},save:function(e){var t=e.attributes,a=t.id,n=t.align,r=t.url,o=t.urlOpenNewTab,l=t.title,c=t.text;return React.createElement("div",{className:"align"+n},React.createElement(y.Content,{tagName:"a",className:"wp-block-advgb-button_link "+a,href:r||"#",title:l,target:o?"_blank":"_self",value:c,rel:"noopener noreferrer"}))}}]})}(wp.i18n,wp.blocks,wp.element,wp.blockEditor,wp.components)},function(e,t,a){"use strict";var n=Object.assign||function(e){for(var t=1;td)&&React.createElement(p,null,React.createElement(R,{title:b("Icon "+I+" Settings","advanced-gutenberg"),initialOpen:!1},React.createElement(C,{label:b("Icon Library (Material Icon)","advanced-gutenberg")},React.createElement(B,{className:"button button-large advgb-browse-image-btn","data-currentItem":a,onClick:function(t){m||(e.togglePopup(),e.setState({currentItem:t.target.attributes.getNamedItem("data-currentItem").value}))}},b("Icon Selection","advanced-gutenberg"))),React.createElement(k,{label:b("Icon Style","advanced-gutenberg"),value:t.style,options:[{label:b("Default","advanced-gutenberg"),value:"default"},{label:b("Stacked","advanced-gutenberg"),value:"stacked"}],onChange:function(t){return e.updateItems(a,{style:t})}}),React.createElement(w,{label:b("Icon Size","advanced-gutenberg"),min:10,max:250,value:t.size,onChange:function(t){return e.updateItems(a,{size:t})}}),React.createElement(l.AdvColorControl,{label:b("Icon Color","advanced-gutenberg"),value:t.color,onChange:function(t){return e.updateItems(a,{color:t})}}),React.createElement(l.AdvColorControl,{label:b("Icon Background","advanced-gutenberg"),value:t.bgColor,onChange:function(t){return e.updateItems(a,{bgColor:t})}}),t.style&&"stacked"===t.style&&React.createElement(p,null,React.createElement(C,{label:b("Border","advanced-gutenberg"),className:"advgb-control-header"}),React.createElement(l.AdvColorControl,{label:b("Border Color","advanced-gutenberg"),value:t.borderColor,onChange:function(t){return e.updateItems(a,{borderColor:t})}}),React.createElement(w,{label:b("Border Size(px)","advanced-gutenberg"),min:0,max:20,value:t.borderSize,onChange:function(t){return e.updateItems(a,{borderSize:t})}}),React.createElement(w,{label:b("Border Radius(%)","advanced-gutenberg"),min:0,max:50,value:t.borderRadius,onChange:function(t){return e.updateItems(a,{borderRadius:t})}})),React.createElement(C,{label:b("Link","advanced-gutenberg"),className:"advgb-control-header"}),React.createElement(C,{label:b("Link","advanced-gutenberg")},React.createElement(E,{value:t.link,onChange:function(t){return e.updateItems(a,{link:t})},autoFocus:!1,isFullWidth:!0,hasBorder:!0})),React.createElement(k,{label:b("Link Target","advanced-gutenberg"),value:t.linkTarget,options:[{label:b("Same Window","advanced-gutenberg"),value:"_self"},{label:b("New Window","advanced-gutenberg"),value:"_blank"}],onChange:function(t){return e.updateItems(a,{linkTarget:t})}}),React.createElement(x,{label:b("Title for Accessibility","advanced-gutenberg"),value:t.title,onChange:function(t){return e.updateItems(a,{title:t})}}),t.style&&"stacked"===t.style&&React.createElement(p,null,React.createElement(C,{label:b("Padding","advanced-gutenberg"),className:"advgb-control-header"}),React.createElement("div",{className:"advgb-controls-title"},React.createElement("span",null,b("Unit","advanced-gutenberg")),React.createElement("div",{className:"advgb-unit-wrapper",key:"unit"},["px","em","vh","%"].map((function(n,r){return React.createElement("span",{className:"advgb-unit "+(t.paddingUnit===n?"selected":""),key:r,onClick:function(){return e.updateItems(a,{paddingUnit:n})}},n)})))),S.map((function(n,r){return React.createElement(w,{className:"advgb-padding-margin-control",key:r,label:n.icon,beforeIcon:n.icon,value:t["padding"+n.label],min:0,max:180,onChange:function(t){return e.updateItems(a,i({},"padding"+n.label,t))}})}))),React.createElement(C,{label:b("Margin","advanced-gutenberg"),className:"advgb-control-header"}),React.createElement("div",{className:"advgb-controls-title"},React.createElement("span",null,b("Unit","advanced-gutenberg")),React.createElement("div",{className:"advgb-unit-wrapper",key:"unit"},["px","em","vh","%"].map((function(n,r){return React.createElement("span",{className:"advgb-unit "+(t.marginUnit===n?"selected":""),key:r,onClick:function(){return e.updateItems(a,{marginUnit:n})}},n)})))),S.map((function(n,r){return React.createElement(w,{className:"advgb-padding-margin-control",key:r,label:n.icon,beforeIcon:n.icon,value:t["margin"+n.label],min:0,max:180,onChange:function(t){return e.updateItems(a,i({},"margin"+n.label,t))}})}))))}))),React.createElement("div",{className:f,id:r},React.createElement("div",{className:T,style:{textAlign:s}},o.map((function(e,t){if(++P>d)return!1;var a=["advgb-icon-style-"+e.style,"advgb-icon-wrap","advgb-item-"+t].filter(Boolean).join(" "),n=["advgb-icon","advgb-icon-"+e.icon].filter(Boolean).join(" "),r=["material"===e.iconType&&"material-icons",""!==e.iconTheme&&"-"+e.iconTheme].filter(Boolean).join(""),o={display:"flex",alignItems:"center",marginTop:e.marginTop+e.marginUnit,marginBottom:e.marginBottom+e.marginUnit,marginLeft:e.marginLeft+e.marginUnit,marginRight:e.marginRight+e.marginUnit,paddingTop:"default"!==e.style?e.paddingTop+e.paddingUnit:0,paddingBottom:"default"!==e.style?e.paddingBottom+e.paddingUnit:0,paddingLeft:"default"!==e.style?e.paddingLeft+e.paddingUnit:0,paddingRight:"default"!==e.style?e.paddingRight+e.paddingUnit:0,borderWidth:"default"!==e.style?e.borderSize+"px":0,borderStyle:"solid",borderColor:e.borderColor,background:e.bgColor,borderRadius:e.borderRadius+"%"},l={fontSize:e.size+"px",color:e.color};return React.createElement(p,null,React.createElement("div",{className:a},React.createElement("div",{className:n,style:o},React.createElement("i",{className:r,style:l},e.icon))))}))),m?React.createElement(c.IconListPopupHook,{content:"iconpopup",closePopup:function(){m&&e.togglePopup()},onSelectIcon:this.handleIcon,onSelectIconTheme:this.handleIconTheme,selectedIcon:this.getItemData(v,"icon"),selectedIconTheme:this.getItemData(v,"iconTheme")}):null))}}]),t}(m),N={blockIDX:{type:"string"},items:{type:"array",default:T(10,(function(){return{icon:"beenhere",iconType:"material",iconTheme:"outlined",size:120,color:"#111111",style:"default",bgColor:"",borderColor:"#111",borderSize:2,borderRadius:0,paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,marginTop:0,marginBottom:0,marginLeft:0,marginRight:40,paddingUnit:"px",marginUnit:"px",link:"",linkTarget:"_self",title:""}}))},numberItem:{type:"number",default:2},changed:{type:"boolean",default:!1},tAlign:{type:"string",default:"center"},isPreview:{type:"boolean",default:!1}};v("advgb/icon",{title:b("Icon - PublishPress","advanced-gutenberg"),description:b("Icon block with more options and styles.","advanced-gutenberg"),icon:{src:I,foreground:"undefined"!=typeof advgbBlocks?advgbBlocks.color:void 0},category:"advgb-category",keywords:[b("icon","advanced-gutenberg"),b("advanced icon","advanced-gutenberg")],attributes:N,supports:{align:["left","center","right"]},example:{attributes:{isPreview:!0}},edit:P,save:function(e){var t=e.attributes,a=t.blockIDX,n=t.className,r=t.items,o=t.numberItem,l=["wp-block-advgb-icon","icon-wrapper",n,a].filter(Boolean).join(" "),c=["advgb-icons"].filter(Boolean).join(" "),i=0;return React.createElement(p,null,React.createElement("div",{className:l},React.createElement("div",{className:c},r.map((function(e,t){if(++i>o)return!1;var a=e.link;e.link.match(/^[a-zA-Z]+:\/\//)||(a="http://"+e.link);var n=["advgb-icon-style-"+e.style,"advgb-icon-wrap","advgb-item-"+t].filter(Boolean).join(" "),r=["advgb-icon","advgb-icon-"+e.icon].filter(Boolean).join(" "),l=["material"===e.iconType&&"material-icons",""!==e.iconTheme&&"-"+e.iconTheme].filter(Boolean).join("");return React.createElement(p,null,React.createElement("div",{className:n},""!==e.link&&React.createElement("a",{href:a,target:e.linkTarget,title:e.title,rel:"noopener noreferrer"},React.createElement("span",{className:r},React.createElement("i",{className:l},e.icon))),""===e.link&&React.createElement("span",{className:r},React.createElement("i",{className:l},e.icon))))})))))},deprecated:[{attributes:N,save:function(e){var t=e.attributes,a=t.blockIDX,n=t.items,r=t.numberItem,o=["wp-block-advgb-icon","icon-wrapper",a].filter(Boolean).join(" "),l=["advgb-icons"].filter(Boolean).join(" "),c=0;return React.createElement(p,null,React.createElement("div",{className:o},React.createElement("div",{className:l},n.map((function(e,t){if(++c>r)return!1;var a=["advgb-icon-style-"+e.style,"advgb-icon-wrap","advgb-item-"+t].filter(Boolean).join(" "),n=["advgb-icon","advgb-icon-"+e.icon].filter(Boolean).join(" "),o=["material"===e.iconType&&"material-icons",""!==e.iconTheme&&"-"+e.iconTheme].filter(Boolean).join("");return React.createElement(p,null,React.createElement("div",{className:a},""!==e.link&&React.createElement("a",{href:e.link,title:e.title},React.createElement("div",{className:n},React.createElement("i",{className:o},e.icon))),""===e.link&&React.createElement("div",{className:n},React.createElement("i",{className:o},e.icon))))})))))}},{attributes:N,save:function(e){var t=e.attributes,a=t.blockIDX,n=t.items,r=t.numberItem,o=["wp-block-advgb-icon","icon-wrapper"].filter(Boolean).join(" "),l=["advgb-icons"].filter(Boolean).join(" "),c=0;return React.createElement(p,null,React.createElement("div",{className:o,id:a},React.createElement("div",{className:l},n.map((function(e,t){if(++c>r)return!1;var a=["advgb-icon-style-"+e.style,"advgb-icon-wrap","advgb-item-"+t].filter(Boolean).join(" "),n=["advgb-icon","advgb-icon-"+e.icon].filter(Boolean).join(" "),o=["material"===e.iconType&&"material-icons",""!==e.iconTheme&&"-"+e.iconTheme].filter(Boolean).join("");return React.createElement(p,null,React.createElement("div",{className:a},""!==e.link&&React.createElement("a",{href:e.link,title:e.title},React.createElement("div",{className:n},React.createElement("i",{className:o},e.icon))),""===e.link&&React.createElement("div",{className:n},React.createElement("i",{className:o},e.icon))))})))))}}]})}(wp.i18n,wp.blocks,wp.element,wp.blockEditor,wp.components)},function(e,t,a){"use strict";var n=Object.assign||function(e){for(var t=1;t1&&(c=u(c,{key:c.key||v})),m.push(c);else if("text"!==l.type){if(i=l.attribs,o(l)||(i=n(l.attribs)),d=null,"script"===l.type||"style"===l.type)l.children[0]&&(i.dangerouslySetInnerHTML={__html:l.children[0].data});else{if("tag"!==l.type)continue;"textarea"===l.name&&l.children[0]?i.defaultValue=l.children[0].data:l.children&&l.children.length&&(d=e(l.children,r))}f>1&&(i.key=v),m.push(g(l.name,i,d))}else m.push(l.data);return 1===m.length?m[0]:m}},function(e,t,a){var n=a(20),r=a(24),o=a(2),l=o.camelCase,c=n.html,i=n.svg,d=n.isCustomAttribute,s=Object.prototype.hasOwnProperty;e.exports=function(e){var t,a,n,u;e=e||{};var g={};for(t in e)n=e[t],d(t)?g[t]=n:(a=t.toLowerCase(),s.call(c,a)?g[(u=c[a]).propertyName]=!!(u.hasBooleanValue||u.hasOverloadedBooleanValue&&!n)||n:s.call(i,t)?g[(u=i[t]).propertyName]=n:o.PRESERVE_CUSTOM_ATTRIBUTES&&(g[t]=n));return null!=e.style&&(g.style=function(e){var t={};e&&r(e,(function(e,a){e&&a&&(t[l(e)]=a)}));return t}(e.style)),g}},function(e,t,a){var n=a(21),r=a(22),o=a(23),l=o.MUST_USE_PROPERTY,c=o.HAS_BOOLEAN_VALUE,i=o.HAS_NUMERIC_VALUE,d=o.HAS_POSITIVE_NUMERIC_VALUE,s=o.HAS_OVERLOADED_BOOLEAN_VALUE;function u(e,t){return(e&t)===t}function g(e,t,a){var n,r,o,g=e.Properties,b=e.DOMAttributeNames;for(r in g)n=b[r]||(a?r:r.toLowerCase()),o=g[r],t[n]={attributeName:n,propertyName:r,mustUseProperty:u(o,l),hasBooleanValue:u(o,c),hasNumericValue:u(o,i),hasPositiveNumericValue:u(o,d),hasOverloadedBooleanValue:u(o,s)}}var b={};g(n,b);var m={};g(r,m,!0);var p={};g(n,p),g(r,p,!0);e.exports={html:b,svg:m,properties:p,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},function(e,t){e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},function(e,t){e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},function(e,t){e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},function(e,t,a){var n=a(25);e.exports=function(e,t){var a,r=null;if(!e||"string"!=typeof e)return r;for(var o,l,c=n(e),i="function"==typeof t,d=0,s=c.length;d +var HEAD_TAG_REGEX = //i; +var BODY_TAG_REGEX = //i; +// http://www.w3.org/TR/html/syntax.html#void-elements +var VOID_ELEMENTS_REGEX = /<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi; + +// detect IE browser +var isIE9 = utilities.isIE(9); +var isIE = isIE9 || utilities.isIE(); + +/** + * DOMParser (performance: slow). * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var n=a(27),r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,l=r?Symbol.for("react.portal"):60106,c=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,d=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,g=r?Symbol.for("react.forward_ref"):60112,b=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.memo"):60115,p=r?Symbol.for("react.lazy"):60116,v="function"==typeof Symbol&&Symbol.iterator;function f(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;aI.length&&I.push(e)}function O(e,t,a){return null==e?0:function e(t,a,n,r){var c=typeof t;"undefined"!==c&&"boolean"!==c||(t=null);var i=!1;if(null===t)i=!0;else switch(c){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case o:case l:i=!0}}if(i)return n(r,t,""===a?"."+H(t,0):a),1;if(i=0,a=""===a?".":a+":",Array.isArray(t))for(var d=0;d' + html + ''; + } + + // because IE9 only supports MIME type 'text/xml', void elements need to be self-closed + if (isIE9) { + html = html.replace(VOID_ELEMENTS_REGEX, '<$1$2$3/>'); + } + + return domParser.parseFromString(html, mimeType); + }; +} + +/** + * DOMImplementation (performance: fair). + * + * @see https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument + */ +var parseFromDocument; + +if (typeof document.implementation === 'object') { + // title parameter is required in IE + // https://msdn.microsoft.com/en-us/library/ff975457(v=vs.85).aspx + var doc = document.implementation.createHTMLDocument( + isIE ? 'HTML_DOM_PARSER_TITLE' : undefined + ); + + /** + * Use HTML document created by `document.implementation.createHTMLDocument`. + * + * @param {string} html - The HTML string. + * @param {string} [tagName] - The element to render the HTML (with 'body' as fallback). + * @return {HTMLDocument} + */ + parseFromDocument = function createHTMLDocument(html, tagName) { + if (tagName) { + doc.documentElement.getElementsByTagName(tagName)[0].innerHTML = html; + return doc; + } + + try { + doc.documentElement.innerHTML = html; + return doc; + // fallback when certain elements in `documentElement` are read-only (IE9) + } catch (err) { + if (parseFromString) { + return parseFromString(html); + } + } + }; +} + +/** + * Template (performance: fast). + * + * @see https://developer.mozilla.org/docs/Web/HTML/Element/template + */ +var parseFromTemplate; +var template = document.createElement('template'); + +if (template.content) { + /** + * Uses a template element (content fragment) to parse HTML. + * + * @param {string} html - The HTML string. + * @return {NodeList} + */ + parseFromTemplate = function templateParser(html) { + template.innerHTML = html; + return template.content.childNodes; + }; +} + +// fallback document parser +var parseWithFallback = parseFromDocument || parseFromString; + +/** + * Parses HTML string to DOM nodes. + * + * @param {string} html - The HTML string. + * @return {NodeList|Array} + */ +function domparser(html) { + var firstTagName; + var match = html.match(FIRST_TAG_REGEX); + + if (match && match[1]) { + firstTagName = match[1].toLowerCase(); + } + + var doc; + var element; + var elements; + + switch (firstTagName) { + case HTML: + if (parseFromString) { + doc = parseFromString(html); + + // the created document may come with filler head/body elements, + // so make sure to remove them if they don't actually exist + if (!HEAD_TAG_REGEX.test(html)) { + element = doc.getElementsByTagName(HEAD)[0]; + if (element) { + element.parentNode.removeChild(element); + } + } + + if (!BODY_TAG_REGEX.test(html)) { + element = doc.getElementsByTagName(BODY)[0]; + if (element) { + element.parentNode.removeChild(element); + } + } + + return doc.getElementsByTagName(HTML); + } + break; + + case HEAD: + case BODY: + if (parseWithFallback) { + elements = parseWithFallback(html).getElementsByTagName(firstTagName); + + // account for possibility of sibling + if (BODY_TAG_REGEX.test(html) && HEAD_TAG_REGEX.test(html)) { + return elements[0].parentNode.childNodes; + } + + return elements; + } + break; + + // low-level tag or text + default: + if (parseFromTemplate) { + return parseFromTemplate(html); + } + + if (parseWithFallback) { + return parseWithFallback(html, BODY).getElementsByTagName(BODY)[0] + .childNodes; + } + + break; + } + + return []; +} + +module.exports = domparser; + + +/***/ }), + +/***/ "./node_modules/html-dom-parser/lib/html-to-dom-client.js": +/*!****************************************************************!*\ + !*** ./node_modules/html-dom-parser/lib/html-to-dom-client.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var domparser = __webpack_require__(/*! ./domparser */ "./node_modules/html-dom-parser/lib/domparser.js"); +var utilities = __webpack_require__(/*! ./utilities */ "./node_modules/html-dom-parser/lib/utilities.js"); + +var formatDOM = utilities.formatDOM; +var isIE9 = utilities.isIE(9); + +var DIRECTIVE_REGEX = /<(![a-zA-Z\s]+)>/; // e.g., + +/** + * Parses HTML and reformats DOM nodes output. + * + * @param {String} html - The HTML string. + * @return {Array} - The formatted DOM nodes. + */ +function parseDOM(html) { + if (typeof html !== 'string') { + throw new TypeError('First argument must be a string'); + } + + if (!html) { + return []; + } + + // match directive + var match = html.match(DIRECTIVE_REGEX); + var directive; + + if (match && match[1]) { + directive = match[1]; + + // remove directive in IE9 because DOMParser uses + // MIME type 'text/xml' instead of 'text/html' + if (isIE9) { + html = html.replace(match[0], ''); + } + } + + return formatDOM(domparser(html), null, directive); +} + +module.exports = parseDOM; + + +/***/ }), + +/***/ "./node_modules/html-dom-parser/lib/utilities.js": +/*!*******************************************************!*\ + !*** ./node_modules/html-dom-parser/lib/utilities.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var CASE_SENSITIVE_TAG_NAMES = __webpack_require__(/*! ./constants */ "./node_modules/html-dom-parser/lib/constants.js").CASE_SENSITIVE_TAG_NAMES; + +var caseSensitiveTagNamesMap = {}; +var tagName; +for (var i = 0, len = CASE_SENSITIVE_TAG_NAMES.length; i < len; i++) { + tagName = CASE_SENSITIVE_TAG_NAMES[i]; + caseSensitiveTagNamesMap[tagName.toLowerCase()] = tagName; +} + +/** + * Gets case-sensitive tag name. + * + * @param {String} tagName - The lowercase tag name. + * @return {String|undefined} + */ +function getCaseSensitiveTagName(tagName) { + return caseSensitiveTagNamesMap[tagName]; +} + +/** + * Formats DOM attributes to a hash map. + * + * @param {NamedNodeMap} attributes - The list of attributes. + * @return {Object} - A map of attribute name to value. + */ +function formatAttributes(attributes) { + var result = {}; + var attribute; + // `NamedNodeMap` is array-like + for (var i = 0, len = attributes.length; i < len; i++) { + attribute = attributes[i]; + result[attribute.name] = attribute.value; + } + return result; +} + +/** + * Corrects the tag name if it is case-sensitive (SVG). + * Otherwise, returns the lowercase tag name (HTML). + * + * @param {String} tagName - The lowercase tag name. + * @return {String} - The formatted tag name. + */ +function formatTagName(tagName) { + tagName = tagName.toLowerCase(); + var caseSensitiveTagName = getCaseSensitiveTagName(tagName); + if (caseSensitiveTagName) { + return caseSensitiveTagName; + } + return tagName; +} + +/** + * Formats the browser DOM nodes to mimic the output of `htmlparser2.parseDOM()`. + * + * @param {NodeList} nodes - The DOM nodes. + * @param {Object} [parentObj] - The formatted parent node. + * @param {String} [directive] - The directive. + * @return {Object[]} - The formatted DOM object. + */ +function formatDOM(nodes, parentObj, directive) { + parentObj = parentObj || null; + + var result = []; + var node; + var prevNode; + var nodeObj; + + // `NodeList` is array-like + for (var i = 0, len = nodes.length; i < len; i++) { + node = nodes[i]; + // reset + nodeObj = { + next: null, + prev: result[i - 1] || null, + parent: parentObj + }; + + // set the next node for the previous node (if applicable) + prevNode = result[i - 1]; + if (prevNode) { + prevNode.next = nodeObj; + } + + // set the node name if it's not "#text" or "#comment" + // e.g., "div" + if (node.nodeName[0] !== '#') { + nodeObj.name = formatTagName(node.nodeName); + // also, nodes of type "tag" have "attribs" + nodeObj.attribs = {}; // default + if (node.attributes && node.attributes.length) { + nodeObj.attribs = formatAttributes(node.attributes); + } + } + + // set the node type + // e.g., "tag" + switch (node.nodeType) { + // 1 = element + case 1: + if (nodeObj.name === 'script' || nodeObj.name === 'style') { + nodeObj.type = nodeObj.name; + } else { + nodeObj.type = 'tag'; + } + // recursively format the children + nodeObj.children = formatDOM(node.childNodes, nodeObj); + break; + // 2 = attribute + // 3 = text + case 3: + nodeObj.type = 'text'; + nodeObj.data = node.nodeValue; + break; + // 8 = comment + case 8: + nodeObj.type = 'comment'; + nodeObj.data = node.nodeValue; + break; + } + + result.push(nodeObj); + } + + if (directive) { + result.unshift({ + name: directive.substring(0, directive.indexOf(' ')).toLowerCase(), + data: directive, + type: 'directive', + next: result[0] ? result[0] : null, + prev: null, + parent: parentObj + }); + + if (result[1]) { + result[1].prev = result[0]; + } + } + + return result; +} + +/** + * Detects IE with or without version. + * + * @param {Number} [version] - The IE version to detect. + * @return {Boolean} - Whether IE or the version has been detected. + */ +function isIE(version) { + if (version) { + return document.documentMode === version; + } + return /(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent); +} + +module.exports = { + formatAttributes: formatAttributes, + formatDOM: formatDOM, + isIE: isIE +}; + + +/***/ }), + +/***/ "./node_modules/html-react-parser/index.js": +/*!*************************************************!*\ + !*** ./node_modules/html-react-parser/index.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var domToReact = __webpack_require__(/*! ./lib/dom-to-react */ "./node_modules/html-react-parser/lib/dom-to-react.js"); +var htmlToDOM = __webpack_require__(/*! html-dom-parser */ "./node_modules/html-dom-parser/lib/html-to-dom-client.js"); + +// decode HTML entities by default for `htmlparser2` +var domParserOptions = { decodeEntities: true, lowerCaseAttributeNames: false }; + +/** + * Converts HTML string to React elements. + * + * @param {String} html - The HTML string to parse to React. + * @param {Object} [options] - The parser options. + * @param {Function} [options.replace] - The replace method. + * @return {JSX.Element|JSX.Element[]|String} - Returns React element(s), string, or empty array. + */ +function HTMLReactParser(html, options) { + if (typeof html !== 'string') { + throw new TypeError('First argument must be a string'); + } + return domToReact(htmlToDOM(html, domParserOptions), options); +} + +HTMLReactParser.domToReact = domToReact; +HTMLReactParser.htmlToDOM = htmlToDOM; + +// support CommonJS and ES Modules +module.exports = HTMLReactParser; +module.exports.default = HTMLReactParser; + + +/***/ }), + +/***/ "./node_modules/html-react-parser/lib/attributes-to-props.js": +/*!*******************************************************************!*\ + !*** ./node_modules/html-react-parser/lib/attributes-to-props.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var reactProperty = __webpack_require__(/*! react-property */ "./node_modules/react-property/index.js"); +var styleToObject = __webpack_require__(/*! style-to-object */ "./node_modules/style-to-object/index.js"); +var utilities = __webpack_require__(/*! ./utilities */ "./node_modules/html-react-parser/lib/utilities.js"); + +var camelCase = utilities.camelCase; + +var htmlProperties = reactProperty.html; +var svgProperties = reactProperty.svg; +var isCustomAttribute = reactProperty.isCustomAttribute; + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +/** + * Converts HTML/SVG DOM attributes to React props. + * + * @param {Object} [attributes={}] - The HTML/SVG DOM attributes. + * @return {Object} - The React props. + */ +function attributesToProps(attributes) { + attributes = attributes || {}; + + var attributeName; + var attributeNameLowerCased; + var attributeValue; + var property; + var props = {}; + + for (attributeName in attributes) { + attributeValue = attributes[attributeName]; + + // ARIA (aria-*) or custom data (data-*) attribute + if (isCustomAttribute(attributeName)) { + props[attributeName] = attributeValue; + continue; + } + + // convert HTML attribute to React prop + attributeNameLowerCased = attributeName.toLowerCase(); + if (hasOwnProperty.call(htmlProperties, attributeNameLowerCased)) { + property = htmlProperties[attributeNameLowerCased]; + props[property.propertyName] = + property.hasBooleanValue || + (property.hasOverloadedBooleanValue && !attributeValue) + ? true + : attributeValue; + continue; + } + + // convert SVG attribute to React prop + if (hasOwnProperty.call(svgProperties, attributeName)) { + property = svgProperties[attributeName]; + props[property.propertyName] = attributeValue; + continue; + } + + // preserve custom attribute if React >=16 + if (utilities.PRESERVE_CUSTOM_ATTRIBUTES) { + props[attributeName] = attributeValue; + } + } + + // convert inline style to object + if (attributes.style != null) { + props.style = cssToJs(attributes.style); + } + + return props; +} + +/** + * Converts inline CSS style to POJO (Plain Old JavaScript Object). + * + * @param {String} style - The inline CSS style. + * @return {Object} - The style object. + */ +function cssToJs(style) { + var styleObject = {}; + + if (style) { + styleToObject(style, function (property, value) { + // skip CSS comment + if (property && value) { + styleObject[camelCase(property)] = value; + } + }); + } + + return styleObject; +} + +module.exports = attributesToProps; + + +/***/ }), + +/***/ "./node_modules/html-react-parser/lib/dom-to-react.js": +/*!************************************************************!*\ + !*** ./node_modules/html-react-parser/lib/dom-to-react.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var attributesToProps = __webpack_require__(/*! ./attributes-to-props */ "./node_modules/html-react-parser/lib/attributes-to-props.js"); +var utilities = __webpack_require__(/*! ./utilities */ "./node_modules/html-react-parser/lib/utilities.js"); + +/** + * Converts DOM nodes to React elements. + * + * @param {DomElement[]} nodes - The DOM nodes. + * @param {Object} [options={}] - The additional options. + * @param {Function} [options.replace] - The replacer. + * @param {Object} [options.library] - The library (React, Preact, etc.). + * @return {String|ReactElement|ReactElement[]} + */ +function domToReact(nodes, options) { + options = options || {}; + + var React = options.library || __webpack_require__(/*! react */ "./node_modules/react/index.js"); + var cloneElement = React.cloneElement; + var createElement = React.createElement; + var isValidElement = React.isValidElement; + + var result = []; + var node; + var hasReplace = typeof options.replace === 'function'; + var replaceElement; + var props; + var children; + + for (var i = 0, len = nodes.length; i < len; i++) { + node = nodes[i]; + + // replace with custom React element (if present) + if (hasReplace) { + replaceElement = options.replace(node); + + if (isValidElement(replaceElement)) { + // specify a "key" prop if element has siblings + // https://fb.me/react-warning-keys + if (len > 1) { + replaceElement = cloneElement(replaceElement, { + key: replaceElement.key || i + }); + } + result.push(replaceElement); + continue; + } + } + + if (node.type === 'text') { + result.push(node.data); + continue; + } + + props = node.attribs; + if (!shouldPassAttributesUnaltered(node)) { + // update values + props = attributesToProps(node.attribs); + } + + children = null; + + // node type for