From dd5663e14c6db365323b688dbae1cfbeaf14bee7 Mon Sep 17 00:00:00 2001 From: jorostoyanov Date: Thu, 22 Apr 2021 16:24:34 +0300 Subject: [PATCH] Add bundles --- build/classic/metaboxes.js | 2 +- build/classic/metaboxes.min.js | 2 +- build/gutenberg/metaboxes.js | 2 +- build/gutenberg/metaboxes.min.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/classic/metaboxes.js b/build/classic/metaboxes.js index 59d9b0e7..2fceca9d 100644 --- a/build/classic/metaboxes.js +++ b/build/classic/metaboxes.js @@ -833,7 +833,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var call /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! immer */ \"immer\");\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(immer__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var callbag_start_with__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! callbag-start-with */ \"./node_modules/callbag-start-with/index.js\");\n/* harmony import */ var callbag_from_delegated_event__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! callbag-from-delegated-event */ \"./node_modules/callbag-from-delegated-event/index.js\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! callbag-basics */ \"callbag-basics\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(callbag_basics__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @carbon-fields/core */ \"@carbon-fields/core\");\n/* harmony import */ var _carbon_fields_core__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__);\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\n\n\n/**\n * Carbon Fields dependencies.\n */\n\n\n/**\n * Applies a monkey patch to the specified method of `window.tagBox` API\n * so we can detect changes of the non-hierarchical taxonomies.\n *\n * @param {Object} tagBox\n * @param {string} method\n * @return {void}\n */\n\nfunction patchWordPressTagBoxAPI(tagBox, method) {\n tagBox[\"original_\".concat(method)] = tagBox[method];\n\n tagBox[method] = function () {\n var event = new Event('change');\n var textarea = window.jQuery(arguments.length <= 0 ? undefined : arguments[0]).closest('.postbox').find('textarea.the-tags').get(0);\n var result = tagBox[\"original_\".concat(method)].apply(tagBox, arguments);\n textarea.dispatchEvent(event);\n return result;\n };\n}\n\nif (window.tagBox) {\n patchWordPressTagBoxAPI(window.tagBox, 'parseTags');\n patchWordPressTagBoxAPI(window.tagBox, 'flushTags');\n}\n/**\n * Extracts the terms of a hierarchical taxonomy.\n *\n * @param {string} taxonomy\n * @return {Object}\n */\n\n\nfunction getTermsFromChecklist(taxonomy) {\n var inputs = document.querySelectorAll(\"#\".concat(taxonomy, \"checklist input[type=\\\"checkbox\\\"]:checked\"));\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(inputs).reduce(function (memo, input) {\n var value = parseInt(input.value, 10);\n memo[taxonomy].push(value);\n return memo;\n }, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, []));\n}\n/**\n * Extracts the terms of a non-hierarchical taxonomy.\n *\n * @param {string} taxonomy\n * @return {Object}\n */\n\n\nfunction getTermsFromText(taxonomy) {\n var node = document.querySelector(\"#tagsdiv-\".concat(taxonomy, \" textarea.the-tags\"));\n var terms = node.value ? node.value.split(window.tagsSuggestL10n.tagDelimiter) : [];\n return _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, terms);\n}\n/**\n * Keeps track of the hierarchical taxonomies like `categories`.\n *\n * @return {Function}\n */\n\n\nfunction trackHierarchicalTaxonomies() {\n var nodes = document.querySelectorAll('div[id^=\"taxonomy-\"]');\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(nodes).map(function (node) {\n var taxonomy = node.id.replace('taxonomy-', '');\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(callbag_from_delegated_event__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(node.querySelector(\"#\".concat(taxonomy, \"checklist\")), 'input[type=\"checkbox\"]', 'change'), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"scan\"])(function (stack, _ref2) {\n var target = _ref2.target;\n return immer__WEBPACK_IMPORTED_MODULE_3___default()(stack, function (draft) {\n var value = parseInt(target.value, 10);\n\n if (target.checked) {\n draft[taxonomy].push(value);\n } else {\n Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"pull\"])(draft[taxonomy], value);\n }\n });\n }, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, [])), Object(callbag_start_with__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(getTermsFromChecklist(taxonomy)));\n });\n}\n/**\n * Keeps track of the non-hierarchical taxonomies like `tags`.\n *\n * @return {Function}\n */\n\n\nfunction trackNonHierarchicalTaxonomies() {\n var nodes = document.querySelectorAll('div[id^=\"tagsdiv-\"]');\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(nodes).map(function (node) {\n var taxonomy = node.id.replace('tagsdiv-', '');\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"fromEvent\"])(node.querySelector('textarea.the-tags'), 'change'), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"map\"])(function (_ref3) {\n var target = _ref3.target;\n return _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, target.value ? target.value.split(window.tagsSuggestL10n.tagDelimiter) : []);\n }), Object(callbag_start_with__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(getTermsFromText(taxonomy)));\n });\n}\n/**\n * Defines the side effects for Classic Editor.\n */\n\n\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__[\"addFilter\"])('carbon-fields.conditional-display-post-term.classic', 'carbon-fields/metaboxes', function () {\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"merge\"].apply(void 0, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(trackHierarchicalTaxonomies()).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(trackNonHierarchicalTaxonomies()))), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"scan\"])(function (previous, current) {\n return {\n post_term: _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, previous.post_term, current)\n };\n }, {\n post_term: {}\n }));\n});\n/**\n * Defines the side effects for Gutenberg.\n */\n\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__[\"addFilter\"])('carbon-fields.conditional-display-post-term.gutenberg', 'carbon-fields/metaboxes', function () {\n var _select = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__[\"select\"])('core'),\n getTaxonomies = _select.getTaxonomies;\n\n var _select2 = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__[\"select\"])('core/editor'),\n getEditedPostAttribute = _select2.getEditedPostAttribute; // Borrowed from https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/components/post-taxonomies/index.js\n\n\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(_carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__[\"fromSelector\"])(getTaxonomies, {\n per_page: -1\n }), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"filter\"])(Boolean), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"map\"])(function (taxonomies) {\n var pairs = taxonomies.map(function (taxonomy) {\n return [taxonomy.slug, getEditedPostAttribute(taxonomy.rest_base) || []];\n });\n return {\n post_term: Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"fromPairs\"])(pairs)\n };\n }));\n});\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/metaboxes/monitors/conditional-display/aperture/post-term.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! immer */ \"immer\");\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(immer__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var callbag_start_with__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! callbag-start-with */ \"./node_modules/callbag-start-with/index.js\");\n/* harmony import */ var callbag_from_delegated_event__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! callbag-from-delegated-event */ \"./node_modules/callbag-from-delegated-event/index.js\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! callbag-basics */ \"callbag-basics\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(callbag_basics__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @carbon-fields/core */ \"@carbon-fields/core\");\n/* harmony import */ var _carbon_fields_core__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__);\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\n\n\n/**\n * Carbon Fields dependencies.\n */\n\n\nvar TAGS_DELIMITER = ',';\n/**\n * Applies a monkey patch to the specified method of `window.tagBox` API\n * so we can detect changes of the non-hierarchical taxonomies.\n *\n * @param {Object} tagBox\n * @param {string} method\n * @return {void}\n */\n\nfunction patchWordPressTagBoxAPI(tagBox, method) {\n tagBox[\"original_\".concat(method)] = tagBox[method];\n\n tagBox[method] = function () {\n var event = new Event('change');\n var textarea = window.jQuery(arguments.length <= 0 ? undefined : arguments[0]).closest('.postbox').find('textarea.the-tags').get(0);\n var result = tagBox[\"original_\".concat(method)].apply(tagBox, arguments);\n textarea.dispatchEvent(event);\n return result;\n };\n}\n\nif (window.tagBox) {\n patchWordPressTagBoxAPI(window.tagBox, 'parseTags');\n patchWordPressTagBoxAPI(window.tagBox, 'flushTags');\n}\n/**\n * Extracts the terms of a hierarchical taxonomy.\n *\n * @param {string} taxonomy\n * @return {Object}\n */\n\n\nfunction getTermsFromChecklist(taxonomy) {\n var inputs = document.querySelectorAll(\"#\".concat(taxonomy, \"checklist input[type=\\\"checkbox\\\"]:checked\"));\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(inputs).reduce(function (memo, input) {\n var value = parseInt(input.value, 10);\n memo[taxonomy].push(value);\n return memo;\n }, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, []));\n}\n/**\n * Extracts the terms of a non-hierarchical taxonomy.\n *\n * @param {string} taxonomy\n * @return {Object}\n */\n\n\nfunction getTermsFromText(taxonomy) {\n var node = document.querySelector(\"#tagsdiv-\".concat(taxonomy, \" textarea.the-tags\"));\n var terms = node.value ? node.value.split(TAGS_DELIMITER) : [];\n return _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, terms);\n}\n/**\n * Keeps track of the hierarchical taxonomies like `categories`.\n *\n * @return {Function}\n */\n\n\nfunction trackHierarchicalTaxonomies() {\n var nodes = document.querySelectorAll('div[id^=\"taxonomy-\"]');\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(nodes).map(function (node) {\n var taxonomy = node.id.replace('taxonomy-', '');\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(callbag_from_delegated_event__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(node.querySelector(\"#\".concat(taxonomy, \"checklist\")), 'input[type=\"checkbox\"]', 'change'), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"scan\"])(function (stack, _ref2) {\n var target = _ref2.target;\n return immer__WEBPACK_IMPORTED_MODULE_3___default()(stack, function (draft) {\n var value = parseInt(target.value, 10);\n\n if (target.checked) {\n draft[taxonomy].push(value);\n } else {\n Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"pull\"])(draft[taxonomy], value);\n }\n });\n }, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, [])), Object(callbag_start_with__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(getTermsFromChecklist(taxonomy)));\n });\n}\n/**\n * Keeps track of the non-hierarchical taxonomies like `tags`.\n *\n * @return {Function}\n */\n\n\nfunction trackNonHierarchicalTaxonomies() {\n var nodes = document.querySelectorAll('div[id^=\"tagsdiv-\"]');\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(nodes).map(function (node) {\n var taxonomy = node.id.replace('tagsdiv-', '');\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"fromEvent\"])(node.querySelector('textarea.the-tags'), 'change'), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"map\"])(function (_ref3) {\n var target = _ref3.target;\n return _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, target.value ? target.value.split(TAGS_DELIMITER) : []);\n }), Object(callbag_start_with__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(getTermsFromText(taxonomy)));\n });\n}\n/**\n * Defines the side effects for Classic Editor.\n */\n\n\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__[\"addFilter\"])('carbon-fields.conditional-display-post-term.classic', 'carbon-fields/metaboxes', function () {\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"merge\"].apply(void 0, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(trackHierarchicalTaxonomies()).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(trackNonHierarchicalTaxonomies()))), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"scan\"])(function (previous, current) {\n return {\n post_term: _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, previous.post_term, current)\n };\n }, {\n post_term: {}\n }));\n});\n/**\n * Defines the side effects for Gutenberg.\n */\n\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__[\"addFilter\"])('carbon-fields.conditional-display-post-term.gutenberg', 'carbon-fields/metaboxes', function () {\n var _select = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__[\"select\"])('core'),\n getTaxonomies = _select.getTaxonomies;\n\n var _select2 = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__[\"select\"])('core/editor'),\n getEditedPostAttribute = _select2.getEditedPostAttribute; // Borrowed from https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/components/post-taxonomies/index.js\n\n\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(_carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__[\"fromSelector\"])(getTaxonomies, {\n per_page: -1\n }), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"filter\"])(Boolean), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"map\"])(function (taxonomies) {\n var pairs = taxonomies.map(function (taxonomy) {\n return [taxonomy.slug, getEditedPostAttribute(taxonomy.rest_base) || []];\n });\n return {\n post_term: Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"fromPairs\"])(pairs)\n };\n }));\n});\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/metaboxes/monitors/conditional-display/aperture/post-term.js?"); /***/ }), diff --git a/build/classic/metaboxes.min.js b/build/classic/metaboxes.min.js index 38aa4fad..5c2cc50c 100644 --- a/build/classic/metaboxes.min.js +++ b/build/classic/metaboxes.min.js @@ -1 +1 @@ -this.cf=this.cf||{},this.cf.metaboxes=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=67)}([function(e,t){!function(){e.exports=this.cf.vendor.lodash}()},function(e,t){!function(){e.exports=this.cf.vendor["callbag-basics"]}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/data"]}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/hooks"]}()},function(e,t){!function(){e.exports=this.cf.core}()},function(e,t,n){var r=n(9);e.exports=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:function(){for(var e=arguments.length,t=new Array(e),n=0;nt=>(n,r)=>{if(0!==n)return;let o;t(0,(t,n)=>{0===t?(o=n,r(t,n)):1===t?e(n)?r(t,n):o(1):r(t,n)})})},function(e,t){e.exports=(e=>(t,n)=>{if(0!==t)return;if("function"!=typeof e)return n(0,()=>{}),void n(2);let r,o;const i=e=>{(r=r||2===e)&&"function"==typeof o&&o()};n(0,i),o=e((e,t)=>{r||0===e||(n(e,t),i(e))})})},function(e,t,n){"use strict";(function(e){var r=n(17),o=n.n(r),i=n(26),c=n.n(i),a=n(27),u=n.n(a),s=n(28),l=n.n(s),d=n(29),f=n.n(d),p=n(30),b=n.n(p),m=n(7),v=n.n(m),O=n(9),j=n.n(O),g=n(32),y=n.n(g),h=n(8),_=n(0),x=n(4),E=(n(66),n(31)),w=function(t){function n(){var t,r;c()(this,n);for(var o=arguments.length,i=new Array(o),a=0;at=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=!1;for(r(0,(t,n)=>{a&&1===t&&(i=[1,n]),2===t&&(c=!0,e.length=0),o&&o(t,n)});0!==e.length;)1===e.length&&(a=!0),r(1,e.shift());c||t(0,(e,t)=>{if(0===e)return o=t,a=!1,void(i&&(o(...i),i=null));r(e,t)})},m=n(15),v=n(4);function O(e){var t=parseInt(e.value,10);return!isNaN(t)&&t>=0?t:0}function j(e){var t=0;if(e.className){var n=e.className.match(/^level-(\d+)/);n&&(t=parseInt(n[1],10)+1)}return t}function g(e){for(var t=[],n=e,r=j(e);r>0&&n;)if(j(n)===r){var o=parseInt(n.value,10);o>0&&t.unshift(o),n=n.previousSibling,r--}else n=n.previousSibling;return t}var y={post_ancestors:[],post_parent_id:0,post_level:1};function h(e){var t=e.options[e.selectedIndex];return{post_ancestors:g(t),post_parent_id:O(t),post_level:j(t)+1}}Object(u.addFilter)("carbon-fields.conditional-display-post-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent_id");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return h(e.target)}),b(h(e))):Object(p.a)(y)}),Object(u.addFilter)("carbon-fields.conditional-display-post-parent.gutenberg","carbon-fields/metaboxes",function(){var e=Object(o.select)("core"),t=e.getPostType,n=e.getEntityRecords;return Object(l.pipe)(Object(l.combine)(Object(v.fromSelector)(Object(o.select)("core/editor").getCurrentPostId),Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"type"),Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"parent")),Object(m.a)(s.isEqual),Object(l.map)(function(e){var r=f()(e,3),o=r[0],i=r[1],c=r[2];if(c=parseInt(c,10),isNaN(c))return y;var a=t(i);if(!Object(s.get)(a,["hierarchical"],!1))return y;var u=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=Object(s.find)(n,["id",t]);return o?(r.unshift(o.id),o.parent?e(o.parent,n,r):r):r}(c,n("postType",i,{per_page:-1,exclude:o,parent_exclude:o,orderby:"menu_order",order:"asc"})||[]);return{post_ancestors:u,post_parent_id:c,post_level:u.length+1}}))});var _=n(35),x=n.n(_),E=(e,t,n)=>x()(n=>{let r=n.target;for(;r!==e;){if(r.matches(t))return!0;r=r.parentElement}return!1})(((e,t,n)=>(r,o)=>{if(0!==r)return;let i=!1;const c=e=>{o(1,e)};o(0,r=>{2===r&&(i=!0,e.removeEventListener(t,c,n))}),i||e.addEventListener(t,c,n)})(e,n)),w={post_format:"standard"};function S(e){var t=e.value;return"0"===t&&(t="standard"),{post_format:t}}Object(u.addFilter)("carbon-fields.conditional-display-post-format.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("div#post-formats-select");return e?Object(l.pipe)(E(e,"input.post-format","change"),Object(l.map)(function(e){return S(e.target)}),b(S(e.querySelector("input.post-format:checked")))):Object(p.a)(w)}),Object(u.addFilter)("carbon-fields.conditional-display-post-format.gutenberg","carbon-fields/metaboxes",function(){return Object(l.pipe)(Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"format"),Object(m.a)(),Object(l.filter)(Boolean),Object(l.map)(function(e){return{post_format:e}}),b(w))});var I={post_template:""};function F(e){var t=e.value;return"default"===t&&(t=""),{post_template:t}}Object(u.addFilter)("carbon-fields.conditional-display-post-template.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#page_template");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return F(e.target)}),b(F(e))):Object(p.a)(I)}),Object(u.addFilter)("carbon-fields.conditional-display-post-template.gutenberg","carbon-fields/metaboxes",function(){return Object(l.pipe)(Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"template"),Object(m.a)(),Object(l.filter)(s.isString),Object(l.map)(function(e){return{post_template:e}}),b(I))});var T=n(5),A=n.n(T),C=n(9),D=n.n(C),N=n(17),k=n.n(N);function G(e,t){e["original_".concat(t)]=e[t],e[t]=function(){var n=new Event("change"),r=window.jQuery(arguments.length<=0?void 0:arguments[0]).closest(".postbox").find("textarea.the-tags").get(0),o=e["original_".concat(t)].apply(e,arguments);return r.dispatchEvent(n),o}}window.tagBox&&(G(window.tagBox,"parseTags"),G(window.tagBox,"flushTags")),Object(u.addFilter)("carbon-fields.conditional-display-post-term.classic","carbon-fields/metaboxes",function(){return Object(l.pipe)(l.merge.apply(void 0,k()((e=document.querySelectorAll('div[id^="taxonomy-"]'),k()(e).map(function(e){var t=e.id.replace("taxonomy-","");return Object(l.pipe)(E(e.querySelector("#".concat(t,"checklist")),'input[type="checkbox"]',"change"),Object(l.scan)(function(e,n){var r=n.target;return a()(e,function(e){var n=parseInt(r.value,10);r.checked?e[t].push(n):Object(s.pull)(e[t],n)})},D()({},t,[])),b(function(e){var t=document.querySelectorAll("#".concat(e,'checklist input[type="checkbox"]:checked'));return k()(t).reduce(function(t,n){var r=parseInt(n.value,10);return t[e].push(r),t},D()({},e,[]))}(t)))}))).concat(k()(function(){var e=document.querySelectorAll('div[id^="tagsdiv-"]');return k()(e).map(function(e){var t=e.id.replace("tagsdiv-","");return Object(l.pipe)(Object(l.fromEvent)(e.querySelector("textarea.the-tags"),"change"),Object(l.map)(function(e){var n=e.target;return D()({},t,n.value?n.value.split(window.tagsSuggestL10n.tagDelimiter):[])}),b(function(e){var t=document.querySelector("#tagsdiv-".concat(e," textarea.the-tags")),n=t.value?t.value.split(window.tagsSuggestL10n.tagDelimiter):[];return D()({},e,n)}(t)))})}()))),Object(l.scan)(function(e,t){return{post_term:A()({},e.post_term,t)}},{post_term:{}}));var e}),Object(u.addFilter)("carbon-fields.conditional-display-post-term.gutenberg","carbon-fields/metaboxes",function(){var e=Object(o.select)("core").getTaxonomies,t=Object(o.select)("core/editor").getEditedPostAttribute;return Object(l.pipe)(Object(v.fromSelector)(e,{per_page:-1}),Object(l.filter)(Boolean),Object(l.map)(function(e){var n=e.map(function(e){return[e.slug,t(e.rest_base)||[]]});return{post_term:Object(s.fromPairs)(n)}}))});var L={term_ancestors:[],term_parent:0,term_level:1};function P(e){var t=e.options[e.selectedIndex];return{term_ancestors:g(t),term_parent:O(t),term_level:j(t)+1}}Object(u.addFilter)("carbon-fields.conditional-display-term-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return P(e.target)}),b(P(e))):Object(p.a)(L)});var R={user_role:""};function B(e){return{user_role:e.value}}Object(u.addFilter)("carbon-fields.conditional-display-user-role.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#role");if(!e){var t=document.querySelector("fieldset[data-profile-role]");return t?Object(p.a)({user_role:t.dataset.profileRole}):Object(p.a)(R)}return Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return B(e.target)}),b(B(e)))});var U=n(6),V=n(22),q={operators:[],isOperatorSupported:function(e){return this.operators.indexOf(e)>-1},evaluate:function(){return!1}},Q={comparers:[A()({},q,{operators:["=","!="],evaluate:function(e,t,n){switch(t){case"=":return e==n;case"!=":return e!=n;default:return!1}}}),A()({},q,{operators:["IN","NOT IN"],evaluate:function(e,t,n){switch(t){case"IN":return n.indexOf(e)>-1;case"NOT IN":return-1===n.indexOf(e);default:return!1}}}),A()({},q,{operators:[">",">=","<","<="],evaluate:function(e,t,n){switch(t){case">":return e>n;case">=":return e>=n;case"<":return e0;case"NOT IN":return 0===Object(s.intersection)(e,n).length;default:return!1}}}),H=A()({},Q,{comparers:[M,z],getEnvironmentValue:function(e,t){return Object(s.get)(t,"post_ancestors",[])}}),J=A()({},Q,{isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(s.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(s.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)}}),X=A()({},Q,{comparers:[M,z],isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(s.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(s.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)},getEnvironmentValue:function(e,t){return Object(s.get)(t,"term_ancestors",[])}}),Y={boolean:K,post_term:W,post_ancestor_id:H,post_parent_id:Q,post_level:Q,post_format:Q,post_template:$,term_level:Q,term_parent:J,term_ancestor:X,user_role:Q},Z=Object(o.withSelect)(function(e){return{containers:e("carbon-fields/metaboxes").getContainers()}}),ee=Object(i.withEffects)(function(e,t){var n=t.context,r=Object(u.applyFilters)("carbon-fields.conditional-display-post-parent.".concat(n)),o=Object(u.applyFilters)("carbon-fields.conditional-display-post-format.".concat(n)),i=Object(u.applyFilters)("carbon-fields.conditional-display-post-template.".concat(n)),c=Object(u.applyFilters)("carbon-fields.conditional-display-post-term.".concat(n)),d=Object(u.applyFilters)("carbon-fields.conditional-display-term-parent.".concat(n)),f=Object(u.applyFilters)("carbon-fields.conditional-display-user-role.".concat(n));return Object(l.pipe)(Object(l.merge)(r,o,i,c,d,f),Object(l.scan)(function(e,t){return a()(e,function(e){Object(s.assign)(e,t)})}))},{handler:function(e){var t=e.containers,n=e.context;return function(e){Object(s.map)(t,function(t,n){return[n,function e(t,n,r){var o=t.map(function(t){if(t.relation)return e(t.conditions,n,t.relation);var r=Object(s.get)(Y,t.type);return r?r.isFulfiled(t,n):(console.error(Object(U.sprintf)(Object(U.__)('Unsupported container condition - "%1$s".',"carbon-fields-ui"),t.type)),!1)});switch(r){case"AND":return o.every(Boolean);case"OR":return o.some(Boolean);default:return console.error(Object(U.sprintf)(Object(U.__)('Unsupported container condition relation used - "%1$s".',"carbon-fields-ui"),r)),!1}}(t.conditions.conditions,e,t.conditions.relation)]}).forEach(function(e){var r=f()(e,2),o=r[0],i=r[1],c=document.getElementById(o),a=document.querySelector(".container-".concat(o)),u=!!a.dataset.mounted;c&&(c.hidden=!i),a&&(i&&!u&&Object(V.b)(t[o],n),!i&&u&&(delete a.dataset.mounted,a._reactRootContainer.unmount()))})}}});t.a=Object(r.compose)(Z,ee)(function(){return null})},function(e,t,n){"use strict";var r=n(14),o=n.n(r),i=n(2),c=n(8),a=n(0),u=n(13),s=n(1);function l(e){return decodeURIComponent((e+"").replace(/%(?![\da-f]{2})/gi,function(){return"%25"}).replace(/\+/g,"%20"))}var d=n(20),f=n(23),p=n(22),b=n(18);t.a=Object(u.withEffects)(function(){return Object(s.merge)(Object(s.pipe)(Object(f.a)(function(e){return window.jQuery(document).on("widget-added widget-updated",e)},function(e){return window.jQuery(document).off("widget-added widget-updated",e)},function(e,t){return{event:e,$widget:t}}),Object(s.filter)(function(e){return e.$widget[0].id.indexOf(b.b)>-1}),Object(s.map)(function(e){return{type:"WIDGET_CREATED_OR_UPDATED",payload:e}})),Object(s.pipe)(Object(f.a)(function(e){return window.jQuery(document).on("ajaxSend",e)},function(e){return window.jQuery(document).off("ajaxSend",e)},function(e,t,n,r){return{event:e,xhr:t,options:n,data:r}}),Object(s.filter)(function(e){var t=e.options;return Object(a.startsWith)(t.data,b.a)}),Object(s.map)(function(e){return{type:"WIDGET_BEIGN_UPDATED_OR_DELETED",payload:e}})))},{handler:function(){return function(e){var t=Object(i.select)("carbon-fields/metaboxes").getContainerById,n=Object(i.dispatch)("carbon-fields/metaboxes"),r=n.addContainer,u=n.removeContainer,s=n.addFields,f=n.removeFields;switch(e.type){case"WIDGET_CREATED_OR_UPDATED":var m=e.payload,v=m.event,O=m.$widget,j=Object(a.flow)(l,JSON.parse)(O.find("[data-json]").data("json")),g=[];if(j.fields=j.fields.map(function(e){return Object(d.a)(e,j,g)}),s(g),r(j),Object(p.b)(j,"classic"),window.cf.config.pagenow===b.c&&"widget-added"===v.type){var y=O.find('[name="widget-id"]').val();O.find('[name="savewidget"]').show().end().find(".widget-content:first").off("keydown","input").off("change input propertychange",":input"),wp.customize.Widgets.getWidgetFormControlForWidget(y).liveUpdateMode=!1}break;case"WIDGET_BEIGN_UPDATED_OR_DELETED":var h=e.payload.options.data.match(/widget-id=(.+?)&/),x=o()(h,2)[1],E="".concat(b.a).concat(x),w=t(E);Object(c.unmountComponentAtNode)(document.querySelector(".container-".concat(E)));var S=_.map(w.fields,"id");u(E),f(S)}}}})(function(){return null})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){"use strict";(function(e){var t=n(26),r=n.n(t),o=n(27),i=n.n(o),c=n(28),a=n.n(c),u=n(29),s=n.n(u),l=n(30),d=n.n(l),f=n(7),p=n.n(f),b=n(9),m=n.n(b),v=n(10),O=n.n(v),j=n(8),g=n(3),y=n(11),h=n(2),_=n(0),x=n(4),E=(n(47),n(31)),w=n(20),S=function(e){function t(){var e,n;r()(this,t);for(var o=arguments.length,i=new Array(o),c=0;c=0&&window.jQuery(".container-".concat(r.id)).closest(".widget-inside").trigger("change")}}}}))},function(e,t,n){},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(3),c=n(2),a=n(13),u=n(1),s=n(23),l=n(24);Object(i.addFilter)("carbon-fields.term_meta.classic","carbon-fields/metaboxes",Object(a.withEffects)(function(){return Object(u.pipe)(Object(s.a)(function(e){return window.jQuery(document).on("ajaxSuccess",e)},function(e){return window.jQuery(document).off("ajaxSuccess",e)},function(e,t,n,r){return{options:n,data:r}}),Object(u.filter)(function(e){var t=e.options,n=e.data;return t.data&&t.data.indexOf("carbon_fields_container")>-1&&t.data.indexOf("add-tag")>-1&&!n.documentElement.querySelector("wp_error")}))},{handler:function(e){return function(){var t=o.a.map(e.container.fields,"id"),n=Object(l.a)(o.a.get(window.cf,"preloaded.containers",[])),r=n.containers,i=n.fields,a=o.a.find(r,["id",e.id]),u=o.a.filter(i,["container_id",e.id]),s=Object(c.dispatch)("carbon-fields/metaboxes"),d=s.updateState,f=s.removeFields;d(o.a.keyBy([a],"id"),o.a.keyBy(u,"id")),f(t)}}}))},function(e,t,n){"use strict";var r=n(3),o=n(13),i=n(1);n(63),Object(r.addFilter)("carbon-fields.theme_options.classic","carbon-fields/metaboxes",Object(o.withEffects)(function(){return Object(i.pipe)(Object(i.fromEvent)(window,"scroll"),Object(i.map)(function(){return window.jQuery(window).scrollTop()}))},{handler:function(){return function(e){var t=window.jQuery(".carbon-box:first"),n=window.jQuery("#postbox-container-1"),r=window.jQuery("#wpadminbar").height()+10,o=t.offset().top-r;o>0&&n.toggleClass("fixed",e>=o).css("top",r)}}}))},function(e,t,n){},function(e,t,n){"use strict";n(65)},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"setupState",function(){return j}),n.d(r,"updateState",function(){return g}),n.d(r,"updateFieldValue",function(){return y}),n.d(r,"addFields",function(){return h}),n.d(r,"cloneFields",function(){return _}),n.d(r,"removeFields",function(){return x}),n.d(r,"addContainer",function(){return E}),n.d(r,"removeContainer",function(){return w}),n.d(r,"receiveSidebar",function(){return S}),n.d(r,"lockSaving",function(){return I}),n.d(r,"unlockSaving",function(){return F});var o={};n.r(o),n.d(o,"getContainers",function(){return T}),n.d(o,"getContainerById",function(){return A}),n.d(o,"getFields",function(){return C}),n.d(o,"getFieldsByContainerId",function(){return D}),n.d(o,"getFieldById",function(){return N}),n.d(o,"isSavingLocked",function(){return k}),n.d(o,"isDirty",function(){return G}),n.d(o,"isFieldUpdated",function(){return L}),n.d(o,"getComplexGroupValues",function(){return P});var i=n(6),c=n(3),a=n(2),u=n(0),s=n(9),l=n.n(s),d=n(5),f=n.n(d),p=n(10),b=n.n(p),m=n(4);function v(e,t,n){var r=t[e];return"complex"===r.type&&r.value.forEach(function(e){n=e.fields.reduce(function(e,n){return v(n.id,t,e)},n)}),n.concat(e)}var O=Object(a.combineReducers)({containers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.containers;case"UPDATE_STATE":return b()(e,function(e){Object(u.values)(t.payload.containers).forEach(function(t){e[t.id]=t})});case"ADD_CONTAINER":return b()(e,function(e){e[t.payload.id]=t.payload});case"REMOVE_CONTAINER":return Object(u.omit)(e,t.payload);default:return e}},fields:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.fields;case"UPDATE_STATE":return b()(e,function(e){Object(u.values)(t.payload.fields).forEach(function(t){e[t.id]=t})});case"UPDATE_FIELD_VALUE":return b()(e,function(n){var r=t.payload,o=r.fieldId,i=r.value,c=r.fieldsToRemove;n[o].value=i,c.reduce(function(t,n){return v(n,e,t)},[]).forEach(function(e){Object(u.unset)(n,e)})});case"ADD_FIELDS":return b()(e,function(e){t.payload.fields.forEach(function(t){e[t.id]=t})});case"CLONE_FIELDS":return b()(e,function(e){var n=t.payload,r=n.originFieldIds,o=n.cloneFieldIds,i=r.reduce(function(t,n,r){return function e(t,n,r,o){var i=Object(u.cloneDeep)(r[t]);return i.id=n,"complex"===i.type&&i.value.forEach(function(t){t.id=Object(m.uniqueId)(),o=t.fields.reduce(function(t,n){var o=n.id,i=Object(m.uniqueId)();return n.id=i,e(o,i,r,t)},o)}),o.concat(i)}(n,o[r],e,t)},[]);Object(u.assign)(e,Object(u.keyBy)(i,"id"))});case"REMOVE_FIELDS":var n=t.payload.fieldIds.reduce(function(t,n){return v(n,e,t)},[]);return Object(u.omit)(e,n);case"RECEIVE_SIDEBAR":return b()(e,function(e){Object(u.forEach)(e,function(e){"sidebar"===e.type&&e.options.unshift(t.payload)})});default:return e}},savingLock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_SAVING":return f()({},e,l()({},t.payload.lockName,!0));case"UNLOCK_SAVING":return Object(u.omit)(e,[t.payload.lockName]);default:return e}},isDirty:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"UPDATE_FIELD_VALUE":return!0;default:return e}},isFieldUpdated:function(e,t){switch(t.type){case"UPDATE_FIELD_VALUE":return{action:t};default:return!1}}});function j(e,t){return{type:"SETUP_STATE",payload:{containers:e,fields:t}}}function g(e,t){return{type:"UPDATE_STATE",payload:{containers:e,fields:t}}}function y(e,t){return{type:"UPDATE_FIELD_VALUE",payload:{fieldId:e,value:t,fieldsToRemove:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]}}}function h(e){return{type:"ADD_FIELDS",payload:{fields:e}}}function _(e,t){return{type:"CLONE_FIELDS",payload:{originFieldIds:e,cloneFieldIds:t}}}function x(e){return{type:"REMOVE_FIELDS",payload:{fieldIds:e}}}function E(e){return{type:"ADD_CONTAINER",payload:e}}function w(e){return{type:"REMOVE_CONTAINER",payload:e}}function S(e){return{type:"RECEIVE_SIDEBAR",payload:e}}function I(e){return{type:"LOCK_SAVING",payload:{lockName:e}}}function F(e){return{type:"UNLOCK_SAVING",payload:{lockName:e}}}function T(e){return e.containers}function A(e,t){return e.containers[t]}function C(e){return e.fields}function D(e,t){return Object(u.filter)(e.fields,["container_id",t])}function N(e,t){return e.fields[t]}function k(e){return Object.keys(e.savingLock).length>0}function G(e){return e.isDirty}function L(e){return e.isFieldUpdated}function P(e,t){var n=Object(u.pick)(C(e),t);return n=Object(u.mapKeys)(n,function(e){return e.base_name.replace(/\-/g,"_")}),Object(u.mapValues)(n,function(e){return e.value})}var R=n(24);Object(a.registerStore)("carbon-fields/metaboxes",{reducer:O,actions:r,selectors:o});var B=Object(R.a)(Object(u.get)(window.cf,"preloaded.containers",[])),U=B.containers,V=B.fields;Object(a.dispatch)("carbon-fields/metaboxes").setupState(Object(u.keyBy)(U,"id"),Object(u.keyBy)(V,"id"));var q=n(11),Q=n(25),K=n(14),M=n.n(K),W=n(12);const $={};var z=n(15),H=n(1);function J(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return void 0===e?[]:Object(u.pick)(t,Object(u.difference)(Object(u.map)(e.fields,"id"),n))}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(u.map)(e,function(e){return[e.id,"".concat(Object(u.repeat)("parent.",t)).concat(e.base_name)]})}var Y=Object(m.withConditionalLogic)(function(e,t){var n=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId;return Object(H.pipe)(Object(H.merge)(Object(W.a)(n(e.containerId)),Object(m.fromSelector)(n,e.containerId)),(e=>t=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=$;t(0,(t,n)=>{if(0===t)return o=n,e(0,(e,t)=>{if(0!==e)return 1===e?(a=void 0,i(2),o(2),void(c&&r(2))):void(2===e&&(i=null,a=t,null!=t&&(o(2),c&&r(e,t))));(i=t)(1)}),c=!0,r(0,(e,t)=>{a===$&&(2===e&&i&&i(2),o(e,t))}),void(a!==$&&r(2,a));2===t&&i(2),a===$&&r(t,n)})})(t.unmount),Object(z.a)(u.isEqual))},function(e,t){t=Object(u.keyBy)(t,"id");var n=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),r=[];if(Object(u.some)(n.fields,["id",e.id]))r=X(r=J(n,t,[e.id]));else{var o=e.name.replace(new RegExp("^".concat(window.cf.config.compactInputKey,"\\[(.+?)\\]")),"$1"),i=Object(u.find)(t,function(t){return t.container_id===e.containerId&&Object(u.startsWith)(o,t.name)}),c=o.split(/\[|\]/g);c.shift(),(c=c.filter(function(e){return""!==e})).pop();var s=c.reduce(function(e,t){return isNaN(t)?e+1:e},0);r=X(r=J(n,t,[i.id]),s+1);for(var l="".concat(i.id,".value");c.length>0;){var d=c.shift(),f=!isNaN(d),p=!f;if(f){l="".concat(l,"[").concat(d,"]");var b=J(Object(u.get)(t,l),t,[e.id]);r=r.concat(X(b,s)),l="".concat(l,".fields")}if(p){var m=Object(u.find)(Object(u.get)(t,l),["name",d]);l="".concat(m.id,".value"),s--}}}return r=r.map(function(e){var n=M()(e,2),r=n[0];return[n[1],Object(u.get)(t,"".concat(r,".value"))]}),Object(u.fromPairs)(r)}),Z=n(21);function ee(e,t){return Object(u.find)(e,function(e){return e.name===t})}Object(c.addFilter)("carbon-fields.association.metabox","carbon-fields/metaboxes",Object(m.withProps)(function(e){return{hierarchyResolver:function(){var t,n,r,o,i=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),c=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId(e.containerId),s=(t=e.name,n=window.cf.config,r=n.compactInput,o=n.compactInputKey,r&&0===t.indexOf(o)?t.replace(new RegExp("^".concat(o,"\\[(.+?)\\]")),"$1"):t).split(/\[|\]/g);if(s=s.filter(function(e){return""!==e}),"widget"===i.type)return e.field.base_name;for(var l=ee(c,s.shift()),d=c.indexOf(l),f=l.base_name;s.length>0;){var p=s.shift(),b=!isNaN(p),m=p===e.field.base_name,v=!b&&!m;if(b&&(d="".concat(d,".value.").concat(p,".name"),f="".concat(f,"[").concat(p,"]:").concat(Object(u.get)(c,d),"/")),v){var O=ee(Object(u.get)(c,d.replace(/\.name$/,".fields")),p),j=Object(u.find)(c,["id",O.id]);d=c.indexOf(j),f="".concat(f).concat(j.base_name)}m&&(f="".concat(f).concat(p))}return f}}})),n(44),n(49),n(50),n(51),n(52),n(53),n(55),Object(c.addFilter)("carbon-fields.sidebar.metabox","carbon-fields/metaboxes",Object(a.withDispatch)(function(e){return{onAdded:e("carbon-fields/metaboxes").receiveSidebar}})),Object(c.addFilter)("carbon-fields.field-edit.metabox","carbon-fields/metaboxes",Object(q.compose)(Q.a,Y,Object(a.withDispatch)(function(e){if(Object(Z.a)()){var t=e("core/editor");return{lockSaving:t.lockPostSaving,unlockSaving:t.unlockPostSaving}}var n=e("carbon-fields/metaboxes");return{lockSaving:n.lockSaving,unlockSaving:n.unlockSaving}}),m.withValidation));var te=n(33),ne=n(22),re=n(19);n.d(t,"registerContainerType",function(){return re.b}),n.d(t,"getContainerType",function(){return re.a}),Object(i.setLocaleData)(window.cf.config.locale,"carbon-fields-ui");var oe=Object(Z.a)()?"gutenberg":"classic";Object(c.addAction)("carbon-fields.init","carbon-fields/metaboxes",function(){Object(ne.a)(oe),Object(te.a)(oe)})},function(e,t,n){"use strict";var r=n(11),o=n(3),i=n(4),c=n(2),a=Object(r.createHigherOrderComponent)(function(e){return Object(c.withSelect)(function(e,t){var n=t.id;return{container:e("carbon-fields/metaboxes").getContainerById(n)}})(e)},"withContainer");Object(o.addFilter)("carbon-fields.register-container-type","carbon-fields/metaboxes",function(e,t,n){return Object(r.compose)(a,Object(i.withFilters)("carbon-fields.".concat(e,".").concat(t)))(n)})}]); \ No newline at end of file +this.cf=this.cf||{},this.cf.metaboxes=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=67)}([function(e,t){!function(){e.exports=this.cf.vendor.lodash}()},function(e,t){!function(){e.exports=this.cf.vendor["callbag-basics"]}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/data"]}()},function(e,t){!function(){e.exports=this.cf.vendor["@wordpress/hooks"]}()},function(e,t){!function(){e.exports=this.cf.core}()},function(e,t,n){var r=n(9);e.exports=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:function(){for(var e=arguments.length,t=new Array(e),n=0;nt=>(n,r)=>{if(0!==n)return;let o;t(0,(t,n)=>{0===t?(o=n,r(t,n)):1===t?e(n)?r(t,n):o(1):r(t,n)})})},function(e,t){e.exports=(e=>(t,n)=>{if(0!==t)return;if("function"!=typeof e)return n(0,()=>{}),void n(2);let r,o;const i=e=>{(r=r||2===e)&&"function"==typeof o&&o()};n(0,i),o=e((e,t)=>{r||0===e||(n(e,t),i(e))})})},function(e,t,n){"use strict";(function(e){var r=n(17),o=n.n(r),i=n(26),c=n.n(i),a=n(27),u=n.n(a),s=n(28),l=n.n(s),d=n(29),f=n.n(d),p=n(30),b=n.n(p),m=n(7),v=n.n(m),O=n(9),j=n.n(O),y=n(32),g=n.n(y),h=n(8),_=n(0),x=n(4),E=(n(66),n(31)),w=function(t){function n(){var t,r;c()(this,n);for(var o=arguments.length,i=new Array(o),a=0;at=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=!1;for(r(0,(t,n)=>{a&&1===t&&(i=[1,n]),2===t&&(c=!0,e.length=0),o&&o(t,n)});0!==e.length;)1===e.length&&(a=!0),r(1,e.shift());c||t(0,(e,t)=>{if(0===e)return o=t,a=!1,void(i&&(o(...i),i=null));r(e,t)})},m=n(15),v=n(4);function O(e){var t=parseInt(e.value,10);return!isNaN(t)&&t>=0?t:0}function j(e){var t=0;if(e.className){var n=e.className.match(/^level-(\d+)/);n&&(t=parseInt(n[1],10)+1)}return t}function y(e){for(var t=[],n=e,r=j(e);r>0&&n;)if(j(n)===r){var o=parseInt(n.value,10);o>0&&t.unshift(o),n=n.previousSibling,r--}else n=n.previousSibling;return t}var g={post_ancestors:[],post_parent_id:0,post_level:1};function h(e){var t=e.options[e.selectedIndex];return{post_ancestors:y(t),post_parent_id:O(t),post_level:j(t)+1}}Object(u.addFilter)("carbon-fields.conditional-display-post-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent_id");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return h(e.target)}),b(h(e))):Object(p.a)(g)}),Object(u.addFilter)("carbon-fields.conditional-display-post-parent.gutenberg","carbon-fields/metaboxes",function(){var e=Object(o.select)("core"),t=e.getPostType,n=e.getEntityRecords;return Object(l.pipe)(Object(l.combine)(Object(v.fromSelector)(Object(o.select)("core/editor").getCurrentPostId),Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"type"),Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"parent")),Object(m.a)(s.isEqual),Object(l.map)(function(e){var r=f()(e,3),o=r[0],i=r[1],c=r[2];if(c=parseInt(c,10),isNaN(c))return g;var a=t(i);if(!Object(s.get)(a,["hierarchical"],!1))return g;var u=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=Object(s.find)(n,["id",t]);return o?(r.unshift(o.id),o.parent?e(o.parent,n,r):r):r}(c,n("postType",i,{per_page:-1,exclude:o,parent_exclude:o,orderby:"menu_order",order:"asc"})||[]);return{post_ancestors:u,post_parent_id:c,post_level:u.length+1}}))});var _=n(35),x=n.n(_),E=(e,t,n)=>x()(n=>{let r=n.target;for(;r!==e;){if(r.matches(t))return!0;r=r.parentElement}return!1})(((e,t,n)=>(r,o)=>{if(0!==r)return;let i=!1;const c=e=>{o(1,e)};o(0,r=>{2===r&&(i=!0,e.removeEventListener(t,c,n))}),i||e.addEventListener(t,c,n)})(e,n)),w={post_format:"standard"};function S(e){var t=e.value;return"0"===t&&(t="standard"),{post_format:t}}Object(u.addFilter)("carbon-fields.conditional-display-post-format.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("div#post-formats-select");return e?Object(l.pipe)(E(e,"input.post-format","change"),Object(l.map)(function(e){return S(e.target)}),b(S(e.querySelector("input.post-format:checked")))):Object(p.a)(w)}),Object(u.addFilter)("carbon-fields.conditional-display-post-format.gutenberg","carbon-fields/metaboxes",function(){return Object(l.pipe)(Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"format"),Object(m.a)(),Object(l.filter)(Boolean),Object(l.map)(function(e){return{post_format:e}}),b(w))});var I={post_template:""};function F(e){var t=e.value;return"default"===t&&(t=""),{post_template:t}}Object(u.addFilter)("carbon-fields.conditional-display-post-template.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#page_template");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return F(e.target)}),b(F(e))):Object(p.a)(I)}),Object(u.addFilter)("carbon-fields.conditional-display-post-template.gutenberg","carbon-fields/metaboxes",function(){return Object(l.pipe)(Object(v.fromSelector)(Object(o.select)("core/editor").getEditedPostAttribute,"template"),Object(m.a)(),Object(l.filter)(s.isString),Object(l.map)(function(e){return{post_template:e}}),b(I))});var T=n(5),A=n.n(T),C=n(9),D=n.n(C),N=n(17),k=n.n(N),G=",";function P(e,t){e["original_".concat(t)]=e[t],e[t]=function(){var n=new Event("change"),r=window.jQuery(arguments.length<=0?void 0:arguments[0]).closest(".postbox").find("textarea.the-tags").get(0),o=e["original_".concat(t)].apply(e,arguments);return r.dispatchEvent(n),o}}window.tagBox&&(P(window.tagBox,"parseTags"),P(window.tagBox,"flushTags")),Object(u.addFilter)("carbon-fields.conditional-display-post-term.classic","carbon-fields/metaboxes",function(){return Object(l.pipe)(l.merge.apply(void 0,k()((e=document.querySelectorAll('div[id^="taxonomy-"]'),k()(e).map(function(e){var t=e.id.replace("taxonomy-","");return Object(l.pipe)(E(e.querySelector("#".concat(t,"checklist")),'input[type="checkbox"]',"change"),Object(l.scan)(function(e,n){var r=n.target;return a()(e,function(e){var n=parseInt(r.value,10);r.checked?e[t].push(n):Object(s.pull)(e[t],n)})},D()({},t,[])),b(function(e){var t=document.querySelectorAll("#".concat(e,'checklist input[type="checkbox"]:checked'));return k()(t).reduce(function(t,n){var r=parseInt(n.value,10);return t[e].push(r),t},D()({},e,[]))}(t)))}))).concat(k()(function(){var e=document.querySelectorAll('div[id^="tagsdiv-"]');return k()(e).map(function(e){var t=e.id.replace("tagsdiv-","");return Object(l.pipe)(Object(l.fromEvent)(e.querySelector("textarea.the-tags"),"change"),Object(l.map)(function(e){var n=e.target;return D()({},t,n.value?n.value.split(G):[])}),b(function(e){var t=document.querySelector("#tagsdiv-".concat(e," textarea.the-tags")),n=t.value?t.value.split(G):[];return D()({},e,n)}(t)))})}()))),Object(l.scan)(function(e,t){return{post_term:A()({},e.post_term,t)}},{post_term:{}}));var e}),Object(u.addFilter)("carbon-fields.conditional-display-post-term.gutenberg","carbon-fields/metaboxes",function(){var e=Object(o.select)("core").getTaxonomies,t=Object(o.select)("core/editor").getEditedPostAttribute;return Object(l.pipe)(Object(v.fromSelector)(e,{per_page:-1}),Object(l.filter)(Boolean),Object(l.map)(function(e){var n=e.map(function(e){return[e.slug,t(e.rest_base)||[]]});return{post_term:Object(s.fromPairs)(n)}}))});var L={term_ancestors:[],term_parent:0,term_level:1};function R(e){var t=e.options[e.selectedIndex];return{term_ancestors:y(t),term_parent:O(t),term_level:j(t)+1}}Object(u.addFilter)("carbon-fields.conditional-display-term-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent");return e?Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return R(e.target)}),b(R(e))):Object(p.a)(L)});var B={user_role:""};function U(e){return{user_role:e.value}}Object(u.addFilter)("carbon-fields.conditional-display-user-role.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#role");if(!e){var t=document.querySelector("fieldset[data-profile-role]");return t?Object(p.a)({user_role:t.dataset.profileRole}):Object(p.a)(B)}return Object(l.pipe)(Object(l.fromEvent)(e,"change"),Object(l.map)(function(e){return U(e.target)}),b(U(e)))});var V=n(6),q=n(22),Q={operators:[],isOperatorSupported:function(e){return this.operators.indexOf(e)>-1},evaluate:function(){return!1}},K={comparers:[A()({},Q,{operators:["=","!="],evaluate:function(e,t,n){switch(t){case"=":return e==n;case"!=":return e!=n;default:return!1}}}),A()({},Q,{operators:["IN","NOT IN"],evaluate:function(e,t,n){switch(t){case"IN":return n.indexOf(e)>-1;case"NOT IN":return-1===n.indexOf(e);default:return!1}}}),A()({},Q,{operators:[">",">=","<","<="],evaluate:function(e,t,n){switch(t){case">":return e>n;case">=":return e>=n;case"<":return e0;case"NOT IN":return 0===Object(s.intersection)(e,n).length;default:return!1}}}),J=A()({},K,{comparers:[W,H],getEnvironmentValue:function(e,t){return Object(s.get)(t,"post_ancestors",[])}}),X=A()({},K,{isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(s.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(s.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)}}),Y=A()({},K,{comparers:[W,H],isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(s.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(s.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)},getEnvironmentValue:function(e,t){return Object(s.get)(t,"term_ancestors",[])}}),Z={boolean:M,post_term:$,post_ancestor_id:J,post_parent_id:K,post_level:K,post_format:K,post_template:z,term_level:K,term_parent:X,term_ancestor:Y,user_role:K},ee=Object(o.withSelect)(function(e){return{containers:e("carbon-fields/metaboxes").getContainers()}}),te=Object(i.withEffects)(function(e,t){var n=t.context,r=Object(u.applyFilters)("carbon-fields.conditional-display-post-parent.".concat(n)),o=Object(u.applyFilters)("carbon-fields.conditional-display-post-format.".concat(n)),i=Object(u.applyFilters)("carbon-fields.conditional-display-post-template.".concat(n)),c=Object(u.applyFilters)("carbon-fields.conditional-display-post-term.".concat(n)),d=Object(u.applyFilters)("carbon-fields.conditional-display-term-parent.".concat(n)),f=Object(u.applyFilters)("carbon-fields.conditional-display-user-role.".concat(n));return Object(l.pipe)(Object(l.merge)(r,o,i,c,d,f),Object(l.scan)(function(e,t){return a()(e,function(e){Object(s.assign)(e,t)})}))},{handler:function(e){var t=e.containers,n=e.context;return function(e){Object(s.map)(t,function(t,n){return[n,function e(t,n,r){var o=t.map(function(t){if(t.relation)return e(t.conditions,n,t.relation);var r=Object(s.get)(Z,t.type);return r?r.isFulfiled(t,n):(console.error(Object(V.sprintf)(Object(V.__)('Unsupported container condition - "%1$s".',"carbon-fields-ui"),t.type)),!1)});switch(r){case"AND":return o.every(Boolean);case"OR":return o.some(Boolean);default:return console.error(Object(V.sprintf)(Object(V.__)('Unsupported container condition relation used - "%1$s".',"carbon-fields-ui"),r)),!1}}(t.conditions.conditions,e,t.conditions.relation)]}).forEach(function(e){var r=f()(e,2),o=r[0],i=r[1],c=document.getElementById(o),a=document.querySelector(".container-".concat(o)),u=!!a.dataset.mounted;c&&(c.hidden=!i),a&&(i&&!u&&Object(q.b)(t[o],n),!i&&u&&(delete a.dataset.mounted,a._reactRootContainer.unmount()))})}}});t.a=Object(r.compose)(ee,te)(function(){return null})},function(e,t,n){"use strict";var r=n(14),o=n.n(r),i=n(2),c=n(8),a=n(0),u=n(13),s=n(1);function l(e){return decodeURIComponent((e+"").replace(/%(?![\da-f]{2})/gi,function(){return"%25"}).replace(/\+/g,"%20"))}var d=n(20),f=n(23),p=n(22),b=n(18);t.a=Object(u.withEffects)(function(){return Object(s.merge)(Object(s.pipe)(Object(f.a)(function(e){return window.jQuery(document).on("widget-added widget-updated",e)},function(e){return window.jQuery(document).off("widget-added widget-updated",e)},function(e,t){return{event:e,$widget:t}}),Object(s.filter)(function(e){return e.$widget[0].id.indexOf(b.b)>-1}),Object(s.map)(function(e){return{type:"WIDGET_CREATED_OR_UPDATED",payload:e}})),Object(s.pipe)(Object(f.a)(function(e){return window.jQuery(document).on("ajaxSend",e)},function(e){return window.jQuery(document).off("ajaxSend",e)},function(e,t,n,r){return{event:e,xhr:t,options:n,data:r}}),Object(s.filter)(function(e){var t=e.options;return Object(a.startsWith)(t.data,b.a)}),Object(s.map)(function(e){return{type:"WIDGET_BEIGN_UPDATED_OR_DELETED",payload:e}})))},{handler:function(){return function(e){var t=Object(i.select)("carbon-fields/metaboxes").getContainerById,n=Object(i.dispatch)("carbon-fields/metaboxes"),r=n.addContainer,u=n.removeContainer,s=n.addFields,f=n.removeFields;switch(e.type){case"WIDGET_CREATED_OR_UPDATED":var m=e.payload,v=m.event,O=m.$widget,j=Object(a.flow)(l,JSON.parse)(O.find("[data-json]").data("json")),y=[];if(j.fields=j.fields.map(function(e){return Object(d.a)(e,j,y)}),s(y),r(j),Object(p.b)(j,"classic"),window.cf.config.pagenow===b.c&&"widget-added"===v.type){var g=O.find('[name="widget-id"]').val();O.find('[name="savewidget"]').show().end().find(".widget-content:first").off("keydown","input").off("change input propertychange",":input"),wp.customize.Widgets.getWidgetFormControlForWidget(g).liveUpdateMode=!1}break;case"WIDGET_BEIGN_UPDATED_OR_DELETED":var h=e.payload.options.data.match(/widget-id=(.+?)&/),x=o()(h,2)[1],E="".concat(b.a).concat(x),w=t(E);Object(c.unmountComponentAtNode)(document.querySelector(".container-".concat(E)));var S=_.map(w.fields,"id");u(E),f(S)}}}})(function(){return null})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){"use strict";(function(e){var t=n(26),r=n.n(t),o=n(27),i=n.n(o),c=n(28),a=n.n(c),u=n(29),s=n.n(u),l=n(30),d=n.n(l),f=n(7),p=n.n(f),b=n(9),m=n.n(b),v=n(10),O=n.n(v),j=n(8),y=n(3),g=n(11),h=n(2),_=n(0),x=n(4),E=(n(47),n(31)),w=n(20),S=function(e){function t(){var e,n;r()(this,t);for(var o=arguments.length,i=new Array(o),c=0;c=0&&window.jQuery(".container-".concat(r.id)).closest(".widget-inside").trigger("change")}}}}))},function(e,t,n){},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(3),c=n(2),a=n(13),u=n(1),s=n(23),l=n(24);Object(i.addFilter)("carbon-fields.term_meta.classic","carbon-fields/metaboxes",Object(a.withEffects)(function(){return Object(u.pipe)(Object(s.a)(function(e){return window.jQuery(document).on("ajaxSuccess",e)},function(e){return window.jQuery(document).off("ajaxSuccess",e)},function(e,t,n,r){return{options:n,data:r}}),Object(u.filter)(function(e){var t=e.options,n=e.data;return t.data&&t.data.indexOf("carbon_fields_container")>-1&&t.data.indexOf("add-tag")>-1&&!n.documentElement.querySelector("wp_error")}))},{handler:function(e){return function(){var t=o.a.map(e.container.fields,"id"),n=Object(l.a)(o.a.get(window.cf,"preloaded.containers",[])),r=n.containers,i=n.fields,a=o.a.find(r,["id",e.id]),u=o.a.filter(i,["container_id",e.id]),s=Object(c.dispatch)("carbon-fields/metaboxes"),d=s.updateState,f=s.removeFields;d(o.a.keyBy([a],"id"),o.a.keyBy(u,"id")),f(t)}}}))},function(e,t,n){"use strict";var r=n(3),o=n(13),i=n(1);n(63),Object(r.addFilter)("carbon-fields.theme_options.classic","carbon-fields/metaboxes",Object(o.withEffects)(function(){return Object(i.pipe)(Object(i.fromEvent)(window,"scroll"),Object(i.map)(function(){return window.jQuery(window).scrollTop()}))},{handler:function(){return function(e){var t=window.jQuery(".carbon-box:first"),n=window.jQuery("#postbox-container-1"),r=window.jQuery("#wpadminbar").height()+10,o=t.offset().top-r;o>0&&n.toggleClass("fixed",e>=o).css("top",r)}}}))},function(e,t,n){},function(e,t,n){"use strict";n(65)},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"setupState",function(){return j}),n.d(r,"updateState",function(){return y}),n.d(r,"updateFieldValue",function(){return g}),n.d(r,"addFields",function(){return h}),n.d(r,"cloneFields",function(){return _}),n.d(r,"removeFields",function(){return x}),n.d(r,"addContainer",function(){return E}),n.d(r,"removeContainer",function(){return w}),n.d(r,"receiveSidebar",function(){return S}),n.d(r,"lockSaving",function(){return I}),n.d(r,"unlockSaving",function(){return F});var o={};n.r(o),n.d(o,"getContainers",function(){return T}),n.d(o,"getContainerById",function(){return A}),n.d(o,"getFields",function(){return C}),n.d(o,"getFieldsByContainerId",function(){return D}),n.d(o,"getFieldById",function(){return N}),n.d(o,"isSavingLocked",function(){return k}),n.d(o,"isDirty",function(){return G}),n.d(o,"isFieldUpdated",function(){return P}),n.d(o,"getComplexGroupValues",function(){return L});var i=n(6),c=n(3),a=n(2),u=n(0),s=n(9),l=n.n(s),d=n(5),f=n.n(d),p=n(10),b=n.n(p),m=n(4);function v(e,t,n){var r=t[e];return"complex"===r.type&&r.value.forEach(function(e){n=e.fields.reduce(function(e,n){return v(n.id,t,e)},n)}),n.concat(e)}var O=Object(a.combineReducers)({containers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.containers;case"UPDATE_STATE":return b()(e,function(e){Object(u.values)(t.payload.containers).forEach(function(t){e[t.id]=t})});case"ADD_CONTAINER":return b()(e,function(e){e[t.payload.id]=t.payload});case"REMOVE_CONTAINER":return Object(u.omit)(e,t.payload);default:return e}},fields:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.fields;case"UPDATE_STATE":return b()(e,function(e){Object(u.values)(t.payload.fields).forEach(function(t){e[t.id]=t})});case"UPDATE_FIELD_VALUE":return b()(e,function(n){var r=t.payload,o=r.fieldId,i=r.value,c=r.fieldsToRemove;n[o].value=i,c.reduce(function(t,n){return v(n,e,t)},[]).forEach(function(e){Object(u.unset)(n,e)})});case"ADD_FIELDS":return b()(e,function(e){t.payload.fields.forEach(function(t){e[t.id]=t})});case"CLONE_FIELDS":return b()(e,function(e){var n=t.payload,r=n.originFieldIds,o=n.cloneFieldIds,i=r.reduce(function(t,n,r){return function e(t,n,r,o){var i=Object(u.cloneDeep)(r[t]);return i.id=n,"complex"===i.type&&i.value.forEach(function(t){t.id=Object(m.uniqueId)(),o=t.fields.reduce(function(t,n){var o=n.id,i=Object(m.uniqueId)();return n.id=i,e(o,i,r,t)},o)}),o.concat(i)}(n,o[r],e,t)},[]);Object(u.assign)(e,Object(u.keyBy)(i,"id"))});case"REMOVE_FIELDS":var n=t.payload.fieldIds.reduce(function(t,n){return v(n,e,t)},[]);return Object(u.omit)(e,n);case"RECEIVE_SIDEBAR":return b()(e,function(e){Object(u.forEach)(e,function(e){"sidebar"===e.type&&e.options.unshift(t.payload)})});default:return e}},savingLock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_SAVING":return f()({},e,l()({},t.payload.lockName,!0));case"UNLOCK_SAVING":return Object(u.omit)(e,[t.payload.lockName]);default:return e}},isDirty:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"UPDATE_FIELD_VALUE":return!0;default:return e}},isFieldUpdated:function(e,t){switch(t.type){case"UPDATE_FIELD_VALUE":return{action:t};default:return!1}}});function j(e,t){return{type:"SETUP_STATE",payload:{containers:e,fields:t}}}function y(e,t){return{type:"UPDATE_STATE",payload:{containers:e,fields:t}}}function g(e,t){return{type:"UPDATE_FIELD_VALUE",payload:{fieldId:e,value:t,fieldsToRemove:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]}}}function h(e){return{type:"ADD_FIELDS",payload:{fields:e}}}function _(e,t){return{type:"CLONE_FIELDS",payload:{originFieldIds:e,cloneFieldIds:t}}}function x(e){return{type:"REMOVE_FIELDS",payload:{fieldIds:e}}}function E(e){return{type:"ADD_CONTAINER",payload:e}}function w(e){return{type:"REMOVE_CONTAINER",payload:e}}function S(e){return{type:"RECEIVE_SIDEBAR",payload:e}}function I(e){return{type:"LOCK_SAVING",payload:{lockName:e}}}function F(e){return{type:"UNLOCK_SAVING",payload:{lockName:e}}}function T(e){return e.containers}function A(e,t){return e.containers[t]}function C(e){return e.fields}function D(e,t){return Object(u.filter)(e.fields,["container_id",t])}function N(e,t){return e.fields[t]}function k(e){return Object.keys(e.savingLock).length>0}function G(e){return e.isDirty}function P(e){return e.isFieldUpdated}function L(e,t){var n=Object(u.pick)(C(e),t);return n=Object(u.mapKeys)(n,function(e){return e.base_name.replace(/\-/g,"_")}),Object(u.mapValues)(n,function(e){return e.value})}var R=n(24);Object(a.registerStore)("carbon-fields/metaboxes",{reducer:O,actions:r,selectors:o});var B=Object(R.a)(Object(u.get)(window.cf,"preloaded.containers",[])),U=B.containers,V=B.fields;Object(a.dispatch)("carbon-fields/metaboxes").setupState(Object(u.keyBy)(U,"id"),Object(u.keyBy)(V,"id"));var q=n(11),Q=n(25),K=n(14),M=n.n(K),W=n(12);const $={};var z=n(15),H=n(1);function J(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return void 0===e?[]:Object(u.pick)(t,Object(u.difference)(Object(u.map)(e.fields,"id"),n))}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(u.map)(e,function(e){return[e.id,"".concat(Object(u.repeat)("parent.",t)).concat(e.base_name)]})}var Y=Object(m.withConditionalLogic)(function(e,t){var n=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId;return Object(H.pipe)(Object(H.merge)(Object(W.a)(n(e.containerId)),Object(m.fromSelector)(n,e.containerId)),(e=>t=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=$;t(0,(t,n)=>{if(0===t)return o=n,e(0,(e,t)=>{if(0!==e)return 1===e?(a=void 0,i(2),o(2),void(c&&r(2))):void(2===e&&(i=null,a=t,null!=t&&(o(2),c&&r(e,t))));(i=t)(1)}),c=!0,r(0,(e,t)=>{a===$&&(2===e&&i&&i(2),o(e,t))}),void(a!==$&&r(2,a));2===t&&i(2),a===$&&r(t,n)})})(t.unmount),Object(z.a)(u.isEqual))},function(e,t){t=Object(u.keyBy)(t,"id");var n=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),r=[];if(Object(u.some)(n.fields,["id",e.id]))r=X(r=J(n,t,[e.id]));else{var o=e.name.replace(new RegExp("^".concat(window.cf.config.compactInputKey,"\\[(.+?)\\]")),"$1"),i=Object(u.find)(t,function(t){return t.container_id===e.containerId&&Object(u.startsWith)(o,t.name)}),c=o.split(/\[|\]/g);c.shift(),(c=c.filter(function(e){return""!==e})).pop();var s=c.reduce(function(e,t){return isNaN(t)?e+1:e},0);r=X(r=J(n,t,[i.id]),s+1);for(var l="".concat(i.id,".value");c.length>0;){var d=c.shift(),f=!isNaN(d),p=!f;if(f){l="".concat(l,"[").concat(d,"]");var b=J(Object(u.get)(t,l),t,[e.id]);r=r.concat(X(b,s)),l="".concat(l,".fields")}if(p){var m=Object(u.find)(Object(u.get)(t,l),["name",d]);l="".concat(m.id,".value"),s--}}}return r=r.map(function(e){var n=M()(e,2),r=n[0];return[n[1],Object(u.get)(t,"".concat(r,".value"))]}),Object(u.fromPairs)(r)}),Z=n(21);function ee(e,t){return Object(u.find)(e,function(e){return e.name===t})}Object(c.addFilter)("carbon-fields.association.metabox","carbon-fields/metaboxes",Object(m.withProps)(function(e){return{hierarchyResolver:function(){var t,n,r,o,i=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),c=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId(e.containerId),s=(t=e.name,n=window.cf.config,r=n.compactInput,o=n.compactInputKey,r&&0===t.indexOf(o)?t.replace(new RegExp("^".concat(o,"\\[(.+?)\\]")),"$1"):t).split(/\[|\]/g);if(s=s.filter(function(e){return""!==e}),"widget"===i.type)return e.field.base_name;for(var l=ee(c,s.shift()),d=c.indexOf(l),f=l.base_name;s.length>0;){var p=s.shift(),b=!isNaN(p),m=p===e.field.base_name,v=!b&&!m;if(b&&(d="".concat(d,".value.").concat(p,".name"),f="".concat(f,"[").concat(p,"]:").concat(Object(u.get)(c,d),"/")),v){var O=ee(Object(u.get)(c,d.replace(/\.name$/,".fields")),p),j=Object(u.find)(c,["id",O.id]);d=c.indexOf(j),f="".concat(f).concat(j.base_name)}m&&(f="".concat(f).concat(p))}return f}}})),n(44),n(49),n(50),n(51),n(52),n(53),n(55),Object(c.addFilter)("carbon-fields.sidebar.metabox","carbon-fields/metaboxes",Object(a.withDispatch)(function(e){return{onAdded:e("carbon-fields/metaboxes").receiveSidebar}})),Object(c.addFilter)("carbon-fields.field-edit.metabox","carbon-fields/metaboxes",Object(q.compose)(Q.a,Y,Object(a.withDispatch)(function(e){if(Object(Z.a)()){var t=e("core/editor");return{lockSaving:t.lockPostSaving,unlockSaving:t.unlockPostSaving}}var n=e("carbon-fields/metaboxes");return{lockSaving:n.lockSaving,unlockSaving:n.unlockSaving}}),m.withValidation));var te=n(33),ne=n(22),re=n(19);n.d(t,"registerContainerType",function(){return re.b}),n.d(t,"getContainerType",function(){return re.a}),Object(i.setLocaleData)(window.cf.config.locale,"carbon-fields-ui");var oe=Object(Z.a)()?"gutenberg":"classic";Object(c.addAction)("carbon-fields.init","carbon-fields/metaboxes",function(){Object(ne.a)(oe),Object(te.a)(oe)})},function(e,t,n){"use strict";var r=n(11),o=n(3),i=n(4),c=n(2),a=Object(r.createHigherOrderComponent)(function(e){return Object(c.withSelect)(function(e,t){var n=t.id;return{container:e("carbon-fields/metaboxes").getContainerById(n)}})(e)},"withContainer");Object(o.addFilter)("carbon-fields.register-container-type","carbon-fields/metaboxes",function(e,t,n){return Object(r.compose)(a,Object(i.withFilters)("carbon-fields.".concat(e,".").concat(t)))(n)})}]); \ No newline at end of file diff --git a/build/gutenberg/metaboxes.js b/build/gutenberg/metaboxes.js index d05c127e..94cbb632 100644 --- a/build/gutenberg/metaboxes.js +++ b/build/gutenberg/metaboxes.js @@ -833,7 +833,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var call /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! immer */ \"immer\");\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(immer__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var callbag_start_with__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! callbag-start-with */ \"./node_modules/callbag-start-with/index.js\");\n/* harmony import */ var callbag_from_delegated_event__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! callbag-from-delegated-event */ \"./node_modules/callbag-from-delegated-event/index.js\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! callbag-basics */ \"callbag-basics\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(callbag_basics__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @carbon-fields/core */ \"@carbon-fields/core\");\n/* harmony import */ var _carbon_fields_core__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__);\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\n\n\n/**\n * Carbon Fields dependencies.\n */\n\n\n/**\n * Applies a monkey patch to the specified method of `window.tagBox` API\n * so we can detect changes of the non-hierarchical taxonomies.\n *\n * @param {Object} tagBox\n * @param {string} method\n * @return {void}\n */\n\nfunction patchWordPressTagBoxAPI(tagBox, method) {\n tagBox[\"original_\".concat(method)] = tagBox[method];\n\n tagBox[method] = function () {\n var event = new Event('change');\n var textarea = window.jQuery(arguments.length <= 0 ? undefined : arguments[0]).closest('.postbox').find('textarea.the-tags').get(0);\n var result = tagBox[\"original_\".concat(method)].apply(tagBox, arguments);\n textarea.dispatchEvent(event);\n return result;\n };\n}\n\nif (window.tagBox) {\n patchWordPressTagBoxAPI(window.tagBox, 'parseTags');\n patchWordPressTagBoxAPI(window.tagBox, 'flushTags');\n}\n/**\n * Extracts the terms of a hierarchical taxonomy.\n *\n * @param {string} taxonomy\n * @return {Object}\n */\n\n\nfunction getTermsFromChecklist(taxonomy) {\n var inputs = document.querySelectorAll(\"#\".concat(taxonomy, \"checklist input[type=\\\"checkbox\\\"]:checked\"));\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(inputs).reduce(function (memo, input) {\n var value = parseInt(input.value, 10);\n memo[taxonomy].push(value);\n return memo;\n }, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, []));\n}\n/**\n * Extracts the terms of a non-hierarchical taxonomy.\n *\n * @param {string} taxonomy\n * @return {Object}\n */\n\n\nfunction getTermsFromText(taxonomy) {\n var node = document.querySelector(\"#tagsdiv-\".concat(taxonomy, \" textarea.the-tags\"));\n var terms = node.value ? node.value.split(window.tagsSuggestL10n.tagDelimiter) : [];\n return _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, terms);\n}\n/**\n * Keeps track of the hierarchical taxonomies like `categories`.\n *\n * @return {Function}\n */\n\n\nfunction trackHierarchicalTaxonomies() {\n var nodes = document.querySelectorAll('div[id^=\"taxonomy-\"]');\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(nodes).map(function (node) {\n var taxonomy = node.id.replace('taxonomy-', '');\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(callbag_from_delegated_event__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(node.querySelector(\"#\".concat(taxonomy, \"checklist\")), 'input[type=\"checkbox\"]', 'change'), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"scan\"])(function (stack, _ref2) {\n var target = _ref2.target;\n return immer__WEBPACK_IMPORTED_MODULE_3___default()(stack, function (draft) {\n var value = parseInt(target.value, 10);\n\n if (target.checked) {\n draft[taxonomy].push(value);\n } else {\n Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"pull\"])(draft[taxonomy], value);\n }\n });\n }, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, [])), Object(callbag_start_with__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(getTermsFromChecklist(taxonomy)));\n });\n}\n/**\n * Keeps track of the non-hierarchical taxonomies like `tags`.\n *\n * @return {Function}\n */\n\n\nfunction trackNonHierarchicalTaxonomies() {\n var nodes = document.querySelectorAll('div[id^=\"tagsdiv-\"]');\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(nodes).map(function (node) {\n var taxonomy = node.id.replace('tagsdiv-', '');\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"fromEvent\"])(node.querySelector('textarea.the-tags'), 'change'), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"map\"])(function (_ref3) {\n var target = _ref3.target;\n return _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, target.value ? target.value.split(window.tagsSuggestL10n.tagDelimiter) : []);\n }), Object(callbag_start_with__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(getTermsFromText(taxonomy)));\n });\n}\n/**\n * Defines the side effects for Classic Editor.\n */\n\n\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__[\"addFilter\"])('carbon-fields.conditional-display-post-term.classic', 'carbon-fields/metaboxes', function () {\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"merge\"].apply(void 0, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(trackHierarchicalTaxonomies()).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(trackNonHierarchicalTaxonomies()))), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"scan\"])(function (previous, current) {\n return {\n post_term: _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, previous.post_term, current)\n };\n }, {\n post_term: {}\n }));\n});\n/**\n * Defines the side effects for Gutenberg.\n */\n\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__[\"addFilter\"])('carbon-fields.conditional-display-post-term.gutenberg', 'carbon-fields/metaboxes', function () {\n var _select = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__[\"select\"])('core'),\n getTaxonomies = _select.getTaxonomies;\n\n var _select2 = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__[\"select\"])('core/editor'),\n getEditedPostAttribute = _select2.getEditedPostAttribute; // Borrowed from https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/components/post-taxonomies/index.js\n\n\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(_carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__[\"fromSelector\"])(getTaxonomies, {\n per_page: -1\n }), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"filter\"])(Boolean), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"map\"])(function (taxonomies) {\n var pairs = taxonomies.map(function (taxonomy) {\n return [taxonomy.slug, getEditedPostAttribute(taxonomy.rest_base) || []];\n });\n return {\n post_term: Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"fromPairs\"])(pairs)\n };\n }));\n});\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/metaboxes/monitors/conditional-display/aperture/post-term.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! immer */ \"immer\");\n/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(immer__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var callbag_start_with__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! callbag-start-with */ \"./node_modules/callbag-start-with/index.js\");\n/* harmony import */ var callbag_from_delegated_event__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! callbag-from-delegated-event */ \"./node_modules/callbag-from-delegated-event/index.js\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! callbag-basics */ \"callbag-basics\");\n/* harmony import */ var callbag_basics__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(callbag_basics__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/hooks */ \"@wordpress/hooks\");\n/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ \"@wordpress/data\");\n/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @carbon-fields/core */ \"@carbon-fields/core\");\n/* harmony import */ var _carbon_fields_core__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__);\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\n\n\n/**\n * Carbon Fields dependencies.\n */\n\n\nvar TAGS_DELIMITER = ',';\n/**\n * Applies a monkey patch to the specified method of `window.tagBox` API\n * so we can detect changes of the non-hierarchical taxonomies.\n *\n * @param {Object} tagBox\n * @param {string} method\n * @return {void}\n */\n\nfunction patchWordPressTagBoxAPI(tagBox, method) {\n tagBox[\"original_\".concat(method)] = tagBox[method];\n\n tagBox[method] = function () {\n var event = new Event('change');\n var textarea = window.jQuery(arguments.length <= 0 ? undefined : arguments[0]).closest('.postbox').find('textarea.the-tags').get(0);\n var result = tagBox[\"original_\".concat(method)].apply(tagBox, arguments);\n textarea.dispatchEvent(event);\n return result;\n };\n}\n\nif (window.tagBox) {\n patchWordPressTagBoxAPI(window.tagBox, 'parseTags');\n patchWordPressTagBoxAPI(window.tagBox, 'flushTags');\n}\n/**\n * Extracts the terms of a hierarchical taxonomy.\n *\n * @param {string} taxonomy\n * @return {Object}\n */\n\n\nfunction getTermsFromChecklist(taxonomy) {\n var inputs = document.querySelectorAll(\"#\".concat(taxonomy, \"checklist input[type=\\\"checkbox\\\"]:checked\"));\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(inputs).reduce(function (memo, input) {\n var value = parseInt(input.value, 10);\n memo[taxonomy].push(value);\n return memo;\n }, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, []));\n}\n/**\n * Extracts the terms of a non-hierarchical taxonomy.\n *\n * @param {string} taxonomy\n * @return {Object}\n */\n\n\nfunction getTermsFromText(taxonomy) {\n var node = document.querySelector(\"#tagsdiv-\".concat(taxonomy, \" textarea.the-tags\"));\n var terms = node.value ? node.value.split(TAGS_DELIMITER) : [];\n return _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, terms);\n}\n/**\n * Keeps track of the hierarchical taxonomies like `categories`.\n *\n * @return {Function}\n */\n\n\nfunction trackHierarchicalTaxonomies() {\n var nodes = document.querySelectorAll('div[id^=\"taxonomy-\"]');\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(nodes).map(function (node) {\n var taxonomy = node.id.replace('taxonomy-', '');\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(callbag_from_delegated_event__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(node.querySelector(\"#\".concat(taxonomy, \"checklist\")), 'input[type=\"checkbox\"]', 'change'), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"scan\"])(function (stack, _ref2) {\n var target = _ref2.target;\n return immer__WEBPACK_IMPORTED_MODULE_3___default()(stack, function (draft) {\n var value = parseInt(target.value, 10);\n\n if (target.checked) {\n draft[taxonomy].push(value);\n } else {\n Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"pull\"])(draft[taxonomy], value);\n }\n });\n }, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, [])), Object(callbag_start_with__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(getTermsFromChecklist(taxonomy)));\n });\n}\n/**\n * Keeps track of the non-hierarchical taxonomies like `tags`.\n *\n * @return {Function}\n */\n\n\nfunction trackNonHierarchicalTaxonomies() {\n var nodes = document.querySelectorAll('div[id^=\"tagsdiv-\"]');\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(nodes).map(function (node) {\n var taxonomy = node.id.replace('tagsdiv-', '');\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"fromEvent\"])(node.querySelector('textarea.the-tags'), 'change'), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"map\"])(function (_ref3) {\n var target = _ref3.target;\n return _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, taxonomy, target.value ? target.value.split(TAGS_DELIMITER) : []);\n }), Object(callbag_start_with__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(getTermsFromText(taxonomy)));\n });\n}\n/**\n * Defines the side effects for Classic Editor.\n */\n\n\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__[\"addFilter\"])('carbon-fields.conditional-display-post-term.classic', 'carbon-fields/metaboxes', function () {\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"merge\"].apply(void 0, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(trackHierarchicalTaxonomies()).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(trackNonHierarchicalTaxonomies()))), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"scan\"])(function (previous, current) {\n return {\n post_term: _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, previous.post_term, current)\n };\n }, {\n post_term: {}\n }));\n});\n/**\n * Defines the side effects for Gutenberg.\n */\n\nObject(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_7__[\"addFilter\"])('carbon-fields.conditional-display-post-term.gutenberg', 'carbon-fields/metaboxes', function () {\n var _select = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__[\"select\"])('core'),\n getTaxonomies = _select.getTaxonomies;\n\n var _select2 = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_8__[\"select\"])('core/editor'),\n getEditedPostAttribute = _select2.getEditedPostAttribute; // Borrowed from https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/components/post-taxonomies/index.js\n\n\n return Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"pipe\"])(Object(_carbon_fields_core__WEBPACK_IMPORTED_MODULE_10__[\"fromSelector\"])(getTaxonomies, {\n per_page: -1\n }), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"filter\"])(Boolean), Object(callbag_basics__WEBPACK_IMPORTED_MODULE_6__[\"map\"])(function (taxonomies) {\n var pairs = taxonomies.map(function (taxonomy) {\n return [taxonomy.slug, getEditedPostAttribute(taxonomy.rest_base) || []];\n });\n return {\n post_term: Object(lodash__WEBPACK_IMPORTED_MODULE_9__[\"fromPairs\"])(pairs)\n };\n }));\n});\n\n//# sourceURL=webpack://cf.%5Bname%5D/./packages/metaboxes/monitors/conditional-display/aperture/post-term.js?"); /***/ }), diff --git a/build/gutenberg/metaboxes.min.js b/build/gutenberg/metaboxes.min.js index 58c094fd..7a4a4966 100644 --- a/build/gutenberg/metaboxes.min.js +++ b/build/gutenberg/metaboxes.min.js @@ -1 +1 @@ -this.cf=this.cf||{},this.cf.metaboxes=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=41)}([function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.cf.vendor["callbag-basics"]}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t){!function(){e.exports=this.cf.core}()},function(e,t,n){var r=n(8);e.exports=function(e){for(var t=1;tt=>(n,r)=>{if(0!==n)return;let o;t(0,(t,n)=>{0===t?(o=n,r(t,n)):1===t?e(n)?r(t,n):o(1):r(t,n)})})},function(e,t){e.exports=(e=>(t,n)=>{if(0!==t)return;if("function"!=typeof e)return n(0,()=>{}),void n(2);let r,o;const i=e=>{(r=r||2===e)&&"function"==typeof o&&o()};n(0,i),o=e((e,t)=>{r||0===e||(n(e,t),i(e))})})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(e){return n(e)}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(t)}e.exports=r},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.containers;case"UPDATE_STATE":return m()(e,function(e){Object(u.values)(t.payload.containers).forEach(function(t){e[t.id]=t})});case"ADD_CONTAINER":return m()(e,function(e){e[t.payload.id]=t.payload});case"REMOVE_CONTAINER":return Object(u.omit)(e,t.payload);default:return e}},fields:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.fields;case"UPDATE_STATE":return m()(e,function(e){Object(u.values)(t.payload.fields).forEach(function(t){e[t.id]=t})});case"UPDATE_FIELD_VALUE":return m()(e,function(n){var r=t.payload,o=r.fieldId,i=r.value,c=r.fieldsToRemove;n[o].value=i,c.reduce(function(t,n){return O(n,e,t)},[]).forEach(function(e){Object(u.unset)(n,e)})});case"ADD_FIELDS":return m()(e,function(e){t.payload.fields.forEach(function(t){e[t.id]=t})});case"CLONE_FIELDS":return m()(e,function(e){var n=t.payload,r=n.originFieldIds,o=n.cloneFieldIds,i=r.reduce(function(t,n,r){return function e(t,n,r,o){var i=Object(u.cloneDeep)(r[t]);return i.id=n,"complex"===i.type&&i.value.forEach(function(t){t.id=Object(v.uniqueId)(),o=t.fields.reduce(function(t,n){var o=n.id,i=Object(v.uniqueId)();return n.id=i,e(o,i,r,t)},o)}),o.concat(i)}(n,o[r],e,t)},[]);Object(u.assign)(e,Object(u.keyBy)(i,"id"))});case"REMOVE_FIELDS":var n=t.payload.fieldIds.reduce(function(t,n){return O(n,e,t)},[]);return Object(u.omit)(e,n);case"RECEIVE_SIDEBAR":return m()(e,function(e){Object(u.forEach)(e,function(e){"sidebar"===e.type&&e.options.unshift(t.payload)})});default:return e}},savingLock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_SAVING":return p()({},e,d()({},t.payload.lockName,!0));case"UNLOCK_SAVING":return Object(u.omit)(e,[t.payload.lockName]);default:return e}},isDirty:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"UPDATE_FIELD_VALUE":return!0;default:return e}},isFieldUpdated:function(e,t){switch(t.type){case"UPDATE_FIELD_VALUE":return{action:t};default:return!1}}});function g(e,t){return{type:"SETUP_STATE",payload:{containers:e,fields:t}}}function y(e,t){return{type:"UPDATE_STATE",payload:{containers:e,fields:t}}}function h(e,t){return{type:"UPDATE_FIELD_VALUE",payload:{fieldId:e,value:t,fieldsToRemove:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]}}}function w(e){return{type:"ADD_FIELDS",payload:{fields:e}}}function x(e,t){return{type:"CLONE_FIELDS",payload:{originFieldIds:e,cloneFieldIds:t}}}function E(e){return{type:"REMOVE_FIELDS",payload:{fieldIds:e}}}function S(e){return{type:"ADD_CONTAINER",payload:e}}function I(e){return{type:"REMOVE_CONTAINER",payload:e}}function F(e){return{type:"RECEIVE_SIDEBAR",payload:e}}function T(e){return{type:"LOCK_SAVING",payload:{lockName:e}}}function A(e){return{type:"UNLOCK_SAVING",payload:{lockName:e}}}function C(e){return e.containers}function D(e,t){return e.containers[t]}function N(e){return e.fields}function k(e,t){return Object(u.filter)(e.fields,["container_id",t])}function G(e,t){return e.fields[t]}function L(e){return Object.keys(e.savingLock).length>0}function P(e){return e.isDirty}function R(e){return e.isFieldUpdated}function B(e,t){var n=Object(u.pick)(N(e),t);return n=Object(u.mapKeys)(n,function(e){return e.base_name.replace(/\-/g,"_")}),Object(u.mapValues)(n,function(e){return e.value})}function U(e,t,n){return(e=Object(u.cloneDeep)(e)).id=Object(v.uniqueId)(),e.container_id=t,"complex"===e.type&&e.value.forEach(function(e){e.id=Object(v.uniqueId)(),e.container_id=t,e.fields=e.fields.map(function(e){return U(e,t,n)})}),n.push(e),Object(u.pick)(e,["id","type","name","base_name"])}function V(e){var t=[];return{containers:e.filter(function(e){var t=e.id;return!Object(u.endsWith)(t,"__i__")}).map(function(e){return Object(u.assign)({},e,{fields:e.fields.map(function(n){return U(n,e.id,t)})})}),fields:t}}Object(a.registerStore)("carbon-fields/metaboxes",{reducer:j,actions:r,selectors:o});var q=V(Object(u.get)(window.cf,"preloaded.containers",[])),Q=q.containers,K=q.fields;Object(a.dispatch)("carbon-fields/metaboxes").setupState(Object(u.keyBy)(Q,"id"),Object(u.keyBy)(K,"id"));var M=n(10),W=Object(M.createHigherOrderComponent)(function(e){var t=Object(a.withSelect)(function(e,t){var n=window.cf.config,r=n.compactInput,o=n.compactInputKey,i=e("carbon-fields/metaboxes").getFieldById(t.id),c=i&&i.value,a=t.name||i.name;return r&&!t.name&&-1===a.indexOf("widget-carbon_fields")&&(a="".concat(o,"[").concat(a,"]")),{field:i,name:a,value:c}}),n=Object(a.withDispatch)(function(e){return{onChange:e("carbon-fields/metaboxes").updateFieldValue}});return Object(M.compose)(t,n)(e)},"withField"),$=n(13),z=n.n($),H=function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:[];return void 0===e?[]:Object(u.pick)(t,Object(u.difference)(Object(u.map)(e.fields,"id"),n))}function te(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(u.map)(e,function(e){return[e.id,"".concat(Object(u.repeat)("parent.",t)).concat(e.base_name)]})}var ne=Object(v.withConditionalLogic)(function(e,t){var n=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId;return Object(Z.pipe)(Object(Z.merge)(H(n(e.containerId)),Object(v.fromSelector)(n,e.containerId)),(e=>t=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=J;t(0,(t,n)=>{if(0===t)return o=n,e(0,(e,t)=>{if(0!==e)return 1===e?(a=void 0,i(2),o(2),void(c&&r(2))):void(2===e&&(i=null,a=t,null!=t&&(o(2),c&&r(e,t))));(i=t)(1)}),c=!0,r(0,(e,t)=>{a===J&&(2===e&&i&&i(2),o(e,t))}),void(a!==J&&r(2,a));2===t&&i(2),a===J&&r(t,n)})})(t.unmount),Y(u.isEqual))},function(e,t){t=Object(u.keyBy)(t,"id");var n=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),r=[];if(Object(u.some)(n.fields,["id",e.id]))r=te(r=ee(n,t,[e.id]));else{var o=e.name.replace(new RegExp("^".concat(window.cf.config.compactInputKey,"\\[(.+?)\\]")),"$1"),i=Object(u.find)(t,function(t){return t.container_id===e.containerId&&Object(u.startsWith)(o,t.name)}),c=o.split(/\[|\]/g);c.shift(),(c=c.filter(function(e){return""!==e})).pop();var l=c.reduce(function(e,t){return isNaN(t)?e+1:e},0);r=te(r=ee(n,t,[i.id]),l+1);for(var s="".concat(i.id,".value");c.length>0;){var d=c.shift(),f=!isNaN(d),p=!f;if(f){s="".concat(s,"[").concat(d,"]");var b=ee(Object(u.get)(t,s),t,[e.id]);r=r.concat(te(b,l)),s="".concat(s,".fields")}if(p){var m=Object(u.find)(Object(u.get)(t,s),["name",d]);s="".concat(m.id,".value"),l--}}}return r=r.map(function(e){var n=z()(e,2),r=n[0];return[n[1],Object(u.get)(t,"".concat(r,".value"))]}),Object(u.fromPairs)(r)});function re(){return!Object(u.isUndefined)(window._wpLoadBlockEditor)}function oe(e,t){return Object(u.find)(e,function(e){return e.name===t})}Object(c.addFilter)("carbon-fields.association.metabox","carbon-fields/metaboxes",Object(v.withProps)(function(e){return{hierarchyResolver:function(){var t,n,r,o,i=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),c=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId(e.containerId),l=(t=e.name,n=window.cf.config,r=n.compactInput,o=n.compactInputKey,r&&0===t.indexOf(o)?t.replace(new RegExp("^".concat(o,"\\[(.+?)\\]")),"$1"):t).split(/\[|\]/g);if(l=l.filter(function(e){return""!==e}),"widget"===i.type)return e.field.base_name;for(var s=oe(c,l.shift()),d=c.indexOf(s),f=s.base_name;l.length>0;){var p=l.shift(),b=!isNaN(p),m=p===e.field.base_name,v=!b&&!m;if(b&&(d="".concat(d,".value.").concat(p,".name"),f="".concat(f,"[").concat(p,"]:").concat(Object(u.get)(c,d),"/")),v){var O=oe(Object(u.get)(c,d.replace(/\.name$/,".fields")),p),j=Object(u.find)(c,["id",O.id]);d=c.indexOf(j),f="".concat(f).concat(j.base_name)}m&&(f="".concat(f).concat(p))}return f}}}));var ie=n(16),ce=n.n(ie),ae=n(17),ue=n.n(ae),le=n(18),se=n.n(le),de=n(19),fe=n.n(de),pe=n(20),be=n.n(pe),me=n(7),ve=n.n(me),Oe=n(12),je=(n(29),n(30),Object(M.compose)(W,Object(v.withFilters)("carbon-fields.field-wrapper.metabox"))(v.Field)),ge=function(e){function t(){var e,n;ce()(this,t);for(var r=arguments.length,o=new Array(r),i=0;it=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=!1;for(r(0,(t,n)=>{a&&1===t&&(i=[1,n]),2===t&&(c=!0,e.length=0),o&&o(t,n)});0!==e.length;)1===e.length&&(a=!0),r(1,e.shift());c||t(0,(e,t)=>{if(0===e)return o=t,a=!1,void(i&&(o(...i),i=null));r(e,t)})};function Ie(e){var t=parseInt(e.value,10);return!isNaN(t)&&t>=0?t:0}function Fe(e){var t=0;if(e.className){var n=e.className.match(/^level-(\d+)/);n&&(t=parseInt(n[1],10)+1)}return t}function Te(e){for(var t=[],n=e,r=Fe(e);r>0&&n;)if(Fe(n)===r){var o=parseInt(n.value,10);o>0&&t.unshift(o),n=n.previousSibling,r--}else n=n.previousSibling;return t}var Ae={post_ancestors:[],post_parent_id:0,post_level:1};function Ce(e){var t=e.options[e.selectedIndex];return{post_ancestors:Te(t),post_parent_id:Ie(t),post_level:Fe(t)+1}}Object(c.addFilter)("carbon-fields.conditional-display-post-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent_id");return e?Object(Z.pipe)(Object(Z.fromEvent)(e,"change"),Object(Z.map)(function(e){return Ce(e.target)}),Se(Ce(e))):H(Ae)}),Object(c.addFilter)("carbon-fields.conditional-display-post-parent.gutenberg","carbon-fields/metaboxes",function(){var e=Object(a.select)("core"),t=e.getPostType,n=e.getEntityRecords;return Object(Z.pipe)(Object(Z.combine)(Object(v.fromSelector)(Object(a.select)("core/editor").getCurrentPostId),Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"type"),Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"parent")),Y(u.isEqual),Object(Z.map)(function(e){var r=z()(e,3),o=r[0],i=r[1],c=r[2];if(c=parseInt(c,10),isNaN(c))return Ae;var a=t(i);if(!Object(u.get)(a,["hierarchical"],!1))return Ae;var l=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=Object(u.find)(n,["id",t]);return o?(r.unshift(o.id),o.parent?e(o.parent,n,r):r):r}(c,n("postType",i,{per_page:-1,exclude:o,parent_exclude:o,orderby:"menu_order",order:"asc"})||[]);return{post_ancestors:l,post_parent_id:c,post_level:l.length+1}}))});var De=n(22),Ne=n.n(De),ke=(e,t,n)=>Ne()(n=>{let r=n.target;for(;r!==e;){if(r.matches(t))return!0;r=r.parentElement}return!1})(((e,t,n)=>(r,o)=>{if(0!==r)return;let i=!1;const c=e=>{o(1,e)};o(0,r=>{2===r&&(i=!0,e.removeEventListener(t,c,n))}),i||e.addEventListener(t,c,n)})(e,n)),Ge={post_format:"standard"};function Le(e){var t=e.value;return"0"===t&&(t="standard"),{post_format:t}}Object(c.addFilter)("carbon-fields.conditional-display-post-format.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("div#post-formats-select");return e?Object(Z.pipe)(ke(e,"input.post-format","change"),Object(Z.map)(function(e){return Le(e.target)}),Se(Le(e.querySelector("input.post-format:checked")))):H(Ge)}),Object(c.addFilter)("carbon-fields.conditional-display-post-format.gutenberg","carbon-fields/metaboxes",function(){return Object(Z.pipe)(Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"format"),Y(),Object(Z.filter)(Boolean),Object(Z.map)(function(e){return{post_format:e}}),Se(Ge))});var Pe={post_template:""};function Re(e){var t=e.value;return"default"===t&&(t=""),{post_template:t}}Object(c.addFilter)("carbon-fields.conditional-display-post-template.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#page_template");return e?Object(Z.pipe)(Object(Z.fromEvent)(e,"change"),Object(Z.map)(function(e){return Re(e.target)}),Se(Re(e))):H(Pe)}),Object(c.addFilter)("carbon-fields.conditional-display-post-template.gutenberg","carbon-fields/metaboxes",function(){return Object(Z.pipe)(Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"template"),Y(),Object(Z.filter)(u.isString),Object(Z.map)(function(e){return{post_template:e}}),Se(Pe))});var Be=n(15),Ue=n.n(Be);function Ve(e,t){e["original_".concat(t)]=e[t],e[t]=function(){var n=new Event("change"),r=window.jQuery(arguments.length<=0?void 0:arguments[0]).closest(".postbox").find("textarea.the-tags").get(0),o=e["original_".concat(t)].apply(e,arguments);return r.dispatchEvent(n),o}}window.tagBox&&(Ve(window.tagBox,"parseTags"),Ve(window.tagBox,"flushTags")),Object(c.addFilter)("carbon-fields.conditional-display-post-term.classic","carbon-fields/metaboxes",function(){return Object(Z.pipe)(Z.merge.apply(void 0,Ue()((e=document.querySelectorAll('div[id^="taxonomy-"]'),Ue()(e).map(function(e){var t=e.id.replace("taxonomy-","");return Object(Z.pipe)(ke(e.querySelector("#".concat(t,"checklist")),'input[type="checkbox"]',"change"),Object(Z.scan)(function(e,n){var r=n.target;return m()(e,function(e){var n=parseInt(r.value,10);r.checked?e[t].push(n):Object(u.pull)(e[t],n)})},d()({},t,[])),Se(function(e){var t=document.querySelectorAll("#".concat(e,'checklist input[type="checkbox"]:checked'));return Ue()(t).reduce(function(t,n){var r=parseInt(n.value,10);return t[e].push(r),t},d()({},e,[]))}(t)))}))).concat(Ue()(function(){var e=document.querySelectorAll('div[id^="tagsdiv-"]');return Ue()(e).map(function(e){var t=e.id.replace("tagsdiv-","");return Object(Z.pipe)(Object(Z.fromEvent)(e.querySelector("textarea.the-tags"),"change"),Object(Z.map)(function(e){var n=e.target;return d()({},t,n.value?n.value.split(window.tagsSuggestL10n.tagDelimiter):[])}),Se(function(e){var t=document.querySelector("#tagsdiv-".concat(e," textarea.the-tags")),n=t.value?t.value.split(window.tagsSuggestL10n.tagDelimiter):[];return d()({},e,n)}(t)))})}()))),Object(Z.scan)(function(e,t){return{post_term:p()({},e.post_term,t)}},{post_term:{}}));var e}),Object(c.addFilter)("carbon-fields.conditional-display-post-term.gutenberg","carbon-fields/metaboxes",function(){var e=Object(a.select)("core").getTaxonomies,t=Object(a.select)("core/editor").getEditedPostAttribute;return Object(Z.pipe)(Object(v.fromSelector)(e,{per_page:-1}),Object(Z.filter)(Boolean),Object(Z.map)(function(e){var n=e.map(function(e){return[e.slug,t(e.rest_base)||[]]});return{post_term:Object(u.fromPairs)(n)}}))});var qe={term_ancestors:[],term_parent:0,term_level:1};function Qe(e){var t=e.options[e.selectedIndex];return{term_ancestors:Te(t),term_parent:Ie(t),term_level:Fe(t)+1}}Object(c.addFilter)("carbon-fields.conditional-display-term-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent");return e?Object(Z.pipe)(Object(Z.fromEvent)(e,"change"),Object(Z.map)(function(e){return Qe(e.target)}),Se(Qe(e))):H(qe)});var Ke={user_role:""};function Me(e){return{user_role:e.value}}Object(c.addFilter)("carbon-fields.conditional-display-user-role.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#role");if(!e){var t=document.querySelector("fieldset[data-profile-role]");return H(t?{user_role:t.dataset.profileRole}:Ke)}return Object(Z.pipe)(Object(Z.fromEvent)(e,"change"),Object(Z.map)(function(e){return Me(e.target)}),Se(Me(e)))});var We=Object(M.createHigherOrderComponent)(function(e){return Object(a.withSelect)(function(e,t){var n=t.id;return{container:e("carbon-fields/metaboxes").getContainerById(n)}})(e)},"withContainer");Object(c.addFilter)("carbon-fields.register-container-type","carbon-fields/metaboxes",function(e,t,n){return Object(M.compose)(We,Object(v.withFilters)("carbon-fields.".concat(e,".").concat(t)))(n)}),n(37),Object(c.addFilter)("carbon-fields.widget.classic","carbon-fields/metaboxes",Object(xe.withEffects)(function(){return Object(v.fromSelector)(Object(a.select)("carbon-fields/metaboxes").isFieldUpdated)},{handler:function(e){return function(t){var n=t.action;if(n){var r=e.container,o=n.payload;r.fields.map(function(e){return e.id}).indexOf(o.fieldId)>=0&&window.jQuery(".container-".concat(r.id)).closest(".widget-inside").trigger("change")}}}}));var $e=n(23),ze=n.n($e);function He(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.data.indexOf("add-tag")>-1&&!n.documentElement.querySelector("wp_error")}))},{handler:function(e){return function(){var t=l.a.map(e.container.fields,"id"),n=V(l.a.get(window.cf,"preloaded.containers",[])),r=n.containers,o=n.fields,i=l.a.find(r,["id",e.id]),c=l.a.filter(o,["container_id",e.id]),u=Object(a.dispatch)("carbon-fields/metaboxes"),s=u.updateState,d=u.removeFields;s(l.a.keyBy([i],"id"),l.a.keyBy(c,"id")),d(t)}}})),n(38),Object(c.addFilter)("carbon-fields.theme_options.classic","carbon-fields/metaboxes",Object(xe.withEffects)(function(){return Object(Z.pipe)(Object(Z.fromEvent)(window,"scroll"),Object(Z.map)(function(){return window.jQuery(window).scrollTop()}))},{handler:function(){return function(e){var t=window.jQuery(".carbon-box:first"),n=window.jQuery("#postbox-container-1"),r=window.jQuery("#wpadminbar").height()+10,o=t.offset().top-r;o>0&&n.toggleClass("fixed",e>=o).css("top",r)}}})),n(39);var Je=n(21),Xe=n.n(Je),Ye=(n(40),function(e){function t(){var e,n;ce()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i-1},evaluate:function(){return!1}},ot={comparers:[p()({},rt,{operators:["=","!="],evaluate:function(e,t,n){switch(t){case"=":return e==n;case"!=":return e!=n;default:return!1}}}),p()({},rt,{operators:["IN","NOT IN"],evaluate:function(e,t,n){switch(t){case"IN":return n.indexOf(e)>-1;case"NOT IN":return-1===n.indexOf(e);default:return!1}}}),p()({},rt,{operators:[">",">=","<","<="],evaluate:function(e,t,n){switch(t){case">":return e>n;case">=":return e>=n;case"<":return e0;case"NOT IN":return 0===Object(u.intersection)(e,n).length;default:return!1}}}),st=p()({},ot,{comparers:[ct,lt],getEnvironmentValue:function(e,t){return Object(u.get)(t,"post_ancestors",[])}}),dt=p()({},ot,{isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(u.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(u.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)}}),ft=p()({},ot,{comparers:[ct,lt],isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(u.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(u.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)},getEnvironmentValue:function(e,t){return Object(u.get)(t,"term_ancestors",[])}}),pt={boolean:it,post_term:at,post_ancestor_id:st,post_parent_id:ot,post_level:ot,post_format:ot,post_template:ut,term_level:ot,term_parent:dt,term_ancestor:ft,user_role:ot},bt=Object(a.withSelect)(function(e){return{containers:e("carbon-fields/metaboxes").getContainers()}}),mt=Object(xe.withEffects)(function(e,t){var n=t.context,r=Object(c.applyFilters)("carbon-fields.conditional-display-post-parent.".concat(n)),o=Object(c.applyFilters)("carbon-fields.conditional-display-post-format.".concat(n)),i=Object(c.applyFilters)("carbon-fields.conditional-display-post-template.".concat(n)),a=Object(c.applyFilters)("carbon-fields.conditional-display-post-term.".concat(n)),l=Object(c.applyFilters)("carbon-fields.conditional-display-term-parent.".concat(n)),s=Object(c.applyFilters)("carbon-fields.conditional-display-user-role.".concat(n));return Object(Z.pipe)(Object(Z.merge)(r,o,i,a,l,s),Object(Z.scan)(function(e,t){return m()(e,function(e){Object(u.assign)(e,t)})}))},{handler:function(e){var t=e.containers,n=e.context;return function(e){Object(u.map)(t,function(t,n){return[n,function e(t,n,r){var o=t.map(function(t){if(t.relation)return e(t.conditions,n,t.relation);var r=Object(u.get)(pt,t.type);return r?r.isFulfiled(t,n):(console.error(Object(i.sprintf)(Object(i.__)('Unsupported container condition - "%1$s".',"carbon-fields-ui"),t.type)),!1)});switch(r){case"AND":return o.every(Boolean);case"OR":return o.some(Boolean);default:return console.error(Object(i.sprintf)(Object(i.__)('Unsupported container condition relation used - "%1$s".',"carbon-fields-ui"),r)),!1}}(t.conditions.conditions,e,t.conditions.relation)]}).forEach(function(e){var r=z()(e,2),o=r[0],i=r[1],c=document.getElementById(o),a=document.querySelector(".container-".concat(o)),u=!!a.dataset.mounted;c&&(c.hidden=!i),a&&(i&&!u&&nt(t[o],n),!i&&u&&(delete a.dataset.mounted,a._reactRootContainer.unmount()))})}}}),vt=Object(M.compose)(bt,mt)(function(){return null});function Ot(e){return decodeURIComponent((e+"").replace(/%(?![\da-f]{2})/gi,function(){return"%25"}).replace(/\+/g,"%20"))}var jt="customize.php",gt="carbon_fields_container_",yt=Object(xe.withEffects)(function(){return Object(Z.merge)(Object(Z.pipe)(He(function(e){return window.jQuery(document).on("widget-added widget-updated",e)},function(e){return window.jQuery(document).off("widget-added widget-updated",e)},function(e,t){return{event:e,$widget:t}}),Object(Z.filter)(function(e){return e.$widget[0].id.indexOf("carbon_fields_")>-1}),Object(Z.map)(function(e){return{type:"WIDGET_CREATED_OR_UPDATED",payload:e}})),Object(Z.pipe)(He(function(e){return window.jQuery(document).on("ajaxSend",e)},function(e){return window.jQuery(document).off("ajaxSend",e)},function(e,t,n,r){return{event:e,xhr:t,options:n,data:r}}),Object(Z.filter)(function(e){var t=e.options;return Object(u.startsWith)(t.data,gt)}),Object(Z.map)(function(e){return{type:"WIDGET_BEIGN_UPDATED_OR_DELETED",payload:e}})))},{handler:function(){return function(e){var t=Object(a.select)("carbon-fields/metaboxes").getContainerById,n=Object(a.dispatch)("carbon-fields/metaboxes"),r=n.addContainer,o=n.removeContainer,i=n.addFields,c=n.removeFields;switch(e.type){case"WIDGET_CREATED_OR_UPDATED":var l=e.payload,s=l.event,d=l.$widget,f=Object(u.flow)(Ot,JSON.parse)(d.find("[data-json]").data("json")),p=[];if(f.fields=f.fields.map(function(e){return U(e,f,p)}),i(p),r(f),nt(f,"classic"),window.cf.config.pagenow===jt&&"widget-added"===s.type){var b=d.find('[name="widget-id"]').val();d.find('[name="savewidget"]').show().end().find(".widget-content:first").off("keydown","input").off("change input propertychange",":input"),wp.customize.Widgets.getWidgetFormControlForWidget(b).liveUpdateMode=!1}break;case"WIDGET_BEIGN_UPDATED_OR_DELETED":var m=e.payload.options.data.match(/widget-id=(.+?)&/),v=z()(m,2)[1],O="".concat(gt).concat(v),j=t(O);Object(Oe.unmountComponentAtNode)(document.querySelector(".container-".concat(O)));var g=_.map(j.fields,"id");o(O),c(g)}}}})(function(){return null}),ht=Object(a.withSelect)(function(e){return{isDirty:e("carbon-fields/metaboxes").isDirty()}})(function(e){return wp.element.createElement("input",{type:"hidden",name:window.cf.config.revisionsInputKey,disabled:!e.isDirty,value:"1"})});n.d(t,"registerContainerType",function(){return et}),n.d(t,"getContainerType",function(){return tt}),Object(i.setLocaleData)(window.cf.config.locale,"carbon-fields-ui");var _t=re()?"gutenberg":"classic";Object(c.addAction)("carbon-fields.init","carbon-fields/metaboxes",function(){var e,t;e=_t,t=Object(a.select)("carbon-fields/metaboxes").getContainers(),Object(u.forEach)(t,function(t){nt(t,e)}),function(e){var t=window.cf.config.pagenow;Object(Oe.render)(wp.element.createElement(Oe.Fragment,null,!re()&&wp.element.createElement(Ee,null),("widgets.php"===t||t===jt)&&wp.element.createElement(yt,null),wp.element.createElement(vt,{context:e})),document.createElement("div"));var n=document.querySelector("#poststuff");n&&Object(Oe.render)(wp.element.createElement(ht,null),n.appendChild(document.createElement("div")))}(_t)})}]); \ No newline at end of file +this.cf=this.cf||{},this.cf.metaboxes=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=41)}([function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.cf.vendor["callbag-basics"]}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t){!function(){e.exports=this.cf.core}()},function(e,t,n){var r=n(8);e.exports=function(e){for(var t=1;tt=>(n,r)=>{if(0!==n)return;let o;t(0,(t,n)=>{0===t?(o=n,r(t,n)):1===t?e(n)?r(t,n):o(1):r(t,n)})})},function(e,t){e.exports=(e=>(t,n)=>{if(0!==t)return;if("function"!=typeof e)return n(0,()=>{}),void n(2);let r,o;const i=e=>{(r=r||2===e)&&"function"==typeof o&&o()};n(0,i),o=e((e,t)=>{r||0===e||(n(e,t),i(e))})})},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(e){return n(e)}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(t)}e.exports=r},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.containers;case"UPDATE_STATE":return m()(e,function(e){Object(u.values)(t.payload.containers).forEach(function(t){e[t.id]=t})});case"ADD_CONTAINER":return m()(e,function(e){e[t.payload.id]=t.payload});case"REMOVE_CONTAINER":return Object(u.omit)(e,t.payload);default:return e}},fields:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SETUP_STATE":return t.payload.fields;case"UPDATE_STATE":return m()(e,function(e){Object(u.values)(t.payload.fields).forEach(function(t){e[t.id]=t})});case"UPDATE_FIELD_VALUE":return m()(e,function(n){var r=t.payload,o=r.fieldId,i=r.value,c=r.fieldsToRemove;n[o].value=i,c.reduce(function(t,n){return O(n,e,t)},[]).forEach(function(e){Object(u.unset)(n,e)})});case"ADD_FIELDS":return m()(e,function(e){t.payload.fields.forEach(function(t){e[t.id]=t})});case"CLONE_FIELDS":return m()(e,function(e){var n=t.payload,r=n.originFieldIds,o=n.cloneFieldIds,i=r.reduce(function(t,n,r){return function e(t,n,r,o){var i=Object(u.cloneDeep)(r[t]);return i.id=n,"complex"===i.type&&i.value.forEach(function(t){t.id=Object(v.uniqueId)(),o=t.fields.reduce(function(t,n){var o=n.id,i=Object(v.uniqueId)();return n.id=i,e(o,i,r,t)},o)}),o.concat(i)}(n,o[r],e,t)},[]);Object(u.assign)(e,Object(u.keyBy)(i,"id"))});case"REMOVE_FIELDS":var n=t.payload.fieldIds.reduce(function(t,n){return O(n,e,t)},[]);return Object(u.omit)(e,n);case"RECEIVE_SIDEBAR":return m()(e,function(e){Object(u.forEach)(e,function(e){"sidebar"===e.type&&e.options.unshift(t.payload)})});default:return e}},savingLock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOCK_SAVING":return p()({},e,d()({},t.payload.lockName,!0));case"UNLOCK_SAVING":return Object(u.omit)(e,[t.payload.lockName]);default:return e}},isDirty:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"UPDATE_FIELD_VALUE":return!0;default:return e}},isFieldUpdated:function(e,t){switch(t.type){case"UPDATE_FIELD_VALUE":return{action:t};default:return!1}}});function y(e,t){return{type:"SETUP_STATE",payload:{containers:e,fields:t}}}function g(e,t){return{type:"UPDATE_STATE",payload:{containers:e,fields:t}}}function h(e,t){return{type:"UPDATE_FIELD_VALUE",payload:{fieldId:e,value:t,fieldsToRemove:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]}}}function w(e){return{type:"ADD_FIELDS",payload:{fields:e}}}function x(e,t){return{type:"CLONE_FIELDS",payload:{originFieldIds:e,cloneFieldIds:t}}}function E(e){return{type:"REMOVE_FIELDS",payload:{fieldIds:e}}}function S(e){return{type:"ADD_CONTAINER",payload:e}}function I(e){return{type:"REMOVE_CONTAINER",payload:e}}function F(e){return{type:"RECEIVE_SIDEBAR",payload:e}}function T(e){return{type:"LOCK_SAVING",payload:{lockName:e}}}function A(e){return{type:"UNLOCK_SAVING",payload:{lockName:e}}}function C(e){return e.containers}function D(e,t){return e.containers[t]}function N(e){return e.fields}function k(e,t){return Object(u.filter)(e.fields,["container_id",t])}function G(e,t){return e.fields[t]}function P(e){return Object.keys(e.savingLock).length>0}function L(e){return e.isDirty}function R(e){return e.isFieldUpdated}function B(e,t){var n=Object(u.pick)(N(e),t);return n=Object(u.mapKeys)(n,function(e){return e.base_name.replace(/\-/g,"_")}),Object(u.mapValues)(n,function(e){return e.value})}function U(e,t,n){return(e=Object(u.cloneDeep)(e)).id=Object(v.uniqueId)(),e.container_id=t,"complex"===e.type&&e.value.forEach(function(e){e.id=Object(v.uniqueId)(),e.container_id=t,e.fields=e.fields.map(function(e){return U(e,t,n)})}),n.push(e),Object(u.pick)(e,["id","type","name","base_name"])}function V(e){var t=[];return{containers:e.filter(function(e){var t=e.id;return!Object(u.endsWith)(t,"__i__")}).map(function(e){return Object(u.assign)({},e,{fields:e.fields.map(function(n){return U(n,e.id,t)})})}),fields:t}}Object(a.registerStore)("carbon-fields/metaboxes",{reducer:j,actions:r,selectors:o});var q=V(Object(u.get)(window.cf,"preloaded.containers",[])),Q=q.containers,K=q.fields;Object(a.dispatch)("carbon-fields/metaboxes").setupState(Object(u.keyBy)(Q,"id"),Object(u.keyBy)(K,"id"));var M=n(10),W=Object(M.createHigherOrderComponent)(function(e){var t=Object(a.withSelect)(function(e,t){var n=window.cf.config,r=n.compactInput,o=n.compactInputKey,i=e("carbon-fields/metaboxes").getFieldById(t.id),c=i&&i.value,a=t.name||i.name;return r&&!t.name&&-1===a.indexOf("widget-carbon_fields")&&(a="".concat(o,"[").concat(a,"]")),{field:i,name:a,value:c}}),n=Object(a.withDispatch)(function(e){return{onChange:e("carbon-fields/metaboxes").updateFieldValue}});return Object(M.compose)(t,n)(e)},"withField"),$=n(13),z=n.n($),H=function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:[];return void 0===e?[]:Object(u.pick)(t,Object(u.difference)(Object(u.map)(e.fields,"id"),n))}function te(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object(u.map)(e,function(e){return[e.id,"".concat(Object(u.repeat)("parent.",t)).concat(e.base_name)]})}var ne=Object(v.withConditionalLogic)(function(e,t){var n=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId;return Object(Z.pipe)(Object(Z.merge)(H(n(e.containerId)),Object(v.fromSelector)(n,e.containerId)),(e=>t=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=J;t(0,(t,n)=>{if(0===t)return o=n,e(0,(e,t)=>{if(0!==e)return 1===e?(a=void 0,i(2),o(2),void(c&&r(2))):void(2===e&&(i=null,a=t,null!=t&&(o(2),c&&r(e,t))));(i=t)(1)}),c=!0,r(0,(e,t)=>{a===J&&(2===e&&i&&i(2),o(e,t))}),void(a!==J&&r(2,a));2===t&&i(2),a===J&&r(t,n)})})(t.unmount),Y(u.isEqual))},function(e,t){t=Object(u.keyBy)(t,"id");var n=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),r=[];if(Object(u.some)(n.fields,["id",e.id]))r=te(r=ee(n,t,[e.id]));else{var o=e.name.replace(new RegExp("^".concat(window.cf.config.compactInputKey,"\\[(.+?)\\]")),"$1"),i=Object(u.find)(t,function(t){return t.container_id===e.containerId&&Object(u.startsWith)(o,t.name)}),c=o.split(/\[|\]/g);c.shift(),(c=c.filter(function(e){return""!==e})).pop();var l=c.reduce(function(e,t){return isNaN(t)?e+1:e},0);r=te(r=ee(n,t,[i.id]),l+1);for(var s="".concat(i.id,".value");c.length>0;){var d=c.shift(),f=!isNaN(d),p=!f;if(f){s="".concat(s,"[").concat(d,"]");var b=ee(Object(u.get)(t,s),t,[e.id]);r=r.concat(te(b,l)),s="".concat(s,".fields")}if(p){var m=Object(u.find)(Object(u.get)(t,s),["name",d]);s="".concat(m.id,".value"),l--}}}return r=r.map(function(e){var n=z()(e,2),r=n[0];return[n[1],Object(u.get)(t,"".concat(r,".value"))]}),Object(u.fromPairs)(r)});function re(){return!Object(u.isUndefined)(window._wpLoadBlockEditor)}function oe(e,t){return Object(u.find)(e,function(e){return e.name===t})}Object(c.addFilter)("carbon-fields.association.metabox","carbon-fields/metaboxes",Object(v.withProps)(function(e){return{hierarchyResolver:function(){var t,n,r,o,i=Object(a.select)("carbon-fields/metaboxes").getContainerById(e.containerId),c=Object(a.select)("carbon-fields/metaboxes").getFieldsByContainerId(e.containerId),l=(t=e.name,n=window.cf.config,r=n.compactInput,o=n.compactInputKey,r&&0===t.indexOf(o)?t.replace(new RegExp("^".concat(o,"\\[(.+?)\\]")),"$1"):t).split(/\[|\]/g);if(l=l.filter(function(e){return""!==e}),"widget"===i.type)return e.field.base_name;for(var s=oe(c,l.shift()),d=c.indexOf(s),f=s.base_name;l.length>0;){var p=l.shift(),b=!isNaN(p),m=p===e.field.base_name,v=!b&&!m;if(b&&(d="".concat(d,".value.").concat(p,".name"),f="".concat(f,"[").concat(p,"]:").concat(Object(u.get)(c,d),"/")),v){var O=oe(Object(u.get)(c,d.replace(/\.name$/,".fields")),p),j=Object(u.find)(c,["id",O.id]);d=c.indexOf(j),f="".concat(f).concat(j.base_name)}m&&(f="".concat(f).concat(p))}return f}}}));var ie=n(16),ce=n.n(ie),ae=n(17),ue=n.n(ae),le=n(18),se=n.n(le),de=n(19),fe=n.n(de),pe=n(20),be=n.n(pe),me=n(7),ve=n.n(me),Oe=n(12),je=(n(29),n(30),Object(M.compose)(W,Object(v.withFilters)("carbon-fields.field-wrapper.metabox"))(v.Field)),ye=function(e){function t(){var e,n;ce()(this,t);for(var r=arguments.length,o=new Array(r),i=0;it=>(n,r)=>{if(0!==n)return;let o,i,c=!1,a=!1;for(r(0,(t,n)=>{a&&1===t&&(i=[1,n]),2===t&&(c=!0,e.length=0),o&&o(t,n)});0!==e.length;)1===e.length&&(a=!0),r(1,e.shift());c||t(0,(e,t)=>{if(0===e)return o=t,a=!1,void(i&&(o(...i),i=null));r(e,t)})};function Ie(e){var t=parseInt(e.value,10);return!isNaN(t)&&t>=0?t:0}function Fe(e){var t=0;if(e.className){var n=e.className.match(/^level-(\d+)/);n&&(t=parseInt(n[1],10)+1)}return t}function Te(e){for(var t=[],n=e,r=Fe(e);r>0&&n;)if(Fe(n)===r){var o=parseInt(n.value,10);o>0&&t.unshift(o),n=n.previousSibling,r--}else n=n.previousSibling;return t}var Ae={post_ancestors:[],post_parent_id:0,post_level:1};function Ce(e){var t=e.options[e.selectedIndex];return{post_ancestors:Te(t),post_parent_id:Ie(t),post_level:Fe(t)+1}}Object(c.addFilter)("carbon-fields.conditional-display-post-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent_id");return e?Object(Z.pipe)(Object(Z.fromEvent)(e,"change"),Object(Z.map)(function(e){return Ce(e.target)}),Se(Ce(e))):H(Ae)}),Object(c.addFilter)("carbon-fields.conditional-display-post-parent.gutenberg","carbon-fields/metaboxes",function(){var e=Object(a.select)("core"),t=e.getPostType,n=e.getEntityRecords;return Object(Z.pipe)(Object(Z.combine)(Object(v.fromSelector)(Object(a.select)("core/editor").getCurrentPostId),Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"type"),Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"parent")),Y(u.isEqual),Object(Z.map)(function(e){var r=z()(e,3),o=r[0],i=r[1],c=r[2];if(c=parseInt(c,10),isNaN(c))return Ae;var a=t(i);if(!Object(u.get)(a,["hierarchical"],!1))return Ae;var l=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=Object(u.find)(n,["id",t]);return o?(r.unshift(o.id),o.parent?e(o.parent,n,r):r):r}(c,n("postType",i,{per_page:-1,exclude:o,parent_exclude:o,orderby:"menu_order",order:"asc"})||[]);return{post_ancestors:l,post_parent_id:c,post_level:l.length+1}}))});var De=n(22),Ne=n.n(De),ke=(e,t,n)=>Ne()(n=>{let r=n.target;for(;r!==e;){if(r.matches(t))return!0;r=r.parentElement}return!1})(((e,t,n)=>(r,o)=>{if(0!==r)return;let i=!1;const c=e=>{o(1,e)};o(0,r=>{2===r&&(i=!0,e.removeEventListener(t,c,n))}),i||e.addEventListener(t,c,n)})(e,n)),Ge={post_format:"standard"};function Pe(e){var t=e.value;return"0"===t&&(t="standard"),{post_format:t}}Object(c.addFilter)("carbon-fields.conditional-display-post-format.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("div#post-formats-select");return e?Object(Z.pipe)(ke(e,"input.post-format","change"),Object(Z.map)(function(e){return Pe(e.target)}),Se(Pe(e.querySelector("input.post-format:checked")))):H(Ge)}),Object(c.addFilter)("carbon-fields.conditional-display-post-format.gutenberg","carbon-fields/metaboxes",function(){return Object(Z.pipe)(Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"format"),Y(),Object(Z.filter)(Boolean),Object(Z.map)(function(e){return{post_format:e}}),Se(Ge))});var Le={post_template:""};function Re(e){var t=e.value;return"default"===t&&(t=""),{post_template:t}}Object(c.addFilter)("carbon-fields.conditional-display-post-template.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#page_template");return e?Object(Z.pipe)(Object(Z.fromEvent)(e,"change"),Object(Z.map)(function(e){return Re(e.target)}),Se(Re(e))):H(Le)}),Object(c.addFilter)("carbon-fields.conditional-display-post-template.gutenberg","carbon-fields/metaboxes",function(){return Object(Z.pipe)(Object(v.fromSelector)(Object(a.select)("core/editor").getEditedPostAttribute,"template"),Y(),Object(Z.filter)(u.isString),Object(Z.map)(function(e){return{post_template:e}}),Se(Le))});var Be=n(15),Ue=n.n(Be),Ve=",";function qe(e,t){e["original_".concat(t)]=e[t],e[t]=function(){var n=new Event("change"),r=window.jQuery(arguments.length<=0?void 0:arguments[0]).closest(".postbox").find("textarea.the-tags").get(0),o=e["original_".concat(t)].apply(e,arguments);return r.dispatchEvent(n),o}}window.tagBox&&(qe(window.tagBox,"parseTags"),qe(window.tagBox,"flushTags")),Object(c.addFilter)("carbon-fields.conditional-display-post-term.classic","carbon-fields/metaboxes",function(){return Object(Z.pipe)(Z.merge.apply(void 0,Ue()((e=document.querySelectorAll('div[id^="taxonomy-"]'),Ue()(e).map(function(e){var t=e.id.replace("taxonomy-","");return Object(Z.pipe)(ke(e.querySelector("#".concat(t,"checklist")),'input[type="checkbox"]',"change"),Object(Z.scan)(function(e,n){var r=n.target;return m()(e,function(e){var n=parseInt(r.value,10);r.checked?e[t].push(n):Object(u.pull)(e[t],n)})},d()({},t,[])),Se(function(e){var t=document.querySelectorAll("#".concat(e,'checklist input[type="checkbox"]:checked'));return Ue()(t).reduce(function(t,n){var r=parseInt(n.value,10);return t[e].push(r),t},d()({},e,[]))}(t)))}))).concat(Ue()(function(){var e=document.querySelectorAll('div[id^="tagsdiv-"]');return Ue()(e).map(function(e){var t=e.id.replace("tagsdiv-","");return Object(Z.pipe)(Object(Z.fromEvent)(e.querySelector("textarea.the-tags"),"change"),Object(Z.map)(function(e){var n=e.target;return d()({},t,n.value?n.value.split(Ve):[])}),Se(function(e){var t=document.querySelector("#tagsdiv-".concat(e," textarea.the-tags")),n=t.value?t.value.split(Ve):[];return d()({},e,n)}(t)))})}()))),Object(Z.scan)(function(e,t){return{post_term:p()({},e.post_term,t)}},{post_term:{}}));var e}),Object(c.addFilter)("carbon-fields.conditional-display-post-term.gutenberg","carbon-fields/metaboxes",function(){var e=Object(a.select)("core").getTaxonomies,t=Object(a.select)("core/editor").getEditedPostAttribute;return Object(Z.pipe)(Object(v.fromSelector)(e,{per_page:-1}),Object(Z.filter)(Boolean),Object(Z.map)(function(e){var n=e.map(function(e){return[e.slug,t(e.rest_base)||[]]});return{post_term:Object(u.fromPairs)(n)}}))});var Qe={term_ancestors:[],term_parent:0,term_level:1};function Ke(e){var t=e.options[e.selectedIndex];return{term_ancestors:Te(t),term_parent:Ie(t),term_level:Fe(t)+1}}Object(c.addFilter)("carbon-fields.conditional-display-term-parent.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#parent");return e?Object(Z.pipe)(Object(Z.fromEvent)(e,"change"),Object(Z.map)(function(e){return Ke(e.target)}),Se(Ke(e))):H(Qe)});var Me={user_role:""};function We(e){return{user_role:e.value}}Object(c.addFilter)("carbon-fields.conditional-display-user-role.classic","carbon-fields/metaboxes",function(){var e=document.querySelector("select#role");if(!e){var t=document.querySelector("fieldset[data-profile-role]");return H(t?{user_role:t.dataset.profileRole}:Me)}return Object(Z.pipe)(Object(Z.fromEvent)(e,"change"),Object(Z.map)(function(e){return We(e.target)}),Se(We(e)))});var $e=Object(M.createHigherOrderComponent)(function(e){return Object(a.withSelect)(function(e,t){var n=t.id;return{container:e("carbon-fields/metaboxes").getContainerById(n)}})(e)},"withContainer");Object(c.addFilter)("carbon-fields.register-container-type","carbon-fields/metaboxes",function(e,t,n){return Object(M.compose)($e,Object(v.withFilters)("carbon-fields.".concat(e,".").concat(t)))(n)}),n(37),Object(c.addFilter)("carbon-fields.widget.classic","carbon-fields/metaboxes",Object(xe.withEffects)(function(){return Object(v.fromSelector)(Object(a.select)("carbon-fields/metaboxes").isFieldUpdated)},{handler:function(e){return function(t){var n=t.action;if(n){var r=e.container,o=n.payload;r.fields.map(function(e){return e.id}).indexOf(o.fieldId)>=0&&window.jQuery(".container-".concat(r.id)).closest(".widget-inside").trigger("change")}}}}));var ze=n(23),He=n.n(ze);function Je(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&t.data.indexOf("add-tag")>-1&&!n.documentElement.querySelector("wp_error")}))},{handler:function(e){return function(){var t=l.a.map(e.container.fields,"id"),n=V(l.a.get(window.cf,"preloaded.containers",[])),r=n.containers,o=n.fields,i=l.a.find(r,["id",e.id]),c=l.a.filter(o,["container_id",e.id]),u=Object(a.dispatch)("carbon-fields/metaboxes"),s=u.updateState,d=u.removeFields;s(l.a.keyBy([i],"id"),l.a.keyBy(c,"id")),d(t)}}})),n(38),Object(c.addFilter)("carbon-fields.theme_options.classic","carbon-fields/metaboxes",Object(xe.withEffects)(function(){return Object(Z.pipe)(Object(Z.fromEvent)(window,"scroll"),Object(Z.map)(function(){return window.jQuery(window).scrollTop()}))},{handler:function(){return function(e){var t=window.jQuery(".carbon-box:first"),n=window.jQuery("#postbox-container-1"),r=window.jQuery("#wpadminbar").height()+10,o=t.offset().top-r;o>0&&n.toggleClass("fixed",e>=o).css("top",r)}}})),n(39);var Xe=n(21),Ye=n.n(Xe),Ze=(n(40),function(e){function t(){var e,n;ce()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i-1},evaluate:function(){return!1}},it={comparers:[p()({},ot,{operators:["=","!="],evaluate:function(e,t,n){switch(t){case"=":return e==n;case"!=":return e!=n;default:return!1}}}),p()({},ot,{operators:["IN","NOT IN"],evaluate:function(e,t,n){switch(t){case"IN":return n.indexOf(e)>-1;case"NOT IN":return-1===n.indexOf(e);default:return!1}}}),p()({},ot,{operators:[">",">=","<","<="],evaluate:function(e,t,n){switch(t){case">":return e>n;case">=":return e>=n;case"<":return e0;case"NOT IN":return 0===Object(u.intersection)(e,n).length;default:return!1}}}),dt=p()({},it,{comparers:[at,st],getEnvironmentValue:function(e,t){return Object(u.get)(t,"post_ancestors",[])}}),ft=p()({},it,{isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(u.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(u.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)}}),pt=p()({},it,{comparers:[at,st],isFulfiled:function(e,t){var n=e.compare,r=e.value;return Object(u.isArray)(r)?r=r.map(function(e){return e.term_object.term_id}):Object(u.isPlainObject)(r)&&(r=r.term_object.term_id),this.firstComparerIsCorrect(this.getEnvironmentValue(e,t),n,r)},getEnvironmentValue:function(e,t){return Object(u.get)(t,"term_ancestors",[])}}),bt={boolean:ct,post_term:ut,post_ancestor_id:dt,post_parent_id:it,post_level:it,post_format:it,post_template:lt,term_level:it,term_parent:ft,term_ancestor:pt,user_role:it},mt=Object(a.withSelect)(function(e){return{containers:e("carbon-fields/metaboxes").getContainers()}}),vt=Object(xe.withEffects)(function(e,t){var n=t.context,r=Object(c.applyFilters)("carbon-fields.conditional-display-post-parent.".concat(n)),o=Object(c.applyFilters)("carbon-fields.conditional-display-post-format.".concat(n)),i=Object(c.applyFilters)("carbon-fields.conditional-display-post-template.".concat(n)),a=Object(c.applyFilters)("carbon-fields.conditional-display-post-term.".concat(n)),l=Object(c.applyFilters)("carbon-fields.conditional-display-term-parent.".concat(n)),s=Object(c.applyFilters)("carbon-fields.conditional-display-user-role.".concat(n));return Object(Z.pipe)(Object(Z.merge)(r,o,i,a,l,s),Object(Z.scan)(function(e,t){return m()(e,function(e){Object(u.assign)(e,t)})}))},{handler:function(e){var t=e.containers,n=e.context;return function(e){Object(u.map)(t,function(t,n){return[n,function e(t,n,r){var o=t.map(function(t){if(t.relation)return e(t.conditions,n,t.relation);var r=Object(u.get)(bt,t.type);return r?r.isFulfiled(t,n):(console.error(Object(i.sprintf)(Object(i.__)('Unsupported container condition - "%1$s".',"carbon-fields-ui"),t.type)),!1)});switch(r){case"AND":return o.every(Boolean);case"OR":return o.some(Boolean);default:return console.error(Object(i.sprintf)(Object(i.__)('Unsupported container condition relation used - "%1$s".',"carbon-fields-ui"),r)),!1}}(t.conditions.conditions,e,t.conditions.relation)]}).forEach(function(e){var r=z()(e,2),o=r[0],i=r[1],c=document.getElementById(o),a=document.querySelector(".container-".concat(o)),u=!!a.dataset.mounted;c&&(c.hidden=!i),a&&(i&&!u&&rt(t[o],n),!i&&u&&(delete a.dataset.mounted,a._reactRootContainer.unmount()))})}}}),Ot=Object(M.compose)(mt,vt)(function(){return null});function jt(e){return decodeURIComponent((e+"").replace(/%(?![\da-f]{2})/gi,function(){return"%25"}).replace(/\+/g,"%20"))}var yt="customize.php",gt="carbon_fields_container_",ht=Object(xe.withEffects)(function(){return Object(Z.merge)(Object(Z.pipe)(Je(function(e){return window.jQuery(document).on("widget-added widget-updated",e)},function(e){return window.jQuery(document).off("widget-added widget-updated",e)},function(e,t){return{event:e,$widget:t}}),Object(Z.filter)(function(e){return e.$widget[0].id.indexOf("carbon_fields_")>-1}),Object(Z.map)(function(e){return{type:"WIDGET_CREATED_OR_UPDATED",payload:e}})),Object(Z.pipe)(Je(function(e){return window.jQuery(document).on("ajaxSend",e)},function(e){return window.jQuery(document).off("ajaxSend",e)},function(e,t,n,r){return{event:e,xhr:t,options:n,data:r}}),Object(Z.filter)(function(e){var t=e.options;return Object(u.startsWith)(t.data,gt)}),Object(Z.map)(function(e){return{type:"WIDGET_BEIGN_UPDATED_OR_DELETED",payload:e}})))},{handler:function(){return function(e){var t=Object(a.select)("carbon-fields/metaboxes").getContainerById,n=Object(a.dispatch)("carbon-fields/metaboxes"),r=n.addContainer,o=n.removeContainer,i=n.addFields,c=n.removeFields;switch(e.type){case"WIDGET_CREATED_OR_UPDATED":var l=e.payload,s=l.event,d=l.$widget,f=Object(u.flow)(jt,JSON.parse)(d.find("[data-json]").data("json")),p=[];if(f.fields=f.fields.map(function(e){return U(e,f,p)}),i(p),r(f),rt(f,"classic"),window.cf.config.pagenow===yt&&"widget-added"===s.type){var b=d.find('[name="widget-id"]').val();d.find('[name="savewidget"]').show().end().find(".widget-content:first").off("keydown","input").off("change input propertychange",":input"),wp.customize.Widgets.getWidgetFormControlForWidget(b).liveUpdateMode=!1}break;case"WIDGET_BEIGN_UPDATED_OR_DELETED":var m=e.payload.options.data.match(/widget-id=(.+?)&/),v=z()(m,2)[1],O="".concat(gt).concat(v),j=t(O);Object(Oe.unmountComponentAtNode)(document.querySelector(".container-".concat(O)));var y=_.map(j.fields,"id");o(O),c(y)}}}})(function(){return null}),_t=Object(a.withSelect)(function(e){return{isDirty:e("carbon-fields/metaboxes").isDirty()}})(function(e){return wp.element.createElement("input",{type:"hidden",name:window.cf.config.revisionsInputKey,disabled:!e.isDirty,value:"1"})});n.d(t,"registerContainerType",function(){return tt}),n.d(t,"getContainerType",function(){return nt}),Object(i.setLocaleData)(window.cf.config.locale,"carbon-fields-ui");var wt=re()?"gutenberg":"classic";Object(c.addAction)("carbon-fields.init","carbon-fields/metaboxes",function(){var e,t;e=wt,t=Object(a.select)("carbon-fields/metaboxes").getContainers(),Object(u.forEach)(t,function(t){rt(t,e)}),function(e){var t=window.cf.config.pagenow;Object(Oe.render)(wp.element.createElement(Oe.Fragment,null,!re()&&wp.element.createElement(Ee,null),("widgets.php"===t||t===yt)&&wp.element.createElement(ht,null),wp.element.createElement(Ot,{context:e})),document.createElement("div"));var n=document.querySelector("#poststuff");n&&Object(Oe.render)(wp.element.createElement(_t,null),n.appendChild(document.createElement("div")))}(wt)})}]); \ No newline at end of file