/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "./assets/src/js/admin/metabox/Metabox.jsx":
/*!*************************************************!*\
  !*** ./assets/src/js/admin/metabox/Metabox.jsx ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Metabox)\n/* harmony export */ });\n/* harmony import */ var _js_admin_metabox_MetaboxContent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/admin/metabox/MetaboxContent */ \"./assets/src/js/admin/metabox/MetaboxContent.jsx\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ \"@wordpress/components\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\nfunction Metabox() {\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null),\n    _useState2 = _slicedToArray(_useState, 2),\n    postId = _useState2[0],\n    setPostId = _useState2[1];\n  var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null),\n    _useState4 = _slicedToArray(_useState3, 2),\n    metaboxContent = _useState4[0],\n    setMetaboxContent = _useState4[1]; // Initial state is null\n\n  var fetchMetaboxData = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function () {\n    if (postId !== null) {\n      fetch(WP_REST.url + \"postsync/fetchMetaboxData?child_post_id=\".concat(postId), {\n        method: 'GET',\n        headers: {\n          'X-WP-Nonce': WP_REST.nonce,\n          'Content-Type': 'application/json'\n        }\n      }).then(function (response) {\n        return response.json();\n      }).then(function (data) {\n        if (data) {\n          setMetaboxContent(data); // Update state with fetched data\n        }\n      })[\"catch\"](function (error) {\n        return console.error('Error:', error);\n      });\n    }\n  }, [postId]);\n  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {\n    if (postId !== null) {\n      fetchMetaboxData();\n    }\n  }, [postId, fetchMetaboxData]);\n  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {\n    if (typeof wp !== \"undefined\" && wp.data && wp.data.select('core/editor')) {\n      var interval = setInterval(function () {\n        var currentPostId = wp.data.select('core/editor').getCurrentPostId();\n        if (Number.isInteger(currentPostId)) {\n          clearInterval(interval);\n          setPostId(currentPostId);\n        } else if (typeof post_ID !== \"undefined\") {\n          // currentPostId can be null and will load forever, so set backup postId\n          clearInterval(interval);\n          setPostId(Number.parseInt(post_ID.value));\n        }\n      }, 200);\n      return function () {\n        return clearInterval(interval);\n      };\n    } else if (typeof post_ID !== \"undefined\") {\n      setPostId(Number.parseInt(post_ID.value));\n    }\n  }, []);\n  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {\n    if (typeof wp !== \"undefined\" && wp.data && wp.data.select('core/edit-post')) {\n      var wasSaving = wp.data.select('core/edit-post').isSavingMetaBoxes();\n      var unsubscribe = wp.data.subscribe(function () {\n        var isSaving = wp.data.select('core/edit-post').isSavingMetaBoxes();\n        var isDoneSaving = wasSaving && !isSaving;\n        wasSaving = isSaving;\n        if (isDoneSaving) {\n          setPostId(wp.data.select('core/editor').getCurrentPostId());\n          fetchMetaboxData();\n        }\n      });\n      return function () {\n        return unsubscribe();\n      };\n    }\n  }, [fetchMetaboxData]);\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", null, metaboxContent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_js_admin_metabox_MetaboxContent__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n    data: metaboxContent,\n    fetchMetaboxData: fetchMetaboxData\n  }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n    style: {\n      display: 'flex',\n      alignItems: 'center'\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {\n    style: {\n      width: 'auto',\n      height: 'auto',\n      display: 'inline-block',\n      margin: '10px',\n      position: 'relative',\n      overflow: 'visible',\n      right: 'auto',\n      top: 'auto',\n      zIndex: 'auto'\n    }\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"p\", null, \"Loading sync data...\")));\n}\n;\n\n//# sourceURL=webpack://post-sync/./assets/src/js/admin/metabox/Metabox.jsx?");

/***/ }),

/***/ "./assets/src/js/admin/metabox/MetaboxContent.jsx":
/*!********************************************************!*\
  !*** ./assets/src/js/admin/metabox/MetaboxContent.jsx ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ \"@wordpress/components\");\n/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\nvar MetaBoxContent = function MetaBoxContent(_ref) {\n  var data = _ref.data,\n    fetchMetaboxData = _ref.fetchMetaboxData;\n  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({\n      //Select modal\n      isSlugModalOpen: false,\n      selectedSiteId: null,\n      //Delete modal\n      isDeleteModalOpen: false,\n      childBlogIdToDelete: null,\n      childPostIdToDelete: null,\n      //Options\n      overwriteSiteIds: data && data.options && data.options.overwriteSiteIds ? data.options.overwriteSiteIds : []\n    }),\n    _useState2 = _slicedToArray(_useState, 2),\n    state = _useState2[0],\n    setState = _useState2[1];\n  var handleCheckboxChange = function handleCheckboxChange(e, site_id) {\n    if (!e.target.checked) {\n      return; // If the checkbox is not checked, we don't do anything\n    }\n\n    setState(function (prevState) {\n      return _objectSpread(_objectSpread({}, prevState), {}, {\n        isSlugModalOpen: true,\n        selectedSiteId: site_id\n      });\n    });\n  };\n  var closeSlugModal = function closeSlugModal() {\n    setState(function (prevState) {\n      return _objectSpread(_objectSpread({}, prevState), {}, {\n        isSlugModalOpen: false,\n        selectedSiteId: null\n      });\n    });\n  };\n  var confirmDeleteSite = function confirmDeleteSite() {\n    var childBlogIdToDelete = state.childBlogIdToDelete,\n      childPostIdToDelete = state.childPostIdToDelete;\n    console.log('Delete confirmed' + childBlogIdToDelete + \"/\" + childPostIdToDelete);\n    fetch(WP_REST.url + 'postsync/deleteChildPost', {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        'X-WP-Nonce': WP_REST.nonce\n      },\n      body: JSON.stringify({\n        child_post_id: childPostIdToDelete,\n        child_blog_id: childBlogIdToDelete\n      })\n    }).then(function (response) {\n      if (response.ok) {\n        fetchMetaboxData();\n      }\n      return response.json();\n    })[\"catch\"](function (error) {\n      return console.error('Error:', error);\n    });\n    closeDeleteModal();\n  };\n  var closeDeleteModal = function closeDeleteModal() {\n    setState(function (prevState) {\n      return _objectSpread(_objectSpread({}, prevState), {}, {\n        isDeleteModalOpen: false,\n        childBlogIdToDelete: null,\n        childPostIdToDelete: null\n      });\n    });\n  };\n  var confirmOverWriteSlug = function confirmOverWriteSlug() {\n    setState(function (prevState) {\n      return _objectSpread(_objectSpread({}, prevState), {}, {\n        overwriteSiteIds: [].concat(_toConsumableArray(prevState.overwriteSiteIds), [state.selectedSiteId])\n      });\n    });\n    closeSlugModal();\n  };\n  var removeOverwriteSlug = function removeOverwriteSlug() {\n    setState(function (prevState) {\n      return _objectSpread(_objectSpread({}, prevState), {}, {\n        overwriteSiteIds: prevState.overwriteSiteIds.filter(function (id) {\n          return id !== state.selectedSiteId;\n        })\n      });\n    });\n    closeSlugModal();\n  };\n  var isSlugModalOpen = state.isSlugModalOpen,\n    selectedSiteId = state.selectedSiteId,\n    isDeleteModalOpen = state.isDeleteModalOpen;\n  var disconnectChild = function disconnectChild(e, childPostId) {\n    e.preventDefault();\n    fetch(WP_REST.url + 'postsync/disconnectChild', {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        'X-WP-Nonce': WP_REST.nonce\n      },\n      body: JSON.stringify({\n        child_post_id: childPostId\n      })\n    }).then(function (response) {\n      if (response.ok) {\n        fetch(WP_REST.url + \"postsync/fetchMetaboxData?child_post_id=\".concat(childPostId), {\n          method: 'GET',\n          headers: {\n            'Content-Type': 'application/json',\n            'X-WP-Nonce': WP_REST.nonce\n          }\n        }).then(function (response) {\n          if (response.ok) {\n            fetchMetaboxData();\n          }\n          return response.json();\n        }).then(function (data) {\n          return console.log(data);\n        })[\"catch\"](function (error) {\n          return console.error('Error:', error);\n        });\n      }\n      return response.json();\n    }).then(function (data) {\n      return console.log(data);\n    })[\"catch\"](function (error) {\n      return console.error('Error:', error);\n    });\n  };\n  var deleteSite = function deleteSite(e, childBlogId, childPostId) {\n    e.preventDefault(); // prevent the default action (navigation)\n\n    setState({\n      isDeleteModalOpen: true,\n      childBlogIdToDelete: childBlogId,\n      childPostIdToDelete: childPostId\n    });\n  };\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, data.parentBlog && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    className: \"mt-2 pb-2\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h3\", null, \"Post is linked to parent blog:\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"label\", null, \"\".concat(data.parentBlog.site_name, \" | \"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Tooltip, {\n    position: \"top\",\n    text: \"Disconnect from parent blog\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n    id: \"disconnectBtn\",\n    className: \"postsync-disconnectBtn \".concat(!data.parentBlog.can_disconnect && \"disabled\"),\n    childPostId: data.parentBlog.child_post_id,\n    onClick: data.parentBlog.can_disconnect && function (e) {\n      return disconnectChild(e, data.parentBlog.child_post_id);\n    }\n  }, ' ', /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n    fill: data.parentBlog.can_disconnect ? \"blue\" : \"gray\",\n    width: \"16px\",\n    height: \"16px\",\n    viewBox: \"0 0 1024 1024\",\n    xmlns: \"http://www.w3.org/2000/svg\",\n    className: \"icon\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n    d: \"M250.857 224.571l-146.286-146.286c-4-3.429-8.571-5.143-13.143-5.143s-9.143 1.714-13.143 5.143c-6.857 7.429-6.857 18.857 0 26.286l146.286 146.286c7.429 6.857 18.857 6.857 26.286 0 6.857-7.429 6.857-18.857 0-26.286zM347.429 201.143v-182.857c0-10.286-8-18.286-18.286-18.286s-18.286 8-18.286 18.286v182.857c0 10.286 8 18.286 18.286 18.286s18.286-8 18.286-18.286zM219.429 329.143c0-10.286-8-18.286-18.286-18.286h-182.857c-10.286 0-18.286 8-18.286 18.286s8 18.286 18.286 18.286h182.857c10.286 0 18.286-8 18.286-18.286zM941.714 256c0-44-17.143-85.143-48.571-116l-84-83.429c-30.857-30.857-72-47.429-116-47.429s-85.714 17.143-116.571 48.571l-190.857 191.429c-9.714 9.714-17.143 20.571-24 32l136.571 10.286 156-156.571c20.571-20.571 57.143-21.143 77.714-0.571l84 83.429c10.286 10.286 16 24 16 38.286 0 14.857-5.714 28.571-16 38.857l-156.571 157.143 10.286 136.571c11.429-6.857 22.286-14.286 32-24l192-192c30.857-31.429 48-72.571 48-116.571zM589.143 669.714l-136.571-10.286-156 156.571c-10.286 10.286-24 16-38.857 16s-28.571-5.714-38.857-15.429l-84-83.429c-10.286-10.286-16-24-16-38.286 0-14.857 5.714-28.571 16-38.857l156.571-156.571-10.286-137.143c-11.429 6.857-22.286 14.286-32 24l-192 192c-30.857 31.429-48 72.571-48 116.571s17.143 85.143 48.571 116l84 83.429c30.857 30.857 72 47.429 116 47.429s85.714-17.143 116.571-48.571l190.857-191.429c9.714-9.714 17.143-20.571 24-32zM950.857 621.714c0-10.286-8-18.286-18.286-18.286h-182.857c-10.286 0-18.286 8-18.286 18.286s8 18.286 18.286 18.286h182.857c10.286 0 18.286-8 18.286-18.286zM640 932.571v-182.857c0-10.286-8-18.286-18.286-18.286s-18.286 8-18.286 18.286v182.857c0 10.286 8 18.286 18.286 18.286s18.286-8 18.286-18.286zM872.571 846.286l-146.286-146.286c-4-3.429-8.571-5.143-13.143-5.143s-9.143 1.714-13.143 5.143c-6.857 7.429-6.857 18.857 0 26.286l146.286 146.286c7.429 6.857 18.857 6.857 26.286 0 6.857-7.429 6.857-18.857 0-26.286z\"\n  })), \"Disconnect\"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n    type: \"hidden\",\n    name: \"syncToParentAndSiblings\",\n    value: true\n  })), data.linkedBlogs && data.linkedBlogs.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    className: \"mt-2 pb-2\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h3\", null, \"Other blogs which are linked:\"), data.linkedBlogs.map(function (blog) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"label\", {\n      key: blog.site_name,\n      className: \"postsync-label\"\n    }, blog.site_name);\n  })), data.eligibleSites && data.eligibleSites.length > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    className: \"mt-2 pb-2\"\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h3\", null, \"Create relation with:\"), data.eligibleSites.map(function (site) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"label\", {\n      key: site.site_id,\n      className: \"postsync-label \".concat(!site.can_publish && \"disabled\")\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n      type: \"checkbox\",\n      className: \"postsync-checkbox\",\n      name: \"children[]\",\n      value: site.site_id,\n      defaultChecked: site.checked,\n      disabled: !site.can_publish,\n      onChange: function onChange(e) {\n        return handleCheckboxChange(e, site.site_id);\n      }\n    }), site.site_name, site.checked ? ' | ' : '', site.checked && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Tooltip, {\n      position: \"top\",\n      text: \"Move to trash on child site\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"postsync-deleteBtn \".concat(!site.can_trashrestore && \"disabled\"),\n      onClick: site.can_trashrestore && function (e) {\n        return deleteSite(e, site.site_id, site.child_post_id);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"svg\", {\n      xmlns: \"http://www.w3.org/2000/svg\",\n      width: \"16\",\n      height: \"16\",\n      fill: site.can_trashrestore ? \"red\" : \"gray\",\n      viewBox: \"0 0 16 16\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"path\", {\n      d: \"M2 4v12h12V4H2zm3.333 9.333a0.667 0.667 0 0 1 -1.333 0V6.667a0.667 0.667 0 0 1 1.333 0v6.667zm3.333 0a0.667 0.667 0 0 1 -1.333 0V6.667a0.667 0.667 0 0 1 1.333 0v6.667zm3.333 0a0.667 0.667 0 0 1 -1.333 0V6.667a0.667 0.667 0 0 1 1.333 0v6.667zm2.667 -12v1.333H1.333V1.333h3.807c0.6 0 1.087 -0.733 1.087 -1.333h3.543c0 0.601 0.487 1.333 1.087 1.333H14.667z\"\n    })))));\n  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n    type: \"hidden\",\n    name: \"overwriteDuplicateSlugs\",\n    value: state.overwriteSiteIds ? state.overwriteSiteIds.join(',') : ''\n  })), isSlugModalOpen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Modal, {\n    title: \"Duplicate Slug\",\n    onRequestClose: closeSlugModal\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"p\", {\n    style: {\n      marginBottom: '20px'\n    }\n  }, \"If the blog contains a post with the same slug, do you wish to overwrite that post?\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    style: {\n      display: 'flex',\n      justifyContent: 'space-between',\n      width: '100px'\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {\n    isPrimary: true,\n    onClick: confirmOverWriteSlug\n  }, \"Yes\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {\n    isSecondary: true,\n    onClick: closeSlugModal\n  }, \"No\"))), isDeleteModalOpen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Modal, {\n    title: \"Delete Confirmation\",\n    onRequestClose: closeDeleteModal\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"p\", {\n    style: {\n      marginBottom: '20px'\n    }\n  }, \"Are you sure you want to delete this post from the child blog?\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    style: {\n      display: 'flex',\n      justifyContent: 'space-between',\n      width: '100px'\n    }\n  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {\n    isPrimary: true,\n    onClick: confirmDeleteSite\n  }, \"Yes\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, {\n    isSecondary: true,\n    onClick: closeDeleteModal\n  }, \"No\"))));\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MetaBoxContent);\n\n//# sourceURL=webpack://post-sync/./assets/src/js/admin/metabox/MetaboxContent.jsx?");

/***/ }),

/***/ "./assets/src/js/admin/postsync.jsx":
/*!******************************************!*\
  !*** ./assets/src/js/admin/postsync.jsx ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _metabox_Metabox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./metabox/Metabox */ \"./assets/src/js/admin/metabox/Metabox.jsx\");\n/* harmony import */ var _scss_admin_metabox_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/scss/admin/metabox.scss */ \"./assets/src/scss/admin/metabox.scss\");\n\n\n\n\n// When the DOM is loaded, render the Metabox component\ndocument.addEventListener('DOMContentLoaded', function (event) {\n  var metaboxContainer = document.getElementById('postsync-metabox-content');\n  if (metaboxContainer) {\n    react_dom__WEBPACK_IMPORTED_MODULE_0___default().render( /*#__PURE__*/React.createElement(_metabox_Metabox__WEBPACK_IMPORTED_MODULE_1__[\"default\"], null), metaboxContainer);\n  }\n});\n\n//# sourceURL=webpack://post-sync/./assets/src/js/admin/postsync.jsx?");

/***/ }),

/***/ "./assets/src/scss/admin/metabox.scss":
/*!********************************************!*\
  !*** ./assets/src/scss/admin/metabox.scss ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://post-sync/./assets/src/scss/admin/metabox.scss?");

/***/ }),

/***/ "react":
/*!************************!*\
  !*** external "React" ***!
  \************************/
/***/ ((module) => {

module.exports = window["React"];

/***/ }),

/***/ "react-dom":
/*!***************************!*\
  !*** external "ReactDOM" ***!
  \***************************/
/***/ ((module) => {

module.exports = window["ReactDOM"];

/***/ }),

/***/ "@wordpress/components":
/*!************************************!*\
  !*** external ["wp","components"] ***!
  \************************************/
/***/ ((module) => {

module.exports = window["wp"]["components"];

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval devtool is used.
/******/ 	var __webpack_exports__ = __webpack_require__("./assets/src/js/admin/postsync.jsx");
/******/ 	
/******/ })()
;